By the members of ntdev and ntfsd | published: 01-may-03 | modified: 01-may-03
IRP dispatching and handling
- If a dispatch routine returns status_pending, the IRP passed into
Dispatch routine must be marked pending with iomarkirppending ().
- If an IRP is marked pending with iomarkirppending () in a dispatch routine,
That dispatch routine must return status_pending.
- If an IRP is to be marked pending, iomarkirppending must be called before
The IRP is accessible from any context in which it might be completed.
- If you complete the IRP in the dispatch routine, you must:
- Fill IRP-> iostatus. Status with the IRP's completion status (this may not be status_pending)
- Fill IRP-> iostatus. Information with the number of bytes read or written by the request if the request is being completed with a success status (for data transfer operations and IOCTLs), and
- Call iocompleterequest ().
On return from the dispatch routine, you must return the same status that you filled into IRP-> iostatus. Status. Note that in some cases IRP-> iostatus. Information can hold a pointer.
I/O completion routines