Platform SDK: Performance Monitoring

PdhValidatePath

The PdhValidatePath function validates that the specified counter is present on the machine specified in the counter path.

PDH_STATUS PdhValidatePath(
  LPCTSTR szFullCounterPath  
);

Parameters

szFullCounterPath
[in] A pointer to a null-terminated string containing the counter path to validate.

Return Values

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.

Remarks

PdhValidatePath verifies the specified counter path in this order: machine, performance object, instance, and counter.

Requirements

  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.

See Also

PdhMakeCounterPath