mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 17:00:51 +08:00
[FREELDR] Make ASSERT bugcheck on failure (#8730)
Show a bugcheck with message showing where and why the ASSERT failed.
This commit is contained in:
@@ -30,7 +30,7 @@ FrLdrBugCheckWithMessage(
|
||||
ULONG BugCode,
|
||||
PCHAR File,
|
||||
ULONG Line,
|
||||
PSTR Format,
|
||||
PCSTR Format,
|
||||
...)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ FrLdrBugCheckWithMessage(
|
||||
ULONG BugCode,
|
||||
PCHAR File,
|
||||
ULONG Line,
|
||||
PSTR Format,
|
||||
PCSTR Format,
|
||||
...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
@@ -146,7 +146,7 @@ FrLdrBugCheckWithMessage(
|
||||
ULONG BugCode,
|
||||
PCHAR File,
|
||||
ULONG Line,
|
||||
PSTR Format,
|
||||
PCSTR Format,
|
||||
...);
|
||||
|
||||
/* Bugcheck codes */
|
||||
@@ -156,6 +156,7 @@ enum _FRLDR_BUGCHECK_CODES
|
||||
MISSING_HARDWARE_REQUIREMENTS,
|
||||
FREELDR_IMAGE_CORRUPTION,
|
||||
MEMORY_INIT_FAILURE,
|
||||
ASSERT_FAILURE,
|
||||
#ifdef UEFIBOOT
|
||||
EXIT_BOOTSERVICES_FAILURE,
|
||||
#endif
|
||||
|
||||
@@ -524,9 +524,21 @@ RtlAssert(IN PVOID FailedAssertion,
|
||||
IN ULONG LineNumber,
|
||||
IN PCHAR Message OPTIONAL)
|
||||
{
|
||||
PCSTR Format;
|
||||
|
||||
if (Message)
|
||||
{
|
||||
DbgPrint("Assertion \'%s\' failed at %s line %lu: %s\n",
|
||||
Format = "Assertion \'%s\' failed at %s line %lu: %s\n";
|
||||
|
||||
DbgPrint(Format,
|
||||
(PCHAR)FailedAssertion,
|
||||
(PCHAR)FileName,
|
||||
LineNumber,
|
||||
Message);
|
||||
|
||||
FrLdrBugCheckWithMessage(
|
||||
ASSERT_FAILURE, FileName, LineNumber,
|
||||
Format,
|
||||
(PCHAR)FailedAssertion,
|
||||
(PCHAR)FileName,
|
||||
LineNumber,
|
||||
@@ -534,7 +546,16 @@ RtlAssert(IN PVOID FailedAssertion,
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgPrint("Assertion \'%s\' failed at %s line %lu\n",
|
||||
Format = "Assertion \'%s\' failed at %s line %lu\n";
|
||||
|
||||
DbgPrint(Format,
|
||||
(PCHAR)FailedAssertion,
|
||||
(PCHAR)FileName,
|
||||
LineNumber);
|
||||
|
||||
FrLdrBugCheckWithMessage(
|
||||
ASSERT_FAILURE, FileName, LineNumber,
|
||||
Format,
|
||||
(PCHAR)FailedAssertion,
|
||||
(PCHAR)FileName,
|
||||
LineNumber);
|
||||
@@ -549,6 +570,7 @@ char *BugCodeStrings[] =
|
||||
"MISSING_HARDWARE_REQUIREMENTS",
|
||||
"FREELDR_IMAGE_CORRUPTION",
|
||||
"MEMORY_INIT_FAILURE",
|
||||
"ASSERT_FAILURE",
|
||||
#ifdef UEFIBOOT
|
||||
"EXIT_BOOTSERVICES_FAILURE",
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user