windows 7驱动程序ioctl调用
我已经为某些特定功能编写了一个 Windows 驱动程序。它可以正常工作,没有任何问题。但是,我在通过 ioctl 接口调用它时遇到问题。
在我的应用程序中,我调用 CreateFile 并尝试传递我给驱动程序的名称。但是,它给了我一个错误,“无法打开设备”,错误代码是 0x03。我使用的名字与我给司机起的名字完全相同。
从命令行应用程序打开驱动程序的名称:\DosDevice\my_driver 传递给 CreateFile 的名称也是相同的。 有什么方法可以找到我的驱动程序在 Windows 命名空间中的名称吗?
I have written a windows driver for some specific functionality. It works without any issues. However, I am facing issues when invoking it through ioctl interface.
Inside my application, I call CreateFile and try to pass the name which I have given to my driver. However, it gives me an error, "unable to open device" and error code is 0x03. I am using exactly the same name which I have given to my driver.
Name to open the driver from cmd line application: \DosDevice\my_driver
Name passed to CreateFile is also the same.
Is there any way to find what is the name of my driver in windows namespace?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Win 32 错误 0x03 是 ERROR_PATH_NOT_FOUND。尝试在设备名称前面添加“\\.\”。所以它变成了“\\.\DosDevice\my_driver”,或者它可能只是“\\.\my_driver”,只是为了清楚地表明这是2个斜杠,一个点,然后是另一个斜杠。这应该将您放入设备命名空间,否则我相信 CreateFile 只是试图打开文件系统上的文件。
Win 32 error 0x03 is ERROR_PATH_NOT_FOUND. Try adding "\\.\" to the front of you device name. So it becomes "\\.\DosDevice\my_driver", or it could simply be "\\.\my_driver", Just to make that clear that is 2 slashes, a dot, then another slash. This should put you into the device namespace, otherwise i believe that CreateFile is just trying to open a file on the file system.
您可以使用 WinObjEx 实用程序检查您的驱动程序是否创建了设备及其名称: http://www .freewebs.com/four-f/
You can use WinObjEx utility to check if your driver creates a device and what name it has: http://www.freewebs.com/four-f/