Commit 14918e29 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

kernel32/tests: Use '%d' to print GetLastError().

parent b84417ee
......@@ -433,7 +433,7 @@ static void check_result(const char *function, TEST *ptest, int initial_value, B
DWORD LastError = GetLastError();
DWORD CorrectError = (ptest->result ? 0xdeadbeef : ERROR_INVALID_PARAMETER);
ok(LastError == CorrectError, "%s(\"%s\"), 0x%02x: GetLastError() returned 0x%08x, should be 0x%08x\n", function, ptest->string, initial_value, LastError, CorrectError);
ok(LastError == CorrectError, "%s(\"%s\"), 0x%02x: GetLastError() returned %d, should be %d\n", function, ptest->string, initial_value, LastError, CorrectError);
ok(result == ptest->result, "%s(\"%s\"), 0x%02x: return value should be %s\n", function, ptest->string, initial_value, ptest->result ? "TRUE" : "FALSE");
}
......@@ -1092,7 +1092,7 @@ static void test_WaitRx(HANDLE hcom)
overlapped.hEvent = hComPortEvent;
ok((hComWriteEvent = CreateEvent( NULL, TRUE, FALSE, NULL )) !=0,
"CreateEvent res 0x%08x\n",
"CreateEvent res %d\n",
GetLastError());
ZeroMemory( &overlapped_w, sizeof(overlapped_w));
overlapped_w.hEvent = hComWriteEvent;
......@@ -1101,40 +1101,40 @@ static void test_WaitRx(HANDLE hcom)
{success_wait = WaitCommEvent(hcom, &evtmask, &overlapped);}
err_wait = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success_wait, err_wait, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success_wait, err_wait, evtmask);
ok(success_wait || err_wait == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
success_write= WriteFile(hcom, "X", 1, &written, &overlapped_w);
err_write = GetLastError();
ok(success_write || err_write == ERROR_IO_PENDING,
"overlapped WriteFile failed, err 0x%08x\n",
"overlapped WriteFile failed, err %d\n",
err_write);
if (!success_write && (err_write == ERROR_IO_PENDING)) {
success_write = WaitForSingleObjectEx(hComWriteEvent, TIMEOUT, TRUE);
err_write = GetLastError();
ok(success_write == WAIT_OBJECT_0, "WaitForSingleObjectEx, res 0x%08x, err 0x%08x\n",
ok(success_write == WAIT_OBJECT_0, "WaitForSingleObjectEx, res %d, err %d\n",
success_write, err_write);
}
Sleep(TIMEOUT >>1);
success_write = GetOverlappedResult(hcom, &overlapped_w, &written, FALSE);
err_write = GetLastError();
trace("Write after Wait res 0x%08x err 0x%08x\n",success_write, err_write);
ok(success_write && written ==1, "Write after Wait res 0x%08x err 0x%08x\n",
trace("Write after Wait res 0x%08x err %d\n",success_write, err_write);
ok(success_write && written ==1, "Write after Wait res 0x%08x err %d\n",
success_write, err_write);
if (!success_wait && (err_wait == ERROR_IO_PENDING)) {
success_wait = WaitForSingleObjectEx(hComPortEvent, TIMEOUT, TRUE);
err_wait = GetLastError();
ok(success_wait == WAIT_OBJECT_0, "wait hComPortEvent, res 0x%08x, err 0x%08x\n",
ok(success_wait == WAIT_OBJECT_0, "wait hComPortEvent, res 0x%08x, err %d\n",
success_wait, err_wait);
}
success_wait = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err_wait = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success_wait, err_wait, evtmask, after-before, after1-before);
ok(evtmask & EV_RXCHAR, "Detect EV_RXCHAR: 0x%08x, expected 0x%08x\n",
......@@ -1164,7 +1164,7 @@ static DWORD CALLBACK toggle_ctlLine(LPVOID arg)
trace("toggle_ctline done\n");
success = WaitForSingleObjectEx(hComPortEvent, TIMEOUT, TRUE);
err = GetLastError();
trace("toggle_ctline WaitForSingleObjectEx res 0x%08x err 0x%08x\n",
trace("toggle_ctline WaitForSingleObjectEx res 0x%08x err %d\n",
success, err);
return 0;
}
......@@ -1218,7 +1218,7 @@ static void test_WaitCts(HANDLE hcom)
err = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success, err, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask);
ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING))
......@@ -1227,7 +1227,7 @@ static void test_WaitCts(HANDLE hcom)
success = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success, err, evtmask, after-before, after1-before);
ok(evtmask & EV_CTS, "Failed to detect EV_CTS: 0x%08x, expected 0x%08x\n",
......@@ -1306,7 +1306,7 @@ static void test_AbortWaitCts(HANDLE hcom)
err = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success, err, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask);
ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING))
......@@ -1315,7 +1315,7 @@ static void test_AbortWaitCts(HANDLE hcom)
success = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success, err, evtmask, after-before, after1-before);
ok(evtmask == 0, "Incorect EventMask 0x%08x returned on Wait aborted bu SetCommMask, expected 0x%08x\n",
......@@ -1369,7 +1369,7 @@ static void test_WaitDsr(HANDLE hcom)
err = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success, err, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask);
ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING))
......@@ -1378,7 +1378,7 @@ static void test_WaitDsr(HANDLE hcom)
success = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success, err, evtmask, after-before, after1-before);
ok(evtmask & EV_DSR, "Failed to detect EV_DSR: 0x%08x, expected 0x%08x\n",
......@@ -1442,7 +1442,7 @@ static void test_WaitRing(HANDLE hcom)
err = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success, err, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask);
ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING))
......@@ -1451,7 +1451,7 @@ static void test_WaitRing(HANDLE hcom)
success = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success, err, evtmask, after-before, after1-before);
ok(evtmask & EV_RING, "Failed to detect EV_RING: 0x%08x, expected 0x%08x\n",
......@@ -1514,7 +1514,7 @@ static void test_WaitDcd(HANDLE hcom)
err = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success, err, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask);
ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING))
......@@ -1523,7 +1523,7 @@ static void test_WaitDcd(HANDLE hcom)
success = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success, err, evtmask, after-before, after1-before);
ok(evtmask & EV_RLSD, "Failed to detect EV_RLSD: 0x%08x, expected 0x%08x\n",
......@@ -1594,17 +1594,17 @@ static void test_WaitBreak(HANDLE hcom)
err = GetLastError();
after = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x\n", success, err, evtmask);
trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask);
ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n");
trace("overlapped WriteCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING))
ok(WaitForSingleObjectEx(hComPortEvent, TIMEOUT, TRUE) == 0,
"wait hComPortEvent res 0x%08x\n", GetLastError());
"wait hComPortEvent res %d\n", GetLastError());
success = GetOverlappedResult(hcom, &overlapped, &written, FALSE);
err = GetLastError();
after1 = GetTickCount();
trace("Success 0x%08x err 0x%08x evtmask 0x%08x diff1 %d, diff2 %d\n",
trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n",
success, err, evtmask, after-before, after1-before);
ok(evtmask & EV_BREAK, "Failed to detect EV_BREAK: 0x%08x, expected 0x%08x\n",
......
......@@ -109,11 +109,11 @@ static void testLoadLibraryA(void)
SetLastError(0xdeadbeef);
hModule = LoadLibraryA("kernel32.dll");
ok( hModule != NULL, "kernel32.dll should be loadable\n");
ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %08x\n", GetLastError());
ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError());
fp = GetProcAddress(hModule, "CreateFileA");
ok( fp != NULL, "CreateFileA should be there\n");
ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %08x\n", GetLastError());
ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError());
SetLastError(0xdeadbeef);
hModule1 = LoadLibraryA("kernel32 ");
......@@ -121,7 +121,7 @@ static void testLoadLibraryA(void)
if (GetLastError() != ERROR_DLL_NOT_FOUND)
{
ok( hModule1 != NULL, "\"kernel32 \" should be loadable\n");
ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %08x\n", GetLastError());
ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError());
ok( hModule == hModule1, "Loaded wrong module\n");
FreeLibrary(hModule1);
}
......@@ -175,7 +175,7 @@ static void testNestedLoadLibraryA(void)
ok(FreeLibrary(hModule3), "FreeLibrary() failed\n");
ok(FreeLibrary(hModule2), "FreeLibrary() failed\n");
ok(FreeLibrary(hModule1), "FreeLibrary() failed\n");
ok(GetModuleHandle(dllname) == NULL, "%s was not fully unloaded", dllname);
ok(GetModuleHandle(dllname) == NULL, "%s was not fully unloaded\n", dllname);
/* Try to load the dll again, if refcounting is ok, this should work */
hModule1 = LoadLibraryA(path1);
......@@ -193,7 +193,7 @@ static void testLoadLibraryA_Wrong(void)
hModule = LoadLibraryA("non_ex_pv.dll");
ok( !hModule, "non_ex_pv.dll should be not loadable\n");
ok( GetLastError() == ERROR_MOD_NOT_FOUND || GetLastError() == ERROR_DLL_NOT_FOUND,
"Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND (win9x), got %08x\n", GetLastError());
"Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND (win9x), got %d\n", GetLastError());
/* Just in case */
FreeLibrary(hModule);
......@@ -207,13 +207,13 @@ static void testGetProcAddress_Wrong(void)
fp = GetProcAddress(NULL, "non_ex_call");
ok( !fp, "non_ex_call should not be found\n");
ok( GetLastError() == ERROR_PROC_NOT_FOUND || GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_PROC_NOT_FOUND or ERROR_INVALID_HANDLE(win9x), got %08x\n", GetLastError());
"Expected ERROR_PROC_NOT_FOUND or ERROR_INVALID_HANDLE(win9x), got %d\n", GetLastError());
SetLastError(0xdeadbeef);
fp = GetProcAddress((HMODULE)0xdeadbeef, "non_ex_call");
ok( !fp, "non_ex_call should not be found\n");
ok( GetLastError() == ERROR_MOD_NOT_FOUND || GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_HANDLE(win9x), got %08x\n", GetLastError());
"Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_HANDLE(win9x), got %d\n", GetLastError());
}
START_TEST(module)
......
......@@ -942,13 +942,13 @@ static void test_GetLongPathNameW(void)
SetLastError(0xdeadbeef);
length = pGetLongPathNameW(NULL,NULL,0);
ok(0==length,"GetLongPathNameW returned %d but expected 0\n",length);
ok(GetLastError()==ERROR_INVALID_PARAMETER,"GetLastError returned %x but expected ERROR_INVALID_PARAMETER\n",GetLastError());
ok(GetLastError()==ERROR_INVALID_PARAMETER,"GetLastError returned %d but expected ERROR_INVALID_PARAMETER\n",GetLastError());
SetLastError(0xdeadbeef);
empty[0]=0;
length = pGetLongPathNameW(empty,NULL,0);
ok(0==length,"GetLongPathNameW returned %d but expected 0\n",length);
ok(GetLastError()==ERROR_PATH_NOT_FOUND,"GetLastError returned %x but expected ERROR_PATH_NOT_FOUND\n",GetLastError());
ok(GetLastError()==ERROR_PATH_NOT_FOUND,"GetLastError returned %d but expected ERROR_PATH_NOT_FOUND\n",GetLastError());
}
}
......@@ -961,7 +961,7 @@ static void test_GetSystemDirectory(void)
SetLastError(0xdeadbeef);
res = GetSystemDirectory(NULL, 0);
/* res includes the terminating Zero */
ok(res > 0, "returned %d with 0x%x (expected '>0')\n", res, GetLastError());
ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError());
total = res;
#if 0
......@@ -974,7 +974,7 @@ static void test_GetSystemDirectory(void)
/* 95+NT: total (includes the terminating Zero)
98+ME: 0 with ERROR_INVALID_PARAMETER */
ok( (res == total) || (!res && (GetLastError() == ERROR_INVALID_PARAMETER)),
"returned %d with 0x%x (expected '%d' or: '0' with "
"returned %d with %d (expected '%d' or: '0' with "
"ERROR_INVALID_PARAMETER)\n", res, GetLastError(), total);
if (total > MAX_PATH) return;
......@@ -984,7 +984,7 @@ static void test_GetSystemDirectory(void)
res = GetSystemDirectory(buffer, total);
/* res does not include the terminating Zero */
ok( (res == (total-1)) && (buffer[0]),
"returned %d with 0x%x and '%s' (expected '%d' and a string)\n",
"returned %d with %d and '%s' (expected '%d' and a string)\n",
res, GetLastError(), buffer, total-1);
buffer[0] = '\0';
......@@ -992,7 +992,7 @@ static void test_GetSystemDirectory(void)
res = GetSystemDirectory(buffer, total + 1);
/* res does not include the terminating Zero */
ok( (res == (total-1)) && (buffer[0]),
"returned %d with 0x%x and '%s' (expected '%d' and a string)\n",
"returned %d with %d and '%s' (expected '%d' and a string)\n",
res, GetLastError(), buffer, total-1);
memset(buffer, '#', total + 1);
......@@ -1000,7 +1000,7 @@ static void test_GetSystemDirectory(void)
SetLastError(0xdeadbeef);
res = GetSystemDirectory(buffer, total-1);
/* res includes the terminating Zero) */
ok( res == total, "returned %d with 0x%x and '%s' (expected '%d')\n",
ok( res == total, "returned %d with %d and '%s' (expected '%d')\n",
res, GetLastError(), buffer, total);
memset(buffer, '#', total + 1);
......@@ -1008,7 +1008,7 @@ static void test_GetSystemDirectory(void)
SetLastError(0xdeadbeef);
res = GetSystemDirectory(buffer, total-2);
/* res includes the terminating Zero) */
ok( res == total, "returned %d with 0x%x and '%s' (expected '%d')\n",
ok( res == total, "returned %d with %d and '%s' (expected '%d')\n",
res, GetLastError(), buffer, total);
}
......@@ -1021,7 +1021,7 @@ static void test_GetWindowsDirectory(void)
SetLastError(0xdeadbeef);
res = GetWindowsDirectory(NULL, 0);
/* res includes the terminating Zero */
ok(res > 0, "returned %d with 0x%x (expected '>0')\n", res, GetLastError());
ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError());
total = res;
#if 0
......@@ -1034,7 +1034,7 @@ static void test_GetWindowsDirectory(void)
/* 95+NT: total (includes the terminating Zero)
98+ME: 0 with ERROR_INVALID_PARAMETER */
ok( (res == total) || (!res && (GetLastError() == ERROR_INVALID_PARAMETER)),
"returned %d with 0x%x (expected '%d' or: '0' with "
"returned %d with %d (expected '%d' or: '0' with "
"ERROR_INVALID_PARAMETER)\n", res, GetLastError(), total);
if (total > MAX_PATH) return;
......@@ -1044,7 +1044,7 @@ static void test_GetWindowsDirectory(void)
res = GetWindowsDirectory(buffer, total);
/* res does not include the terminating Zero */
ok( (res == (total-1)) && (buffer[0]),
"returned %d with 0x%x and '%s' (expected '%d' and a string)\n",
"returned %d with %d and '%s' (expected '%d' and a string)\n",
res, GetLastError(), buffer, total-1);
buffer[0] = '\0';
......@@ -1052,7 +1052,7 @@ static void test_GetWindowsDirectory(void)
res = GetWindowsDirectory(buffer, total + 1);
/* res does not include the terminating Zero */
ok( (res == (total-1)) && (buffer[0]),
"returned %d with 0x%x and '%s' (expected '%d' and a string)\n",
"returned %d with %d and '%s' (expected '%d' and a string)\n",
res, GetLastError(), buffer, total-1);
memset(buffer, '#', total + 1);
......@@ -1060,7 +1060,7 @@ static void test_GetWindowsDirectory(void)
SetLastError(0xdeadbeef);
res = GetWindowsDirectory(buffer, total-1);
/* res includes the terminating Zero) */
ok( res == total, "returned %d with 0x%x and '%s' (expected '%d')\n",
ok( res == total, "returned %d with %d and '%s' (expected '%d')\n",
res, GetLastError(), buffer, total);
memset(buffer, '#', total + 1);
......@@ -1068,7 +1068,7 @@ static void test_GetWindowsDirectory(void)
SetLastError(0xdeadbeef);
res = GetWindowsDirectory(buffer, total-2);
/* res includes the terminating Zero) */
ok( res == total, "returned %d with 0x%x and '%s' (expected '%d')\n",
ok( res == total, "returned %d with %d and '%s' (expected '%d')\n",
res, GetLastError(), buffer, total);
}
......
......@@ -91,10 +91,10 @@ static void test_CreateNamedPipe(int pipemode)
/* lpSecurityAttrib */ NULL);
ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
ok(WaitNamedPipeA(PIPENAME, 2000), "WaitNamedPipe failed (%08x)\n", GetLastError());
ok(WaitNamedPipeA(PIPENAME, 2000), "WaitNamedPipe failed (%d)\n", GetLastError());
hFile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed (%08x)\n", GetLastError());
ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError());
/* don't try to do i/o if one side couldn't be opened, as it hangs */
if (hFile != INVALID_HANDLE_VALUE) {
......
......@@ -184,7 +184,7 @@ static void test_FileTimeToSystemTime(void)
ft.dwLowDateTime = 0;
ret = FileTimeToSystemTime(&ft, &st);
ok( ret,
"FileTimeToSystemTime() failed with Error 0x%08x\n",GetLastError());
"FileTimeToSystemTime() failed with Error %d\n",GetLastError());
ok(((st.wYear == 1601) && (st.wMonth == 1) && (st.wDay == 1) &&
(st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 0) &&
(st.wMilliseconds == 0)),
......@@ -194,7 +194,7 @@ static void test_FileTimeToSystemTime(void)
ft.dwLowDateTime = (UINT)time;
ret = FileTimeToSystemTime(&ft, &st);
ok( ret,
"FileTimeToSystemTime() failed with Error 0x%08x\n",GetLastError());
"FileTimeToSystemTime() failed with Error %d\n",GetLastError());
ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) &&
(st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) &&
(st.wMilliseconds == 0)),
......@@ -221,7 +221,7 @@ static void test_FileTimeToLocalFileTime(void)
ft.dwLowDateTime = (UINT)time;
ret = FileTimeToLocalFileTime(&ft, &lft);
ok( ret,
"FileTimeToLocalFileTime() failed with Error 0x%08x\n",GetLastError());
"FileTimeToLocalFileTime() failed with Error %d\n",GetLastError());
FileTimeToSystemTime(&lft, &st);
ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) &&
(st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) &&
......@@ -235,7 +235,7 @@ static void test_FileTimeToLocalFileTime(void)
ok(res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
ret = FileTimeToLocalFileTime(&ft, &lft);
ok( ret,
"FileTimeToLocalFileTime() failed with Error 0x%08x\n",GetLastError());
"FileTimeToLocalFileTime() failed with Error %d\n",GetLastError());
FileTimeToSystemTime(&lft, &st);
ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) &&
(st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) &&
......
......@@ -281,7 +281,7 @@ static void test_MapViewOfFile(void)
/* this fails on win9x but succeeds on NT */
ptr = MapViewOfFile( mapping, FILE_MAP_COPY, 0, 0, 4096 );
if (ptr) UnmapViewOfFile( ptr );
else ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %x\n", GetLastError() );
else ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %d\n", GetLastError() );
ptr = MapViewOfFile( mapping, 0, 0, 0, 4096 );
ok( ptr != NULL, "MapViewOfFile 0 failed\n" );
......@@ -304,7 +304,7 @@ static void test_MapViewOfFile(void)
/* this fails on win9x but succeeds on NT */
ptr = MapViewOfFile( mapping, FILE_MAP_COPY, 0, 0, 4096 );
if (ptr) UnmapViewOfFile( ptr );
else ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %x\n", GetLastError() );
else ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %d\n", GetLastError() );
ptr = MapViewOfFile( mapping, 0, 0, 0, 4096 );
ok( ptr != NULL, "MapViewOfFile 0 failed\n" );
......@@ -313,7 +313,7 @@ static void test_MapViewOfFile(void)
ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 4096 );
ok( !ptr, "MapViewOfFile FILE_MAP_WRITE succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %x\n", GetLastError() );
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() );
CloseHandle( mapping );
/* copy-on-write mapping */
......@@ -336,14 +336,14 @@ static void test_MapViewOfFile(void)
ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 4096 );
ok( !ptr, "MapViewOfFile FILE_MAP_WRITE succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %x\n", GetLastError() );
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() );
CloseHandle( mapping );
/* no access mapping */
mapping = CreateFileMappingA( file, NULL, PAGE_NOACCESS, 0, 4096, NULL );
/* fails on NT but succeeds on win9x */
if (!mapping) ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %x\n", GetLastError() );
if (!mapping) ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %d\n", GetLastError() );
else
{
ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 );
......@@ -352,7 +352,7 @@ static void test_MapViewOfFile(void)
ptr = MapViewOfFile( mapping, FILE_MAP_COPY, 0, 0, 4096 );
ok( !ptr, "MapViewOfFile FILE_MAP_COPY succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %x\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %d\n", GetLastError() );
ptr = MapViewOfFile( mapping, 0, 0, 0, 4096 );
ok( ptr != NULL, "MapViewOfFile 0 failed\n" );
......@@ -360,7 +360,7 @@ static void test_MapViewOfFile(void)
ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 4096 );
ok( !ptr, "MapViewOfFile FILE_MAP_WRITE succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %x\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %d\n", GetLastError() );
CloseHandle( mapping );
}
......@@ -375,7 +375,7 @@ static void test_MapViewOfFile(void)
mapping = CreateFileMappingA( file, NULL, PAGE_READWRITE, 0, 4096, NULL );
ok( !mapping, "CreateFileMapping PAGE_READWRITE succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %x\n", GetLastError() );
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() );
mapping = CreateFileMappingA( file, NULL, PAGE_WRITECOPY, 0, 4096, NULL );
ok( mapping != 0, "CreateFileMapping PAGE_WRITECOPY failed\n" );
......@@ -394,17 +394,17 @@ static void test_MapViewOfFile(void)
mapping = CreateFileMappingA( file, NULL, PAGE_READWRITE, 0, 4096, NULL );
ok( !mapping, "CreateFileMapping PAGE_READWRITE succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %x\n", GetLastError() );
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() );
mapping = CreateFileMappingA( file, NULL, PAGE_WRITECOPY, 0, 4096, NULL );
ok( !mapping, "CreateFileMapping PAGE_WRITECOPY succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %x\n", GetLastError() );
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() );
mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 4096, NULL );
ok( !mapping, "CreateFileMapping PAGE_READONLY succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %x\n", GetLastError() );
GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() );
CloseHandle( file );
......
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