PdhParseCounterPath
The PdhParseCounterPath
function parses the elements of the counter path and stores the results in the
structure passed by the caller.
PDH_STATUS PdhParseCounterPath(
IN LPCTSTR szFullPathBuffer, |
// path string
buffer |
IN PDH_COUNTER_PATH_ELEMENTS *pCounterPathElements, |
// counter path
elements |
IN LPDWORD pdwBufferSize, |
// size of buffer |
IN DWORD dwFlags |
// reserved |
); |
|
Parameters
szFullPathBuffer
The buffer
containing the counter path to parse into individual components.
pCounterPathElements
A pointer to
a PDH_COUNTER_PATH_ELEMENTS
pdwBufferSize
A pointer to
the DWORD containing the size, in bytes, of the buffer referenced by pCounterPathElements
and returns with the size of the buffer used. If the buffer size on entry is
zero, then no data is returned in the pCounterPathElements buffer,
however, the size of the buffer required is returned in the DWORD referenced
by this pointer.
dwFlags
Reserved.
Must be zero.
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:
PDH_INVALID_ARGUMENT
An argument
is incorrect, or this function does not have the necessary access to that
argument.
PDH_INSUFFICIENT_BUFFER
The buffer
supplied is not large enough to accept the resulting data.
PDH_INVALID_PATH
The path is
not formatted correctly and cannot be parsed.
PDH_MEMORY_ALLOCATION_FAILURE
A temporary
buffer cannot be allocated.
See Also