Open device name using CreateFile

后端 未结 1 1958
粉色の甜心
粉色の甜心 2020-12-31 13:43

I am working on a simple device driver I want to comunicate with the driver from user-mode using IRP.

I am having trouble opening the device driver. Using DeviceTree

相关标签:
1条回答
  • 2020-12-31 14:13

    Here is a good explanation by Tim Robinson, MVP (Windows SDK):

    Names of the form \Device\xxx are internal NT object manager names which are inaccessible to Win32. You will only be able to access your device if it creates a symbolic link to \Device\MyDevice from the \??\ directory. Objects in the \??\ kernel directory show up through \\.\ in Win32. Use Winobj in the DDK (or download it from www.sysinternals.com) to check.

    NOTE: Nowadays NT namespace root is exposed via GLOBALROOT symbolic link, so any NT path is accessible to Win32 including \Device\xxx: use \\.\GLOBALROOT\Device\xxx. A device symlink is not required in such case.

    0 讨论(0)
提交回复
热议问题