WinUsb_GetCurrentFrameNumberAndQpc function (winusb.h)

The WinUsb_GetCurrentFrameNumberAndQpc function retrieves the system query performance counter (QPC) value synchronized with the frame and microframe.

Syntax

BOOL WinUsb_GetCurrentFrameNumberAndQpc(
  [in] WINUSB_INTERFACE_HANDLE                             InterfaceHandle,
  [in] PUSB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION FrameQpcInfo
);

Parameters

[in] InterfaceHandle

An opaque handle retrieved in the previous call to WinUsb_Initialize.

[in] FrameQpcInfo

A pointer to a USB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION structure. On output, CurrentQueryPerformanceCounter set to the system QPC value (in microseconds) predicted by the USB driver stack. Optionally, on input, the caller can specify a frame and microframe number for which to retrieve the QPC value.

On output, the QueryPerformanceCounterAtInputFrameOrMicroFrame member is set to the QPC value for that frame or microframe.

Return value

WinUsb_GetCurrentFrameNumberAndQpc returns TRUE if the operation succeeds. Otherwise, this routine returns FALSE, and the caller can retrieve the logged error by calling GetLastError.

GetLastError can return one of the following error codes.

Return code Description
ERROR_INVALID_HANDLE
The caller passed NULL in the InterfaceHandle or FrameQpcInfo parameter.

Requirements

Requirement Value
Minimum supported client Windows 10
Minimum supported server Windows Server 2016
Target Platform Universal
Header winusb.h (include Winusb.h)
Library Winusb.lib
DLL Winusb.dll

See also

WinUSB

WinUSB Functions

WinUsb_Initialize

WinUsb_StartTrackingForTimeSync