|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp-com-dotnet-itypeinfo-fix (last revision 2013-02-01 19:16 UTC by bmiller dot qw at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-08-26 12:44 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: cmb
[2020-08-26 12:58 UTC] cmb@php.net
[2020-08-26 12:58 UTC] cmb@php.net
-Status: Verified
+Status: Closed
[2020-11-07 17:34 UTC] fherrero at noticiasdenavarra dot com
[2020-11-07 18:01 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ I found that COM ByRef parameters where still being treated as ByVal parameters - only for "out of process" com objects. I debugged the COM extension (or COM_DOTNET) and found that in function; php_com_get_id_of_name() (in com_com.c) was calling "hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid);" to get the com object dispatch id from the member name. For out of process objects this will always return E_NOTIMPL. Thus the iTypeInfo object (obj->typeinfo) would be destroyed. The final result would be that ByRef parameters would NOT be detected. Easy fix; Just ALWAYS use the IDispatch_GetIDsOfNames and only use iTypeInfo for the ITypeInfo_GetTypeComp call - which is what we need. Test script: --------------- //(need MS word) or any app that has a COM interface $word = new COM("word.application") or die("Unable to instantiate Word"); $word->Visible = 1; /* In the com_com.c, place a breakpoint at: hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid); It will always return E_NOTIMPL then the code deletes obj->typeinfo which ultimately causes the problem */ Expected result: ---------------- If the com object function call used references then the variable would be changed. Sorry I couldn't find a public COM object off hand that passed variables by reference.