PdhValidatePathEx function

Validates that the specified counter is present on the computer or in the log file.

Syntax


PDH_STATUS PdhValidatePathEx(
  _In_opt_ PDH_HLOG hDataSource,
  _In_     LPCTSTR  szFullPathBuffer
);

Parameters

hDataSource [in, optional]

Handle to the data source. The PdhOpenLog and PdhBindInputDataSource functions return this handle.

To validate that the counter is present on the local computer, specify NULL (this is the same as calling PdhValidatePath).

szFullPathBuffer [in]

Null-terminated string that specifies the counter path to validate. The maximum length of a counter path is PDH_MAX_COUNTER_PATH.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code. The following are possible values.

Return codeDescription
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 computer or in the log file.

PDH_CSTATUS_NO_MACHINE

The specified computer 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.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Pdh.h

Library

Pdh.lib

DLL

Pdh.dll

Unicode and ANSI names

PdhValidatePathExW (Unicode) and PdhValidatePathExA (ANSI)

See also

PdhMakeCounterPath
PdhValidatePath

 

 

Show: