The BugCheckCallback routine is executed whenever the system issues a bug check.
VOID
BugCheckCallback(
IN PVOID Buffer,
IN ULONG Length
);
None
Drivers can supply a BugCheckCallback that resets the device to a known state if the system issues a bug check.
Use KeRegisterBugCheckCallback to register a BugCheckCallback routine. A driver can subsequently remove the callback by using the KeDeregisterBugCheckCallback routine. If the driver can be unloaded, it must remove any registered callbacks in its Unload routine.
A BugCheckCallback routine is strongly restricted in the actions it can take. For more information, see Writing a Bug Check Callback Routine. The routine can safely use the READ_PORT_XXX, READ_REGISTER_XXX, WRITE_PORT_XXX, and WRITE_REGISTER_XXX routines to interact with the device.
Drivers that require more sophisticated interaction with the system as it issues a bug check can instead implement BugCheckDumpIoCallback or BugCheckSecondaryDumpDataCallback routines.
Note that beginning with the Windows XP SP1 and Windows Server 2003 operating systems, BugCheckCallback routines execute after the system crash dump file has already been written. (On earlier operating systems, the routines execute before the crash dump file is written.) Thus, any data that is stored in the buffer specified by the Buffer parameter will not appear in the crash dump file. Drivers that are required to write data to the crash dump file instead implement a BugCheckSecondaryDumpDataCallback routine. (On earlier operating systems, the data written to Buffer does appear in the crash dump file.)
BugCheckCallback routines execute at IRQL = HIGH_LEVEL.
KeDeregisterBugCheckCallback, KeRegisterBugCheckCallback, BugCheckDumpIoCallback, BugCheckSecondaryDumpDataCallback