From: Tim Clem tclem@codeweavers.com
AllocationBase + RegionSize should not exceed the highest WoW user address. --- dlls/wow64/virtual.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index c34f602b2e0..a2056fc05e4 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -449,6 +449,13 @@ NTSTATUS WINAPI wow64_NtQueryVirtualMemory( UINT *args ) info32->CommitSize = info.CommitSize; info32->PartitionId = info.PartitionId; info32->NodePreference = info.NodePreference; + + if ((ULONG_PTR)info.AllocationBase + info.RegionSize > highest_user_address) + { + info32->RegionSize = highest_user_address - (ULONG_PTR)info.AllocationBase; + TRACE( "region %p-%p ends past the WoW address limit %p; reporting its size as 0x%lx\n", + info.AllocationBase, (char *)info.AllocationBase + info.RegionSize, (void *)highest_user_address, (unsigned long)info32->RegionSize ); + } } } res_len = sizeof(MEMORY_REGION_INFORMATION32);