[BOOT] Execution contexts and more refactoring
This commit is contained in:
@@ -88,14 +88,13 @@ Return Value:
|
||||
NTSTATUS Status;
|
||||
PMEMORY_DESCRIPTOR Descriptor, NewDescriptor;
|
||||
|
||||
(VOID)MemoryInfo;
|
||||
|
||||
DebugPrint(L"Initializing page allocator...\r\n");
|
||||
|
||||
PapMinimumAllocationCount = MinimumAllocation;
|
||||
PapMinimumPhysicalPage = 1;
|
||||
PapMaximumPhysicalPage = MAXULONGLONG >> PAGE_SHIFT;
|
||||
|
||||
//
|
||||
// Initialize Memory Descriptor Lists
|
||||
//
|
||||
InitializeMdl(&MmMdlFwAllocationTracker);
|
||||
InitializeMdl(&MmMdlBadMemory);
|
||||
InitializeMdl(&MmMdlTruncatedMemory);
|
||||
@@ -116,11 +115,18 @@ Return Value:
|
||||
// MDL the memory manager will use for allocation.
|
||||
//
|
||||
Descriptor = (PMEMORY_DESCRIPTOR)((PUCHAR)MemoryInfo + MemoryInfo->MdlOffset);
|
||||
for (ULONG DescriptorCount = MemoryInfo->DescriptorCount; DescriptorCount > 0; DescriptorCount--) {
|
||||
for (ULONG DescriptorCount = MemoryInfo->DescriptorCount;
|
||||
DescriptorCount > 0;
|
||||
DescriptorCount--) {
|
||||
//
|
||||
// Remove from the usable MDL.
|
||||
//
|
||||
Status = MmMdRemoveRegionFromMdlEx(&MmMdlUnmappedUnallocated, Descriptor->FirstPage, Descriptor->PageCount, MDL_OPERATION_FLAGS_PHYSICAL, NULL);
|
||||
Status = MmMdRemoveRegionFromMdl(
|
||||
&MmMdlUnmappedUnallocated,
|
||||
Descriptor->FirstPage,
|
||||
Descriptor->PageCount,
|
||||
MDL_OPERATION_FLAGS_PHYSICAL
|
||||
);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
Reference in New Issue
Block a user