Windows 表示 "on the device path for a special file (such as the paging file, hibernate file, or crash dump file)" 的设备是什么意思?

What does Windows mean by a device that is "on the device path for a special file (such as the paging file, hibernate file, or crash dump file)"?

我注意到如果您 processing an IRP_MN_QUERY_DEVICE_RELATIONS 具有 PowerRelations 类型并且您添加了一个电源关系,那么您应该将您的设备接收到的 IRP_MN_DEVICE_USAGE_NOTIFICATION IRP 发送到目标设备

If the target device is on the device path for a special file (such as the paging file, hibernate file, or crash dump file)...

我以前没见过那个措辞,也没有用谷歌搜索它。在 IRP_MN_DEVICE_USAGE_NOTIFICATION 的 link 之后,它解释了更多但不是很多关于将特殊文件附加到您的设备的实际情况的详细信息。

System components send this IRP to ask the drivers for a device whether the device can support a special file. Special files include paging files, dump files, and hibernation files. If all the drivers for the device succeed the IRP, the system creates the special file.

位于特殊文件的设备路径上是什么意思,通常是什么类型的设备?

免责声明:我不熟悉相关控制代码。

但是,文档的意思似乎很清楚。

例如,考虑页面文件,它通常是 C:\pagefile.sys。从内核的角度来看,那就是

\Device\HarddiskVolume1\pagefile.sys

这使得 Device\HarddiskVolume1 成为 "on the device path to a special file" 的设备。阅读文档,相关规则也适用于此设备所依赖的任何其他设备。

实际上,如果你是某种存储设备,或者是支持存储设备的总线设备,你才需要担心这个。如果这适用于您,并且如果您支持特殊文件(即,当您收到 IRP_MN_DEVICE_USAGE_NOTIFICATIONInPath 设置为 TRUE 时 return 成功) 如果您对另一台设备有重要的电源依赖性,那么您必须按照描述转发 IRP。

如果不需要支持特殊文件,调用失败即可。例如,可能不需要支持可移动媒体设备上的特殊文件,因此 USB 控制器、集线器等可能不支持它们。但是 RAID 控制器可能确实 需要支持特殊文件,至少如果您希望能够在 RAID 磁盘上安装 Windows。