mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Don't use MmLowestUserAddress as a ULONG!
svn path=/trunk/; revision=12712
This commit is contained in:
parent
6a5aa2060e
commit
28dff13100
3 changed files with 12 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue