479{
495 CHAR UserBootOptions[256];
497
498 static PCSTR SourcePaths[] =
499 {
500 "",
501#if defined(_M_IX86)
502 "I386\\",
503#elif defined(_M_MPPC)
504 "PPC\\",
505#elif defined(_M_MRX000)
506 "MIPS\\",
507#endif
508 "reactos\\",
510 };
511
512
514 if (!ArgValue || !*ArgValue)
515 {
516 ERR(
"No 'BootType' value, aborting!\n");
518 }
519 if (
_stricmp(ArgValue,
"ReactOSSetup") != 0)
520 {
521 ERR(
"Unknown 'BootType' value '%s', aborting!\n", ArgValue);
523 }
524
525
528 {
529 ERR(
"No 'SystemPartition' specified, aborting!\n");
531 }
532
533
537
538
541 if (ArgValue)
542 {
544 }
545 else
546 {
547
548
549
550
551
552
553
555 }
556
557
558
559
560
561
562
564 {
565
567
568
570
571
574
575
577 }
578
579
580 if (!*BootPath || BootPath[
strlen(BootPath) - 1] !=
'\\')
582
583 TRACE(
"BootPath: '%s'\n", BootPath);
584
585
586
587
588
592
594
595
598 {
599
602 {
607 }
608 }
609
610
611 BootFromFloppy =
strstr(BootPath,
"fdisk") !=
NULL;
612
613
615 for (
i = BootFromFloppy ? 0 : 1; ;
i++)
616 {
617 SystemPath = SourcePaths[
i];
618 if (!SystemPath)
619 {
622 }
628 {
629 break;
630 }
631 }
632
633 TRACE(
"BootPath: '%s', SystemPath: '%s'\n", BootPath, SystemPath);
634
635
636
638 {
639 PCSTR OptionsToRemove[2] = {
"SIFOPTIONSOVERRIDE",
NULL};
640
641
642
644
645
647 sizeof(UserBootOptions),
650 OptionsToRemove);
651
653 }
654 else
655 {
659 PSTR OptionsToAdd[3];
660 PSTR OptionsToRemove[4];
661
662
664 {
666 WARN(
"Failed to get load options\n");
667 }
668
669#if !DBG
670
671
672
675 {
676#else
677
678#endif
679 if (
InfFindFirstLine(InfHandle,
"SetupData",
"SetupDebugOptions", &InfContext))
680 {
682 WARN(
"Failed to get debug load options\n");
683 }
684
685 if (!DbgLoadOptions)
686 DbgLoadOptions = "/DEBUG";
687#if !DBG
688 }
689#endif
690
691
693 if (LoadOptions && *LoadOptions)
695
696
697 if (DbgLoadOptions)
698 {
701
702
703
704
705
706
707
708
709
710 OptionsToRemove[0] = "/NODEBUG";
713 &HigherPriorityOptions);
715 OptionsToRemove[1] = (HigherPriorityOptions ? HigherPriorityOptions : "");
716
717
718
719
720
721
722 OptionsToAdd[0] = (
PSTR)DbgLoadOptions;
723 OptionsToRemove[2] = (
PSTR)DbgLoadOptions;
725 sizeof(UserBootOptions),
727 (
PCSTR*)OptionsToAdd,
728 (
PCSTR*)OptionsToRemove);
729
732 if (HigherPriorityOptions)
734 }
735
738
739
740
741
742
743
746 &HigherPriorityOptions);
748 OptionsToRemove[0] = (HigherPriorityOptions ? HigherPriorityOptions : "");
749
750
751
755 sizeof(UserBootOptions),
757 (
PCSTR*)OptionsToAdd,
758 (
PCSTR*)OptionsToRemove);
759
762 if (HigherPriorityOptions)
764
766 }
767
769
770
774
775
777
778
781
782
784
785
788 TRACE(
"Setup SYSTEM hive %s\n", (
Success ?
"loaded" :
"not loaded"));
789
792
793
797
798
800 TRACE(
"Firmware Errata file %s\n", (
Success ?
"loaded" :
"not loaded"));
801
802
803
804
805
807
808
810
812
813
815 LoaderBlock,
817 BootPath);
818}
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)
FORCEINLINE VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
VOID UiUpdateProgressBar(_In_ ULONG Percentage, _In_opt_ PCSTR ProgressText)
VOID UiDrawBackdrop(VOID)
VOID UiDrawProgressBarCenter(_In_ PCSTR ProgressText)
VOID UiDrawStatusText(PCSTR StatusText)
struct _FileName FileName
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ HANDLE _In_ ULONG FileNameLength
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
BOOLEAN InfFindFirstLine(HINF InfHandle, PCSTR Section, PCSTR Key, PINFCONTEXT Context)
BOOLEAN InfOpenFile(PHINF InfHandle, PCSTR FileName, PULONG ErrorLine)
FORCEINLINE VOID UiResetForSOS(VOID)
BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot, IN BOOLEAN Setup)
PCSTR NtLdrGetOption(IN PCSTR Options, IN PCSTR OptionName)
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)
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)
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)
VOID AllocateAndInitLPB(IN USHORT VersionToBoot, OUT PLOADER_PARAMETER_BLOCK *OutLoaderBlock)
struct _SETUP_LOADER_BLOCK * SetupLdrBlock
SETUP_LOADER_BLOCK SetupBlock
BOOLEAN InfGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
VOID InfCloseFile(HINF InfHandle)
ARC_STATUS LoadAndBootWindowsCommon(IN USHORT OperatingSystemVersion, IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR BootOptions, IN PCSTR BootPath)