PKDEVICE_QUEUE_ENTRY
KeRemoveDeviceQueue(
IN PKDEVICE_QUEUE DeviceQueue
);
KeRemoveDeviceQueue removes an entry from the head of a specified device queue.
If the device queue is empty but the device queue’s state is Busy, KeRemoveDeviceQueue returns NULL.
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.
KeInitializeDeviceQueue, KeInsertByKeyDeviceQueue, KeInsertDeviceQueue, KeRemoveByKeyDeviceQueue, KeRemoveEntryDeviceQueue