Platform SDK: Performance Monitoring |
The PdhGetDefaultPerfObject function retrieves the name of the default performance object. This name can be used to select the default entry in the object browser list box.
PDH_STATUS PdhGetDefaultPerfObject( LPCTSTR szDataSource, LPCTSTR szMachineName, LPTSTR szDefaultObjectName, LPDWORD pcchBufferSize );
Windows NT 4.0: Reserved. Must be NULL.
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 provided is not large enough for the available data. |
PDH_INVALID_ARGUMENT | A required argument is invalid or a reserved argument is not NULL. |
PDH_MEMORY_ALLOCATION_FAILURE | A required temporary buffer could not be allocated. |
PDH_CSTATUS_NO_MACHINE | The specified machine is offline or unavailable. |
PDH_CSTATUS_NO_COUNTERNAME | The default object name cannot be read or found. |
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.