Win32::API, please help

From: Reinhard Pagitsch (reinhard.pagitsch_at_isis-papyrus.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 09:02:48 +0200

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; or
my $PDH_COUNTER = " " x 80;

Thank you,
Reinhard

-- 
QA
ISIS Information Systems
Austria tel: (+43) 2236 27551 150  Fax: 2236 21081
Visit our web site http://www.isis-papyrus.com