Re: PHP_ProcessWatcher

From: Date: Fri, 07 Nov 2003 12:05:56 +0000
Subject: Re: PHP_ProcessWatcher
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23331@lists.php.net to get a copy of this message
Hi Dave Mertens, you wrote: > Windows users have the w32api interface. Using the windows api it's > possible to determine whether a process is still runing. Currently > i've lost the name of the api , but i remember i needed two of > them. One to get the ProcessID of a running process, and one to > determine the process status (running, cpu time, memory usage, > etc). Yeah, I spent some hours on that issue but didn't succeed yet... The api has completely changed, and the manual is out of date in this concern, but there is: http://wobster.mynnga.de/w32api.txt Though I didn't figure out how to declare an array as complex type. $api = new Win32; $api->RegisterFunction('bool EnumProcesses (array &processes, int b, int &c) From psapi.dll'); "array" is undefined and "int[n]" doesn't work either, so... $api = new Win32; $api->DefineType('array { int p1; int p2; ... }'); $p = $api->InitType('array'); $api->RegisterFunction(...); $api->EnumProcesses($p, (int), $c); var_dump($p) outputs sth similar: object (type) (1) { [0] => resource (1) of type (Type Instance) } And if you set "(int)" to sth higher than 3 PHP dies... Just weird... :-( Regards, -- Michael - < mike(@)php.net >

Attachment: [application/pgp-signature]
« previous php.pear.dev (#23331) next »