[BOOTLIB] Fix the implementation of RtlAssert() ('Message' can be NULL, and fix the...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 8 Aug 2018 19:37:22 +0000 (21:37 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 8 Aug 2018 19:37:22 +0000 (21:37 +0200)
boot/environ/lib/misc/rtlcompat.c

index 06ebf7e..6f0c7bf 100644 (file)
@@ -72,11 +72,24 @@ RtlAssert (
     IN PCHAR Message OPTIONAL
     )
 {
     IN PCHAR Message OPTIONAL
     )
 {
-    EfiPrintf(L"*** ASSERTION %s FAILED AT %d in %s (%s) ***\r\n",
-              FailedAssertion,
-              LineNumber,
-              FileName,
-              Message);
+    if (Message != NULL)
+    {
+        EfiPrintf(L"*** ASSERTION \'%S\' FAILED AT line %lu in %S (%S) ***\r\n",
+                  (PCHAR)FailedAssertion,
+                  LineNumber,
+                  (PCHAR)FileName,
+                  Message);
+    }
+    else
+    {
+        EfiPrintf(L"*** ASSERTION \'%S\' FAILED AT line %lu in %S ***\r\n",
+                  (PCHAR)FailedAssertion,
+                  LineNumber,
+                  (PCHAR)FileName);
+    }
+
+    /* Issue a breakpoint */
+    __debugbreak();
 }
 
 ULONG
 }
 
 ULONG
@@ -85,7 +98,7 @@ DbgPrint (
     ...
     )
 {
     ...
     )
 {
-    EfiPrintf(L"%s\r\n", Format);
+    EfiPrintf(L"%S\r\n", Format);
     return 0;
 }
 
     return 0;
 }