Creates a full counter path using the members specified in the PDH_COUNTER_PATH_ELEMENTS structure.
PDH_FUNCTION PdhMakeCounterPathA( PPDH_COUNTER_PATH_ELEMENTS_A pCounterPathElements, LPSTR szFullPathBuffer, LPDWORD pcchBufferSize, DWORD dwFlags );
A PDH_COUNTER_PATH_ELEMENTS structure that contains the members used to make up the path. Only the szObjectName and szCounterName members are required, the others are optional.
If the instance name member is NULL, the path will not contain an instance reference and the szParentInstance and dwInstanceIndex members will be ignored.
Caller-allocated buffer that receives a null-terminated counter path. The maximum length of a counter path is PDH_MAX_COUNTER_PATH. Set to NULL if pcchBufferSize is zero.
Size of the szFullPathBuffer buffer, in TCHARs. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.
Format of the input and output counter values. You can specify one of the following values.
If the function succeeds, it returns ERROR_SUCCESS.
||The szFullPathBuffer buffer is too small to contain the counter name. This return value is expected if pcchBufferSize is zero on input. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.|
||A parameter is not valid or is incorrectly formatted. For example, on some releases you could receive this error if the specified size on input is greater than zero but less than the required size.|
You should call this function twice, the first time to get the required buffer size (set szFullPathBuffer to NULL and pcchBufferSize to 0), and the second time to get the data.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|