16.9 Setting Up Symbolic Links

The user-visible name for a particular device can be subsystem-specific, as mentioned in Section 16.8.1.3. For example, an MS-DOS® or Win32 application’s print job is likely to be directed to a logical device named LPT1, rather than to the NT device object name for the parallel port to which a printer is attached.

A subkey of the CurrentControlSet\Control key, \Session Manager\DOS Devices, contains subkeys with value entries for the Win32 subsystem’s logical device names. During system initialization, the Win32 Session Manager sets up symbolic link objects in the NT object namespace \?? (formerly \DosDevices), using the registry’s \Session Manager\DOS Devices subkeys. Each symbolic link object creates an alias between a Win32-visible name and the corresponding NT device object name, so that applications and/or end users can use the Win32-visible name to send I/O requests to the underlying device.

Windows NT supplies a default set of Win32 logical names for standard MS-DOS and Windows® devices like LPT1, but the default set cannot include every possible device that might be present in or added to a Windows NT machine. Consequently, NT driver writers must set up symbolic link objects in the NT object namespace \??, in order to make their devices available to Win32 applications and end users for I/O requests. Section 16.9.1, explains how the writer of a new NT device driver can set up the necessary symbolic link(s).

As mentioned in Section 16.8.1.2, NT drivers of floppy and CD-ROM devices from which the system itself can be loaded must set up a symbolic link between the ARC- or NtDetect-created “hardware” name for the device and the corresponding device object name. Section 16.9.2 explains how the writer of a new floppy or CD-ROM device driver can set up the necessary symbolic link(s).