Don't use MmLowestUserAddress as a ULONG!
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
Modified: trunk/reactos/ntoskrnl/mm/aspace.c
Modified: trunk/reactos/ntoskrnl/mm/marea.c

Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
--- trunk/reactos/ntoskrnl/include/internal/mm.h	2005-01-01 22:57:06 UTC (rev 12711)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h	2005-01-02 01:06:17 UTC (rev 12712)
@@ -47,7 +47,7 @@
 #define NR_SECTION_PAGE_ENTRIES          (1024)
 
 #ifndef __USE_W32API
-#define MM_LOWEST_USER_ADDRESS (4096)
+#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
 #endif
 
 #define MM_VIRTMEM_GRANULARITY (64 * 1024) /* Although Microsoft says this isn't hardcoded anymore,
@@ -217,7 +217,7 @@
 {
   LIST_ENTRY MAreaListHead;
   FAST_MUTEX Lock;
-  ULONG LowestAddress;
+  PVOID LowestAddress;
   struct _EPROCESS* Process;
   PUSHORT PageTableRefCountTable;
   ULONG PageTableRefCountTableSize;

Modified: trunk/reactos/ntoskrnl/mm/aspace.c
--- trunk/reactos/ntoskrnl/mm/aspace.c	2005-01-01 22:57:06 UTC (rev 12711)
+++ trunk/reactos/ntoskrnl/mm/aspace.c	2005-01-02 01:06:17 UTC (rev 12712)
@@ -1,4 +1,4 @@
-/* $Id: aspace.c,v 1.19 2004/09/09 20:42:33 hbirr Exp $
+/* $Id$
  * 
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -76,7 +76,7 @@
    }
    else
    {
-      AddressSpace->LowestAddress = KERNEL_BASE;
+      AddressSpace->LowestAddress = (PVOID)KERNEL_BASE;
    }
    AddressSpace->Process = Process;
    if (Process != NULL)

Modified: trunk/reactos/ntoskrnl/mm/marea.c
--- trunk/reactos/ntoskrnl/mm/marea.c	2005-01-01 22:57:06 UTC (rev 12711)
+++ trunk/reactos/ntoskrnl/mm/marea.c	2005-01-02 01:06:17 UTC (rev 12712)
@@ -253,7 +253,7 @@
       Address = (PVOID) MM_ROUND_UP(Address, Granularity);
    }
    /* Check if enough space for the block */
-   if (AddressSpace->LowestAddress < KERNEL_BASE)
+   if (AddressSpace->LowestAddress < (PVOID)KERNEL_BASE)
    {
       if ((ULONG_PTR) Address >= KERNEL_BASE || Length > KERNEL_BASE - (ULONG_PTR) Address)
       {
@@ -290,7 +290,7 @@
    Length += PAGE_SIZE; /* For a guard page following the area */
 #endif
 
-   if (AddressSpace->LowestAddress < KERNEL_BASE) //(ULONG_PTR)MmSystemRangeStart)
+   if (AddressSpace->LowestAddress < (PVOID)KERNEL_BASE) //(ULONG_PTR)MmSystemRangeStart)
    {
       HighestAddress = MmHighestUserAddress;
    }
@@ -337,7 +337,7 @@
    }
 
    /* Check if enough space for the block */
-   if (AddressSpace->LowestAddress < KERNEL_BASE)
+   if (AddressSpace->LowestAddress < (PVOID)KERNEL_BASE)
    {
       if ((ULONG_PTR) Address >= KERNEL_BASE || Length > KERNEL_BASE - (ULONG_PTR) Address)
       {
@@ -374,7 +374,7 @@
 
    Address = (PVOID)PAGE_ROUND_DOWN(Address);
 
-   if (AddressSpace->LowestAddress < KERNEL_BASE)
+   if (AddressSpace->LowestAddress < (PVOID)KERNEL_BASE)
    {
       if (Address >= (PVOID)KERNEL_BASE)
       {
@@ -383,7 +383,7 @@
    }
    else
    {
-      if ((ULONG_PTR)Address < AddressSpace->LowestAddress)
+      if ((ULONG_PTR)Address < (ULONG_PTR)AddressSpace->LowestAddress)
       {
          return 0;
       }
@@ -405,7 +405,7 @@
       }
       current_entry = current_entry->Flink;
    }
-   if (AddressSpace->LowestAddress < KERNEL_BASE)
+   if (AddressSpace->LowestAddress < (PVOID)KERNEL_BASE)
    {
       return KERNEL_BASE - (ULONG_PTR)Address;
    }
@@ -548,13 +548,13 @@
                              - (ULONG_PTR) MM_ROUND_DOWN(*BaseAddress, Granularity));
       *BaseAddress = MM_ROUND_DOWN(*BaseAddress, Granularity);
 
-      if (AddressSpace->LowestAddress == KERNEL_BASE &&
+      if (AddressSpace->LowestAddress == (PVOID)KERNEL_BASE &&
             (*BaseAddress) < (PVOID)KERNEL_BASE)
       {
          return STATUS_ACCESS_VIOLATION;
       }
 
-      if (AddressSpace->LowestAddress < KERNEL_BASE &&
+      if (AddressSpace->LowestAddress < (PVOID)KERNEL_BASE &&
             (PVOID)((char*)(*BaseAddress) + tmpLength) > (PVOID)KERNEL_BASE)
       {
          return STATUS_ACCESS_VIOLATION;