ReactOS  0.4.15-dev-2979-gfd8baca
winldr.h File Reference
#include <arc/setupblk.h>
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for winldr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RSDP_DESCRIPTOR
 
struct  _ARC_DISK_SIGNATURE_EX
 

Macros

#define TAG_WLDR_DTE   'eDlW'
 
#define TAG_WLDR_BDE   'dBlW'
 
#define TAG_WLDR_NAME   'mNlW'
 

Typedefs

typedef struct RSDP_DESCRIPTORPRSDP_DESCRIPTOR
 
typedef struct _ARC_DISK_SIGNATURE_EX ARC_DISK_SIGNATURE_EX
 
typedef struct _ARC_DISK_SIGNATURE_EXPARC_DISK_SIGNATURE_EX
 

Functions

ARC_STATUS LoadAndBootWindows (IN ULONG Argc, IN PCHAR Argv[], IN PCHAR Envp[])
 
ARC_STATUS LoadReactOSSetup (IN ULONG Argc, IN PCHAR Argv[], IN PCHAR Envp[])
 
PVOID VaToPa (PVOID Va)
 
PVOID PaToVa (PVOID Pa)
 
VOID List_PaToVa (_In_ LIST_ENTRY *ListEntry)
 

Macro Definition Documentation

◆ TAG_WLDR_BDE

#define TAG_WLDR_BDE   'dBlW'

Definition at line 14 of file winldr.h.

◆ TAG_WLDR_DTE

#define TAG_WLDR_DTE   'eDlW'

Definition at line 13 of file winldr.h.

◆ TAG_WLDR_NAME

#define TAG_WLDR_NAME   'mNlW'

Definition at line 15 of file winldr.h.

Typedef Documentation

◆ ARC_DISK_SIGNATURE_EX

◆ PARC_DISK_SIGNATURE_EX

◆ PRSDP_DESCRIPTOR

Function Documentation

◆ List_PaToVa()

VOID List_PaToVa ( _In_ LIST_ENTRY ListEntry)

◆ LoadAndBootWindows()

ARC_STATUS LoadAndBootWindows ( IN ULONG  Argc,
IN PCHAR  Argv[],
IN PCHAR  Envp[] 
)

Definition at line 759 of file winldr.c.

763 {
765  PCSTR ArgValue;
767  PCSTR FileName;
770  USHORT OperatingSystemVersion;
771  PLOADER_PARAMETER_BLOCK LoaderBlock;
772  CHAR BootPath[MAX_PATH];
774  CHAR BootOptions[256];
775 
776  /* Retrieve the (mandatory) boot type */
777  ArgValue = GetArgumentValue(Argc, Argv, "BootType");
778  if (!ArgValue || !*ArgValue)
779  {
780  ERR("No 'BootType' value, aborting!\n");
781  return EINVAL;
782  }
783 
784  /* Convert it to an OS version */
785  if (_stricmp(ArgValue, "Windows") == 0 ||
786  _stricmp(ArgValue, "Windows2003") == 0)
787  {
788  OperatingSystemVersion = _WIN32_WINNT_WS03;
789  }
790  else if (_stricmp(ArgValue, "WindowsNT40") == 0)
791  {
792  OperatingSystemVersion = _WIN32_WINNT_NT4;
793  }
794  else
795  {
796  ERR("Unknown 'BootType' value '%s', aborting!\n", ArgValue);
797  return EINVAL;
798  }
799 
800  /* Retrieve the (mandatory) system partition */
801  SystemPartition = GetArgumentValue(Argc, Argv, "SystemPartition");
803  {
804  ERR("No 'SystemPartition' specified, aborting!\n");
805  return EINVAL;
806  }
807 
808  UiDrawBackdrop();
809  UiDrawProgressBarCenter(1, 100, "Loading NT...");
810 
811  /* Retrieve the system path */
812  *BootPath = ANSI_NULL;
813  ArgValue = GetArgumentValue(Argc, Argv, "SystemPath");
814  if (ArgValue)
815  RtlStringCbCopyA(BootPath, sizeof(BootPath), ArgValue);
816 
817  /*
818  * Check whether BootPath is a full path
819  * and if not, create a full boot path.
820  *
821  * See FsOpenFile for the technique used.
822  */
823  if (strrchr(BootPath, ')') == NULL)
824  {
825  /* Temporarily save the boot path */
826  RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
827 
828  /* This is not a full path: prepend the SystemPartition */
829  RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
830 
831  /* Append a path separator if needed */
832  if (*FilePath != '\\' && *FilePath != '/')
833  RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
834 
835  /* Append the remaining path */
836  RtlStringCbCatA(BootPath, sizeof(BootPath), FilePath);
837  }
838 
839  /* Append a path separator if needed */
840  if (!*BootPath || BootPath[strlen(BootPath) - 1] != '\\')
841  RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
842 
843  TRACE("BootPath: '%s'\n", BootPath);
844 
845  /* Retrieve the boot options */
847  ArgValue = GetArgumentValue(Argc, Argv, "Options");
848  if (ArgValue && *ArgValue)
849  RtlStringCbCopyA(BootOptions, sizeof(BootOptions), ArgValue);
850 
851  /* Append boot-time options */
853 
854  /*
855  * Set the "/HAL=" and "/KERNEL=" options if needed.
856  * If already present on the standard "Options=" option line, they take
857  * precedence over those passed via the separate "Hal=" and "Kernel="
858  * options.
859  */
860  if (!NtLdrGetOption(BootOptions, "HAL="))
861  {
862  /*
863  * Not found in the options, try to retrieve the
864  * separate value and append it to the options.
865  */
866  ArgValue = GetArgumentValue(Argc, Argv, "Hal");
867  if (ArgValue && *ArgValue)
868  {
869  RtlStringCbCatA(BootOptions, sizeof(BootOptions), " /HAL=");
870  RtlStringCbCatA(BootOptions, sizeof(BootOptions), ArgValue);
871  }
872  }
873  if (!NtLdrGetOption(BootOptions, "KERNEL="))
874  {
875  /*
876  * Not found in the options, try to retrieve the
877  * separate value and append it to the options.
878  */
879  ArgValue = GetArgumentValue(Argc, Argv, "Kernel");
880  if (ArgValue && *ArgValue)
881  {
882  RtlStringCbCatA(BootOptions, sizeof(BootOptions), " /KERNEL=");
883  RtlStringCbCatA(BootOptions, sizeof(BootOptions), ArgValue);
884  }
885  }
886 
887  TRACE("BootOptions: '%s'\n", BootOptions);
888 
889  /* Check if a RAM disk file was given */
891  if (FileName && (FileNameLength > 7))
892  {
893  /* Load the RAM disk */
895  if (Status != ESUCCESS)
896  {
897  FileName += 7; FileNameLength -= 7;
898  UiMessageBox("Failed to load RAM disk file '%.*s'",
900  return Status;
901  }
902  }
903 
904  /* Let user know we started loading */
905  //UiDrawStatusText("Loading...");
906 
907  /* Allocate and minimally-initialize the Loader Parameter Block */
908  AllocateAndInitLPB(OperatingSystemVersion, &LoaderBlock);
909 
910  /* Load the system hive */
911  UiDrawBackdrop();
912  UiDrawProgressBarCenter(15, 100, "Loading system hive...");
913  Success = WinLdrInitSystemHive(LoaderBlock, BootPath, FALSE);
914  TRACE("SYSTEM hive %s\n", (Success ? "loaded" : "not loaded"));
915  /* Bail out if failure */
916  if (!Success)
917  return ENOEXEC;
918 
919  /* Fixup the version number using data from the registry */
920  if (OperatingSystemVersion == 0)
921  OperatingSystemVersion = WinLdrDetectVersion();
922  LoaderBlock->Extension->MajorVersion = (OperatingSystemVersion & 0xFF00) >> 8;
923  LoaderBlock->Extension->MinorVersion = (OperatingSystemVersion & 0xFF);
924 
925  /* Load NLS data, OEM font, and prepare boot drivers list */
926  Success = WinLdrScanSystemHive(LoaderBlock, BootPath);
927  TRACE("SYSTEM hive %s\n", (Success ? "scanned" : "not scanned"));
928  /* Bail out if failure */
929  if (!Success)
930  return ENOEXEC;
931 
932  /* Load the Firmware Errata file */
933  Success = WinLdrInitErrataInf(LoaderBlock, OperatingSystemVersion, BootPath);
934  TRACE("Firmware Errata file %s\n", (Success ? "loaded" : "not loaded"));
935  /* Not necessarily fatal if not found - carry on going */
936 
937  /* Finish loading */
938  return LoadAndBootWindowsCommon(OperatingSystemVersion,
939  LoaderBlock,
940  BootOptions,
941  BootPath);
942 }
VOID AppendBootTimeOptions(PCHAR BootOptions)
Definition: options.c:252
ARC_STATUS RamDiskInitialize(IN BOOLEAN InitRamDisk, IN PCSTR LoadOptions OPTIONAL, IN PCSTR DefaultPath OPTIONAL)
Definition: ramdisk.c:205
#define _WIN32_WINNT_WS03
Definition: sdkddkver.h:23
Definition: arc.h:32
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot)
Definition: wlregistry.c:173
Definition: arc.h:39
PLOADER_PARAMETER_EXTENSION Extension
Definition: arc.h:512
char CHAR
Definition: xmlstorage.h:175
ULONG ARC_STATUS
Definition: arc.h:4
static BOOLEAN WinLdrInitErrataInf(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN USHORT OperatingSystemVersion, IN PCSTR SystemRoot)
Definition: winldr.c:698
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define _stricmp
Definition: cat.c:22
PCWSTR FilePath
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
#define FALSE
Definition: types.h:117
#define ANSI_NULL
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:320
unsigned char BOOLEAN
ARC_STATUS LoadAndBootWindowsCommon(IN USHORT OperatingSystemVersion, IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR BootOptions, IN PCSTR BootPath)
Definition: winldr.c:945
#define _WIN32_WINNT_NT4
Definition: sdkddkver.h:20
USHORT WinLdrDetectVersion(VOID)
Definition: winldr.c:429
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_PATH
Definition: compat.h:34
static PPARTENTRY SystemPartition
Definition: usetup.c:61
VOID UiDrawBackdrop(VOID)
Definition: ui.c:214
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ HANDLE _In_ ULONG FileNameLength
Definition: fltkernel.h:1129
VOID AllocateAndInitLPB(IN USHORT VersionToBoot, OUT PLOADER_PARAMETER_BLOCK *OutLoaderBlock)
Definition: winldr.c:44
#define ERR(fmt,...)
Definition: debug.h:110
struct _FileName FileName
Definition: fatprocs.h:893
PCSTR NtLdrGetOption(IN PCSTR Options, IN PCSTR OptionName)
Definition: ntldropts.c:128
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
Definition: arc.h:47
const char * PCSTR
Definition: typedefs.h:52
PCHAR GetArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN PCHAR ArgumentName)
Definition: arcsupp.c:41
BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot, IN BOOLEAN Setup)
Definition: wlregistry.c:123
PCSTR NtLdrGetOptionEx(IN PCSTR Options, IN PCSTR OptionName, OUT PULONG OptionLength OPTIONAL)
Definition: ntldropts.c:117
VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: ui.c:346
NTSTRSAFEAPI RtlStringCbCatA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:625

◆ LoadReactOSSetup()

ARC_STATUS LoadReactOSSetup ( IN ULONG  Argc,
IN PCHAR  Argv[],
IN PCHAR  Envp[] 
)

Definition at line 435 of file setupldr.c.

439 {
441  PCSTR ArgValue;
443  PCSTR SystemPath;
444  PSTR FileName;
446  BOOLEAN BootFromFloppy;
448  HINF InfHandle;
449  INFCONTEXT InfContext;
450  ULONG i, ErrorLine;
451  PLOADER_PARAMETER_BLOCK LoaderBlock;
452  PSETUP_LOADER_BLOCK SetupBlock;
453  CHAR BootPath[MAX_PATH];
455  CHAR UserBootOptions[256];
457 
458  static PCSTR SourcePaths[] =
459  {
460  "", /* Only for floppy boot */
461 #if defined(_M_IX86)
462  "I386\\",
463 #elif defined(_M_MPPC)
464  "PPC\\",
465 #elif defined(_M_MRX000)
466  "MIPS\\",
467 #endif
468  "reactos\\",
469  NULL
470  };
471 
472  /* Retrieve the (mandatory) boot type */
473  ArgValue = GetArgumentValue(Argc, Argv, "BootType");
474  if (!ArgValue || !*ArgValue)
475  {
476  ERR("No 'BootType' value, aborting!\n");
477  return EINVAL;
478  }
479  if (_stricmp(ArgValue, "ReactOSSetup") != 0)
480  {
481  ERR("Unknown 'BootType' value '%s', aborting!\n", ArgValue);
482  return EINVAL;
483  }
484 
485  /* Retrieve the (mandatory) system partition */
486  SystemPartition = GetArgumentValue(Argc, Argv, "SystemPartition");
488  {
489  ERR("No 'SystemPartition' specified, aborting!\n");
490  return EINVAL;
491  }
492 
493  UiDrawStatusText("Setup is loading...");
494 
495  UiDrawBackdrop();
496  UiDrawProgressBarCenter(1, 100, "Loading ReactOS Setup...");
497 
498  /* Retrieve the system path */
499  *BootPath = ANSI_NULL;
500  ArgValue = GetArgumentValue(Argc, Argv, "SystemPath");
501  if (ArgValue)
502  {
503  RtlStringCbCopyA(BootPath, sizeof(BootPath), ArgValue);
504  }
505  else
506  {
507  /*
508  * IMPROVE: I don't want to use the SystemPartition here as a
509  * default choice because I can do it after (see few lines below).
510  * Instead I reset BootPath here so that we can build the full path
511  * using the general code from below.
512  */
513  // RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
514  *BootPath = ANSI_NULL;
515  }
516 
517  /*
518  * Check whether BootPath is a full path
519  * and if not, create a full boot path.
520  *
521  * See FsOpenFile for the technique used.
522  */
523  if (strrchr(BootPath, ')') == NULL)
524  {
525  /* Temporarily save the boot path */
526  RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
527 
528  /* This is not a full path: prepend the SystemPartition */
529  RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
530 
531  /* Append a path separator if needed */
532  if (*FilePath != '\\' && *FilePath != '/')
533  RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
534 
535  /* Append the remaining path */
536  RtlStringCbCatA(BootPath, sizeof(BootPath), FilePath);
537  }
538 
539  /* Append a path separator if needed */
540  if (!*BootPath || BootPath[strlen(BootPath) - 1] != '\\')
541  RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
542 
543  TRACE("BootPath: '%s'\n", BootPath);
544 
545  /*
546  * Retrieve the boot options. Any options present here will supplement or
547  * override those that will be specified in TXTSETUP.SIF's OsLoadOptions.
548  */
549  BootOptions = GetArgumentValue(Argc, Argv, "Options");
550  if (!BootOptions)
551  BootOptions = "";
552 
553  TRACE("BootOptions: '%s'\n", BootOptions);
554 
555  /* Check if a RAM disk file was given */
557  if (FileName && (FileNameLength > 7))
558  {
559  /* Load the RAM disk */
561  if (Status != ESUCCESS)
562  {
563  FileName += 7; FileNameLength -= 7;
564  UiMessageBox("Failed to load RAM disk file '%.*s'",
566  return Status;
567  }
568  }
569 
570  /* Check if we booted from floppy */
571  BootFromFloppy = strstr(BootPath, "fdisk") != NULL;
572 
573  /* Open 'txtsetup.sif' from any of the source paths */
574  FileName = BootPath + strlen(BootPath);
575  for (i = BootFromFloppy ? 0 : 1; ; i++)
576  {
577  SystemPath = SourcePaths[i];
578  if (!SystemPath)
579  {
580  UiMessageBox("Failed to open txtsetup.sif");
581  return ENOENT;
582  }
583  FileNameLength = (ULONG)(sizeof(BootPath) - (FileName - BootPath)*sizeof(CHAR));
585  RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
586  RtlStringCbCatA(FilePath, sizeof(FilePath), "txtsetup.sif");
587  if (InfOpenFile(&InfHandle, FilePath, &ErrorLine))
588  {
589  break;
590  }
591  }
592 
593  TRACE("BootPath: '%s', SystemPath: '%s'\n", BootPath, SystemPath);
594 
595  // UseLocalSif = NtLdrGetOption(BootOptions, "USELOCALSIF");
596 
597  if (NtLdrGetOption(BootOptions, "SIFOPTIONSOVERRIDE"))
598  {
599  PCSTR OptionsToRemove[2] = {"SIFOPTIONSOVERRIDE", NULL};
600 
601  /* Do not use any load options from TXTSETUP.SIF, but
602  * use instead those passed from the command line. */
603  RtlStringCbCopyA(UserBootOptions, sizeof(UserBootOptions), BootOptions);
604 
605  /* Remove the private switch from the options */
606  NtLdrUpdateLoadOptions(UserBootOptions,
607  sizeof(UserBootOptions),
608  FALSE,
609  NULL,
610  OptionsToRemove);
611 
612  BootOptions = UserBootOptions;
613  }
614  else // if (!*BootOptions || NtLdrGetOption(BootOptions, "SIFOPTIONSADD"))
615  {
616  PCSTR LoadOptions = NULL;
617  PCSTR DbgLoadOptions = NULL;
618  PSTR ExtraOptions, HigherPriorityOptions;
619  PSTR OptionsToAdd[3];
620  PSTR OptionsToRemove[4];
621 
622  /* Load the options from TXTSETUP.SIF */
623  if (InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext))
624  {
625  if (!InfGetDataField(&InfContext, 1, &LoadOptions))
626  WARN("Failed to get load options\n");
627  }
628 
629 #if !DBG
630  /* Non-debug mode: get the debug load options only if /DEBUG was specified
631  * in the Argv command-line options (was e.g. added to the options when
632  * the user selected "Debugging Mode" in the advanced boot menu). */
633  if (NtLdrGetOption(BootOptions, "DEBUG") ||
634  NtLdrGetOption(BootOptions, "DEBUG="))
635  {
636 #else
637  /* Debug mode: always get the debug load options */
638 #endif
639  if (InfFindFirstLine(InfHandle, "SetupData", "SetupDebugOptions", &InfContext))
640  {
641  if (!InfGetDataField(&InfContext, 1, &DbgLoadOptions))
642  WARN("Failed to get debug load options\n");
643  }
644  /* If none was found, default to enabling debugging */
645  if (!DbgLoadOptions)
646  DbgLoadOptions = "/DEBUG";
647 #if !DBG
648  }
649 #endif
650 
651  /* Initialize the load options with those from TXTSETUP.SIF */
652  *UserBootOptions = ANSI_NULL;
653  if (LoadOptions && *LoadOptions)
654  RtlStringCbCopyA(UserBootOptions, sizeof(UserBootOptions), LoadOptions);
655 
656  /* Merge the debug load options if any */
657  if (DbgLoadOptions)
658  {
659  RtlZeroMemory(OptionsToAdd, sizeof(OptionsToAdd));
660  RtlZeroMemory(OptionsToRemove, sizeof(OptionsToRemove));
661 
662  /*
663  * Retrieve any option patterns that we should remove from the
664  * SIF load options because they are of higher precedence than
665  * those specified in the debug load options to be added.
666  * Also always remove NODEBUG (even if the debug load options
667  * do not contain explicitly the DEBUG option), since we want
668  * to have debugging enabled if possible.
669  */
670  OptionsToRemove[0] = "/NODEBUG";
671  NtLdrGetHigherPriorityOptions(DbgLoadOptions,
672  &ExtraOptions,
673  &HigherPriorityOptions);
674  OptionsToAdd[1] = (ExtraOptions ? ExtraOptions : "");
675  OptionsToRemove[1] = (HigherPriorityOptions ? HigherPriorityOptions : "");
676 
677  /*
678  * Prepend the debug load options, so that in case it contains
679  * redundant options with respect to the SIF load options, the
680  * former can take precedence over the latter.
681  */
682  OptionsToAdd[0] = (PSTR)DbgLoadOptions;
683  OptionsToRemove[2] = (PSTR)DbgLoadOptions;
684  NtLdrUpdateLoadOptions(UserBootOptions,
685  sizeof(UserBootOptions),
686  FALSE,
687  (PCSTR*)OptionsToAdd,
688  (PCSTR*)OptionsToRemove);
689 
690  if (ExtraOptions)
692  if (HigherPriorityOptions)
693  FrLdrHeapFree(HigherPriorityOptions, TAG_BOOT_OPTIONS);
694  }
695 
696  RtlZeroMemory(OptionsToAdd, sizeof(OptionsToAdd));
697  RtlZeroMemory(OptionsToRemove, sizeof(OptionsToRemove));
698 
699  /*
700  * Retrieve any option patterns that we should remove from the
701  * SIF load options because they are of higher precedence than
702  * those specified in the options to be added.
703  */
705  &ExtraOptions,
706  &HigherPriorityOptions);
707  OptionsToAdd[1] = (ExtraOptions ? ExtraOptions : "");
708  OptionsToRemove[0] = (HigherPriorityOptions ? HigherPriorityOptions : "");
709 
710  /* Finally, prepend the user-specified options that
711  * take precedence over those from TXTSETUP.SIF. */
712  OptionsToAdd[0] = (PSTR)BootOptions;
713  OptionsToRemove[1] = (PSTR)BootOptions;
714  NtLdrUpdateLoadOptions(UserBootOptions,
715  sizeof(UserBootOptions),
716  FALSE,
717  (PCSTR*)OptionsToAdd,
718  (PCSTR*)OptionsToRemove);
719 
720  if (ExtraOptions)
722  if (HigherPriorityOptions)
723  FrLdrHeapFree(HigherPriorityOptions, TAG_BOOT_OPTIONS);
724 
725  BootOptions = UserBootOptions;
726  }
727 
728  TRACE("BootOptions: '%s'\n", BootOptions);
729 
730  /* Allocate and minimally-initialize the Loader Parameter Block */
731  AllocateAndInitLPB(_WIN32_WINNT_WS03, &LoaderBlock);
732 
733  /* Allocate and initialize the setup loader block */
734  SetupBlock = &WinLdrSystemBlock->SetupBlock;
735  LoaderBlock->SetupLdrBlock = SetupBlock;
736 
737  /* Set textmode setup flag */
738  SetupBlock->Flags = SETUPLDR_TEXT_MODE;
739 
740  /* Load the "setupreg.hiv" setup system hive */
741  UiDrawBackdrop();
742  UiDrawProgressBarCenter(15, 100, "Loading setup system hive...");
743  Success = WinLdrInitSystemHive(LoaderBlock, BootPath, TRUE);
744  TRACE("Setup SYSTEM hive %s\n", (Success ? "loaded" : "not loaded"));
745  /* Bail out if failure */
746  if (!Success)
747  return ENOEXEC;
748 
749  /* Load NLS data, they are in the System32 directory of the installation medium */
750  RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
751  RtlStringCbCatA(FilePath, sizeof(FilePath), "system32\\");
752  SetupLdrLoadNlsData(LoaderBlock, InfHandle, FilePath);
753 
754  /* Load the Firmware Errata file from the installation medium */
755  Success = SetupLdrInitErrataInf(LoaderBlock, InfHandle, BootPath);
756  TRACE("Firmware Errata file %s\n", (Success ? "loaded" : "not loaded"));
757  /* Not necessarily fatal if not found - carry on going */
758 
759  // UiDrawStatusText("Press F6 if you need to install a 3rd-party SCSI or RAID driver...");
760 
761  /* Get a list of boot drivers */
762  SetupLdrScanBootDrivers(&LoaderBlock->BootDriverListHead, InfHandle, BootPath);
763 
764  /* Close the inf file */
765  InfCloseFile(InfHandle);
766 
767  UiDrawStatusText("The Setup program is starting...");
768 
769  /* Finish loading */
771  LoaderBlock,
772  BootOptions,
773  BootPath);
774 }
ARC_STATUS RamDiskInitialize(IN BOOLEAN InitRamDisk, IN PCSTR LoadOptions OPTIONAL, IN PCSTR DefaultPath OPTIONAL)
Definition: ramdisk.c:205
FORCEINLINE VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
Definition: mm.h:181
#define _WIN32_WINNT_WS03
Definition: sdkddkver.h:23
Definition: arc.h:32
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static VOID SetupLdrScanBootDrivers(PLIST_ENTRY BootDriverListHead, HINF InfHandle, PCSTR SearchPath)
Definition: setupldr.c:124
#define TRUE
Definition: types.h:120
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
PCSTR ExtraOptions
Definition: setupldr.c:296
Definition: arc.h:39
static VOID SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, PCSTR SearchPath)
Definition: setupldr.c:25
char CHAR
Definition: xmlstorage.h:175
#define WARN(fmt,...)
Definition: debug.h:112
ULONG ARC_STATUS
Definition: arc.h:4
VOID NtLdrUpdateLoadOptions(IN OUT PSTR LoadOptions, IN ULONG BufferSize, IN BOOLEAN Append, IN PCSTR OptionsToAdd[] OPTIONAL, IN PCSTR OptionsToRemove[] OPTIONAL)
Definition: setupldr.c:201
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define _stricmp
Definition: cat.c:22
BOOLEAN InfGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
Definition: infrosget.c:127
PCWSTR FilePath
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
struct _SETUP_LOADER_BLOCK * SetupLdrBlock
Definition: arc.h:511
#define FALSE
Definition: types.h:117
#define ANSI_NULL
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:320
unsigned char BOOLEAN
ARC_STATUS LoadAndBootWindowsCommon(IN USHORT OperatingSystemVersion, IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR BootOptions, IN PCSTR BootPath)
Definition: winldr.c:945
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_PATH
Definition: compat.h:34
LIST_ENTRY BootDriverListHead
Definition: arc.h:495
static PPARTENTRY SystemPartition
Definition: usetup.c:61
VOID UiDrawStatusText(PCSTR StatusText)
Definition: ui.c:249
VOID InfCloseFile(HINF InfHandle)
Definition: inffile.c:1028
VOID UiDrawBackdrop(VOID)
Definition: ui.c:214
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ HANDLE _In_ ULONG FileNameLength
Definition: fltkernel.h:1129
SETUP_LOADER_BLOCK SetupBlock
Definition: winldr.h:50
#define ERR(fmt,...)
Definition: debug.h:110
struct _FileName FileName
Definition: fatprocs.h:893
#define TAG_BOOT_OPTIONS
Definition: setupldr.c:322
PCSTR NtLdrGetOption(IN PCSTR Options, IN PCSTR OptionName)
Definition: ntldropts.c:128
#define SETUPLDR_TEXT_MODE
Definition: setupblk.h:7
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
Definition: glfuncs.h:248
signed char * PSTR
Definition: retypes.h:7
Definition: arc.h:46
#define NULL
Definition: types.h:112
static BOOLEAN SetupLdrInitErrataInf(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN HINF InfHandle, IN PCSTR SystemRoot)
Definition: setupldr.c:83
VOID AllocateAndInitLPB(IN USHORT VersionToBoot, OUT PLOADER_PARAMETER_BLOCK *OutLoaderBlock)
Definition: winldr.c:44
BOOLEAN InfFindFirstLine(HINF InfHandle, PCSTR Section, PCSTR Key, PINFCONTEXT Context)
Definition: inffile.c:1050
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
Definition: arc.h:47
const char * PCSTR
Definition: typedefs.h:52
PCHAR GetArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN PCHAR ArgumentName)
Definition: arcsupp.c:41
BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot, IN BOOLEAN Setup)
Definition: wlregistry.c:123
VOID NtLdrGetHigherPriorityOptions(IN PCSTR BootOptions, OUT PSTR *ExtraOptions, OUT PSTR *HigherPriorityOptions)
Definition: setupldr.c:325
PCSTR NtLdrGetOptionEx(IN PCSTR Options, IN PCSTR OptionName, OUT PULONG OptionLength OPTIONAL)
Definition: ntldropts.c:117
BOOLEAN InfOpenFile(PHINF InfHandle, PCSTR FileName, PULONG ErrorLine)
Definition: inffile.c:918
VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: ui.c:346
PLOADER_SYSTEM_BLOCK WinLdrSystemBlock
Definition: winldr.c:28
NTSTRSAFEAPI RtlStringCbCatA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:625

◆ PaToVa()

◆ VaToPa()