Writing I/O Completion Routines

An I/O Completion routine is an I/O Manager callback that notifies a higher-level driver when the lower-level driver has finished work on an IRP. This section explains how to use I/O Completion routines in intermediate drivers.

Requesting an I/O Completion Callback

To regain control of an IRP after it has been processed by a lower-level driver, use IoSetCompletionRoutine (described in Table 15.1). This function puts the address of an I/O Completion routine in the IRP stack location associated with the next lower driver. When some lower-level driver calls IoCompleteRequest, the I/O Completion routine executes as the IRP bubbles its way back to the top of the driver hierarchy.

Except for the driver on the bottom, ...

Get Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.