summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_dotnet.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-02-21 01:11:11 +0000
committerStanislav Malyshev <stas@php.net>2007-02-21 01:11:11 +0000
commita72041406b293254c54f2f13f916622f2e8d4ed0 (patch)
treeccc5f9686de2978542bcd1770ed5e22b1e0e4706 /ext/com_dotnet/com_dotnet.c
parent47e06ea8217d873e0228f2bacb5e2f25db199693 (diff)
downloadphp-git-a72041406b293254c54f2f13f916622f2e8d4ed0.tar.gz
CreateInstance requires BSTR (should fix #33188)
Diffstat (limited to 'ext/com_dotnet/com_dotnet.c')
-rw-r--r--ext/com_dotnet/com_dotnet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index 33a73bc2d9..8660daf4c5 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -188,6 +188,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
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 @@ PHP_FUNCTION(com_dotnet_create_instance)
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;