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. Modified: trunk/reactos/ntoskrnl/mm/marea.c _____
Modified: trunk/reactos/ntoskrnl/mm/marea.c --- trunk/reactos/ntoskrnl/mm/marea.c 2005-03-20 11:35:39 UTC (rev 14213) +++ trunk/reactos/ntoskrnl/mm/marea.c 2005-03-20 12:04:30 UTC (rev 14214) @@ -491,7 +491,8 @@
/* Check if there is enough space after the last memory area. */ 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); return AlignedAddress;