2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/mm/procsup.c
5 * PURPOSE: Memory functions related to Processes
7 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
10 /* INCLUDES *****************************************************************/
16 /* FUNCTIONS *****************************************************************/
20 MmCleanProcessAddressSpace(IN PEPROCESS Process
)
22 /* FIXME: Add part of MmDeleteProcessAddressSpace here */
27 MmDeleteProcessAddressSpace(PEPROCESS Process
)
30 PMEMORY_AREA MemoryArea
;
32 DPRINT("MmDeleteProcessAddressSpace(Process %x (%s))\n", Process
,
33 Process
->ImageFileName
);
35 MmLockAddressSpace(&Process
->Vm
);
37 while ((MemoryArea
= (PMEMORY_AREA
)Process
->Vm
.WorkingSetExpansionLinks
.Flink
) != NULL
)
39 switch (MemoryArea
->Type
)
41 case MEMORY_AREA_SECTION_VIEW
:
42 Address
= (PVOID
)MemoryArea
->StartingAddress
;
43 MmUnlockAddressSpace(&Process
->Vm
);
44 MmUnmapViewOfSection(Process
, Address
);
45 MmLockAddressSpace(&Process
->Vm
);
48 case MEMORY_AREA_VIRTUAL_MEMORY
:
49 MmFreeVirtualMemory(Process
, MemoryArea
);
52 case MEMORY_AREA_OWNED_BY_ARM3
:
53 MmFreeMemoryArea(&Process
->Vm
,
60 KeBugCheck(MEMORY_MANAGEMENT
);
64 Mmi386ReleaseMmInfo(Process
);
66 MmUnlockAddressSpace(&Process
->Vm
);
68 DPRINT("Finished MmReleaseMmInfo()\n");
69 return(STATUS_SUCCESS
);