if (!UiInitialize(FALSE))
{
UiMessageBoxCritical("Unable to initialize UI.\n");
- return;
+ goto quit;
}
if (!MmInitializeMemoryManager())
{
UiMessageBoxCritical("Unable to initialize memory manager");
- return;
+ goto quit;
}
#ifdef _M_IX86
HalpInitBusHandler();
#endif
RunLoader();
+
+quit:
+ /* If we reach this point, something went wrong before, therefore reboot */
+ DiskStopFloppyMotor();
+ Reboot();
}
// We need to emulate these, because the original ones don't work in freeldr
+// These functions are here, because they need to be in the main compilation unit
+// and cannot be in a library.
int __cdecl wctomb(char *mbchar, wchar_t wchar)
{
*mbchar = (char)wchar;
*wchar = (wchar_t)*mbchar;
return 1;
}
+
+// The wctype table is 144 KB, too much for poor freeldr
+int iswctype(wint_t wc, wctype_t wctypeFlags)
+{
+ return _isctype((char)wc, wctypeFlags);
+}
+