mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 03:07:05 +00:00
KeBugCheck() calls KeBugCheckEx().
KeBugCheckEx() displays additional bug message. svn path=/trunk/; revision=2498
This commit is contained in:
parent
1208d849d0
commit
25c85c7dfe
1 changed files with 75 additions and 70 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* ReactOS kernel
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002 ReactOS Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: bug.c,v 1.18 2001/04/17 04:11:00 dwelch Exp $
|
/* $Id: bug.c,v 1.19 2002/01/10 00:59:32 ekohl Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/ke/bug.c
|
* FILE: ntoskrnl/ke/bug.c
|
||||||
|
@ -53,13 +53,13 @@ KeInitializeBugCheck(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN STDCALL
|
BOOLEAN STDCALL
|
||||||
KeDeregisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord)
|
KeDeregisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN STDCALL
|
BOOLEAN STDCALL
|
||||||
KeRegisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord,
|
KeRegisterBugCheckCallback(PKBUGCHECK_CALLBACK_RECORD CallbackRecord,
|
||||||
PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine,
|
PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine,
|
||||||
PVOID Buffer,
|
PVOID Buffer,
|
||||||
ULONG Length,
|
ULONG Length,
|
||||||
|
@ -74,7 +74,7 @@ KeRegisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord,
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
KeBugCheckEx (ULONG BugCheckCode,
|
KeBugCheckEx(ULONG BugCheckCode,
|
||||||
ULONG BugCheckParameter1,
|
ULONG BugCheckParameter1,
|
||||||
ULONG BugCheckParameter2,
|
ULONG BugCheckParameter2,
|
||||||
ULONG BugCheckParameter3,
|
ULONG BugCheckParameter3,
|
||||||
|
@ -88,11 +88,44 @@ KeBugCheckEx (ULONG BugCheckCode,
|
||||||
* RETURNS: Doesn't
|
* RETURNS: Doesn't
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
PRTL_MESSAGE_RESOURCE_ENTRY Message;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* PJS: disable interrupts first, then do the rest */
|
/* PJS: disable interrupts first, then do the rest */
|
||||||
__asm__("cli\n\t");
|
__asm__("cli\n\t");
|
||||||
DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode,
|
DbgPrint("Bug detected (code %x param %x %x %x %x)\n",
|
||||||
BugCheckParameter1,BugCheckParameter2,BugCheckParameter3,
|
BugCheckCode,
|
||||||
|
BugCheckParameter1,
|
||||||
|
BugCheckParameter2,
|
||||||
|
BugCheckParameter3,
|
||||||
BugCheckParameter4);
|
BugCheckParameter4);
|
||||||
|
|
||||||
|
Status = RtlFindMessage((PVOID)KERNEL_BASE, //0xC0000000,
|
||||||
|
11, //RT_MESSAGETABLE,
|
||||||
|
0x09, //0x409,
|
||||||
|
BugCheckCode,
|
||||||
|
&Message);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
if (Message->Flags == 0)
|
||||||
|
DbgPrint(" %s\n", Message->Text);
|
||||||
|
else
|
||||||
|
DbgPrint(" %S\n", (PWSTR)Message->Text);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DbgPrint(" No message text found!\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (InBugCheck == 1)
|
||||||
|
{
|
||||||
|
DbgPrint("Recursive bug check halting now\n");
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
__asm__("hlt\n\t");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
InBugCheck = 1;
|
||||||
if (PsGetCurrentProcess() != NULL)
|
if (PsGetCurrentProcess() != NULL)
|
||||||
{
|
{
|
||||||
DbgPrint("Pid: %x <", PsGetCurrentProcess()->UniqueProcessId);
|
DbgPrint("Pid: %x <", PsGetCurrentProcess()->UniqueProcessId);
|
||||||
|
@ -119,7 +152,7 @@ KeBugCheckEx (ULONG BugCheckCode,
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
KeBugCheck (ULONG BugCheckCode)
|
KeBugCheck(ULONG BugCheckCode)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Brings the system down in a controlled manner when an
|
* FUNCTION: Brings the system down in a controlled manner when an
|
||||||
* inconsistency that might otherwise cause corruption has been detected
|
* inconsistency that might otherwise cause corruption has been detected
|
||||||
|
@ -128,35 +161,7 @@ KeBugCheck (ULONG BugCheckCode)
|
||||||
* RETURNS: Doesn't
|
* RETURNS: Doesn't
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
__asm__("cli\n\t");
|
KeBugCheckEx(BugCheckCode, 0, 0, 0, 0);
|
||||||
DbgPrint("Bug detected (code %x)\n", BugCheckCode);
|
|
||||||
if (InBugCheck == 1)
|
|
||||||
{
|
|
||||||
DbgPrint("Recursive bug check halting now\n");
|
|
||||||
for(;;);
|
|
||||||
}
|
|
||||||
InBugCheck = 1;
|
|
||||||
if (PsGetCurrentProcess() != NULL)
|
|
||||||
{
|
|
||||||
DbgPrint("Pid: %x <", PsGetCurrentProcess()->UniqueProcessId);
|
|
||||||
DbgPrint("%.8s> ", PsGetCurrentProcess()->ImageFileName);
|
|
||||||
}
|
|
||||||
if (PsGetCurrentThread() != NULL)
|
|
||||||
{
|
|
||||||
DbgPrint("Thrd: %x Tid: %x\n",
|
|
||||||
PsGetCurrentThread(),
|
|
||||||
PsGetCurrentThread()->Cid.UniqueThread);
|
|
||||||
}
|
|
||||||
// PsDumpThreads();
|
|
||||||
KeDumpStackFrames((PULONG)__builtin_frame_address(0));
|
|
||||||
#if 1
|
|
||||||
for(;;)
|
|
||||||
{
|
|
||||||
__asm__("hlt\n\t");
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
for(;;);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue