ReactOS  0.4.14-dev-49-gfb4591c
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 416 of file debug.c.

417 {
418  return 0;
419 }

Referenced by BlStatusPrint(), ClassDebugPrint(), 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 456 of file debug.c.

462 {
463  char Buffer[70];
464 
465  sprintf(Buffer,
466  "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
467  BugCheckCode,
468  (PVOID)BugCheckParameter1,
469  (PVOID)BugCheckParameter2,
470  (PVOID)BugCheckParameter3,
471  (PVOID)BugCheckParameter4);
472 
474  ASSERT(FALSE);
475  for (;;);
476 }
#define sprintf(buf, format,...)
Definition: sprintf.c:55
Definition: bufpool.h:45
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID UiMessageBoxCritical(PCSTR MessageText)
Definition: ui.c:331

◆ MsgBoxPrint()

ULONG MsgBoxPrint ( const char Format,
  ... 
)

Definition at line 424 of file debug.c.

425 {
426  va_list ap;
427  CHAR Buffer[512];
428  ULONG Length;
429 
430  va_start(ap, Format);
431 
432  /* Construct a string */
433  Length = _vsnprintf(Buffer, 512, Format, ap);
434 
435  /* Check if we went past the buffer */
436  if (Length == MAXULONG)
437  {
438  /* Terminate it if we went over-board */
439  Buffer[sizeof(Buffer) - 1] = '\n';
440 
441  /* Put maximum */
442  Length = sizeof(Buffer);
443  }
444 
445  /* Show it as a message box */
447 
448  /* Cleanup and exit */
449  va_end(ap);
450  return 0;
451 }
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
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define MAXULONG
Definition: typedefs.h:250
#define va_start(ap, A)
Definition: acmsvcex.h:91
#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
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34

◆ RtlAssert()

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

Definition at line 480 of file debug.c.

484 {
485  if (Message)
486  {
487  DbgPrint("Assertion \'%s\' failed at %s line %lu: %s\n",
488  (PCHAR)FailedAssertion,
489  (PCHAR)FileName,
490  LineNumber,
491  Message);
492  }
493  else
494  {
495  DbgPrint("Assertion \'%s\' failed at %s line %lu\n",
496  (PCHAR)FailedAssertion,
497  (PCHAR)FileName,
498  LineNumber);
499  }
500 
501  DbgBreakPoint();
502 }
ULONG DbgPrint(PCCH Format,...)
Definition: debug.c:416
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:1206
NTKERNELAPI VOID DbgBreakPoint()
Definition: debug.c:6

Referenced by USBPORT_AssertFailure().

Variable Documentation

◆ BugCheckInfo

ULONG_PTR BugCheckInfo[5]

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

Referenced by FrLdrBugCheckEx(), and FrLdrBugCheckWithMessage().