WdfIoQueueStop method

[Applies to KMDF and UMDF]

The WdfIoQueueStop method prevents an I/O queue from delivering I/O requests, but the queue receives and stores new requests.

Syntax


VOID WdfIoQueueStop(
  [in]            WDFQUEUE Queue,
  [in, optional]  PFN_WDF_IO_QUEUE_STATE StopComplete,
  [in, optional]  WDFCONTEXT Context
);

Parameters

Queue [in]

A handle to a framework queue object.

StopComplete [in, optional]

A pointer to a driver-supplied EvtIoQueueState callback function. This parameter is optional and can be NULL.

Context [in, optional]

An untyped pointer to driver-supplied context information that the framework passes to the EvtIoQueueState callback function. This parameter is optional and can be NULL.

Return value

None.

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

Remarks

If the driver supplies an EvtIoQueueState callback function, the framework calls it after all requests that were delivered to the driver have been completed or canceled.

The WdfIoQueueStop method enables the queue to receive new requests, even if the queue was not receiving new requests before the driver called WdfIoQueueStop. For example, before calling WdfIoQueueStop, a driver might call WdfIoQueueDrain, which causes the framework to stop adding new I/O requests to the queue. The driver's subsequent call of WdfIoQueueStop causes the framework to resume adding requests to the queue.

A driver must not call WdfIoQueueDrain after calling WdfIoQueueStop until it has restarted the queue by calling WdfIoQueueStart.

For more information about the WdfIoQueueStop method, see Managing I/O Queues.

Examples

The following code example stops a specified I/O queue. When all requests that were delivered to the driver have been completed or canceled, it calls a driver's EvtIoQueueStateStop function.


WDFCONTEXT stopContext;

stopContext = &myContext;

WdfIoQueueStop(
               queue,
               EvtIoQueueStateStop,
               stopContext
               );

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfio.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

ChangeQueueState, DriverCreate, EvtSurpriseRemoveNoSuspendQueue, KmdfIrql, KmdfIrql2, NoCancelFromEvtSurpriseRemove

See also

WdfIoQueueStopSynchronously
WdfIoQueueStart
EvtIoQueueState

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft