mirror of
https://github.com/reactos/reactos.git
synced 2025-07-13 10:14:13 +00:00
- 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:
parent
55ea8c5583
commit
22c7de15e6
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue