Like any other higher-level kernel-mode driver, a SCSI filter driver must have one or more Dispatch routines to handle every IRP_MJ_XXX request for which the underlying SCSI class driver supplies a Dispatch entry point. Depending on the nature of its device, an SFD’s Dispatch entry point for any given request might do either of the following:
An SFD is most likely to set up new IRPs with the major function code IRP_MJ_INTERNAL_DEVICE_CONTROL.
For requests that require no special handling, an SFD’s Dispatch routine usually calls IoGetNextIrpStackLocation with an input IRP, sets up the class driver’s I/O stack location and, then, calls IoCallDriver with pointers to the class driver’s device object and the IRP. Note that an SFD seldom sets its IoCompletion routine in IRPs that require no special handling both because a call to the IoCompletion routine is unnecessary and because it degrades I/O throughput for the SFD’s device(s).
For requests that do require special handling, the SFD can do the following:
Like a SCSI class driver, an SFD might have SCSI-specific BuildSrb or SplitTransferRequest routines to be called from the driver’s Dispatch routine(s), or might implement the same functionality inline.
For more information about BuildSrb and SplitTransferRequest routines, see Sections A.1.4.4 and A.1.4.5. For more information about general requirements for Dispatch routines, see Chapter 6.