ReactOS  0.4.12-dev-685-gf36cbf7
winldr.c
Go to the documentation of this file.
1 /*
2  * FreeLoader
3  *
4  * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
5  * Copyright (C) 2006 Aleksey Bragin <aleksey@reactos.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #include <freeldr.h>
23 #include "winldr.h"
24 #include "registry.h"
25 
26 #include <ndk/ldrtypes.h>
27 
28 #include <debug.h>
29 DBG_DEFAULT_CHANNEL(WINDOWS);
30 
31 // FIXME: Find a better way to retrieve ARC disk information
34 
36 extern BOOLEAN AcpiPresent;
37 
40 extern void WinLdrSetupEms(IN PCHAR BootOptions);
41 
43 
44 // debug stuff
46 
47 // Init "phase 0"
48 VOID
50 {
51  PLOADER_PARAMETER_BLOCK LoaderBlock;
52 
53  /* Allocate and zero-init the LPB */
56  if (WinLdrSystemBlock == NULL)
57  {
58  UiMessageBox("Failed to allocate memory for system block!");
59  return;
60  }
61 
63 
64  LoaderBlock = &WinLdrSystemBlock->LoaderBlock;
65  LoaderBlock->NlsData = &WinLdrSystemBlock->NlsDataBlock;
66 
67  /* Init three critical lists, used right away */
71 
72  *OutLoaderBlock = LoaderBlock;
73 }
74 
75 // Init "phase 1"
76 VOID
81  USHORT VersionToBoot)
82 {
83  /* Examples of correct options and paths */
84  //CHAR Options[] = "/DEBUGPORT=COM1 /BAUDRATE=115200";
85  //CHAR Options[] = "/NODEBUG";
86  //CHAR SystemRoot[] = "\\WINNT\\";
87  //CHAR ArcBoot[] = "multi(0)disk(0)rdisk(0)partition(1)";
88 
89  LPSTR LoadOptions, NewLoadOptions;
90  CHAR HalPath[] = "\\";
91  CHAR ArcBoot[256];
92  CHAR MiscFiles[256];
93  ULONG i;
94  ULONG_PTR PathSeparator;
96 
97  /* Construct SystemRoot and ArcBoot from SystemPath */
98  PathSeparator = strstr(BootPath, "\\") - BootPath;
99  strncpy(ArcBoot, BootPath, PathSeparator);
100  ArcBoot[PathSeparator] = ANSI_NULL;
101 
102  TRACE("ArcBoot: %s\n", ArcBoot);
103  TRACE("SystemRoot: %s\n", SystemRoot);
104  TRACE("Options: %s\n", Options);
105 
106  /* Fill Arc BootDevice */
108  strncpy(LoaderBlock->ArcBootDeviceName, ArcBoot, MAX_PATH);
109  LoaderBlock->ArcBootDeviceName = PaToVa(LoaderBlock->ArcBootDeviceName);
110 
111  /* Fill Arc HalDevice, it matches ArcBoot path */
113  LoaderBlock->ArcHalDeviceName = PaToVa(LoaderBlock->ArcHalDeviceName);
114 
115  /* Fill SystemRoot */
117  strncpy(LoaderBlock->NtBootPathName, SystemRoot, MAX_PATH);
118  LoaderBlock->NtBootPathName = PaToVa(LoaderBlock->NtBootPathName);
119 
120  /* Fill NtHalPathName */
122  strncpy(LoaderBlock->NtHalPathName, HalPath, MAX_PATH);
123  LoaderBlock->NtHalPathName = PaToVa(LoaderBlock->NtHalPathName);
124 
125  /* Fill LoadOptions and strip the '/' commutator symbol in front of each option */
126  NewLoadOptions = LoadOptions = LoaderBlock->LoadOptions = WinLdrSystemBlock->LoadOptions;
128 
129  do
130  {
131  while (*LoadOptions == '/')
132  ++LoadOptions;
133 
134  *NewLoadOptions++ = *LoadOptions;
135  } while (*LoadOptions++);
136 
137  LoaderBlock->LoadOptions = PaToVa(LoaderBlock->LoadOptions);
138 
139  /* Arc devices */
142 
143  /* Convert ARC disk information from freeldr to a correct format */
144  for (i = 0; i < reactos_disk_count; i++)
145  {
146  PARC_DISK_SIGNATURE_EX ArcDiskSig;
147 
148  /* Allocate the ARC structure */
149  ArcDiskSig = FrLdrHeapAlloc(sizeof(ARC_DISK_SIGNATURE_EX), 'giSD');
150 
151  /* Copy the data over */
153 
154  /* Set the ARC Name pointer */
155  ArcDiskSig->DiskSignature.ArcName = PaToVa(ArcDiskSig->ArcName);
156 
157  /* Insert into the list */
159  &ArcDiskSig->DiskSignature.ListEntry);
160  }
161 
162  /* Convert all list's to Virtual address */
163 
164  /* Convert the ArcDisks list to virtual address */
166  LoaderBlock->ArcDiskInformation = PaToVa(LoaderBlock->ArcDiskInformation);
167 
168  /* Convert configuration entries to VA */
169  ConvertConfigToVA(LoaderBlock->ConfigurationRoot);
170  LoaderBlock->ConfigurationRoot = PaToVa(LoaderBlock->ConfigurationRoot);
171 
172  /* Convert all DTE into virtual addresses */
173  List_PaToVa(&LoaderBlock->LoadOrderListHead);
174 
175  /* This one will be converted right before switching to virtual paging mode */
176  //List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
177 
178  /* Convert list of boot drivers */
179  List_PaToVa(&LoaderBlock->BootDriverListHead);
180 
181  /* Initialize Extension now */
183  Extension->Size = sizeof(LOADER_PARAMETER_EXTENSION);
184  Extension->MajorVersion = (VersionToBoot & 0xFF00) >> 8;
185  Extension->MinorVersion = VersionToBoot & 0xFF;
186  Extension->Profile.Status = 2;
187 
188  /* Check if FreeLdr detected a ACPI table */
189  if (AcpiPresent)
190  {
191  /* Set the pointer to something for compatibility */
192  Extension->AcpiTable = (PVOID)1;
193  // FIXME: Extension->AcpiTableSize;
194  }
195 
196 #ifdef _M_IX86
197  /* Set headless block pointer */
199  {
200  Extension->HeadlessLoaderBlock = &WinLdrSystemBlock->HeadlessLoaderBlock;
201  RtlCopyMemory(Extension->HeadlessLoaderBlock,
203  sizeof(HEADLESS_LOADER_BLOCK));
204  Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock);
205  }
206 #endif
207  /* Load drivers database */
208  strcpy(MiscFiles, BootPath);
209  strcat(MiscFiles, "AppPatch\\drvmain.sdb");
210  Extension->DrvDBImage = PaToVa(WinLdrLoadModule(MiscFiles,
211  &Extension->DrvDBSize,
213 
214  /* Convert extension and setup block pointers */
215  LoaderBlock->Extension = PaToVa(Extension);
216 
217  if (LoaderBlock->SetupLdrBlock)
218  LoaderBlock->SetupLdrBlock = PaToVa(LoaderBlock->SetupLdrBlock);
219 
220  TRACE("WinLdrInitializePhase1() completed\n");
221 }
222 
223 static BOOLEAN
227  ULONG Flags,
228  PLDR_DATA_TABLE_ENTRY *DriverDTE)
229 {
230  CHAR FullPath[1024];
231  CHAR DriverPath[1024];
232  CHAR DllName[1024];
233  PCHAR DriverNamePos;
235  PVOID DriverBase = NULL;
236 
237  // Separate the path to file name and directory path
238  _snprintf(DriverPath, sizeof(DriverPath), "%wZ", FilePath);
239  DriverNamePos = strrchr(DriverPath, '\\');
240  if (DriverNamePos != NULL)
241  {
242  // Copy the name
243  strcpy(DllName, DriverNamePos+1);
244 
245  // Cut out the name from the path
246  *(DriverNamePos+1) = 0;
247  }
248  else
249  {
250  // There is no directory in the path
251  strcpy(DllName, DriverPath);
252  DriverPath[0] = ANSI_NULL;
253  }
254 
255  TRACE("DriverPath: %s, DllName: %s, LPB\n", DriverPath, DllName);
256 
257  // Check if driver is already loaded
258  Success = WinLdrCheckForLoadedDll(LoadOrderListHead, DllName, DriverDTE);
259  if (Success)
260  {
261  // We've got the pointer to its DTE, just return success
262  return TRUE;
263  }
264 
265  // It's not loaded, we have to load it
266  _snprintf(FullPath, sizeof(FullPath), "%s%wZ", BootPath, FilePath);
267  Success = WinLdrLoadImage(FullPath, LoaderBootDriver, &DriverBase);
268  if (!Success)
269  return FALSE;
270 
271  // Allocate a DTE for it
272  Success = WinLdrAllocateDataTableEntry(LoadOrderListHead, DllName, DllName, DriverBase, DriverDTE);
273  if (!Success)
274  {
275  ERR("WinLdrAllocateDataTableEntry() failed\n");
276  return FALSE;
277  }
278 
279  // Modify any flags, if needed
280  (*DriverDTE)->Flags |= Flags;
281 
282  // Look for any dependencies it may have, and load them too
283  sprintf(FullPath,"%s%s", BootPath, DriverPath);
284  Success = WinLdrScanImportDescriptorTable(LoadOrderListHead, FullPath, *DriverDTE);
285  if (!Success)
286  {
287  ERR("WinLdrScanImportDescriptorTable() failed for %s\n", FullPath);
288  return FALSE;
289  }
290 
291  return TRUE;
292 }
293 
294 BOOLEAN
297 {
298  PLIST_ENTRY NextBd;
299  PBOOT_DRIVER_LIST_ENTRY BootDriver;
301  BOOLEAN ret = TRUE;
302 
303  // Walk through the boot drivers list
304  NextBd = LoaderBlock->BootDriverListHead.Flink;
305 
306  while (NextBd != &LoaderBlock->BootDriverListHead)
307  {
308  BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, Link);
309 
310  TRACE("BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver->FilePath,
311  BootDriver->LdrEntry, &BootDriver->RegistryPath);
312 
313  // Paths are relative (FIXME: Are they always relative?)
314 
315  // Load it
317  BootPath,
318  &BootDriver->FilePath,
319  0,
320  &BootDriver->LdrEntry);
321 
322  if (Success)
323  {
324  // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore
325  BootDriver->RegistryPath.Buffer = PaToVa(BootDriver->RegistryPath.Buffer);
326  BootDriver->FilePath.Buffer = PaToVa(BootDriver->FilePath.Buffer);
327  BootDriver->LdrEntry = PaToVa(BootDriver->LdrEntry);
328  }
329  else
330  {
331  // Loading failed - cry loudly
332  ERR("Can't load boot driver '%wZ'!\n", &BootDriver->FilePath);
333  UiMessageBox("Can't load boot driver '%wZ'!", &BootDriver->FilePath);
334  ret = FALSE;
335 
336  // Remove it from the list and try to continue
337  RemoveEntryList(NextBd);
338  }
339 
340  NextBd = BootDriver->Link.Flink;
341  }
342 
343  return ret;
344 }
345 
346 PVOID
348  ULONG *Size,
349  TYPE_OF_MEMORY MemoryType)
350 {
351  ULONG FileId;
352  PVOID PhysicalBase;
354  ULONG FileSize;
357 
358  //CHAR ProgressString[256];
359 
360  /* Inform user we are loading files */
361  //sprintf(ProgressString, "Loading %s...", FileName);
362  //UiDrawProgressBarCenter(1, 100, ProgressString);
363 
364  TRACE("Loading module %s\n", ModuleName);
365  *Size = 0;
366 
367  /* Open the image file */
369  if (Status != ESUCCESS)
370  {
371  /* In case of errors, we just return, without complaining to the user */
372  return NULL;
373  }
374 
375  /* Get this file's size */
377  if (Status != ESUCCESS)
378  {
379  ArcClose(FileId);
380  return NULL;
381  }
382  FileSize = FileInfo.EndingAddress.LowPart;
383  *Size = FileSize;
384 
385  /* Allocate memory */
386  PhysicalBase = MmAllocateMemoryWithType(FileSize, MemoryType);
387  if (PhysicalBase == NULL)
388  {
389  ArcClose(FileId);
390  return NULL;
391  }
392 
393  /* Load whole file */
394  Status = ArcRead(FileId, PhysicalBase, FileSize, &BytesRead);
395  ArcClose(FileId);
396  if (Status != ESUCCESS)
397  {
398  return NULL;
399  }
400 
401  TRACE("Loaded %s at 0x%x with size 0x%x\n", ModuleName, PhysicalBase, FileSize);
402 
403  return PhysicalBase;
404 }
405 
406 USHORT
408 {
409  LONG rc;
410  HKEY hKey;
411 
412  rc = RegOpenKey(
413  NULL,
414  L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server",
415  &hKey);
416  if (rc != ERROR_SUCCESS)
417  {
418  // Key doesn't exist; assume NT 4.0
419  return _WIN32_WINNT_NT4;
420  }
421 
422  // We may here want to read the value of ProductVersion
423  return _WIN32_WINNT_WS03;
424 }
425 
426 static
427 BOOLEAN
429  IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
430  IN PCCH Path,
431  IN PCCH File,
432  IN PCCH ImportName, // BaseDllName
433  IN TYPE_OF_MEMORY MemoryType,
435  IN ULONG Percentage)
436 {
438  CHAR FullFileName[MAX_PATH];
439  CHAR ProgressString[256];
441 
442  UiDrawBackdrop();
443  sprintf(ProgressString, "Loading %s...", File);
444  UiDrawProgressBarCenter(Percentage, 100, ProgressString);
445 
446  strcpy(FullFileName, Path);
447  strcat(FullFileName, File);
448 
449  Success = WinLdrLoadImage(FullFileName, MemoryType, &BaseAddress);
450  if (!Success)
451  {
452  TRACE("Loading %s failed\n", File);
453  return FALSE;
454  }
455  TRACE("%s loaded successfully at %p\n", File, BaseAddress);
456 
457  /*
458  * Cheat about the base DLL name if we are loading
459  * the Kernel Debugger Transport DLL, to make the
460  * PE loader happy.
461  */
462  Success = WinLdrAllocateDataTableEntry(&LoaderBlock->LoadOrderListHead,
463  ImportName,
464  FullFileName,
465  BaseAddress,
466  Dte);
467 
468  return Success;
469 }
470 
471 static
472 BOOLEAN
474  IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
476  IN PCSTR BootPath,
477  IN OUT PLDR_DATA_TABLE_ENTRY* KernelDTE)
478 {
480  PCSTR Options;
481  CHAR DirPath[MAX_PATH];
482  CHAR KernelFileName[MAX_PATH];
483  CHAR HalFileName[MAX_PATH];
484  CHAR KdTransportDllName[MAX_PATH];
485  PLDR_DATA_TABLE_ENTRY HalDTE, KdComDTE = NULL;
486 
487  if (!KernelDTE) return FALSE;
488 
489  /* Initialize SystemRoot\System32 path */
490  strcpy(DirPath, BootPath);
491  strcat(DirPath, "system32\\");
492 
493  //
494  // TODO: Parse also the separate INI values "Kernel=" and "Hal="
495  //
496 
497  /* Default KERNEL and HAL file names */
498  strcpy(KernelFileName, "ntoskrnl.exe");
499  strcpy(HalFileName , "hal.dll");
500 
501  /* Find any /KERNEL= or /HAL= switch in the boot options */
503  while (Options)
504  {
505  /* Skip possible initial whitespace */
506  Options += strspn(Options, " \t");
507 
508  /* Check whether a new commutator starts and it is either KERNEL or HAL */
509  if (*Options != '/' || (++Options,
510  !(_strnicmp(Options, "KERNEL=", 7) == 0 ||
511  _strnicmp(Options, "HAL=", 4) == 0)) )
512  {
513  /* Search for another whitespace */
514  Options = strpbrk(Options, " \t");
515  continue;
516  }
517  else
518  {
519  size_t i = strcspn(Options, " \t"); /* Skip whitespace */
520  if (i == 0)
521  {
522  /* Use the default values */
523  break;
524  }
525 
526  /* We have found either KERNEL or HAL commutator */
527  if (_strnicmp(Options, "KERNEL=", 7) == 0)
528  {
529  Options += 7; i -= 7;
530  strncpy(KernelFileName, Options, i);
531  KernelFileName[i] = ANSI_NULL;
532  _strupr(KernelFileName);
533  }
534  else if (_strnicmp(Options, "HAL=", 4) == 0)
535  {
536  Options += 4; i -= 4;
537  strncpy(HalFileName, Options, i);
538  HalFileName[i] = ANSI_NULL;
539  _strupr(HalFileName);
540  }
541  }
542  }
543 
544  TRACE("Kernel file = '%s' ; HAL file = '%s'\n", KernelFileName, HalFileName);
545 
546  /* Load the Kernel */
547  LoadModule(LoaderBlock, DirPath, KernelFileName, "ntoskrnl.exe", LoaderSystemCode, KernelDTE, 30);
548 
549  /* Load the HAL */
550  LoadModule(LoaderBlock, DirPath, HalFileName, "hal.dll", LoaderHalCode, &HalDTE, 45);
551 
552  /* Load the Kernel Debugger Transport DLL */
554  {
555  /*
556  * According to http://www.nynaeve.net/?p=173 :
557  * "[...] Another enhancement that could be done Microsoft-side would be
558  * a better interface for replacing KD transport modules. Right now, due
559  * to the fact that ntoskrnl is static linked to KDCOM.DLL, the OS loader
560  * has a hardcoded hack that interprets the KD type in the OS loader options,
561  * loads one of the (hardcoded filenames) "kdcom.dll", "kd1394.dll", or
562  * "kdusb2.dll" modules, and inserts them into the loaded module list under
563  * the name "kdcom.dll". [...]"
564  */
565 
566  /*
567  * This loop replaces a dumb call to strstr(..., "DEBUGPORT=").
568  * Indeed I want it to be case-insensitive to allow "debugport="
569  * or "DeBuGpOrT=" or... , and I don't want it to match malformed
570  * command-line options, such as:
571  *
572  * "...foo DEBUGPORT=xxx bar..."
573  * "...foo/DEBUGPORT=xxx bar..."
574  * "...foo/DEBUGPORT=bar..."
575  *
576  * i.e. the "DEBUGPORT=" switch must start with a slash and be separated
577  * from the rest by whitespace, unless it begins the command-line, e.g.:
578  *
579  * "/DEBUGPORT=COM1 foo...bar..."
580  * "...foo /DEBUGPORT=USB bar..."
581  * or:
582  * "...foo /DEBUGPORT= bar..."
583  * (in that case, we default the port to COM).
584  */
586  while (Options)
587  {
588  /* Skip possible initial whitespace */
589  Options += strspn(Options, " \t");
590 
591  /* Check whether a new commutator starts and it is the DEBUGPORT one */
592  if (*Options != '/' || _strnicmp(++Options, "DEBUGPORT=", 10) != 0)
593  {
594  /* Search for another whitespace */
595  Options = strpbrk(Options, " \t");
596  continue;
597  }
598  else
599  {
600  /* We found the DEBUGPORT commutator. Move to the port name. */
601  Options += 10;
602  break;
603  }
604  }
605 
606  if (Options)
607  {
608  /*
609  * We have found the DEBUGPORT commutator. Parse the port name.
610  * Format: /DEBUGPORT=COM1 or /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log or /DEBUGPORT=FOO
611  * If we only have /DEBUGPORT= (i.e. without any port name), defaults it to "COM".
612  */
613  strcpy(KdTransportDllName, "KD");
614  if (_strnicmp(Options, "COM", 3) == 0 && '0' <= Options[3] && Options[3] <= '9')
615  {
616  strncat(KdTransportDllName, Options, 3);
617  }
618  else
619  {
620  size_t i = strcspn(Options, " \t:"); /* Skip valid separators: whitespace or colon */
621  if (i == 0)
622  strcat(KdTransportDllName, "COM");
623  else
624  strncat(KdTransportDllName, Options, i);
625  }
626  strcat(KdTransportDllName, ".DLL");
627  _strupr(KdTransportDllName);
628 
629  /*
630  * Load the transport DLL. Override the base DLL name of the
631  * loaded transport DLL to the default "KDCOM.DLL" name.
632  */
633  LoadModule(LoaderBlock, DirPath, KdTransportDllName, "kdcom.dll", LoaderSystemCode, &KdComDTE, 60);
634  }
635  }
636 
637  /* Load all referenced DLLs for Kernel, HAL and Kernel Debugger Transport DLL */
638  Success = WinLdrScanImportDescriptorTable(&LoaderBlock->LoadOrderListHead, DirPath, *KernelDTE);
639  Success &= WinLdrScanImportDescriptorTable(&LoaderBlock->LoadOrderListHead, DirPath, HalDTE);
640  if (KdComDTE)
641  {
642  Success &= WinLdrScanImportDescriptorTable(&LoaderBlock->LoadOrderListHead, DirPath, KdComDTE);
643  }
644 
645  return Success;
646 }
647 
648 VOID
651 {
652  ULONG_PTR SectionId;
653  PCSTR SectionName = OperatingSystem->SystemPartition;
654  CHAR SettingsValue[80];
655  BOOLEAN HasSection;
658  CHAR BootOptions[256];
659  PCHAR File;
661  PLOADER_PARAMETER_BLOCK LoaderBlock;
662 
663  /* Get OS setting value */
664  SettingsValue[0] = ANSI_NULL;
665  IniOpenSection("Operating Systems", &SectionId);
666  IniReadSettingByName(SectionId, SectionName, SettingsValue, sizeof(SettingsValue));
667 
668  /* Open the operating system section specified in the .ini file */
669  HasSection = IniOpenSection(SectionName, &SectionId);
670 
671  UiDrawBackdrop();
672  UiDrawProgressBarCenter(1, 100, "Loading NT...");
673 
674  /* Read the system path is set in the .ini file */
675  if (!HasSection ||
676  !IniReadSettingByName(SectionId, "SystemPath", BootPath, sizeof(BootPath)))
677  {
678  strcpy(BootPath, SectionName);
679  }
680 
681  /*
682  * Check whether BootPath is a full path
683  * and if not, create a full boot path.
684  *
685  * See FsOpenFile for the technique used.
686  */
687  if (strrchr(BootPath, ')') == NULL)
688  {
689  /* Temporarily save the boot path */
691 
692  /* This is not a full path. Use the current (i.e. boot) device. */
694 
695  /* Append a path separator if needed */
696  if (FileName[0] != '\\' && FileName[0] != '/')
697  strcat(BootPath, "\\");
698 
699  /* Append the remaining path */
701  }
702 
703  /* Append a backslash if needed */
704  if ((BootPath[0] == 0) || BootPath[strlen(BootPath) - 1] != '\\')
705  strcat(BootPath, "\\");
706 
707  /* Read booting options */
708  if (!HasSection || !IniReadSettingByName(SectionId, "Options", BootOptions, sizeof(BootOptions)))
709  {
710  /* Get options after the title */
711  PCSTR p = SettingsValue;
712  while (*p == ' ' || *p == '"')
713  p++;
714  while (*p != '\0' && *p != '"')
715  p++;
716  strcpy(BootOptions, p);
717  TRACE("BootOptions: '%s'\n", BootOptions);
718  }
719 
720  /* Append boot-time options */
722 
723  /* Check if a ramdisk file was given */
724  File = strstr(BootOptions, "/RDPATH=");
725  if (File)
726  {
727  /* Copy the file name and everything else after it */
728  strcpy(FileName, File + 8);
729 
730  /* Null-terminate */
731  *strstr(FileName, " ") = ANSI_NULL;
732 
733  /* Load the ramdisk */
735  {
736  UiMessageBox("Failed to load RAM disk file %s", FileName);
737  return;
738  }
739  }
740 
741  /* Let user know we started loading */
742  //UiDrawStatusText("Loading...");
743 
744  TRACE("BootPath: '%s'\n", BootPath);
745 
746  /* Allocate and minimalist-initialize LPB */
747  AllocateAndInitLPB(&LoaderBlock);
748 
749  /* Load the system hive */
750  UiDrawBackdrop();
751  UiDrawProgressBarCenter(15, 100, "Loading system hive...");
752  Success = WinLdrInitSystemHive(LoaderBlock, BootPath, FALSE);
753  TRACE("SYSTEM hive %s\n", (Success ? "loaded" : "not loaded"));
754  /* Bail out if failure */
755  if (!Success)
756  return;
757 
758  /* Load NLS data, OEM font, and prepare boot drivers list */
759  Success = WinLdrScanSystemHive(LoaderBlock, BootPath);
760  TRACE("SYSTEM hive %s\n", (Success ? "scanned" : "not scanned"));
761  /* Bail out if failure */
762  if (!Success)
763  return;
764 
765  /* Finish loading */
767  LoaderBlock,
768  BootOptions,
769  BootPath,
770  FALSE);
771 }
772 
773 VOID
776  PLOADER_PARAMETER_BLOCK LoaderBlock,
779  BOOLEAN Setup)
780 {
781  PLOADER_PARAMETER_BLOCK LoaderBlockVA;
783  PLDR_DATA_TABLE_ENTRY KernelDTE;
786  TRACE("LoadAndBootWindowsCommon()\n");
787 
788 #ifdef _M_IX86
789  /* Setup redirection support */
791 #endif
792 
793  /* Convert BootPath to SystemRoot */
794  SystemRoot = strstr(BootPath, "\\");
795 
796  /* Detect hardware */
797  UiDrawBackdrop();
798  UiDrawProgressBarCenter(20, 100, "Detecting hardware...");
799  LoaderBlock->ConfigurationRoot = MachHwDetect();
800 
801  if (OperatingSystemVersion == 0)
803 
804  /* Load the operating system core: the Kernel, the HAL and the Kernel Debugger Transport DLL */
806  LoaderBlock,
807  BootOptions,
808  BootPath,
809  &KernelDTE);
810  if (!Success)
811  {
812  UiMessageBox("Error loading NTOS core.");
813  return;
814  }
815 
816  /* Load boot drivers */
817  UiDrawBackdrop();
818  UiDrawProgressBarCenter(100, 100, "Loading boot drivers...");
819  Success = WinLdrLoadBootDrivers(LoaderBlock, BootPath);
820  TRACE("Boot drivers loading %s\n", Success ? "successful" : "failed");
821 
822  /* Initialize Phase 1 - no drivers loading anymore */
823  WinLdrInitializePhase1(LoaderBlock,
824  BootOptions,
825  SystemRoot,
826  BootPath,
828 
829  /* Save entry-point pointer and Loader block VAs */
831  LoaderBlockVA = PaToVa(LoaderBlock);
832 
833  /* "Stop all motors", change videomode */
835 
836  /* Cleanup ini file */
837  IniCleanup();
838 
839  /* Debugging... */
840  //DumpMemoryAllocMap();
841 
842  /* Do the machine specific initialization */
843  WinLdrSetupMachineDependent(LoaderBlock);
844 
845  /* Map pages and create memory descriptors */
846  WinLdrSetupMemoryLayout(LoaderBlock);
847 
848  /* Set processor context */
850 
851  /* Save final value of LoaderPagesSpanned */
853 
854  TRACE("Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
855  KiSystemStartup, LoaderBlockVA);
856 
857  // Zero KI_USER_SHARED_DATA page
858  memset((PVOID)KI_USER_SHARED_DATA, 0, MM_PAGE_SIZE);
859 
860  WinLdrpDumpMemoryDescriptors(LoaderBlockVA);
861  WinLdrpDumpBootDriver(LoaderBlockVA);
862 #ifndef _M_AMD64
863  WinLdrpDumpArcDisks(LoaderBlockVA);
864 #endif
865 
866  /* Pass control */
867  (*KiSystemStartup)(LoaderBlockVA);
868 }
869 
870 VOID
872 {
873  PLIST_ENTRY NextMd;
875 
876  NextMd = LoaderBlock->MemoryDescriptorListHead.Flink;
877 
878  while (NextMd != &LoaderBlock->MemoryDescriptorListHead)
879  {
881 
882  TRACE("BP %08X PC %04X MT %d\n", MemoryDescriptor->BasePage,
883  MemoryDescriptor->PageCount, MemoryDescriptor->MemoryType);
884 
885  NextMd = MemoryDescriptor->ListEntry.Flink;
886  }
887 }
888 
889 VOID
891 {
892  PLIST_ENTRY NextBd;
893  PBOOT_DRIVER_LIST_ENTRY BootDriver;
894 
895  NextBd = LoaderBlock->BootDriverListHead.Flink;
896 
897  while (NextBd != &LoaderBlock->BootDriverListHead)
898  {
899  BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, Link);
900 
901  TRACE("BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver->FilePath,
902  BootDriver->LdrEntry, &BootDriver->RegistryPath);
903 
904  NextBd = BootDriver->Link.Flink;
905  }
906 }
907 
908 VOID
910 {
911  PLIST_ENTRY NextBd;
912  PARC_DISK_SIGNATURE ArcDisk;
913 
914  NextBd = LoaderBlock->ArcDiskInformation->DiskSignatureListHead.Flink;
915 
916  while (NextBd != &LoaderBlock->ArcDiskInformation->DiskSignatureListHead)
917  {
918  ArcDisk = CONTAINING_RECORD(NextBd, ARC_DISK_SIGNATURE, ListEntry);
919 
920  TRACE("ArcDisk %s checksum: 0x%X, signature: 0x%X\n",
921  ArcDisk->ArcName, ArcDisk->CheckSum, ArcDisk->Signature);
922 
923  NextBd = ArcDisk->ListEntry.Flink;
924  }
925 }
VOID AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK *OutLoaderBlock)
Definition: winldr.c:49
VOID AppendBootTimeOptions(PCHAR BootOptions)
Definition: options.c:244
signed char * PCHAR
Definition: retypes.h:7
#define MachHwDetect()
Definition: machine.h:130
#define IN
Definition: typedefs.h:38
VOID LoadAndBootWindows(IN OperatingSystemItem *OperatingSystem, IN USHORT OperatingSystemVersion)
Definition: winldr.c:649
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
VOID(NTAPI * KERNEL_ENTRY_POINT)(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.h:34
PSTR ArcBootDeviceName
Definition: arc.h:503
_Out_ PNDIS_BUFFER _In_ NDIS_HANDLE _In_ PVOID MemoryDescriptor
Definition: ndis.h:3252
BOOLEAN WinLdrAllocateDataTableEntry(IN OUT PLIST_ENTRY ModuleListHead, IN PCCH BaseDllName, IN PCCH FullDllName, IN PVOID BasePA, OUT PLDR_DATA_TABLE_ENTRY *NewEntry)
Definition: peloader.c:172
ARC_DISK_INFORMATION ArcDiskInformation
Definition: winldr.h:84
ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[]
Definition: archwsup.c:21
#define ERROR_SUCCESS
Definition: deptool.c:10
VOID WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:909
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:824
char * strncat(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:605
#define _WIN32_WINNT_WS03
Definition: sdkddkver.h:23
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
BOOLEAN NTAPI RamDiskLoadVirtualFile(IN PCHAR FileName)
Definition: ramdisk.c:121
Definition: arc.h:32
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strpbrk(const char *String, const char *Delimiters)
Definition: utclib.c:302
VOID WinLdrSetProcessorContext(void)
Definition: winldr.c:348
PCHAR ArcName
Definition: arc.h:210
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
PLOADER_PARAMETER_EXTENSION Extension
Definition: arc.h:512
PCONFIGURATION_COMPONENT_DATA ConfigurationRoot
Definition: arc.h:502
char CHAR
Definition: xmlstorage.h:175
static BOOLEAN LoadWindowsCore(IN USHORT OperatingSystemVersion, IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR BootOptions, IN PCSTR BootPath, IN OUT PLDR_DATA_TABLE_ENTRY *KernelDTE)
Definition: winldr.c:473
BOOLEAN WinLdrTerminalConnected
Definition: headless.c:30
ULONG Signature
Definition: arc.h:209
_Check_return_ _CRTIMP size_t __cdecl strspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
HEADLESS_LOADER_BLOCK LoaderRedirectionInformation
Definition: headless.c:29
ULONG ARC_STATUS
Definition: arc.h:4
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1260
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define InsertTailList(ListHead, Entry)
char * LPSTR
Definition: xmlstorage.h:182
enum OPTION_FLAGS Options
Definition: stats.c:44
UNICODE_STRING FilePath
Definition: arc.h:201
static int Link(const char **args)
Definition: vfdcmd.c:2414
void WinLdrSetupEms(IN PCHAR BootOptions)
Definition: headless.c:243
BOOLEAN WinLdrSetupMemoryLayout(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: wlmemory.c:182
CHAR ArcBootDeviceName[MAX_PATH+1]
Definition: winldr.h:80
PCWSTR FilePath
BOOLEAN WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, LPCSTR BootPath)
Definition: winldr.c:295
enum _TYPE_OF_MEMORY TYPE_OF_MEMORY
uint32_t ULONG_PTR
Definition: typedefs.h:63
Definition: arc.h:198
#define MAX_OPTIONS_LENGTH
Definition: winldr.h:68
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define sprintf(buf, format,...)
Definition: sprintf.c:55
BOOLEAN WinLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead, IN PCH DllName, OUT PLDR_DATA_TABLE_ENTRY *LoadedEntry)
Definition: peloader.c:58
#define _snprintf
Definition: xmlstorage.h:200
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
#define _WIN32_WINNT_WIN2K
Definition: sdkddkver.h:21
VOID DumpMemoryAllocMap(VOID)
struct _SETUP_LOADER_BLOCK * SetupLdrBlock
Definition: arc.h:511
#define ANSI_NULL
long LONG
Definition: pedump.c:60
VOID List_PaToVa(_In_ LIST_ENTRY *ListEntry)
DBG_DEFAULT_CHANNEL(WINDOWS)
PVOID EntryPoint
Definition: ntddk_ex.h:207
INIT_FUNCTION VOID NTAPI KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: kiinit.c:371
_Check_return_ _CRTIMP int __cdecl _strnicmp(_In_reads_or_z_(_MaxCount) const char *_Str1, _In_reads_or_z_(_MaxCount) const char *_Str2, _In_ size_t _MaxCount)
_In_opt_ PVOID _In_ PCSTR File
Definition: iofuncs.h:615
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:347
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:379
#define _WIN32_WINNT_NT4
Definition: sdkddkver.h:20
USHORT WinLdrDetectVersion(VOID)
Definition: winldr.c:407
VOID WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:890
const char * LPCSTR
Definition: xmlstorage.h:183
void * PVOID
Definition: retypes.h:9
LOADER_PARAMETER_BLOCK LoaderBlock
Definition: winldr.h:72
USHORT OperatingSystemVersion
Definition: bootmgr.c:35
ULONG_PTR LoaderPagesSpanned
Definition: arc.h:356
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:147
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
CONST CHAR * PCCH
Definition: ntbasedef.h:399
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
#define TRACE(s)
Definition: solgame.cpp:4
LIST_ENTRY ListEntry
Definition: arc.h:208
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:25
PVOID WinLdrLoadModule(PCSTR ModuleName, ULONG *Size, TYPE_OF_MEMORY MemoryType)
Definition: winldr.c:347
static const WCHAR SystemRoot[]
Definition: reg.c:38
CHAR ArcName[MAX_PATH]
Definition: winldr.h:58
NLS_DATA_BLOCK NlsDataBlock
Definition: winldr.h:78
#define MAX_PATH
Definition: compat.h:26
PARC_DISK_INFORMATION ArcDiskInformation
Definition: arc.h:509
static BOOLEAN WinLdrLoadDeviceDriver(PLIST_ENTRY LoadOrderListHead, LPCSTR BootPath, PUNICODE_STRING FilePath, ULONG Flags, PLDR_DATA_TABLE_ENTRY *DriverDTE)
Definition: winldr.c:224
LIST_ENTRY BootDriverListHead
Definition: arc.h:495
ULONG reactos_disk_count
Definition: archwsup.c:20
ULONG LoaderPagesSpanned
Definition: mm.c:29
ARC_DISK_SIGNATURE DiskSignature
Definition: winldr.h:57
BOOLEAN AcpiPresent
Definition: macharm.c:21
VOID WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock, LPCSTR Options, LPCSTR SystemRoot, LPCSTR BootPath, USHORT VersionToBoot)
Definition: winldr.c:77
BOOLEAN WinLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead, IN PCCH DirectoryPath, IN PLDR_DATA_TABLE_ENTRY ScanDTE)
Definition: peloader.c:101
ARC_STATUS ArcRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
Definition: fs.c:237
CHAR LoadOptions[MAX_OPTIONS_LENGTH+1]
Definition: winldr.h:79
VOID IniCleanup(VOID)
Definition: inifile.c:235
int ret
static const WCHAR L[]
Definition: oid.c:1250
PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType)
Definition: mm.c:31
#define KI_USER_SHARED_DATA
Definition: btrfs_drv.h:1801
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
#define MachPrepareForReactOS(Setup)
Definition: machine.h:116
CHAR NtHalPathName[MAX_PATH+1]
Definition: winldr.h:83
Definition: typedefs.h:117
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID UiDrawBackdrop(VOID)
Definition: ui.c:241
VOID WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:871
LIST_ENTRY LoadOrderListHead
Definition: arc.h:493
LOADER_PARAMETER_EXTENSION Extension
Definition: winldr.h:73
Status
Definition: gdiplustypes.h:24
static BOOLEAN LoadModule(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCCH Path, IN PCCH File, IN PCCH ImportName, IN TYPE_OF_MEMORY MemoryType, OUT PLDR_DATA_TABLE_ENTRY *Dte, IN ULONG Percentage)
Definition: winldr.c:428
#define ERR(fmt,...)
Definition: debug.h:109
UNICODE_STRING RegistryPath
Definition: arc.h:202
PRTL_UNICODE_STRING_BUFFER Path
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
unsigned short USHORT
Definition: pedump.c:61
struct _LDR_DATA_TABLE_ENTRY * LdrEntry
Definition: arc.h:203
LIST_ENTRY MemoryDescriptorListHead
Definition: arc.h:494
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define MachDiskGetBootPath(Path, Size)
Definition: machine.h:118
BOOLEAN WinLdrLoadImage(IN PCHAR FileName, TYPE_OF_MEMORY MemoryType, OUT PVOID *ImageBasePA)
Definition: peloader.c:268
VOID ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start)
Definition: conversion.c:51
ARC_STATUS ArcClose(ULONG FileId)
Definition: fs.c:219
LIST_ENTRY Link
Definition: arc.h:200
ARC_STATUS ArcGetFileInformation(ULONG FileId, FILEINFORMATION *Information)
Definition: fs.c:251
#define OUT
Definition: typedefs.h:39
struct FileInfo FileInfo
FORCEINLINE PVOID PaToVa(PVOID Pa)
Definition: conversion.h:22
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ARC_STATUS ArcOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
Definition: fs.c:57
LIST_ENTRY DiskSignatureListHead
Definition: arc.h:221
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID LoadAndBootWindowsCommon(USHORT OperatingSystemVersion, PLOADER_PARAMETER_BLOCK LoaderBlock, LPCSTR BootOptions, LPCSTR BootPath, BOOLEAN Setup)
Definition: winldr.c:774
PNLS_DATA_BLOCK NlsData
Definition: arc.h:508
const char * PCSTR
Definition: typedefs.h:51
Definition: File.h:15
ULONG CheckSum
Definition: arc.h:211
CHAR NtBootPathName[MAX_PATH+1]
Definition: winldr.h:82
GLfloat GLfloat p
Definition: glext.h:8902
#define RegOpenKey
Definition: winreg.h:519
BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot, IN BOOLEAN Setup)
Definition: wlregistry.c:121
#define memset(x, y, z)
Definition: compat.h:39
BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN LPCSTR DirectoryPath)
Definition: wlregistry.c:171
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesRead
Definition: fltkernel.h:1255
struct _LOADER_PARAMETER_EXTENSION LOADER_PARAMETER_EXTENSION
char BootPath[0x100]
Definition: mach.c:35
VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: ui.c:373
PLOADER_SYSTEM_BLOCK WinLdrSystemBlock
Definition: winldr.c:42