Unload Routine Functionality
The responsibilities of a driver's Unload routine depend on whether the driver supports PnP or not.
Just as the DriverEntry routines of PnP drivers are usually simple, so are their Unload routines, as described in A PnP Driver's Unload Routine.
A non-PnP driver's Unload routine must free device objects and release driver-allocated resources. In short, it must undo the work performed by its corresponding DriverEntry and Reinitialize routines in initializing the driver, its devices, and its resources. See A Non-PnP Driver's Unload Routine for details.