KeRemoveDeviceQueue function (wdm.h)

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

Syntax

PKDEVICE_QUEUE_ENTRY KeRemoveDeviceQueue(
  [in, out] PKDEVICE_QUEUE DeviceQueue
);

Parameters

[in, out] DeviceQueue

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

Return value

If the device queue is empty but is set to a busy state, KeRemoveDeviceQueue returns NULL.

Remarks

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

It is an error to call KeRemoveDeviceQueue when the device queue object is set to a not-busy state.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL DISPATCH_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), IrqlDispatch(storport), IrqlDispatch(storport), IrqlDispatch(wdm)

See also

KeInitializeDeviceQueue

KeInsertByKeyDeviceQueue

KeInsertDeviceQueue

KeRemoveByKeyDeviceQueue

KeRemoveEntryDeviceQueue