6.2.3 When to Complete an IRP in the Dispatch Routine

Usually, NT drivers do not complete IRPs in their Dispatch routines unless the parameters for the given request are invalid or, in a device driver, unless the particular IRP_MJ_XXX  requires no device I/O operation(s).

    A higher-level NT driver should complete an IRP in its Dispatch routine(s) or pass it on for processing by lower drivers according to the following guidelines: 

Note that every NT driver in a chain of layered drivers can check the validity of parameters in its own I/O stack location of each IRP input to the driver’s Dispatch routines. In such a chain, each driver’s Dispatch routine can complete only those IRPs for which it can determine the validity of parameters in its own I/O stack location. Completing IRPs with invalid parameters in the Dispatch routine of the highest possible driver improves I/O throughput for any chain of NT drivers and for the system overall.

    A lowest-level NT driver should complete an IRP in its Dispatch routine(s) according to the following guidelines: 

Otherwise, the Dispatch routine must call IoMarkIrpPending with the IRP, queue the IRP to other driver routines for further processing, and return STATUS_PENDING.