Platform SDK: Performance Monitoring |
The PdhEnumObjects function returns a list of objects available on the specified machine.
PDH_STATUS PdhEnumObjects( LPCTSTR szDataSource, LPCTSTR szMachineName, LPTSTR mszObjectList, LPDWORD pcchBufferLength, DWORD dwDetailLevel, BOOL bRefresh );
Windows NT 4.0: [in] Reserved. Must be NULL.
Value | Meaning |
---|---|
PERF_DETAIL_NOVICE | Novice user level of detail. |
PERF_DETAIL_ADVANCED | Advanced user level of detail. Includes the novice level of detail. |
PERF_DETAIL_EXPERT | Expert user level of detail. Includes the novice and advanced levels of detail. |
PERF_DETAIL_WIZARD | System designer level of detail. Includes all levels of detail. |
Value | Meaning |
---|---|
TRUE | A new performance data buffer for this machine will be cached before the objects are returned. |
FALSE | A new performance data buffer for this machine will not be cached; the object list will be returned from currently cached performance data buffer. |
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_MORE_DATA | There are more entries available to return than there is room in the buffer. Some entries might be returned in the buffer, however. |
PDH_INSUFFICIENT_BUFFER | The buffer provided is not large enough to contain any data. |
PDH_CSTATUS_NO_MACHINE | The machine is unavailable. |
PDH_CSTATUS_NO_OBJECT | The specified object could not be found on the machine. |
PDH_INVALID_ARGUMENT | A required argument is invalid or a reserved argument is not NULL. |
When you request a required buffer size, the bRefresh flag should be FALSE for all subsequent calls to this function. Otherwise, the size might not be valid.
The term real-time as used in the description of this function does not imply the standard meaning of the term real-time. Instead, it describes the collection of performance data from a source providing current information (for example, the registry or a WMI provider) rather than from a log file.
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.