#33912 [Com]: Crash when trying to access registry using com
ID: 33912 Comment by: dana dot mica at xnet dot ro Reported By: awsewell at catawba dot edu Status: No Feedback Bug Type: COM related Operating System: Windows XP PHP Version: 5CVS-2005-07-29 Assigned To: wez New Comment: Hello everyone. But be, as you have been, my happiness. Help me! Please help find sites for: Iron core electric tempe. I found only this - a href=http://indipendentifiorenzuola.it/Members/ElectricIron;general electric travel iron/a. Electric iron, never easily is coke the most extended tritium front, it also has the precautions of being still privy and regular to produce art of. Electric iron, total entertainments fully over the occasion determine the abuse and maker of composting and using route volts. Thanks for the help :-), Dymphna from Islands. Previous Comments: [2006-12-17 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-12-09 11:01:49] rricha...@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip Does it still crash? use following script for correct output. See inline comments for changes: ?php define('HKEY_LOCAL_MACHINE',0x8002); /* passing VT_ARRAY arg - see bug #39596 */ $keys = new VARIANT(array()); $hostname = .; $keyPath = SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall; $wshShell = new COM(winmgmts:{impersonationLevel=impersonate}//{$hostname}/root/default:StdRegProv); $wshShell-EnumKey(HKEY_LOCAL_MACHINE, $keyPath, $keys); /* COM in PHP 5 does not use the value property like in PHP 4 so use $keys directly */ foreach($keys as $key){ print $key\n; } ? [2005-08-02 15:29:06] terrafrost at gmail dot com Doesn't seem to work on the latest beta of PHP5, but it works on PHP4... ?php define('HKEY_LOCAL_MACHINE',0x8002); $keys = new VARIANT('', VT_ARRAY); $hostname = .; $keyPath = SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall; $wshShell = new COM(winmgmts:{impersonationLevel=impersonate}//{$hostname}/root/default:StdRegProv); $wshShell-EnumKey(HKEY_LOCAL_MACHINE, $keyPath, $keys); $keys = $keys-value; foreach($keys as $key){ print $key\n; } ? [2005-08-02 00:49:14] terrafrost at gmail dot com EnumKey's first variable isn't supposed to be a string - it's supposed to be an int. The number representing HKEY_LOCAL_MACHINE is 0x8002. Check out the following link for more information: http://msdn.microsoft.com/library/en-us/wmisdk/wmi/enumkey_method_in_class_stdregprov.asp That said, even when HKEY_LOCAL_MACHINE is replaced with 0x8002 in awsewell's code, the code still doesn't work as it should. The problem would seem to be due to arrays not being passed by reference. I say that because in vBScript, they do seem to be (just check out the examples in the link I provided). [2005-07-28 23:41:02] awsewell at catawba dot edu I tried the latest version via the link provided and get the same results. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33912 -- Edit this bug report at http://bugs.php.net/?id=33912edit=1
#33912 [Com]: Crash when trying to access registry using com
ID: 33912 Comment by: terrafrost at gmail dot com Reported By: awsewell at catawba dot edu Status: Assigned Bug Type: COM related Operating System: Windows XP PHP Version: 5CVS-2005-07-29 Assigned To: wez New Comment: Doesn't seem to work on the latest beta of PHP5, but it works on PHP4... ?php define('HKEY_LOCAL_MACHINE',0x8002); $keys = new VARIANT('', VT_ARRAY); $hostname = .; $keyPath = SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall; $wshShell = new COM(winmgmts:{impersonationLevel=impersonate}//{$hostname}/root/default:StdRegProv); $wshShell-EnumKey(HKEY_LOCAL_MACHINE, $keyPath, $keys); $keys = $keys-value; foreach($keys as $key){ print $key\n; } ? Previous Comments: [2005-08-02 00:49:14] terrafrost at gmail dot com EnumKey's first variable isn't supposed to be a string - it's supposed to be an int. The number representing HKEY_LOCAL_MACHINE is 0x8002. Check out the following link for more information: http://msdn.microsoft.com/library/en-us/wmisdk/wmi/enumkey_method_in_class_stdregprov.asp That said, even when HKEY_LOCAL_MACHINE is replaced with 0x8002 in awsewell's code, the code still doesn't work as it should. The problem would seem to be due to arrays not being passed by reference. I say that because in vBScript, they do seem to be (just check out the examples in the link I provided). [2005-07-28 23:41:02] awsewell at catawba dot edu I tried the latest version via the link provided and get the same results. [2005-07-28 23:34:47] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip [2005-07-28 23:30:55] awsewell at catawba dot edu Description: When trying to use php 5.04 to access the registry with the code below PHP crashes. Reproduce code: --- ?php $hostname = .; $keyPath = \SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall; $wshShell = new COM(winmgmts:{impersonationLevel=impersonate}//{$hostname}/root/default:StdRegProv); $wshShell-EnumKey(HKEY_LOCAL_MACHINE, $keyPath, $keys); foreach($keys as $key){ print $key; } unset($wshShell); ? Expected result: I execpt to see the list of subkeys from the registry. Actual result: -- PHP crashes with only CLI has encountered a problem and needs to close. We are sorry for the inconvenience. -- Edit this bug report at http://bugs.php.net/?id=33912edit=1
#33912 [Com]: Crash when trying to access registry using com
ID: 33912 Comment by: terrafrost at gmail dot com Reported By: awsewell at catawba dot edu Status: Assigned Bug Type: COM related Operating System: Windows XP PHP Version: 5CVS-2005-07-29 Assigned To: wez New Comment: EnumKey's first variable isn't supposed to be a string - it's supposed to be an int. The number representing HKEY_LOCAL_MACHINE is 0x8002. Check out the following link for more information: http://msdn.microsoft.com/library/en-us/wmisdk/wmi/enumkey_method_in_class_stdregprov.asp That said, even when HKEY_LOCAL_MACHINE is replaced with 0x8002 in awsewell's code, the code still doesn't work as it should. The problem would seem to be due to arrays not being passed by reference. I say that because in vBScript, they do seem to be (just check out the examples in the link I provided). Previous Comments: [2005-07-28 23:41:02] awsewell at catawba dot edu I tried the latest version via the link provided and get the same results. [2005-07-28 23:34:47] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip [2005-07-28 23:30:55] awsewell at catawba dot edu Description: When trying to use php 5.04 to access the registry with the code below PHP crashes. Reproduce code: --- ?php $hostname = .; $keyPath = \SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall; $wshShell = new COM(winmgmts:{impersonationLevel=impersonate}//{$hostname}/root/default:StdRegProv); $wshShell-EnumKey(HKEY_LOCAL_MACHINE, $keyPath, $keys); foreach($keys as $key){ print $key; } unset($wshShell); ? Expected result: I execpt to see the list of subkeys from the registry. Actual result: -- PHP crashes with only CLI has encountered a problem and needs to close. We are sorry for the inconvenience. -- Edit this bug report at http://bugs.php.net/?id=33912edit=1