6.2.6  Handling Asynchronous Transfer Requests

Except for highest-level drivers, all NT drivers handle IRP_MJ_READ and IRP_MJ_WRITE requests asynchronously. Even a highest-level NT driver cannot wait in its Dispatch routine for lower-level drivers to finish processing an asynchronous read or write request. It must pass such a request on to lower drivers and return STATUS_PENDING from its DispatchRead and/or DispatchWrite routine(s).

Similarly, an NT device driver must pass such a transfer request on to other driver routines that process device I/O requests and return STATUS_PENDING from its DispatchRead and/or DispatchWrite routine(s) or from its DispatchReadWrite routine.

As already mentioned in Section 6.2.4, a higher-level NT driver sometimes must set up partial-transfer IRPs and pass them on to lower drivers. Such a higher-level driver can complete the original read/write IRP only when its partial-transfer requests have been completed by the lower driver(s).

For example, an NT SCSI class driver’s DispatchReadWrite routine is required to split large transfer requests that exceed the underlying HBA’s transfer capabilites into a set of partial-transfer requests. The class driver must set up the parameters in its partial-transfer IRPs so that the NT SCSI port/miniport drivers can satisfy each partial-transfer request in a single DMA operation.

Other NT device drivers that use DMA or PIO also might need to split up large transfer requests for themselves.

For more information about using DMA and PIO, see Chapters 3 and 16. For more information about NT SCSI class driver requirements, see also Appendix A.