The KeRemoveByKeyDeviceQueue routine removes an entry, selected according to a sort key value, from the specified device queue.
NTKERNELAPI PKDEVICE_QUEUE_ENTRY KeRemoveByKeyDeviceQueue( PKDEVICE_QUEUE DeviceQueue, ULONG SortKey );
Pointer to an initialized device queue object for which the caller provides the storage.
Specifies the key to be used when searching the DeviceQueue.
KeRemoveByKeyDeviceQueue returns the device queue entry that was removed; returns NULL if the queue was empty.
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.
|Windows version||Available starting with Windows 2000.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|DDI compliance rules||IrqlDispatch, HwStorPortProhibitedDDIs, IrqlDispatch(storport)|