System Root Path
updated 16 June 2004]
This driver retrieves
the System Root path and prints the output to the
debugger. This sample demonstrates the use of ZwOpenSymbolicLinkObject, ZwQuerySymbolicLinkObject,
IoGetDeviceObjectPointer, and RtlVolumeDeviceToDosName.
The path is found by opening then querying the symbolic link
"\SystemRoot". The drive letter is then found by calling
Note, amongst other
methods, it is also possible to retrieve the system root path
from the registry HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\PathName. However, this sample was
designed to show the use of certain API's thus these other
methods fall outside the scope of this sample driver.
for 32-bit Windows
2K/XP/2K3. Source code only.