ReactOS  0.4.15-dev-1389-g828d5fa
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 427 of file debug.c.

428 {
429  return 0;
430 }

Referenced by BlStatusPrint(), Fast486DumpState(), PciDebugDumpQueryCapabilities(), and RtlAssert().

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

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

◆ MsgBoxPrint()

ULONG MsgBoxPrint ( const char Format,
  ... 
)

Definition at line 435 of file debug.c.

436 {
437  va_list ap;
438  CHAR Buffer[512];
439  ULONG Length;
440 
441  va_start(ap, Format);
442 
443  /* Construct a string */
444  Length = _vsnprintf(Buffer, 512, Format, ap);
445 
446  /* Check if we went past the buffer */
447  if (Length == MAXULONG)
448  {
449  /* Terminate it if we went over-board */
450  Buffer[sizeof(Buffer) - 1] = '\n';
451 
452  /* Put maximum */
453  Length = sizeof(Buffer);
454  }
455 
456  /* Show it as a message box */
458 
459  /* Cleanup and exit */
460  va_end(ap);
461  return 0;
462 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
char CHAR
Definition: xmlstorage.h:175
#define va_end(ap)
Definition: acmsvcex.h:90
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:320
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
va_start(ap, x)
#define MAXULONG
Definition: typedefs.h:251
#define _vsnprintf
Definition: xmlstorage.h:202
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
unsigned int ULONG
Definition: retypes.h:1

◆ RtlAssert()

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

Definition at line 491 of file debug.c.

495 {
496  if (Message)
497  {
498  DbgPrint("Assertion \'%s\' failed at %s line %lu: %s\n",
499  (PCHAR)FailedAssertion,
500  (PCHAR)FileName,
501  LineNumber,
502  Message);
503  }
504  else
505  {
506  DbgPrint("Assertion \'%s\' failed at %s line %lu\n",
507  (PCHAR)FailedAssertion,
508  (PCHAR)FileName,
509  LineNumber);
510  }
511 
512  DbgBreakPoint();
513 }
ULONG DbgPrint(PCCH Format,...)
Definition: debug.c:427
signed char * PCHAR
Definition: retypes.h:7
CHAR Message[80]
Definition: alive.c:5
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:1216
NTKERNELAPI VOID DbgBreakPoint()
Definition: debug.c:6

Referenced by USBPORT_AssertFailure().

Variable Documentation

◆ BugCheckInfo

ULONG_PTR BugCheckInfo[5]

Definition at line 523 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 515 of file debug.c.

Referenced by FrLdrBugCheckEx(), and FrLdrBugCheckWithMessage().