[BOOT] Add stubs to complete MmPaInitialize()

MmPaInitialize() is now complete
Added BlpMmInitializeConstraints() and MmMdRemoveRegionFromMdlEx()
This commit is contained in:
2024-08-27 13:57:21 -04:00
parent 437b19a0f5
commit 6fc91eb58c
6 changed files with 155 additions and 15 deletions

View File

@@ -347,9 +347,9 @@ Routine Description:
Arguments:
Mdl - the MDL to remove Descriptor from.
Mdl - MDL to remove Descriptor from.
Descriptor - the descriptor to remove from Mdl.
Descriptor - Descriptor to remove from Mdl.
Return Value:
@@ -386,6 +386,67 @@ Return Value:
}
}
NTSTATUS
MmMdRemoveRegionFromMdlEx (
IN PMEMORY_DESCRIPTOR_LIST Mdl,
IN ULONGLONG FirstPage,
IN ULONGLONG PageCount,
IN ULONG Flags,
OUT PMEMORY_DESCRIPTOR_LIST Unused
)
/*++
Routine Description:
Removes a region from a MDL.
Arguments:
Mdl - MDL to remove the region from.
FirstPage - The first page in the region.
PageCount - The number of pages in the region.
Flags - MDL_OPERATION_FLAGS_*.
Unused - Unused.
Return Value:
None.
--*/
{
ULONGLONG RemoveEnd, DescriptorEnd;
PLIST_ENTRY Entry;
PMEMORY_DESCRIPTOR Descriptor;
MEMORY_DESCRIPTOR RemovedDescriptor;
(VOID)Flags;
(VOID)Unused;
RemoveEnd = FirstPage + PageCount;
Entry = Mdl->Head->Flink;
while (Entry != Mdl->Head) {
Descriptor = (PMEMORY_DESCRIPTOR)Entry;
DescriptorEnd = Descriptor->FirstPage + Descriptor->PageCount;
RtlCopyMemory(&RemovedDescriptor, Descriptor, sizeof(MEMORY_DESCRIPTOR));
// if (FirstPage <= Descriptor->FirstPage && Descriptor->FirstPage < RemoveEnd) {
// }
}
//
// TODO: Finish this function.
//
return STATUS_SUCCESS;
}
NTSTATUS
MmMdFreeDescriptor (
IN PMEMORY_DESCRIPTOR Descriptor