diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c index b08174f3520..895a9ab7949 100644 --- a/dlls/kernel32/tests/comm.c +++ b/dlls/kernel32/tests/comm.c @@ -1115,9 +1115,8 @@ static void test_WaitRx(HANDLE hcom) ZeroMemory( &overlapped, sizeof(overlapped)); overlapped.hEvent = hComPortEvent; - ok((hComWriteEvent = CreateEvent( NULL, TRUE, FALSE, NULL )) !=0, - "CreateEvent res %d\n", - GetLastError()); + hComWriteEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + ok(hComWriteEvent != NULL, "CreateEvent res %d\n", GetLastError()); ZeroMemory( &overlapped_w, sizeof(overlapped_w)); overlapped_w.hEvent = hComWriteEvent; diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index df2ab3738c5..3ed3f66e6c7 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -2393,7 +2393,8 @@ static void test_read_write(void) user_apc_ran = FALSE; if (pQueueUserAPC) { trace("Queueing an user APC\n"); /* verify the file is non alerable */ - ok(pQueueUserAPC(&user_apc, GetCurrentThread(), 0), "QueueUserAPC failed: %d\n", GetLastError()); + ret = pQueueUserAPC(&user_apc, GetCurrentThread(), 0); + ok(ret, "QueueUserAPC failed: %d\n", GetLastError()); } SetLastError(12345678); diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 4b3566a1f5c..4fc673967b3 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -480,7 +480,8 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg) user_apc_ran = FALSE; if (i == 0 && pQueueUserAPC) { trace("Queueing an user APC\n"); /* verify the pipe is non alerable */ - ok(pQueueUserAPC(&user_apc, GetCurrentThread(), 0), "QueueUserAPC failed: %d\n", GetLastError()); + success = pQueueUserAPC(&user_apc, GetCurrentThread(), 0); + ok(success, "QueueUserAPC failed: %d\n", GetLastError()); } /* Wait for client to connect */ diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index 07b351cf7d8..44a7927541c 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -448,8 +448,8 @@ static void test_profile_delete_on_close(void) h = CreateFile(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); - ok( WriteFile( h, contents, sizeof contents - 1, &size, NULL ), - "Cannot write test file: %x\n", GetLastError() ); + res = WriteFile( h, contents, sizeof contents - 1, &size, NULL ); + ok( res, "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents - 1, "Test file: partial write\n"); SetLastError(0xdeadbeef); @@ -472,8 +472,8 @@ static void test_profile_refresh(void) h = CreateFile(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); - ok( WriteFile( h, contents1, sizeof contents1 - 1, &size, NULL ), - "Cannot write test file: %x\n", GetLastError() ); + res = WriteFile( h, contents1, sizeof contents1 - 1, &size, NULL ); + ok( res, "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents1 - 1, "Test file: partial write\n"); SetLastError(0xdeadbeef); @@ -488,8 +488,8 @@ static void test_profile_refresh(void) h = CreateFile(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); - ok( WriteFile( h, contents2, sizeof contents2 - 1, &size, NULL ), - "Cannot write test file: %x\n", GetLastError() ); + res = WriteFile( h, contents2, sizeof contents2 - 1, &size, NULL ); + ok( res, "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents2 - 1, "Test file: partial write\n"); SetLastError(0xdeadbeef); diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index cd5417c6fcd..a2a881f43db 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -598,12 +598,14 @@ static void test_MapViewOfFile(void) ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); if (!ptr) { + SIZE_T size; ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); SetLastError(0xdeadbeef); - ok( VirtualQuery( ptr, &info, sizeof(info) ) == sizeof(info), + size = VirtualQuery( ptr, &info, sizeof(info) ); + ok( size == sizeof(info), "VirtualQuery error %u\n", GetLastError() ); ok( info.BaseAddress == ptr, "%p != %p\n", info.BaseAddress, ptr ); ok( info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr ); @@ -623,12 +625,14 @@ static void test_MapViewOfFile(void) ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); if (!ptr) { + SIZE_T size; ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %u\n", GetLastError() ); SetLastError(0xdeadbeef); - ok( VirtualQuery( ptr, &info, sizeof(info) ) == sizeof(info), + size = VirtualQuery( ptr, &info, sizeof(info) ); + ok( size == sizeof(info), "VirtualQuery error %u\n", GetLastError() ); ok( info.BaseAddress == ptr, "%p != %p\n", info.BaseAddress, ptr ); ok( info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr );