Export (0) Print
Expand All

EvtIoQueueState function

[Applies to KMDF and UMDF]

A driver's EvtIoQueueState event callback function delivers queue state information to the driver.

Syntax


EVT_WDF_IO_QUEUE_STATE EvtIoQueueState;

VOID EvtIoQueueState(
  _In_  WDFQUEUE Queue,
  _In_  WDFCONTEXT Context
)
{ ... }

Parameters

Queue [in]

A handle to an I/O queue object.

Context [in]

Driver-defined context information that the driver specified when it registered the EvtIoQueueState callback function.

Return value

None

Remarks

Drivers can register an EvtIoQueueState callback function by specifying its address as input to WdfIoQueueStop, WdfIoQueueDrain, WdfIoQueuePurge, or WdfIoQueueReadyNotify. The framework calls the EvtIoQueueState callback function after the specified operation completes.

The EvtIoQueueState callback function can be called at IRQL <= DISPATCH_LEVEL, unless the ExecutionLevel member of the device or driver's WDF_OBJECT_ATTRIBUTES structure is set to WdfExecutionLevelPassive.

If the IRQL is PASSIVE_LEVEL, the framework calls the callback function within a critical region.

Examples

To define an EvtIoQueueState callback function, you must first provide a function declaration that identifies the type of callback function you’re defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it’s a requirement for writing drivers for the Windows operating system.

For example, to define an EvtIoQueueState callback function that is named MyIoQueueState, use the EVT_WDF_IO_QUEUE_STATE type as shown in this code example:


EVT_WDF_IO_QUEUE_STATE  MyIoQueueState;

Then, implement your callback function as follows:


_Use_decl_annotations_
VOID
 MyIoQueueState (
    WDFQUEUE  Queue,
    WDFCONTEXT  Context
    )
 {...}

The EVT_WDF_IO_QUEUE_STATE function type is defined in the Wdfio.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the EVT_WDF_IO_QUEUE_STATE function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for KMDF Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfio.h (include Wdf.h)

IRQL

<= DISPATCH_LEVEL (see Remarks section)

See also

WdfIoQueueDrain
WdfIoQueuePurge
WdfIoQueueReadyNotify
WdfIoQueueStop
WDF_OBJECT_ATTRIBUTES

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft