Platform SDK: Performance Monitoring |
The PdhValidatePath function validates that the specified counter is present on the machine specified in the counter path.
PDH_STATUS PdhValidatePath( LPCTSTR szFullCounterPath );
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, the return value is a PDH error status defined in PDHMsg.h. The following are possible error values.
Error value | Description |
---|---|
PDH_CSTATUS_NO_INSTANCE | The specified instance of the performance object was not found. |
PDH_CSTATUS_NO_COUNTER | The specified counter was not found in the performance object. |
PDH_CSTATUS_NO_OBJECT | The specified performance object was not found on the machine. |
PDH_CSTATUS_NO_MACHINE | The specified machine could not be found or connected to. |
PDH_CSTATUS_BAD_COUNTERNAME | The counter path string could not be parsed. |
PDH_MEMORY_ALLOCATION_FAILURE | The function is unable to allocate a required temporary buffer. |
PdhValidatePath verifies the specified counter path in this order: machine, performance object, instance, and counter.
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.