Win32::API, please help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Does anyone has expirence with this modul?
I want to write a simple module which uses the PDH library (performance
data helper library). But if I try to use
PDH_STATUS PdhAddCounter(PDH_HQUERY hQuery,LPCTSTR szFullCounterPath,
DWORD_PTR dwUserData,PDH_HCOUNTER* phCounter);
the return status is always -1073738820, and I can not find the code in
the MSDN.

The declaration of the function is
my $call = new Win32::API('pdh', 'PdhAddCounter', 'NPPP','N');
Is this correct?

The call of the function is
my $pdhStatus=$call->Call($PDH_QUERY,$cname,0,$PDH_COUNTER);

$PDH_QUERY I get from the PdhOpenQuery function which is a valid handle
I think.
The call to PdhOpenQuery returns 0 which is ERROR_SUCCES, I belive?
ERROR_SUCCES is definded in the PDH.h as 0L.

$PDH_COUNTER i had defined as
my $PDH_COUNTER =  " " x 80;

Thank you,

ISIS Information Systems
Austria tel: (+43) 2236 27551 150  Fax: 2236 21081
Visit our web site

Site Timeline