KeInsertDeviceQueue 例程获取指定设备队列对象的旋转锁,如果设备队列设置为繁忙状态,则会将指定的条目排入队列。
语法
BOOLEAN KeInsertDeviceQueue(
[in, out] PKDEVICE_QUEUE DeviceQueue,
[in, out] PKDEVICE_QUEUE_ENTRY DeviceQueueEntry
);
参数
[in, out] DeviceQueue
指向调用方为其提供存储的设备队列类型的控制对象的指针。
[in, out] DeviceQueueEntry
指向要插入的设备队列条目的指针。
返回值
如果设备队列为空,则返回 FALSE,并且不会在设备队列中插入 DeviceQueueEntry。
言论
如果设备队列设置为忙碌状态,则会在设备队列的末尾插入指定的 DeviceQueueEntry,并释放设备队列旋转锁。
如果 KeInsertDeviceQueue 返回 FALSE,则条目未排队,并且调用方必须开始处理 IRP。 当队列为空时,调用 KeInsertDeviceQueue 或 KeInsertByKeyDeviceQueue 会导致设备队列从非忙状态更改为忙碌状态。
此例程适用于将 I/O 请求排队到设备驱动程序的代码。
要求
| 要求 | 价值 |
|---|---|
| 最低支持的客户端 | 从 Windows 2000 开始可用。 |
| 目标平台 | 普遍 |
| 标头 | wdm.h (包括 Wdm.h、Ntddk.h、Ntifs.h) |
| 库 | NtosKrnl.lib |
| DLL | NtosKrnl.exe |
| IRQL | DISPATCH_LEVEL |
| DDI 符合性规则 | HwStorPortProhibitedDIS(storport), IrqlDispatch(storport), IrqlDispatch(storport), IrqlDispatch(wdm), MarkingQueuedIrps(wdm) |