1

I know I can open a physical device by CreateFile with names like "\\.\name,
e.g. "\\.\CdRom0" or "\\.\PhysicalDrive0".
Are the other available device names documented somewhere?
Is there a way to enumerate them?

DontPanic
  • 2,164
  • 5
  • 29
  • 56
  • All of them. Only some have a convenient DOS name. Explore the kernel namespaces with SysInternals' WinObj. – Hans Passant Aug 19 '20 at 14:34
  • Hans: WinObj worked great! Lots of interesting devices. – DontPanic Aug 19 '20 at 20:44
  • Not all devices are strictly in the Windows device namespace that's accessible via "\\.\" or "\\?\". The latter is shorthand for the logon session's DOS device directory at "\Sessions\0\DosDevices\", which is implicitly linked to and contains an explicit "Global" link to the global DOS devices directory "\GLOBAL??". The "DOS device" object directories contain object symbolic links to real device objects in "\Device", or paths on them (e.g. subst or mapped drives). The global directory contains a "GLOBALROOT" link to the root directory, e.g. "\\?\GLOBALROOT\Device\HarddiskVolume2". – Eryk Sun Aug 19 '20 at 21:26
  • @Eryk: Very informative. Especially about "\\?\GLOBALROOT\Device\HarddiskVolume2" and the like. – DontPanic Aug 21 '20 at 13:43

0 Answers0