Bug #16323 Updated: php_OLECHAR_to_char() error in IIS

From: Date: Fri, 29 Mar 2002 09:52:57 +0000
Subject: Bug #16323 Updated: php_OLECHAR_to_char() error in IIS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-3598@lists.php.net to get a copy of this message
ID: 16323 Updated by: Vladimir.Michl@hlubocky.del.cz Reported By: preston.bannister@cox.net Status: Open Bug Type: COM related Operating System: Windows 2000 Professional PHP Version: 4.1.2 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2002-03-27 19:40:04] preston.bannister@cox.net 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

« previous php.bugs (#3598) next »