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 ULONG LoaderPagesSpanned
;
34 extern BOOLEAN AcpiPresent
;
36 extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation
;
37 extern BOOLEAN WinLdrTerminalConnected
;
38 extern void WinLdrSetupEms(IN PCHAR BootOptions
);
40 PLOADER_SYSTEM_BLOCK WinLdrSystemBlock
;
43 VOID
DumpMemoryAllocMap(VOID
);
47 AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK
*OutLoaderBlock
)
49 PLOADER_PARAMETER_BLOCK LoaderBlock
;
51 /* Allocate and zero-init the LPB */
52 WinLdrSystemBlock
= MmAllocateMemoryWithType(sizeof(LOADER_SYSTEM_BLOCK
),
54 if (WinLdrSystemBlock
== NULL
)
56 UiMessageBox("Failed to allocate memory for system block!");
60 RtlZeroMemory(WinLdrSystemBlock
, sizeof(LOADER_SYSTEM_BLOCK
));
62 LoaderBlock
= &WinLdrSystemBlock
->LoaderBlock
;
63 LoaderBlock
->NlsData
= &WinLdrSystemBlock
->NlsDataBlock
;
65 /* Init three critical lists, used right away */
66 InitializeListHead(&LoaderBlock
->LoadOrderListHead
);
67 InitializeListHead(&LoaderBlock
->MemoryDescriptorListHead
);
68 InitializeListHead(&LoaderBlock
->BootDriverListHead
);
70 *OutLoaderBlock
= LoaderBlock
;
75 WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock
,
81 /* Examples of correct options and paths */
82 //CHAR Options[] = "/DEBUGPORT=COM1 /BAUDRATE=115200";
83 //CHAR Options[] = "/NODEBUG";
84 //CHAR SystemRoot[] = "\\WINNT\\";
85 //CHAR ArcBoot[] = "multi(0)disk(0)rdisk(0)partition(1)";
87 LPSTR LoadOptions
, NewLoadOptions
;
88 CHAR HalPath
[] = "\\";
92 ULONG_PTR PathSeparator
;
93 PLOADER_PARAMETER_EXTENSION Extension
;
95 /* Construct SystemRoot and ArcBoot from SystemPath */
96 PathSeparator
= strstr(BootPath
, "\\") - BootPath
;
97 strncpy(ArcBoot
, BootPath
, PathSeparator
);
98 ArcBoot
[PathSeparator
] = 0;
100 TRACE("ArcBoot: %s\n", ArcBoot
);
101 TRACE("SystemRoot: %s\n", SystemRoot
);
102 TRACE("Options: %s\n", Options
);
104 /* Fill Arc BootDevice */
105 LoaderBlock
->ArcBootDeviceName
= WinLdrSystemBlock
->ArcBootDeviceName
;
106 strncpy(LoaderBlock
->ArcBootDeviceName
, ArcBoot
, MAX_PATH
);
107 LoaderBlock
->ArcBootDeviceName
= PaToVa(LoaderBlock
->ArcBootDeviceName
);
109 /* Fill Arc HalDevice, it matches ArcBoot path */
110 LoaderBlock
->ArcHalDeviceName
= WinLdrSystemBlock
->ArcBootDeviceName
;
111 LoaderBlock
->ArcHalDeviceName
= PaToVa(LoaderBlock
->ArcHalDeviceName
);
113 /* Fill SystemRoot */
114 LoaderBlock
->NtBootPathName
= WinLdrSystemBlock
->NtBootPathName
;
115 strncpy(LoaderBlock
->NtBootPathName
, SystemRoot
, MAX_PATH
);
116 LoaderBlock
->NtBootPathName
= PaToVa(LoaderBlock
->NtBootPathName
);
118 /* Fill NtHalPathName */
119 LoaderBlock
->NtHalPathName
= WinLdrSystemBlock
->NtHalPathName
;
120 strncpy(LoaderBlock
->NtHalPathName
, HalPath
, MAX_PATH
);
121 LoaderBlock
->NtHalPathName
= PaToVa(LoaderBlock
->NtHalPathName
);
123 /* Fill LoadOptions and strip the '/' commutator symbol in front of each option */
124 NewLoadOptions
= LoadOptions
= LoaderBlock
->LoadOptions
= WinLdrSystemBlock
->LoadOptions
;
125 strncpy(LoaderBlock
->LoadOptions
, Options
, MAX_OPTIONS_LENGTH
);
129 while (*LoadOptions
== '/')
132 *NewLoadOptions
++ = *LoadOptions
;
133 } while (*LoadOptions
++);
135 LoaderBlock
->LoadOptions
= PaToVa(LoaderBlock
->LoadOptions
);
138 LoaderBlock
->ArcDiskInformation
= &WinLdrSystemBlock
->ArcDiskInformation
;
139 InitializeListHead(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
141 /* Convert ARC disk information from freeldr to a correct format */
142 for (i
= 0; i
< reactos_disk_count
; i
++)
144 PARC_DISK_SIGNATURE_EX ArcDiskSig
;
146 /* Allocate the ARC structure */
147 ArcDiskSig
= HeapAllocate(FrLdrDefaultHeap
,
148 sizeof(ARC_DISK_SIGNATURE_EX
),
151 /* Copy the data over */
152 ArcDiskSig
->DiskSignature
.Signature
= reactos_arc_disk_info
[i
].Signature
;
153 ArcDiskSig
->DiskSignature
.CheckSum
= reactos_arc_disk_info
[i
].CheckSum
;
155 /* Copy the ARC Name */
156 strncpy(ArcDiskSig
->ArcName
, reactos_arc_disk_info
[i
].ArcName
, MAX_PATH
);
157 ArcDiskSig
->DiskSignature
.ArcName
= PaToVa(ArcDiskSig
->ArcName
);
159 /* Mark partition table as valid */
160 ArcDiskSig
->DiskSignature
.ValidPartitionTable
= TRUE
;
162 /* Insert into the list */
163 InsertTailList(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
,
164 &ArcDiskSig
->DiskSignature
.ListEntry
);
167 /* Convert all list's to Virtual address */
169 /* Convert the ArcDisks list to virtual address */
170 List_PaToVa(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
171 LoaderBlock
->ArcDiskInformation
= PaToVa(LoaderBlock
->ArcDiskInformation
);
173 /* Convert configuration entries to VA */
174 ConvertConfigToVA(LoaderBlock
->ConfigurationRoot
);
175 LoaderBlock
->ConfigurationRoot
= PaToVa(LoaderBlock
->ConfigurationRoot
);
177 /* Convert all DTE into virtual addresses */
178 List_PaToVa(&LoaderBlock
->LoadOrderListHead
);
180 /* this one will be converted right before switching to
181 virtual paging mode */
182 //List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
184 /* Convert list of boot drivers */
185 List_PaToVa(&LoaderBlock
->BootDriverListHead
);
187 /* Initialize Extension now */
188 Extension
= &WinLdrSystemBlock
->Extension
;
189 Extension
->Size
= sizeof(LOADER_PARAMETER_EXTENSION
);
190 Extension
->MajorVersion
= (VersionToBoot
& 0xFF00) >> 8;
191 Extension
->MinorVersion
= VersionToBoot
& 0xFF;
192 Extension
->Profile
.Status
= 2;
194 /* Check if ACPI is present */
197 /* See KiRosFrldrLpbToNtLpb for details */
198 Extension
->AcpiTable
= (PVOID
)1;
202 /* Set headless block pointer */
203 if (WinLdrTerminalConnected
)
205 Extension
->HeadlessLoaderBlock
= &WinLdrSystemBlock
->HeadlessLoaderBlock
;
206 RtlCopyMemory(Extension
->HeadlessLoaderBlock
,
207 &LoaderRedirectionInformation
,
208 sizeof(HEADLESS_LOADER_BLOCK
));
209 Extension
->HeadlessLoaderBlock
= PaToVa(Extension
->HeadlessLoaderBlock
);
212 /* Load drivers database */
213 strcpy(MiscFiles
, BootPath
);
214 strcat(MiscFiles
, "AppPatch\\drvmain.sdb");
215 Extension
->DrvDBImage
= PaToVa(WinLdrLoadModule(MiscFiles
,
216 &Extension
->DrvDBSize
,
217 LoaderRegistryData
));
219 /* Convert extension and setup block pointers */
220 LoaderBlock
->Extension
= PaToVa(Extension
);
222 if (LoaderBlock
->SetupLdrBlock
)
223 LoaderBlock
->SetupLdrBlock
= PaToVa(LoaderBlock
->SetupLdrBlock
);
225 TRACE("WinLdrInitializePhase1() completed\n");
229 WinLdrLoadDeviceDriver(PLIST_ENTRY LoadOrderListHead
,
231 PUNICODE_STRING FilePath
,
233 PLDR_DATA_TABLE_ENTRY
*DriverDTE
)
236 CHAR DriverPath
[1024];
242 // Separate the path to file name and directory path
243 _snprintf(DriverPath
, sizeof(DriverPath
), "%wZ", FilePath
);
244 DriverNamePos
= strrchr(DriverPath
, '\\');
245 if (DriverNamePos
!= NULL
)
248 strcpy(DllName
, DriverNamePos
+1);
250 // Cut out the name from the path
251 *(DriverNamePos
+1) = 0;
255 // There is no directory in the path
256 strcpy(DllName
, DriverPath
);
260 TRACE("DriverPath: %s, DllName: %s, LPB\n", DriverPath
, DllName
);
263 // Check if driver is already loaded
264 Status
= WinLdrCheckForLoadedDll(LoadOrderListHead
, DllName
, DriverDTE
);
267 // We've got the pointer to its DTE, just return success
271 // It's not loaded, we have to load it
272 _snprintf(FullPath
, sizeof(FullPath
), "%s%wZ", BootPath
, FilePath
);
273 Status
= WinLdrLoadImage(FullPath
, LoaderBootDriver
, &DriverBase
);
277 // Allocate a DTE for it
278 Status
= WinLdrAllocateDataTableEntry(LoadOrderListHead
, DllName
, DllName
, DriverBase
, DriverDTE
);
281 ERR("WinLdrAllocateDataTableEntry() failed\n");
285 // Modify any flags, if needed
286 (*DriverDTE
)->Flags
|= Flags
;
288 // Look for any dependencies it may have, and load them too
289 sprintf(FullPath
,"%s%s", BootPath
, DriverPath
);
290 Status
= WinLdrScanImportDescriptorTable(LoadOrderListHead
, FullPath
, *DriverDTE
);
293 ERR("WinLdrScanImportDescriptorTable() failed for %s\n", FullPath
);
301 WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock
,
305 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
308 // Walk through the boot drivers list
309 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
311 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
313 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
315 TRACE("BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
316 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
318 // Paths are relative (FIXME: Are they always relative?)
321 Status
= WinLdrLoadDeviceDriver(&LoaderBlock
->LoadOrderListHead
, BootPath
, &BootDriver
->FilePath
,
322 0, &BootDriver
->LdrEntry
);
324 // If loading failed - cry loudly
325 //FIXME: Maybe remove it from the list and try to continue?
328 UiMessageBox("Can't load boot driver!");
332 // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore
333 BootDriver
->RegistryPath
.Buffer
= PaToVa(BootDriver
->RegistryPath
.Buffer
);
334 BootDriver
->FilePath
.Buffer
= PaToVa(BootDriver
->FilePath
.Buffer
);
335 BootDriver
->LdrEntry
= PaToVa(BootDriver
->LdrEntry
);
337 NextBd
= BootDriver
->Link
.Flink
;
343 PVOID
WinLdrLoadModule(PCSTR ModuleName
, ULONG
*Size
,
344 TYPE_OF_MEMORY MemoryType
)
348 FILEINFORMATION FileInfo
;
353 //CHAR ProgressString[256];
355 /* Inform user we are loading files */
356 //sprintf(ProgressString, "Loading %s...", FileName);
357 //UiDrawProgressBarCenter(1, 100, ProgressString);
359 TRACE("Loading module %s\n", ModuleName
);
362 /* Open the image file */
363 Status
= ArcOpen((PCHAR
)ModuleName
, OpenReadOnly
, &FileId
);
364 if (Status
!= ESUCCESS
)
366 /* In case of errors, we just return, without complaining to the user */
370 /* Get this file's size */
371 Status
= ArcGetFileInformation(FileId
, &FileInfo
);
372 if (Status
!= ESUCCESS
)
377 FileSize
= FileInfo
.EndingAddress
.LowPart
;
380 /* Allocate memory */
381 PhysicalBase
= MmAllocateMemoryWithType(FileSize
, MemoryType
);
382 if (PhysicalBase
== NULL
)
388 /* Load whole file */
389 Status
= ArcRead(FileId
, PhysicalBase
, FileSize
, &BytesRead
);
391 if (Status
!= ESUCCESS
)
396 TRACE("Loaded %s at 0x%x with size 0x%x\n", ModuleName
, PhysicalBase
, FileSize
);
403 WinLdrDetectVersion()
410 L
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server",
412 if (rc
!= ERROR_SUCCESS
)
414 // Key doesn't exist; assume NT 4.0
415 return _WIN32_WINNT_NT4
;
418 // We may here want to read the value of ProductVersion
419 return _WIN32_WINNT_WS03
;
425 PLOADER_PARAMETER_BLOCK LoaderBlock
,
428 TYPE_OF_MEMORY MemoryType
,
429 PLDR_DATA_TABLE_ENTRY
*Dte
,
432 CHAR FullFileName
[MAX_PATH
];
433 CHAR ProgressString
[256];
438 sprintf(ProgressString
, "Loading %s...", File
);
439 UiDrawProgressBarCenter(Percentage
, 100, ProgressString
);
441 strcpy(FullFileName
, Path
);
442 strcat(FullFileName
, "SYSTEM32\\");
443 strcat(FullFileName
, File
);
445 Status
= WinLdrLoadImage(FullFileName
, MemoryType
, &BaseAdress
);
446 TRACE("%s loaded with status %d at %p\n",
447 File
, Status
, BaseAdress
);
449 strcpy(FullFileName
, "WINDOWS\\SYSTEM32\\");
450 strcat(FullFileName
, File
);
451 WinLdrAllocateDataTableEntry(&LoaderBlock
->LoadOrderListHead
, File
,
452 FullFileName
, BaseAdress
, Dte
);
458 LoadAndBootWindows(IN OperatingSystemItem
* OperatingSystem
,
459 IN USHORT OperatingSystemVersion
)
462 PCSTR SectionName
= OperatingSystem
->SystemPartition
;
463 CHAR SettingsValue
[80];
465 CHAR BootPath
[MAX_PATH
];
466 CHAR FileName
[MAX_PATH
];
467 CHAR BootOptions
[256];
470 PLOADER_PARAMETER_BLOCK LoaderBlock
;
472 // Get OS setting value
473 SettingsValue
[0] = ANSI_NULL
;
474 IniOpenSection("Operating Systems", &SectionId
);
475 IniReadSettingByName(SectionId
, SectionName
, SettingsValue
, sizeof(SettingsValue
));
477 // Open the operating system section
478 // specified in the .ini file
479 HasSection
= IniOpenSection(SectionName
, &SectionId
);
482 UiDrawProgressBarCenter(1, 100, "Loading NT...");
484 /* Read the system path is set in the .ini file */
486 !IniReadSettingByName(SectionId
, "SystemPath", BootPath
, sizeof(BootPath
)))
488 strcpy(BootPath
, SectionName
);
491 /* Special case for LiveCD */
492 if (!_strnicmp(BootPath
, "LiveCD", strlen("LiveCD")))
494 strcpy(FileName
, BootPath
+ strlen("LiveCD"));
495 MachDiskGetBootPath(BootPath
, sizeof(BootPath
));
496 strcat(BootPath
, FileName
);
499 /* append a backslash */
500 if ((strlen(BootPath
)==0) || BootPath
[strlen(BootPath
)] != '\\')
501 strcat(BootPath
, "\\");
503 /* Read booting options */
504 if (!HasSection
|| !IniReadSettingByName(SectionId
, "Options", BootOptions
, sizeof(BootOptions
)))
506 /* Get options after the title */
507 PCSTR p
= SettingsValue
;
508 while (*p
== ' ' || *p
== '"')
510 while (*p
!= '\0' && *p
!= '"')
512 strcpy(BootOptions
, p
);
513 TRACE("BootOptions: '%s'\n", BootOptions
);
516 /* Append boot-time options */
517 AppendBootTimeOptions(BootOptions
);
519 /* Check if a ramdisk file was given */
520 File
= strstr(BootOptions
, "/RDPATH=");
523 /* Copy the file name and everything else after it */
524 strcpy(FileName
, File
+ 8);
527 *strstr(FileName
, " ") = ANSI_NULL
;
529 /* Load the ramdisk */
530 RamDiskLoadVirtualFile(FileName
);
533 /* Let user know we started loading */
534 //UiDrawStatusText("Loading...");
536 TRACE("BootPath: '%s'\n", BootPath
);
538 /* Allocate and minimalistic-initialize LPB */
539 AllocateAndInitLPB(&LoaderBlock
);
542 /* Setup redirection support */
543 WinLdrSetupEms(BootOptions
);
548 UiDrawProgressBarCenter(15, 100, "Loading system hive...");
549 Status
= WinLdrInitSystemHive(LoaderBlock
, BootPath
);
550 TRACE("SYSTEM hive loaded with status %d\n", Status
);
552 /* Load NLS data, OEM font, and prepare boot drivers list */
553 Status
= WinLdrScanSystemHive(LoaderBlock
, BootPath
);
554 TRACE("SYSTEM hive scanned with status %d\n", Status
);
557 LoadAndBootWindowsCommon(OperatingSystemVersion
,
565 LoadAndBootWindowsCommon(
566 USHORT OperatingSystemVersion
,
567 PLOADER_PARAMETER_BLOCK LoaderBlock
,
572 PLOADER_PARAMETER_BLOCK LoaderBlockVA
;
574 CHAR FileName
[MAX_PATH
];
575 PLDR_DATA_TABLE_ENTRY KernelDTE
, HalDTE
, KdComDTE
= NULL
;
576 KERNEL_ENTRY_POINT KiSystemStartup
;
578 TRACE("LoadAndBootWindowsCommon()\n");
580 /* Convert BootPath to SystemRoot */
581 SystemRoot
= strstr(BootPath
, "\\");
583 /* Detect hardware */
584 LoaderBlock
->ConfigurationRoot
= MachHwDetect();
586 if (OperatingSystemVersion
== 0)
587 OperatingSystemVersion
= WinLdrDetectVersion();
590 LoadModule(LoaderBlock
, BootPath
, "NTOSKRNL.EXE", LoaderSystemCode
, &KernelDTE
, 30);
593 LoadModule(LoaderBlock
, BootPath
, "HAL.DLL", LoaderHalCode
, &HalDTE
, 45);
595 /* Load kernel-debugger support dll */
596 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
598 LoadModule(LoaderBlock
, BootPath
, "KDCOM.DLL", LoaderSystemCode
, &KdComDTE
, 60);
601 /* Load all referenced DLLs for kernel, HAL and kdcom.dll */
602 strcpy(FileName
, BootPath
);
603 strcat(FileName
, "system32\\");
604 Status
= WinLdrScanImportDescriptorTable(&LoaderBlock
->LoadOrderListHead
, FileName
, KernelDTE
);
605 Status
&= WinLdrScanImportDescriptorTable(&LoaderBlock
->LoadOrderListHead
, FileName
, HalDTE
);
607 Status
&= WinLdrScanImportDescriptorTable(&LoaderBlock
->LoadOrderListHead
, FileName
, KdComDTE
);
611 UiMessageBox("Error loading imported dll.");
615 /* Load boot drivers */
617 UiDrawProgressBarCenter(100, 100, "Loading boot drivers...");
618 Status
= WinLdrLoadBootDrivers(LoaderBlock
, (PCHAR
)BootPath
);
619 TRACE("Boot drivers loaded with status %d\n", Status
);
621 /* Initialize Phase 1 - no drivers loading anymore */
622 WinLdrInitializePhase1(LoaderBlock
, BootOptions
, SystemRoot
, BootPath
, OperatingSystemVersion
);
624 /* Save entry-point pointer and Loader block VAs */
625 KiSystemStartup
= (KERNEL_ENTRY_POINT
)KernelDTE
->EntryPoint
;
626 LoaderBlockVA
= PaToVa(LoaderBlock
);
628 /* "Stop all motors", change videomode */
629 MachPrepareForReactOS(Setup
);
632 //DumpMemoryAllocMap();
634 /* Do the machine specific initialization */
635 WinLdrSetupMachineDependent(LoaderBlock
);
637 /* Map pages and create memory descriptors */
638 WinLdrSetupMemoryLayout(LoaderBlock
);
640 /* Set processor context */
641 WinLdrSetProcessorContext();
643 /* Save final value of LoaderPagesSpanned */
644 LoaderBlock
->Extension
->LoaderPagesSpanned
= LoaderPagesSpanned
;
646 TRACE("Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
647 KiSystemStartup
, LoaderBlockVA
);
649 // Zero KI_USER_SHARED_DATA page
650 memset((PVOID
)KI_USER_SHARED_DATA
, 0, MM_PAGE_SIZE
);
652 WinLdrpDumpMemoryDescriptors(LoaderBlockVA
);
653 WinLdrpDumpBootDriver(LoaderBlockVA
);
655 WinLdrpDumpArcDisks(LoaderBlockVA
);
658 //FIXME: If I substitute this debugging checkpoint, GCC will "optimize away" the code below
660 /*asm(".intel_syntax noprefix\n");
663 asm(".att_syntax\n");*/
666 (*KiSystemStartup
)(LoaderBlockVA
);
670 WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
)
673 PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor
;
675 NextMd
= LoaderBlock
->MemoryDescriptorListHead
.Flink
;
677 while (NextMd
!= &LoaderBlock
->MemoryDescriptorListHead
)
679 MemoryDescriptor
= CONTAINING_RECORD(NextMd
, MEMORY_ALLOCATION_DESCRIPTOR
, ListEntry
);
681 TRACE("BP %08X PC %04X MT %d\n", MemoryDescriptor
->BasePage
,
682 MemoryDescriptor
->PageCount
, MemoryDescriptor
->MemoryType
);
684 NextMd
= MemoryDescriptor
->ListEntry
.Flink
;
689 WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
)
692 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
694 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
696 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
698 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
700 TRACE("BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
701 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
703 NextBd
= BootDriver
->Link
.Flink
;
708 WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
)
711 PARC_DISK_SIGNATURE ArcDisk
;
713 NextBd
= LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
.Flink
;
715 while (NextBd
!= &LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
)
717 ArcDisk
= CONTAINING_RECORD(NextBd
, ARC_DISK_SIGNATURE
, ListEntry
);
719 TRACE("ArcDisk %s checksum: 0x%X, signature: 0x%X\n",
720 ArcDisk
->ArcName
, ArcDisk
->CheckSum
, ArcDisk
->Signature
);
722 NextBd
= ArcDisk
->ListEntry
.Flink
;