ID: 16323
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Closed
Bug Type: COM related
Operating System: Windows 2000 Professional
PHP Version: 4.1.2
New Comment:
this should be fixed in the upcomming 4.2.0 version. try one of the
release candidates.
Previous Comments:
------------------------------------------------------------------------
[2002-03-29 04:52:56] [EMAIL PROTECTED]
I found the same problem with php 4.1.1, if OLE Automation object
return empty string.
After some testing a have this result:
OLE Automation server return Variant with type 0x08 - OLE Str. To
php_OLECHAR_to_char() (in conversion.c)
as unicode_str arrive probably NULL, because WideCharToMultiByte return
0 and
in my simulations WideCharToMultiByte return 0 if unicode_str is NULL.
I thing that, if unicode_str is NULL, php_OLECHAR_to_char()
must convert it to empty string, without any warning.
------------------------------------------------------------------------
[2002-03-27 19:40:04] [EMAIL PROTECTED]
The following example PHP script works fine when run from the command
line, but fails when run via IIS.
<?php
$wsh = @new COM('WScript.Shell') or die("Cannot create instance of
Windows Scripting Host!");
$key = 'HKLM\foo';
$v = $wsh->RegRead($key);
echo "<br> Got $key = $v\n";
$v = $v + 1;
$wsh->RegWrite($key,$v);
echo "<br> Set $key to $v\n";
?>
The error returned references the line containing RegWrite.
----
Got HKLM\foo = 2
Warning: Error in php_OLECHAR_to_char() in
c:\asg\webmanager\test\x4.php on line 7
Warning: Error in php_OLECHAR_to_char() in
c:\asg\webmanager\test\x4.php on line 7
Warning: Invoke() failed: Exception occurred. Source: Description: in
c:\asg\webmanager\test\x4.php on line 7
Set HKLM\foo to 3
----
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16323&edit=1