BOOLEAN
KeInsertDeviceQueue(
IN PKDEVICE_QUEUE DeviceQueue,
IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry
);
KeInsertDeviceQueue acquires the spin lock for the given device queue object and, if the device queue state is Busy, queues the given entry.
If the device queue is empty, FALSE is returned and the DeviceQueueEntry is not inserted in the device queue.
If the state of the device queue is Busy, the specified DeviceQueueEntry is inserted at the tail of the device queue and the device queue spin lock is released.
If KeInsertDeviceQueue returns FALSE, the entry was not queued and the caller must begin processing the IRP. A call to KeInsertDeviceQueue or KeInsertByKeyDeviceQueue when the queue is empty causes the device queue state transition from Not-Busy to Busy.
This routine is for code that queues an I/O request to a device driver.
Callers of KeInsertDeviceQueue must be running at IRQL DISPATCH_LEVEL.
KeInitializeDeviceQueue, KeInsertByKeyDeviceQueue, KeRemoveDeviceQueue, KeRemoveEntryDeviceQueue