ID:               36588
 User updated by:  e dot vandeoudeweetering at marcanti dot esprit-sg dot
 Reported By:      e dot vandeoudeweetering at marcanti dot esprit-sg dot
 Status:           Open
 Bug Type:         COM related
 Operating System: Windows 2000 (5.00.2195) SP4
 PHP Version:      5.1.2
 New Comment:

Please mark this request as BOGUS!

Wrap the variable into a variant object, then make the function call:

$com_reg = new
COM("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdR
egProv");
$value = new VARIANT();
$com_reg -> getStringValue('subtree', "key\\subkey", 'entryName',
$value);
print $value;

see:
http://bugs.php.net/bug.php?id=16567
http://www.php.net/variant


Previous Comments:
------------------------------------------------------------------------

[2006-03-02 11:44:46] e dot vandeoudeweetering at marcanti dot
esprit-sg dot 

Description:
------------
When COM is used to retrieve an out parameters value in a function
call, the value remains empty.

See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/getstringvalue_method_in_class_stdregprov.asp

Reproduce code:
---------------
$com_reg = new
COM("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv");
$value = 'old_value';
$com_reg -> getStringValue('subtree', "key\\subkey", 'entryName',
$value);
print $value;

Expected result:
----------------
The value from the registry key 'subtree\key\subkey\entryName' should
be printed.

Actual result:
--------------
The value 'old_value' that is declared earlier in the code is printed.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36588&edit=1

Reply via email to