Plug and Play Minor IRPs

This section describes the PnP IRPs that are sent to drivers. All PnP IRPs have the major function code IRP_MJ_PNP and a minor function code indicating the particular PnP request.

This section provides reference information for the individual IRPs. See Plug and Play for a description of the order in which the IRPs are sent, a discussion of how to handle IRPs in DispatchPnP routines, and a general discussion of PnP concepts and terminology.

For each IRP and each kind of driver, a driver is either required to handle the IRP, can optionally handle the IRP, or must not handle the IRP. Consult the table below to identify which IRPs your driver will handle and then consult the reference pages for information about the individual IRPs. The IRPs are listed in functional order in the table and in alphabetical order in the IRP reference pages.

If an IRP is marked "No" in the table for a particular driver, that driver must not handle the IRP. The driver must pass the IRP to the next driver in the device stack as described in the reference page for the IRP.

The PnP manager sends these IRPs. PnP drivers can send some of these IRPs, but only those so noted in this section.

The following are the minor function codes for PnP IRPs, and the driver types that handle them:

PnP IRP minor function code Value Function or filter driver for nonbus device Function driver for bus device (for bus FDO) Bus driver or bus filter driver (for child PDOs)
IRP_MN_START_DEVICE 0x00 Required Required Required
IRP_MN_QUERY_REMOVE_DEVICE 0x01 Required Required Required
IRP_MN_REMOVE_DEVICE 0x02 Required Required Required
IRP_MN_CANCEL_REMOVE_DEVICE 0x03 Required Required Required
IRP_MN_STOP_DEVICE 0x04 Required Required Required
IRP_MN_QUERY_STOP_DEVICE 0x05 Required Required Required
IRP_MN_CANCEL_STOP_DEVICE 0x06 Required Required Required
IRP_MN_QUERY_DEVICE_RELATIONS 0x07
- BusRelations x Optional (1) Required No (2)
- EjectionRelations x No No Optional
- RemovalRelations x Optional Optional No
- TargetDeviceRelation x No No Required
IRP_MN_QUERY_INTERFACE 0x08 Optional Optional Required (1)
IRP_MN_QUERY_CAPABILITIES 0x09 Optional Optional or Required
IRP_MN_QUERY_RESOURCES 0x0A No No Required (1)
IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B No No Required (1)
IRP_MN_QUERY_DEVICE_TEXT 0x0C No No Required (1)
IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D Optional (1) Optional (1) No
IRP_MN_READ_CONFIG 0x0F No No Required (1)
IRP_MN_WRITE_CONFIG 0x10 No No Required (1)
IRP_MN_EJECT 0x11 No No Required
IRP_MN_SET_LOCK 0x12 No No Required (1)
IRP_MN_QUERY_ID 0x13
- BusQueryDeviceID x No No Required
- BusQueryHardwareIDs x No No Optional
- BusQueryCompatibleIDs x No No or Optional
- BusQueryInstanceID x No No Optional
- BusQueryContainerID x No No Required (3)
IRP_MN_QUERY_PNP_DEVICE_STATE 0x14 Optional Optional Optional
IRP_MN_QUERY_BUS_INFORMATION 0x15 No No Required (1)
IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16 Required (1) Required (1) Required (1)
IRP_MN_SURPRISE_REMOVAL 0x17 Required Required Required
IRP_MN_DEVICE_ENUMERATED 0x19 No No Required (1)

(1) Required or optional in certain situations. See the reference page for the IRP for more details.

(2) Bus filter drivers might handle a query for BusRelations.

(3) Supported in Windows 7 and later versions of Windows.