WdfIoQueuePurgeSynchronously function

[Applies to KMDF and UMDF]

The WdfIoQueuePurgeSynchronously method causes the framework to stop queuing I/O requests to an I/O queue and to cancel unprocessed requests and driver-owned cancellable requests.

Syntax

void WdfIoQueuePurgeSynchronously(
  WDFQUEUE Queue
);

Parameters

Queue

A handle to a framework queue object.

Return Value

None.

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

Remarks

After a driver calls WdfIoQueuePurgeSynchronously, the framework stops adding I/O requests to the specified queue. The framework cancels all requests that it has not delivered to the driver. If the framework receives additional requests for the queue, it completes them with a completion status value of STATUS_INVALID_DEVICE_STATE.

WdfIoQueuePurgeSynchronously returns after all the unprocessed and driver-owned requests are completed or canceled.

After a driver has purged an I/O queue, it can restart the queue by calling WdfIoQueueStart.

Do not call WdfIoQueuePurgeSynchronously from the following queue object event callback functions, regardless of the queue with which the event callback function is associated:

EvtIoDefault EvtIoDeviceControl EvtIoInternalDeviceControl EvtIoRead EvtIoWrite For more information about the WdfIoQueuePurgeSynchronously method, see Managing I/O Queues.

Examples

The following code example purges a specified I/O queue.

WdfIoQueuePurgeSynchronously(ReadQueue);

Requirements

   
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfio.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL PASSIVE_LEVEL
DDI compliance rules ChangeQueueState, DriverCreate, EvtSurpriseRemoveNoSuspendQueue, KmdfIrql, KmdfIrql2, NoCancelFromEvtSurpriseRemove

See Also

WdfIoQueuePurge