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 codeFunction or filter driver for nonbus deviceFunction driver for bus device (for bus FDO)Bus driver or bus filter driver (for child PDOs)

IRP_MN_START_DEVICE

Required

Required

Required

IRP_MN_QUERY_STOP_DEVICE

Required

Required

Required

IRP_MN_STOP_DEVICE

Required

Required

Required

IRP_MN_CANCEL_STOP_DEVICE

Required

Required

Required

IRP_MN_QUERY_REMOVE_DEVICE

Required

Required

Required

IRP_MN_REMOVE_DEVICE

Required

Required

Required

IRP_MN_CANCEL_REMOVE_DEVICE

Required

Required

Required

IRP_MN_SURPRISE_REMOVAL

Required

Required

Required

IRP_MN_QUERY_CAPABILITIES

Optional

Optional

Required

IRP_MN_QUERY_PNP_DEVICE_STATE

Optional

Optional

Optional

IRP_MN_FILTER_RESOURCE_REQUIREMENTS

Optional (1)

Optional (1)

No

IRP_MN_DEVICE_USAGE_NOTIFICATION

Required (1)

Required (1)

Required (1)

IRP_MN_QUERY_DEVICE_RELATIONS

  • BusRelations

Optional (1)

Required

No (2)

  • EjectionRelations

No

No

Optional

  • RemovalRelations

Optional

Optional

No

  • TargetDeviceRelation

No

No

Required

IRP_MN_QUERY_RESOURCES

No

No

Required (1)

IRP_MN_QUERY_RESOURCE_REQUIREMENTS

No

No

Required (1)

IRP_MN_QUERY_ID

  • BusQueryDeviceID

No

No

Required

  • BusQueryHardwareIDs

No

No

Optional

  • BusQueryCompatibleIDs

No

No

Optional

  • BusQueryInstanceID

No

No

Optional

  • BusQueryContainerID

No

No

Required (3)

IRP_MN_QUERY_DEVICE_TEXT

No

No

Required (1)

IRP_MN_QUERY_BUS_INFORMATION

No

No

Required (1)

IRP_MN_QUERY_INTERFACE

Optional

Optional

Required (1)

IRP_MN_READ_CONFIG

No

No

Required (1)

IRP_MN_WRITE_CONFIG

No

No

Required (1)

IRP_MN_DEVICE_ENUMERATED

No

No

Required (1)

IRP_MN_SET_LOCK

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.

 

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft