php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31737 COM crash when calling WinMgmts
Submitted: 2005-01-28 08:44 UTC Modified: 2005-01-28 11:46 UTC
From: jlim at natsoft dot com Assigned:
Status: Closed Package: COM related
PHP Version: 4.3.10 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jlim at natsoft dot com
New email:
PHP Version: OS:

 

 [2005-01-28 08:44 UTC] 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. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-28 11:46 UTC] jlim at natsoft dot com
Verified fixed with latest snapshot. Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 17:01:34 2024 UTC