KeRemoveDeviceQueue

PKDEVICE_QUEUE_ENTRY
    KeRemoveDeviceQueue(

        IN PKDEVICE_QUEUE  DeviceQueue
        );

KeRemoveDeviceQueue removes an entry from the head of a specified device queue.

Parameters

DeviceQueue
Points to an initialized device queue object for which the caller provides the storage.

Return Value

If the device queue is empty but the device queue’s state is Busy, KeRemoveDeviceQueue returns NULL.

Comments

The specified device queue spin lock is acquired and the state of the device queue is checked. If the state is Busy and an IRP is queued, this routine dequeues the entry and returns a pointer to the IRP. A call to KeRemoveDeviceQueue when the state of the device queue object is Busy but no IRPs are queued causes the state transition to Not-Busy. The given device queue’s spin lock is released.

It is an error to call KeRemoveDeviceQueue when the state of the device queue object is Not-Busy.

Callers of KeRemoveDeviceQueue must be running at IRQL DISPATCH_LEVEL.

See Also

KeInitializeDeviceQueue, KeInsertByKeyDeviceQueue, KeInsertDeviceQueue, KeRemoveByKeyDeviceQueue, KeRemoveEntryDeviceQueue