I/O Flow through Device Stack
contains a collection of routines that can be called by the I/O Manager.The I/O Manager typically calls a driver routine at the following conditions:i. When a driver is loadedii. When a driver is unloaded or the system is shutting downiii. When a device is inserted or removediv. When a user-mode program issues an I/O request (which is routedthrough the device object)
v. When a shared hardware resource becomes available for driver use
I/O request packets (IRPs) are kernel mode structures that are used to facilitatecommunication between each of the WDM drivers as well as when theoperating system needs to communicate with the drivers.
Life-cycle of IRP:
I. With each user-mode request for I/O, the I/O Manager allocates an IRPfrom nonpaged system memory. The I/O Manager is responsible to passthe IRP to the appropriate driver.II. When the operation is complete, the driver stores a final status code in the
IRP and returns it to the I/O Manager.
III. The I/O Manager uses the information in the IRP to complete the requestand send the user the final status.