Platform SDK: Performance Monitoring |
The PdhCollectQueryData function collects the current raw data value for all counters in the specified query and updates the status code of each counter.
[C++] PDH_STATUS PdhCollectQueryData( HQUERY hQuery ); [Visual Basic] PdhCollectQueryData( ByVal QueryHandle as Long ) as Long
If the function succeeds, it returns ERROR_SUCCESS. Otherwise, the function returns a PDH error value.
The following are possible PDH error values.
Error value | Description |
---|---|
PDH_INVALID_HANDLE | The query handle is not valid. |
PDH_NO_DATA | The query does not currently have any counters. |
[C++] PDH error values are defined in PDHMsg.h.
[Visual Basic] PDH error values are defined in PDHDefs.txt.
The PdhCollectQueryData function can succeed, but may not have collected data for all counters. Always check the status code of each counter in the query before using the data.
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Pdh.h (C/C++).
Library: Use Pdh.lib.