NT drivers are hidden from end users by a Windows NT protected subsystem that implements an already familiar programming interface, such as Windows® or POSIX. Devices are visible to user-mode code, which includes protected subsystems, only as named file objects controlled by the NT I/O Manager.
Figure 2.1 illustrates this relationship between an end user, a subsystem, and the NT I/O Manager.
Figure 2.1 NT File Objects Represent Files, Volumes, and Devices
A Windows NT protected subsystem, such as the Win32® subsystem, passes I/O requests to the appropriate kernel-mode driver through the I/O system services. The subsystem shown in Figure 2.1 depends on support from the NT display, video adapter, keyboard, and mouse device drivers.
A protected subsystem insulates its end users and applications from having to know anything about kernel-mode components, including NT drivers. In turn, the NT I/O Manager insulates protected subsystems from having to know anything about machine-specific device configurations or about NT drivers’ implementations.
The NT I/O Manager’s layered approach also insulates most NT drivers from having to know anything about:
The I/O Manager supplies NT drivers with a single I/O model, a set of kernel-mode support routines these drivers can use to carry out I/O operations, and a consistent interface between the originator of an I/O request and the NT drivers that must respond to it.
As shown in Figure 2.1, a subsystem and its native applications can access an NT driver’s device or a file on a mass-storage device only through file object handles supplied by the NT I/O Manager. A subsystem’s request to open such a file object and to obtain a handle for I/O to a device or a data file is made by calling the NT I/O system services to open a named file, which can have a subsystem-specific alias (symbolic link) to the kernel-mode name for the file object.
The NT I/O Manager, which exports these system services, is then responsible for locating or creating the file object that represents the device or data file and for locating the appropriate NT driver(s). Figure 2.2 shows an overview of what happens when a subsystem opens a file object representing a data file on behalf of an application.
Figure 2.2 Opening an NT File Object
After a subsystem successfully opens a file object that represents a data file, a device, or a volume, the subsystem uses the returned file object handle to request that device I/O operations (usually read, write, or device I/O control requests) be carried out by calling the I/O system services. The I/O Manager routes these requests as IRPs sent to appropriate NT drivers.