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分支总是可以访问的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值