- In success cases of NtAllocateVirtualMemory, return the real (page rounded!) base address and region size, not the possibly unaligned pointer and length which were passed to the function. These cases were hit when a region of memory was previously reserved, then a commit request came with unaligned base address and length, which match that previously reserved region after aligning.

svn path=/trunk/; revision=36427
This commit is contained in:
Aleksey Bragin 2008-09-23 12:41:02 +00:00
parent 55ea8c5583
commit 22c7de15e6

View file

@ -727,6 +727,15 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
MmUnlockAddressSpace(AddressSpace);
ObDereferenceObject(Process);
DPRINT("NtAllocateVirtualMemory() = %x\n",Status);
/* Give the caller rounded BaseAddress and area length */
if (NT_SUCCESS(Status))
{
*UBaseAddress = BaseAddress;
*URegionSize = RegionSize;
DPRINT("*UBaseAddress %x *URegionSize %x\n", BaseAddress, RegionSize);
}
return(Status);
}
else if (MemoryAreaLength >= RegionSize)
@ -749,6 +758,15 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
MmUnlockAddressSpace(AddressSpace);
ObDereferenceObject(Process);
DPRINT("NtAllocateVirtualMemory() = %x\n",Status);
/* Give the caller rounded BaseAddress and area length */
if (NT_SUCCESS(Status))
{
*UBaseAddress = BaseAddress;
*URegionSize = RegionSize;
DPRINT("*UBaseAddress %x *URegionSize %x\n", BaseAddress, RegionSize);
}
return(Status);
}
else