ReactOS  0.4.13-dev-544-gede3fdd
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 420 of file debug.c.

421 {
422  return 0;
423 }

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

466 {
467  char Buffer[70];
468 
469  sprintf(Buffer,
470  "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
471  BugCheckCode,
472  (PVOID)BugCheckParameter1,
473  (PVOID)BugCheckParameter2,
474  (PVOID)BugCheckParameter3,
475  (PVOID)BugCheckParameter4);
476 
478  ASSERT(FALSE);
479  for (;;);
480 }
#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:358

◆ MsgBoxPrint()

ULONG MsgBoxPrint ( const char Format,
  ... 
)

Definition at line 428 of file debug.c.

429 {
430  va_list ap;
431  CHAR Buffer[512];
432  ULONG Length;
433 
434  va_start(ap, Format);
435 
436  /* Construct a string */
437  Length = _vsnprintf(Buffer, 512, Format, ap);
438 
439  /* Check if we went past the buffer */
440  if (Length == MAXULONG)
441  {
442  /* Terminate it if we went over-board */
443  Buffer[sizeof(Buffer) - 1] = '\n';
444 
445  /* Put maximum */
446  Length = sizeof(Buffer);
447  }
448 
449  /* Show it as a message box */
451 
452  /* Cleanup and exit */
453  va_end(ap);
454  return 0;
455 }
char CHAR
Definition: xmlstorage.h:175
#define va_end(ap)
Definition: acmsvcex.h:90
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:347
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 484 of file debug.c.

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

Referenced by USBPORT_AssertFailure().

Variable Documentation

◆ BugCheckInfo

ULONG_PTR BugCheckInfo[5]

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

Referenced by FrLdrBugCheckEx(), and FrLdrBugCheckWithMessage().