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.
NTSTATUS Shutdown | IRQL == PASSIVE_LEVEL |
---|---|
Parameter | Description |
IN PRDRIVE_OBJECT pDriverObject | Pointer to driver object for this driver |
IN PIRP pIrp | Pointer 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.