Timing of File Operations In WDM driver

原文:

You’ll be likely to want to read a disk file in a WDM driver while you’re initializing your device in response to an IRP_MN_START_DEVICE request. Depending on where your device falls in the initialization sequence, you might or might not have access to files using normal pathnames like /??/C:/dir/file.ext. To be safe, put your data files into some directory below the system root directory and use a filename like /SystemRoot/dir/file.ext. The SystemRoot branch of the namespace is always accessible since the operating system has to be able to read disk files to start up.

 

翻译:

在WDM程序中,当你的驱动程序收到IRP_MN_START_DEVICE请求时,你开始初始化你的设备,此时,你很可能会读取磁盘上的某个文件。你的驱动程序是否能够访问那些使用通用路径名的文件(比如/??/C:/dir/file.ext)取决于你的设备初始化处于系统初始化序列的哪个阶段,为了安全起见,你最好把你要访问的文件放到操作系统根目录下面,并且使用诸如 /SystemRoot/dir/file.ext这样的文件名来访问文件。因为操作系统必须读磁盘来启动,命名空间中的SystemRoot分支总是可以访问的。

你可能感兴趣的:(Timing of File Operations In WDM driver)