'What is the purpose of IoCompleteRequest?
Why do many device drivers have an IoCompleteRequest(irp,IO_NO_INCREMENT); at the end of the dispatch routines? I read the corresponding Microsoft docs for the IoCompleteRequest function, but I didn't understand very well those concepts.
Solution 1:[1]
First, you need to understand the lifecycle of an IRP. How the IRP is created (IoAllocateIrp), delivered (IoCallDriver), and released (IoFreeIrp) after work is done. Second, if necessary, when post-processing is required at the end of the operation, the processing of the I/O completion routine is also handled in the driver hierarchical manner. IoCompleteRequest does the job of ensuring these two things.
- Application performs an I/O request.
- I/O Manager (create IRP, pass to driver)
- Driver (IRP complete after processing the job (IoCompleteRequest))
- I/O Manager (Release IRP, transfer result to upper application)
- The application receives the I/O result.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | reinhard v.z. |
