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 //FIXME: Do a better way to retrieve Arc disk information
28 extern ULONG reactos_disk_count
;
29 extern ARC_DISK_SIGNATURE reactos_arc_disk_info
[];
30 extern char reactos_arc_strings
[32][256];
32 extern BOOLEAN UseRealHeap
;
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
);
41 VOID
DumpMemoryAllocMap(VOID
);
45 AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK
*OutLoaderBlock
)
47 PLOADER_PARAMETER_BLOCK LoaderBlock
;
49 /* Allocate and zero-init the LPB */
50 LoaderBlock
= MmHeapAlloc(sizeof(LOADER_PARAMETER_BLOCK
));
51 RtlZeroMemory(LoaderBlock
, sizeof(LOADER_PARAMETER_BLOCK
));
53 /* Init three critical lists, used right away */
54 InitializeListHead(&LoaderBlock
->LoadOrderListHead
);
55 InitializeListHead(&LoaderBlock
->MemoryDescriptorListHead
);
56 InitializeListHead(&LoaderBlock
->BootDriverListHead
);
58 /* Alloc space for NLS (it will be converted to VA in WinLdrLoadNLS) */
59 LoaderBlock
->NlsData
= MmHeapAlloc(sizeof(NLS_DATA_BLOCK
));
60 if (LoaderBlock
->NlsData
== NULL
)
62 UiMessageBox("Failed to allocate memory for NLS table data!");
65 RtlZeroMemory(LoaderBlock
->NlsData
, sizeof(NLS_DATA_BLOCK
));
67 *OutLoaderBlock
= LoaderBlock
;
72 WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock
,
78 /* Examples of correct options and paths */
79 //CHAR Options[] = "/DEBUGPORT=COM1 /BAUDRATE=115200";
80 //CHAR Options[] = "/NODEBUG";
81 //CHAR SystemRoot[] = "\\WINNT\\";
82 //CHAR ArcBoot[] = "multi(0)disk(0)rdisk(0)partition(1)";
84 CHAR HalPath
[] = "\\";
87 ULONG i
, PathSeparator
;
88 PLOADER_PARAMETER_EXTENSION Extension
;
90 /* Construct SystemRoot and ArcBoot from SystemPath */
91 PathSeparator
= strstr(BootPath
, "\\") - BootPath
;
92 strncpy(ArcBoot
, BootPath
, PathSeparator
);
93 ArcBoot
[PathSeparator
] = 0;
95 DPRINTM(DPRINT_WINDOWS
, "ArcBoot: %s\n", ArcBoot
);
96 DPRINTM(DPRINT_WINDOWS
, "SystemRoot: %s\n", SystemRoot
);
97 DPRINTM(DPRINT_WINDOWS
, "Options: %s\n", Options
);
99 /* Fill Arc BootDevice */
100 LoaderBlock
->ArcBootDeviceName
= MmHeapAlloc(strlen(ArcBoot
)+1);
101 strcpy(LoaderBlock
->ArcBootDeviceName
, ArcBoot
);
102 LoaderBlock
->ArcBootDeviceName
= PaToVa(LoaderBlock
->ArcBootDeviceName
);
104 /* Fill Arc HalDevice, it matches ArcBoot path */
105 LoaderBlock
->ArcHalDeviceName
= MmHeapAlloc(strlen(ArcBoot
)+1);
106 strcpy(LoaderBlock
->ArcHalDeviceName
, ArcBoot
);
107 LoaderBlock
->ArcHalDeviceName
= PaToVa(LoaderBlock
->ArcHalDeviceName
);
109 /* Fill SystemRoot */
110 LoaderBlock
->NtBootPathName
= MmHeapAlloc(strlen(SystemRoot
)+1);
111 strcpy(LoaderBlock
->NtBootPathName
, SystemRoot
);
112 LoaderBlock
->NtBootPathName
= PaToVa(LoaderBlock
->NtBootPathName
);
114 /* Fill NtHalPathName */
115 LoaderBlock
->NtHalPathName
= MmHeapAlloc(strlen(HalPath
)+1);
116 strcpy(LoaderBlock
->NtHalPathName
, HalPath
);
117 LoaderBlock
->NtHalPathName
= PaToVa(LoaderBlock
->NtHalPathName
);
119 /* Fill load options */
120 LoaderBlock
->LoadOptions
= MmHeapAlloc(strlen(Options
)+1);
121 strcpy(LoaderBlock
->LoadOptions
, Options
);
122 LoaderBlock
->LoadOptions
= PaToVa(LoaderBlock
->LoadOptions
);
125 LoaderBlock
->ArcDiskInformation
= (PARC_DISK_INFORMATION
)MmHeapAlloc(sizeof(ARC_DISK_INFORMATION
));
126 InitializeListHead(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
128 /* Convert ARC disk information from freeldr to a correct format */
129 for (i
= 0; i
< reactos_disk_count
; i
++)
131 PARC_DISK_SIGNATURE ArcDiskInfo
;
133 /* Get the ARC structure */
134 ArcDiskInfo
= (PARC_DISK_SIGNATURE
)MmHeapAlloc(sizeof(ARC_DISK_SIGNATURE
));
135 RtlZeroMemory(ArcDiskInfo
, sizeof(ARC_DISK_SIGNATURE
));
137 /* Copy the data over */
138 ArcDiskInfo
->Signature
= reactos_arc_disk_info
[i
].Signature
;
139 ArcDiskInfo
->CheckSum
= reactos_arc_disk_info
[i
].CheckSum
;
141 /* Copy the ARC Name */
142 ArcDiskInfo
->ArcName
= (PCHAR
)MmHeapAlloc(sizeof(CHAR
)*256);
143 strcpy(ArcDiskInfo
->ArcName
, reactos_arc_disk_info
[i
].ArcName
);
144 ArcDiskInfo
->ArcName
= (PCHAR
)PaToVa(ArcDiskInfo
->ArcName
);
146 /* Mark partition table as valid */
147 ArcDiskInfo
->ValidPartitionTable
= TRUE
;
149 /* Insert into the list */
150 InsertTailList(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
,
151 &ArcDiskInfo
->ListEntry
);
154 /* Convert all list's to Virtual address */
156 /* Convert the ArcDisks list to virtual address */
157 List_PaToVa(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
158 LoaderBlock
->ArcDiskInformation
= PaToVa(LoaderBlock
->ArcDiskInformation
);
160 /* Convert configuration entries to VA */
161 ConvertConfigToVA(LoaderBlock
->ConfigurationRoot
);
162 LoaderBlock
->ConfigurationRoot
= PaToVa(LoaderBlock
->ConfigurationRoot
);
164 /* Convert all DTE into virtual addresses */
165 List_PaToVa(&LoaderBlock
->LoadOrderListHead
);
167 /* this one will be converted right before switching to
168 virtual paging mode */
169 //List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
171 /* Convert list of boot drivers */
172 List_PaToVa(&LoaderBlock
->BootDriverListHead
);
174 /* Initialize Extension now */
175 Extension
= MmHeapAlloc(sizeof(LOADER_PARAMETER_EXTENSION
));
176 if (Extension
== NULL
)
178 UiMessageBox("Failed to allocate LPB Extension!");
181 RtlZeroMemory(Extension
, sizeof(LOADER_PARAMETER_EXTENSION
));
183 /* Fill LPB extension */
184 Extension
->Size
= sizeof(LOADER_PARAMETER_EXTENSION
);
185 Extension
->MajorVersion
= (VersionToBoot
& 0xFF00) >> 8;
186 Extension
->MinorVersion
= VersionToBoot
& 0xFF;
187 Extension
->Profile
.Status
= 2;
189 /* Check if ACPI is present */
192 /* See KiRosFrldrLpbToNtLpb for details */
193 Extension
->AcpiTable
= (PVOID
)1;
197 /* Set headless block pointer */
198 if (WinLdrTerminalConnected
)
200 Extension
->HeadlessLoaderBlock
= MmHeapAlloc(sizeof(HEADLESS_LOADER_BLOCK
));
201 if (Extension
->HeadlessLoaderBlock
== NULL
)
203 UiMessageBox("Failed to allocate HLB Extension!");
208 Extension
->HeadlessLoaderBlock
,
209 &LoaderRedirectionInformation
,
210 sizeof(HEADLESS_LOADER_BLOCK
));
211 Extension
->HeadlessLoaderBlock
= PaToVa(Extension
->HeadlessLoaderBlock
);
214 /* Load drivers database */
215 strcpy(MiscFiles
, BootPath
);
216 strcat(MiscFiles
, "AppPatch\\drvmain.sdb");
217 Extension
->DrvDBImage
= PaToVa(WinLdrLoadModule(MiscFiles
,
218 &Extension
->DrvDBSize
, LoaderRegistryData
));
220 /* Convert extension and setup block pointers */
221 LoaderBlock
->Extension
= PaToVa(Extension
);
223 if (LoaderBlock
->SetupLdrBlock
)
224 LoaderBlock
->SetupLdrBlock
= PaToVa(LoaderBlock
->SetupLdrBlock
);
229 WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
,
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 DPRINTM(DPRINT_WINDOWS
, "DriverPath: %s, DllName: %s, LPB %p\n", DriverPath
, DllName
, LoaderBlock
);
263 // Check if driver is already loaded
264 Status
= WinLdrCheckForLoadedDll(LoaderBlock
, 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(LoaderBlock
, DllName
, DllName
, DriverBase
, DriverDTE
);
281 DPRINTM(DPRINT_WINDOWS
, "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(LoaderBlock
, FullPath
, *DriverDTE
);
293 DPRINTM(DPRINT_WINDOWS
, "WinLdrScanImportDescriptorTable() failed for %s\n",
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 DPRINTM(DPRINT_WINDOWS
, "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
, 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 DPRINTM(DPRINT_WINDOWS
, "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 DPRINTM(DPRINT_WINDOWS
, "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
;
425 PLOADER_PARAMETER_BLOCK LoaderBlock
,
428 PLDR_DATA_TABLE_ENTRY
*Dte
,
431 CHAR FullFileName
[MAX_PATH
];
432 CHAR ProgressString
[256];
437 sprintf(ProgressString
, "Loading %s...", File
);
438 UiDrawProgressBarCenter(Percentage
, 100, ProgressString
);
440 strcpy(FullFileName
, Path
);
441 strcat(FullFileName
, "SYSTEM32\\");
442 strcat(FullFileName
, File
);
444 Status
= WinLdrLoadImage(FullFileName
, LoaderSystemCode
, &BaseAdress
);
445 DPRINTM(DPRINT_WINDOWS
, "%s loaded with status %d at %p\n",
446 File
, Status
, BaseAdress
);
448 strcpy(FullFileName
, "WINDOWS\\SYSTEM32\\");
449 strcat(FullFileName
, File
);
450 WinLdrAllocateDataTableEntry(LoaderBlock
, File
,
451 FullFileName
, BaseAdress
, Dte
);
457 LoadAndBootWindows(PCSTR OperatingSystemName
,
459 USHORT OperatingSystemVersion
)
462 char BootPath
[MAX_PATH
];
463 CHAR FileName
[MAX_PATH
];
464 CHAR BootOptions
[256];
468 PLOADER_PARAMETER_BLOCK LoaderBlock
;
470 // Open the operating system section
471 // specified in the .ini file
472 HasSection
= IniOpenSection(OperatingSystemName
, &SectionId
);
475 UiDrawProgressBarCenter(1, 100, "Loading NT...");
477 /* Read the system path is set in the .ini file */
479 !IniReadSettingByName(SectionId
, "SystemPath", BootPath
, sizeof(BootPath
)))
481 strcpy(BootPath
, OperatingSystemName
);
484 /* Special case for LiveCD */
485 if (!_strnicmp(BootPath
, "LiveCD", strlen("LiveCD")))
487 strcpy(FileName
, BootPath
+ strlen("LiveCD"));
488 MachDiskGetBootPath(BootPath
, sizeof(BootPath
));
489 strcat(BootPath
, FileName
);
492 /* append a backslash */
493 if ((strlen(BootPath
)==0) || BootPath
[strlen(BootPath
)] != '\\')
494 strcat(BootPath
, "\\");
496 /* Read booting options */
497 if (!HasSection
|| !IniReadSettingByName(SectionId
, "Options", BootOptions
, sizeof(BootOptions
)))
499 /* Get options after the title */
500 const CHAR
*p
= SettingsValue
;
501 while (*p
== ' ' || *p
== '"')
503 while (*p
!= '\0' && *p
!= '"')
505 strcpy(BootOptions
, p
);
506 DPRINTM(DPRINT_WINDOWS
,"BootOptions: '%s'\n", BootOptions
);
509 /* Append boot-time options */
510 AppendBootTimeOptions(BootOptions
);
512 /* Check if a ramdisk file was given */
513 File
= strstr(BootOptions
, "/RDPATH=");
516 /* Copy the file name and everything else after it */
517 strcpy(FileName
, File
+ 8);
520 *strstr(FileName
, " ") = ANSI_NULL
;
522 /* Load the ramdisk */
523 RamDiskLoadVirtualFile(FileName
);
526 /* Let user know we started loading */
527 //UiDrawStatusText("Loading...");
529 DPRINTM(DPRINT_WINDOWS
,"BootPath: '%s'\n", BootPath
);
531 /* Allocate and minimalistic-initialize LPB */
532 AllocateAndInitLPB(&LoaderBlock
);
535 /* Setup redirection support */
536 WinLdrSetupEms(BootOptions
);
541 UiDrawProgressBarCenter(15, 100, "Loading system hive...");
542 Status
= WinLdrInitSystemHive(LoaderBlock
, BootPath
);
543 DPRINTM(DPRINT_WINDOWS
, "SYSTEM hive loaded with status %d\n", Status
);
545 /* Load NLS data, OEM font, and prepare boot drivers list */
546 Status
= WinLdrScanSystemHive(LoaderBlock
, BootPath
);
547 DPRINTM(DPRINT_WINDOWS
, "SYSTEM hive scanned with status %d\n", Status
);
550 LoadAndBootWindowsCommon(OperatingSystemVersion
,
558 LoadAndBootWindowsCommon(
559 USHORT OperatingSystemVersion
,
560 PLOADER_PARAMETER_BLOCK LoaderBlock
,
565 PLOADER_PARAMETER_BLOCK LoaderBlockVA
;
567 CHAR FileName
[MAX_PATH
];
568 PVOID NtosBase
= NULL
, HalBase
= NULL
, KdComBase
= NULL
;
569 PLDR_DATA_TABLE_ENTRY KernelDTE
, HalDTE
, KdComDTE
= NULL
;
570 KERNEL_ENTRY_POINT KiSystemStartup
;
573 /* Convert BootPath to SystemRoot */
574 SystemRoot
= strstr(BootPath
, "\\");
576 /* Detect hardware */
578 LoaderBlock
->ConfigurationRoot
= MachHwDetect();
580 if (OperatingSystemVersion
== 0)
581 OperatingSystemVersion
= WinLdrDetectVersion();
584 NtosBase
= LoadModule(LoaderBlock
, BootPath
, "NTOSKRNL.EXE", &KernelDTE
, 30);
587 HalBase
= LoadModule(LoaderBlock
, BootPath
, "HAL.DLL", &HalDTE
, 45);
589 /* Load kernel-debugger support dll */
590 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
592 KdComBase
= LoadModule(LoaderBlock
, BootPath
, "KDCOM.DLL", &KdComDTE
, 60);
595 /* Load all referenced DLLs for kernel, HAL and kdcom.dll */
596 strcpy(FileName
, BootPath
);
597 strcat(FileName
, "system32\\");
598 Status
= WinLdrScanImportDescriptorTable(LoaderBlock
, FileName
, KernelDTE
);
599 Status
&= WinLdrScanImportDescriptorTable(LoaderBlock
, FileName
, HalDTE
);
601 Status
&= WinLdrScanImportDescriptorTable(LoaderBlock
, FileName
, KdComDTE
);
605 UiMessageBox("Error loading imported dll.");
609 /* Load boot drivers */
611 UiDrawProgressBarCenter(100, 100, "Loading boot drivers...");
612 Status
= WinLdrLoadBootDrivers(LoaderBlock
, (PCHAR
)BootPath
);
613 DPRINTM(DPRINT_WINDOWS
, "Boot drivers loaded with status %d\n", Status
);
615 /* Initialize Phase 1 - no drivers loading anymore */
616 WinLdrInitializePhase1(LoaderBlock
, BootOptions
, SystemRoot
, BootPath
, OperatingSystemVersion
);
618 /* Save entry-point pointer and Loader block VAs */
619 KiSystemStartup
= (KERNEL_ENTRY_POINT
)KernelDTE
->EntryPoint
;
620 LoaderBlockVA
= PaToVa(LoaderBlock
);
622 /* "Stop all motors", change videomode */
623 MachPrepareForReactOS(Setup
);
626 //DumpMemoryAllocMap();
628 /* Do the machine specific initialization */
629 WinLdrSetupMachineDependent(LoaderBlock
);
631 /* Map pages and create memory descriptors */
632 WinLdrSetupMemoryLayout(LoaderBlock
);
634 /* Save final value of LoaderPagesSpanned */
635 LoaderBlock
->Extension
->LoaderPagesSpanned
= LoaderPagesSpanned
;
637 /* Set processor context */
638 WinLdrSetProcessorContext();
640 DPRINTM(DPRINT_WINDOWS
, "Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
641 KiSystemStartup
, LoaderBlockVA
);
643 // Zero KI_USER_SHARED_DATA page
644 memset((PVOID
)KI_USER_SHARED_DATA
, 0, MM_PAGE_SIZE
);
646 WinLdrpDumpMemoryDescriptors(LoaderBlockVA
);
647 WinLdrpDumpBootDriver(LoaderBlockVA
);
648 WinLdrpDumpArcDisks(LoaderBlockVA
);
650 //FIXME: If I substitute this debugging checkpoint, GCC will "optimize away" the code below
652 /*asm(".intel_syntax noprefix\n");
655 asm(".att_syntax\n");*/
658 (*KiSystemStartup
)(LoaderBlockVA
);
662 WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
)
665 PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor
;
667 NextMd
= LoaderBlock
->MemoryDescriptorListHead
.Flink
;
669 while (NextMd
!= &LoaderBlock
->MemoryDescriptorListHead
)
671 MemoryDescriptor
= CONTAINING_RECORD(NextMd
, MEMORY_ALLOCATION_DESCRIPTOR
, ListEntry
);
673 DPRINTM(DPRINT_WINDOWS
, "BP %08X PC %04X MT %d\n", MemoryDescriptor
->BasePage
,
674 MemoryDescriptor
->PageCount
, MemoryDescriptor
->MemoryType
);
676 NextMd
= MemoryDescriptor
->ListEntry
.Flink
;
681 WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
)
684 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
686 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
688 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
690 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
692 DPRINTM(DPRINT_WINDOWS
, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
693 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
695 NextBd
= BootDriver
->Link
.Flink
;
700 WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
)
703 PARC_DISK_SIGNATURE ArcDisk
;
705 NextBd
= LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
.Flink
;
707 while (NextBd
!= &LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
)
709 ArcDisk
= CONTAINING_RECORD(NextBd
, ARC_DISK_SIGNATURE
, ListEntry
);
711 DPRINTM(DPRINT_WINDOWS
, "ArcDisk %s checksum: 0x%X, signature: 0x%X\n",
712 ArcDisk
->ArcName
, ArcDisk
->CheckSum
, ArcDisk
->Signature
);
714 NextBd
= ArcDisk
->ListEntry
.Flink
;