KeInsertByKeyDeviceQueue 例程获取指定 DeviceQueue 的旋转锁,如果设备队列设置为忙碌状态,则根据指定的排序键值对条目进行排队。
语法
BOOLEAN KeInsertByKeyDeviceQueue(
[in, out] PKDEVICE_QUEUE DeviceQueue,
[in, out] PKDEVICE_QUEUE_ENTRY DeviceQueueEntry,
[in] ULONG SortKey
);
参数
[in, out] DeviceQueue
指向调用方为其提供存储的设备队列类型的控制对象的指针。
[in, out] DeviceQueueEntry
指向要根据特定键值插入到设备队列中的设备队列条目的指针。
[in] SortKey
指定排序键值,该值确定插入条目的设备队列中的位置。
返回值
如果设备队列为空,则返回 FALSE,这意味着不会在设备队列中插入 DeviceQueueEntry。
言论
获取指定的设备队列旋转锁,并检查设备队列的状态。 如果设备队列设置为忙碌状态,则 DeviceQueueEntry 指定的 IRP 会根据其排序键值插入到设备队列中,并释放设备队列旋转锁。
新条目位于设备队列中,其排序键值小于或等于其排序键值,并在具有更大排序键值的任何条目之前放置。
如果 KeInsertByKeyDeviceQueue 返回 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) |