KeRemoveByKeyDeviceQueue function

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

Syntax

NTKERNELAPI PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue(
  PKDEVICE_QUEUE DeviceQueue,
  ULONG          SortKey
);

Parameters

DeviceQueue

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

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

   
Windows version 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 IrqlDispatch, HwStorPortProhibitedDDIs, IrqlDispatch(storport)

See Also

KeInitializeDeviceQueue

KeInsertByKeyDeviceQueue

KeInsertDeviceQueue

KeRemoveDeviceQueue

KeRemoveEntryDeviceQueue