ReactOS 0.4.15-dev-7834-g00c4b3d
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 432 of file debug.c.

433{
434 return 0;
435}

◆ 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 472 of file debug.c.

478{
479 char Buffer[70];
480
482 "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
483 BugCheckCode,
484 (PVOID)BugCheckParameter1,
485 (PVOID)BugCheckParameter2,
486 (PVOID)BugCheckParameter3,
487 (PVOID)BugCheckParameter4);
488
490 ASSERT(FALSE);
491 for (;;);
492}
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 440 of file debug.c.

441{
442 va_list ap;
443 CHAR Buffer[512];
445
447
448 /* Construct a string */
449 Length = _vsnprintf(Buffer, 512, Format, ap);
450
451 /* Check if we went past the buffer */
452 if (Length == MAXULONG)
453 {
454 /* Terminate it if we went over-board */
455 Buffer[sizeof(Buffer) - 1] = '\n';
456
457 /* Put maximum */
458 Length = sizeof(Buffer);
459 }
460
461 /* Show it as a message box */
463
464 /* Cleanup and exit */
465 va_end(ap);
466 return 0;
467}
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 496 of file debug.c.

500{
501 if (Message)
502 {
503 DbgPrint("Assertion \'%s\' failed at %s line %lu: %s\n",
504 (PCHAR)FailedAssertion,
507 Message);
508 }
509 else
510 {
511 DbgPrint("Assertion \'%s\' failed at %s line %lu\n",
512 (PCHAR)FailedAssertion,
514 LineNumber);
515 }
516
518}
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 531 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 520 of file debug.c.

Referenced by FrLdrBugCheckEx(), and FrLdrBugCheckWithMessage().