KeRemoveByKeyDeviceQueue function (wdm.h)

The KeRemoveByKeyDeviceQueue routine removes an entry, selected according to a sort key value, from the specified device queue.

Syntax

PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(
  [in, out] PKDEVICE_QUEUE DeviceQueue,
  [in]      ULONG          SortKey
);

Parameters

[in, out] DeviceQueue

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

[in] SortKey

Specifies the key to be used when searching the DeviceQueue.

Return value

KeRemoveByKeyDeviceQueue returns the device queue entry that was removed; returns NULL if the queue was empty.

Remarks

This routine searches for the first entry in the device queue that has a value greater than or equal to the SortKey. After this entry is found, this routine removes the entry from the device queue and returns it. If no such entry is found, then the first entry in the queue is returned. If the device queue is empty, then the device is set to a not-busy state and a NULL pointer is returned.

It is an error to call KeRemoveByKeyDeviceQueue 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

KeRemoveDeviceQueue

KeRemoveEntryDeviceQueue