mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed the access to the region list in MmAlterRegion.
svn path=/trunk/; revision=3922
This commit is contained in:
parent
4af2b6bcb7
commit
efc518af7b
1 changed files with 6 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: region.c,v 1.4 2002/09/15 10:45:03 guido Exp $
|
/* $Id: region.c,v 1.5 2003/01/02 16:41:56 hbirr Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/region.c
|
* FILE: ntoskrnl/mm/region.c
|
||||||
|
@ -183,12 +183,11 @@ MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress,
|
||||||
* and call the helper function to actually do the changes.
|
* and call the helper function to actually do the changes.
|
||||||
*/
|
*/
|
||||||
CurrentEntry = NewRegion->RegionListEntry.Flink;
|
CurrentEntry = NewRegion->RegionListEntry.Flink;
|
||||||
|
CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION,
|
||||||
|
RegionListEntry);
|
||||||
CurrentBaseAddress = StartAddress + NewRegion->Length;
|
CurrentBaseAddress = StartAddress + NewRegion->Length;
|
||||||
while (RemainingLength > 0 && CurrentRegion->Length <= RemainingLength)
|
while (RemainingLength > 0 && CurrentRegion->Length <= RemainingLength)
|
||||||
{
|
{
|
||||||
CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION,
|
|
||||||
RegionListEntry);
|
|
||||||
CurrentEntry = CurrentEntry->Flink;
|
|
||||||
if (CurrentRegion->Type != NewType &&
|
if (CurrentRegion->Type != NewType &&
|
||||||
CurrentRegion->Protect != NewProtect)
|
CurrentRegion->Protect != NewProtect)
|
||||||
{
|
{
|
||||||
|
@ -199,8 +198,11 @@ MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress,
|
||||||
CurrentBaseAddress += CurrentRegion->Length;
|
CurrentBaseAddress += CurrentRegion->Length;
|
||||||
NewRegion->Length += CurrentRegion->Length;
|
NewRegion->Length += CurrentRegion->Length;
|
||||||
RemainingLength -= CurrentRegion->Length;
|
RemainingLength -= CurrentRegion->Length;
|
||||||
|
CurrentEntry = CurrentEntry->Flink;
|
||||||
RemoveEntryList(&CurrentRegion->RegionListEntry);
|
RemoveEntryList(&CurrentRegion->RegionListEntry);
|
||||||
ExFreePool(CurrentRegion);
|
ExFreePool(CurrentRegion);
|
||||||
|
CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION,
|
||||||
|
RegionListEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue