Commit f94755f7 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

kernel32/tests: Fix flags passed to VirtualFree in multiple tests.

parent 446067b3
...@@ -3104,7 +3104,7 @@ static void test_read_write(void) ...@@ -3104,7 +3104,7 @@ static void test_read_write(void)
"wrong error %u\n", GetLastError() ); "wrong error %u\n", GetLastError() );
ok( bytes == 0, "read %x bytes\n", bytes ); ok( bytes == 0, "read %x bytes\n", bytes );
VirtualFree( mem, 0, MEM_FREE ); VirtualFree( mem, 0, MEM_RELEASE );
ret = CloseHandle(hFile); ret = CloseHandle(hFile);
ok( ret, "CloseHandle: error %d\n", GetLastError()); ok( ret, "CloseHandle: error %d\n", GetLastError());
......
...@@ -147,8 +147,8 @@ static void test_VirtualAllocEx(void) ...@@ -147,8 +147,8 @@ static void test_VirtualAllocEx(void)
b = pVirtualFreeEx(hProcess, addr1, 0, MEM_RELEASE); b = pVirtualFreeEx(hProcess, addr1, 0, MEM_RELEASE);
ok(b != 0, "VirtualFreeEx, error %u\n", GetLastError()); ok(b != 0, "VirtualFreeEx, error %u\n", GetLastError());
VirtualFree( src, 0, MEM_FREE ); VirtualFree( src, 0, MEM_RELEASE );
VirtualFree( dst, 0, MEM_FREE ); VirtualFree( dst, 0, MEM_RELEASE );
/* /*
* The following tests parallel those in test_VirtualAlloc() * The following tests parallel those in test_VirtualAlloc()
...@@ -1755,11 +1755,11 @@ static void test_write_watch(void) ...@@ -1755,11 +1755,11 @@ static void test_write_watch(void)
ok( !ret, "ResetWriteWatch failed %u\n", ret ); ok( !ret, "ResetWriteWatch failed %u\n", ret );
} }
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_READWRITE ); base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_READWRITE );
ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() );
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
base = VirtualAlloc( 0, size, MEM_WRITE_WATCH, PAGE_READWRITE ); base = VirtualAlloc( 0, size, MEM_WRITE_WATCH, PAGE_READWRITE );
ok( !base, "VirtualAlloc succeeded\n" ); ok( !base, "VirtualAlloc succeeded\n" );
...@@ -1803,7 +1803,7 @@ static void test_write_watch(void) ...@@ -1803,7 +1803,7 @@ static void test_write_watch(void)
"wrong count %lu\n", count ); "wrong count %lu\n", count );
if (count) ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); if (count) ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] );
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
} }
#ifdef __i386__ #ifdef __i386__
...@@ -1948,7 +1948,7 @@ static void test_guard_page(void) ...@@ -1948,7 +1948,7 @@ static void test_guard_page(void)
ok( success, "VirtualUnlock failed %u\n", GetLastError() ); ok( success, "VirtualUnlock failed %u\n", GetLastError() );
} }
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
/* combined guard page / write watch tests */ /* combined guard page / write watch tests */
if (!pGetWriteWatch || !pResetWriteWatch) if (!pGetWriteWatch || !pResetWriteWatch)
...@@ -2054,7 +2054,7 @@ static void test_guard_page(void) ...@@ -2054,7 +2054,7 @@ static void test_guard_page(void)
todo_wine todo_wine
ok( results[0] == base || broken(results[0] == (void *)0xdeadbeef) /* Windows 8 */, "wrong result %p\n", results[0] ); ok( results[0] == base || broken(results[0] == (void *)0xdeadbeef) /* Windows 8 */, "wrong result %p\n", results[0] );
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
} }
static DWORD WINAPI stack_commit_func( void *arg ) static DWORD WINAPI stack_commit_func( void *arg )
...@@ -2128,8 +2128,8 @@ static void test_stack_commit(void) ...@@ -2128,8 +2128,8 @@ static void test_stack_commit(void)
pNtCurrentTeb()->Tib.StackBase = old_stack_base; pNtCurrentTeb()->Tib.StackBase = old_stack_base;
pNtCurrentTeb()->Tib.StackLimit = old_stack_limit; pNtCurrentTeb()->Tib.StackLimit = old_stack_limit;
VirtualFree( new_stack, 0, MEM_FREE ); VirtualFree( new_stack, 0, MEM_RELEASE );
VirtualFree( call_on_stack, 0, MEM_FREE ); VirtualFree( call_on_stack, 0, MEM_RELEASE );
} }
DWORD num_execute_fault_calls; DWORD num_execute_fault_calls;
...@@ -2564,7 +2564,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) ...@@ -2564,7 +2564,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
success = UnregisterClassA( cls_name, GetModuleHandleA(0) ); success = UnregisterClassA( cls_name, GetModuleHandleA(0) );
ok( success, "UnregisterClass failed %u\n", GetLastError() ); ok( success, "UnregisterClass failed %u\n", GetLastError() );
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
/* Repeat the tests from above with MEM_WRITE_WATCH protected memory. */ /* Repeat the tests from above with MEM_WRITE_WATCH protected memory. */
...@@ -2753,7 +2753,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) ...@@ -2753,7 +2753,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
success = UnregisterClassA( cls_name, GetModuleHandleA(0) ); success = UnregisterClassA( cls_name, GetModuleHandleA(0) );
ok( success, "UnregisterClass failed %u\n", GetLastError() ); ok( success, "UnregisterClass failed %u\n", GetLastError() );
VirtualFree( base, 0, MEM_FREE ); VirtualFree( base, 0, MEM_RELEASE );
out: out:
if (restore_flags) if (restore_flags)
...@@ -2943,7 +2943,7 @@ static void test_VirtualProtect(void) ...@@ -2943,7 +2943,7 @@ static void test_VirtualProtect(void)
exec_prot = 1 << (i + 4); exec_prot = 1 << (i + 4);
} }
VirtualFree(base, 0, MEM_FREE); VirtualFree(base, 0, MEM_RELEASE);
} }
static BOOL is_mem_writable(DWORD prot) static BOOL is_mem_writable(DWORD prot)
...@@ -3044,7 +3044,7 @@ static void test_VirtualAlloc_protection(void) ...@@ -3044,7 +3044,7 @@ static void test_VirtualAlloc_protection(void)
ptr = VirtualAlloc(base, si.dwPageSize, MEM_COMMIT, td[i].prot); ptr = VirtualAlloc(base, si.dwPageSize, MEM_COMMIT, td[i].prot);
ok(ptr == base, "%d: VirtualAlloc failed %d\n", i, GetLastError()); ok(ptr == base, "%d: VirtualAlloc failed %d\n", i, GetLastError());
VirtualFree(base, 0, MEM_FREE); VirtualFree(base, 0, MEM_RELEASE);
} }
else else
{ {
......
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