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
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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
;
36 WinLdrCheckForLoadedDll(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock
,
38 OUT PLDR_DATA_TABLE_ENTRY
*LoadedEntry
);
41 VOID
DumpMemoryAllocMap(VOID
);
42 VOID
WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
);
43 VOID
WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
);
44 VOID
WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
);
49 AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK
*OutLoaderBlock
)
51 PLOADER_PARAMETER_BLOCK LoaderBlock
;
53 /* Allocate and zero-init the LPB */
54 LoaderBlock
= MmHeapAlloc(sizeof(LOADER_PARAMETER_BLOCK
));
55 RtlZeroMemory(LoaderBlock
, sizeof(LOADER_PARAMETER_BLOCK
));
57 /* Init three critical lists, used right away */
58 InitializeListHead(&LoaderBlock
->LoadOrderListHead
);
59 InitializeListHead(&LoaderBlock
->MemoryDescriptorListHead
);
60 InitializeListHead(&LoaderBlock
->BootDriverListHead
);
62 /* Alloc space for NLS (it will be converted to VA in WinLdrLoadNLS) */
63 LoaderBlock
->NlsData
= MmHeapAlloc(sizeof(NLS_DATA_BLOCK
));
64 if (LoaderBlock
->NlsData
== NULL
)
66 UiMessageBox("Failed to allocate memory for NLS table data!");
69 RtlZeroMemory(LoaderBlock
->NlsData
, sizeof(NLS_DATA_BLOCK
));
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 CHAR HalPath
[] = "\\";
92 ULONG i
, PathSeparator
;
93 PLOADER_PARAMETER_EXTENSION Extension
;
95 LoaderBlock
->u
.I386
.CommonDataArea
= NULL
; // Force No ABIOS support
97 /* Construct SystemRoot and ArcBoot from SystemPath */
98 PathSeparator
= strstr(SystemPath
, "\\") - SystemPath
;
99 strncpy(ArcBoot
, SystemPath
, PathSeparator
);
100 ArcBoot
[PathSeparator
] = 0;
101 strcpy(SystemRoot
, &SystemPath
[PathSeparator
]);
102 strcat(SystemRoot
, "\\");
104 DPRINTM((DPRINT_WINDOWS
, "ArcBoot: %s\n", ArcBoot
));
105 DPRINTM((DPRINT_WINDOWS
, "SystemRoot: %s\n", SystemRoot
));
106 DPRINTM((DPRINT_WINDOWS
, "Options: %s\n", Options
));
108 /* Fill Arc BootDevice */
109 LoaderBlock
->ArcBootDeviceName
= MmHeapAlloc(strlen(ArcBoot
)+1);
110 strcpy(LoaderBlock
->ArcBootDeviceName
, ArcBoot
);
111 LoaderBlock
->ArcBootDeviceName
= PaToVa(LoaderBlock
->ArcBootDeviceName
);
113 /* Fill Arc HalDevice, it matches ArcBoot path */
114 LoaderBlock
->ArcHalDeviceName
= MmHeapAlloc(strlen(ArcBoot
)+1);
115 strcpy(LoaderBlock
->ArcHalDeviceName
, ArcBoot
);
116 LoaderBlock
->ArcHalDeviceName
= PaToVa(LoaderBlock
->ArcHalDeviceName
);
118 /* Fill SystemRoot */
119 LoaderBlock
->NtBootPathName
= MmHeapAlloc(strlen(SystemRoot
)+1);
120 strcpy(LoaderBlock
->NtBootPathName
, SystemRoot
);
121 LoaderBlock
->NtBootPathName
= PaToVa(LoaderBlock
->NtBootPathName
);
123 /* Fill NtHalPathName */
124 LoaderBlock
->NtHalPathName
= MmHeapAlloc(strlen(HalPath
)+1);
125 strcpy(LoaderBlock
->NtHalPathName
, HalPath
);
126 LoaderBlock
->NtHalPathName
= PaToVa(LoaderBlock
->NtHalPathName
);
128 /* Fill load options */
129 LoaderBlock
->LoadOptions
= MmHeapAlloc(strlen(Options
)+1);
130 strcpy(LoaderBlock
->LoadOptions
, Options
);
131 LoaderBlock
->LoadOptions
= PaToVa(LoaderBlock
->LoadOptions
);
134 LoaderBlock
->ArcDiskInformation
= (PARC_DISK_INFORMATION
)MmHeapAlloc(sizeof(ARC_DISK_INFORMATION
));
135 InitializeListHead(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
137 /* Convert ARC disk information from freeldr to a correct format */
138 for (i
= 0; i
< reactos_disk_count
; i
++)
140 PARC_DISK_SIGNATURE ArcDiskInfo
;
142 /* Get the ARC structure */
143 ArcDiskInfo
= (PARC_DISK_SIGNATURE
)MmHeapAlloc(sizeof(ARC_DISK_SIGNATURE
));
144 RtlZeroMemory(ArcDiskInfo
, sizeof(ARC_DISK_SIGNATURE
));
146 /* Copy the data over */
147 ArcDiskInfo
->Signature
= reactos_arc_disk_info
[i
].Signature
;
148 ArcDiskInfo
->CheckSum
= reactos_arc_disk_info
[i
].CheckSum
;
150 /* Copy the ARC Name */
151 ArcDiskInfo
->ArcName
= (PCHAR
)MmHeapAlloc(sizeof(CHAR
)*256);
152 strcpy(ArcDiskInfo
->ArcName
, reactos_arc_disk_info
[i
].ArcName
);
153 ArcDiskInfo
->ArcName
= (PCHAR
)PaToVa(ArcDiskInfo
->ArcName
);
155 /* Mark partition table as valid */
156 ArcDiskInfo
->ValidPartitionTable
= TRUE
;
158 /* Insert into the list */
159 InsertTailList(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
,
160 &ArcDiskInfo
->ListEntry
);
163 /* Convert all list's to Virtual address */
165 /* Convert the ArcDisks list to virtual address */
166 List_PaToVa(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
167 LoaderBlock
->ArcDiskInformation
= PaToVa(LoaderBlock
->ArcDiskInformation
);
169 /* Convert configuration entries to VA */
170 ConvertConfigToVA(LoaderBlock
->ConfigurationRoot
);
171 LoaderBlock
->ConfigurationRoot
= PaToVa(LoaderBlock
->ConfigurationRoot
);
173 /* Convert all DTE into virtual addresses */
174 List_PaToVa(&LoaderBlock
->LoadOrderListHead
);
176 /* this one will be converted right before switching to
177 virtual paging mode */
178 //List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
180 /* Convert list of boot drivers */
181 List_PaToVa(&LoaderBlock
->BootDriverListHead
);
183 /* Initialize Extension now */
184 Extension
= MmHeapAlloc(sizeof(LOADER_PARAMETER_EXTENSION
));
185 if (Extension
== NULL
)
187 UiMessageBox("Failed to allocate LPB Extension!");
190 RtlZeroMemory(Extension
, sizeof(LOADER_PARAMETER_EXTENSION
));
192 /* Fill LPB extension */
193 Extension
->Size
= sizeof(LOADER_PARAMETER_EXTENSION
);
194 Extension
->MajorVersion
= (VersionToBoot
& 0xFF00) >> 8;
195 Extension
->MinorVersion
= VersionToBoot
& 0xFF;
196 Extension
->Profile
.Status
= 2;
198 /* Load drivers database */
199 strcpy(MiscFiles
, BootPath
);
200 strcat(MiscFiles
, "AppPatch\\drvmain.sdb");
201 Extension
->DrvDBImage
= PaToVa(WinLdrLoadModule(MiscFiles
,
202 &Extension
->DrvDBSize
, LoaderRegistryData
));
204 LoaderBlock
->Extension
= PaToVa(Extension
);
207 // Last step before going virtual
208 void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock
,
217 ULONG BlockSize
, NumPages
;
219 LoaderBlock
->u
.I386
.CommonDataArea
= NULL
; //CommonDataArea;
220 LoaderBlock
->u
.I386
.MachineType
= 0; // ntldr sets this to 0
222 /* Allocate 2 pages for PCR */
223 Pcr
= (ULONG_PTR
)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE
, LoaderStartupPcrPage
);
224 *PcrBasePage
= Pcr
>> MM_PAGE_SHIFT
;
228 UiMessageBox("Can't allocate PCR\n");
233 TssSize
= (sizeof(KTSS
) + MM_PAGE_SIZE
) & ~(MM_PAGE_SIZE
- 1);
234 TssPages
= TssSize
/ MM_PAGE_SIZE
;
236 Tss
= (ULONG_PTR
)MmAllocateMemoryWithType(TssSize
, LoaderMemoryData
);
238 *TssBasePage
= Tss
>> MM_PAGE_SHIFT
;
240 /* Allocate space for new GDT + IDT */
241 BlockSize
= NUM_GDT
*sizeof(KGDTENTRY
) + NUM_IDT
*sizeof(KIDTENTRY
);//FIXME: Use GDT/IDT limits here?
242 NumPages
= (BlockSize
+ MM_PAGE_SIZE
- 1) >> MM_PAGE_SHIFT
;
243 *GdtIdt
= (PKGDTENTRY
)MmAllocateMemoryWithType(NumPages
* MM_PAGE_SIZE
, LoaderMemoryData
);
247 UiMessageBox("Can't allocate pages for GDT+IDT!\n");
251 /* Zero newly prepared GDT+IDT */
252 RtlZeroMemory(*GdtIdt
, NumPages
<< MM_PAGE_SHIFT
);
256 WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
,
258 PUNICODE_STRING FilePath
,
260 PLDR_DATA_TABLE_ENTRY
*DriverDTE
)
263 CHAR DriverPath
[1024];
269 // Separate the path to file name and directory path
270 sprintf(DriverPath
, "%S", FilePath
->Buffer
);
271 DriverNamePos
= strrchr(DriverPath
, '\\');
272 if (DriverNamePos
!= NULL
)
275 strcpy(DllName
, DriverNamePos
+1);
277 // Cut out the name from the path
278 *(DriverNamePos
+1) = 0;
281 DPRINTM((DPRINT_WINDOWS
, "DriverPath: %s, DllName: %s, LPB %p\n", DriverPath
, DllName
, LoaderBlock
));
284 // Check if driver is already loaded
285 Status
= WinLdrCheckForLoadedDll(LoaderBlock
, DllName
, DriverDTE
);
288 // We've got the pointer to its DTE, just return success
292 // It's not loaded, we have to load it
293 sprintf(FullPath
,"%s%S", BootPath
, FilePath
->Buffer
);
294 Status
= WinLdrLoadImage(FullPath
, LoaderBootDriver
, &DriverBase
);
298 // Allocate a DTE for it
299 Status
= WinLdrAllocateDataTableEntry(LoaderBlock
, DllName
, DllName
, DriverBase
, DriverDTE
);
302 DPRINTM((DPRINT_WINDOWS
, "WinLdrAllocateDataTableEntry() failed\n"));
306 // Modify any flags, if needed
307 (*DriverDTE
)->Flags
|= Flags
;
309 // Look for any dependencies it may have, and load them too
310 sprintf(FullPath
,"%s%s", BootPath
, DriverPath
);
311 Status
= WinLdrScanImportDescriptorTable(LoaderBlock
, FullPath
, *DriverDTE
);
314 DPRINTM((DPRINT_WINDOWS
, "WinLdrScanImportDescriptorTable() failed for %s\n",
323 WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock
,
327 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
330 // Walk through the boot drivers list
331 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
333 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
335 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
337 DPRINTM((DPRINT_WINDOWS
, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
338 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
));
340 // Paths are relative (FIXME: Are they always relative?)
343 Status
= WinLdrLoadDeviceDriver(LoaderBlock
, BootPath
, &BootDriver
->FilePath
,
344 0, &BootDriver
->LdrEntry
);
346 // If loading failed - cry loudly
347 //FIXME: Maybe remove it from the list and try to continue?
350 UiMessageBox("Can't load boot driver!");
354 // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore
355 BootDriver
->RegistryPath
.Buffer
= PaToVa(BootDriver
->RegistryPath
.Buffer
);
356 BootDriver
->LdrEntry
= PaToVa(BootDriver
->LdrEntry
);
358 NextBd
= BootDriver
->Link
.Flink
;
364 PVOID
WinLdrLoadModule(PCSTR ModuleName
, ULONG
*Size
,
365 TYPE_OF_MEMORY MemoryType
)
372 //CHAR ProgressString[256];
374 /* Inform user we are loading files */
375 //sprintf(ProgressString, "Loading %s...", FileName);
376 //UiDrawProgressBarCenter(1, 100, ProgressString);
378 DPRINTM((DPRINT_WINDOWS
, "Loading module %s\n", ModuleName
));
381 /* Open the image file */
382 FileHandle
= FsOpenFile(ModuleName
);
384 if (FileHandle
== NULL
)
386 /* In case of errors, we just return, without complaining to the user */
390 /* Get this file's size */
391 FileSize
= FsGetFileSize(FileHandle
);
394 /* Allocate memory */
395 PhysicalBase
= MmAllocateMemoryWithType(FileSize
, MemoryType
);
396 if (PhysicalBase
== NULL
)
398 FsCloseFile(FileHandle
);
402 /* Load whole file */
403 Status
= FsReadFile(FileHandle
, FileSize
, NULL
, PhysicalBase
);
406 FsCloseFile(FileHandle
);
410 DPRINTM((DPRINT_WINDOWS
, "Loaded %s at 0x%x with size 0x%x\n", ModuleName
, PhysicalBase
, FileSize
));
412 /* We are done with the file - close it */
413 FsCloseFile(FileHandle
);
420 LoadAndBootWindows(PCSTR OperatingSystemName
, USHORT OperatingSystemVersion
)
423 CHAR SystemPath
[512], SearchPath
[512];
426 CHAR BootOptions
[256];
427 PVOID NtosBase
= NULL
, HalBase
= NULL
, KdComBase
= NULL
;
431 PLOADER_PARAMETER_BLOCK LoaderBlock
, LoaderBlockVA
;
432 KERNEL_ENTRY_POINT KiSystemStartup
;
433 PLDR_DATA_TABLE_ENTRY KernelDTE
, HalDTE
, KdComDTE
= NULL
;
439 //sprintf(MsgBuffer,"Booting Microsoft(R) Windows(R) OS version '%04x' is not implemented yet", OperatingSystemVersion);
440 //UiMessageBox(MsgBuffer);
442 // Open the operating system section
443 // specified in the .ini file
444 if (!IniOpenSection(OperatingSystemName
, &SectionId
))
446 sprintf(MsgBuffer
,"Operating System section '%s' not found in freeldr.ini", OperatingSystemName
);
447 UiMessageBox(MsgBuffer
);
452 UiDrawStatusText("Detecting Hardware...");
453 UiDrawProgressBarCenter(1, 100, "Loading Windows...");
455 /* Make sure the system path is set in the .ini file */
456 if (!IniReadSettingByName(SectionId
, "SystemPath", SystemPath
, sizeof(SystemPath
)))
458 UiMessageBox("System path not specified for selected operating system.");
462 /* Read booting options */
463 if (!IniReadSettingByName(SectionId
, "Options", BootOptions
, sizeof(BootOptions
)))
465 /* Nothing read, make the string empty */
466 strcpy(BootOptions
, "");
469 /* Normalize system path */
470 if (!MachDiskNormalizeSystemPath(SystemPath
, sizeof(SystemPath
)))
472 UiMessageBox("Invalid system path");
476 /* Let user know we started loading */
477 UiDrawStatusText("Loading...");
479 /* Try to open system drive */
480 BootDevice
= 0xffffffff;
481 if (!FsOpenSystemVolume(SystemPath
, BootPath
, &BootDevice
))
483 UiMessageBox("Failed to open boot drive.");
487 /* append a backslash */
488 if ((strlen(BootPath
)==0) ||
489 BootPath
[strlen(BootPath
)] != '\\')
490 strcat(BootPath
, "\\");
492 DPRINTM((DPRINT_WINDOWS
,"SystemRoot: '%s'\n", BootPath
));
494 /* Allocate and minimalistic-initialize LPB */
495 AllocateAndInitLPB(&LoaderBlock
);
497 /* Detect hardware */
499 LoaderBlock
->ConfigurationRoot
= MachHwDetect();
502 strcpy(FileName
, BootPath
);
503 strcat(FileName
, "SYSTEM32\\NTOSKRNL.EXE");
504 Status
= WinLdrLoadImage(FileName
, LoaderSystemCode
, &NtosBase
);
505 DPRINTM((DPRINT_WINDOWS
, "Ntos loaded with status %d at %p\n", Status
, NtosBase
));
508 strcpy(FileName
, BootPath
);
509 strcat(FileName
, "SYSTEM32\\HAL.DLL");
510 Status
= WinLdrLoadImage(FileName
, LoaderHalCode
, &HalBase
);
511 DPRINTM((DPRINT_WINDOWS
, "HAL loaded with status %d at %p\n", Status
, HalBase
));
513 /* Load kernel-debugger support dll */
514 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
516 strcpy(FileName
, BootPath
);
517 strcat(FileName
, "SYSTEM32\\KDCOM.DLL");
518 Status
= WinLdrLoadImage(FileName
, LoaderBootDriver
, &KdComBase
);
519 DPRINTM((DPRINT_WINDOWS
, "KdCom loaded with status %d at %p\n", Status
, KdComBase
));
522 /* Allocate data table entries for above-loaded modules */
523 WinLdrAllocateDataTableEntry(LoaderBlock
, "ntoskrnl.exe",
524 "WINDOWS\\SYSTEM32\\NTOSKRNL.EXE", NtosBase
, &KernelDTE
);
525 WinLdrAllocateDataTableEntry(LoaderBlock
, "hal.dll",
526 "WINDOWS\\SYSTEM32\\HAL.DLL", HalBase
, &HalDTE
);
527 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
529 WinLdrAllocateDataTableEntry(LoaderBlock
, "kdcom.dll",
530 "WINDOWS\\SYSTEM32\\KDCOM.DLL", KdComBase
, &KdComDTE
);
533 /* Load all referenced DLLs for kernel, HAL and kdcom.dll */
534 strcpy(SearchPath
, BootPath
);
535 strcat(SearchPath
, "SYSTEM32\\");
536 WinLdrScanImportDescriptorTable(LoaderBlock
, SearchPath
, KernelDTE
);
537 WinLdrScanImportDescriptorTable(LoaderBlock
, SearchPath
, HalDTE
);
539 WinLdrScanImportDescriptorTable(LoaderBlock
, SearchPath
, KdComDTE
);
541 /* Load Hive, and then NLS data, OEM font, and prepare boot drivers list */
542 Status
= WinLdrLoadAndScanSystemHive(LoaderBlock
, BootPath
);
543 DPRINTM((DPRINT_WINDOWS
, "SYSTEM hive loaded and scanned with status %d\n", Status
));
545 /* Load boot drivers */
546 Status
= WinLdrLoadBootDrivers(LoaderBlock
, BootPath
);
547 DPRINTM((DPRINT_WINDOWS
, "Boot drivers loaded with status %d\n", Status
));
549 /* Alloc PCR, TSS, do magic things with the GDT/IDT */
550 WinLdrSetupForNt(LoaderBlock
, &GdtIdt
, &PcrBasePage
, &TssBasePage
);
552 /* Initialize Phase 1 - no drivers loading anymore */
553 WinLdrInitializePhase1(LoaderBlock
, BootOptions
, SystemPath
, BootPath
, OperatingSystemVersion
);
555 /* Save entry-point pointer and Loader block VAs */
556 KiSystemStartup
= (KERNEL_ENTRY_POINT
)KernelDTE
->EntryPoint
;
557 LoaderBlockVA
= PaToVa(LoaderBlock
);
559 /* "Stop all motors", change videomode */
560 if (OperatingSystemVersion
< _WIN32_WINNT_WIN2K
)
561 MachPrepareForReactOS(TRUE
);
563 MachPrepareForReactOS(FALSE
);
566 //DumpMemoryAllocMap();
568 /* Turn on paging mode of CPU*/
569 WinLdrTurnOnPaging(LoaderBlock
, PcrBasePage
, TssBasePage
, GdtIdt
);
571 /* Save final value of LoaderPagesSpanned */
572 LoaderBlock
->Extension
->LoaderPagesSpanned
= LoaderPagesSpanned
;
574 DPRINTM((DPRINT_WINDOWS
, "Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
575 KiSystemStartup
, LoaderBlockVA
));
577 WinLdrpDumpMemoryDescriptors(LoaderBlockVA
);
578 WinLdrpDumpBootDriver(LoaderBlockVA
);
579 WinLdrpDumpArcDisks(LoaderBlockVA
);
581 //FIXME: If I substitute this debugging checkpoint, GCC will "optimize away" the code below
583 /*asm(".intel_syntax noprefix\n");
586 asm(".att_syntax\n");*/
589 (*KiSystemStartup
)(LoaderBlockVA
);
595 WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
)
598 PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor
;
600 NextMd
= LoaderBlock
->MemoryDescriptorListHead
.Flink
;
602 while (NextMd
!= &LoaderBlock
->MemoryDescriptorListHead
)
604 MemoryDescriptor
= CONTAINING_RECORD(NextMd
, MEMORY_ALLOCATION_DESCRIPTOR
, ListEntry
);
606 DPRINTM((DPRINT_WINDOWS
, "BP %08X PC %04X MT %d\n", MemoryDescriptor
->BasePage
,
607 MemoryDescriptor
->PageCount
, MemoryDescriptor
->MemoryType
));
609 NextMd
= MemoryDescriptor
->ListEntry
.Flink
;
614 WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
)
617 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
619 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
621 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
623 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
625 DPRINTM((DPRINT_WINDOWS
, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
626 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
));
628 NextBd
= BootDriver
->Link
.Flink
;
633 WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
)
636 PARC_DISK_SIGNATURE ArcDisk
;
638 NextBd
= LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
.Flink
;
640 while (NextBd
!= &LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
)
642 ArcDisk
= CONTAINING_RECORD(NextBd
, ARC_DISK_SIGNATURE
, ListEntry
);
644 DPRINTM((DPRINT_WINDOWS
, "ArcDisk %s checksum: 0x%X, signature: 0x%X\n",
645 ArcDisk
->ArcName
, ArcDisk
->CheckSum
, ArcDisk
->Signature
));
647 NextBd
= ArcDisk
->ListEntry
.Flink
;