The PdhMakeCounterPath function creates a full counter path using the members specified in the structure passed in the parameter list.
PDH_STATUS PdhMakeCounterPath(
IN PDH_COUNTER_PATH_ELEMENTS *pCounterPathElements,
// counter path elements
IN LPTSTR szFullPathBuffer, // path string buffer
IN LPDWORD pcchBufferSize, // size of buffer
IN DWORD dwFlags // reserved
);
Member | Required or Optional |
---|---|
LPTSTR szMachineName | optional |
LPTSTR szObjectName | required |
LPTSTR szInstanceName | optional |
LPTSTR szParentInstance | optional |
DWORD dwInstanceIndex | optional ((DWORD)–1 if no index) |
LPTSTR szCounterName | required |
If a required member is not present, then no path string will be constructed. If the szMachineName member is NULL, then no machine name will be included in the path (a generic path will be created). If the instance name argument is NULL, then no instance reference will be inserted into the path string and the szParentInstance and the dwInstanceIndex members will be ignored.
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, the return value is a PDH error status defined in pdhmsg.h.
Performance Data Helper Overview, Performance Data Functions, , PDH_COUNTER_PATH_ELEMENTS, PdhParseCounterPath