From 51fe71aec32864ac909dce4315d3ac98c5af521b Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Mon, 30 Jan 2012 17:19:14 +0000 Subject: [PATCH] [NTOSKRNL]: Keep doing the old region/swap work incorrectly, but at least return a correct size. Let's see if this fixes it. svn path=/trunk/; revision=55330 --- reactos/ntoskrnl/mm/anonmem.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 782cc30f366..3b10e4c134c 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -874,14 +874,11 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, return(Status); } -#if 0 MemoryAreaLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress; -#else ULONG_PTR EndingAddress; EndingAddress = ((ULONG_PTR)MemoryArea->StartingAddress + RegionSize - 1) | (PAGE_SIZE - 1); - MemoryAreaLength = (ULONG_PTR)EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress + 1; -#endif + RegionSize = (ULONG_PTR)EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress + 1; MmInitializeRegion(&MemoryArea->Data.VirtualMemoryData.RegionListHead, MemoryAreaLength, Type, Protect); @@ -898,7 +895,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process); *UBaseAddress = BaseAddress; - *URegionSize = MemoryAreaLength; + *URegionSize = RegionSize; DPRINT("*UBaseAddress %x *URegionSize %x\n", BaseAddress, RegionSize); return(STATUS_SUCCESS);