Step 3: The Driver Package for the Device is Installed
After Windows has selected the best driver package for the new device, Windows installs the driver package by following these steps:
Based on directives within the driver package's INF file, Windows installs the driver package on the device. For example, it:
Copies the driver binaries and other associated files to locations on the hard disk as specified by any relevant INF CopyFiles directive.
Performs registry operations as specified by any relevant INF AddReg directive.
Assigns a device setup class to the device from the Class and ClassGuid entries in the INF Version section.
Once the driver package is installed on the device, the device will be restarted.
As part of processing the device again due to the restart, the Plug and Play (PnP) manager identifies the appropriate function driver and any optional filter drivers for the device and attempts to build the device stack and start the device.
The PnP manager calls the DriverEntry routine for any required driver that is not yet loaded. The PnP manager then calls the AddDevice routine for each driver, starting with lower-filter drivers, then the function driver, and, finally, any upper filter drivers. The PnP manager assigns resources to the device, if required, and sends an IRP_MN_START_DEVICE to the device's drivers.
As soon as this step is complete, the device is installed and ready to be used.