KeInsertDeviceQueue

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.

Parameters

DeviceQueue
Points to a control object of type device queue for which the caller provides the storage.
DeviceQueueEntry
Points to the device queue entry that is to be inserted.

Return Value

If the device queue is empty, FALSE is returned and the DeviceQueueEntry is not inserted in the device queue.

Comments

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.

See Also

KeInitializeDeviceQueue, KeInsertByKeyDeviceQueue, KeRemoveDeviceQueue, KeRemoveEntryDeviceQueue