PdhCollectQueryData error

Discussion in 'Windows 64bit' started by =?Utf-8?B?QWwgU2FudGlubw==?=, Dec 6, 2005.

  1. 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
     
    =?Utf-8?B?QWwgU2FudGlubw==?=, Dec 6, 2005
    #1
    1. Advertising

  2. 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
     
    =?Utf-8?B?QWwgU2FudGlubw==?=, Dec 6, 2005
    #2
    1. Advertising

  3. RE: PdhCollectQueryData error (Sample program)

    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
     
    =?Utf-8?B?QWwgU2FudGlubw==?=, Dec 7, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWljaGFlbA==?=

    Error using DOS window, ever seen this error?

    =?Utf-8?B?TWljaGFlbA==?=, Apr 15, 2004, in forum: Microsoft Certification
    Replies:
    1
    Views:
    611
    Marlin Munrow
    Apr 15, 2004
  2. =?Utf-8?B?RGF2aWQgRGF5?=

    DNS error or Time Out error following Broadband Upgrade

    =?Utf-8?B?RGF2aWQgRGF5?=, May 4, 2005, in forum: Microsoft Certification
    Replies:
    2
    Views:
    806
    BrainLock
    May 6, 2005
  3. =?Utf-8?B?VGVtcGxlUmluZ2xldHM=?=

    Windows Media Player 10 error "An Internal Application error has o

    =?Utf-8?B?VGVtcGxlUmluZ2xldHM=?=, Jun 27, 2005, in forum: Microsoft Certification
    Replies:
    1
    Views:
    3,183
    Don Carter
    Jun 27, 2005
  4. Ismaiel
    Replies:
    0
    Views:
    6,109
    Ismaiel
    Oct 26, 2004
  5. kanman
    Replies:
    0
    Views:
    5,466
    kanman
    Apr 25, 2009
Loading...

Share This Page