Author: ion
Date: Fri May 19 00:10:44 2006
New Revision: 21934
URL:
http://svn.reactos.ru/svn/reactos?rev=21934&view=rev
Log:
- Use EPROCESS 's AddressCreationLock instead of the MADDRESS_SPACE Lock.
- Overlay MADDRES_SPACE over MM_AVL_NODE. Even though our structures are currently
incompatible, they represent the same thing (The EPROCESS's Address space).
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/include/internal/ps.h
trunk/reactos/ntoskrnl/ke/bug.c
trunk/reactos/ntoskrnl/mm/anonmem.c
trunk/reactos/ntoskrnl/mm/aspace.c
trunk/reactos/ntoskrnl/mm/i386/page.c
trunk/reactos/ntoskrnl/mm/marea.c
trunk/reactos/ntoskrnl/mm/mdl.c
trunk/reactos/ntoskrnl/mm/mm.c
trunk/reactos/ntoskrnl/mm/process.c
trunk/reactos/ntoskrnl/mm/rmap.c
trunk/reactos/ntoskrnl/mm/section.c
trunk/reactos/ntoskrnl/mm/virtual.c
trunk/reactos/ntoskrnl/ps/psmgr.c
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/include/internal/m…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h Fri May 19 00:10:44 2006
@@ -219,7 +219,6 @@
ULONG Type;
ULONG Protect;
ULONG Flags;
- ULONG LockCount;
BOOLEAN DeleteInProgress;
ULONG PageOpCount;
union
@@ -242,7 +241,6 @@
typedef struct _MADDRESS_SPACE
{
PMEMORY_AREA MemoryAreaRoot;
- FAST_MUTEX Lock;
PVOID LowestAddress;
struct _ROS_EPROCESS* Process;
PUSHORT PageTableRefCountTable;
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/include/internal/p…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ps.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ps.h Fri May 19 00:10:44 2006
@@ -45,7 +45,7 @@
EX_PUSH_LOCK AddressCreationLock;
PETHREAD RotateInProgress;
#else
- KGUARDED_MUTEX AddressCreationLock;
+ FAST_MUTEX AddressCreationLock; // FIXME: FAST_MUTEX for XP, KGUARDED_MUTEX for 2K3
KSPIN_LOCK HyperSpaceLock;
#endif
PETHREAD ForkInProgress;
@@ -200,7 +200,6 @@
UCHAR PriorityClass;
MM_AVL_TABLE VadRoot;
ULONG Cookie;
- MADDRESS_SPACE AddressSpace;
} ROS_EPROCESS, *PROS_EPROCESS;
#include <poppack.h>
Modified: trunk/reactos/ntoskrnl/ke/bug.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=21934…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/bug.c (original)
+++ trunk/reactos/ntoskrnl/ke/bug.c Fri May 19 00:10:44 2006
@@ -26,6 +26,8 @@
HalReleaseDisplayOwnership(
VOID
);
+
+extern FAST_MUTEX KernelAddressSpaceLock;
/* GLOBALS ******************************************************************/
@@ -341,7 +343,7 @@
KeRaiseIrql(HIGH_LEVEL, &OldIrql);
/* Unload the Kernel Adress Space if we own it */
- if (MmGetKernelAddressSpace()->Lock.Owner == KeGetCurrentThread())
+ if (KernelAddressSpaceLock.Owner == KeGetCurrentThread())
MmUnlockAddressSpace(MmGetKernelAddressSpace());
/* FIXMEs: Use inbv to clear, fill and write to screen. */
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/anonmem.c (original)
+++ trunk/reactos/ntoskrnl/mm/anonmem.c Fri May 19 00:10:44 2006
@@ -679,7 +679,7 @@
Type = (AllocationType & MEM_COMMIT) ? MEM_COMMIT : MEM_RESERVE;
DPRINT("Type %x\n", Type);
- AddressSpace = &Process->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
MmLockAddressSpace(AddressSpace);
if (PBaseAddress != 0)
@@ -833,7 +833,7 @@
if (PageOp != NULL)
{
NTSTATUS Status;
- MmUnlockAddressSpace(&Process->AddressSpace);
+ MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
Status = KeWaitForSingleObject(&PageOp->CompletionEvent,
0,
KernelMode,
@@ -844,7 +844,7 @@
DPRINT1("Failed to wait for page op\n");
KEBUGCHECK(0);
}
- MmLockAddressSpace(&Process->AddressSpace);
+ MmLockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
MmReleasePageOp(PageOp);
}
}
@@ -860,7 +860,7 @@
}
/* Actually free the memory area. */
- MmFreeMemoryArea(&Process->AddressSpace,
+ MmFreeMemoryArea((PMADDRESS_SPACE)&Process->VadRoot,
MemoryArea,
MmFreeVirtualMemoryPage,
(PVOID)Process);
@@ -913,7 +913,7 @@
return(Status);
}
- AddressSpace = &Process->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
MmLockAddressSpace(AddressSpace);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
Modified: trunk/reactos/ntoskrnl/mm/aspace.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/aspace.c?rev=21…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/aspace.c (original)
+++ trunk/reactos/ntoskrnl/mm/aspace.c Fri May 19 00:10:44 2006
@@ -20,7 +20,8 @@
/* GLOBALS ******************************************************************/
-STATIC MADDRESS_SPACE KernelAddressSpace;
+static MADDRESS_SPACE KernelAddressSpace;
+FAST_MUTEX KernelAddressSpaceLock;
/* FUNCTIONS *****************************************************************/
@@ -35,7 +36,15 @@
{
return;
}
- ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&AddressSpace->Lock);
+
+ if (AddressSpace->Process)
+ {
+
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&AddressSpace->Process->AddressCreationLock);
+ }
+ else
+ {
+ ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&KernelAddressSpaceLock);
+ }
}
VOID
@@ -49,7 +58,14 @@
{
return;
}
- ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&AddressSpace->Lock);
+ if (AddressSpace->Process)
+ {
+
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&AddressSpace->Process->AddressCreationLock);
+ }
+ else
+ {
+ ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&KernelAddressSpaceLock);
+ }
}
VOID
@@ -64,7 +80,7 @@
NTAPI
MmGetCurrentAddressSpace(VOID)
{
- return(&((PROS_EPROCESS)PsGetCurrentProcess())->AddressSpace);
+ return((PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot);
}
PMADDRESS_SPACE
@@ -80,7 +96,14 @@
PMADDRESS_SPACE AddressSpace)
{
AddressSpace->MemoryAreaRoot = NULL;
- ExInitializeFastMutex(&AddressSpace->Lock);
+ if (Process)
+ {
+ ExInitializeFastMutex(&Process->AddressCreationLock);
+ }
+ else
+ {
+ ExInitializeFastMutex(&KernelAddressSpaceLock);
+ }
if (Process != NULL)
{
AddressSpace->LowestAddress = MM_LOWEST_USER_ADDRESS;
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c Fri May 19 00:10:44 2006
@@ -243,7 +243,7 @@
DPRINT1("ProcessId %d, Pde for %08x - %08x is not freed, RefCount
%d\n",
Process->UniqueProcessId,
(i * 512 + j) * 512 * PAGE_SIZE, (i * 512 + j + 1) * 512 * PAGE_SIZE -
1,
- Process->AddressSpace.PageTableRefCountTable[i*512 + j]);
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable[i*512
+ j]);
Pde = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(PageDir[j]));
for (k = 0; k < 512; k++)
{
@@ -288,7 +288,7 @@
{
DPRINT1("Pde for %08x - %08x is not freed, RefCount %d\n",
i * 4 * 1024 * 1024, (i + 1) * 4 * 1024 * 1024 - 1,
- Process->AddressSpace.PageTableRefCountTable[i]);
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable[i]);
Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(PageDir[i]));
for (j = 0; j < 1024; j++)
{
@@ -1041,13 +1041,13 @@
* Decrement the reference count for this page table.
*/
if (Process != NULL && WasValid &&
- Process->AddressSpace.PageTableRefCountTable != NULL &&
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL
&&
Address < MmSystemRangeStart)
{
PUSHORT Ptrc;
ULONG Idx;
- Ptrc = Process->AddressSpace.PageTableRefCountTable;
+ Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable;
Idx = Ke386Pae ? PAE_ADDR_TO_PAGE_TABLE(Address) : ADDR_TO_PAGE_TABLE(Address);
Ptrc[Idx]--;
@@ -1090,12 +1090,12 @@
* Decrement the reference count for this page table.
*/
if (Process != NULL && Pte &&
- Process->AddressSpace.PageTableRefCountTable != NULL &&
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL
&&
Address < MmSystemRangeStart)
{
PUSHORT Ptrc;
- Ptrc = Process->AddressSpace.PageTableRefCountTable;
+ Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable;
Ptrc[PAE_ADDR_TO_PAGE_TABLE(Address)]--;
if (Ptrc[PAE_ADDR_TO_PAGE_TABLE(Address)] == 0)
@@ -1134,12 +1134,12 @@
* Decrement the reference count for this page table.
*/
if (Process != NULL && Pte &&
- Process->AddressSpace.PageTableRefCountTable != NULL &&
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL
&&
Address < MmSystemRangeStart)
{
PUSHORT Ptrc;
- Ptrc = Process->AddressSpace.PageTableRefCountTable;
+ Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable;
Ptrc[ADDR_TO_PAGE_TABLE(Address)]--;
if (Ptrc[ADDR_TO_PAGE_TABLE(Address)] == 0)
@@ -1694,13 +1694,13 @@
}
}
if (Process != NULL &&
- Process->AddressSpace.PageTableRefCountTable != NULL &&
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL
&&
Address < MmSystemRangeStart)
{
PUSHORT Ptrc;
ULONG Idx;
- Ptrc = Process->AddressSpace.PageTableRefCountTable;
+ Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable;
Idx = Ke386Pae ? PAE_ADDR_TO_PAGE_TABLE(Address) : ADDR_TO_PAGE_TABLE(Address);
Ptrc[Idx]++;
}
@@ -1823,12 +1823,12 @@
MmMarkPageUnmapped(PAE_PTE_TO_PFN((Pte)));
}
if (Address < MmSystemRangeStart &&
- Process->AddressSpace.PageTableRefCountTable != NULL &&
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL
&&
Attributes & PA_PRESENT)
{
PUSHORT Ptrc;
- Ptrc = Process->AddressSpace.PageTableRefCountTable;
+ Ptrc =
((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable;
Ptrc[PAE_ADDR_TO_PAGE_TABLE(Addr)]++;
}
@@ -1888,12 +1888,12 @@
}
(void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes);
if (Address < MmSystemRangeStart &&
- Process->AddressSpace.PageTableRefCountTable != NULL &&
+ ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL
&&
Attributes & PA_PRESENT)
{
PUSHORT Ptrc;
- Ptrc = Process->AddressSpace.PageTableRefCountTable;
+ Ptrc =
((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable;
Ptrc[ADDR_TO_PAGE_TABLE(Addr)]++;
}
Modified: trunk/reactos/ntoskrnl/mm/marea.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=219…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/marea.c (original)
+++ trunk/reactos/ntoskrnl/mm/marea.c Fri May 19 00:10:44 2006
@@ -1011,7 +1011,7 @@
MemoryArea->EndingAddress = (PVOID)((ULONG_PTR)*BaseAddress + tmpLength);
MemoryArea->Protect = Protect;
MemoryArea->Flags = AllocationFlags;
- MemoryArea->LockCount = 0;
+ //MemoryArea->LockCount = 0;
MemoryArea->PageOpCount = 0;
MemoryArea->DeleteInProgress = FALSE;
Modified: trunk/reactos/ntoskrnl/mm/mdl.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/mdl.c?rev=21934…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mdl.c (original)
+++ trunk/reactos/ntoskrnl/mm/mdl.c Fri May 19 00:10:44 2006
@@ -273,14 +273,14 @@
ASSERT(Mdl->Process == PsGetCurrentProcess());
- Marea = MmLocateMemoryAreaByAddress(
&((PROS_EPROCESS)Mdl->Process)->AddressSpace, BaseAddress );
+ Marea = MmLocateMemoryAreaByAddress(
(PMADDRESS_SPACE)&((PROS_EPROCESS)Mdl->Process)->VadRoot, BaseAddress );
if (Marea == NULL)
{
DPRINT1( "Couldn't open memory area when unmapping user-space
pages!\n" );
KEBUGCHECK(0);
}
- MmFreeMemoryArea( &((PROS_EPROCESS)Mdl->Process)->AddressSpace, Marea,
NULL, NULL );
+ MmFreeMemoryArea(
(PMADDRESS_SPACE)&((PROS_EPROCESS)Mdl->Process)->VadRoot, Marea, NULL, NULL );
Mdl->Process = NULL;
}
@@ -411,7 +411,7 @@
/* FIXME: why isn't AccessMode used? */
Mode = UserMode;
Mdl->Process = CurrentProcess;
- AddressSpace = &((PROS_EPROCESS)CurrentProcess)->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)CurrentProcess)->VadRoot;
}
@@ -805,8 +805,8 @@
CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess();
- MmLockAddressSpace(&CurrentProcess->AddressSpace);
- Status = MmCreateMemoryArea(&CurrentProcess->AddressSpace,
+ MmLockAddressSpace((PMADDRESS_SPACE)&CurrentProcess->VadRoot);
+ Status = MmCreateMemoryArea((PMADDRESS_SPACE)&CurrentProcess->VadRoot,
MEMORY_AREA_MDL_MAPPING,
&Base,
PageCount * PAGE_SIZE,
@@ -815,7 +815,7 @@
(Base != NULL),
0,
BoundaryAddressMultiple);
- MmUnlockAddressSpace(&CurrentProcess->AddressSpace);
+ MmUnlockAddressSpace((PMADDRESS_SPACE)&CurrentProcess->VadRoot);
if (!NT_SUCCESS(Status))
{
if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL)
Modified: trunk/reactos/ntoskrnl/mm/mm.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/mm.c?rev=21934&…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mm.c (original)
+++ trunk/reactos/ntoskrnl/mm/mm.c Fri May 19 00:10:44 2006
@@ -38,17 +38,17 @@
DPRINT("MmReleaseMmInfo(Process %x (%s))\n", Process,
Process->ImageFileName);
- MmLockAddressSpace(&Process->AddressSpace);
-
- while ((MemoryArea = Process->AddressSpace.MemoryAreaRoot) != NULL)
+ MmLockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
+
+ while ((MemoryArea = ((PMADDRESS_SPACE)&Process->VadRoot)->MemoryAreaRoot)
!= NULL)
{
switch (MemoryArea->Type)
{
case MEMORY_AREA_SECTION_VIEW:
Address = (PVOID)MemoryArea->StartingAddress;
- MmUnlockAddressSpace(&Process->AddressSpace);
+ MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
MmUnmapViewOfSection((PEPROCESS)Process, Address);
- MmLockAddressSpace(&Process->AddressSpace);
+ MmLockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
break;
case MEMORY_AREA_VIRTUAL_MEMORY:
@@ -58,7 +58,7 @@
case MEMORY_AREA_SHARED_DATA:
case MEMORY_AREA_NO_ACCESS:
- MmFreeMemoryArea(&Process->AddressSpace,
+ MmFreeMemoryArea((PMADDRESS_SPACE)&Process->VadRoot,
MemoryArea,
NULL,
NULL);
@@ -75,8 +75,8 @@
Mmi386ReleaseMmInfo(Process);
- MmUnlockAddressSpace(&Process->AddressSpace);
- MmDestroyAddressSpace(&Process->AddressSpace);
+ MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
+ MmDestroyAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
DPRINT("Finished MmReleaseMmInfo()\n");
return(STATUS_SUCCESS);
@@ -114,7 +114,7 @@
}
else
{
- AddressSpace = &((PROS_EPROCESS)PsGetCurrentProcess())->AddressSpace;
+ AddressSpace =
(PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot;
}
MmLockAddressSpace(AddressSpace);
@@ -171,7 +171,7 @@
}
else
{
- AddressSpace = &((PROS_EPROCESS)PsGetCurrentProcess())->AddressSpace;
+ AddressSpace =
(PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot;
}
if (!FromMdl)
@@ -304,7 +304,7 @@
}
else
{
- AddressSpace = &((PROS_EPROCESS)PsGetCurrentProcess())->AddressSpace;
+ AddressSpace =
(PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot;
}
if (!FromMdl)
Modified: trunk/reactos/ntoskrnl/mm/process.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/process.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/process.c (original)
+++ trunk/reactos/ntoskrnl/mm/process.c Fri May 19 00:10:44 2006
@@ -29,7 +29,7 @@
PVOID BaseAddress)
{
NTSTATUS Status;
- PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace;
+ PMADDRESS_SPACE ProcessAddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
PMEMORY_AREA MemoryArea;
PHYSICAL_ADDRESS BoundaryAddressMultiple;
PVOID AllocatedBase = BaseAddress;
@@ -110,7 +110,7 @@
MmDeleteTeb(PROS_EPROCESS Process,
PTEB Teb)
{
- PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace;
+ PMADDRESS_SPACE ProcessAddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
PMEMORY_AREA MemoryArea;
/* Lock the Address Space */
@@ -424,7 +424,7 @@
IN PROS_SECTION_OBJECT Section OPTIONAL)
{
NTSTATUS Status;
- PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace;
+ PMADDRESS_SPACE ProcessAddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
PVOID BaseAddress;
PMEMORY_AREA MemoryArea;
PHYSICAL_ADDRESS BoundaryAddressMultiple;
Modified: trunk/reactos/ntoskrnl/mm/rmap.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/rmap.c?rev=2193…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/rmap.c (original)
+++ trunk/reactos/ntoskrnl/mm/rmap.c Fri May 19 00:10:44 2006
@@ -92,7 +92,7 @@
{
return Status;
}
- AddressSpace = &Process->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
}
else
{
@@ -223,7 +223,7 @@
{
return Status;
}
- AddressSpace = &Process->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
}
else
{
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c (original)
+++ trunk/reactos/ntoskrnl/mm/section.c Fri May 19 00:10:44 2006
@@ -1338,7 +1338,7 @@
PageOutContext = (MM_SECTION_PAGEOUT_CONTEXT*)Context;
if (Process)
{
- MmLockAddressSpace(&Process->AddressSpace);
+ MmLockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
}
MmDeleteVirtualMapping(Process,
@@ -1362,7 +1362,7 @@
}
if (Process)
{
- MmUnlockAddressSpace(&Process->AddressSpace);
+ MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
}
if (PageOutContext->Private)
@@ -3676,7 +3676,7 @@
return(Status);
}
- AddressSpace = &Process->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
Status = ObReferenceObjectByHandle(SectionHandle,
SECTION_MAP_READ,
@@ -3911,7 +3911,7 @@
ASSERT(Process);
- AddressSpace = &((PROS_EPROCESS)Process)->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot;
MmLockAddressSpace(AddressSpace);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
@@ -4432,7 +4432,7 @@
Section = (PROS_SECTION_OBJECT)SectionObject;
- AddressSpace = &((PROS_EPROCESS)Process)->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot;
AllocationType |= (Section->AllocationAttributes & SEC_NO_CHANGE);
Modified: trunk/reactos/ntoskrnl/mm/virtual.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/virtual.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/virtual.c (original)
+++ trunk/reactos/ntoskrnl/mm/virtual.c Fri May 19 00:10:44 2006
@@ -137,7 +137,7 @@
DPRINT("NtQueryVirtualMemory() = %x\n",Status);
return(Status);
}
- AddressSpace = &Process->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
}
else
{
@@ -393,7 +393,7 @@
PAGE_ROUND_DOWN(*BaseAddress);
*BaseAddress = (PVOID)PAGE_ROUND_DOWN(*BaseAddress);
- AddressSpace = &((PROS_EPROCESS)Process)->AddressSpace;
+ AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot;
MmLockAddressSpace(AddressSpace);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, *BaseAddress);
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/psmgr.c?rev=219…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/psmgr.c (original)
+++ trunk/reactos/ntoskrnl/ps/psmgr.c Fri May 19 00:10:44 2006
@@ -255,7 +255,7 @@
PspInheritQuota(PsInitialSystemProcess, NULL);
MmInitializeAddressSpace((PROS_EPROCESS)PsInitialSystemProcess,
- &((PROS_EPROCESS)PsInitialSystemProcess)->AddressSpace);
+ (PMADDRESS_SPACE)&((PROS_EPROCESS)PsInitialSystemProcess)->VadRoot);
((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent =
ExAllocatePoolWithTag(PagedPool, sizeof(KEVENT), TAG('P', 's',
'L', 'k'));