Platform SDK: Performance Monitoring |
The PdhMakeCounterPath function creates a full counter path using the members specified in the structure passed in the parameter list.
PDH_STATUS PdhMakeCounterPath( PDH_COUNTER_PATH_ELEMENTS *pCounterPathElements, LPTSTR szFullPathBuffer, LPDWORD pcchBufferSize, DWORD dwFlags );
Member | Required or optional |
---|---|
szMachineName | optional |
szObjectName | required |
szInstanceName | optional |
szParentInstance | optional |
dwInstanceIndex | optional ((DWORD)–1 if no index) |
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.
Value | Description |
---|---|
PDH_PATH_WBEM_RESULT | Windows 2000: The path is returned as in WMI format. |
PDH_PATH_WBEM_INPUT | Windows 2000: The input is assumed to be in WMI format. |
0 | The path is returned as a list of registry path items. |
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.
Error value | Description |
---|---|
PDH_INSUFFICIENT_BUFFER | The buffer is not large enough to contain any data. |
PDH_INVALID_ARGUMENT | An argument is not correct or is incorrectly formatted. |
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.