From:             radek at pinkbike dot com
Operating system: Windows XP
PHP version:      5CVS-2004-08-19 (dev)
PHP Bug Type:     COM related
Bug description:  Fatal error on COM registry read.

Description:
------------
Fatal error using the 'WScript.Shell' COM when accessing the registry on
WIndows XP.  Tried  5.0 RC3, 5.0, and latest  Apache/1.3.31 (Win32)
PHP/5.0.2-dev with same results.

Reproduce code:
---------------
This works correctly (reading a valid registry entry)

  $shell= &new COM('WScript.Shell');
  $data=$shell->regRead('HKEY_CURRENT_USER\Environment\TEMP');

The following causes a fatal error if the registry key does not exist

  $shell= &new COM('WScript.Shell');
  $data=$shell->regRead('HKEY_CURRENT_USER\Environment\TEMP11111');

This used to work correctly in 4.x versions of PHP.

Expected result:
----------------
Not to get a fatal error but a NULL if a registry entery does not exist.

Actual result:
--------------
Fatal error: Uncaught exception 'com_exception' with message 'Source:
WshShell.RegRead
Description: Unable to open registry key
"HKEY_CURRENT_USER\Environment\TEMP11111" for reading.' in
f:\web\test.php:3 Stack trace: #0 {main} thrown in f:\web\test.php on line
3

-- 
Edit bug report at http://bugs.php.net/?id=29747&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29747&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29747&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29747&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29747&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29747&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29747&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29747&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29747&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29747&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29747&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29747&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29747&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29747&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29747&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29747&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29747&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29747&r=float

Reply via email to