Plug and Play provides:
To support PnP, a driver must follow these guidelines:
This dispatch routine must handle IRP_MJ_PNP requests and associated minor function codes. For more information, see DispatchPnP Routines.
The PnP Manager is responsible for determining the presence of hardware devices. When the PnP Manager detects a device, it notifies the driver by calling its AddDevice routine. Hardware can be detected when the system is booted, or any time that a user adds a device to, or removes one from, a running system.
A PnP driver must provide the PnP Manager with lists of resources that a device can potentially use. The PnP Manager is responsible for assigning resources to each device, and notifying the driver of each device's assignments when it sends an IRP_MN_START_DEVICE request. The driver must thus be capable of working with various configurations of hardware resources.
Some drivers are insulated from the details of the PnP and power management by system-supplied port or class drivers. For example, a SCSI port driver insulates a SCSI miniport driver from many of the details of the power and PnP systems, so a SCSI miniport driver doesn't need to handle power and PnP IRPs directly. For such drivers, see the driver-specific documentation for details of the required PnP support.