PdhValidatePath fails with PDH_CSTATUS_NO_OBJECT but PdhGetFormattedCounterValue finds the counter fine? RRS feed

  • Question

  • When calling PdhValidatePath it returns PDH_CSTATUS_NO_OBJECT or other bad CSTATUS's for certain counters on a given host.
    But when calling PdhAddCounter + PdhCollectQueryData + PdhGetFormattedCounterValue We not only see the counter exist but it returns values.
    What is wrong with the PdhValidatePath function that it fails sometimes with certain counters i only see this so far with my MSSQL$SQL2 counters.

    Failed counters: \\<SERVER_NAME>\MSSQL$SQL2:Memory Manager\Optimizer Memory (KB)
    Passed Counter: \\<SERVER_NAME>\Memory\Pages Output/sec

    -Windows Server Enterprise 2008 x64 Edition with SP2 (Version 6.0.6002)
    -Windows Server Standard 2008 x64 Edition with SP2 (Version 6.0.6002)
    -PDH.dll  version: 6.0.6002.18005

    Wednesday, April 27, 2011 7:21 PM

All replies