handling NMI interrupts on WinXPe

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I want to handle the NMI interrupt on WinXpe.

The following thread comes to the conclusion that you can not use
KeRegisterNmiCallback() because it does not work, but you can use
KeRegisterBugCheckCallback() instead.

http://groups.google.ch/group/microsoft.public.windowsxp.embedded/browse_thread/thread/fe6409d36fcf9d23/8a8863d71625c945?lnk=st&q=nmi+group%3Amicrosoft.public.windowsxp.embedded.*&rnum=1&hl=de#8a8863d71625c945


So I tried to implement an NMI callback with the following code, but my
NMI callback routine seems not to be called on NMI because the
processor does not halt on NMI.

Could someone give me a hint what is wrong with my NMI handler? Do you
have sample code for an NMI callback initialisation?

/*** CALLBACK ROUTINE ****/
VOID MyBugCheckSecondaryDumpDataCallback(
KBUGCHECK_CALLBACK_REASON Reason,
PKBUGCHECK_REASON_CALLBACK_RECORD gpReasonCallbackRecord,
PVOID ReasonSpecificData, ULONG ReasonSpecificDataLength)
{
OutputDebugString ("NMI CALLBACK ROUTINE CALLED!");
_asm{
cli
hlt
}
}

/*** CODE IN DriverEntry TO SETUP CALLBACK ****/
....
gpReasonCallbackRecord=MmAllocateNonCachedMemory(
sizeof (KBUGCHECK_REASON_CALLBACK_RECORD));
if(gpReasonCallbackRecord)
{
KeInitializeCallbackRecord(gpReasonCallbackRecord);
bCallbackRegistered =
KeRegisterBugCheckReasonCallback(gpReasonCallbackRecord,
MyBugCheckSecondaryDumpDataCallback,
KbCallbackSecondaryDumpData, CRASH_STRING);
if(!bCallbackRegistered)
OutputDebugString("BugCheckReason callback NOT registered\n");
}
....

.