Author: sir_richard Date: Tue Oct 19 17:00:12 2010 New Revision: 49204
URL: http://svn.reactos.org/svn/reactos?rev=49204&view=rev Log: [NTOS]: Implement the MAREA<->VAD hack for section VADs as well.
Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c?... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] Tue Oct 19 17:00:12 2010 @@ -133,8 +133,9 @@ } else { - /* This is a section VAD, this code doesn't happen yet */ - ASSERT(FALSE); + /* This is a section VAD. Store the MAREA here for now */ + DPRINT("Storing %p in %p\n", MemoryArea, Vad); + Vad->ControlArea->WaitingForDeletion = (PVOID)MemoryArea; } } } @@ -191,23 +192,25 @@ { /* We store the ReactOS MEMORY_AREA here */ MemoryArea = (PMEMORY_AREA)Vad->FirstPrototypePte; - if (MemoryArea) - { - /* Get the process */ - Process = CONTAINING_RECORD(Table, EPROCESS, VadRoot); - - /* We only create fake memory-areas for ARM3 VADs */ - ASSERT(MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3); - ASSERT(MemoryArea->Vad == NULL); + } + else + { + /* This is a section VAD. We store the ReactOS MEMORY_AREA here */ + MemoryArea = (PMEMORY_AREA)Vad->ControlArea->WaitingForDeletion; + } + + /* Make sure one actually still exists */ + if (MemoryArea) + { + /* Get the process */ + Process = CONTAINING_RECORD(Table, EPROCESS, VadRoot);
- /* Free it */ - MmFreeMemoryArea(&Process->Vm, MemoryArea, NULL, NULL); - } - } - else - { - /* This is a section VAD, this code doesn't happen yet */ - ASSERT(FALSE); + /* We only create fake memory-areas for ARM3 VADs */ + ASSERT(MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3); + ASSERT(MemoryArea->Vad == NULL); + + /* Free it */ + MmFreeMemoryArea(&Process->Vm, MemoryArea, NULL, NULL); } } }