From: Wez Furlong Date: Fri, 28 Nov 2003 17:11:16 +0000 (+0000) Subject: Fix #25664 - COM crashes when calling a Delphi implementations of ITypeInfo. X-Git-Tag: php-5.0.0b3RC1~559 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cab6d93bddffe536076f630fbd377b89e9f46566;p=php Fix #25664 - COM crashes when calling a Delphi implementations of ITypeInfo. Problem was that our extension assumes that the first param to ITypeInfo::Invoke was a reference to the COM object; this is not necessarily true and caused a crash in this instance. Problem solved by removing the ITypeInfo::Invoke call, as it doesn't buy us anything anyway. --- diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index b2465f82bd..5484161712 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -290,21 +290,8 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, unsigned int arg_err; EXCEPINFO e; - if (obj->typeinfo) { - hr = ITypeInfo_Invoke(obj->typeinfo, V_DISPATCH(&obj->v), id_member, flags, disp_params, v, &e, &arg_err); - if (FAILED(hr) && (hr != DISP_E_EXCEPTION)) { - hr = IDispatch_Invoke(V_DISPATCH(&obj->v), id_member, - &IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, &e, &arg_err); - if (SUCCEEDED(hr)) { - /* fall back on using IDispatch directly */ - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - } - } else { - hr = IDispatch_Invoke(V_DISPATCH(&obj->v), id_member, - &IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, &e, &arg_err); - } + hr = IDispatch_Invoke(V_DISPATCH(&obj->v), id_member, + &IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, &e, &arg_err); if (FAILED(hr)) { char *source = NULL, *desc = NULL, *msg = NULL;