Expand Minimize

PdhSetQueryTimeRange function

Limits the samples that you can read from a log file to those within the specified time range, inclusively.

Syntax


PDH_STATUS PdhSetQueryTimeRange(
  _In_  PDH_HQUERY hQuery,
  _In_  PPDH_TIME_INFO pInfo
);

Parameters

hQuery [in]

Handle to the query. The PdhOpenQuery function returns this handle.

pInfo [in]

A PDH_TIME_INFO structure that specifies the time range. Specify the time as local file time. The end time must be greater than the start time. You can specify 0 for the start time and the maximum 64-bit value for the end time if you want to read all records.

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_HANDLE

The query handle is not valid.

PDH_INVALID_ARGUMENT

The ending time range value must be greater than the starting time range value.

 

Remarks

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.

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

See also

PdhCollectQueryData
PdhGetDataSourceTimeRange
PdhOpenQuery

 

 

Community Additions

ADD
Show:
© 2014 Microsoft