mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:33:07 +00:00
[NTOS]: Fix a bug in MmFindGapBottomUp which could make it return an address lower than what the caller said should be the lowest address.
svn path=/trunk/; revision=49439
This commit is contained in:
parent
36429c0a64
commit
c7b69d59e3
1 changed files with 10 additions and 5 deletions
|
@ -492,13 +492,16 @@ MmFindGapBottomUp(
|
||||||
break;
|
break;
|
||||||
|
|
||||||
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
|
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
|
||||||
if (Node->StartingAddress > AlignedAddress &&
|
if (AlignedAddress >= LowestAddress)
|
||||||
(ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
|
||||||
{
|
{
|
||||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
if (Node->StartingAddress > AlignedAddress &&
|
||||||
return AlignedAddress;
|
(ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||||
|
{
|
||||||
|
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||||
|
ASSERT(AlignedAddress >= LowestAddress);
|
||||||
|
return AlignedAddress;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviousNode = Node;
|
PreviousNode = Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,6 +511,7 @@ MmFindGapBottomUp(
|
||||||
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||||
{
|
{
|
||||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||||
|
ASSERT(AlignedAddress >= LowestAddress);
|
||||||
return AlignedAddress;
|
return AlignedAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,6 +521,7 @@ MmFindGapBottomUp(
|
||||||
(ULONG_PTR)FirstNode->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
(ULONG_PTR)FirstNode->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||||
{
|
{
|
||||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||||
|
ASSERT(AlignedAddress >= LowestAddress);
|
||||||
return AlignedAddress;
|
return AlignedAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue