stas Wed Feb 21 01:11:12 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/com_dotnet com_dotnet.c
Log:
CreateInstance requires BSTR (should fix #33188)
http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_dotnet.c?r1=1.14.2.1.2.3&r2=1.14.2.1.2.4&diff_format=u
Index: php-src/ext/com_dotnet/com_dotnet.c
diff -u php-src/ext/com_dotnet/com_dotnet.c:1.14.2.1.2.3
php-src/ext/com_dotnet/com_dotnet.c:1.14.2.1.2.4
--- php-src/ext/com_dotnet/com_dotnet.c:1.14.2.1.2.3 Tue Feb 20 20:30:36 2007
+++ php-src/ext/com_dotnet/com_dotnet.c Wed Feb 21 01:11:11 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_dotnet.c,v 1.14.2.1.2.3 2007/02/20 20:30:36 stas Exp $ */
+/* $Id: com_dotnet.c,v 1.14.2.1.2.4 2007/02/21 01:11:11 stas Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -188,6 +188,7 @@
int assembly_name_len, datatype_name_len;
struct dotnet_runtime_stuff *stuff;
OLECHAR *oleassembly, *oletype;
+ BSTR oleassembly_sys, oletype_sys;
HRESULT hr;
int ret = FAILURE;
char *where = "";
@@ -223,10 +224,14 @@
oletype = php_com_string_to_olestring(datatype_name, datatype_name_len,
obj->code_page TSRMLS_CC);
oleassembly = php_com_string_to_olestring(assembly_name,
assembly_name_len, obj->code_page TSRMLS_CC);
+ oletype_sys = SysAllocString(oletype);
+ oleassembly_sys = SysAllocString(oleassembly);
where = "CreateInstance";
- hr = stuff->dotnet_domain->lpVtbl->CreateInstance(stuff->dotnet_domain,
oleassembly, oletype, &unk);
+ hr = stuff->dotnet_domain->lpVtbl->CreateInstance(stuff->dotnet_domain,
oleassembly_sys, oletype_sys, &unk);
efree(oletype);
efree(oleassembly);
+ SysFreeString(oletype_sys);
+ SysFreeString(oleassembly_sys);
if (SUCCEEDED(hr)) {
VARIANT unwrapped;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php