The KeRegisterNmiCallback routine registers a routine to be called whenever a nonmaskable interrupt (NMI) occurs.
PVOID
KeRegisterNmiCallback(
PNMI_CALLBACK CallbackRoutine,
PVOID Context
);
BOOLEAN XxxNmiCallback(IN PVOID Context, IN BOOLEAN Handled);
On success, KeRegisterNmiCallback returns an opaque pointer that the caller passes to KeDeregisterNmiCallback to deregister the callback. The routine returns NULL if it is unable to register the callback.
Declared in ntddk.h. Include ntddk.h.
KeRegisterNmiCallback is only available in Windows Server 2003 and later operating systems.
When a nonmaskable interrupt occurs, the system calls each registered callback in reverse order from the order in which they were registered. For the first callback, the system passes FALSE as the Handled parameter. For each subsequent callback, if any previous callback returned TRUE, the system passes TRUE as the Handled parameter, otherwise it passes FALSE. If any callback returns a value of TRUE, the system considers the interrupt to have been handled. Otherwise, the system calls the HAL's default handler for the interrupt, which normally bugchecks the system.
The callback routine must be able to be run at IRQL = HIGH_LEVEL.
KeRegisterNmiCallback routine can only be called at IRQL <= APC_LEVEL.