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>
28 void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock
,
33 //FIXME: Do a better way to retrieve Arc disk information
34 extern ULONG reactos_disk_count
;
35 extern ARC_DISK_SIGNATURE reactos_arc_disk_info
[];
36 extern char reactos_arc_strings
[32][256];
38 extern BOOLEAN UseRealHeap
;
39 extern ULONG LoaderPagesSpanned
;
42 WinLdrCheckForLoadedDll(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock
,
44 OUT PLDR_DATA_TABLE_ENTRY
*LoadedEntry
);
47 VOID
DumpMemoryAllocMap(VOID
);
48 VOID
WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
);
49 VOID
WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
);
50 VOID
WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
);
55 AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK
*OutLoaderBlock
)
57 PLOADER_PARAMETER_BLOCK LoaderBlock
;
59 /* Allocate and zero-init the LPB */
60 LoaderBlock
= MmHeapAlloc(sizeof(LOADER_PARAMETER_BLOCK
));
61 RtlZeroMemory(LoaderBlock
, sizeof(LOADER_PARAMETER_BLOCK
));
63 /* Init three critical lists, used right away */
64 InitializeListHead(&LoaderBlock
->LoadOrderListHead
);
65 InitializeListHead(&LoaderBlock
->MemoryDescriptorListHead
);
66 InitializeListHead(&LoaderBlock
->BootDriverListHead
);
68 /* Alloc space for NLS (it will be converted to VA in WinLdrLoadNLS) */
69 LoaderBlock
->NlsData
= MmHeapAlloc(sizeof(NLS_DATA_BLOCK
));
70 if (LoaderBlock
->NlsData
== NULL
)
72 UiMessageBox("Failed to allocate memory for NLS table data!");
75 RtlZeroMemory(LoaderBlock
->NlsData
, sizeof(NLS_DATA_BLOCK
));
77 *OutLoaderBlock
= LoaderBlock
;
82 WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock
,
88 /* Examples of correct options and paths */
89 //CHAR Options[] = "/DEBUGPORT=COM1 /BAUDRATE=115200";
90 //CHAR Options[] = "/NODEBUG";
91 //CHAR SystemRoot[] = "\\WINNT\\";
92 //CHAR ArcBoot[] = "multi(0)disk(0)rdisk(0)partition(1)";
94 CHAR HalPath
[] = "\\";
97 ULONG i
, PathSeparator
;
98 PLOADER_PARAMETER_EXTENSION Extension
;
100 /* Construct SystemRoot and ArcBoot from SystemPath */
101 PathSeparator
= strstr(BootPath
, "\\") - BootPath
;
102 strncpy(ArcBoot
, BootPath
, PathSeparator
);
103 ArcBoot
[PathSeparator
] = 0;
105 DPRINTM(DPRINT_WINDOWS
, "ArcBoot: %s\n", ArcBoot
);
106 DPRINTM(DPRINT_WINDOWS
, "SystemRoot: %s\n", SystemRoot
);
107 DPRINTM(DPRINT_WINDOWS
, "Options: %s\n", Options
);
109 /* Fill Arc BootDevice */
110 LoaderBlock
->ArcBootDeviceName
= MmHeapAlloc(strlen(ArcBoot
)+1);
111 strcpy(LoaderBlock
->ArcBootDeviceName
, ArcBoot
);
112 LoaderBlock
->ArcBootDeviceName
= PaToVa(LoaderBlock
->ArcBootDeviceName
);
114 /* Fill Arc HalDevice, it matches ArcBoot path */
115 LoaderBlock
->ArcHalDeviceName
= MmHeapAlloc(strlen(ArcBoot
)+1);
116 strcpy(LoaderBlock
->ArcHalDeviceName
, ArcBoot
);
117 LoaderBlock
->ArcHalDeviceName
= PaToVa(LoaderBlock
->ArcHalDeviceName
);
119 /* Fill SystemRoot */
120 LoaderBlock
->NtBootPathName
= MmHeapAlloc(strlen(SystemRoot
)+1);
121 strcpy(LoaderBlock
->NtBootPathName
, SystemRoot
);
122 LoaderBlock
->NtBootPathName
= PaToVa(LoaderBlock
->NtBootPathName
);
124 /* Fill NtHalPathName */
125 LoaderBlock
->NtHalPathName
= MmHeapAlloc(strlen(HalPath
)+1);
126 strcpy(LoaderBlock
->NtHalPathName
, HalPath
);
127 LoaderBlock
->NtHalPathName
= PaToVa(LoaderBlock
->NtHalPathName
);
129 /* Fill load options */
130 LoaderBlock
->LoadOptions
= MmHeapAlloc(strlen(Options
)+1);
131 strcpy(LoaderBlock
->LoadOptions
, Options
);
132 LoaderBlock
->LoadOptions
= PaToVa(LoaderBlock
->LoadOptions
);
135 LoaderBlock
->ArcDiskInformation
= (PARC_DISK_INFORMATION
)MmHeapAlloc(sizeof(ARC_DISK_INFORMATION
));
136 InitializeListHead(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
138 /* Convert ARC disk information from freeldr to a correct format */
139 for (i
= 0; i
< reactos_disk_count
; i
++)
141 PARC_DISK_SIGNATURE ArcDiskInfo
;
143 /* Get the ARC structure */
144 ArcDiskInfo
= (PARC_DISK_SIGNATURE
)MmHeapAlloc(sizeof(ARC_DISK_SIGNATURE
));
145 RtlZeroMemory(ArcDiskInfo
, sizeof(ARC_DISK_SIGNATURE
));
147 /* Copy the data over */
148 ArcDiskInfo
->Signature
= reactos_arc_disk_info
[i
].Signature
;
149 ArcDiskInfo
->CheckSum
= reactos_arc_disk_info
[i
].CheckSum
;
151 /* Copy the ARC Name */
152 ArcDiskInfo
->ArcName
= (PCHAR
)MmHeapAlloc(sizeof(CHAR
)*256);
153 strcpy(ArcDiskInfo
->ArcName
, reactos_arc_disk_info
[i
].ArcName
);
154 ArcDiskInfo
->ArcName
= (PCHAR
)PaToVa(ArcDiskInfo
->ArcName
);
156 /* Mark partition table as valid */
157 ArcDiskInfo
->ValidPartitionTable
= TRUE
;
159 /* Insert into the list */
160 InsertTailList(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
,
161 &ArcDiskInfo
->ListEntry
);
164 /* Convert all list's to Virtual address */
166 /* Convert the ArcDisks list to virtual address */
167 List_PaToVa(&LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
);
168 LoaderBlock
->ArcDiskInformation
= PaToVa(LoaderBlock
->ArcDiskInformation
);
170 /* Convert configuration entries to VA */
171 ConvertConfigToVA(LoaderBlock
->ConfigurationRoot
);
172 LoaderBlock
->ConfigurationRoot
= PaToVa(LoaderBlock
->ConfigurationRoot
);
174 /* Convert all DTE into virtual addresses */
175 List_PaToVa(&LoaderBlock
->LoadOrderListHead
);
177 /* this one will be converted right before switching to
178 virtual paging mode */
179 //List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
181 /* Convert list of boot drivers */
182 List_PaToVa(&LoaderBlock
->BootDriverListHead
);
184 /* Initialize Extension now */
185 Extension
= MmHeapAlloc(sizeof(LOADER_PARAMETER_EXTENSION
));
186 if (Extension
== NULL
)
188 UiMessageBox("Failed to allocate LPB Extension!");
191 RtlZeroMemory(Extension
, sizeof(LOADER_PARAMETER_EXTENSION
));
193 /* Fill LPB extension */
194 Extension
->Size
= sizeof(LOADER_PARAMETER_EXTENSION
);
195 Extension
->MajorVersion
= (VersionToBoot
& 0xFF00) >> 8;
196 Extension
->MinorVersion
= VersionToBoot
& 0xFF;
197 Extension
->Profile
.Status
= 2;
199 /* Load drivers database */
200 strcpy(MiscFiles
, BootPath
);
201 strcat(MiscFiles
, "AppPatch\\drvmain.sdb");
202 Extension
->DrvDBImage
= PaToVa(WinLdrLoadModule(MiscFiles
,
203 &Extension
->DrvDBSize
, LoaderRegistryData
));
205 /* Convert extension and setup block pointers */
206 LoaderBlock
->Extension
= PaToVa(Extension
);
208 if (LoaderBlock
->SetupLdrBlock
)
209 LoaderBlock
->SetupLdrBlock
= PaToVa(LoaderBlock
->SetupLdrBlock
);
213 WinLdrLoadDeviceDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
,
215 PUNICODE_STRING FilePath
,
217 PLDR_DATA_TABLE_ENTRY
*DriverDTE
)
220 CHAR DriverPath
[1024];
226 // Separate the path to file name and directory path
227 sprintf(DriverPath
, "%S", FilePath
->Buffer
);
228 DriverNamePos
= strrchr(DriverPath
, '\\');
229 if (DriverNamePos
!= NULL
)
232 strcpy(DllName
, DriverNamePos
+1);
234 // Cut out the name from the path
235 *(DriverNamePos
+1) = 0;
239 // There is no directory in the path
240 strcpy(DllName
, DriverPath
);
244 DPRINTM(DPRINT_WINDOWS
, "DriverPath: %s, DllName: %s, LPB %p\n", DriverPath
, DllName
, LoaderBlock
);
247 // Check if driver is already loaded
248 Status
= WinLdrCheckForLoadedDll(LoaderBlock
, DllName
, DriverDTE
);
251 // We've got the pointer to its DTE, just return success
255 // It's not loaded, we have to load it
256 sprintf(FullPath
,"%s%S", BootPath
, FilePath
->Buffer
);
257 Status
= WinLdrLoadImage(FullPath
, LoaderBootDriver
, &DriverBase
);
260 DPRINTM(DPRINT_WINDOWS
, "WinLdrLoadImage() failed\n");
264 // Allocate a DTE for it
265 Status
= WinLdrAllocateDataTableEntry(LoaderBlock
, DllName
, DllName
, DriverBase
, DriverDTE
);
268 DPRINTM(DPRINT_WINDOWS
, "WinLdrAllocateDataTableEntry() failed\n");
272 // Modify any flags, if needed
273 (*DriverDTE
)->Flags
|= Flags
;
275 // Look for any dependencies it may have, and load them too
276 sprintf(FullPath
,"%s%s", BootPath
, DriverPath
);
277 Status
= WinLdrScanImportDescriptorTable(LoaderBlock
, FullPath
, *DriverDTE
);
280 DPRINTM(DPRINT_WINDOWS
, "WinLdrScanImportDescriptorTable() failed for %s\n",
289 WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock
,
293 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
296 // Walk through the boot drivers list
297 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
299 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
301 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
303 DPRINTM(DPRINT_WINDOWS
, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
304 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
306 // Paths are relative (FIXME: Are they always relative?)
309 Status
= WinLdrLoadDeviceDriver(LoaderBlock
, BootPath
, &BootDriver
->FilePath
,
310 0, &BootDriver
->LdrEntry
);
312 // If loading failed - cry loudly
313 //FIXME: Maybe remove it from the list and try to continue?
316 DPRINTM(DPRINT_WARNING
, "Can't load boot driver: %wZ\n", &BootDriver
->FilePath
);
317 UiMessageBox("Can't load boot driver!");
321 // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore
322 BootDriver
->RegistryPath
.Buffer
= PaToVa(BootDriver
->RegistryPath
.Buffer
);
323 BootDriver
->LdrEntry
= PaToVa(BootDriver
->LdrEntry
);
325 NextBd
= BootDriver
->Link
.Flink
;
331 PVOID
WinLdrLoadModule(PCSTR ModuleName
, ULONG
*Size
,
332 TYPE_OF_MEMORY MemoryType
)
336 FILEINFORMATION FileInfo
;
341 //CHAR ProgressString[256];
343 /* Inform user we are loading files */
344 //sprintf(ProgressString, "Loading %s...", FileName);
345 //UiDrawProgressBarCenter(1, 100, ProgressString);
347 DPRINTM(DPRINT_WINDOWS
, "Loading module %s\n", ModuleName
);
350 /* Open the image file */
351 Status
= ArcOpen((PCHAR
)ModuleName
, OpenReadOnly
, &FileId
);
352 if (Status
!= ESUCCESS
)
354 /* In case of errors, we just return, without complaining to the user */
358 /* Get this file's size */
359 Status
= ArcGetFileInformation(FileId
, &FileInfo
);
360 if (Status
!= ESUCCESS
)
365 FileSize
= FileInfo
.EndingAddress
.LowPart
;
368 /* Allocate memory */
369 PhysicalBase
= MmAllocateMemoryWithType(FileSize
, MemoryType
);
370 if (PhysicalBase
== NULL
)
376 /* Load whole file */
377 Status
= ArcRead(FileId
, PhysicalBase
, FileSize
, &BytesRead
);
379 if (Status
!= ESUCCESS
)
384 DPRINTM(DPRINT_WINDOWS
, "Loaded %s at 0x%x with size 0x%x\n", ModuleName
, PhysicalBase
, FileSize
);
391 WinLdrDetectVersion()
398 L
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server",
400 if (rc
!= ERROR_SUCCESS
)
402 // Key doesn't exist; assume NT 4.0
403 return _WIN32_WINNT_NT4
;
406 // We may here want to read the value of ProductVersion
407 return _WIN32_WINNT_WS03
;
412 LoadAndBootWindows(PCSTR OperatingSystemName
,
414 USHORT OperatingSystemVersion
)
417 char FullPath
[MAX_PATH
], SystemRoot
[MAX_PATH
], BootPath
[MAX_PATH
];
418 CHAR FileName
[MAX_PATH
];
419 CHAR BootOptions
[256];
422 PVOID NtosBase
= NULL
, HalBase
= NULL
, KdComBase
= NULL
;
425 PLOADER_PARAMETER_BLOCK LoaderBlock
, LoaderBlockVA
;
426 KERNEL_ENTRY_POINT KiSystemStartup
;
427 PLDR_DATA_TABLE_ENTRY KernelDTE
, HalDTE
, KdComDTE
= NULL
;
433 // Open the operating system section
434 // specified in the .ini file
435 HasSection
= IniOpenSection(OperatingSystemName
, &SectionId
);
438 UiDrawStatusText("Detecting Hardware...");
439 UiDrawProgressBarCenter(1, 100, "Loading NT...");
441 /* Read the system path is set in the .ini file */
442 if (!HasSection
|| !IniReadSettingByName(SectionId
, "SystemPath", FullPath
, sizeof(FullPath
)))
444 strcpy(FullPath
, OperatingSystemName
);
447 /* Special case for LiveCD */
448 if (!_strnicmp(FullPath
, "LiveCD", strlen("LiveCD")))
450 strcpy(BootPath
, FullPath
+ strlen("LiveCD"));
451 MachDiskGetBootPath(FullPath
, sizeof(FullPath
));
452 strcat(FullPath
, BootPath
);
455 /* Convert FullPath to SystemRoot */
456 PathSeparator
= strstr(FullPath
, "\\");
457 strcpy(SystemRoot
, PathSeparator
);
458 strcat(SystemRoot
, "\\");
460 /* Read booting options */
461 if (!HasSection
|| !IniReadSettingByName(SectionId
, "Options", BootOptions
, sizeof(BootOptions
)))
463 /* Get options after the title */
464 const CHAR
*p
= SettingsValue
;
465 while (*p
== ' ' || *p
== '"')
467 while (*p
!= '\0' && *p
!= '"')
469 strcpy(BootOptions
, p
);
470 DPRINTM(DPRINT_WINDOWS
,"BootOptions: '%s'\n", BootOptions
);
474 // Check if a ramdisk file was given
476 File
= strstr(BootOptions
, "/RDPATH=");
480 // Copy the file name and everything else after it
482 strcpy(FileName
, File
+ 8);
487 *strstr(FileName
, " ") = ANSI_NULL
;
492 RamDiskLoadVirtualFile(FileName
);
495 /* Let user know we started loading */
496 UiDrawStatusText("Loading...");
498 /* append a backslash */
499 strcpy(BootPath
, FullPath
);
500 if ((strlen(BootPath
)==0) ||
501 BootPath
[strlen(BootPath
)] != '\\')
502 strcat(BootPath
, "\\");
504 DPRINTM(DPRINT_WINDOWS
,"BootPath: '%s'\n", BootPath
);
506 /* Allocate and minimalistic-initialize LPB */
507 AllocateAndInitLPB(&LoaderBlock
);
509 /* Detect hardware */
511 LoaderBlock
->ConfigurationRoot
= MachHwDetect();
514 Status
= WinLdrInitSystemHive(LoaderBlock
, BootPath
);
515 DPRINTM(DPRINT_WINDOWS
, "SYSTEM hive loaded with status %d\n", Status
);
517 if (OperatingSystemVersion
== 0)
518 OperatingSystemVersion
= WinLdrDetectVersion();
521 strcpy(FileName
, BootPath
);
522 strcat(FileName
, "SYSTEM32\\NTOSKRNL.EXE");
523 Status
= WinLdrLoadImage(FileName
, LoaderSystemCode
, &NtosBase
);
524 DPRINTM(DPRINT_WINDOWS
, "Ntos loaded with status %d at %p\n", Status
, NtosBase
);
527 strcpy(FileName
, BootPath
);
528 strcat(FileName
, "SYSTEM32\\HAL.DLL");
529 Status
= WinLdrLoadImage(FileName
, LoaderHalCode
, &HalBase
);
530 DPRINTM(DPRINT_WINDOWS
, "HAL loaded with status %d at %p\n", Status
, HalBase
);
532 /* Load kernel-debugger support dll */
533 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
535 strcpy(FileName
, BootPath
);
536 strcat(FileName
, "SYSTEM32\\KDCOM.DLL");
537 Status
= WinLdrLoadImage(FileName
, LoaderBootDriver
, &KdComBase
);
538 DPRINTM(DPRINT_WINDOWS
, "KdCom loaded with status %d at %p\n", Status
, KdComBase
);
541 /* Allocate data table entries for above-loaded modules */
542 WinLdrAllocateDataTableEntry(LoaderBlock
, "ntoskrnl.exe",
543 "WINDOWS\\SYSTEM32\\NTOSKRNL.EXE", NtosBase
, &KernelDTE
);
544 WinLdrAllocateDataTableEntry(LoaderBlock
, "hal.dll",
545 "WINDOWS\\SYSTEM32\\HAL.DLL", HalBase
, &HalDTE
);
546 if (OperatingSystemVersion
> _WIN32_WINNT_WIN2K
)
548 WinLdrAllocateDataTableEntry(LoaderBlock
, "kdcom.dll",
549 "WINDOWS\\SYSTEM32\\KDCOM.DLL", KdComBase
, &KdComDTE
);
552 /* Load all referenced DLLs for kernel, HAL and kdcom.dll */
553 strcpy(FileName
, BootPath
);
554 strcat(FileName
, "SYSTEM32\\");
555 WinLdrScanImportDescriptorTable(LoaderBlock
, FileName
, KernelDTE
);
556 WinLdrScanImportDescriptorTable(LoaderBlock
, FileName
, HalDTE
);
558 WinLdrScanImportDescriptorTable(LoaderBlock
, FileName
, KdComDTE
);
560 /* Load NLS data, OEM font, and prepare boot drivers list */
561 Status
= WinLdrScanSystemHive(LoaderBlock
, BootPath
);
562 DPRINTM(DPRINT_WINDOWS
, "SYSTEM hive scanned with status %d\n", Status
);
564 /* Load boot drivers */
565 Status
= WinLdrLoadBootDrivers(LoaderBlock
, BootPath
);
566 DPRINTM(DPRINT_WINDOWS
, "Boot drivers loaded with status %d\n", Status
);
568 /* Alloc PCR, TSS, do magic things with the GDT/IDT */
569 WinLdrSetupForNt(LoaderBlock
, &GdtIdt
, &PcrBasePage
, &TssBasePage
);
571 /* Initialize Phase 1 - no drivers loading anymore */
572 WinLdrInitializePhase1(LoaderBlock
, BootOptions
, SystemRoot
, BootPath
, OperatingSystemVersion
);
574 /* Save entry-point pointer and Loader block VAs */
575 KiSystemStartup
= (KERNEL_ENTRY_POINT
)KernelDTE
->EntryPoint
;
576 LoaderBlockVA
= PaToVa(LoaderBlock
);
578 /* "Stop all motors", change videomode */
579 if (OperatingSystemVersion
< _WIN32_WINNT_WIN2K
)
580 MachPrepareForReactOS(TRUE
);
582 MachPrepareForReactOS(FALSE
);
585 //DumpMemoryAllocMap();
587 /* Turn on paging mode of CPU*/
588 WinLdrTurnOnPaging(LoaderBlock
, PcrBasePage
, TssBasePage
, GdtIdt
);
590 DbgPrint("Heeelooo\n");
592 /* Save final value of LoaderPagesSpanned */
593 LoaderBlock
->Extension
->LoaderPagesSpanned
= LoaderPagesSpanned
;
595 DPRINTM(DPRINT_WINDOWS
, "Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
596 KiSystemStartup
, LoaderBlockVA
);
598 DbgPrint("Heeelooo\n");
600 WinLdrpDumpMemoryDescriptors(LoaderBlockVA
);
601 WinLdrpDumpBootDriver(LoaderBlockVA
);
602 WinLdrpDumpArcDisks(LoaderBlockVA
);
604 //FIXME: If I substitute this debugging checkpoint, GCC will "optimize away" the code below
606 /*asm(".intel_syntax noprefix\n");
609 asm(".att_syntax\n");*/
612 (*KiSystemStartup
)(LoaderBlockVA
);
618 WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock
)
621 PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor
;
623 NextMd
= LoaderBlock
->MemoryDescriptorListHead
.Flink
;
625 while (NextMd
!= &LoaderBlock
->MemoryDescriptorListHead
)
627 MemoryDescriptor
= CONTAINING_RECORD(NextMd
, MEMORY_ALLOCATION_DESCRIPTOR
, ListEntry
);
629 DPRINTM(DPRINT_WINDOWS
, "BP %08X PC %04X MT %d\n", MemoryDescriptor
->BasePage
,
630 MemoryDescriptor
->PageCount
, MemoryDescriptor
->MemoryType
);
632 NextMd
= MemoryDescriptor
->ListEntry
.Flink
;
637 WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock
)
640 PBOOT_DRIVER_LIST_ENTRY BootDriver
;
642 NextBd
= LoaderBlock
->BootDriverListHead
.Flink
;
644 while (NextBd
!= &LoaderBlock
->BootDriverListHead
)
646 BootDriver
= CONTAINING_RECORD(NextBd
, BOOT_DRIVER_LIST_ENTRY
, Link
);
648 DPRINTM(DPRINT_WINDOWS
, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver
->FilePath
,
649 BootDriver
->LdrEntry
, &BootDriver
->RegistryPath
);
651 NextBd
= BootDriver
->Link
.Flink
;
656 WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock
)
659 PARC_DISK_SIGNATURE ArcDisk
;
661 NextBd
= LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
.Flink
;
663 while (NextBd
!= &LoaderBlock
->ArcDiskInformation
->DiskSignatureListHead
)
665 ArcDisk
= CONTAINING_RECORD(NextBd
, ARC_DISK_SIGNATURE
, ListEntry
);
667 DPRINTM(DPRINT_WINDOWS
, "ArcDisk %s checksum: 0x%X, signature: 0x%X\n",
668 ArcDisk
->ArcName
, ArcDisk
->CheckSum
, ArcDisk
->Signature
);
670 NextBd
= ArcDisk
->ListEntry
.Flink
;