From bf571b10a065ff7557aca28e9e5aab0e92316d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 25 Jan 2017 22:43:04 +0000 Subject: [PATCH] [XDK]: Do not always redefine the ASSERT(MSG) macros with the NT_xxx ones, especially for the FreeLdr/... bootloader (where we don't use WinDbg for debugging, yet), because in this case the int 0x2c is hardly informative. We fall back to the good old RtlAssert which displays an assertion failure string in the default debug output port (e.g. serial), and then does an int 0x03. [FREELDR] - "static"-ify some printing helper functions; - hide the textmode cursor before blue-screening; - disable interrupts before hanging forever. svn path=/trunk/; revision=73596 --- reactos/boot/freeldr/freeldr/arch/i386/i386bug.c | 14 +++++++++----- reactos/sdk/include/xdk/rtlfuncs.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c b/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c index b938da2b871..aeed9adfb7d 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c @@ -35,7 +35,7 @@ char *i386ExceptionDescriptionText[] = #define SCREEN_ATTR 0x1F // Bright white on blue background -void +static void i386PrintChar(char chr, ULONG x, ULONG y) { MachVideoPutChar(chr, SCREEN_ATTR, x, y); @@ -45,7 +45,7 @@ i386PrintChar(char chr, ULONG x, ULONG y) ULONG i386_ScreenPosX = 0; ULONG i386_ScreenPosY = 0; -void +static void i386PrintText(char *pszText) { char chr; @@ -66,7 +66,7 @@ i386PrintText(char *pszText) } } -void +static void PrintText(const char *format, ...) { va_list argptr; @@ -79,7 +79,7 @@ PrintText(const char *format, ...) i386PrintText(buffer); } -void +static void i386PrintFrames(PKTRAP_FRAME TrapFrame) { FRAME *Frame; @@ -105,6 +105,7 @@ i386PrintExceptionText(ULONG TrapIndex, PKTRAP_FRAME TrapFrame, PKSPECIAL_REGIST { PUCHAR InstructionPointer; + MachVideoHideShowTextCursor(FALSE); MachVideoClearScreen(SCREEN_ATTR); i386_ScreenPosX = 0; i386_ScreenPosY = 0; @@ -182,7 +183,7 @@ FrLdrBugCheckWithMessage( CHAR Buffer[1024]; va_list argptr; - /* Blue screen for the win */ + MachVideoHideShowTextCursor(FALSE); MachVideoClearScreen(SCREEN_ATTR); i386_ScreenPosX = 0; i386_ScreenPosY = 0; @@ -215,6 +216,7 @@ FrLdrBugCheckEx( PCHAR File, ULONG Line) { + MachVideoHideShowTextCursor(FALSE); MachVideoClearScreen(SCREEN_ATTR); i386_ScreenPosX = 0; i386_ScreenPosY = 0; @@ -231,6 +233,8 @@ FrLdrBugCheckEx( PrintText("Bug Information:\n %p\n %p\n %p\n %p\n %p\n\n", BugCheckInfo[0], BugCheckInfo[1], BugCheckInfo[2], BugCheckInfo[3], BugCheckInfo[4]); + _disable(); + __halt(); for (;;); } diff --git a/reactos/sdk/include/xdk/rtlfuncs.h b/reactos/sdk/include/xdk/rtlfuncs.h index b3e82b80925..821a644f9f4 100644 --- a/reactos/sdk/include/xdk/rtlfuncs.h +++ b/reactos/sdk/include/xdk/rtlfuncs.h @@ -3314,7 +3314,7 @@ RtlCheckBit( # define NT_ASSERTMSGW NT_ASSERTMSGW_NOASSUME #endif /* NT_ASSERT_ALWAYS_ASSUMES */ -#if defined(_MSC_VER) && (defined(__REACTOS__) || defined(ASSERT_ALWAYS_NT_ASSERT)) +#if defined(_MSC_VER) && (defined(__REACTOS__) || defined(ASSERT_ALWAYS_NT_ASSERT)) && !defined(_BLDR_) #undef ASSERT #define ASSERT NT_ASSERT #undef ASSERTMSG