typedef struct _IO_STATUS_BLOCK { NTSTATUS Status; ULONG Information; } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
The I/O status block in the IRP is set to indicate the final status of a given request before a driver calls IoCompleteRequest with the IRP.
Unless a driver completes an IRP with an error from its Dispatch routine for that IRP_MJ_XXX, the lowest-level driver in the chain frequently sets the I/O status block in an IRP to the values that are returned to the original requestor of the I/O operation.
The IoCompletion routine(s) of higher-level drivers usually check the I/O status block in IRPs completed by lower drivers. By design, the I/O status block in an IRP is the only information passed back from the underlying device driver to all higher-level drivers’ IoCompletion routines.
IO_STACK_LOCATION, IoCompleteRequest, IoSetCompletionRoutine, IRP