WdfIoQueuePurgeSynchronously function (wdfio.h)

[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.


void WdfIoQueuePurgeSynchronously(
  [in] WDFQUEUE Queue


[in] Queue

A handle to a framework queue object.

Return value



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

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.


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



Requirement Value
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)
DDI compliance rules ChangeQueueState(kmdf), DriverCreate(kmdf), EvtSurpriseRemoveNoSuspendQueue(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), NoCancelFromEvtSurpriseRemove(kmdf), NoIoQueuePurgeSynchronously(kmdf)

See also