#31737 [Opn->Fbk]: COM crash when calling WinMgmts
| From: | derick@php.net | Date: | Fri, 28 Jan 2005 08:04:28 +0000 |
| Subject: | #31737 [Opn->Fbk]: COM crash when calling WinMgmts | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72969@lists.php.net to get a copy of this message | ||
ID: 31737
Updated by: derick@php.net
Reported By: jlim at natsoft dot com
-Status: Open
+Status: Feedback
Bug Type: COM related
Operating System: Windows XP
PHP Version: 4.3.10
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-01-28 08:44:54] jlim at natsoft dot com
Description:
------------
Previously the following script to monitor CPU usage on Windows was
working with PHP 4.3.8.
The following script also fails with PHP 5.0.3.
Thanks for looking into it. John Lim.
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
$c = new
COM("WinMgmts:{impersonationLevel=impersonate}!Win32_PerfRawData_PerfOS_Processor.Name='_Total'");
if (!$c) return false;
$info[0] = $c->PercentProcessorTime;
$info[1] = $c->TimeStamp_Sys100NS;
print_r($info);
?>
Expected result:
----------------
TESTED ON PHP 4.3.8 works fine:
C:\php4\php438>php -n c:\com.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
Array
(
[0] => 363738299988;
[1] => 127513714771937472
)
Actual result:
--------------
Crash with no output and windows crash manager dialog box appears.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31737&edit=1