Is there a way I can open a device using CreateFile and the device's physical device name ( such as: \Device\000055 )? What would all the arguments to CreateFile be?
This is a discussion on Device IO within the Windows Programming forums, part of the Platform Specific Boards category; Is there a way I can open a device using CreateFile and the device's physical device name ( such as: ...
Is there a way I can open a device using CreateFile and the device's physical device name ( such as: \Device\000055 )? What would all the arguments to CreateFile be?
Ever notice how fast Windows runs?
Neither did I.
Which is why I switched to Linux.
CreateFile Function (Windows)
Google is your friend!
I have tried but it comes up with the error "file not found".
Ever notice how fast Windows runs?
Neither did I.
Which is why I switched to Linux.
Are you formatting the drive name correctly?
In C, as a physical drive, named in a string literal you need "\\\\.\\PhysicalDrive0" to open drive C: You have to double the slashes because C uses the \ as an escape character like in \n ... so to get one slash you need 2.
Naming Files, Paths, and Namespaces (Windows)
If the device has a symlink in the Global?? namespace you can open it with CreateFile (with the symlink name, not the device path) assuming you have the correct user rights to open it.Originally Posted by MSDN
If not then you have to use the NT api, like NtCreateFile, etc..