Platform SDK: Performance Monitoring |
The PdhEnumMachines function returns a list of the names of the machines that have been opened previously by the PDH DLL. The machines listed include those that are currently connected and online, as well as those that are offline or not returning performance data. For information about how to connect to a machine, see PdhConnectMachine.
PDH_STATUS PdhEnumMachines( LPCTSTR szDataSource, LPTSTR mszMachineNameList, LPDWORD pcchBufferLength );
Windows NT 4.0: [in] 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_MORE_DATA | More data is available then the current buffer can hold. Some entries may be returned in the mszMachinenameList buffer. |
PDH_INSUFFICIENT_BUFFER | The buffer provided is not large enough to contain any data. |
PDH_INVALID_ARGUMENT | A required argument is invalid or a reserved argument is not NULL. |
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.