Handling IRPs 4: Completing an IRP
来源:互联网 发布:nodejs高级编程 中文 编辑:程序博客网 时间:2024/05/18 02:33
Completing an IRP
When I/O is complete, the driver that completed the I/O calls theIoCompleteRequest routine. This routine moves the IRP stack pointer to point to the next higher location in the IRP stack, as Figure 3 shows.
Figure 3. IRP completion and stack pointer
Figure 3 shows the current I/O stack location after driver C has calledIoCompleteRequest. The solid arrow on the left indicates that the stack pointer now points to the parameters and callback for driver B. The dotted arrow indicates the previous stack location. The hollow arrow on the right indicates the order in which the IoCompletion routines are called.
Note: For ease of explanation, this paper shows the I/O stack locations in the IRP “upside-down,” that is, in inverted order from A to C instead of from C to A. Using an inverted diagram enables calls that proceed “down” the device stack to point downwards.
If a driver set an IoCompletion routine as it passed the IRP down the device stack, the I/O Manager calls that routine when the IRP stack pointer once again points to the I/O stack location for the driver. In this way, IoCompletion routines act as return addresses for the drivers that handled the IRP as it traversed the device stack.
An IoCompletion routine can return either of two status values:
· STATUS_CONTINUE_COMPLETION—continues the upward completion of the IRP. The I/O Manager advances the IRP stack pointer and calls the next-higher driver’sIoCompletion routine.
· STATUS_MORE_PROCESSING_REQUIRED—stops the upward completion of the IRP and leaves the IRP stack pointer at its current location. Drivers that return this status usually restart the upward completion of the IRP later by calling theIoCompleteRequest routine.
When every driver has completed its corresponding sub-request, the I/O request is complete. The I/O Manager retrieves the status of the request from theIrp‑>IoStatus.Status field and retrieves the number of bytes transferred from theIrp‑>IoStatus.Information field.
- Handling IRPs 4: Completing an IRP
- Handling IRPs: Definition 1: IRP as a Container for an I/O Request
- Handling IRPs 3: Passing an IRP to the Next Lower Driver
- handling IRPs 15: Building IRPs
- Handling IRPs: Definition 2: IRP as a Thread-Independent Call Stack
- handling IRPs 14: Success, Error, and Warning Status for IRP Completion
- Handling IRPs: Introduction
- Handling IRPs 10: Optimizations
- Handling IRPs 9: Summary of Guidelines for Pending IRPs
- IRP Dispatching and Handling
- Handling IRPs 5: Synchronous I/O Responses
- Handling IRPs 6: Asynchronous I/O Responses
- Handling IRPs 8: Propagating the Pending Bit
- handling IRPs 12: Data Transfer Mechanisms
- handling IRPs 16: Debugging I/O Problems
- Handling IRPs: What Every Driver Writer Needs to Know -翻译
- Handling IRPs 7: IoCompletion Routines and Asynchronous I/O Responses
- Handling IRPs 11: Life Cycle of a File Object
- c#之执行SQL存储过程
- python 抓取腾讯微博数据并做简单的分析
- 数据结构要点归纳总结(转)
- Error: C3065E: type of input file 'XXX' unknown——已解决!
- Handling IRPs 3: Passing an IRP to the Next Lower Driver
- Handling IRPs 4: Completing an IRP
- 开发者所需要知道的iOS7 SDK新特性
- Handling IRPs 5: Synchronous I/O Responses
- 访问存储设备
- [黑马程序员]对两个整数变量的值进行交换的方法总结
- 自动构建 msbuild基础
- Handling IRPs 6: Asynchronous I/O Responses
- WPA Supplicant 在Windows下的编译
- JAVA I/O(一) File类