From:             bmiller dot qw at gmail dot com
Operating system: Windows
PHP version:      5.4.11
Package:          COM related
Bug Type:         Bug
Bug description:COM obj parameters passed by reference are not updated

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.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64130&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64130&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64130&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64130&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64130&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64130&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64130&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64130&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64130&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64130&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64130&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64130&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64130&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64130&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64130&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64130&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64130&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64130&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64130&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64130&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64130&r=mysqlcfg

Reply via email to