* and call the helper function to actually do the changes.
*/
CurrentEntry = NewRegion->RegionListEntry.Flink;
+ CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION,
+ RegionListEntry);
CurrentBaseAddress = StartAddress + NewRegion->Length;
while (RemainingLength > 0 && CurrentRegion->Length <= RemainingLength)
{
- CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION,
- RegionListEntry);
- CurrentEntry = CurrentEntry->Flink;
if (CurrentRegion->Type != NewType &&
CurrentRegion->Protect != NewProtect)
{
CurrentBaseAddress += CurrentRegion->Length;
NewRegion->Length += CurrentRegion->Length;
RemainingLength -= CurrentRegion->Length;
+ CurrentEntry = CurrentEntry->Flink;
RemoveEntryList(&CurrentRegion->RegionListEntry);
ExFreePool(CurrentRegion);
+ CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION,
+ RegionListEntry);
}
/*