本節說明傳送至驅動程式的 PnP IRP。 All PnP IRPs have the major function code IRP_MJ_PNP and a minor function code indicating the particular PnP request.
本節提供個別 IRP 的參考資訊。 如需 IRP 傳送順序的描述、如何在 DispatchPnP 常式中處理 IRP,以及 PnP 概念和術語的一般討論,請參閱隨插即用。
針對每個 IRP 和每種驅動程式,驅動程式必須處理 IRP、可以選擇性地處理 IRP,或不得處理 IRP。 請參閱下表,以識別驅動程式將處理哪些 IRP,然後參閱參考頁面以取得個別 IRP 的相關資訊。 IRP 會在資料表中以功能順序列出,並在 IRP 參考頁面中依字母順序列出。
如果 IRP 在特定驅動程式的數據表中標示為「否」,則該驅動程式不得處理 IRP。 驅動程式必須將 IRP 傳遞至裝置堆疊中的下一個驅動程式,如 IRP 參考頁面所述。
PnP 管理員會傳送這些 IRP。 PnP 驅動程式可以傳送其中一些 IRP,但只能傳送本節中所述的 IRP。
以下是 PnP IRP 的次要函式碼,以及處理它們的驅動程式類型:
| PnP IRP 次要函式碼 | Value | 非匯流排裝置的函式或篩選驅動程式 | 匯流排裝置的功能驅動程式(用於匯流排 FDO) | 匯流排驅動程式或匯流排篩選器驅動程式 (適用於子 PDO) |
|---|---|---|---|---|
| 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 | 選擇性或必要 | |
| 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 | 否或選用 | |
| - 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) 在某些情況下是必需的或可選的。 如需詳細資訊,請參閱 IRP 的參考頁面。
(2) Bus filter drivers might handle a query for BusRelations.
(3) 支援 Windows 7 及更高版本的 Windows。