ReactOS 0.4.15-dev-8100-g1887773
debug.c File Reference
#include <freeldr.h>
#include <debug.h>
Include dependency graph for debug.c:

Go to the source code of this file.

Functions

ULONG DbgPrint (PCCH Format,...)
 
ULONG MsgBoxPrint (const char *Format,...)
 
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx (IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
 
VOID NTAPI RtlAssert (IN PVOID FailedAssertion, IN PVOID FileName, IN ULONG LineNumber, IN PCHAR Message OPTIONAL)
 

Variables

charBugCodeStrings []
 
ULONG_PTR BugCheckInfo [5]
 

Function Documentation

◆ DbgPrint()

ULONG DbgPrint ( PCCH  Format,
  ... 
)

Definition at line 428 of file debug.c.

429{
430 return 0;
431}

◆ KeBugCheckEx()

DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx ( IN ULONG  BugCheckCode,
IN ULONG_PTR  BugCheckParameter1,
IN ULONG_PTR  BugCheckParameter2,
IN ULONG_PTR  BugCheckParameter3,
IN ULONG_PTR  BugCheckParameter4 
)

Definition at line 468 of file debug.c.

474{
475 char Buffer[70];
476
478 "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
479 BugCheckCode,
480 (PVOID)BugCheckParameter1,
481 (PVOID)BugCheckParameter2,
482 (PVOID)BugCheckParameter3,
483 (PVOID)BugCheckParameter4);
484
486 ASSERT(FALSE);
487 for (;;);
488}
VOID UiMessageBoxCritical(_In_ PCSTR MessageText)
Definition: ui.c:372
Definition: bufpool.h:45
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44
#define sprintf(buf, format,...)
Definition: sprintf.c:55

◆ MsgBoxPrint()

ULONG MsgBoxPrint ( const char Format,
  ... 
)

Definition at line 436 of file debug.c.

437{
438 va_list ap;
439 CHAR Buffer[512];
441
443
444 /* Construct a string */
445 Length = _vsnprintf(Buffer, 512, Format, ap);
446
447 /* Check if we went past the buffer */
448 if (Length == MAXULONG)
449 {
450 /* Terminate it if we went over-board */
451 Buffer[sizeof(Buffer) - 1] = '\n';
452
453 /* Put maximum */
454 Length = sizeof(Buffer);
455 }
456
457 /* Show it as a message box */
459
460 /* Cleanup and exit */
461 va_end(ap);
462 return 0;
463}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
VOID UiMessageBox(_In_ PCSTR Format,...)
Definition: ui.c:359
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define MAXULONG
Definition: typedefs.h:251
uint32_t ULONG
Definition: typedefs.h:59
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
#define _vsnprintf
Definition: xmlstorage.h:202
char CHAR
Definition: xmlstorage.h:175

◆ RtlAssert()

VOID NTAPI RtlAssert ( IN PVOID  FailedAssertion,
IN PVOID  FileName,
IN ULONG  LineNumber,
IN PCHAR Message  OPTIONAL 
)

Definition at line 492 of file debug.c.

496{
497 if (Message)
498 {
499 DbgPrint("Assertion \'%s\' failed at %s line %lu: %s\n",
500 (PCHAR)FailedAssertion,
503 Message);
504 }
505 else
506 {
507 DbgPrint("Assertion \'%s\' failed at %s line %lu\n",
508 (PCHAR)FailedAssertion,
510 LineNumber);
511 }
512
514}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
static const WCHAR Message[]
Definition: register.c:74
#define DbgPrint
Definition: hal.h:12
NTSYSAPI void WINAPI DbgBreakPoint(void)
char * PCHAR
Definition: typedefs.h:51

Referenced by USBPORT_AssertFailure().

Variable Documentation

◆ BugCheckInfo

ULONG_PTR BugCheckInfo[5]

Definition at line 527 of file debug.c.

Referenced by FrLdrBugCheckEx().

◆ BugCodeStrings

char* BugCodeStrings[]
Initial value:
=
{
"TEST_BUGCHECK",
"MISSING_HARDWARE_REQUIREMENTS",
"FREELDR_IMAGE_CORRUPTION",
"MEMORY_INIT_FAILURE",
}

Definition at line 516 of file debug.c.

Referenced by FrLdrBugCheckEx(), and FrLdrBugCheckWithMessage().