Fix nasty condition when we were subtracting AlignedAddress (which happened to be aligned to 0x80000000) from HighestAddress (which is MmSystemRangeStart - 1 == 0x7fffffff) and then using it for length comparsion.

svn path=/trunk/; revision=14214
This commit is contained in:
Filip Navara 2005-03-20 12:04:30 +00:00
parent b0fb19733c
commit 4cae592ec2

View file

@ -491,7 +491,8 @@ MmFindGapBottomUp(
/* Check if there is enough space after the last memory area. */ /* Check if there is enough space after the last memory area. */
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity); AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
if ((ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length) if ((ULONG_PTR)HighestAddress > (ULONG_PTR)AlignedAddress &&
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
{ {
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress); DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
return AlignedAddress; return AlignedAddress;