Each driver-specific I/O stack location (IO_STACK_LOCATION) for every IRP contains a major function code (IRP_MJ_XXX), which tells the driver what operation it or the underlying device driver should carry out to satisfy the I/O request. 每個核心模式驅動程式都必須為其必須支援的主要函式碼提供分派常式。
The specific operations a driver carries out for a given IRP_MJ_XXX code depend somewhat on the underlying device, particularly for IRP_MJ_DEVICE_CONTROL and IRP_MJ_INTERNAL_DEVICE_CONTROL requests. 例如,傳送至鍵盤驅動程式的要求必須與傳送至磁碟驅動程式的要求有些不同。 不過,I/O 管理員會定義每個系統定義主要功能碼的參數及 I/O 堆疊位置內容。
Every higher-level driver must set up the appropriate I/O stack location in IRPs for the next-lower-level driver and call IoCallDriver, either with each input IRP, or with a driver-created IRP (if the higher-level driver holds on to the input IRP). 因此,每個中繼驅動程式都必須為基礎裝置驅動程式處理的每個主要函式碼提供分派常式。 否則,每當應用程式或更高層級的驅動程式嘗試將 I/O 要求向下傳送至基礎裝置驅動程式時,新的中繼驅動程式就會「中斷鏈結」。
File system drivers and legacy file system filter drivers also handle a required subset of system-defined IRP_MJ_XXX function codes, some with subordinate IRP_MN_XXX function codes. 如需如何處理這些 IRP 的詳細資訊,請參閱 檔案系統驅動程式和舊版 FS 篩選驅動程式的 IRP 主要函式碼。
驅動程式會處理使用下列部分或全部主要函式碼設定的 IRP:
IRP_MJ_INTERNAL_DEVICE_CONTROL
本節所述的輸入和輸出參數是 IRP 中函式特定的參數。
For more information about IRPs, see Handling IRPs.