PdhValidatePathExW function (pdh.h)
Validates that the specified counter is present on the computer or in the log file.
PDH_FUNCTION PdhValidatePathExW(
[in, optional] PDH_HLOG hDataSource,
[in] LPCWSTR szFullPathBuffer
);
[in, optional] hDataSource
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).
[in] szFullPathBuffer
Null-terminated string that specifies the counter path to validate. The maximum length of a counter path is PDH_MAX_COUNTER_PATH.
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 code | Description |
---|---|
|
The specified instance of the performance object was not found. |
|
The specified counter was not found in the performance object. |
|
The specified performance object was not found on the computer or in the log file. |
|
The specified computer could not be found or connected to. |
|
The counter path string could not be parsed. |
|
The function is unable to allocate a required temporary buffer. |
Note
The pdh.h header defines PdhValidatePathEx as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | pdh.h |
Library | Pdh.lib |
DLL | Pdh.dll |