Previous Next

KeRegisterNmiCallback

The KeRegisterNmiCallback routine registers a routine to be called whenever a nonmaskable interrupt (NMI) occurs.

PVOID
  KeRegisterNmiCallback(
    PNMI_CALLBACK  CallbackRoutine,
    PVOID  Context
    );

Parameters

CallbackRoutine
Pointer to a function of the form:
BOOLEAN
XxxNmiCallback(IN PVOID Context, IN BOOLEAN Handled);
Context
Specifies the value to be passed as the Context parameter of XxxNmiCallback when it is called.

Return Value

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.

Headers

Declared in ntddk.h. Include ntddk.h.

Comments

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.

See Also

KeDeregisterNmiCallback