Commit f41ac64a authored by Alexandre Julliard's avatar Alexandre Julliard

wow64: Don't add MEM_RESERVE for invalid flags combinations.

parent d76f5b4a
...@@ -408,6 +408,20 @@ static void test_cross_process_notifications( HANDLE process, void *ptr ) ...@@ -408,6 +408,20 @@ static void test_cross_process_notifications( HANDLE process, void *ptr )
ok( !entry, "not at end of list\n" ); ok( !entry, "not at end of list\n" );
addr = NULL; addr = NULL;
size = 0x321;
status = NtAllocateVirtualMemory( process, &addr, 0, &size, 0, PAGE_EXECUTE_READ );
ok( status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemory failed %lx\n", status );
entry = pop_from_work_list( &list->work_list );
if (current_machine != IMAGE_FILE_MACHINE_ARM64)
{
entry = expect_cross_work_entry( list, entry, CrossProcessPreVirtualAlloc, addr, 0x321,
0, PAGE_EXECUTE_READ, 0, 0xcccccccc );
entry = expect_cross_work_entry( list, entry, CrossProcessPostVirtualAlloc, addr, 0x321,
0, PAGE_EXECUTE_READ, status, 0xcccccccc );
}
ok( !entry, "not at end of list\n" );
addr = NULL;
size = 0x4321; size = 0x4321;
status = NtAllocateVirtualMemory( process, &addr, 0, &size, MEM_RESERVE, PAGE_EXECUTE_READWRITE ); status = NtAllocateVirtualMemory( process, &addr, 0, &size, MEM_RESERVE, PAGE_EXECUTE_READWRITE );
ok( !status, "NtAllocateVirtualMemory failed %lx\n", status ); ok( !status, "NtAllocateVirtualMemory failed %lx\n", status );
......
...@@ -153,7 +153,7 @@ NTSTATUS WINAPI wow64_NtAllocateVirtualMemory( UINT *args ) ...@@ -153,7 +153,7 @@ NTSTATUS WINAPI wow64_NtAllocateVirtualMemory( UINT *args )
BOOL is_current = RtlIsCurrentProcess( process ); BOOL is_current = RtlIsCurrentProcess( process );
NTSTATUS status; NTSTATUS status;
if (!addr) type |= MEM_RESERVE; if (!addr && (type & MEM_COMMIT)) type |= MEM_RESERVE;
if (!is_current) if (!is_current)
send_cross_process_notification( process, CrossProcessPreVirtualAlloc, send_cross_process_notification( process, CrossProcessPreVirtualAlloc,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment