The information in this article applies to: 
 SUMMARYThis article explains the difference between IoMarkIrpPending(Irp), IoStatus.Status=STATUS_PENDING, and return STATUS_PENDING. MORE INFORMATION
To see exactly what IoMarkIrpPending does, look at the following definition
in NTDDK.H:
 There is never any reason to store STATUS_PENDING in Irp->IoStatus.Status because Irp->IoStatus.Status is filled in with the "final" status of the IRP just before calling IoCompleteRequest. None of the code paths look at Irp->IoStatus.Status until IoCompleteRequest is called. Therefore, there is no reason to set Irp->IoStatus.Status to any value before IoCompleteRequest is called. Conversely, STATUS_PENDING is never an appropriate value for Irp- >IoStatus.Status when IoCompleteRequest is called. STATUS_PENDING is the proper return value from any dispatch routine that has not called IoCompleteRequest on the IRP or not passed the IRP to a lower-layer driver. This type of routine must also call IoMarkIrpPending for the IRP. 
Keywords          : NTDDKKMode   | 
| 
 Last Reviewed: March 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use.  |