4 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
5 * Copyright (C) 2006 Aleksey Bragin <aleksey@reactos.org>
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.
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.
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.
24 #include <ndk/ldrtypes.h>
27 DBG_DEFAULT_CHANNEL(WINDOWS
);
29 //FIXME: Do a better way to retrieve Arc disk information
30 extern ULONG reactos_disk_count
;
31 extern ARC_DISK_SIGNATURE reactos_arc_disk_info
[];
33 extern BOOLEAN UseRealHeap
;
34 extern ULONG LoaderPagesSpanned
;
35 extern BOOLEAN AcpiPresent
;
37 extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation
;
38 extern BOOLEAN WinLdrTerminalConnected
;
39 extern void WinLdrSetupEms(IN PCHAR BootOptions
);
41 PLOADER_SYSTEM_BLOCK WinLdrSystemBlock
;
44 VOID
DumpMemoryAllocMap(VOID
);
48 AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK
*OutLoaderBlock
)
50 PLOADER_PARAMETER_BLOCK LoaderBlock
;
52 /* Allocate and zero-init the LPB */
53 WinLdrSystemBlock
= MmAllocateMemoryWithType(sizeof(LOADER_SYSTEM_BLOCK
),
55 if (WinLdrSystemBlock
== NULL
)
57 UiMessageBox("Failed to allocate memory for system block!");
61 RtlZeroMemory(WinLdrSystemBlock
, sizeof(LOADER_SYSTEM_BLOCK
));
63 LoaderBlock
= &WinLdrSystemBlock
->LoaderBlock
;
64 LoaderBlock
->NlsData
= &WinLdrSystemBlock
->NlsDataBlock
;
66 /* Init three critical lists, used right away */
67 InitializeListHead(&LoaderBlock
->LoadOrderListHead
);
68 InitializeListHead(&LoaderBlock
->MemoryDescriptorListHead
);
69 InitializeListHead(&LoaderBlock
->BootDriverListHead
);
71 *OutLoaderBlock
= LoaderBlock
;
76 WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock
,
82 /* Examples of correct options and paths */
83 //CHAR Options[] = "/DEBUGPORT=COM1 /BAUDRATE=115200";
84 //CHAR Options[] = "/NODEBUG";
85 //CHAR SystemRoot[] = "\\WINNT\\";
86 //CHAR ArcBoot[] = "multi(0)disk(0)rdisk(0)partition(1)";
88 LPSTR LoadOptions
, NewLoadOptions
;
89 CHAR HalPath
[] = "\\";
93 ULONG_PTR PathSeparator
;
94 PLOADER_PARAMETER_EXTENSION Extension
;
96 /* Construct SystemRoot and ArcBoot from SystemPath */
97 PathSeparator
= strstr(BootPath
, "\\") - BootPath
;
98 strncpy(ArcBoot
, BootPath
, PathSeparator
);
99 ArcBoot
[PathSeparator
] = 0;
101 TRACE("ArcBoot: %s\n", ArcBoot
);
102 TRACE("SystemRoot: %s\n", SystemRoot
);
103 TRACE("Options: %s\n", Options
);
105 /* Fill Arc BootDevice */
106 LoaderBlock
->ArcBootDeviceName
= WinLdrSystemBlock
->ArcBootDeviceName
;
107 strncpy(LoaderBlock
->ArcBootDeviceName
, ArcBoot
, MAX_PATH
);
108 LoaderBlock
->ArcBootDeviceName
= PaToVa(LoaderBlock
->ArcBootDeviceName
);
110 /* Fill Arc HalDevice, it matches ArcBoot path */
111 LoaderBlock
->ArcHalDeviceName
= WinLdrSystemBlock
->ArcBootDeviceName
;
112 LoaderBlock
->ArcHalDeviceName
= PaToVa(LoaderBlock
->ArcHalDeviceName
);
114 /* Fill SystemRoot */
115 LoaderBlock
->NtBootPathName
= WinLdrSystemBlock
->NtBootPathName
;
116 strncpy(LoaderBlock
->NtBootPathName
, SystemRoot
, MAX_PATH
);
117 LoaderBlock
->NtBootPathName
= PaToVa(LoaderBlock
->NtBootPathName
);
119 /* Fill NtHalPathName */
120 LoaderBlock
->NtHalPathName
= WinLdrSystemBlock
->NtHalPathName
;
121 strncpy(LoaderBlock
->NtHalPathName
, HalPath
, MAX_PATH
);
122 LoaderBlock
->NtHalPathName
= PaToVa(LoaderBlock
->NtHalPathName
);
124 /* Fill LoadOptions and strip the '/' commutator symbol in front of each option */
125 NewLoadOptions
= LoadOptions
= LoaderBlock
->LoadOptions
= WinLdrSystemBlock
->LoadOptions
;
126 strncpy(LoaderBlock
->LoadOptions
, Options
, MAX_OPTIONS_LENGTH
);
130 while (*LoadOptions
== '/')
133 *NewLoadOptions
++ = *LoadOptions
;
134 } while (*LoadOptions
++);
136 LoaderBlock
->LoadOptions
= PaToVa(LoaderBlock
->LoadOptions
);
139 LoaderBlock
->ArcDiskInformation
= &WinLdrSystemBlock
->ArcDiskInformation
;
140 InitializeListHead(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
142 /* Convert ARC disk information from freeldr to a correct format */
143 for (i
= 0; i
< reactos_disk_count
; i
++)
145 PARC_DISK_SIGNATURE_EX ArcDiskSig
;
147 /* Allocate the ARC structure */
148 ArcDiskSig
= HeapAllocate(FrLdrDefaultHeap
,
149 sizeof(ARC_DISK_SIGNATURE_EX
),
152 /* Copy the data over */
153 ArcDiskSig
->DiskSignature
.Signature
= reactos_arc_disk_info
[i
].Signature
;
154 ArcDiskSig
->DiskSignature
.CheckSum
= reactos_arc_disk_info
[i
].CheckSum
;
156 /* Copy the ARC Name */
157 strncpy(ArcDiskSig
->ArcName
, reactos_arc_disk_info
[i
].ArcName
, MAX_PATH
);
158 ArcDiskSig
->DiskSignature
.ArcName
= PaToVa(ArcDiskSig
->ArcName
);
160 /* Mark partition table as valid */
161 ArcDiskSig
->DiskSignature
.ValidPartitionTable
= TRUE
;
163 /* Insert into the list */
164 InsertTailList(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
,
165 &ArcDiskSig
->DiskSignature
.ListEntry
);
168 /* Convert all list's to Virtual address */
170 /* Convert the ArcDisks list to virtual address */
171 List_PaToVa(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
172 LoaderBlock
->ArcDiskInformation
= PaToVa(LoaderBlock
->ArcDiskInformation
);
174 /* Convert configuration entries to VA */
175 ConvertConfigToVA(LoaderBlock
->ConfigurationRoot
);
176 LoaderBlock
->ConfigurationRoot
= PaToVa(LoaderBlock
->ConfigurationRoot
);
178 /* Convert all DTE into virtual addresses */
179 List_PaToVa(&LoaderBlock
->LoadOrderListHead
);
181 /* this one will be converted right before switching to
182 virtual paging mode */
183 //List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
185 /* Convert list of boot drivers */
186 List_PaToVa(&LoaderBlock
->BootDriverListHead
);
188 /* Initialize Extension now */
189 Extension
= &WinLdrSystemBlock
->Extension
;
190 Extension
->Size
= sizeof(LOADER_PARAMETER_EXTENSION
);
191 Extension
->MajorVersion
= (VersionToBoot
& 0xFF00) >> 8;
192 Extension
->MinorVersion
= VersionToBoot
& 0xFF;
193 Extension
->Profile
.Status
= 2;
195 /* Check if ACPI is present */
198 /* See KiRosFrldrLpbToNtLpb for details */
199 Extension
->AcpiTable
= (PVOID
)1;
203 /* Set headless block pointer */
204 if (WinLdrTerminalConnected
)
206 Extension
->HeadlessLoaderBlock
= &WinLdrSystemBlock
->HeadlessLoaderBlock
;
207 RtlCopyMemory(Extension
->HeadlessLoaderBlock
,
208 &LoaderRedirectionInformation
,
209 sizeof(HEADLESS_LOADER_BLOCK
));
210 Extension
->HeadlessLoaderBlock
= PaToVa(Extension
->HeadlessLoaderBlock
);
213 /* Load drivers database */
214 strcpy(MiscFiles
, BootPath
);
215 strcat(MiscFiles
, "AppPatch\\drvmain.sdb");
216 Extension
->DrvDBImage
= PaToVa(WinLdrLoadModule(MiscFiles
,
217 &Extension
->DrvDBSize
,
218 LoaderRegistryData
));
220 /* Convert extension and setup block pointers */
221 LoaderBlock
->Extension
= PaToVa(Extension
);
223 if (LoaderBlock
->SetupLdrBlock
)
224 LoaderBlock
->SetupLdrBlock
= PaToVa(LoaderBlock
->SetupLdrBlock
);
226 TRACE("WinLdrInitializePhase1() completed\n");
230 WinLdrLoadDeviceDriver(PLIST_ENTRY LoadOrderListHead
,
232 PUNICODE_STRING FilePath
,
234 PLDR_DATA_TABLE_ENTRY
*DriverDTE
)
237 CHAR DriverPath
[1024];
243 // Separate the path to file name and directory path
244 _snprintf(DriverPath
, sizeof(DriverPath
), "%wZ", FilePath
);
245 DriverNamePos
= strrchr(DriverPath
, '\\');
246 if (DriverNamePos
!= NULL
)
249 strcpy(DllName
, DriverNamePos
+1);
251 // Cut out the name from the path
252 *(DriverNamePos
+1) = 0;
256 // There is no directory in the path
257 strcpy(DllName
, DriverPath
);
261 TRACE("DriverPath: %s, DllName: %s, LPB\n", DriverPath
, DllName
);
264 // Check if driver is already loaded
265 Status
= WinLdrCheckForLoadedDll(LoadOrderListHead
, DllName
, DriverDTE
);
268 // We've got the pointer to its DTE, just return success
272 // It's not loaded, we have to load it
273 _snprintf(FullPath
, sizeof(FullPath
), "%s%wZ", BootPath
, FilePath
);
274 Status
= WinLdrLoadImage(FullPath
, LoaderBootDriver
, &DriverBase
);
278 // Allocate a DTE for it
279 Status
= WinLdrAllocateDataTableEntry(LoadOrderListHead
, DllName
, DllName
, DriverBase
, DriverDTE
);
282 ERR("WinLdrAllocateDataTableEntry() failed\n");
286 // Modify any flags, if needed
287 (*DriverDTE
)->Flags
|= Flags
;
289 // Look for any dependencies it may have, and load them too
290 sprintf(FullPath
,"%s%s", BootPath
, DriverPath
);
291 Status
= WinLdrScanImportDescriptorTable(LoadOrderListHead
, FullPath
, *DriverDTE
);
294 ERR("WinLdrScanImportDescriptorTable() failed for %s\n", FullPath
);
302 WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock
,
306 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
309 // Walk through the boot drivers list
310 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
312 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
314 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
316 TRACE("BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
317 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
319 // Paths are relative (FIXME: Are they always relative?)
322 Status
= WinLdrLoadDeviceDriver(&LoaderBlock
->LoadOrderListHead
, BootPath
, &BootDriver
->FilePath
,
323 0, &BootDriver
->LdrEntry
);
325 // If loading failed - cry loudly
326 //FIXME: Maybe remove it from the list and try to continue?
329 UiMessageBox("Can't load boot driver!");
333 // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore
334 BootDriver
->RegistryPath
.Buffer
= PaToVa(BootDriver
->RegistryPath
.Buffer
);
335 BootDriver
->FilePath
.Buffer
= PaToVa(BootDriver
->FilePath
.Buffer
);
336 BootDriver
->LdrEntry
= PaToVa(BootDriver
->LdrEntry
);
338 NextBd
= BootDriver
->Link
.Flink
;
344 PVOID
WinLdrLoadModule(PCSTR ModuleName
, ULONG
*Size
,
345 TYPE_OF_MEMORY MemoryType
)
349 FILEINFORMATION FileInfo
;
354 //CHAR ProgressString[256];
356 /* Inform user we are loading files */
357 //sprintf(ProgressString, "Loading %s...", FileName);
358 //UiDrawProgressBarCenter(1, 100, ProgressString);
360 TRACE("Loading module %s\n", ModuleName
);
363 /* Open the image file */
364 Status
= ArcOpen((PCHAR
)ModuleName
, OpenReadOnly
, &FileId
);
365 if (Status
!= ESUCCESS
)
367 /* In case of errors, we just return, without complaining to the user */
371 /* Get this file's size */
372 Status
= ArcGetFileInformation(FileId
, &FileInfo
);
373 if (Status
!= ESUCCESS
)
378 FileSize
= FileInfo
.EndingAddress
.LowPart
;
381 /* Allocate memory */
382 PhysicalBase
= MmAllocateMemoryWithType(FileSize
, MemoryType
);
383 if (PhysicalBase
== NULL
)
389 /* Load whole file */
390 Status
= ArcRead(FileId
, PhysicalBase
, FileSize
, &BytesRead
);
392 if (Status
!= ESUCCESS
)
397 TRACE("Loaded %s at 0x%x with size 0x%x\n", ModuleName
, PhysicalBase
, FileSize
);
404 WinLdrDetectVersion()
411 L
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server",
413 if (rc
!= ERROR_SUCCESS
)
415 // Key doesn't exist; assume NT 4.0
416 return _WIN32_WINNT_NT4
;
419 // We may here want to read the value of ProductVersion
420 return _WIN32_WINNT_WS03
;
426 PLOADER_PARAMETER_BLOCK LoaderBlock
,
429 TYPE_OF_MEMORY MemoryType
,
430 PLDR_DATA_TABLE_ENTRY
*Dte
,
433 CHAR FullFileName
[MAX_PATH
];
434 CHAR ProgressString
[256];
439 sprintf(ProgressString
, "Loading %s...", File
);
440 UiDrawProgressBarCenter(Percentage
, 100, ProgressString
);
442 strcpy(FullFileName
, Path
);
443 strcat(FullFileName
, "SYSTEM32\\");
444 strcat(FullFileName
, File
);
446 Status
= WinLdrLoadImage(FullFileName
, MemoryType
, &BaseAdress
);
447 TRACE("%s loaded with status %d at %p\n",
448 File
, Status
, BaseAdress
);
450 strcpy(FullFileName
, "WINDOWS\\SYSTEM32\\");
451 strcat(FullFileName
, File
);
452 WinLdrAllocateDataTableEntry(&LoaderBlock
->LoadOrderListHead
, File
,
453 FullFileName
, BaseAdress
, Dte
);
459 LoadAndBootWindows(PCSTR OperatingSystemName
,
461 USHORT OperatingSystemVersion
)
464 char BootPath
[MAX_PATH
];
465 CHAR FileName
[MAX_PATH
];
466 CHAR BootOptions
[256];
470 PLOADER_PARAMETER_BLOCK LoaderBlock
;
472 // Open the operating system section
473 // specified in the .ini file
474 HasSection
= IniOpenSection(OperatingSystemName
, &SectionId
);
477 UiDrawProgressBarCenter(1, 100, "Loading NT...");
479 /* Read the system path is set in the .ini file */
481 !IniReadSettingByName(SectionId
, "SystemPath", BootPath
, sizeof(BootPath
)))
483 strcpy(BootPath
, OperatingSystemName
);
486 /* Special case for LiveCD */
487 if (!_strnicmp(BootPath
, "LiveCD", strlen("LiveCD")))
489 strcpy(FileName
, BootPath
+ strlen("LiveCD"));
490 MachDiskGetBootPath(BootPath
, sizeof(BootPath
));
491 strcat(BootPath
, FileName
);
494 /* append a backslash */
495 if ((strlen(BootPath
)==0) || BootPath
[strlen(BootPath
)] != '\\')
496 strcat(BootPath
, "\\");
498 /* Read booting options */
499 if (!HasSection
|| !IniReadSettingByName(SectionId
, "Options", BootOptions
, sizeof(BootOptions
)))
501 /* Get options after the title */
502 const CHAR
*p
= SettingsValue
;
503 while (*p
== ' ' || *p
== '"')
505 while (*p
!= '\0' && *p
!= '"')
507 strcpy(BootOptions
, p
);
508 TRACE("BootOptions: '%s'\n", BootOptions
);
511 /* Append boot-time options */
512 AppendBootTimeOptions(BootOptions
);
514 /* Check if a ramdisk file was given */
515 File
= strstr(BootOptions
, "/RDPATH=");
518 /* Copy the file name and everything else after it */
519 strcpy(FileName
, File
+ 8);
522 *strstr(FileName
, " ") = ANSI_NULL
;
524 /* Load the ramdisk */
525 RamDiskLoadVirtualFile(FileName
);
528 /* Let user know we started loading */
529 //UiDrawStatusText("Loading...");
531 TRACE("BootPath: '%s'\n", BootPath
);
533 /* Allocate and minimalistic-initialize LPB */
534 AllocateAndInitLPB(&LoaderBlock
);
537 /* Setup redirection support */
538 WinLdrSetupEms(BootOptions
);
543 UiDrawProgressBarCenter(15, 100, "Loading system hive...");
544 Status
= WinLdrInitSystemHive(LoaderBlock
, BootPath
);
545 TRACE("SYSTEM hive loaded with status %d\n", Status
);
547 /* Load NLS data, OEM font, and prepare boot drivers list */
548 Status
= WinLdrScanSystemHive(LoaderBlock
, BootPath
);
549 TRACE("SYSTEM hive scanned with status %d\n", Status
);
552 LoadAndBootWindowsCommon(OperatingSystemVersion
,
560 LoadAndBootWindowsCommon(
561 USHORT OperatingSystemVersion
,
562 PLOADER_PARAMETER_BLOCK LoaderBlock
,
567 PLOADER_PARAMETER_BLOCK LoaderBlockVA
;
569 CHAR FileName
[MAX_PATH
];
570 PLDR_DATA_TABLE_ENTRY KernelDTE
, HalDTE
, KdComDTE
= NULL
;
571 KERNEL_ENTRY_POINT KiSystemStartup
;
573 TRACE("LoadAndBootWindowsCommon()\n");
575 /* Convert BootPath to SystemRoot */
576 SystemRoot
= strstr(BootPath
, "\\");
578 /* Detect hardware */
580 LoaderBlock
->ConfigurationRoot
= MachHwDetect();
582 if (OperatingSystemVersion
== 0)
583 OperatingSystemVersion
= WinLdrDetectVersion();
586 LoadModule(LoaderBlock
, BootPath
, "NTOSKRNL.EXE", LoaderSystemCode
, &KernelDTE
, 30);
589 LoadModule(LoaderBlock
, BootPath
, "HAL.DLL", LoaderHalCode
, &HalDTE
, 45);
591 /* Load kernel-debugger support dll */
592 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
594 LoadModule(LoaderBlock
, BootPath
, "KDCOM.DLL", LoaderSystemCode
, &KdComDTE
, 60);
597 /* Load all referenced DLLs for kernel, HAL and kdcom.dll */
598 strcpy(FileName
, BootPath
);
599 strcat(FileName
, "system32\\");
600 Status
= WinLdrScanImportDescriptorTable(&LoaderBlock
->LoadOrderListHead
, FileName
, KernelDTE
);
601 Status
&= WinLdrScanImportDescriptorTable(&LoaderBlock
->LoadOrderListHead
, FileName
, HalDTE
);
603 Status
&= WinLdrScanImportDescriptorTable(&LoaderBlock
->LoadOrderListHead
, FileName
, KdComDTE
);
607 UiMessageBox("Error loading imported dll.");
611 /* Load boot drivers */
613 UiDrawProgressBarCenter(100, 100, "Loading boot drivers...");
614 Status
= WinLdrLoadBootDrivers(LoaderBlock
, (PCHAR
)BootPath
);
615 TRACE("Boot drivers loaded with status %d\n", Status
);
617 /* Initialize Phase 1 - no drivers loading anymore */
618 WinLdrInitializePhase1(LoaderBlock
, BootOptions
, SystemRoot
, BootPath
, OperatingSystemVersion
);
620 /* Save entry-point pointer and Loader block VAs */
621 KiSystemStartup
= (KERNEL_ENTRY_POINT
)KernelDTE
->EntryPoint
;
622 LoaderBlockVA
= PaToVa(LoaderBlock
);
624 /* "Stop all motors", change videomode */
625 MachPrepareForReactOS(Setup
);
628 //DumpMemoryAllocMap();
630 /* Do the machine specific initialization */
631 WinLdrSetupMachineDependent(LoaderBlock
);
633 /* Map pages and create memory descriptors */
634 WinLdrSetupMemoryLayout(LoaderBlock
);
636 /* Set processor context */
637 WinLdrSetProcessorContext();
639 /* Save final value of LoaderPagesSpanned */
640 LoaderBlock
->Extension
->LoaderPagesSpanned
= LoaderPagesSpanned
;
642 TRACE("Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
643 KiSystemStartup
, LoaderBlockVA
);
645 // Zero KI_USER_SHARED_DATA page
646 memset((PVOID
)KI_USER_SHARED_DATA
, 0, MM_PAGE_SIZE
);
648 WinLdrpDumpMemoryDescriptors(LoaderBlockVA
);
649 WinLdrpDumpBootDriver(LoaderBlockVA
);
651 WinLdrpDumpArcDisks(LoaderBlockVA
);
654 //FIXME: If I substitute this debugging checkpoint, GCC will "optimize away" the code below
656 /*asm(".intel_syntax noprefix\n");
659 asm(".att_syntax\n");*/
662 (*KiSystemStartup
)(LoaderBlockVA
);
666 WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
)
669 PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor
;
671 NextMd
= LoaderBlock
->MemoryDescriptorListHead
.Flink
;
673 while (NextMd
!= &LoaderBlock
->MemoryDescriptorListHead
)
675 MemoryDescriptor
= CONTAINING_RECORD(NextMd
, MEMORY_ALLOCATION_DESCRIPTOR
, ListEntry
);
677 TRACE("BP %08X PC %04X MT %d\n", MemoryDescriptor
->BasePage
,
678 MemoryDescriptor
->PageCount
, MemoryDescriptor
->MemoryType
);
680 NextMd
= MemoryDescriptor
->ListEntry
.Flink
;
685 WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
)
688 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
690 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
692 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
694 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
696 TRACE("BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
697 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
699 NextBd
= BootDriver
->Link
.Flink
;
704 WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
)
707 PARC_DISK_SIGNATURE ArcDisk
;
709 NextBd
= LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
.Flink
;
711 while (NextBd
!= &LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
)
713 ArcDisk
= CONTAINING_RECORD(NextBd
, ARC_DISK_SIGNATURE
, ListEntry
);
715 TRACE("ArcDisk %s checksum: 0x%X, signature: 0x%X\n",
716 ArcDisk
->ArcName
, ArcDisk
->CheckSum
, ArcDisk
->Signature
);
718 NextBd
= ArcDisk
->ListEntry
.Flink
;