6.2 Basic Dispatch Routine Functionality
The required functionality of a particular Dispatch routine varies, depending on the IRP_MJ_XXX it handles, on the individual driver’s level in a chain of NT drivers, and on the type of underlying physical device.
Basically, most Dispatch routines process incoming IRPs as follows:
1.Check the driver’s I/O stack location in the IRP to determine what to do and check the parameters, if any, for validity.
2.Satisfy the request and complete the IRP if possible; otherwise, pass it on for further processing by lower-level drivers or by other device driver routines.
Whether an NT driver must check its I/O stack location to determine what to do and to check parameters depends on the given IRP_MJ_XXX, as well as on whether that driver set up a separate Dispatch routine for each IRP_MJ_XXX that the driver handles.
Whether an NT driver must pass on an IRP for further processing depends on the validity of the parameters, if any, as well as on the IRP_MJ_XXX and on the driver’s level, if any, in a chain of layered drivers.