- Revert 49927 "Update to trunk" as it breaks KsStudio (again)
[reactos.git] / ntoskrnl / mm / marea.c
index a621abf..92aacb8 100644 (file)
@@ -356,12 +356,6 @@ NTAPI
 MiInsertVad(IN PMMVAD Vad,
 IN PEPROCESS Process);
 
-ULONG
-NTAPI
-MiMakeProtectionMask(
-    IN ULONG Protect
-);
-
 static VOID
 MmInsertMemoryArea(
    PMMSUPPORT AddressSpace,
@@ -395,7 +389,6 @@ MmInsertMemoryArea(
         }
        Vad->u.VadFlags.Spare = 1;
        Vad->u.VadFlags.PrivateMemory = 1;
-       Vad->u.VadFlags.Protection = MiMakeProtectionMask(marea->Protect);
        MiInsertVad(Vad, MmGetAddressSpaceOwner(AddressSpace));
        marea->Vad = Vad;
    }
@@ -492,16 +485,13 @@ MmFindGapBottomUp(
          break;
 
       AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
-      if (AlignedAddress >= LowestAddress)
+      if (Node->StartingAddress > AlignedAddress &&
+          (ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
       {
-          if (Node->StartingAddress > AlignedAddress &&
-              (ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
-          {
-             DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
-             ASSERT(AlignedAddress >= LowestAddress);
-             return AlignedAddress;
-          }
+         DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
+         return AlignedAddress;
       }
+
       PreviousNode = Node;
    }
 
@@ -511,7 +501,6 @@ MmFindGapBottomUp(
        (ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
    {
       DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
-      ASSERT(AlignedAddress >= LowestAddress);
       return AlignedAddress;
    }
 
@@ -521,7 +510,6 @@ MmFindGapBottomUp(
        (ULONG_PTR)FirstNode->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
    {
       DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
-      ASSERT(AlignedAddress >= LowestAddress);
       return AlignedAddress;
    }