To make a new device accessible from the Win32 subsystem, there must be a symbolic link object in the NT object namespace \??. Such a symbolic link object maps the NT generic name for a driver’s device object to the corresponding Win32 logical name for the same device. There are two alternative techniques to set up such a symbolic link:
FaxDev:REG_SZ:\Device\Fax0
When such a symbolic link object has been created in \??, a Win32 application or subsystem-level driver can get a handle for the file object that represents the \Device\Fax0 device object using \\ .\FaxDev as a parameter.
Note that a system administrator or end user must be very knowledgeable about using regedt32 and about the DOS Devices key in the registry in order to use the first technique of “installing” a new Win32 device in the registry.
Using regedt32 creates a nonvolatile subkey under \Session Manager\DOS Devices in the registry. As mentioned in Section 16.9, the Session Manager creates a symbolic link object in the \?? object namespace for each subkey. To the Session Manager, the creation of these symbolic link objects requires only that it process the value entries of the DOS Devices subkeys. Consequently, it can create a symbolic link for a device that is not actually available for user-mode I/O requests. For example, if a device driver fails its initialization or is unloaded dynamically, the Session Manager does not remove the corresponding DOS Devices subkey in the registry nor the corresponding symbolic link object in the \?? namespace.
For developers of new NT drivers, relying on the first technique for setting up a new device and retail driver can be very costly in terms of customer support.
Consequently, most NT driver writer are likely to prefer the second technique for making a new device visible to Win32 applications and end users. For example, the driver of a new fax device might do the following in order to make its device accessible to I/O requests from Win32 applications:
While using the first technique to make a driver’s device visible within the Win32 subsystem environment is a simple way to get an under-development NT driver loaded so it can be debugged and tested, retail drivers should create symbolic links between the NT names for their device objects and the corresponding Win32 logical device names in the NT object namespace \??.
Any NT driver that has an Unload routine is responsible for releasing the symbolic link objects it has created. Such a driver’s Unload routine must call IoDeleteSymbolicLink for each symbolic link that the DriverEntry routine set up.