mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
[NTOSKRNL/MM]
- The initial region does not necessarily begins with the asked address, calculate remaining space acccordingly. svn path=/trunk/; revision=52616
This commit is contained in:
@@ -135,16 +135,20 @@ MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress,
|
||||
{
|
||||
return(STATUS_NO_MEMORY);
|
||||
}
|
||||
if(NewRegion->Length < Length)
|
||||
RemainingLength = Length - NewRegion->Length;
|
||||
else
|
||||
RemainingLength = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
NewRegion = InitialRegion;
|
||||
if(((ULONG_PTR)InitialBaseAddress + NewRegion->Length) <
|
||||
((ULONG_PTR)StartAddress + Length))
|
||||
RemainingLength = ((ULONG_PTR)StartAddress + Length) - ((ULONG_PTR)InitialBaseAddress + NewRegion->Length);
|
||||
else
|
||||
RemainingLength = 0;
|
||||
}
|
||||
|
||||
if(NewRegion->Length < Length)
|
||||
RemainingLength = Length - NewRegion->Length;
|
||||
else
|
||||
RemainingLength = 0;
|
||||
|
||||
/*
|
||||
* Free any complete regions that are containing in the range of addresses
|
||||
|
||||
Reference in New Issue
Block a user