/* Build a lame VAD if this is a user-space allocation */
if ((marea->EndingAddress < MmSystemRangeStart) && (marea->Type != MEMORY_AREA_OWNED_BY_ARM3))
{
- ASSERT(marea->Type == MEMORY_AREA_VIRTUAL_MEMORY || marea->Type == MEMORY_AREA_SECTION_VIEW);
PMMVAD Vad;
+
+ ASSERT(marea->Type == MEMORY_AREA_VIRTUAL_MEMORY || marea->Type == MEMORY_AREA_SECTION_VIEW);
Vad = ExAllocatePoolWithTag(NonPagedPool, sizeof(MMVAD), 'Fake');
ASSERT(Vad);
RtlZeroMemory(Vad, sizeof(MMVAD));
break;
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
- if (Node->StartingAddress > AlignedAddress &&
- (ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
+ if (AlignedAddress >= LowestAddress)
{
- DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
- return AlignedAddress;
+ if (Node->StartingAddress > AlignedAddress &&
+ (ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
+ {
+ DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
+ ASSERT(AlignedAddress >= LowestAddress);
+ return AlignedAddress;
+ }
}
-
PreviousNode = Node;
}
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
{
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
+ ASSERT(AlignedAddress >= LowestAddress);
return AlignedAddress;
}
(ULONG_PTR)FirstNode->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
{
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
+ ASSERT(AlignedAddress >= LowestAddress);
return AlignedAddress;
}