Platform SDK: Performance Monitoring |
The PdhSetQueryTimeRange function specifies the timeframe performance data will be collected for the specified query. This query refers to a log file that has been opened for reading.
PDH_STATUS PdhSetQueryTimeRange( HQUERY hQuery, PPDH_TIME_INFO pInfo );
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 | An invalid handle was specified. |
PDH_INVALID_ARGUMENT | A time earlier than the starting time range value was specified as the ending time range value. |
When the end of the specified time range or the end of the log file is reached, the PdhCollectQueryData function will return PDH_NO_MORE_DATA.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.