PdhGetDataSourceTimeRange
TOC
Collapse the table of content
Expand the table of content

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.

To use handles to data sources, use the PdhGetDataSourceTimeRangeH function.

Syntax


PDH_STATUS PdhGetDataSourceTimeRange(
  _In_  LPCTSTR        szDataSource,
  _Out_ LPDWORD        pdwNumEntries,
  _Out_ PPDH_TIME_INFO pInfo,
  _In_  LPDWORD        pdwBufferSize
);

Parameters

szDataSource [in]

Null-terminated string that specifies the name of a log file from which the time range information is retrieved.

pdwNumEntries [out]

Number of structures in the pInfo buffer. This function collects information for only one time range, so the value is typically 1, or zero if an error occurred.

pInfo [out]

A PDH_TIME_INFO structure that receives the time range.

pdwBufferSize [in]

Size of the PDH_TIME_INFO structure, in bytes.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code. The following are possible values.

Return codeDescription
PDH_INVALID_ARGUMENT

A parameter is not valid or is incorrectly formatted.

PDH_INVALID_HANDLE

The counter handle is not valid.

PDH_DATA_SOURCE_IS_REAL_TIME

The current data source is a real-time data source.

 

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Pdh.h

Library

Pdh.lib

DLL

Pdh.dll

Unicode and ANSI names

PdhGetDataSourceTimeRangeW (Unicode) and PdhGetDataSourceTimeRangeA (ANSI)

See also

PdhGetDataSourceTimeRangeH
PdhSetQueryTimeRange

 

 

Show:
© 2016 Microsoft