Platform SDK: Performance Monitoring |
The PdhCollectQueryDataEx function samples the current raw data value for all counters in the specified query according to the specified time interval, and updates the status code of the counter. After the time interval has expired, the specified event is signaled.
PDH_STATUS PdhCollectQueryDataEx( HQUERY hQuery, DWORD dwIntervalTime, HANDLE hNewDataEvent );
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_INVALID_HANDLE | The query handle is not valid. |
PDH_NO_DATA | The query does not currently have any counters. |
This function is designed to return successfully while no data is available. For this reason, check the event specified by the value of hNewDataEvent to ensure that a value exists for all of the counters in the query.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.