Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Windows 64bit > PdhCollectQueryData error

Reply
Thread Tools

PdhCollectQueryData error

 
 
=?Utf-8?B?QWwgU2FudGlubw==?=
Guest
Posts: n/a
 
      12-06-2005
Calls to PdhCollectQueryData on NT, 2K, and XP work fine when running under
standard User credentials. Under XP x64 the call succeeds for Administrators
but fails when running under standard User credentials with the error

PDH_NO_DATA / 0x800007D5 / No data to return.

I'd like to know whether this is by design and whether the user now needs to
have a certain permission to succeed.

Thanks
--
Al
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWwgU2FudGlubw==?=
Guest
Posts: n/a
 
      12-06-2005
I'm following up my previous post with the system configuration:

MSI K8N Neo4
AMD Athlon 64 x2 3800+
XP x64 Build 3790 SP 1 v.1433

--
Al


"Al Santino" wrote:

> Calls to PdhCollectQueryData on NT, 2K, and XP work fine when running under
> standard User credentials. Under XP x64 the call succeeds for Administrators
> but fails when running under standard User credentials with the error
>
> PDH_NO_DATA / 0x800007D5 / No data to return.
>
> I'd like to know whether this is by design and whether the user now needs to
> have a certain permission to succeed.
>
> Thanks
> --
> Al

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWwgU2FudGlubw==?=
Guest
Posts: n/a
 
      12-07-2005
Here's a simple program to demonstrate the problem.

// PdhTest.cpp
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <pdh.h>

// Attempt to access PDH "ID Process" counter
// data for the current process.
// Works for Admin, Users on NT/2K/XP
// Works for Admin but not Users on XP x64

int main(int argc, char* argv[])
{
HQUERY hQuery;
HCOUNTER hCounter;
wchar_t path[MAX_PATH] = {0};
DWORD cbPathSize = sizeof path / sizeof wchar_t;
PDH_COUNTER_PATH_ELEMENTS cpe = {0};
// Next line must match the program name
cpe.szInstanceName = L"PdhTest";
cpe.szCounterName = L"ID Process";

HRESULT hr = PdhOpenQuery(NULL, 0, &hQuery);
if ( hr == ERROR_SUCCESS)
hr = PdhMakeCounterPath(&cpe, path, &cbPathSize, 0 );
if ( hr == ERROR_SUCCESS)
hr = PdhAddCounter(hQuery, path, 0, &hCounter);
if ( hr == ERROR_SUCCESS)
hr = PdhCollectQueryData(hQuery);

// NT, 2K, XP - Admin, Users success
// XP x64 - Admin success; Users 800007d5
printf("hr = %x\n", hr );
return 0;
}

--
Al


"Al Santino" wrote:

> Calls to PdhCollectQueryData on NT, 2K, and XP work fine when running under
> standard User credentials. Under XP x64 the call succeeds for Administrators
> but fails when running under standard User credentials with the error
>
> PDH_NO_DATA / 0x800007D5 / No data to return.
>
> I'd like to know whether this is by design and whether the user now needs to
> have a certain permission to succeed.
>
> Thanks
> --
> Al

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error JavaQueries Java 1 03-01-2005 06:30 PM



Advertisments