28 Entry->Blink = Previous;
46 if (NewRegion2 ==
NULL)
54 if (NewRegion1 ==
NULL)
59 NewRegion1->
Type = NewType;
61 InternalLength = ((
char*)InitialBaseAddress + InitialRegion->
Length) - (
char*)StartAddress;
62 InternalLength =
min(InternalLength,
Length);
63 NewRegion1->
Length = InternalLength;
78 if (((
char*)InitialBaseAddress + InitialRegion->
Length) > ((
char*)StartAddress +
Length))
80 NewRegion2->
Type = InitialRegion->
Type;
82 NewRegion2->
Length = ((
char*)InitialBaseAddress + InitialRegion->
Length) -
83 ((
char*)StartAddress +
Length);
93 if (InitialBaseAddress == StartAddress)
100 InitialRegion->
Length = (
char*)StartAddress - (
char*)InitialBaseAddress;
117 PVOID CurrentBaseAddress;
125 &InitialBaseAddress);
134 if (NewRegion ==
NULL)
145 NewRegion = InitialRegion;
160 CurrentBaseAddress = (
char*)StartAddress + NewRegion->
Length;
161 while (RemainingLength > 0 && CurrentRegion->
Length <= RemainingLength &&
162 CurrentEntry != RegionListHead)
164 if (CurrentRegion->
Type != NewType ||
174 RemainingLength -= CurrentRegion->
Length;
175 CurrentEntry = CurrentEntry->
Flink;
185 if (RemainingLength > 0 && CurrentEntry != RegionListHead)
189 if (CurrentRegion->
Type != NewType ||
192 AlterFunc(
AddressSpace, CurrentBaseAddress, RemainingLength,
196 NewRegion->
Length += RemainingLength;
197 CurrentRegion->
Length -= RemainingLength;
208 if (CurrentRegion->
Type == NewRegion->
Type &&
225 if (CurrentRegion->
Type == NewRegion->
Type &&
258 PVOID* RegionBaseAddress)
264 current_entry = RegionListHead->
Flink;
265 while (current_entry != RegionListHead)
272 if (RegionBaseAddress !=
NULL)
274 *RegionBaseAddress = StartAddress;
279 current_entry = current_entry->
Flink;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define RemoveEntryList(Entry)
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define InitializeListHead(ListHead)
struct task_struct * current
#define ExFreePoolWithTag(_P, _T)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID(* PMM_ALTER_REGION_FUNC)(PMMSUPPORT AddressSpace, PVOID BaseAddress, SIZE_T Length, ULONG OldType, ULONG OldProtect, ULONG NewType, ULONG NewProtect)
VOID NTAPI MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type, ULONG Protect)
static PMM_REGION MmSplitRegion(PMM_REGION InitialRegion, PVOID InitialBaseAddress, PVOID StartAddress, SIZE_T Length, ULONG NewType, ULONG NewProtect, PMMSUPPORT AddressSpace, PMM_ALTER_REGION_FUNC AlterFunc)
PMM_REGION NTAPI MmFindRegion(PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID Address, PVOID *RegionBaseAddress)
NTSTATUS NTAPI MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, SIZE_T Length, ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc)
static VOID InsertAfterEntry(PLIST_ENTRY Previous, PLIST_ENTRY Entry)
base of all file and directory entries
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
LIST_ENTRY RegionListEntry
#define CONTAINING_RECORD(address, type, field)
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
_Must_inspect_result_ _In_ ULONG NewProtect
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T _In_ SECTION_INHERIT _In_ ULONG _In_ ULONG Protect