Writing Shutdown Routines

If a driver has special processing to do before the operating system disappears, a driver should supply a Shutdown routine.

Execution Context

The I/O Manager calls a Shutdown routine during a system shutdown. As described in Table 6.5, the Shutdown routine runs at PASSIVE_LEVEL IRQL, which means it has access to paged system resources.

Table 6.5. Function Prototype for Shutdown Routine
NTSTATUS ShutdownIRQL == PASSIVE_LEVEL
ParameterDescription
IN PRDRIVE_OBJECT pDriverObjectPointer to driver object for this driver
IN PIRP pIrpPointer to shutdown IRP
Return value• STATUS_SUCCESS -or-
 • STATUS_XXX - some error code

What a Shutdown Routine Does

The main purpose of the Shutdown routine is to put the device into a quiescent state ...

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.