https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d53991895d6753dcdd378…
commit d53991895d6753dcdd3788807c02b6d2f4c0b113
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Aug 8 21:37:22 2018 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 8 21:37:22 2018 +0200
[BOOTLIB] Fix the implementation of RtlAssert() ('Message' can be NULL, and
fix the printing of ANSI string). Fix also the implementation of DbgPrint().
---
boot/environ/lib/misc/rtlcompat.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/boot/environ/lib/misc/rtlcompat.c b/boot/environ/lib/misc/rtlcompat.c
index 06ebf7e35d..6f0c7bf7c0 100644
--- a/boot/environ/lib/misc/rtlcompat.c
+++ b/boot/environ/lib/misc/rtlcompat.c
@@ -72,11 +72,24 @@ RtlAssert (
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
@@ -85,7 +98,7 @@ DbgPrint (
...
)
{
- EfiPrintf(L"%s\r\n", Format);
+ EfiPrintf(L"%S\r\n", Format);
return 0;
}