43 ERR(
"Failed to find or get 'NLS/AnsiCodepage'\n");
52 ERR(
"Failed to find or get 'NLS/OemCodepage'\n");
61 ERR(
"Failed to find or get 'NLS/UnicodeCasetable'\n");
70 WARN(
"Failed to find or get 'NLS/OemHalFont'\n");
72 RtlInitEmptyUnicodeString(&OemHalFileName,
NULL, 0);
75 TRACE(
"NLS data: '%wZ' '%wZ' '%wZ' '%wZ'\n",
76 &AnsiFileName, &OemFileName, &LangFileName, &OemHalFileName);
85 TRACE(
"NLS data loading %s\n",
Success ?
"successful" :
"failed");
111 WARN(
"Failed to find 'BiosInfo/InfName'\n");
116 WARN(
"Failed to read 'InfName' value\n");
127 WARN(
"Could not load '%s'\n", ErrataFilePath);
131 LoaderBlock->Extension->EmInfFileImage =
PaToVa(PhysicalBase);
132 LoaderBlock->Extension->EmInfFileSize =
FileSize;
144 PCSTR Media, DriverName, dirIndex, ImagePath;
147 WCHAR DriverNameW[256];
162 if ((
strcmp(Media,
"x") == 0) &&
168 L"%S\\%S", ImagePath, DriverName);
185 ERR(
"Could not add boot driver '%s'\n", DriverName);
209 TRACE(
"No required filesystem driver\n");
248 PCSTR NextOptions, NextOpt;
258 for (; OptionsToRemove && *OptionsToRemove; ++OptionsToRemove)
260 NextOptions = *OptionsToRemove;
272 if ((OptionLength >= NextOptLength) &&
273 (
_strnicmp(Option, NextOpt, NextOptLength) == 0))
275 if ((OptionLength == NextOptLength) ||
276 (NextOpt[NextOptLength-1] ==
'=') ||
277 (NextOpt[NextOptLength-1] ==
':'))
280 while ((Option > LoadOptions) &&
281 (Option[-1] ==
'/' ||
290 if ((Option > LoadOptions) &&
291 (Option[-1] !=
' ') &&
292 (Option[-1] !=
'\t') &&
317 for (; OptionsToAdd && *OptionsToAdd; ++OptionsToAdd)
341 {
"/DEBUG/DEBUG=",
NULL,
"/NODEBUG"},
344 {
"/DEBUGPORT=SCREEN",
NULL,
"/NOGUIBOOT"},
347 {
"/HAL=/KERNEL=",
NULL,
"/DETECTHAL"},
350 {
"/PAE",
NULL,
"/NOPAE"},
353 {
"/EXECUTE",
"/NOEXECUTE=ALWAYSOFF",
"/NOEXECUTE/NOEXECUTE="},
356 {
"/NOEXECUTE/NOEXECUTE=",
NULL,
"/NOEXECUTE/NOEXECUTE="},
359 {
"/SAFEBOOT/SAFEBOOT:",
NULL,
"/SAFEBOOT/SAFEBOOT:"},
362#define TAG_BOOT_OPTIONS 'pOtB'
368 OUT PSTR* HigherPriorityOptions)
371 PCSTR NextOptions, NextOpt;
374 SIZE_T HighPriorOptsSize = 0;
385 if (HigherPriorityOptions)
386 *HigherPriorityOptions =
NULL;
421 if (HigherPriorityOptions)
431 if (HigherPriorityOptions)
434 if (!*HigherPriorityOptions)
447 *(*ExtraOptions) =
'\0';
448 if (HigherPriorityOptions)
449 *(*HigherPriorityOptions) =
'\0';
495 CHAR UserBootOptions[256];
498 static PCSTR SourcePaths[] =
503#elif defined(_M_MPPC)
505#elif defined(_M_MRX000)
514 if (!ArgValue || !*ArgValue)
516 ERR(
"No 'BootType' value, aborting!\n");
519 if (
_stricmp(ArgValue,
"ReactOSSetup") != 0)
521 ERR(
"Unknown 'BootType' value '%s', aborting!\n", ArgValue);
529 ERR(
"No 'SystemPartition' specified, aborting!\n");
580 if (!*BootPath || BootPath[
strlen(BootPath) - 1] !=
'\\')
583 TRACE(
"BootPath: '%s'\n", BootPath);
611 BootFromFloppy =
strstr(BootPath,
"fdisk") !=
NULL;
615 for (
i = BootFromFloppy ? 0 : 1; ;
i++)
617 SystemPath = SourcePaths[
i];
633 TRACE(
"BootPath: '%s', SystemPath: '%s'\n", BootPath, SystemPath);
639 PCSTR OptionsToRemove[2] = {
"SIFOPTIONSOVERRIDE",
NULL};
647 sizeof(UserBootOptions),
659 PSTR OptionsToAdd[3];
660 PSTR OptionsToRemove[4];
666 WARN(
"Failed to get load options\n");
679 if (
InfFindFirstLine(InfHandle,
"SetupData",
"SetupDebugOptions", &InfContext))
682 WARN(
"Failed to get debug load options\n");
686 DbgLoadOptions =
"/DEBUG";
693 if (LoadOptions && *LoadOptions)
710 OptionsToRemove[0] =
"/NODEBUG";
713 &HigherPriorityOptions);
715 OptionsToRemove[1] = (HigherPriorityOptions ? HigherPriorityOptions :
"");
722 OptionsToAdd[0] = (
PSTR)DbgLoadOptions;
723 OptionsToRemove[2] = (
PSTR)DbgLoadOptions;
725 sizeof(UserBootOptions),
727 (
PCSTR*)OptionsToAdd,
728 (
PCSTR*)OptionsToRemove);
732 if (HigherPriorityOptions)
746 &HigherPriorityOptions);
748 OptionsToRemove[0] = (HigherPriorityOptions ? HigherPriorityOptions :
"");
755 sizeof(UserBootOptions),
757 (
PCSTR*)OptionsToAdd,
758 (
PCSTR*)OptionsToRemove);
762 if (HigherPriorityOptions)
788 TRACE(
"Setup SYSTEM hive %s\n", (
Success ?
"loaded" :
"not loaded"));
800 TRACE(
"Firmware Errata file %s\n", (
Success ?
"loaded" :
"not loaded"));
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
PSTR GetArgumentValue(_In_ ULONG Argc, _In_ PCHAR Argv[], _In_ PCSTR ArgumentName)
PPARTENTRY SystemPartition
ARC_STATUS RamDiskInitialize(IN BOOLEAN InitRamDisk, IN PCSTR LoadOptions OPTIONAL, IN PCSTR DefaultPath OPTIONAL)
#define DBG_DEFAULT_CHANNEL(ch)
FORCEINLINE VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
VOID UiUpdateProgressBar(_In_ ULONG Percentage, _In_opt_ PCSTR ProgressText)
VOID UiDrawBackdrop(VOID)
VOID UiDrawProgressBarCenter(_In_ PCSTR ProgressText)
VOID UiDrawStatusText(PCSTR StatusText)
VOID UiMessageBox(_In_ PCSTR Format,...)
FORCEINLINE PVOID PaToVa(PVOID Pa)
static const WCHAR SystemRoot[]
#define _strnicmp(_String1, _String2, _MaxCount)
struct _FileName FileName
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ HANDLE _In_ ULONG FileNameLength
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOLEAN InfFindFirstLine(HINF InfHandle, PCSTR Section, PCSTR Key, PINFCONTEXT Context)
BOOLEAN InfGetData(PINFCONTEXT Context, PCSTR *Key, PCSTR *Data)
BOOLEAN InfOpenFile(PHINF InfHandle, PCSTR FileName, PULONG ErrorLine)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define UNREFERENCED_PARAMETER(P)
BOOLEAN WinLdrLoadNLSData(_Inout_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ PCSTR DirectoryPath, _In_ PCUNICODE_STRING AnsiFileName, _In_ PCUNICODE_STRING OemFileName, _In_ PCUNICODE_STRING LangFileName, _In_ PCUNICODE_STRING OemHalFileName)
BOOLEAN WinLdrAddDriverToList(_Inout_ PLIST_ENTRY DriverListHead, _In_ BOOLEAN InsertAtHead, _In_ PCWSTR DriverName, _In_opt_ PCWSTR ImagePath, _In_opt_ PCWSTR GroupName, _In_ ULONG ErrorControl, _In_ ULONG Tag)
Inserts the specified driver entry into the driver list, or updates an existing entry with new ImageP...
FORCEINLINE VOID UiResetForSOS(VOID)
BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot, IN BOOLEAN Setup)
PCSTR NtLdrGetOptionExN(IN PCSTR Options, IN PCCH OptionName, IN ULONG OptNameLength, OUT PULONG OptionLength OPTIONAL)
PCSTR NtLdrGetOption(IN PCSTR Options, IN PCSTR OptionName)
PCSTR NtLdrGetNextOption(IN OUT PCSTR *Options, OUT PULONG OptionLength OPTIONAL)
VOID NtLdrAddOptions(IN OUT PSTR LoadOptions, IN ULONG BufferSize, IN BOOLEAN Append, IN PCSTR NewOptions OPTIONAL)
PCSTR NtLdrGetOptionEx(IN PCSTR Options, IN PCSTR OptionName, OUT PULONG OptionLength OPTIONAL)
NTSTRSAFEAPI RtlStringCbCatA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define _WIN32_WINNT_WS03
#define SETUPLDR_TEXT_MODE
VOID NtLdrUpdateLoadOptions(IN OUT PSTR LoadOptions, IN ULONG BufferSize, IN BOOLEAN Append, IN PCSTR OptionsToAdd[] OPTIONAL, IN PCSTR OptionsToRemove[] OPTIONAL)
static VOID SetupLdrLoadNlsData(_Inout_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ HINF InfHandle, _In_ PCSTR SearchPath)
ARC_STATUS LoadReactOSSetup(IN ULONG Argc, IN PCHAR Argv[], IN PCHAR Envp[])
static VOID SetupLdrScanBootDrivers(_Inout_ PLIST_ENTRY BootDriverListHead, _In_ HINF InfHandle, _In_ PCSTR SearchPath)
VOID NtLdrGetHigherPriorityOptions(IN PCSTR BootOptions, OUT PSTR *ExtraOptions, OUT PSTR *HigherPriorityOptions)
static BOOLEAN SetupLdrInitErrataInf(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN HINF InfHandle, IN PCSTR SystemRoot)
static const struct @180 HighPriorOptionsMap[]
VOID AllocateAndInitLPB(IN USHORT VersionToBoot, OUT PLOADER_PARAMETER_BLOCK *OutLoaderBlock)
PULONG MinorVersion OPTIONAL
LIST_ENTRY BootDriverListHead
struct _SETUP_LOADER_BLOCK * SetupLdrBlock
SETUP_LOADER_BLOCK SetupBlock
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
BOOLEAN InfGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
VOID InfCloseFile(HINF InfHandle)
BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
ARC_STATUS LoadAndBootWindowsCommon(IN USHORT OperatingSystemVersion, IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR BootOptions, IN PCSTR BootPath)
PVOID WinLdrLoadModule(PCSTR ModuleName, PULONG Size, TYPE_OF_MEMORY MemoryType)
PLOADER_SYSTEM_BLOCK WinLdrSystemBlock
#define SERVICE_ERROR_CRITICAL
#define SERVICE_ERROR_NORMAL