BOOLEAN DebugStartOfLine = TRUE;
+// We need to emulate these, because the original ones don't work in freeldr
+int __cdecl wctomb(char *mbchar, wchar_t wchar)
+{
+ *mbchar = wchar;
+ return 1;
+}
+
+int __cdecl mbtowc (wchar_t *wchar, const char *mbchar, size_t count)
+{
+ *wchar = *mbchar;
+ return 1;
+}
+
VOID DebugInit(VOID)
{
if (DebugPort & RS232)
case DPRINT_HWDETECT:
DbgPrint("HWDETECT: ");
break;
+ case DPRINT_PELOADER:
+ DbgPrint("PELOADER: ");
+ break;
+ case DPRINT_SCSIPORT:
+ DbgPrint("SCSIPORT: ");
+ break;
default:
DbgPrint("UNKNOWN: ");
break;
return;
}
+ // Disable file/line for scsiport messages
+ if (Mask & DPRINT_SCSIPORT)
+ {
+ DebugStartOfLine = FALSE;
+ }
+
// Print the header if we have started a new line
if (DebugStartOfLine)
{
return 0;
}
+NTKERNELAPI
+VOID
+NTAPI
+KeBugCheckEx(
+ IN ULONG BugCheckCode,
+ IN ULONG_PTR BugCheckParameter1,
+ IN ULONG_PTR BugCheckParameter2,
+ IN ULONG_PTR BugCheckParameter3,
+ IN ULONG_PTR BugCheckParameter4)
+{
+ char Buffer[70];
+ sprintf(Buffer, "*** STOP: 0x%08lX (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)",
+ BugCheckCode, BugCheckParameter1, BugCheckParameter2,
+ BugCheckParameter3, BugCheckParameter4);
+ UiMessageBoxCritical(Buffer);
+ assert(FALSE);
+ for (;;);
+}