From c02e2cb416e6a01d9c24c2541d86290e2cc593c6 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Fri, 8 May 2009 07:13:41 +0000 Subject: [PATCH] - NtFreeVirtualMemory: Pass RegionListHead from SectionData vice VirtualMemoryData to MmAlterRegion for MemoryArea->Type of Section view. Fixes MapViewOfFile tests for kernel32_winetests. More investigation is needed on whether this function should even succeed on FileMapping Objects. svn path=/trunk/; revision=40833 --- reactos/ntoskrnl/mm/anonmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index c6fa21789ed..1c4f1eb4e93 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -1003,7 +1003,9 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle, Status = MmAlterRegion(AddressSpace, MemoryArea->StartingAddress, - &MemoryArea->Data.VirtualMemoryData.RegionListHead, + (MemoryArea->Type == MEMORY_AREA_SECTION_VIEW) ? + &MemoryArea->Data.SectionData.RegionListHead : + &MemoryArea->Data.VirtualMemoryData.RegionListHead, BaseAddress, RegionSize, MEM_RESERVE,