ReactOS 0.4.16-dev-746-g329a414
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

VOID DebugInit (_In_ PCSTR DebugString)
 
ULONG DbgPrint (PCCH Format,...)
 
VOID DbgPrint2 (ULONG Mask, ULONG Level, const char *File, ULONG Line, char *Format,...)
 
VOID DebugDumpBuffer (ULONG Mask, PVOID Buffer, ULONG Length)
 
VOID DbgParseDebugChannels (PCHAR Value)
 
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

◆ DbgParseDebugChannels()

VOID DbgParseDebugChannels ( PCHAR  Value)

Definition at line 462 of file debug.c.

463{
465}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

◆ DbgPrint()

ULONG DbgPrint ( PCCH  Format,
  ... 
)

Definition at line 436 of file debug.c.

437{
439 return 0;
440}

◆ DbgPrint2()

VOID DbgPrint2 ( ULONG  Mask,
ULONG  Level,
const char File,
ULONG  Line,
char Format,
  ... 
)

Definition at line 443 of file debug.c.

444{
450}
Definition: File.h:16
unsigned int Mask
Definition: fpcontrol.c:82
Definition: ncftp.h:79
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56

◆ DebugDumpBuffer()

VOID DebugDumpBuffer ( ULONG  Mask,
PVOID  Buffer,
ULONG  Length 
)

Definition at line 453 of file debug.c.

454{
458}
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

◆ DebugInit()

VOID DebugInit ( _In_ PCSTR  DebugString)

Definition at line 429 of file debug.c.

431{
433}
static CCHAR DebugString[256]
Definition: settings.c:16

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

508{
509 char Buffer[70];
510
512 "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
513 BugCheckCode,
514 (PVOID)BugCheckParameter1,
515 (PVOID)BugCheckParameter2,
516 (PVOID)BugCheckParameter3,
517 (PVOID)BugCheckParameter4);
518
520 ASSERT(FALSE);
521 for (;;);
522}
VOID UiMessageBoxCritical(_In_ PCSTR MessageText)
Definition: ui.c:372
#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 470 of file debug.c.

471{
472 va_list ap;
473 CHAR Buffer[512];
475
477
478 /* Construct a string */
479 Length = _vsnprintf(Buffer, 512, Format, ap);
480
481 /* Check if we went past the buffer */
482 if (Length == MAXULONG)
483 {
484 /* Terminate it if we went over-board */
485 Buffer[sizeof(Buffer) - 1] = '\n';
486
487 /* Put maximum */
488 Length = sizeof(Buffer);
489 }
490
491 /* Show it as a message box */
493
494 /* Cleanup and exit */
495 va_end(ap);
496 return 0;
497}
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
#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 526 of file debug.c.

530{
531 if (Message)
532 {
533 DbgPrint("Assertion \'%s\' failed at %s line %lu: %s\n",
534 (PCHAR)FailedAssertion,
537 Message);
538 }
539 else
540 {
541 DbgPrint("Assertion \'%s\' failed at %s line %lu\n",
542 (PCHAR)FailedAssertion,
544 LineNumber);
545 }
546
548}
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 561 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 550 of file debug.c.

Referenced by FrLdrBugCheckEx(), and FrLdrBugCheckWithMessage().