Driver Installation

Windows provides components to install devices and drivers. The system-provided device installation components work with vendor-supplied components to install devices. Windows installs devices when the system restarts and at any time after a system restart when a user plugs in a Plug and Play (PnP) device (or manually installs a non-PnP device).

  1. Device Identification

    Before a driver is installed for a new device, the bus or hub driver to which the device is connected assigns a hardware identifier ID to the device. The Windows Plug and Play (PnP) manager uses hardware IDs to find the closest match between a device and a driver package that contains the driver for the device.

  2. Driver Selection

    After a new device is detected and identified, using the hardware identifier (ID) that is reported by the bus or hub driver, Windows searches for driver packages that match a device hardware ID or compatible ID in the driver package and selects the most appropriate driver for the device from one or more driver packages.

  3. Device Enumeration

    Windows represents each device instance as a unique device node (devnode). The PnP manager creates a devnode for each device on a machine and the devnodes are organized into a hierarchical Device Tree. A devnode contains the device stack (the device objects for the device's drivers) and information about the device such as whether the device has been started and which drivers have registered for notification on the device. Windows represents a driver for the device as a driver node. A driver node includes all the software support for a device, such as any services, device-specific co-installers, and registry entries based on the information from the driver package. The HKLM\SYSTEM\CurrentControlSet\Enum registry tree contains information about the devices on the system. The PnP manager creates a subkey for each device, with a name in the form of HKLM\SYSTEM\CurrentControlSet\Enum\Enumerator\deviceID. Under each of these keys is a subkey for each device instance present on the system. This subkey, which is known as the device's hardware key (or, device key), has information such as the device description, hardware IDs, compatible IDs, and resource requirements. The Enum tree is reserved for use by operating system components, and its layout is subject to change.

  4. Driver Installation

    Windows copies the driver binaries and other associated files to the hard disk and registers any device-specific co-installer. Windows determines the device setup class from the driver package INF file. To optimize device installation, the devices that are set up and configured in the same manner are grouped into the same device setup class which contains system configuration information about a setup class, such as the class installer (if there is one), the registered class device drivers and services, the upper-filter drivers, and registered class lower-filter drivers. Microsoft defines the setup classes for most devices with a GUID associated with each class. The information is stored under the registry key HKLM\System\CurrentControlSet\Control\Class\ClassGuid.

  5. Driver Startup

    The PnP manager loads the appropriate function driver and any optional filter drivers for the device and starts the device.