Platform SDK: Performance Monitoring |
The PdhGetDataSourceTimeRange function determines the time range, number of entries and, if applicable, the size of the buffer containing the performance data from the specified input source.
PDH_STATUS PdhGetDataSourceTimeRange( LPCTSTR szDataSource, LPDWORD pdwNumEntries, PPDH_TIME_INFO pInfo, LPDWORD dwBufferSize );
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_ARGUMENT | An argument is not correct or is incorrectly formatted. |
PDH_INVALID_HANDLE | The counter handle is not valid. |
The following are possible non-error return values.
Value | Description |
---|---|
PDH_DATA_SOURCE_IS_REAL_TIME | The current data source is a real-time data source. |
If the current data source is a real-time data source, a PDH_DATA_SOURCE_IS_REAL_TIME value is returned and no action is performed by this function.
The SampleCount member of the PDH_TIME_INFO structure, which the pInfo parameter points to, contains the number of samples collected during the time interval.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows 2000.