#include <ntoskrnl.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
/* FUNCTIONS *****************************************************************/
-VOID static
+static VOID
InsertAfterEntry(PLIST_ENTRY Previous,
PLIST_ENTRY Entry)
/*
Previous->Flink = Entry;
}
-PMM_REGION static
+static PMM_REGION
MmSplitRegion(PMM_REGION InitialRegion, PVOID InitialBaseAddress,
PVOID StartAddress, ULONG Length, ULONG NewType,
- ULONG NewProtect, PMM_AVL_TABLE AddressSpace,
+ ULONG NewProtect, PMMSUPPORT AddressSpace,
PMM_ALTER_REGION_FUNC AlterFunc)
{
PMM_REGION NewRegion1;
NTSTATUS
NTAPI
-MmAlterRegion(PMM_AVL_TABLE AddressSpace, PVOID BaseAddress,
+MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress,
PLIST_ENTRY RegionListHead, PVOID StartAddress, ULONG Length,
ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc)
{
VOID
NTAPI
-MmInitializeRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type,
+MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type,
ULONG Protect)
{
PMM_REGION Region;
Region = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_REGION),
TAG_MM_REGION);
+ if (!Region) return;
+
Region->Type = Type;
Region->Protect = Protect;
Region->Length = Length;