diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index ae052e45b96..8218568d79c 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -47,7 +47,7 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE; #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 @@ typedef struct _MADDRESS_SPACE { LIST_ENTRY MAreaListHead; FAST_MUTEX Lock; - ULONG LowestAddress; + PVOID LowestAddress; struct _EPROCESS* Process; PUSHORT PageTableRefCountTable; ULONG PageTableRefCountTableSize; diff --git a/reactos/ntoskrnl/mm/aspace.c b/reactos/ntoskrnl/mm/aspace.c index a3800e08ef9..8296857f5cb 100644 --- a/reactos/ntoskrnl/mm/aspace.c +++ b/reactos/ntoskrnl/mm/aspace.c @@ -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 @@ MmInitializeAddressSpace(PEPROCESS Process, } else { - AddressSpace->LowestAddress = KERNEL_BASE; + AddressSpace->LowestAddress = (PVOID)KERNEL_BASE; } AddressSpace->Process = Process; if (Process != NULL) diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 27476aca74a..41ab4bc38cd 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -253,7 +253,7 @@ static PVOID MmFindGapBottomUp(PMADDRESS_SPACE AddressSpace, ULONG Length, ULONG 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 @@ static PVOID MmFindGapTopDown(PMADDRESS_SPACE AddressSpace, ULONG Length, ULONG 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 @@ static PVOID MmFindGapTopDown(PMADDRESS_SPACE AddressSpace, ULONG Length, ULONG } /* 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 @@ ULONG MmFindGapAtAddress(PMADDRESS_SPACE AddressSpace, PVOID Address) 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 @@ ULONG MmFindGapAtAddress(PMADDRESS_SPACE AddressSpace, PVOID Address) } else { - if ((ULONG_PTR)Address < AddressSpace->LowestAddress) + if ((ULONG_PTR)Address < (ULONG_PTR)AddressSpace->LowestAddress) { return 0; } @@ -405,7 +405,7 @@ ULONG MmFindGapAtAddress(PMADDRESS_SPACE AddressSpace, PVOID Address) } 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 @@ NTSTATUS MmCreateMemoryArea(PEPROCESS Process, - (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;