WdfUsbTargetDeviceRetrieveCurrentFrameNumber function (wdfusb.h)

[Applies to KMDF only]

The WdfUsbTargetDeviceRetrieveCurrentFrameNumber method retrieves the current USB frame number.

Syntax

NTSTATUS WdfUsbTargetDeviceRetrieveCurrentFrameNumber(
  [in]  WDFUSBDEVICE UsbDevice,
  [out] PULONG       CurrentFrameNumber
);

Parameters

[in] UsbDevice

A handle to a USB device object that was obtained from a previous call to WdfUsbTargetDeviceCreateWithParameters.

[out] CurrentFrameNumber

A pointer to a location that receives the current 32-bit USB frame number.

Return value

WdfUsbTargetDeviceRetrieveCurrentFrameNumber returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method can return one of the following values:

Return code Description
STATUS_INVALID_PARAMETER
An invalid parameter was detected.
STATUS_UNSUCCESSFUL
The frame number was unavailable, possibly because lower drivers do not provide frame numbers.
 

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

For more information about the WdfUsbTargetDeviceRetrieveCurrentFrameNumber method and USB I/O targets, see USB I/O Targets.

Examples

The following code example calls WdfUsbTargetDeviceRetrieveCurrentFrameNumber. The example obtains a USB device object handle from driver-defined context space.

ULONG  frameNumber;
PMY_DEVICE_CONTEXT  pMyDeviceContext;

pMyDeviceContext = GetDeviceContext(Device);

status = WdfUsbTargetDeviceRetrieveCurrentFrameNumber(
                                              pMyDeviceContext->UsbTargetDevice,
                                              &frameNumber
                                              );

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Header wdfusb.h (include Wdfusb.h)
Library Wdf01000.sys (see Framework Library Versioning.)
IRQL <=DISPATCH_LEVEL
DDI compliance rules DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), UsbKmdfIrql(kmdf), UsbKmdfIrql2(kmdf), UsbKmdfIrqlExplicit(kmdf)

See also

WdfUsbTargetDeviceCreateWithParameters