Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- include/commctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/commctrl.h b/include/commctrl.h index 944a9158371..b829e4498ea 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -476,8 +476,8 @@ typedef struct struct _IMAGELIST; typedef struct _IMAGELIST *HIMAGELIST;
-#define CLR_NONE 0xFFFFFFFF -#define CLR_DEFAULT 0xFF000000 +#define CLR_NONE __MSABI_LONG(0xFFFFFFFF) +#define CLR_DEFAULT __MSABI_LONG(0xFF000000) #define CLR_HILIGHT CLR_DEFAULT
#define ILC_MASK 0x00000001
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/comctl32/tests/Makefile.in | 1 dlls/comctl32/tests/animate.c | 4 - dlls/comctl32/tests/button.c | 196 ++++++++++++++++----------------- dlls/comctl32/tests/combo.c | 114 ++++++++++--------- dlls/comctl32/tests/datetime.c | 62 +++++----- dlls/comctl32/tests/dpa.c | 68 ++++++----- dlls/comctl32/tests/edit.c | 198 +++++++++++++++++---------------- dlls/comctl32/tests/header.c | 74 ++++++------ dlls/comctl32/tests/imagelist.c | 120 ++++++++++---------- dlls/comctl32/tests/listbox.c | 226 +++++++++++++++++++------------------- dlls/comctl32/tests/listview.c | 138 ++++++++++++----------- dlls/comctl32/tests/misc.c | 58 +++++----- dlls/comctl32/tests/monthcal.c | 40 +++---- dlls/comctl32/tests/mru.c | 28 ++--- dlls/comctl32/tests/msg.h | 16 +-- dlls/comctl32/tests/pager.c | 30 +++-- dlls/comctl32/tests/progress.c | 12 +- dlls/comctl32/tests/propsheet.c | 84 +++++++------- dlls/comctl32/tests/rebar.c | 20 ++- dlls/comctl32/tests/static.c | 4 - dlls/comctl32/tests/status.c | 13 ++ dlls/comctl32/tests/subclass.c | 2 dlls/comctl32/tests/syslink.c | 10 +- dlls/comctl32/tests/tab.c | 40 +++---- dlls/comctl32/tests/taskdialog.c | 16 +-- dlls/comctl32/tests/toolbar.c | 184 +++++++++++++++---------------- dlls/comctl32/tests/tooltips.c | 82 +++++++------- dlls/comctl32/tests/trackbar.c | 10 +- dlls/comctl32/tests/treeview.c | 58 +++++----- dlls/comctl32/tests/updown.c | 22 ++-- dlls/comctl32/tests/v6util.h | 4 - 31 files changed, 969 insertions(+), 965 deletions(-)
diff --git a/dlls/comctl32/tests/Makefile.in b/dlls/comctl32/tests/Makefile.in index 79d7485de73..4669efcf2b5 100644 --- a/dlls/comctl32/tests/Makefile.in +++ b/dlls/comctl32/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = comctl32.dll IMPORTS = ole32 user32 gdi32 advapi32
diff --git a/dlls/comctl32/tests/animate.c b/dlls/comctl32/tests/animate.c index 400de55b5eb..ad7e16ace65 100644 --- a/dlls/comctl32/tests/animate.c +++ b/dlls/comctl32/tests/animate.c @@ -136,13 +136,13 @@ static void test_play(void) res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(INVALID_AVI_INDEX)); err = GetLastError(); ok(res == 0, "Invalid video should have failed\n"); - ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %u\n", err); + ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %lu\n", err);
SetLastError(0xdeadbeef); res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1)); err = GetLastError(); ok(res == 0, "Play should have failed\n"); - ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %u\n", err); + ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", err); destroy_animate();
create_animate(0, 0); diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index f30e9f665e5..0443a36718b 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -67,7 +67,7 @@ static WCHAR* get_versioned_classname(const WCHAR *name) memset(&data, 0, sizeof(data)); data.cbSize = sizeof(data); ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data); - ok(ret, "Failed to find class redirection section, error %u\n", GetLastError()); + ok(ret, "Failed to find class redirection section, error %lu\n", GetLastError()); wnddata = (struct wndclass_redirect_data*)data.lpData; return (WCHAR*)((BYTE*)wnddata + wnddata->name_offset); } @@ -237,10 +237,10 @@ static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam }
ok_(__FILE__,test_cd.line)(!(cd->dwDrawStage & CDDS_ITEM), - "[%u] CDDS_ITEM is set\n", test_cd.button); + "[%lu] CDDS_ITEM is set\n", test_cd.button);
ok_(__FILE__,test_cd.line)(state == test_cd.state, - "[%u] expected uItemState %u, got %u\n", test_cd.button, + "[%lu] expected uItemState %u, got %u\n", test_cd.button, test_cd.state, state);
msg.message = message; @@ -265,7 +265,7 @@ static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam case CDDS_POSTERASE: case CDDS_POSTPAINT: ok_(__FILE__,test_cd.line)(cd->dwItemSpec == 0xdeadbeef, - "[%u] NMCUSTOMDRAW was not shared, stage %u\n", test_cd.button, msg.stage); + "[%lu] NMCUSTOMDRAW was not shared, stage %lu\n", test_cd.button, msg.stage); break; } return ret; @@ -278,9 +278,9 @@ static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam
GetClientRect(bcd->hdr.hwndFrom, &rc);
- ok(bcd->hdr.hwndFrom != NULL, "Received BCN_DROPDOWN with no hwnd attached, wParam %lu id %lu\n", + ok(bcd->hdr.hwndFrom != NULL, "Received BCN_DROPDOWN with no hwnd attached, wParam %Iu id %Iu\n", wParam, bcd->hdr.idFrom); - ok(bcd->hdr.idFrom == wParam, "[%u] Mismatch between wParam (%lu) and idFrom (%lu)\n", + ok(bcd->hdr.idFrom == wParam, "[%u] Mismatch between wParam (%Iu) and idFrom (%Iu)\n", button, wParam, bcd->hdr.idFrom); ok(EqualRect(&rc, &bcd->rcButton), "[%u] Wrong rcButton, expected %s got %s\n", button, wine_dbgstr_rect(&rc), wine_dbgstr_rect(&bcd->rcButton)); @@ -636,7 +636,7 @@ static HWND create_button(DWORD style, HWND parent) menuid = (HMENU)ID_BUTTON; } hwnd = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, parent, menuid, 0, NULL); - ok(hwnd != NULL, "failed to create a button, 0x%08x, %p\n", style, parent); + ok(hwnd != NULL, "failed to create a button, 0x%08lx, %p\n", style, parent); pSetWindowSubclass(hwnd, button_subclass_proc, 0, 0); return hwnd; } @@ -775,9 +775,9 @@ static void test_button_messages(void) style &= ~(WS_CHILD | BS_NOTIFY); /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */ if (button[i].style == BS_USERBUTTON) - ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %x\n", style); + ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %lx\n", style); else - ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style); + ok(style == button[i].style, "expected style %lx got %lx\n", button[i].style, style);
dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); if (button[i].style == BS_SPLITBUTTON || @@ -785,10 +785,10 @@ static void test_button_messages(void) button[i].style == BS_COMMANDLINK || button[i].style == BS_DEFCOMMANDLINK) { - ok(dlg_code == button[i].dlg_code || broken(dlg_code == DLGC_BUTTON) /* WinXP */, "%u: wrong dlg_code %08x\n", i, dlg_code); + ok(dlg_code == button[i].dlg_code || broken(dlg_code == DLGC_BUTTON) /* WinXP */, "%u: wrong dlg_code %08lx\n", i, dlg_code); } else - ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code); + ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08lx\n", i, dlg_code);
ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); @@ -828,10 +828,10 @@ static void test_button_messages(void) style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_VISIBLE | WS_CHILD | BS_NOTIFY); /* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */ - ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); - ok(state == 0, "expected state 0, got %04x\n", state); + ok(state == 0, "expected state 0, got %04lx\n", state);
cd_seq = (button[i].cd_setstate_type == cd_seq_empty) ? empty_cd_seq : pre_pre_cd_seq; flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -844,11 +844,11 @@ static void test_button_messages(void) check_cd_seq(cd_setstate_type, "BM_SETSTATE/TRUE");
state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); - ok(state == BST_PUSHED, "expected state 0x0004, got %04x\n", state); + ok(state == BST_PUSHED, "expected state 0x0004, got %04lx\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); - ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
flush_sequences(sequences, NUM_MSG_SEQUENCES); set_test_cd_state(0); @@ -860,14 +860,14 @@ static void test_button_messages(void) check_cd_seq(cd_setstate_type, "BM_SETSTATE/FALSE");
state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); - ok(state == 0, "expected state 0, got %04x\n", state); + ok(state == 0, "expected state 0, got %04lx\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); - ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); - ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state); + ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04lx\n", state);
cd_seq = (button[i].cd_setcheck_type == cd_seq_empty) ? empty_cd_seq : pre_pre_cd_seq; flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -888,11 +888,11 @@ static void test_button_messages(void) check_cd_seq(cd_setcheck_type, "BM_SETCHECK");
state = SendMessageA(hwnd, BM_GETCHECK, 0, 0); - ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state); + ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04lx\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); - ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
flush_sequences(sequences, NUM_MSG_SEQUENCES); set_test_cd_state(0); @@ -914,18 +914,18 @@ static void test_button_messages(void) button[i].style == BS_COMMANDLINK || button[i].style == BS_DEFCOMMANDLINK) { - ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04x\n", state); + ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04lx\n", state); } else - ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04x\n", state); + ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04lx\n", state);
style = GetWindowLongA(hwnd, GWL_STYLE); style &= ~(WS_CHILD | BS_NOTIFY | WS_VISIBLE); if (button[i].style == BS_RADIOBUTTON || button[i].style == BS_AUTORADIOBUTTON) - ok(style == (button[i].style | WS_TABSTOP), "expected style %04x | WS_TABSTOP got %04x\n", button[i].style, style); + ok(style == (button[i].style | WS_TABSTOP), "expected style %04lx | WS_TABSTOP got %04lx\n", button[i].style, style); else - ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style); + ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
/* Test that original font is not selected back after painting */ hfont = (HFONT)SendMessageA(hwnd, WM_GETFONT, 0, 0); @@ -1128,8 +1128,8 @@ static void test_note(void) ok(!ret, "Expect BCM_GETNOTE return false\n"); ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w)); - ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size); - ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n", + ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size); + ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_INVALID_PARAMETER, error);
/* Get note length when note is not set */ @@ -1141,7 +1141,7 @@ static void test_note(void) ret = SendMessageA(hwnd, BCM_SETNOTE, 0, (LPARAM)test_w); ok(ret, "Expect BCM_SETNOTE return true\n"); error = GetLastError(); - ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
SetLastError(0xdeadbeef); lstrcpyW(buffer_w, deadbeef_w); @@ -1150,9 +1150,9 @@ static void test_note(void) ok(ret, "Expect BCM_GETNOTE return true\n"); ok(!lstrcmpW(buffer_w, test_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(test_w), wine_dbgstr_w(buffer_w)); - ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size); + ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size); error = GetLastError(); - ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
ret = SendMessageA(hwnd, BCM_GETNOTELENGTH, 0, 0); ok(ret == ARRAY_SIZE(test_w) - 1, "Got: %d\n", ret); @@ -1165,9 +1165,9 @@ static void test_note(void) ok(!ret, "Expect BCM_GETNOTE return false\n"); ok(!lstrcmpW(buffer_w, tes_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(tes_w), wine_dbgstr_w(buffer_w)); - ok(size == ARRAY_SIZE(test_w), "Got: %d\n", size); + ok(size == ARRAY_SIZE(test_w), "Got: %ld\n", size); error = GetLastError(); - ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08x\n", + ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_INSUFFICIENT_BUFFER, error);
/* Set note with NULL buffer */ @@ -1175,7 +1175,7 @@ static void test_note(void) ret = SendMessageA(hwnd, BCM_SETNOTE, 0, 0); ok(ret, "Expect BCM_SETNOTE return false\n"); error = GetLastError(); - ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error);
/* Check that set note with NULL buffer make note empty */ SetLastError(0xdeadbeef); @@ -1184,9 +1184,9 @@ static void test_note(void) ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w); ok(ret, "Expect BCM_GETNOTE return true\n"); ok(!*buffer_w, "Expect note length 0\n"); - ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size); + ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size); error = GetLastError(); - ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error); ret = SendMessageA(hwnd, BCM_GETNOTELENGTH, 0, 0); ok(ret == 0, "Expect note length: %d, got: %d\n", 0, ret);
@@ -1195,9 +1195,9 @@ static void test_note(void) size = ARRAY_SIZE(buffer_w); ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, 0); ok(!ret, "Expect BCM_SETNOTE return false\n"); - ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size); + ok(size == ARRAY_SIZE(buffer_w), "Got: %ld\n", size); error = GetLastError(); - ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n", + ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_INVALID_PARAMETER, error);
/* Get note with NULL size */ @@ -1208,7 +1208,7 @@ static void test_note(void) ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w)); error = GetLastError(); - ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n", + ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_INVALID_PARAMETER, error);
/* Get note with zero size */ @@ -1219,9 +1219,9 @@ static void test_note(void) ok(!ret, "Expect BCM_GETNOTE return false\n"); ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w)); - ok(size == 1, "Got: %d\n", size); + ok(size == 1, "Got: %ld\n", size); error = GetLastError(); - ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08x\n", + ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_INSUFFICIENT_BUFFER, error);
DestroyWindow(hwnd); @@ -1235,7 +1235,7 @@ static void test_note(void) ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w); ok(!ret, "Expect BCM_GETNOTE return false\n"); error = GetLastError(); - ok(error == ERROR_NOT_SUPPORTED, "Expect last error: 0x%08x, got: 0x%08x\n", + ok(error == ERROR_NOT_SUPPORTED, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_NOT_SUPPORTED, error); DestroyWindow(hwnd); } @@ -1527,8 +1527,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_GLYPH | BCSIF_SIZE | BCSIF_STYLE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x36, "[%u] expected 0x36 default glyph, got 0x%p\n", button, info.himlGlyph); ok(info.uSplitStyle == BCSS_STRETCH, "[%u] expected 0x%08x default style, got 0x%08x\n", button, BCSS_STRETCH, info.uSplitStyle); - ok(info.size.cx == glyph_size, "[%u] expected %d default size.cx, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0 default size.cy, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size, "[%u] expected %d default size.cx, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0 default size.cy, got %ld\n", button, info.size.cy);
info.mask = BCSIF_SIZE; info.size.cx = glyph_size + 7; @@ -1539,8 +1539,8 @@ static void test_bcm_splitinfo(HWND hwnd) ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info); ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret); ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask); - ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %d\n", button, glyph_size + 7, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %ld\n", button, glyph_size + 7, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
/* Invalid size.cx resets it to default glyph size, while size.cy is stored */ info.size.cx = 0; @@ -1551,8 +1551,8 @@ static void test_bcm_splitinfo(HWND hwnd) ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info); ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret); ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask); - ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == -20, "[%u] expected -20, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == -20, "[%u] expected -20, got %ld\n", button, info.size.cy);
info.size.cx = -glyph_size - 7; info.size.cy = -10; @@ -1562,8 +1562,8 @@ static void test_bcm_splitinfo(HWND hwnd) ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info); ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret); ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask); - ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == -10, "[%u] expected -10, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == -10, "[%u] expected -10, got %ld\n", button, info.size.cy);
/* Set to a valid size other than glyph_size */ info.mask = BCSIF_SIZE; @@ -1575,8 +1575,8 @@ static void test_bcm_splitinfo(HWND hwnd) ret = SendMessageA(hwnd, BCM_GETSPLITINFO, 0, (LPARAM)&info); ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret); ok(info.mask == BCSIF_SIZE, "[%u] wrong mask, got %u\n", button, info.mask); - ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %d\n", button, glyph_size + 7, info.size.cx); - ok(info.size.cy == 11, "[%u] expected 11, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size + 7, "[%u] expected %d, got %ld\n", button, glyph_size + 7, info.size.cx); + ok(info.size.cy == 11, "[%u] expected 11, got %ld\n", button, info.size.cy);
/* Change the glyph, size.cx should be automatically adjusted and size.cy set to 0 */ dummy.mask = BCSIF_GLYPH; @@ -1588,8 +1588,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret); ok(info.mask == (BCSIF_GLYPH | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x35, "[%u] expected 0x35, got %p\n", button, info.himlGlyph); - ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
/* Unless the size is specified manually */ dummy.mask = BCSIF_GLYPH | BCSIF_SIZE; @@ -1602,8 +1602,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(ret == TRUE, "[%u] expected TRUE, got %d\n", button, ret); ok(info.mask == (BCSIF_GLYPH | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x34, "[%u] expected 0x34, got %p\n", button, info.himlGlyph); - ok(info.size.cx == glyph_size + 11, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == 7, "[%u] expected 7, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size + 11, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == 7, "[%u] expected 7, got %ld\n", button, info.size.cy);
/* Add the BCSS_IMAGE style manually with the wrong BCSIF_GLYPH mask, should treat it as invalid image */ info.mask = BCSIF_GLYPH | BCSIF_STYLE; @@ -1617,8 +1617,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_GLYPH | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x37, "[%u] expected 0x37, got %p\n", button, info.himlGlyph); ok(info.uSplitStyle == BCSS_IMAGE, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE, info.uSplitStyle); - ok(info.size.cx == border_w, "[%u] expected %d, got %d\n", button, border_w, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == border_w, "[%u] expected %d, got %ld\n", button, border_w, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
/* Change the size to prevent ambiguity */ dummy.mask = BCSIF_SIZE; @@ -1631,8 +1631,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_GLYPH | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x37, "[%u] expected 0x37, got %p\n", button, info.himlGlyph); ok(info.uSplitStyle == BCSS_IMAGE, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE, info.uSplitStyle); - ok(info.size.cx == glyph_size + 5, "[%u] expected %d, got %d\n", button, glyph_size + 5, info.size.cx); - ok(info.size.cy == 4, "[%u] expected 4, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size + 5, "[%u] expected %d, got %ld\n", button, glyph_size + 5, info.size.cx); + ok(info.size.cy == 4, "[%u] expected 4, got %ld\n", button, info.size.cy);
/* Now remove the BCSS_IMAGE style manually with the wrong BCSIF_IMAGE mask */ info.mask = BCSIF_IMAGE | BCSIF_STYLE; @@ -1646,8 +1646,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x35, "[%u] expected 0x35, got %p\n", button, info.himlGlyph); ok(info.uSplitStyle == BCSS_STRETCH, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_STRETCH, info.uSplitStyle); - ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
/* Add a proper valid image, the BCSS_IMAGE style should be set automatically */ img = pImageList_Create(42, 33, ILC_COLOR, 1, 1); @@ -1662,8 +1662,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == img, "[%u] expected %p, got %p\n", button, img, info.himlGlyph); ok(info.uSplitStyle == (BCSS_IMAGE | BCSS_STRETCH), "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE | BCSS_STRETCH, info.uSplitStyle); - ok(info.size.cx == 42 + border_w, "[%u] expected %d, got %d\n", button, 42 + border_w, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == 42 + border_w, "[%u] expected %d, got %ld\n", button, 42 + border_w, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy); pImageList_Destroy(img); dummy.mask = BCSIF_SIZE; dummy.size.cx = glyph_size + 5; @@ -1682,8 +1682,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_GLYPH | BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == (HIMAGELIST)0x37, "[%u] expected 0x37, got %p\n", button, info.himlGlyph); ok(info.uSplitStyle == BCSS_STRETCH, "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_STRETCH, info.uSplitStyle); - ok(info.size.cx == glyph_size, "[%u] expected %d, got %d\n", button, glyph_size, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == glyph_size, "[%u] expected %d, got %ld\n", button, glyph_size, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy);
/* Try a NULL image */ info.mask = BCSIF_IMAGE; @@ -1696,8 +1696,8 @@ static void test_bcm_splitinfo(HWND hwnd) ok(info.mask == (BCSIF_IMAGE | BCSIF_STYLE | BCSIF_SIZE), "[%u] wrong mask, got %u\n", button, info.mask); ok(info.himlGlyph == NULL, "[%u] expected NULL, got %p\n", button, info.himlGlyph); ok(info.uSplitStyle == (BCSS_IMAGE | BCSS_STRETCH), "[%u] expected 0x%08x style, got 0x%08x\n", button, BCSS_IMAGE | BCSS_STRETCH, info.uSplitStyle); - ok(info.size.cx == border_w, "[%u] expected %d, got %d\n", button, border_w, info.size.cx); - ok(info.size.cy == 0, "[%u] expected 0, got %d\n", button, info.size.cy); + ok(info.size.cx == border_w, "[%u] expected %d, got %ld\n", button, border_w, info.size.cx); + ok(info.size.cy == 0, "[%u] expected 0, got %ld\n", button, info.size.cy); }
static void test_button_data(void) @@ -1897,7 +1897,7 @@ static void test_state(void) { hwnd = create_button(type, NULL); state = SendMessageA(hwnd, BM_GETSTATE, 0, 0); - ok(state == BST_UNCHECKED, "Expect state 0x%08x, got 0x%08x\n", BST_UNCHECKED, state); + ok(state == BST_UNCHECKED, "Expect state 0x%08x, got 0x%08lx\n", BST_UNCHECKED, state); DestroyWindow(hwnd); } } @@ -2012,9 +2012,9 @@ static void test_bcm_get_ideal_size(void) ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); /* Ideal size contains text rect even show bitmap only */ ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight), - "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, + "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight)); - ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height); + ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height); DestroyWindow(hwnd);
/* Image alignments when button has bitmap and text*/ @@ -2033,13 +2033,13 @@ static void test_bcm_get_ideal_size(void) if (!(style & (BS_CENTER | BS_VCENTER)) || ((style & BS_CENTER) && (style & BS_CENTER) != BS_CENTER) || !(style & BS_VCENTER) || (style & BS_VCENTER) == BS_VCENTER) ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight), - "Style: 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx, + "Style: 0x%08lx expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", style, size.cx, image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight)); else ok(size.cx >= max(text_width, height) + pushtype[k].extra_width && size.cy >= height + tm.tmHeight, - "Style: 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx, + "Style: 0x%08lx expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", style, size.cx, max(text_width, height) + pushtype[k].extra_width, size.cy, height + tm.tmHeight); - ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height); + ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height); DestroyWindow(hwnd); }
@@ -2059,17 +2059,17 @@ static void test_bcm_get_ideal_size(void) ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); if (biml.uAlign == BUTTON_IMAGELIST_ALIGN_TOP || biml.uAlign == BUTTON_IMAGELIST_ALIGN_BOTTOM) ok(size.cx >= max(text_width, height) + pushtype[k].extra_width && size.cy >= height + tm.tmHeight, - "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", biml.uAlign, size.cx, + "Align:%d expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", biml.uAlign, size.cx, max(text_width, height) + pushtype[k].extra_width, size.cy, height + tm.tmHeight); else if (biml.uAlign == BUTTON_IMAGELIST_ALIGN_LEFT || biml.uAlign == BUTTON_IMAGELIST_ALIGN_RIGHT) ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight), - "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", biml.uAlign, size.cx, + "Align:%d expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", biml.uAlign, size.cx, image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight)); else ok(size.cx >= image_width + pushtype[k].extra_width && size.cy >= height, - "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", + "Align:%d expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", biml.uAlign, size.cx, image_width + pushtype[k].extra_width, size.cy, height); - ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height); + ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height); DestroyWindow(hwnd); }
@@ -2093,9 +2093,9 @@ static void test_bcm_get_ideal_size(void) ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); /* Ideal size contains text rect even show icons only */ ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight), - "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, + "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight)); - ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height); + ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height); DestroyWindow(hwnd);
/* Show icon and text */ @@ -2109,9 +2109,9 @@ static void test_bcm_get_ideal_size(void) ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); ok(size.cx >= image_width + text_width + pushtype[k].extra_width && size.cy >= max(height, tm.tmHeight), - "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, + "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width + pushtype[k].extra_width, size.cy, max(height, tm.tmHeight)); - ok(size.cy < large_height, "Expect ideal cy %d < %d\n", size.cy, large_height); + ok(size.cy < large_height, "Expect ideal cy %ld < %ld\n", size.cy, large_height); DestroyWindow(hwnd); DestroyIcon(hicon); } @@ -2130,7 +2130,7 @@ static void test_bcm_get_ideal_size(void) ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); ok((size.cx <= image_width + text_width && size.cx >= text_width && size.cy <= max(height, tm.tmHeight) && size.cy >= tm.tmHeight), - "Expect ideal cx %d within range (%d, %d ) and ideal cy %d within range (%d, %d )\n", size.cx, + "Expect ideal cx %ld within range (%ld, %ld ) and ideal cy %ld within range (%ld, %ld )\n", size.cx, text_width, image_width + text_width, size.cy, tm.tmHeight, max(height, tm.tmHeight)); DestroyWindow(hwnd);
@@ -2145,7 +2145,7 @@ static void test_bcm_get_ideal_size(void) ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)), - "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy, + "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width, size.cy, max(height, tm.tmHeight)); DestroyWindow(hwnd);
@@ -2159,7 +2159,7 @@ static void test_bcm_get_ideal_size(void) ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n"); ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)), - "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy, + "Expect ideal cx %ld >= %ld and ideal cy %ld >= %ld\n", size.cx, image_width + text_width, size.cy, max(height, tm.tmHeight)); DestroyWindow(hwnd);
@@ -2178,13 +2178,13 @@ static void test_bcm_get_ideal_size(void)
if (type == BS_COMMANDLINK || type == BS_DEFCOMMANDLINK) { - ok((size.cx == 0 && size.cy > 0), "Style 0x%08x expect ideal cx %d == %d and ideal cy %d > %d\n", + ok((size.cx == 0 && size.cy > 0), "Style 0x%08lx expect ideal cx %ld == %d and ideal cy %ld > %d\n", style, size.cx, 0, size.cy, 0); } else { ok(size.cx == client_width && size.cy == client_height, - "Style 0x%08x expect size.cx == %d and size.cy == %d, got size.cx: %d size.cy: %d\n", style, + "Style 0x%08lx expect size.cx == %ld and size.cy == %ld, got size.cx: %ld size.cy: %ld\n", style, client_width, client_height, size.cx, size.cy); } DestroyWindow(hwnd); @@ -2210,19 +2210,19 @@ static void test_bcm_get_ideal_size(void) || type == BS_OWNERDRAW) { ok(size.cx == client_width && size.cy == client_height, - "Style 0x%08x expect ideal size (%d,%d), got (%d,%d)\n", style, client_width, client_height, size.cx, + "Style 0x%08lx expect ideal size (%ld,%ld), got (%ld,%ld)\n", style, client_width, client_height, size.cx, size.cy); } else if (type == BS_COMMANDLINK || type == BS_DEFCOMMANDLINK) { ok((size.cx == 0 && size.cy > 0), - "Style 0x%08x expect ideal cx %d == %d and ideal cy %d > %d\n", style, size.cx, 0, + "Style 0x%08lx expect ideal cx %ld == %d and ideal cy %ld > %d\n", style, size.cx, 0, size.cy, 0); } else { height = line_count == 2 ? 2 * tm.tmHeight : tm.tmHeight; - ok(size.cx >= 0 && size.cy >= height, "Style 0x%08x expect ideal cx %d >= 0 and ideal cy %d >= %d\n", + ok(size.cx >= 0 && size.cy >= height, "Style 0x%08lx expect ideal cx %ld >= 0 and ideal cy %ld >= %ld\n", style, size.cx, size.cy, height); } DestroyWindow(hwnd); @@ -2239,14 +2239,14 @@ static void test_bcm_get_ideal_size(void) size.cy = 0; ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n"); - ok(size.cx == 13 && size.cy > 0, "Expected ideal cx %d == %d and ideal cy %d > %d\n", size.cx, 13, size.cy, 0); + ok(size.cx == 13 && size.cy > 0, "Expected ideal cx %ld == %d and ideal cy %ld > %d\n", size.cx, 13, size.cy, 0); height = size.cy; size.cx = 32767; size.cy = 7; ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n"); ok(size.cx < 32767, "Expected ideal cx to have been adjusted\n"); - ok(size.cx > image_width && size.cy == height, "Expected ideal cx %d > %d and ideal cy %d == %d\n", size.cx, image_width, size.cy, height); + ok(size.cx > image_width && size.cy == height, "Expected ideal cx %ld > %ld and ideal cy %ld == %ld\n", size.cx, image_width, size.cy, height);
/* Try longer note without word breaks, shouldn't extend height because no word splitting */ ret = SendMessageA(hwnd, BCM_SETNOTE, 0, (LPARAM)L"WWWWWWWWWWWWWWWW"); @@ -2255,14 +2255,14 @@ static void test_bcm_get_ideal_size(void) size.cy = 0; ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n"); - ok(size.cx == k && size.cy == height, "Expected ideal cx %d == %d and ideal cy %d == %d\n", size.cx, k, size.cy, height); + ok(size.cx == k && size.cy == height, "Expected ideal cx %ld == %d and ideal cy %ld == %ld\n", size.cx, k, size.cy, height);
/* Now let it extend the width */ size.cx = 32767; size.cy = 0; ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n"); - ok(size.cx > k && size.cy == height, "Expected ideal cx %d > %d and ideal cy %d == %d\n", size.cx, k, size.cy, height); + ok(size.cx > k && size.cy == height, "Expected ideal cx %ld > %d and ideal cy %ld == %ld\n", size.cx, k, size.cy, height);
/* Use a very long note with words and the same width, should extend the height due to word wrap */ ret = SendMessageA(hwnd, BCM_SETNOTE, 0, (LPARAM)L"This is a long note for the button with many words, which should " @@ -2271,13 +2271,13 @@ static void test_bcm_get_ideal_size(void) k = size.cx; ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n"); - ok(size.cx <= k && size.cy > height, "Expected ideal cx %d <= %d and ideal cy %d > %d\n", size.cx, k, size.cy, height); + ok(size.cx <= k && size.cy > height, "Expected ideal cx %ld <= %d and ideal cy %ld > %ld\n", size.cx, k, size.cy, height);
/* Now try the wordy note with a width smaller than the image itself, which prevents wrapping */ size.cx = 13; ret = SendMessageA(hwnd, BCM_GETIDEALSIZE, 0, (LPARAM)&size); ok(ret == TRUE, "Expected BCM_GETIDEALSIZE message to return true\n"); - ok(size.cx == 13 && size.cy == height, "Expected ideal cx %d == %d and ideal cy %d == %d\n", size.cx, 13, size.cy, height); + ok(size.cx == 13 && size.cy == height, "Expected ideal cx %ld == %d and ideal cy %ld == %ld\n", size.cx, 13, size.cy, height); DestroyWindow(hwnd);
@@ -2302,12 +2302,12 @@ static void test_style(void)
type = GetWindowLongW(button, GWL_STYLE) & BS_TYPEMASK; expected_type = (i == BS_USERBUTTON ? BS_PUSHBUTTON : i); - ok(type == expected_type, "Expected type %#x, got %#x.\n", expected_type, type); + ok(type == expected_type, "Expected type %#lx, got %#lx.\n", expected_type, type);
for (j = BS_PUSHBUTTON; j <= BS_DEFCOMMANDLINK; ++j) { ret = SendMessageA(button, BM_SETSTYLE, j, FALSE); - ok(ret == 0, "Expected %#x, got %#lx.\n", 0, ret); + ok(ret == 0, "Expected %#x, got %#Ix.\n", 0, ret);
type = GetWindowLongW(button, GWL_STYLE) & BS_TYPEMASK; if (i >= BS_SPLITBUTTON && j <= BS_DEFPUSHBUTTON) @@ -2316,7 +2316,7 @@ static void test_style(void) expected_type = j;
ok(type == expected_type || broken(type == j), /* XP */ - "Original type %#x, expected new type %#x, got %#x.\n", i, expected_type, type); + "Original type %#lx, expected new type %#lx, got %#lx.\n", i, expected_type, type); } DestroyWindow(button); } @@ -2360,7 +2360,7 @@ static void test_visual(void) BitBlt(mem_dc2, 0, 0, width, height, button_dc, 0, 0, SRCCOPY);
todo_wine_if(type == BS_PUSHBOX || (is_theme_active && type == BS_GROUPBOX)) - ok(equal_dc(mem_dc1, mem_dc2, width, height), "Type %#x: Expected content unchanged.\n", type); + ok(equal_dc(mem_dc1, mem_dc2, width, height), "Type %#lx: Expected content unchanged.\n", type);
DeleteObject(mem_bitmap2); DeleteObject(mem_bitmap1); diff --git a/dlls/comctl32/tests/combo.c b/dlls/comctl32/tests/combo.c index dd197db5a90..0dd05befa06 100644 --- a/dlls/comctl32/tests/combo.c +++ b/dlls/comctl32/tests/combo.c @@ -63,7 +63,7 @@ static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
info->cbSize = sizeof(*info); ret = GetComboBoxInfo(hwnd, info); - ok(ret, "Failed to get combobox info structure, error %d\n", GetLastError()); + ok(ret, "Failed to get combobox info structure, error %ld\n", GetLastError()); }
static HWND createComboEx(DWORD style) { @@ -168,19 +168,19 @@ static void test_comboex(void)
/* Add items onto the end of the combobox */ res = addItem(myHwnd, -1, first_item); - ok(res == 0, "Adding simple item failed (%d)\n", res); + ok(res == 0, "Adding simple item failed (%ld)\n", res); res = addItem(myHwnd, -1, second_item); - ok(res == 1, "Adding simple item failed (%d)\n", res); + ok(res == 1, "Adding simple item failed (%ld)\n", res); res = addItem(myHwnd, 2, third_item); - ok(res == 2, "Adding simple item failed (%d)\n", res); + ok(res == 2, "Adding simple item failed (%ld)\n", res); res = addItem(myHwnd, 1, middle_item); - ok(res == 1, "Inserting simple item failed (%d)\n", res); + ok(res == 1, "Inserting simple item failed (%ld)\n", res);
/* Add an item completely out of range */ res = addItem(myHwnd, 99, out_of_range_item); - ok(res == -1, "Adding using out of range index worked unexpectedly (%d)\n", res); + ok(res == -1, "Adding using out of range index worked unexpectedly (%ld)\n", res); res = addItem(myHwnd, 5, out_of_range_item); - ok(res == -1, "Adding using out of range index worked unexpectedly (%d)\n", res); + ok(res == -1, "Adding using out of range index worked unexpectedly (%ld)\n", res); /* Removed: Causes traps on Windows XP res = addItem(myHwnd, -2, "Out Of Range Item"); ok(res == -1, "Adding out of range worked unexpectedly (%ld)\n", res); @@ -188,62 +188,62 @@ static void test_comboex(void)
/* Get an item completely out of range */ res = getItem(myHwnd, 99, &cbexItem); - ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText); + ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText); res = getItem(myHwnd, 4, &cbexItem); - ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText); + ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText); res = getItem(myHwnd, -2, &cbexItem); - ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText); + ok(res == 0, "Getting item using out of range index worked unexpectedly (%ld, %s)\n", res, cbexItem.pszText);
/* Get an item in range */ res = getItem(myHwnd, 0, &cbexItem); - ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); ok(strcmp(first_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
res = getItem(myHwnd, 1, &cbexItem); - ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); ok(strcmp(middle_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
res = getItem(myHwnd, 2, &cbexItem); - ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); ok(strcmp(second_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
res = getItem(myHwnd, 3, &cbexItem); - ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res); + ok(res != 0, "Getting item using valid index failed unexpectedly (%ld)\n", res); ok(strcmp(third_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
/* Set an item completely out of range */ res = setItem(myHwnd, 99, replacement_item); - ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res); + ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res); res = setItem(myHwnd, 4, replacement_item); - ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res); + ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res); res = setItem(myHwnd, -2, replacement_item); - ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res); + ok(res == 0, "Setting item using out of range index worked unexpectedly (%ld)\n", res);
/* Set an item in range */ res = setItem(myHwnd, 0, replacement_item); - ok(res != 0, "Setting first item failed (%d)\n", res); + ok(res != 0, "Setting first item failed (%ld)\n", res); res = setItem(myHwnd, 3, replacement_item); - ok(res != 0, "Setting last item failed (%d)\n", res); + ok(res != 0, "Setting last item failed (%ld)\n", res);
/* Remove items completely out of range (4 items in control at this point) */ res = delItem(myHwnd, -1); - ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res); + ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res); res = delItem(myHwnd, 4); - ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res); + ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res);
/* Remove items in range (4 items in control at this point) */ res = delItem(myHwnd, 3); - ok(res == 3, "Deleting using out of range index failed (%d)\n", res); + ok(res == 3, "Deleting using out of range index failed (%ld)\n", res); res = delItem(myHwnd, 0); - ok(res == 2, "Deleting using out of range index failed (%d)\n", res); + ok(res == 2, "Deleting using out of range index failed (%ld)\n", res); res = delItem(myHwnd, 0); - ok(res == 1, "Deleting using out of range index failed (%d)\n", res); + ok(res == 1, "Deleting using out of range index failed (%ld)\n", res); res = delItem(myHwnd, 0); - ok(res == 0, "Deleting using out of range index failed (%d)\n", res); + ok(res == 0, "Deleting using out of range index failed (%ld)\n", res);
/* Remove from an empty box */ res = delItem(myHwnd, 0); - ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res); + ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%ld)\n", res);
/* Cleanup */ @@ -294,7 +294,7 @@ static void test_comboex_WM_LBUTTONDOWN(void) x = cbInfo.rcButton.left + (cbInfo.rcButton.right-cbInfo.rcButton.left)/2; y = cbInfo.rcButton.top + (cbInfo.rcButton.bottom-cbInfo.rcButton.top)/2; result = SendMessageA(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); - ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n", + ok(result, "WM_LBUTTONDOWN was not processed. LastError=%ld\n", GetLastError()); ok(GetFocus() == hCombo || broken(GetFocus() != hCombo), /* win98 */ @@ -306,7 +306,7 @@ static void test_comboex_WM_LBUTTONDOWN(void) ok(idx == 0, "For TopIndex expected %d, got %d\n", 0, idx);
result = SendMessageA(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); - ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n", + ok(result, "WM_LBUTTONUP was not processed. LastError=%ld\n", GetLastError()); ok(GetFocus() == hCombo || broken(GetFocus() != hCombo), /* win98 */ @@ -319,7 +319,7 @@ static void test_comboex_WM_LBUTTONDOWN(void) x = rect.left + (rect.right-rect.left)/2; y = item_height/2 + item_height*4; result = SendMessageA(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y)); - ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n", + ok(!result, "WM_MOUSEMOVE was not processed. LastError=%ld\n", GetLastError()); ok(GetFocus() == hCombo || broken(GetFocus() != hCombo), /* win98 */ @@ -327,7 +327,7 @@ static void test_comboex_WM_LBUTTONDOWN(void) GetFocus());
result = SendMessageA(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); - ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n", + ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%ld\n", GetLastError()); ok(GetFocus() == hCombo || broken(GetFocus() != hCombo), /* win98 */ @@ -337,7 +337,7 @@ static void test_comboex_WM_LBUTTONDOWN(void) "The dropdown list should still be visible.\n");
result = SendMessageA(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); - ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n", + ok(!result, "WM_LBUTTONUP was not processed. LastError=%ld\n", GetLastError()); todo_wine ok(GetFocus() == hEdit || broken(GetFocus() == hCombo), /* win98 */ @@ -642,7 +642,7 @@ static void test_comboex_get_set_item(void) item.pszText = textA; item.iItem = -1; ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); - ok(ret == 1, "Unexpected return value %d.\n", ret); + ok(ret == 1, "Unexpected return value %ld.\n", ret);
ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE);
@@ -651,17 +651,17 @@ static void test_comboex_get_set_item(void) item.iItem = -1; item.lParam = 0xdeadbeef; ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item); - ok(ret == 1, "Unexpected return value %d.\n", ret); - ok(item.lParam == 0, "Expected zero, got %lx\n", item.lParam); + ok(ret == 1, "Unexpected return value %ld.\n", ret); + ok(item.lParam == 0, "Expected zero, got %Ix\n", item.lParam);
item.lParam = 0x1abe11ed; ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); - ok(ret == 1, "Unexpected return value %d.\n", ret); + ok(ret == 1, "Unexpected return value %ld.\n", ret);
item.lParam = 0; ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item); - ok(ret == 1, "Unexpected return value %d.\n", ret); - ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %lx\n", item.lParam); + ok(ret == 1, "Unexpected return value %ld.\n", ret); + ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %Ix\n", item.lParam);
DestroyWindow(hComboEx); } @@ -931,29 +931,29 @@ static void test_combo_changesize(DWORD style) /* first make it slightly smaller */ MoveWindow( hCombo, 10, 10, clwidth - 2, clheight - 2, TRUE); GetClientRect( hCombo, &rc); - ok( rc.right - rc.left == clwidth - 2, "clientrect width is %d vs %d\n", + ok( rc.right - rc.left == clwidth - 2, "clientrect width is %ld vs %d\n", rc.right - rc.left, clwidth - 2); - ok( rc.bottom - rc.top == clheight, "clientrect height is %d vs %d\n", + ok( rc.bottom - rc.top == clheight, "clientrect height is %ld vs %d\n", rc.bottom - rc.top, clheight); SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc); - ok( rc.right - rc.left == clwidth - 2, "drop-down rect width is %d vs %d\n", + ok( rc.right - rc.left == clwidth - 2, "drop-down rect width is %ld vs %d\n", rc.right - rc.left, clwidth - 2); - ok( rc.bottom - rc.top == ddheight, "drop-down rect height is %d vs %d\n", + ok( rc.bottom - rc.top == ddheight, "drop-down rect height is %ld vs %d\n", rc.bottom - rc.top, ddheight); - ok( rc.right - rc.left == ddwidth -2, "drop-down rect width is %d vs %d\n", + ok( rc.right - rc.left == ddwidth -2, "drop-down rect width is %ld vs %d\n", rc.right - rc.left, ddwidth - 2); /* new cx, cy is slightly bigger than the initial values */ MoveWindow( hCombo, 10, 10, clwidth + 2, clheight + 2, TRUE); GetClientRect( hCombo, &rc); - ok( rc.right - rc.left == clwidth + 2, "clientrect width is %d vs %d\n", + ok( rc.right - rc.left == clwidth + 2, "clientrect width is %ld vs %d\n", rc.right - rc.left, clwidth + 2); - ok( rc.bottom - rc.top == clheight, "clientrect height is %d vs %d\n", + ok( rc.bottom - rc.top == clheight, "clientrect height is %ld vs %d\n", rc.bottom - rc.top, clheight); SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc); - ok( rc.right - rc.left == clwidth + 2, "drop-down rect width is %d vs %d\n", + ok( rc.right - rc.left == clwidth + 2, "drop-down rect width is %ld vs %d\n", rc.right - rc.left, clwidth + 2); todo_wine { - ok( rc.bottom - rc.top == clheight + 2, "drop-down rect height is %d vs %d\n", + ok( rc.bottom - rc.top == clheight + 2, "drop-down rect height is %ld vs %d\n", rc.bottom - rc.top, clheight + 2); }
@@ -1193,8 +1193,8 @@ static void test_combo_listbox_styles(DWORD cb_style)
style = GetWindowLongW( info.hwndList, GWL_STYLE ); exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE ); - ok(style == expect_style, "%08x: got %08x\n", cb_style, style); - ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle); + ok(style == expect_style, "%08lx: got %08lx\n", cb_style, style); + ok(exstyle == expect_exstyle, "%08lx: got %08lx\n", cb_style, exstyle);
if (cb_style != CBS_SIMPLE) expect_exstyle |= WS_EX_TOPMOST; @@ -1202,14 +1202,14 @@ static void test_combo_listbox_styles(DWORD cb_style) SendMessageW(combo, CB_SHOWDROPDOWN, TRUE, 0 ); style = GetWindowLongW( info.hwndList, GWL_STYLE ); exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE ); - ok(style == (expect_style | WS_VISIBLE), "%08x: got %08x\n", cb_style, style); - ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle); + ok(style == (expect_style | WS_VISIBLE), "%08lx: got %08lx\n", cb_style, style); + ok(exstyle == expect_exstyle, "%08lx: got %08lx\n", cb_style, exstyle);
SendMessageW(combo, CB_SHOWDROPDOWN, FALSE, 0 ); style = GetWindowLongW( info.hwndList, GWL_STYLE ); exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE ); - ok(style == expect_style, "%08x: got %08x\n", cb_style, style); - ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle); + ok(style == expect_style, "%08lx: got %08lx\n", cb_style, style); + ok(exstyle == expect_exstyle, "%08lx: got %08lx\n", cb_style, exstyle);
DestroyWindow(combo); } @@ -1462,7 +1462,7 @@ static void test_comboex_CBEN_GETDISPINFO(void) item.iIndent = I_INDENTCALLBACK;
res = SendMessageA(combo, CBEM_INSERTITEMA, 0, (LPARAM)&item); - ok(!res, "Unexpected return value %u.\n", res); + ok(!res, "Unexpected return value %lu.\n", res);
for (i = 0; i < ARRAY_SIZE(test_masks); ++i) { @@ -1471,7 +1471,7 @@ static void test_comboex_CBEN_GETDISPINFO(void) memset(&item, 0, sizeof(item)); item.mask = test_masks[i]; res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item); - ok(res == 1, "Unexpected return value %u.\n", res); + ok(res == 1, "Unexpected return value %lu.\n", res);
ok_sequence(sequences, PARENT_SEQ_INDEX, getdisp_parent_seq, "Get disp mask seq", TRUE); } @@ -1484,7 +1484,7 @@ static void test_comboex_CBEN_GETDISPINFO(void) item.mask = CBEIF_IMAGE; di_context.mask = 0; res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item); - ok(res == 1, "Unexpected return value %u.\n", res); + ok(res == 1, "Unexpected return value %lu.\n", res); todo_wine ok(di_context.mask == CBEIF_IMAGE, "Unexpected mask %#x.\n", di_context.mask);
@@ -1495,7 +1495,7 @@ static void test_comboex_CBEN_GETDISPINFO(void) memset(&item, 0, sizeof(item)); item.mask = CBEIF_IMAGE; res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item); - ok(res == 1, "Unexpected return value %u.\n", res); + ok(res == 1, "Unexpected return value %lu.\n", res); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "Get disp after DI_SETITEM seq", FALSE);
/* Request two fields, one was set. */ @@ -1503,7 +1503,7 @@ static void test_comboex_CBEN_GETDISPINFO(void) item.mask = CBEIF_IMAGE | CBEIF_INDENT; di_context.mask = 0; res = SendMessageA(combo, CBEM_GETITEMA, 0, (LPARAM)&item); - ok(res == 1, "Unexpected return value %u.\n", res); + ok(res == 1, "Unexpected return value %lu.\n", res); todo_wine ok(di_context.mask == CBEIF_INDENT, "Unexpected mask %#x.\n", di_context.mask);
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 47d7a8fbe56..e5dbd6bec45 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -24,9 +24,9 @@ #include "msg.h" #include "v6util.h"
-#define expect(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d, got %ld\n", (EXPECTED), (GOT)) +#define expect(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d, got %Id\n", (EXPECTED), (GOT))
-#define expect_unsuccess(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d(unsuccessful), got %ld(successful)\n", (EXPECTED), (GOT)) +#define expect_unsuccess(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d(unsuccessful), got %Id(successful)\n", (EXPECTED), (GOT))
#define NUM_MSG_SEQUENCES 1 #define DATETIME_SEQ_INDEX 0 @@ -220,17 +220,17 @@ static void test_mccolor_types(HWND hWndDateTime, int mccolor_type, const char*
theColor=RGB(0,0,0); crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor); - ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor); + ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor); prevColor=theColor; theColor=RGB(255,255,255); crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor); - ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor); + ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor); prevColor=theColor; theColor=RGB(100,180,220); crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor); - ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor); + ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor); crColor = SendMessageA(hWndDateTime, DTM_GETMCCOLOR, mccolor_type, 0); - ok(crColor==theColor, "%s: GETMCCOLOR: Expected %d, got %d\n", mccolor_name, theColor, crColor); + ok(crColor==theColor, "%s: GETMCCOLOR: Expected %ld, got %ld\n", mccolor_name, theColor, crColor); }
static void test_dtm_set_and_get_mccolor(void) @@ -282,7 +282,7 @@ static void test_dtm_get_monthcal(void)
todo_wine { r = SendMessageA(hWnd, DTM_GETMONTHCAL, 0, 0); - ok(r == 0, "Expected NULL(no child month calendar control), got %ld\n", r); + ok(r == 0, "Expected NULL(no child month calendar control), got %Id\n", r); }
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_get_monthcal_seq, "test_dtm_get_monthcal", FALSE); @@ -348,7 +348,7 @@ static void test_dtm_set_and_get_range(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r); + ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %Ix\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r); expect_systime(&st[0], &getSt[0]);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st); @@ -362,7 +362,7 @@ static void test_dtm_set_and_get_range(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r); + ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %Ix\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r); expect_systime(&st[1], &getSt[1]);
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st); @@ -376,7 +376,7 @@ static void test_dtm_set_and_get_range(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); expect_systime(&st[0], &getSt[0]); expect_systime(&st[1], &getSt[1]);
@@ -388,7 +388,7 @@ static void test_dtm_set_and_get_range(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); expect_systime(&st[0], &getSt[0]); expect_systime(&st[1], &getSt[1]);
@@ -400,7 +400,7 @@ static void test_dtm_set_and_get_range(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); expect_systime(&st[0], &getSt[0]); expect_systime(&st[1], &getSt[1]);
@@ -408,9 +408,9 @@ static void test_dtm_set_and_get_range(void)
/* DTM_SETRANGE with 0 flags */ r = SendMessageA(hWnd, DTM_SETRANGE, 0, (LPARAM)st); - ok(r, "got %lu\n", r); + ok(r, "got %Iu\n", r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == 0, "got %lu\n", r); + ok(r == 0, "got %Iu\n", r); ok(getSt[0].wYear == 0 && getSt[1].wYear == 0, "got %u, %u\n", getSt[0].wYear, getSt[1].wYear);
DestroyWindow(hWnd); @@ -435,7 +435,7 @@ static void test_dtm_set_range_swap_min_max(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&origSt); - ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); expect_systime(&st[0], &origSt);
/* set st[0] to value higher than st[1] */ @@ -447,7 +447,7 @@ static void test_dtm_set_range_swap_min_max(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); todo_wine { ok(compare_systime(&st[0], &getSt[0]) == 1 || broken(compare_systime(&st[0], &getSt[1]) == 1), /* comctl32 version <= 5.80 */ @@ -463,7 +463,7 @@ static void test_dtm_set_range_swap_min_max(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); - ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); /* the time part seems to not change after swapping the min and max values and doing DTM_SETSYSTEMTIME */ expect_systime_date(&st[0], &getSt[0]); @@ -484,7 +484,7 @@ static void test_dtm_set_range_swap_min_max(void) whenever we do a DTM_SETRANGE, the DTM_GETRANGE will return the values swapped*/ r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); todo_wine { ok(compare_systime(&st[0], &getSt[1]) == 1 || broken(compare_systime(&st[0], &getSt[0]) == 1), /* comctl32 version <= 5.80 */ @@ -504,7 +504,7 @@ static void test_dtm_set_range_swap_min_max(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); expect_systime(&st[0], &getSt[1]); expect_systime(&st[1], &getSt[0]);
@@ -516,7 +516,7 @@ static void test_dtm_set_range_swap_min_max(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); expect_systime(&st[0], &getSt[0]); expect_systime(&st[1], &getSt[1]);
@@ -544,7 +544,7 @@ static void test_dtm_set_and_get_system_time(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt); - ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %ld\n", GDT_NONE, GDT_VALID, GDT_ERROR, r); + ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %Id\n", GDT_NONE, GDT_VALID, GDT_ERROR, r);
/* set st to lowest possible value */ fill_systime_struct(&st, 1601, 1, 0, 1, 0, 0, 0, 0); @@ -564,7 +564,7 @@ static void test_dtm_set_and_get_system_time(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt); - ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); expect_systime(&st, &getSt);
/* set st to invalid value */ @@ -687,7 +687,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void) r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); expect(1, r); r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); - ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); expect_systime(&st[0], &getSt[0]); expect_systime(&st[1], &getSt[1]);
@@ -696,7 +696,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&refSt); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); - ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); expect_systime(&refSt, &getSt[0]);
/* Now set an out-of-bounds time */ @@ -705,7 +705,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); - ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); expect_systime(&refSt, &getSt[0]);
fill_systime_struct(&st[0], 1977, 1, 0, 1, 0, 0, 0, 0); @@ -713,7 +713,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void) r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]); expect(1, r); r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); - ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); expect_systime(&refSt, &getSt[0]);
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_systime_with_limits, "test_dtm_set_and_get_systime_with_limits", FALSE); @@ -755,7 +755,7 @@ static void test_dtm_get_ideal_size(void) r = SendMessageA(hwnd, DTM_GETIDEALSIZE, 0, (LPARAM)&size); ok(r, "Expect DTM_GETIDEALSIZE message to return true\n"); ok(size.cx > 0 && size.cy >= tm.tmHeight, - "Expect size.cx > 0 and size.cy >= %d, got cx:%d cy:%d\n", tm.tmHeight, size.cx, size.cy); + "Expect size.cx > 0 and size.cy >= %ld, got cx:%ld cy:%ld\n", tm.tmHeight, size.cx, size.cy);
DestroyWindow(hwnd); DeleteObject(hfont); @@ -775,7 +775,7 @@ static void test_wm_set_get_text(void) ok(CB_ERR == ret || broken(0 == ret) || /* comctl32 <= 4.72 */ broken(1 == ret), /* comctl32 <= 4.70 */ - "Expected CB_ERR, got %ld\n", ret); + "Expected CB_ERR, got %Id\n", ret);
buff[0] = 0; ret = SendMessageA(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff); @@ -785,20 +785,20 @@ static void test_wm_set_get_text(void) SetLastError(0xdeadbeef); ret = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_ICALENDARTYPE, caltype, 3); if (ret == 0) - skip("Must know local calendar type (%x)\n", GetLastError()); + skip("Must know local calendar type (%lx)\n", GetLastError()); else if (atoi(caltype) != CAL_GREGORIAN) skip("DateTimePicker Control only supports Gregorian calendar (type: %s)\n", caltype); else { SetLastError(0xdeadbeef); ret = GetDateFormatA(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time)); if (ret == 0) - skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError()); + skip("GetDateFormat failed, returned %Id, error %ld\n", ret, GetLastError()); else { ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
ret = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); - ok(ret == strlen(time), "Got wrong length: %ld, expected %d.\n", ret, strlen(time)); + ok(ret == strlen(time), "Got wrong length: %Id, expected %Id.\n", ret, strlen(time)); } }
diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c index 841076ef00f..3eaa1d5810f 100644 --- a/dlls/comctl32/tests/dpa.c +++ b/dlls/comctl32/tests/dpa.c @@ -35,7 +35,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
typedef struct _STREAMDATA @@ -96,13 +96,13 @@ static void init_functions(void) /* Callbacks */ static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp) { - ok(lp == 0x1abe11ed, "lp=%ld\n", lp); + ok(lp == 0x1abe11ed, "lp=%Id\n", lp); return p1 < p2 ? -1 : p1 > p2 ? 1 : 0; }
static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp) { - ok(lp == 0x1abe11ed, "lp=%ld\n", lp); + ok(lp == 0x1abe11ed, "lp=%Id\n", lp); return p1 > p2 ? -1 : p1 < p2 ? 1 : 0; }
@@ -115,14 +115,14 @@ static INT nMessages[4]; static PVOID CALLBACK CB_MergeInsertSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp) { nMessages[op]++; - ok(lp == 0x1abe11ed, "lp=%ld\n", lp); + ok(lp == 0x1abe11ed, "lp=%Id\n", lp); return p1; }
static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp) { nMessages[op]++; - ok(lp == 0x1abe11ed, "lp=%ld\n", lp); + ok(lp == 0x1abe11ed, "lp=%Id\n", lp); return ((PCHAR)p2)+1; }
@@ -209,12 +209,12 @@ static void test_dpa(void)
GetSystemInfo(&si); hHeap = HeapCreate(0, 1, 2); - ok(hHeap != NULL, "error=%d\n", GetLastError()); + ok(hHeap != NULL, "error=%ld\n", GetLastError()); dpa3 = pDPA_CreateEx(0, hHeap); ok(dpa3 != NULL, "\n"); ret = pDPA_Grow(dpa3, si.dwPageSize + 1); ok(!ret && GetLastError() == ERROR_NOT_ENOUGH_MEMORY, - "ret=%d error=%d\n", ret, GetLastError()); + "ret=%d error=%ld\n", ret, GetLastError());
dpa = pDPA_Create(0); ok(dpa != NULL, "\n"); @@ -224,7 +224,7 @@ static void test_dpa(void) /* Fill the created gap */ ok(pDPA_SetPtr(dpa, 0, (PVOID)5), "\n"); rc=CheckDPA(dpa, 0x56, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
/* Prepend item */ ret = pDPA_InsertPtr(dpa, 1, (PVOID)1); @@ -240,7 +240,7 @@ static void test_dpa(void) ok(ret == 5, "ret=%d\n", ret);
rc=CheckDPA(dpa, 0x516324, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
for(i = 1; i <= 6; i++) { @@ -254,28 +254,28 @@ static void test_dpa(void) /* Sort DPA */ ok(pDPA_Sort(dpa, CB_CmpGT, 0x1abe11ed), "\n"); rc=CheckDPA(dpa, 0x654321, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
/* Clone into a new DPA */ dpa2 = pDPA_Clone(dpa, NULL); ok(dpa2 != NULL, "\n"); /* The old data should have been preserved */ rc=CheckDPA(dpa2, 0x654321, &dw2); - ok(rc, "dw=0x%x\n", dw2); + ok(rc, "dw=0x%lx\n", dw2); ok(pDPA_Sort(dpa, CB_CmpLT, 0x1abe11ed), "\n");
/* Test if the DPA itself was really copied */ rc=CheckDPA(dpa, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw ); + ok(rc, "dw=0x%lx\n", dw ); rc=CheckDPA(dpa2, 0x654321, &dw2); - ok(rc, "dw2=0x%x\n", dw2); + ok(rc, "dw2=0x%lx\n", dw2);
/* Clone into an old DPA */ SetLastError(ERROR_SUCCESS); p = pDPA_Clone(dpa, dpa3); ok(p == dpa3, "p=%p\n", p); rc=CheckDPA(dpa3, 0x123456, &dw3); - ok(rc, "dw3=0x%x\n", dw3); + ok(rc, "dw3=0x%lx\n", dw3);
for(i = 1; i <= 6; i++) { @@ -309,7 +309,7 @@ static void test_dpa(void) p = pDPA_DeletePtr(dpa, 2); ok(p == (PVOID)3, "p=%p\n", p); rc=CheckDPA(dpa, 0x12456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
/* Check where to re-insert the deleted item */ i = pDPA_Search(dpa, (PVOID)3, 0, @@ -328,7 +328,7 @@ static void test_dpa(void) ret = pDPA_InsertPtr(dpa, 2, (PVOID)3); ok(ret == 2, "ret=%d i=%d\n", ret, 2); rc=CheckDPA(dpa, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
/* When doing a binary search while claiming reverse order all indexes * should be bogus */ @@ -346,7 +346,7 @@ static void test_dpa(void)
pDPA_DeleteAllPtrs(dpa2); rc=CheckDPA(dpa2, 0, &dw2); - ok(rc, "dw2=0x%x\n", dw2); + ok(rc, "dw2=0x%lx\n", dw2);
pDPA_Destroy(dpa); pDPA_Destroy(dpa2); @@ -372,7 +372,7 @@ static void test_DPA_Merge(void) ok(ret == 2, "ret=%d\n", ret);
rc = CheckDPA(dpa, 0x135, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
for (i = 0; i < 6; i++) { @@ -383,16 +383,16 @@ static void test_DPA_Merge(void) }
rc = CheckDPA(dpa2, 0x654321, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw); rc = CheckDPA(dpa3, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
/* Delete all odd entries from dpa2 */ memset(nMessages, 0, sizeof(nMessages)); pDPA_Merge(dpa2, dpa, DPAM_INTERSECT, CB_CmpLT, CB_MergeDeleteOddSrc, 0x1abe11ed); rc = CheckDPA(dpa2, 0x246, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
expect(3, nMessages[DPAMM_MERGE]); expect(3, nMessages[DPAMM_DELETE]); @@ -409,7 +409,7 @@ static void test_DPA_Merge(void) pDPA_Merge(dpa2, dpa, DPAM_INTERSECT, CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed); rc = CheckDPA(dpa2, 0x135, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
expect(3, nMessages[DPAMM_MERGE]); expect(6, nMessages[DPAMM_DELETE]); @@ -431,7 +431,7 @@ static void test_DPA_Merge(void) rc = CheckDPA(dpa2, 0x123456, &dw); ok(rc || broken(!rc && dw == 0x23456), /* 4.7x */ - "dw=0x%x\n", dw); + "dw=0x%lx\n", dw);
expect(0, nMessages[DPAMM_MERGE]); expect(0, nMessages[DPAMM_DELETE]); @@ -463,13 +463,13 @@ static void test_DPA_Merge(void) "Expected 3, got %d\n", nMessages[DPAMM_INSERT]);
rc = CheckDPA(dpa, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw); rc = CheckDPA(dpa2, 0x123456, &dw); ok(rc || broken(!rc), /* win98 */ - "dw=0x%x\n", dw); + "dw=0x%lx\n", dw); rc = CheckDPA(dpa3, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
pDPA_Destroy(dpa); pDPA_Destroy(dpa2); @@ -492,13 +492,13 @@ static void test_DPA_EnumCallback(void) }
rc = CheckDPA(dpa, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw);
nEnum = 0; /* test callback sets first 3 items to 7 */ pDPA_EnumCallback(dpa, CB_EnumFirstThree, dpa); rc = CheckDPA(dpa, 0x777456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw); ok(nEnum == 3, "nEnum=%d\n", nEnum);
pDPA_Destroy(dpa); @@ -535,7 +535,7 @@ static void test_DPA_LoadStream(void) HDPA dpa;
hRes = CoInitialize(NULL); - ok(hRes == S_OK, "Failed to initialize COM, hr %#x.\n", hRes); + ok(hRes == S_OK, "Failed to initialize COM, hr %#lx.\n", hRes);
dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE; hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg); @@ -622,10 +622,10 @@ static void test_DPA_LoadStream(void) expect(E_FAIL, hRes);
ret = IStream_Release(pStm); - ok(!ret, "ret=%d\n", ret); + ok(!ret, "ret=%ld\n", ret);
ret = IStorage_Release(pStg); - ok(!ret, "ret=%d\n", ret); + ok(!ret, "ret=%ld\n", ret);
CoUninitialize(); } @@ -643,7 +643,7 @@ static void test_DPA_SaveStream(void) LARGE_INTEGER liZero;
hRes = CoInitialize(NULL); - ok(hRes == S_OK, "Failed to initialize COM, hr %#x.\n", hRes); + ok(hRes == S_OK, "Failed to initialize COM, hr %#lx.\n", hRes);
dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE; hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg); @@ -657,7 +657,7 @@ static void test_DPA_SaveStream(void) /* simple parameter check */ hRes = pDPA_SaveStream(dpa, NULL, pStm, NULL); ok(hRes == E_INVALIDARG || - broken(hRes == S_OK) /* XP and below */, "Wrong result, %d\n", hRes); + broken(hRes == S_OK) /* XP and below */, "Wrong result, %ld\n", hRes); if (0) { /* crashes on XP */ hRes = pDPA_SaveStream(NULL, CB_Save, pStm, NULL); @@ -688,7 +688,7 @@ if (0) { hRes = pDPA_LoadStream(&dpa, CB_Load, pStm, (void*)0xdeadbeef); expect(S_OK, hRes); rc = CheckDPA(dpa, 0x123456, &dw); - ok(rc, "dw=0x%x\n", dw); + ok(rc, "dw=0x%lx\n", dw); pDPA_Destroy(dpa);
ret = IStream_Release(pStm); diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c index 2c108ed419c..4bfbecc713b 100644 --- a/dlls/comctl32/tests/edit.c +++ b/dlls/comctl32/tests/edit.c @@ -669,7 +669,7 @@ static void set_client_height(HWND Wnd, unsigned Height)
GetClientRect(Wnd, &ClientRect); ok(ClientRect.bottom - ClientRect.top == Height, - "The client height should be %d, but is %d\n", + "The client height should be %d, but is %ld\n", Height, ClientRect.bottom - ClientRect.top); }
@@ -685,52 +685,52 @@ static void test_edit_control_1(void) trace("EDIT: Single line\n"); hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); r = get_edit_style(hwEdit); - ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%x\n", r); + ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%lx\n", r); for (i = 0; i < 65535; i++) { msMessage.wParam = i; r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage); ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS), - "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r); + "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %lx\n", r); } DestroyWindow(hwEdit);
trace("EDIT: Single line want returns\n"); hwEdit = create_editcontrol(ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); r = get_edit_style(hwEdit); - ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN), "Wrong style expected 0x10c0 got: 0x%x\n", r); + ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN), "Wrong style expected 0x10c0 got: 0x%lx\n", r); for (i = 0; i < 65535; i++) { msMessage.wParam = i; r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage); ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS), - "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r); + "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %lx\n", r); } DestroyWindow(hwEdit);
trace("EDIT: Multiline line\n"); hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); r = get_edit_style(hwEdit); - ok(r == (ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0xc4 got: 0x%x\n", r); + ok(r == (ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0xc4 got: 0x%lx\n", r); for (i = 0; i < 65535; i++) { msMessage.wParam = i; r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage); ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS), - "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r); + "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %lx\n", r); } DestroyWindow(hwEdit);
trace("EDIT: Multi line want returns\n"); hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); r = get_edit_style(hwEdit); - ok(r == (ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0x10c4 got: 0x%x\n", r); + ok(r == (ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0x10c4 got: 0x%lx\n", r); for (i = 0; i < 65535; i++) { msMessage.wParam = i; r = SendMessageA(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage); ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS), - "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r); + "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %lx\n", r); } DestroyWindow(hwEdit); } @@ -765,11 +765,11 @@ static void test_edit_control_2(void) trace("EDIT: SETTEXT atomicity\n"); /* Send messages to "type" in the word 'foo'. */ r = SendMessageA(hwndET2, WM_CHAR, 'f', 1); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r); r = SendMessageA(hwndET2, WM_CHAR, 'o', 1); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r); r = SendMessageA(hwndET2, WM_CHAR, 'o', 1); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r); /* 'foo' should have been changed to 'bar' by the UPDATE handler. */ GetWindowTextA(hwndET2, szLocalString, MAXLEN); ok(strcmp(szLocalString, "bar")==0, @@ -777,34 +777,34 @@ static void test_edit_control_2(void)
/* try setting the caret before it's visible */ r = SetCaretPos(0, 0); - todo_wine ok(0 == r, "SetCaretPos succeeded unexpectedly, expected: 0, got: %d\n", r); + todo_wine ok(0 == r, "SetCaretPos succeeded unexpectedly, expected: 0, got: %ld\n", r); phwnd = SetFocus(hwndET2); ok(phwnd != NULL, "SetFocus failed unexpectedly, expected non-zero, got NULL\n"); r = SetCaretPos(0, 0); - ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); + ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); r = GetCaretPos(&cpos); - ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); - ok(cpos.x == 0 && cpos.y == 0, "Wrong caret position, expected: (0,0), got: (%d,%d)\n", cpos.x, cpos.y); + ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); + ok(cpos.x == 0 && cpos.y == 0, "Wrong caret position, expected: (0,0), got: (%ld,%ld)\n", cpos.x, cpos.y); r = SetCaretPos(-1, -1); - ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); + ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); r = GetCaretPos(&cpos); - ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); - ok(cpos.x == -1 && cpos.y == -1, "Wrong caret position, expected: (-1,-1), got: (%d,%d)\n", cpos.x, cpos.y); + ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); + ok(cpos.x == -1 && cpos.y == -1, "Wrong caret position, expected: (-1,-1), got: (%ld,%ld)\n", cpos.x, cpos.y); r = SetCaretPos(w << 1, h << 1); - ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); + ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); r = GetCaretPos(&cpos); - ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); - ok(cpos.x == (w << 1) && cpos.y == (h << 1), "Wrong caret position, expected: (%d,%d), got: (%d,%d)\n", w << 1, h << 1, cpos.x, cpos.y); + ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); + ok(cpos.x == (w << 1) && cpos.y == (h << 1), "Wrong caret position, expected: (%ld,%ld), got: (%ld,%ld)\n", w << 1, h << 1, cpos.x, cpos.y); r = SetCaretPos(w, h); - ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); + ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); r = GetCaretPos(&cpos); - ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); - ok(cpos.x == w && cpos.y == h, "Wrong caret position, expected: (%d,%d), got: (%d,%d)\n", w, h, cpos.x, cpos.y); + ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); + ok(cpos.x == w && cpos.y == h, "Wrong caret position, expected: (%ld,%ld), got: (%ld,%ld)\n", w, h, cpos.x, cpos.y); r = SetCaretPos(w - 1, h - 1); - ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); + ok(1 == r, "SetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); r = GetCaretPos(&cpos); - ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %d\n", r); - ok(cpos.x == (w - 1) && cpos.y == (h - 1), "Wrong caret position, expected: (%d,%d), got: (%d,%d)\n", w - 1, h - 1, cpos.x, cpos.y); + ok(1 == r, "GetCaretPos failed unexpectedly, expected: 1, got: %ld\n", r); + ok(cpos.x == (w - 1) && cpos.y == (h - 1), "Wrong caret position, expected: (%ld,%ld), got: (%ld,%ld)\n", w - 1, h - 1, cpos.x, cpos.y);
DestroyWindow(hwndET2); DestroyWindow(hwndMain); @@ -1361,7 +1361,7 @@ static void test_edit_control_5(void)
/* size of non-child edit control is (much) bigger than requested */ GetWindowRect( hWnd, &rc); - ok( rc.right - rc.left > 20, "size of the window (%d) is smaller than expected\n", + ok( rc.right - rc.left > 20, "size of the window (%ld) is smaller than expected\n", rc.right - rc.left); DestroyWindow(hWnd); /* so create a parent, and give it edit controls children to test with */ @@ -1413,25 +1413,25 @@ static void test_edit_control_6(void) ok(hWnd != NULL, "Failed to create edit control.\n");
ret = SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)str); - ok(ret == TRUE, "Expected %d, got %d\n", TRUE, ret); + ok(ret == TRUE, "Expected %d, got %ld\n", TRUE, ret); ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf); - ok(ret == strlen(str), "Expected %s, got len %d\n", str, ret); + ok(ret == strlen(str), "Expected %s, got len %ld\n", str, ret); ok(!strcmp(buf, str), "Expected %s, got %s\n", str, buf);
buf[0] = 0; ret = SendMessageA(hWnd, WM_DESTROY, 0, 0); todo_wine - ok(ret == 1, "Unexpected return value %d\n", ret); + ok(ret == 1, "Unexpected return value %ld\n", ret); ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf); - ok(ret == strlen(str), "Expected %s, got len %d\n", str, ret); + ok(ret == strlen(str), "Expected %s, got len %ld\n", str, ret); ok(!strcmp(buf, str), "Expected %s, got %s\n", str, buf);
buf[0] = 0; ret = SendMessageA(hWnd, WM_NCDESTROY, 0, 0); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ret = SendMessageA(hWnd, WM_GETTEXT, MAXLEN, (LPARAM)buf); todo_wine { - ok(ret == strlen("Test"), "Unexpected text length %d\n", ret); + ok(ret == strlen("Test"), "Unexpected text length %ld\n", ret); ok(!strcmp(buf, "Test"), "Unexpected text %s\n", buf); } DestroyWindow(hWnd); @@ -1446,20 +1446,20 @@ static void test_edit_control_limittext(void) trace("EDIT: buffer limit for single-line\n"); hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0); - ok(r == 30000, "Incorrect default text limit, expected 30000 got %u\n", r); + ok(r == 30000, "Incorrect default text limit, expected 30000 got %lu\n", r); SendMessageA(hwEdit, EM_SETLIMITTEXT, 0, 0); r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0); - ok( r == 2147483646, "got limit %u (expected 2147483646)\n", r); + ok( r == 2147483646, "got limit %lu (expected 2147483646)\n", r); DestroyWindow(hwEdit);
/* Test default limit for multi-line control */ trace("EDIT: buffer limit for multi-line\n"); hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0); - ok(r == 30000, "Incorrect default text limit, expected 30000 got %u\n", r); + ok(r == 30000, "Incorrect default text limit, expected 30000 got %lu\n", r); SendMessageA(hwEdit, EM_SETLIMITTEXT, 0, 0); r = SendMessageA(hwEdit, EM_GETLIMITTEXT, 0, 0); - ok( r == 4294967295U, "got limit %u (expected 4294967295)\n", r); + ok( r == 4294967295U, "got limit %lu (expected 4294967295)\n", r); DestroyWindow(hwEdit); }
@@ -1479,16 +1479,16 @@ static void test_edit_control_scroll(void) ok(hwEdit != NULL, "Failed to create Edit control.\n");
ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0); - ok(!ret, "Returned %x, expected 0.\n", ret); + ok(!ret, "Returned %lx, expected 0.\n", ret);
ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEUP, 0); - ok(!ret, "Returned %x, expected 0.\n", ret); + ok(!ret, "Returned %lx, expected 0.\n", ret);
ret = SendMessageA(hwEdit, EM_SCROLL, SB_LINEUP, 0); - ok(!ret, "Returned %x, expected 0.\n", ret); + ok(!ret, "Returned %lx, expected 0.\n", ret);
ret = SendMessageA(hwEdit, EM_SCROLL, SB_LINEDOWN, 0); - ok(!ret, "Returned %x, expected 0.\n", ret); + ok(!ret, "Returned %lx, expected 0.\n", ret);
DestroyWindow (hwEdit);
@@ -1500,7 +1500,7 @@ static void test_edit_control_scroll(void) ok(hwEdit != NULL, "Failed to create Edit control.\n");
ret = SendMessageA(hwEdit, EM_SCROLL, SB_PAGEDOWN, 0); - ok(!ret, "Returned %x, expected 0.\n", ret); + ok(!ret, "Returned %lx, expected 0.\n", ret);
DestroyWindow (hwEdit); } @@ -1782,16 +1782,16 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam,
memset(&rect, 0, sizeof(rect)); SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rect); - ok(!rect.right && !rect.bottom, "Invalid size after NCCREATE: %d x %d\n", rect.right, rect.bottom); + ok(!rect.right && !rect.bottom, "Invalid size after NCCREATE: %ld x %ld\n", rect.right, rect.bottom);
/* test that messages between WM_NCCREATE and WM_CREATE don't crash or cause unexpected behavior */ r = SendMessageA(hwnd, EM_SETSEL, 0, 0); - ok(r == 1, "Returned %ld, expected 1.\n", r); + ok(r == 1, "Returned %Id, expected 1.\n", r); r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010); - todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r); + todo_wine ok(r == 1, "Returned %Id, expected 1.\n", r); r = SendMessageA(hwnd, EM_LINESCROLL, 1, 1); - ok(r == 1, "Returned %ld, expected 1.\n", r); + ok(r == 1, "Returned %Id, expected 1.\n", r);
return result;
@@ -1799,11 +1799,11 @@ static LRESULT CALLBACK test_class_proc(HWND hwnd, UINT message, WPARAM wParam, /* test that messages between WM_NCCREATE and WM_CREATE don't crash or cause unexpected behavior */ r = SendMessageA(hwnd, EM_SETSEL, 0, 0); - ok(r == 1, "Returned %ld, expected 1.\n", r); + ok(r == 1, "Returned %Id, expected 1.\n", r); r = SendMessageA(hwnd, WM_SIZE, 0, 0x00100010); - todo_wine ok(r == 1, "Returned %ld, expected 1.\n", r); + todo_wine ok(r == 1, "Returned %Id, expected 1.\n", r); r = SendMessageA(hwnd, EM_LINESCROLL, 1, 1); - ok(r == 1, "Returned %ld, expected 1.\n", r); + ok(r == 1, "Returned %Id, expected 1.\n", r);
break; } @@ -2035,7 +2035,7 @@ static void test_margins_font_change(void) #define edit_pos_ok(expected, got, txt) edit_pos_ok_(__LINE__, expected, got, #txt) static inline void edit_pos_ok_(unsigned line, DWORD expected, DWORD got, const char* txt) { - ok_(__FILE__, line)(expected == got, "wrong %s expected %d got %d\n", txt, expected, got); + ok_(__FILE__, line)(expected == got, "wrong %s expected %ld got %ld\n", txt, expected, got); }
#define check_pos(hwEdit, set_height, test_top, test_height, test_left) \ @@ -2188,39 +2188,39 @@ static void test_espassword(void)
hwEdit = create_editcontrol(ES_PASSWORD, 0); r = get_edit_style(hwEdit); - ok(r == ES_PASSWORD, "Wrong style expected ES_PASSWORD got: 0x%x\n", r); + ok(r == ES_PASSWORD, "Wrong style expected ES_PASSWORD got: 0x%lx\n", r); /* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) password); - ok(r == TRUE, "Expected: %d, got: %d\n", TRUE, r); + ok(r == TRUE, "Expected: %d, got: %ld\n", TRUE, r);
/* select all, cut (ctrl-x) */ SendMessageA(hwEdit, EM_SETSEL, 0, -1); r = SendMessageA(hwEdit, WM_CHAR, 24, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); - ok(r == strlen(password), "Expected: %s, got len %d\n", password, r); + ok(r == strlen(password), "Expected: %s, got len %ld\n", password, r); ok(strcmp(buffer, password) == 0, "expected %s, got %s\n", password, buffer);
r = OpenClipboard(hwEdit); - ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + ok(r == TRUE, "expected %d, got %ld\n", TRUE, r); r = EmptyClipboard(); - ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + ok(r == TRUE, "expected %d, got %ld\n", TRUE, r); r = CloseClipboard(); - ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + ok(r == TRUE, "expected %d, got %ld\n", TRUE, r);
/* select all, copy (ctrl-c) and paste (ctrl-v) */ SendMessageA(hwEdit, EM_SETSEL, 0, -1); r = SendMessageA(hwEdit, WM_CHAR, 3, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r); r = SendMessageA(hwEdit, WM_CHAR, 22, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); - ok(r == 0, "Expected: 0, got: %d\n", r); + ok(r == 0, "Expected: 0, got: %ld\n", r); ok(strcmp(buffer, "") == 0, "expected empty string, got %s\n", buffer);
DestroyWindow(hwEdit); @@ -2236,48 +2236,48 @@ static void test_undo(void)
hwEdit = create_editcontrol(0, 0); r = get_edit_style(hwEdit); - ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r); + ok(0 == r, "Wrong style expected 0x%x got: 0x%lx\n", 0, r);
/* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) text); - ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r); + ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
/* select all, */ cpMin = cpMax = 0xdeadbeef; SendMessageA(hwEdit, EM_SETSEL, 0, -1); r = SendMessageA(hwEdit, EM_GETSEL, (WPARAM) &cpMin, (LPARAM) &cpMax); - ok((strlen(text) << 16) == r, "Unexpected length %d\n", r); - ok(0 == cpMin, "Expected: %d, got %d\n", 0, cpMin); - ok(9 == cpMax, "Expected: %d, got %d\n", 9, cpMax); + ok((strlen(text) << 16) == r, "Unexpected length %ld\n", r); + ok(0 == cpMin, "Expected: %d, got %ld\n", 0, cpMin); + ok(9 == cpMax, "Expected: %d, got %ld\n", 9, cpMax);
/* cut (ctrl-x) */ r = SendMessageA(hwEdit, WM_CHAR, 24, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); - ok(0 == r, "Expected: %d, got len %d\n", 0, r); + ok(0 == r, "Expected: %d, got len %ld\n", 0, r); ok(0 == strcmp(buffer, ""), "expected %s, got %s\n", "", buffer);
/* undo (ctrl-z) */ r = SendMessageA(hwEdit, WM_CHAR, 26, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); - ok(strlen(text) == r, "Unexpected length %d\n", r); + ok(strlen(text) == r, "Unexpected length %ld\n", r); ok(0 == strcmp(buffer, text), "expected %s, got %s\n", text, buffer);
/* undo again (ctrl-z) */ r = SendMessageA(hwEdit, WM_CHAR, 26, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); - ok(r == 0, "Expected: %d, got len %d\n", 0, r); + ok(r == 0, "Expected: %d, got len %ld\n", 0, r); ok(0 == strcmp(buffer, ""), "expected %s, got %s\n", "", buffer);
DestroyWindow(hwEdit); @@ -2292,19 +2292,19 @@ static void test_enter(void) /* multiline */ hwEdit = create_editcontrol(ES_MULTILINE, 0); r = get_edit_style(hwEdit); - ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%x\n", r); + ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%lx\n", r);
/* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) ""); - ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r); + ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer); - ok(2 == r, "Expected: %d, got len %d\n", 2, r); + ok(2 == r, "Expected: %d, got len %ld\n", 2, r); ok(0 == strcmp(buffer, "\r\n"), "expected "\r\n", got "%s"\n", buffer);
DestroyWindow (hwEdit); @@ -2312,19 +2312,19 @@ static void test_enter(void) /* single line */ hwEdit = create_editcontrol(0, 0); r = get_edit_style(hwEdit); - ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r); + ok(0 == r, "Wrong style expected 0x%x got: 0x%lx\n", 0, r);
/* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) ""); - ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r); + ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer); - ok(0 == r, "Expected: %d, got len %d\n", 0, r); + ok(0 == r, "Expected: %d, got len %ld\n", 0, r); ok(0 == strcmp(buffer, ""), "expected "", got "%s"\n", buffer);
DestroyWindow(hwEdit); @@ -2332,19 +2332,19 @@ static void test_enter(void) /* single line with ES_WANTRETURN */ hwEdit = create_editcontrol(ES_WANTRETURN, 0); r = get_edit_style(hwEdit); - ok(ES_WANTRETURN == r, "Wrong style expected ES_WANTRETURN got: 0x%x\n", r); + ok(ES_WANTRETURN == r, "Wrong style expected ES_WANTRETURN got: 0x%lx\n", r);
/* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) ""); - ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r); + ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
r = SendMessageA(hwEdit, WM_CHAR, VK_RETURN, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer); - ok(0 == r, "Expected: %d, got len %d\n", 0, r); + ok(0 == r, "Expected: %d, got len %ld\n", 0, r); ok(0 == strcmp(buffer, ""), "expected "", got "%s"\n", buffer);
DestroyWindow(hwEdit); @@ -2359,19 +2359,19 @@ static void test_tab(void) /* multiline */ hwEdit = create_editcontrol(ES_MULTILINE, 0); r = get_edit_style(hwEdit); - ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%x\n", r); + ok(ES_MULTILINE == r, "Wrong style expected ES_MULTILINE got: 0x%lx\n", r);
/* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) ""); - ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r); + ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
r = SendMessageA(hwEdit, WM_CHAR, VK_TAB, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer); - ok(1 == r, "Expected: %d, got len %d\n", 1, r); + ok(1 == r, "Expected: %d, got len %ld\n", 1, r); ok(0 == strcmp(buffer, "\t"), "expected "\t", got "%s"\n", buffer);
DestroyWindow(hwEdit); @@ -2379,19 +2379,19 @@ static void test_tab(void) /* single line */ hwEdit = create_editcontrol(0, 0); r = get_edit_style(hwEdit); - ok(0 == r, "Wrong style expected 0x%x got: 0x%x\n", 0, r); + ok(0 == r, "Wrong style expected 0x%x got: 0x%lx\n", 0, r);
/* set text */ r = SendMessageA(hwEdit , WM_SETTEXT, 0, (LPARAM) ""); - ok(TRUE == r, "Expected: %d, got: %d\n", TRUE, r); + ok(TRUE == r, "Expected: %d, got: %ld\n", TRUE, r);
r = SendMessageA(hwEdit, WM_CHAR, VK_TAB, 0); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
/* get text */ buffer[0] = 0; r = SendMessageA(hwEdit, WM_GETTEXT, 16, (LPARAM) buffer); - ok(0 == r, "Expected: %d, got len %d\n", 0, r); + ok(0 == r, "Expected: %d, got len %ld\n", 0, r); ok(0 == strcmp(buffer, ""), "expected "", got "%s"\n", buffer);
DestroyWindow(hwEdit); @@ -2802,11 +2802,11 @@ static void test_fontsize(void) ShowWindow (hwEdit, SW_SHOW);
r = SendMessageA(hwEdit, WM_CHAR, 'A', 1); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r); r = SendMessageA(hwEdit, WM_CHAR, 'B', 1); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r); r = SendMessageA(hwEdit, WM_CHAR, 'C', 1); - ok(1 == r, "Expected: %d, got: %d\n", 1, r); + ok(1 == r, "Expected: %d, got: %ld\n", 1, r);
GetWindowTextA(hwEdit, szLocalString, MAXLEN); ok(strcmp(szLocalString, "ABC")==0, @@ -2992,7 +2992,7 @@ static void test_dialogmode(void)
hwButton = CreateWindowA("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, 100, 100, 50, 20, hwParent, (HMENU)ID_EDITTESTDBUTTON, hinst, NULL); - ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError()); + ok(hwButton!=NULL, "CreateWindow failed with error code %ld\n", GetLastError());
r = SendMessageA(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); ok(1 == r, "expected 1, got %d\n", r); @@ -3290,13 +3290,13 @@ static void test_wordbreak_proc(void) ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)test_wordbreak_procA); - ok(ret == 1, "Unexpected return value %ld.\n", ret); + ok(ret == 1, "Unexpected return value %Id.\n", ret);
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0); ok(proc == test_wordbreak_procA, "Unexpected wordbreak proc %p.\n", proc);
ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, 0); - ok(ret == 1, "Unexpected return value %ld.\n", ret); + ok(ret == 1, "Unexpected return value %Id.\n", ret);
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0); ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc); diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index 143bc8f84f4..7261da2a5f3 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -59,7 +59,7 @@ static HWND hWndHeader; #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
#define NUM_MSG_SEQUENCES 2 @@ -397,13 +397,13 @@ static WCHAR pszUniTestW[] = {'T','S','T',0};
#define TEST_GET_ITEM(i,c)\ { res = getItem(hWndHeader, i, buffer);\ - ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%d)\n", i, res);\ + ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%ld)\n", i, res);\ ok(strcmp(str_items[c], buffer) == 0, "Getting item[%d] returned "%s" expecting "%s"\n", i, buffer, str_items[c]);\ }
#define TEST_GET_ITEMCOUNT(i)\ { res = getItemCount(hWndHeader);\ - ok(res == i, "Got Item Count as %d\n", res);\ + ok(res == i, "Got Item Count as %ld\n", res);\ }
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -734,25 +734,25 @@ static void test_header_control (void) { TEST_GET_ITEMCOUNT(3-i); res = addItem(hWndHeader, 0, str_items[i]); - ok(res == 0, "Adding simple item failed (%d)\n", res); + ok(res == 0, "Adding simple item failed (%ld)\n", res); }
TEST_GET_ITEMCOUNT(4); res = addItem(hWndHeader, 99, str_items[i+1]); - ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res); + ok(res != -1, "Adding Out of Range item should fail with -1 got (%ld)\n", res); TEST_GET_ITEMCOUNT(5); res = addItem(hWndHeader, 5, str_items[i+1]); - ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res); + ok(res != -1, "Adding Out of Range item should fail with -1 got (%ld)\n", res); TEST_GET_ITEMCOUNT(6);
for (i = 0; i < 4; i++) { TEST_GET_ITEM(i,i); TEST_GET_ITEMCOUNT(6); }
res=getItem(hWndHeader, 99, buffer); - ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer); + ok(res == 0, "Getting Out of Range item should fail with 0 (%ld), got %s\n", res,buffer); res=getItem(hWndHeader, 5, buffer); - ok(res == 1, "Getting Out of Range item should fail with 1 (%d), got %s\n", res,buffer); + ok(res == 1, "Getting Out of Range item should fail with 1 (%ld), got %s\n", res,buffer); res=getItem(hWndHeader, -2, buffer); - ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer); + ok(res == 0, "Getting Out of Range item should fail with 0 (%ld), got %s\n", res,buffer);
if (winetest_interactive) { @@ -762,17 +762,17 @@ static void test_header_control (void)
TEST_GET_ITEMCOUNT(6); res=setItem(hWndHeader, 99, str_items[5], FALSE); - ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res); + ok(res == 0, "Setting Out of Range item should fail with 0 (%ld)\n", res); res=setItem(hWndHeader, 5, str_items[5], TRUE); - ok(res == 1, "Setting Out of Range item should fail with 1 (%d)\n", res); + ok(res == 1, "Setting Out of Range item should fail with 1 (%ld)\n", res); res=setItem(hWndHeader, -2, str_items[5], FALSE); - ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res); + ok(res == 0, "Setting Out of Range item should fail with 0 (%ld)\n", res); TEST_GET_ITEMCOUNT(6);
for (i = 0; i < 4; i++) { res = setItem(hWndHeader, i, str_items[4], TRUE); - ok(res != 0, "Setting %d item failed (%d)\n", i+1, res); + ok(res != 0, "Setting %d item failed (%ld)\n", i+1, res); TEST_GET_ITEM(i, 4); TEST_GET_ITEMCOUNT(6); } @@ -800,22 +800,22 @@ static void test_header_control (void) TEST_GET_ITEMCOUNT(6);
res = delItem(hWndHeader, 5); - ok(res == 1, "Deleting Out of Range item should fail with 1 (%d)\n", res); + ok(res == 1, "Deleting Out of Range item should fail with 1 (%ld)\n", res); res = delItem(hWndHeader, -2); - ok(res == 0, "Deleting Out of Range item should fail with 0 (%d)\n", res); + ok(res == 0, "Deleting Out of Range item should fail with 0 (%ld)\n", res); TEST_GET_ITEMCOUNT(5);
res = delItem(hWndHeader, 3); - ok(res != 0, "Deleting using out of range index failed (%d)\n", res); + ok(res != 0, "Deleting using out of range index failed (%ld)\n", res); TEST_GET_ITEMCOUNT(4); res = delItem(hWndHeader, 0); - ok(res != 0, "Deleting using out of range index failed (%d)\n", res); + ok(res != 0, "Deleting using out of range index failed (%ld)\n", res); TEST_GET_ITEMCOUNT(3); res = delItem(hWndHeader, 0); - ok(res != 0, "Deleting using out of range index failed (%d)\n", res); + ok(res != 0, "Deleting using out of range index failed (%ld)\n", res); TEST_GET_ITEMCOUNT(2); res = delItem(hWndHeader, 0); - ok(res != 0, "Deleting using out of range index failed (%d)\n", res); + ok(res != 0, "Deleting using out of range index failed (%ld)\n", res); TEST_GET_ITEMCOUNT(1);
DestroyWindow(hWndHeader); @@ -1370,13 +1370,13 @@ static void test_hds_nosizing(HWND hParent) }
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom) \ - ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \ + ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %ld\n", draw_stage, nm->dwDrawStage); \ if (item_spec != -1) \ - ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %ld\n", item_spec, nm->dwItemSpec); \ - ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \ + ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %Id\n", item_spec, nm->dwItemSpec); \ + ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %Id\n", lparam, nm->lItemlParam); \ ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \ broken(draw_stage != CDDS_ITEMPREPAINT), /* comctl32 < 5.80 */ \ - "Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \ + "Invalid rect (%d,%d)-(%d,%ld) vs %s\n", _left, _top, _right, _bottom, \ wine_dbgstr_rect(&nm->rc));
static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm) @@ -1394,7 +1394,7 @@ static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm) return 0; }
- ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage); return -1; }
@@ -1421,7 +1421,7 @@ static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm) return 0; }
- ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage); return 0; }
@@ -1451,7 +1451,7 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm) return 0; }
- ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage); return 0; }
@@ -1479,7 +1479,7 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm) return 0; }
- ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage); + ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage); return 0; }
@@ -1502,7 +1502,7 @@ static void test_customdraw(void) hWndHeader = create_header_control(); GetClientRect(hWndHeader, &rect); ok(rect.right - rect.left == 670 && rect.bottom - rect.top == g_customheight, - "Tests will fail as header size is %dx%d instead of 670x%d\n", + "Tests will fail as header size is %ldx%ld instead of 670x%ld\n", rect.right - rect.left, rect.bottom - rect.top, g_customheight);
for (i = 0; i < 3; i++) @@ -1654,10 +1654,10 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP compare(di->hwndItem, g_DrawItem.hwndItem, "%p"); compare(di->itemID, g_DrawItem.itemID, "%d"); compare(di->itemState, g_DrawItem.itemState, "%d"); - compare(di->rcItem.left, g_DrawItem.rcItem.left, "%d"); - compare(di->rcItem.top, g_DrawItem.rcItem.top, "%d"); - compare(di->rcItem.right, g_DrawItem.rcItem.right, "%d"); - compare(di->rcItem.bottom, g_DrawItem.rcItem.bottom, "%d"); + compare(di->rcItem.left, g_DrawItem.rcItem.left, "%ld"); + compare(di->rcItem.top, g_DrawItem.rcItem.top, "%ld"); + compare(di->rcItem.right, g_DrawItem.rcItem.right, "%ld"); + compare(di->rcItem.bottom, g_DrawItem.rcItem.bottom, "%ld"); break;
case WM_DESTROY: @@ -1707,7 +1707,7 @@ static BOOL init(void) GetTextMetricsA(hdc, &tm); /* 2 dot extra space are needed for the border */ g_customheight = tm.tmHeight + 2; - trace("customdraw height: %d (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY)); + trace("customdraw height: %ld (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY)); SelectObject(hdc, hOldFont); ReleaseDC(0, hdc);
@@ -1736,22 +1736,22 @@ static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, order[i-1] = start>>(4*(count-i)) & 0xf;
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order); - ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret); + ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %ld\n", ret);
/* new order */ for(i = 1; i<=count; i++) order[i-1] = set>>(4*(count-i)) & 0xf; ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order); - ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret); + ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %ld\n", ret);
/* check actual order */ ret = SendMessageA(hwnd, HDM_GETORDERARRAY, count, (LPARAM)order); - ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %d\n", ret); + ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %ld\n", ret); for(i = 1; i<=count; i++) array |= order[i-1]<<(4*(count-i));
todo_wine_if(todo) - ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array); + ok_(__FILE__, line)(array == expected, "Expected %lx, got %lx\n", expected, array); }
static void test_hdm_orderarray(void) diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 66a70982e6f..e7e3582ec35 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -373,7 +373,7 @@ static void test_hotspot(void) /* check new hotspot, it should be the same like the old one */ himlNew = pImageList_GetDragImage(NULL, &ppt); ok(ppt.x == dx1 && ppt.y == dy1, - "Expected drag hotspot [%d,%d] got [%d,%d]\n", + "Expected drag hotspot [%d,%d] got [%ld,%ld]\n", dx1, dy1, ppt.x, ppt.y); /* check size of new dragged image */ pImageList_GetIconSize(himlNew, &newx, &newy); @@ -755,7 +755,7 @@ static HRESULT STDMETHODCALLTYPE Test_Stream_Seek(IStream *iface, LARGE_INTEGER
if (is_v6_test()) { - ok(origin == STREAM_SEEK_CUR, "Unexpected origin %d.\n", origin); + ok(origin == STREAM_SEEK_CUR, "Unexpected origin %ld.\n", origin); ok(offset.QuadPart == 0, "Unexpected offset %s.\n", wine_dbgstr_longlong(offset.QuadPart)); ok(new_pos != NULL, "Unexpected out position pointer.\n"); return IStream_Seek(stream->stream, offset, origin, new_pos); @@ -844,7 +844,7 @@ static void init_memstream(struct memstream *stream)
stream->IStream_iface.lpVtbl = &Test_Stream_Vtbl; hr = CreateStreamOnHGlobal(NULL, TRUE, &stream->stream); - ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr); }
static void cleanup_memstream(struct memstream *stream) @@ -868,19 +868,19 @@ static ULONG check_bitmap_data(const ILHEAD *header, const char *bm_data, if (bmih->biBitCount <= 8) hdr_size += (1 << bpp) * sizeof(RGBQUAD);
ok(bmfh->bfType == (('M' << 8) | 'B'), "wrong bfType 0x%02x\n", bmfh->bfType); - ok(bmfh->bfSize == hdr_size, "wrong bfSize 0x%02x\n", bmfh->bfSize); + ok(bmfh->bfSize == hdr_size, "wrong bfSize 0x%02lx\n", bmfh->bfSize); ok(bmfh->bfReserved1 == 0, "wrong bfReserved1 0x%02x\n", bmfh->bfReserved1); ok(bmfh->bfReserved2 == 0, "wrong bfReserved2 0x%02x\n", bmfh->bfReserved2); - ok(bmfh->bfOffBits == hdr_size, "wrong bfOffBits 0x%02x\n", bmfh->bfOffBits); + ok(bmfh->bfOffBits == hdr_size, "wrong bfOffBits 0x%02lx\n", bmfh->bfOffBits);
- ok(bmih->biSize == sizeof(*bmih), "wrong biSize %d\n", bmih->biSize); + ok(bmih->biSize == sizeof(*bmih), "wrong biSize %ld\n", bmih->biSize); ok(bmih->biPlanes == 1, "wrong biPlanes %d\n", bmih->biPlanes); ok(bmih->biBitCount == bpp, "wrong biBitCount %d\n", bmih->biBitCount);
image_size = DIB_GetWidthBytes(bmih->biWidth, bmih->biBitCount) * bmih->biHeight; - ok(bmih->biSizeImage == image_size, "wrong biSizeImage %u\n", bmih->biSizeImage); - ok(bmih->biWidth == bmpsize->cx && bmih->biHeight == bmpsize->cy, "Unexpected bitmap size %d x %d, " - "expected %d x %d\n", bmih->biWidth, bmih->biHeight, bmpsize->cx, bmpsize->cy); + ok(bmih->biSizeImage == image_size, "wrong biSizeImage %lu\n", bmih->biSizeImage); + ok(bmih->biWidth == bmpsize->cx && bmih->biHeight == bmpsize->cy, "Unexpected bitmap size %ld x %ld, " + "expected %ld x %ld\n", bmih->biWidth, bmih->biHeight, bmpsize->cx, bmpsize->cy);
if (0) { @@ -927,7 +927,7 @@ static void check_ilhead_data(const ILHEAD *ilh, INT cx, INT cy, INT cur, INT ma
ok(ilh->cx == cx, "wrong cx %d (expected %d)\n", ilh->cx, cx); ok(ilh->cy == cy, "wrong cy %d (expected %d)\n", ilh->cy, cy); - ok(ilh->bkcolor == CLR_NONE, "wrong bkcolor %x\n", ilh->bkcolor); + ok(ilh->bkcolor == CLR_NONE, "wrong bkcolor %lx\n", ilh->bkcolor); ok(ilh->flags == flags || broken(!(ilh->flags & 0xfe) && (flags & 0xfe) == ILC_COLOR4), /* <= w2k */ "wrong flags %04x\n", ilh->flags); ok(ilh->ovls[0] == -1, "wrong ovls[0] %04x\n", ilh->ovls[0]); @@ -1014,10 +1014,10 @@ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, IN ok(b, "%s: ImageList_Write failed\n", comment);
hr = GetHGlobalFromStream(stream.stream, &hglobal); - ok(hr == S_OK, "%s: Failed to get hglobal, %#x\n", comment, hr); + ok(hr == S_OK, "%s: Failed to get hglobal, %#lx\n", comment, hr);
hr = IStream_Stat(stream.stream, &stat, STATFLAG_NONAME); - ok(hr == S_OK, "Stat() failed, hr %#x.\n", hr); + ok(hr == S_OK, "Stat() failed, hr %#lx.\n", hr);
data = GlobalLock(hglobal);
@@ -1031,7 +1031,7 @@ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, IN &bmpsize, flags & 0xfe, comment); if (!is_v6_header(header) && size < stat.cbSize.LowPart - sizeof(ILHEAD)) /* mask is present */ { - ok( flags & ILC_MASK, "%s: extra data %u/%u but mask not expected\n", comment, stat.cbSize.LowPart, size ); + ok( flags & ILC_MASK, "%s: extra data %lu/%u but mask not expected\n", comment, stat.cbSize.LowPart, size ); check_bitmap_data(header, data + sizeof(ILHEAD) + size, stat.cbSize.LowPart - sizeof(ILHEAD) - size, &bmpsize, 1, comment); } @@ -1341,7 +1341,7 @@ static void test_shell_imagelist(void)
/* Get system image list */ hr = pSHGetImageList(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml); - ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr); + ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%lx\n", hr);
if (hr != S_OK) { FreeLibrary(hShell32); @@ -1358,7 +1358,7 @@ static void test_shell_imagelist(void) /* Check icon size matches */ IImageList_GetImageRect(iml, 0, &rect); ok(((rect.right == cx) && (rect.bottom == cy)), - "IImageList_GetImageRect returned r:%d,b:%d\n", + "IImageList_GetImageRect returned r:%ld,b:%ld\n", rect.right, rect.bottom);
IImageList_Release(iml); @@ -1530,7 +1530,7 @@ static void test_ImageList_DrawIndirect(void) ok(himl != 0, "ImageList_Create failed\n");
hr = pHIMAGELIST_QueryInterface(himl, &IID_IImageList, (void **) &imgl); - ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
/* Add a no-alpha image */ hbmImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_image); @@ -1540,14 +1540,14 @@ static void test_ImageList_DrawIndirect(void) ok(iImage != -1, "ImageList_Add failed\n");
hr = IImageList_GetItemFlags(imgl, 1000, &flags); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IImageList_GetItemFlags(imgl, 1000, NULL); - ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IImageList_GetItemFlags(imgl, iImage, &flags); - ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr); - ok(!flags, "Unexpected flags %#x.\n", flags); + ok(hr == S_OK, "Failed to get item flags, hr %#lx.\n", hr); + ok(!flags, "Unexpected flags %#lx.\n", flags);
/* Add an alpha image */ hbmAlphaImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_alpha); @@ -1557,8 +1557,8 @@ static void test_ImageList_DrawIndirect(void) ok(iAlphaImage != -1, "ImageList_Add failed\n");
hr = IImageList_GetItemFlags(imgl, iAlphaImage, &flags); - ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr); - ok(flags & ILIF_ALPHA, "Unexpected flags %#x.\n", flags); + ok(hr == S_OK, "Failed to get item flags, hr %#lx.\n", hr); + ok(flags & ILIF_ALPHA, "Unexpected flags %#lx.\n", flags);
/* Add a transparent alpha image */ hbmTransparentImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_transparent); @@ -1568,8 +1568,8 @@ static void test_ImageList_DrawIndirect(void) ok(iTransparentImage != -1, "ImageList_Add failed\n");
hr = IImageList_GetItemFlags(imgl, iTransparentImage, &flags); - ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr); - ok(flags & ILIF_ALPHA, "Unexpected flags %#x.\n", flags); + ok(hr == S_OK, "Failed to get item flags, hr %#lx.\n", hr); + ok(flags & ILIF_ALPHA, "Unexpected flags %#lx.\n", flags);
/* 32-bit Tests */ bitmapInfo.bmiHeader.biBitCount = 32; @@ -1682,31 +1682,31 @@ static void test_iimagelist(void) /* test reference counting on destruction */ imgl = (IImageList*)createImageList(32, 32); ret = IImageList_AddRef(imgl); - ok(ret == 2, "Expected 2, got %d\n", ret); + ok(ret == 2, "Expected 2, got %ld\n", ret); ret = pImageList_Destroy((HIMAGELIST)imgl); - ok(ret == TRUE, "Expected TRUE, got %d\n", ret); + ok(ret == TRUE, "Expected TRUE, got %ld\n", ret); ret = pImageList_Destroy((HIMAGELIST)imgl); - ok(ret == TRUE, "Expected TRUE, got %d\n", ret); + ok(ret == TRUE, "Expected TRUE, got %ld\n", ret); ret = pImageList_Destroy((HIMAGELIST)imgl); - ok(ret == FALSE, "Expected FALSE, got %d\n", ret); + ok(ret == FALSE, "Expected FALSE, got %ld\n", ret);
imgl = (IImageList*)createImageList(32, 32); ret = IImageList_AddRef(imgl); - ok(ret == 2, "Expected 2, got %d\n", ret); + ok(ret == 2, "Expected 2, got %ld\n", ret); ret = pImageList_Destroy((HIMAGELIST)imgl); - ok(ret == TRUE, "Expected TRUE, got %d\n", ret); + ok(ret == TRUE, "Expected TRUE, got %ld\n", ret); ret = IImageList_Release(imgl); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ret = pImageList_Destroy((HIMAGELIST)imgl); - ok(ret == FALSE, "Expected FALSE, got %d\n", ret); + ok(ret == FALSE, "Expected FALSE, got %ld\n", ret);
/* ref counting, HIMAGELIST_QueryInterface adds a reference */ imgl = (IImageList*)createImageList(32, 32); hr = pHIMAGELIST_QueryInterface((HIMAGELIST)imgl, &IID_IImageList, (void**)&imgl2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); ok(imgl2 == imgl, "got different pointer\n"); ret = IImageList_Release(imgl); - ok(ret == 1, "got %u\n", ret); + ok(ret == 1, "got %lu\n", ret); IImageList_Release(imgl);
if (!pImageList_CoCreateInstance) @@ -1716,7 +1716,7 @@ static void test_iimagelist(void) }
hr = pImageList_CoCreateInstance(&CLSID_ImageList, NULL, &IID_IImageList, (void **) &imgl); - ok(SUCCEEDED(hr), "ImageList_CoCreateInstance failed, hr=%x\n", hr); + ok(SUCCEEDED(hr), "ImageList_CoCreateInstance failed, hr=%lx\n", hr);
if (hr == S_OK) IImageList_Release(imgl); @@ -1727,7 +1727,7 @@ static void test_iimagelist(void) return;
hr = pHIMAGELIST_QueryInterface(himl, &IID_IImageList, (void **) &imgl); - ok(SUCCEEDED(hr), "HIMAGELIST_QueryInterface failed, hr=%x\n", hr); + ok(SUCCEEDED(hr), "HIMAGELIST_QueryInterface failed, hr=%lx\n", hr);
if (hr == S_OK) IImageList_Release(imgl); @@ -1741,7 +1741,7 @@ static void test_iimagelist(void) win_skip("IImageList2 is not supported.\n"); return; } - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); IImageList2_Release(imagelist); }
@@ -1773,7 +1773,7 @@ static void test_IImageList_Add_Remove(void)
/* remove when nothing exists */ hr = IImageList_Remove(imgl, 0); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
/* removing everything from an empty imagelist should succeed */ hr = IImageList_Remove(imgl, -1); @@ -1788,7 +1788,7 @@ static void test_IImageList_Add_Remove(void) ok( IImageList_ReplaceIcon(imgl, -1, hicon3, &ret) == S_OK && (ret == 2),"failed to add icon3\n");
/* remove an index out of range */ - ok( IImageList_Remove(imgl, 4711) == E_INVALIDARG, "got 0x%08x\n", hr); + ok( IImageList_Remove(imgl, 4711) == E_INVALIDARG, "got 0x%08lx\n", hr);
/* remove three */ ok( IImageList_Remove(imgl,0) == S_OK, "can't remove 0\n"); @@ -1796,7 +1796,7 @@ static void test_IImageList_Add_Remove(void) ok( IImageList_Remove(imgl,0) == S_OK, "can't remove 0\n");
/* remove one extra */ - ok( IImageList_Remove(imgl, 0) == E_INVALIDARG, "got 0x%08x\n", hr); + ok( IImageList_Remove(imgl, 0) == E_INVALIDARG, "got 0x%08lx\n", hr);
IImageList_Release(imgl); ok(DestroyIcon(hicon1),"icon 1 wasn't deleted\n"); @@ -1819,17 +1819,17 @@ static void test_IImageList_Get_SetImageCount(void)
/* check SetImageCount/GetImageCount */ hr = IImageList_SetImageCount(imgl, 3); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); ret = 0; hr = IImageList_GetImageCount(imgl, &ret); ok(hr == S_OK && ret == 3, "invalid image count after increase\n"); hr = IImageList_SetImageCount(imgl, 1); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); ret = 0; hr = IImageList_GetImageCount(imgl, &ret); ok(hr == S_OK && ret == 1, "invalid image count after decrease to 1\n"); hr = IImageList_SetImageCount(imgl, 0); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); ret = -1; hr = IImageList_GetImageCount(imgl, &ret); ok(hr == S_OK && ret == 0, "invalid image count after decrease to 0\n"); @@ -1887,7 +1887,7 @@ if (0)
memset(&imldp, 0, sizeof (imldp)); hr = IImageList_Draw(imgl, &imldp); - ok( hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok( hr == E_INVALIDARG, "got 0x%08lx\n", hr);
imldp.cbSize = IMAGELISTDRAWPARAMS_V3_SIZE; imldp.hdcDst = hdc; @@ -2334,14 +2334,14 @@ static void test_loadimage(void) IMAGE_BITMAP, LR_CREATEDIBSECTION ); ok( list != NULL, "got %p\n", list ); flags = pImageList_GetFlags( list ); - ok( flags == (ILC_COLOR4 | ILC_MASK), "got %08x\n", flags ); + ok( flags == (ILC_COLOR4 | ILC_MASK), "got %08lx\n", flags ); pImageList_Destroy( list );
list = pImageList_LoadImageW( hinst, MAKEINTRESOURCEW(IDB_BITMAP_128x15), 16, 1, CLR_NONE, IMAGE_BITMAP, LR_CREATEDIBSECTION ); ok( list != NULL, "got %p\n", list ); flags = pImageList_GetFlags( list ); - ok( flags == ILC_COLOR4, "got %08x\n", flags ); + ok( flags == ILC_COLOR4, "got %08lx\n", flags ); pImageList_Destroy( list ); }
@@ -2470,9 +2470,9 @@ if (0) }
hr = IImageList_Clone(imgl, &IID_IImageList, (void**)&imgl2); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); ref = IImageList_Release(imgl2); - ok(ref == 0, "got %u\n", ref); + ok(ref == 0, "got %lu\n", ref);
IImageList_Release(imgl); } @@ -2494,7 +2494,7 @@ if (0) }
hr = IImageList_GetBkColor(imgl, &color); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr);
IImageList_Release(imgl); } @@ -2516,15 +2516,15 @@ if (0) }
hr = IImageList_SetBkColor(imgl, CLR_NONE, &color); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IImageList_SetBkColor(imgl, CLR_NONE, &color); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr);
color = 0xdeadbeef; hr = IImageList_GetBkColor(imgl, &color); - ok(hr == S_OK, "got 0x%08x\n", hr); - ok(color == CLR_NONE, "got %x\n", color); + ok(hr == S_OK, "got 0x%08lx\n", hr); + ok(color == CLR_NONE, "got %lx\n", color);
IImageList_Release(imgl); } @@ -2547,7 +2547,7 @@ if (0)
count = -1; hr = IImageList_GetImageCount(imgl, &count); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); ok(count == 0, "got %d\n", count);
IImageList_Release(imgl); @@ -2564,13 +2564,13 @@ static void test_IImageList_GetIconSize(void) imgl = (IImageList*)himl;
hr = IImageList_GetIconSize(imgl, NULL, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IImageList_GetIconSize(imgl, &cx, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IImageList_GetIconSize(imgl, NULL, &cy); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
IImageList_Release(imgl); } @@ -2585,13 +2585,13 @@ static void test_ImageList_WriteEx(void) ok(himl != 0, "Failed to create an imagelist.\n");
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = pImageList_WriteEx(himl, ILP_NORMAL, stream); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = pImageList_WriteEx(himl, ILP_DOWNLEVEL, stream); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream); pImageList_Destroy(himl); diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index d5c782159ce..cb311b1fc77 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -195,7 +195,7 @@ static void keypress(HWND handle, WPARAM keycode, BYTE scancode, BOOL extended) }
#define listbox_field_ok(t, s, f, got) \ - ok (t.s.f==got.f, "style %#x, step " #s ", field " #f \ + ok (t.s.f==got.f, "style %#lx, step " #s ", field " #f \ ": expected %d, got %d\n", style, t.s.f, got.f)
#define listbox_todo_field_ok(t, s, f, got) \ @@ -307,20 +307,20 @@ static void test_item_height(void) ok (SendMessageA(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set font\n");
itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); - ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %d\n", itemHeight, tm.tmHeight); + ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %ld\n", itemHeight, tm.tmHeight);
DestroyWindow (hLB);
hLB = CreateWindowA(WC_LISTBOXA, "TestList", LBS_OWNERDRAWVARIABLE, 0, 0, 100, 100, NULL, NULL, NULL, 0);
itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); - ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %d.\n", + ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %ld.\n", itemHeight, tm.tmHeight); itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 5, 0); - ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %d.\n", + ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %ld.\n", itemHeight, tm.tmHeight); itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, -5, 0); - ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %d.\n", + ok(itemHeight > 0 && itemHeight <= tm.tmHeight, "Unexpected item height %d, expected %ld.\n", itemHeight, tm.tmHeight);
DestroyWindow (hLB); @@ -367,7 +367,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA m.lParam = mis->itemData ? hash_Ly((const char *)mis->itemData) : 0; add_message(sequences, PARENT_SEQ_INDEX, &m);
- ok(wParam == mis->CtlID, "got wParam=%08lx, expected %08x\n", wParam, mis->CtlID); + ok(wParam == mis->CtlID, "got wParam=%08Ix, expected %08x\n", wParam, mis->CtlID); ok(mis->CtlType == ODT_LISTBOX, "mi->CtlType = %u\n", mis->CtlType); ok(mis->CtlID == 1, "mi->CtlID = %u\n", mis->CtlID); ok(mis->itemHeight, "mi->itemHeight = 0\n"); @@ -380,7 +380,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA HWND ctrl = GetDlgItem(hwnd, cis->CtlID); BOOL is_unicode_data = TRUE;
- ok(wParam == cis->CtlID, "expected %#x, got %#lx\n", cis->CtlID, wParam); + ok(wParam == cis->CtlID, "expected %#x, got %#Ix\n", cis->CtlID, wParam); ok(cis->hwndItem == ctrl, "expected %p, got %p\n", ctrl, cis->hwndItem); ok((int)cis->itemID1 >= 0, "expected >= 0, got %d\n", cis->itemID1); ok((int)cis->itemID2 == -1, "expected -1, got %d\n", cis->itemID2); @@ -406,7 +406,7 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA RECT rc_item, rc_client, rc_clip; DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
- ok(wParam == dis->CtlID, "got wParam=%08lx instead of %08x\n", wParam, dis->CtlID); + ok(wParam == dis->CtlID, "got wParam=%08Ix instead of %08x\n", wParam, dis->CtlID); ok(dis->CtlType == ODT_LISTBOX, "wrong CtlType %04x\n", dis->CtlType);
GetClientRect(dis->hwndItem, &rc_client); @@ -508,14 +508,14 @@ static void test_ownerdraw(void)
SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc); ok(!IsRectEmpty(&rc), "empty item rect\n"); - ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top); + ok(rc.top < 0, "rc.top is not negative (%ld)\n", rc.top);
DestroyWindow(hLB);
/* Both FIXED and VARIABLE, FIXED should override VARIABLE. */ hLB = CreateWindowA(WC_LISTBOXA, "TestList", LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE | styles[i], 0, 0, 100, 100, NULL, NULL, NULL, 0); - ok(hLB != NULL, "last error 0x%08x\n", GetLastError()); + ok(hLB != NULL, "last error 0x%08lx\n", GetLastError());
ok(GetWindowLongA(hLB, GWL_STYLE) & LBS_OWNERDRAWVARIABLE, "Unexpected window style.\n");
@@ -915,70 +915,70 @@ static void test_changing_selection_styles(void) for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) { ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)"x"); - ok(ret == k, "%u: Unexpected return value %d, expected %d.\n", j, ret, k); + ok(ret == k, "%u: Unexpected return value %ld, expected %d.\n", j, ret, k); } ret = SendMessageA(listbox, LB_GETCOUNT, 0, 0); - ok(ret == ARRAY_SIZE(selexpect_multi), "%u: Unexpected count %d.\n", j, ret); + ok(ret == ARRAY_SIZE(selexpect_multi), "%u: Unexpected count %ld.\n", j, ret);
/* Select items with different methods */ ret = SendMessageA(listbox, LB_SETCURSEL, 2, 0); - ok(ret == setcursel_expect, "%u: Unexpected return value %d.\n", j, ret); + ok(ret == setcursel_expect, "%u: Unexpected return value %ld.\n", j, ret); ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 0)); - ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret); ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 2)); - ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret);
/* Verify that the proper items are selected */ for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) { ret = SendMessageA(listbox, LB_GETSEL, k, 0); - ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n", + ok(ret == selexpect[k], "%u: Unexpected selection state %ld, expected %ld.\n", j, ret, selexpect[k]); }
/* Now change the selection style */ style = GetWindowLongA(listbox, GWL_STYLE); ok((style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == selstyles[j], - "%u: unexpected window styles %#x.\n", j, style); + "%u: unexpected window styles %#lx.\n", j, style); if (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) style &= ~selstyles[j]; else style |= LBS_MULTIPLESEL | LBS_EXTENDEDSEL; SetWindowLongA(listbox, GWL_STYLE, style); style = GetWindowLongA(listbox, GWL_STYLE); - ok(!(style & selstyles[j]), "%u: unexpected window styles %#x.\n", j, style); + ok(!(style & selstyles[j]), "%u: unexpected window styles %#lx.\n", j, style);
/* Verify that the same items are selected */ ret = SendMessageA(listbox, LB_GETSELCOUNT, 0, 0); - ok(ret == getselcount_expect, "%u: expected %d from LB_GETSELCOUNT, got %d\n", + ok(ret == getselcount_expect, "%u: expected %ld from LB_GETSELCOUNT, got %ld\n", j, getselcount_expect, ret);
for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) { ret = SendMessageA(listbox, LB_GETSEL, k, 0); - ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n", + ok(ret == selexpect[k], "%u: Unexpected selection state %ld, expected %ld.\n", j, ret, selexpect[k]); }
/* Lastly see if we can still change the selection as before with old style */ if (setcursel_expect != LB_ERR) setcursel_expect = 0; ret = SendMessageA(listbox, LB_SETCURSEL, 0, 0); - ok(ret == setcursel_expect, "%u: Unexpected return value %d.\n", j, ret); + ok(ret == setcursel_expect, "%u: Unexpected return value %ld.\n", j, ret); ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 1)); - ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret); ret = SendMessageA(listbox, LB_SELITEMRANGE, FALSE, MAKELPARAM(2, 2)); - ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + ok(ret == selitemrange_expect, "%u: Unexpected return value %ld.\n", j, ret);
/* And verify the selections */ selexpect = (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) ? selexpect_multi2 : selexpect_single2; ret = SendMessageA(listbox, LB_GETSELCOUNT, 0, 0); - ok(ret == getselcount_expect, "%u: expected %d from LB_GETSELCOUNT, got %d\n", + ok(ret == getselcount_expect, "%u: expected %ld from LB_GETSELCOUNT, got %ld\n", j, getselcount_expect, ret);
for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) { ret = SendMessageA(listbox, LB_GETSEL, k, 0); - ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n", + ok(ret == selexpect[k], "%u: Unexpected selection state %ld, expected %ld.\n", j, ret, selexpect[k]); }
@@ -1001,13 +1001,13 @@ static void test_itemfrompoint(void) RECT rc;
r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 )); - ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#x.\n", r ); + ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#lx.\n", r );
r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 700, 30 )); - ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#x.\n", r ); + ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#lx.\n", r );
r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 30, 300 )); - ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#x.\n", r ); + ok( r == MAKELPARAM(0xffff, 1), "Unexpected ret value %#lx.\n", r );
id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); ok( id == 0, "item id wrong\n"); @@ -1015,16 +1015,16 @@ static void test_itemfrompoint(void) ok( id == 1, "item id wrong\n");
r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 )); - ok( r == 0x1, "ret %x\n", r ); + ok( r == 0x1, "ret %lx\n", r );
r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 601 )); - ok( r == MAKELPARAM(1, 1), "Unexpected ret value %#x.\n", r ); + ok( r == MAKELPARAM(1, 1), "Unexpected ret value %#lx.\n", r );
/* Resize control so that below assertions about sizes are valid */ r = SendMessageA( hList, LB_GETITEMRECT, 0, (LPARAM)&rc); - ok( r == 1, "ret %x\n", r); + ok( r == 1, "ret %lx\n", r); r = MoveWindow(hList, 1, 1, 600, (rc.bottom - rc.top + 1) * 9 / 2, TRUE); - ok( r != 0, "ret %x\n", r); + ok( r != 0, "ret %lx\n", r);
id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi2"); ok( id == 2, "item id wrong\n"); @@ -1044,27 +1044,27 @@ static void test_itemfrompoint(void)
SendMessageA( hList, LB_SETTOPINDEX, 1, 0); r = SendMessageA( hList, LB_GETTOPINDEX, 0, 0); - ok( r == 1, "top %d\n", r); + ok( r == 1, "top %ld\n", r);
r = SendMessageA( hList, LB_GETITEMRECT, 5, (LPARAM)&rc); - ok( r == 1, "ret %x\n", r); + ok( r == 1, "ret %lx\n", r); r = SendMessageA( hList, LB_GETITEMRECT, 6, (LPARAM)&rc); - ok( r == 0, "ret %x\n", r); + ok( r == 0, "ret %lx\n", r);
r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(/* x */ 10, /* y */ 10) ); - ok( r == 1, "ret %x\n", r); + ok( r == 1, "ret %lx\n", r);
r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(1000, 10) ); - ok( r == 0x10001, "ret %x\n", r ); + ok( r == 0x10001, "ret %lx\n", r );
r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, -10) ); - ok( r == 0x10001, "ret %x\n", r ); + ok( r == 0x10001, "ret %lx\n", r );
r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 100) ); - ok( r == 0x10005, "item %x\n", r ); + ok( r == 0x10005, "item %lx\n", r );
r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 200) ); - ok( r == 0x10005, "item %x\n", r ); + ok( r == 0x10005, "item %lx\n", r );
DestroyWindow( hList ); } @@ -1117,7 +1117,7 @@ static void test_listbox_LB_DIR(void) ok(ret, "Failed to create test directory.\n");
file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); - ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %ld\n", GetLastError()); CloseHandle( file );
/* NOTE: for this test to succeed, there must be no subdirectories @@ -1141,7 +1141,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer); } - ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox */ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); @@ -1168,7 +1168,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, "w*.c"); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer); - ok (res >= 0, "SendMessage(LB_DIR, 0, w*.c) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, 0, w*.c) failed - 0x%08lx\n", GetLastError());
/* Path specification does NOT converted to uppercase */ ok (!strcmp(pathBuffer, "w*.c"), @@ -1197,7 +1197,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08x\n", GetLastError()); + ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. * All files plus "[..]" @@ -1225,7 +1225,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, "w*.c"); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); - ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. Since the parent directory does not * fit w*.c, there should be exactly the same number of items as without DDL_DIRECTORY @@ -1254,7 +1254,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); - ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be at least one element before, since the string "[-c-]" should @@ -1299,7 +1299,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *) failed - 0x%08x\n", GetLastError()); + ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be at least one element before, since the string "[-c-]" should @@ -1326,7 +1326,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, "w*.c"); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, w*.c) failed - 0x%08x\n", GetLastError()); + ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, w*.c) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be at least one element before, since the string "[-c-]" should @@ -1364,7 +1364,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08x\n", GetLastError()); + ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be exactly the number of plain files, plus the number of mapped drives. @@ -1402,7 +1402,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, "w*.c"); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed - 0x%08x\n", GetLastError()); + ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be exactly the number of plain files, plus the number of mapped drives. @@ -1436,7 +1436,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); - ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %u\n", + ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %lu\n", GetLastError());
itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); @@ -1479,7 +1479,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, wildcard); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError()); + ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08lx\n", GetLastError());
/* There should be no plain files on the listbox */ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); @@ -1514,7 +1514,7 @@ static void test_listbox_LB_DIR(void) strcpy(pathBuffer, "w*.c"); SendMessageA(hList, LB_RESETCONTENT, 0, 0); res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); - ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08lx\n", GetLastError());
/* There should be no plain files on the listbox, and no [..], since it does not fit w*.c */ itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); @@ -1615,7 +1615,7 @@ static void test_listbox_dlgdir(void) BOOL ret;
file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); - ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %ld\n", GetLastError()); CloseHandle( file );
/* NOTE: for this test to succeed, there must be no subdirectories @@ -1644,7 +1644,7 @@ static void test_listbox_dlgdir(void) */ strcpy(pathBuffer, "w*.c"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0); - ok (res == 1, "DlgDirList(*.c, 0) returned %d - expected 1 - 0x%08x\n", res, GetLastError()); + ok (res == 1, "DlgDirList(*.c, 0) returned %d - expected 1 - 0x%08lx\n", res, GetLastError());
/* Path specification gets converted to uppercase */ ok (!strcmp(pathBuffer, "W*.C"), @@ -1681,7 +1681,7 @@ static void test_listbox_dlgdir(void) /* Test DDL_DIRECTORY */ strcpy(pathBuffer, "w*.c"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY); - ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08x\n", GetLastError()); + ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be exactly more elements than before, since the directories should @@ -1725,7 +1725,7 @@ static void test_listbox_dlgdir(void) /* Test DDL_DRIVES. At least on WinXP-SP2, this implies DDL_EXCLUSIVE */ strcpy(pathBuffer, "w*.c"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DRIVES); - ok (res == 1, "DlgDirList(*.c, DDL_DRIVES) failed - 0x%08x\n", GetLastError()); + ok (res == 1, "DlgDirList(*.c, DDL_DRIVES) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be at least one element before, since the string "[-c-]" should @@ -1765,7 +1765,7 @@ static void test_listbox_dlgdir(void) /* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */ strcpy(pathBuffer, "w*.c"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES); - ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n", GetLastError()); + ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08lx\n", GetLastError());
/* There should be some content in the listbox. In particular, there should * be exactly the number of plain files, plus the number of mapped drives, @@ -1808,7 +1808,7 @@ static void test_listbox_dlgdir(void) /* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */ strcpy(pathBuffer, "w*.c"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_EXCLUSIVE); - ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed - 0x%08x\n", GetLastError()); + ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed - 0x%08lx\n", GetLastError());
/* There should be exactly one element: "[..]" */ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); @@ -1834,7 +1834,7 @@ static void test_listbox_dlgdir(void) /* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */ strcpy(pathBuffer, "w*.c"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE); - ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed - 0x%08x\n", GetLastError()); + ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed - 0x%08lx\n", GetLastError());
/* There should be no plain files on the listbox */ itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); @@ -1866,14 +1866,14 @@ static void test_listbox_dlgdir(void) /* Fill with everything - drives, directory and all plain files. */ strcpy(pathBuffer, "*"); res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES); - ok (res != 0, "DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n", GetLastError()); + ok (res != 0, "DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08lx\n", GetLastError());
SendMessageA(g_listBox, LB_SETCURSEL, -1, 0); /* Unselect any current selection */ memset(pathBuffer, 0, MAX_PATH); SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef to 0x%08lx\n", GetLastError()); ok (res == 0, "DlgDirSelectEx() with no selection returned %d, expected 0\n", res); /* WinXP-SP2 leaves pathBuffer untouched, but Win98 fills it with garbage. */ @@ -1897,7 +1897,7 @@ static void test_listbox_dlgdir(void) SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n", i, GetLastError()); ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
@@ -1911,7 +1911,7 @@ static void test_listbox_dlgdir(void) SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n", i, GetLastError()); ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
@@ -1930,7 +1930,7 @@ static void test_listbox_dlgdir(void) SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n", i, GetLastError()); ok(res == 0, "DlgDirSelectEx() thinks %s (%s) is a drive/directory!\n", itemBuffer, pathBuffer);
@@ -1966,7 +1966,7 @@ static void test_listbox_dlgdir(void) SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n", i, GetLastError()); ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
@@ -1980,7 +1980,7 @@ static void test_listbox_dlgdir(void) SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n", i, GetLastError()); ok(res == 1, "DlgDirSelectEx() thinks %s (%s) is not a drive/directory!\n", itemBuffer, pathBuffer);
@@ -1999,7 +1999,7 @@ static void test_listbox_dlgdir(void) SetLastError(0xdeadbeef); res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, - "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", + "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08lx\n", i, GetLastError()); ok(res == 0, "DlgDirSelectEx() thinks %s (%s) is a drive/directory!\n", itemBuffer, pathBuffer);
@@ -2029,7 +2029,7 @@ static void test_listbox_dlgdir(void) res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); ok(!res, "DlgDirList should have failed with 0 but %d was returned\n", res); ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS, - "GetLastError should return 0x589, got 0x%X\n",GetLastError()); + "GetLastError should return 0x589, got 0x%lX\n",GetLastError());
DestroyWindow(hWnd); } @@ -2054,9 +2054,9 @@ static void test_set_count( void ) ok( IsRectEmpty( &r ), "got non-empty rect\n");
ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); - ok( ret == 0, "got %d\n", ret ); + ok( ret == 0, "got %ld\n", ret ); ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 ); - ok( ret == 100, "got %d\n", ret ); + ok( ret == 100, "got %ld\n", ret );
GetUpdateRect( listbox, &r, TRUE ); ok( !IsRectEmpty( &r ), "got empty rect\n"); @@ -2066,15 +2066,15 @@ static void test_set_count( void ) ok( IsRectEmpty( &r ), "got non-empty rect\n");
ret = SendMessageA( listbox, LB_SETCOUNT, 99, 0 ); - ok( ret == 0, "got %d\n", ret ); + ok( ret == 0, "got %ld\n", ret );
GetUpdateRect( listbox, &r, TRUE ); ok( !IsRectEmpty( &r ), "got empty rect\n");
ret = SendMessageA( listbox, LB_SETCOUNT, -5, 0 ); - ok( ret == 0, "got %d\n", ret ); + ok( ret == 0, "got %ld\n", ret ); ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 ); - ok( ret == -5, "got %d\n", ret ); + ok( ret == -5, "got %ld\n", ret );
DestroyWindow( listbox );
@@ -2084,8 +2084,8 @@ static void test_set_count( void )
SetLastError( 0xdeadbeef ); ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); - ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret ); - ok( GetLastError() == 0xdeadbeef, "Unexpected error %d.\n", GetLastError() ); + ok( ret == LB_ERR, "expected %d, got %ld\n", LB_ERR, ret ); + ok( GetLastError() == 0xdeadbeef, "Unexpected error %ld.\n", GetLastError() );
DestroyWindow( listbox ); } @@ -2108,7 +2108,7 @@ static void test_GetListBoxInfo(void)
flush_sequences(sequences, NUM_MSG_SEQUENCES); ret = GetListBoxInfo(listbox); - ok(ret > 0, "got %d\n", ret); + ok(ret > 0, "got %ld\n", ret); ok_sequence(sequences, LB_SEQ_INDEX, getlistboxinfo_seq, "GetListBoxInfo()", FALSE);
DestroyWindow(listbox); @@ -2133,45 +2133,45 @@ static void test_init_storage( void ) 0, 0, 100, 100, parent, (HMENU)ID_LISTBOX, NULL, 0);
items_size = SendMessageA(listbox, LB_INITSTORAGE, 100, 0); - ok(items_size >= 100, "expected at least 100, got %d\n", items_size); + ok(items_size >= 100, "expected at least 100, got %ld\n", items_size);
ret = SendMessageA(listbox, LB_INITSTORAGE, 0, 0); - ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
/* it doesn't grow since the space was already reserved */ ret = SendMessageA(listbox, LB_INITSTORAGE, items_size, 0); - ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
/* it doesn't shrink the reserved space */ ret = SendMessageA(listbox, LB_INITSTORAGE, 42, 0); - ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
/* now populate almost all of it so it's not reserved anymore */ if (styles[i] & LBS_NODATA) { ret = SendMessageA(listbox, LB_SETCOUNT, items_size - 1, 0); - ok(ret == 0, "unexpected return value %d\n", ret); + ok(ret == 0, "unexpected return value %ld\n", ret); } else { for (j = 0; j < items_size - 1; j++) { ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)""); - ok(ret == j, "expected %d, got %d\n", j, ret); + ok(ret == j, "expected %d, got %ld\n", j, ret); } }
/* we still have one more reserved slot, so it doesn't grow yet */ ret = SendMessageA(listbox, LB_INITSTORAGE, 1, 0); - ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret);
/* fill the slot and check again, it should grow this time */ ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)""); - ok(ret == items_size - 1, "expected %d, got %d\n", items_size - 1, ret); + ok(ret == items_size - 1, "expected %ld, got %ld\n", items_size - 1, ret); ret = SendMessageA(listbox, LB_INITSTORAGE, 0, 0); - ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + ok(ret == items_size, "expected %ld, got %ld\n", items_size, ret); ret = SendMessageA(listbox, LB_INITSTORAGE, 1, 0); - ok(ret > items_size, "expected it to grow past %d, got %d\n", items_size, ret); + ok(ret > items_size, "expected it to grow past %ld, got %ld\n", items_size, ret);
DestroyWindow(listbox); } @@ -2213,7 +2213,7 @@ static void test_extents(void) listbox = create_listbox(WS_CHILD | WS_VISIBLE, parent);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 0, "Got wrong initial horizontal extent: %u\n", res); + ok(res == 0, "Got wrong initial horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2228,7 +2228,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 64, "Got wrong horizontal extent: %u\n", res); + ok(res == 64, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2243,7 +2243,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 184, "Got wrong horizontal extent: %u\n", res); + ok(res == 184, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2259,7 +2259,7 @@ static void test_extents(void) listbox = create_listbox(WS_CHILD | WS_VISIBLE | WS_HSCROLL, parent);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 0, "Got wrong initial horizontal extent: %u\n", res); + ok(res == 0, "Got wrong initial horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2274,7 +2274,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 64, "Got wrong horizontal extent: %u\n", res); + ok(res == 64, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2289,7 +2289,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 184, "Got wrong horizontal extent: %u\n", res); + ok(res == 184, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2303,7 +2303,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 0, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 0, "Got wrong horizontal extent: %u\n", res); + ok(res == 0, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2320,7 +2320,7 @@ static void test_extents(void) listbox = create_listbox(WS_CHILD | WS_VISIBLE | WS_HSCROLL | LBS_DISABLENOSCROLL, parent);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 0, "Got wrong initial horizontal extent: %u\n", res); + ok(res == 0, "Got wrong initial horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2335,7 +2335,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 64, "Got wrong horizontal extent: %u\n", res); + ok(res == 64, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2350,7 +2350,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 184, "Got wrong horizontal extent: %u\n", res); + ok(res == 184, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2364,7 +2364,7 @@ static void test_extents(void) SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 0, 0);
res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); - ok(res == 0, "Got wrong horizontal extent: %u\n", res); + ok(res == 0, "Got wrong horizontal extent: %lu\n", res);
sinfo.cbSize = sizeof(sinfo); sinfo.fMask = SIF_RANGE; @@ -2484,14 +2484,14 @@ static void test_WM_MEASUREITEM(void) listbox = create_listbox(WS_CHILD | LBS_OWNERDRAWVARIABLE, parent);
data = SendMessageA(listbox, LB_GETITEMDATA, 0, 0); - ok(data == (LRESULT)strings[0], "data = %08lx, expected %p\n", data, strings[0]); + ok(data == (LRESULT)strings[0], "data = %08Ix, expected %p\n", data, strings[0]); DestroyWindow(parent);
parent = create_parent(); listbox = create_listbox(WS_CHILD | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS, parent);
data = SendMessageA(listbox, LB_GETITEMDATA, 0, 0); - ok(!data, "data = %08lx\n", data); + ok(!data, "data = %08Ix\n", data);
/* LBS_HASSTRINGS */ parent = create_parent(); @@ -2502,11 +2502,11 @@ static void test_WM_MEASUREITEM(void) flush_sequences(sequences, NUM_MSG_SEQUENCES);
ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0"); - ok(ret == 0, "expected 0, got %ld\n", ret); + ok(ret == 0, "expected 0, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1"); - ok(ret == 1, "expected 1, got %ld\n", ret); + ok(ret == 1, "expected 1, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2"); - ok(ret == 2, "expected 2, got %ld\n", ret); + ok(ret == 2, "expected 2, got %Id\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, lb_addstring_ownerdraw_parent_seq, "LB_ADDSTRING (LBS_HASSTRINGS, ownerdraw)", FALSE); @@ -2520,11 +2520,11 @@ static void test_WM_MEASUREITEM(void) flush_sequences(sequences, NUM_MSG_SEQUENCES);
ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0"); - ok(ret == 0, "expected 0, got %ld\n", ret); + ok(ret == 0, "expected 0, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1"); - ok(ret == 1, "expected 1, got %ld\n", ret); + ok(ret == 1, "expected 1, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2"); - ok(ret == 2, "expected 2, got %ld\n", ret); + ok(ret == 2, "expected 2, got %Id\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, lb_addstring_sort_parent_seq, "LB_ADDSTRING (LBS_SORT)", FALSE); DestroyWindow(listbox); @@ -2537,11 +2537,11 @@ static void test_WM_MEASUREITEM(void) flush_sequences(sequences, NUM_MSG_SEQUENCES);
ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2"); - ok(ret == 0, "expected 0, got %ld\n", ret); + ok(ret == 0, "expected 0, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0"); - ok(ret == 1, "expected 1, got %ld\n", ret); + ok(ret == 1, "expected 1, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1"); - ok(ret == 2, "expected 2, got %ld\n", ret); + ok(ret == 2, "expected 2, got %Id\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "LB_ADDSTRING (LBS_HASSTRINGS)", FALSE); DestroyWindow(listbox); @@ -2554,11 +2554,11 @@ static void test_WM_MEASUREITEM(void) flush_sequences(sequences, NUM_MSG_SEQUENCES);
ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2"); - ok(ret == 0, "expected 0, got %ld\n", ret); + ok(ret == 0, "expected 0, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0"); - ok(ret == 0, "expected 0, got %ld\n", ret); + ok(ret == 0, "expected 0, got %Id\n", ret); ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1"); - ok(ret == 1, "expected 1, got %ld\n", ret); + ok(ret == 1, "expected 1, got %Id\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "LB_ADDSTRING (LBS_HASSTRINGS, LBS_SORT)", FALSE); DestroyWindow(listbox); @@ -2667,7 +2667,7 @@ static void test_LBS_NODATA(void) ok(listbox != NULL, "Failed to create a listbox.\n");
style = GetWindowLongA(listbox, GWL_STYLE); - ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#x.\n", i, style); + ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#lx.\n", i, style); ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0); ok(ret == LB_ERR, "%u: unexpected return value %d.\n", i, ret); DestroyWindow(listbox); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 1718bf71342..ca263cd644a 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -49,14 +49,14 @@ enum seq_index { #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
#define expect2(expected1, expected2, got1, got2) expect2_(__LINE__, expected1, expected2, got1, got2) static inline void expect2_(unsigned line, DWORD expected1, DWORD expected2, DWORD got1, DWORD got2) { ok_(__FILE__, line)(expected1 == got1 && expected2 == got2, - "expected (%d,%d), got (%d,%d)\n", + "expected (%ld,%ld), got (%ld,%ld)\n", expected1, expected2, got1, got2); }
@@ -702,7 +702,7 @@ static HWND create_listview_control(DWORD style) WS_CHILD | WS_BORDER | WS_VISIBLE | style, 0, 0, rect.right, rect.bottom, hwndparent, NULL, GetModuleHandleA(NULL), NULL); - ok(hwnd != NULL, "gle=%d\n", GetLastError()); + ok(hwnd != NULL, "gle=%ld\n", GetLastError());
if (!hwnd) return NULL;
@@ -725,7 +725,7 @@ static HWND create_listview_controlW(DWORD style, HWND parent) WS_CHILD | WS_BORDER | WS_VISIBLE | style, 0, 0, rect.right, rect.bottom, parent, NULL, GetModuleHandleW(NULL), NULL); - ok(hwnd != NULL, "gle=%d\n", GetLastError()); + ok(hwnd != NULL, "gle=%ld\n", GetLastError());
if (!hwnd) return NULL;
@@ -1094,7 +1094,7 @@ static void test_checkboxes(void)
/* Set the style again and check that doesn't change an item's state */ r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); - ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r); + ok(r == LVS_EX_CHECKBOXES, "ret %lx\n", r);
item.iItem = 3; item.mask = LVIF_STATE; @@ -1105,7 +1105,7 @@ static void test_checkboxes(void)
/* Unsetting the checkbox extended style doesn't change an item's state */ r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, 0); - ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r); + ok(r == LVS_EX_CHECKBOXES, "ret %lx\n", r);
item.iItem = 3; item.mask = LVIF_STATE; @@ -1241,7 +1241,7 @@ static void test_items(void) expect(1, r); ok(item.state & LVIS_SELECTED, "Expected LVIS_SELECTED\n"); r = SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); - ok(r, "got %d\n", r); + ok(r, "got %ld\n", r);
/* LVIS_SELECTED with zero stateMask */ /* set */ @@ -1264,7 +1264,7 @@ static void test_items(void) expect(1, r); ok(item.state & LVIS_FOCUSED, "Expected LVIS_FOCUSED\n"); r = SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); - ok(r, "got %d\n", r); + ok(r, "got %ld\n", r);
/* LVIS_CUT with LVIS_FOCUSED stateMask */ /* set */ @@ -1287,7 +1287,7 @@ static void test_items(void) expect(1, r); ok(item.state & LVIS_CUT, "Expected LVIS_CUT\n"); r = SendMessageA(hwnd, LVM_DELETEITEM, 0, 0); - ok(r, "got %d\n", r); + ok(r, "got %ld\n", r);
/* Insert an item with just a param */ memset (&item, 0xcc, sizeof (item)); @@ -1305,7 +1305,7 @@ static void test_items(void) item.iSubItem = 0; r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); - ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest); + ok(item.lParam == lparamTest, "got lParam %Ix, expected %Ix\n", item.lParam, lparamTest);
/* Set up a subitem */ memset (&item, 0xcc, sizeof (item)); @@ -1350,7 +1350,7 @@ static void test_items(void) item.iSubItem = 1; item.pszText = text; r = SendMessageA(hwnd, LVM_SETITEMA, 0, (LPARAM) &item); - ok(r == 1 || broken(r == 0) /* NT4 */, "ret %d\n", r); + ok(r == 1 || broken(r == 0) /* NT4 */, "ret %ld\n", r);
if (r == 1) { @@ -1372,7 +1372,7 @@ static void test_items(void) item.iSubItem = 1; r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); - ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest); + ok(item.lParam == lparamTest, "got lParam %Ix, expected %Ix\n", item.lParam, lparamTest);
/* Set up param on first subitem: no effect */ memset (&item, 0xcc, sizeof (item)); @@ -1390,7 +1390,7 @@ static void test_items(void) item.iSubItem = 1; r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM) &item); expect(1, r); - ok(item.lParam == lparamTest, "got lParam %lx, expected %lx\n", item.lParam, lparamTest); + ok(item.lParam == lparamTest, "got lParam %Ix, expected %Ix\n", item.lParam, lparamTest);
/**** Some tests of state highlighting ****/ memset (&item, 0xcc, sizeof (item)); @@ -1473,7 +1473,7 @@ static void test_columns(void) ok(header == NULL, "got %p\n", header);
rc = SendMessageA(hwnd, LVM_GETCOLUMNORDERARRAY, 2, (LPARAM)&order); - ok(rc == 0, "got %d\n", rc); + ok(rc == 0, "got %ld\n", rc);
header = (HWND)SendMessageA(hwnd, LVM_GETHEADER, 0, 0); ok(header == NULL, "got %p\n", header); @@ -1485,20 +1485,20 @@ static void test_columns(void) ok(hwnd != NULL, "failed to create listview window\n");
rc = SendMessageA(hwnd, LVM_DELETECOLUMN, -1, 0); - ok(!rc, "got %d\n", rc); + ok(!rc, "got %ld\n", rc);
rc = SendMessageA(hwnd, LVM_DELETECOLUMN, 0, 0); - ok(!rc, "got %d\n", rc); + ok(!rc, "got %ld\n", rc);
/* Add a column with no mask */ memset(&column, 0xcc, sizeof(column)); column.mask = 0; rc = SendMessageA(hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM)&column); - ok(rc == 0, "Inserting column with no mask failed with %d\n", rc); + ok(rc == 0, "Inserting column with no mask failed with %ld\n", rc);
/* Check its width */ rc = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0); - ok(rc == 10, "Inserting column with no mask failed to set width to 10 with %d\n", rc); + ok(rc == 10, "Inserting column with no mask failed to set width to 10 with %ld\n", rc);
DestroyWindow(hwnd);
@@ -1774,7 +1774,7 @@ static void test_create(BOOL is_version_6)
SetRect(&rect, LVIR_BOUNDS, 1, -10, -10); r = SendMessageA(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); - ok(r == 1, "Unexpected ret value %d.\n", r); + ok(r == 1, "Unexpected ret value %ld.\n", r); /* right value contains garbage, probably because header columns are not set up */ ok(rect.bottom >= 0, "Unexpected rectangle.\n");
@@ -1911,32 +1911,32 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM case CDDS_ITEMPREPAINT: clr = GetBkColor(nmlvcd->nmcd.hdc); todo_wine_if(nmlvcd->iSubItem) - ok(clr == c0ffee, "Unexpected background color %#x.\n", clr); + ok(clr == c0ffee, "Unexpected background color %#lx.\n", clr); nmlvcd->clrTextBk = CLR_DEFAULT; nmlvcd->clrText = RGB(0, 255, 0); return CDRF_NOTIFYSUBITEMDRAW|CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPREPAINT | CDDS_SUBITEM: clr = GetBkColor(nmlvcd->nmcd.hdc); - ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background %#x.\n", nmlvcd->clrTextBk); - ok(nmlvcd->clrText == RGB(0, 255, 0), "Unexpected text color %#x.\n", nmlvcd->clrText); + ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background %#lx.\n", nmlvcd->clrTextBk); + ok(nmlvcd->clrText == RGB(0, 255, 0), "Unexpected text color %#lx.\n", nmlvcd->clrText); if (showsel_always && is_selected && nmlvcd->iSubItem) - ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#x.\n", clr); + ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#lx.\n", clr); else todo_wine_if(nmlvcd->iSubItem) - ok(clr == c0ffee, "clr=%.8x\n", clr); + ok(clr == c0ffee, "clr=%.8lx\n", clr); return CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: clr = GetBkColor(nmlvcd->nmcd.hdc); if (showsel_always && is_selected) - ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#x.\n", clr); + ok(clr == GetSysColor(COLOR_3DFACE), "Unexpected background color %#lx.\n", clr); else { todo_wine - ok(clr == c0ffee, "Unexpected background color %#x.\n", clr); + ok(clr == c0ffee, "Unexpected background color %#lx.\n", clr); }
- ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background color %#x.\n", nmlvcd->clrTextBk); - ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText); + ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background color %#lx.\n", nmlvcd->clrTextBk); + ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%lx\n", nmlvcd->clrText); return CDRF_DODEFAULT; } return CDRF_DODEFAULT; @@ -2034,7 +2034,7 @@ static void test_icon_spacing(void) r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(20, 30)); ok(r == MAKELONG(w, h) || broken(r == MAKELONG(w, w)), /* win98 */ - "Expected %d, got %d\n", MAKELONG(w, h), r); + "Expected %ld, got %d\n", MAKELONG(w, h), r);
r = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(25, 35)); expect(MAKELONG(20,30), r); @@ -2421,7 +2421,7 @@ static void test_multiselect(void) ok(r, "got %d\n", r);
selected_count = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); - ok(selected_count == 1, "expected 1, got %d\n", selected_count); + ok(selected_count == 1, "expected 1, got %ld\n", selected_count);
/* Set SHIFT key pressed */ GetKeyboardState(kstate); @@ -2438,7 +2438,7 @@ static void test_multiselect(void) selected_count = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
ok((task.result == -1 ? item_count : task.result) == selected_count, - "Failed multiple selection %s. There should be %d selected items (is %d)\n", + "Failed multiple selection %s. There should be %ld selected items (is %ld)\n", task.descr, item_count, selected_count);
/* Set SHIFT key released */ @@ -2804,7 +2804,7 @@ static void test_subitem_rect(void) expect(250, rect.right);
r = SendMessageA(hwnd, LVM_SCROLL, 10, 0); - ok(r, "got %d\n", r); + ok(r, "got %ld\n", r);
SetRect(&rect, LVIR_BOUNDS, 1, 0, 0); r = SendMessageA(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect); @@ -3747,7 +3747,7 @@ static void test_hittest(void) r = SendMessageA(hwnd, LVM_GETITEMSPACING, TRUE, 0); vert = HIWORD(r); ok(bounds.bottom - bounds.top == vert, - "Vertical spacing inconsistent (%d != %d)\n", bounds.bottom - bounds.top, vert); + "Vertical spacing inconsistent (%ld != %d)\n", bounds.bottom - bounds.top, vert); r = SendMessageA(hwnd, LVM_GETITEMPOSITION, 0, (LPARAM)&pos); expect(TRUE, r);
@@ -3907,7 +3907,7 @@ static void test_getviewrect(void) item.iItem = 0; item.iSubItem = 0; r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); - ok(!r, "got %d\n", r); + ok(!r, "got %ld\n", r);
r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(100, 0)); expect(TRUE, r); @@ -3931,8 +3931,8 @@ static void test_getviewrect(void) expect(0, rect.left); expect(0, rect.top); /* precise value differs for 2k, XP and Vista */ - ok(rect.bottom > 0, "Expected positive bottom value, got %d\n", rect.bottom); - ok(rect.right > 0, "Expected positive right value, got %d\n", rect.right); + ok(rect.bottom > 0, "Expected positive bottom value, got %ld\n", rect.bottom); + ok(rect.right > 0, "Expected positive right value, got %ld\n", rect.right);
DestroyWindow(hwnd); } @@ -3970,7 +3970,7 @@ static void test_getitemposition(void)
SetRectEmpty(&rect); r = SendMessageA(header, HDM_GETITEMRECT, 0, (LPARAM)&rect); - ok(r, "got %d\n", r); + ok(r, "got %ld\n", r); /* some padding? */ expect(2, pt.x); /* offset by header height */ @@ -4005,7 +4005,7 @@ static void test_getitemrect(void) expect(0, rect.top); /* estimate it as width / height ratio */ todo_wine - ok((rect.right / rect.bottom) >= 5, "got right %d, bottom %d\n", rect.right, rect.bottom); + ok((rect.right / rect.bottom) >= 5, "got right %ld, bottom %ld\n", rect.right, rect.bottom); DestroyWindow(hwnd);
hwnd = create_listview_control(LVS_REPORT); @@ -4451,7 +4451,7 @@ static void test_notifyformat(void) r = SendMessageA(hwnd, LVM_SETUNICODEFORMAT, 1, 0); expect(0, r); r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); - ok(r == 1, "Unexpected return value %d.\n", r); + ok(r == 1, "Unexpected return value %ld.\n", r); r = SendMessageA(hwnd, LVM_SETUNICODEFORMAT, 0, 0); expect(1, r); r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); @@ -4468,7 +4468,7 @@ static void test_notifyformat(void) r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); - ok( r == 1, "Expected 1, got %d\n", r ); + ok( r == 1, "Expected 1, got %ld\n", r ); r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_QUERY); ok(r != 0, "Expected valid format\n");
@@ -4478,7 +4478,7 @@ static void test_notifyformat(void) r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(1, r); r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); - ok( r == 1, "Expected 1, got %d\n", r ); + ok( r == 1, "Expected 1, got %ld\n", r );
notifyFormat = NFR_ANSI; r = SendMessageA(hwnd, WM_NOTIFYFORMAT, 0, NF_REQUERY); @@ -4486,7 +4486,7 @@ static void test_notifyformat(void) r = SendMessageA(hwnd, LVM_GETUNICODEFORMAT, 0, 0); expect(0, r); r = SendMessageA(header, HDM_GETUNICODEFORMAT, 0, 0); - ok( r == 1, "Expected 1, got %d\n", r ); + ok( r == 1, "Expected 1, got %ld\n", r );
DestroyWindow(hwnd);
@@ -5055,7 +5055,7 @@ static void test_approximate_viewrect(void) expect(0, ret);
ret = SendMessageA(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(75, 75)); - ok(ret != 0, "Unexpected return value %#x.\n", ret); + ok(ret != 0, "Unexpected return value %#lx.\n", ret);
ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 11, MAKELPARAM(100,100)); expect(MAKELONG(77,827), ret); @@ -5133,7 +5133,7 @@ static void test_approximate_viewrect(void) col.pszText = column_header; col.cx = column_width; ret = SendMessageA(hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM)&col); - ok(ret == 0, "Unexpected return value %d.\n", ret); + ok(ret == 0, "Unexpected return value %ld.\n", ret);
/* Empty control with column */ ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 0, 0); @@ -5170,7 +5170,7 @@ todo_wine { itema.iSubItem = 0; itema.pszText = test; ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema); - ok(ret == 0, "Unexpected return value %d.\n", ret); + ok(ret == 0, "Unexpected return value %ld.\n", ret);
ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 0, 0); ok(LOWORD(ret) >= column_width, "Unexpected width %d.\n", LOWORD(ret)); @@ -5181,8 +5181,8 @@ todo_wine { item_width = LOWORD(ret);
ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 1, 0); - ok(LOWORD(ret) == item_width, "Unexpected width %d, item %d\n", LOWORD(ret), item_count - 1); - ok(HIWORD(ret) > header_height, "Unexpected height %d. item %d.\n", HIWORD(ret), item_count - 1); + ok(LOWORD(ret) == item_width, "Unexpected width %d, item %ld\n", LOWORD(ret), item_count - 1); + ok(HIWORD(ret) > header_height, "Unexpected height %d. item %ld.\n", HIWORD(ret), item_count - 1);
item_height = HIWORD(ret) - header_height;
@@ -5542,7 +5542,7 @@ static void test_header_notification2(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMCHANGINGW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); parent_header_notify_seq[0].id = HDN_ITEMCHANGINGA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", TRUE); @@ -5551,7 +5551,7 @@ static void test_header_notification2(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMCHANGEDW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); parent_header_notify_seq[0].id = HDN_ITEMCHANGEDA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", TRUE); @@ -5562,35 +5562,35 @@ static void test_header_notification2(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMCLICKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_click_seq, "header notify, parent", FALSE); ok(nmhdr.hdr.code == HDN_ITEMCLICKA, "Expected ANSI notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMDBLCLICKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); ok(nmhdr.hdr.code == HDN_ITEMDBLCLICKW, "Expected Unicode notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_DIVIDERDBLCLICKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_divider_dclick_seq, "header notify, parent", TRUE); ok(nmhdr.hdr.code == HDN_DIVIDERDBLCLICKA, "Expected ANSI notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_BEGINTRACKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); ok(nmhdr.hdr.code == HDN_BEGINTRACKW, "Expected Unicode notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ENDTRACKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); parent_header_notify_seq[0].id = HDN_ENDTRACKA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", FALSE); @@ -5598,7 +5598,7 @@ static void test_header_notification2(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_TRACKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); parent_header_notify_seq[0].id = HDN_TRACKA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", FALSE); @@ -5606,20 +5606,20 @@ static void test_header_notification2(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_BEGINDRAG; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 1, "got %d\n", ret); + ok(ret == 1, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ENDDRAG; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); parent_header_notify_seq[0].id = HDN_ENDDRAG; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_FILTERCHANGE; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); parent_header_notify_seq[0].id = HDN_FILTERCHANGE; parent_header_notify_seq[0].flags |= optional; /* NT4 does not send this message */ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, @@ -5628,25 +5628,25 @@ static void test_header_notification2(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_BEGINFILTEREDIT; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ENDFILTEREDIT; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMSTATEICONCLICK; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMKEYDOWN; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE);
@@ -5699,7 +5699,7 @@ static void test_dispinfo(void) item.pszText = (char*)buff; item.cchTextMax = ARRAY_SIZE(buff); ret = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&item); - ok(ret == sizeof(testA)-1, "got %d, expected 4\n", ret); + ok(ret == sizeof(testA)-1, "got %ld, expected 4\n", ret); g_disp_A_to_W = FALSE;
ok(memcmp(item.pszText, testA, sizeof(testA)) == 0, @@ -6221,7 +6221,7 @@ static void test_oneclickactivate(void) track.dwFlags = TME_QUERY; p_TrackMouseEvent(&track); ok(track.hwndTrack == hwnd, "hwndTrack != hwnd\n"); - ok(track.dwFlags == TME_LEAVE, "dwFlags = %x\n", track.dwFlags); + ok(track.dwFlags == TME_LEAVE, "dwFlags = %lx\n", track.dwFlags);
r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); expect(0, r); @@ -6250,7 +6250,7 @@ static void test_callback_mask(void) ok(ret, "got %d\n", ret);
mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0); - ok(mask == ~0u, "got 0x%08x\n", mask); + ok(mask == ~0u, "got 0x%08lx\n", mask);
/* Ask for state, invalid subitem. */ insert_item(hwnd, 0); @@ -6296,13 +6296,13 @@ static void test_callback_mask(void) hwnd = create_listview_control(LVS_REPORT | LVS_OWNERDATA);
mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0); - ok(mask == 0, "Unexpected callback mask %#x.\n", mask); + ok(mask == 0, "Unexpected callback mask %#lx.\n", mask);
ret = SendMessageA(hwnd, LVM_SETCALLBACKMASK, LVIS_FOCUSED, 0); ok(ret, "Failed to set callback mask, %d\n", ret);
mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0); - ok(mask == LVIS_FOCUSED, "Unexpected callback mask %#x.\n", mask); + ok(mask == LVIS_FOCUSED, "Unexpected callback mask %#lx.\n", mask);
ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); ok(ret, "Failed to set item count.\n"); @@ -6465,7 +6465,7 @@ static void test_state_image(void) ok(r, "Failed to get item state.\n"); ok(item.state == (INDEXTOSTATEIMAGEMASK(1) | LVIS_SELECTED | LVIS_FOCUSED), "Unexpected item state %#x.\n", item.state); - ok(item.lParam == 123456, "Unexpected lParam %ld.\n", item.lParam); + ok(item.lParam == 123456, "Unexpected lParam %Id.\n", item.lParam);
item.mask = 0; item.stateMask = ~0u; @@ -6485,7 +6485,7 @@ static void test_state_image(void) r = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); ok(r, "Failed to get subitem state.\n"); ok(item.state == 0, "Unexpected state %#x.\n", item.state); - ok(item.lParam == 123456, "Unexpected lParam %ld.\n", item.lParam); + ok(item.lParam == 123456, "Unexpected lParam %Id.\n", item.lParam);
item.mask = LVIF_STATE; item.stateMask = LVIS_FOCUSED; diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 2fe6ad68426..75e2aa1862b 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -219,7 +219,7 @@ static void test_Alloc(void) size = pGetSize(p); ok(size == 1 || broken(size == min), /* win9x */ - "Expected 1, got %d\n", size); + "Expected 1, got %ld\n", size);
/* reallocate the block */ p = pReAlloc(p, 2); @@ -229,7 +229,7 @@ static void test_Alloc(void) size = pGetSize(p); ok(size == 2 || broken(size == min), /* win9x */ - "Expected 2, got %d\n", size); + "Expected 2, got %ld\n", size);
/* free the block */ res = pFree(p); @@ -279,7 +279,7 @@ static void test_LoadIconWithScaleDown(void) GetTempFileNameW(tmp_path, L"ICO", 0, icon_path); handle = CreateFileW(icon_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %lu\n", GetLastError()); res = WriteFile(handle, testicon_data, sizeof(testicon_data), &written, NULL); ok(res && written == sizeof(testicon_data), "Failed to write icon file\n"); CloseHandle(handle); @@ -296,43 +296,43 @@ static void test_LoadIconWithScaleDown(void) /* invalid arguments */ icon = (HICON)0x1234; hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, 0x100, &icon); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr); ok(icon == NULL, "Expected NULL, got %p\n", icon);
icon = (HICON)0x1234; hr = pLoadIconMetric(NULL, NULL, LIM_LARGE, &icon); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr); ok(icon == NULL, "Expected NULL, got %p\n", icon);
icon = (HICON)0x1234; hr = pLoadIconWithScaleDown(NULL, NULL, 32, 32, &icon); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr); ok(icon == NULL, "Expected NULL, got %p\n", icon);
/* non-existing filename */ hr = pLoadIconMetric(NULL, L"nonexisting.ico", LIM_LARGE, &icon); ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* Win7 */, - "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
hr = pLoadIconWithScaleDown(NULL, L"nonexisting.ico", 32, 32, &icon); todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), - "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
/* non-existing resource name */ hr = pLoadIconMetric(hinst, L"Nonexisting", LIM_LARGE, &icon); ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), - "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
hr = pLoadIconWithScaleDown(hinst, L"Noneexisting", 32, 32, &icon); ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), - "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);
/* load icon using predefined identifier */ hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_SMALL, &icon); - ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %lx\n", hr); res = GetIconInfo(icon, &info); - ok(res, "Failed to get icon info, error %u\n", GetLastError()); + ok(res, "Failed to get icon info, error %lu\n", GetLastError()); bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ok(bytes > 0, "Failed to get bitmap info for icon\n"); ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth); @@ -340,9 +340,9 @@ static void test_LoadIconWithScaleDown(void) DestroyIcon(icon);
hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_LARGE, &icon); - ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %lx\n", hr); res = GetIconInfo(icon, &info); - ok(res, "Failed to get icon info, error %u\n", GetLastError()); + ok(res, "Failed to get icon info, error %lu\n", GetLastError()); bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ok(bytes > 0, "Failed to get bitmap info for icon\n"); ok(bmp.bmWidth == GetSystemMetrics(SM_CXICON), "Wrong icon width %d\n", bmp.bmWidth); @@ -350,9 +350,9 @@ static void test_LoadIconWithScaleDown(void) DestroyIcon(icon);
hr = pLoadIconWithScaleDown(NULL, (LPWSTR)IDI_APPLICATION, 42, 42, &icon); - ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %lx\n", hr); res = GetIconInfo(icon, &info); - ok(res, "Failed to get icon info, error %u\n", GetLastError()); + ok(res, "Failed to get icon info, error %lu\n", GetLastError()); bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ok(bytes > 0, "Failed to get bitmap info for icon\n"); ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth); @@ -361,9 +361,9 @@ static void test_LoadIconWithScaleDown(void)
/* load icon from file */ hr = pLoadIconMetric(NULL, icon_path, LIM_SMALL, &icon); - ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %lx\n", hr); res = GetIconInfo(icon, &info); - ok(res, "Failed to get icon info, error %u\n", GetLastError()); + ok(res, "Failed to get icon info, error %lu\n", GetLastError()); bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ok(bytes > 0, "Failed to get bitmap info for icon\n"); ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth); @@ -371,9 +371,9 @@ static void test_LoadIconWithScaleDown(void) DestroyIcon(icon);
hr = pLoadIconWithScaleDown(NULL, icon_path, 42, 42, &icon); - ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %lx\n", hr); res = GetIconInfo(icon, &info); - ok(res, "Failed to get icon info, error %u\n", GetLastError()); + ok(res, "Failed to get icon info, error %lu\n", GetLastError()); bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); ok(bytes > 0, "Failed to get bitmap info for icon\n"); ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth); @@ -522,7 +522,7 @@ static HWND create_control(const char *class, DWORD style, HWND parent, DWORD_PT if (parent) style |= WS_CHILD; hwnd = CreateWindowExA(0, class, "test", style, 0, 0, 50, 20, parent, 0, 0, NULL); - ok(!!hwnd, "Failed to create %s style %#x parent %p\n", class, style, parent); + ok(!!hwnd, "Failed to create %s style %#lx parent %p\n", class, style, parent); pSetWindowSubclass(hwnd, test_wm_themechanged_proc, 0, data); return hwnd; } @@ -637,13 +637,13 @@ static void test_WM_SYSCOLORCHANGE(void)
parent = CreateWindowExA(0, WC_STATICA, "parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, 0, 0, NULL); - ok(!!parent, "CreateWindowExA failed, error %d\n", GetLastError()); + ok(!!parent, "CreateWindowExA failed, error %ld\n", GetLastError());
temp.tmplate.style = WS_CHILD | WS_VISIBLE; temp.tmplate.cx = 50; temp.tmplate.cy = 50; dialog = CreateDialogIndirectParamA(NULL, &temp.tmplate, parent, wm_syscolorchange_dlg_proc, 0); - ok(!!dialog, "CreateDialogIndirectParamA failed, error %d\n", GetLastError()); + ok(!!dialog, "CreateDialogIndirectParamA failed, error %ld\n", GetLastError()); flush_events(); flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -917,15 +917,15 @@ static void test_themed_background(void)
parent = CreateWindowA(cls.lpszClassName, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 100, 100, 0, 0, 0, 0); - ok(parent != NULL, "CreateWindowA failed, error %u.\n", GetLastError()); + ok(parent != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(tests); ++i) { - winetest_push_context("%s %#x", tests[i].class_name, tests[i].style); + winetest_push_context("%s %#lx", tests[i].class_name, tests[i].style);
child = CreateWindowA(tests[i].class_name, " ", WS_CHILD | WS_VISIBLE | tests[i].style, 0, 0, 50, 50, parent, 0, 0, 0); - ok(child != NULL, "CreateWindowA failed, error %u.\n", GetLastError()); + ok(child != NULL, "CreateWindowA failed, error %lu.\n", GetLastError()); flush_events(); flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -953,17 +953,17 @@ static void test_themed_background(void) color = GetPixel(hdc, 40, 40); /* BS_PUSHBOX is unimplemented on Wine */ todo_wine_if(i == 11) - ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color); + ok(color == 0x808080, "Expected color %#x, got %#lx.\n", 0x808080, color); } else if (tests[i].seq == groupbox_seq) { /* DrawThemeParentBackground() is used to fill content background */ color = GetPixel(hdc, 40, 40); - ok(color == 0xff, "Expected color %#x, got %#x.\n", 0xff, color); + ok(color == 0xff, "Expected color %#x, got %#lx.\n", 0xff, color);
/* WM_CTLCOLORSTATIC is used to fill text background */ color = GetPixel(hdc, 10, 10); - ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color); + ok(color == 0x808080, "Expected color %#x, got %#lx.\n", 0x808080, color); }
ReleaseDC(child, hdc); diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index 5b950ac76c3..fcafb790302 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -35,15 +35,15 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
#define expect_hex(expected,got) expect_hex_(__LINE__, expected, got) static inline void expect_hex_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %x, got %x\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %lx, got %lx\n", expected, got); } -#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %d, got %d\n", expected, got); +#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %ld, got %ld\n", expected, got);
#define NUM_MSG_SEQUENCES 2 #define PARENT_SEQ_INDEX 0 @@ -285,7 +285,7 @@ static void test_monthcal(void) limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st); ok(limits == 0 || broken(limits == GDTR_MIN), /* comctl32 <= 4.70 */ - "No limits should be set (%d)\n", limits); + "No limits should be set (%ld)\n", limits); if (limits == GDTR_MIN) { win_skip("comctl32 <= 4.70 is broken\n"); @@ -318,7 +318,7 @@ static void test_monthcal(void) expect(0, st[1].wMilliseconds);
limits = SendMessageA(hwnd, MCM_GETRANGE, 0, 0); - ok(limits == 0, "got %u\n", limits); + ok(limits == 0, "got %lu\n", limits);
GetSystemTime(&st[0]); st[1] = st[0]; @@ -468,7 +468,7 @@ static void test_monthcal(void)
/* 0 limit flags */ limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1); - ok(limits == GDTR_MIN, "got 0x%08x\n", limits); + ok(limits == GDTR_MIN, "got 0x%08lx\n", limits);
GetSystemTime(st); st[1] = st[0]; @@ -477,7 +477,7 @@ static void test_monthcal(void) ok(r, "got %d\n", r);
limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st); - ok(limits == 0, "got 0x%08x\n", limits); + ok(limits == 0, "got 0x%08lx\n", limits); ok(st[0].wYear == 0 && st[1].wYear == 0, "got %u, %u\n", st[0].wYear, st[1].wYear);
/* flags are 0, set min limit */ @@ -489,7 +489,7 @@ static void test_monthcal(void) ok(r, "got %d\n", r);
limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1); - ok(limits == GDTR_MIN, "got 0x%08x\n", limits); + ok(limits == GDTR_MIN, "got 0x%08lx\n", limits); ok(st1[1].wYear == 0, "got %u\n", st1[1].wYear);
/* now set max limit, check flags */ @@ -497,7 +497,7 @@ static void test_monthcal(void) ok(r, "got %d\n", r);
limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1); - ok(limits == GDTR_MAX, "got 0x%08x\n", limits); + ok(limits == GDTR_MAX, "got 0x%08lx\n", limits); ok(st1[0].wYear == 0, "got %u\n", st1[0].wYear);
DestroyWindow(hwnd); @@ -652,7 +652,7 @@ static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wPa message == WM_STYLECHANGED) && lParam) { STYLESTRUCT *style = (STYLESTRUCT*)lParam; - trace("\told style: 0x%08x, new style: 0x%08x\n", style->styleOld, style->styleNew); + trace("\told style: 0x%08lx, new style: 0x%08lx\n", style->styleOld, style->styleNew); }
defwndproc_counter++; @@ -927,7 +927,7 @@ static void test_firstDay(void) SetLastError(0xdeadbeef); ret = GetLocaleInfoA(lcid, LOCALE_ICALENDARTYPE, caltype, 3); if (ret == 0) { - skip("Must know local calendar type (%x)\n", GetLastError()); + skip("Must know local calendar type (%lx)\n", GetLastError()); return; } else if (atoi(caltype) != CAL_GREGORIAN) { skip("MonthCalendar Control only supports Gregorian calendar (type: %s)\n", caltype); @@ -1236,7 +1236,7 @@ if (0) break;
todo_wine_if(title_hits[title_index].todo) - ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %d\n", + ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %ld\n", title_hits[title_index].ht, res, x); } old_res = res; @@ -1841,7 +1841,7 @@ static void test_hittest_v6(void) expect(0, mchit.rc.left); expect(0, mchit.rc.top); expect_d(r.right, mchit.rc.right); - ok(mchit.rc.bottom > 0, "got %d\n", mchit.rc.bottom); + ok(mchit.rc.bottom > 0, "got %ld\n", mchit.rc.bottom);
/* between two calendars */ MoveWindow(hwnd, 0, 0, r.right * 5/2, r.bottom, FALSE); @@ -1907,7 +1907,7 @@ static void test_MCM_SIZERECTTOMIN(void) }
ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, 0); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret);
SetRectEmpty(&r); ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r); @@ -1917,18 +1917,18 @@ static void test_MCM_SIZERECTTOMIN(void) DestroyWindow(hwnd); return; } - ok(ret == 1, "got %d\n", ret); - ok(r.left == 0 && r.right > 0, "got %d, %d\n", r.left, r.right); + ok(ret == 1, "got %ld\n", ret); + ok(r.left == 0 && r.right > 0, "got %ld, %ld\n", r.left, r.right);
r = r2; ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r); - ok(ret == 1, "got %d\n", ret); + ok(ret == 1, "got %ld\n", ret);
r2.right = (r2.right - r2.left) * 3; r2.bottom = (r2.bottom - r2.top) * 3; r2.left = r2.top = 0; ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r2); - ok(ret == 1, "got %d\n", ret); + ok(ret == 1, "got %ld\n", ret);
DestroyWindow(hwnd); } @@ -1984,7 +1984,7 @@ static void test_daystate(void) /* try to switch on */ SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | MCS_DAYSTATE); style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & MCS_DAYSTATE) == 0, "got 0x%08x\n", style); + ok((style & MCS_DAYSTATE) == 0, "got 0x%08lx\n", style);
DestroyWindow(hwnd);
@@ -2006,7 +2006,7 @@ static void test_daystate(void) /* try to switch off */ SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~MCS_DAYSTATE); style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08x\n", style); + ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08lx\n", style);
DestroyWindow(hwnd); } diff --git a/dlls/comctl32/tests/mru.c b/dlls/comctl32/tests/mru.c index 6a9a04d9663..472fb99bac3 100644 --- a/dlls/comctl32/tests/mru.c +++ b/dlls/comctl32/tests/mru.c @@ -200,7 +200,7 @@ static void check_reg_entries(const char *mrulist, const char**items) buff[0] = '\0'; ret = RegQueryValueExA(hKey, "MRUList", NULL, &type, (LPBYTE)buff, &size);
- ok(!ret && buff[0], "Checking MRU: got %d from RegQueryValueExW\n", ret); + ok(!ret && buff[0], "Checking MRU: got %ld from RegQueryValueExW\n", ret); if(ret || !buff[0]) return;
ok(strcmp(buff, mrulist) == 0, "Checking MRU: Expected list %s, got %s\n", @@ -217,7 +217,7 @@ static void check_reg_entries(const char *mrulist, const char**items) buff[0] = '\0'; ret = RegQueryValueExA(hKey, name, NULL, &type, (LPBYTE)buff, &size); ok(!ret && buff[0], - "Checking MRU item %d ('%c'): got %d from RegQueryValueExW\n", + "Checking MRU item %d ('%c'): got %ld from RegQueryValueExW\n", i, mrulist[i], ret); if(ret || !buff[0]) return; ok(!strcmp(buff, items[mrulist[i]-'a']), @@ -262,7 +262,7 @@ static void test_MRUListA(void) SetLastError(0); hMRU = pCreateMRUListA(&infoA); ok (!hMRU && !GetLastError(), - "CreateMRUListA(too small) expected NULL,0 got %p,%d\n", + "CreateMRUListA(too small) expected NULL,0 got %p,%ld\n", hMRU, GetLastError());
/* size too big */ @@ -276,7 +276,7 @@ static void test_MRUListA(void) SetLastError(0); hMRU = pCreateMRUListA(&infoA); ok (!hMRU && !GetLastError(), - "CreateMRUListA(too big) expected NULL,0 got %p,%d\n", + "CreateMRUListA(too big) expected NULL,0 got %p,%ld\n", hMRU, GetLastError());
/* NULL hKey */ @@ -290,7 +290,7 @@ static void test_MRUListA(void) SetLastError(0); hMRU = pCreateMRUListA(&infoA); ok (!hMRU && !GetLastError(), - "CreateMRUListA(NULL key) expected NULL,0 got %p,%d\n", + "CreateMRUListA(NULL key) expected NULL,0 got %p,%ld\n", hMRU, GetLastError());
/* NULL subkey name */ @@ -304,7 +304,7 @@ static void test_MRUListA(void) SetLastError(0); hMRU = pCreateMRUListA(&infoA); ok (!hMRU && !GetLastError(), - "CreateMRUListA(NULL name) expected NULL,0 got %p,%d\n", + "CreateMRUListA(NULL name) expected NULL,0 got %p,%ld\n", hMRU, GetLastError());
/* Create a string MRU */ @@ -321,7 +321,7 @@ static void test_MRUListA(void)
hMRU = pCreateMRUListA(&infoA); ok(hMRU && !GetLastError(), - "CreateMRUListA(string) expected non-NULL,0 got %p,%d\n", + "CreateMRUListA(string) expected non-NULL,0 got %p,%ld\n", hMRU, GetLastError());
if (hMRU) @@ -336,35 +336,35 @@ static void test_MRUListA(void) SetLastError(0); iRet = pAddMRUStringA(NULL, checks[0]); ok(iRet == -1 && !GetLastError(), - "AddMRUStringA(NULL list) expected -1,0 got %d,%d\n", + "AddMRUStringA(NULL list) expected -1,0 got %d,%ld\n", iRet, GetLastError());
/* Add (NULL string) */ SetLastError(0); iRet = pAddMRUStringA(hMRU, NULL); todo_wine ok(iRet == 0 && !GetLastError(), - "AddMRUStringA(NULL str) expected 0,0 got %d,%d\n", + "AddMRUStringA(NULL str) expected 0,0 got %d,%ld\n", iRet, GetLastError());
/* Add 3 strings. Check the registry is correct after each add */ SetLastError(0); iRet = pAddMRUStringA(hMRU, checks[0]); ok(iRet == 0 && !GetLastError(), - "AddMRUStringA(1) expected 0,0 got %d,%d\n", + "AddMRUStringA(1) expected 0,0 got %d,%ld\n", iRet, GetLastError()); check_reg_entries("a", checks);
SetLastError(0); iRet = pAddMRUStringA(hMRU, checks[1]); ok(iRet == 1 && !GetLastError(), - "AddMRUStringA(2) expected 1,0 got %d,%d\n", + "AddMRUStringA(2) expected 1,0 got %d,%ld\n", iRet, GetLastError()); check_reg_entries("ba", checks);
SetLastError(0); iRet = pAddMRUStringA(hMRU, checks[2]); ok(iRet == 2 && !GetLastError(), - "AddMRUStringA(2) expected 2,0 got %d,%d\n", + "AddMRUStringA(2) expected 2,0 got %d,%ld\n", iRet, GetLastError()); check_reg_entries("cba", checks);
@@ -374,7 +374,7 @@ static void test_MRUListA(void) SetLastError(0); iRet = pAddMRUStringA(hMRU, checks[1]); ok(iRet == 1 && !GetLastError(), - "AddMRUStringA(re-add 1) expected 1,0 got %d,%d\n", + "AddMRUStringA(re-add 1) expected 1,0 got %d,%ld\n", iRet, GetLastError()); check_reg_entries("bca", checks);
@@ -382,7 +382,7 @@ static void test_MRUListA(void) SetLastError(0); iRet = pAddMRUStringA(hMRU, checks[3]); ok(iRet == 0 && !GetLastError(), - "AddMRUStringA(add new) expected 0,0 got %d,%d\n", + "AddMRUStringA(add new) expected 0,0 got %d,%ld\n", iRet, GetLastError()); checks[0] = checks[3]; check_reg_entries("abc", checks); diff --git a/dlls/comctl32/tests/msg.h b/dlls/comctl32/tests/msg.h index 8ba2efddb0a..f6877d6a2b1 100644 --- a/dlls/comctl32/tests/msg.h +++ b/dlls/comctl32/tests/msg.h @@ -114,7 +114,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index, trace_(file, line)("Failed sequence %s:\n", context ); while (expected->message && actual->message) { - trace_(file, line)( " %u: expected: %04x - actual: %04x wp %08lx lp %08lx\n", + trace_(file, line)( " %u: expected: %04x - actual: %04x wp %08Ix lp %08Ix\n", count, expected->message, actual->message, actual->wParam, actual->lParam );
if (expected->message == actual->message) @@ -155,7 +155,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index,
while (actual->message) { - trace_(file, line)( " %u: expected: nothing - actual: %04x wp %08lx lp %08lx\n", + trace_(file, line)( " %u: expected: nothing - actual: %04x wp %08Ix lp %08Ix\n", count, actual->message, actual->wParam, actual->lParam ); actual++; count++; @@ -190,14 +190,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index, failcount++; dump++; ok_(file, line) (FALSE, - "%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n", + "%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n", context, expected->message, expected->wParam, actual->wParam); } } else { ok_(file, line) (expected->wParam == actual->wParam, - "%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n", + "%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n", context, expected->message, expected->wParam, actual->wParam); if (expected->wParam != actual->wParam) dump++; } @@ -212,14 +212,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index, failcount++; dump++; ok_(file, line) (FALSE, - "%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n", + "%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n", context, expected->message, expected->lParam, actual->lParam); } } else { ok_(file, line) (expected->lParam == actual->lParam, - "%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n", + "%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n", context, expected->message, expected->lParam, actual->lParam); if (expected->lParam != actual->lParam) dump++; } @@ -234,14 +234,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index, failcount++; dump++; ok_(file, line) (FALSE, - "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n", + "%s: in msg 0x%04x expecting cd stage 0x%08lx got 0x%08lx\n", context, expected->message, expected->stage, actual->stage); } } else { ok_(file, line) (expected->stage == actual->stage, - "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n", + "%s: in msg 0x%04x expecting cd stage 0x%08lx got 0x%08lx\n", context, expected->message, expected->stage, actual->stage); if (expected->stage != actual->stage) dump++; } diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c index 2ce964f8a27..e783dcc95e2 100644 --- a/dlls/comctl32/tests/pager.c +++ b/dlls/comctl32/tests/pager.c @@ -312,9 +312,9 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP DWORD style = GetWindowLongA(nmpgcs->hdr.hwndFrom, GWL_STYLE);
if (style & PGS_HORZ) - ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#x.\n", nmpgcs->dwFlag); + ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#lx.\n", nmpgcs->dwFlag); else - ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#x.\n", nmpgcs->dwFlag); + ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#lx.\n", nmpgcs->dwFlag); break; } default: @@ -449,14 +449,14 @@ static void test_pager(void) ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "set child", FALSE); GetWindowRect( pager, &rect ); ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100, - "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top ); + "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top );
flush_sequences(sequences, NUM_MSG_SEQUENCES); SendMessageA(pager, PGM_SETCHILD, 0, (LPARAM)child2_wnd); ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", FALSE); GetWindowRect(pager, &rect); ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100, - "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top); + "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top); ok(!IsWindowVisible(child2_wnd), "Child window 2 is visible\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -464,14 +464,14 @@ static void test_pager(void) ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", FALSE); GetWindowRect(pager, &rect); ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100, - "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top); + "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top);
flush_sequences( sequences, NUM_MSG_SEQUENCES ); SendMessageA( pager, PGM_SETPOS, 0, 10 ); ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE); GetWindowRect( pager, &rect ); ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100, - "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top ); + "pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top );
flush_sequences( sequences, NUM_MSG_SEQUENCES ); SendMessageA( pager, PGM_SETPOS, 0, 10 ); @@ -546,7 +546,7 @@ static void test_wm_notifyformat(void) INT i;
bret = register_notifyformat_class(); - ok(bret, "Register test class failed, error 0x%08x\n", GetLastError()); + ok(bret, "Register test class failed, error 0x%08lx\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(formats); i++) { @@ -562,26 +562,26 @@ static void test_wm_notifyformat(void) /* Test parent */ notify_query_received = FALSE; ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent, NF_REQUERY); - ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret); + ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret); ok(notify_query_received, "Didn't receive notify\n");
/* Send NF_QUERY directly to parent */ notify_query_received = FALSE; ret = SendMessageW(parent, WM_NOTIFYFORMAT, (WPARAM)pager, NF_QUERY); - ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret); + ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret); ok(notify_query_received, "Didn't receive notify\n");
/* Pager send notifications to its parent regardless of wParam */ notify_query_received = FALSE; ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent_wnd, NF_REQUERY); - ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret); + ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret); ok(notify_query_received, "Didn't receive notify\n");
/* Pager always wants Unicode notifications from children */ ret = SendMessageW(child, WM_NOTIFYFORMAT, (WPARAM)pager, NF_REQUERY); - ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret); + ok(ret == NFR_UNICODE, "Expect %d, got %Id\n", NFR_UNICODE, ret); ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)child, NF_QUERY); - ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret); + ok(ret == NFR_UNICODE, "Expect %d, got %Id\n", NFR_UNICODE, ret);
DestroyWindow(parent); } @@ -688,9 +688,9 @@ static LRESULT WINAPI test_notify_proc(HWND hwnd, UINT message, WPARAM wParam, L if (!notify_test_info.unicode) break; ok(!notify_test_info.received, "Extra notification received\n");
- ok(wParam == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam); + ok(wParam == notify_test_info.id_from, "Expect %Id, got %Id\n", notify_test_info.id_from, wParam); ok(hdr->code == notify_test_info.ansi, "Expect 0x%08x, got 0x%08x\n", notify_test_info.ansi, hdr->code); - ok(hdr->idFrom == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam); + ok(hdr->idFrom == notify_test_info.id_from, "Expect %Id, got %Id\n", notify_test_info.id_from, wParam); ok(hdr->hwndFrom == notify_test_info.hwnd_from, "Expect %p, got %p\n", notify_test_info.hwnd_from, hdr->hwndFrom);
if (hdr->code != notify_test_info.ansi) @@ -1264,7 +1264,7 @@ static void test_wm_notify(void) INT i;
bret = register_test_notify_class(); - ok(bret, "Register test class failed, error 0x%08x\n", GetLastError()); + ok(bret, "Register test class failed, error 0x%08lx\n", GetLastError());
parent = CreateWindowA(class, "parent", WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), 0); ok(parent != NULL, "CreateWindow failed\n"); diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c index 91ea6eec2a9..b6716366498 100644 --- a/dlls/comctl32/tests/progress.c +++ b/dlls/comctl32/tests/progress.c @@ -222,22 +222,22 @@ static void test_setcolors(void) progress = create_progress(PBS_SMOOTH);
clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, 0); - ok(clr == CLR_DEFAULT, "got %x\n", clr); + ok(clr == CLR_DEFAULT, "got %lx\n", clr);
clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, RGB(0, 255, 0)); - ok(clr == 0, "got %x\n", clr); + ok(clr == 0, "got %lx\n", clr);
clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, CLR_DEFAULT); - ok(clr == RGB(0, 255, 0), "got %x\n", clr); + ok(clr == RGB(0, 255, 0), "got %lx\n", clr);
clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, 0); - ok(clr == CLR_DEFAULT, "got %x\n", clr); + ok(clr == CLR_DEFAULT, "got %lx\n", clr);
clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, RGB(255, 0, 0)); - ok(clr == 0, "got %x\n", clr); + ok(clr == 0, "got %lx\n", clr);
clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, CLR_DEFAULT); - ok(clr == RGB(255, 0, 0), "got %x\n", clr); + ok(clr == RGB(255, 0, 0), "got %lx\n", clr);
DestroyWindow(progress); } diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index 0284311c81b..8b2c282c72e 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -89,7 +89,7 @@ static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam) * Arabic Windows 10 allocates 2 * size - 32, * all others allocate exactly 2 * size */ ok(buffer_size >= 2 * size || broken(buffer_size == 2 * size - 32), - "Unexpected template buffer size %u, resource size %u\n", + "Unexpected template buffer size %lu, resource size %lu\n", buffer_size, size); break; } @@ -173,7 +173,7 @@ static void test_title(void) style = GetWindowLongA(hdlg, GWL_STYLE); ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION|WS_SYSMENU| DS_CONTEXTHELP|DS_MODALFRAME|DS_SETFONT|DS_3DLOOK), - "got unexpected style: %x\n", style); + "got unexpected style: %lx\n", style);
DestroyWindow(hdlg); } @@ -215,7 +215,7 @@ static void test_nopage(void) (HWND)SendMessageA(hdlg, PSM_GETCURRENTPAGEHWND, 0, 0); active_page = /* PropSheet_HwndToIndex(hdlg, hpage)); */ (int)SendMessageA(hdlg, PSM_HWNDTOINDEX, (WPARAM)hpage, 0); - ok(hpage == NULL, "expected no current page, got %p, index=%d\n", hpage, active_page); + ok(hpage == NULL, "expected no current page, got %p, index=%ld\n", hpage, active_page); flush_events(); RedrawWindow(hdlg,NULL,NULL,RDW_UPDATENOW|RDW_ERASENOW);
@@ -287,7 +287,7 @@ static void test_disableowner(void) psh.pfnCallback = disableowner_callback;
p = pPropertySheetA(&psh); - ok(p == 0, "Expected 0, got %ld\n", p); + ok(p == 0, "Expected 0, got %Id\n", p); ok(IsWindowEnabled(parenthwnd) != 0, "parent window should be enabled\n"); DestroyWindow(parenthwnd); } @@ -402,26 +402,26 @@ static void test_wiznavigation(void) hdlg = (HWND)pPropertySheetA(&psh); ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
- ok(active_page == 0, "Active page should be 0. Is: %d\n", active_page); + ok(active_page == 0, "Active page should be 0. Is: %ld\n", active_page);
style = GetWindowLongA(hdlg, GWL_STYLE) & ~(DS_CONTEXTHELP|WS_SYSMENU); ok(style == (WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION| DS_MODALFRAME|DS_SETFONT|DS_3DLOOK), - "got unexpected style: %x\n", style); + "got unexpected style: %lx\n", style);
control = GetFocus(); controlID = GetWindowLongPtrA(control, GWLP_ID); - ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID); + ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %Id\n", nextID, controlID);
/* simulate pressing the Next button */ SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (!active_page) hwndtoindex_supported = FALSE; if (hwndtoindex_supported) - ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %d\n", active_page); + ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %ld\n", active_page);
control = GetFocus(); controlID = GetWindowLongPtrA(control, GWLP_ID); - ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %ld\n", IDC_PS_EDIT1, controlID); + ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %Id\n", IDC_PS_EDIT1, controlID);
defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres)); @@ -432,20 +432,20 @@ static void test_wiznavigation(void) /* press next again */ SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (hwndtoindex_supported) - ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page); + ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %ld\n", active_page);
control = GetFocus(); controlID = GetWindowLongPtrA(control, GWLP_ID); - ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %ld\n", IDC_PS_RADIO1, controlID); + ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %Id\n", IDC_PS_RADIO1, controlID);
/* back button */ SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0); if (hwndtoindex_supported) - ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %d\n", active_page); + ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %ld\n", active_page);
control = GetFocus(); controlID = GetWindowLongPtrA(control, GWLP_ID); - ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %ld\n", IDC_PS_EDIT1, controlID); + ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %Id\n", IDC_PS_EDIT1, controlID);
defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(defidres == MAKELRESULT(backID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", backID, LOWORD(defidres)); @@ -453,20 +453,20 @@ static void test_wiznavigation(void) /* press next twice */ SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (hwndtoindex_supported) - ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page); + ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %ld\n", active_page); SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_NEXT, 0); if (hwndtoindex_supported) - ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %d\n", active_page); + ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %ld\n", active_page); else active_page = 3;
control = GetFocus(); controlID = GetWindowLongPtrA(control, GWLP_ID); - ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID); + ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %Id\n", nextID, controlID);
/* try to navigate away, but shouldn't be able to */ SendMessageA(hdlg, PSM_PRESSBUTTON, PSBTN_BACK, 0); - ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %d\n", active_page); + ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %ld\n", active_page);
defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0); ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres)); @@ -892,34 +892,34 @@ if (0) tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 2, "got %d\n", r); + ok(r == 2, "got %ld\n", r);
ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[2]); ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 3, "got %d\n", r); + ok(r == 3, "got %ld\n", r);
/* add property sheet page that can't be created */ ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[3]); ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 4, "got %d\n", r); + ok(r == 4, "got %ld\n", r);
/* select page that can't be created */ ret = SendMessageA(hdlg, PSM_SETCURSEL, 3, 1); ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 3, "got %d\n", r); + ok(r == 3, "got %ld\n", r);
/* test PSP_PREMATURE flag with incorrect property sheet page */ ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[4]); ok(ret == FALSE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 3, "got %d\n", r); + ok(r == 3, "got %ld\n", r);
pDestroyPropertySheetPage(hpsp[4]); DestroyWindow(hdlg); @@ -986,34 +986,34 @@ if (0) tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 2, "got %d\n", r); + ok(r == 2, "got %ld\n", r);
ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]); ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 3, "got %d\n", r); + ok(r == 3, "got %ld\n", r);
/* add property sheet page that can't be created */ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]); ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 4, "got %d\n", r); + ok(r == 4, "got %ld\n", r);
/* select page that can't be created */ ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0); ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 3, "got %d\n", r); + ok(r == 3, "got %ld\n", r);
/* test PSP_PREMATURE flag with incorrect property sheet page */ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]); ok(ret == FALSE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0); - ok(r == 3, "got %d\n", r); + ok(r == 3, "got %ld\n", r);
pDestroyPropertySheetPage(hpsp[4]); DestroyWindow(hdlg); @@ -1037,7 +1037,7 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps
ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);
- ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n", + ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %Ix, %p\n", psp->lParam, psp); ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n"); ok(!lstrcmpA(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n"); @@ -1045,11 +1045,11 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps switch (msg) { case PSPCB_ADDREF: - ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize); + ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %lu\n", psp->dwSize); cpage->addref_called++; break; case PSPCB_RELEASE: - ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize); + ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %lu\n", psp->dwSize); cpage->release_called++; break; default: @@ -1065,7 +1065,7 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps PROPSHEETPAGEW *psp_orig = &cpage->u.pageW;
ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd); - ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n", + ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %Ix, %p\n", psp->lParam, psp); ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n"); ok(!lstrcmpW(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n"); @@ -1073,11 +1073,11 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps switch (msg) { case PSPCB_ADDREF: - ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize); + ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %lu\n", psp->dwSize); cpage->addref_called++; break; case PSPCB_RELEASE: - ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize); + ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %lu\n", psp->dwSize); cpage->release_called++; break; default: @@ -1107,10 +1107,10 @@ static void test_CreatePropertySheetPage(void) hpsp = pCreatePropertySheetPageA(&page.u.pageA);
if (page.u.pageA.dwSize < PROPSHEETPAGEA_V1_SIZE) - ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageA.dwSize); + ok(hpsp == NULL, "Expected failure, size %lu\n", page.u.pageA.dwSize); else { - ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageA.dwSize); + ok(hpsp != NULL, "Failed to create a page, size %lu\n", page.u.pageA.dwSize); ok(page.addref_called == (page.u.pageA.dwSize > PROPSHEETPAGEA_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n"); }
@@ -1136,10 +1136,10 @@ static void test_CreatePropertySheetPage(void) hpsp = pCreatePropertySheetPageW(&page.u.pageW);
if (page.u.pageW.dwSize < PROPSHEETPAGEW_V1_SIZE) - ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageW.dwSize); + ok(hpsp == NULL, "Expected failure, size %lu\n", page.u.pageW.dwSize); else { - ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageW.dwSize); + ok(hpsp != NULL, "Failed to create a page, size %lu\n", page.u.pageW.dwSize); ok(page.addref_called == (page.u.pageW.dwSize > PROPSHEETPAGEW_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n"); }
@@ -1176,7 +1176,7 @@ static void test_bad_control_class(void) U3(psh).phpage = &hpsp;
ret = pPropertySheetA(&psh); - ok(ret == 0, "got %ld\n", ret); + ok(ret == 0, "got %Id\n", ret);
/* Need to recreate hpsp otherwise the test fails under Windows */ hpsp = pCreatePropertySheetPageA(&psp); @@ -1185,9 +1185,9 @@ static void test_bad_control_class(void)
psh.dwFlags = PSH_MODELESS; ret = pPropertySheetA(&psh); - ok(ret != 0, "got %ld\n", ret); + ok(ret != 0, "got %Id\n", ret);
- ok(IsWindow((HWND)ret), "bad window handle %#lx\n", ret); + ok(IsWindow((HWND)ret), "bad window handle %#Ix\n", ret); DestroyWindow((HWND)ret); }
@@ -1236,7 +1236,7 @@ static void test_page_dialog_texture(void)
/* Test that page dialog procedure is unchanged */ dlgproc = GetWindowLongPtrA(sheethwnd, DWLP_DLGPROC); - ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#lx.\n", dlgproc); + ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#Ix.\n", dlgproc);
/* Test that theme dialog texture is enabled for comctl32 v6, even when theming is off */ ret = pIsThemeDialogTextureEnabled(sheethwnd); @@ -1244,7 +1244,7 @@ static void test_page_dialog_texture(void) ok(ret == is_v6, "Wrong theme dialog texture status.\n");
hwnd = CreateWindowA(WC_EDITA, "child", WS_POPUP | WS_VISIBLE, 1, 2, 50, 50, 0, 0, 0, NULL); - ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError()); + ok(hwnd != NULL, "CreateWindowA failed, error %ld.\n", GetLastError()); hdc = GetDC(hwnd);
hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd); diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index e868198b4d8..c15b22aeca1 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -930,8 +930,8 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle, rb.cch = MAX_PATH; ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFOA failed from line %d\n", line); expect_eq(line, rb.fStyle, fStyle, int, "%x"); - expect_eq(line, rb.clrFore, clrFore, COLORREF, "%x"); - expect_eq(line, rb.clrBack, clrBack, COLORREF, "%x"); + expect_eq(line, rb.clrFore, clrFore, COLORREF, "%lx"); + expect_eq(line, rb.clrBack, clrBack, COLORREF, "%lx"); expect_eq(line, strcmp(rb.lpText, lpText), 0, int, "%d"); expect_eq(line, rb.iImage, iImage, int, "%x"); expect_eq(line, rb.hwndChild, hwndChild, HWND, "%p"); @@ -945,7 +945,7 @@ static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle, expect_eq(line, rb.cyMaxChild, cyMaxChild, int, "%x"); expect_eq(line, rb.cyIntegral, cyIntegral, int, "%x"); expect_eq(line, rb.cxIdeal, cxIdeal, int, "%d"); - expect_eq(line, rb.lParam, lParam, LPARAM, "%ld"); + expect_eq(line, rb.lParam, lParam, LPARAM, "%Id"); ok(rb.cxHeader == cxHeader || rb.cxHeader == cxHeader + 1 || broken(rb.cxHeader == cxHeader_broken), "expected %d for %d from line %d\n", cxHeader, rb.cxHeader, line); } @@ -1029,9 +1029,9 @@ static void test_colors(void)
/* test default colors */ clr = SendMessageA(hRebar, RB_GETTEXTCOLOR, 0, 0); - compare(clr, CLR_NONE, "%x"); + compare(clr, CLR_NONE, "%lx"); clr = SendMessageA(hRebar, RB_GETBKCOLOR, 0, 0); - compare(clr, CLR_NONE, "%x"); + compare(clr, CLR_NONE, "%lx");
scheme.dwSize = sizeof(scheme); scheme.clrBtnHighlight = 0; @@ -1039,8 +1039,8 @@ static void test_colors(void) ret = SendMessageA(hRebar, RB_GETCOLORSCHEME, 0, (LPARAM)&scheme); if (ret) { - compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%x"); - compare(scheme.clrBtnShadow, CLR_DEFAULT, "%x"); + compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%lx"); + compare(scheme.clrBtnShadow, CLR_DEFAULT, "%lx"); } else skip("RB_GETCOLORSCHEME not supported\n"); @@ -1052,14 +1052,14 @@ static void test_colors(void) bi.clrFore = bi.clrBack = 0xc0ffe; ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi); ok(ret, "RB_GETBANDINFOA failed\n"); - compare(bi.clrFore, RGB(0, 0, 0), "%x"); - compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%x"); + compare(bi.clrFore, RGB(0, 0, 0), "%lx"); + compare(bi.clrBack, GetSysColor(COLOR_3DFACE), "%lx");
SendMessageA(hRebar, RB_SETTEXTCOLOR, 0, RGB(255, 0, 0)); bi.clrFore = bi.clrBack = 0xc0ffe; ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi); ok(ret, "RB_GETBANDINFOA failed\n"); - compare(bi.clrFore, RGB(0, 0, 0), "%x"); + compare(bi.clrFore, RGB(0, 0, 0), "%lx");
DestroyWindow(hRebar); } diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index 0038cadd7d2..b8f43142d6b 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -283,10 +283,10 @@ static void test_STM_SETIMAGE(void)
for (type = SS_LEFT; type < SS_ETCHEDFRAME; type++) { - winetest_push_context("%u", type); + winetest_push_context("%lu", type);
hwnd = create_static(type); - ok(hwnd != 0, "failed to create static type %#x\n", type); + ok(hwnd != 0, "failed to create static type %#lx\n", type);
/* set icon */ g_nReceivedColorStatic = 0; diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index 5de96c19f03..1851507481f 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -25,7 +25,12 @@
#define SUBCLASS_NAME "MyStatusBar"
-#define expect(expected,got) ok (expected == got,"Expected %d, got %d\n",expected,got) +#define expect(expected,got) expect_(__LINE__, expected, got) +static inline void expect_(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); +} + #define expect_rect(_left,_top,_right,_bottom,got) do { \ RECT exp = {abs(got.left - _left), abs(got.top - _top), \ abs(got.right - _right), abs(got.bottom - _bottom)}; \ @@ -145,7 +150,7 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEXA *enumlf, NEWTEXTME y = tm.tmHeight + (tm.tmInternalLeading ? tm.tmInternalLeading : 2) + 4;
ok( (rcCtrl.bottom == max(y, g_ysize)) || (rcCtrl.bottom == max(y, g_dpisize)), - "got %d (expected %d or %d) for %s #%d\n", + "got %ld (expected %d or %d) for %s #%d\n", rcCtrl.bottom, max(y, g_ysize), max(y, g_dpisize), facename, sizes[i]);
SelectObject(hdc, hOldFont); @@ -370,11 +375,11 @@ static void test_status_control(void) crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, RGB(255,0,0)); ok(crColor == CLR_DEFAULT || broken(crColor == RGB(0,0,0)), /* win95 */ - "Expected 0x%.8x, got 0x%.8x\n", CLR_DEFAULT, crColor); + "Expected 0x%.8lx, got 0x%.8lx\n", CLR_DEFAULT, crColor); crColor = SendMessageA(hWndStatus, SB_SETBKCOLOR , 0, CLR_DEFAULT); ok(crColor == RGB(255,0,0) || broken(crColor == RGB(0,0,0)), /* win95 */ - "Expected 0x%.8x, got 0x%.8x\n", RGB(255,0,0), crColor); + "Expected 0x%.8lx, got 0x%.8lx\n", RGB(255,0,0), crColor);
/* Add an icon to the status bar */ hIcon = LoadIconA(NULL, (LPCSTR)IDI_QUESTION); diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index b2b47319b16..439d61a83c8 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -155,7 +155,7 @@ static void ok_sequence(const struct message *expected, const char *context) "%s: the procnum %d was expected, but got procnum %d instead\n", context, expected->procnum, actual->procnum); ok(expected->wParam == actual->wParam, - "%s: in procnum %d expecting wParam 0x%lx got 0x%lx\n", + "%s: in procnum %d expecting wParam 0x%Ix got 0x%Ix\n", context, expected->procnum, expected->wParam, actual->wParam); expected++; actual++; diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 7f3e19fc670..d5192c26b5c 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -184,7 +184,7 @@ static void test_create_syslink(void) /* Create an invisible SysLink control */ flush_sequences(sequences, NUM_MSG_SEQUENCE); hWndSysLink = create_syslink(WS_CHILD | WS_TABSTOP, hWndParent); - ok(hWndSysLink != NULL, "Expected non NULL value (le %u)\n", GetLastError()); + ok(hWndSysLink != NULL, "Expected non NULL value (le %lu)\n", GetLastError()); flush_events(); ok_sequence(sequences, SYSLINK_SEQ_INDEX, empty_wnd_seq, "create SysLink", FALSE); ok_sequence(sequences, PARENT_SEQ_INDEX, parent_create_syslink_wnd_seq, "create SysLink (parent)", TRUE); @@ -210,7 +210,7 @@ static void test_LM_GETIDEALHEIGHT(void) ok(hwnd != NULL, "Failed to create SysLink window.\n");
ret = SendMessageA(hwnd, LM_GETIDEALHEIGHT, 0, 0); - ok(ret > 0, "Unexpected ideal height, %d.\n", ret); + ok(ret > 0, "Unexpected ideal height, %ld.\n", ret);
DestroyWindow(hwnd); } @@ -226,13 +226,13 @@ static void test_LM_GETIDEALSIZE(void)
memset(&sz, 0, sizeof(sz)); ret = SendMessageA(hwnd, LM_GETIDEALSIZE, 0, (LPARAM)&sz); - ok(ret > 0, "Unexpected return value, %d.\n", ret); + ok(ret > 0, "Unexpected return value, %ld.\n", ret); if (sz.cy == 0) win_skip("LM_GETIDEALSIZE is not supported.\n"); else { - ok(sz.cx > 5, "Unexpected ideal width, %d.\n", sz.cx); - ok(sz.cy == ret, "Unexpected ideal height, %d.\n", sz.cy); + ok(sz.cx > 5, "Unexpected ideal width, %ld.\n", sz.cx); + ok(sz.cy == ret, "Unexpected ideal height, %ld.\n", sz.cy); }
DestroyWindow(hwnd); diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index c5d57af114d..67dea94b55c 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -37,7 +37,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
#define expect_str(expected, got)\ @@ -56,14 +56,14 @@ static void CheckSize(HWND hwnd, INT width, INT height, const char *msg, int lin
SendMessageA(hwnd, TCM_GETITEMRECT, 0, (LPARAM)&r); if (width >= 0 && height < 0) - ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%d]\n", + ok_(__FILE__,line) (width == r.right - r.left, "%s: Expected width [%d] got [%ld]\n", msg, width, r.right - r.left); else if (height >= 0 && width < 0) - ok_(__FILE__,line) (height == r.bottom - r.top, "%s: Expected height [%d] got [%d]\n", + ok_(__FILE__,line) (height == r.bottom - r.top, "%s: Expected height [%d] got [%ld]\n", msg, height, r.bottom - r.top); else ok_(__FILE__,line) ((width == r.right - r.left) && (height == r.bottom - r.top ), - "%s: Expected [%d,%d] got [%d,%d]\n", msg, width, height, + "%s: Expected [%d,%d] got [%ld,%ld]\n", msg, width, height, r.right - r.left, r.bottom - r.top); }
@@ -461,7 +461,7 @@ static void test_tab(INT nMinTabWidth) dpi = GetDeviceCaps(hdc, LOGPIXELSX); hOldFont = SelectObject(hdc, (HFONT)SendMessageA(hwTab, WM_GETFONT, 0, 0)); GetTextExtentPoint32A(hdc, "Tab 1", strlen("Tab 1"), &size); - trace("Tab1 text size: size.cx=%d size.cy=%d\n", size.cx, size.cy); + trace("Tab1 text size: size.cx=%ld size.cy=%ld\n", size.cx, size.cy); SelectObject(hdc, hOldFont); ReleaseDC(hwTab, hdc);
@@ -532,7 +532,7 @@ static void test_tab(INT nMinTabWidth) exp = max(size.cx +TAB_PADDING_X*2, (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth); SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab ); ok( rTab.right - rTab.left == exp || broken(rTab.right - rTab.left == DEFAULT_MIN_TAB_WIDTH), - "no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left ); + "no icon, default width: Expected width [%d] got [%ld]\n", exp, rTab.right - rTab.left );
for (i=0; i<8; i++) { @@ -560,7 +560,7 @@ static void test_tab(INT nMinTabWidth) exp = (nMinTabWidth < 0) ? DEFAULT_MIN_TAB_WIDTH : nMinTabWidth; SendMessageA( hwTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab ); ok( rTab.right - rTab.left == exp || broken(rTab.right - rTab.left == DEFAULT_MIN_TAB_WIDTH), - "no icon, default width: Expected width [%d] got [%d]\n", exp, rTab.right - rTab.left ); + "no icon, default width: Expected width [%d] got [%ld]\n", exp, rTab.right - rTab.left );
for (i=0; i<8; i++) { @@ -830,14 +830,14 @@ static void test_getset_item(void) ok(GetParent(hTab) == NULL, "got %p, expected null parent\n", GetParent(hTab));
ret = SendMessageA(hTab, TCM_SETITEMEXTRA, sizeof(LPARAM)-1, 0); - ok(ret == TRUE, "got %d\n", ret); + ok(ret == TRUE, "got %ld\n", ret);
/* set some item data */ tcItem.lParam = ~0; tcItem.mask = TCIF_PARAM;
ret = SendMessageA(hTab, TCM_INSERTITEMA, 0, (LPARAM)&tcItem); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret);
/* all sizeof(LPARAM) returned anyway when using sizeof(LPARAM)-1 size */ memset(&lparam, 0xaa, sizeof(lparam)); @@ -847,7 +847,7 @@ static void test_getset_item(void) expect(TRUE, ret); /* everything higher specified size is preserved */ memset(&lparam, 0xff, sizeof(lparam)-1); - ok(tcItem.lParam == lparam, "Expected 0x%lx, got 0x%lx\n", lparam, tcItem.lParam); + ok(tcItem.lParam == lparam, "Expected 0x%Ix, got 0x%Ix\n", lparam, tcItem.lParam);
DestroyWindow(hTab);
@@ -862,7 +862,7 @@ static void test_getset_item(void) tcItem.mask = TCIF_PARAM; ret = SendMessageA(hTab, TCM_GETITEMA, 5, (LPARAM)&tcItem); expect(FALSE, ret); - ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam); + ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);
memset(&tcItem, 0xcc, sizeof(tcItem)); tcItem.mask = TCIF_IMAGE; @@ -899,13 +899,13 @@ static void test_getset_item(void) tcItem.mask = TCIF_PARAM; ret = SendMessageA(hTab, TCM_GETITEMA, -1, (LPARAM)&tcItem); expect(FALSE, ret); - ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam); + ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);
memset(&tcItem, 0xcc, sizeof(tcItem)); tcItem.mask = TCIF_PARAM; ret = SendMessageA(hTab, TCM_GETITEMA, -2, (LPARAM)&tcItem); expect(FALSE, ret); - ok(tcItem.lParam == 0, "Expected zero lParam, got %lu\n", tcItem.lParam); + ok(tcItem.lParam == 0, "Expected zero lParam, got %Iu\n", tcItem.lParam);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
@@ -1227,10 +1227,10 @@ static void test_TCM_SETITEMEXTRA(void) }
ret = SendMessageA(hTab, TCM_SETITEMEXTRA, -1, 0); - ok(ret == FALSE, "got %d\n", ret); + ok(ret == FALSE, "got %ld\n", ret);
ret = SendMessageA(hTab, TCM_SETITEMEXTRA, 2, 0); - ok(ret == TRUE, "got %d\n", ret); + ok(ret == TRUE, "got %ld\n", ret); DestroyWindow(hTab);
/* it's not possible to change extra data size for control with tabs */ @@ -1238,7 +1238,7 @@ static void test_TCM_SETITEMEXTRA(void) ok(hTab != NULL, "Failed to create tab control\n");
ret = SendMessageA(hTab, TCM_SETITEMEXTRA, 2, 0); - ok(ret == FALSE, "got %d\n", ret); + ok(ret == FALSE, "got %ld\n", ret); DestroyWindow(hTab); }
@@ -1270,7 +1270,7 @@ static void test_TCS_OWNERDRAWFIXED(void)
itemdata = 0; memset(&itemdata, 0xde, 4); - ok(g_drawitem.itemData == itemdata, "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata); + ok(g_drawitem.itemData == itemdata, "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);
DestroyWindow(hTab);
@@ -1301,7 +1301,7 @@ static void test_TCS_OWNERDRAWFIXED(void) RedrawWindow(hTab, NULL, 0, RDW_UPDATENOW);
memset(&itemdata, 0xde, sizeof(ULONG_PTR)); - ok(*(ULONG_PTR*)g_drawitem.itemData == itemdata, "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata); + ok(*(ULONG_PTR*)g_drawitem.itemData == itemdata, "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);
DestroyWindow(hTab);
@@ -1334,7 +1334,7 @@ static void test_TCS_OWNERDRAWFIXED(void) memset(&itemdata, 0xde, 4); memset(&itemdata2, 0xde, sizeof(LPARAM)-1); ok(g_drawitem.itemData == itemdata || broken(g_drawitem.itemData == itemdata2) /* win98 */, - "got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, itemdata); + "got 0x%Ix, expected 0x%Ix\n", g_drawitem.itemData, itemdata);
DestroyWindow(hTab); } @@ -1378,7 +1378,7 @@ static void test_create(void) hTab = CreateWindowA(WC_TABCONTROLA, "TestTab", ptr->style, 10, 10, 300, 100, parent_wnd, NULL, NULL, 0); style = GetWindowLongA(hTab, GWL_STYLE); - ok(style == ptr->act_style, "expected style 0x%08x, got style 0x%08x\n", ptr->act_style, style); + ok(style == ptr->act_style, "expected style 0x%08lx, got style 0x%08lx\n", ptr->act_style, style);
DestroyWindow(hTab); ptr++; diff --git a/dlls/comctl32/tests/taskdialog.c b/dlls/comctl32/tests/taskdialog.c index 9c0b8772a59..6a12b185639 100644 --- a/dlls/comctl32/tests/taskdialog.c +++ b/dlls/comctl32/tests/taskdialog.c @@ -417,7 +417,7 @@ static void run_test_(TASKDIALOGCONFIG *info, int expect_button, int expect_radi flush_sequences(sequences, NUM_MSG_SEQUENCES);
hr = pTaskDialogIndirect(info, &ret_button, &ret_radio, &ret_verification); - ok_(file, line)(hr == S_OK, "TaskDialogIndirect() failed, got %#x.\n", hr); + ok_(file, line)(hr == S_OK, "TaskDialogIndirect() failed, got %#lx.\n", hr);
ok_sequence_(sequences, TASKDIALOG_SEQ_INDEX, msg_start, context, FALSE, file, line); ok_(file, line)(ret_button == expect_button, @@ -437,7 +437,7 @@ static HRESULT CALLBACK taskdialog_callback_proc(HWND hwnd, UINT notification, const struct message_info *msg_send; struct message msg;
- ok(test_ref_data == ref_data, "Unexpected ref data %lu.\n", ref_data); + ok(test_ref_data == ref_data, "Unexpected ref data %Iu.\n", ref_data);
init_test_message(notification, (short)wParam, lParam, &msg); add_message(sequences, TASKDIALOG_SEQ_INDEX, &msg); @@ -458,19 +458,19 @@ static void test_invalid_parameters(void) HRESULT hr;
hr = pTaskDialogIndirect(NULL, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
info.cbSize = 0; hr = pTaskDialogIndirect(&info, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
info.cbSize = sizeof(TASKDIALOGCONFIG) - 1; hr = pTaskDialogIndirect(&info, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr);
info.cbSize = sizeof(TASKDIALOGCONFIG) + 1; hr = pTaskDialogIndirect(&info, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "Unexpected return value %#x.\n", hr); + ok(hr == E_INVALIDARG, "Unexpected return value %#lx.\n", hr); }
static void test_callback(void) @@ -729,9 +729,9 @@ static HRESULT CALLBACK taskdialog_callback_proc_progress_bar(HWND hwnd, UINT no
/* TDM_SET_PROGRESS_BAR_RANGE */ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200)); - ok(ret == MAKELONG(0, 100), "Expect range:%x got:%lx\n", MAKELONG(0, 100), ret); + ok(ret == MAKELONG(0, 100), "Expect range:%lx got:%lx\n", MAKELONG(0, 100), ret); ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200)); - ok(ret == MAKELONG(0, 200), "Expect range:%x got:%lx\n", MAKELONG(0, 200), ret); + ok(ret == MAKELONG(0, 200), "Expect range:%lx got:%lx\n", MAKELONG(0, 200), ret);
/* TDM_SET_PROGRESS_BAR_POS */ if (flags & TDF_SHOW_MARQUEE_PROGRESS_BAR) diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index dcd95ffa4d8..80f9e067c00 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -216,7 +216,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam) case TBN_GETDISPINFOW: nmdisp = (NMTBDISPINFOA *)lParam;
- compare(nmdisp->dwMask, g_dwExpectedDispInfoMask, "%x"); + compare(nmdisp->dwMask, g_dwExpectedDispInfoMask, "%lx"); ok(nmdisp->pszText == NULL, "pszText is not NULL\n"); break; case TBN_SAVE: @@ -260,7 +260,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam) if (restore->iItem == -1) { ok( restore->cButtons == 25, "got %d\n", restore->cButtons ); - ok( *restore->pCurrent == 0xcafe, "got %08x\n", *restore->pCurrent ); + ok( *restore->pCurrent == 0xcafe, "got %08lx\n", *restore->pCurrent ); /* Skip the last one */ restore->cButtons = 11; restore->pCurrent++; @@ -269,7 +269,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam) } else { - ok( *restore->pCurrent == 0xcafe0000 + restore->iItem, "got %08x\n", *restore->pCurrent ); + ok( *restore->pCurrent == 0xcafe0000 + restore->iItem, "got %08lx\n", *restore->pCurrent ); if (restore->iItem < 7 || restore->iItem == 10) { ok( restore->tbButton.iBitmap == -1, "got %08x\n", restore->tbButton.iBitmap ); @@ -291,8 +291,8 @@ static LRESULT parent_wnd_notify(LPARAM lParam) ok( restore->tbButton.fsStyle == BTNS_SEP, "%d: got %02x\n", restore->iItem, restore->tbButton.fsStyle ); }
- ok( restore->tbButton.dwData == 0, "got %08lx\n", restore->tbButton.dwData ); - ok( restore->tbButton.iString == 0, "got %08lx\n", restore->tbButton.iString ); + ok( restore->tbButton.dwData == 0, "got %08Ix\n", restore->tbButton.dwData ); + ok( restore->tbButton.iString == 0, "got %08Ix\n", restore->tbButton.iString );
restore->tbButton.iBitmap = 0; restore->tbButton.fsState = TBSTATE_ENABLED; @@ -467,12 +467,12 @@ static void basic_test(void) ok(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 1008, 0), "B3 pressed\n");
/* tests with invalid index */ - compare(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessageA(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessageA(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessageA(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessageA(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), -1L, "%ld"); - compare(SendMessageA(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessageA(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id"); + compare(SendMessageA(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id"); + compare(SendMessageA(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id"); + compare(SendMessageA(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), (LRESULT)-1L, "%Id"); + compare(SendMessageA(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), (LRESULT)-1L, "%Id"); + compare(SendMessageA(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), (LRESULT)-1L, "%Id");
DestroyWindow(hToolbar); } @@ -753,11 +753,11 @@ static void test_add_bitmap(void) /* however TB_SETBITMAPSIZE/add std bitmap won't change the image size (the button size does change) */ ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(8, 8)) == TRUE, "TB_SETBITMAPSIZE failed\n"); UpdateWindow(hToolbar); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(15, 14), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(15, 14), "%lx"); CHECK_IMAGELIST(10, 20, 15); ok(SendMessageA(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&stdsmall) == 1, "TB_SETBITMAPSIZE failed\n"); UpdateWindow(hToolbar); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%lx"); CHECK_IMAGELIST(22, 20, 15);
/* check standard bitmaps */ @@ -768,12 +768,12 @@ static void test_add_bitmap(void)
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); CHECK_IMAGELIST(15, 16, 16); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%lx"); addbmp.nID = IDB_STD_LARGE_COLOR; rebuild_toolbar(&hToolbar); ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); CHECK_IMAGELIST(15, 24, 24); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(31, 30), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(31, 30), "%lx");
addbmp.nID = IDB_VIEW_SMALL_COLOR; rebuild_toolbar(&hToolbar); @@ -901,71 +901,71 @@ static void test_hotitem(void) * comctl6 doesn't have this requirement even when theme == NULL */ SetWindowLongA(hToolbar, GWL_STYLE, TBSTYLE_FLAT | GetWindowLongA(hToolbar, GWL_STYLE)); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == -1, "Hot item: %ld, expected -1\n", ret); + ok(ret == -1, "Hot item: %Id, expected -1\n", ret); ret = SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0); - ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); + ok(ret == -1, "TB_SETHOTITEM returned %Id, expected -1\n", ret); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 1, "Hot item: %ld, expected 1\n", ret); + ok(ret == 1, "Hot item: %Id, expected 1\n", ret); ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0); - ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret); + ok(ret == 1, "TB_SETHOTITEM returned %Id, expected 1\n", ret);
ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0xbeef, 0); - ok(ret == 2, "TB_SETHOTITEM returned %ld, expected 2\n", ret); + ok(ret == 2, "TB_SETHOTITEM returned %Id, expected 2\n", ret); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 2, "Hot item: %lx, expected 2\n", ret); + ok(ret == 2, "Hot item: %Ix, expected 2\n", ret); ret = SendMessageA(hToolbar, TB_SETHOTITEM, -0xbeef, 0); - ok(ret == 2, "TB_SETHOTITEM returned %ld, expected 2\n", ret); + ok(ret == 2, "TB_SETHOTITEM returned %Id, expected 2\n", ret); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == -1, "Hot item: %lx, expected -1\n", ret); + ok(ret == -1, "Hot item: %Ix, expected -1\n", ret);
expect_hot_notify(0, 7); ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); - ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); + ok(ret == -1, "TB_SETHOTITEM returned %Id, expected -1\n", ret); check_hot_notify(); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 3, "Hot item: %lx, expected 3\n", ret); + ok(ret == 3, "Hot item: %Ix, expected 3\n", ret); g_fBlockHotItemChange = TRUE; ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 3, "Hot item: %lx, expected 3\n", ret); + ok(ret == 3, "Hot item: %Ix, expected 3\n", ret); g_fBlockHotItemChange = FALSE;
g_fReceivedHotItemChange = FALSE; ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0xbeaf, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "TBN_HOTITEMCHANGE received for invalid parameter\n");
g_fReceivedHotItemChange = FALSE; ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "TBN_HOTITEMCHANGE received after a duplication\n");
expect_hot_notify(7, 0); ret = SendMessageA(hToolbar, TB_SETHOTITEM, -0xbeaf, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret); check_hot_notify(); SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0);
/* setting disabled buttons will generate a notify with the button id but no button will be hot */ expect_hot_notify(7, 9); ret = SendMessageA(hToolbar, TB_SETHOTITEM, 4, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_SETHOTITEM returned %Id, expected 3\n", ret); check_hot_notify(); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == -1, "Hot item: %lx, expected -1\n", ret); + ok(ret == -1, "Hot item: %Ix, expected -1\n", ret); /* enabling the button won't change that */ SendMessageA(hToolbar, TB_ENABLEBUTTON, 9, TRUE); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret); + ok(ret == -1, "TB_GETHOTITEM returned %Id, expected -1\n", ret);
/* disabling a hot button works */ ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); - ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); + ok(ret == -1, "TB_SETHOTITEM returned %Id, expected -1\n", ret); g_fReceivedHotItemChange = FALSE; SendMessageA(hToolbar, TB_ENABLEBUTTON, 7, FALSE); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 3, "TB_GETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_GETHOTITEM returned %Id, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0); @@ -975,17 +975,17 @@ static void test_hotitem(void) g_fReceivedHotItemChange = FALSE; ok(SendMessageA(hToolbar, TB_SETBUTTONINFOA, 1, (LPARAM)&tbinfo) == TRUE, "TB_SETBUTTONINFOA failed\n"); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 1, "TB_GETHOTITEM returned %ld, expected 1\n", ret); + ok(ret == 1, "TB_GETHOTITEM returned %Id, expected 1\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
/* deleting a button unsets the hot item */ ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0, 0); - ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret); + ok(ret == 1, "TB_SETHOTITEM returned %Id, expected 1\n", ret); g_fReceivedHotItemChange = FALSE; ret = SendMessageA(hToolbar, TB_DELETEBUTTON, 1, 0); - ok(ret == TRUE, "TB_DELETEBUTTON returned %ld, expected TRUE\n", ret); + ok(ret == TRUE, "TB_DELETEBUTTON returned %Id, expected TRUE\n", ret); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret); + ok(ret == -1, "TB_GETHOTITEM returned %Id, expected -1\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
DestroyWindow(hToolbar); @@ -1519,11 +1519,11 @@ static void test_sizes(void) /* -1 in TB_SETBITMAPSIZE is a special code meaning that the coordinate shouldn't be changed */ add_128x15_bitmap(hToolbar, 16); ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(14, -1)), "TB_SETBITMAPSIZE failed\n"); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 21), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 21), "%lx"); ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(-1, 12)), "TB_SETBITMAPSIZE failed\n"); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%lx"); ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(-1, -1)), "TB_SETBITMAPSIZE failed\n"); - compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%x"); + compare((LONG)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(21, 18), "%lx"); /* check the imagelist */ InvalidateRect(hToolbar, NULL, TRUE); UpdateWindow(hToolbar); @@ -1689,13 +1689,13 @@ static void test_sizes(void) SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)buttons1); check_sizes(); GetClientRect(hToolbar, &rect); - ok(rect.top == 0, "rect.top = %d\n", rect.top); - ok(rect.bottom == 26, "rect.bottom = %d\n", rect.bottom); + ok(rect.top == 0, "rect.top = %ld\n", rect.top); + ok(rect.bottom == 26, "rect.bottom = %ld\n", rect.bottom);
rebuild_toolbar_ex(&hToolbar, WS_EX_DLGMODALFRAME); GetClientRect(hToolbar, &rect); - ok(rect.top == 0, "rect.top = %d\n", rect.top); - ok(rect.bottom == 26, "rect.bottom = %d\n", rect.bottom); + ok(rect.top == 0, "rect.top = %ld\n", rect.top); + ok(rect.bottom == 26, "rect.bottom = %ld\n", rect.bottom);
free_tbsize_results(); DestroyWindow(hToolbar); @@ -1714,7 +1714,7 @@ static void prepare_recalc_test(HWND *phToolbar) SetWindowLongA(*phToolbar, GWL_STYLE, GetWindowLongA(*phToolbar, GWL_STYLE) | TBSTYLE_FLAT); SendMessageA(*phToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); - ok(rect.top == 2, "Test will make no sense because initial top is %d instead of 2\n", + ok(rect.top == 2, "Test will make no sense because initial top is %ld instead of 2\n", rect.top); }
@@ -1722,7 +1722,7 @@ static BOOL did_recalc(HWND hToolbar) { RECT rect; SendMessageA(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); - ok(rect.top == 2 || rect.top == 0, "Unexpected top margin %d in recalc test\n", + ok(rect.top == 2 || rect.top == 0, "Unexpected top margin %ld in recalc test\n", rect.top); return (rect.top == 0); } @@ -1741,7 +1741,7 @@ static void restore_recalc_state(HWND hToolbar) SendMessageA(hToolbar, TB_GETSTYLE, 0, 0) | TBSTYLE_FLAT); /* safety check */ SendMessageA(hToolbar, TB_GETITEMRECT, 1, (LPARAM)&rect); - ok(rect.top == 2, "Test will make no sense because initial top is %d instead of 2\n", + ok(rect.top == 2, "Test will make no sense because initial top is %ld instead of 2\n", rect.top); }
@@ -1960,13 +1960,13 @@ static void test_dispinfo(void)
ret = (BOOL)SendMessageA(hToolbar, CCM_SETUNICODEFORMAT, TRUE, 0); compare(ret, FALSE, "%d"); - compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), 1L, "%ld"); + compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), (LRESULT)1L, "%Id"); InvalidateRect(hToolbar, NULL, FALSE); UpdateWindow(hToolbar);
ret = (BOOL)SendMessageA(hToolbar, CCM_SETUNICODEFORMAT, FALSE, 0); compare(ret, TRUE, "%d"); - compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), 0L, "%ld"); + compare(SendMessageA(hToolbar, CCM_GETUNICODEFORMAT, 0, 0), (LRESULT)0L, "%Id"); InvalidateRect(hToolbar, NULL, FALSE); UpdateWindow(hToolbar);
@@ -2023,7 +2023,7 @@ static void test_setrows(void)
rows = SendMessageA(hToolbar, TB_GETROWS, MAKELONG(0,0), MAKELONG(0,0)); ok(rows == tbrows_results[i].expectedRows, - "[%d] Unexpected number of rows %d (expected %d)\n", i, rows, + "[%ld] Unexpected number of rows %d (expected %d)\n", i, rows, tbrows_results[i].expectedRows); }
@@ -2133,25 +2133,25 @@ static void test_get_set_style(void) style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0); style2 = GetWindowLongA(hToolbar, GWL_STYLE); todo_wine - ok(style == style2, "got 0x%08x, expected 0x%08x\n", style, style2); + ok(style == style2, "got 0x%08lx, expected 0x%08lx\n", style, style2);
/* try to alter common window bits */ style2 |= WS_BORDER; ret = SendMessageA(hToolbar, TB_SETSTYLE, 0, style2); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0); style2 = GetWindowLongA(hToolbar, GWL_STYLE); ok((style != style2) && (style == (style2 | WS_BORDER)), - "got 0x%08x, expected 0x%08x\n", style, style2); - ok(style & WS_BORDER, "got 0x%08x\n", style); + "got 0x%08lx, expected 0x%08lx\n", style, style2); + ok(style & WS_BORDER, "got 0x%08lx\n", style);
/* now styles are the same, alter window style */ ret = SendMessageA(hToolbar, TB_SETSTYLE, 0, style2); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret); style2 |= WS_BORDER; SetWindowLongA(hToolbar, GWL_STYLE, style2); style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0); - ok(style == style2, "got 0x%08x, expected 0x%08x\n", style, style2); + ok(style == style2, "got 0x%08lx, expected 0x%08lx\n", style, style2);
DestroyWindow(hToolbar); } @@ -2179,13 +2179,13 @@ static LRESULT WINAPI toolbar_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam,
/* control is already set up */ style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); - ok(style != 0, "got %x\n", style); + ok(style != 0, "got %lx\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & TBSTYLE_TOOLTIPS) == 0, "got 0x%08x\n", style); + ok((style & TBSTYLE_TOOLTIPS) == 0, "got 0x%08lx\n", style); SetWindowLongA(hwnd, GWL_STYLE, style|TBSTYLE_TOOLTIPS); style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style); + ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
return ret; } @@ -2199,23 +2199,23 @@ static LRESULT WINAPI toolbar_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam, CHECK_EXPECT2(g_hook_WM_CREATE);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style); + ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
/* test if toolbar-specific messages are already working before WM_CREATE */ style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); - ok(style != 0, "got %x\n", style); - ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%x\n", style); - ok((cs->style & TBSTYLE_TOOLTIPS) == 0, "0x%08x\n", cs->style); + ok(style != 0, "got %lx\n", style); + ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%lx\n", style); + ok((cs->style & TBSTYLE_TOOLTIPS) == 0, "0x%08lx\n", cs->style);
ret = CallWindowProcA(oldproc, hwnd, msg, wParam, lParam);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style); + ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
/* test if toolbar-specific messages are already working before WM_CREATE */ style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); - ok(style != 0, "got %x\n", style); - ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%x\n", style); + ok(style != 0, "got %lx\n", style); + ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%lx\n", style);
return ret; } @@ -2276,11 +2276,11 @@ static void test_create(BOOL v6) style = GetWindowLongA(hwnd, GWL_STYLE); if (v6) { - ok(!(style & TBSTYLE_TOOLTIPS), "got 0x%08x\n", style); + ok(!(style & TBSTYLE_TOOLTIPS), "got 0x%08lx\n", style); } else { - ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08x\n", style); + ok((style & TBSTYLE_TOOLTIPS) == TBSTYLE_TOOLTIPS, "got 0x%08lx\n", style);
tooltip = (HWND)SendMessageA(hwnd, TB_GETTOOLTIPS, 0, 0); ok(tooltip != NULL, "got %p\n", tooltip); @@ -2296,10 +2296,10 @@ static void test_create(BOOL v6) 0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandleA(NULL), NULL);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08x\n", style); + ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08lx\n", style);
style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); - ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08x\n", style); + ok((style & TBSTYLE_TRANSPARENT) == TBSTYLE_TRANSPARENT, "got 0x%08lx\n", style);
DestroyWindow(hwnd);
@@ -2314,10 +2314,10 @@ static void test_create(BOOL v6) GetModuleHandleA(NULL), NULL);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08x\n", style); + ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08lx\n", style);
style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); - ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08x\n", style); + ok(!(style & TBSTYLE_TRANSPARENT), "got 0x%08lx\n", style);
DestroyWindow(hwnd); } @@ -2384,20 +2384,20 @@ static void test_TB_GET_SET_EXTENDEDSTYLE(void) oldstyle2 = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0);
oldstyle = SendMessageA(hwnd, TB_SETEXTENDEDSTYLE, ptr->mask, ptr->style); - ok(oldstyle == oldstyle2, "%d: got old style 0x%08x, expected 0x%08x\n", i, oldstyle, oldstyle2); + ok(oldstyle == oldstyle2, "%d: got old style 0x%08lx, expected 0x%08lx\n", i, oldstyle, oldstyle2); style = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); - ok(style == ptr->style_set, "%d: got style 0x%08x, expected 0x%08x\n", i, style, ptr->style_set); + ok(style == ptr->style_set, "%d: got style 0x%08lx, expected 0x%08lx\n", i, style, ptr->style_set); }
/* Windows sets CCS_VERT when TB_GETEXTENDEDSTYLE is set */ oldstyle2 = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); oldstyle = SendMessageA(hwnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_VERTICAL); - ok(oldstyle == oldstyle2, "got old style 0x%08x, expected 0x%08x\n", oldstyle, oldstyle2); + ok(oldstyle == oldstyle2, "got old style 0x%08lx, expected 0x%08lx\n", oldstyle, oldstyle2); style = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); - ok(style == TBSTYLE_EX_VERTICAL, "got style 0x%08x, expected 0x%08x\n", style, TBSTYLE_EX_VERTICAL); + ok(style == TBSTYLE_EX_VERTICAL, "got style 0x%08lx, expected 0x%08x\n", style, TBSTYLE_EX_VERTICAL); style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); todo_wine - ok(style == CCS_VERT, "got style 0x%08x, expected CCS_VERT\n", style); + ok(style == CCS_VERT, "got style 0x%08lx, expected CCS_VERT\n", style);
DestroyWindow(hwnd); } @@ -2504,11 +2504,11 @@ static void test_save(void) DestroyWindow( wnd );
res = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\Wine\WineTest", &key ); - ok( !res, "got %08x\n", res ); + ok( !res, "got %08lx\n", res ); res = RegQueryValueExW( key, L"toolbartest", NULL, &type, data, &size ); - ok( !res, "got %08x\n", res ); - ok( type == REG_BINARY, "got %08x\n", type ); - ok( size == sizeof(expect), "got %08x\n", size ); + ok( !res, "got %08lx\n", res ); + ok( type == REG_BINARY, "got %08lx\n", type ); + ok( size == sizeof(expect), "got %08lx\n", size ); ok( !memcmp( data, expect, size ), "mismatch\n" );
RegCloseKey( key ); @@ -2521,23 +2521,23 @@ static void test_save(void) ok( res, "restoring failed\n" ); ok_sequence(sequences, PARENT_SEQ_INDEX, restore_parent_seq, "restore", FALSE); count = SendMessageW( wnd, TB_BUTTONCOUNT, 0, 0 ); - ok( count == ARRAY_SIZE(expect_btns), "got %d\n", count ); + ok( count == ARRAY_SIZE(expect_btns), "got %ld\n", count );
for (i = 0; i < count; i++) { res = SendMessageW( wnd, TB_GETBUTTON, i, (LPARAM)&tb ); - ok( res, "got %d\n", res ); + ok( res, "got %ld\n", res );
- ok( tb.iBitmap == expect_btns[i].iBitmap, "%d: got %d\n", i, tb.iBitmap ); - ok( tb.idCommand == expect_btns[i].idCommand, "%d: got %d\n", i, tb.idCommand ); - ok( tb.fsState == expect_btns[i].fsState, "%d: got %02x\n", i, tb.fsState ); - ok( tb.fsStyle == expect_btns[i].fsStyle, "%d: got %02x\n", i, tb.fsStyle ); - ok( tb.dwData == expect_btns[i].dwData, "%d: got %lx\n", i, tb.dwData ); + ok( tb.iBitmap == expect_btns[i].iBitmap, "%ld: got %d\n", i, tb.iBitmap ); + ok( tb.idCommand == expect_btns[i].idCommand, "%ld: got %d\n", i, tb.idCommand ); + ok( tb.fsState == expect_btns[i].fsState, "%ld: got %02x\n", i, tb.fsState ); + ok( tb.fsStyle == expect_btns[i].fsStyle, "%ld: got %02x\n", i, tb.fsStyle ); + ok( tb.dwData == expect_btns[i].dwData, "%ld: got %Ix\n", i, tb.dwData ); if (IS_INTRESOURCE(expect_btns[i].iString)) - ok( tb.iString == expect_btns[i].iString, "%d: got %lx\n", i, tb.iString ); + ok( tb.iString == expect_btns[i].iString, "%ld: got %Ix\n", i, tb.iString ); else ok( !strcmp( (char *)tb.iString, (char *)expect_btns[i].iString ), - "%d: got %s\n", i, (char *)tb.iString ); + "%ld: got %s\n", i, (char *)tb.iString );
/* In fact the ptr value set in TBN_GETBUTTONINFOA is simply copied */ if (tb.idCommand == 7) diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 7570ea68b0a..3bde35250cc 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -27,7 +27,7 @@ #include "v6util.h" #include "msg.h"
-#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) +#define expect(expected, got) ok(got == expected, "Expected %d, got %ld\n", expected, got)
enum seq_index { @@ -55,7 +55,7 @@ static void test_create_tooltip(BOOL is_v6) style = GetWindowLongA(hwnd, GWL_STYLE); exp_style = 0x7fffffff | WS_POPUP; exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME); - ok(style == exp_style, "wrong style %08x/%08x\n", style, exp_style); + ok(style == exp_style, "wrong style %08lx/%08lx\n", style, exp_style);
DestroyWindow(hwnd);
@@ -70,7 +70,7 @@ static void test_create_tooltip(BOOL is_v6) exp_style |= WS_BORDER; todo_wine_if(is_v6) ok(style == exp_style || broken(style == (exp_style | WS_BORDER)) /* XP */, - "Unexpected window style %#x.\n", style); + "Unexpected window style %#lx.\n", style);
DestroyWindow(hwnd);
@@ -196,7 +196,7 @@ static void test_customdraw(void) { 50, 50, 300, 300, NULL, NULL, NULL, 0); - ok(parent != NULL, "%d: Creation of main window failed\n", iterationNumber); + ok(parent != NULL, "%ld: Creation of main window failed\n", iterationNumber);
/* Make it show */ ShowWindow(parent, SW_SHOWNORMAL); @@ -208,7 +208,7 @@ static void test_customdraw(void) { CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, GetModuleHandleA(NULL), 0); - ok(hwndTip != NULL, "%d: Creation of tooltip window failed\n", iterationNumber); + ok(hwndTip != NULL, "%ld: Creation of tooltip window failed\n", iterationNumber);
/* Set up parms for the wndproc to handle */ CD_Stages = 0; @@ -229,7 +229,7 @@ static void test_customdraw(void) { toolInfo.lParam = 0xdeadbeef; GetClientRect (parent, &toolInfo.rect); ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo); - ok(ret, "%d: Failed to add the tool.\n", iterationNumber); + ok(ret, "%ld: Failed to add the tool.\n", iterationNumber);
/* Make tooltip appear quickly */ SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); @@ -243,23 +243,23 @@ static void test_customdraw(void) { { /* Check CustomDraw results */ ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls, - "%d: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages, + "%ld: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages, expectedResults[iterationNumber].ExpectedCalls); }
ret = SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, 0); - ok(ret, "%d: Failed to get current tool %#lx.\n", iterationNumber, ret); + ok(ret, "%ld: Failed to get current tool %#Ix.\n", iterationNumber, ret);
memset(&toolInfo, 0xcc, sizeof(toolInfo)); toolInfo.cbSize = sizeof(toolInfo); toolInfo.lpszText = NULL; toolInfo.lpReserved = (void *)0xdeadbeef; SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, (LPARAM)&toolInfo); - ok(toolInfo.hwnd == parent, "%d: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd); - ok(toolInfo.hinst == GetModuleHandleA(NULL), "%d: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst); - ok(toolInfo.uId == 0x1234abcd, "%d: Unexpected uId %lx.\n", iterationNumber, toolInfo.uId); - ok(toolInfo.lParam == 0, "%d: Unexpected lParam %lx.\n", iterationNumber, toolInfo.lParam); - ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%d: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved); + ok(toolInfo.hwnd == parent, "%ld: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd); + ok(toolInfo.hinst == GetModuleHandleA(NULL), "%ld: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst); + ok(toolInfo.uId == 0x1234abcd, "%ld: Unexpected uId %Ix.\n", iterationNumber, toolInfo.uId); + ok(toolInfo.lParam == 0, "%ld: Unexpected lParam %Ix.\n", iterationNumber, toolInfo.lParam); + ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%ld: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved);
/* Clean up */ DestroyWindow(hwndTip); @@ -378,19 +378,19 @@ static void test_gettext(void) toolinfoA.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoA.rect); r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA); - ok(r, "got %ld\n", r); + ok(r, "got %Id\n", r);
toolinfoA.hwnd = NULL; toolinfoA.uId = 0x1234abcd; toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!*toolinfoA.lpszText, "lpszText should be empty, got %s\n", toolinfoA.lpszText);
toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA); todo_wine - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(toolinfoA.lpszText == NULL, "expected NULL, got %p\n", toolinfoA.lpszText);
/* NULL hinst, valid resource id for text */ @@ -409,17 +409,17 @@ static void test_gettext(void) toolinfoA.uId = 0x1233abcd; toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!strcmp(toolinfoA.lpszText, "abc"), "got wrong text, %s\n", toolinfoA.lpszText);
toolinfoA.hinst = (HINSTANCE)0xdeadbee; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA); todo_wine - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(toolinfoA.hinst == NULL, "expected NULL, got %p\n", toolinfoA.hinst);
r = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r);
/* add another tool with text */ toolinfoA.cbSize = sizeof(TTTOOLINFOA); @@ -435,24 +435,24 @@ static void test_gettext(void) ok(r, "Adding the tool to the tooltip failed\n");
length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0); - ok(length == 0, "Expected 0, got %d\n", length); + ok(length == 0, "Expected 0, got %ld\n", length);
toolinfoA.hwnd = NULL; toolinfoA.uId = 0x1235abcd; toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);
memset(bufA, 0x1f, sizeof(bufA)); toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA); todo_wine - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);
length = SendMessageA(hwnd, WM_GETTEXTLENGTH, 0, 0); - ok(length == 0, "Expected 0, got %d\n", length); + ok(length == 0, "Expected 0, got %ld\n", length);
/* add another with callback text */ toolinfoA.cbSize = sizeof(TTTOOLINFOA); @@ -470,13 +470,13 @@ static void test_gettext(void) toolinfoA.uId = 0x1236abcd; toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!strcmp(toolinfoA.lpszText, testcallbackA), "lpszText should be an (%s) string\n", testcallbackA);
toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA); todo_wine - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(toolinfoA.lpszText == LPSTR_TEXTCALLBACKA, "expected LPSTR_TEXTCALLBACKA, got %p\n", toolinfoA.lpszText);
DestroyWindow(hwnd); @@ -518,13 +518,13 @@ static void test_gettext(void) toolinfoA.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoA.rect); r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA); - ok(r, "got %ld\n", r); + ok(r, "got %Id\n", r);
toolinfoA.hwnd = NULL; toolinfoA.uId = 0x1235abce; toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %s\n", testtipA, toolinfoA.lpszText);
/* enable TTS_NOPREFIX, original text is retained */ @@ -535,7 +535,7 @@ static void test_gettext(void) toolinfoA.uId = 0x1235abce; toolinfoA.lpszText = bufA; r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA); - ok(!r, "got %ld\n", r); + ok(!r, "got %Id\n", r); ok(!strcmp(toolinfoA.lpszText, testtip2A), "expected %s, got %s\n", testtip2A, toolinfoA.lpszText);
DestroyWindow(hwnd); @@ -566,7 +566,7 @@ static void test_ttm_gettoolinfo(void) ti.lParam = 0xaaaaaaaa; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti); ok(r, "Getting tooltip info failed\n"); - ok(0x1abe11ed == ti.lParam, "Expected 0x1abe11ed, got %lx\n", ti.lParam); + ok(0x1abe11ed == ti.lParam, "Expected 0x1abe11ed, got %Ix\n", ti.lParam);
tiW.cbSize = TTTOOLINFOW_V2_SIZE; tiW.hwnd = NULL; @@ -575,7 +575,7 @@ static void test_ttm_gettoolinfo(void) tiW.lpszText = NULL; r = SendMessageA(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&tiW); ok(r, "Getting tooltip info failed\n"); - ok(0x1abe11ed == tiW.lParam, "Expected 0x1abe11ed, got %lx\n", tiW.lParam); + ok(0x1abe11ed == tiW.lParam, "Expected 0x1abe11ed, got %Ix\n", tiW.lParam);
ti.cbSize = TTTOOLINFOA_V2_SIZE; ti.uId = 0x1234ABCD; @@ -586,7 +586,7 @@ static void test_ttm_gettoolinfo(void) ti.lParam = 0xdeadbeef; r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&ti); ok(r, "Getting tooltip info failed\n"); - ok(0x55555555 == ti.lParam, "Expected 0x55555555, got %lx\n", ti.lParam); + ok(0x55555555 == ti.lParam, "Expected 0x55555555, got %Ix\n", ti.lParam);
DestroyWindow(hwnd);
@@ -890,16 +890,16 @@ static void test_track(void) SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10));
GetWindowRect(tt, &pos); - ok(almost_eq(pos.left, 10), "pos.left = %d\n", pos.left); - ok(almost_eq(pos.top, 10), "pos.top = %d\n", pos.top); + ok(almost_eq(pos.left, 10), "pos.left = %ld\n", pos.left); + ok(almost_eq(pos.top, 10), "pos.top = %ld\n", pos.top);
info.uFlags = TTF_IDISHWND | TTF_ABSOLUTE; SendMessageW(tt, TTM_SETTOOLINFOW, 0, (LPARAM)&info); SendMessageW(tt, TTM_TRACKPOSITION, 0, MAKELPARAM(10, 10));
GetWindowRect(tt, &pos); - ok(!almost_eq(pos.left, 10), "pos.left = %d\n", pos.left); - ok(!almost_eq(pos.top, 10), "pos.top = %d\n", pos.top); + ok(!almost_eq(pos.left, 10), "pos.left = %ld\n", pos.left); + ok(!almost_eq(pos.top, 10), "pos.top = %ld\n", pos.top);
DestroyWindow(tt); DestroyWindow(parent); @@ -1066,27 +1066,27 @@ static void test_margin(void) ok(hwnd != NULL, "failed to create tooltip wnd\n");
ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
SetRect(&r, -1, -1, 1, 1); ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, (LPARAM)&r); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
SetRectEmpty(&r1); ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret); ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
SetRectEmpty(&r1); ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret); ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, 0); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
DestroyWindow(hwnd); } diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c index 70b61d4db20..a367b7e699c 100644 --- a/dlls/comctl32/tests/trackbar.c +++ b/dlls/comctl32/tests/trackbar.c @@ -28,7 +28,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
#define NUM_MSG_SEQUENCE 2 @@ -722,21 +722,21 @@ static void test_position(void) r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); ok(r == 25, "got %d\n", r); SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect2); - ok(rect.left == rect2.left, "got %d\n", rect.left); + ok(rect.left == rect2.left, "got %ld\n", rect.left);
/* with repaint */ SendMessageA(hWndTrackbar, TBM_SETPOS, TRUE, 30); r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); ok(r == 30, "got %d\n", r); SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect2); - ok(rect.left != rect2.left, "got %d, expected %d\n", rect2.left, rect.left); + ok(rect.left != rect2.left, "got %ld, expected %ld\n", rect2.left, rect.left);
/* now move it with keys */ SendMessageA(hWndTrackbar, WM_KEYDOWN, VK_END, 0); r = SendMessageA(hWndTrackbar, TBM_GETPOS, 0, 0); ok(r == 100, "got %d\n", r); SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect); - ok(rect.left != rect2.left, "got %d, expected %d\n", rect.left, rect2.left); + ok(rect.left != rect2.left, "got %ld, expected %ld\n", rect.left, rect2.left);
DestroyWindow(hWndTrackbar); } @@ -1114,7 +1114,7 @@ static void test_tic_placement(void) SendMessageA(hWndTrackbar, TBM_SETTICFREQ, 1, 0);
numtics = SendMessageA(hWndTrackbar, TBM_GETNUMTICS, 0, 0); - ok(numtics == 6, "Expected 6, got %d\n", numtics); + ok(numtics == 6, "Expected 6, got %ld\n", numtics);
flush_sequences(sequences, NUM_MSG_SEQUENCE); /* test TBM_GETPTICS */ diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 45e2091f3b2..41a61f1465b 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -60,7 +60,7 @@ static BOOL g_v6; #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; @@ -800,17 +800,17 @@ static void test_get_set_bkcolor(void)
/* If the value is -1, the control is using the system color for the background color. */ crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0); - ok(crColor == ~0u, "Default background color reported as 0x%.8x\n", crColor); + ok(crColor == ~0u, "Default background color reported as 0x%.8lx\n", crColor);
/* Test for black background */ SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(0,0,0)); crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0); - ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor); + ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8lx\n", crColor);
/* Test for white background */ SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255,255,255)); crColor = SendMessageA(hTree, TVM_GETBKCOLOR, 0, 0); - ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8x\n", crColor); + ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8lx\n", crColor);
/* Reset the default background */ SendMessageA(hTree, TVM_SETBKCOLOR, 0, -1); @@ -884,7 +884,7 @@ static void test_get_set_insertmark(void)
SendMessageA(hTree, TVM_SETINSERTMARKCOLOR, 0, crColor); crColor = SendMessageA(hTree, TVM_GETINSERTMARKCOLOR, 0, 0); - ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8x, expected 0x00000000\n", crColor); + ok(crColor == RGB(0,0,0), "Insert mark color reported as 0x%.8lx, expected 0x00000000\n", crColor);
ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_insertmarkcolor_seq, "test get set insertmark color", FALSE); @@ -1057,17 +1057,17 @@ static void test_get_set_textcolor(void) flush_sequences(sequences, NUM_MSG_SEQUENCES);
crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0); - ok(crColor == ~0u, "Default text color reported as 0x%.8x\n", crColor); + ok(crColor == ~0u, "Default text color reported as 0x%.8lx\n", crColor);
/* Test for black text */ SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(0,0,0)); crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0); - ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor); + ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8lx\n", crColor);
/* Test for white text */ SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, RGB(255,255,255)); crColor = SendMessageA(hTree, TVM_GETTEXTCOLOR, 0, 0); - ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8x\n", crColor); + ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8lx\n", crColor);
/* Reset the default text color */ SendMessageA(hTree, TVM_SETTEXTCOLOR, 0, CLR_NONE); @@ -1359,7 +1359,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, g_item_expanding.mask = TVIF_STATE; g_item_expanding.hItem = hRoot; ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanding); - ok(ret == TRUE, "got %lu\n", ret); + ok(ret == TRUE, "got %Iu\n", ret); } break; } @@ -1375,7 +1375,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, g_item_expanded.mask = TVIF_STATE; g_item_expanded.hItem = hRoot; ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanded); - ok(ret == TRUE, "got %lu\n", ret); + ok(ret == TRUE, "got %Iu\n", ret); } if (g_get_rect_in_expand) { @@ -1424,9 +1424,9 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYITEMERASE|CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPREPAINT: ok(text == nmcd->clrText || (g_v6 && nmcd->clrText == 0xffffffff), - "got %08x vs %08x\n", text, nmcd->clrText); + "got %08lx vs %08lx\n", text, nmcd->clrText); ok(bkgnd == nmcd->clrTextBk || (g_v6 && nmcd->clrTextBk == 0xffffffff), - "got %08x vs %08x\n", bkgnd, nmcd->clrTextBk); + "got %08lx vs %08lx\n", bkgnd, nmcd->clrTextBk); nmcd->clrText = cafe; nmcd->clrTextBk = c0ffee; SetTextColor(nmcd->nmcd.hdc, c0ffee); @@ -1436,10 +1436,10 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, return CDRF_NOTIFYPOSTPAINT|CDRF_NEWFONT; case CDDS_ITEMPOSTPAINT: /* at the point of post paint notification colors are already restored */ - ok(nmcd->clrText == cafe, "got 0%x\n", nmcd->clrText); - ok(nmcd->clrTextBk == c0ffee, "got 0%x\n", nmcd->clrTextBk); - ok(text != cafe, "got 0%x\n", text); - ok(bkgnd != c0ffee, "got 0%x\n", bkgnd); + ok(nmcd->clrText == cafe, "got 0%lx\n", nmcd->clrText); + ok(nmcd->clrTextBk == c0ffee, "got 0%lx\n", nmcd->clrTextBk); + ok(text != cafe, "got 0%lx\n", text); + ok(bkgnd != c0ffee, "got 0%lx\n", bkgnd); if (g_customdraw_font) ok(GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT) != g_customdraw_font, "got %p\n", GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT)); @@ -1587,8 +1587,8 @@ static void test_expand(void) *(HTREEITEM *)&rect = first; visible = SendMessageA(tv, TVM_GETITEMRECT, FALSE, (LPARAM)&rect); ok(visible, "first node should be visible\n"); - ok(!rect.left, "rect.left = %d\n", rect.left); - ok(!rect.top, "rect.top = %d\n", rect.top); + ok(!rect.left, "rect.left = %ld\n", rect.left); + ok(!rect.top, "rect.top = %ld\n", rect.top); ok(rect.right, "rect.right = 0\n"); ok(rect.bottom, "rect.bottom = 0\n");
@@ -1705,7 +1705,7 @@ static void test_itemedit(void) r = SetWindowTextA(edit, buffA); expect(TRUE, r); r = GetWindowTextA(edit, buffA, ARRAY_SIZE(buffA)); - ok( r == ARRAY_SIZE(buffA) - 1, "got %d\n", r ); + ok( r == ARRAY_SIZE(buffA) - 1, "got %ld\n", r ); /* ...but it's trimmed to MAX_PATH chars when editing ends */ r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit); expect(0, r); @@ -2141,7 +2141,7 @@ static void test_WM_PAINT(void) hTree = create_treeview_control(0);
clr = SendMessageA(hTree, TVM_SETBKCOLOR, 0, RGB(255, 0, 0)); - ok(clr == ~0u, "got %d, expected -1\n", clr); + ok(clr == ~0u, "got %ld, expected -1\n", clr);
hdc = GetDC(hMainWnd);
@@ -2149,10 +2149,10 @@ static void test_WM_PAINT(void) FillRect(hdc, &rc, GetStockObject(BLACK_BRUSH));
clr = GetPixel(hdc, 1, 1); - ok(clr == RGB(0, 0, 0), "got 0x%x\n", clr); + ok(clr == RGB(0, 0, 0), "got 0x%lx\n", clr);
ret = SendMessageA(hTree, WM_PAINT, (WPARAM)hdc, 0); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret);
clr = GetPixel(hdc, 1, 1); htheme = pGetWindowTheme(hTree); @@ -2160,7 +2160,7 @@ static void test_WM_PAINT(void) ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */ /* When theming is on and treeview glyphs are transparent, parent window needs to be repainted */ || (is_glyph_transparent && clr == GetSysColor(COLOR_WINDOW)), - "got 0x%x\n", clr); + "got 0x%lx\n", clr);
ReleaseDC(hMainWnd, hdc);
@@ -2191,8 +2191,8 @@ static void test_delete_items(void)
if (item_sequence[0]->count == 2) { - ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%lx\n", hChild, msg[0].lParam); - ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%lx\n", hRoot, msg[1].lParam); + ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%Ix\n", hChild, msg[0].lParam); + ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%Ix\n", hRoot, msg[1].lParam); }
ret = SendMessageA(hTree, TVM_GETCOUNT, 0, 0); @@ -2334,7 +2334,7 @@ static void _check_item(HWND hwnd, HTREEITEM item, BOOL is_version_6, int line) width = data->width; todo_wine ok_(__FILE__, line)(width == (rect.right - rect.left) || broken(is_version_6 && width == 0) /* XP */, - "Width %d, rect width %d.\n", width, rect.right - rect.left); + "Width %d, rect width %ld.\n", width, rect.right - rect.left); } }
@@ -2647,7 +2647,7 @@ static void test_WM_GETDLGCODE(void) hTree = create_treeview_control(0);
code = SendMessageA(hTree, WM_GETDLGCODE, VK_TAB, 0); - ok(code == (DLGC_WANTCHARS | DLGC_WANTARROWS), "0x%08x\n", code); + ok(code == (DLGC_WANTCHARS | DLGC_WANTARROWS), "0x%08lx\n", code);
DestroyWindow(hTree); } @@ -2707,7 +2707,7 @@ static void test_TVS_FULLROWSELECT(void) hwnd = create_treeview_control(TVS_FULLROWSELECT);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08x\n", style); + ok((style & (TVS_FULLROWSELECT | TVS_HASLINES)) == (TVS_FULLROWSELECT | TVS_HASLINES), "got style 0x%08lx\n", style);
DestroyWindow(hwnd);
@@ -2717,7 +2717,7 @@ static void test_TVS_FULLROWSELECT(void) style = GetWindowLongA(hwnd, GWL_STYLE); SetWindowLongA(hwnd, GWL_STYLE, style | TVS_FULLROWSELECT); style = GetWindowLongA(hwnd, GWL_STYLE); - ok(style & TVS_FULLROWSELECT, "got style 0x%08x\n", style); + ok(style & TVS_FULLROWSELECT, "got style 0x%08lx\n", style);
DestroyWindow(hwnd); } diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index 6ffdcb9e1ab..3a475318a25 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -53,7 +53,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
#define NUM_MSG_SEQUENCES 3 @@ -806,7 +806,7 @@ static void test_updown_create(void) ok(updown != NULL, "Failed to create updown control\n"); r.right = 0; GetClientRect(updown, &r); - ok(r.right > 0, "Expected default width, got %d\n", r.right); + ok(r.right > 0, "Expected default width, got %ld\n", r.right); DestroyWindow(updown); /* create with really small width */ updown = CreateWindowA (UPDOWN_CLASSA, 0, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 2, 0, @@ -814,7 +814,7 @@ static void test_updown_create(void) ok(updown != NULL, "Failed to create updown control\n"); r.right = 0; GetClientRect(updown, &r); - ok(r.right != 2 && r.right > 0, "Expected default width, got %d\n", r.right); + ok(r.right != 2 && r.right > 0, "Expected default width, got %ld\n", r.right); DestroyWindow(updown); /* create with width greater than default */ updown = CreateWindowA (UPDOWN_CLASSA, 0, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 100, 0, @@ -822,7 +822,7 @@ static void test_updown_create(void) ok(updown != NULL, "Failed to create updown control\n"); r.right = 0; GetClientRect(updown, &r); - ok(r.right < 100 && r.right > 0, "Expected default width, got %d\n", r.right); + ok(r.right < 100 && r.right > 0, "Expected default width, got %ld\n", r.right); DestroyWindow(updown); /* create with zero height, UDS_HORZ */ updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, @@ -830,7 +830,7 @@ static void test_updown_create(void) ok(updown != NULL, "Failed to create updown control\n"); r.bottom = 0; GetClientRect(updown, &r); - ok(r.bottom == 0, "Expected zero height, got %d\n", r.bottom); + ok(r.bottom == 0, "Expected zero height, got %ld\n", r.bottom); DestroyWindow(updown); /* create with really small height, UDS_HORZ */ updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 2, @@ -838,7 +838,7 @@ static void test_updown_create(void) ok(updown != NULL, "Failed to create updown control\n"); r.bottom = 0; GetClientRect(updown, &r); - ok(r.bottom == 0, "Expected zero height, got %d\n", r.bottom); + ok(r.bottom == 0, "Expected zero height, got %ld\n", r.bottom); DestroyWindow(updown); /* create with height greater than default, UDS_HORZ */ updown = CreateWindowA (UPDOWN_CLASSA, 0, UDS_HORZ | WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 100, @@ -846,7 +846,7 @@ static void test_updown_create(void) ok(updown != NULL, "Failed to create updown control\n"); r.bottom = 0; GetClientRect(updown, &r); - ok(r.bottom < 100 && r.bottom > 0, "Expected default height, got %d\n", r.bottom); + ok(r.bottom < 100 && r.bottom > 0, "Expected default height, got %ld\n", r.bottom); DestroyWindow(updown); }
@@ -987,9 +987,9 @@ static void test_UDS_SETBUDDY(void)
updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_ARROWKEYS, g_edit); ret = SetWindowPos(g_edit, 0, 100, 100, start_width, start_height, SWP_NOACTIVATE | SWP_NOZORDER); - ok(ret, "SetWindowPos failed, error %u.\n", GetLastError()); + ok(ret, "SetWindowPos failed, error %lu.\n", GetLastError()); ret = GetWindowRect(g_edit, &rect); - ok(ret, "GetWindowRect failed, error %u.\n", GetLastError()); + ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError()); width = rect.right - rect.left; height = rect.bottom - rect.top; ok(width == start_width, "Expected width %d, got %d.\n", start_width, width); @@ -997,13 +997,13 @@ static void test_UDS_SETBUDDY(void)
SendMessageA(updown, UDM_SETBUDDY, (WPARAM)g_edit, 0); ret = GetWindowRect(g_edit, &rect); - ok(ret, "GetWindowRect failed, error %u.\n", GetLastError()); + ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError()); updown_width = start_width - (rect.right - rect.left); ok(updown_width > 0, "Expected updown width > 0, got %d.\n", updown_width);
SendMessageA(updown, UDM_SETBUDDY, (WPARAM)g_edit, 0); ret = GetWindowRect(g_edit, &rect); - ok(ret, "GetWindowRect failed, error %u.\n", GetLastError()); + ok(ret, "GetWindowRect failed, error %lu.\n", GetLastError()); width = rect.right - rect.left; height = rect.bottom - rect.top; ok(width == start_width - 2 * updown_width, "Expected width %d, got %d.\n", diff --git a/dlls/comctl32/tests/v6util.h b/dlls/comctl32/tests/v6util.h index 626f6e61255..fc32616d777 100644 --- a/dlls/comctl32/tests/v6util.h +++ b/dlls/comctl32/tests/v6util.h @@ -107,7 +107,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) hmod = GetModuleHandleA("comctl32.dll");
ret = ActivateActCtx(*hCtx, pcookie); - ok(ret, "Failed to activate context, error %d.\n", GetLastError()); + ok(ret, "Failed to activate context, error %ld.\n", GetLastError());
if (!ret) { @@ -118,7 +118,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) data.cbSize = sizeof(data); ret = FindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "comctl32.dll", &data); - ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError()); + ok(ret, "failed to find comctl32.dll in active context, %lu\n", GetLastError()); if (ret) { FreeLibrary(hmod);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=109404
Your paranoid android.
=== w10pro64_ar (64 bit report) ===
comctl32: datetime.c:798: Test failed: Expected 28/02/2022, got 2022/02/28
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/gameux/tests/gamestatistics.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c index aa10156f1ab..2b1a867e83c 100644 --- a/dlls/gameux/tests/gamestatistics.c +++ b/dlls/gameux/tests/gamestatistics.c @@ -141,7 +141,7 @@ static void test_gamestatisticsmgr( void ) static const GUID guidApplicationId = { 0x17A6558E, 0x60BE, 0x4078, { 0xB6, 0x6F, 0x9C, 0x3A, 0xDA, 0x2A, 0x32, 0xE6 } };
HRESULT hr; - DWORD dwOpenResult; + GAMESTATS_OPEN_RESULT openResult; LPWSTR lpStatisticsFile = NULL; LPWSTR lpName = NULL, lpValue = NULL, sTooLongString = NULL; UINT uMaxCategoryLength = 0, uMaxNameLength = 0, uMaxValueLength = 0; @@ -157,7 +157,7 @@ static void test_gamestatisticsmgr( void )
/* this should fail, because statistics don't exist yet */ gs = (void *)0xdeadbeef; - hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENONLY, &dwOpenResult, &gs); + hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENONLY, &openResult, &gs); if (hr != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) { /* With win10 1803 game explorer functionality was removed and gameux became a stub */ @@ -169,7 +169,7 @@ static void test_gamestatisticsmgr( void ) (gs == (void *)0xdeadbeef ? "deadbeef" : "neither NULL nor deadbeef"));
/* now, allow them to be created */ - hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENORCREATE, &dwOpenResult, &gs); + hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENORCREATE, &openResult, &gs); ok(SUCCEEDED(hr), "GetGameStatistics returned error: 0x%x\n", hr); ok(gs!=NULL, "GetGameStatistics did not return valid interface pointer\n"); if(gs) @@ -277,9 +277,9 @@ static void test_gamestatisticsmgr( void ) ok(SUCCEEDED(hr), "releasing IGameStatistics returned error: 0x%08x\n", hr);
/* try to read written statistics */ - hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENORCREATE, &dwOpenResult, &gs); + hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENORCREATE, &openResult, &gs); ok(SUCCEEDED(hr), "GetGameStatistics returned error: 0x%08x\n", hr); - ok(dwOpenResult == GAMESTATS_OPEN_OPENED, "GetGameStatistics returned invalid open result: 0x%x\n", dwOpenResult); + ok(openResult == GAMESTATS_OPEN_OPENED, "GetGameStatistics returned invalid open result: 0x%x\n", openResult); ok(gs!=NULL, "GetGameStatistics did not return valid interface pointer\n");
/* verify values with these which we stored before*/
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/gameux/tests/Makefile.in | 1 - dlls/gameux/tests/gameexplorer.c | 16 +++++++------- dlls/gameux/tests/gamestatistics.c | 40 ++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/dlls/gameux/tests/Makefile.in b/dlls/gameux/tests/Makefile.in index 5ae792525f9..7b3f2f9cd19 100644 --- a/dlls/gameux/tests/Makefile.in +++ b/dlls/gameux/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = gameux.dll IMPORTS = uuid shlwapi oleaut32 ole32 advapi32 shell32
diff --git a/dlls/gameux/tests/gameexplorer.c b/dlls/gameux/tests/gameexplorer.c index 1774128feee..9e08a6a7962 100644 --- a/dlls/gameux/tests/gameexplorer.c +++ b/dlls/gameux/tests/gameexplorer.c @@ -102,25 +102,25 @@ static void test_add_remove_game(void) memcpy(&guid, &defaultGUID, sizeof (guid));
hr = IGameExplorer_AddGame(ge, bstrExeName, bstrExePath, GIS_CURRENT_USER, &guid); - ok(SUCCEEDED(hr), "IGameExplorer::AddGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer::AddGame failed (error 0x%08lx)\n", hr); ok(memcmp(&guid, &defaultGUID, sizeof (guid)) == 0, "AddGame unexpectedly modified GUID\n");
if(SUCCEEDED(hr)) { hr = IGameExplorer_RemoveGame(ge, guid); - ok(SUCCEEDED(hr), "IGameExplorer::RemoveGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer::RemoveGame failed (error 0x%08lx)\n", hr); }
/* try to register game with empty guid */ memcpy(&guid, &GUID_NULL, sizeof (guid));
hr = IGameExplorer_AddGame(ge, bstrExeName, bstrExePath, GIS_CURRENT_USER, &guid); - ok(SUCCEEDED(hr), "IGameExplorer::AddGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer::AddGame failed (error 0x%08lx)\n", hr);
if(SUCCEEDED(hr)) { hr = IGameExplorer_RemoveGame(ge, guid); - ok(SUCCEEDED(hr), "IGameExplorer::RemoveGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer::RemoveGame failed (error 0x%08lx)\n", hr); } }
@@ -157,12 +157,12 @@ static void test_install_uninstall_game(void)
hr = IGameExplorer2_InstallGame(ge2, sExeName, sExePath, GIS_CURRENT_USER); - ok(SUCCEEDED(hr), "IGameExplorer2::InstallGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer2::InstallGame failed (error 0x%08lx)\n", hr);
if(SUCCEEDED(hr)) { hr = IGameExplorer2_UninstallGame(ge2, sExeName); - ok(SUCCEEDED(hr), "IGameExplorer2::UninstallGame failed (error 0x%08x)\n", hr); + ok(SUCCEEDED(hr), "IGameExplorer2::UninstallGame failed (error 0x%08lx)\n", hr); }
IGameExplorer2_Release(ge2); @@ -188,13 +188,13 @@ START_TEST(gameexplorer) HRESULT hr;
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); - ok(hr == S_OK, "Failed to initialize COM, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to initialize COM, hr %#lx.\n", hr); trace("Running multithreaded tests.\n"); run_tests(); CoUninitialize();
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - ok(hr == S_OK, "Failed to initialize COM, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to initialize COM, hr %#lx.\n", hr); trace("Running apartment threaded tests.\n"); run_tests(); CoUninitialize(); diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c index 2b1a867e83c..49c2c53f68c 100644 --- a/dlls/gameux/tests/gamestatistics.c +++ b/dlls/gameux/tests/gamestatistics.c @@ -50,13 +50,13 @@ static void test_register_game(IGameExplorer **explorer) PathRemoveFileSpecW(pathW);
hr = CoCreateInstance(&CLSID_GameExplorer, NULL, CLSCTX_INPROC_SERVER, &IID_IGameExplorer, (void**)explorer); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr);
gameInstanceId = GUID_NULL; bstrExeName = SysAllocString(sExeName); bstrExePath = SysAllocString(pathW); hr = IGameExplorer_AddGame(*explorer, bstrExeName, bstrExePath, GIS_CURRENT_USER, &gameInstanceId); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr);
SysFreeString(bstrExeName); SysFreeString(bstrExePath); @@ -72,7 +72,7 @@ static void test_unregister_game(IGameExplorer *ge) if (!ge) return;
hr = IGameExplorer_RemoveGame(ge, gameInstanceId); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); IGameExplorer_Release(ge); }
@@ -164,13 +164,13 @@ static void test_gamestatisticsmgr( void ) win_skip("gameux is partially stubbed, skipping tests\n"); return; } - ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "GetGameStatistics returned unexpected value: 0x%08x\n", hr); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "GetGameStatistics returned unexpected value: 0x%08lx\n", hr); ok(gs == NULL, "Expected output pointer to be NULL, got %s\n", (gs == (void *)0xdeadbeef ? "deadbeef" : "neither NULL nor deadbeef"));
/* now, allow them to be created */ hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENORCREATE, &openResult, &gs); - ok(SUCCEEDED(hr), "GetGameStatistics returned error: 0x%x\n", hr); + ok(SUCCEEDED(hr), "GetGameStatistics returned error: 0x%lx\n", hr); ok(gs!=NULL, "GetGameStatistics did not return valid interface pointer\n"); if(gs) { @@ -197,16 +197,16 @@ static void test_gamestatisticsmgr( void )
/* create name of statistics file */ hr = _buildStatisticsFilePath(&guidApplicationId, &lpStatisticsFile); - ok(SUCCEEDED(hr), "cannot build path to game statistics (error 0x%x)\n", hr); + ok(SUCCEEDED(hr), "cannot build path to game statistics (error 0x%lx)\n", hr); trace("statistics file path: %s\n", wine_dbgstr_w(lpStatisticsFile)); ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s already exists\n", wine_dbgstr_w(lpStatisticsFile));
/* write sample statistics */ hr = IGameStatistics_SetCategoryTitle(gs, wMaxCategories, NULL); - ok(hr==E_INVALIDARG, "setting category title invalid value: 0x%x\n", hr); + ok(hr==E_INVALIDARG, "setting category title invalid value: 0x%lx\n", hr);
hr = IGameStatistics_SetCategoryTitle(gs, wMaxCategories, L"Category0"); - ok(hr==E_INVALIDARG, "setting category title invalid value: 0x%x\n", hr); + ok(hr==E_INVALIDARG, "setting category title invalid value: 0x%lx\n", hr);
/* check what happen if string is too long */ sTooLongString = CoTaskMemAlloc(sizeof(WCHAR)*(uMaxCategoryLength+2)); @@ -215,7 +215,7 @@ static void test_gamestatisticsmgr( void )
/* when string is too long, Windows returns S_FALSE, but saves string (stripped to expected number of characters) */ hr = IGameStatistics_SetCategoryTitle(gs, 0, sTooLongString); - ok(hr==S_FALSE, "setting category title invalid result: 0x%x\n", hr); + ok(hr==S_FALSE, "setting category title invalid result: 0x%lx\n", hr); CoTaskMemFree(sTooLongString);
ok(IGameStatistics_SetCategoryTitle(gs, 0, L"Category0")==S_OK, "setting category title failed: Category0\n"); @@ -224,32 +224,32 @@ static void test_gamestatisticsmgr( void )
/* check what happen if any string is NULL */ hr = IGameStatistics_SetStatistic(gs, 0, 0, NULL, L"Value00"); - ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%lx)\n", hr);
hr = IGameStatistics_SetStatistic(gs, 0, 0, L"Statistic00", NULL); - ok(hr == S_OK, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_OK, "setting statistic returned unexpected value: 0x%lx)\n", hr);
/* check what happen if any string is too long */ sTooLongString = CoTaskMemAlloc(sizeof(WCHAR)*(uMaxNameLength+2)); memset(sTooLongString, 'a', sizeof(WCHAR)*(uMaxNameLength+1)); sTooLongString[uMaxNameLength+1]=0; hr = IGameStatistics_SetStatistic(gs, 0, 0, sTooLongString, L"Value00"); - ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%lx)\n", hr); CoTaskMemFree(sTooLongString);
sTooLongString = CoTaskMemAlloc(sizeof(WCHAR)*(uMaxValueLength+2)); memset(sTooLongString, 'a', sizeof(WCHAR)*(uMaxValueLength+1)); sTooLongString[uMaxValueLength+1]=0; hr = IGameStatistics_SetStatistic(gs, 0, 0, L"Statistic00", sTooLongString); - ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == S_FALSE, "setting statistic returned unexpected value: 0x%lx)\n", hr); CoTaskMemFree(sTooLongString);
/* check what happen on too big index of category or statistic */ hr = IGameStatistics_SetStatistic(gs, wMaxCategories, 0, L"Statistic00", L"Value00"); - ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%lx)\n", hr);
hr = IGameStatistics_SetStatistic(gs, 0, wMaxStatsPerCategory, L"Statistic00", L"Value00"); - ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%x)\n", hr); + ok(hr == E_INVALIDARG, "setting statistic returned unexpected value: 0x%lx)\n", hr);
ok(IGameStatistics_SetStatistic(gs, 0, 0, L"Statistic00", L"Value00")==S_OK, "setting statistic failed: name=Statistic00, value=Value00\n"); @@ -274,11 +274,11 @@ static void test_gamestatisticsmgr( void ) ok(IGameStatistics_SetCategoryTitle(gs, 0, L"Category0a")==S_OK, "setting category title failed: Category0a\n");
hr = IGameStatistics_Release(gs); - ok(SUCCEEDED(hr), "releasing IGameStatistics returned error: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "releasing IGameStatistics returned error: 0x%08lx\n", hr);
/* try to read written statistics */ hr = IGameStatisticsMgr_GetGameStatistics(gsm, sExeName, GAMESTATS_OPEN_OPENORCREATE, &openResult, &gs); - ok(SUCCEEDED(hr), "GetGameStatistics returned error: 0x%08x\n", hr); + ok(SUCCEEDED(hr), "GetGameStatistics returned error: 0x%08lx\n", hr); ok(openResult == GAMESTATS_OPEN_OPENED, "GetGameStatistics returned invalid open result: 0x%x\n", openResult); ok(gs!=NULL, "GetGameStatistics did not return valid interface pointer\n");
@@ -350,17 +350,17 @@ static void test_gamestatisticsmgr( void ) CoTaskMemFree(lpValue);
hr = IGameStatistics_Release(gs); - ok(SUCCEEDED(hr), "releasing IGameStatistics returned error: 0x%x\n", hr); + ok(SUCCEEDED(hr), "releasing IGameStatistics returned error: 0x%lx\n", hr);
/* test of removing game statistics from underlying storage */ ok(_isFileExists(lpStatisticsFile) == TRUE, "statistics file %s does not exists\n", wine_dbgstr_w(lpStatisticsFile)); hr = IGameStatisticsMgr_RemoveGameStatistics(gsm, sExeName); - ok(SUCCEEDED(hr), "cannot remove game statistics, error: 0x%x\n", hr); + ok(SUCCEEDED(hr), "cannot remove game statistics, error: 0x%lx\n", hr); ok(_isFileExists(lpStatisticsFile) == FALSE, "statistics file %s still exists\n", wine_dbgstr_w(lpStatisticsFile)); }
hr = IGameStatisticsMgr_Release(gsm); - ok(SUCCEEDED(hr), "releasing IGameStatisticsMgr returned error: 0x%x\n", hr); + ok(SUCCEEDED(hr), "releasing IGameStatisticsMgr returned error: 0x%lx\n", hr);
CoTaskMemFree(lpStatisticsFile); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=109406
Your paranoid android.
=== w8adm (32 bit report) ===
Report validation errors: gameux:gameexplorer crashed (c0000005)
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/gdi32/tests/Makefile.in | 1 dlls/gdi32/tests/bitmap.c | 836 +++++++++++++++++++-------------------- dlls/gdi32/tests/brush.c | 56 +-- dlls/gdi32/tests/clipping.c | 40 +- dlls/gdi32/tests/dc.c | 80 ++-- dlls/gdi32/tests/dib.c | 90 ++-- dlls/gdi32/tests/driver.c | 154 ++++--- dlls/gdi32/tests/font.c | 618 ++++++++++++++-------------- dlls/gdi32/tests/gdiobj.c | 62 +-- dlls/gdi32/tests/icm.c | 52 +- dlls/gdi32/tests/mapping.c | 132 +++--- dlls/gdi32/tests/metafile.c | 912 +++++++++++++++++++++--------------------- dlls/gdi32/tests/palette.c | 6 dlls/gdi32/tests/path.c | 114 +++-- dlls/gdi32/tests/pen.c | 244 ++++++----- 15 files changed, 1703 insertions(+), 1694 deletions(-)
diff --git a/dlls/gdi32/tests/Makefile.in b/dlls/gdi32/tests/Makefile.in index c693ca4117f..3eb478ff765 100644 --- a/dlls/gdi32/tests/Makefile.in +++ b/dlls/gdi32/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = gdi32.dll IMPORTS = setupapi user32 gdi32 advapi32
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 3e1ed7f7652..18d1e8f6c28 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -250,7 +250,7 @@ static void test_createdibitmap(void) pixel = 0xdeadbeef; bm.bmiHeader.biBitCount= 32; GetDIBits(hdc, hbm, 0, 1, &pixel, &bm, DIB_RGB_COLORS); - ok(pixel == 0x00ffffff, "Reading a 32 bit pixel from a DDB returned %08x\n", pixel); + ok(pixel == 0x00ffffff, "Reading a 32 bit pixel from a DDB returned %08lx\n", pixel); DeleteObject(hbm);
ReleaseDC(0, hdc); @@ -325,28 +325,28 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER
ok(ds.dsBm.bmBits == bits, "wrong bm.bmBits %p != %p\n", ds.dsBm.bmBits, bits); if (ds.dsBm.bmWidthBytes != bm_width_bytes) /* Win2k bug */ - ok(ds.dsBmih.biSizeImage == ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight, "%u != %u\n", + ok(ds.dsBmih.biSizeImage == ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight, "%lu != %u\n", ds.dsBmih.biSizeImage, ds.dsBm.bmWidthBytes * ds.dsBm.bmHeight); - ok(bmih->biSizeImage == 0, "%u != 0\n", bmih->biSizeImage); + ok(bmih->biSizeImage == 0, "%lu != 0\n", bmih->biSizeImage); ds.dsBmih.biSizeImage = 0;
- ok(ds.dsBmih.biSize == bmih->biSize, "%u != %u\n", ds.dsBmih.biSize, bmih->biSize); - ok(ds.dsBmih.biWidth == bmih->biWidth, "%d != %d\n", ds.dsBmih.biWidth, bmih->biWidth); - ok(ds.dsBmih.biHeight == abs(bmih->biHeight), "%d != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); + ok(ds.dsBmih.biSize == bmih->biSize, "%lu != %lu\n", ds.dsBmih.biSize, bmih->biSize); + ok(ds.dsBmih.biWidth == bmih->biWidth, "%ld != %ld\n", ds.dsBmih.biWidth, bmih->biWidth); + ok(ds.dsBmih.biHeight == abs(bmih->biHeight), "%ld != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); ok(ds.dsBmih.biPlanes == bmih->biPlanes, "%u != %u\n", ds.dsBmih.biPlanes, bmih->biPlanes); ok(ds.dsBmih.biBitCount == bmih->biBitCount, "%u != %u\n", ds.dsBmih.biBitCount, bmih->biBitCount); ok(ds.dsBmih.biCompression == bmih->biCompression || ((bmih->biBitCount == 32) && broken(ds.dsBmih.biCompression == BI_BITFIELDS)), /* nt4 sp1 and 2 */ - "%u != %u\n", ds.dsBmih.biCompression, bmih->biCompression); - ok(ds.dsBmih.biSizeImage == bmih->biSizeImage, "%u != %u\n", ds.dsBmih.biSizeImage, bmih->biSizeImage); - ok(ds.dsBmih.biXPelsPerMeter == bmih->biXPelsPerMeter, "%d != %d\n", ds.dsBmih.biXPelsPerMeter, bmih->biXPelsPerMeter); - ok(ds.dsBmih.biYPelsPerMeter == bmih->biYPelsPerMeter, "%d != %d\n", ds.dsBmih.biYPelsPerMeter, bmih->biYPelsPerMeter); + "%lu != %lu\n", ds.dsBmih.biCompression, bmih->biCompression); + ok(ds.dsBmih.biSizeImage == bmih->biSizeImage, "%lu != %lu\n", ds.dsBmih.biSizeImage, bmih->biSizeImage); + ok(ds.dsBmih.biXPelsPerMeter == bmih->biXPelsPerMeter, "%ld != %ld\n", ds.dsBmih.biXPelsPerMeter, bmih->biXPelsPerMeter); + ok(ds.dsBmih.biYPelsPerMeter == bmih->biYPelsPerMeter, "%ld != %ld\n", ds.dsBmih.biYPelsPerMeter, bmih->biYPelsPerMeter);
memset(&ds, 0xAA, sizeof(ds)); ret = GetObjectW(hbm, sizeof(ds) - 4, &ds); ok(ret == sizeof(ds.dsBm), "wrong size %d\n", ret); - ok(ds.dsBm.bmWidth == bmih->biWidth, "%d != %d\n", ds.dsBmih.biWidth, bmih->biWidth); - ok(ds.dsBm.bmHeight == abs(bmih->biHeight), "%d != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); + ok(ds.dsBm.bmWidth == bmih->biWidth, "%ld != %ld\n", ds.dsBmih.biWidth, bmih->biWidth); + ok(ds.dsBm.bmHeight == abs(bmih->biHeight), "%ld != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); ok(ds.dsBm.bmBits == bits, "%p != %p\n", ds.dsBm.bmBits, bits);
ret = GetObjectW(hbm, 0, &ds); @@ -360,11 +360,11 @@ static void _test_color( int line, HDC hdc, COLORREF color, COLORREF exp ) { COLORREF c; c = SetPixel(hdc, 0, 0, color); - ok_(__FILE__, line)(c == exp, "SetPixel failed: got 0x%06x expected 0x%06x\n", c, exp); + ok_(__FILE__, line)(c == exp, "SetPixel failed: got 0x%06lx expected 0x%06lx\n", c, exp); c = GetPixel(hdc, 0, 0); - ok_(__FILE__, line)(c == exp, "GetPixel failed: got 0x%06x expected 0x%06x\n", c, exp); + ok_(__FILE__, line)(c == exp, "GetPixel failed: got 0x%06lx expected 0x%06lx\n", c, exp); c = GetNearestColor(hdc, color); - ok_(__FILE__, line)(c == exp, "GetNearestColor failed: got 0x%06x expected 0x%06x\n", c, exp); + ok_(__FILE__, line)(c == exp, "GetNearestColor failed: got 0x%06lx expected 0x%06lx\n", c, exp); } #define test_color(hdc, color, exp) _test_color( __LINE__, hdc, color, exp )
@@ -385,10 +385,10 @@ static void test_dib_bits_access( HBITMAP hdib, void *bits ) "VirtualQuery failed\n"); ok(info.BaseAddress == bits, "%p != %p\n", info.BaseAddress, bits); ok(info.AllocationBase == bits, "%p != %p\n", info.AllocationBase, bits); - ok(info.AllocationProtect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
memset( pbmi, 0, sizeof(bmibuf) ); memset( data, 0xcc, sizeof(data) ); @@ -410,20 +410,20 @@ static void test_dib_bits_access( HBITMAP hdib, void *bits ) "VirtualQuery failed\n"); ok(info.BaseAddress == bits, "%p != %p\n", info.BaseAddress, bits); ok(info.AllocationBase == bits, "%p != %p\n", info.AllocationBase, bits); - ok(info.AllocationProtect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); - ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); + ok(info.AllocationProtect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type); + ok(info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect);
/* try writing protected bits to a file */
GetTempFileNameA( ".", "dib", 0, filename ); file = CreateFileA( filename, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "failed to open %s error %u\n", filename, GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "failed to open %s error %lu\n", filename, GetLastError() ); ret = WriteFile( file, bits, 8192, &written, NULL ); - ok( ret, "WriteFile failed error %u\n", GetLastError() ); - if (ret) ok( written == 8192, "only wrote %u bytes\n", written ); + ok( ret, "WriteFile failed error %lu\n", GetLastError() ); + if (ret) ok( written == 8192, "only wrote %lu bytes\n", written ); CloseHandle( file ); DeleteFileA( filename ); } @@ -473,7 +473,7 @@ static void test_dibsections(void) ok(hdib == NULL && bits == NULL, "CreateDIBSection failed for invalid parameter: bmi == 0x0\n");
hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL, "CreateDIBSection error %ld\n", GetLastError()); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIBSection\n"); ok(dibsec.dsBm.bmBits == bits, "dibsec.dsBits %p != bits %p\n", dibsec.dsBm.bmBits, bits);
@@ -482,11 +482,11 @@ static void test_dibsections(void) "VirtualQuery failed\n"); ok(info.BaseAddress == bits, "%p != %p\n", info.BaseAddress, bits); ok(info.AllocationBase == bits, "%p != %p\n", info.AllocationBase, bits); - ok(info.AllocationProtect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.RegionSize == 0x26000, "0x%lx != 0x26000\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.RegionSize == 0x26000, "0x%Ix != 0x26000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
test_dib_bits_access( hdib, bits );
@@ -496,7 +496,7 @@ static void test_dibsections(void) /* Test a top-down DIB. */ pbmi->bmiHeader.biHeight = -100; hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL, "CreateDIBSection error %ld\n", GetLastError()); test_dib_info(hdib, bits, &pbmi->bmiHeader); DeleteObject(hdib);
@@ -506,7 +506,7 @@ static void test_dibsections(void) SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hdib == NULL, "CreateDIBSection should fail when asked to create a compressed DIB section\n"); - ok(GetLastError() == 0xdeadbeef, "wrong error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "wrong error %ld\n", GetLastError());
pbmi->bmiHeader.biBitCount = 16; pbmi->bmiHeader.biCompression = BI_BITFIELDS; @@ -515,18 +515,18 @@ static void test_dibsections(void) ((PDWORD)pbmi->bmiColors)[2] = 0x001f; SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL, "CreateDIBSection error %ld\n", GetLastError());
/* test the DIB memory */ ok(VirtualQuery(bits, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); ok(info.BaseAddress == bits, "%p != %p\n", info.BaseAddress, bits); ok(info.AllocationBase == bits, "%p != %p\n", info.AllocationBase, bits); - ok(info.AllocationProtect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.RegionSize == 0x19000, "0x%lx != 0x19000\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.RegionSize == 0x19000, "0x%Ix != 0x19000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
test_dib_info(hdib, bits, &pbmi->bmiHeader); DeleteObject(hdib); @@ -549,7 +549,7 @@ static void test_dibsections(void) ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIBSection\n"); ok(dibsec.dsBmih.biClrUsed == 2, - "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 2); + "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.dsBmih.biClrUsed, 2);
/* Test if the old BITMAPCOREINFO structure is supported */
@@ -645,7 +645,7 @@ static void test_dibsections(void) ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 16, - "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 16); + "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.dsBmih.biClrUsed, 16); test_dib_info(hdib, bits, &pbmi->bmiHeader); DeleteObject(hdib);
@@ -663,7 +663,7 @@ static void test_dibsections(void) ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 256, - "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 256); + "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.dsBmih.biClrUsed, 256);
oldbm = SelectObject(hdcmem, hdib);
@@ -696,7 +696,7 @@ static void test_dibsections(void) hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); - ok(dibsec.dsBmih.biClrUsed == 2, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 2); + ok(dibsec.dsBmih.biClrUsed == 2, "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.dsBmih.biClrUsed, 2);
/* The colour table has already been grabbed from the dc, so we select back the old palette */ @@ -746,8 +746,8 @@ static void test_dibsections(void)
BitBlt(hdcmem2, 0, 0, 16,16, hdcmem, 0, 0, SRCCOPY);
- ok(bits32[0] == 0xff00, "lower left pixel is %08x\n", bits32[0]); - ok(bits32[17] == 0xff00ff, "bottom but one, left pixel is %08x\n", bits32[17]); + ok(bits32[0] == 0xff00, "lower left pixel is %08lx\n", bits32[0]); + ok(bits32[17] == 0xff00ff, "bottom but one, left pixel is %08lx\n", bits32[17]);
SelectObject(hdcmem2, oldbm2); test_dib_info(hdib2, bits32, &pbmi->bmiHeader); @@ -785,7 +785,7 @@ static void test_dibsections(void) hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); - ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 256); + ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.dsBmih.biClrUsed, 256);
test_dib_info(hdib, bits, &pbmi->bmiHeader);
@@ -823,7 +823,7 @@ static void test_dibsections(void) hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); - ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 256); + ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.dsBmih.biClrUsed, 256);
test_dib_info(hdib, bits, &pbmi->bmiHeader);
@@ -856,7 +856,7 @@ static void test_dibsections(void) pbmi->bmiHeader.biClrUsed = 173; memset( pbmi->bmiColors, 0xcc, 256 * sizeof(RGBQUAD) ); GetDIBits( hdc, hdib, 0, 1, NULL, pbmi, DIB_RGB_COLORS ); - ok( pbmi->bmiHeader.biClrUsed == 0, "wrong colors %u\n", pbmi->bmiHeader.biClrUsed ); + ok( pbmi->bmiHeader.biClrUsed == 0, "wrong colors %lu\n", pbmi->bmiHeader.biClrUsed ); for (i = 0; i < 256; i++) { if (i < 142) @@ -897,7 +897,7 @@ static void test_dibsections(void) hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); - ok(dibsec.dsBmih.biClrUsed == 0, "created DIBSection: wrong biClrUsed field: %u\n", dibsec.dsBmih.biClrUsed); + ok(dibsec.dsBmih.biClrUsed == 0, "created DIBSection: wrong biClrUsed field: %lu\n", dibsec.dsBmih.biClrUsed); oldbm = SelectObject(hdcmem, hdib); ret = GetDIBColorTable(hdcmem, 0, 256, rgb); ok(ret == 0, "GetDIBColorTable returned %d\n", ret); @@ -1501,7 +1501,7 @@ static void test_bitmap(void) { ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY /* XP */ || GetLastError() == ERROR_INVALID_PARAMETER /* Win2k */, - "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n", GetLastError()); + "expected ERROR_NOT_ENOUGH_MEMORY, got %lu\n", GetLastError()); } else DeleteObject(hbmp); @@ -1512,7 +1512,7 @@ static void test_bitmap(void) { ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY /* XP */ || GetLastError() == ERROR_INVALID_PARAMETER /* Win2k */, - "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n", GetLastError()); + "expected ERROR_NOT_ENOUGH_MEMORY, got %lu\n", GetLastError()); } else DeleteObject(hbmp); @@ -1522,7 +1522,7 @@ static void test_bitmap(void) ok(!hbmp, "CreateBitmap should fail\n"); if (!hbmp) ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); else DeleteObject(hbmp);
@@ -1619,13 +1619,13 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g,
res = SetPixel( hdc, 0, 0, RGB(r,g,b) ); ok( res == get_nearest( r, g, b ), - "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n", res, r, g, b, fg, bg ); + "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n", res, r, g, b, fg, bg ); res = GetPixel( hdc, 0, 0 ); ok( res == get_nearest( r, g, b ), - "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n", res, r, g, b, fg, bg ); + "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n", res, r, g, b, fg, bg ); res = GetNearestColor( hdc, RGB(r,g,b) ); ok( res == get_nearest( r, g, b ), - "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n", res, r, g, b, fg, bg ); + "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n", res, r, g, b, fg, bg );
/* solid pen */ old_pen = SelectObject( hdc, CreatePen( PS_SOLID, 1, RGB(r,g,b) )); @@ -1633,10 +1633,10 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, LineTo( hdc, 16, 0 ); res = GetPixel( hdc, 0, 0 ); ok( res == (is_black_pen( fg, bg, r, g, b ) ? 0 : 0xffffff), - "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n", res, r, g, b, fg, bg ); + "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n", res, r, g, b, fg, bg ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == (is_black_pen( fg, bg, r, g, b ) ? 0x00 : 0xffff), - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg ); DeleteObject( SelectObject( hdc, old_pen ));
/* mono DDB pattern brush */ @@ -1645,7 +1645,7 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, PatBlt( hdc, 0, 0, 16, 16, PATCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0x5555 || broken(bits[0] == 0xaada) /* XP SP1 & 2003 SP0 */, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg ); DeleteObject( SelectObject( hdc, old_brush ));
/* mono DDB bitmap */ @@ -1654,13 +1654,13 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, BitBlt( hdc, 0, 0, 16, 8, memdc, 0, 0, SRCCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0x5555, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg ); SetTextColor( memdc, RGB(255,255,255) ); SetBkColor( memdc, RGB(0,0,0) ); BitBlt( hdc, 0, 0, 16, 8, memdc, 0, 0, SRCCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0x5555, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg );
/* mono DIB section */ memset( buffer, 0, sizeof(buffer) ); @@ -1682,7 +1682,7 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, BitBlt( hdc, 0, 0, 16, 8, memdc, 0, 0, SRCCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0x5555, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg );
colors[0].rgbRed = 0x0; colors[0].rgbGreen = 0x0; @@ -1696,21 +1696,21 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, BitBlt( hdc, 0, 0, 16, 8, memdc, 0, 0, SRCCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0xaaaa, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg );
SetTextColor( memdc, RGB(0,20,0) ); SetBkColor( memdc, RGB(240,240,240) ); BitBlt( hdc, 0, 0, 16, 8, memdc, 0, 0, SRCCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0x5555, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg );
SetTextColor( memdc, RGB(250,250,250) ); SetBkColor( memdc, RGB(10,10,10) ); BitBlt( hdc, 0, 0, 16, 8, memdc, 0, 0, SRCCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); ok( bits[0] == 0xaaaa, - "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); + "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n", bits[0], r, g, b, fg, bg ); DeleteDC( memdc ); DeleteObject( bitmap ); } @@ -1884,7 +1884,7 @@ static void test_GetDIBits_selected_DIB(UINT bpp)
/* Check if last pixel was set */ pixel = ((DWORD *)bits2)[info->bmiHeader.biWidth * info->bmiHeader.biHeight - 1]; - ok(pixel != 0, "Pixel: 0x%08x\n", pixel); + ok(pixel != 0, "Pixel: 0x%08lx\n", pixel);
HeapFree(GetProcessHeap(), 0, bits2); DeleteDC(dc); @@ -2148,18 +2148,18 @@ static void test_GetDIBits(void) ok(lines == 0, "GetDIBits copied %d lines with hdc = 0\n", lines); ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == 0xdeadbeef), /* winnt */ - "wrong error %u\n", GetLastError()); - ok(bi->bmiHeader.biSizeImage == 0, "expected 0, got %u\n", bi->bmiHeader.biSizeImage); + "wrong error %lu\n", GetLastError()); + ok(bi->bmiHeader.biSizeImage == 0, "expected 0, got %lu\n", bi->bmiHeader.biSizeImage); ok(bi->bmiHeader.biClrUsed == 37 || broken(bi->bmiHeader.biClrUsed == 0), - "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
memset(buf, 0xAA, sizeof(buf)); SetLastError(0xdeadbeef); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); - ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %lu\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
/* the color table consists of black and white */ ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 && @@ -2204,10 +2204,10 @@ static void test_GetDIBits(void) memset(buf, 0xAA, sizeof(buf)); SetLastError(0xdeadbeef); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); - ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %lu\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
/* the color table doesn't exist for 24-bit images */ for (i = 0; i < 256; i++) @@ -2228,7 +2228,7 @@ static void test_GetDIBits(void) SetLastError(0xdeadbeef); bi->bmiHeader.biHeight = -bm.bmHeight; /* indicate bottom-up data */ lines = SetDIBits(hdc, hbmp, 0, bm.bmHeight, bmp_bits_24, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "SetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "SetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError());
memset(&bm, 0xAA, sizeof(bm)); @@ -2262,10 +2262,10 @@ static void test_GetDIBits(void) memset(buf, 0xAA, sizeof(buf)); SetLastError(0xdeadbeef); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); - ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %lu\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
/* the color table consists of black and white */ ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 && @@ -2310,9 +2310,9 @@ static void test_GetDIBits(void) memset(buf, 0xAA, sizeof(buf)); SetLastError(0xdeadbeef); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, 20, pal_ents );
@@ -2349,9 +2349,9 @@ static void test_GetDIBits(void) memset(buf, 0xAA, sizeof(buf)); SetLastError(0xdeadbeef); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, 20, pal_ents );
@@ -2394,10 +2394,10 @@ static void test_GetDIBits(void) memset(buf, 0xAA, sizeof(buf)); SetLastError(0xdeadbeef); lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); - ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", + ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %lu\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); - ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %u\n", bi->bmiHeader.biClrUsed); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %lu\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biClrUsed == 0, "wrong biClrUsed %lu\n", bi->bmiHeader.biClrUsed);
/* the color table doesn't exist for 24-bit images */ for (i = 0; i < 256; i++) @@ -2449,7 +2449,7 @@ static void test_GetDIBits_BI_BITFIELDS(void) { ok( dibinfo->bmiHeader.biCompression == BI_BITFIELDS || broken( dibinfo->bmiHeader.biCompression == BI_RGB ), /* nt4 sp3 */ - "compression is %u (%d bpp)\n", dibinfo->bmiHeader.biCompression, dibinfo->bmiHeader.biBitCount ); + "compression is %lu (%d bpp)\n", dibinfo->bmiHeader.biCompression, dibinfo->bmiHeader.biBitCount );
if (dibinfo->bmiHeader.biCompression == BI_BITFIELDS) { @@ -2471,10 +2471,10 @@ static void test_GetDIBits_BI_BITFIELDS(void) memset(dibinfo, 0, sizeof(dibinfo_buf)); dibinfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ret = GetDIBits(hdc, hbm, 0, 1, NULL, dibinfo, DIB_RGB_COLORS); - ok(ret == 1, "GetDIBits failed ret %u err %u\n",ret,GetLastError()); + ok(ret == 1, "GetDIBits failed ret %u err %lu\n",ret,GetLastError()); dibinfo->bmiHeader.biSizeImage = 0xdeadbeef; ret = GetDIBits(hdc, hbm, 0, 1, bits, dibinfo, DIB_RGB_COLORS); - ok(ret == 1, "GetDIBits failed ret %u err %u\n",ret,GetLastError()); + ok(ret == 1, "GetDIBits failed ret %u err %lu\n",ret,GetLastError());
ok( bitmasks[0] != 0, "red mask is not set\n" ); ok( bitmasks[1] != 0, "green mask is not set\n" ); @@ -2487,7 +2487,7 @@ static void test_GetDIBits_BI_BITFIELDS(void) dibinfo->bmiHeader.biSizeImage = 0xdeadbeef; SetLastError(0xdeadbeef); ret = GetDIBits(hdc, hbm, 0, 0, bits, dibinfo, DIB_RGB_COLORS); - ok(ret == 1, "GetDIBits failed ret %u err %u\n",ret,GetLastError()); + ok(ret == 1, "GetDIBits failed ret %u err %lu\n",ret,GetLastError());
ok( !bitmasks[0], "red mask is set\n" ); ok( !bitmasks[1], "green mask is set\n" ); @@ -2497,7 +2497,7 @@ static void test_GetDIBits_BI_BITFIELDS(void) memset(bitmasks, 0, 3*sizeof(DWORD)); dibinfo->bmiHeader.biSizeImage = 0xdeadbeef; ret = GetDIBits(hdc, hbm, 0, 0, bits, dibinfo, DIB_RGB_COLORS); - ok(ret == 1, "GetDIBits failed ret %u err %u\n",ret,GetLastError()); + ok(ret == 1, "GetDIBits failed ret %u err %lu\n",ret,GetLastError());
ok( bitmasks[0] != 0, "red mask is not set\n" ); ok( bitmasks[1] != 0, "green mask is not set\n" ); @@ -2536,7 +2536,7 @@ static void test_GetDIBits_BI_BITFIELDS(void)
ok( dibinfo->bmiHeader.biCompression == BI_BITFIELDS || broken( dibinfo->bmiHeader.biCompression == BI_RGB ), /* nt4 sp3 */ - "compression is %u\n", dibinfo->bmiHeader.biCompression ); + "compression is %lu\n", dibinfo->bmiHeader.biCompression ); ok( !bitmasks[0], "red mask is set\n" ); ok( !bitmasks[1], "green mask is set\n" ); ok( !bitmasks[2], "blue mask is set\n" ); @@ -2547,12 +2547,12 @@ static void test_GetDIBits_BI_BITFIELDS(void) ok( dibinfo->bmiHeader.biBitCount == 32, "wrong bit count %u\n", dibinfo->bmiHeader.biBitCount ); ok( dibinfo->bmiHeader.biCompression == BI_BITFIELDS || broken( dibinfo->bmiHeader.biCompression == BI_RGB ), /* nt4 sp3 */ - "compression is %u\n", dibinfo->bmiHeader.biCompression ); + "compression is %lu\n", dibinfo->bmiHeader.biCompression ); if (dibinfo->bmiHeader.biCompression == BI_BITFIELDS) { - ok( bitmasks[0] == 0xff0000, "wrong red mask %08x\n", bitmasks[0] ); - ok( bitmasks[1] == 0x00ff00, "wrong green mask %08x\n", bitmasks[1] ); - ok( bitmasks[2] == 0x0000ff, "wrong blue mask %08x\n", bitmasks[2] ); + ok( bitmasks[0] == 0xff0000, "wrong red mask %08lx\n", bitmasks[0] ); + ok( bitmasks[1] == 0x00ff00, "wrong green mask %08lx\n", bitmasks[1] ); + ok( bitmasks[2] == 0x0000ff, "wrong blue mask %08lx\n", bitmasks[2] ); } ok( dibinfo->bmiHeader.biSizeImage != 0xdeadbeef, "size image not set\n" );
@@ -2583,7 +2583,7 @@ static void test_GetDIBits_BI_BITFIELDS(void) ok(ret == 1, "GetDIBits failed\n");
ok( dibinfo->bmiHeader.biCompression == BI_BITFIELDS, - "compression is %u\n", dibinfo->bmiHeader.biCompression ); + "compression is %lu\n", dibinfo->bmiHeader.biCompression ); ok( !bitmasks[0], "red mask is set\n" ); ok( !bitmasks[1], "green mask is set\n" ); ok( !bitmasks[2], "blue mask is set\n" ); @@ -2591,9 +2591,9 @@ static void test_GetDIBits_BI_BITFIELDS(void) dibinfo->bmiHeader.biSizeImage = 0xdeadbeef; ret = GetDIBits(hdc, hbm, 0, 1, bits, dibinfo, DIB_RGB_COLORS); ok(ret == 1, "GetDIBits failed\n"); - ok( bitmasks[0] == 0x0000ff, "wrong red mask %08x\n", bitmasks[0] ); - ok( bitmasks[1] == 0x00ff00, "wrong green mask %08x\n", bitmasks[1] ); - ok( bitmasks[2] == 0xff0000, "wrong blue mask %08x\n", bitmasks[2] ); + ok( bitmasks[0] == 0x0000ff, "wrong red mask %08lx\n", bitmasks[0] ); + ok( bitmasks[1] == 0x00ff00, "wrong green mask %08lx\n", bitmasks[1] ); + ok( bitmasks[2] == 0xff0000, "wrong blue mask %08lx\n", bitmasks[2] ); ok( dibinfo->bmiHeader.biSizeImage != 0xdeadbeef, "size image not set\n" );
DeleteObject(hbm); @@ -2625,7 +2625,7 @@ static void test_GetDIBits_BI_BITFIELDS(void) ok( dibinfo->bmiHeader.biBitCount == 24, "wrong bit count %u\n", dibinfo->bmiHeader.biBitCount );
ok( dibinfo->bmiHeader.biCompression == BI_RGB, - "compression is %u\n", dibinfo->bmiHeader.biCompression ); + "compression is %lu\n", dibinfo->bmiHeader.biCompression ); ok( !bitmasks[0], "red mask is set\n" ); ok( !bitmasks[1], "green mask is set\n" ); ok( !bitmasks[2], "blue mask is set\n" ); @@ -2676,7 +2676,7 @@ static void test_select_object(void) SetLastError(0xdeadbeef); hbm_old = SelectObject(NULL, hbm); ok(!hbm_old, "SelectObject returned %p\n", hbm_old); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
DeleteObject(hbm); @@ -2707,15 +2707,15 @@ static void test_select_object(void) if(depths[i] == bpp || (bpp == 16 && depths[i] == 15) /* 16 and 15 bpp are compatible */ ) { - ok(hbm_old != 0, "SelectObject failed, BITSPIXEL: %d, created depth: %d\n", bpp, depths[i]); + ok(hbm_old != 0, "SelectObject failed, BITSPIXEL: %d, created depth: %ld\n", bpp, depths[i]); SelectObject(hdc, hbm_old); } else { - ok(hbm_old == 0, "SelectObject should fail. BITSPIXELS: %d, created depth: %d\n", bpp, depths[i]); + ok(hbm_old == 0, "SelectObject should fail. BITSPIXELS: %d, created depth: %ld\n", bpp, depths[i]); }
memset(&bm, 0xAA, sizeof(bm)); bytes = GetObjectW(hbm, sizeof(bm), &bm); - ok(bytes == sizeof(bm), "GetObject returned %d\n", bytes); + ok(bytes == sizeof(bm), "GetObject returned %ld\n", bytes); ok(bm.bmType == 0, "wrong bmType %d\n", bm.bmType); ok(bm.bmWidth == 10, "wrong bmWidth %d\n", bm.bmWidth); ok(bm.bmHeight == 10, "wrong bmHeight %d\n", bm.bmHeight); @@ -2749,7 +2749,7 @@ static void test_mono_1x1_bmp_dbg(HBITMAP hbmp, int line) SetLastError(0xdeadbeef); ret = GetObjectW(hbmp, sizeof(bm), &bm); if (!ret) /* XP, only for curObj2 */ return; - ok_(__FILE__, line)(ret == sizeof(BITMAP), "GetObject returned %d, error %u\n", ret, GetLastError()); + ok_(__FILE__, line)(ret == sizeof(BITMAP), "GetObject returned %d, error %lu\n", ret, GetLastError()); ok_(__FILE__, line)(bm.bmType == 0, "wrong bmType, expected 0 got %d\n", bm.bmType); ok_(__FILE__, line)(bm.bmWidth == 1, "wrong bmWidth, expected 1 got %d\n", bm.bmWidth); ok_(__FILE__, line)(bm.bmHeight == 1, "wrong bmHeight, expected 1 got %d\n", bm.bmHeight); @@ -2821,7 +2821,7 @@ static void test_CreateBitmap(void) bmp.bmBitsPixel = 1; bmp.bmBits = NULL; bm = CreateBitmapIndirect(&bmp); - ok(bm != 0, "CreateBitmapIndirect error %u\n", GetLastError()); + ok(bm != 0, "CreateBitmapIndirect error %lu\n", GetLastError()); test_mono_1x1_bmp(bm); DeleteObject(bm);
@@ -2839,11 +2839,11 @@ static void test_CreateBitmap(void) if(i > 32) { DWORD error = GetLastError(); ok(bm == 0, "CreateBitmapIndirect for %d bpp succeeded\n", i); - ok(error == ERROR_INVALID_PARAMETER, "Got error %d, expected ERROR_INVALID_PARAMETER\n", error); + ok(error == ERROR_INVALID_PARAMETER, "Got error %ld, expected ERROR_INVALID_PARAMETER\n", error); DeleteObject(bm); continue; } - ok(bm != 0, "CreateBitmapIndirect error %u\n", GetLastError()); + ok(bm != 0, "CreateBitmapIndirect error %lu\n", GetLastError()); GetObjectW(bm, sizeof(bmp), &bmp); if(i == 1) { expect = 1; @@ -2886,7 +2886,7 @@ static void test_bitmapinfoheadersize(void)
SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL, "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
bmi.bmiHeader.biSize++; @@ -2895,7 +2895,7 @@ static void test_bitmapinfoheadersize(void) hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); ok(hdib != NULL || broken(!hdib), /* Win98, WinMe */ - "CreateDIBSection error %d\n", GetLastError()); + "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
bmi.bmiHeader.biSize = sizeof(BITMAPINFO); @@ -2904,7 +2904,7 @@ static void test_bitmapinfoheadersize(void) hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); ok(hdib != NULL || broken(!hdib), /* Win98, WinMe */ - "CreateDIBSection error %d\n", GetLastError()); + "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
bmi.bmiHeader.biSize++; @@ -2913,14 +2913,14 @@ static void test_bitmapinfoheadersize(void) hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); ok(hdib != NULL || broken(!hdib), /* Win98, WinMe */ - "CreateDIBSection error %d\n", GetLastError()); + "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
bmi.bmiHeader.biSize = sizeof(BITMAPV4HEADER);
SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL, "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
bmi.bmiHeader.biSize = sizeof(BITMAPV5HEADER); @@ -2929,7 +2929,7 @@ static void test_bitmapinfoheadersize(void) hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); ok(hdib != NULL || broken(!hdib), /* Win95 */ - "CreateDIBSection error %d\n", GetLastError()); + "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
memset(&bci, 0, sizeof(BITMAPCOREINFO)); @@ -2947,7 +2947,7 @@ static void test_bitmapinfoheadersize(void)
SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, (BITMAPINFO *)&bci, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL, "CreateDIBSection error %ld\n", GetLastError()); DeleteObject(hdib);
bci.bmciHeader.bcSize++; @@ -3010,7 +3010,7 @@ static void check_BitBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32 *dstBuffer = 0x89ABCDEF; BitBlt(hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, dwRop); ok(expected == *dstBuffer, - "BitBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n", + "BitBlt with dwRop %06lX. Expected 0x%08X, got 0x%08X from line %d\n", dwRop, expected, *dstBuffer, line); }
@@ -3087,7 +3087,7 @@ static void check_StretchBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UI *dstBuffer = 0x89ABCDEF; StretchBlt(hdcDst, 0, 0, 2, 1, hdcSrc, 0, 0, 1, 1, dwRop); ok(expected == *dstBuffer, - "StretchBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n", + "StretchBlt with dwRop %06lX. Expected 0x%08X, got 0x%08X from line %d\n", dwRop, expected, *dstBuffer, line); }
@@ -3451,7 +3451,7 @@ static void check_StretchDIBits_pixel(HDC hdcDst, UINT32 *dstBuffer, UINT32 *src
StretchDIBits(hdcDst, 0, 0, 2, 1, 0, 0, 1, 1, &buffer, &bitmapInfo, DIB_RGB_COLORS, dwRop); ok(expected == *dstBuffer, - "StretchDIBits with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n", + "StretchDIBits with dwRop %06lX. Expected 0x%08X, got 0x%08X from line %d\n", dwRop, expected, *dstBuffer, line); }
@@ -3670,12 +3670,12 @@ static void test_GdiAlphaBlend(void)
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -1, 0, 10, 10, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, -1, 10, 10, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); @@ -3689,84 +3689,84 @@ static void test_GdiAlphaBlend(void) SetWindowOrgEx(hdcSrc, -10, -10, NULL); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -1, 0, 10, 10, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, -1, 10, 10, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); SetMapMode(hdcSrc, MM_ANISOTROPIC); ScaleWindowExtEx(hdcSrc, 10, 1, 10, 1, NULL); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -1, 0, 30, 30, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, -1, 30, 30, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() );
SetMapMode(hdcDst, MM_ANISOTROPIC); SetViewportExtEx(hdcDst, -1, -1, NULL); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, -1, 50, 50, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, -20, -20, 20, 20, hdcSrc, 0, -1, 50, 50, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, -20, -20, -20, -20, hdcSrc, 0, -1, 50, 50, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, -20, 0, -20, 20, hdcSrc, 0, -1, 50, 50, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, -20, 20, -20, hdcSrc, 0, -1, 50, 50, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetMapMode(hdcDst, MM_TEXT);
SetViewportExtEx(hdcSrc, -1, -1, NULL); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -20, -20, -30, -30, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -20, -20, 30, -30, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -20, -20, -30, 30, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -20, -20, 30, 30, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 20, 20, 30, 30, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -60, -60, 30, 30, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetViewportExtEx(hdcSrc, 1, 1, NULL);
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, NULL, 0, 0, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
/* overlapping source and dest not allowed */
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcDst, 19, 19, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 20, 20, 20, 20, hdcDst, 1, 1, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcDst, 20, 10, 20, 20, blend); @@ -3780,7 +3780,7 @@ static void test_GdiAlphaBlend(void) blend.AlphaFormat = AC_SRC_ALPHA; SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() );
bmi->bmiHeader.biCompression = BI_BITFIELDS; ((DWORD *)bmi->bmiColors)[0] = 0xff0000; @@ -3793,7 +3793,7 @@ static void test_GdiAlphaBlend(void)
SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() );
bmi->bmiHeader.biCompression = BI_BITFIELDS; ((DWORD *)bmi->bmiColors)[0] = 0x0000ff; @@ -3807,7 +3807,7 @@ static void test_GdiAlphaBlend(void) SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
bmi->bmiHeader.biBitCount = 24; bmi->bmiHeader.biCompression = BI_RGB; @@ -3819,7 +3819,7 @@ static void test_GdiAlphaBlend(void) SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
bmi->bmiHeader.biBitCount = 1; bmpSrc = CreateDIBSection(hdcDst, bmi, DIB_RGB_COLORS, &bits, NULL, 0); @@ -3830,7 +3830,7 @@ static void test_GdiAlphaBlend(void) SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
bmpSrc = CreateBitmap( 100, 100, 1, 1, NULL ); ok(bmpSrc != NULL, "Couldn't create source bitmap\n"); @@ -3840,7 +3840,7 @@ static void test_GdiAlphaBlend(void) SetLastError(0xdeadbeef); ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, 0, 20, 20, blend); ok( !ret, "GdiAlphaBlend succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
DeleteDC(hdcDst); DeleteDC(hdcSrc); @@ -3884,80 +3884,80 @@ static void test_GdiGradientFill(void)
SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, rect, 1, GRADIENT_FILL_RECT_H ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, rect, 1, 3 ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( (HDC)0xdead, vt, 3, rect, 1, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( NULL, NULL, 0, rect, 1, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); ret = pGdiGradientFill( hdc, NULL, 0, rect, 1, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, NULL, 3, rect, 1, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, NULL, 0, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, NULL, 1, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, rect, 0, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, rect, 3, GRADIENT_FILL_RECT_H ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); rect[2].UpperLeft = rect[2].LowerRight = 1; SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, rect, 3, GRADIENT_FILL_RECT_H ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 1, rect, 1, GRADIENT_FILL_RECT_H ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 1, tri, 0, GRADIENT_FILL_TRIANGLE ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 1, tri, 1, GRADIENT_FILL_TRIANGLE ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, tri, 2, GRADIENT_FILL_TRIANGLE ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, tri, 3, GRADIENT_FILL_TRIANGLE ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); tri[3].Vertex3 = 1; SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); tri[3].Vertex3 = 0; SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE ); ok( !ret, "GdiGradientFill succeeded\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); tri[3].Vertex1 = tri[3].Vertex2 = tri[3].Vertex3 = 1; SetLastError( 0xdeadbeef ); ret = pGdiGradientFill( hdc, vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE ); - ok( ret, "GdiGradientFill failed err %u\n", GetLastError() ); + ok( ret, "GdiGradientFill failed err %lu\n", GetLastError() );
DeleteDC( hdc ); DeleteObject( bmp ); @@ -4043,7 +4043,7 @@ static void test_32bit_ddb(void) oldDst = SelectObject(hdcDst, bmpDst);
StretchBlt(hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, 1, 1, SRCCOPY); - ok(dstBuffer[0] == colorSrc, "Expected color=%x, received color=%x\n", colorSrc, dstBuffer[0]); + ok(dstBuffer[0] == colorSrc, "Expected color=%lx, received color=%lx\n", colorSrc, dstBuffer[0]);
if (pGdiAlphaBlend) { @@ -4056,13 +4056,13 @@ static void test_32bit_ddb(void) blend.AlphaFormat = 0; dstBuffer[0] = 0x80808080; ret = pGdiAlphaBlend( hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, 1, 1, blend ); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); - ok(dstBuffer[0] == 0x60504844, "wrong color %x\n", dstBuffer[0]); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); + ok(dstBuffer[0] == 0x60504844, "wrong color %lx\n", dstBuffer[0]); blend.AlphaFormat = AC_SRC_ALPHA; dstBuffer[0] = 0x80808080; ret = pGdiAlphaBlend( hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, 1, 1, blend ); - ok( ret, "GdiAlphaBlend failed err %u\n", GetLastError() ); - ok(dstBuffer[0] == 0x90807874, "wrong color %x\n", dstBuffer[0]); + ok( ret, "GdiAlphaBlend failed err %lu\n", GetLastError() ); + ok(dstBuffer[0] == 0x90807874, "wrong color %lx\n", dstBuffer[0]); }
data = (DWORD *)biDst->bmiColors; @@ -4072,7 +4072,7 @@ static void test_32bit_ddb(void) SelectObject( hdcSrc, brush ); PatBlt( hdcSrc, 0, 0, 1, 1, PATCOPY ); BitBlt( hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, SRCCOPY ); - ok(dstBuffer[0] == data[0], "Expected color=%x, received color=%x\n", data[0], dstBuffer[0]); + ok(dstBuffer[0] == data[0], "Expected color=%lx, received color=%lx\n", data[0], dstBuffer[0]); SelectObject( hdcSrc, GetStockObject(BLACK_BRUSH) ); DeleteObject( brush );
@@ -4083,7 +4083,7 @@ static void test_32bit_ddb(void) PatBlt( hdcSrc, 0, 0, 1, 1, PATCOPY ); BitBlt( hdcDst, 0, 0, 1, 1, hdcSrc, 0, 0, SRCCOPY ); ok(dstBuffer[0] == (data[0] & ~0xff000000), - "Expected color=%x, received color=%x\n", data[0] & 0xff000000, dstBuffer[0]); + "Expected color=%lx, received color=%lx\n", data[0] & 0xff000000, dstBuffer[0]); SelectObject( hdcSrc, GetStockObject(BLACK_BRUSH) ); DeleteObject( brush );
@@ -4241,7 +4241,7 @@ static void test_GetSetDIBits_rtl(void)
ret = GetDIBits( hdc_mem, bitmap, 0, 8, bits_1, &info, DIB_RGB_COLORS ); ok(ret == 8, "got %d\n", ret); - ok(bits_1[56] == 0xff0000, "got %08x\n", bits_1[56]); /* check we have a red pixel */ + ok(bits_1[56] == 0xff0000, "got %08lx\n", bits_1[56]); /* check we have a red pixel */
SetLayout( hdc_mem, LAYOUT_RTL );
@@ -4312,48 +4312,48 @@ static void test_GetDIBits_scanlines(void) ret = GetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, dib_bits + 8, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); ok( !memcmp( data, dib_bits + 8, 56 * 4 ), "bits differ\n"); - for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 9, 12, data, info, DIB_RGB_COLORS ); ok( ret == 1, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = 16; info->bmiHeader.biSizeImage = 0; ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - ok( info->bmiHeader.biSizeImage == 128 * 4, "got %d\n", info->bmiHeader.biSizeImage ); - for (i = 0; i < 56; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); + ok( info->bmiHeader.biSizeImage == 128 * 4, "got %ld\n", info->bmiHeader.biSizeImage ); + for (i = 0; i < 56; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); ok( !memcmp( data + 56, dib_bits, 40 * 4 ), "bits differ\n"); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 2, 12, data, info, DIB_RGB_COLORS ); ok( ret == 6, "got %d\n", ret ); - for (i = 0; i < 48; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 48; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); ok( !memcmp( data + 48, dib_bits, 48 * 4 ), "bits differ\n"); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 2, 3, data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 24; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 24; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 24; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = 5; ret = GetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); ok( !memcmp( data, dib_bits + 32, 16 * 4 ), "bits differ\n"); - for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
/* b-u -> t-d */ @@ -4367,77 +4367,77 @@ static void test_GetDIBits_scanlines(void) ret = GetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, inverted_bits + 16, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 56 * 4 ), "bits differ\n"); - for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 4, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 32 * 4 ), "bits differ\n"); - for (i = 32; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 32; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 3, 12, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 3, 13, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = -16; ret = GetDIBits( hdc, dib, 0, 16, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 64 * 4 ), "bits differ\n"); - for (i = 64; i < 128; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); + for (i = 64; i < 128; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, inverted_bits + 24, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 96; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 96; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 64 * 4 ), "bits differ\n"); - for (i = 64; i < 96; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 64; i < 96; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 5, 12, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 64 * 4 ), "bits differ\n"); - for (i = 64; i < 88; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 88; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 64; i < 88; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 88; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 9, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); ok( !memcmp( data, inverted_bits, 56 * 4 ), "bits differ\n"); - for (i = 56; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 56; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 18, 12, data, info, DIB_RGB_COLORS ); ok( ret == 1, "got %d\n", ret ); - for (i = 0; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = -5; ret = GetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); ok( !memcmp( data, inverted_bits + 16, 16 * 4 ), "bits differ\n"); - for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
DeleteObject( dib ); @@ -4464,72 +4464,72 @@ static void test_GetDIBits_scanlines(void) ret = GetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, dib_bits + 16, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 56 * 4 ), "bits differ\n"); - for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 4, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 32 * 4 ), "bits differ\n"); - for (i = 32; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 32; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 3, 12, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 3, 13, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = -16; ret = GetDIBits( hdc, dib, 0, 16, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 64 * 4 ), "bits differ\n"); - for (i = 64; i < 128; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); + for (i = 64; i < 128; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, dib_bits + 24, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 96; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 96; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 64 * 4 ), "bits differ\n"); - for (i = 64; i < 96; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 64; i < 96; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 5, 12, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 64 * 4 ), "bits differ\n"); - for (i = 64; i < 88; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 88; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 64; i < 88; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 88; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 9, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); ok( !memcmp( data, dib_bits, 56 * 4 ), "bits differ\n"); - for (i = 56; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 56; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = -5; ret = GetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); ok( !memcmp( data, dib_bits + 16, 16 * 4 ), "bits differ\n"); - for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
@@ -4545,46 +4545,46 @@ static void test_GetDIBits_scanlines(void) ret = GetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); ok( !memcmp( data, inverted_bits + 8, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 40; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); ok( !memcmp( data, inverted_bits + 8, 56 * 4 ), "bits differ\n"); - for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 56; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 9, 12, data, info, DIB_RGB_COLORS ); ok( ret == 1, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 64; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = 16; ret = GetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 56; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 56; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); ok( !memcmp( data + 56, inverted_bits, 40 * 4 ), "bits differ\n"); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 2, 12, data, info, DIB_RGB_COLORS ); ok( ret == 6, "got %d\n", ret ); - for (i = 0; i < 48; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 48; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); ok( !memcmp( data + 48, inverted_bits, 48 * 4 ), "bits differ\n"); - for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 96; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
ret = GetDIBits( hdc, dib, 2, 3, data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( data[i] == 0, "%d: got %08x\n", i, data[i] ); - for (i = 24; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 0; i < 24; i++) ok( data[i] == 0, "%d: got %08lx\n", i, data[i] ); + for (i = 24; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] ); memset( data, 0xaa, sizeof(data) );
info->bmiHeader.biHeight = 5; ret = GetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); ok( !memcmp( data, inverted_bits + 32, 16 * 4 ), "bits differ\n"); - for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08x\n", i, data[i] ); + for (i = 16; i < 128; i++) ok( data[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, data[i] );
DeleteObject( dib );
@@ -4633,9 +4633,9 @@ static void test_SetDIBits(void)
ret = SetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 8, data, 40 * 4 ), "bits differ\n"); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* top of dst is aligned with startscans down for the top of the src. @@ -4645,15 +4645,15 @@ static void test_SetDIBits(void) ret = SetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); ok( !memcmp( dib_bits, data + 56, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 5; ret = SetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 32, data, 16 * 4 ), "bits differ\n"); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* t-d -> b-u */ @@ -4668,16 +4668,16 @@ static void test_SetDIBits(void)
ret = SetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 8, inverted_data + 88, 40 * 4 ), "bits differ\n"); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -16; ret = SetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); ok( !memcmp( dib_bits, inverted_data + 88, 40 * 4 ), "bits differ\n"); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBits( hdc, dib, 4, 12, data, info, DIB_RGB_COLORS ); @@ -4693,9 +4693,9 @@ static void test_SetDIBits(void) info->bmiHeader.biHeight = -5; ret = SetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 32, inverted_data + 112, 16 * 4 ), "bits differ\n"); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
DeleteObject( dib ); @@ -4716,24 +4716,24 @@ static void test_SetDIBits(void)
ret = SetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 16, data, 40 * 4 ), "bits differ\n"); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -16; ret = SetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 24, data, 40 * 4 ), "bits differ\n"); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -5; ret = SetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 16, data, 16 * 4 ), "bits differ\n"); - for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* b-u -> t-d */ @@ -4747,24 +4747,24 @@ static void test_SetDIBits(void)
ret = SetDIBits( hdc, dib, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 16, inverted_data + 88, 40 * 4 ), "bits differ\n"); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 16; ret = SetDIBits( hdc, dib, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 24, inverted_data + 32, 40 * 4 ), "bits differ\n"); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 5; ret = SetDIBits( hdc, dib, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 16, inverted_data + 112, 16 * 4 ), "bits differ\n"); - for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* handling of partial color table */ @@ -4788,7 +4788,7 @@ static void test_SetDIBits(void) DWORD expect = idx >= info->bmiHeader.biClrUsed ? 0 : (info->bmiColors[idx].rgbRed << 16 | info->bmiColors[idx].rgbGreen << 8 | info->bmiColors[idx].rgbBlue); - ok( dib_bits[i] == expect, "%d: got %08x instead of %08x\n", i, dib_bits[i], expect ); + ok( dib_bits[i] == expect, "%d: got %08lx instead of %08lx\n", i, dib_bits[i], expect ); } memset( dib_bits, 0xaa, 64 * 4 );
@@ -4816,7 +4816,7 @@ static void test_SetDIBits(void) DWORD expect = idx >= info->bmiHeader.biClrUsed ? 0 : (palent[ent].peRed << 16 | palent[ent].peGreen << 8 | palent[ent].peBlue); ok( dib_bits[i] == expect || broken(dib_bits[i] == 0), /* various Windows versions get some values wrong */ - "%d: got %08x instead of %08x\n", i, dib_bits[i], expect ); + "%d: got %08lx instead of %08lx\n", i, dib_bits[i], expect ); } memset( dib_bits, 0xaa, 64 * 4 );
@@ -4951,7 +4951,7 @@ static void test_SetDIBits_RLE8(void)
ret = SetDIBits( hdc, dib, 1, 0, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* reduce width to 4, left-hand side of dst is touched. */ @@ -4961,7 +4961,7 @@ static void test_SetDIBits_RLE8(void) for (i = 0; i < 64; i++) { DWORD expect = (i & 4) ? 0xaaaaaaaa : bottom_up[i]; - ok( dib_bits[i] == expect, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == expect, "%d: got %08lx\n", i, dib_bits[i] ); } memset( dib_bits, 0xaa, 64 * 4 );
@@ -4972,7 +4972,7 @@ static void test_SetDIBits_RLE8(void) info->bmiHeader.biHeight = 4; ret = SetDIBits( hdc, dib, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 4, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 32, bottom_up, 32 * 4 ), "bits differ\n"); memset( dib_bits, 0xaa, 64 * 4 );
@@ -4981,7 +4981,7 @@ static void test_SetDIBits_RLE8(void) ret = SetDIBits( hdc, dib, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); ok( !memcmp( dib_bits, bottom_up + 8, 56 * 4 ), "bits differ\n"); - for (i = 0; i < 8; i++) ok( dib_bits[56 + i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[56 + i] ); + for (i = 0; i < 8; i++) ok( dib_bits[56 + i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[56 + i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* top-down compressed dibs are invalid */ @@ -4989,7 +4989,7 @@ static void test_SetDIBits_RLE8(void) SetLastError( 0xdeadbeef ); ret = SetDIBits( hdc, dib, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %x\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %lx\n", GetLastError() ); DeleteObject( dib );
/* top-down dst */ @@ -5016,13 +5016,13 @@ static void test_SetDIBits_RLE8(void) ret = SetDIBits( hdc, dib, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 4, "got %d\n", ret ); ok( !memcmp( dib_bits, top_down + 32, 32 * 4 ), "bits differ\n"); - for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 9; ret = SetDIBits( hdc, dib, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); ok( !memcmp( dib_bits + 8, top_down, 56 * 4 ), "bits differ\n"); memset( dib_bits, 0xaa, 64 * 4 );
@@ -5067,79 +5067,79 @@ static void test_SetDIBitsToDevice(void)
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == data[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == data[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 8; i < 48; i++) ok( dib_bits[i] == data[i - 8], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 8; i < 48; i++) ok( dib_bits[i] == data[i - 8], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 3, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == data[i + 16], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 24; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == data[i + 16], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 24; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 16; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 8; i < 64; i++) ok( dib_bits[i] == data[i - 8], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 8; i < 64; i++) ok( dib_bits[i] == data[i - 8], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 2, 8, 8, 0, 6, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 40; i++) ok( dib_bits[i] == data[i + 56], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 40; i++) ok( dib_bits[i] == data[i + 56], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, -4, 8, 8, 0, 3, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 10, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 32; i < 64; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 4, 8, 8, 0, -3, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 4, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == data[i], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == data[i], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 2, 8, 5, 0, -2, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 32; i < 48; i++) ok( dib_bits[i] == data[i - 32], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 32; i < 48; i++) ok( dib_bits[i] == data[i - 32], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 5; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 2, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 16; i < 32; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 16; i < 32; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 3, 3, 2, 2, 1, 2, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 3, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 27 || i == 28 || i == 35 || i == 36) - ok( dib_bits[i] == data[i - 18], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == data[i - 18], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 16, 16, 0, 0, 0, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 2, 8, 4, 0, -1, 3, 12, data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
SetMapMode( hdc, MM_ANISOTROPIC ); @@ -5148,9 +5148,9 @@ static void test_SetDIBitsToDevice(void) ok( ret == 3, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 41 || i == 42 || i == 49 || i == 50) - ok( dib_bits[i] == data[i - 32], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == data[i - 32], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
SetWindowExtEx( hdc, -1, -1, NULL ); @@ -5158,9 +5158,9 @@ static void test_SetDIBitsToDevice(void) ok( ret == 4, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 48 || i == 49 || i == 56 || i == 57) - ok( dib_bits[i] == data[i - 37], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == data[i - 37], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 ); SetMapMode( hdc, MM_TEXT );
@@ -5169,9 +5169,9 @@ static void test_SetDIBitsToDevice(void) ok( ret == 3, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 36 || i == 37 || i == 38 || i == 44 || i == 45 || i == 46) - ok( dib_bits[i] == data[i - 27], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == data[i - 27], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 ); SetLayout( hdc, LAYOUT_LTR );
@@ -5179,94 +5179,94 @@ static void test_SetDIBitsToDevice(void) info->bmiHeader.biHeight = -8; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == inverted_data[i + 64], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == inverted_data[i + 64], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 8; i < 48; i++) ok( dib_bits[i] == inverted_data[i + 80], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 8; i < 48; i++) ok( dib_bits[i] == inverted_data[i + 80], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 4, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == inverted_data[i + 112], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 16; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == inverted_data[i + 112], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 16; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -16; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 8; i < 64; i++) ok( dib_bits[i] == inverted_data[i + 24], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 8; i < 64; i++) ok( dib_bits[i] == inverted_data[i + 24], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 4, 8, 8, 0, 7, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == inverted_data[i + 112], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 16; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == inverted_data[i + 112], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 16; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 32; i < 64; i++) ok( dib_bits[i] == inverted_data[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 32; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 32; i < 64; i++) ok( dib_bits[i] == inverted_data[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, -3, 8, 8, 0, 2, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == inverted_data[i - 8], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == inverted_data[i - 8], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 3, 8, 8, 0, -2, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 24; i < 40; i++) ok( dib_bits[i] == inverted_data[i + 8], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 24; i < 40; i++) ok( dib_bits[i] == inverted_data[i + 8], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 5, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == inverted_data[i - 8], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == inverted_data[i - 8], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 2, 8, 4, 0, -1, 3, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 5, -7, 8, 16, -2, -4, 0, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 31 || i == 39 || i == 47 || i == 55 || i == 63) - ok( dib_bits[i] == inverted_data[i + 1], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == inverted_data[i + 1], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -5; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 8; i < 24; i++) ok( dib_bits[i] == inverted_data[i + 104], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 24; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 8; i < 24; i++) ok( dib_bits[i] == inverted_data[i + 104], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 24; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 5, 4, 2, 2, 6, 3, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 21 || i == 22 || i == 29 || i == 30) - ok( dib_bits[i] == inverted_data[i + 89], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == inverted_data[i + 89], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 16, 16, 0, 0, 0, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -8; @@ -5279,59 +5279,59 @@ static void test_SetDIBitsToDevice(void)
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == data[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == data[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 16; i < 56; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 16; i < 56; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 3, 8, 3, 0, 2, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 24; i < 48; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 24; i < 48; i++) ok( dib_bits[i] == data[i - 16], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 48; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -16; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); - for (i = 0; i < 56; i++) ok( dib_bits[i] == data[i + 40], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 56; i++) ok( dib_bits[i] == data[i + 40], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 5, -7, 8, 16, -1, -8, 0, 12, data, info, DIB_RGB_COLORS ); ok( ret == 12, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 6 || i == 7) - ok( dib_bits[i] == data[i + 82], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == data[i + 82], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = -5; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 56; i++) ok( dib_bits[i] == data[i - 40], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 56; i++) ok( dib_bits[i] == data[i - 40], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 7, 2, 8, 8, 1, 0, 0, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 47 || i == 55 || i == 63) - ok( dib_bits[i] == data[i - 46], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == data[i - 46], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 16, 16, 0, 0, 0, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* b-u -> t-d */ @@ -5339,57 +5339,57 @@ static void test_SetDIBitsToDevice(void) info->bmiHeader.biHeight = 8; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == inverted_data[i + 64], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == inverted_data[i + 64], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 16; i < 56; i++) ok( dib_bits[i] == inverted_data[i + 72], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 16; i < 56; i++) ok( dib_bits[i] == inverted_data[i + 72], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 16; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 7, "got %d\n", ret ); - for (i = 0; i < 56; i++) ok( dib_bits[i] == inverted_data[i + 72], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 56; i++) ok( dib_bits[i] == inverted_data[i + 72], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 4, 4, 8, 8, 0, -4, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 3, "got %d\n", ret ); for (i = 0; i < 64; i++) if ((i >= 36 && i <= 39) || (i >= 44 && i <= 47) || (i >= 52 && i <= 55)) - ok( dib_bits[i] == inverted_data[i + 68], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == inverted_data[i + 68], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 4, 4, 8, 8, -30, -30, 1, 12, data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 5, -5, 8, 16, -2, -4, 4, 12, data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); for (i = 0; i < 64; i++) if (i == 7 || i == 15 || i == 23) - ok( dib_bits[i] == inverted_data[i + 97], "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == inverted_data[i + 97], "%d: got %08lx\n", i, dib_bits[i] ); else - ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 5; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 2, data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 56; i++) ok( dib_bits[i] == inverted_data[i + 72], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 40; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 56; i++) ok( dib_bits[i] == inverted_data[i + 72], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 56; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 16, 16, 0, 0, 0, 5, data, info, DIB_RGB_COLORS ); ok( ret == 5, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* handling of partial color table */ @@ -5413,7 +5413,7 @@ static void test_SetDIBitsToDevice(void) DWORD expect = idx >= info->bmiHeader.biClrUsed ? 0 : (info->bmiColors[idx].rgbRed << 16 | info->bmiColors[idx].rgbGreen << 8 | info->bmiColors[idx].rgbBlue); - ok( dib_bits[i] == expect, "%d: got %08x instead of %08x\n", i, dib_bits[i], expect ); + ok( dib_bits[i] == expect, "%d: got %08lx instead of %08lx\n", i, dib_bits[i], expect ); } memset( dib_bits, 0xaa, 64 * 4 );
@@ -5441,7 +5441,7 @@ static void test_SetDIBitsToDevice(void) DWORD expect = idx >= info->bmiHeader.biClrUsed ? 0 : (palent[ent].peRed << 16 | palent[ent].peGreen << 8 | palent[ent].peBlue); ok( dib_bits[i] == expect || broken(dib_bits[i] == 0), - "%d: got %08x instead of %08x\n", i, dib_bits[i], expect ); + "%d: got %08lx instead of %08lx\n", i, dib_bits[i], expect ); } memset( dib_bits, 0xaa, 64 * 4 );
@@ -5506,23 +5506,23 @@ static void test_SetDIBitsToDevice_RLE8(void)
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* startscan and lines are ignored, unless lines == 0 */ ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 1, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 0, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biWidth = 2; @@ -5535,8 +5535,8 @@ static void test_SetDIBitsToDevice_RLE8(void) } for (i = 0; i < 64; i += 8) { - ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); - ok( dib_bits[i+1] == bottom_up[i+1], "%d: got %08x\n", i+1, dib_bits[i+1] ); + ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); + ok( dib_bits[i+1] == bottom_up[i+1], "%d: got %08lx\n", i+1, dib_bits[i+1] ); } memset( dib_bits, 0xaa, 64 * 4 );
@@ -5544,68 +5544,68 @@ static void test_SetDIBitsToDevice_RLE8(void) info->bmiHeader.biHeight = 2; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 2, "got %d\n", ret ); - for (i = 0; i < 16; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 16; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 9; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 9, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 8; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 1, 9, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == bottom_up[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 3, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 40; i++) ok( dib_bits[i] == bottom_up[i + 24], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 40; i++) ok( dib_bits[i] == bottom_up[i + 24], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 3, 4, 4, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); for (i = 8; i < 40; i++) - if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == bottom_up[i - 8], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + else ok( dib_bits[i] == bottom_up[i - 8], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 3, 3, 8, 4, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); for (i = 8; i < 40; i++) - if ((i & 7) < 3) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == bottom_up[i - 11], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + if ((i & 7) < 3) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + else ok( dib_bits[i] == bottom_up[i - 11], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 2, 3, 8, 4, 2, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 8; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); for (i = 8; i < 40; i++) - if ((i & 7) < 2) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == bottom_up[i - 8], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + if ((i & 7) < 2) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + else ok( dib_bits[i] == bottom_up[i - 8], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biWidth = 37; info->bmiHeader.biHeight = 37; ret = SetDIBitsToDevice( hdc, -2, 1, 10, 5, 2, -1, 12, 24, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 37, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); for (i = 24; i < 64; i++) - if (i == 52) ok( dib_bits[i] == 0x00808080, "%d: got %08x\n", i, dib_bits[i] ); - else if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == bottom_up[i - 20], "%d: got %08x\n", i, dib_bits[i] ); + if (i == 52) ok( dib_bits[i] == 0x00808080, "%d: got %08lx\n", i, dib_bits[i] ); + else if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + else ok( dib_bits[i] == bottom_up[i - 20], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
/* top-down compressed dibs are invalid */ @@ -5614,7 +5614,7 @@ static void test_SetDIBitsToDevice_RLE8(void) SetLastError( 0xdeadbeef ); ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 0, "got %d\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %x\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got %lx\n", GetLastError() );
/* top-down dst */
@@ -5634,35 +5634,35 @@ static void test_SetDIBitsToDevice_RLE8(void)
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 9, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 8, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 4; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 4, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biHeight = 9; ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 0, 0, 8, 8, 0, 0, 0, 9, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); - for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 64; i++) ok( dib_bits[i] == top_down[i], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
ret = SetDIBitsToDevice( hdc, 2, 3, 8, 6, 2, 2, 0, 8, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 9, "got %d\n", ret ); - for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - for (i = 24; i < 64; i++) ok( dib_bits[i] == top_down[i - 24], "%d: got %08x\n", i, dib_bits[i] ); + for (i = 0; i < 24; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 24; i < 64; i++) ok( dib_bits[i] == top_down[i - 24], "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
info->bmiHeader.biWidth = 37; @@ -5670,10 +5670,10 @@ static void test_SetDIBitsToDevice_RLE8(void) ret = SetDIBitsToDevice( hdc, -2, 1, 10, 5, 2, -1, 12, 24, rle8_data, info, DIB_RGB_COLORS ); ok( ret == 37, "got %d\n", ret ); for (i = 0; i < 40; i++) - if (i == 12) ok( dib_bits[i] == 0x00808080, "%d: got %08x\n", i, dib_bits[i] ); - else if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); - else ok( dib_bits[i] == top_down[i + 28], "%d: got %08x\n", i, dib_bits[i] ); - for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08x\n", i, dib_bits[i] ); + if (i == 12) ok( dib_bits[i] == 0x00808080, "%d: got %08lx\n", i, dib_bits[i] ); + else if (i & 4) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); + else ok( dib_bits[i] == top_down[i + 28], "%d: got %08lx\n", i, dib_bits[i] ); + for (i = 40; i < 64; i++) ok( dib_bits[i] == 0xaaaaaaaa, "%d: got %08lx\n", i, dib_bits[i] ); memset( dib_bits, 0xaa, 64 * 4 );
cleanup: @@ -5741,7 +5741,7 @@ static void test_D3DKMTCreateDCFromMemory( void ) }
status = pD3DKMTCreateDCFromMemory( NULL ); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status);
for (i = 0; i < ARRAY_SIZE(test_data); ++i) { @@ -5758,19 +5758,19 @@ static void test_D3DKMTCreateDCFromMemory( void ) create_desc.hBitmap = (void *)0x020baade;
status = pD3DKMTCreateDCFromMemory( &create_desc ); - ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#x.\n", + ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#lx.\n", test_data[i].name, status);
create_desc.hDeviceDc = CreateCompatibleDC( NULL ); create_desc.pMemory = NULL; status = pD3DKMTCreateDCFromMemory( &create_desc ); - ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#x.\n", + ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#lx.\n", test_data[i].name, status);
create_desc.pMemory = data; create_desc.Height = 0; status = pD3DKMTCreateDCFromMemory( &create_desc ); - ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#x.\n", + ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#lx.\n", test_data[i].name, status); ok(create_desc.hDc == (void *)0x010baade, "%s: Got unexpected dc %p.\n", test_data[i].name, create_desc.hDc); @@ -5780,7 +5780,7 @@ static void test_D3DKMTCreateDCFromMemory( void ) create_desc.Height = 7; create_desc.Pitch = 0; status = pD3DKMTCreateDCFromMemory( &create_desc ); - ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#x.\n", + ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#lx.\n", test_data[i].name, status); ok(create_desc.hDc == (void *)0x010baade, "%s: Got unexpected dc %p.\n", test_data[i].name, create_desc.hDc); @@ -5790,7 +5790,7 @@ static void test_D3DKMTCreateDCFromMemory( void ) create_desc.Width = 9; create_desc.Pitch = sizeof(*data); status = pD3DKMTCreateDCFromMemory( &create_desc ); - ok(status == test_data[i].status, "%s: Got unexpected status %#x, expected %#x.\n", + ok(status == test_data[i].status, "%s: Got unexpected status %#lx, expected %#lx.\n", test_data[i].name, status, test_data[i].status); if (status == STATUS_SUCCESS) { @@ -5809,9 +5809,9 @@ static void test_D3DKMTCreateDCFromMemory( void ) }
type = GetObjectType( create_desc.hDc ); - ok(type == OBJ_MEMDC, "%s: Got unexpected object type %#x.\n", test_data[i].name, type); + ok(type == OBJ_MEMDC, "%s: Got unexpected object type %#lx.\n", test_data[i].name, type); type = GetObjectType( create_desc.hBitmap ); - ok(type == OBJ_BITMAP, "%s: Got unexpected object type %#x.\n", test_data[i].name, type); + ok(type == OBJ_BITMAP, "%s: Got unexpected object type %#lx.\n", test_data[i].name, type); bitmap = GetCurrentObject( create_desc.hDc, OBJ_BITMAP ); ok(bitmap == create_desc.hBitmap, "%s: Got unexpected bitmap %p, expected %p.\n", test_data[i].name, bitmap, create_desc.hBitmap); @@ -5834,46 +5834,46 @@ static void test_D3DKMTCreateDCFromMemory( void ) ok(dib.dsBm.bmBits == create_desc.pMemory, "%s: Got unexpected bits %p, expected %p.\n", test_data[i].name, dib.dsBm.bmBits, create_desc.pMemory);
- ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "%s: Got unexpected size %u.\n", + ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "%s: Got unexpected size %lu.\n", test_data[i].name, dib.dsBmih.biSize); - ok(dib.dsBmih.biWidth == create_desc.Width, "%s: Got unexpected width %d.\n", + ok(dib.dsBmih.biWidth == create_desc.Width, "%s: Got unexpected width %ld.\n", test_data[i].name, dib.dsBmih.biHeight); - ok(dib.dsBmih.biHeight == create_desc.Height, "%s: Got unexpected height %d.\n", + ok(dib.dsBmih.biHeight == create_desc.Height, "%s: Got unexpected height %ld.\n", test_data[i].name, dib.dsBmih.biHeight); ok(dib.dsBmih.biPlanes == 1, "%s: Got unexpected plane count %u.\n", test_data[i].name, dib.dsBmih.biPlanes); ok(dib.dsBmih.biBitCount == test_data[i].bit_count, "%s: Got unexpected bit count %u.\n", test_data[i].name, dib.dsBmih.biBitCount); ok(dib.dsBmih.biCompression == (test_data[i].bit_count == 16 ? BI_BITFIELDS : BI_RGB), - "%s: Got unexpected compression %#x.\n", + "%s: Got unexpected compression %#lx.\n", test_data[i].name, dib.dsBmih.biCompression); - ok(!dib.dsBmih.biSizeImage, "%s: Got unexpected image size %u.\n", + ok(!dib.dsBmih.biSizeImage, "%s: Got unexpected image size %lu.\n", test_data[i].name, dib.dsBmih.biSizeImage); - ok(!dib.dsBmih.biXPelsPerMeter, "%s: Got unexpected horizontal resolution %d.\n", + ok(!dib.dsBmih.biXPelsPerMeter, "%s: Got unexpected horizontal resolution %ld.\n", test_data[i].name, dib.dsBmih.biXPelsPerMeter); - ok(!dib.dsBmih.biYPelsPerMeter, "%s: Got unexpected vertical resolution %d.\n", + ok(!dib.dsBmih.biYPelsPerMeter, "%s: Got unexpected vertical resolution %ld.\n", test_data[i].name, dib.dsBmih.biYPelsPerMeter); if (test_data[i].format == D3DDDIFMT_P8) { - ok(dib.dsBmih.biClrUsed == 256, "%s: Got unexpected used colour count %u.\n", + ok(dib.dsBmih.biClrUsed == 256, "%s: Got unexpected used colour count %lu.\n", test_data[i].name, dib.dsBmih.biClrUsed); - ok(dib.dsBmih.biClrImportant == 256, "%s: Got unexpected important colour count %u.\n", + ok(dib.dsBmih.biClrImportant == 256, "%s: Got unexpected important colour count %lu.\n", test_data[i].name, dib.dsBmih.biClrImportant); } else { - ok(!dib.dsBmih.biClrUsed, "%s: Got unexpected used colour count %u.\n", + ok(!dib.dsBmih.biClrUsed, "%s: Got unexpected used colour count %lu.\n", test_data[i].name, dib.dsBmih.biClrUsed); - ok(!dib.dsBmih.biClrImportant, "%s: Got unexpected important colour count %u.\n", + ok(!dib.dsBmih.biClrImportant, "%s: Got unexpected important colour count %lu.\n", test_data[i].name, dib.dsBmih.biClrImportant); }
ok(dib.dsBitfields[0] == test_data[i].mask_r && dib.dsBitfields[1] == test_data[i].mask_g && dib.dsBitfields[2] == test_data[i].mask_b, - "%s: Got unexpected colour masks 0x%08x 0x%08x 0x%08x.\n", + "%s: Got unexpected colour masks 0x%08lx 0x%08lx 0x%08lx.\n", test_data[i].name, dib.dsBitfields[0], dib.dsBitfields[1], dib.dsBitfields[2]); ok(!dib.dshSection, "%s: Got unexpected section %p.\n", test_data[i].name, dib.dshSection); - ok(!dib.dsOffset, "%s: Got unexpected offset %u.\n", test_data[i].name, dib.dsOffset); + ok(!dib.dsOffset, "%s: Got unexpected offset %lu.\n", test_data[i].name, dib.dsOffset);
ret = BitBlt( create_desc.hDc, 0, 0, 4, 10, NULL, 0, 0, BLACKNESS ); ok(ret, "Failed to blit.\n"); @@ -5893,11 +5893,11 @@ static void test_D3DKMTCreateDCFromMemory( void ) destroy_desc.hBitmap = create_desc.hBitmap;
status = pD3DKMTDestroyDCFromMemory( NULL ); - ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#x.\n", test_data[i].name, status); + ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#lx.\n", test_data[i].name, status); status = pD3DKMTDestroyDCFromMemory( &destroy_desc ); - ok(status == STATUS_SUCCESS, "%s: Got unexpected status %#x.\n", test_data[i].name, status); + ok(status == STATUS_SUCCESS, "%s: Got unexpected status %#lx.\n", test_data[i].name, status); status = pD3DKMTDestroyDCFromMemory( &destroy_desc ); - ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#x.\n", test_data[i].name, status); + ok(status == STATUS_INVALID_PARAMETER, "%s: Got unexpected status %#lx.\n", test_data[i].name, status);
ret = DeleteDC( create_desc.hDeviceDc ); ok(ret, "Failed to delete dc.\n"); @@ -5917,7 +5917,7 @@ static void test_D3DKMTCreateDCFromMemory( void ) expected = 0x00000000; else expected = 0xaaaaaaaa >> (32 - test_data[i].bit_count); - ok(colour == expected, "%s: Got unexpected colour 0x%08x at %u, %u, expected 0x%08x.\n", + ok(colour == expected, "%s: Got unexpected colour 0x%08lx at %u, %u, expected 0x%08lx.\n", test_data[i].name, colour, x, y, expected); if (colour != expected) fail = TRUE; @@ -5932,7 +5932,7 @@ static void test_D3DKMTCreateDCFromMemory( void ) expected = 0x00000000; else expected = CLR_INVALID; - ok(pixel == expected, "%s: got 0x%08x at %u, %u, expect 0x%08x\n", test_data[i].name, + ok(pixel == expected, "%s: got 0x%08lx at %u, %u, expect 0x%08lx\n", test_data[i].name, pixel, x, y, expected); } } @@ -5943,7 +5943,7 @@ static void test_D3DKMTCreateDCFromMemory( void ) }
alloc_data = VirtualAlloc( NULL, 4096, MEM_COMMIT, PAGE_READWRITE ); - ok(!!alloc_data, "Failed to allocate memory, error %u.\n", GetLastError()); + ok(!!alloc_data, "Failed to allocate memory, error %lu.\n", GetLastError());
create_desc.pMemory = alloc_data; create_desc.Format = D3DDDIFMT_A8R8G8B8; @@ -5954,26 +5954,26 @@ static void test_D3DKMTCreateDCFromMemory( void ) create_desc.pColorTable = NULL;
status = pD3DKMTCreateDCFromMemory( &create_desc ); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status);
size = VirtualQuery( alloc_data, &memory_info, sizeof(memory_info) ); ok(size == sizeof(memory_info), "Got unexpected size %u.\n", size); - ok(memory_info.State == MEM_COMMIT, "Got state %#x.\n", memory_info.State); - ok(memory_info.Protect == PAGE_READWRITE, "Got protection %#x.\n", memory_info.Protect); + ok(memory_info.State == MEM_COMMIT, "Got state %#lx.\n", memory_info.State); + ok(memory_info.Protect == PAGE_READWRITE, "Got protection %#lx.\n", memory_info.Protect);
destroy_desc.hDc = create_desc.hDc; destroy_desc.hBitmap = create_desc.hBitmap;
status = pD3DKMTDestroyDCFromMemory( &destroy_desc ); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status);
size = VirtualQuery( alloc_data, &memory_info, sizeof(memory_info) ); ok(size == sizeof(memory_info), "Got unexpected size %u.\n", size); - ok(memory_info.State == MEM_COMMIT, "Got state %#x.\n", memory_info.State); - ok(memory_info.Protect == PAGE_READWRITE, "Got protection %#x.\n", memory_info.Protect); + ok(memory_info.State == MEM_COMMIT, "Got state %#lx.\n", memory_info.State); + ok(memory_info.Protect == PAGE_READWRITE, "Got protection %#lx.\n", memory_info.Protect);
ret = VirtualFree( alloc_data, 0, MEM_RELEASE ); - ok(ret, "Failed to free memory, error %u.\n", GetLastError()); + ok(ret, "Failed to free memory, error %lu.\n", GetLastError()); }
START_TEST(bitmap) diff --git a/dlls/gdi32/tests/brush.c b/dlls/gdi32/tests/brush.c index 0841eb2f2e1..b23e73ac65f 100644 --- a/dlls/gdi32/tests/brush.c +++ b/dlls/gdi32/tests/brush.c @@ -61,15 +61,15 @@ static void test_solidbrush(void) stockBrush = NULL; memset(&br, 0, sizeof(br)); ret = GetObjectW(solidBrush, sizeof(br), &br); - ok( ret !=0, "GetObject on solid %s brush failed, error=%d\n", stock[i].name, GetLastError()); + ok( ret !=0, "GetObject on solid %s brush failed, error=%ld\n", stock[i].name, GetLastError()); ok(br.lbStyle==BS_SOLID, "%s brush has wrong style, got %d expected %d\n", stock[i].name, br.lbStyle, BS_SOLID); - ok(br.lbColor==stock[i].color, "%s brush has wrong color, got 0x%08x expected 0x%08x\n", stock[i].name, br.lbColor, stock[i].color); + ok(br.lbColor==stock[i].color, "%s brush has wrong color, got 0x%08lx expected 0x%08lx\n", stock[i].name, br.lbColor, stock[i].color);
if(stockBrush) { /* Sanity check, make sure the colors being compared do in fact have a stock brush */ ret = GetObjectW(stockBrush, sizeof(br), &br); - ok( ret !=0, "GetObject on stock %s brush failed, error=%d\n", stock[i].name, GetLastError()); - ok(br.lbColor==stock[i].color, "stock %s brush unexpected color, got 0x%08x expected 0x%08x\n", stock[i].name, br.lbColor, stock[i].color); + ok( ret !=0, "GetObject on stock %s brush failed, error=%ld\n", stock[i].name, GetLastError()); + ok(br.lbColor==stock[i].color, "stock %s brush unexpected color, got 0x%08lx expected 0x%08lx\n", stock[i].name, br.lbColor, stock[i].color); }
DeleteObject(solidBrush); @@ -92,26 +92,26 @@ static void test_hatch_brush(void) brush = CreateHatchBrush( i, RGB(12,34,56) ); if (i < HS_API_MAX) { - ok( brush != 0, "%u: CreateHatchBrush failed err %u\n", i, GetLastError() ); + ok( brush != 0, "%u: CreateHatchBrush failed err %lu\n", i, GetLastError() ); size = GetObjectW( brush, sizeof(lb), &lb ); ok( size == sizeof(lb), "wrong size %u\n", size ); - ok( lb.lbColor == RGB(12,34,56), "wrong color %08x\n", lb.lbColor ); + ok( lb.lbColor == RGB(12,34,56), "wrong color %08lx\n", lb.lbColor ); if (i <= HS_DIAGCROSS) { ok( lb.lbStyle == BS_HATCHED, "wrong style %u\n", lb.lbStyle ); - ok( lb.lbHatch == i, "wrong hatch %lu/%u\n", lb.lbHatch, i ); + ok( lb.lbHatch == i, "wrong hatch %Iu/%u\n", lb.lbHatch, i ); } else { ok( lb.lbStyle == BS_SOLID, "wrong style %u\n", lb.lbStyle ); - ok( lb.lbHatch == 0, "wrong hatch %lu\n", lb.lbHatch ); + ok( lb.lbHatch == 0, "wrong hatch %Iu\n", lb.lbHatch ); } DeleteObject( brush ); } else { ok( !brush, "%u: CreateHatchBrush succeeded\n", i ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); } } } @@ -141,7 +141,7 @@ static void test_pattern_brush(void) ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap ); DeleteObject( brush );
@@ -154,7 +154,7 @@ static void test_pattern_brush(void) ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap ); ret = GetObjectW( bitmap, sizeof(dib), &dib ); ok( ret == sizeof(dib.dsBm), "wrong size %u\n", ret ); @@ -180,7 +180,7 @@ static void test_pattern_brush(void) ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap ); ret = GetObjectW( bitmap, sizeof(dib), &dib ); ok( ret == sizeof(dib), "wrong size %u\n", ret ); @@ -193,7 +193,7 @@ static void test_pattern_brush(void) ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */ "wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info ); DeleteObject( brush ); @@ -207,7 +207,7 @@ static void test_pattern_brush(void) ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */ "wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
@@ -223,7 +223,7 @@ static void test_pattern_brush(void) ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( (HGLOBAL)br.lbHatch != mem, "wrong handle %p/%p\n", (HGLOBAL)br.lbHatch, mem ); bits = GlobalLock( mem ); ok( (HGLOBAL)br.lbHatch == bits || broken(!br.lbHatch), /* nt4 */ @@ -287,14 +287,14 @@ static void test_pattern_brush(void) SetRect( &rect, 0, 0, 16, 16 ); brush = CreateSolidBrush( 0xff5511 ); result = FillRect( hdc, &rect, brush ); - ok( result, "FillRect failed, error %d.\n", GetLastError() ); + ok( result, "FillRect failed, error %ld.\n", GetLastError() ); DeleteObject( brush ); color = GetPixel( hdc, 10, 10 ); - ok( color == 0xff5511, "Expected color %#x, got %#x.\n", 0xff5511, color ); + ok( color == 0xff5511, "Expected color %#x, got %#lx.\n", 0xff5511, color );
/* Create a pattern brush with the first bitmap filled with 0xff5511 */ brush = CreatePatternBrush( bitmap ); - ok( brush != NULL, "CreatePatternBrush failed, error %u.\n", GetLastError() ); + ok( brush != NULL, "CreatePatternBrush failed, error %lu.\n", GetLastError() );
/* Delete the first bitmap used for pattern brush creation */ SelectObject( hdc, bitmap2 ); @@ -303,7 +303,7 @@ static void test_pattern_brush(void) memset( &br, 0, sizeof(br) ); ret = GetObjectW( brush, sizeof(br), &br ); ok( ret == sizeof(br), "wrong size %u\n", ret ); - ok( br.lbColor == 0, "wrong color %u\n", br.lbColor ); + ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor ); ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle ); ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
@@ -315,17 +315,17 @@ static void test_pattern_brush(void) /* Fill hdc with 0xabcdef */ brush2 = CreateSolidBrush( 0xabcdef ); result = FillRect( hdc, &rect, brush2 ); - ok( result, "FillRect failed, error %d.\n", GetLastError() ); + ok( result, "FillRect failed, error %ld.\n", GetLastError() ); color = GetPixel( hdc, 10, 10 ); - ok( color == 0xabcdef, "Expected color %#x, got %#x.\n", 0xabcdef, color ); + ok( color == 0xabcdef, "Expected color %#x, got %#lx.\n", 0xabcdef, color ); DeleteObject( brush2 );
/* Fill hdc with the brush created with the deleted bitmap */ /* FillRect() succeeds and hdc is filled with the deleted bitmap content */ result = FillRect( hdc, &rect, brush ); - ok( result, "FillRect failed, error %d.\n", GetLastError() ); + ok( result, "FillRect failed, error %ld.\n", GetLastError() ); color = GetPixel( hdc, 10, 10 ); - ok( color == 0xff5511, "Expected color %#x, got %#x.\n", 0xff5511, color ); + ok( color == 0xff5511, "Expected color %#x, got %#lx.\n", 0xff5511, color ); DeleteObject( brush );
SelectObject( hdc, old_bitmap ); @@ -385,7 +385,7 @@ static void test_palette_brush(void) DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 | pal->palPalEntry[255 - i].peGreen << 8 | pal->palPalEntry[255 - i].peBlue); - ok( dib_bits[i] == expect, "wrong bits %x/%x at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 ); + ok( dib_bits[i] == expect, "wrong bits %lx/%lx at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 ); }
for (i = 0; i < 256; i++) pal->palPalEntry[i].peRed = i * 3; @@ -398,7 +398,7 @@ static void test_palette_brush(void) DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 | pal->palPalEntry[255 - i].peGreen << 8 | pal->palPalEntry[255 - i].peBlue); - ok( dib_bits[i] == expect, "wrong bits %x/%x at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 ); + ok( dib_bits[i] == expect, "wrong bits %lx/%lx at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 ); } DeleteDC( hdc ); DeleteObject( dib ); @@ -415,11 +415,11 @@ static void test_brush_org( void ) SetBrushOrgEx( hdc, 0, 0, &old );
SetBrushOrgEx( hdc, 1, 1, &pt ); - ok( pt.x == 0 && pt.y == 0, "got %d,%d\n", pt.x, pt.y ); + ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y ); SetBrushOrgEx( hdc, 0x10000, -1, &pt ); - ok( pt.x == 1 && pt.y == 1, "got %d,%d\n", pt.x, pt.y ); + ok( pt.x == 1 && pt.y == 1, "got %ld,%ld\n", pt.x, pt.y ); SetBrushOrgEx( hdc, old.x, old.y, &pt ); - ok( pt.x == 0x10000 && pt.y == -1, "got %d,%d\n", pt.x, pt.y ); + ok( pt.x == 0x10000 && pt.y == -1, "got %ld,%ld\n", pt.x, pt.y );
ReleaseDC( 0, hdc ); } diff --git a/dlls/gdi32/tests/clipping.c b/dlls/gdi32/tests/clipping.c index 37a96de2bb4..ce66f9cad09 100644 --- a/dlls/gdi32/tests/clipping.c +++ b/dlls/gdi32/tests/clipping.c @@ -132,19 +132,19 @@ static void verify_region(HRGN hrgn, const RECT *rc)
ret = GetRegionData(hrgn, 0, NULL); if (IsRectEmpty(rc)) - ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", ret); else - ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %lu\n", ret);
if (!ret) return;
ret = GetRegionData(hrgn, sizeof(rgn), &rgn.data); if (IsRectEmpty(rc)) - ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", ret); else - ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %lu\n", ret);
- trace("size %u, type %u, count %u, rgn size %u, bound %s\n", + trace("size %lu, type %lu, count %lu, rgn size %lu, bound %s\n", rgn.data.rdh.dwSize, rgn.data.rdh.iType, rgn.data.rdh.nCount, rgn.data.rdh.nRgnSize, wine_dbgstr_rect(&rgn.data.rdh.rcBound)); if (rgn.data.rdh.nCount != 0) @@ -154,21 +154,21 @@ static void verify_region(HRGN hrgn, const RECT *rc) ok(EqualRect(rect, rc), "rects don't match\n"); }
- ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", rgn.data.rdh.dwSize); - ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn.data.rdh.iType); + ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", rgn.data.rdh.dwSize); + ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %lu\n", rgn.data.rdh.iType); if (IsRectEmpty(rc)) { - ok(rgn.data.rdh.nCount == 0, "expected 0, got %u\n", rgn.data.rdh.nCount); + ok(rgn.data.rdh.nCount == 0, "expected 0, got %lu\n", rgn.data.rdh.nCount); ok(rgn.data.rdh.nRgnSize == 0 || broken(rgn.data.rdh.nRgnSize == 168), /* NT4 */ - "expected 0, got %u\n", rgn.data.rdh.nRgnSize); + "expected 0, got %lu\n", rgn.data.rdh.nRgnSize); } else { - ok(rgn.data.rdh.nCount == 1, "expected 1, got %u\n", rgn.data.rdh.nCount); + ok(rgn.data.rdh.nCount == 1, "expected 1, got %lu\n", rgn.data.rdh.nCount); ok(rgn.data.rdh.nRgnSize == sizeof(RECT) || broken(rgn.data.rdh.nRgnSize == 168), /* NT4 */ - "expected sizeof(RECT), got %u\n", rgn.data.rdh.nRgnSize); + "expected sizeof(RECT), got %lu\n", rgn.data.rdh.nRgnSize); } ok(EqualRect(&rgn.data.rdh.rcBound, rc), "rects don't match\n"); } @@ -190,7 +190,7 @@ static void test_ExtCreateRegion(void) SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, 0, NULL); ok(!hrgn, "ExtCreateRegion should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
rgn.data.rdh.dwSize = 0; rgn.data.rdh.iType = 0; @@ -202,14 +202,14 @@ static void test_ExtCreateRegion(void) SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); ok(!hrgn, "ExtCreateRegion should fail\n"); - ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
rgn.data.rdh.dwSize = sizeof(rgn.data.rdh) - 1;
SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); ok(!hrgn, "ExtCreateRegion should fail\n"); - ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
/* although XP doesn't care about the type Win9x does */ rgn.data.rdh.iType = RDH_RECTANGLES; @@ -218,7 +218,7 @@ static void test_ExtCreateRegion(void) /* sizeof(RGNDATAHEADER) is large enough */ SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER), &rgn.data); - ok(hrgn != 0, "ExtCreateRegion error %u\n", GetLastError()); + ok(hrgn != 0, "ExtCreateRegion error %lu\n", GetLastError()); verify_region(hrgn, &empty_rect); DeleteObject(hrgn);
@@ -229,11 +229,11 @@ static void test_ExtCreateRegion(void) ok(!hrgn, "ExtCreateRegion should fail\n"); todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || - broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %u\n", GetLastError()); + broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); - ok(hrgn != 0, "ExtCreateRegion error %u\n", GetLastError()); + ok(hrgn != 0, "ExtCreateRegion error %lu\n", GetLastError()); verify_region(hrgn, &empty_rect); DeleteObject(hrgn);
@@ -243,7 +243,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); - ok(hrgn != 0, "ExtCreateRegion error %u\n", GetLastError()); + ok(hrgn != 0, "ExtCreateRegion error %lu\n", GetLastError()); verify_region(hrgn, &rc); DeleteObject(hrgn);
@@ -256,7 +256,7 @@ static void test_ExtCreateRegion(void)
SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(&xform, sizeof(rgn), &rgn.data); - ok(hrgn != 0, "ExtCreateRegion error %u/%x\n", GetLastError(), GetLastError()); + ok(hrgn != 0, "ExtCreateRegion error %lu/%lx\n", GetLastError(), GetLastError()); verify_region(hrgn, &rc_xformed); DeleteObject(hrgn);
@@ -269,7 +269,7 @@ static void test_ExtCreateRegion(void) hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) - 1, &rgn.data); todo_wine ok(!hrgn, "ExtCreateRegion should fail\n"); - ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError());
}
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index 2e005f23f3c..c64ef332060 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -44,30 +44,30 @@ static void test_dc_values(void)
ok( hdc != NULL, "CreateDC failed\n" ); color = SetBkColor( hdc, 0x12345678 ); - ok( color == 0xffffff, "initial color %08x\n", color ); + ok( color == 0xffffff, "initial color %08lx\n", color ); color = GetBkColor( hdc ); - ok( color == 0x12345678, "wrong color %08x\n", color ); + ok( color == 0x12345678, "wrong color %08lx\n", color ); color = SetBkColor( hdc, 0xffffffff ); - ok( color == 0x12345678, "wrong color %08x\n", color ); + ok( color == 0x12345678, "wrong color %08lx\n", color ); color = GetBkColor( hdc ); - ok( color == 0xffffffff, "wrong color %08x\n", color ); + ok( color == 0xffffffff, "wrong color %08lx\n", color ); color = SetBkColor( hdc, 0 ); - ok( color == 0xffffffff, "wrong color %08x\n", color ); + ok( color == 0xffffffff, "wrong color %08lx\n", color ); color = GetBkColor( hdc ); - ok( color == 0, "wrong color %08x\n", color ); + ok( color == 0, "wrong color %08lx\n", color );
color = SetTextColor( hdc, 0xffeeddcc ); - ok( color == 0, "initial color %08x\n", color ); + ok( color == 0, "initial color %08lx\n", color ); color = GetTextColor( hdc ); - ok( color == 0xffeeddcc, "wrong color %08x\n", color ); + ok( color == 0xffeeddcc, "wrong color %08lx\n", color ); color = SetTextColor( hdc, 0xffffffff ); - ok( color == 0xffeeddcc, "wrong color %08x\n", color ); + ok( color == 0xffeeddcc, "wrong color %08lx\n", color ); color = GetTextColor( hdc ); - ok( color == 0xffffffff, "wrong color %08x\n", color ); + ok( color == 0xffffffff, "wrong color %08lx\n", color ); color = SetTextColor( hdc, 0 ); - ok( color == 0xffffffff, "wrong color %08x\n", color ); + ok( color == 0xffffffff, "wrong color %08lx\n", color ); color = GetTextColor( hdc ); - ok( color == 0, "wrong color %08x\n", color ); + ok( color == 0, "wrong color %08lx\n", color );
extra = GetTextCharacterExtra( hdc ); ok( extra == 0, "initial extra %d\n", extra ); @@ -84,7 +84,7 @@ static void test_dc_values(void) SetLastError(0xdeadbeef); attr = SetBkMode(ULongToHandle(0xdeadbeef), OPAQUE); ok(!attr, "attr = %x\n", attr); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
attr = GetBkColor(ULongToHandle(0xdeadbeef)); ok(attr == CLR_INVALID, "attr = %x\n", attr); @@ -92,7 +92,7 @@ static void test_dc_values(void) SetLastError(0xdeadbeef); attr = GetDeviceCaps(ULongToHandle(0xdeadbeef), TECHNOLOGY); ok(!attr, "GetDeviceCaps rets %d\n", attr); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
DeleteDC( hdc ); } @@ -129,7 +129,7 @@ static void test_savedc_2(void) ret, wine_dbgstr_rect(&rc)); ret = GetRegionData(hrgn, sizeof(buffer), rgndata); ok(ret == sizeof(RGNDATAHEADER), "got %u\n", ret); - ok(!rgndata->rdh.nCount, "got %u rectangles\n", rgndata->rdh.nCount); + ok(!rgndata->rdh.nCount, "got %lu rectangles\n", rgndata->rdh.nCount); SetRect(&rc, 0, 0, 100, 100); ok(EqualRect(&rc, &rc_clip), "rects are not equal: %s - %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(&rc_clip)); @@ -144,7 +144,7 @@ static void test_savedc_2(void) ok(ret == 1, "GetClipRgn returned %d instead of 1\n", ret); ret = GetRegionData(hrgn, sizeof(buffer), rgndata); ok(ret == sizeof(RGNDATAHEADER) + sizeof(RECT), "got %u\n", ret); - ok(rgndata->rdh.nCount == 1, "got %u rectangles\n", rgndata->rdh.nCount); + ok(rgndata->rdh.nCount == 1, "got %lu rectangles\n", rgndata->rdh.nCount); SetRect(&rc, 0, 0, 50, 50); ok(EqualRect((RECT *)rgndata->Buffer, &rc), "got rect %s\n", wine_dbgstr_rect((RECT *)rgndata->Buffer));
@@ -243,7 +243,7 @@ static void test_savedc(void) SetLastError(0xdeadbeef); ret = SaveDC(ULongToHandle(0xdeadbeef)); ok(!ret, "SaveDC returned %u\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError()); }
static void test_GdiConvertToDevmodeW(void) @@ -263,7 +263,7 @@ static void test_GdiConvertToDevmodeW(void) memset(&dmA, 0, sizeof(dmA)); dmA.dmSize = sizeof(dmA); ret = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dmA); - ok(ret, "EnumDisplaySettingsExA error %u\n", GetLastError()); + ok(ret, "EnumDisplaySettingsExA error %lu\n", GetLastError()); ok(dmA.dmSize >= FIELD_OFFSET(DEVMODEA, dmICMMethod), "dmSize is too small: %04x\n", dmA.dmSize); ok(dmA.dmSize <= sizeof(DEVMODEA), "dmSize is too large: %04x\n", dmA.dmSize);
@@ -284,7 +284,7 @@ static void test_GdiConvertToDevmodeW(void) ok(dmW->dmSize == FIELD_OFFSET(DEVMODEW, dmICMMethod) + sizeof(dmW->dmICMMethod), "wrong size %u\n", dmW->dmSize); ok(dmW->dmICMMethod == DMICMMETHOD_NONE, - "expected DMICMMETHOD_NONE, got %u\n", dmW->dmICMMethod); + "expected DMICMMETHOD_NONE, got %lu\n", dmW->dmICMMethod); HeapFree(GetProcessHeap(), 0, dmW);
dmA.dmSize = 1024; @@ -297,13 +297,13 @@ static void test_GdiConvertToDevmodeW(void) dmA.dmSize = 0; dmW = pGdiConvertToDevmodeW(&dmA); ok(!dmW, "GdiConvertToDevmodeW should fail\n"); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError());
/* this is the minimal dmSize that XP accepts */ dmA.dmSize = FIELD_OFFSET(DEVMODEA, dmFields); dmW = pGdiConvertToDevmodeW(&dmA); ok(dmW->dmSize == FIELD_OFFSET(DEVMODEW, dmFields), - "expected %04x, got %04x\n", FIELD_OFFSET(DEVMODEW, dmFields), dmW->dmSize); + "expected %04lx, got %04x\n", FIELD_OFFSET(DEVMODEW, dmFields), dmW->dmSize); HeapFree(GetProcessHeap(), 0, dmW); }
@@ -415,7 +415,7 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr, int scale type, descr ); type = SetBoundsRect( hdc, NULL, DCB_RESET | DCB_ENABLE ); ok( type == (DCB_RESET | DCB_DISABLE) || broken(type == (DCB_SET | DCB_ENABLE)) /* XP */, - "SetBoundsRect returned %x for %s (hdc type %d)\n", type, descr, GetObjectType( hdc ) ); + "SetBoundsRect returned %x for %s (hdc type %ld)\n", type, descr, GetObjectType( hdc ) );
SetMapMode( hdc, MM_TEXT ); Rectangle( hdc, 2, 2, 4, 4 ); @@ -523,15 +523,15 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr, int scale ret = GetDeviceGammaRamp( hdc, &ramp ); if (GetObjectType( hdc ) != OBJ_DC || GetDeviceCaps( hdc, TECHNOLOGY ) == DT_RASPRINTER) { - ok( !ret, "GetDeviceGammaRamp succeeded on %s (type %d)\n", descr, GetObjectType( hdc ) ); + ok( !ret, "GetDeviceGammaRamp succeeded on %s (type %ld)\n", descr, GetObjectType( hdc ) ); ok( GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == 0xdeadbeef) /* nt4 */ || broken(GetLastError() == NO_ERROR), /* Printer DC on Win10 1909+ */ - "wrong error %u on %s\n", GetLastError(), descr ); + "wrong error %lu on %s\n", GetLastError(), descr ); } else { - ok( ret || broken(!ret) /* NT4 */, "GetDeviceGammaRamp failed on %s (type %d), error %u\n", + ok( ret || broken(!ret) /* NT4 */, "GetDeviceGammaRamp failed on %s (type %ld), error %lu\n", descr, GetObjectType( hdc ), GetLastError() ); } } @@ -723,11 +723,11 @@ static void test_DC_bitmap(void) oldhbmp = SelectObject( hdcmem, hbmp); ok( oldhbmp != NULL, "SelectObject returned NULL\n" ); /* a memdc always has a bitmap selected */ col = GetPixel( hdcmem, 0, 0); - ok( col == 0xffffff, "GetPixel returned %08x, expected 00ffffff\n", col); + ok( col == 0xffffff, "GetPixel returned %08lx, expected 00ffffff\n", col); col = GetPixel( hdcmem, 1, 1); - ok( col == 0x000000, "GetPixel returned %08x, expected 00000000\n", col); + ok( col == 0x000000, "GetPixel returned %08lx, expected 00000000\n", col); col = GetPixel( hdcmem, 100, 1); - ok( col == CLR_INVALID, "GetPixel returned %08x, expected ffffffff\n", col); + ok( col == CLR_INVALID, "GetPixel returned %08lx, expected ffffffff\n", col); SelectObject( hdcmem, oldhbmp); DeleteObject( hbmp);
@@ -748,10 +748,10 @@ static void test_DC_bitmap(void) ok( oldhbmp != NULL, "SelectObject returned NULL\n" ); col = GetPixel( hdcmem, 0, 0); ok( col == 0xffffff, - "GetPixel of a bitmap with 16 bits/pixel returned %08x, expected 00ffffff\n", col); + "GetPixel of a bitmap with 16 bits/pixel returned %08lx, expected 00ffffff\n", col); col = GetPixel( hdcmem, 1, 1); ok( col == 0x000000, - "GetPixel of a bitmap with 16 bits/pixel returned returned %08x, expected 00000000\n", col); + "GetPixel of a bitmap with 16 bits/pixel returned returned %08lx, expected 00000000\n", col); } if( oldhbmp) SelectObject( hdcmem, oldhbmp); DeleteObject( hbmp); @@ -764,10 +764,10 @@ static void test_DC_bitmap(void) ok( oldhbmp != NULL, "SelectObject returned NULL\n" ); col = GetPixel( hdcmem, 0, 0); ok( col == 0xffffff, - "GetPixel of a bitmap with 32 bits/pixel returned %08x, expected 00ffffff\n", col); + "GetPixel of a bitmap with 32 bits/pixel returned %08lx, expected 00ffffff\n", col); col = GetPixel( hdcmem, 1, 1); ok( col == 0x000000, - "GetPixel of a bitmap with 32 bits/pixel returned returned %08x, expected 00000000\n", col); + "GetPixel of a bitmap with 32 bits/pixel returned returned %08lx, expected 00000000\n", col); } if( oldhbmp) SelectObject( hdcmem, oldhbmp); DeleteObject( hbmp); @@ -1399,13 +1399,13 @@ static void test_printer_dc(void) ok( display_memdc != NULL, "CreateCompatibleDC failed for screen\n" );
ret = GetDeviceCaps( hdc, TECHNOLOGY ); - ok( ret == DT_RASPRINTER, "wrong type %u\n", ret ); + ok( ret == DT_RASPRINTER, "wrong type %lu\n", ret );
ret = GetDeviceCaps( memdc, TECHNOLOGY ); - ok( ret == DT_RASPRINTER, "wrong type %u\n", ret ); + ok( ret == DT_RASPRINTER, "wrong type %lu\n", ret );
ret = GetDeviceCaps( display_memdc, TECHNOLOGY ); - ok( ret == DT_RASDISPLAY, "wrong type %u\n", ret ); + ok( ret == DT_RASDISPLAY, "wrong type %lu\n", ret );
bmp = CreateBitmap( 100, 100, 1, GetDeviceCaps( hdc, BITSPIXEL ), NULL ); orig = SelectObject( memdc, bmp ); @@ -1427,7 +1427,7 @@ static void test_printer_dc(void) ok( BitBlt( display_memdc, 10, 10, 20, 20, memdc, 0, 0, SRCCOPY ), "BitBlt failed\n" );
ret = GetPixel( hdc, 0, 0 ); - ok( ret == CLR_INVALID, "wrong pixel value %x\n", ret ); + ok( ret == CLR_INVALID, "wrong pixel value %lx\n", ret );
enhmf_dc = CreateEnhMetaFileA( hdc, NULL, NULL, NULL ); ok(enhmf_dc != 0, "CreateEnhMetaFileA failed\n"); @@ -1463,12 +1463,12 @@ static void print_something(HDC hdc) di.lpszDatatype = NULL; di.fwType = 0; ret = StartDocA(hdc, &di); - ok(ret > 0, "StartDoc failed: %d\n", ret); + ok(ret > 0, "StartDoc failed: %ld\n", ret);
strcpy(buf + 2, "\n% ===> before DOWNLOADHEADER <===\n"); *(WORD *)buf = strlen(buf + 2); ret = Escape(hdc, POSTSCRIPT_PASSTHROUGH, 0, buf, NULL); - ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %d\n", ret); + ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %ld\n", ret);
strcpy(buf, "deadbeef"); ret = ExtEscape(hdc, DOWNLOADHEADER, 0, NULL, sizeof(buf), buf ); @@ -1478,7 +1478,7 @@ static void print_something(HDC hdc) strcpy(buf + 2, "\n% ===> after DOWNLOADHEADER <===\n"); *(WORD *)buf = strlen(buf + 2); ret = Escape(hdc, POSTSCRIPT_PASSTHROUGH, 0, buf, NULL); - ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %d\n", ret); + ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %ld\n", ret);
ret = EndDoc(hdc); ok(ret == 1, "EndDoc failed\n"); @@ -1695,7 +1695,7 @@ static void test_SetPixel(void) COLORREF c;
c = SetPixel((HDC)0xdeadbeef, 0, 0, 0); - ok(c == ~0, "SetPixel returned: %x\n", c); + ok(c == ~0, "SetPixel returned: %lx\n", c); }
diff --git a/dlls/gdi32/tests/dib.c b/dlls/gdi32/tests/dib.c index bdc3d9ed55b..94823e91364 100644 --- a/dlls/gdi32/tests/dib.c +++ b/dlls/gdi32/tests/dib.c @@ -1832,10 +1832,10 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) ret = PatBlt(hdc, 10, y, 100, 10, rop3[i]);
if(rop_uses_src(rop3[i])) - ok(ret == FALSE || broken(is_ddb), "got TRUE for %x\n", rop3[i]); + ok(ret == FALSE || broken(is_ddb), "got TRUE for %lx\n", rop3[i]); else { - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 20; }
@@ -1955,7 +1955,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -1982,7 +1982,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2009,7 +2009,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2036,7 +2036,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2073,7 +2073,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2095,7 +2095,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2120,7 +2120,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2144,7 +2144,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) if(!rop_uses_src(rop3[i])) { ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); y += 25; } } @@ -2201,7 +2201,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) hatch_brush = CreateHatchBrush(hatch_style, RGB(0xff, 0, 0)); SelectObject(hdc, hatch_brush); ret = PatBlt(hdc, 10 + i + 30 * hatch_style, y, 20, 20, rop3[i]); - ok(ret, "got FALSE for %x\n", rop3[i]); + ok(ret, "got FALSE for %lx\n", rop3[i]); SelectObject(hdc, orig_brush); DeleteObject(hatch_brush); } @@ -2678,19 +2678,19 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
s = SetPixel( hdc, i * 2, j, DIBINDEX(i) ); g = GetPixel( hdc, i * 2, 0 ); /* retrieve value set with R2_COPYPEN */ - ok( s == g, "got %08x and %08x\n", s, g ); + ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2, 20 + j, PALETTEINDEX(i) ); g = GetPixel( hdc, i * 2, 20 + 0 ); /* retrieve value set with R2_COPYPEN */ - ok( s == g, "got %08x and %08x\n", s, g ); + ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2, 40 + j, RGB( (i & 0x07) << 5, (i & 0x38) << 2, i & 0xc0 ) ); g = GetPixel( hdc, i * 2, 40 + 0 ); /* retrieve value set with R2_COPYPEN */ - ok( s == g, "got %08x and %08x\n", s, g ); + ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2, 60 + j, PALETTERGB( (i & 0x07) << 5, (i & 0x38) << 2, i & 0xc0 ) ); g = GetPixel( hdc, i * 2, 60 + 0 ); /* retrieve value set with R2_COPYPEN */ - ok( s == g, "got %08x and %08x\n", s, g ); + ok( s == g, "got %08lx and %08lx\n", s, g ); }
SetROP2( hdc, R2_COPYPEN ); @@ -2699,11 +2699,11 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) { s = SetPixel( hdc, i * 2, 80 + j, (j << 24) | RGB( (i & 0x07) << 5, (i & 0x38) << 2, i & 0xc0 )); g = GetPixel( hdc, i * 2, 80 + j ); - ok( s == g, "got %08x and %08x\n", s, g ); + ok( s == g, "got %08lx and %08lx\n", s, g );
s = SetPixel( hdc, i * 2 + 1, 80 + j, (j << 24) | i ); g = GetPixel( hdc, i * 2 + 1, 80 + j ); - ok( s == g, "got %08x and %08x\n", s, g ); + ok( s == g, "got %08lx and %08lx\n", s, g ); } }
@@ -3176,10 +3176,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_RGB, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_RGB, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
@@ -3205,10 +3205,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0xff0000, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0x00ff00, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0x0000ff, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0xff0000, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0x00ff00, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0x0000ff, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib); SelectPalette( mem_dc, default_palette, FALSE ); @@ -3232,10 +3232,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0x0000ff, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0x00ff00, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0xff0000, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0x0000ff, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0x00ff00, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0xff0000, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
@@ -3258,10 +3258,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0x3ff00000, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0x000ffc00, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0x000003ff, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0x3ff00000, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0x000ffc00, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0x000003ff, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
@@ -3284,10 +3284,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(mem_dc, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0x0003f000, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0x00000fc0, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0x0000003f, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0x0003f000, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0x00000fc0, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0x0000003f, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
@@ -3324,10 +3324,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0x7c00, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0x03e0, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0x001f, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0x7c00, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0x03e0, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0x001f, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
@@ -3349,10 +3349,10 @@ static void test_simple_graphics(void) dib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(dib != NULL, "ret NULL\n"); ok(GetObjectW( dib, sizeof(ds), &ds ), "GetObject failed\n"); - ok(ds.dsBitfields[0] == 0x0f00, "got %08x\n", ds.dsBitfields[0]); - ok(ds.dsBitfields[1] == 0x00f0, "got %08x\n", ds.dsBitfields[1]); - ok(ds.dsBitfields[2] == 0x000f, "got %08x\n", ds.dsBitfields[2]); - ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); + ok(ds.dsBitfields[0] == 0x0f00, "got %08lx\n", ds.dsBitfields[0]); + ok(ds.dsBitfields[1] == 0x00f0, "got %08lx\n", ds.dsBitfields[1]); + ok(ds.dsBitfields[2] == 0x000f, "got %08lx\n", ds.dsBitfields[2]); + ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %lx\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
diff --git a/dlls/gdi32/tests/driver.c b/dlls/gdi32/tests/driver.c index 54144c44e1c..3d25eacacd9 100644 --- a/dlls/gdi32/tests/driver.c +++ b/dlls/gdi32/tests/driver.c @@ -68,15 +68,15 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void)
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Invalid parameters */ status = pD3DKMTOpenAdapterFromGdiDisplayName(NULL); - ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#lx.\n", status);
memset(&open_adapter_gdi_desc, 0, sizeof(open_adapter_gdi_desc)); status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc); - ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#lx.\n", status);
/* Open adapter */ for (i = 0; EnumDisplayDevicesW(NULL, i, &display_device, 0); ++i) @@ -84,10 +84,10 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void) lstrcpyW(open_adapter_gdi_desc.DeviceName, display_device.DeviceName); status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc); if (display_device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); else { - ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_UNSUCCESSFUL, "Got unexpected return code %#lx.\n", status); continue; }
@@ -97,7 +97,7 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void)
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); } }
@@ -128,7 +128,7 @@ static void test_D3DKMTOpenAdapterFromHdc(void) win_skip("D3DKMTOpenAdapterFromHdc() is not supported.\n"); return; } - todo_wine ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + todo_wine ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
/* Open adapter */ for (i = 0; EnumDisplayDevicesW(NULL, i, &display_device, 0); ++i) @@ -141,7 +141,7 @@ static void test_D3DKMTOpenAdapterFromHdc(void) hdc = CreateDCW(0, display_device.DeviceName, 0, NULL); open_adapter_hdc_desc.hDc = hdc; status = pD3DKMTOpenAdapterFromHdc(&open_adapter_hdc_desc); - todo_wine ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + todo_wine ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); todo_wine ok(open_adapter_hdc_desc.hAdapter, "Expect not null.\n"); DeleteDC(hdc);
@@ -149,7 +149,7 @@ static void test_D3DKMTOpenAdapterFromHdc(void) { close_adapter_desc.hAdapter = open_adapter_hdc_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); } }
@@ -159,12 +159,12 @@ static void test_D3DKMTOpenAdapterFromHdc(void) status = pD3DKMTOpenAdapterFromHdc(&open_adapter_hdc_desc); ReleaseDC(0, hdc); todo_wine ok(status == (adapter_count > 1 ? STATUS_INVALID_PARAMETER : STATUS_SUCCESS), - "Got unexpected return code %#x.\n", status); + "Got unexpected return code %#lx.\n", status); if (status == STATUS_SUCCESS) { close_adapter_desc.hAdapter = open_adapter_hdc_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); } }
@@ -181,11 +181,11 @@ static void test_D3DKMTCloseAdapter(void)
/* Invalid parameters */ status = pD3DKMTCloseAdapter(NULL); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&close_adapter_desc, 0, sizeof(close_adapter_desc)); status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status); }
static void test_D3DKMTCreateDevice(void) @@ -204,20 +204,20 @@ static void test_D3DKMTCreateDevice(void)
/* Invalid parameters */ status = pD3DKMTCreateDevice(NULL); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&create_device_desc, 0, sizeof(create_device_desc)); status = pD3DKMTCreateDevice(&create_device_desc); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
lstrcpyW(open_adapter_gdi_desc.DeviceName, display1W); status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Create device */ create_device_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCreateDevice(&create_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); ok(create_device_desc.hDevice, "Expect not null.\n"); ok(create_device_desc.pCommandBuffer == NULL, "Expect null.\n"); ok(create_device_desc.CommandBufferSize == 0, "Got wrong value %#x.\n", create_device_desc.CommandBufferSize); @@ -228,11 +228,11 @@ static void test_D3DKMTCreateDevice(void)
destroy_device_desc.hDevice = create_device_desc.hDevice; status = pD3DKMTDestroyDevice(&destroy_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); }
static void test_D3DKMTDestroyDevice(void) @@ -248,11 +248,11 @@ static void test_D3DKMTDestroyDevice(void)
/* Invalid parameters */ status = pD3DKMTDestroyDevice(NULL); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&destroy_device_desc, 0, sizeof(destroy_device_desc)); status = pD3DKMTDestroyDevice(&destroy_device_desc); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status); }
static void test_D3DKMTCheckVidPnExclusiveOwnership(void) @@ -384,21 +384,21 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
/* Invalid parameters */ status = pD3DKMTCheckVidPnExclusiveOwnership(NULL); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
memset(&check_owner_desc, 0, sizeof(check_owner_desc)); status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
/* Test cases */ lstrcpyW(open_adapter_gdi_desc.DeviceName, display1W); status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
memset(&create_device_desc, 0, sizeof(create_device_desc)); create_device_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCreateDevice(&create_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter; check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId; @@ -424,7 +424,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) (status == STATUS_INVALID_PARAMETER && tests1[i].owner_type == D3DKMT_VIDPNSOURCEOWNER_EMULATED) || (status == STATUS_SUCCESS && tests1[i].owner_type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE && tests1[i - 1].owner_type == D3DKMT_VIDPNSOURCEOWNER_EMULATED), - "Got unexpected return code %#x at test %d.\n", status, i); + "Got unexpected return code %#lx at test %d.\n", status, i);
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); /* If don't sleep, D3DKMTCheckVidPnExclusiveOwnership may get STATUS_GRAPHICS_PRESENT_UNOCCLUDED instead @@ -443,14 +443,14 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) || (status == STATUS_GRAPHICS_PRESENT_OCCLUDED /* win8 */ && tests1[i].owner_type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE && tests1[i - 1].owner_type == D3DKMT_VIDPNSOURCEOWNER_EMULATED), - "Got unexpected return code %#x at test %d.\n", status, i); + "Got unexpected return code %#lx at test %d.\n", status, i); }
/* Set owner and unset owner using different devices */ memset(&create_device_desc2, 0, sizeof(create_device_desc2)); create_device_desc2.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCreateDevice(&create_device_desc2); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Set owner with the first device */ set_owner_desc.hDevice = create_device_desc.hDevice; @@ -459,9 +459,9 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) set_owner_desc.pVidPnSourceId = &open_adapter_gdi_desc.VidPnSourceId; set_owner_desc.VidPnSourceCount = 1; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); - ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Unset owner with the second device */ set_owner_desc.hDevice = create_device_desc2.hDevice; @@ -469,10 +469,10 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) set_owner_desc.pVidPnSourceId = NULL; set_owner_desc.VidPnSourceCount = 0; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); /* No effect */ - ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Unset owner with the first device */ set_owner_desc.hDevice = create_device_desc.hDevice; @@ -480,10 +480,10 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) set_owner_desc.pVidPnSourceId = NULL; set_owner_desc.VidPnSourceCount = 0; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); /* Proves that the correct device is needed to unset owner */ - ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#x.\n", + ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Set owner with the first device, set owner again with the second device */ @@ -504,7 +504,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) ok(status == tests2[i].expected_set_status1 || (status == STATUS_INVALID_PARAMETER /* win8 */ && tests2[i].set_owner_type1 == D3DKMT_VIDPNSOURCEOWNER_EMULATED), - "Got unexpected return code %#x at test %d.\n", status, i); + "Got unexpected return code %#lx at test %d.\n", status, i); }
if (tests2[i].set_owner_type2 != -1) @@ -520,7 +520,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) && tests2[i].set_owner_type2 == D3DKMT_VIDPNSOURCEOWNER_EMULATED) || (status == STATUS_SUCCESS && tests2[i].set_owner_type1 == D3DKMT_VIDPNSOURCEOWNER_EMULATED && tests2[i].set_owner_type2 == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE), - "Got unexpected return code %#x at test %d.\n", status, i); + "Got unexpected return code %#lx at test %d.\n", status, i); }
status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); @@ -538,7 +538,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) || (status == STATUS_GRAPHICS_PRESENT_OCCLUDED /* win8 */ && tests2[i].set_owner_type2 == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE && tests2[i].set_owner_type1 == D3DKMT_VIDPNSOURCEOWNER_EMULATED), - "Got unexpected return code %#x at test %d.\n", status, i); + "Got unexpected return code %#lx at test %d.\n", status, i);
/* Unset owner with first device */ if (tests2[i].set_owner_type1 != -1) @@ -548,7 +548,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) set_owner_desc.pVidPnSourceId = NULL; set_owner_desc.VidPnSourceCount = 0; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x at test %d.\n", status, i); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx at test %d.\n", status, i); }
/* Unset owner with second device */ @@ -559,7 +559,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) set_owner_desc.pVidPnSourceId = NULL; set_owner_desc.VidPnSourceCount = 0; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x at test %d.\n", status, i); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx at test %d.\n", status, i); } }
@@ -570,11 +570,11 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) set_owner_desc.pVidPnSourceId = &open_adapter_gdi_desc.VidPnSourceId; set_owner_desc.VidPnSourceCount = 1; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
destroy_device_desc.hDevice = create_device_desc.hDevice; status = pD3DKMTDestroyDevice(&destroy_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
set_owner_desc.hDevice = create_device_desc2.hDevice; owner_type = D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE; @@ -584,15 +584,15 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void) status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); /* So ownership is released when device is destroyed. otherwise the return code should be * STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE */ - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
destroy_device_desc.hDevice = create_device_desc2.hDevice; status = pD3DKMTDestroyDevice(&destroy_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); }
static void test_D3DKMTSetVidPnSourceOwner(void) @@ -608,7 +608,7 @@ static void test_D3DKMTSetVidPnSourceOwner(void)
/* Invalid parameters */ status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status); }
static void test_D3DKMTCheckOcclusion(void) @@ -635,31 +635,31 @@ static void test_D3DKMTCheckOcclusion(void)
/* NULL parameter check */ status = pD3DKMTCheckOcclusion(NULL); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = NULL; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#lx.\n", status);
hwnd = CreateWindowA("static", "static1", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, 0); ok(hwnd != NULL, "Failed to create window.\n");
occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Minimized state doesn't affect D3DKMTCheckOcclusion */ ShowWindow(hwnd, SW_MINIMIZE); occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); ShowWindow(hwnd, SW_SHOWNORMAL);
/* Invisible state doesn't affect D3DKMTCheckOcclusion */ ShowWindow(hwnd, SW_HIDE); occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); ShowWindow(hwnd, SW_SHOW);
/* hwnd2 covers hwnd */ @@ -668,11 +668,11 @@ static void test_D3DKMTCheckOcclusion(void)
occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = hwnd2; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
/* Composition doesn't affect D3DKMTCheckOcclusion */ if (pDwmEnableComposition) @@ -683,22 +683,22 @@ static void test_D3DKMTCheckOcclusion(void) occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); /* This result means that D3DKMTCheckOcclusion doesn't check composition status despite MSDN says it will */ - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = hwnd2; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
ShowWindow(hwnd, SW_MINIMIZE); occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); ShowWindow(hwnd, SW_SHOWNORMAL);
ShowWindow(hwnd, SW_HIDE); occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); ShowWindow(hwnd, SW_SHOW);
hr = pDwmEnableComposition(DWM_EC_ENABLECOMPOSITION); @@ -709,19 +709,19 @@ static void test_D3DKMTCheckOcclusion(void)
lstrcpyW(open_adapter_gdi_desc.DeviceName, display1W); status = pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
memset(&create_device_desc, 0, sizeof(create_device_desc)); create_device_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCreateDevice(&create_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter; check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId; status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); /* D3DKMTCheckVidPnExclusiveOwnership gets STATUS_GRAPHICS_PRESENT_UNOCCLUDED sometimes and with some delay, * it will always return STATUS_SUCCESS. So there are some timing issues here. */ - ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Test D3DKMTCheckOcclusion relationship with video present source owner */ set_owner_desc.hDevice = create_device_desc.hDevice; @@ -730,7 +730,7 @@ static void test_D3DKMTCheckOcclusion(void) set_owner_desc.pVidPnSourceId = &open_adapter_gdi_desc.VidPnSourceId; set_owner_desc.VidPnSourceCount = 1; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
for (i = 0; EnumDisplayDevicesW(NULL, i, &display_device, 0); ++i) { @@ -742,31 +742,31 @@ static void test_D3DKMTCheckOcclusion(void)
occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status); + ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
/* Note hwnd2 is not actually occluded but D3DKMTCheckOcclusion reports STATUS_GRAPHICS_PRESENT_OCCLUDED as well */ SetWindowPos(hwnd2, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); ShowWindow(hwnd2, SW_SHOW); occlusion_desc.hWnd = hwnd2; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status); + ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
/* Now hwnd is HWND_TOPMOST. Still reports STATUS_GRAPHICS_PRESENT_OCCLUDED */ ok(SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE), "Failed to SetWindowPos.\n"); ok(GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "No WS_EX_TOPMOST style.\n"); occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status); + ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
DestroyWindow(hwnd2); occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == expected_occlusion, "Got unexpected return code %#x.\n", status); + ok(status == expected_occlusion, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter; check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId; status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); - ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_GRAPHICS_PRESENT_OCCLUDED, "Got unexpected return code %#lx.\n", status);
/* Unset video present source owner */ set_owner_desc.hDevice = create_device_desc.hDevice; @@ -774,24 +774,24 @@ static void test_D3DKMTCheckOcclusion(void) set_owner_desc.pVidPnSourceId = NULL; set_owner_desc.VidPnSourceCount = 0; status = pD3DKMTSetVidPnSourceOwner(&set_owner_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
occlusion_desc.hWnd = hwnd; status = pD3DKMTCheckOcclusion(&occlusion_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
check_owner_desc.hAdapter = open_adapter_gdi_desc.hAdapter; check_owner_desc.VidPnSourceId = open_adapter_gdi_desc.VidPnSourceId; status = pD3DKMTCheckVidPnExclusiveOwnership(&check_owner_desc); - ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS || status == STATUS_GRAPHICS_PRESENT_UNOCCLUDED, "Got unexpected return code %#lx.\n", status);
destroy_device_desc.hDevice = create_device_desc.hDevice; status = pD3DKMTDestroyDevice(&destroy_device_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status);
close_adapter_desc.hAdapter = open_adapter_gdi_desc.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(status == STATUS_SUCCESS, "Got unexpected return code %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected return code %#lx.\n", status); DestroyWindow(hwnd); }
@@ -812,7 +812,7 @@ static void test_D3DKMTOpenAdapterFromDeviceName_deviface(const GUID *devinterfa BOOL ret;
set = SetupDiGetClassDevsW(devinterface_guid, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); - ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevs failed, error %u.\n", GetLastError()); + ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevs failed, error %lu.\n", GetLastError());
iface_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_W *)iface_detail_buffer; iface_data->cbSize = sizeof(*iface_data); @@ -823,16 +823,16 @@ static void test_D3DKMTOpenAdapterFromDeviceName_deviface(const GUID *devinterfa { ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, iface_data, sizeof(iface_detail_buffer), NULL, &device_data ); - ok(ret, "Got unexpected ret %d, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %d, GetLastError() %lu.\n", ret, GetLastError());
status = pD3DKMTOpenAdapterFromDeviceName(&device_name); - todo_wine_if(todo) ok(status == expected_status, "Got status %#x, expected %#x.\n", status, expected_status); + todo_wine_if(todo) ok(status == expected_status, "Got status %#lx, expected %#lx.\n", status, expected_status);
if (!status) { ret = SetupDiGetDevicePropertyW(set, &device_data, &DEVPROPKEY_GPU_LUID, &type, (BYTE *)&luid, sizeof(luid), NULL, 0); - ok(ret || GetLastError() == ERROR_NOT_FOUND, "Got unexpected ret %d, GetLastError() %u.\n", + ok(ret || GetLastError() == ERROR_NOT_FOUND, "Got unexpected ret %d, GetLastError() %lu.\n", ret, GetLastError());
if (ret) @@ -847,7 +847,7 @@ static void test_D3DKMTOpenAdapterFromDeviceName_deviface(const GUID *devinterfa
close_adapter_desc.hAdapter = device_name.hAdapter; status = pD3DKMTCloseAdapter(&close_adapter_desc); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); } ++i; } @@ -871,11 +871,11 @@ static void test_D3DKMTOpenAdapterFromDeviceName(void) win_skip("D3DKMTOpenAdapterFromDeviceName() is not supported.\n"); return; } - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status);
memset(&device_name, 0, sizeof(device_name)); status = pD3DKMTOpenAdapterFromDeviceName(&device_name); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status);
winetest_push_context("GUID_DEVINTERFACE_DISPLAY_ADAPTER"); test_D3DKMTOpenAdapterFromDeviceName_deviface(&GUID_DEVINTERFACE_DISPLAY_ADAPTER, STATUS_INVALID_PARAMETER, TRUE); diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index bc626d284ca..79de251dc59 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -174,11 +174,11 @@ static void check_font(const char* test, const LOGFONTA* lf, HFONT hfont)
ret = GetObjectA(hfont, sizeof(getobj_lf), &getobj_lf); ok(ret == sizeof(LOGFONTA), "%s: GetObject returned %d\n", test, ret); - ok(lf->lfHeight == getobj_lf.lfHeight, "lfHeight: expect %08x got %08x\n", lf->lfHeight, getobj_lf.lfHeight); - ok(lf->lfWidth == getobj_lf.lfWidth, "lfWidth: expect %08x got %08x\n", lf->lfWidth, getobj_lf.lfWidth); - ok(lf->lfEscapement == getobj_lf.lfEscapement, "lfEscapement: expect %08x got %08x\n", lf->lfEscapement, getobj_lf.lfEscapement); - ok(lf->lfOrientation == getobj_lf.lfOrientation, "lfOrientation: expect %08x got %08x\n", lf->lfOrientation, getobj_lf.lfOrientation); - ok(lf->lfWeight == getobj_lf.lfWeight, "lfWeight: expect %08x got %08x\n", lf->lfWeight, getobj_lf.lfWeight); + ok(lf->lfHeight == getobj_lf.lfHeight, "lfHeight: expect %08lx got %08lx\n", lf->lfHeight, getobj_lf.lfHeight); + ok(lf->lfWidth == getobj_lf.lfWidth, "lfWidth: expect %08lx got %08lx\n", lf->lfWidth, getobj_lf.lfWidth); + ok(lf->lfEscapement == getobj_lf.lfEscapement, "lfEscapement: expect %08lx got %08lx\n", lf->lfEscapement, getobj_lf.lfEscapement); + ok(lf->lfOrientation == getobj_lf.lfOrientation, "lfOrientation: expect %08lx got %08lx\n", lf->lfOrientation, getobj_lf.lfOrientation); + ok(lf->lfWeight == getobj_lf.lfWeight, "lfWeight: expect %08lx got %08lx\n", lf->lfWeight, getobj_lf.lfWeight); ok(lf->lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf->lfItalic, getobj_lf.lfItalic); ok(lf->lfUnderline == getobj_lf.lfUnderline, "lfUnderline: expect %02x got %02x\n", lf->lfUnderline, getobj_lf.lfUnderline); ok(lf->lfStrikeOut == getobj_lf.lfStrikeOut, "lfStrikeOut: expect %02x got %02x\n", lf->lfStrikeOut, getobj_lf.lfStrikeOut); @@ -240,17 +240,17 @@ static INT CALLBACK font_enum_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
static void compare_tm(const TEXTMETRICA *tm, const TEXTMETRICA *otm) { - ok(tm->tmHeight == otm->tmHeight, "tmHeight %d != %d\n", tm->tmHeight, otm->tmHeight); - ok(tm->tmAscent == otm->tmAscent, "tmAscent %d != %d\n", tm->tmAscent, otm->tmAscent); - ok(tm->tmDescent == otm->tmDescent, "tmDescent %d != %d\n", tm->tmDescent, otm->tmDescent); - ok(tm->tmInternalLeading == otm->tmInternalLeading, "tmInternalLeading %d != %d\n", tm->tmInternalLeading, otm->tmInternalLeading); - ok(tm->tmExternalLeading == otm->tmExternalLeading, "tmExternalLeading %d != %d\n", tm->tmExternalLeading, otm->tmExternalLeading); - ok(tm->tmAveCharWidth == otm->tmAveCharWidth, "tmAveCharWidth %d != %d\n", tm->tmAveCharWidth, otm->tmAveCharWidth); - ok(tm->tmMaxCharWidth == otm->tmMaxCharWidth, "tmMaxCharWidth %d != %d\n", tm->tmMaxCharWidth, otm->tmMaxCharWidth); - ok(tm->tmWeight == otm->tmWeight, "tmWeight %d != %d\n", tm->tmWeight, otm->tmWeight); - ok(tm->tmOverhang == otm->tmOverhang, "tmOverhang %d != %d\n", tm->tmOverhang, otm->tmOverhang); - ok(tm->tmDigitizedAspectX == otm->tmDigitizedAspectX, "tmDigitizedAspectX %d != %d\n", tm->tmDigitizedAspectX, otm->tmDigitizedAspectX); - ok(tm->tmDigitizedAspectY == otm->tmDigitizedAspectY, "tmDigitizedAspectY %d != %d\n", tm->tmDigitizedAspectY, otm->tmDigitizedAspectY); + ok(tm->tmHeight == otm->tmHeight, "tmHeight %ld != %ld\n", tm->tmHeight, otm->tmHeight); + ok(tm->tmAscent == otm->tmAscent, "tmAscent %ld != %ld\n", tm->tmAscent, otm->tmAscent); + ok(tm->tmDescent == otm->tmDescent, "tmDescent %ld != %ld\n", tm->tmDescent, otm->tmDescent); + ok(tm->tmInternalLeading == otm->tmInternalLeading, "tmInternalLeading %ld != %ld\n", tm->tmInternalLeading, otm->tmInternalLeading); + ok(tm->tmExternalLeading == otm->tmExternalLeading, "tmExternalLeading %ld != %ld\n", tm->tmExternalLeading, otm->tmExternalLeading); + ok(tm->tmAveCharWidth == otm->tmAveCharWidth, "tmAveCharWidth %ld != %ld\n", tm->tmAveCharWidth, otm->tmAveCharWidth); + ok(tm->tmMaxCharWidth == otm->tmMaxCharWidth, "tmMaxCharWidth %ld != %ld\n", tm->tmMaxCharWidth, otm->tmMaxCharWidth); + ok(tm->tmWeight == otm->tmWeight, "tmWeight %ld != %ld\n", tm->tmWeight, otm->tmWeight); + ok(tm->tmOverhang == otm->tmOverhang, "tmOverhang %ld != %ld\n", tm->tmOverhang, otm->tmOverhang); + ok(tm->tmDigitizedAspectX == otm->tmDigitizedAspectX, "tmDigitizedAspectX %ld != %ld\n", tm->tmDigitizedAspectX, otm->tmDigitizedAspectX); + ok(tm->tmDigitizedAspectY == otm->tmDigitizedAspectY, "tmDigitizedAspectY %ld != %ld\n", tm->tmDigitizedAspectY, otm->tmDigitizedAspectY); ok(tm->tmFirstChar == otm->tmFirstChar, "tmFirstChar %d != %d\n", tm->tmFirstChar, otm->tmFirstChar); ok(tm->tmLastChar == otm->tmLastChar, "tmLastChar %d != %d\n", tm->tmLastChar, otm->tmLastChar); ok(tm->tmDefaultChar == otm->tmDefaultChar, "tmDefaultChar %d != %d\n", tm->tmDefaultChar, otm->tmDefaultChar); @@ -308,14 +308,14 @@ static void test_font_metrics(const char *context, tm = otm.otmTextMetrics; if (0) /* these metrics are scaled too, but with rounding errors */ { - ok(otm.otmAscent == tm.tmAscent, "ascent %d != %d\n", otm.otmAscent, tm.tmAscent); - ok(otm.otmDescent == -tm.tmDescent, "descent %d != %d\n", otm.otmDescent, -tm.tmDescent); + ok(otm.otmAscent == tm.tmAscent, "ascent %d != %ld\n", otm.otmAscent, tm.tmAscent); + ok(otm.otmDescent == -tm.tmDescent, "descent %d != %ld\n", otm.otmDescent, -tm.tmDescent); } - ok(otm.otmMacAscent == tm.tmAscent, "ascent %d != %d\n", otm.otmMacAscent, tm.tmAscent); + ok(otm.otmMacAscent == tm.tmAscent, "ascent %d != %ld\n", otm.otmMacAscent, tm.tmAscent); ok(otm.otmDescent < 0, "otm.otmDescent should be < 0\n"); ok(otm.otmMacDescent < 0, "otm.otmMacDescent should be < 0\n"); ok(tm.tmDescent > 0, "tm.tmDescent should be > 0\n"); - ok(otm.otmMacDescent == -tm.tmDescent, "descent %d != %d\n", otm.otmMacDescent, -tm.tmDescent); + ok(otm.otmMacDescent == -tm.tmDescent, "descent %d != %ld\n", otm.otmMacDescent, -tm.tmDescent); if (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE) ok(otm.otmEMSquare == 2048, "expected 2048, got %d\n", otm.otmEMSquare); } @@ -327,27 +327,27 @@ if (0) /* these metrics are scaled too, but with rounding errors */
cx = tm.tmAveCharWidth / tm_orig->tmAveCharWidth; cy = tm.tmHeight / tm_orig->tmHeight; - ok(cx == scale_x && cy == scale_y, "height %d: expected scale_x %d, scale_y %d, got cx %d, cy %d\n", + ok(cx == scale_x && cy == scale_y, "height %ld: expected scale_x %d, scale_y %d, got cx %d, cy %d\n", lfHeight, scale_x, scale_y, cx, cy); - ok(tm.tmHeight == tm_orig->tmHeight * scale_y, "height %d != %d\n", tm.tmHeight, tm_orig->tmHeight * scale_y); - ok(tm.tmAscent == tm_orig->tmAscent * scale_y, "ascent %d != %d\n", tm.tmAscent, tm_orig->tmAscent * scale_y); - ok(tm.tmDescent == tm_orig->tmDescent * scale_y, "descent %d != %d\n", tm.tmDescent, tm_orig->tmDescent * scale_y); - ok(near_match(tm.tmAveCharWidth, tm_orig->tmAveCharWidth * scale_x), "ave width %d != %d\n", tm.tmAveCharWidth, tm_orig->tmAveCharWidth * scale_x); - ok(near_match(tm.tmMaxCharWidth, tm_orig->tmMaxCharWidth * scale_x), "max width %d != %d\n", tm.tmMaxCharWidth, tm_orig->tmMaxCharWidth * scale_x); + ok(tm.tmHeight == tm_orig->tmHeight * scale_y, "height %ld != %ld\n", tm.tmHeight, tm_orig->tmHeight * scale_y); + ok(tm.tmAscent == tm_orig->tmAscent * scale_y, "ascent %ld != %ld\n", tm.tmAscent, tm_orig->tmAscent * scale_y); + ok(tm.tmDescent == tm_orig->tmDescent * scale_y, "descent %ld != %ld\n", tm.tmDescent, tm_orig->tmDescent * scale_y); + ok(near_match(tm.tmAveCharWidth, tm_orig->tmAveCharWidth * scale_x), "ave width %ld != %ld\n", tm.tmAveCharWidth, tm_orig->tmAveCharWidth * scale_x); + ok(near_match(tm.tmMaxCharWidth, tm_orig->tmMaxCharWidth * scale_x), "max width %ld != %ld\n", tm.tmMaxCharWidth, tm_orig->tmMaxCharWidth * scale_x);
- ok(lf.lfHeight == lfHeight, "lfHeight %d != %d\n", lf.lfHeight, lfHeight); + ok(lf.lfHeight == lfHeight, "lfHeight %ld != %ld\n", lf.lfHeight, lfHeight); if (lf.lfHeight) { if (lf.lfWidth) - ok(lf.lfWidth == tm.tmAveCharWidth, "lfWidth %d != tm %d\n", lf.lfWidth, tm.tmAveCharWidth); + ok(lf.lfWidth == tm.tmAveCharWidth, "lfWidth %ld != tm %ld\n", lf.lfWidth, tm.tmAveCharWidth); } else - ok(lf.lfWidth == lfWidth, "lfWidth %d != %d\n", lf.lfWidth, lfWidth); + ok(lf.lfWidth == lfWidth, "lfWidth %ld != %ld\n", lf.lfWidth, lfWidth);
GetTextExtentPoint32A(hdc, test_str, test_str_len, &size);
- ok(near_match(size.cx, size_orig->cx * scale_x), "cx %d != %d\n", size.cx, size_orig->cx * scale_x); - ok(size.cy == size_orig->cy * scale_y, "cy %d != %d\n", size.cy, size_orig->cy * scale_y); + ok(near_match(size.cx, size_orig->cx * scale_x), "cx %ld != %ld\n", size.cx, size_orig->cx * scale_x); + ok(size.cy == size_orig->cy * scale_y, "cy %ld != %ld\n", size.cy, size_orig->cy * scale_y);
GetCharWidthA(hdc, 'A', 'A', &width_of_A);
@@ -377,7 +377,7 @@ static void test_bitmap_font(void) return; }
- trace("found bitmap font %s, height %d\n", bitmap_lf.lfFaceName, bitmap_lf.lfHeight); + trace("found bitmap font %s, height %ld\n", bitmap_lf.lfFaceName, bitmap_lf.lfHeight);
height_orig = bitmap_lf.lfHeight; lfWidth = bitmap_lf.lfWidth; @@ -536,14 +536,14 @@ static void test_outline_font(void) memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); ok(gm.gmCellIncX == width_orig, "incX %d != %d\n", gm.gmCellIncX, width_orig); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY); /* with a custom matrix */ memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat2); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); ok(gm.gmCellIncX == width_orig/2, "incX %d != %d\n", gm.gmCellIncX, width_orig/2); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY);
@@ -606,7 +606,7 @@ static void test_outline_font(void)
SetLastError(0xdeadbeef); ret = SetWorldTransform(hdc, &xform); - ok(ret, "SetWorldTransform error %u\n", GetLastError()); + ok(ret, "SetWorldTransform error %lu\n", GetLastError());
test_font_metrics("xform", hdc, hfont, lf.lfHeight, lf.lfWidth, test_str, sizeof(test_str), &otm.otmTextMetrics, &size_orig, width_orig, 1, 1);
@@ -614,26 +614,26 @@ static void test_outline_font(void) memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); pt.x = width_orig; pt.y = 0; LPtoDP(hdc, &pt, 1); - ok(gm.gmCellIncX == pt.x, "incX %d != %d\n", gm.gmCellIncX, pt.x); + ok(gm.gmCellIncX == pt.x, "incX %d != %ld\n", gm.gmCellIncX, pt.x); ok(gm.gmCellIncX == 20 * width_orig, "incX %d != %d\n", gm.gmCellIncX, 20 * width_orig); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY); /* with a custom matrix */ memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat2); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); pt.x = width_orig; pt.y = 0; LPtoDP(hdc, &pt, 1); - ok(gm.gmCellIncX == pt.x/2, "incX %d != %d\n", gm.gmCellIncX, pt.x/2); + ok(gm.gmCellIncX == pt.x/2, "incX %d != %ld\n", gm.gmCellIncX, pt.x/2); ok(near_match(gm.gmCellIncX, 10 * width_orig), "incX %d != %d\n", gm.gmCellIncX, 10 * width_orig); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY);
SetLastError(0xdeadbeef); ret = SetMapMode(hdc, MM_LOMETRIC); - ok(ret == MM_TEXT, "expected MM_TEXT, got %d, error %u\n", ret, GetLastError()); + ok(ret == MM_TEXT, "expected MM_TEXT, got %d, error %lu\n", ret, GetLastError());
test_font_metrics("lometric", hdc, hfont, lf.lfHeight, lf.lfWidth, test_str, sizeof(test_str), &otm.otmTextMetrics, &size_orig, width_orig, 1, 1);
@@ -641,24 +641,24 @@ static void test_outline_font(void) memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); pt.x = width_orig; pt.y = 0; LPtoDP(hdc, &pt, 1); - ok(near_match(gm.gmCellIncX, pt.x), "incX %d != %d\n", gm.gmCellIncX, pt.x); + ok(near_match(gm.gmCellIncX, pt.x), "incX %d != %ld\n", gm.gmCellIncX, pt.x); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY); /* with a custom matrix */ memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat2); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); pt.x = width_orig; pt.y = 0; LPtoDP(hdc, &pt, 1); - ok(near_match(gm.gmCellIncX, (pt.x + 1)/2), "incX %d != %d\n", gm.gmCellIncX, (pt.x + 1)/2); + ok(near_match(gm.gmCellIncX, (pt.x + 1)/2), "incX %d != %ld\n", gm.gmCellIncX, (pt.x + 1)/2); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY);
SetLastError(0xdeadbeef); ret = SetMapMode(hdc, MM_TEXT); - ok(ret == MM_LOMETRIC, "expected MM_LOMETRIC, got %d, error %u\n", ret, GetLastError()); + ok(ret == MM_LOMETRIC, "expected MM_LOMETRIC, got %d, error %lu\n", ret, GetLastError());
test_font_metrics("text", hdc, hfont, lf.lfHeight, lf.lfWidth, test_str, sizeof(test_str), &otm.otmTextMetrics, &size_orig, width_orig, 1, 1);
@@ -666,20 +666,20 @@ static void test_outline_font(void) memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); pt.x = width_orig; pt.y = 0; LPtoDP(hdc, &pt, 1); - ok(gm.gmCellIncX == pt.x, "incX %d != %d\n", gm.gmCellIncX, pt.x); + ok(gm.gmCellIncX == pt.x, "incX %d != %ld\n", gm.gmCellIncX, pt.x); ok(gm.gmCellIncX == 20 * width_orig, "incX %d != %d\n", gm.gmCellIncX, 20 * width_orig); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY); /* with a custom matrix */ memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat2); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %d\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %ld\n", GetLastError()); pt.x = width_orig; pt.y = 0; LPtoDP(hdc, &pt, 1); - ok(gm.gmCellIncX == pt.x/2, "incX %d != %d\n", gm.gmCellIncX, pt.x/2); + ok(gm.gmCellIncX == pt.x/2, "incX %d != %ld\n", gm.gmCellIncX, pt.x/2); ok(gm.gmCellIncX == 10 * width_orig, "incX %d != %d\n", gm.gmCellIncX, 10 * width_orig); ok(gm.gmCellIncY == 0, "incY %d != 0\n", gm.gmCellIncY);
@@ -930,7 +930,7 @@ static void test_bitmap_font_metrics(void) if (font_res == fd[i].dpi && lf.lfCharSet == expected_cs) { todo_wine_if (ret) /* FIXME: Remove once Wine is fixed */ - ok(!ret, "%s height %d charset %d dpi %d should be enumerated\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi); + ok(!ret, "%s height %ld charset %d dpi %d should be enumerated\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi); } } if (ret && !(fd[i].height & FH_SCALE)) @@ -941,7 +941,7 @@ static void test_bitmap_font_metrics(void)
SetLastError(0xdeadbeef); ret = GetTextFaceA(hdc, sizeof(face_name), face_name); - ok(ret, "GetTextFace error %u\n", GetLastError()); + ok(ret, "GetTextFace error %lu\n", GetLastError());
if (strcmp(face_name, fd[i].face_name) != 0) { @@ -961,7 +961,7 @@ static void test_bitmap_font_metrics(void) ok(ret == ERROR_CAN_NOT_COMPLETE || ret == 0xdeadbeef /* Win10 */, "Unexpected error %d.\n", ret);
bRet = GetTextMetricsA(hdc, &tm); - ok(bRet, "GetTextMetrics error %d\n", GetLastError()); + ok(bRet, "GetTextMetrics error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetTextCharset(hdc); @@ -983,16 +983,16 @@ static void test_bitmap_font_metrics(void) } if (!skipme) { - ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %d != %d\n", fd[i].face_name, height, tm.tmWeight, fd[i].weight); + ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %ld != %d\n", fd[i].face_name, height, tm.tmWeight, fd[i].weight); if (fd[i].height & FH_SCALE) - ok(tm.tmHeight == fd[i].scaled_height, "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, height, tm.tmHeight, fd[i].scaled_height); + ok(tm.tmHeight == fd[i].scaled_height, "%s(%d): tm.tmHeight %ld != %d\n", fd[i].face_name, height, tm.tmHeight, fd[i].scaled_height); else - ok(tm.tmHeight == fd[i].height, "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, fd[i].height, tm.tmHeight, fd[i].height); - ok(tm.tmAscent == fd[i].ascent, "%s(%d): tm.tmAscent %d != %d\n", fd[i].face_name, height, tm.tmAscent, fd[i].ascent); - ok(tm.tmDescent == fd[i].descent, "%s(%d): tm.tmDescent %d != %d\n", fd[i].face_name, height, tm.tmDescent, fd[i].descent); - ok(tm.tmInternalLeading == fd[i].int_leading, "%s(%d): tm.tmInternalLeading %d != %d\n", fd[i].face_name, height, tm.tmInternalLeading, fd[i].int_leading); - ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %d != %d\n", fd[i].face_name, height, tm.tmExternalLeading, fd[i].ext_leading); - ok(tm.tmAveCharWidth == fd[i].ave_char_width, "%s(%d): tm.tmAveCharWidth %d != %d\n", fd[i].face_name, height, tm.tmAveCharWidth, fd[i].ave_char_width); + ok(tm.tmHeight == fd[i].height, "%s(%d): tm.tmHeight %ld != %d\n", fd[i].face_name, fd[i].height, tm.tmHeight, fd[i].height); + ok(tm.tmAscent == fd[i].ascent, "%s(%d): tm.tmAscent %ld != %d\n", fd[i].face_name, height, tm.tmAscent, fd[i].ascent); + ok(tm.tmDescent == fd[i].descent, "%s(%d): tm.tmDescent %ld != %d\n", fd[i].face_name, height, tm.tmDescent, fd[i].descent); + ok(tm.tmInternalLeading == fd[i].int_leading, "%s(%d): tm.tmInternalLeading %ld != %d\n", fd[i].face_name, height, tm.tmInternalLeading, fd[i].int_leading); + ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %ld != %d\n", fd[i].face_name, height, tm.tmExternalLeading, fd[i].ext_leading); + ok(tm.tmAveCharWidth == fd[i].ave_char_width, "%s(%d): tm.tmAveCharWidth %ld != %d\n", fd[i].face_name, height, tm.tmAveCharWidth, fd[i].ave_char_width); ok(tm.tmFirstChar == fd[i].first_char, "%s(%d): tm.tmFirstChar = %02x\n", fd[i].face_name, height, tm.tmFirstChar); ok(tm.tmLastChar == fd[i].last_char, "%s(%d): tm.tmLastChar = %02x\n", fd[i].face_name, height, tm.tmLastChar); /* Substitutions like MS Sans Serif,0=MS Sans Serif,204 @@ -1005,7 +1005,7 @@ static void test_bitmap_font_metrics(void) /* Don't run the max char width test on System/ANSI_CHARSET. We have extra characters in our font that make the max width bigger */ if ((strcmp(lf.lfFaceName, "System") || lf.lfCharSet != ANSI_CHARSET) && tm.tmDigitizedAspectX == 96) - ok(tm.tmMaxCharWidth == fd[i].max_char_width, "%s(%d): tm.tmMaxCharWidth %d != %d\n", fd[i].face_name, height, tm.tmMaxCharWidth, fd[i].max_char_width); + ok(tm.tmMaxCharWidth == fd[i].max_char_width, "%s(%d): tm.tmMaxCharWidth %ld != %d\n", fd[i].face_name, height, tm.tmMaxCharWidth, fd[i].max_char_width); } else skip("Skipping font metrics test for system langid 0x%x\n", @@ -1040,19 +1040,19 @@ static void test_GdiGetCharDimensions(void) avgwidth = ((size.cx / 26) + 1) / 2;
ret = pGdiGetCharDimensions(hdc, &tm, &height); - ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth, ret); - ok(height == tm.tmHeight, "GdiGetCharDimensions should have set height to %d instead of %d\n", tm.tmHeight, height); + ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth, ret); + ok(height == tm.tmHeight, "GdiGetCharDimensions should have set height to %ld instead of %ld\n", tm.tmHeight, height);
ret = pGdiGetCharDimensions(hdc, &tm, NULL); - ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth, ret); + ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth, ret);
ret = pGdiGetCharDimensions(hdc, NULL, NULL); - ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth, ret); + ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth, ret);
height = 0; ret = pGdiGetCharDimensions(hdc, NULL, &height); - ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth, ret); - ok(height == size.cy, "GdiGetCharDimensions should have set height to %d instead of %d\n", size.cy, height); + ok(ret == avgwidth, "GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth, ret); + ok(height == size.cy, "GdiGetCharDimensions should have set height to %ld instead of %ld\n", size.cy, height);
DeleteDC(hdc); } @@ -1327,7 +1327,7 @@ static void test_GetCharABCWidths(void) ok(ret, "GetCharABCWidthsA should have succeeded at width %d\n", i);
ok(abc[0].abcA == gm.gmptGlyphOrigin.x, - "abcA(%d) and gmptGlyphOrigin.x(%d) values are different at width %d\n", + "abcA(%d) and gmptGlyphOrigin.x(%ld) values are different at width %d\n", abc[0].abcA, gm.gmptGlyphOrigin.x, i); ok(abc[0].abcB == gm.gmBlackBoxX, "abcB(%d) and gmBlackBoxX(%d) values are different at width %d\n", @@ -1420,27 +1420,27 @@ static void test_text_extents(void) GetTextMetricsA(hdc, &tm); ret = GetTextExtentPointA(hdc, "o", 1, &sz); ok(ret, "got %d\n", ret); - ok(sz.cy == tm.tmHeight, "cy %d tmHeight %d\n", sz.cy, tm.tmHeight); + ok(sz.cy == tm.tmHeight, "cy %ld tmHeight %ld\n", sz.cy, tm.tmHeight);
memset(&sz, 0xcc, sizeof(sz)); ret = GetTextExtentPointA(hdc, "o", 0, &sz); ok(ret, "got %d\n", ret); - ok(sz.cx == 0 && sz.cy == 0, "cx %d, cy %d\n", sz.cx, sz.cy); + ok(sz.cx == 0 && sz.cy == 0, "cx %ld, cy %ld\n", sz.cx, sz.cy);
memset(&sz, 0xcc, sizeof(sz)); ret = GetTextExtentPointA(hdc, "", 0, &sz); ok(ret, "got %d\n", ret); - ok(sz.cx == 0 && sz.cy == 0, "cx %d, cy %d\n", sz.cx, sz.cy); + ok(sz.cx == 0 && sz.cy == 0, "cx %ld, cy %ld\n", sz.cx, sz.cy);
memset(&sz, 0xcc, sizeof(sz)); ret = GetTextExtentPointW(hdc, wt, 0, &sz); ok(ret, "got %d\n", ret); - ok(sz.cx == 0 && sz.cy == 0, "cx %d, cy %d\n", sz.cx, sz.cy); + ok(sz.cx == 0 && sz.cy == 0, "cx %ld, cy %ld\n", sz.cx, sz.cy);
memset(&sz, 0xcc, sizeof(sz)); ret = GetTextExtentPointW(hdc, L"", 0, &sz); ok(ret, "got %d\n", ret); - ok(sz.cx == 0 && sz.cy == 0, "cx %d, cy %d\n", sz.cx, sz.cy); + ok(sz.cx == 0 && sz.cy == 0, "cx %ld, cy %ld\n", sz.cx, sz.cy);
len = lstrlenW(wt); extents = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof extents[0]); @@ -1449,7 +1449,7 @@ static void test_text_extents(void) GetTextExtentExPointW(hdc, wt, len, 32767, &fit1, extents, &sz1); GetTextExtentPointW(hdc, wt, len, &sz2); ok(sz1.cy == sz2.cy, - "cy from GetTextExtentExPointW (%d) and GetTextExtentPointW (%d) differ\n", sz1.cy, sz2.cy); + "cy from GetTextExtentExPointW (%ld) and GetTextExtentPointW (%ld) differ\n", sz1.cy, sz2.cy); /* Because of the '\n' in the string GetTextExtentExPoint and GetTextExtentPoint return different widths under Win2k, but under WinXP they return the same width. So we don't test that @@ -1522,12 +1522,12 @@ static void test_text_extents(void) SetMapMode( hdc, MM_HIMETRIC ); ret = GetTextExtentExPointW(hdc, wt, 3, 0, NULL, extents, &sz); ok(ret, "got %d\n", ret); - ok(sz.cx == extents[2], "got %d vs %d\n", sz.cx, extents[2]); + ok(sz.cx == extents[2], "got %ld vs %d\n", sz.cx, extents[2]);
ret = GetTextExtentExPointW(hdc, wt, 3, extents[1], &fit1, extents2, &sz2); ok(ret, "got %d\n", ret); ok(fit1 == 2, "got %d\n", fit1); - ok(sz2.cx == sz.cx, "got %d vs %d\n", sz2.cx, sz.cx); + ok(sz2.cx == sz.cx, "got %ld vs %ld\n", sz2.cx, sz.cx); for(i = 0; i < 2; i++) ok(extents2[i] == extents[i], "%d: %d, %d\n", i, extents2[i], extents[i]);
@@ -1608,11 +1608,11 @@ static void test_GetGlyphIndices(void) { flags |= GGI_MARK_NONEXISTING_GLYPHS; charcount = GetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount); ok((glyphs[4] == 0x001f || glyphs[4] == 0xffff /* Vista */), "GetGlyphIndicesW should have returned a nonexistent char not %04x\n", glyphs[4]); flags = 0; charcount = GetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount); ok(glyphs[4] == textm.tmDefaultChar || glyphs[4] == 0x20 /* CJK Windows */, "GetGlyphIndicesW should have returned a %04x not %04x\n", textm.tmDefaultChar, glyphs[4]); } @@ -1633,13 +1633,13 @@ static void test_GetGlyphIndices(void)
glyphs[0] = glyphs[1] = 0; charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS); - ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount); + ok(charcount == ARRAY_SIZE(c), "got %lu\n", charcount); ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]); ok(glyphs[1] == 0x001f || glyphs[1] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
glyphs[0] = glyphs[1] = 0; charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, 0); - ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount); + ok(charcount == ARRAY_SIZE(c), "got %lu\n", charcount); ok(glyphs[0] == textm.tmDefaultChar || glyphs[0] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[0]); ok(glyphs[1] == textm.tmDefaultChar || glyphs[1] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[1]);
@@ -1660,12 +1660,12 @@ static void test_GetGlyphIndices(void) ok(GetTextMetricsA(hdc, &textm), "GetTextMetric failed\n"); flags |= GGI_MARK_NONEXISTING_GLYPHS; charcount = GetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount); ok(glyphs[4] == 0xffff, "GetGlyphIndicesW should have returned 0xffff char not %04x\n", glyphs[4]); flags = 0; testtext[0] = textm.tmDefaultChar; charcount = GetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount); ok(glyphs[0] == 0, "GetGlyphIndicesW for tmDefaultChar should be 0 not %04x\n", glyphs[0]); ok(glyphs[4] == 0, "GetGlyphIndicesW should have returned 0 not %04x\n", glyphs[4]); DeleteObject(SelectObject(hdc, hOldFont)); @@ -1676,8 +1676,8 @@ static void test_GetGlyphIndices(void) ok(font != NULL, "Failed to map font file.\n"); num_fonts = 0; rsrc = AddFontMemResourceEx(font, font_size, NULL, &num_fonts); - ok(ret != 0, "Failed to add resource, %d.\n", GetLastError()); - ok(num_fonts == 1, "Unexpected number of fonts %u.\n", num_fonts); + ok(ret != 0, "Failed to add resource, %ld.\n", GetLastError()); + ok(num_fonts == 1, "Unexpected number of fonts %lu.\n", num_fonts);
memset(&lf, 0, sizeof(lf)); strcpy(lf.lfFaceName, "wine_nul"); @@ -1688,7 +1688,7 @@ static void test_GetGlyphIndices(void) ok(GetTextMetricsA(hdc, &textm), "GetTextMetric failed\n"); testtext[0] = 'T'; charcount = GetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); - ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); + ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount); ok(glyphs[0] == 0, "GetGlyphIndicesW for tmDefaultChar should be 0 not %04x\n", glyphs[0]); ok(glyphs[4] == 0, "GetGlyphIndicesW should have returned 0 not %04x\n", glyphs[4]); DeleteObject(SelectObject(hdc, hOldFont)); @@ -1696,10 +1696,10 @@ static void test_GetGlyphIndices(void) ReleaseDC(0, hdc);
ret = RemoveFontMemResourceEx(rsrc); - ok(ret, "RemoveFontMemResourceEx error %d\n", GetLastError()); + ok(ret, "RemoveFontMemResourceEx error %ld\n", GetLastError()); free_font(font); ret = DeleteFileA(ttf_name); - ok(ret, "Failed to delete font file, %d.\n", GetLastError()); + ok(ret, "Failed to delete font file, %ld.\n", GetLastError()); }
static void test_GetKerningPairs(void) @@ -1809,13 +1809,13 @@ static void test_GetKerningPairs(void)
SetLastError(0xdeadbeef); uiRet = GetOutlineTextMetricsW(hdc, sizeof(otm), &otm); - ok(uiRet == sizeof(otm), "GetOutlineTextMetricsW error %d\n", GetLastError()); + ok(uiRet == sizeof(otm), "GetOutlineTextMetricsW error %ld\n", GetLastError());
- ok(match_off_by_1(kd[i].tmHeight, otm.otmTextMetrics.tmHeight, FALSE), "expected %d, got %d\n", + ok(match_off_by_1(kd[i].tmHeight, otm.otmTextMetrics.tmHeight, FALSE), "expected %ld, got %ld\n", kd[i].tmHeight, otm.otmTextMetrics.tmHeight); - ok(match_off_by_1(kd[i].tmAscent, otm.otmTextMetrics.tmAscent, FALSE), "expected %d, got %d\n", + ok(match_off_by_1(kd[i].tmAscent, otm.otmTextMetrics.tmAscent, FALSE), "expected %ld, got %ld\n", kd[i].tmAscent, otm.otmTextMetrics.tmAscent); - ok(kd[i].tmDescent == otm.otmTextMetrics.tmDescent, "expected %d, got %d\n", + ok(kd[i].tmDescent == otm.otmTextMetrics.tmDescent, "expected %ld, got %ld\n", kd[i].tmDescent, otm.otmTextMetrics.tmDescent);
ok(kd[i].otmEMSquare == otm.otmEMSquare, "expected %u, got %u\n", @@ -1851,17 +1851,17 @@ static void test_GetKerningPairs(void) SetLastError(0xdeadbeef); ret = GetKerningPairsW(hdc, 0, kern_pair); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got error %u, expected ERROR_INVALID_PARAMETER\n", GetLastError()); - ok(ret == 0, "got %u, expected 0\n", ret); + "got error %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + ok(ret == 0, "got %lu, expected 0\n", ret);
ret = GetKerningPairsW(hdc, 100, NULL); - ok(ret == total_kern_pairs, "got %u, expected %u\n", ret, total_kern_pairs); + ok(ret == total_kern_pairs, "got %lu, expected %lu\n", ret, total_kern_pairs);
ret = GetKerningPairsW(hdc, total_kern_pairs/2, kern_pair); - ok(ret == total_kern_pairs/2, "got %u, expected %u\n", ret, total_kern_pairs/2); + ok(ret == total_kern_pairs/2, "got %lu, expected %lu\n", ret, total_kern_pairs/2);
ret = GetKerningPairsW(hdc, total_kern_pairs, kern_pair); - ok(ret == total_kern_pairs, "got %u, expected %u\n", ret, total_kern_pairs); + ok(ret == total_kern_pairs, "got %lu, expected %lu\n", ret, total_kern_pairs);
matches = 0;
@@ -1883,7 +1883,7 @@ static void test_GetKerningPairs(void) } }
- ok(matches == kd[i].total_kern_pairs, "got matches %u, expected %u\n", + ok(matches == kd[i].total_kern_pairs, "got matches %lu, expected %lu\n", matches, kd[i].total_kern_pairs);
HeapFree(GetProcessHeap(), 0, kern_pair); @@ -1928,15 +1928,15 @@ static void test_height( HDC hdc, const struct font_data *fd )
old_hfont = SelectObject(hdc, hfont); ret = GetTextMetricsA(hdc, &tm); - ok(ret, "GetTextMetrics error %d\n", GetLastError()); + ok(ret, "GetTextMetrics error %ld\n", GetLastError()); if(fd[i].dpi == tm.tmDigitizedAspectX) { - ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmWeight, fd[i].weight); - ok(match_off_by_1(tm.tmHeight, fd[i].height, fd[i].exact), "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmHeight, fd[i].height); - ok(match_off_by_1(tm.tmAscent, fd[i].ascent, fd[i].exact), "%s(%d): tm.tmAscent %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmAscent, fd[i].ascent); - ok(match_off_by_1(tm.tmDescent, fd[i].descent, fd[i].exact), "%s(%d): tm.tmDescent %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmDescent, fd[i].descent); - ok(match_off_by_1(tm.tmInternalLeading, fd[i].int_leading, fd[i].exact), "%s(%d): tm.tmInternalLeading %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmInternalLeading, fd[i].int_leading); - ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmExternalLeading, fd[i].ext_leading); + ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %ld != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmWeight, fd[i].weight); + ok(match_off_by_1(tm.tmHeight, fd[i].height, fd[i].exact), "%s(%d): tm.tmHeight %ld != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmHeight, fd[i].height); + ok(match_off_by_1(tm.tmAscent, fd[i].ascent, fd[i].exact), "%s(%d): tm.tmAscent %ld != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmAscent, fd[i].ascent); + ok(match_off_by_1(tm.tmDescent, fd[i].descent, fd[i].exact), "%s(%d): tm.tmDescent %ld != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmDescent, fd[i].descent); + ok(match_off_by_1(tm.tmInternalLeading, fd[i].int_leading, fd[i].exact), "%s(%d): tm.tmInternalLeading %ld != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmInternalLeading, fd[i].int_leading); + ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %ld != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmExternalLeading, fd[i].ext_leading); }
SelectObject(hdc, old_hfont); @@ -2123,7 +2123,7 @@ static void test_height_selection_vdmx( HDC hdc ) } ret = DeleteFileA( ttf_name ); ok(ret || broken(!ret && GetLastError() == ERROR_ACCESS_DENIED), - "DeleteFile error %d\n", GetLastError()); + "DeleteFile error %ld\n", GetLastError()); } }
@@ -2170,7 +2170,7 @@ static UINT get_font_fsselection(LOGFONTA *lf) otm = HeapAlloc(GetProcessHeap(), 0, otm_size); otm->otmSize = sizeof(*otm); ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); - ok(ret == otm->otmSize, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + ok(ret == otm->otmSize, "expected %u, got %lu, error %ld\n", otm->otmSize, ret, GetLastError()); fsSelection = otm->otmfsSelection; HeapFree(GetProcessHeap(), 0, otm); SelectObject(hdc, hfont_old); @@ -2247,7 +2247,7 @@ static void test_GetOutlineTextMetrics(void) SetLastError(0xdeadbeef); otm->otmSize = sizeof(*otm); ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); - ok(ret == otm->otmSize, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + ok(ret == otm->otmSize, "expected %u, got %lu, error %ld\n", otm->otmSize, ret, GetLastError()); ok(otm->otmpFamilyName == NULL, "expected NULL got %p\n", otm->otmpFamilyName); ok(otm->otmpFaceName == NULL, "expected NULL got %p\n", otm->otmpFaceName); ok(otm->otmpStyleName == NULL, "expected NULL got %p\n", otm->otmpStyleName); @@ -2256,7 +2256,7 @@ static void test_GetOutlineTextMetrics(void) memset(otm, 0xAA, otm_size); SetLastError(0xdeadbeef); ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); - ok(ret == otm->otmSize, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + ok(ret == otm->otmSize, "expected %u, got %lu, error %ld\n", otm->otmSize, ret, GetLastError()); ok(otm->otmpFamilyName != NULL, "expected not NULL got %p\n", otm->otmpFamilyName); ok(otm->otmpFaceName != NULL, "expected not NULL got %p\n", otm->otmpFaceName); ok(otm->otmpStyleName != NULL, "expected not NULL got %p\n", otm->otmpStyleName); @@ -2268,7 +2268,7 @@ static void test_GetOutlineTextMetrics(void) SetLastError(0xdeadbeef); otm->otmSize = sizeof(*otm) - sizeof(char*); ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); - ok(ret == otm->otmSize, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + ok(ret == otm->otmSize, "expected %u, got %lu, error %ld\n", otm->otmSize, ret, GetLastError()); ok(otm->otmpFamilyName == NULL, "expected NULL got %p\n", otm->otmpFamilyName); ok(otm->otmpFaceName == NULL, "expected NULL got %p\n", otm->otmpFaceName); ok(otm->otmpStyleName == NULL, "expected NULL got %p\n", otm->otmpStyleName); @@ -2277,7 +2277,7 @@ static void test_GetOutlineTextMetrics(void) /* check handling of NULL pointer */ SetLastError(0xdeadbeef); ret = GetOutlineTextMetricsA(hdc, otm_size, NULL); - ok(ret == otm_size, "expected %u, got %u, error %d\n", otm_size, ret, GetLastError()); + ok(ret == otm_size, "expected %lu, got %lu, error %ld\n", otm_size, ret, GetLastError());
HeapFree(GetProcessHeap(), 0, otm);
@@ -2410,29 +2410,29 @@ static void test_SetTextJustification(void) SetTextJustification(hdc, 0, 0); GetTextExtentPoint32A(hdc, " ", 1, &expect); GetTextExtentPoint32A(hdc, " ", 3, &size); - ok( size.cx == 3 * expect.cx, "wrong size %d/%d\n", size.cx, expect.cx ); + ok( size.cx == 3 * expect.cx, "wrong size %ld/%ld\n", size.cx, expect.cx ); SetTextJustification(hdc, 4, 1); GetTextExtentPoint32A(hdc, " ", 1, &size); - ok( size.cx == expect.cx + 4, "wrong size %d/%d\n", size.cx, expect.cx ); + ok( size.cx == expect.cx + 4, "wrong size %ld/%ld\n", size.cx, expect.cx ); SetTextJustification(hdc, 9, 2); GetTextExtentPoint32A(hdc, " ", 2, &size); - ok( size.cx == 2 * expect.cx + 9, "wrong size %d/%d\n", size.cx, expect.cx ); + ok( size.cx == 2 * expect.cx + 9, "wrong size %ld/%ld\n", size.cx, expect.cx ); SetTextJustification(hdc, 7, 3); GetTextExtentPoint32A(hdc, " ", 3, &size); - ok( size.cx == 3 * expect.cx + 7, "wrong size %d/%d\n", size.cx, expect.cx ); + ok( size.cx == 3 * expect.cx + 7, "wrong size %ld/%ld\n", size.cx, expect.cx ); SetTextJustification(hdc, 7, 3); SetTextCharacterExtra(hdc, 2 ); GetTextExtentPoint32A(hdc, " ", 3, &size); - ok( size.cx == 3 * (expect.cx + 2) + 7, "wrong size %d/%d\n", size.cx, expect.cx ); + ok( size.cx == 3 * (expect.cx + 2) + 7, "wrong size %ld/%ld\n", size.cx, expect.cx ); SetTextJustification(hdc, 0, 0); SetTextCharacterExtra(hdc, 0); size.cx = size.cy = 1234; GetTextExtentPoint32A(hdc, " ", 0, &size); - ok( size.cx == 0 && size.cy == 0, "wrong size %d,%d\n", size.cx, size.cy ); + ok( size.cx == 0 && size.cy == 0, "wrong size %ld,%ld\n", size.cx, size.cy ); GetTextExtentExPointI(hdc, indices, 2, -1, NULL, NULL, &expect); SetTextJustification(hdc, 5, 1); GetTextExtentExPointI(hdc, indices, 2, -1, NULL, NULL, &size); - ok( size.cx == expect.cx + 5, "wrong size %d/%d\n", size.cx, expect.cx ); + ok( size.cx == expect.cx + 5, "wrong size %ld/%ld\n", size.cx, expect.cx ); SetTextJustification(hdc, 0, 0);
SetMapMode( hdc, MM_ANISOTROPIC ); @@ -2446,7 +2446,7 @@ static void test_SetTextJustification(void) { SetTextCharacterExtra(hdc, i); GetTextExtentPoint32A(hdc, "A", 1, &size); - ok( size.cx == expect.cx + i, "wrong size %d/%d+%d\n", size.cx, expect.cx, i ); + ok( size.cx == expect.cx + i, "wrong size %ld/%ld+%d\n", size.cx, expect.cx, i ); } SetTextCharacterExtra(hdc, 0); GetTextExtentExPointI(hdc, indices, 1, -1, NULL, NULL, &expect); @@ -2454,7 +2454,7 @@ static void test_SetTextJustification(void) { SetTextCharacterExtra(hdc, i); GetTextExtentExPointI(hdc, indices, 1, -1, NULL, NULL, &size); - ok( size.cx == expect.cx + i, "wrong size %d/%d+%d\n", size.cx, expect.cx, i ); + ok( size.cx == expect.cx + i, "wrong size %ld/%ld+%d\n", size.cx, expect.cx, i ); } SetTextCharacterExtra(hdc, 0);
@@ -2468,7 +2468,7 @@ static void test_SetTextJustification(void) { SetTextCharacterExtra(hdc, i); GetTextExtentPoint32A(hdc, "A", 1, &size); - ok( size.cx == expect.cx + i, "wrong size %d/%d+%d\n", size.cx, expect.cx, i ); + ok( size.cx == expect.cx + i, "wrong size %ld/%ld+%d\n", size.cx, expect.cx, i ); }
DeleteObject(hfont); @@ -2496,7 +2496,7 @@ static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count lstrcpyA(lf.lfFaceName, "Arial"); SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hdc = GetDC(0); hfont_old = SelectObject(hdc, hfont); @@ -2506,7 +2506,7 @@ static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count
SetLastError(0xdeadbeef); ret = GetTextFaceA(hdc, sizeof(name), name); - ok(ret, "GetTextFaceA error %u\n", GetLastError()); + ok(ret, "GetTextFaceA error %lu\n", GetLastError());
if (charset == SYMBOL_CHARSET) { @@ -2529,7 +2529,7 @@ static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count
if (pGdiGetCodePage != NULL && pGdiGetCodePage(hdc) != code_page) { - skip("Font code page %d, looking for code page %d\n", + skip("Font code page %ld, looking for code page %d\n", pGdiGetCodePage(hdc), code_page); ReleaseDC(0, hdc); return FALSE; @@ -2546,7 +2546,7 @@ static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count
SetLastError(0xdeadbeef); ret = GetGlyphIndicesW(hdc, unicode_buf, count, idx, 0); - ok(ret == count, "GetGlyphIndicesW expected %d got %d, error %u\n", + ok(ret == count, "GetGlyphIndicesW expected %d got %ld, error %lu\n", count, ret, GetLastError()); } else @@ -2557,7 +2557,7 @@ static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count
SetLastError(0xdeadbeef); ret = GetGlyphIndicesA(hdc, ansi_buf, count, idx, 0); - ok(ret == count, "GetGlyphIndicesA expected %d got %d, error %u\n", + ok(ret == count, "GetGlyphIndicesA expected %d got %ld, error %lu\n", count, ret, GetLastError()); }
@@ -2683,12 +2683,12 @@ static void test_GdiGetCodePage(void) lf.lfCharSet = matching_data[i].lfCharSet; lstrcpyA(lf.lfFaceName, matching_data[i].lfFaceName); hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hfont = SelectObject(hdc, hfont); codepage = pGdiGetCodePage(hdc); ok(codepage == matching_data[i].expected_codepage, - "GdiGetCodePage should have returned %d, got %d\n", matching_data[i].expected_codepage, codepage); + "GdiGetCodePage should have returned %d, got %ld\n", matching_data[i].expected_codepage, codepage);
hfont = SelectObject(hdc, hfont); DeleteObject(hfont); @@ -2696,11 +2696,11 @@ static void test_GdiGetCodePage(void) /* CLIP_DFA_DISABLE turns off the font association */ lf.lfClipPrecision = CLIP_DFA_DISABLE; hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hfont = SelectObject(hdc, hfont); codepage = pGdiGetCodePage(hdc); - ok(codepage == 1252, "GdiGetCodePage returned %d\n", codepage); + ok(codepage == 1252, "GdiGetCodePage returned %ld\n", codepage);
hfont = SelectObject(hdc, hfont); DeleteObject(hfont); @@ -2772,7 +2772,7 @@ static INT CALLBACK arial_enum_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, D struct enum_font_data *efd = (struct enum_font_data *)lParam; const NEWTEXTMETRICA *ntm = (const NEWTEXTMETRICA *)tm;
- ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight); + ok(lf->lfHeight == tm->tmHeight, "lfHeight %ld != tmHeight %ld\n", lf->lfHeight, tm->tmHeight);
if (type != TRUETYPE_FONTTYPE) return 1;
@@ -2794,7 +2794,7 @@ static INT CALLBACK arial_enum_procw(const LOGFONTW *lf, const TEXTMETRICW *tm, struct enum_font_dataW *efd = (struct enum_font_dataW *)lParam; const NEWTEXTMETRICW *ntm = (const NEWTEXTMETRICW *)tm;
- ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight); + ok(lf->lfHeight == tm->tmHeight, "lfHeight %ld != tmHeight %ld\n", lf->lfHeight, tm->tmHeight);
if (type != TRUETYPE_FONTTYPE) return 1;
@@ -2895,7 +2895,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efdw.total = 0; SetLastError(0xdeadbeef); ret = EnumFontFamiliesW(hdc, NULL, arial_enum_procw, (LPARAM)&efdw); - ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesW error %u\n", GetLastError()); + ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesW error %lu\n", GetLastError()); if(ret) { get_charset_statsW(&efdw, &ansi_charset, &symbol_charset, &russian_charset); @@ -2908,7 +2908,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efdw.total = 0; SetLastError(0xdeadbeef); ret = EnumFontFamiliesExW(hdc, NULL, arial_enum_procw, (LPARAM)&efdw, 0); - ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesExW error %u\n", GetLastError()); + ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesExW error %lu\n", GetLastError()); if(ret) { get_charset_statsW(&efdw, &ansi_charset, &symbol_charset, &russian_charset); @@ -2922,7 +2922,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efd.total = 0; SetLastError(0xdeadbeef); ret = EnumFontFamiliesA(hdc, font_name, arial_enum_proc, (LPARAM)&efd); - ok(ret, "EnumFontFamilies error %u\n", GetLastError()); + ok(ret, "EnumFontFamilies error %lu\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); if (*font_name) ok(efd.total > 0, "no fonts enumerated: %s\n", font_name); @@ -2943,7 +2943,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efd.total = 0; SetLastError(0xdeadbeef); ret = EnumFontFamiliesExA(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); - ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError()); + ok(ret, "EnumFontFamiliesEx error %lu\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); if (font_charset == SYMBOL_CHARSET) { @@ -2971,7 +2971,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efd.total = 0; SetLastError(0xdeadbeef); EnumFontFamiliesExA(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); - ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError()); + ok(ret, "EnumFontFamiliesEx error %lu\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); ok(efd.total > 0, "no fonts enumerated: %s DEFAULT_CHARSET\n", font_name); for (i = 0; i < efd.total; i++) @@ -3026,7 +3026,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efd.total = 0; SetLastError(0xdeadbeef); EnumFontFamiliesExA(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); - ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError()); + ok(ret, "EnumFontFamiliesEx error %lu\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); if (*font_name && font_charset == ANSI_CHARSET) ok(efd.total == 0, "no fonts should be enumerated: %s SYMBOL_CHARSET\n", font_name); @@ -3187,7 +3187,7 @@ static void test_negative_width(HDC hdc, const LOGFONTA *lf)
SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(lf); - ok(hfont != 0, "CreateFontIndirect error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirect error %lu\n", GetLastError()); check_font("original", lf, hfont);
hfont_prev = SelectObject(hdc, hfont); @@ -3205,14 +3205,14 @@ static void test_negative_width(HDC hdc, const LOGFONTA *lf) memset(&gm1, 0xab, sizeof(gm1)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'x', GGO_METRICS, &gm1, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutline error 0x%x\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutline error 0x%lx\n", GetLastError());
SelectObject(hdc, hfont_prev); DeleteObject(hfont);
SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(&lf2); - ok(hfont != 0, "CreateFontIndirect error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirect error %lu\n", GetLastError()); check_font("negative width", &lf2, hfont);
hfont_prev = SelectObject(hdc, hfont); @@ -3220,7 +3220,7 @@ static void test_negative_width(HDC hdc, const LOGFONTA *lf) memset(&gm2, 0xbb, sizeof(gm2)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'x', GGO_METRICS, &gm2, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutline error 0x%x\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutline error 0x%lx\n", GetLastError());
SelectObject(hdc, hfont_prev); DeleteObject(hfont); @@ -3231,7 +3231,7 @@ static void test_negative_width(HDC hdc, const LOGFONTA *lf) gm1.gmptGlyphOrigin.y == gm2.gmptGlyphOrigin.y && gm1.gmCellIncX == gm2.gmCellIncX && gm1.gmCellIncY == gm2.gmCellIncY, - "gm1=%d,%d,%d,%d,%d,%d gm2=%d,%d,%d,%d,%d,%d\n", + "gm1=%d,%d,%ld,%ld,%d,%d gm2=%d,%d,%ld,%ld,%d,%d\n", gm1.gmBlackBoxX, gm1.gmBlackBoxY, gm1.gmptGlyphOrigin.x, gm1.gmptGlyphOrigin.y, gm1.gmCellIncX, gm1.gmCellIncY, gm2.gmBlackBoxX, gm2.gmBlackBoxY, gm2.gmptGlyphOrigin.x, @@ -3439,7 +3439,7 @@ static BOOL get_first_last_from_cmap(HDC hdc, DWORD *first, DWORD *last, cmap_ty
header = HeapAlloc(GetProcessHeap(), 0, size); ret = GetFontData(hdc, MS_CMAP_TAG, 0, header, size); - ok(ret == size, "GetFontData should return %u not %u\n", size, ret); + ok(ret == size, "GetFontData should return %lu not %lu\n", size, ret); ok(GET_BE_WORD(header->version) == 0, "got cmap version %d\n", GET_BE_WORD(header->version));
cmap = get_cmap(header, 3, 1); @@ -3700,7 +3700,7 @@ static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_
data = HeapAlloc(GetProcessHeap(), 0, size); ret = GetFontData(hdc, MS_NAME_TAG, 0, data, size); - ok(ret == size, "GetFontData should return %u not %u\n", size, ret); + ok(ret == size, "GetFontData should return %lu not %lu\n", size, ret);
header = (void *)data; header->format = GET_BE_WORD(header->format); @@ -3718,7 +3718,7 @@ static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_ } if (header->storage_offset >= size) { - skip("storage_offset %u > size %u\n", header->storage_offset, size); + skip("storage_offset %u > size %lu\n", header->storage_offset, size); goto out; }
@@ -3777,7 +3777,7 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(lf); - ok(hfont != 0, "CreateFontIndirect error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirect error %lu\n", GetLastError());
hfont_old = SelectObject(hdc, hfont);
@@ -3789,18 +3789,18 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) } if (size > sizeof(tt_os2)) { - trace("got too large OS/2 chunk of size %u\n", size); + trace("got too large OS/2 chunk of size %lu\n", size); size = sizeof(tt_os2); }
memset(&tt_os2, 0, sizeof(tt_os2)); ret = GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size); - ok(ret >= TT_OS2_V0_SIZE && ret <= size, "GetFontData should return size from [%u,%u] not %u\n", TT_OS2_V0_SIZE, + ok(ret >= TT_OS2_V0_SIZE && ret <= size, "GetFontData should return size from [%lu,%lu] not %lu\n", TT_OS2_V0_SIZE, size, ret);
SetLastError(0xdeadbeef); ret = GetTextMetricsA(hdc, &tmA); - ok(ret, "GetTextMetricsA error %u\n", GetLastError()); + ok(ret, "GetTextMetricsA error %lu\n", GetLastError());
if(!get_first_last_from_cmap(hdc, &cmap_first, &cmap_last, &cmap_type)) { @@ -3823,19 +3823,19 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) /* NEWTEXTMETRIC's scaling method is different from TEXTMETRIC's */ #define SCALE_NTM(value) (MulDiv(ntm->tmHeight, (value), cell_height)) size = MulDiv(32, ntm->ntmCellHeight, ntm->ntmSizeEM); - ok(ntm->tmHeight == size, "%s: ntm->tmHeight %d != %d (%u/%u)\n", + ok(ntm->tmHeight == size, "%s: ntm->tmHeight %ld != %ld (%u/%u)\n", font_name, ntm->tmHeight, size, ntm->ntmCellHeight, ntm->ntmSizeEM); size = SCALE_NTM(ntm->ntmAvgWidth); - ok(ntm->tmAveCharWidth == size, "%s: ntm->tmAveCharWidth %d != %d (%u/%u,%d)\n", + ok(ntm->tmAveCharWidth == size, "%s: ntm->tmAveCharWidth %ld != %ld (%u/%u,%ld)\n", font_name, ntm->tmAveCharWidth, size, ntm->ntmAvgWidth, cell_height, ntm->tmHeight); size = SCALE_NTM(ascent); - ok(ntm->tmAscent == size, "%s: ntm->tmAscent %d != %d (%u/%u,%d)\n", + ok(ntm->tmAscent == size, "%s: ntm->tmAscent %ld != %ld (%u/%u,%ld)\n", font_name, ntm->tmAscent, size, ascent, cell_height, ntm->tmHeight); size = ntm->tmHeight - ntm->tmAscent; - ok(ntm->tmDescent == size, "%s: ntm->tmDescent %d != %d (%u/%u,%d)\n", + ok(ntm->tmDescent == size, "%s: ntm->tmDescent %ld != %ld (%u/%u,%ld)\n", font_name, ntm->tmDescent, size, descent, cell_height, ntm->tmHeight); size = SCALE_NTM(cell_height - ntm->ntmSizeEM); - ok(ntm->tmInternalLeading == size, "%s: ntm->tmInternalLeading %d != %d (%u/%u,%d)\n", + ok(ntm->tmInternalLeading == size, "%s: ntm->tmInternalLeading %ld != %ld (%u/%u,%ld)\n", font_name, ntm->tmInternalLeading, size, cell_height - ntm->ntmSizeEM, cell_height, ntm->tmHeight); #undef SCALE_NTM
@@ -3847,7 +3847,7 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) break_char = GET_BE_WORD(tt_os2.usBreakChar);
if (winetest_debug > 1) - trace("font %s charset %u: %x-%x (%x-%x) default %x break %x OS/2 version %u vendor %4.4s\n", + trace("font %s charset %u: %x-%x (%lx-%lx) default %x break %x OS/2 version %u vendor %4.4s\n", font_name, lf->lfCharSet, os2_first_char, os2_last_char, cmap_first, cmap_last, default_char, break_char, version, (LPCSTR)&tt_os2.achVendID);
@@ -3906,7 +3906,7 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) SetLastError(0xdeadbeef); ret = GetTextMetricsW(hdc, &tmW); ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, - "GetTextMetricsW error %u\n", GetLastError()); + "GetTextMetricsW error %lu\n", GetLastError()); if (ret) { /* Wine uses the os2 first char */ @@ -3926,10 +3926,10 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
/* Test the aspect ratio while we have tmW */ ret = GetDeviceCaps(hdc, LOGPIXELSX); - ok(tmW.tmDigitizedAspectX == ret, "W: tmDigitizedAspectX %u != %u\n", + ok(tmW.tmDigitizedAspectX == ret, "W: tmDigitizedAspectX %lu != %lu\n", tmW.tmDigitizedAspectX, ret); ret = GetDeviceCaps(hdc, LOGPIXELSY); - ok(tmW.tmDigitizedAspectX == ret, "W: tmDigitizedAspectY %u != %u\n", + ok(tmW.tmDigitizedAspectX == ret, "W: tmDigitizedAspectY %lu != %lu\n", tmW.tmDigitizedAspectX, ret); } } @@ -4261,7 +4261,7 @@ static void test_RealizationInfo(void) memset(info, 0xcc, sizeof(info)); r = pGdiRealizationInfo(hdc, info); ok(r != 0, "ret 0\n"); - ok((info[0] & 0xf) == 1, "info[0] = %x for the system font\n", info[0]); + ok((info[0] & 0xf) == 1, "info[0] = %lx for the system font\n", info[0]); ok(info[3] == 0xcccccccc, "structure longer than 3 dwords\n");
if (!is_truetype_font_installed("Tahoma")) @@ -4281,7 +4281,7 @@ static void test_RealizationInfo(void) memset(info, 0xcc, sizeof(info)); r = pGdiRealizationInfo(hdc, info); ok(r != 0, "ret 0\n"); - ok((info[0] & 0xf) == 3, "info[0] = %x for arial\n", info[0]); + ok((info[0] & 0xf) == 3, "info[0] = %lx for arial\n", info[0]); ok(info[3] == 0xcccccccc, "structure longer than 3 dwords\n");
if (pGetFontRealizationInfo) @@ -4303,11 +4303,11 @@ static void test_RealizationInfo(void) ok(r != 0, "ret 0\n"); /* We may get the '24' version here if that has been previously requested. */ - ok(fri->size == 16 || fri->size == 24, "got %d\n", info2[0]); + ok(fri->size == 16 || fri->size == 24, "got %ld\n", info2[0]); ok(fri->flags == ri->flags, "flags mismatch\n"); ok(fri->cache_num == ri->cache_num, "cache_num mismatch\n"); ok(fri->instance_id == ri->instance_id, "instance id mismatch\n"); - ok(info2[6] == 0xcccccccc, "got wrong dword 6, 0x%08x\n", info2[6]); + ok(info2[6] == 0xcccccccc, "got wrong dword 6, 0x%08lx\n", info2[6]);
memset(info2, 0xcc, sizeof(info2)); info2[0] = 28; @@ -4318,7 +4318,7 @@ static void test_RealizationInfo(void) info2[0] = 24; r = pGetFontRealizationInfo(hdc, info2); ok(r != 0, "ret 0\n"); - ok(fri->size == 24, "got %d\n", fri->size); + ok(fri->size == 24, "got %ld\n", fri->size); ok(fri->flags == ri->flags, "flags mismatch\n"); ok(fri->cache_num == ri->cache_num, "cache_num mismatch\n"); ok(fri->instance_id == ri->instance_id, "instance id mismatch\n"); @@ -4330,18 +4330,18 @@ static void test_RealizationInfo(void) /* invalid font id */ SetLastError(0xdeadbeef); r = pGetFontFileInfo(0xabababab, 0, &file_info, sizeof(file_info), &needed); - ok(r == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "ret %d gle %d\n", r, GetLastError()); + ok(r == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "ret %d gle %ld\n", r, GetLastError());
needed = 0; r = pGetFontFileInfo(fri->instance_id, 0, &file_info, sizeof(file_info), &needed); - ok(r != 0, "Failed to get font file info, error %d.\n", GetLastError()); + ok(r != 0, "Failed to get font file info, error %ld.\n", GetLastError());
if (r) { ok(needed > 0 && needed < sizeof(file_info), "Unexpected required size.\n");
h = CreateFileW(file_info.path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok(h != INVALID_HANDLE_VALUE, "Unable to open file %d\n", GetLastError()); + ok(h != INVALID_HANDLE_VALUE, "Unable to open file %ld\n", GetLastError());
GetFileTime(h, NULL, NULL, &time); ok(!CompareFileTime(&file_info.time, &time), "time mismatch\n"); @@ -4355,12 +4355,12 @@ static void test_RealizationInfo(void) /* shorter buffer */ SetLastError(0xdeadbeef); r = pGetFontFileInfo(fri->instance_id, 0, &file_info, needed - 1, &needed); - ok(r == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "ret %d gle %d\n", r, GetLastError()); + ok(r == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "ret %d gle %ld\n", r, GetLastError()); }
/* Get bytes 2 - 16 using GetFontFileData */ r = pGetFontFileData(fri->instance_id, 0, 2, data, sizeof(data)); - ok(r != 0, "ret 0 gle %d\n", GetLastError()); + ok(r != 0, "ret 0 gle %ld\n", GetLastError());
ok(!memcmp(data, file + 2, sizeof(data)), "mismatch\n"); } @@ -4488,8 +4488,8 @@ static void test_orientation(void) hfont = create_font("orientation", &lf); old_hfont = SelectObject(hdc, hfont); ok(GetTextExtentExPointA(hdc, test_str, sizeof(test_str), 32767, NULL, NULL, &size), "GetTextExtentExPointA failed\n"); - ok(near_match(311, size.cx), "cx should be about 311, got %d\n", size.cx); - ok(near_match(75, size.cy), "cy should be about 75, got %d\n", size.cy); + ok(near_match(311, size.cx), "cx should be about 311, got %ld\n", size.cx); + ok(near_match(75, size.cy), "cy should be about 75, got %ld\n", size.cy); SelectObject(hdc, old_hfont); DeleteObject(hfont); DeleteDC(hdc); @@ -4518,7 +4518,7 @@ static void test_oemcharset(void) ok(!lstrcmpA(clf.lfFaceName, lf.lfFaceName), "expected %s face name, got %s\n", lf.lfFaceName, clf.lfFaceName); ok(clf.lfPitchAndFamily == lf.lfPitchAndFamily, "expected %x family, got %x\n", lf.lfPitchAndFamily, clf.lfPitchAndFamily); ok(clf.lfCharSet == lf.lfCharSet, "expected %d charset, got %d\n", lf.lfCharSet, clf.lfCharSet); - ok(clf.lfHeight == lf.lfHeight, "expected %d height, got %d\n", lf.lfHeight, clf.lfHeight); + ok(clf.lfHeight == lf.lfHeight, "expected %ld height, got %ld\n", lf.lfHeight, clf.lfHeight); DeleteObject(hfont); DeleteDC(hdc); } @@ -4611,25 +4611,25 @@ static void test_GetGlyphOutline(void) lstrcpyA(lf.lfFaceName, "Tahoma"); SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError()); old_hfont = SelectObject(hdc, hfont);
memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %lu\n", GetLastError());
memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, NULL); ok(ret == GDI_ERROR, "GetGlyphOutlineA should fail\n"); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError());
memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); ret = GetGlyphOutlineW(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) - ok(ret != GDI_ERROR, "GetGlyphOutlineW error %u\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineW error %lu\n", GetLastError());
memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); @@ -4637,7 +4637,7 @@ static void test_GetGlyphOutline(void) if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) { ok(ret == GDI_ERROR, "GetGlyphOutlineW should fail\n"); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError()); }
/* test for needed buffer size request on space char */ @@ -4658,7 +4658,7 @@ static void test_GetGlyphOutline(void) if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) { ok(ret == GDI_ERROR, "GetGlyphOutlineW should return GDI_ERROR\n"); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", GetLastError()); ok(gm.gmBlackBoxX == 0, "Expected 0, got %u\n", gm.gmBlackBoxX); ok(gm.gmBlackBoxY == 0, "Expected 0, got %u\n", gm.gmBlackBoxY); } @@ -4783,43 +4783,43 @@ static void test_GetGlyphOutline(void) }
ret = GetObjectA(hfont, sizeof lf, &lf); - ok(ret > 0, "GetObject error %u\n", GetLastError()); + ok(ret > 0, "GetObject error %lu\n", GetLastError());
ret = GetTextMetricsA(hdc, &tm); - ok(ret, "GetTextMetrics error %u\n", GetLastError()); + ok(ret, "GetTextMetrics error %lu\n", GetLastError()); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %lu\n", GetLastError()); ok(gm2.gmCellIncX == tm.tmAveCharWidth * 2 || broken(gm2.gmCellIncX == -lf.lfHeight), - "expected %d, got %d (%s:%d)\n", + "expected %ld, got %d (%s:%d)\n", tm.tmAveCharWidth * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet);
ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &rotate_mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %lu\n", GetLastError()); ok(gm2.gmCellIncY == -lf.lfHeight, - "expected %d, got %d (%s:%d)\n", + "expected %ld, got %d (%s:%d)\n", -lf.lfHeight, gm2.gmCellIncY, lf.lfFaceName, lf.lfCharSet);
lf.lfItalic = TRUE; hfont = CreateFontIndirectA(&lf); - ok(hfont != NULL, "CreateFontIndirect error %u\n", GetLastError()); + ok(hfont != NULL, "CreateFontIndirect error %lu\n", GetLastError()); DeleteObject(SelectObject(hdc, hfont)); ret = GetTextMetricsA(hdc, &tm); - ok(ret, "GetTextMetrics error %u\n", GetLastError()); + ok(ret, "GetTextMetrics error %lu\n", GetLastError()); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %lu\n", GetLastError()); ok(gm2.gmCellIncX == tm.tmAveCharWidth * 2 || broken(gm2.gmCellIncX == -lf.lfHeight), - "expected %d, got %d (%s:%d)\n", + "expected %ld, got %d (%s:%d)\n", tm.tmAveCharWidth * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet);
lf.lfItalic = FALSE; lf.lfEscapement = lf.lfOrientation = 2700; hfont = CreateFontIndirectA(&lf); - ok(hfont != NULL, "CreateFontIndirect error %u\n", GetLastError()); + ok(hfont != NULL, "CreateFontIndirect error %lu\n", GetLastError()); DeleteObject(SelectObject(hdc, hfont)); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ok(ret != GDI_ERROR, "GetGlyphOutlineA error %lu\n", GetLastError()); ok(gm2.gmCellIncY == -lf.lfHeight, - "expected %d, got %d (%s:%d)\n", + "expected %ld, got %d (%s:%d)\n", -lf.lfHeight, gm2.gmCellIncY, lf.lfFaceName, lf.lfCharSet);
hfont = SelectObject(hdc, old_hfont); @@ -4852,7 +4852,7 @@ static void test_GetTextMetrics2(const char *fontname, int font_height) ok( hf != NULL, "CreateFontA(%s, %d) failed\n", fontname, font_height); of = SelectObject( hdc, hf); ret = GetTextMetricsA( hdc, &tm); - ok(ret, "GetTextMetricsA error %u\n", GetLastError()); + ok(ret, "GetTextMetricsA error %lu\n", GetLastError()); height = tm.tmHeight; ave_width = tm.tmAveCharWidth; SelectObject( hdc, of); @@ -4866,7 +4866,7 @@ static void test_GetTextMetrics2(const char *fontname, int font_height) ok(hf != 0, "CreateFont failed\n"); of = SelectObject(hdc, hf); ret = GetTextMetricsA(hdc, &tm); - ok(ret, "GetTextMetrics error %u\n", GetLastError()); + ok(ret, "GetTextMetrics error %lu\n", GetLastError()); SelectObject(hdc, of); DeleteObject(hf);
@@ -4917,18 +4917,18 @@ static void test_GetCharacterPlacement(void)
size2 = GetCharacterPlacementA(hdc, "Wine Test", 9, 0, NULL, 0); ok(size2, "GetCharacterPlacementA failed!\n"); - ok(size == size2, "GetCharacterPlacementA returned different result: %u vs %u\n", size2, size); + ok(size == size2, "GetCharacterPlacementA returned different result: %lu vs %lu\n", size2, size);
size2 = GetCharacterPlacementA(hdc, "Wine Test", 9, 1024, NULL, GCP_REORDER); ok(size2, "GetCharacterPlacementA failed!\n"); - ok(size == size2, "GetCharacterPlacementA returned different result: %u vs %u\n", size2, size); + ok(size == size2, "GetCharacterPlacementA returned different result: %lu vs %lu\n", size2, size);
pos[0] = -1; glyphs[0] = '!'; result.nGlyphs = 20; size = GetCharacterPlacementA(hdc, "Wine Test", 9, 1024, &result, GCP_REORDER); ok(size, "GetCharacterPlacementA failed!\n"); - ok(size == size2, "GetCharacterPlacementA returned different result: %u vs %u\n", size2, size); + ok(size == size2, "GetCharacterPlacementA returned different result: %lu vs %lu\n", size2, size); ok(result.nGlyphs == 9, "Unexpected number of glyphs %u\n", result.nGlyphs); ok(glyphs[0] == 'W', "Unexpected first glyph %s\n", wine_dbgstr_wn(glyphs, 1)); todo_wine ok(pos[0] == 0, "Unexpected caret position %d\n", pos[0]); @@ -4959,9 +4959,9 @@ static void test_CreateFontIndirect(void) ok(hfont != 0, "CreateFontIndirectA failed\n"); SetLastError(0xdeadbeef); ret = GetObjectA(hfont, sizeof(getobj_lf), &getobj_lf); - ok(ret, "GetObject failed: %d\n", GetLastError()); + ok(ret, "GetObject failed: %ld\n", GetLastError()); ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic); - ok(lf.lfWeight == getobj_lf.lfWeight, "lfWeight: expect %08x got %08x\n", lf.lfWeight, getobj_lf.lfWeight); + ok(lf.lfWeight == getobj_lf.lfWeight, "lfWeight: expect %08lx got %08lx\n", lf.lfWeight, getobj_lf.lfWeight); ok(!lstrcmpA(lf.lfFaceName, getobj_lf.lfFaceName), "font names don't match: %s != %s\n", lf.lfFaceName, getobj_lf.lfFaceName); DeleteObject(hfont); } @@ -4981,7 +4981,7 @@ static void test_CreateFontIndirectEx(void) SetLastError(0xdeadbeef); hfont = CreateFontIndirectExA(NULL); ok(hfont == NULL, "got %p\n", hfont); - ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got error %ld\n", GetLastError());
memset(&lfex, 0, sizeof(lfex)); lstrcpyA(lfex.elfEnumLogfontEx.elfLogFont.lfFaceName, "Arial"); @@ -5011,7 +5011,7 @@ static void test_realization_info(const char *name, DWORD size, BOOL is_memory_r strcpy(lf.lfFaceName, name);
hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "Failed to create a font, %u.\n", GetLastError()); + ok(hfont != 0, "Failed to create a font, %lu.\n", GetLastError());
hdc = GetDC(NULL);
@@ -5023,35 +5023,35 @@ static void test_realization_info(const char *name, DWORD size, BOOL is_memory_r ret = pGetFontRealizationInfo(hdc, (DWORD *)&info); ok(ret != 0, "Unexpected return value %d.\n", ret);
- ok((info.flags & 0xf) == 0x3, "Unexpected flags %#x.\n", info.flags); - ok(info.cache_num != 0, "Unexpected cache num %u.\n", info.cache_num); - ok(info.instance_id != 0, "Unexpected instance id %u.\n", info.instance_id); + ok((info.flags & 0xf) == 0x3, "Unexpected flags %#lx.\n", info.flags); + ok(info.cache_num != 0, "Unexpected cache num %lu.\n", info.cache_num); + ok(info.instance_id != 0, "Unexpected instance id %lu.\n", info.instance_id); ok(info.simulations == 0, "Unexpected simulations %#x.\n", info.simulations); ok(info.face_index == 0, "Unexpected face index %u.\n", info.face_index);
ret = pGetFontFileInfo(info.instance_id, 0, NULL, 0, NULL); - ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %d.\n", + ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %ld.\n", ret, GetLastError());
needed = 0; ret = pGetFontFileInfo(info.instance_id, 0, NULL, 0, &needed); - ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %d.\n", + ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %ld.\n", ret, GetLastError());
ret = pGetFontFileInfo(info.instance_id, 0, &file_info, 0, NULL); - ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %d.\n", + ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %ld.\n", ret, GetLastError());
ret = pGetFontFileInfo(info.instance_id, 0, &file_info, needed - 1, NULL); - ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %d.\n", + ok(ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return value %d, error %ld.\n", ret, GetLastError());
ret = pGetFontFileInfo(info.instance_id, 0, &file_info, needed, NULL); - ok(ret != 0, "Failed to get font file info, ret %d gle %d.\n", ret, GetLastError()); + ok(ret != 0, "Failed to get font file info, ret %d gle %ld.\n", ret, GetLastError());
memset(&file_info, 0xcc, sizeof(file_info)); ret = pGetFontFileInfo(info.instance_id, 0, &file_info, sizeof(file_info), NULL); - ok(ret != 0, "Failed to get font file info, ret %d gle %d.\n", ret, GetLastError()); + ok(ret != 0, "Failed to get font file info, ret %d gle %ld.\n", ret, GetLastError()); if (ret) { ok(is_memory_resource ? file_info.size.QuadPart == size : file_info.size.QuadPart > 0, "Unexpected file size.\n"); @@ -5064,35 +5064,35 @@ static void test_realization_info(const char *name, DWORD size, BOOL is_memory_r
memset(data, 0xcc, size); ret = pGetFontFileData(info.instance_id, 0, 0, data, size); - ok(ret != 0, "Failed to get font file data, %d\n", GetLastError()); - ok(*(DWORD *)data == 0x00000100, "Unexpected sfnt header version %#x.\n", *(DWORD *)data); + ok(ret != 0, "Failed to get font file data, %ld\n", GetLastError()); + ok(*(DWORD *)data == 0x00000100, "Unexpected sfnt header version %#lx.\n", *(DWORD *)data); ok(*(WORD *)(data + 4) == 0x0e00, "Unexpected table count %#x.\n", *(WORD *)(data + 4));
/* Larger than font data size. */ memset(data, 0xcc, size); ret = pGetFontFileData(info.instance_id, 0, 0, data, size + 16); - ok(ret == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "Unexpected return value %d, error %d\n", + ok(ret == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "Unexpected return value %d, error %ld\n", ret, GetLastError()); - ok(*(DWORD *)data == 0xcccccccc, "Unexpected buffer contents %#x.\n", *(DWORD *)data); + ok(*(DWORD *)data == 0xcccccccc, "Unexpected buffer contents %#lx.\n", *(DWORD *)data);
/* With offset. */ memset(data, 0xcc, size); ret = pGetFontFileData(info.instance_id, 0, 16, data, size - 16); - ok(ret != 0, "Failed to get font file data, %d\n", GetLastError()); - ok(*(DWORD *)data == 0x1000000, "Unexpected buffer contents %#x.\n", *(DWORD *)data); + ok(ret != 0, "Failed to get font file data, %ld\n", GetLastError()); + ok(*(DWORD *)data == 0x1000000, "Unexpected buffer contents %#lx.\n", *(DWORD *)data);
memset(data, 0xcc, size); ret = pGetFontFileData(info.instance_id, 0, 16, data, size); - ok(ret == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "Unexpected return value %d, error %d\n", + ok(ret == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "Unexpected return value %d, error %ld\n", ret, GetLastError()); - ok(*(DWORD *)data == 0xcccccccc, "Unexpected buffer contents %#x.\n", *(DWORD *)data); + ok(*(DWORD *)data == 0xcccccccc, "Unexpected buffer contents %#lx.\n", *(DWORD *)data);
/* Zero buffer size. */ memset(data, 0xcc, size); ret = pGetFontFileData(info.instance_id, 0, 16, data, 0); todo_wine - ok(ret == 0 && GetLastError() == ERROR_NOACCESS, "Unexpected return value %d, error %d\n", ret, GetLastError()); - ok(*(DWORD *)data == 0xcccccccc, "Unexpected buffer contents %#x.\n", *(DWORD *)data); + ok(ret == 0 && GetLastError() == ERROR_NOACCESS, "Unexpected return value %d, error %ld\n", ret, GetLastError()); + ok(*(DWORD *)data == 0xcccccccc, "Unexpected buffer contents %#lx.\n", *(DWORD *)data);
HeapFree(GetProcessHeap(), 0, data);
@@ -5113,28 +5113,28 @@ static void test_AddFontMemResource(void) ret = AddFontMemResourceEx(NULL, 0, NULL, NULL); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = AddFontMemResourceEx(NULL, 10, NULL, NULL); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = AddFontMemResourceEx(NULL, 0, NULL, &num_fonts); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = AddFontMemResourceEx(NULL, 10, NULL, &num_fonts); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
/* Now with scalable font */ @@ -5149,8 +5149,8 @@ static void test_AddFontMemResource(void)
num_fonts = 0; ret = AddFontMemResourceEx(font, font_size, NULL, &num_fonts); - ok(ret != 0, "Failed to add resource, %d.\n", GetLastError()); - ok(num_fonts == 1, "Unexpected number of fonts %u.\n", num_fonts); + ok(ret != 0, "Failed to add resource, %ld.\n", GetLastError()); + ok(num_fonts == 1, "Unexpected number of fonts %lu.\n", num_fonts);
bRet = is_truetype_font_installed("wine_test"); todo_wine @@ -5159,12 +5159,12 @@ static void test_AddFontMemResource(void) test_realization_info("wine_test", font_size, TRUE);
bRet = RemoveFontMemResourceEx(ret); - ok(bRet, "RemoveFontMemResourceEx error %d\n", GetLastError()); + ok(bRet, "RemoveFontMemResourceEx error %ld\n", GetLastError());
free_font(font);
bRet = DeleteFileA(ttf_name); - ok(bRet, "Failed to delete font file, %d.\n", GetLastError()); + ok(bRet, "Failed to delete font file, %ld.\n", GetLastError());
font = load_font("sserife.fon", &font_size); if (!font) @@ -5177,14 +5177,14 @@ static void test_AddFontMemResource(void) ret = AddFontMemResourceEx(font, 0, NULL, NULL); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = AddFontMemResourceEx(font, 10, NULL, NULL); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
num_fonts = 0xdeadbeef; @@ -5192,7 +5192,7 @@ static void test_AddFontMemResource(void) ret = AddFontMemResourceEx(font, 0, NULL, &num_fonts); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
@@ -5201,14 +5201,14 @@ static void test_AddFontMemResource(void) ret = AddFontMemResourceEx(font, 10, NULL, &num_fonts); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == 0xdeadbeef, - "Expected GetLastError() to return 0xdeadbeef, got %u\n", + "Expected GetLastError() to return 0xdeadbeef, got %lu\n", GetLastError()); ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
num_fonts = 0xdeadbeef; SetLastError(0xdeadbeef); ret = AddFontMemResourceEx(font, font_size, NULL, &num_fonts); - ok(ret != 0, "AddFontMemResourceEx error %d\n", GetLastError()); + ok(ret != 0, "AddFontMemResourceEx error %ld\n", GetLastError()); ok(num_fonts != 0xdeadbeef, "number of loaded fonts should not be 0xdeadbeef\n"); ok(num_fonts != 0, "number of loaded fonts should not be 0\n");
@@ -5216,7 +5216,7 @@ static void test_AddFontMemResource(void)
SetLastError(0xdeadbeef); bRet = RemoveFontMemResourceEx(ret); - ok(bRet, "RemoveFontMemResourceEx error %d\n", GetLastError()); + ok(bRet, "RemoveFontMemResourceEx error %ld\n", GetLastError());
/* test invalid pointer to number of loaded fonts */ font = load_font("sserife.fon", &font_size); @@ -5226,14 +5226,14 @@ static void test_AddFontMemResource(void) ret = AddFontMemResourceEx(font, font_size, NULL, (void *)0xdeadbeef); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == 0xdeadbeef, - "Expected GetLastError() to return 0xdeadbeef, got %u\n", + "Expected GetLastError() to return 0xdeadbeef, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = AddFontMemResourceEx(font, font_size, NULL, NULL); ok(!ret, "AddFontMemResourceEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
free_font(font); @@ -5245,7 +5245,7 @@ static INT CALLBACK enum_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
if (type != TRUETYPE_FONTTYPE) return 1;
- ok(ntm->tmWeight == elf->lfWeight, "expected %d got %d\n", ntm->tmWeight, elf->lfWeight); + ok(ntm->tmWeight == elf->lfWeight, "expected %ld got %ld\n", ntm->tmWeight, elf->lfWeight);
lf = (LOGFONTA *)lparam; *lf = *elf; @@ -5263,7 +5263,7 @@ static INT CALLBACK enum_all_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA * ret = strcmp(lf->lfFaceName, elf->lfFaceName); if(ret == 0) { - ok(ntm->tmWeight == elf->lfWeight, "expected %d got %d\n", ntm->tmWeight, elf->lfWeight); + ok(ntm->tmWeight == elf->lfWeight, "expected %ld got %ld\n", ntm->tmWeight, elf->lfWeight); *lf = *elf; return 0; } @@ -5304,20 +5304,20 @@ static void test_EnumFonts(void) ok(!ret, "font Arial is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); - ok(lf.lfWeight == FW_NORMAL, "expected FW_NORMAL got %d\n", lf.lfWeight); + ok(lf.lfWeight == FW_NORMAL, "expected FW_NORMAL got %ld\n", lf.lfWeight);
strcpy(lf.lfFaceName, "Arial"); ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); ok(!ret, "font Arial is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); - ok(lf.lfWeight == FW_NORMAL, "expected FW_NORMAL got %d\n", lf.lfWeight); + ok(lf.lfWeight == FW_NORMAL, "expected FW_NORMAL got %ld\n", lf.lfWeight);
ret = EnumFontFamiliesA(hdc, "Arial Bold", enum_fonts_proc, (LPARAM)&lf); ok(!ret, "font Arial Bold is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); - ok(lf.lfWeight == FW_BOLD, "expected FW_BOLD got %d\n", lf.lfWeight); + ok(lf.lfWeight == FW_BOLD, "expected FW_BOLD got %ld\n", lf.lfWeight);
strcpy(lf.lfFaceName, "Arial Bold"); ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); @@ -5327,7 +5327,7 @@ static void test_EnumFonts(void) ok(!ret, "font Arial Bold Italic is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); - ok(lf.lfWeight == FW_BOLD, "expected FW_BOLD got %d\n", lf.lfWeight); + ok(lf.lfWeight == FW_BOLD, "expected FW_BOLD got %ld\n", lf.lfWeight);
strcpy(lf.lfFaceName, "Arial Bold Italic"); ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); @@ -5348,7 +5348,7 @@ static INT CALLBACK enum_ms_shell_dlg_proc(const LOGFONTA *lf, const TEXTMETRICA struct enum_fullname_data *efnd = (struct enum_fullname_data *)lParam;
if (winetest_debug > 2) - trace("enumed font "%s", charset %d, height %d, weight %d, italic %d\n", + trace("enumed font "%s", charset %d, height %ld, weight %ld, italic %d\n", lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
if (type != TRUETYPE_FONTTYPE) return 1; @@ -5369,7 +5369,7 @@ static INT CALLBACK enum_ms_shell_dlg2_proc(const LOGFONTA *lf, const TEXTMETRIC struct enum_fullname_data *efnd = (struct enum_fullname_data *)lParam;
if (winetest_debug > 2) - trace("enumed font "%s", charset %d, height %d, weight %d, italic %d\n", + trace("enumed font "%s", charset %d, height %ld, weight %ld, italic %d\n", lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
if (type != TRUETYPE_FONTTYPE) return 1; @@ -5695,7 +5695,7 @@ static void test_GetGlyphOutline_empty_contour(void) lstrcpyA(lf.lfFaceName, "wine_test");
hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hdc = GetDC(NULL);
@@ -5703,17 +5703,17 @@ static void test_GetGlyphOutline_empty_contour(void) ok(hfont_prev != NULL, "SelectObject failed\n");
ret = GetGlyphOutlineW(hdc, 0xa8, GGO_NATIVE, &gm, 0, NULL, &mat); - ok(ret == 228, "GetGlyphOutline returned %d, expected 228\n", ret); + ok(ret == 228, "GetGlyphOutline returned %ld, expected 228\n", ret);
header = (TTPOLYGONHEADER*)buf; ret = GetGlyphOutlineW(hdc, 0xa8, GGO_NATIVE, &gm, sizeof(buf), buf, &mat); - ok(ret == 228, "GetGlyphOutline returned %d, expected 228\n", ret); - ok(header->cb == 36, "header->cb = %d, expected 36\n", header->cb); - ok(header->dwType == TT_POLYGON_TYPE, "header->dwType = %d, expected TT_POLYGON_TYPE\n", header->dwType); + ok(ret == 228, "GetGlyphOutline returned %ld, expected 228\n", ret); + ok(header->cb == 36, "header->cb = %ld, expected 36\n", header->cb); + ok(header->dwType == TT_POLYGON_TYPE, "header->dwType = %ld, expected TT_POLYGON_TYPE\n", header->dwType); header = (TTPOLYGONHEADER*)((char*)header+header->cb); - ok(header->cb == 96, "header->cb = %d, expected 96\n", header->cb); + ok(header->cb == 96, "header->cb = %ld, expected 96\n", header->cb); header = (TTPOLYGONHEADER*)((char*)header+header->cb); - ok(header->cb == 96, "header->cb = %d, expected 96\n", header->cb); + ok(header->cb == 96, "header->cb = %ld, expected 96\n", header->cb);
SelectObject(hdc, hfont_prev); DeleteObject(hfont); @@ -5736,7 +5736,7 @@ static void test_GetGlyphOutline_metric_clipping(void)
SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hdc = GetDC(NULL);
@@ -5745,15 +5745,15 @@ static void test_GetGlyphOutline_metric_clipping(void)
SetLastError(0xdeadbeef); ret = GetTextMetricsA(hdc, &tm); - ok(ret, "GetTextMetrics error %u\n", GetLastError()); + ok(ret, "GetTextMetrics error %lu\n", GetLastError());
GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); ok(gm.gmptGlyphOrigin.y <= tm.tmAscent, - "Glyph top(%d) exceeds ascent(%d)\n", + "Glyph top(%ld) exceeds ascent(%ld)\n", gm.gmptGlyphOrigin.y, tm.tmAscent); GetGlyphOutlineA(hdc, 'D', GGO_METRICS, &gm, 0, NULL, &mat); ok(gm.gmptGlyphOrigin.y - gm.gmBlackBoxY >= -tm.tmDescent, - "Glyph bottom(%d) exceeds descent(%d)\n", + "Glyph bottom(%ld) exceeds descent(%ld)\n", gm.gmptGlyphOrigin.y - gm.gmBlackBoxY, -tm.tmDescent);
/* Test tmLastChar - wine_test has code points fffb-fffe mapped to glyph 0 */ @@ -5781,7 +5781,7 @@ static void test_GetGlyphOutline_character(void) lstrcpyA(lf.lfFaceName, "wine_test");
hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hdc = GetDC(NULL);
@@ -5832,7 +5832,7 @@ static void test_fstype_fixup(void)
SetLastError(0xdeadbeef); hfont = CreateFontIndirectA(&lf); - ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + ok(hfont != 0, "CreateFontIndirectA error %lu\n", GetLastError());
hdc = GetDC(NULL);
@@ -5843,7 +5843,7 @@ static void test_fstype_fixup(void) otm = HeapAlloc(GetProcessHeap(), 0, otm_size); otm->otmSize = sizeof(*otm); ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); - ok(ret == otm->otmSize, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + ok(ret == otm->otmSize, "expected %u, got %lu, error %ld\n", otm->otmSize, ret, GetLastError());
/* Test font has fsType set to 0x7fff, test that reserved bits are filtered out, valid bits are 1, 2, 3, 8, 9. */ @@ -5877,9 +5877,9 @@ static void test_CreateScalableFontResource(void) ok(!ret, "font wine_test should not be enumerated\n");
ret = GetTempPathA(MAX_PATH, tmp_path); - ok(ret, "GetTempPath() error %d\n", GetLastError()); + ok(ret, "GetTempPath() error %ld\n", GetLastError()); ret = GetTempFileNameA(tmp_path, "fot", 0, fot_name); - ok(ret, "GetTempFileName() error %d\n", GetLastError()); + ok(ret, "GetTempFileName() error %ld\n", GetLastError());
ret = GetFileAttributesA(fot_name); ok(ret != INVALID_FILE_ATTRIBUTES, "file %s does not exist\n", fot_name); @@ -5887,31 +5887,31 @@ static void test_CreateScalableFontResource(void) SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(0, fot_name, ttf_name, NULL); ok(!ret, "CreateScalableFontResource() should fail\n"); - ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(0, fot_name, ttf_name, ""); ok(!ret, "CreateScalableFontResource() should fail\n"); - ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %ld\n", GetLastError());
file_part = strrchr(ttf_name, '\'); SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(0, fot_name, file_part, tmp_path); ok(!ret, "CreateScalableFontResource() should fail\n"); - ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(0, fot_name, "random file name", tmp_path); ok(!ret, "CreateScalableFontResource() should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(0, fot_name, NULL, ttf_name); ok(!ret, "CreateScalableFontResource() should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %ld\n", GetLastError());
ret = DeleteFileA(fot_name); - ok(ret, "DeleteFile() error %d\n", GetLastError()); + ok(ret, "DeleteFile() error %ld\n", GetLastError());
ret = RemoveFontResourceExA(fot_name, 0, 0); ok(!ret, "RemoveFontResourceEx() should fail\n"); @@ -5919,14 +5919,14 @@ static void test_CreateScalableFontResource(void) /* test public font resource */ SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(0, fot_name, ttf_name, NULL); - ok(ret, "CreateScalableFontResource() error %d\n", GetLastError()); + ok(ret, "CreateScalableFontResource() error %ld\n", GetLastError());
ret = is_truetype_font_installed("wine_test"); ok(!ret, "font wine_test should not be enumerated\n");
SetLastError(0xdeadbeef); ret = AddFontResourceExA(fot_name, 0, 0); - ok(ret, "AddFontResourceEx() error %d\n", GetLastError()); + ok(ret, "AddFontResourceEx() error %ld\n", GetLastError());
ret = is_truetype_font_installed("wine_test"); ok(ret, "font wine_test should be enumerated\n"); @@ -5941,7 +5941,7 @@ static void test_CreateScalableFontResource(void)
SetLastError(0xdeadbeef); ret = RemoveFontResourceExA(fot_name, 0, 0); - ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError()); + ok(ret, "RemoveFontResourceEx() error %ld\n", GetLastError());
ret = is_truetype_font_installed("wine_test"); ok(!ret, "font wine_test should not be enumerated\n"); @@ -5954,13 +5954,13 @@ static void test_CreateScalableFontResource(void) { SetLastError(0xdeadbeef); ret = AddFontResourceExA(fot_name, 0, 0); - ok(ret, "AddFontResourceEx() error %d\n", GetLastError()); + ok(ret, "AddFontResourceEx() error %ld\n", GetLastError()); } for (i = 0; i < 5; i++) { SetLastError(0xdeadbeef); ret = RemoveFontResourceExA(fot_name, 0, 0); - ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError()); + ok(ret, "RemoveFontResourceEx() error %ld\n", GetLastError()); } ret = RemoveFontResourceExA(fot_name, 0, 0); ok(!ret, "RemoveFontResourceEx() should fail\n"); @@ -5970,14 +5970,14 @@ static void test_CreateScalableFontResource(void) /* test hidden font resource */ SetLastError(0xdeadbeef); ret = CreateScalableFontResourceA(1, fot_name, ttf_name, NULL); - ok(ret, "CreateScalableFontResource() error %d\n", GetLastError()); + ok(ret, "CreateScalableFontResource() error %ld\n", GetLastError());
ret = is_truetype_font_installed("wine_test"); ok(!ret, "font wine_test should not be enumerated\n");
SetLastError(0xdeadbeef); ret = AddFontResourceExA(fot_name, 0, 0); - ok(ret, "AddFontResourceEx() error %d\n", GetLastError()); + ok(ret, "AddFontResourceEx() error %ld\n", GetLastError());
ret = is_truetype_font_installed("wine_test"); todo_wine @@ -5986,7 +5986,7 @@ static void test_CreateScalableFontResource(void) /* XP allows removing a private font added with 0 flags */ SetLastError(0xdeadbeef); ret = RemoveFontResourceExA(fot_name, FR_PRIVATE, 0); - ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError()); + ok(ret, "RemoveFontResourceEx() error %ld\n", GetLastError());
ret = is_truetype_font_installed("wine_test"); ok(!ret, "font wine_test should not be enumerated\n"); @@ -6088,7 +6088,7 @@ static void check_vertical_metrics(const char *face) ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n"); ret = GetCharABCWidthsW(hdc, code, code, &vabc); ok(ret, "GetCharABCWidthsW failed\n"); - ok(vabc.abcA == vgm.gmptGlyphOrigin.x, "expected %d, got %d\n", + ok(vabc.abcA == vgm.gmptGlyphOrigin.x, "expected %d, got %ld\n", vabc.abcA, vgm.gmptGlyphOrigin.x); ok(vabc.abcB == vgm.gmBlackBoxX, "expected %d, got %d\n", vabc.abcB, vgm.gmBlackBoxX); @@ -6119,13 +6119,13 @@ static void check_vertical_metrics(const char *face) topSideBearing = GET_BE_WORD(topSideBearing); ok(match_off_by_1(vgm.gmptGlyphOrigin.x, MulDiv(topSideBearing, height, otm.otmEMSquare), FALSE), - "expected %d, got %d\n", + "expected %d, got %ld\n", MulDiv(topSideBearing, height, otm.otmEMSquare), vgm.gmptGlyphOrigin.x); } else { ok(vgm.gmptGlyphOrigin.x == rgm.gmptGlyphOrigin.x + vgm.gmCellIncX + otm.otmDescent, - "got %d, expected rgm.origin.x(%d) + vgm.cellIncX(%d) + descent(%d)\n", + "got %ld, expected rgm.origin.x(%ld) + vgm.cellIncX(%d) + descent(%d)\n", vgm.gmptGlyphOrigin.x, rgm.gmptGlyphOrigin.x, vgm.gmCellIncX, otm.otmDescent); }
@@ -6185,7 +6185,7 @@ static void test_vertical_font(void) }
ret = RemoveFontResourceExA(ttf_name, FR_PRIVATE, 0); - ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError()); + ok(ret, "RemoveFontResourceEx() error %ld\n", GetLastError());
DeleteFileA(ttf_name); } @@ -6372,8 +6372,8 @@ static void test_stock_fonts(void) (!strcmp(td[i][j].face_name, "System") && td[i][j].height > 16))) ok(height == td[i][j].height_pixels, "%d(%d): expected height %d, got %d\n", i, j, td[i][j].height_pixels, height);
- ok(td[i][j].weight == lf.lfWeight, "%d(%d): expected lfWeight %d, got %d\n", i, j, td[i][j].weight, lf.lfWeight); - ok(td[i][j].height == lf.lfHeight, "%d(%d): expected lfHeight %d, got %d\n", i, j, td[i][j].height, lf.lfHeight); + ok(td[i][j].weight == lf.lfWeight, "%d(%d): expected lfWeight %d, got %ld\n", i, j, td[i][j].weight, lf.lfWeight); + ok(td[i][j].height == lf.lfHeight, "%d(%d): expected lfHeight %d, got %ld\n", i, j, td[i][j].height, lf.lfHeight); if (td[i][j].face_name[0] == '?') { /* Wine doesn't have this font, skip this case for now. @@ -6412,8 +6412,8 @@ static void test_max_height(void) hfont_old = SelectObject(hdc, hfont); r = GetTextMetricsA(hdc, &tm1); ok(r, "GetTextMetrics failed\n"); - ok(tm1.tmHeight > 0, "expected a positive value, got %d\n", tm1.tmHeight); - ok(tm1.tmAveCharWidth > 0, "expected a positive value, got %d\n", tm1.tmHeight); + ok(tm1.tmHeight > 0, "expected a positive value, got %ld\n", tm1.tmHeight); + ok(tm1.tmAveCharWidth > 0, "expected a positive value, got %ld\n", tm1.tmHeight); DeleteObject(SelectObject(hdc, hfont_old));
/* test the largest value */ @@ -6424,9 +6424,9 @@ static void test_max_height(void) r = GetTextMetricsA(hdc, &tm); ok(r, "GetTextMetrics failed\n"); ok(tm.tmHeight > tm1.tmHeight, - "expected greater than 1 ppem value (%d), got %d\n", tm1.tmHeight, tm.tmHeight); + "expected greater than 1 ppem value (%ld), got %ld\n", tm1.tmHeight, tm.tmHeight); ok(tm.tmAveCharWidth > tm1.tmAveCharWidth, - "expected greater than 1 ppem value (%d), got %d\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); + "expected greater than 1 ppem value (%ld), got %ld\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); DeleteObject(SelectObject(hdc, hfont_old));
/* test an invalid value */ @@ -6438,9 +6438,9 @@ static void test_max_height(void) r = GetTextMetricsA(hdc, &tm); ok(r, "GetTextMetrics failed\n"); ok(tm.tmHeight == tm1.tmHeight, - "expected 1 ppem value (%d), got %d\n", tm1.tmHeight, tm.tmHeight); + "expected 1 ppem value (%ld), got %ld\n", tm1.tmHeight, tm.tmHeight); ok(tm.tmAveCharWidth == tm1.tmAveCharWidth, - "expected 1 ppem value (%d), got %d\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); + "expected 1 ppem value (%ld), got %ld\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); DeleteObject(SelectObject(hdc, hfont_old)); }
@@ -6627,17 +6627,17 @@ static void test_fake_bold_font(void)
/* compare results (outline) */ ok(data[0].tm.tmHeight == data[1].tm.tmHeight, - "expected %d, got %d\n", data[0].tm.tmHeight, data[1].tm.tmHeight); + "expected %ld, got %ld\n", data[0].tm.tmHeight, data[1].tm.tmHeight); ok(data[0].tm.tmAscent == data[1].tm.tmAscent, - "expected %d, got %d\n", data[0].tm.tmAscent, data[1].tm.tmAscent); + "expected %ld, got %ld\n", data[0].tm.tmAscent, data[1].tm.tmAscent); ok(data[0].tm.tmDescent == data[1].tm.tmDescent, - "expected %d, got %d\n", data[0].tm.tmDescent, data[1].tm.tmDescent); + "expected %ld, got %ld\n", data[0].tm.tmDescent, data[1].tm.tmDescent); ok(data[0].tm.tmAveCharWidth + 1 == data[1].tm.tmAveCharWidth, - "expected %d, got %d\n", data[0].tm.tmAveCharWidth + 1, data[1].tm.tmAveCharWidth); + "expected %ld, got %ld\n", data[0].tm.tmAveCharWidth + 1, data[1].tm.tmAveCharWidth); ok(data[0].tm.tmMaxCharWidth + 1 == data[1].tm.tmMaxCharWidth, - "expected %d, got %d\n", data[0].tm.tmMaxCharWidth + 1, data[1].tm.tmMaxCharWidth); + "expected %ld, got %ld\n", data[0].tm.tmMaxCharWidth + 1, data[1].tm.tmMaxCharWidth); ok(data[0].tm.tmOverhang == data[1].tm.tmOverhang, - "expected %d, got %d\n", data[0].tm.tmOverhang, data[1].tm.tmOverhang); + "expected %ld, got %ld\n", data[0].tm.tmOverhang, data[1].tm.tmOverhang); ok(data[0].w + 1 == data[1].w, "expected %d, got %d\n", data[0].w + 1, data[1].w);
@@ -6683,19 +6683,19 @@ static void test_fake_bold_font(void) continue; } ok(data[i].tm.tmHeight == data[i+1].tm.tmHeight, - "expected %d, got %d\n", data[i].tm.tmHeight, data[i+1].tm.tmHeight); + "expected %ld, got %ld\n", data[i].tm.tmHeight, data[i+1].tm.tmHeight); ok(data[i].tm.tmAscent == data[i+1].tm.tmAscent, - "expected %d, got %d\n", data[i].tm.tmAscent, data[i+1].tm.tmAscent); + "expected %ld, got %ld\n", data[i].tm.tmAscent, data[i+1].tm.tmAscent); ok(data[i].tm.tmDescent == data[i+1].tm.tmDescent, - "expected %d, got %d\n", data[i].tm.tmDescent, data[i+1].tm.tmDescent); + "expected %ld, got %ld\n", data[i].tm.tmDescent, data[i+1].tm.tmDescent); ok(data[i+1].tm.tmAveCharWidth - data[i].tm.tmAveCharWidth == diff, - "expected %d, got %d\n", diff, data[i+1].tm.tmAveCharWidth - data[i].tm.tmAveCharWidth); + "expected %d, got %ld\n", diff, data[i+1].tm.tmAveCharWidth - data[i].tm.tmAveCharWidth); ok(data[i+1].tm.tmMaxCharWidth - data[i].tm.tmMaxCharWidth == diff, - "expected %d, got %d\n", diff, data[i+1].tm.tmMaxCharWidth - data[i].tm.tmMaxCharWidth); + "expected %d, got %ld\n", diff, data[i+1].tm.tmMaxCharWidth - data[i].tm.tmMaxCharWidth); ok(data[i].tm.tmOverhang == 0, - "expected 0, got %d\n", data[i].tm.tmOverhang); + "expected 0, got %ld\n", data[i].tm.tmOverhang); ok(data[i+1].tm.tmOverhang == 1, - "expected 1, got %d\n", data[i+1].tm.tmOverhang); + "expected 1, got %ld\n", data[i+1].tm.tmOverhang); ok(data[i].w + 1 == data[i+1].w, "expected %d, got %d\n", data[i].w + 1, data[i+1].w); } @@ -7325,7 +7325,7 @@ static void test_GetCharWidthInfo(void) ok(hfont_prev != NULL, "SelectObject failed\n");
ret = GetFontData(hdc, MS_MAKE_TAG('h','h','e','a'), 0, &hhea, sizeof(hhea)); - ok(ret == sizeof(hhea), "got %u\n", ret); + ok(ret == sizeof(hhea), "got %lu\n", ret); minLeftSideBearing = GET_BE_WORD(hhea.minLeftSideBearing); minRightSideBearing = GET_BE_WORD(hhea.minRightSideBearing);
@@ -7377,8 +7377,8 @@ static void test_GetCharWidthInfo(void) pt[0].x = info.lsb; pt[0].y = 0; pt[1].x = info.rsb; pt[1].y = 0; DPtoLP(hdc, pt, 2); - ok(pt[0].x == info2.lsb, "expected %d, got %d\n", pt[0].x, info2.lsb); - ok(pt[1].x == info2.rsb, "expected %d, got %d\n", pt[1].x, info2.rsb); + ok(pt[0].x == info2.lsb, "expected %ld, got %d\n", pt[0].x, info2.lsb); + ok(pt[1].x == info2.rsb, "expected %ld, got %d\n", pt[1].x, info2.rsb);
DeleteObject(SelectObject(hdc, hfont_prev)); ReleaseDC(NULL, hdc); @@ -7511,7 +7511,7 @@ static void test_GetCharacterPlacement_kerning(void) kp = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*kp));
ret = GetKerningPairsW(hdc, count, kp); - ok(ret == count, "got %u, expected %u\n", ret, count); + ok(ret == count, "got %lu, expected %lu\n", ret, count);
size = kern_amount = idx = 0; for (i = 0; i < count; i++) @@ -7559,19 +7559,19 @@ static void test_GetCharacterPlacement_kerning(void) goto done; }
- ok(width + kern_amount == width_kern, "%d + %d != %d\n", width, kern_amount, width_kern); + ok(width + kern_amount == width_kern, "%ld + %d != %ld\n", width, kern_amount, width_kern);
kern_amount = idx = 0; for (i = 0; i < count; i += 3, idx++) { - ok(pos[i] + kern_amount == pos_kern[i], "%d: %d + %d != %d\n", i, pos[i], kern_amount, pos_kern[i]); + ok(pos[i] + kern_amount == pos_kern[i], "%ld: %d + %d != %d\n", i, pos[i], kern_amount, pos_kern[i]); kern_amount += kern[idx]; - ok(pos[i+1] + kern_amount == pos_kern[i+1], "%d: %d + %d != %d\n", i, pos[i+1], kern_amount, pos_kern[i+1]); - ok(pos[i+2] + kern_amount == pos_kern[i+2], "%d: %d + %d != %d\n", i, pos[i+2], kern_amount, pos_kern[i+2]); + ok(pos[i+1] + kern_amount == pos_kern[i+1], "%ld: %d + %d != %d\n", i, pos[i+1], kern_amount, pos_kern[i+1]); + ok(pos[i+2] + kern_amount == pos_kern[i+2], "%ld: %d + %d != %d\n", i, pos[i+2], kern_amount, pos_kern[i+2]);
- ok(dx[i] + kern[idx] == dx_kern[i], "%d: %d + %d != %d\n", i, dx[i], kern[idx], dx_kern[i]); - ok(dx[i+1] == dx_kern[i+1], "%d: %d != %d\n", i, dx[i+1], dx_kern[i+1]); - ok(dx[i+2] == dx_kern[i+2], "%d: %d != %d\n", i, dx[i+2], dx_kern[i+2]); + ok(dx[i] + kern[idx] == dx_kern[i], "%ld: %d + %d != %d\n", i, dx[i], kern[idx], dx_kern[i]); + ok(dx[i+1] == dx_kern[i+1], "%ld: %d != %d\n", i, dx[i+1], dx_kern[i+1]); + ok(dx[i+2] == dx_kern[i+2], "%ld: %d != %d\n", i, dx[i+2], dx_kern[i+2]); }
done: @@ -7600,7 +7600,7 @@ static void test_select_object(void) SetLastError(0xdeadbeef); old_font = SelectObject(NULL, hfont); ok(!old_font, "SelectObject returned %p\n", old_font); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
DeleteObject(hfont); diff --git a/dlls/gdi32/tests/gdiobj.c b/dlls/gdi32/tests/gdiobj.c index e6efce8e552..b9671c0fb9f 100644 --- a/dlls/gdi32/tests/gdiobj.c +++ b/dlls/gdi32/tests/gdiobj.c @@ -47,41 +47,41 @@ static void test_gdi_objects(void) SetLastError(0); hp = SelectObject(NULL, GetStockObject(BLACK_PEN)); ok(!hp && (GetLastError() == ERROR_INVALID_HANDLE || broken(!GetLastError())), - "SelectObject(NULL DC) expected 0, ERROR_INVALID_HANDLE, got %p, %u\n", + "SelectObject(NULL DC) expected 0, ERROR_INVALID_HANDLE, got %p, %lu\n", hp, GetLastError());
/* With a valid DC and a NULL object, the call returns 0 but does not SetLastError() */ SetLastError(0); hp = SelectObject(hdc, NULL); ok(!hp && !GetLastError(), - "SelectObject(NULL obj) expected 0, NO_ERROR, got %p, %u\n", + "SelectObject(NULL obj) expected 0, NO_ERROR, got %p, %lu\n", hp, GetLastError());
/* The DC is unaffected by the NULL SelectObject */ SetLastError(0); hp = SelectObject(hdc, GetStockObject(BLACK_PEN)); ok(hp && !GetLastError(), - "SelectObject(post NULL) expected non-null, NO_ERROR, got %p, %u\n", + "SelectObject(post NULL) expected non-null, NO_ERROR, got %p, %lu\n", hp, GetLastError());
/* GetCurrentObject does not SetLastError() on a null object */ SetLastError(0); hp = GetCurrentObject(NULL, OBJ_PEN); ok(!hp && !GetLastError(), - "GetCurrentObject(NULL DC) expected 0, NO_ERROR, got %p, %u\n", + "GetCurrentObject(NULL DC) expected 0, NO_ERROR, got %p, %lu\n", hp, GetLastError());
/* DeleteObject does not SetLastError() on a null object */ ret = DeleteObject(NULL); ok( !ret && !GetLastError(), - "DeleteObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n", + "DeleteObject(NULL obj), expected 0, NO_ERROR, got %d, %lu\n", ret, GetLastError());
/* GetObject does not SetLastError() on a null object */ SetLastError(0); i = GetObjectA(NULL, sizeof(buff), buff); ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_INVALID_PARAMETER), - "GetObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n", + "GetObject(NULL obj), expected 0, NO_ERROR, got %d, %lu\n", i, GetLastError());
/* GetObject expects ERROR_NOACCESS when passed an invalid buffer */ @@ -89,21 +89,21 @@ static void test_gdi_objects(void) SetLastError(0); i = GetObjectA(hp, (INT_PTR)buff, (LPVOID)sizeof(buff)); ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_NOACCESS), - "GetObject(invalid buff), expected 0, ERROR_NOACCESS, got %d, %u\n", + "GetObject(invalid buff), expected 0, ERROR_NOACCESS, got %d, %lu\n", i, GetLastError());
/* GetObjectType does SetLastError() on a null object */ SetLastError(0); i = GetObjectType(NULL); ok (!i && GetLastError() == ERROR_INVALID_HANDLE, - "GetObjectType(NULL obj), expected 0, ERROR_INVALID_HANDLE, got %d, %u\n", + "GetObjectType(NULL obj), expected 0, ERROR_INVALID_HANDLE, got %d, %lu\n", i, GetLastError());
/* UnrealizeObject does not SetLastError() on a null object */ SetLastError(0); i = UnrealizeObject(NULL); ok (!i && !GetLastError(), - "UnrealizeObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n", + "UnrealizeObject(NULL obj), expected 0, NO_ERROR, got %d, %lu\n", i, GetLastError());
ReleaseDC(NULL, hdc); @@ -125,7 +125,7 @@ static DWORD WINAPI thread_proc(void *param) struct hgdiobj_event *hgdiobj_event = param;
hgdiobj_event->hdc = CreateDCA("display", NULL, NULL, NULL); - ok(hgdiobj_event->hdc != NULL, "CreateDC error %u\n", GetLastError()); + ok(hgdiobj_event->hdc != NULL, "CreateDC error %lu\n", GetLastError());
hgdiobj_event->hgdiobj1 = CreatePen(PS_DASHDOTDOT, 17, RGB(1, 2, 3)); ok(hgdiobj_event->hgdiobj1 != 0, "Failed to create pen\n"); @@ -135,7 +135,7 @@ static DWORD WINAPI thread_proc(void *param)
SetEvent(hgdiobj_event->ready_event); status = WaitForSingleObject(hgdiobj_event->stop_event, INFINITE); - ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError()); + ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %lu\n", GetLastError());
ok(!GetObjectA(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n");
@@ -155,43 +155,43 @@ static void test_thread_objects(void) BOOL bRet;
hgdiobj_event.stop_event = CreateEventA(NULL, 0, 0, NULL); - ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n", GetLastError()); + ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %lu\n", GetLastError()); hgdiobj_event.ready_event = CreateEventA(NULL, 0, 0, NULL); - ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %u\n", GetLastError()); + ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %lu\n", GetLastError());
hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid); - ok(hthread != NULL, "CreateThread error %u\n", GetLastError()); + ok(hthread != NULL, "CreateThread error %lu\n", GetLastError());
status = WaitForSingleObject(hgdiobj_event.ready_event, INFINITE); - ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError()); + ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %lu\n", GetLastError());
ret = GetObjectA(hgdiobj_event.hgdiobj1, sizeof(lp), &lp); - ok(ret == sizeof(lp), "GetObject error %u\n", GetLastError()); + ok(ret == sizeof(lp), "GetObject error %lu\n", GetLastError()); ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle); - ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08x\n", lp.lopnColor); + ok(lp.lopnWidth.x == 17, "wrong pen width.y %ld\n", lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "wrong pen width.y %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08lx\n", lp.lopnColor);
ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY); ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret);
bRet = DeleteObject(hgdiobj_event.hgdiobj1); - ok(bRet, "DeleteObject error %u\n", GetLastError()); + ok(bRet, "DeleteObject error %lu\n", GetLastError()); bRet = DeleteDC(hgdiobj_event.hdc); - ok(bRet, "DeleteDC error %u\n", GetLastError()); + ok(bRet, "DeleteDC error %lu\n", GetLastError());
type = GetObjectType(hgdiobj_event.hgdiobj2); - ok(type == OBJ_REGION, "GetObjectType returned %u\n", type); + ok(type == OBJ_REGION, "GetObjectType returned %lu\n", type);
SetEvent(hgdiobj_event.stop_event); status = WaitForSingleObject(hthread, INFINITE); - ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError()); + ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %lu\n", GetLastError()); CloseHandle(hthread);
type = GetObjectType(hgdiobj_event.hgdiobj2); - ok(type == OBJ_REGION, "GetObjectType returned %u\n", type); + ok(type == OBJ_REGION, "GetObjectType returned %lu\n", type); bRet = DeleteObject(hgdiobj_event.hgdiobj2); - ok(bRet, "DeleteObject error %u\n", GetLastError()); + ok(bRet, "DeleteObject error %lu\n", GetLastError());
CloseHandle(hgdiobj_event.stop_event); CloseHandle(hgdiobj_event.ready_event); @@ -216,7 +216,7 @@ static void test_GetCurrentObject(void) assert(hdc != 0);
type = GetObjectType(hdc); - ok(type == OBJ_MEMDC, "GetObjectType returned %u\n", type); + ok(type == OBJ_MEMDC, "GetObjectType returned %lu\n", type);
hpen = CreatePen(PS_SOLID, 10, RGB(10, 20, 30)); assert(hpen != 0); @@ -354,9 +354,9 @@ static void test_handles_on_win64(void) hrgn_test = (HRGN)(ULONG_PTR)((ULONG_PTR)hrgn | ((ULONGLONG)cases[i].high << 32) | cases[i].low); type = GetObjectType( hrgn_test ); if (cases[i].ret) - ok( type == OBJ_REGION, "wrong type %u\n", type ); + ok( type == OBJ_REGION, "wrong type %lu\n", type ); else - ok( type == 0, "wrong type %u\n", type ); + ok( type == 0, "wrong type %lu\n", type ); ret = DeleteObject(hrgn_test); ok( cases[i].ret == ret, "DeleteObject should return %s (%p)\n", cases[i].ret ? "TRUE" : "FALSE", hrgn_test); @@ -430,7 +430,7 @@ static void test_shared_handle_table(void) handle = HandleToULong( hrgn ); entry = &gdi_shared->Handles[handle & 0xffff]; todo_wine - ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %x\n", + ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %lx\n", entry->Owner.ProcessId, GetCurrentProcessId());
test_shared_handle_entry( hrgn, NTGDI_OBJ_REGION, FALSE ); @@ -442,7 +442,7 @@ static void test_shared_handle_table(void) ok(entry->Type == 4, "Type = %x\n", entry->Type); ok(entry->Object, "Object = NULL\n"); todo_wine - ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %x\n", + ok(entry->Owner.ProcessId == GetCurrentProcessId(), "ProcessId = %x, expected %lx\n", entry->Owner.ProcessId, GetCurrentProcessId()); ok(entry->Owner.Count == 0, "Count = %u\n", entry->Owner.Count);
@@ -465,7 +465,7 @@ static void test_shared_handle_table(void) test_shared_handle_entry( GetStockObject( STOCK_LAST + 1 ), NTGDI_OBJ_BITMAP, TRUE );
dc = CreateDCW(L"display", NULL, NULL, NULL); - ok(GetObjectType(dc) == OBJ_DC, "GetObjectType(dc) = %x\n", GetObjectType(dc)); + ok(GetObjectType(dc) == OBJ_DC, "GetObjectType(dc) = %lx\n", GetObjectType(dc)); test_shared_handle_entry( dc, NTGDI_OBJ_DC, FALSE ); DeleteDC(dc);
diff --git a/dlls/gdi32/tests/icm.c b/dlls/gdi32/tests/icm.c index 509d5c0c579..79a5eabb930 100644 --- a/dlls/gdi32/tests/icm.c +++ b/dlls/gdi32/tests/icm.c @@ -48,12 +48,12 @@ static void test_GetICMProfileA( HDC dc ) size = MAX_PATH; ret = GetICMProfileA( dc, &size, NULL ); ok( !ret, "GetICMProfileA succeeded\n" ); - ok( size > 0, "got %u\n", size ); + ok( size > 0, "got %lu\n", size );
size = 0; ret = GetICMProfileA( dc, &size, NULL ); ok( !ret, "GetICMProfileA succeeded\n" ); - ok( size > 0, "got %u\n", size ); + ok( size > 0, "got %lu\n", size );
size = MAX_PATH; ret = GetICMProfileA( NULL, &size, filename ); @@ -67,14 +67,14 @@ static void test_GetICMProfileA( HDC dc ) ok( !ret, "GetICMProfileA succeeded\n" ); ok( size, "expected size > 0\n" ); ok( filename[0] == 0, "Expected filename to be empty\n" ); - ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %ld, expected ERROR_INSUFFICIENT_BUFFER\n", error );
ret = GetICMProfileA( dc, NULL, filename ); ok( !ret, "GetICMProfileA succeeded\n" );
size = MAX_PATH; ret = GetICMProfileA( dc, &size, filename ); - ok( ret, "GetICMProfileA failed %d\n", GetLastError() ); + ok( ret, "GetICMProfileA failed %ld\n", GetLastError() );
trace( "%s\n", filename ); } @@ -102,7 +102,7 @@ static void test_GetICMProfileW( HDC dc ) /* Vista crashes */ size = MAX_PATH; ret = GetICMProfileW( dc, &size, NULL ); - ok( ret, "GetICMProfileW failed %d\n", GetLastError() ); + ok( ret, "GetICMProfileW failed %ld\n", GetLastError() ); }
ret = GetICMProfileW( dc, NULL, filename ); @@ -115,7 +115,7 @@ static void test_GetICMProfileW( HDC dc ) size = 0; ret = GetICMProfileW( dc, &size, NULL ); ok( !ret, "GetICMProfileW succeeded\n" ); - ok( size > 0, "got %u\n", size ); + ok( size > 0, "got %lu\n", size );
size = 0; SetLastError(0xdeadbeef); @@ -123,11 +123,11 @@ static void test_GetICMProfileW( HDC dc ) error = GetLastError(); ok( !ret, "GetICMProfileW succeeded\n" ); ok( size, "expected size > 0\n" ); - ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %ld, expected ERROR_INSUFFICIENT_BUFFER\n", error );
size = MAX_PATH; ret = GetICMProfileW( dc, &size, filename ); - ok( ret, "GetICMProfileW failed %d\n", GetLastError() ); + ok( ret, "GetICMProfileW failed %ld\n", GetLastError() ); }
static void test_SetICMMode( HDC dc ) @@ -145,24 +145,24 @@ static void test_SetICMMode( HDC dc )
SetLastError( 0xdeadbeef ); ret = SetICMMode( NULL, 0 ); - ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() ); + ok( !ret, "SetICMMode succeeded (%ld)\n", GetLastError() );
ret = SetICMMode( dc, -1 ); - ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() ); + ok( !ret, "SetICMMode succeeded (%ld)\n", GetLastError() );
save = SetICMMode( dc, ICM_QUERY ); - ok( save == ICM_ON || save == ICM_OFF, "SetICMMode failed (%d)\n", GetLastError() ); + ok( save == ICM_ON || save == ICM_OFF, "SetICMMode failed (%ld)\n", GetLastError() );
if (save == ICM_ON) knob = ICM_OFF; else knob = ICM_ON;
ret = SetICMMode( dc, knob ); - todo_wine ok( ret, "SetICMMode failed (%d)\n", GetLastError() ); + todo_wine ok( ret, "SetICMMode failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, ICM_QUERY ); - todo_wine ok( ret == knob, "SetICMMode failed (%d)\n", GetLastError() ); + todo_wine ok( ret == knob, "SetICMMode failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, save ); - ok( ret, "SetICMMode failed (%d)\n", GetLastError() ); + ok( ret, "SetICMMode failed (%ld)\n", GetLastError() );
SetLastError( 0xdeadbeef ); dc = CreateDCW( L"DISPLAY", NULL, NULL, NULL ); @@ -171,10 +171,10 @@ static void test_SetICMMode( HDC dc ) win_skip( "CreateDCW is not implemented\n" ); return; } - ok( dc != NULL, "CreateDCW failed (%d)\n", GetLastError() ); + ok( dc != NULL, "CreateDCW failed (%ld)\n", GetLastError() );
ret = SetICMMode( dc, ICM_QUERY ); - ok( ret == ICM_OFF, "SetICMMode failed (%d)\n", GetLastError() ); + ok( ret == ICM_OFF, "SetICMMode failed (%ld)\n", GetLastError() );
DeleteDC( dc ); } @@ -235,31 +235,31 @@ static void test_SetICMProfileA( HDC dc )
len = sizeof(profile); ret = GetICMProfileA( dc, &len, profile ); - ok(ret, "GetICMProfileA failed %u\n", GetLastError()); + ok(ret, "GetICMProfileA failed %lu\n", GetLastError());
SetLastError( 0xdeadbeef ); ret = SetICMProfileA( NULL, NULL ); error = GetLastError(); ok(!ret, "SetICMProfileA succeeded\n"); ok(error == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", error); + "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = SetICMProfileA( NULL, profile ); error = GetLastError(); ok(!ret, "SetICMProfileA succeeded\n"); ok(error == ERROR_INVALID_HANDLE, - "expected ERROR_INVALID_HANDLE, got %u\n", error); + "expected ERROR_INVALID_HANDLE, got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = SetICMProfileA( dc, NULL ); error = GetLastError(); ok(!ret, "SetICMProfileA succeeded\n"); ok(error == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", error); + "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
ret = SetICMProfileA( dc, profile ); - ok(ret, "SetICMProfileA failed %u\n", GetLastError()); + ok(ret, "SetICMProfileA failed %lu\n", GetLastError()); }
static void test_SetICMProfileW( HDC dc ) @@ -278,28 +278,28 @@ static void test_SetICMProfileW( HDC dc )
len = ARRAY_SIZE(profile); ret = GetICMProfileW( dc, &len, profile ); - ok(ret, "GetICMProfileW failed %u\n", GetLastError()); + ok(ret, "GetICMProfileW failed %lu\n", GetLastError());
SetLastError( 0xdeadbeef ); ret = SetICMProfileW( NULL, NULL ); error = GetLastError(); ok(!ret, "SetICMProfileW succeeded\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = SetICMProfileW( NULL, profile ); error = GetLastError(); ok(!ret, "SetICMProfileW succeeded\n"); - ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", error); + ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = SetICMProfileW( dc, NULL ); error = GetLastError(); ok(!ret, "SetICMProfileW succeeded\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
ret = SetICMProfileW( dc, profile ); - ok(ret, "SetICMProfileW failed %u\n", GetLastError()); + ok(ret, "SetICMProfileW failed %lu\n", GetLastError()); }
START_TEST(icm) diff --git a/dlls/gdi32/tests/mapping.c b/dlls/gdi32/tests/mapping.c index 90c9d5a6617..78c83907a7e 100644 --- a/dlls/gdi32/tests/mapping.c +++ b/dlls/gdi32/tests/mapping.c @@ -39,8 +39,8 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD); { \ POINT _pt = { 1000, 1000 }; \ LPtoDP(_hdc, &_pt, 1); \ - ok(rough_match(_pt.x, _x), "expected x %d, got %d\n", (_x), _pt.x); \ - ok(rough_match(_pt.y, _y), "expected y %d, got %d\n", (_y), _pt.y); \ + ok(rough_match(_pt.x, _x), "expected x %d, got %ld\n", (_x), _pt.x); \ + ok(rough_match(_pt.y, _y), "expected y %d, got %ld\n", (_y), _pt.y); \ }
#define expect_world_transform(_hdc, _em11, _em22) \ @@ -51,7 +51,7 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD); _ret = GetWorldTransform(_hdc, &_xform); \ if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) \ { \ - ok(_ret, "GetWorldTransform error %u\n", GetLastError()); \ + ok(_ret, "GetWorldTransform error %lu\n", GetLastError()); \ ok(_xform.eM11 == (_em11), "expected %f, got %f\n", (_em11), _xform.eM11); \ ok(_xform.eM12 == 0.0, "expected 0.0, got %f\n", _xform.eM12); \ ok(_xform.eM21 == 0.0, "expected 0.0, got %f\n", _xform.eM21); \ @@ -67,9 +67,9 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD); SIZE _size; \ SetLastError(0xdeadbeef); \ _ret = _func(_hdc, &_size); \ - ok(_ret, #_func " error %u\n", GetLastError()); \ - ok(_size.cx == (_cx), "expected cx %d, got %d\n", (_cx), _size.cx); \ - ok(_size.cy == (_cy), "expected cy %d, got %d\n", (_cy), _size.cy); \ + ok(_ret, #_func " error %lu\n", GetLastError()); \ + ok(_size.cx == (_cx), "expected cx %ld, got %ld\n", (_cx), _size.cx); \ + ok(_size.cy == (_cy), "expected cy %ld, got %ld\n", (_cy), _size.cy); \ }
#define expect_viewport_ext(_hdc, _cx, _cy) expect_dc_ext(GetViewportExtEx, _hdc, _cx, _cy) @@ -78,7 +78,8 @@ static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD); static void test_world_transform(void) { HDC hdc; - INT ret, size_cx, size_cy, res_x, res_y, dpi_x, dpi_y; + int ret; + LONG size_cx, size_cy, res_x, res_y, dpi_x, dpi_y; XFORM xform; SIZE size;
@@ -99,11 +100,11 @@ static void test_world_transform(void) res_y = GetDeviceCaps(hdc, VERTRES); dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); - trace("dc size %d x %d, resolution %d x %d dpi %d x %d\n", + trace("dc size %ld x %ld, resolution %ld x %ld dpi %ld x %ld\n", size_cx, size_cy, res_x, res_y, dpi_x, dpi_y );
- expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, 1000, 1000);
@@ -115,10 +116,10 @@ static void test_world_transform(void) ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" ); ok( rough_match( size.cx, size_cx * 10 ) || rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */ - "expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx ); + "expected cx %ld or %d, got %ld\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx ); ok( rough_match( size.cy, size_cy * 10 ) || rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */ - "expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy ); + "expected cy %ld or %d, got %ld\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy ); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, MulDiv(1000 / 10, res_x, size_cx), -MulDiv(1000 / 10, res_y, size_cy));
@@ -126,8 +127,8 @@ static void test_world_transform(void) ret = SetMapMode(hdc, MM_TEXT); ok(ret == MM_LOMETRIC, "expected MM_LOMETRIC, got %d\n", ret);
- expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, 1000, 1000);
@@ -139,8 +140,8 @@ static void test_world_transform(void) return; }
- expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, 1000, 1000);
@@ -164,10 +165,10 @@ static void test_world_transform(void) xform.eDy = 0.0f; SetLastError(0xdeadbeef); ret = SetWorldTransform(hdc, &xform); - ok(ret, "SetWorldTransform error %u\n", GetLastError()); + ok(ret, "SetWorldTransform error %lu\n", GetLastError());
- expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, 20000, 20000);
@@ -179,10 +180,10 @@ static void test_world_transform(void) ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" ); ok( rough_match( size.cx, size_cx * 10 ) || rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */ - "expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx ); + "expected cx %ld or %d, got %ld\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx ); ok( rough_match( size.cy, size_cy * 10 ) || rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */ - "expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy ); + "expected cy %ld or %d, got %ld\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy ); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, MulDiv(20000, res_x, size.cx), -MulDiv(20000, res_y, size.cy));
@@ -190,8 +191,8 @@ static void test_world_transform(void) ret = SetMapMode(hdc, MM_TEXT); ok(ret == MM_LOMETRIC, "expected MM_LOMETRIC, got %d\n", ret);
- expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, 20000, 20000);
@@ -199,17 +200,17 @@ static void test_world_transform(void) size.cy = 0xdeadbeef; ret = SetViewportExtEx(hdc, -1, -1, &size); ok(ret, "SetViewportExtEx(-1, -1) failed\n"); - ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy); - expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %ld,%ld\n", size.cx, size.cy); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, 20000, 20000);
ret = SetMapMode(hdc, MM_ANISOTROPIC); ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
- expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, 20000, 20000);
@@ -217,9 +218,9 @@ static void test_world_transform(void) size.cy = 0xdeadbeef; ret = SetViewportExtEx(hdc, -1, -1, &size); ok(ret, "SetViewportExtEx(-1, -1) failed\n"); - ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy); - expect_viewport_ext(hdc, -1, -1); - expect_window_ext(hdc, 1, 1); + ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %ld,%ld\n", size.cx, size.cy); + expect_viewport_ext(hdc, -1l, -1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, -20000, -20000);
@@ -228,8 +229,8 @@ static void test_world_transform(void) ret = GetGraphicsMode(hdc); ok(ret == GM_COMPATIBLE, "expected GM_COMPATIBLE, got %d\n", ret);
- expect_viewport_ext(hdc, -1, -1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, -1l, -1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 20.0, 20.0); expect_LPtoDP(hdc, -20000, -20000);
@@ -238,7 +239,8 @@ static void test_world_transform(void)
static void test_dc_layout(void) { - INT ret, size_cx, size_cy, res_x, res_y, dpi_x, dpi_y; + INT ret; + LONG size_cx, size_cy, res_x, res_y, dpi_x, dpi_y; SIZE size; POINT pt; HBITMAP bitmap; @@ -265,8 +267,8 @@ static void test_dc_layout(void)
ret = GetMapMode( hdc ); ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret); - expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, 1000, 1000);
@@ -282,16 +284,16 @@ static void test_dc_layout(void) ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret); ret = pGetLayout( hdc ); ok(ret == LAYOUT_RTL, "got %x\n", ret); - expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, -1000 + 99, 1000); GetViewportOrgEx( hdc, &pt ); - ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y ); + ok( pt.x == 0 && pt.y == 0, "wrong origin %ld,%ld\n", pt.x, pt.y ); GetWindowOrgEx( hdc, &pt ); - ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y ); + ok( pt.x == 0 && pt.y == 0, "wrong origin %ld,%ld\n", pt.x, pt.y ); GetDCOrgEx( hdc, &pt ); - ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y ); + ok( pt.x == 0 && pt.y == 0, "wrong origin %ld,%ld\n", pt.x, pt.y ); if (pGetTransform) { XFORM xform; @@ -361,10 +363,10 @@ static void test_dc_layout(void) ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" ); ok( rough_match( size.cx, size_cx * 10 ) || rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */ - "expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx ); + "expected cx %ld or %d, got %ld\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx ); ok( rough_match( size.cy, size_cy * 10 ) || rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */ - "expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy ); + "expected cy %lxd or %d, got %ld\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy ); expect_world_transform(hdc, 1.0, 1.0); expect_LPtoDP(hdc, -MulDiv(1000 / 10, res_x, size_cx) + 99, -MulDiv(1000 / 10, res_y, size_cy));
@@ -435,22 +437,22 @@ static void test_SetWindowExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, LO SetWindowExtEx(hdc, cx, cy, NULL); GetWindowExtEx(hdc, &windowExt); ok(windowExt.cx == cx && windowExt.cy == cy, - "Window extension: Expected %dx%d, got %dx%d\n", + "Window extension: Expected %ldx%ld, got %ldx%ld\n", cx, cy, windowExt.cx, windowExt.cy);
GetViewportExtEx(hdc, &viewportExt); ok(rough_match(viewportExt.cx, expected_vp_cx) && rough_match(viewportExt.cy, expected_vp_cy), - "Viewport extents have not been properly adjusted: Expected %dx%d, got %dx%d\n", + "Viewport extents have not been properly adjusted: Expected %ldx%ld, got %ldx%ld\n", expected_vp_cx, expected_vp_cy, viewportExt.cx, viewportExt.cy);
GetWindowOrgEx(hdc, &windowOrgAfter); ok(windowOrg.x == windowOrgAfter.x && windowOrg.y == windowOrgAfter.y, - "Window origin changed from (%d,%d) to (%d,%d)\n", + "Window origin changed from (%ld,%ld) to (%ld,%ld)\n", windowOrg.x, windowOrg.y, windowOrgAfter.x, windowOrgAfter.y);
GetViewportOrgEx(hdc, &viewportOrgAfter); ok(viewportOrg.x == viewportOrgAfter.x && viewportOrg.y == viewportOrgAfter.y, - "Viewport origin changed from (%d,%d) to (%d,%d)\n", + "Viewport origin changed from (%ld,%ld) to (%ld,%ld)\n", viewportOrg.x, viewportOrg.y, viewportOrgAfter.x, viewportOrgAfter.y); }
@@ -466,22 +468,22 @@ static void test_SetViewportExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, SetViewportExtEx(hdc, cx, cy, NULL); GetViewportExtEx(hdc, &viewportExt); ok(rough_match(viewportExt.cx, expected_vp_cx) && rough_match(viewportExt.cy, expected_vp_cy), - "Viewport extents have not been properly adjusted: Expected %dx%d, got %dx%d\n", + "Viewport extents have not been properly adjusted: Expected %ldx%ld, got %ldx%ld\n", expected_vp_cx, expected_vp_cy, viewportExt.cx, viewportExt.cy);
GetWindowExtEx(hdc, &windowExtAfter); ok(windowExt.cx == windowExtAfter.cx && windowExt.cy == windowExtAfter.cy, - "Window extension changed from %dx%d to %dx%d\n", + "Window extension changed from %ldx%ld to %ldx%ld\n", windowExt.cx, windowExt.cy, windowExtAfter.cx, windowExtAfter.cy);
GetWindowOrgEx(hdc, &windowOrgAfter); ok(windowOrg.x == windowOrgAfter.x && windowOrg.y == windowOrgAfter.y, - "Window origin changed from (%d,%d) to (%d,%d)\n", + "Window origin changed from (%ld,%ld) to (%ld,%ld)\n", windowOrg.x, windowOrg.y, windowOrgAfter.x, windowOrgAfter.y);
GetViewportOrgEx(hdc, &viewportOrgAfter); ok(viewportOrg.x == viewportOrgAfter.x && viewportOrg.y == viewportOrgAfter.y, - "Viewport origin changed from (%d,%d) to (%d,%d)\n", + "Viewport origin changed from (%ld,%ld) to (%ld,%ld)\n", viewportOrg.x, viewportOrg.y, viewportOrgAfter.x, viewportOrgAfter.y); }
@@ -548,13 +550,13 @@ static void test_setvirtualresolution(void) r = pSetVirtualResolution(hdc, 4000, 1000, 400, 200); /* 10 pix/mm x 5 pix/mm */ ok(r == TRUE, "got %d\n", r); expect_LPtoDP(hdc, 1000, 1000); - expect_viewport_ext(hdc, 1, 1); - expect_window_ext(hdc, 1, 1); + expect_viewport_ext(hdc, 1l, 1l); + expect_window_ext(hdc, 1l, 1l);
SetMapMode(hdc, MM_LOMETRIC); expect_LPtoDP(hdc, 1000, -500); - expect_viewport_ext(hdc, 4000, -1000); - expect_window_ext(hdc, 4000, 2000); + expect_viewport_ext(hdc, 4000l, -1000l); + expect_window_ext(hdc, 4000l, 2000l);
/* Doesn't change the device caps */ ok(horz_res == GetDeviceCaps(hdc, HORZRES), "horz_res changed\n"); @@ -567,40 +569,40 @@ static void test_setvirtualresolution(void) SetMapMode(hdc, MM_TEXT); SetMapMode(hdc, MM_LOMETRIC); expect_LPtoDP(hdc, 2000, -500); - expect_viewport_ext(hdc, 8000, -1000); - expect_window_ext(hdc, 4000, 2000); + expect_viewport_ext(hdc, 8000l, -1000l); + expect_window_ext(hdc, 4000l, 2000l);
r = pSetVirtualResolution(hdc, 8000, 1000, 200, 200); /* 40 pix/mm x 5 pix/mm */ ok(r == TRUE, "got %d\n", r); SetMapMode(hdc, MM_TEXT); SetMapMode(hdc, MM_LOMETRIC); expect_LPtoDP(hdc, 4000, -500); - expect_viewport_ext(hdc, 8000, -1000); - expect_window_ext(hdc, 2000, 2000); + expect_viewport_ext(hdc, 8000l, -1000l); + expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 8000, 1000, 200, 200); /* 40 pix/mm x 5 pix/mm */ ok(r == TRUE, "got %d\n", r); SetMapMode(hdc, MM_TEXT); SetMapMode(hdc, MM_LOMETRIC); expect_LPtoDP(hdc, 4000, -500); - expect_viewport_ext(hdc, 8000, -1000); - expect_window_ext(hdc, 2000, 2000); + expect_viewport_ext(hdc, 8000l, -1000l); + expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 8000, 2000, 200, 200); /* 40 pix/mm x 10 pix/mm */ ok(r == TRUE, "got %d\n", r); SetMapMode(hdc, MM_TEXT); SetMapMode(hdc, MM_LOMETRIC); expect_LPtoDP(hdc, 4000, -1000); - expect_viewport_ext(hdc, 8000, -2000); - expect_window_ext(hdc, 2000, 2000); + expect_viewport_ext(hdc, 8000l, -2000l); + expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 0, 0, 10, 0); /* Error */ ok(r == FALSE, "got %d\n", r); SetMapMode(hdc, MM_TEXT); SetMapMode(hdc, MM_LOMETRIC); expect_LPtoDP(hdc, 4000, -1000); - expect_viewport_ext(hdc, 8000, -2000); - expect_window_ext(hdc, 2000, 2000); + expect_viewport_ext(hdc, 8000l, -2000l); + expect_window_ext(hdc, 2000l, 2000l);
r = pSetVirtualResolution(hdc, 0, 0, 0, 0); /* Reset to true resolution */ ok(r == TRUE, "got %d\n", r); diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 2df38674c2f..004ad98d949 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -78,8 +78,8 @@ static int CALLBACK eto_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, { case EMR_HEADER: ok(GetTextAlign(hdc) == 0, "text align %08x\n", GetTextAlign(hdc)); - ok(GetBkColor(hdc) == RGB(0xff, 0xff, 0xff), "bk color %08x\n", GetBkColor(hdc)); - ok(GetTextColor(hdc) == RGB(0x0, 0x0, 0x0), "text color %08x\n", GetTextColor(hdc)); + ok(GetBkColor(hdc) == RGB(0xff, 0xff, 0xff), "bk color %08lx\n", GetBkColor(hdc)); + ok(GetTextColor(hdc) == RGB(0x0, 0x0, 0x0), "text color %08lx\n", GetTextColor(hdc)); ok(GetROP2(hdc) == R2_COPYPEN, "rop %d\n", GetROP2(hdc)); ok(GetArcDirection(hdc) == AD_COUNTERCLOCKWISE, "arc dir %d\n", GetArcDirection(hdc)); ok(GetPolyFillMode(hdc) == ALTERNATE, "poly fill %d\n", GetPolyFillMode(hdc)); @@ -99,7 +99,7 @@ static int CALLBACK eto_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, dx = (const INT *)((const char *)emr + emr_ExtTextOutA->emrtext.offDx);
ret = GetObjectA(GetCurrentObject(hdc, OBJ_FONT), sizeof(device_lf), &device_lf); - ok( ret == sizeof(device_lf), "GetObjectA error %d\n", GetLastError()); + ok( ret == sizeof(device_lf), "GetObjectA error %ld\n", GetLastError());
/* compare up to lfOutPrecision, other values are not interesting, * and in fact sometimes arbitrary adapted by Win9x. @@ -109,7 +109,7 @@ static int CALLBACK eto_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
for(i = 0; i < emr_ExtTextOutA->emrtext.nChars; i++) { - ok(orig_dx[i] == dx[i], "pass %d: dx[%d] (%d) didn't match %d\n", + ok(orig_dx[i] == dx[i], "pass %d: dx[%ld] (%d) didn't match %d\n", n_record, i, dx[i], orig_dx[i]); } n_record++; @@ -126,7 +126,7 @@ static int CALLBACK eto_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, ret = GetObjectA(GetCurrentObject(hdc, OBJ_FONT), sizeof(device_lf), &device_lf); ok( ret == sizeof(device_lf) || broken(ret == (sizeof(device_lf) - LF_FACESIZE + strlen(device_lf.lfFaceName) + 1)), /* NT4 */ - "GetObjectA error %d\n", GetLastError()); + "GetObjectA error %ld\n", GetLastError());
/* compare up to lfOutPrecision, other values are not interesting, * and in fact sometimes arbitrary adapted by Win9x. @@ -134,16 +134,16 @@ static int CALLBACK eto_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, ok(!memcmp(&orig_lf, &device_lf, FIELD_OFFSET(LOGFONTA, lfOutPrecision)), "fonts don't match\n"); ok(!lstrcmpA(orig_lf.lfFaceName, device_lf.lfFaceName), "font names don't match\n");
- ok(!emr_ExtTextOutW->rclBounds.left, "emr_ExtTextOutW->rclBounds.left = %d\n", + ok(!emr_ExtTextOutW->rclBounds.left, "emr_ExtTextOutW->rclBounds.left = %ld\n", emr_ExtTextOutW->rclBounds.left); - ok(emr_ExtTextOutW->rclBounds.right != -1, "emr_ExtTextOutW->rclBounds.right = %d\n", + ok(emr_ExtTextOutW->rclBounds.right != -1, "emr_ExtTextOutW->rclBounds.right = %ld\n", emr_ExtTextOutW->rclBounds.right); - ok(emr_ExtTextOutW->rclBounds.bottom != -1, "emr_ExtTextOutW->rclBounds.bottom = %d\n", + ok(emr_ExtTextOutW->rclBounds.bottom != -1, "emr_ExtTextOutW->rclBounds.bottom = %ld\n", emr_ExtTextOutW->rclBounds.bottom);
for(i = 0; i < emr_ExtTextOutW->emrtext.nChars; i++) { - ok(orig_dx[i] == dx[i], "pass %d: dx[%d] (%d) didn't match %d\n", + ok(orig_dx[i] == dx[i], "pass %d: dx[%ld] (%d) didn't match %d\n", n_record, i, dx[i], orig_dx[i]); } n_record++; @@ -174,10 +174,10 @@ static void test_ExtTextOut(void) /* Win9x doesn't play EMFs on invisible windows */ hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, NULL); - ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + ok(hwnd != 0, "CreateWindowExA error %ld\n", GetLastError());
hdcDisplay = GetDC(hwnd); - ok(hdcDisplay != 0, "GetDC error %d\n", GetLastError()); + ok(hdcDisplay != 0, "GetDC error %ld\n", GetLastError());
SetMapMode(hdcDisplay, MM_TEXT);
@@ -190,7 +190,7 @@ static void test_ExtTextOut(void) orig_lf.lfQuality = DEFAULT_QUALITY; lstrcpyA(orig_lf.lfFaceName, "Arial"); hFont = CreateFontIndirectA(&orig_lf); - ok(hFont != 0, "CreateFontIndirectA error %d\n", GetLastError()); + ok(hFont != 0, "CreateFontIndirectA error %ld\n", GetLastError());
hFont = SelectObject(hdcDisplay, hFont);
@@ -198,12 +198,12 @@ static void test_ExtTextOut(void) for (i = 0; i < len; i++) { ret = GetCharWidthA(hdcDisplay, text[i], text[i], &dx[i]); - ok( ret, "GetCharWidthA error %d\n", GetLastError()); + ok( ret, "GetCharWidthA error %ld\n", GetLastError()); } hFont = SelectObject(hdcDisplay, hFont);
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ok(GetDeviceCaps(hdcMetafile, TECHNOLOGY) == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) has to return DT_RASDISPLAY for a display based EMF\n"); @@ -212,37 +212,37 @@ static void test_ExtTextOut(void)
/* 1. pass NULL lpDx */ ret = ExtTextOutA(hdcMetafile, 0, 0, 0, &rc, text, lstrlenA(text), NULL); - ok( ret, "ExtTextOutA error %d\n", GetLastError()); + ok( ret, "ExtTextOutA error %ld\n", GetLastError());
/* 2. pass custom lpDx */ ret = ExtTextOutA(hdcMetafile, 0, 20, 0, &rc, text, lstrlenA(text), dx); - ok( ret, "ExtTextOutA error %d\n", GetLastError()); + ok( ret, "ExtTextOutA error %ld\n", GetLastError());
/* 3. pass NULL lprc */ ret = ExtTextOutA(hdcMetafile, 0, 40, 0, NULL, text, lstrlenA(text), NULL); - ok( ret, "ExtTextOutA error %d\n", GetLastError()); + ok( ret, "ExtTextOutA error %ld\n", GetLastError());
/* 4. test with unmatched BeginPath/EndPath calls */ ret = BeginPath(hdcMetafile); - ok( ret, "BeginPath error %d\n", GetLastError()); + ok( ret, "BeginPath error %ld\n", GetLastError()); ret = BeginPath(hdcMetafile); - ok( ret, "BeginPath error %d\n", GetLastError()); + ok( ret, "BeginPath error %ld\n", GetLastError()); ret = EndPath(hdcMetafile); - ok( ret, "BeginPath error %d\n", GetLastError()); + ok( ret, "BeginPath error %ld\n", GetLastError()); ret = ExtTextOutA(hdcMetafile, 0, 60, 0, NULL, text, lstrlenA(text), NULL); - ok( ret, "ExtTextOutA error %d\n", GetLastError()); + ok( ret, "ExtTextOutA error %ld\n", GetLastError());
hFont = SelectObject(hdcMetafile, hFont); ret = DeleteObject(hFont); - ok( ret, "DeleteObject error %d\n", GetLastError()); + ok( ret, "DeleteObject error %ld\n", GetLastError());
hMetafile = CloseEnhMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
ok(!GetObjectType(hdcMetafile), "CloseEnhMetaFile has to destroy metafile hdc\n");
ret = PlayEnhMetaFile(hdcDisplay, hMetafile, &rc); - ok( ret, "PlayEnhMetaFile error %d\n", GetLastError()); + ok( ret, "PlayEnhMetaFile error %ld\n", GetLastError());
SetTextAlign(hdcDisplay, TA_UPDATECP | TA_CENTER | TA_BASELINE | TA_RTLREADING ); SetBkColor(hdcDisplay, RGB(0xff, 0, 0)); @@ -256,12 +256,12 @@ static void test_ExtTextOut(void) SetBkMode(hdcDisplay, OPAQUE);
ret = EnumEnhMetaFile(hdcDisplay, hMetafile, eto_emf_enum_proc, dx, &rc); - ok( ret, "EnumEnhMetaFile error %d\n", GetLastError()); + ok( ret, "EnumEnhMetaFile error %ld\n", GetLastError());
ok( GetTextAlign(hdcDisplay) == (TA_UPDATECP | TA_CENTER | TA_BASELINE | TA_RTLREADING), "text align %08x\n", GetTextAlign(hdcDisplay)); - ok( GetBkColor(hdcDisplay) == RGB(0xff, 0, 0), "bk color %08x\n", GetBkColor(hdcDisplay)); - ok( GetTextColor(hdcDisplay) == RGB(0, 0xff, 0), "text color %08x\n", GetTextColor(hdcDisplay)); + ok( GetBkColor(hdcDisplay) == RGB(0xff, 0, 0), "bk color %08lx\n", GetBkColor(hdcDisplay)); + ok( GetTextColor(hdcDisplay) == RGB(0, 0xff, 0), "text color %08lx\n", GetTextColor(hdcDisplay)); ok( GetROP2(hdcDisplay) == R2_NOT, "rop2 %d\n", GetROP2(hdcDisplay)); ok( GetArcDirection(hdcDisplay) == AD_CLOCKWISE, "arc dir %d\n", GetArcDirection(hdcDisplay)); ok( GetPolyFillMode(hdcDisplay) == WINDING, "poly fill %d\n", GetPolyFillMode(hdcDisplay)); @@ -276,9 +276,9 @@ static void test_ExtTextOut(void) "A null hdc does not require a valid rc\n");
ret = DeleteEnhMetaFile(hMetafile); - ok( ret, "DeleteEnhMetaFile error %d\n", GetLastError()); + ok( ret, "DeleteEnhMetaFile error %ld\n", GetLastError()); ret = ReleaseDC(hwnd, hdcDisplay); - ok( ret, "ReleaseDC error %d\n", GetLastError()); + ok( ret, "ReleaseDC error %ld\n", GetLastError()); DestroyWindow(hwnd); }
@@ -358,7 +358,7 @@ static void test_ExtTextOutScale(void) ok(ret, "GetWindowExtEx failed\n");
if (winetest_debug > 1) - trace("gm %d, mm %d, wnd %d,%d, vp %d,%d horz %d,%d vert %d,%d\n", + trace("gm %d, mm %d, wnd %ld,%ld, vp %ld,%ld horz %d,%d vert %d,%d\n", test.graphics_mode, test.map_mode, wndext.cx, wndext.cy, vportext.cx, vportext.cy, horzSize, horzRes, vertSize, vertRes); @@ -423,7 +423,7 @@ static void check_dc_state(HDC hdc, int restore_no,
SetLastError(0xdeadbeef); ret = GetWorldTransform(hdc, &xform); - ok(ret, "GetWorldTransform error %u\n", GetLastError()); + ok(ret, "GetWorldTransform error %lu\n", GetLastError());
if (winetest_debug > 1) trace("%d: eM11 %f, eM22 %f, eDx %f, eDy %f\n", restore_no, xform.eM11, @@ -460,7 +460,7 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, static int select_no;
if (winetest_debug > 1) - trace("hdc %p, emr->iType %d, emr->nSize %d, param %p\n", + trace("hdc %p, emr->iType %ld, emr->nSize %ld, param %p\n", hdc, emr->iType, emr->nSize, (void *)param);
SetLastError(0xdeadbeef); @@ -468,21 +468,21 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { ret = GetWindowOrgEx(hdc, &pt); - ok(ret, "GetWindowOrgEx error %u\n", GetLastError()); - trace("window org (%d,%d)\n", pt.x, pt.y); + ok(ret, "GetWindowOrgEx error %lu\n", GetLastError()); + trace("window org (%ld,%ld)\n", pt.x, pt.y); ret = GetViewportOrgEx(hdc, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - trace("vport org (%d,%d)\n", pt.x, pt.y); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + trace("vport org (%ld,%ld)\n", pt.x, pt.y); ret = GetWindowExtEx(hdc, &size); - ok(ret, "GetWindowExtEx error %u\n", GetLastError()); - trace("window ext (%d,%d)\n", size.cx, size.cy); + ok(ret, "GetWindowExtEx error %lu\n", GetLastError()); + trace("window ext (%ld,%ld)\n", size.cx, size.cy); ret = GetViewportExtEx(hdc, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - trace("vport ext (%d,%d)\n", size.cx, size.cy); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + trace("vport ext (%ld,%ld)\n", size.cx, size.cy); } else { - ok(ret, "GetWorldTransform error %u\n", GetLastError()); + ok(ret, "GetWorldTransform error %lu\n", GetLastError()); if (winetest_debug > 1) trace("eM11 %f, eM22 %f, eDx %f, eDy %f\n", xform.eM11, xform.eM22, xform.eDx, xform.eDy); } @@ -499,10 +499,10 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
if (winetest_debug > 1) { - trace("bounds %d,%d-%d,%d, frame %d,%d-%d,%d\n", + trace("bounds %ld,%ld-%ld,%ld, frame %ld,%ld-%ld,%ld\n", emf->rclBounds.left, emf->rclBounds.top, emf->rclBounds.right, emf->rclBounds.bottom, emf->rclFrame.left, emf->rclFrame.top, emf->rclFrame.right, emf->rclFrame.bottom); - trace("mm %d x %d, device %d x %d\n", emf->szlMillimeters.cx, emf->szlMillimeters.cy, + trace("mm %ld x %ld, device %ld x %ld\n", emf->szlMillimeters.cx, emf->szlMillimeters.cy, emf->szlDevice.cx, emf->szlDevice.cy); }
@@ -519,35 +519,35 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, case EMR_LINETO: { const EMRLINETO *line = (const EMRLINETO *)emr; - if (winetest_debug > 1) trace("EMR_LINETO %d,%d\n", line->ptl.x, line->ptl.x); + if (winetest_debug > 1) trace("EMR_LINETO %ld,%ld\n", line->ptl.x, line->ptl.x); break; } case EMR_SETWINDOWORGEX: { const EMRSETWINDOWORGEX *org = (const EMRSETWINDOWORGEX *)emr; if (winetest_debug > 1) - trace("EMR_SETWINDOWORGEX: %d,%d\n", org->ptlOrigin.x, org->ptlOrigin.y); + trace("EMR_SETWINDOWORGEX: %ld,%ld\n", org->ptlOrigin.x, org->ptlOrigin.y); break; } case EMR_SETWINDOWEXTEX: { const EMRSETWINDOWEXTEX *ext = (const EMRSETWINDOWEXTEX *)emr; if (winetest_debug > 1) - trace("EMR_SETWINDOWEXTEX: %d,%d\n", ext->szlExtent.cx, ext->szlExtent.cy); + trace("EMR_SETWINDOWEXTEX: %ld,%ld\n", ext->szlExtent.cx, ext->szlExtent.cy); break; } case EMR_SETVIEWPORTORGEX: { const EMRSETVIEWPORTORGEX *org = (const EMRSETVIEWPORTORGEX *)emr; if (winetest_debug > 1) - trace("EMR_SETVIEWPORTORGEX: %d,%d\n", org->ptlOrigin.x, org->ptlOrigin.y); + trace("EMR_SETVIEWPORTORGEX: %ld,%ld\n", org->ptlOrigin.x, org->ptlOrigin.y); break; } case EMR_SETVIEWPORTEXTEX: { const EMRSETVIEWPORTEXTEX *ext = (const EMRSETVIEWPORTEXTEX *)emr; if (winetest_debug > 1) - trace("EMR_SETVIEWPORTEXTEX: %d,%d\n", ext->szlExtent.cx, ext->szlExtent.cy); + trace("EMR_SETVIEWPORTEXTEX: %ld,%ld\n", ext->szlExtent.cx, ext->szlExtent.cy); break; } case EMR_SAVEDC: @@ -558,20 +558,20 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, case EMR_RESTOREDC: { const EMRRESTOREDC *restoredc = (const EMRRESTOREDC *)emr; - if (winetest_debug > 1) trace("EMR_RESTOREDC: %d\n", restoredc->iRelative); + if (winetest_debug > 1) trace("EMR_RESTOREDC: %ld\n", restoredc->iRelative);
switch(++restore_no) { case 1: - ok(restoredc->iRelative == -1, "first restore %d\n", restoredc->iRelative); + ok(restoredc->iRelative == -1, "first restore %ld\n", restoredc->iRelative); check_dc_state(hdc, restore_no, -2, -2, 8192, 8192, 20, 20, 20479, 20478); break; case 2: - ok(restoredc->iRelative == -3, "second restore %d\n", restoredc->iRelative); + ok(restoredc->iRelative == -3, "second restore %ld\n", restoredc->iRelative); check_dc_state(hdc, restore_no, 0, 0, 16384, 16384, 0, 0, 17873, 17872); break; case 3: - ok(restoredc->iRelative == -2, "third restore %d\n", restoredc->iRelative); + ok(restoredc->iRelative == -2, "third restore %ld\n", restoredc->iRelative); check_dc_state(hdc, restore_no, -4, -4, 32767, 32767, 40, 40, 3276, 3276); break; } @@ -582,7 +582,7 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, case EMR_SELECTOBJECT: { const EMRSELECTOBJECT *selectobj = (const EMRSELECTOBJECT*)emr; - if (winetest_debug > 1) trace("EMR_SELECTOBJECT: %x\n",selectobj->ihObject); + if (winetest_debug > 1) trace("EMR_SELECTOBJECT: %lx\n",selectobj->ihObject); select_no ++; break; } @@ -597,21 +597,21 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { ret = GetWindowOrgEx(hdc, &pt); - ok(ret, "GetWindowOrgEx error %u\n", GetLastError()); - if (winetest_debug > 1) trace("window org (%d,%d)\n", pt.x, pt.y); + ok(ret, "GetWindowOrgEx error %lu\n", GetLastError()); + if (winetest_debug > 1) trace("window org (%ld,%ld)\n", pt.x, pt.y); ret = GetViewportOrgEx(hdc, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - if (winetest_debug > 1) trace("vport org (%d,%d)\n", pt.x, pt.y); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + if (winetest_debug > 1) trace("vport org (%ld,%ld)\n", pt.x, pt.y); ret = GetWindowExtEx(hdc, &size); - ok(ret, "GetWindowExtEx error %u\n", GetLastError()); - if (winetest_debug > 1) trace("window ext (%d,%d)\n", size.cx, size.cy); + ok(ret, "GetWindowExtEx error %lu\n", GetLastError()); + if (winetest_debug > 1) trace("window ext (%ld,%ld)\n", size.cx, size.cy); ret = GetViewportExtEx(hdc, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - if (winetest_debug > 1) trace("vport ext (%d,%d)\n", size.cx, size.cy); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + if (winetest_debug > 1) trace("vport ext (%ld,%ld)\n", size.cx, size.cy); } else { - ok(ret, "GetWorldTransform error %u\n", GetLastError()); + ok(ret, "GetWorldTransform error %lu\n", GetLastError()); if (winetest_debug > 1) trace("eM11 %f, eM22 %f, eDx %f, eDy %f\n", xform.eM11, xform.eM22, xform.eDx, xform.eDy); } @@ -633,13 +633,13 @@ static void test_SaveDC(void) /* Win9x doesn't play EMFs on invisible windows */ hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, NULL); - ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + ok(hwnd != 0, "CreateWindowExA error %ld\n", GetLastError());
hdcDisplay = GetDC(hwnd); - ok(hdcDisplay != 0, "GetDC error %d\n", GetLastError()); + ok(hdcDisplay != 0, "GetDC error %ld\n", GetLastError());
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
SetMapMode(hdcMetafile, MM_ANISOTROPIC);
@@ -655,11 +655,11 @@ static void test_SaveDC(void) SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 0,"Expecting ViewportOrg x of 0, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 0,"Expecting ViewportOrg x of 0, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 120,"Expecting ViewportExt cx of 120, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 120,"Expecting ViewportExt cx of 120, got %li\n",size.cx); ret = SaveDC(hdcMetafile); ok(ret == 1, "ret = %d\n", ret);
@@ -672,11 +672,11 @@ static void test_SaveDC(void) SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 10,"Expecting ViewportOrg x of 10, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 10,"Expecting ViewportOrg x of 10, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 200,"Expecting ViewportExt cx of 200, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 200,"Expecting ViewportExt cx of 200, got %li\n",size.cx); ret = SaveDC(hdcMetafile); ok(ret == 2, "ret = %d\n", ret);
@@ -691,11 +691,11 @@ static void test_SaveDC(void) SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %li\n",size.cx); ret = SaveDC(hdcMetafile); ok(ret == 3, "ret = %d\n", ret);
@@ -713,39 +713,39 @@ static void test_SaveDC(void) SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 30,"Expecting ViewportOrg x of 30, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 30,"Expecting ViewportOrg x of 30, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 400,"Expecting ViewportExt cx of 400, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 400,"Expecting ViewportExt cx of 400, got %li\n",size.cx); ret = RestoreDC(hdcMetafile, -1); ok(ret, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %li\n",size.cx); ok( GetPolyFillMode( hdcMetafile ) == ALTERNATE, "PolyFillMode not restored\n" ); ok( GetBkColor( hdcMetafile ) == 0, "Background color not restored\n" ); ret = SaveDC(hdcMetafile); ok(ret == 3, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %li\n",size.cx); ret = RestoreDC(hdcMetafile, 1); ok(ret, "ret = %d\n", ret); ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 0,"Expecting ViewportOrg x of 0, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 0,"Expecting ViewportOrg x of 0, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 120,"Expecting ViewportExt cx of 120, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 120,"Expecting ViewportExt cx of 120, got %li\n",size.cx);
SetWindowOrgEx(hdcMetafile, -4, -4, NULL); SetViewportOrgEx(hdcMetafile, 40, 40, NULL); @@ -756,20 +756,20 @@ static void test_SaveDC(void) SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %li\n",size.cx); ret = SaveDC(hdcMetafile); ok(ret == 1, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %li\n",size.cx); ret = SaveDC(hdcMetafile); ok(ret == 2, "ret = %d\n", ret);
@@ -781,12 +781,12 @@ static void test_SaveDC(void) orig_lf.lfQuality = DEFAULT_QUALITY; lstrcpyA(orig_lf.lfFaceName, "Arial"); hFont = CreateFontIndirectA(&orig_lf); - ok(hFont != 0, "CreateFontIndirectA error %d\n", GetLastError()); + ok(hFont != 0, "CreateFontIndirectA error %ld\n", GetLastError());
hFontOld = SelectObject(hdcMetafile, hFont);
hFont2 = CreateFontIndirectA(&orig_lf); - ok(hFont2 != 0, "CreateFontIndirectA error %d\n", GetLastError()); + ok(hFont2 != 0, "CreateFontIndirectA error %ld\n", GetLastError()); hFontCheck = SelectObject(hdcMetafile, hFont2); ok(hFontCheck == hFont, "Font not selected\n");
@@ -796,11 +796,11 @@ static void test_SaveDC(void) ret = RestoreDC(hdcMetafile, 1); ok(ret, "ret = %d\n", ret); ret = GetViewportOrgEx(hdcMetafile, &pt); - ok(ret, "GetViewportOrgEx error %u\n", GetLastError()); - ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %i\n",pt.x); + ok(ret, "GetViewportOrgEx error %lu\n", GetLastError()); + ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %li\n",pt.x); ret = GetViewportExtEx(hdcMetafile, &size); - ok(ret, "GetViewportExtEx error %u\n", GetLastError()); - ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %i\n",size.cx); + ok(ret, "GetViewportExtEx error %lu\n", GetLastError()); + ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %li\n",size.cx);
hFontCheck = SelectObject(hdcMetafile, hFontOld); ok(hFontOld == hFontCheck && hFontCheck != hFont && hFontCheck != hFont2, @@ -812,19 +812,19 @@ static void test_SaveDC(void) ok(!ret, "ret = %d\n", ret);
hMetafile = CloseEnhMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
ret = EnumEnhMetaFile(hdcDisplay, hMetafile, savedc_emf_enum_proc, 0, &rc); ok( ret == 1, "EnumEnhMetaFile rets %d\n", ret);
ret = DeleteObject(hFont); - ok( ret, "DeleteObject error %d\n", GetLastError()); + ok( ret, "DeleteObject error %ld\n", GetLastError()); ret = DeleteObject(hFont2); - ok( ret, "DeleteObject error %d\n", GetLastError()); + ok( ret, "DeleteObject error %ld\n", GetLastError()); ret = DeleteEnhMetaFile(hMetafile); - ok( ret, "DeleteEnhMetaFile error %d\n", GetLastError()); + ok( ret, "DeleteEnhMetaFile error %ld\n", GetLastError()); ret = ReleaseDC(hwnd, hdcDisplay); - ok( ret, "ReleaseDC error %d\n", GetLastError()); + ok( ret, "ReleaseDC error %ld\n", GetLastError()); DestroyWindow(hwnd); }
@@ -838,7 +838,7 @@ static void test_mf_SaveDC(void) HFONT hFont,hFont2,hFontOld,hFontCheck;
hdcMetafile = CreateMetaFileA(NULL); - ok(hdcMetafile != 0, "CreateMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateMetaFileA error %ld\n", GetLastError());
ret = SetMapMode(hdcMetafile, MM_ANISOTROPIC); ok (ret, "SetMapMode should not fail\n"); @@ -848,16 +848,16 @@ static void test_mf_SaveDC(void)
pt.x = pt.y = 5555; SetWindowOrgEx(hdcMetafile, 0, 0, &pt); - ok( pt.x == 5555 && pt.y == 5555, "wrong origin %d,%d\n", pt.x, pt.y); + ok( pt.x == 5555 && pt.y == 5555, "wrong origin %ld,%ld\n", pt.x, pt.y); pt.x = pt.y = 5555; SetViewportOrgEx(hdcMetafile, 0, 0, &pt); - ok( pt.x == 5555 && pt.y == 5555, "wrong origin %d,%d\n", pt.x, pt.y); + ok( pt.x == 5555 && pt.y == 5555, "wrong origin %ld,%ld\n", pt.x, pt.y); size.cx = size.cy = 5555; SetWindowExtEx(hdcMetafile, 110, 110, &size ); - ok( size.cx == 5555 && size.cy == 5555, "wrong size %d,%d\n", size.cx, size.cy ); + ok( size.cx == 5555 && size.cy == 5555, "wrong size %ld,%ld\n", size.cx, size.cy ); size.cx = size.cy = 5555; SetViewportExtEx(hdcMetafile, 120, 120, &size ); - ok( size.cx == 5555 && size.cy == 5555, "wrong size %d,%d\n", size.cx, size.cy ); + ok( size.cx == 5555 && size.cy == 5555, "wrong size %ld,%ld\n", size.cx, size.cy );
/* Force Win9x to update DC state */ SetPixelV(hdcMetafile, 50, 50, 0); @@ -937,12 +937,12 @@ static void test_mf_SaveDC(void) orig_lf.lfQuality = DEFAULT_QUALITY; lstrcpyA(orig_lf.lfFaceName, "Arial"); hFont = CreateFontIndirectA(&orig_lf); - ok(hFont != 0, "CreateFontIndirectA error %d\n", GetLastError()); + ok(hFont != 0, "CreateFontIndirectA error %ld\n", GetLastError());
hFontOld = SelectObject(hdcMetafile, hFont);
hFont2 = CreateFontIndirectA(&orig_lf); - ok(hFont2 != 0, "CreateFontIndirectA error %d\n", GetLastError()); + ok(hFont2 != 0, "CreateFontIndirectA error %ld\n", GetLastError()); hFontCheck = SelectObject(hdcMetafile, hFont2); ok(hFontCheck == hFont, "Font not selected\n");
@@ -964,14 +964,14 @@ static void test_mf_SaveDC(void) ok(ret, "ret = %d\n", ret);
hMetafile = CloseMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseMetaFile error %ld\n", GetLastError());
ret = DeleteMetaFile(hMetafile); - ok( ret, "DeleteMetaFile error %d\n", GetLastError()); + ok( ret, "DeleteMetaFile error %ld\n", GetLastError()); ret = DeleteObject(hFont); - ok( ret, "DeleteObject error %d\n", GetLastError()); + ok( ret, "DeleteObject error %ld\n", GetLastError()); ret = DeleteObject(hFont2); - ok( ret, "DeleteObject error %d\n", GetLastError()); + ok( ret, "DeleteObject error %ld\n", GetLastError()); }
@@ -2016,7 +2016,7 @@ static const unsigned char emf_mask_blit_bits[] = static INT CALLBACK mf_enum_proc(HDC hdc, HANDLETABLE *ht, METARECORD *mr, INT nobj, LPARAM param) { - trace("hdc %p, mr->rdFunction %04x, mr->rdSize %u, param %p\n", + trace("hdc %p, mr->rdFunction %04x, mr->rdSize %lu, param %p\n", hdc, mr->rdFunction, mr->rdSize, (void *)param); return TRUE; } @@ -2101,11 +2101,11 @@ static int compare_mf_disk_bits(LPCSTR name, const BYTE *bits, UINT bsize, const assert(mfsize <= MF_BUFSIZE);
ret = ReadFile(hfile, buf, sizeof(buf), &rd_size, NULL); - ok( ret && rd_size == mfsize, "ReadFile: error %d\n", GetLastError()); + ok( ret && rd_size == mfsize, "ReadFile: error %ld\n", GetLastError());
CloseHandle(hfile);
- ok(mfsize == bsize, "%s: mfsize=%d, bsize=%d.\n", desc, mfsize, bsize); + ok(mfsize == bsize, "%s: mfsize=%ld, bsize=%d.\n", desc, mfsize, bsize);
if (mfsize != bsize) return -1; @@ -2116,7 +2116,7 @@ static int compare_mf_disk_bits(LPCSTR name, const BYTE *bits, UINT bsize, const if (buf[i] != bits[i]) diff++; } - ok(diff == 0, "%s: mfsize=%d, bsize=%d, diff=%d\n", + ok(diff == 0, "%s: mfsize=%ld, bsize=%d, diff=%d\n", desc, mfsize, bsize, diff);
return diff; @@ -2158,7 +2158,7 @@ static void dump_emf_records(const HENHMETAFILE mf, const char *desc) if (!winetest_debug) return;
mfsize = GetEnhMetaFileBits(mf, MF_BUFSIZE, buf); - ok (mfsize > 0, "%s: GetEnhMetaFileBits error %d\n", desc, GetLastError()); + ok (mfsize > 0, "%s: GetEnhMetaFileBits error %ld\n", desc, GetLastError());
printf("EMF %s has records:\n", desc);
@@ -2167,7 +2167,7 @@ static void dump_emf_records(const HENHMETAFILE mf, const char *desc) while(offset < mfsize) { EMR *emr = (EMR *)(emf + offset); - printf("emr->iType %d, emr->nSize %u\n", emr->iType, emr->nSize); + printf("emr->iType %ld, emr->nSize %lu\n", emr->iType, emr->nSize); /*trace("emr->iType 0x%04lx, emr->nSize 0x%04lx\n", emr->iType, emr->nSize);*/ offset += emr->nSize; } @@ -2180,7 +2180,7 @@ static void dump_emf_record(const ENHMETARECORD *emr, const char *desc)
if (!winetest_debug) return;
- printf ("%s: EMF record %u has bits:\n{\n", desc, emr->iType); + printf ("%s: EMF record %lu has bits:\n{\n", desc, emr->iType); buf = (const BYTE *)emr; for (i = 0; i < emr->nSize; i++) { @@ -2197,18 +2197,18 @@ static void dump_emf_record(const ENHMETARECORD *emr, const char *desc)
static void dump_EMREXTTEXTOUT(const EMREXTTEXTOUTW *eto) { - trace("rclBounds %d,%d - %d,%d\n", eto->rclBounds.left, eto->rclBounds.top, + trace("rclBounds %ld,%ld - %ld,%ld\n", eto->rclBounds.left, eto->rclBounds.top, eto->rclBounds.right, eto->rclBounds.bottom); - trace("iGraphicsMode %u\n", eto->iGraphicsMode); + trace("iGraphicsMode %lu\n", eto->iGraphicsMode); trace("exScale: %f\n", eto->exScale); trace("eyScale: %f\n", eto->eyScale); - trace("emrtext.ptlReference %d,%d\n", eto->emrtext.ptlReference.x, eto->emrtext.ptlReference.y); - trace("emrtext.nChars %u\n", eto->emrtext.nChars); - trace("emrtext.offString %#x\n", eto->emrtext.offString); - trace("emrtext.fOptions %#x\n", eto->emrtext.fOptions); - trace("emrtext.rcl %d,%d - %d,%d\n", eto->emrtext.rcl.left, eto->emrtext.rcl.top, + trace("emrtext.ptlReference %ld,%ld\n", eto->emrtext.ptlReference.x, eto->emrtext.ptlReference.y); + trace("emrtext.nChars %lu\n", eto->emrtext.nChars); + trace("emrtext.offString %#lx\n", eto->emrtext.offString); + trace("emrtext.fOptions %#lx\n", eto->emrtext.fOptions); + trace("emrtext.rcl %ld,%ld - %ld,%ld\n", eto->emrtext.rcl.left, eto->emrtext.rcl.top, eto->emrtext.rcl.right, eto->emrtext.rcl.bottom); - trace("emrtext.offDx %#x\n", eto->emrtext.offDx); + trace("emrtext.offDx %#lx\n", eto->emrtext.offDx); }
static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr2, @@ -2216,10 +2216,10 @@ static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr { int diff;
- ok(emr1->iType == emr2->iType, "%s: emr->iType %u != %u\n", + ok(emr1->iType == emr2->iType, "%s: emr->iType %lu != %lu\n", desc, emr1->iType, emr2->iType);
- ok(emr1->nSize == emr2->nSize, "%s: emr->nSize %u != %u\n", + ok(emr1->nSize == emr2->nSize, "%s: emr->nSize %lu != %lu\n", desc, emr1->nSize, emr2->nSize);
/* iType and nSize mismatches are fatal */ @@ -2293,7 +2293,7 @@ static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr else diff = memcmp(emr1, emr2, emr1->nSize);
- ok(diff == 0, "%s: contents of record %u don't match\n", desc, emr1->iType); + ok(diff == 0, "%s: contents of record %lu don't match\n", desc, emr1->iType);
if (diff) { @@ -2319,7 +2319,7 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits, const ENHMETAHEADER *emh1, *emh2;
mfsize = GetEnhMetaFileBits(mf, MF_BUFSIZE, buf); - ok (mfsize > 0, "%s: GetEnhMetaFileBits error %d\n", desc, GetLastError()); + ok (mfsize > 0, "%s: GetEnhMetaFileBits error %ld\n", desc, GetLastError());
if (mfsize < MF_BUFSIZE) { @@ -2332,26 +2332,26 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits, /* basic things must match */ emh1 = (const ENHMETAHEADER *)bits; emh2 = (const ENHMETAHEADER *)buf; - ok(emh1->iType == EMR_HEADER, "expected EMR_HEADER, got %u\n", emh1->iType); - ok(emh1->nSize == sizeof(ENHMETAHEADER), "expected sizeof(ENHMETAHEADER), got %u\n", emh1->nSize); - ok(emh2->nBytes == mfsize, "expected emh->nBytes %u, got %u\n", mfsize, emh2->nBytes); - ok(emh1->dSignature == ENHMETA_SIGNATURE, "expected ENHMETA_SIGNATURE, got %u\n", emh1->dSignature); + ok(emh1->iType == EMR_HEADER, "expected EMR_HEADER, got %lu\n", emh1->iType); + ok(emh1->nSize == sizeof(ENHMETAHEADER), "expected sizeof(ENHMETAHEADER), got %lu\n", emh1->nSize); + ok(emh2->nBytes == mfsize, "expected emh->nBytes %u, got %lu\n", mfsize, emh2->nBytes); + ok(emh1->dSignature == ENHMETA_SIGNATURE, "expected ENHMETA_SIGNATURE, got %lu\n", emh1->dSignature);
- ok(emh1->iType == emh2->iType, "expected EMR_HEADER, got %u\n", emh2->iType); + ok(emh1->iType == emh2->iType, "expected EMR_HEADER, got %lu\n", emh2->iType); ok(emh1->nSize == emh2->nSize, - "expected nSize %u, got %u\n", emh1->nSize, emh2->nSize); - ok(emh1->rclBounds.left == emh2->rclBounds.left, "%s: expected rclBounds.left = %d, got %d\n", + "expected nSize %lu, got %lu\n", emh1->nSize, emh2->nSize); + ok(emh1->rclBounds.left == emh2->rclBounds.left, "%s: expected rclBounds.left = %ld, got %ld\n", desc, emh1->rclBounds.left, emh2->rclBounds.left); - ok(emh1->rclBounds.top == emh2->rclBounds.top, "%s: expected rclBounds.top = %d, got %d\n", + ok(emh1->rclBounds.top == emh2->rclBounds.top, "%s: expected rclBounds.top = %ld, got %ld\n", desc, emh1->rclBounds.top, emh2->rclBounds.top); - ok(emh1->rclBounds.right == emh2->rclBounds.right, "%s: expected rclBounds.right = %d, got %d\n", + ok(emh1->rclBounds.right == emh2->rclBounds.right, "%s: expected rclBounds.right = %ld, got %ld\n", desc, emh1->rclBounds.right, emh2->rclBounds.right); - ok(emh1->rclBounds.bottom == emh2->rclBounds.bottom, "%s: expected rclBounds.bottom = %d, got %d\n", + ok(emh1->rclBounds.bottom == emh2->rclBounds.bottom, "%s: expected rclBounds.bottom = %ld, got %ld\n", desc, emh1->rclBounds.bottom, emh2->rclBounds.bottom); - ok(emh1->dSignature == emh2->dSignature, "expected dSignature %u, got %u\n", emh1->dSignature, emh2->dSignature); + ok(emh1->dSignature == emh2->dSignature, "expected dSignature %lu, got %lu\n", emh1->dSignature, emh2->dSignature); ok(emh1->nBytes == emh2->nBytes, - "expected nBytes %u, got %u\n", emh1->nBytes, emh2->nBytes); - ok(emh1->nRecords == emh2->nRecords, "expected nRecords %u, got %u\n", emh1->nRecords, emh2->nRecords); + "expected nBytes %lu, got %lu\n", emh1->nBytes, emh2->nBytes); + ok(emh1->nRecords == emh2->nRecords, "expected nRecords %lu, got %lu\n", emh1->nRecords, emh2->nRecords);
offset1 = emh1->nSize; offset2 = emh2->nSize; /* Needed for Win9x/WinME/NT4 */ @@ -2361,7 +2361,7 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits, const ENHMETARECORD *emr2 = (const ENHMETARECORD *)(buf + offset2);
if (winetest_debug > 1) - trace("%s: EMF record %u, size %u/record %u, size %u\n", + trace("%s: EMF record %lu, size %lu/record %lu, size %lu\n", desc, emr1->iType, emr1->nSize, emr2->iType, emr2->nSize);
if (!match_emf_record(emr1, emr2, desc, ignore_scaling)) return -1; @@ -3392,17 +3392,17 @@ static void test_emf_BitBlt(void)
/* Test that source DC cannot be an enhanced metafile */ hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %ld\n", GetLastError()); hdc_emf2 = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf2, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf2, "CreateEnhMetaFileW failed, error %ld\n", GetLastError());
ret = StretchBlt(hdc_emf, 0, 0, 1, 1, hdc_emf2, 0, 0, 1, 1, SRCCOPY); ok(!ret, "StretchBlt succeeded\n");
hemf2 = CloseEnhMetaFile(hdc_emf2); - ok(!!hemf2, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf2, "CloseEnhMetaFile failed, error %ld\n", GetLastError()); hemf = CloseEnhMetaFile(hdc_emf); - ok(!!hemf, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf, "CloseEnhMetaFile failed, error %ld\n", GetLastError()); DeleteEnhMetaFile(hemf2); DeleteEnhMetaFile(hemf);
@@ -3421,36 +3421,36 @@ static void test_emf_BitBlt(void) memcpy(bmi->bmiColors, tests[test_idx].colors, sizeof(RGBQUAD) * tests[test_idx].color_count);
hbitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, &bits, NULL, 0); - ok(!!hbitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + ok(!!hbitmap, "CreateDIBSection failed, error %ld\n", GetLastError()); hdc_bitmap = CreateCompatibleDC(hdc); - ok(!!hdc_bitmap, "CreateCompatibleDC failed, error %d\n", GetLastError()); + ok(!!hdc_bitmap, "CreateCompatibleDC failed, error %ld\n", GetLastError()); old_hbitmap = SelectObject(hdc_bitmap, hbitmap);
SetBkColor(hdc_bitmap, RGB(0xff, 0xff, 0xff)); ret = SetGraphicsMode(hdc_bitmap, GM_ADVANCED); - ok(ret, "SetGraphicsMode failed, error %d\n", GetLastError()); + ok(ret, "SetGraphicsMode failed, error %ld\n", GetLastError()); ret = SetWorldTransform(hdc_bitmap, &xform); - ok(ret, "SetWorldTransform failed, error %d\n", GetLastError()); + ok(ret, "SetWorldTransform failed, error %ld\n", GetLastError());
hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %ld\n", GetLastError());
ret = BitBlt(hdc_bitmap, 0, 0, bitmap_width, bitmap_height, 0, 0, 0, BLACKNESS); - ok(ret, "BitBlt failed, error %d\n", GetLastError()); + ok(ret, "BitBlt failed, error %ld\n", GetLastError()); if (tests[test_idx].src_width == bitmap_width && tests[test_idx].src_height == bitmap_height) { ret = BitBlt(hdc_emf, 0, 0, bitmap_width, bitmap_height, hdc_bitmap, 0, 0, SRCCOPY); - ok(ret, "BitBlt failed, error %d\n", GetLastError()); + ok(ret, "BitBlt failed, error %ld\n", GetLastError()); } else { ret = StretchBlt(hdc_emf, 0, 0, bitmap_width, bitmap_height, hdc_bitmap, 0, 0, tests[test_idx].src_width, tests[test_idx].src_height, SRCCOPY); - ok(ret, "StretchBlt failed, error %d\n", GetLastError()); + ok(ret, "StretchBlt failed, error %ld\n", GetLastError()); }
hemf = CloseEnhMetaFile(hdc_emf); - ok(!!hemf, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf, "CloseEnhMetaFile failed, error %ld\n", GetLastError());
ret = compare_emf_bits(hemf, tests[test_idx].bits, tests[test_idx].bits_count, "test_emf_BitBlt", FALSE); @@ -3490,21 +3490,21 @@ static void test_emf_DCBrush(void) ok( hdcMetafile != 0, "CreateEnhMetaFileA failed\n" );
hBrush = SelectObject(hdcMetafile, GetStockObject(DC_BRUSH)); - ok(hBrush != 0, "SelectObject error %d.\n", GetLastError()); + ok(hBrush != 0, "SelectObject error %ld.\n", GetLastError());
hPen = SelectObject(hdcMetafile, GetStockObject(DC_PEN)); - ok(hPen != 0, "SelectObject error %d.\n", GetLastError()); + ok(hPen != 0, "SelectObject error %ld.\n", GetLastError());
color = pSetDCBrushColor( hdcMetafile, RGB(0x55,0x55,0x55) ); - ok( color == 0xffffff, "SetDCBrushColor returned %x\n", color ); + ok( color == 0xffffff, "SetDCBrushColor returned %lx\n", color );
color = pSetDCPenColor( hdcMetafile, RGB(0x33,0x44,0x55) ); - ok( color == 0, "SetDCPenColor returned %x\n", color ); + ok( color == 0, "SetDCPenColor returned %lx\n", color );
Rectangle( hdcMetafile, 10, 10, 20, 20 );
color = pSetDCBrushColor( hdcMetafile, RGB(0x12,0x34,0x56) ); - ok( color == 0x555555, "SetDCBrushColor returned %x\n", color ); + ok( color == 0x555555, "SetDCBrushColor returned %lx\n", color );
hMetafile = CloseEnhMetaFile(hdcMetafile); ok( hMetafile != 0, "CloseEnhMetaFile failed\n" ); @@ -3516,11 +3516,11 @@ static void test_emf_DCBrush(void) dump_emf_records(hMetafile, "emf_DC_Brush"); } ret = DeleteEnhMetaFile(hMetafile); - ok( ret, "DeleteEnhMetaFile error %d\n", GetLastError()); + ok( ret, "DeleteEnhMetaFile error %ld\n", GetLastError()); ret = DeleteObject(hBrush); - ok( ret, "DeleteObject(HBRUSH) error %d\n", GetLastError()); + ok( ret, "DeleteObject(HBRUSH) error %ld\n", GetLastError()); ret = DeleteObject(hPen); - ok( ret, "DeleteObject(HPEN) error %d\n", GetLastError()); + ok( ret, "DeleteObject(HPEN) error %ld\n", GetLastError()); }
/* Test a blank metafile. May be used as a template for new tests. */ @@ -3534,7 +3534,7 @@ static void test_mf_Blank(void) INT type;
hdcMetafile = CreateMetaFileA(NULL); - ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
/* Tests on metafile initialization */ caps = GetDeviceCaps (hdcMetafile, TECHNOLOGY); @@ -3542,7 +3542,7 @@ static void test_mf_Blank(void) "GetDeviceCaps: TECHNOLOGY=%d != DT_METAFILE.\n", caps);
hMetafile = CloseMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseMetaFile error %ld\n", GetLastError()); type = GetObjectType(hMetafile); ok(type == OBJ_METAFILE, "CloseMetaFile created object with type %d\n", type); type = GetObjectType(hdcMetafile); @@ -3557,7 +3557,7 @@ static void test_mf_Blank(void) }
ret = DeleteMetaFile(hMetafile); - ok( ret, "DeleteMetaFile(%p) error %d\n", hMetafile, GetLastError()); + ok( ret, "DeleteMetaFile(%p) error %ld\n", hMetafile, GetLastError()); }
static void test_metafile_file(void) @@ -3576,52 +3576,52 @@ static void test_metafile_file(void) GetTempFileNameA(temp_path, "wmf", 0, mf_name);
dc = CreateMetaFileA(mf_name); - ok(dc != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(dc != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
file = CreateFileA(mf_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); ok(file == INVALID_HANDLE_VALUE && GetLastError() == ERROR_SHARING_VIOLATION, - "CreateFile returned: %p %u\n", file, GetLastError()); + "CreateFile returned: %p %lu\n", file, GetLastError());
file = CreateFileA(mf_name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
size = GetFileSize(file, NULL); - ok(!size, "size = %u\n", size); + ok(!size, "size = %lu\n", size);
ret = MoveToEx(dc, 1, 1, NULL); - ok( ret, "MoveToEx error %d.\n", GetLastError()); + ok( ret, "MoveToEx error %ld.\n", GetLastError()); ret = LineTo(dc, 2, 2); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = MoveToEx(dc, 1, 1, &oldpoint); - ok( ret, "MoveToEx error %d.\n", GetLastError()); + ok( ret, "MoveToEx error %ld.\n", GetLastError()); ret = Ellipse(dc, 0, 0, 2, 2); - ok( ret, "Ellipse error %d.\n", GetLastError()); + ok( ret, "Ellipse error %ld.\n", GetLastError());
ret = GetCurrentPositionEx(dc, &oldpoint); ok(!ret, "GetCurrentPositionEx succeeded\n");
size = GetFileSize(file, NULL); - ok(!size, "size = %u\n", size); + ok(!size, "size = %lu\n", size);
metafile = CloseMetaFile(dc); size = GetFileSize(file, NULL); - ok(size == sizeof(MF_GRAPHICS_BITS), "size = %u\n", size); + ok(size == sizeof(MF_GRAPHICS_BITS), "size = %lu\n", size);
CloseHandle(file); file = CreateFileA(mf_name, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); todo_wine ok(file == INVALID_HANDLE_VALUE && GetLastError() == ERROR_SHARING_VIOLATION, - "CreateFile returned: %p %u\n", file, GetLastError()); + "CreateFile returned: %p %lu\n", file, GetLastError()); if (file != INVALID_HANDLE_VALUE) CloseHandle(file); file = CreateFileA(mf_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); ret = ReadFile(file, buf, sizeof(buf), &size, NULL); - ok(ret, "ReadFile failed: %u\n", GetLastError()); - ok(size == sizeof(MF_GRAPHICS_BITS), "size = %u\n", size); + ok(ret, "ReadFile failed: %lu\n", GetLastError()); + ok(size == sizeof(MF_GRAPHICS_BITS), "size = %lu\n", size); ok(!memcmp(buf, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS)), "unexpected file content\n"); CloseHandle(file);
@@ -3632,30 +3632,30 @@ static void test_metafile_file(void) }
ret = DeleteMetaFile(metafile); - ok(ret, "Could not delete metafile: %u\n", GetLastError()); + ok(ret, "Could not delete metafile: %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteMetaFile(metafile); ok(!ret, "DeleteMetaFile succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
SetLastError(0xdeadbeef); metafile = CloseMetaFile(dc); - ok(!metafile && GetLastError() == ERROR_INVALID_HANDLE, "CloseMetaFile returned %p (%u)\n", + ok(!metafile && GetLastError() == ERROR_INVALID_HANDLE, "CloseMetaFile returned %p (%lu)\n", metafile, GetLastError());
ret = DeleteFileA(mf_name); - ok(ret, "Could not delete file: %u\n", GetLastError()); + ok(ret, "Could not delete file: %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteMetaFile(ULongToHandle(0xdeadbeef)); ok(!ret, "DeleteMetaFile succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
SetLastError(0xdeadbeef); size = GetMetaFileBitsEx(ULongToHandle(0xdeadbeef), 0, NULL); - ok(!size, "GetMetaFileBitsEx returned %u\n", size); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(!size, "GetMetaFileBitsEx returned %lu\n", size); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError()); }
static void test_mf_SetPixel(void) @@ -3669,25 +3669,25 @@ static void test_mf_SetPixel(void) ok(hdc != 0, "CreateEnhMetaFile failed\n");
c = GetPixel(hdc, 5, 5); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
c = SetPixel(hdc, 5, 5, RGB(1,2,3)); - ok(c == 1, "c = %x\n", c); + ok(c == 1, "c = %lx\n", c);
c = SetPixel(hdc, 5, 5, RGB(1,2,3)); - ok(c == 1, "c = %x\n", c); + ok(c == 1, "c = %lx\n", c);
ret = SetPixelV(hdc, 5, 5, RGB(1,2,3)); ok(ret, "ret = %x\n", ret);
c = GetPixel(hdc, 5, 5); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
ret = Rectangle(hdc, 1, 1, 10, 10); ok(ret, "Rectangle failed\n");
c = GetPixel(hdc, 5, 5); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
mf = CloseMetaFile(hdc); ok(mf != 0, "CloseEnhMetaFile failed\n"); @@ -3734,19 +3734,19 @@ static void test_enhmetafile_file(void) GetTempFileNameA(temp_path, "wmf", 0, mf_name);
dc = CreateEnhMetaFileA(NULL, mf_name, NULL, NULL); - ok(dc != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(dc != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
file = CreateFileA(mf_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); ok(file == INVALID_HANDLE_VALUE && GetLastError() == ERROR_SHARING_VIOLATION, - "CreateFile returned: %p %u\n", file, GetLastError()); + "CreateFile returned: %p %lu\n", file, GetLastError());
file = CreateFileA(mf_name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
size = GetFileSize(file, NULL); - ok(!size, "size = %u\n", size); + ok(!size, "size = %lu\n", size);
pts[0].x = pts[0].y = 10; pts[1].x = pts[1].y = 20; @@ -3764,25 +3764,25 @@ static void test_enhmetafile_file(void) ok( ret, "PolyBezierTo failed\n" );
size = GetFileSize(file, NULL); - ok(!size, "size = %u\n", size); + ok(!size, "size = %lu\n", size);
metafile = CloseEnhMetaFile(dc); size = GetFileSize(file, NULL); - ok(size == sizeof(EMF_BEZIER_BITS), "size = %u\n", size); + ok(size == sizeof(EMF_BEZIER_BITS), "size = %lu\n", size);
CloseHandle(file); file = CreateFileA(mf_name, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); todo_wine ok(file == INVALID_HANDLE_VALUE && GetLastError() == ERROR_SHARING_VIOLATION, - "CreateFile returned: %p %u\n", file, GetLastError()); + "CreateFile returned: %p %lu\n", file, GetLastError()); if (file != INVALID_HANDLE_VALUE) CloseHandle(file); file = CreateFileA(mf_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); ret = ReadFile(file, buf, sizeof(buf), &size, NULL); - ok(ret, "ReadFile failed: %u\n", GetLastError()); - ok(size == sizeof(EMF_BEZIER_BITS), "size = %u\n", size); + ok(ret, "ReadFile failed: %lu\n", GetLastError()); + ok(size == sizeof(EMF_BEZIER_BITS), "size = %lu\n", size); CloseHandle(file);
if (compare_emf_bits(metafile, EMF_BEZIER_BITS, sizeof(EMF_BEZIER_BITS), "emf_Bezier", FALSE) != 0) @@ -3792,30 +3792,30 @@ static void test_enhmetafile_file(void) }
ret = DeleteEnhMetaFile(metafile); - ok(ret, "Could not delete emf: %u\n", GetLastError()); + ok(ret, "Could not delete emf: %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteEnhMetaFile(metafile); ok(!ret, "DeleteEnhMetaFile succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
SetLastError(0xdeadbeef); metafile = CloseEnhMetaFile(dc); - ok(!metafile && GetLastError() == ERROR_INVALID_HANDLE, "CloseMetaFile returned %p (%u)\n", + ok(!metafile && GetLastError() == ERROR_INVALID_HANDLE, "CloseMetaFile returned %p (%lu)\n", metafile, GetLastError());
ret = DeleteFileA(mf_name); - ok(ret, "Could not delete file: %u\n", GetLastError()); + ok(ret, "Could not delete file: %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteEnhMetaFile(ULongToHandle(0xdeadbeef)); ok(!ret, "DeleteEnhMetaFile succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
SetLastError(0xdeadbeef); size = GetEnhMetaFileBits(ULongToHandle(0xdeadbeef), 0, NULL); - ok(!size, "GetEnhMetaFileBitsEx returned %u\n", size); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n", GetLastError()); + ok(!size, "GetEnhMetaFileBitsEx returned %lu\n", size); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError()); }
static void test_emf_SetPixel(void) @@ -3829,22 +3829,22 @@ static void test_emf_SetPixel(void) ok(hdc != 0, "CreateEnhMetaFile failed\n");
c = GetPixel(hdc, 5, 5); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
c = SetPixel(hdc, 5, 5, RGB(1,2,3)); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
ret = SetPixelV(hdc, 5, 5, RGB(1,2,3)); ok(!ret, "ret = %x\n", ret);
c = GetPixel(hdc, 5, 5); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
ret = Rectangle(hdc, 1, 1, 10, 10); ok(ret, "Rectangle failed\n");
c = GetPixel(hdc, 5, 5); - ok(c == CLR_INVALID, "c = %x\n", c); + ok(c == CLR_INVALID, "c = %lx\n", c);
emf = CloseEnhMetaFile(hdc); ok(emf != 0, "CloseEnhMetaFile failed\n"); @@ -3885,10 +3885,10 @@ static void test_CopyMetaFile(void) INT type;
hdcMetafile = CreateMetaFileA(NULL); - ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
hMetafile = CloseMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseMetaFile error %ld\n", GetLastError()); type = GetObjectType(hMetafile); ok(type == OBJ_METAFILE, "CloseMetaFile created object with type %d\n", type);
@@ -3903,13 +3903,13 @@ static void test_CopyMetaFile(void) GetTempFileNameA(temp_path, "wmf", 0, mf_name);
hmf_copy = CopyMetaFileA(hMetafile, mf_name); - ok(hmf_copy != 0, "CopyMetaFile error %d\n", GetLastError()); + ok(hmf_copy != 0, "CopyMetaFile error %ld\n", GetLastError());
type = GetObjectType(hmf_copy); ok(type == OBJ_METAFILE, "CopyMetaFile created object with type %d\n", type);
ret = DeleteMetaFile(hMetafile); - ok( ret, "DeleteMetaFile(%p) error %d\n", hMetafile, GetLastError()); + ok( ret, "DeleteMetaFile(%p) error %ld\n", hMetafile, GetLastError());
if (compare_mf_disk_bits(mf_name, MF_BLANK_BITS, sizeof(MF_BLANK_BITS), "mf_blank") != 0) { @@ -3918,7 +3918,7 @@ static void test_CopyMetaFile(void) }
ret = DeleteMetaFile(hmf_copy); - ok( ret, "DeleteMetaFile(%p) error %d\n", hmf_copy, GetLastError()); + ok( ret, "DeleteMetaFile(%p) error %ld\n", hmf_copy, GetLastError());
DeleteFileA(mf_name); } @@ -3932,7 +3932,7 @@ static void test_SetMetaFileBits(void) METAHEADER *mh;
hmf = SetMetaFileBitsEx(sizeof(MF_GRAPHICS_BITS), MF_GRAPHICS_BITS); - ok(hmf != 0, "SetMetaFileBitsEx error %d\n", GetLastError()); + ok(hmf != 0, "SetMetaFileBitsEx error %ld\n", GetLastError()); type = GetObjectType(hmf); ok(type == OBJ_METAFILE, "SetMetaFileBitsEx created object with type %d\n", type);
@@ -3943,7 +3943,7 @@ static void test_SetMetaFileBits(void) }
ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError());
/* NULL data crashes XP SP1 */ /*hmf = SetMetaFileBitsEx(sizeof(MF_GRAPHICS_BITS), NULL);*/ @@ -3952,13 +3952,13 @@ static void test_SetMetaFileBits(void) SetLastError(0xdeadbeef); hmf = SetMetaFileBitsEx(0, MF_GRAPHICS_BITS); ok(!hmf, "SetMetaFileBitsEx should fail\n"); - ok(GetLastError() == ERROR_INVALID_DATA, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_DATA, "wrong error %ld\n", GetLastError());
/* Now with odd size */ SetLastError(0xdeadbeef); hmf = SetMetaFileBitsEx(sizeof(MF_GRAPHICS_BITS) - 1, MF_GRAPHICS_BITS); ok(!hmf, "SetMetaFileBitsEx should fail\n"); - ok(GetLastError() == 0xdeadbeef /* XP SP1 */, "wrong error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef /* XP SP1 */, "wrong error %ld\n", GetLastError());
/* Now with zeroed out header fields */ assert(sizeof(buf) >= sizeof(MF_GRAPHICS_BITS)); @@ -3971,7 +3971,7 @@ static void test_SetMetaFileBits(void) SetLastError(0xdeadbeef); hmf = SetMetaFileBitsEx(sizeof(MF_GRAPHICS_BITS), buf); ok(!hmf, "SetMetaFileBitsEx should fail\n"); - ok(GetLastError() == ERROR_INVALID_DATA, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_DATA, "wrong error %ld\n", GetLastError());
/* Now with corrupted mtSize field */ memcpy(buf, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS)); @@ -3979,7 +3979,7 @@ static void test_SetMetaFileBits(void) /* corruption of mtSize doesn't lead to a failure */ mh->mtSize *= 2; hmf = SetMetaFileBitsEx(sizeof(MF_GRAPHICS_BITS), buf); - ok(hmf != 0, "SetMetaFileBitsEx error %d\n", GetLastError()); + ok(hmf != 0, "SetMetaFileBitsEx error %ld\n", GetLastError());
if (compare_mf_bits(hmf, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS), "mf_Graphics") != 0) { @@ -3988,7 +3988,7 @@ static void test_SetMetaFileBits(void) }
ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError());
#ifndef _WIN64 /* Generates access violation on XP x64 and Win2003 x64 */ /* Now with zeroed out mtSize field */ @@ -3997,7 +3997,7 @@ static void test_SetMetaFileBits(void) /* zeroing mtSize doesn't lead to a failure */ mh->mtSize = 0; hmf = SetMetaFileBitsEx(sizeof(MF_GRAPHICS_BITS), buf); - ok(hmf != 0, "SetMetaFileBitsEx error %d\n", GetLastError()); + ok(hmf != 0, "SetMetaFileBitsEx error %ld\n", GetLastError());
if (compare_mf_bits(hmf, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS), "mf_Graphics") != 0) { @@ -4006,7 +4006,7 @@ static void test_SetMetaFileBits(void) }
ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError()); #endif }
@@ -4025,21 +4025,21 @@ static void test_mf_Graphics(void) static const BYTE types[] = { PT_MOVETO, PT_LINETO };
hdcMetafile = CreateMetaFileA(NULL); - ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
ret = MoveToEx(hdcMetafile, 1, 1, NULL); - ok( ret, "MoveToEx error %d.\n", GetLastError()); + ok( ret, "MoveToEx error %ld.\n", GetLastError()); ret = LineTo(hdcMetafile, 2, 2); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError());
oldpoint.x = oldpoint.y = 0xdeadbeef; ret = MoveToEx(hdcMetafile, 1, 1, &oldpoint); - ok( ret, "MoveToEx error %d.\n", GetLastError()); + ok( ret, "MoveToEx error %ld.\n", GetLastError()); ok(oldpoint.x == 0xdeadbeef && oldpoint.y == 0xdeadbeef, "MoveToEx modified oldpoint\n");
ret = Ellipse(hdcMetafile, 0, 0, 2, 2); - ok( ret, "Ellipse error %d.\n", GetLastError()); + ok( ret, "Ellipse error %ld.\n", GetLastError());
ret = ArcTo(hdcMetafile, 1, 2, 30, 40, 11, 12, 23, 24 ); ok( !ret, "ArcTo succeeded\n" ); @@ -4048,10 +4048,10 @@ static void test_mf_Graphics(void) ret = PolyDraw(hdcMetafile, points, types, ARRAY_SIZE(points)); ok(!ret, "PolyDraw succeeded\n"); todo_wine - ok(GetLastError() == 0xdeadbeef, "GetLastError() = %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() = %lu\n", GetLastError());
hMetafile = CloseMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseMetaFile error %ld\n", GetLastError()); type = GetObjectType(hdcMetafile); ok(type == 0 || broken(type == OBJ_METADC) /* win10 >=1607 */, "CloseMetaFile has to destroy metafile hdc (%d)\n", type); @@ -4064,7 +4064,7 @@ static void test_mf_Graphics(void) }
ret = DeleteMetaFile(hMetafile); - ok( ret, "DeleteMetaFile(%p) error %d\n", + ok( ret, "DeleteMetaFile(%p) error %ld\n", hMetafile, GetLastError()); }
@@ -4088,7 +4088,7 @@ static void test_mf_FloodFill(void) };
hdc = CreateMetaFileA(NULL); - ok(hdc != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(hdc != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
ret = FloodFill(hdc, 1, 2, RGB(3,4,5)); ok(ret, "FloodFill failed\n"); @@ -4100,7 +4100,7 @@ static void test_mf_FloodFill(void) ok(ret, "FloodFill failed\n");
mf = CloseMetaFile(hdc); - ok(mf != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(mf != 0, "CloseMetaFile error %ld\n", GetLastError());
if (compare_mf_bits (mf, floodfill_bits, sizeof(floodfill_bits), "mf_FloodFill") != 0) @@ -4110,7 +4110,7 @@ static void test_mf_FloodFill(void) }
ret = DeleteMetaFile(mf); - ok(ret, "DeleteMetaFile(%p) error %d\n", mf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", mf, GetLastError()); }
static void test_mf_PatternBrush(void) @@ -4131,16 +4131,16 @@ static void test_mf_PatternBrush(void) orig_lb->lbStyle = BS_PATTERN; orig_lb->lbColor = RGB(0, 0, 0); orig_lb->lbHatch = (ULONG_PTR)CreateBitmap (8, 8, 1, 1, SAMPLE_PATTERN_BRUSH); - ok((HBITMAP)orig_lb->lbHatch != NULL, "CreateBitmap error %d.\n", GetLastError()); + ok((HBITMAP)orig_lb->lbHatch != NULL, "CreateBitmap error %ld.\n", GetLastError());
hBrush = CreateBrushIndirect (orig_lb); - ok(hBrush != 0, "CreateBrushIndirect error %d\n", GetLastError()); + ok(hBrush != 0, "CreateBrushIndirect error %ld\n", GetLastError());
hdcMetafile = CreateMetaFileA(NULL); - ok(hdcMetafile != 0, "CreateMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateMetaFileA error %ld\n", GetLastError());
hBrush = SelectObject(hdcMetafile, hBrush); - ok(hBrush != 0, "SelectObject error %d.\n", GetLastError()); + ok(hBrush != 0, "SelectObject error %ld.\n", GetLastError());
memset(info, 0, sizeof(buffer)); info->bmiHeader.biSize = sizeof(info->bmiHeader); @@ -4156,10 +4156,10 @@ static void test_mf_PatternBrush(void) ok(dib_brush != NULL, "CreatePatternBrush failed\n");
dib_brush = SelectObject(hdcMetafile, dib_brush); - ok(dib_brush != 0, "SelectObject error %d.\n", GetLastError()); + ok(dib_brush != 0, "SelectObject error %ld.\n", GetLastError());
hMetafile = CloseMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseMetaFile error %ld\n", GetLastError()); type = GetObjectType(hdcMetafile); ok(type == 0 || broken(type == OBJ_METADC) /* win10 >=1607 */, "CloseMetaFile has to destroy metafile hdc (%d)\n", type); @@ -4172,13 +4172,13 @@ static void test_mf_PatternBrush(void) }
ret = DeleteMetaFile(hMetafile); - ok( ret, "DeleteMetaFile error %d\n", GetLastError()); + ok( ret, "DeleteMetaFile error %ld\n", GetLastError()); ret = DeleteObject(hBrush); - ok( ret, "DeleteObject(HBRUSH) error %d\n", GetLastError()); + ok( ret, "DeleteObject(HBRUSH) error %ld\n", GetLastError()); ret = DeleteObject(dib_brush); ok(ret, "DeleteObject failed\n"); ret = DeleteObject((HBITMAP)orig_lb->lbHatch); - ok( ret, "DeleteObject(HBITMAP) error %d\n", + ok( ret, "DeleteObject(HBITMAP) error %ld\n", GetLastError()); HeapFree (GetProcessHeap(), 0, orig_lb); } @@ -4200,16 +4200,16 @@ static void test_emf_pattern_brush(void) orig_lb->lbStyle = BS_PATTERN; orig_lb->lbColor = RGB(0, 0, 0); orig_lb->lbHatch = (ULONG_PTR)CreateBitmap(8, 8, 1, 1, SAMPLE_PATTERN_BRUSH); - ok((HBITMAP)orig_lb->lbHatch != NULL, "CreateBitmap error %d.\n", GetLastError()); + ok((HBITMAP)orig_lb->lbHatch != NULL, "CreateBitmap error %ld.\n", GetLastError());
bitmap_brush = CreateBrushIndirect(orig_lb); - ok(bitmap_brush != 0, "CreateBrushIndirect error %d\n", GetLastError()); + ok(bitmap_brush != 0, "CreateBrushIndirect error %ld\n", GetLastError());
hdc = CreateEnhMetaFileA(NULL, NULL, NULL, NULL); - ok(hdc != 0, "CreateMetaFileA error %d\n", GetLastError()); + ok(hdc != 0, "CreateMetaFileA error %ld\n", GetLastError());
bitmap_brush = SelectObject(hdc, bitmap_brush); - ok(bitmap_brush != 0, "SelectObject error %d.\n", GetLastError()); + ok(bitmap_brush != 0, "SelectObject error %ld.\n", GetLastError());
memset(info, 0, sizeof(buffer)); info->bmiHeader.biSize = sizeof(info->bmiHeader); @@ -4225,10 +4225,10 @@ static void test_emf_pattern_brush(void) ok(dib_brush != NULL, "CreatePatternBrush failed\n");
dib_brush = SelectObject(hdc, dib_brush); - ok(dib_brush != 0, "SelectObject error %d.\n", GetLastError()); + ok(dib_brush != 0, "SelectObject error %ld.\n", GetLastError());
emf = CloseEnhMetaFile(hdc); - ok(emf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(emf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if (compare_emf_bits(emf, emf_pattern_brush_bits, sizeof(emf_pattern_brush_bits), "emf_pattern_brush", FALSE)) @@ -4238,7 +4238,7 @@ static void test_emf_pattern_brush(void) }
ret = DeleteEnhMetaFile(emf); - ok(ret, "DeleteMetaFile error %d\n", GetLastError()); + ok(ret, "DeleteMetaFile error %ld\n", GetLastError()); ret = DeleteObject(bitmap_brush); ok(ret, "DeleteObject failed\n"); ret = DeleteObject(dib_brush); @@ -4320,21 +4320,21 @@ static void test_mf_DCBrush(void) ok( hdcMetafile != 0, "CreateMetaFileA failed\n" );
hBrush = SelectObject(hdcMetafile, GetStockObject(DC_BRUSH)); - ok(hBrush != 0, "SelectObject error %d.\n", GetLastError()); + ok(hBrush != 0, "SelectObject error %ld.\n", GetLastError());
hPen = SelectObject(hdcMetafile, GetStockObject(DC_PEN)); - ok(hPen != 0, "SelectObject error %d.\n", GetLastError()); + ok(hPen != 0, "SelectObject error %ld.\n", GetLastError());
color = pSetDCBrushColor( hdcMetafile, RGB(0x55,0x55,0x55) ); - ok( color == CLR_INVALID, "SetDCBrushColor returned %x\n", color ); + ok( color == CLR_INVALID, "SetDCBrushColor returned %lx\n", color );
color = pSetDCPenColor( hdcMetafile, RGB(0x33,0x44,0x55) ); - ok( color == CLR_INVALID, "SetDCPenColor returned %x\n", color ); + ok( color == CLR_INVALID, "SetDCPenColor returned %lx\n", color );
Rectangle( hdcMetafile, 10, 10, 20, 20 );
color = pSetDCBrushColor( hdcMetafile, RGB(0x12,0x34,0x56) ); - ok( color == CLR_INVALID, "SetDCBrushColor returned %x\n", color ); + ok( color == CLR_INVALID, "SetDCBrushColor returned %lx\n", color );
hMetafile = CloseMetaFile(hdcMetafile); ok( hMetafile != 0, "CloseMetaFile failed\n" ); @@ -4345,7 +4345,7 @@ static void test_mf_DCBrush(void) EnumMetaFile(0, hMetafile, mf_enum_proc, 0); } ret = DeleteMetaFile(hMetafile); - ok(ret, "DeleteMetaFile(%p) error %d\n", hMetafile, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hMetafile, GetLastError()); }
static void test_mf_select(void) @@ -4431,7 +4431,7 @@ static void test_mf_select(void) /* pen is still black after RestoreDC */ ok(obj == GetStockObject(BLACK_PEN), "unexpected pen: %p\n", obj); ret = DeleteObject(pen); - ok(ret, "DeleteObject failed: %u\n", GetLastError()); + ok(ret, "DeleteObject failed: %lu\n", GetLastError());
obj = GetCurrentObject(hdc, OBJ_PEN); ok(!obj, "GetCurrentObject succeeded\n"); @@ -4439,7 +4439,7 @@ static void test_mf_select(void) SetLastError(0xdeadbeef); obj = SelectObject(hdc, GetStockObject(DEFAULT_PALETTE)); ok(!obj && GetLastError() == ERROR_INVALID_FUNCTION, - "SelectObject returned %p (%u).\n", obj, GetLastError()); + "SelectObject returned %p (%lu).\n", obj, GetLastError());
ret = RestoreDC(hdc, -5); ok(ret, "RestoreDC failed\n"); @@ -4454,7 +4454,7 @@ static void test_mf_select(void) }
ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError());
/* create two metafiles, select the same pen to both of them, * unselect it from only one and then delete */ @@ -4472,7 +4472,7 @@ static void test_mf_select(void) obj = SelectObject(hdc, GetStockObject(BLACK_PEN)); ok(obj == pen, "unexpected pen: %p\n", obj); ret = DeleteObject(pen); - ok(ret, "DeleteObject failed: %u\n", GetLastError()); + ok(ret, "DeleteObject failed: %lu\n", GetLastError());
hmf = CloseMetaFile(hdc); ok(hmf != 0, "CloseMetaFile failed\n"); @@ -4483,7 +4483,7 @@ static void test_mf_select(void) EnumMetaFile(0, hmf, mf_enum_proc, 0); } ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError());
hmf = CloseMetaFile(hdc2); ok(hmf != 0, "CloseMetaFile failed\n"); @@ -4494,7 +4494,7 @@ static void test_mf_select(void) EnumMetaFile(0, hmf, mf_enum_proc, 0); } ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError()); }
static void test_emf_select(void) @@ -4622,14 +4622,14 @@ static void test_emf_select(void) /* pen is still black after RestoreDC */ ok(obj == pen, "unexpected pen: %p\n", obj); ret = DeleteObject(pen); - ok(ret, "DeleteObject failed: %u\n", GetLastError()); + ok(ret, "DeleteObject failed: %lu\n", GetLastError());
obj = GetCurrentObject(hdc, OBJ_PEN); ok(obj == GetStockObject(BLACK_PEN), "GetCurrentObject returned %p\n", obj);
SetLastError(0xdeadbeef); obj = SelectObject(hdc, GetStockObject(DEFAULT_PALETTE)); - ok(!obj, "SelectObject returned %p (%u).\n", obj, GetLastError()); + ok(!obj, "SelectObject returned %p (%lu).\n", obj, GetLastError());
ret = RestoreDC(hdc, -5); ok(!ret, "RestoreDC succeeded\n"); @@ -4644,7 +4644,7 @@ static void test_emf_select(void) }
ret = DeleteEnhMetaFile(hemf); - ok(ret, "DeleteEnhMetaFile(%p) error %d\n", hemf, GetLastError()); + ok(ret, "DeleteEnhMetaFile(%p) error %ld\n", hemf, GetLastError());
/* create two EMFs, select the same pen to both of them, * unselect it from only one and then delete */ @@ -4662,7 +4662,7 @@ static void test_emf_select(void) obj = SelectObject(hdc, GetStockObject(BLACK_PEN)); ok(obj == pen, "unexpected pen: %p\n", obj); ret = DeleteObject(pen); - ok(ret, "DeleteObject failed: %u\n", GetLastError()); + ok(ret, "DeleteObject failed: %lu\n", GetLastError());
hemf = CloseEnhMetaFile(hdc); ok(hemf != 0, "CloseEnhMetaFile failed\n"); @@ -4673,7 +4673,7 @@ static void test_emf_select(void) dump_emf_records(hemf, "emf_delete_not_selected"); } ret = DeleteEnhMetaFile(hemf); - ok(ret, "DeleteEnhMetaFile(%p) error %d\n", hemf, GetLastError()); + ok(ret, "DeleteEnhMetaFile(%p) error %ld\n", hemf, GetLastError());
hemf = CloseEnhMetaFile(hdc2); ok(hemf != 0, "CloseEnhMetaFile failed\n"); @@ -4684,7 +4684,7 @@ static void test_emf_select(void) dump_emf_records(hemf, "emf_delete_selected"); } ret = DeleteEnhMetaFile(hemf); - ok(ret, "DeleteEnhMetaFile(%p) error %d\n", hemf, GetLastError()); + ok(ret, "DeleteEnhMetaFile(%p) error %ld\n", hemf, GetLastError()); }
static const PALETTEENTRY logpalettedata[8] = { @@ -4764,7 +4764,7 @@ static void test_mf_palette(void) }
ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError()); }
static void test_mf_blit(void) @@ -4852,7 +4852,7 @@ static void test_mf_blit(void) bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biCompression = BI_RGB; bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); - ok(!!bitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + ok(!!bitmap, "CreateDIBSection failed, error %ld\n", GetLastError()); for (i = 0; i < bmi.bmiHeader.biHeight * bmi.bmiHeader.biWidth * 3; i++) ((BYTE *)bits)[i] = i + 10;
@@ -4886,7 +4886,7 @@ static void test_mf_blit(void) }
ret = DeleteMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError()); }
static void test_emf_blit(void) @@ -4914,7 +4914,7 @@ static void test_emf_blit(void) bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biCompression = BI_RGB; bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); - ok(!!bitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + ok(!!bitmap, "CreateDIBSection failed, error %ld\n", GetLastError()); for (i = 0; i < bmi.bmiHeader.biHeight * bmi.bmiHeader.biWidth * 3; i++) ((BYTE *)bits)[i] = i + 10;
@@ -4951,7 +4951,7 @@ static void test_emf_blit(void) }
ret = DeleteEnhMetaFile(hmf); - ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hmf, GetLastError()); }
static void test_emf_mask_blit(void) @@ -4978,7 +4978,7 @@ static void test_emf_mask_blit(void) bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biCompression = BI_RGB; bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); - ok(!!bitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + ok(!!bitmap, "CreateDIBSection failed, error %ld\n", GetLastError()); for (i = 0; i < bmi.bmiHeader.biHeight * bmi.bmiHeader.biWidth * 3; i++) ((BYTE *)bits)[i] = i + 10;
@@ -4988,7 +4988,7 @@ static void test_emf_mask_blit(void) bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biCompression = BI_RGB; mask_bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); - ok(!!mask_bitmap, "CreateDIBSection failed, error %d\n", GetLastError()); + ok(!!mask_bitmap, "CreateDIBSection failed, error %ld\n", GetLastError()); memset(bits, ~0, bmi.bmiHeader.biHeight * 4);
SelectObject(dib_hdc, bitmap); @@ -5017,7 +5017,7 @@ static void test_emf_mask_blit(void) }
ret = DeleteEnhMetaFile(emf); - ok(ret, "DeleteMetaFile(%p) error %d\n", emf, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", emf, GetLastError()); }
static const unsigned char EMF_STRETCHDIBITS_1BIT_3X3_NOSIZE[] = @@ -6412,15 +6412,15 @@ static void test_emf_StretchDIBits(void) }
hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %ld\n", GetLastError());
ret = StretchDIBits(hdc_emf, 0, 0, bitmap_width, bitmap_height, 0, 0, tests[test_idx].src_width, tests[test_idx].src_height, dib_bits, &bmi.i, DIB_RGB_COLORS, SRCCOPY); - ok(ret == bitmap_height, "expected StretchDIBits to return %d, got %d (lasterr %u)\n", bitmap_height, ret, GetLastError()); + ok(ret == bitmap_height, "expected StretchDIBits to return %d, got %d (lasterr %lu)\n", bitmap_height, ret, GetLastError());
hemf = CloseEnhMetaFile(hdc_emf); - ok(!!hemf, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf, "CloseEnhMetaFile failed, error %ld\n", GetLastError());
ret = compare_emf_bits(hemf, tests[test_idx].bits, tests[test_idx].bits_count, "test_emf_StretchDIBits", FALSE); @@ -7794,16 +7794,16 @@ static void test_emf_SetDIBitsToDevice(void) }
hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %ld\n", GetLastError());
ret = SetDIBitsToDevice(hdc_emf, 0, 0, tests[test_idx].width, tests[test_idx].height, 0, 0, 0, bitmap_height, dib_bits, &bmi.i, DIB_RGB_COLORS); - ok(ret == tests[test_idx].height, "expected SetDIBitsToDevice to return %d, got %d (lasterr %u)\n", tests[test_idx].height, ret, GetLastError()); + ok(ret == tests[test_idx].height, "expected SetDIBitsToDevice to return %d, got %d (lasterr %lu)\n", tests[test_idx].height, ret, GetLastError());
hemf = CloseEnhMetaFile(hdc_emf); - ok(!!hemf, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf, "CloseEnhMetaFile failed, error %ld\n", GetLastError());
ret = compare_emf_bits(hemf, tests[test_idx].bits, tests[test_idx].bits_count, "test_emf_SetDIBitsToDevice", FALSE); @@ -7829,19 +7829,19 @@ static void test_mf_ExtTextOut_on_path(void) static const INT dx[4] = { 3, 5, 8, 12 };
hdcMetafile = CreateMetaFileA(NULL); - ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateMetaFileA(NULL) error %ld\n", GetLastError());
ret = BeginPath(hdcMetafile); ok(!ret, "BeginPath on metafile DC should fail\n");
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx); - ok(ret, "ExtTextOut error %d\n", GetLastError()); + ok(ret, "ExtTextOut error %ld\n", GetLastError());
ret = EndPath(hdcMetafile); ok(!ret, "EndPath on metafile DC should fail\n");
hMetafile = CloseMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseMetaFile error %ld\n", GetLastError());
if (compare_mf_bits(hMetafile, MF_TEXTOUT_ON_PATH_BITS, sizeof(MF_TEXTOUT_ON_PATH_BITS), "mf_TextOut_on_path") != 0) @@ -7851,7 +7851,7 @@ static void test_mf_ExtTextOut_on_path(void) }
ret = DeleteMetaFile(hMetafile); - ok(ret, "DeleteMetaFile(%p) error %d\n", hMetafile, GetLastError()); + ok(ret, "DeleteMetaFile(%p) error %ld\n", hMetafile, GetLastError()); }
static const unsigned char EMF_EMPTY_BITS[] = @@ -7888,41 +7888,41 @@ static void test_emf_ExtTextOut_on_path(void) /* Win9x doesn't play EMFs on invisible windows */ hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, NULL); - ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + ok(hwnd != 0, "CreateWindowExA error %ld\n", GetLastError());
hdcDisplay = GetDC(hwnd); - ok(hdcDisplay != 0, "GetDC error %d\n", GetLastError()); + ok(hdcDisplay != 0, "GetDC error %ld\n", GetLastError());
/* with default font */ ret = BeginPath(hdcDisplay); - ok(ret, "BeginPath error %d\n", GetLastError()); + ok(ret, "BeginPath error %ld\n", GetLastError());
ret = ExtTextOutA(hdcDisplay, 11, 22, 0, NULL, "Test", 4, dx); - ok(ret, "ExtTextOut error %d\n", GetLastError()); + ok(ret, "ExtTextOut error %ld\n", GetLastError());
ret = EndPath(hdcDisplay); - ok(ret, "EndPath error %d\n", GetLastError()); + ok(ret, "EndPath error %ld\n", GetLastError());
ret = GetPath(hdcDisplay, NULL, NULL, 0); ok(!ret, "expected 0, got %d\n", ret);
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ret = BeginPath(hdcMetafile); - ok(ret, "BeginPath error %d\n", GetLastError()); + ok(ret, "BeginPath error %ld\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx); - ok(ret, "ExtTextOut error %d\n", GetLastError()); + ok(ret, "ExtTextOut error %ld\n", GetLastError());
ret = EndPath(hdcMetafile); - ok(ret, "EndPath error %d\n", GetLastError()); + ok(ret, "EndPath error %ld\n", GetLastError());
ret = GetPath(hdcMetafile, NULL, NULL, 0); ok(!ret, "expected 0, got %d\n", ret);
hMetafile = CloseEnhMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
/* this doesn't succeed yet: EMF has correct size, all EMF records * are there, but their contents don't match for different reasons. @@ -7935,7 +7935,7 @@ static void test_emf_ExtTextOut_on_path(void) }
ret = DeleteEnhMetaFile(hMetafile); - ok(ret, "DeleteEnhMetaFile error %d\n", GetLastError()); + ok(ret, "DeleteEnhMetaFile error %ld\n", GetLastError());
/* with outline font */ memset(&lf, 0, sizeof(lf)); @@ -7946,17 +7946,17 @@ static void test_emf_ExtTextOut_on_path(void) lf.lfQuality = DEFAULT_QUALITY; lstrcpyA(lf.lfFaceName, "Tahoma"); hFont = CreateFontIndirectA(&lf); - ok(hFont != 0, "CreateFontIndirectA error %d\n", GetLastError()); + ok(hFont != 0, "CreateFontIndirectA error %ld\n", GetLastError()); hFont = SelectObject(hdcDisplay, hFont);
ret = BeginPath(hdcDisplay); - ok(ret, "BeginPath error %d\n", GetLastError()); + ok(ret, "BeginPath error %ld\n", GetLastError());
ret = ExtTextOutA(hdcDisplay, 11, 22, 0, NULL, "Test", 4, dx); - ok(ret, "ExtTextOut error %d\n", GetLastError()); + ok(ret, "ExtTextOut error %ld\n", GetLastError());
ret = EndPath(hdcDisplay); - ok(ret, "EndPath error %d\n", GetLastError()); + ok(ret, "EndPath error %ld\n", GetLastError());
ret = GetPath(hdcDisplay, NULL, NULL, 0); ok(ret != 0, "expected != 0\n"); @@ -7964,18 +7964,18 @@ static void test_emf_ExtTextOut_on_path(void) SelectObject(hdcDisplay, hFont);
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
hFont = SelectObject(hdcMetafile, hFont);
ret = BeginPath(hdcMetafile); - ok(ret, "BeginPath error %d\n", GetLastError()); + ok(ret, "BeginPath error %ld\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx); - ok(ret, "ExtTextOut error %d\n", GetLastError()); + ok(ret, "ExtTextOut error %ld\n", GetLastError());
ret = EndPath(hdcMetafile); - ok(ret, "EndPath error %d\n", GetLastError()); + ok(ret, "EndPath error %ld\n", GetLastError());
ret = GetPath(hdcMetafile, NULL, NULL, 0); ok(!ret, "expected 0, got %d\n", ret); @@ -7984,7 +7984,7 @@ static void test_emf_ExtTextOut_on_path(void) DeleteObject(hFont);
hMetafile = CloseEnhMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if (compare_emf_bits(hMetafile, EMF_TEXTOUT_OUTLINE_ON_PATH_BITS, sizeof(EMF_TEXTOUT_OUTLINE_ON_PATH_BITS), "emf_TextOut_outline_on_path", FALSE) != 0) @@ -7994,17 +7994,17 @@ static void test_emf_ExtTextOut_on_path(void) }
ret = DeleteEnhMetaFile(hMetafile); - ok(ret, "DeleteEnhMetaFile error %d\n", GetLastError()); + ok(ret, "DeleteEnhMetaFile error %ld\n", GetLastError());
/* test ExtTextOut with count == -1 doesn't get written */ hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, ETO_OPAQUE, &rect, "Test", -1, dx); - ok(!ret, "ExtTextOut error %d\n", GetLastError()); + ok(!ret, "ExtTextOut error %ld\n", GetLastError());
hMetafile = CloseEnhMetaFile(hdcMetafile); - ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hMetafile != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if (compare_emf_bits(hMetafile, EMF_EMPTY_BITS, sizeof(EMF_EMPTY_BITS), "emf_TextOut_negative_count", FALSE) != 0) @@ -8014,10 +8014,10 @@ static void test_emf_ExtTextOut_on_path(void) }
ret = DeleteEnhMetaFile(hMetafile); - ok(ret, "DeleteEnhMetaFile error %d\n", GetLastError()); + ok(ret, "DeleteEnhMetaFile error %ld\n", GetLastError());
ret = ReleaseDC(hwnd, hdcDisplay); - ok(ret, "ReleaseDC error %d\n", GetLastError()); + ok(ret, "ReleaseDC error %ld\n", GetLastError()); DestroyWindow(hwnd); }
@@ -8099,18 +8099,18 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, INT ret;
if (winetest_debug > 1) - trace("EMR_EXTSELECTCLIPRGN: cbRgnData %#x, iMode %u\n", clip->cbRgnData, clip->iMode); + trace("EMR_EXTSELECTCLIPRGN: cbRgnData %#lx, iMode %lu\n", clip->cbRgnData, clip->iMode);
- ok(clip->iMode == RGN_COPY, "expected RGN_COPY, got %u\n", clip->iMode); + ok(clip->iMode == RGN_COPY, "expected RGN_COPY, got %lu\n", clip->iMode); ok(clip->cbRgnData >= sizeof(RGNDATAHEADER) + sizeof(RECT), - "too small data block: %u bytes\n", clip->cbRgnData); + "too small data block: %lu bytes\n", clip->cbRgnData); if (clip->cbRgnData < sizeof(RGNDATAHEADER) + sizeof(RECT)) return 0;
rgn1 = (const union _rgn *)clip->RgnData;
if (winetest_debug > 1) - trace("size %u, type %u, count %u, rgn size %u, bound %s\n", + trace("size %lu, type %lu, count %lu, rgn size %lu, bound %s\n", rgn1->data.rdh.dwSize, rgn1->data.rdh.iType, rgn1->data.rdh.nCount, rgn1->data.rdh.nRgnSize, wine_dbgstr_rect(&rgn1->data.rdh.rcBound)); @@ -8121,18 +8121,18 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, if (winetest_debug > 1) trace("rect %s\n", wine_dbgstr_rect(&rect)); ok(EqualRect(&rect, rc), "rects don't match\n");
- ok(rgn1->data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u\n", rgn1->data.rdh.dwSize); - ok(rgn1->data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn1->data.rdh.iType); - ok(rgn1->data.rdh.nCount == 1, "expected 1, got %u\n", rgn1->data.rdh.nCount); + ok(rgn1->data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %lu\n", rgn1->data.rdh.dwSize); + ok(rgn1->data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %lu\n", rgn1->data.rdh.iType); + ok(rgn1->data.rdh.nCount == 1, "expected 1, got %lu\n", rgn1->data.rdh.nCount); ok(rgn1->data.rdh.nRgnSize == sizeof(RECT), - "expected sizeof(RECT), got %u\n", rgn1->data.rdh.nRgnSize); + "expected sizeof(RECT), got %lu\n", rgn1->data.rdh.nRgnSize);
hrgn = CreateRectRgn(0, 0, 0, 0);
memset(&xform, 0, sizeof(xform)); SetLastError(0xdeadbeef); ret = GetWorldTransform(hdc, &xform); - ok(ret, "GetWorldTransform error %u\n", GetLastError()); + ok(ret, "GetWorldTransform error %lu\n", GetLastError());
if (winetest_debug > 1) trace("xform.eM11 %f, xform.eM22 %f\n", xform.eM11, xform.eM22);
@@ -8151,7 +8151,7 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, ok(ret == sizeof(rgn2), "expected sizeof(rgn2), got %u\n", ret);
if (winetest_debug > 1) - trace("size %u, type %u, count %u, rgn size %u, bound %s\n", rgn2.data.rdh.dwSize, + trace("size %lu, type %lu, count %lu, rgn size %lu, bound %s\n", rgn2.data.rdh.dwSize, rgn2.data.rdh.iType, rgn2.data.rdh.nCount, rgn2.data.rdh.nRgnSize, wine_dbgstr_rect(&rgn2.data.rdh.rcBound));
@@ -8169,11 +8169,11 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, if (winetest_debug > 1) trace("transformed %s\n", wine_dbgstr_rect(&rc_transformed)); ok(is_equal_rect(&rect, &rc_transformed), "rects don't match\n");
- ok(rgn2.data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u\n", rgn2.data.rdh.dwSize); - ok(rgn2.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn2.data.rdh.iType); - ok(rgn2.data.rdh.nCount == 1, "expected 1, got %u\n", rgn2.data.rdh.nCount); + ok(rgn2.data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %lu\n", rgn2.data.rdh.dwSize); + ok(rgn2.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %lu\n", rgn2.data.rdh.iType); + ok(rgn2.data.rdh.nCount == 1, "expected 1, got %lu\n", rgn2.data.rdh.nCount); ok(rgn2.data.rdh.nRgnSize == sizeof(RECT), - "expected sizeof(RECT), got %u\n", rgn2.data.rdh.nRgnSize); + "expected sizeof(RECT), got %lu\n", rgn2.data.rdh.nRgnSize);
DeleteObject(hrgn); } @@ -8195,7 +8195,7 @@ static void test_emf_clipping(void)
SetLastError(0xdeadbeef); hdc = CreateEnhMetaFileA(0, NULL, NULL, NULL); - ok(hdc != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdc != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
/* Need to write something to the emf, otherwise Windows won't play it back */ LineTo(hdc, 1, 1); @@ -8208,11 +8208,11 @@ static void test_emf_clipping(void) Rectangle(hdc, rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom); EndPath(hdc); ret = SelectClipPath(hdc, RGN_AND); - ok(ret, "SelectClipPath error %d\n", GetLastError()); + ok(ret, "SelectClipPath error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hemf = CloseEnhMetaFile(hdc); - ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if (compare_emf_bits(hemf, EMF_CLIPPING, sizeof(EMF_CLIPPING), "emf_clipping", FALSE) != 0) @@ -8226,12 +8226,12 @@ static void test_emf_clipping(void) /* Win9x doesn't play EMFs on invisible windows */ hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, NULL); - ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + ok(hwnd != 0, "CreateWindowExA error %ld\n", GetLastError());
hdc = GetDC(hwnd);
ret = EnumEnhMetaFile(hdc, hemf, clip_emf_enum_proc, &rc_clip, &rc); - ok(ret, "EnumEnhMetaFile error %d\n", GetLastError()); + ok(ret, "EnumEnhMetaFile error %ld\n", GetLastError());
DeleteEnhMetaFile(hemf); ReleaseDC(hwnd, hdc); @@ -8264,7 +8264,7 @@ static void test_emf_clipping(void) ok(ret == 1, "expected 1, got %d\n", ret); ret = GetRegionData(hrgn, sizeof(buffer), rgndata); ok(ret == sizeof(RGNDATAHEADER) + sizeof(RECT), "got %u\n", ret); - ok(rgndata->rdh.nCount == 1, "got %u rectangles\n", rgndata->rdh.nCount); + ok(rgndata->rdh.nCount == 1, "got %lu rectangles\n", rgndata->rdh.nCount); ok(EqualRect((RECT *)rgndata->Buffer, &rc), "got rect %s\n", wine_dbgstr_rect((RECT *)rgndata->Buffer)); SetRect(&rc_res, -1, -1, -1, -1); ret = GetClipBox(hdc, &rc_res); @@ -8280,7 +8280,7 @@ static void test_emf_clipping(void) ok(ret == 1, "expected 1, got %d\n", ret); ret = GetRegionData(hrgn, sizeof(buffer), rgndata); ok(ret == sizeof(RGNDATAHEADER) + sizeof(RECT), "got %u\n", ret); - ok(rgndata->rdh.nCount == 1, "got %u rectangles\n", rgndata->rdh.nCount); + ok(rgndata->rdh.nCount == 1, "got %lu rectangles\n", rgndata->rdh.nCount); ok(EqualRect((RECT *)rgndata->Buffer, &rc_sclip), "got rect %s\n", wine_dbgstr_rect((RECT *)rgndata->Buffer)); SetRect(&rc_res, -1, -1, -1, -1); ret = GetClipBox(hdc, &rc_res); @@ -8368,7 +8368,7 @@ static void test_mf_clipping(void)
SetLastError(0xdeadbeef); hdc = CreateMetaFileA(NULL); - ok(hdc != 0, "CreateMetaFileA error %d\n", GetLastError()); + ok(hdc != 0, "CreateMetaFileA error %ld\n", GetLastError());
hrgn = CreateRectRgn(rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom); ret = SelectClipRgn(hdc, hrgn); @@ -8381,7 +8381,7 @@ static void test_mf_clipping(void)
SetLastError(0xdeadbeef); hmf = CloseMetaFile(hdc); - ok(hmf != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hmf != 0, "CloseMetaFile error %ld\n", GetLastError());
if (compare_mf_bits(hmf, MF_CLIP_BITS, sizeof(MF_CLIP_BITS), "mf_clipping") != 0) @@ -8393,12 +8393,12 @@ static void test_mf_clipping(void)
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, NULL); - ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + ok(hwnd != 0, "CreateWindowExA error %ld\n", GetLastError());
hdc = GetDC(hwnd);
ret = EnumMetaFile(hdc, hmf, clip_mf_enum_proc, (LPARAM)&rc_clip); - ok(ret, "EnumMetaFile error %d\n", GetLastError()); + ok(ret, "EnumMetaFile error %ld\n", GetLastError());
/* Oddly, windows doesn't seem to use META_SELECTCLIPREGION */ ok(clip_mf_enum_proc_seen_selectclipregion == 0, @@ -8435,20 +8435,20 @@ static void test_mf_GetPath(void)
SetLastError(0xdeadbeef); hdc = CreateMetaFileA(NULL); - ok(hdc != 0, "CreateMetaFileA error %d\n", GetLastError()); + ok(hdc != 0, "CreateMetaFileA error %ld\n", GetLastError());
ret = BeginPath(hdc); ok(!ret, "BeginPath on metafile DC should fail\n"); ret = MoveToEx(hdc, 50, 50, NULL); - ok( ret, "MoveToEx error %d.\n", GetLastError()); + ok( ret, "MoveToEx error %ld.\n", GetLastError()); ret = LineTo(hdc, 50, 150); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = LineTo(hdc, 150, 150); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = LineTo(hdc, 150, 50); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = LineTo(hdc, 50, 50); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); Rectangle(hdc, 10, 10, 20, 20); EndPath(hdc);
@@ -8456,7 +8456,7 @@ static void test_mf_GetPath(void) ok( size == -1, "GetPath returned %d.\n", size);
hmf = CloseMetaFile(hdc); - ok(hmf != 0, "CloseMetaFile error %d\n", GetLastError()); + ok(hmf != 0, "CloseMetaFile error %ld\n", GetLastError());
if (compare_mf_bits (hmf, MF_PATH_BITS, sizeof(MF_PATH_BITS), "mf_GetPath") != 0) { @@ -8465,7 +8465,7 @@ static void test_mf_GetPath(void) }
ret = DeleteMetaFile(hmf); - ok( ret, "DeleteMetaFile error %d\n", GetLastError()); + ok( ret, "DeleteMetaFile error %ld\n", GetLastError()); }
static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, INT nObj, LPARAM lpData) @@ -8477,7 +8477,7 @@ static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETAREC PlayEnhMetaFileRecord(hdc, lpHTable, lpEMFR, nObj); LPtoDP(hdc, mapping, 2); if (winetest_debug > 1) - trace("EMF record: iType %d, nSize %d, (%d,%d)-(%d,%d)\n", + trace("EMF record: iType %ld, nSize %ld, (%ld,%ld)-(%ld,%ld)\n", lpEMFR->iType, lpEMFR->nSize, mapping[0].x, mapping[0].y, mapping[1].x, mapping[1].y);
@@ -8493,7 +8493,7 @@ static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETAREC } else { - ok(lpMFP->mm == MM_ANISOTROPIC, "mm=%d\n", lpMFP->mm); + ok(lpMFP->mm == MM_ANISOTROPIC, "mm=%ld\n", lpMFP->mm);
x0 = MulDiv(0, GetDeviceCaps(hdc, HORZSIZE) * 100, GetDeviceCaps(hdc, HORZRES)); y0 = MulDiv(0, GetDeviceCaps(hdc, VERTSIZE) * 100, GetDeviceCaps(hdc, VERTRES)); @@ -8501,7 +8501,7 @@ static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETAREC y1 = MulDiv(10, GetDeviceCaps(hdc, VERTSIZE) * 100, GetDeviceCaps(hdc, VERTRES)); } ok(mapping[0].x == x0 && mapping[0].y == y0 && mapping[1].x == x1 && mapping[1].y == y1, - "(%d,%d)->(%d,%d), expected (%d,%d)->(%d,%d)\n", + "(%ld,%ld)->(%ld,%ld), expected (%d,%d)->(%d,%d)\n", mapping[0].x, mapping[0].y, mapping[1].x, mapping[1].y, x0, y0, x1, y1); } @@ -8518,11 +8518,11 @@ static HENHMETAFILE create_converted_emf(const METAFILEPICT *mfp) LPBYTE pBits;
hdcMf = CreateMetaFileA(NULL); - ok(hdcMf != NULL, "CreateMetaFile failed with error %d\n", GetLastError()); + ok(hdcMf != NULL, "CreateMetaFile failed with error %ld\n", GetLastError()); ret = LineTo(hdcMf, (INT)LINE_X, (INT)LINE_Y); - ok(ret, "LineTo failed with error %d\n", GetLastError()); + ok(ret, "LineTo failed with error %ld\n", GetLastError()); hmf = CloseMetaFile(hdcMf); - ok(hmf != NULL, "CloseMetaFile failed with error %d\n", GetLastError()); + ok(hmf != NULL, "CloseMetaFile failed with error %ld\n", GetLastError());
if (compare_mf_bits (hmf, MF_LINETO_BITS, sizeof(MF_LINETO_BITS), "mf_LineTo") != 0) { @@ -8531,7 +8531,7 @@ static HENHMETAFILE create_converted_emf(const METAFILEPICT *mfp) }
size = GetMetaFileBitsEx(hmf, 0, NULL); - ok(size, "GetMetaFileBitsEx failed with error %d\n", GetLastError()); + ok(size, "GetMetaFileBitsEx failed with error %ld\n", GetLastError()); pBits = HeapAlloc(GetProcessHeap(), 0, size); GetMetaFileBitsEx(hmf, size, pBits); DeleteMetaFile(hmf); @@ -8668,18 +8668,18 @@ static void checkConvertedFrameAndBounds(UINT buffer_size, BYTE * buffer, BOOL m case MM_ISOTROPIC: mm_str = "MM_ISOTROPIC"; break; default: mm_str = "Unexpected"; } - sprintf(buf, "mm=%s, xExt=%d, yExt=%d", mm_str, xExt, yExt); + sprintf(buf, "mm=%s, xExt=%ld, yExt=%ld", mm_str, xExt, yExt); msg = buf; }
- ok(rclBounds.left == rclBoundsExpected->left, "rclBounds.left: Expected %d, got %d (%s)\n", rclBoundsExpected->left, rclBounds.left, msg); - ok(rclBounds.top == rclBoundsExpected->top, "rclBounds.top: Expected %d, got %d (%s)\n", rclBoundsExpected->top, rclBounds.top, msg); - ok(rclBounds.right == rclBoundsExpected->right, "rclBounds.right: Expected %d, got %d (%s)\n", rclBoundsExpected->right, rclBounds.right, msg); - ok(rclBounds.bottom == rclBoundsExpected->bottom, "rclBounds.bottom: Expected %d, got %d (%s)\n", rclBoundsExpected->bottom, rclBounds.bottom, msg); - ok(rclFrame.left == rclFrameExpected->left, "rclFrame.left: Expected %d, got %d (%s)\n", rclFrameExpected->left, rclFrame.left, msg); - ok(rclFrame.top == rclFrameExpected->top, "rclFrame.top: Expected %d, got %d (%s)\n", rclFrameExpected->top, rclFrame.top, msg); - ok(rclFrame.right == rclFrameExpected->right, "rclFrame.right: Expected %d, got %d (%s)\n", rclFrameExpected->right, rclFrame.right, msg); - ok(rclFrame.bottom == rclFrameExpected->bottom, "rclFrame.bottom: Expected %d, got %d (%s)\n", rclFrameExpected->bottom, rclFrame.bottom, msg); + ok(rclBounds.left == rclBoundsExpected->left, "rclBounds.left: Expected %ld, got %ld (%s)\n", rclBoundsExpected->left, rclBounds.left, msg); + ok(rclBounds.top == rclBoundsExpected->top, "rclBounds.top: Expected %ld, got %ld (%s)\n", rclBoundsExpected->top, rclBounds.top, msg); + ok(rclBounds.right == rclBoundsExpected->right, "rclBounds.right: Expected %ld, got %ld (%s)\n", rclBoundsExpected->right, rclBounds.right, msg); + ok(rclBounds.bottom == rclBoundsExpected->bottom, "rclBounds.bottom: Expected %ld, got %ld (%s)\n", rclBoundsExpected->bottom, rclBounds.bottom, msg); + ok(rclFrame.left == rclFrameExpected->left, "rclFrame.left: Expected %ld, got %ld (%s)\n", rclFrameExpected->left, rclFrame.left, msg); + ok(rclFrame.top == rclFrameExpected->top, "rclFrame.top: Expected %ld, got %ld (%s)\n", rclFrameExpected->top, rclFrame.top, msg); + ok(rclFrame.right == rclFrameExpected->right, "rclFrame.right: Expected %ld, got %ld (%s)\n", rclFrameExpected->right, rclFrame.right, msg); + ok(rclFrame.bottom == rclFrameExpected->bottom, "rclFrame.bottom: Expected %ld, got %ld (%s)\n", rclFrameExpected->bottom, rclFrame.bottom, msg); } }
@@ -8757,7 +8757,7 @@ static void test_SetWinMetaFileBits(void) todo_wine { ok(diffx <= 1 && diffy <= 1, - "SetWinMetaFileBits (MM_ANISOTROPIC): Reference bounds: The whole device surface must be used (%dx%d), but got (%dx%d)\n", + "SetWinMetaFileBits (MM_ANISOTROPIC): Reference bounds: The whole device surface must be used (%dx%d), but got (%ldx%ld)\n", GetDeviceCaps(dc, HORZRES) / 2, GetDeviceCaps(dc, VERTRES) / 2, rclBoundsAnisotropic.right, rclBoundsAnisotropic.bottom); }
@@ -8769,7 +8769,7 @@ static void test_SetWinMetaFileBits(void) todo_wine { ok(diffx <= 1 && diffy <= 1, - "SetWinMetaFileBits (MM_ANISOTROPIC): Reference frame: The whole device surface must be used (%dx%d), but got (%dx%d)\n", + "SetWinMetaFileBits (MM_ANISOTROPIC): Reference frame: The whole device surface must be used (%dx%d), but got (%ldx%ld)\n", GetDeviceCaps(dc, HORZSIZE) / 2, GetDeviceCaps(dc, VERTSIZE) / 2, rclFrameAnisotropic.right / 100, rclFrameAnisotropic.bottom / 100); } DeleteDC(dc); @@ -8913,8 +8913,8 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc) if(rec_num == mfcomment_chunks - 1) this_chunk_size = emf_size - rec_num * chunk_size;
- ok(rec->rdSize == (this_chunk_size + 44) / 2, "%04x: got %04x expected %04x\n", rec_num, rec->rdSize, (this_chunk_size + 44) / 2); - ok(rec->rdFunction == META_ESCAPE, "%04x: got %04x\n", rec_num, rec->rdFunction); + ok(rec->rdSize == (this_chunk_size + 44) / 2, "%04lx: got %04lx expected %04lx\n", rec_num, rec->rdSize, (this_chunk_size + 44) / 2); + ok(rec->rdFunction == META_ESCAPE, "%04lx: got %04x\n", rec_num, rec->rdFunction); if(rec->rdSize < (this_chunk_size + 44) / 2) break; ok(rec->rdParm[0] == MFCOMMENT, "got %04x\n", rec->rdParm[0]); ok(rec->rdParm[1] == this_chunk_size + 34, "got %04x %x\n", rec->rdParm[1], emf_size + 34); @@ -8930,10 +8930,10 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc) ok(rec->rdParm[10] == 0, "got %04x\n", rec->rdParm[10]); ok(rec->rdParm[11] == mfcomment_chunks, "got %04x\n", rec->rdParm[11]); /* num chunks */ ok(rec->rdParm[12] == 0, "got %04x\n", rec->rdParm[12]); - ok(rec->rdParm[13] == this_chunk_size, "got %04x expected %04x\n", rec->rdParm[13], this_chunk_size); + ok(rec->rdParm[13] == this_chunk_size, "got %04x expected %04lx\n", rec->rdParm[13], this_chunk_size); ok(rec->rdParm[14] == 0, "got %04x\n", rec->rdParm[14]); - ok(*(DWORD*)(rec->rdParm + 15) == emf_size - this_chunk_size - rec_num * chunk_size, "got %08x\n", *(DWORD*)(rec->rdParm + 15)); /* DWORD size remaining after current chunk */ - ok(*(DWORD*)(rec->rdParm + 17) == emf_size, "got %08x emf_size %08x\n", *(DWORD*)(rec->rdParm + 17), emf_size); + ok(*(DWORD*)(rec->rdParm + 15) == emf_size - this_chunk_size - rec_num * chunk_size, "got %08lx\n", *(DWORD*)(rec->rdParm + 15)); /* DWORD size remaining after current chunk */ + ok(*(DWORD*)(rec->rdParm + 17) == emf_size, "got %08lx emf_size %08x\n", *(DWORD*)(rec->rdParm + 17), emf_size); ok(!memcmp(rec->rdParm + 19, (char*)enh_header + rec_num * chunk_size, this_chunk_size), "bits mismatch\n"); }
@@ -8977,8 +8977,8 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc) default: pt.x = pt.y = 0; } - ok(near_match((short)rec->rdParm[0], pt.y), "got %d expect %d\n", (short)rec->rdParm[0], pt.y); - ok(near_match((short)rec->rdParm[1], pt.x), "got %d expect %d\n", (short)rec->rdParm[1], pt.x); + ok(near_match((short)rec->rdParm[0], pt.y), "got %d expect %ld\n", (short)rec->rdParm[0], pt.y); + ok(near_match((short)rec->rdParm[1], pt.x), "got %d expect %ld\n", (short)rec->rdParm[1], pt.x); } if(rec_num == mfcomment_chunks + 2) { @@ -9105,7 +9105,7 @@ static void test_SetEnhMetaFileBits(void) hemf = SetEnhMetaFileBits(sizeof(data), data); ok(!hemf, "SetEnhMetaFileBits should fail\n"); ok(GetLastError() == ERROR_INVALID_DATA, - "expected ERROR_INVALID_DATA, got %u\n", GetLastError()); + "expected ERROR_INVALID_DATA, got %lu\n", GetLastError());
emh = (ENHMETAHEADER *)data; memset(emh, 0, sizeof(*emh)); @@ -9120,7 +9120,7 @@ static void test_SetEnhMetaFileBits(void)
SetLastError(0xdeadbeef); hemf = SetEnhMetaFileBits(emh->nBytes, data); - ok(hemf != 0, "SetEnhMetaFileBits error %u\n", GetLastError()); + ok(hemf != 0, "SetEnhMetaFileBits error %lu\n", GetLastError()); DeleteEnhMetaFile(hemf);
/* XP refuses to load unaligned EMF */ @@ -9128,7 +9128,7 @@ static void test_SetEnhMetaFileBits(void) SetLastError(0xdeadbeef); hemf = SetEnhMetaFileBits(emh->nBytes, data); ok(!hemf, "SetEnhMetaFileBits should fail\n"); - ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %lu\n", GetLastError()); DeleteEnhMetaFile(hemf);
emh->dSignature = 0; @@ -9136,7 +9136,7 @@ static void test_SetEnhMetaFileBits(void) SetLastError(0xdeadbeef); hemf = SetEnhMetaFileBits(emh->nBytes, data); ok(!hemf, "SetEnhMetaFileBits should fail\n"); - ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %lu\n", GetLastError()); DeleteEnhMetaFile(hemf); }
@@ -9149,7 +9149,7 @@ static void test_emf_polybezier(void)
SetLastError(0xdeadbeef); hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
pts[0].x = pts[0].y = 10; pts[1].x = pts[1].y = 20; @@ -9167,7 +9167,7 @@ static void test_emf_polybezier(void) ok( ret, "PolyBezierTo failed\n" );
hemf = CloseEnhMetaFile(hdcMetafile); - ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if(compare_emf_bits(hemf, EMF_BEZIER_BITS, sizeof(EMF_BEZIER_BITS), "emf_Bezier", FALSE) != 0) @@ -9321,20 +9321,20 @@ static void test_emf_paths(void)
SetLastError(0xdeadbeef); hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ret = BeginPath(hdcMetafile); - ok(ret, "BeginPath error %d\n", GetLastError()); + ok(ret, "BeginPath error %ld\n", GetLastError()); ret = MoveToEx(hdcMetafile, 50, 50, NULL); - ok( ret, "MoveToEx error %d.\n", GetLastError()); + ok( ret, "MoveToEx error %ld.\n", GetLastError()); ret = LineTo(hdcMetafile, 50, 150); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = LineTo(hdcMetafile, 150, 150); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = LineTo(hdcMetafile, 150, 50); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); ret = LineTo(hdcMetafile, 50, 50); - ok( ret, "LineTo error %d.\n", GetLastError()); + ok( ret, "LineTo error %ld.\n", GetLastError()); Rectangle(hdcMetafile, 10, 10, 20, 20); Arc(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21); ArcTo(hdcMetafile, 23, 23, 37, 27, 37, 27, 23, 23); @@ -9348,7 +9348,7 @@ static void test_emf_paths(void) PolyDraw(hdcMetafile, pts, types, 9); AngleArc(hdcMetafile, 37, 36, 23, 90, 180); ret = EndPath(hdcMetafile); - ok(ret, "EndPath failed: %u\n", GetLastError()); + ok(ret, "EndPath failed: %lu\n", GetLastError());
size = GetPath(hdcMetafile, NULL, NULL, 0); ok( size == 112, "GetPath returned %d.\n", size); @@ -9358,12 +9358,12 @@ static void test_emf_paths(void) ok(!ret, "EndPath succeeded\n");
ret = StrokeAndFillPath( hdcMetafile ); - ok( ret, "StrokeAndFillPath failed err %d\n", GetLastError() ); + ok( ret, "StrokeAndFillPath failed err %ld\n", GetLastError() ); ret = StrokeAndFillPath( hdcMetafile ); ok( !ret, "StrokeAndFillPath succeeded\n" );
hemf = CloseEnhMetaFile(hdcMetafile); - ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if (compare_emf_bits(hemf, EMF_PATH_BITS, sizeof(EMF_PATH_BITS), "test_emf_paths", FALSE) != 0) { @@ -9375,29 +9375,29 @@ static void test_emf_paths(void)
SetLastError(0xdeadbeef); hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ret = BeginPath(hdcMetafile); - ok( ret, "BeginPath failed error %d\n", GetLastError() ); + ok( ret, "BeginPath failed error %ld\n", GetLastError() ); ret = CloseFigure(hdcMetafile); - ok( ret, "CloseFigure failed error %d\n", GetLastError() ); + ok( ret, "CloseFigure failed error %ld\n", GetLastError() ); ret = BeginPath(hdcMetafile); - ok( ret, "BeginPath failed error %d\n", GetLastError() ); + ok( ret, "BeginPath failed error %ld\n", GetLastError() ); ret = EndPath(hdcMetafile); - ok( ret, "EndPath failed error %d\n", GetLastError() ); + ok( ret, "EndPath failed error %ld\n", GetLastError() ); ret = EndPath(hdcMetafile); ok( !ret, "EndPath succeeded\n" ); ret = CloseFigure(hdcMetafile); ok( !ret, "CloseFigure succeeded\n" ); ret = BeginPath(hdcMetafile); - ok( ret, "BeginPath failed error %d\n", GetLastError() ); + ok( ret, "BeginPath failed error %ld\n", GetLastError() ); ret = AbortPath(hdcMetafile); - ok( ret, "AbortPath failed error %d\n", GetLastError() ); + ok( ret, "AbortPath failed error %ld\n", GetLastError() ); ret = AbortPath(hdcMetafile); - ok( ret, "AbortPath failed error %d\n", GetLastError() ); + ok( ret, "AbortPath failed error %ld\n", GetLastError() );
hemf = CloseEnhMetaFile(hdcMetafile); - ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if (compare_emf_bits(hemf, EMF_EMPTY_PATH_BITS, sizeof(EMF_EMPTY_PATH_BITS), "empty path", FALSE) != 0) { @@ -9418,7 +9418,7 @@ static void test_emf_PolyPolyline(void)
SetLastError(0xdeadbeef); hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ret = PolyPolyline(hdcMetafile, NULL, NULL, 0); ok( !ret, "PolyPolyline\n" ); @@ -9428,21 +9428,21 @@ static void test_emf_PolyPolyline(void) counts[1] = 1; ret = PolyPolyline(hdcMetafile, pts, counts, 2); ok( !ret, "PolyPolyline\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "gle %d\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "gle %ld\n", GetLastError() );
SetLastError( 0xdeadbeef ); counts[0] = 1; counts[1] = 1; ret = PolyPolyline(hdcMetafile, pts, counts, 2); ok( !ret, "PolyPolyline\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "gle %d\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "gle %ld\n", GetLastError() );
SetLastError( 0xdeadbeef ); counts[0] = 2; counts[1] = 1; ret = PolyPolyline(hdcMetafile, pts, counts, 2); ok( !ret, "PolyPolyline\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "gle %d\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "gle %ld\n", GetLastError() );
counts[0] = 2; counts[1] = 2; @@ -9450,7 +9450,7 @@ static void test_emf_PolyPolyline(void) ok( ret, "PolyPolyline\n" );
hemf = CloseEnhMetaFile(hdcMetafile); - ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
if(compare_emf_bits(hemf, EMF_POLYPOLYLINE_BITS, sizeof(EMF_POLYPOLYLINE_BITS), "emf_PolyPolyline", FALSE) != 0) @@ -9478,7 +9478,7 @@ static void test_emf_GradientFill(void) BOOL ret;
mf = CreateEnhMetaFileA( GetDC( 0 ), NULL, NULL, NULL ); - ok( mf != 0, "CreateEnhMetaFileA error %d\n", GetLastError() ); + ok( mf != 0, "CreateEnhMetaFileA error %ld\n", GetLastError() );
/* Don't test the GRADIENT_FILL_RECT_ modes since a Windows bug * means it allocates three mesh indices rather than two per @@ -9493,7 +9493,7 @@ static void test_emf_GradientFill(void) ok( ret, "GradientFill\n" );
hemf = CloseEnhMetaFile( mf ); - ok( hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError() ); + ok( hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError() );
if (compare_emf_bits( hemf, EMF_GRADIENTFILL_BITS, sizeof(EMF_GRADIENTFILL_BITS), "emf_GradientFill", FALSE ) != 0) @@ -9725,7 +9725,7 @@ static void test_emf_WorldTransform(void) for(i = 0; i < ARRAY_SIZE(test_data); ++i) { hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL); - ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %ld\n", GetLastError());
ret = SetGraphicsMode(hdcMetafile, GM_ADVANCED); ok(ret == TRUE, "SetGraphicsMode failed\n"); @@ -9753,17 +9753,17 @@ static void test_emf_WorldTransform(void) ok(ret == TRUE, "LineTo failed\n");
hemf = CloseEnhMetaFile(hdcMetafile); - ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + ok(hemf != 0, "CloseEnhMetaFile error %ld\n", GetLastError());
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 200, 0, 0, 0, NULL); - ok(hwnd != 0, "CreateWindowExA error %d\n", GetLastError()); + ok(hwnd != 0, "CreateWindowExA error %ld\n", GetLastError());
hdc = GetDC(hwnd); ok(hdc != 0, "GetDC failed\n");
ret = EnumEnhMetaFile(hdc, hemf, enum_emf_WorldTransform, &test_data[i], &rect); - ok(ret == TRUE, "EnumEnhMetaFile failed: %u\n", GetLastError()); + ok(ret == TRUE, "EnumEnhMetaFile failed: %lu\n", GetLastError());
ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); @@ -10401,17 +10401,17 @@ static void test_emf_AlphaBlend(void)
/* Test that source DC cannot be an enhanced metafile */ hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf, "CreateEnhMetaFileW failed, error %ld\n", GetLastError()); hdc_emf2 = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf2, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!hdc_emf2, "CreateEnhMetaFileW failed, error %ld\n", GetLastError());
ret = GdiAlphaBlend(hdc_emf, 0, 0, 1, 1, hdc_emf2, 0, 0, 1, 1, blend); ok(!ret, "GdiAlphaBlend succeeded\n");
hemf2 = CloseEnhMetaFile(hdc_emf2); - ok(!!hemf2, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf2, "CloseEnhMetaFile failed, error %ld\n", GetLastError()); hemf = CloseEnhMetaFile(hdc_emf); - ok(!!hemf, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!hemf, "CloseEnhMetaFile failed, error %ld\n", GetLastError()); DeleteEnhMetaFile(hemf2); DeleteEnhMetaFile(hemf);
@@ -10429,39 +10429,39 @@ static void test_emf_AlphaBlend(void) memcpy(bmi->bmiColors, tests[test_idx].colors, sizeof(RGBQUAD) * tests[test_idx].color_count);
hbitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, &bits, NULL, 0); - ok(!!hbitmap, "Test %d: CreateDIBSection failed, error %d\n", test_idx, GetLastError()); + ok(!!hbitmap, "Test %d: CreateDIBSection failed, error %ld\n", test_idx, GetLastError()); hdc_bitmap = CreateCompatibleDC(hdc); - ok(!!hdc_bitmap, "Test %d: CreateCompatibleDC failed, error %d\n", test_idx, GetLastError()); + ok(!!hdc_bitmap, "Test %d: CreateCompatibleDC failed, error %ld\n", test_idx, GetLastError()); old_hbitmap = SelectObject(hdc_bitmap, hbitmap);
SetBkColor(hdc_bitmap, RGB(0xff, 0xff, 0xff)); ret = SetGraphicsMode(hdc_bitmap, GM_ADVANCED); - ok(ret, "Test %d: SetGraphicsMode failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetGraphicsMode failed, error %ld\n", test_idx, GetLastError()); ret = SetWorldTransform(hdc_bitmap, &xform); - ok(ret, "Test %d: SetWorldTransform failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetWorldTransform failed, error %ld\n", test_idx, GetLastError()); ret = SetMapMode(hdc_bitmap, MM_ANISOTROPIC); - ok(ret, "Test %d: SetMapMode failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetMapMode failed, error %ld\n", test_idx, GetLastError()); ret = SetWindowOrgEx(hdc_bitmap, 0, 0, NULL); - ok(ret, "Test %d: SetWindowOrgEx failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetWindowOrgEx failed, error %ld\n", test_idx, GetLastError()); ret = SetWindowExtEx(hdc_bitmap, 400, 400, NULL); - ok(ret, "Test %d: SetWindowExtEx failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetWindowExtEx failed, error %ld\n", test_idx, GetLastError()); ret = SetViewportOrgEx(hdc_bitmap, 0, 0, NULL); - ok(ret, "Test %d: SetViewportOrgEx failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetViewportOrgEx failed, error %ld\n", test_idx, GetLastError()); ret = SetViewportExtEx(hdc_bitmap, bitmap_width, bitmap_height, NULL); - ok(ret, "Test %d: SetViewportExtEx failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: SetViewportExtEx failed, error %ld\n", test_idx, GetLastError());
hdc_emf = CreateEnhMetaFileW(hdc, NULL, NULL, NULL); - ok(!!hdc_emf, "Test %d: CreateEnhMetaFileW failed, error %d\n", test_idx, GetLastError()); + ok(!!hdc_emf, "Test %d: CreateEnhMetaFileW failed, error %ld\n", test_idx, GetLastError());
ret = BitBlt(hdc_emf, 0, 0, bitmap_width, bitmap_height, 0, 0, 0, WHITENESS); - ok(ret, "Test %d: BitBlt failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: BitBlt failed, error %ld\n", test_idx, GetLastError()); ret = BitBlt(hdc_bitmap, 0, 0, bitmap_width, bitmap_height, 0, 0, 0, BLACKNESS); - ok(ret, "Test %d: BitBlt failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: BitBlt failed, error %ld\n", test_idx, GetLastError()); ret = GdiAlphaBlend(hdc_emf, 0, 0, bitmap_width, bitmap_height, hdc_bitmap, 0, 0, 400, 400, blend); - ok(ret, "Test %d: GdiAlphaBlend failed, error %d\n", test_idx, GetLastError()); + ok(ret, "Test %d: GdiAlphaBlend failed, error %ld\n", test_idx, GetLastError());
hemf = CloseEnhMetaFile(hdc_emf); - ok(!!hemf, "Test %d: CloseEnhMetaFile failed, %d\n", test_idx, GetLastError()); + ok(!!hemf, "Test %d: CloseEnhMetaFile failed, %ld\n", test_idx, GetLastError());
sprintf(comment, "test_emf_AlphaBlend() test %d", test_idx); ret = compare_emf_bits(hemf, tests[test_idx].bits, tests[test_idx].bits_count, comment, FALSE); @@ -10492,39 +10492,39 @@ static void test_emf_text_extents(void)
dc = GetDC(0); emf_dc = CreateEnhMetaFileW(dc, NULL, NULL, NULL); - ok(!!emf_dc, "CreateEnhMetaFileW failed, error %d\n", GetLastError()); + ok(!!emf_dc, "CreateEnhMetaFileW failed, error %ld\n", GetLastError());
logfont.lfWeight = FW_NORMAL; logfont.lfHeight = 20; lstrcpyW(logfont.lfFaceName, L"Tahoma"); font = CreateFontIndirectW(&logfont); - ok(!!font, "CreateFontIndirectW failed, error %d\n", GetLastError()); + ok(!!font, "CreateFontIndirectW failed, error %ld\n", GetLastError());
old_font = SelectObject(dc, font); old_font2 = SelectObject(emf_dc, font);
ret = SetGraphicsMode(dc, GM_ADVANCED); - ok(ret, "SetGraphicsMode failed, error %d\n", GetLastError()); + ok(ret, "SetGraphicsMode failed, error %ld\n", GetLastError()); ret = SetGraphicsMode(emf_dc, GM_ADVANCED); - ok(ret, "SetGraphicsMode failed, error %d\n", GetLastError()); + ok(ret, "SetGraphicsMode failed, error %ld\n", GetLastError());
ret = ModifyWorldTransform(dc, &xform, MWT_RIGHTMULTIPLY); - ok(ret, "ModifyWorldTransform failed, error %d\n", GetLastError()); + ok(ret, "ModifyWorldTransform failed, error %ld\n", GetLastError()); ret = ModifyWorldTransform(emf_dc, &xform, MWT_RIGHTMULTIPLY); - ok(ret, "ModifyWorldTransform failed, error %d\n", GetLastError()); + ok(ret, "ModifyWorldTransform failed, error %ld\n", GetLastError());
ret = GetTextExtentPoint32W(dc, L"W", 1, &size); - ok(ret, "GetTextExtentPoint32W failed, error %d\n", GetLastError()); + ok(ret, "GetTextExtentPoint32W failed, error %ld\n", GetLastError()); ret = GetTextExtentPoint32W(emf_dc, L"W", 1, &size2); - ok(ret, "GetTextExtentPoint32W failed, error %d\n", GetLastError()); - ok(size2.cx == size.cx && size2.cy == size.cy, "Expected size %dx%d, got %dx%d\n", + ok(ret, "GetTextExtentPoint32W failed, error %ld\n", GetLastError()); + ok(size2.cx == size.cx && size2.cy == size.cy, "Expected size %ldx%ld, got %ldx%ld\n", size.cx, size.cy, size2.cx, size2.cy);
SelectObject(emf_dc, old_font2); SelectObject(dc, old_font); DeleteObject(font); emf = CloseEnhMetaFile(emf_dc); - ok(!!emf, "CloseEnhMetaFile failed, error %d\n", GetLastError()); + ok(!!emf, "CloseEnhMetaFile failed, error %ld\n", GetLastError()); DeleteEnhMetaFile(emf); ReleaseDC(0, dc); } @@ -10581,20 +10581,20 @@ static void test_mf_SetLayout(void) HDC mf_dc;
mf_dc = CreateMetaFileW(NULL); - ok(!!mf_dc, "CreateMetaFileW failed, error %d\n", GetLastError()); + ok(!!mf_dc, "CreateMetaFileW failed, error %ld\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(tests); ++i) { winetest_push_context("Test %d", i); layout = SetLayout(mf_dc, tests[i]); - ok(layout == LAYOUT_RTL, "Expected %#x, got %#x\n", tests[i], layout); + ok(layout == LAYOUT_RTL, "Expected %#lx, got %#lx\n", tests[i], layout); layout = GetLayout(mf_dc); - ok(layout == GDI_ERROR, "Expected %#x, got %#x\n", GDI_ERROR, layout); + ok(layout == GDI_ERROR, "Expected %#x, got %#lx\n", GDI_ERROR, layout); winetest_pop_context(); }
mf = CloseMetaFile(mf_dc); - ok(!!mf, "CloseMetaFile failed, error %d\n", GetLastError()); + ok(!!mf, "CloseMetaFile failed, error %ld\n", GetLastError());
ret = compare_mf_bits(mf, MF_SETLAYOUT_BITS, sizeof(MF_SETLAYOUT_BITS), "mf_SetLayout"); ok(!ret, "Bits mismatch\n"); diff --git a/dlls/gdi32/tests/palette.c b/dlls/gdi32/tests/palette.c index 126a53310bd..aac16097fba 100644 --- a/dlls/gdi32/tests/palette.c +++ b/dlls/gdi32/tests/palette.c @@ -58,7 +58,7 @@ static void test_DIB_PAL_COLORS(void) { memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) ); hpal = CreatePalette( logpalette ); hpalOld = SelectPalette( memhdc, hpal, FALSE ); - ok( hpalOld != NULL, "error=%d\n", GetLastError() ); + ok( hpalOld != NULL, "error=%ld\n", GetLastError() );
/* Create a DIB BMP which references colours in the logical palette */ memset( bmp, 0x00, sizeof(BITMAPINFO) ); @@ -78,9 +78,9 @@ static void test_DIB_PAL_COLORS(void) { *bmpPalPtr++ = 19; /* Pointer to bad logical palette index */
hbmp = CreateDIBSection( memhdc, bmp, DIB_PAL_COLORS, 0, 0, 0 ); - ok( hbmp != NULL, "error=%d\n", GetLastError() ); + ok( hbmp != NULL, "error=%ld\n", GetLastError() ); hbmpOld = SelectObject( memhdc, hbmp ); - ok( hbmpOld != NULL, "error=%d\n", GetLastError() ); + ok( hbmpOld != NULL, "error=%ld\n", GetLastError() );
/* Test with a RGB to DIB_PAL_COLORS */ setColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue ); diff --git a/dlls/gdi32/tests/path.c b/dlls/gdi32/tests/path.c index 3fb479df9fe..3c7c0ac1f87 100644 --- a/dlls/gdi32/tests/path.c +++ b/dlls/gdi32/tests/path.c @@ -69,13 +69,13 @@ static void test_path_state(void) ok( !ret, "WidenPath succeeded\n" );
ret = EndPath( hdc ); - ok( ret, "EndPath failed error %u\n", GetLastError() ); + ok( ret, "EndPath failed error %lu\n", GetLastError() ); ret = WidenPath( hdc ); - ok( ret, "WidenPath failed error %u\n", GetLastError() ); + ok( ret, "WidenPath failed error %lu\n", GetLastError() );
SelectObject( hdc, orig ); ret = WidenPath( hdc ); - ok( ret, "WidenPath failed error %u\n", GetLastError() ); + ok( ret, "WidenPath failed error %lu\n", GetLastError() );
BeginPath( hdc ); LineTo( hdc, 100, 100 ); @@ -84,22 +84,22 @@ static void test_path_state(void) SaveDC( hdc ); SelectObject( hdc, dib ); ret = EndPath( hdc ); - ok( ret, "EndPath failed error %u\n", GetLastError() ); + ok( ret, "EndPath failed error %lu\n", GetLastError() ); ret = WidenPath( hdc ); - ok( ret, "WidenPath failed error %u\n", GetLastError() ); + ok( ret, "WidenPath failed error %lu\n", GetLastError() );
/* path should be open again after RestoreDC */ RestoreDC( hdc, -1 ); ret = WidenPath( hdc ); ok( !ret, "WidenPath succeeded\n" ); ret = EndPath( hdc ); - ok( ret, "EndPath failed error %u\n", GetLastError() ); + ok( ret, "EndPath failed error %lu\n", GetLastError() );
SaveDC( hdc ); BeginPath( hdc ); RestoreDC( hdc, -1 ); ret = WidenPath( hdc ); - ok( ret, "WidenPath failed error %u\n", GetLastError() ); + ok( ret, "WidenPath failed error %lu\n", GetLastError() );
/* test all functions with no path at all */ AbortPath( hdc ); @@ -107,55 +107,55 @@ static void test_path_state(void) ret = WidenPath( hdc ); ok( !ret, "WidenPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = FlattenPath( hdc ); ok( !ret, "FlattenPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = StrokePath( hdc ); ok( !ret, "StrokePath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = FillPath( hdc ); ok( !ret, "FillPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = StrokeAndFillPath( hdc ); ok( !ret, "StrokeAndFillPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = SelectClipPath( hdc, RGN_OR ); ok( !ret, "SelectClipPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); rgn = PathToRegion( hdc ); ok( !rgn, "PathToRegion succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = EndPath( hdc ); ok( !ret, "SelectClipPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = CloseFigure( hdc ); ok( !ret, "CloseFigure succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
/* test all functions with an open path */ AbortPath( hdc ); @@ -164,7 +164,7 @@ static void test_path_state(void) ret = WidenPath( hdc ); ok( !ret, "WidenPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -172,7 +172,7 @@ static void test_path_state(void) ret = FlattenPath( hdc ); ok( !ret, "FlattenPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -180,7 +180,7 @@ static void test_path_state(void) ret = StrokePath( hdc ); ok( !ret, "StrokePath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -188,7 +188,7 @@ static void test_path_state(void) ret = FillPath( hdc ); ok( !ret, "FillPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -196,7 +196,7 @@ static void test_path_state(void) ret = StrokeAndFillPath( hdc ); ok( !ret, "StrokeAndFillPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -205,7 +205,7 @@ static void test_path_state(void) ret = SelectClipPath( hdc, RGN_OR ); ok( !ret, "SelectClipPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -214,7 +214,7 @@ static void test_path_state(void) rgn = PathToRegion( hdc ); ok( !rgn, "PathToRegion succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -267,7 +267,7 @@ static void test_path_state(void) SetLastError( 0xdeadbeef ); ret = SelectClipPath( hdc, RGN_OR ); ok( !ret, "SelectClipPath succeeded on empty path\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); ok( GetPath( hdc, NULL, NULL, 0 ) == -1, "path not deleted\n" );
BeginPath( hdc ); @@ -283,7 +283,7 @@ static void test_path_state(void) SetLastError( 0xdeadbeef ); rgn = PathToRegion( hdc ); ok( !rgn, "PathToRegion succeeded on empty path\n" ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); DeleteObject( rgn ); ok( GetPath( hdc, NULL, NULL, 0 ) == -1, "path not deleted\n" );
@@ -293,7 +293,7 @@ static void test_path_state(void) ret = CloseFigure( hdc ); ok( !ret, "CloseFigure succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
AbortPath( hdc ); BeginPath( hdc ); @@ -302,7 +302,7 @@ static void test_path_state(void) ret = EndPath( hdc ); ok( !ret, "EndPath succeeded\n" ); ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
DeleteDC( hdc ); DeleteObject( dib ); @@ -354,7 +354,7 @@ static void test_widenpath(void) BeginPath(hdc); ret = WidenPath(hdc); ok(ret == FALSE && (GetLastError() == ERROR_CAN_NOT_COMPLETE || GetLastError() == 0xdeadbeef), - "WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %u\n", ret, FALSE, GetLastError()); + "WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %lu\n", ret, FALSE, GetLastError());
AbortPath(hdc);
@@ -365,7 +365,7 @@ static void test_widenpath(void) Polyline(hdc, pnt, 6); EndPath(hdc); ret = WidenPath(hdc); - ok(ret == TRUE, "WidenPath failed: %d\n", GetLastError()); + ok(ret == TRUE, "WidenPath failed: %ld\n", GetLastError()); nSize = GetPath(hdc, NULL, NULL, 0); ok(nSize > 6, "WidenPath should compute a widened path with a 1px wide pen. Path length is %d, should be more than 6\n", nSize);
@@ -410,7 +410,7 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, /* Get the path */ assert(hdc != 0); size = GetPath(hdc, NULL, NULL, 0); - ok(size > 0, "GetPath returned size %d, last error %d\n", size, GetLastError()); + ok(size > 0, "GetPath returned size %d, last error %ld\n", size, GetLastError()); if (size <= 0) return;
pnt = HeapAlloc(GetProcessHeap(), 0, size*sizeof(POINT)); @@ -429,14 +429,14 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, * floating point to integer conversion */ static const int fudge = 2;
- ok( types[idx] == expected[idx].type, "%s: Expected #%d: %s (%d,%d) but got %s (%d,%d)\n", + ok( types[idx] == expected[idx].type, "%s: Expected #%d: %s (%d,%d) but got %s (%ld,%ld)\n", path_name, idx, type_string[expected[idx].type], expected[idx].x, expected[idx].y, type_string[types[idx]], pnt[idx].x, pnt[idx].y);
if (types[idx] == expected[idx].type) ok( (pnt[idx].x >= expected[idx].x - fudge && pnt[idx].x <= expected[idx].x + fudge) && (pnt[idx].y >= expected[idx].y - fudge && pnt[idx].y <= expected[idx].y + fudge), - "%s: Expected #%d: %s position (%d,%d) but got (%d,%d)\n", path_name, idx, + "%s: Expected #%d: %s position (%d,%d) but got (%ld,%ld)\n", path_name, idx, type_string[expected[idx].type], expected[idx].x, expected[idx].y, pnt[idx].x, pnt[idx].y); }
@@ -444,7 +444,7 @@ static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, { printf("static const path_test_t %s[] =\n{\n", path_name); for (idx = 0; idx < size; idx++) - printf(" {%d, %d, %s}, /* %d */\n", pnt[idx].x, pnt[idx].y, type_string[types[idx]], idx); + printf(" {%ld, %ld, %s}, /* %d */\n", pnt[idx].x, pnt[idx].y, type_string[types[idx]], idx); printf("};\n" ); }
@@ -612,7 +612,7 @@ static void test_polydraw(void)
BeginPath(hdc); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == -20 && pos.y == -20, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == -20 && pos.y == -20, "wrong pos %ld,%ld\n", pos.x, pos.y );
/* closefigure with no previous moveto */ if (!(retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2)) && @@ -624,66 +624,66 @@ static void test_polydraw(void) } expect(TRUE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y ); LineTo(hdc, -10, -10); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == -10 && pos.y == -10, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == -10 && pos.y == -10, "wrong pos %ld,%ld\n", pos.x, pos.y );
MoveToEx(hdc, 100, 100, NULL); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 100 && pos.y == 100, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 100 && pos.y == 100, "wrong pos %ld,%ld\n", pos.x, pos.y ); LineTo(hdc, 95, 95); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 95 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 95 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* closefigure with previous moveto */ retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2); expect(TRUE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* bad bezier points */ retb = PolyDraw(hdc, &(polydraw_pts[2]), &(polydraw_tps[2]), 4); expect(FALSE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y ); retb = PolyDraw(hdc, &(polydraw_pts[6]), &(polydraw_tps[6]), 4); expect(FALSE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 10 && pos.y == 15, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 10 && pos.y == 15, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* good bezier points */ retb = PolyDraw(hdc, &(polydraw_pts[8]), &(polydraw_tps[8]), 4); expect(TRUE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* does lineto or bezierto take precedence? */ retb = PolyDraw(hdc, &(polydraw_pts[12]), &(polydraw_tps[12]), 4); expect(FALSE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* bad point type, has already moved cursor position */ retb = PolyDraw(hdc, &(polydraw_pts[15]), &(polydraw_tps[15]), 4); expect(FALSE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* bad point type, cursor position is moved, but back to its original spot */ retb = PolyDraw(hdc, &(polydraw_pts[17]), &(polydraw_tps[17]), 4); expect(FALSE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 35 && pos.y == 40, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 35 && pos.y == 40, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* does lineto or moveto take precedence? */ retb = PolyDraw(hdc, &(polydraw_pts[20]), &(polydraw_tps[20]), 3); expect(TRUE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 65 && pos.y == 65, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 65 && pos.y == 65, "wrong pos %ld,%ld\n", pos.x, pos.y ); /* consecutive movetos */ retb = PolyDraw(hdc, &(polydraw_pts[23]), &(polydraw_tps[23]), 4); expect(TRUE, retb); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 80 && pos.y == 80, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 80 && pos.y == 80, "wrong pos %ld,%ld\n", pos.x, pos.y );
EndPath(hdc); ok_path(hdc, "polydraw_path", polydraw_path, ARRAY_SIZE(polydraw_path)); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 80 && pos.y == 80, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 80 && pos.y == 80, "wrong pos %ld,%ld\n", pos.x, pos.y ); done: ReleaseDC(0, hdc); } @@ -695,27 +695,27 @@ static void test_closefigure(void) {
MoveToEx( hdc, 100, 100, NULL ); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 100 && pos.y == 100, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 100 && pos.y == 100, "wrong pos %ld,%ld\n", pos.x, pos.y );
BeginPath(hdc); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 100 && pos.y == 100, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 100 && pos.y == 100, "wrong pos %ld,%ld\n", pos.x, pos.y ); MoveToEx(hdc, 95, 95, NULL); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 95 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 95 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y ); LineTo(hdc, 95, 0); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 95 && pos.y == 0, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 95 && pos.y == 0, "wrong pos %ld,%ld\n", pos.x, pos.y ); LineTo(hdc, 0, 95); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 0 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 0 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y );
CloseFigure(hdc); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 0 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 0 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y ); EndPath(hdc); GetCurrentPositionEx( hdc, &pos ); - ok( pos.x == 0 && pos.y == 95, "wrong pos %d,%d\n", pos.x, pos.y ); + ok( pos.x == 0 && pos.y == 95, "wrong pos %ld,%ld\n", pos.x, pos.y ); nSize = GetPath(hdc, NULL, NULL, 0);
AbortPath(hdc); @@ -737,7 +737,7 @@ static void test_closefigure(void) { static void WINAPI linedda_callback(INT x, INT y, LPARAM lparam) { POINT **pt = (POINT**)lparam; - ok((*pt)->x == x && (*pt)->y == y, "point mismatch expect(%d,%d) got(%d,%d)\n", + ok((*pt)->x == x && (*pt)->y == y, "point mismatch expect(%ld,%ld) got(%d,%d)\n", (*pt)->x, (*pt)->y, x, y);
(*pt)++; @@ -1910,7 +1910,7 @@ static void test_clipped_polygon_fill(void) oldbmp = SelectObject( memdc, bmp ); Polygon( memdc, pts, ARRAY_SIZE(pts) ); col = GetPixel( memdc, 1, 1 ); - ok( col == RGB( 0x11, 0x22, 0x33 ), "got %06x\n", col ); + ok( col == RGB( 0x11, 0x22, 0x33 ), "got %06lx\n", col ); SelectObject( memdc, oldbrush ); SelectObject( memdc, oldbmp ); DeleteObject( brush ); diff --git a/dlls/gdi32/tests/pen.c b/dlls/gdi32/tests/pen.c index d1bfa7ee34f..2100f046e85 100644 --- a/dlls/gdi32/tests/pen.c +++ b/dlls/gdi32/tests/pen.c @@ -27,9 +27,17 @@
#include "wine/test.h"
-#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) -#define expect2(expected, alt, got) ok(got == expected || got == alt, \ - "Expected %.8x or %.8x, got %.8x\n", expected, alt, got) +#define expect(expected,got) expect_(__LINE__, expected, got) +static inline void expect_(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %.08lx, got %.08lx\n", expected, got); +} +#define expect2(expected,alt,got) expect2_(__LINE__, expected, alt, got) +static inline void expect2_(unsigned line, DWORD expected, DWORD alt, DWORD got) +{ + ok_(__FILE__, line)(expected == got || alt == got, + "Expected %.08lx or %.08lx, got %.08lx\n", expected, alt, got); +}
static void test_logpen(void) { @@ -91,59 +99,59 @@ static void test_logpen(void) }
obj_type = GetObjectType(hpen); - ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); + ok(obj_type == OBJ_PEN, "wrong object type %lu\n", obj_type);
memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(lp), &lp); - ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); - ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); + ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
DeleteObject(hpen);
/* CreatePen behaviour */ SetLastError(0xdeadbeef); hpen = CreatePen(pen[i].style, pen[i].width, pen[i].color); - ok(hpen != 0, "CreatePen error %d\n", GetLastError()); + ok(hpen != 0, "CreatePen error %ld\n", GetLastError());
obj_type = GetObjectType(hpen); - ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); + ok(obj_type == OBJ_PEN, "wrong object type %lu\n", obj_type);
/* check what's the real size of the object */ size = GetObjectW(hpen, 0, NULL); - ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
/* ask for truncated data */ memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp); - ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); + ok(!size, "GetObject should fail: size %d, error %ld\n", size, GetLastError());
/* see how larger buffer sizes are handled */ memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(lp) * 4, &lp); - ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
/* see how larger buffer sizes are handled */ memset(&elp, 0xb0, sizeof(elp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(elp) * 2, &elp); - ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(lp), &lp); - ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(lp), "GetObject returned %d, error %ld\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); - ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); + ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
memset(&elp, 0xb0, sizeof(elp)); SetLastError(0xdeadbeef); @@ -153,23 +161,23 @@ static void test_logpen(void) if (pen[i].style == PS_NULL) { ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n"); - ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %d\n", + ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %ld\n", size, GetLastError()); - ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, elp.elpPenStyle); - ok(elp.elpWidth == 0, "expected 0, got %u\n", elp.elpWidth); - ok(elp.elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, elp.elpColor); + ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %lu\n", pen[i].ret_style, elp.elpPenStyle); + ok(elp.elpWidth == 0, "expected 0, got %lu\n", elp.elpWidth); + ok(elp.elpColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, elp.elpColor); ok(elp.elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %u\n", elp.elpBrushStyle); ok(elp.elpHatch == 0, "expected 0, got %p\n", (void *)elp.elpHatch); - ok(elp.elpNumEntries == 0, "expected 0, got %x\n", elp.elpNumEntries); + ok(elp.elpNumEntries == 0, "expected 0, got %lx\n", elp.elpNumEntries); } else { - ok(size == sizeof(LOGPEN), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(LOGPEN), "GetObject returned %d, error %ld\n", size, GetLastError()); memcpy(&lp, &elp, sizeof(lp)); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); - ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); + ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor); }
DeleteObject(hpen); @@ -184,14 +192,14 @@ static void test_logpen(void) { ok(hpen == 0, "ExtCreatePen should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "wrong last error value %d\n", GetLastError()); + "wrong last error value %ld\n", GetLastError()); SetLastError(0xdeadbeef); hpen = ExtCreatePen(pen[i].style, pen[i].width, &lb, 0, NULL); if (pen[i].style != PS_NULL) { ok(hpen == 0, "ExtCreatePen with width != 1 should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "wrong last error value %d\n", GetLastError()); + "wrong last error value %ld\n", GetLastError());
SetLastError(0xdeadbeef); hpen = ExtCreatePen(pen[i].style, 1, &lb, 0, NULL); @@ -201,7 +209,7 @@ static void test_logpen(void) { ok(hpen == 0, "ExtCreatePen with width != 1 should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "wrong last error value %d\n", GetLastError()); + "wrong last error value %ld\n", GetLastError()); SetLastError(0xdeadbeef); hpen = ExtCreatePen(pen[i].style, 1, &lb, 2, user_style); } @@ -214,20 +222,20 @@ static void test_logpen(void) if (pen[i].style > PS_ALTERNATE) { ok(hpen == 0, "ExtCreatePen should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %ld\n", GetLastError()); goto test_geometric_pens; } - ok(hpen != 0, "ExtCreatePen error %d\n", GetLastError()); + ok(hpen != 0, "ExtCreatePen error %ld\n", GetLastError());
obj_type = GetObjectType(hpen); /* for some reason XP differentiates PS_NULL here */ if (pen[i].style == PS_NULL) { - ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); + ok(obj_type == OBJ_PEN, "wrong object type %lu\n", obj_type); ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n"); } else - ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type); + ok(obj_type == OBJ_EXTPEN, "wrong object type %lu\n", obj_type);
/* check what's the real size of the object */ SetLastError(0xdeadbeef); @@ -236,17 +244,17 @@ static void test_logpen(void) { case PS_NULL: ok(size == sizeof(LOGPEN), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); break;
case PS_USERSTYLE: ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); break;
default: ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); break; }
@@ -254,7 +262,7 @@ static void test_logpen(void) memset(&elp, 0xb0, sizeof(elp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(elp.elpPenStyle), &elp); - ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); + ok(!size, "GetObject should fail: size %d, error %ld\n", size, GetLastError());
/* see how larger buffer sizes are handled */ memset(elp_buffer, 0xb0, sizeof(elp_buffer)); @@ -264,12 +272,12 @@ static void test_logpen(void) { case PS_NULL: ok(size == sizeof(LOGPEN), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); memcpy(&lp, ext_pen, sizeof(lp)); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); - ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); + ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor);
/* for PS_NULL it also works this way */ memset(&elp, 0xb0, sizeof(elp)); @@ -277,31 +285,31 @@ static void test_logpen(void) SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(elp), &elp); ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(ext_pen->elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen->elpHatch); - ok(ext_pen->elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %x\n", ext_pen->elpNumEntries); + ok(ext_pen->elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %lx\n", ext_pen->elpNumEntries); break;
case PS_USERSTYLE: ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); - ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries); - ok(ext_style[0] == 0xabc, "expected 0xabc, got %x\n", ext_style[0]); - ok(ext_style[1] == 0xdef, "expected 0xdef, got %x\n", ext_style[1]); + ok(ext_pen->elpNumEntries == 2, "expected 0, got %lx\n", ext_pen->elpNumEntries); + ok(ext_style[0] == 0xabc, "expected 0xabc, got %lx\n", ext_style[0]); + ok(ext_style[1] == 0xdef, "expected 0xdef, got %lx\n", ext_style[1]); break;
default: ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); - ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); + ok(ext_pen->elpNumEntries == 0, "expected 0, got %lx\n", ext_pen->elpNumEntries); break; }
- ok(ext_pen->elpPenStyle == pen[i].style, "expected %x, got %x\n", pen[i].style, ext_pen->elpPenStyle); - ok(ext_pen->elpWidth == 1, "expected 1, got %x\n", ext_pen->elpWidth); - ok(ext_pen->elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen->elpColor); + ok(ext_pen->elpPenStyle == pen[i].style, "expected %x, got %lx\n", pen[i].style, ext_pen->elpPenStyle); + ok(ext_pen->elpWidth == 1, "expected 1, got %lx\n", ext_pen->elpWidth); + ok(ext_pen->elpColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, ext_pen->elpColor); ok(ext_pen->elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen->elpBrushStyle);
DeleteObject(hpen); @@ -328,17 +336,17 @@ test_geometric_pens: if (pen[i].style > PS_ALTERNATE) { ok(hpen == 0, "ExtCreatePen should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %ld\n", GetLastError()); continue; } - ok(hpen != 0, "ExtCreatePen error %d\n", GetLastError()); + ok(hpen != 0, "ExtCreatePen error %ld\n", GetLastError());
obj_type = GetObjectType(hpen); /* for some reason XP differentiates PS_NULL here */ if (pen[i].style == PS_NULL) - ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); + ok(obj_type == OBJ_PEN, "wrong object type %lu\n", obj_type); else - ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type); + ok(obj_type == OBJ_EXTPEN, "wrong object type %lu\n", obj_type);
/* check what's the real size of the object */ size = GetObjectW(hpen, 0, NULL); @@ -346,17 +354,17 @@ test_geometric_pens: { case PS_NULL: ok(size == sizeof(LOGPEN), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); break;
case PS_USERSTYLE: ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); break;
default: ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); break; }
@@ -364,7 +372,7 @@ test_geometric_pens: memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp); - ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); + ok(!size, "GetObject should fail: size %d, error %ld\n", size, GetLastError());
memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); @@ -372,16 +380,16 @@ test_geometric_pens: /* for some reason XP differentiates PS_NULL here */ if (pen[i].style == PS_NULL) { - ok(size == sizeof(LOGPEN), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == sizeof(LOGPEN), "GetObject returned %d, error %ld\n", size, GetLastError()); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); - ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); + ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor); } else /* XP doesn't set last error here */ ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/, - "GetObject should fail: size %d, error %d\n", size, GetLastError()); + "GetObject should fail: size %d, error %ld\n", size, GetLastError());
memset(elp_buffer, 0xb0, sizeof(elp_buffer)); SetLastError(0xdeadbeef); @@ -391,54 +399,54 @@ test_geometric_pens: { case PS_NULL: ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(ext_pen->elpHatch == 0, "expected 0, got %p\n", (void *)ext_pen->elpHatch); - ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); + ok(ext_pen->elpNumEntries == 0, "expected 0, got %lx\n", ext_pen->elpNumEntries);
/* for PS_NULL it also works this way */ SetLastError(0xdeadbeef); size = GetObjectW(hpen, sizeof(elp_buffer), &lp); ok(size == sizeof(LOGPEN), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); - ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); - ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y); - ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); + ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %ld\n", pen[i].ret_width, lp.lopnWidth.x); + ok(lp.lopnWidth.y == 0, "expected 0, got %ld\n", lp.lopnWidth.y); + ok(lp.lopnColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, lp.lopnColor); break;
case PS_USERSTYLE: ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/, - "GetObject should fail: size %d, error %d\n", size, GetLastError()); + "GetObject should fail: size %d, error %ld\n", size, GetLastError()); size = GetObjectW(hpen, sizeof(elp_buffer), elp_buffer); ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); - ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries); - ok(ext_style[0] == 0xabc, "expected 0xabc, got %x\n", ext_style[0]); - ok(ext_style[1] == 0xdef, "expected 0xdef, got %x\n", ext_style[1]); + ok(ext_pen->elpNumEntries == 2, "expected 0, got %lx\n", ext_pen->elpNumEntries); + ok(ext_style[0] == 0xabc, "expected 0xabc, got %lx\n", ext_style[0]); + ok(ext_style[1] == 0xdef, "expected 0xdef, got %lx\n", ext_style[1]); break;
default: ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), - "GetObject returned %d, error %d\n", size, GetLastError()); + "GetObject returned %d, error %ld\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); - ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); + ok(ext_pen->elpNumEntries == 0, "expected 0, got %lx\n", ext_pen->elpNumEntries); break; }
/* for some reason XP differentiates PS_NULL here */ if (pen[i].style == PS_NULL) - ok(ext_pen->elpPenStyle == pen[i].ret_style, "expected %x, got %x\n", pen[i].ret_style, ext_pen->elpPenStyle); + ok(ext_pen->elpPenStyle == pen[i].ret_style, "expected %x, got %lx\n", pen[i].ret_style, ext_pen->elpPenStyle); else { - ok(ext_pen->elpPenStyle == (PS_GEOMETRIC | pen[i].style), "expected %x, got %x\n", PS_GEOMETRIC | pen[i].style, ext_pen->elpPenStyle); + ok(ext_pen->elpPenStyle == (PS_GEOMETRIC | pen[i].style), "expected %x, got %lx\n", PS_GEOMETRIC | pen[i].style, ext_pen->elpPenStyle); }
if (pen[i].style == PS_NULL) - ok(ext_pen->elpWidth == 0, "expected 0, got %x\n", ext_pen->elpWidth); + ok(ext_pen->elpWidth == 0, "expected 0, got %lx\n", ext_pen->elpWidth); else - ok(ext_pen->elpWidth == pen[i].ret_width, "expected %u, got %x\n", pen[i].ret_width, ext_pen->elpWidth); - ok(ext_pen->elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen->elpColor); + ok(ext_pen->elpWidth == pen[i].ret_width, "expected %u, got %lx\n", pen[i].ret_width, ext_pen->elpWidth); + ok(ext_pen->elpColor == pen[i].ret_color, "expected %08lx, got %08lx\n", pen[i].ret_color, ext_pen->elpColor); ok(ext_pen->elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen->elpBrushStyle);
DeleteObject(hpen); @@ -478,17 +486,17 @@ static void test_ps_alternate(void) skip("looks like 9x, skipping PS_ALTERNATE tests\n"); return; } - ok(pen != NULL, "gle=%d\n", GetLastError()); + ok(pen != NULL, "gle=%ld\n", GetLastError()); hdc = CreateCompatibleDC(NULL); - ok(hdc != NULL, "gle=%d\n", GetLastError()); + ok(hdc != NULL, "gle=%ld\n", GetLastError()); bmp = CreateBitmap(8, 1, 1, 1, NULL); - ok(bmp != NULL, "gle=%d\n", GetLastError()); + ok(bmp != NULL, "gle=%ld\n", GetLastError()); hRet = SelectObject(hdc, bmp); - ok(hRet != NULL, "gle=%d\n", GetLastError()); + ok(hRet != NULL, "gle=%ld\n", GetLastError()); hRet = SelectObject(hdc, pen); - ok(hRet != NULL, "gle=%d\n", GetLastError()); + ok(hRet != NULL, "gle=%ld\n", GetLastError()); iRet = SetBkMode(hdc, TRANSPARENT); - ok(iRet, "gle=%d\n", GetLastError()); + ok(iRet, "gle=%ld\n", GetLastError());
TEST_LINE(0, 1, "10000000") TEST_LINE(0, 2, "10000000") @@ -600,39 +608,39 @@ static void test_brush_pens(void) lb.lbColor = RGB(12,34,56); lb.lbHatch = HS_CROSS; pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); - ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); + ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() ); size = GetObjectW( pen, sizeof(buffer), elp ); - ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); - ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size ); + ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %lx\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == lb.lbStyle, "wrong brush style %x\n", elp->elpBrushStyle ); - ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor ); - ok( elp->elpHatch == HS_CROSS, "wrong hatch %lx\n", elp->elpHatch ); - ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries ); + ok( elp->elpColor == RGB(12,34,56), "wrong color %lx\n", elp->elpColor ); + ok( elp->elpHatch == HS_CROSS, "wrong hatch %Ix\n", elp->elpHatch ); + ok( elp->elpNumEntries == 0, "wrong entries %lx\n", elp->elpNumEntries ); break;
case BS_NULL: pen = ExtCreatePen( PS_SOLID | PS_GEOMETRIC, 3, &lb, 0, NULL ); - ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); + ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() ); size = GetObjectW( pen, sizeof(buffer), elp ); - ok( size == sizeof(LOGPEN), "wrong size %u\n", size ); + ok( size == sizeof(LOGPEN), "wrong size %lu\n", size ); ok( ((LOGPEN *)elp)->lopnStyle == PS_NULL, "wrong pen style %x\n", ((LOGPEN *)elp)->lopnStyle ); ok( ((LOGPEN *)elp)->lopnColor == 0, - "wrong color %x\n", ((LOGPEN *)elp)->lopnColor ); + "wrong color %lx\n", ((LOGPEN *)elp)->lopnColor ); break;
case BS_PATTERN: lb.lbColor = RGB(12,34,56); lb.lbHatch = (ULONG_PTR)bmp; pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); - ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); + ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() ); size = GetObjectW( pen, sizeof(buffer), elp ); - ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); - ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size ); + ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %lx\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == BS_PATTERN, "wrong brush style %x\n", elp->elpBrushStyle ); - ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor ); - ok( elp->elpHatch == (ULONG_PTR)bmp, "wrong hatch %lx/%p\n", elp->elpHatch, bmp ); - ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries ); + ok( elp->elpColor == 0, "wrong color %lx\n", elp->elpColor ); + ok( elp->elpHatch == (ULONG_PTR)bmp, "wrong hatch %Ix/%p\n", elp->elpHatch, bmp ); + ok( elp->elpNumEntries == 0, "wrong entries %lx\n", elp->elpNumEntries ); break;
case BS_DIBPATTERN: @@ -640,20 +648,20 @@ static void test_brush_pens(void) lb.lbColor = DIB_PAL_COLORS; lb.lbHatch = lb.lbStyle == BS_DIBPATTERN ? (ULONG_PTR)hmem : (ULONG_PTR)info; pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); - ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); + ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() ); size = GetObjectW( pen, sizeof(buffer), elp ); - ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); - ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size ); + ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %lx\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == BS_DIBPATTERNPT, "wrong brush style %x\n", elp->elpBrushStyle ); - ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor ); - ok( elp->elpHatch == lb.lbHatch, "wrong hatch %lx/%lx\n", elp->elpHatch, lb.lbHatch ); - ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries ); + ok( elp->elpColor == 0, "wrong color %lx\n", elp->elpColor ); + ok( elp->elpHatch == lb.lbHatch, "wrong hatch %Ix/%Ix\n", elp->elpHatch, lb.lbHatch ); + ok( elp->elpNumEntries == 0, "wrong entries %lx\n", elp->elpNumEntries ); break;
default: pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); ok( !pen, "ExtCreatePen succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); break; }
@@ -665,19 +673,19 @@ static void test_brush_pens(void) pen = ExtCreatePen( PS_DOT, 1, &lb, 0, NULL ); if (lb.lbStyle == BS_SOLID) { - ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); + ok( pen != 0, "ExtCreatePen failed err %lu\n", GetLastError() ); size = GetObjectW( pen, sizeof(buffer), elp ); - ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); - ok( elp->elpPenStyle == PS_DOT, "wrong pen style %x\n", elp->elpPenStyle ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %lu\n", size ); + ok( elp->elpPenStyle == PS_DOT, "wrong pen style %lx\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == BS_SOLID, "wrong brush style %x\n", elp->elpBrushStyle ); - ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor ); - ok( elp->elpHatch == HS_CROSS, "wrong hatch %lx\n", elp->elpHatch ); + ok( elp->elpColor == RGB(12,34,56), "wrong color %lx\n", elp->elpColor ); + ok( elp->elpHatch == HS_CROSS, "wrong hatch %Ix\n", elp->elpHatch ); DeleteObject( pen ); } else { ok( !pen, "ExtCreatePen succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } }
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/gdiplus/tests/brush.c | 6 +++++- dlls/gdiplus/tests/font.c | 7 ++++++- dlls/gdiplus/tests/metafile.c | 6 +++++- dlls/gdiplus/tests/pen.c | 6 +++++- dlls/gdiplus/tests/region.c | 6 +++++- 5 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index 0287078bc80..fd4116240d4 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -25,7 +25,11 @@ #include "gdiplus.h" #include "wine/test.h"
-#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) +#define expect(expected,got) expect_(__LINE__, expected, got) +static inline void expect_(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got); +} #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
static HWND hwnd; diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index d8f8a474742..3fe123e25c4 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -25,7 +25,12 @@ #include "gdiplus.h" #include "wine/test.h"
-#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) +#define expect(expected,got) expect_inline(__LINE__, expected, got) +static inline void expect_inline(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); +} + #define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got)) #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001) diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 3ad3db35273..51193f76b6a 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -25,7 +25,11 @@ #include "winspool.h" #include "wine/test.h"
-#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) +#define expect(expected,got) expect_(__LINE__, expected, got) +static inline void expect_(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got); +} #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001)
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index 28caf29acbe..bfd4b233081 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -24,7 +24,11 @@ #include "gdiplus.h" #include "wine/test.h"
-#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) +#define expect(expected,got) expect_(__LINE__, expected, got) +static inline void expect_(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got); +} #define expectf(expected, got) ok(fabs(got - expected) < 0.1, "Expected %.2f, got %.2f\n", expected, got)
static void test_startup(void) diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 04c388bf5a7..04db033a7e0 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -33,7 +33,11 @@ #define RGNDATA_MAGIC 0xdbc01001 #define RGNDATA_MAGIC2 0xdbc01002
-#define expect(expected, got) ok((got) == (expected), "Expected %.8x, got %.8x\n", (expected), (got)) +#define expect(expected,got) expect_(__LINE__, expected, got) +static inline void expect_(unsigned line, DWORD expected, DWORD got) +{ + ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); +} #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) < (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001)
Signed-off-by: Esme Povirk esme@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/gdiplus/tests/Makefile.in | 1 dlls/gdiplus/tests/brush.c | 2 - dlls/gdiplus/tests/font.c | 30 ++++---- dlls/gdiplus/tests/graphics.c | 14 ++-- dlls/gdiplus/tests/image.c | 160 ++++++++++++++++++++-------------------- dlls/gdiplus/tests/metafile.c | 14 ++-- dlls/gdiplus/tests/pen.c | 2 - dlls/gdiplus/tests/region.c | 78 ++++++++++---------- 8 files changed, 150 insertions(+), 151 deletions(-)
diff --git a/dlls/gdiplus/tests/Makefile.in b/dlls/gdiplus/tests/Makefile.in index 6b6033d8676..ef3f26d9082 100644 --- a/dlls/gdiplus/tests/Makefile.in +++ b/dlls/gdiplus/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = gdiplus.dll IMPORTS = gdiplus ole32 user32 gdi32
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index fd4116240d4..2634b5cd67b 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -28,7 +28,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got); } #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 3fe123e25c4..ccdb7a2ef96 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -28,10 +28,10 @@ #define expect(expected,got) expect_inline(__LINE__, expected, got) static inline void expect_inline(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); }
-#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got)) +#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %ld\n", (expected), (got)) #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001)
@@ -54,7 +54,7 @@ static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW lstrcatW(pathW, filename);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW), GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW), GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(resource), (LPCSTR)RT_RCDATA); ok(res != 0, "couldn't find resource\n"); @@ -68,7 +68,7 @@ static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW static void _delete_testfontfile(const WCHAR *filename, int line) { BOOL ret = DeleteFileW(filename); - ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError()); + ok_(__FILE__,line)(ret, "failed to delete file %s, error %ld\n", wine_dbgstr_w(filename), GetLastError()); }
static void test_long_name(void) @@ -752,14 +752,14 @@ static void test_font_metrics(void)
gdip_get_font_metrics(font, &fm_gdip); trace("gdiplus:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent, fm_gdip.font_height, fm_gdip.font_size);
gdi_get_font_metrics(&lf, &fm_gdi); trace("gdi:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent, fm_gdi.font_height, fm_gdi.font_size); @@ -768,10 +768,10 @@ static void test_font_metrics(void)
stat = GdipGetLogFontW(font, graphics, &lf); expect(Ok, stat); - ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight); + ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %ld\n", lf.lfHeight); gdi_get_font_metrics(&lf, &fm_gdi); trace("gdi:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent, fm_gdi.font_height, fm_gdi.font_size); @@ -793,14 +793,14 @@ static void test_font_metrics(void)
gdip_get_font_metrics(font, &fm_gdip); trace("gdiplus:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent, fm_gdip.font_height, fm_gdip.font_size);
gdi_get_font_metrics(&lf, &fm_gdi); trace("gdi:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent, fm_gdi.font_height, fm_gdi.font_size); @@ -809,10 +809,10 @@ static void test_font_metrics(void)
stat = GdipGetLogFontW(font, graphics, &lf); expect(Ok, stat); - ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight); + ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %ld\n", lf.lfHeight); gdi_get_font_metrics(&lf, &fm_gdi); trace("gdi:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent, fm_gdi.font_height, fm_gdi.font_size); @@ -831,17 +831,17 @@ static void test_font_metrics(void)
gdip_get_font_metrics(font, &fm_gdip); trace("gdiplus:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent, fm_gdip.font_height, fm_gdip.font_size);
stat = GdipGetLogFontW(font, graphics, &lf); expect(Ok, stat); - ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight); + ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %ld\n", lf.lfHeight); gdi_get_font_metrics(&lf, &fm_gdi); trace("gdi:\n"); - trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", + trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n", wine_dbgstr_w(lf.lfFaceName), lf.lfHeight, fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent, fm_gdi.font_height, fm_gdi.font_size); diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index c8c31ce258b..0ee2b73c413 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3178,7 +3178,7 @@ static void test_GdipGetNearestColor(void) todo_wine ok(color == 0xffa8b8e8 || broken(color == 0xffa0b8e0), /* Win98/WinMe */ - "Expected ffa8b8e8, got %.8x\n", color); + "Expected ffa8b8e8, got %.8lx\n", color); GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap);
@@ -3784,7 +3784,7 @@ static void test_GdipMeasureString(void) height = units_to_pixels(font_size, td[i].unit, td[i].res_y); if (td[i].unit != UnitDisplay) height *= td[i].page_scale; - ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %d (%f), got %d\n", + ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %ld (%f), got %ld\n", i, (LONG)(height + 0.5), height, lf.lfHeight);
height = font_size + 2.0 * font_size / 6.0; @@ -3865,7 +3865,7 @@ static void test_GdipMeasureString(void) else height = units_to_pixels(font_size, font_unit, td[i].res_y); /*trace("%.1f font units = %f pixels with %.1f dpi, page_scale %.1f\n", font_size, height, td[i].res_y, td[i].page_scale);*/ - ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %d (%f), got %d\n", + ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %ld (%f), got %ld\n", i, (LONG)(height + 0.5), height, lf.lfHeight);
if (td[i].unit == UnitDisplay || td[i].unit == UnitPixel) @@ -3955,7 +3955,7 @@ static void test_GdipMeasureString(void) lf.lfHeight = 0xdeadbeef; status = GdipGetLogFontW(font, graphics, &lf); expect(Ok, status); - ok(lf.lfHeight == -100, "%u: expected -100, got %d\n", i, lf.lfHeight); + ok(lf.lfHeight == -100, "%u: expected -100, got %ld\n", i, lf.lfHeight);
set_rect_empty(&rc); set_rect_empty(&bounds); @@ -6421,7 +6421,7 @@ static DWORD* GetBitmapPixelBuffer(HDC hdc, HBITMAP hbmp, int width, int height) bi.biClrImportant = 0;
lines = GetDIBits(hdc, hbmp, 0, height, buffer, (BITMAPINFO *)&bi, DIB_RGB_COLORS); - ok(lines == height, "Expected GetDIBits:%p,%d->%d,%d\n", buffer, height, lines, GetLastError()); + ok(lines == height, "Expected GetDIBits:%p,%d->%d,%ld\n", buffer, height, lines, GetLastError());
return buffer; } @@ -7204,7 +7204,7 @@ static void test_printer_dc(void) rect.Width = pixel_per_unit_x; rect.Height = pixel_per_unit_y; match = check_rect_pixels(pixel, &rect, width, 0, &pt); - ok(match, "Expected pixel (%u, %u) to be %08x, got %08x\n", + ok(match, "Expected pixel (%u, %u) to be %08x, got %08lx\n", pt.X, pt.Y, 0, pixel[pt.X + pt.Y * width]);
/* pixels at (1, 1) should all be 0x00ffffff */ @@ -7213,7 +7213,7 @@ static void test_printer_dc(void) rect.Width = pixel_per_unit_x; rect.Height = pixel_per_unit_y; match = check_rect_pixels(pixel, &rect, width, 0x00ffffff, &pt); - ok(match, "Expected pixel (%u, %u) to be %08x, got %08x\n", + ok(match, "Expected pixel (%u, %u) to be %08x, got %08lx\n", pt.X, pt.Y, 0x00ffffff, pixel[pt.X + pt.Y * width]);
GdipFree(pixel); diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index c52c90f6799..9e35cf33eb4 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1234,7 +1234,7 @@ static void test_GdipCreateBitmapFromHBITMAP(void) { BYTE clr = 255 - i; ARGB argb = 0xff000000 | (clr << 16) | (clr << 8) | clr; - ok(palette->Entries[i] == argb, "got %08x, expected %08x\n", palette->Entries[i], argb); + ok(palette->Entries[i] == argb, "got %08lx, expected %08lx\n", palette->Entries[i], argb); } GdipDisposeImage((GpImage*)gpbm);
@@ -1252,7 +1252,7 @@ static void test_GdipCreateBitmapFromHBITMAP(void) { BYTE clr = 255 - i; ARGB argb = 0xff000000 | (clr << 16) | (clr << 8) | clr; - ok(palette->Entries[i] == argb, "got %08x, expected %08x\n", palette->Entries[i], argb); + ok(palette->Entries[i] == argb, "got %08lx, expected %08lx\n", palette->Entries[i], argb); } GdipDisposeImage((GpImage*)gpbm);
@@ -1513,7 +1513,7 @@ static void test_testcontrol(void) param = 0; stat = GdipTestControl(TestControlGetBuildNumber, ¶m); expect(Ok, stat); - ok(param != 0, "Build number expected, got %u\n", param); + ok(param != 0, "Build number expected, got %lu\n", param); }
static void test_fromhicon(void) @@ -1991,7 +1991,7 @@ static void test_createhbitmap(void) if (bm.bmBits) { DWORD val = *(DWORD*)bm.bmBits; - ok(val == 0xff686868, "got %x, expected 0xff686868\n", val); + ok(val == 0xff686868, "got %lx, expected 0xff686868\n", val); }
hdc = CreateCompatibleDC(NULL); @@ -2038,9 +2038,9 @@ static void test_createhbitmap(void) if (bm.bmBits) { DWORD val = *(DWORD*)bm.bmBits; - ok(val == 0x682a2a2a, "got %x, expected 0x682a2a2a\n", val); + ok(val == 0x682a2a2a, "got %lx, expected 0x682a2a2a\n", val); val = *((DWORD*)bm.bmBits + (bm.bmHeight-1) * bm.bmWidthBytes/4 + 1); - ok(val == 0x0, "got %x, expected 0x682a2a2a\n", val); + ok(val == 0x0, "got %lx, expected 0x682a2a2a\n", val); }
hdc = CreateCompatibleDC(NULL); @@ -2080,20 +2080,20 @@ static void test_createhbitmap(void) if (bm.bmBits) { DWORD val = *(DWORD*)bm.bmBits; - ok(val == 0x68c12ac1 || broken(val == 0x682a2ac1), "got %x, expected 0x68c12ac1\n", val); + ok(val == 0x68c12ac1 || broken(val == 0x682a2ac1), "got %lx, expected 0x68c12ac1\n", val); val = *((DWORD*)bm.bmBits + (bm.bmHeight-1) * bm.bmWidthBytes/4 + 1); - ok(val == 0xff00ff || broken(val == 0xff), "got %x, expected 0xff00ff\n", val); + ok(val == 0xff00ff || broken(val == 0xff), "got %lx, expected 0xff00ff\n", val); }
hdc = CreateCompatibleDC(NULL);
oldhbitmap = SelectObject(hdc, hbitmap); pixel = GetPixel(hdc, 5, 5); - ok(pixel == 0xc12ac1 || broken(pixel == 0xc12a2a), "got %x, expected 0xc12ac1\n", pixel); + ok(pixel == 0xc12ac1 || broken(pixel == 0xc12a2a), "got %lx, expected 0xc12ac1\n", pixel); pixel = GetPixel(hdc, 1, 0); - ok(pixel == 0xff00ff || broken(pixel == 0xff0000), "got %x, expected 0xff00ff\n", pixel); + ok(pixel == 0xff00ff || broken(pixel == 0xff0000), "got %lx, expected 0xff00ff\n", pixel); pixel = GetPixel(hdc, 2, 0); - ok(pixel == 0xb12ac1 || broken(pixel == 0xb12a2a), "got %x, expected 0xb12ac1\n", pixel); + ok(pixel == 0xb12ac1 || broken(pixel == 0xb12a2a), "got %lx, expected 0xb12ac1\n", pixel);
SelectObject(hdc, oldhbitmap); DeleteDC(hdc); @@ -2120,20 +2120,20 @@ static void test_createhbitmap(void) if (bm.bmBits) { DWORD val = *(DWORD*)bm.bmBits; - ok(val == 0x68c12ac1 || broken(val == 0x682a2ac1), "got %x, expected 0x68c12ac1\n", val); + ok(val == 0x68c12ac1 || broken(val == 0x682a2ac1), "got %lx, expected 0x68c12ac1\n", val); val = *((DWORD*)bm.bmBits + (bm.bmHeight-1) * bm.bmWidthBytes/4 + 1); - ok(val == 0xff00ff || broken(val == 0xff), "got %x, expected 0xff00ff\n", val); + ok(val == 0xff00ff || broken(val == 0xff), "got %lx, expected 0xff00ff\n", val); }
hdc = CreateCompatibleDC(NULL);
oldhbitmap = SelectObject(hdc, hbitmap); pixel = GetPixel(hdc, 5, 5); - ok(pixel == 0xc12ac1 || broken(pixel == 0xc12a2a), "got %x, expected 0xc12ac1\n", pixel); + ok(pixel == 0xc12ac1 || broken(pixel == 0xc12a2a), "got %lx, expected 0xc12ac1\n", pixel); pixel = GetPixel(hdc, 1, 0); - ok(pixel == 0xff00ff || broken(pixel == 0xff0000), "got %x, expected 0xff00ff\n", pixel); + ok(pixel == 0xff00ff || broken(pixel == 0xff0000), "got %lx, expected 0xff00ff\n", pixel); pixel = GetPixel(hdc, 2, 0); - ok(pixel == 0xb12ac1 || broken(pixel == 0xb12a2a), "got %x, expected 0xb12ac1\n", pixel); + ok(pixel == 0xb12ac1 || broken(pixel == 0xb12a2a), "got %lx, expected 0xb12ac1\n", pixel);
SelectObject(hdc, oldhbitmap); DeleteDC(hdc); @@ -2354,7 +2354,7 @@ static void check_halftone_palette(ColorPalette *palette) expected |= halftone_values[((i-40)/6)%6] << 8; expected |= halftone_values[((i-40)/36)%6] << 16; } - ok(expected == palette->Entries[i], "Expected %.8x, got %.8x, i=%u/%u\n", + ok(expected == palette->Entries[i], "Expected %.8lx, got %.8lx, i=%u/%u\n", expected, palette->Entries[i], i, palette->Count); } } @@ -2662,7 +2662,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xeeff40cc, color, 3), "expected 0xeeff40cc, got 0x%08x\n", color); + ok(color_match(0xeeff40cc, color, 3), "expected 0xeeff40cc, got 0x%08lx\n", color);
/* Toggle NoOp */ stat = GdipSetImageAttributesNoOp(imageattr, ColorAdjustTypeDefault, FALSE); @@ -2674,7 +2674,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xfefe40cc, color, 3), "expected 0xfefe40cc, got 0x%08x\n", color); + ok(color_match(0xfefe40cc, color, 3), "expected 0xfefe40cc, got 0x%08lx\n", color);
stat = GdipSetImageAttributesNoOp(imageattr, ColorAdjustTypeDefault, TRUE); expect(Ok, stat); @@ -2685,7 +2685,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08x\n", color); + ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08lx\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault); expect(Ok, stat); @@ -2699,7 +2699,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08x\n", color); + ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08lx\n", color);
stat = GdipDrawImageRectRectI(graphics, (GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1, UnitPixel, imageattr, NULL, NULL); @@ -2707,7 +2707,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 1), "Expected ff40ccee, got %.8x\n", color); + ok(color_match(0xff40ccee, color, 1), "Expected ff40ccee, got %.8lx\n", color);
/* Disable adjustment, toggle NoOp */ stat = GdipSetImageAttributesColorMatrix(imageattr, ColorAdjustTypeDefault, @@ -2723,7 +2723,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08x\n", color); + ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08lx\n", color);
stat = GdipSetImageAttributesNoOp(imageattr, ColorAdjustTypeDefault, TRUE); expect(Ok, stat); @@ -2734,7 +2734,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08x\n", color); + ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08lx\n", color);
/* Reset with NoOp on, enable adjustment. */ stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault); @@ -2750,7 +2750,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xfff24ace, color, 3), "expected 0xfff24ace, got 0x%08x\n", color); + ok(color_match(0xfff24ace, color, 3), "expected 0xfff24ace, got 0x%08lx\n", color);
/* Now inhibit specific category. */ stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault); @@ -2766,7 +2766,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xfffe41cc, color, 3), "expected 0xfffe41cc, got 0x%08x\n", color); + ok(color_match(0xfffe41cc, color, 3), "expected 0xfffe41cc, got 0x%08lx\n", color);
stat = GdipSetImageAttributesNoOp(imageattr, ColorAdjustTypeBitmap, TRUE); expect(Ok, stat); @@ -2777,7 +2777,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08x\n", color); + ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08lx\n", color);
stat = GdipSetImageAttributesNoOp(imageattr, ColorAdjustTypeBitmap, FALSE); expect(Ok, stat); @@ -2791,7 +2791,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xfff24ace, color, 3), "expected 0xfff24ace, got 0x%08x\n", color); + ok(color_match(0xfff24ace, color, 3), "expected 0xfff24ace, got 0x%08lx\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeBitmap); expect(Ok, stat); @@ -2802,7 +2802,7 @@ static void test_colormatrix(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08x\n", color); + ok(color_match(0xff40ccee, color, 3), "expected 0xff40ccee, got 0x%08lx\n", color);
GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap1); @@ -2864,7 +2864,7 @@ static void test_gamma(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff20ffff, color, 1), "Expected ff20ffff, got %.8x\n", color); + ok(color_match(0xff20ffff, color, 1), "Expected ff20ffff, got %.8lx\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault); expect(Ok, stat); @@ -2875,7 +2875,7 @@ static void test_gamma(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff80ffff, color, 1), "Expected ff80ffff, got %.8x\n", color); + ok(color_match(0xff80ffff, color, 1), "Expected ff80ffff, got %.8lx\n", color);
GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap1); @@ -3166,7 +3166,7 @@ static void test_multiframegif(void) expect(Ok, stat); stat = GdipBitmapGetPixel(bmp, 2, 0, &color); expect(Ok, stat); - ok(color==0 || broken(color==0xff0000ff), "color = %x\n", color); + ok(color==0 || broken(color==0xff0000ff), "color = %lx\n", color); if(color != 0) { win_skip("broken animated gif support\n"); GdipDisposeImage((GpImage*)bmp); @@ -3180,7 +3180,7 @@ static void test_multiframegif(void) for(j=0; j<4; j++) { stat = GdipBitmapGetPixel(bmp, j*2, 0, &color); expect(Ok, stat); - ok(gifanimation2_pixels[i%5][j] == color, "at %d,%d got %x, expected %x\n", i, j, color, gifanimation2_pixels[i%5][j]); + ok(gifanimation2_pixels[i%5][j] == color, "at %d,%d got %lx, expected %lx\n", i, j, color, gifanimation2_pixels[i%5][j]); } }
@@ -3363,7 +3363,7 @@ static void test_remaptable(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xffff00ff, color, 1), "Expected ffff00ff, got %.8x\n", color); + ok(color_match(0xffff00ff, color, 1), "Expected ffff00ff, got %.8lx\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault); expect(Ok, stat); @@ -3374,7 +3374,7 @@ static void test_remaptable(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0xff00ff00, color, 1), "Expected ff00ff00, got %.8x\n", color); + ok(color_match(0xff00ff00, color, 1), "Expected ff00ff00, got %.8lx\n", color);
GdipDeleteGraphics(graphics); GdipDisposeImage((GpImage*)bitmap1); @@ -3433,19 +3433,19 @@ static void test_colorkey(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8x\n", color); + ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8lx\n", color);
stat = GdipBitmapGetPixel(bitmap2, 0, 1, &color); expect(Ok, stat); - ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8x\n", color); + ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8lx\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 0, &color); expect(Ok, stat); - ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8x\n", color); + ok(color_match(0x00000000, color, 1), "Expected 00000000, got %.8lx\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 1, &color); expect(Ok, stat); - ok(color_match(0xffffffff, color, 1), "Expected ffffffff, got %.8x\n", color); + ok(color_match(0xffffffff, color, 1), "Expected ffffffff, got %.8lx\n", color);
stat = GdipResetImageAttributes(imageattr, ColorAdjustTypeDefault); expect(Ok, stat); @@ -3456,19 +3456,19 @@ static void test_colorkey(void)
stat = GdipBitmapGetPixel(bitmap2, 0, 0, &color); expect(Ok, stat); - ok(color_match(0x20405060, color, 1), "Expected 20405060, got %.8x\n", color); + ok(color_match(0x20405060, color, 1), "Expected 20405060, got %.8lx\n", color);
stat = GdipBitmapGetPixel(bitmap2, 0, 1, &color); expect(Ok, stat); - ok(color_match(0x40506070, color, 1), "Expected 40506070, got %.8x\n", color); + ok(color_match(0x40506070, color, 1), "Expected 40506070, got %.8lx\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 0, &color); expect(Ok, stat); - ok(color_match(0x60708090, color, 1), "Expected 60708090, got %.8x\n", color); + ok(color_match(0x60708090, color, 1), "Expected 60708090, got %.8lx\n", color);
stat = GdipBitmapGetPixel(bitmap2, 1, 1, &color); expect(Ok, stat); - ok(color_match(0xffffffff, color, 1), "Expected ffffffff, got %.8x\n", color); + ok(color_match(0xffffffff, color, 1), "Expected ffffffff, got %.8lx\n", color);
GdipDeleteGraphics(graphics); @@ -3526,11 +3526,11 @@ static GpImage *load_image(const BYTE *image_data, UINT image_size, BOOL valid_d GlobalUnlock(hmem);
hr = CreateStreamOnHGlobal(hmem, TRUE, &stream); - ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); + ok(hr == S_OK, "CreateStreamOnHGlobal error %#lx\n", hr); if (hr != S_OK) return NULL;
refcount = obj_refcount(stream); - ok(refcount == 1, "expected stream refcount 1, got %d\n", refcount); + ok(refcount == 1, "expected stream refcount 1, got %ld\n", refcount);
status = GdipLoadImageFromStream(stream, &image); todo_wine_if(todo_load) @@ -3550,25 +3550,25 @@ static GpImage *load_image(const BYTE *image_data, UINT image_size, BOOL valid_d
refcount = obj_refcount(stream); if (image_type == ImageTypeBitmap) - ok(refcount > 1, "expected stream refcount > 1, got %d\n", refcount); + ok(refcount > 1, "expected stream refcount > 1, got %ld\n", refcount); else - ok(refcount == 1, "expected stream refcount 1, got %d\n", refcount); + ok(refcount == 1, "expected stream refcount 1, got %ld\n", refcount); old_refcount = refcount;
status = GdipCloneImage(image, &clone); ok(status == Ok, "GdipCloneImage error %d\n", status); refcount = obj_refcount(stream); - ok(refcount == old_refcount, "expected stream refcount %d, got %d\n", old_refcount, refcount); + ok(refcount == old_refcount, "expected stream refcount %ld, got %ld\n", old_refcount, refcount); status = GdipDisposeImage(clone); ok(status == Ok, "GdipDisposeImage error %d\n", status); refcount = obj_refcount(stream); - ok(refcount == old_refcount, "expected stream refcount %d, got %d\n", old_refcount, refcount); + ok(refcount == old_refcount, "expected stream refcount %ld, got %ld\n", old_refcount, refcount);
refcount = IStream_Release(stream); if (image_type == ImageTypeBitmap) ok(refcount >= 1, "expected stream refcount != 0\n"); else - ok(refcount == 0, "expected stream refcount 0, got %d\n", refcount); + ok(refcount == 0, "expected stream refcount 0, got %ld\n", refcount);
return image; } @@ -3701,7 +3701,7 @@ static void test_image_properties(void) expect(Ok, status); if (prop_count != 0) ok(td[i].prop_id == prop_id[0] || td[i].prop_id2 == prop_id[0], - " %u: expected property id %#x or %#x, got %#x\n", + " %u: expected property id %#x or %#x, got %#lx\n", i, td[i].prop_id, td[i].prop_id2, prop_id[0]); }
@@ -3734,7 +3734,7 @@ static void test_image_properties(void) status = GdipGetPropertyItem(image, prop_id[0], prop_size, &item.data); expect(Ok, status); ok(prop_id[0] == item.data.id, - "%u: expected property id %#x, got %#x\n", i, prop_id[0], item.data.id); + "%u: expected property id %#lx, got %#lx\n", i, prop_id[0], item.data.id); } }
@@ -3967,14 +3967,14 @@ static void test_tiff_properties(void) looks broken since TypeFloat and TypeDouble now reported as TypeUndefined, and signed types reported as unsigned. */ broken(prop_item->type == documented_type(td[i].type)), - "%u: expected type %u, got %u\n", i, td[i].type, prop_item->type); - ok(td[i].id == prop_item->id, "%u: expected id %#x, got %#x\n", i, td[i].id, prop_item->id); + "%u: expected type %lu, got %u\n", i, td[i].type, prop_item->type); + ok(td[i].id == prop_item->id, "%u: expected id %#lx, got %#lx\n", i, td[i].id, prop_item->id); prop_size -= sizeof(*prop_item); - ok(prop_item->length == prop_size, "%u: expected length %u, got %u\n", i, prop_size, prop_item->length); + ok(prop_item->length == prop_size, "%u: expected length %u, got %lu\n", i, prop_size, prop_item->length); ok(td[i].length == prop_item->length || broken(td[i].id == 0xf00f && td[i].length == prop_item->length+1) /* XP */, - "%u: expected length %u, got %u\n", i, td[i].length, prop_item->length); + "%u: expected length %lu, got %lu\n", i, td[i].length, prop_item->length); ok(td[i].length == prop_size || broken(td[i].id == 0xf00f && td[i].length == prop_size+1) /* XP */, - "%u: expected length %u, got %u\n", i, td[i].length, prop_size); + "%u: expected length %lu, got %u\n", i, td[i].length, prop_size); if (td[i].length == prop_item->length) { int match = memcmp(td[i].value, prop_item->value, td[i].length) == 0; @@ -3983,7 +3983,7 @@ static void test_tiff_properties(void) { UINT j; BYTE *data = prop_item->value; - trace("id %#x:", prop_item->id); + trace("id %#lx:", prop_item->id); for (j = 0; j < prop_item->length; j++) trace(" %02x", data[j]); trace("\n"); @@ -4076,11 +4076,11 @@ static void test_GdipGetAllPropertyItems(void) expect(Ok, status); ok(prop_item->value == prop_item + 1, "expected item->value %p, got %p\n", prop_item + 1, prop_item->value); ok(td[i].type == prop_item->type, - "%u: expected type %u, got %u\n", i, td[i].type, prop_item->type); - ok(td[i].id == prop_item->id, "%u: expected id %#x, got %#x\n", i, td[i].id, prop_item->id); + "%u: expected type %lu, got %u\n", i, td[i].type, prop_item->type); + ok(td[i].id == prop_item->id, "%u: expected id %#lx, got %#lx\n", i, td[i].id, prop_item->id); size -= sizeof(*prop_item); - ok(prop_item->length == size, "%u: expected length %u, got %u\n", i, size, prop_item->length); - ok(td[i].length == prop_item->length, "%u: expected length %u, got %u\n", i, td[i].length, prop_item->length); + ok(prop_item->length == size, "%u: expected length %u, got %lu\n", i, size, prop_item->length); + ok(td[i].length == prop_item->length, "%u: expected length %lu, got %lu\n", i, td[i].length, prop_item->length); if (td[i].length == prop_item->length) { int match = memcmp(td[i].value, prop_item->value, td[i].length) == 0; @@ -4089,7 +4089,7 @@ static void test_GdipGetAllPropertyItems(void) { UINT j; BYTE *data = prop_item->value; - trace("id %#x:", prop_item->id); + trace("id %#lx:", prop_item->id); for (j = 0; j < prop_item->length; j++) trace(" %02x", data[j]); trace("\n"); @@ -4140,9 +4140,9 @@ static void test_GdipGetAllPropertyItems(void) ok(prop_item[i].value == item_data, "%u: expected value %p, got %p\n", i, item_data, prop_item[i].value); ok(td[i].type == prop_item[i].type, - "%u: expected type %u, got %u\n", i, td[i].type, prop_item[i].type); - ok(td[i].id == prop_item[i].id, "%u: expected id %#x, got %#x\n", i, td[i].id, prop_item[i].id); - ok(td[i].length == prop_item[i].length, "%u: expected length %u, got %u\n", i, td[i].length, prop_item[i].length); + "%u: expected type %lu, got %u\n", i, td[i].type, prop_item[i].type); + ok(td[i].id == prop_item[i].id, "%u: expected id %#lx, got %#lx\n", i, td[i].id, prop_item[i].id); + ok(td[i].length == prop_item[i].length, "%u: expected length %lu, got %lu\n", i, td[i].length, prop_item[i].length); if (td[i].length == prop_item[i].length) { int match = memcmp(td[i].value, prop_item[i].value, td[i].length) == 0; @@ -4151,7 +4151,7 @@ static void test_GdipGetAllPropertyItems(void) { UINT j; BYTE *data = prop_item[i].value; - trace("id %#x:", prop_item[i].id); + trace("id %#lx:", prop_item[i].id); for (j = 0; j < prop_item[i].length; j++) trace(" %02x", data[j]); trace("\n"); @@ -4206,8 +4206,8 @@ static void test_tiff_palette(void) expect(2, palette.pal.Count); if (palette.pal.Count == 2) { - ok(entries[0] == 0xff000000, "expected 0xff000000, got %#x\n", entries[0]); - ok(entries[1] == 0xffffffff, "expected 0xffffffff, got %#x\n", entries[1]); + ok(entries[0] == 0xff000000, "expected 0xff000000, got %#lx\n", entries[0]); + ok(entries[1] == 0xffffffff, "expected 0xffffffff, got %#lx\n", entries[1]); }
GdipDisposeImage(image); @@ -4884,11 +4884,11 @@ static void test_gif_properties(void) expect(Ok, status); ok(prop_item->value == prop_item + 1, "expected item->value %p, got %p\n", prop_item + 1, prop_item->value); ok(td[i].type == prop_item->type, - "%u: expected type %u, got %u\n", i, td[i].type, prop_item->type); - ok(td[i].id == prop_item->id, "%u: expected id %#x, got %#x\n", i, td[i].id, prop_item->id); + "%u: expected type %lu, got %u\n", i, td[i].type, prop_item->type); + ok(td[i].id == prop_item->id, "%u: expected id %#lx, got %#lx\n", i, td[i].id, prop_item->id); size -= sizeof(*prop_item); - ok(prop_item->length == size, "%u: expected length %u, got %u\n", i, size, prop_item->length); - ok(td[i].length == prop_item->length, "%u: expected length %u, got %u\n", i, td[i].length, prop_item->length); + ok(prop_item->length == size, "%u: expected length %u, got %lu\n", i, size, prop_item->length); + ok(td[i].length == prop_item->length, "%u: expected length %lu, got %lu\n", i, td[i].length, prop_item->length); if (td[i].length == prop_item->length) { int match = memcmp(td[i].value, prop_item->value, td[i].length) == 0; @@ -4897,7 +4897,7 @@ static void test_gif_properties(void) { UINT j; BYTE *data = prop_item->value; - trace("id %#x:", prop_item->id); + trace("id %#lx:", prop_item->id); for (j = 0; j < prop_item->length; j++) trace(" %02x", data[j]); trace("\n"); @@ -4948,9 +4948,9 @@ static void test_gif_properties(void) ok(prop_item[i].value == item_data, "%u: expected value %p, got %p\n", i, item_data, prop_item[i].value); ok(td[i].type == prop_item[i].type, - "%u: expected type %u, got %u\n", i, td[i].type, prop_item[i].type); - ok(td[i].id == prop_item[i].id, "%u: expected id %#x, got %#x\n", i, td[i].id, prop_item[i].id); - ok(td[i].length == prop_item[i].length, "%u: expected length %u, got %u\n", i, td[i].length, prop_item[i].length); + "%u: expected type %lu, got %u\n", i, td[i].type, prop_item[i].type); + ok(td[i].id == prop_item[i].id, "%u: expected id %#lx, got %#lx\n", i, td[i].id, prop_item[i].id); + ok(td[i].length == prop_item[i].length, "%u: expected length %lu, got %lu\n", i, td[i].length, prop_item[i].length); if (td[i].length == prop_item[i].length) { int match = memcmp(td[i].value, prop_item[i].value, td[i].length) == 0; @@ -4959,7 +4959,7 @@ static void test_gif_properties(void) { UINT j; BYTE *data = prop_item[i].value; - trace("id %#x:", prop_item[i].id); + trace("id %#lx:", prop_item[i].id); for (j = 0; j < prop_item[i].length; j++) trace(" %02x", data[j]); trace("\n"); @@ -5185,7 +5185,7 @@ static void test_CloneBitmapArea(void) > 0x17d ? 0xffffffff : 0xff000000;
match = color_match(color_orig, color_copy, 0x00); - ok(match == TRUE, "Colors 0x%08x and 0x%08x do not match! (Conversion from %x to %x)\n", + ok(match == TRUE, "Colors 0x%08lx and 0x%08lx do not match! (Conversion from %x to %x)\n", color_orig, color_copy, td[i].src_format, td[i].dst_format); }
@@ -5229,7 +5229,7 @@ static void test_supported_encoders(void) hmem = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD, 16);
hr = CreateStreamOnHGlobal(hmem, TRUE, &stream); - ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); + ok(hr == S_OK, "CreateStreamOnHGlobal error %#lx\n", hr);
status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); ok(status == Ok, "%s encoder, GdipSaveImageToStream error %d\n", wine_dbgstr_w(td[i].mime), status); diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 51193f76b6a..aa844a62ff9 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -28,7 +28,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got); } #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001) @@ -64,14 +64,14 @@ static void check_record(int count, const char *desc, const struct emfplus_recor todo_wine_if (expected->todo) ok(expected->record_type == actual->record_type && (expected->flags == actual->flags || broken(expected->broken_flags == actual->flags)), - "%s.%i: Expected record type 0x%x, got 0x%x. Expected flags %#x, got %#x.\n", desc, count, + "%s.%i: Expected record type 0x%lx, got 0x%lx. Expected flags %#lx, got %#lx.\n", desc, count, expected->record_type, actual->record_type, expected->flags, actual->flags); } else { todo_wine_if (expected->todo) ok(expected->record_type == actual->record_type, - "%s.%i: Expected record type 0x%x, got 0x%x.\n", desc, count, + "%s.%i: Expected record type 0x%lx, got 0x%lx.\n", desc, count, expected->record_type, actual->record_type); } } @@ -136,7 +136,7 @@ static int CALLBACK enum_emf_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETAR const EmfPlusRecordHeader *record = (const EmfPlusRecordHeader*)&comment->Data[offset];
ok(record->Size == record->DataSize + sizeof(EmfPlusRecordHeader), - "%s: EMF+ record datasize %u and size %u mismatch\n", state->desc, record->DataSize, record->Size); + "%s: EMF+ record datasize %lu and size %lu mismatch\n", state->desc, record->DataSize, record->Size);
ok(offset + record->DataSize <= comment->cbData, "%s: EMF+ record truncated\n", state->desc); @@ -196,7 +196,7 @@ static int CALLBACK enum_emf_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETAR } else { - ok(0, "%s: Unexpected EMF 0x%x record\n", state->desc, lpEMFR->iType); + ok(0, "%s: Unexpected EMF 0x%lx record\n", state->desc, lpEMFR->iType); }
return 1; @@ -294,7 +294,7 @@ static BOOL CALLBACK play_metafile_proc(EmfPlusRecordType record_type, unsigned
todo_wine_if (state->expected[state->count].todo) ok(state->expected[state->count].record_type == record_type, - "%s.%i: expected record type 0x%x, got 0x%x\n", state->desc, state->count, + "%s.%i: expected record type 0x%lx, got 0x%x\n", state->desc, state->count, state->expected[state->count].record_type, record_type); state->count++; } @@ -3154,7 +3154,7 @@ static void test_unknownfontdecode(void) lstrcatW(path, L"wine_testfont0.ttf");
file = CreateFileW(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(path), GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(testfont0_resnum), diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index bfd4b233081..cd3e45f9b41 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -27,7 +27,7 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got); } #define expectf(expected, got) ok(fabs(got - expected) < 0.1, "Expected %.2f, got %.2f\n", expected, got)
diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 04db033a7e0..7920afd8ef4 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -36,12 +36,12 @@ #define expect(expected,got) expect_(__LINE__, expected, got) static inline void expect_(unsigned line, DWORD expected, DWORD got) { - ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got); + ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got); } #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) < (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001)
-#define expect_magic(value) ok(broken(*(value) == RGNDATA_MAGIC) || *(value) == RGNDATA_MAGIC2, "Expected a known magic value, got %8x\n", *(value)) +#define expect_magic(value) ok(broken(*(value) == RGNDATA_MAGIC) || *(value) == RGNDATA_MAGIC2, "Expected a known magic value, got %8lx\n", *(value)) #define expect_dword(value, expected) expect((expected), *(value)) #define expect_float(value, expected) expectf((expected), *(FLOAT *)(value))
@@ -63,19 +63,19 @@ static void verify_region(HRGN hrgn, const RECT *rc)
ret = GetRegionData(hrgn, 0, NULL); if (IsRectEmpty(rc)) - ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", ret); else - ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %lu\n", ret);
if (!ret) return;
ret = GetRegionData(hrgn, sizeof(rgn), &rgn.data); if (IsRectEmpty(rc)) - ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", ret); else - ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret); + ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %lu\n", ret);
- trace("size %u, type %u, count %u, rgn size %u, bound %s\n", + trace("size %lu, type %lu, count %lu, rgn size %lu, bound %s\n", rgn.data.rdh.dwSize, rgn.data.rdh.iType, rgn.data.rdh.nCount, rgn.data.rdh.nRgnSize, wine_dbgstr_rect(&rgn.data.rdh.rcBound)); @@ -87,17 +87,17 @@ static void verify_region(HRGN hrgn, const RECT *rc) wine_dbgstr_rect(rc), wine_dbgstr_rect(rect)); }
- ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", rgn.data.rdh.dwSize); - ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %u\n", rgn.data.rdh.iType); + ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %lu\n", rgn.data.rdh.dwSize); + ok(rgn.data.rdh.iType == RDH_RECTANGLES, "expected RDH_RECTANGLES, got %lu\n", rgn.data.rdh.iType); if (IsRectEmpty(rc)) { - ok(rgn.data.rdh.nCount == 0, "expected 0, got %u\n", rgn.data.rdh.nCount); - ok(rgn.data.rdh.nRgnSize == 0, "expected 0, got %u\n", rgn.data.rdh.nRgnSize); + ok(rgn.data.rdh.nCount == 0, "expected 0, got %lu\n", rgn.data.rdh.nCount); + ok(rgn.data.rdh.nRgnSize == 0, "expected 0, got %lu\n", rgn.data.rdh.nRgnSize); } else { - ok(rgn.data.rdh.nCount == 1, "expected 1, got %u\n", rgn.data.rdh.nCount); - ok(rgn.data.rdh.nRgnSize == sizeof(RECT), "expected sizeof(RECT), got %u\n", rgn.data.rdh.nRgnSize); + ok(rgn.data.rdh.nCount == 1, "expected 1, got %lu\n", rgn.data.rdh.nCount); + ok(rgn.data.rdh.nRgnSize == sizeof(RECT), "expected sizeof(RECT), got %lu\n", rgn.data.rdh.nRgnSize); } ok(EqualRect(&rgn.data.rdh.rcBound, rc), "expected %s, got %s\n", wine_dbgstr_rect(rc), wine_dbgstr_rect(&rgn.data.rdh.rcBound)); @@ -146,11 +146,11 @@ static void test_region_data(DWORD *data, UINT size, INT line) for (i = 0; i < size - 1; i++) { if (i == 1) continue; /* data[1] never matches */ - ok_(__FILE__, line)(data[i] == buf[i], "off %u: %#x != %#x\n", i, data[i], buf[i]); + ok_(__FILE__, line)(data[i] == buf[i], "off %u: %#lx != %#lx\n", i, data[i], buf[i]); } /* some Windows versions fail to properly clear the aligned DWORD */ ok_(__FILE__, line)(data[size - 1] == buf[size - 1] || broken(data[size - 1] != buf[size - 1]), - "off %u: %#x != %#x\n", size - 1, data[size - 1], buf[size - 1]); + "off %u: %#lx != %#lx\n", size - 1, data[size - 1], buf[size - 1]);
GdipDeleteRegion(region); } @@ -191,7 +191,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(20, needed); expect_dword(buf, 12); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); @@ -209,7 +209,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(20, needed); expect_dword(buf, 12); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_EMPTY_RECT); @@ -227,7 +227,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(20, needed); expect_dword(buf, 12); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); @@ -252,7 +252,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(36, needed); expect_dword(buf, 28); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_RECT); @@ -308,7 +308,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(156, needed); expect_dword(buf, 148); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 10); expect_dword(buf + 4, CombineModeExclude); @@ -371,7 +371,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(72, needed); expect_dword(buf, 64); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -406,7 +406,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(96, needed); expect_dword(buf, 88); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 2); expect_dword(buf + 4, CombineModeIntersect); @@ -451,7 +451,7 @@ static void test_getregiondata(void) expect(Ok, status); expect(36, needed); expect_dword(buf, 28); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -461,7 +461,7 @@ static void test_getregiondata(void) expect_dword(buf + 7, 0); /* flags 0 means that a path is an array of FLOATs */ ok(*(buf + 8) == 0x4000 /* before win7 */ || *(buf + 8) == 0, - "expected 0x4000 or 0, got %08x\n", *(buf + 8)); + "expected 0x4000 or 0, got %08lx\n", *(buf + 8)); expect_dword(buf + 10, 0xeeeeeeee); test_region_data(buf, needed, __LINE__);
@@ -493,7 +493,7 @@ static void test_getregiondata(void) expect(Ok, status); expect(56, needed); expect_dword(buf, 48); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3 , 0); expect_dword(buf + 4 , RGNDATA_PATH); @@ -567,7 +567,7 @@ static void test_getregiondata(void) expect(Ok, status); expect(72, needed); expect_dword(buf, 64); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -618,7 +618,7 @@ static void test_getregiondata(void) expect(Ok, status); expect(116, needed); expect_dword(buf, 108); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 2); expect_dword(buf + 4, CombineModeUnion); @@ -646,7 +646,7 @@ static void test_getregiondata(void) expect_float(buf + 26, 70.2); expect_dword(buf + 27, 0x01010100); ok((*(buf + 28) & 0xffff) == 0x0101, - "expected ????0101 got %08x\n", *(buf + 28)); + "expected ????0101 got %08lx\n", *(buf + 28)); expect_dword(buf + 29, 0xeeeeeeee); test_region_data(buf, needed, __LINE__);
@@ -672,7 +672,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(56, needed); expect_dword(buf, 48); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -716,7 +716,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(72, needed); expect_dword(buf, 64); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -762,7 +762,7 @@ static void test_getregiondata(void) ok(status == Ok, "status %08x\n", status); expect(136, needed); expect_dword(buf, 128); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -796,7 +796,7 @@ static void test_getregiondata(void) expect_dword(buf + 31, 0x03030300); expect_dword(buf + 32, 0x03030301); ok((*(buf + 33) & 0xffffff) == 0x030303, - "expected 0x??030303 got %08x\n", *(buf + 33)); + "expected 0x??030303 got %08lx\n", *(buf + 33)); expect_dword(buf + 34, 0xeeeeeeee); test_region_data(buf, needed, __LINE__);
@@ -924,7 +924,7 @@ static void test_combinereplace(void) expect(Ok, status); expect(36, needed); expect_dword(buf, 28); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_RECT); @@ -944,7 +944,7 @@ static void test_combinereplace(void) expect(Ok, status); expect(156, needed); expect_dword(buf, 148); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); @@ -963,7 +963,7 @@ static void test_combinereplace(void) expect(Ok, status); expect(20, needed); expect_dword(buf, 12); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); @@ -990,7 +990,7 @@ static void test_combinereplace(void) expect(Ok, status); expect(180, needed); expect_dword(buf, 172); - trace("buf[1] = %08x\n", buf[1]); + trace("buf[1] = %08lx\n", buf[1]); expect_magic(buf + 2); expect_dword(buf + 3, 2); expect_dword(buf + 4, CombineModeUnion); @@ -1449,14 +1449,14 @@ static void test_translate(void) static DWORD get_region_type(GpRegion *region) { DWORD *data; - DWORD size; + UINT size; DWORD result; DWORD status; status = GdipGetRegionDataSize(region, &size); expect(Ok, status); data = GdipAlloc(size); status = GdipGetRegionData(region, (BYTE*)data, size, NULL); - ok(status == Ok || status == InsufficientBuffer, "unexpected status 0x%x\n", status); + ok(status == Ok || status == InsufficientBuffer, "unexpected status 0x%lx\n", status); result = data[4]; GdipFree(data); return result; @@ -1597,7 +1597,7 @@ static void test_scans(void) GpMatrix *matrix; GpRectF rectf; GpStatus status; - ULONG count=80085; + UINT count=80085; INT icount; GpRectF scans[2]; GpRect scansi[2];
Signed-off-by: Esme Povirk esme@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/hid/tests/Makefile.in | 1 - dlls/hid/tests/device.c | 68 ++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/dlls/hid/tests/Makefile.in b/dlls/hid/tests/Makefile.in index 2a732990d7b..6bf377350c8 100644 --- a/dlls/hid/tests/Makefile.in +++ b/dlls/hid/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = hid.dll IMPORTS = hid setupapi
diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c index 6693bc8bf5a..17617f0e127 100644 --- a/dlls/hid/tests/device.c +++ b/dlls/hid/tests/device.c @@ -43,11 +43,11 @@ static void test_device_info(HANDLE device) int i;
rc = HidD_GetPreparsedData(device, &ppd); - ok(rc, "Failed to get preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to get preparsed data(0x%lx)\n", GetLastError()); status = HidP_GetCaps(ppd, &Caps); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%x)\n", status); + ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%lx)\n", status); rc = HidD_GetProductString(device, device_name, sizeof(device_name)); - ok(rc, "Failed to get product string(0x%x)\n", GetLastError()); + ok(rc, "Failed to get product string(0x%lx)\n", GetLastError()); trace("Found device %s (%02x, %02x)\n", wine_dbgstr_w(device_name), Caps.UsagePage, Caps.Usage);
trace("LinkCollectionNodes: (%d)\n", Caps.NumberLinkCollectionNodes); @@ -55,11 +55,11 @@ static void test_device_info(HANDLE device)
nodes_count = 0; status = HidP_GetLinkCollectionNodes(nodes, &nodes_count, ppd); - ok(status == HIDP_STATUS_BUFFER_TOO_SMALL, "HidP_GetLinkCollectionNodes succeeded:%x\n", status); + ok(status == HIDP_STATUS_BUFFER_TOO_SMALL, "HidP_GetLinkCollectionNodes succeeded:%lx\n", status);
nodes_count = ARRAY_SIZE(nodes); status = HidP_GetLinkCollectionNodes(nodes, &nodes_count, ppd); - ok(status == HIDP_STATUS_SUCCESS, "HidP_GetLinkCollectionNodes failed:%x\n", status); + ok(status == HIDP_STATUS_SUCCESS, "HidP_GetLinkCollectionNodes failed:%lx\n", status);
for (i = 0; i < nodes_count; ++i) { @@ -71,16 +71,16 @@ static void test_device_info(HANDLE device) nodes[i].CollectionType, nodes[i].IsAlias, nodes[i].UserContext); }
- ok(nodes_count > 0, "Unexpected number of link collection nodes:%u.\n", nodes_count); + ok(nodes_count > 0, "Unexpected number of link collection nodes:%lu.\n", nodes_count); ok(nodes[0].LinkUsagePage == Caps.UsagePage, "Unexpected top collection usage page:%x\n", nodes[0].LinkUsagePage); ok(nodes[0].LinkUsage == Caps.Usage, "Unexpected top collection usage:%x\n", nodes[0].LinkUsage); ok(nodes[0].CollectionType == 1, "Unexpected top collection type:%x\n", nodes[0].CollectionType);
rc = HidD_FreePreparsedData(ppd); - ok(rc, "Failed to free preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to free preparsed data(0x%lx)\n", GetLastError()); rc = HidD_GetAttributes(device, &attributes); - ok(rc, "Failed to get device attributes (0x%x)\n", GetLastError()); - ok(attributes.Size == sizeof(attributes), "Unexpected HIDD_ATTRIBUTES size: %d\n", attributes.Size); + ok(rc, "Failed to get device attributes (0x%lx)\n", GetLastError()); + ok(attributes.Size == sizeof(attributes), "Unexpected HIDD_ATTRIBUTES size: %ld\n", attributes.Size); trace("Device attributes: vid:%04x pid:%04x ver:%04x\n", attributes.VendorID, attributes.ProductID, attributes.VersionNumber); }
@@ -120,7 +120,7 @@ static void run_for_each_device(device_test *test) continue; }
- ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %u.\n", + ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %lu.\n", wine_dbgstr_w(data->DevicePath), GetLastError());
if (file != INVALID_HANDLE_VALUE) @@ -167,14 +167,14 @@ static HANDLE get_device(USHORT page, USHORT usages[], UINT usage_count, DWORD a trace("Not enough permissions to read device %s.\n", wine_dbgstr_w(data->DevicePath)); continue; } - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
rc = HidD_GetPreparsedData(file, &ppd); - ok(rc, "Failed to get preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to get preparsed data(0x%lx)\n", GetLastError()); status = HidP_GetCaps(ppd, &Caps); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%x)\n", status); + ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%lx)\n", status); rc = HidD_FreePreparsedData(ppd); - ok(rc, "Failed to free preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to free preparsed data(0x%lx)\n", GetLastError()); if (!page || page == Caps.UsagePage) { int j; @@ -214,7 +214,7 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D ULONG usage_length = 100; status = HidP_GetUsages(HidP_Input, i, 0, button_pages, &usage_length, ppd, data, data_length); ok (status == HIDP_STATUS_SUCCESS || usage_length == 0, - "HidP_GetUsages failed (%x) but usage length still %i\n", status, usage_length); + "HidP_GetUsages failed (%lx) but usage length still %li\n", status, usage_length); if (status == HIDP_STATUS_SUCCESS && usage_length) { CHAR report[50]; @@ -224,7 +224,7 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D count = usage_length; j = 0; report[0] = 0; - trace("\tButtons [0x%x: %i buttons]:\n", i, usage_length); + trace("\tButtons [0x%x: %li buttons]:\n", i, usage_length); for (count = 0; count < usage_length; count += 15) { for (j=count; j < count+15 && j < usage_length; j++) @@ -248,7 +248,7 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D values = HeapAlloc(GetProcessHeap(), 0, sizeof(HIDP_VALUE_CAPS) * Caps.NumberInputValueCaps); length = Caps.NumberInputValueCaps; status = HidP_GetValueCaps(HidP_Input, values, &length, ppd); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get value caps (%x)\n",status); + ok(status == HIDP_STATUS_SUCCESS, "Failed to get value caps (%lx)\n",status);
trace("\tValues:\n"); for (i = 0; i < length; i++) @@ -258,9 +258,9 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D { status = HidP_GetUsageValue(HidP_Input, values[i].UsagePage, 0, values[i].Range.UsageMin, &value, ppd, data, data_length); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get value [%i,%i] (%x)\n", + ok(status == HIDP_STATUS_SUCCESS, "Failed to get value [%i,%i] (%lx)\n", values[i].UsagePage, values[i].Range.UsageMin, status); - trace("[%02x, %02x]: %u\n", values[i].UsagePage, values[i].Range.UsageMin, value); + trace("[%02x, %02x]: %lu\n", values[i].UsagePage, values[i].Range.UsageMin, value); } else { @@ -270,7 +270,7 @@ static void process_data(HIDP_CAPS Caps, PHIDP_PREPARSED_DATA ppd, CHAR *data, D
status = HidP_GetUsageValueArray(HidP_Input, values[i].UsagePage, 0, values[i].NotRange.Usage, array, array_size, ppd, data, data_length); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get value array [%i,%i] (%x)\n", + ok(status == HIDP_STATUS_SUCCESS, "Failed to get value array [%i,%i] (%lx)\n", values[i].UsagePage, values[i].NotRange.Usage, status); dump[0] = 0; for (k = 0; k < array_size; k++) @@ -316,13 +316,13 @@ static void test_read_device(void) return; } rc = HidD_GetProductString(device, device_name, sizeof(device_name)); - ok(rc, "Failed to get product string(0x%x)\n", GetLastError()); + ok(rc, "Failed to get product string(0x%lx)\n", GetLastError()); trace("Read tests on device :%s\n",wine_dbgstr_w(device_name));
rc = HidD_GetPreparsedData(device, &ppd); - ok(rc, "Failed to get preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to get preparsed data(0x%lx)\n", GetLastError()); status = HidP_GetCaps(ppd, &Caps); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%x)\n", status); + ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%lx)\n", status); data = HeapAlloc(GetProcessHeap(), 0, Caps.InputReportByteLength);
memset(&overlapped, 0, sizeof(overlapped)); @@ -335,7 +335,7 @@ static void test_read_device(void) else max_time = timeout = 100; if (winetest_interactive) - trace("Test your device for the next %i seconds\n", max_time/1000); + trace("Test your device for the next %li seconds\n", max_time/1000); report = HeapAlloc(GetProcessHeap(), 0, 3 * Caps.InputReportByteLength); tick = GetTickCount(); spent = 0; @@ -346,7 +346,7 @@ static void test_read_device(void) { ResetEvent(overlapped.hEvent); spent = GetTickCount() - tick; - trace("REMAINING: %d ms\n", max_time - spent); + trace("REMAINING: %ld ms\n", max_time - spent); continue; } ResetEvent(overlapped.hEvent); @@ -363,16 +363,16 @@ static void test_read_device(void) sprintf(bytestr, "%x ", (BYTE)data[i]); strcat(report, bytestr); } - trace("Input report (%i): %s\n", read, report); + trace("Input report (%li): %s\n", read, report);
process_data(Caps, ppd, data, read); } - trace("REMAINING: %d ms\n", max_time - spent); + trace("REMAINING: %ld ms\n", max_time - spent); } while(spent < max_time);
CloseHandle(overlapped.hEvent); rc = HidD_FreePreparsedData(ppd); - ok(rc, "Failed to free preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to free preparsed data(0x%lx)\n", GetLastError()); CancelIo(device); CloseHandle(device); HeapFree(GetProcessHeap(), 0, data); @@ -402,13 +402,13 @@ static void test_get_input_report(void) return; } rc = HidD_GetProductString(device, device_name, sizeof(device_name)); - ok(rc, "Failed to get product string(0x%x)\n", GetLastError()); + ok(rc, "Failed to get product string(0x%lx)\n", GetLastError()); trace("HidD_GetInputRpeort tests on device :%s\n",wine_dbgstr_w(device_name));
rc = HidD_GetPreparsedData(device, &ppd); - ok(rc, "Failed to get preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to get preparsed data(0x%lx)\n", GetLastError()); status = HidP_GetCaps(ppd, &Caps); - ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%x)\n", status); + ok(status == HIDP_STATUS_SUCCESS, "Failed to get Caps(0x%lx)\n", status); data = HeapAlloc(GetProcessHeap(), 0, Caps.InputReportByteLength);
if (winetest_interactive) @@ -416,7 +416,7 @@ static void test_get_input_report(void) else max_time = 100; if (winetest_interactive) - trace("Test your device for the next %i seconds\n", max_time/1000); + trace("Test your device for the next %li seconds\n", max_time/1000); report = HeapAlloc(GetProcessHeap(), 0, 3 * Caps.InputReportByteLength); tick = GetTickCount(); spent = 0; @@ -444,12 +444,12 @@ static void test_get_input_report(void) } else trace("Failed to get Input Report, (%x)\n", rc); - trace("REMAINING: %d ms\n", max_time - spent); + trace("REMAINING: %ld ms\n", max_time - spent); Sleep(500); } while(spent < max_time);
rc = HidD_FreePreparsedData(ppd); - ok(rc, "Failed to free preparsed data(0x%x)\n", GetLastError()); + ok(rc, "Failed to free preparsed data(0x%lx)\n", GetLastError()); CloseHandle(device); HeapFree(GetProcessHeap(), 0, data); HeapFree(GetProcessHeap(), 0, report);
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/hlink/tests/Makefile.in | 1 dlls/hlink/tests/browse_ctx.c | 52 +++--- dlls/hlink/tests/hlink.c | 368 +++++++++++++++++++++-------------------- 3 files changed, 210 insertions(+), 211 deletions(-)
diff --git a/dlls/hlink/tests/Makefile.in b/dlls/hlink/tests/Makefile.in index 03a6534f891..f5344d6f2d7 100644 --- a/dlls/hlink/tests/Makefile.in +++ b/dlls/hlink/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = hlink.dll IMPORTS = hlink ole32
diff --git a/dlls/hlink/tests/browse_ctx.c b/dlls/hlink/tests/browse_ctx.c index 95a72d77722..c0a731bb334 100644 --- a/dlls/hlink/tests/browse_ctx.c +++ b/dlls/hlink/tests/browse_ctx.c @@ -36,41 +36,41 @@ static void test_SetInitialHlink(void) HRESULT hres;
hres = CreateBindCtx(0, &bindctx); - ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateBindCtx failed: 0x%08lx\n", hres);
hres = CreateItemMoniker(one, five, &dummy); - ok(hres == S_OK, "CreateItemMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateItemMoniker failed: 0x%08lx\n", hres);
hres = IMoniker_GetDisplayName(dummy, bindctx, NULL, &exp_name); - ok(hres == S_OK, "GetDisplayName failed: 0x%08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: 0x%08lx\n", hres);
hres = HlinkCreateBrowseContext(NULL, &IID_IHlinkBrowseContext, (void**)&bc); - ok(hres == S_OK, "HlinkCreateBrowseContext failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateBrowseContext failed: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_SetInitialHlink(bc, dummy, one, NULL); - ok(hres == S_OK, "SetInitialHlink failed: 0x%08x\n", hres); + ok(hres == S_OK, "SetInitialHlink failed: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_SetInitialHlink(bc, dummy, one, NULL); - ok(hres == CO_E_ALREADYINITIALIZED, "got 0x%08x\n", hres); + ok(hres == CO_E_ALREADYINITIALIZED, "got 0x%08lx\n", hres);
hres = IHlinkBrowseContext_SetInitialHlink(bc, dummy, five, NULL); - ok(hres == CO_E_ALREADYINITIALIZED, "got 0x%08x\n", hres); + ok(hres == CO_E_ALREADYINITIALIZED, "got 0x%08lx\n", hres);
/* there's only one */ hres = IHlinkBrowseContext_GetHlink(bc, HLID_PREVIOUS, &found_hlink); - ok(hres == E_FAIL, "got 0x%08x\n", hres); + ok(hres == E_FAIL, "got 0x%08lx\n", hres);
hres = IHlinkBrowseContext_GetHlink(bc, HLID_NEXT, &found_hlink); - ok(hres == E_FAIL, "got 0x%08x\n", hres); + ok(hres == E_FAIL, "got 0x%08lx\n", hres);
hres = IHlinkBrowseContext_GetHlink(bc, HLID_CURRENT, &found_hlink); - ok(hres == S_OK, "GetHlink failed: 0x%08x\n", hres); + ok(hres == S_OK, "GetHlink failed: 0x%08lx\n", hres);
hres = IHlink_GetMonikerReference(found_hlink, HLINKGETREF_DEFAULT, &found_moniker, NULL); - ok(hres == S_OK, "GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "GetMonikerReference failed: 0x%08lx\n", hres);
hres = IMoniker_GetDisplayName(found_moniker, bindctx, NULL, &found_name); - ok(hres == S_OK, "GetDisplayName failed: 0x%08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: 0x%08lx\n", hres); ok(!lstrcmpW(found_name, exp_name), "Found display name should have been %s, was: %s\n", wine_dbgstr_w(exp_name), wine_dbgstr_w(found_name));
CoTaskMemFree(exp_name); @@ -90,19 +90,19 @@ static void test_BrowseWindowInfo(void) HRESULT hres;
hres = HlinkCreateBrowseContext(NULL, &IID_IHlinkBrowseContext, (void**)&bc); - ok(hres == S_OK, "HlinkCreateBrowseContext failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateBrowseContext failed: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_GetBrowseWindowInfo(bc, NULL); - ok(hres == E_INVALIDARG, "GetBrowseWindow failed with wrong code: 0x%08x\n", hres); + ok(hres == E_INVALIDARG, "GetBrowseWindow failed with wrong code: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_SetBrowseWindowInfo(bc, NULL); - ok(hres == E_INVALIDARG, "SetBrowseWindow failed with wrong code: 0x%08x\n", hres); + ok(hres == E_INVALIDARG, "SetBrowseWindow failed with wrong code: 0x%08lx\n", hres);
memset(&bwinfo_get, -1, sizeof(HLBWINFO));
hres = IHlinkBrowseContext_GetBrowseWindowInfo(bc, &bwinfo_get); - ok(hres == S_OK, "GetBrowseWindowInfo failed: 0x%08x\n", hres); - ok(bwinfo_get.cbSize == 0, "Got wrong size: %x\n", bwinfo_get.cbSize); + ok(hres == S_OK, "GetBrowseWindowInfo failed: 0x%08lx\n", hres); + ok(bwinfo_get.cbSize == 0, "Got wrong size: %lx\n", bwinfo_get.cbSize);
bwinfo_set.cbSize = sizeof(HLBWINFO); bwinfo_set.grfHLBWIF = HLBWIF_WEBTOOLBARHIDDEN; @@ -120,12 +120,12 @@ static void test_BrowseWindowInfo(void) bwinfo_set.hltbinfo.rcTbPos.top = 11; bwinfo_set.hltbinfo.rcTbPos.bottom = 12; hres = IHlinkBrowseContext_SetBrowseWindowInfo(bc, &bwinfo_set); - ok(hres == S_OK, "SetBrowseWindowInfo failed: 0x%08x\n", hres); + ok(hres == S_OK, "SetBrowseWindowInfo failed: 0x%08lx\n", hres);
memset(&bwinfo_get, 0, sizeof(HLBWINFO));
hres = IHlinkBrowseContext_GetBrowseWindowInfo(bc, &bwinfo_get); - ok(hres == S_OK, "GetBrowseWindowInfo failed: 0x%08x\n", hres); + ok(hres == S_OK, "GetBrowseWindowInfo failed: 0x%08lx\n", hres); ok(!memcmp(&bwinfo_set, &bwinfo_get, sizeof(HLBWINFO)), "Set and Get differ\n");
IHlinkBrowseContext_Release(bc); @@ -172,26 +172,26 @@ static void test_GetObject(void) HRESULT hres;
hres = CreateItemMoniker(one, five, &dummy); - ok(hres == S_OK, "CreateItemMoniker() failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateItemMoniker() failed: 0x%08lx\n", hres);
hres = HlinkCreateBrowseContext(NULL, &IID_IHlinkBrowseContext, (void **)&bc); - ok(hres == S_OK, "HlinkCreateBrowseContext() failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateBrowseContext() failed: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_GetObject(bc, dummy, FALSE, &unk); - ok(hres == MK_E_UNAVAILABLE, "expected MK_E_UNAVAILABLE, got 0x%08x\n", hres); + ok(hres == MK_E_UNAVAILABLE, "expected MK_E_UNAVAILABLE, got 0x%08lx\n", hres);
hres = IHlinkBrowseContext_Register(bc, 0, &Unknown, dummy, &cookie); - ok(hres == S_OK, "Register() failed: 0x%08x\n", hres); + ok(hres == S_OK, "Register() failed: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_GetObject(bc, dummy, FALSE, &unk); - ok(hres == S_OK, "GetObject() failed: 0x%08x\n", hres); + ok(hres == S_OK, "GetObject() failed: 0x%08lx\n", hres); ok(unk == &Unknown, "wrong object returned\n");
hres = IHlinkBrowseContext_Revoke(bc, cookie); - ok(hres == S_OK, "Revoke() failed: 0x%08x\n", hres); + ok(hres == S_OK, "Revoke() failed: 0x%08lx\n", hres);
hres = IHlinkBrowseContext_GetObject(bc, dummy, FALSE, &unk); - ok(hres == MK_E_UNAVAILABLE, "expected MK_E_UNAVAILABLE, got 0x%08x\n", hres); + ok(hres == MK_E_UNAVAILABLE, "expected MK_E_UNAVAILABLE, got 0x%08lx\n", hres);
IHlinkBrowseContext_Release(bc); IMoniker_Release(dummy); diff --git a/dlls/hlink/tests/hlink.c b/dlls/hlink/tests/hlink.c index 1d2c530b52d..984f952c158 100644 --- a/dlls/hlink/tests/hlink.c +++ b/dlls/hlink/tests/hlink.c @@ -129,7 +129,7 @@ static void test_HlinkIsShortcut(void)
for (i=0; i < ARRAY_SIZE(shortcut_test); i++) { hres = HlinkIsShortcut(shortcut_test[i].file); - ok(hres == shortcut_test[i].hres, "[%d] HlinkIsShortcut returned %08x, expected %08x\n", + ok(hres == shortcut_test[i].hres, "[%d] HlinkIsShortcut returned %08lx, expected %08lx\n", i, hres, shortcut_test[i].hres); } } @@ -165,10 +165,10 @@ static void test_reference(void) CoTaskMemFree(str);
r = IHlink_GetStringReference(lnk, -1, NULL, NULL); - ok(r == S_OK, "failed, r=%08x\n", r); + ok(r == S_OK, "failed, r=%08lx\n", r);
r = IHlink_GetStringReference(lnk, -1, NULL, &str); - ok(r == S_OK, "failed, r=%08x\n", r); + ok(r == S_OK, "failed, r=%08lx\n", r); ok(str == NULL, "string should be null\n");
r = IHlink_GetStringReference(lnk, HLINKGETREF_DEFAULT, &str, NULL); @@ -378,16 +378,16 @@ static void test_persist_save_data(const char *testname, IHlink *lnk, BOOL same;
hr = IHlink_QueryInterface(lnk, &IID_IPersistStream, (void **)&ps); - ok(hr == S_OK, "IHlink_QueryInterface failed with error 0x%08x\n", hr); + ok(hr == S_OK, "IHlink_QueryInterface failed with error 0x%08lx\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "CreateStreamOnHGlobal failed with error 0x%08x\n", hr); + ok(hr == S_OK, "CreateStreamOnHGlobal failed with error 0x%08lx\n", hr);
hr = IPersistStream_Save(ps, stream, TRUE); - ok(hr == S_OK, "IPersistStream_Save failed with error 0x%08x\n", hr); + ok(hr == S_OK, "IPersistStream_Save failed with error 0x%08lx\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "GetHGlobalFromStream failed with error 0x%08x\n", hr); + ok(hr == S_OK, "GetHGlobalFromStream failed with error 0x%08lx\n", hr);
data_size = GlobalSize(hglobal);
@@ -396,7 +396,7 @@ static void test_persist_save_data(const char *testname, IHlink *lnk, /* first check we have the right amount of data */ ok((data_size == expected_data_size) || (data_size == expected_data_alt_size), - "%s: Size of saved data differs (expected %d or %d, actual %d)\n", + "%s: Size of saved data differs (expected %d or %d, actual %ld)\n", testname, expected_data_size, expected_data_alt_size, data_size);
same = TRUE; @@ -470,7 +470,7 @@ static void test_persist(void)
hr = HlinkCreateFromString(url, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (LPVOID*) &lnk); - ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08x\n", hr); + ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08lx\n", hr); if (!lnk) { skip("Can't create lnk, skipping test_persist.\n"); return; @@ -482,7 +482,7 @@ static void test_persist(void)
hr = HlinkCreateFromString(url, NULL, friendly_name, NULL, 0, NULL, &IID_IHlink, (LPVOID*) &lnk); - ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08x\n", hr); + ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08lx\n", hr); test_persist_save_data("url + friendly name", lnk, expected_hlink_data2, sizeof(expected_hlink_data2), expected_hlink_data2_ie7, sizeof(expected_hlink_data2_ie7)); @@ -490,7 +490,7 @@ static void test_persist(void)
hr = HlinkCreateFromString(url, location, friendly_name, NULL, 0, NULL, &IID_IHlink, (LPVOID*) &lnk); - ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08x\n", hr); + ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08lx\n", hr); test_persist_save_data("url + friendly_name + location", lnk, expected_hlink_data3, sizeof(expected_hlink_data3), expected_hlink_data3_ie7, sizeof(expected_hlink_data3_ie7)); @@ -498,7 +498,7 @@ static void test_persist(void)
hr = HlinkCreateFromString(rel_url, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (LPVOID*) &lnk); - ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08x\n", hr); + ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08lx\n", hr); test_persist_save_data("relative url", lnk, expected_hlink_data4, sizeof(expected_hlink_data4), expected_hlink_data4, sizeof(expected_hlink_data4)); @@ -506,9 +506,9 @@ static void test_persist(void)
hr = HlinkCreateFromString(url, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (LPVOID*) &lnk); - ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08x\n", hr); + ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08lx\n", hr); hr = IHlink_SetTargetFrameName(lnk, target_frame_name); - ok(hr == S_OK, "IHlink_SetTargetFrameName failed with error 0x%08x\n", hr); + ok(hr == S_OK, "IHlink_SetTargetFrameName failed with error 0x%08lx\n", hr); test_persist_save_data("url + target frame name", lnk, expected_hlink_data5, sizeof(expected_hlink_data5), expected_hlink_data5_ie7, sizeof(expected_hlink_data5_ie7)); @@ -516,7 +516,7 @@ static void test_persist(void)
hr = HlinkCreateFromString(filename, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (LPVOID*) &lnk); - ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08x\n", hr); + ok(hr == S_OK, "HlinkCreateFromString failed with error 0x%08lx\n", hr); test_persist_save_data("filename", lnk, expected_hlink_data6, sizeof(expected_hlink_data6), expected_hlink_data6, sizeof(expected_hlink_data6)); @@ -529,23 +529,23 @@ static void test_special_reference(void) HRESULT hres;
hres = HlinkGetSpecialReference(HLSR_HOME, &ref); - ok(hres == S_OK, "HlinkGetSpecialReference(HLSR_HOME) failed: %08x\n", hres); + ok(hres == S_OK, "HlinkGetSpecialReference(HLSR_HOME) failed: %08lx\n", hres); ok(ref != NULL, "ref == NULL\n"); CoTaskMemFree(ref);
hres = HlinkGetSpecialReference(HLSR_SEARCHPAGE, &ref); - ok(hres == S_OK, "HlinkGetSpecialReference(HLSR_SEARCHPAGE) failed: %08x\n", hres); + ok(hres == S_OK, "HlinkGetSpecialReference(HLSR_SEARCHPAGE) failed: %08lx\n", hres); ok(ref != NULL, "ref == NULL\n"); CoTaskMemFree(ref);
ref = (void*)0xdeadbeef; hres = HlinkGetSpecialReference(HLSR_HISTORYFOLDER, &ref); - ok(hres == E_NOTIMPL, "HlinkGetSpecialReference(HLSR_HISTORYFOLDER) failed: %08x\n", hres); + ok(hres == E_NOTIMPL, "HlinkGetSpecialReference(HLSR_HISTORYFOLDER) failed: %08lx\n", hres); ok(ref == NULL, "ref=%p\n", ref);
ref = (void*)0xdeadbeef; hres = HlinkGetSpecialReference(4, &ref); - ok(hres == E_INVALIDARG, "HlinkGetSpecialReference(HLSR_HISTORYFOLDER) failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "HlinkGetSpecialReference(HLSR_HISTORYFOLDER) failed: %08lx\n", hres); ok(ref == NULL, "ref=%p\n", ref); }
@@ -564,33 +564,33 @@ static void test_HlinkCreateExtensionServices(void)
hres = HlinkCreateExtensionServices(NULL, NULL, NULL, NULL, NULL, &IID_IAuthenticate, (void**)&authenticate); - ok(hres == S_OK, "HlinkCreateExtensionServices failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateExtensionServices failed: %08lx\n", hres); ok(authenticate != NULL, "HlinkCreateExtensionServices returned NULL\n");
password = username = (void*)0xdeadbeef; hwnd = (void*)0xdeadbeef; hres = IAuthenticate_Authenticate(authenticate, &hwnd, &username, &password); - ok(hres == S_OK, "Authenticate failed: %08x\n", hres); + ok(hres == S_OK, "Authenticate failed: %08lx\n", hres); ok(!hwnd, "hwnd != NULL\n"); ok(!username, "username != NULL\n"); ok(!password, "password != NULL\n");
hres = IAuthenticate_QueryInterface(authenticate, &IID_IHttpNegotiate, (void**)&http_negotiate); - ok(hres == S_OK, "Could not get IHttpNegotiate interface: %08x\n", hres); + ok(hres == S_OK, "Could not get IHttpNegotiate interface: %08lx\n", hres);
headers = (void*)0xdeadbeef; hres = IHttpNegotiate_BeginningTransaction(http_negotiate, (void*)0xdeadbeef, (void*)0xdeadbeef, 0, &headers); - ok(hres == S_OK, "BeginningTransaction failed: %08x\n", hres); + ok(hres == S_OK, "BeginningTransaction failed: %08lx\n", hres); ok(headers == NULL, "headers != NULL\n");
hres = IHttpNegotiate_BeginningTransaction(http_negotiate, (void*)0xdeadbeef, (void*)0xdeadbeef, 0, NULL); - ok(hres == E_INVALIDARG, "BeginningTransaction failed: %08x, expected E_INVALIDARG\n", hres); + ok(hres == E_INVALIDARG, "BeginningTransaction failed: %08lx, expected E_INVALIDARG\n", hres);
headers = (void*)0xdeadbeef; hres = IHttpNegotiate_OnResponse(http_negotiate, 200, (void*)0xdeadbeef, (void*)0xdeadbeef, &headers); - ok(hres == S_OK, "OnResponse failed: %08x\n", hres); + ok(hres == S_OK, "OnResponse failed: %08lx\n", hres); ok(headers == NULL, "headers != NULL\n");
IHttpNegotiate_Release(http_negotiate); @@ -599,13 +599,13 @@ static void test_HlinkCreateExtensionServices(void)
hres = HlinkCreateExtensionServices(headersW, (HWND)0xfefefefe, usernameW, passwordW, NULL, &IID_IAuthenticate, (void**)&authenticate); - ok(hres == S_OK, "HlinkCreateExtensionServices failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateExtensionServices failed: %08lx\n", hres); ok(authenticate != NULL, "HlinkCreateExtensionServices returned NULL\n");
password = username = NULL; hwnd = NULL; hres = IAuthenticate_Authenticate(authenticate, &hwnd, &username, &password); - ok(hres == S_OK, "Authenticate failed: %08x\n", hres); + ok(hres == S_OK, "Authenticate failed: %08lx\n", hres); ok(hwnd == (HWND)0xfefefefe, "hwnd=%p\n", hwnd); ok(!lstrcmpW(username, usernameW), "unexpected username\n"); ok(!lstrcmpW(password, passwordW), "unexpected password\n"); @@ -615,23 +615,23 @@ static void test_HlinkCreateExtensionServices(void) password = username = (void*)0xdeadbeef; hwnd = (void*)0xdeadbeef; hres = IAuthenticate_Authenticate(authenticate, &hwnd, NULL, &password); - ok(hres == E_INVALIDARG, "Authenticate failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "Authenticate failed: %08lx\n", hres); ok(password == (void*)0xdeadbeef, "password = %p\n", password); ok(hwnd == (void*)0xdeadbeef, "hwnd = %p\n", hwnd);
hres = IAuthenticate_QueryInterface(authenticate, &IID_IHttpNegotiate, (void**)&http_negotiate); - ok(hres == S_OK, "Could not get IHttpNegotiate interface: %08x\n", hres); + ok(hres == S_OK, "Could not get IHttpNegotiate interface: %08lx\n", hres);
headers = (void*)0xdeadbeef; hres = IHttpNegotiate_BeginningTransaction(http_negotiate, (void*)0xdeadbeef, (void*)0xdeadbeef, 0, &headers); - ok(hres == S_OK, "BeginningTransaction failed: %08x\n", hres); + ok(hres == S_OK, "BeginningTransaction failed: %08lx\n", hres); ok(!lstrcmpW(headers, headersexW), "unexpected headers %s\n", wine_dbgstr_w(headers)); CoTaskMemFree(headers);
headers = (void*)0xdeadbeef; hres = IHttpNegotiate_OnResponse(http_negotiate, 200, (void*)0xdeadbeef, (void*)0xdeadbeef, &headers); - ok(hres == S_OK, "OnResponse failed: %08x\n", hres); + ok(hres == S_OK, "OnResponse failed: %08lx\n", hres); ok(headers == NULL, "unexpected headers %s\n", wine_dbgstr_w(headers));
IHttpNegotiate_Release(http_negotiate); @@ -657,61 +657,61 @@ static void test_HlinkParseDisplayName(void) CreateBindCtx(0, &bctx);
hres = HlinkParseDisplayName(bctx, winehq_urlW, FALSE, &eaten, &mon); - ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); - ok(eaten == ARRAY_SIZE(winehq_urlW)-1, "eaten=%d\n", eaten); + ok(hres == S_OK, "HlinkParseDisplayName failed: %08lx\n", hres); + ok(eaten == ARRAY_SIZE(winehq_urlW)-1, "eaten=%ld\n", eaten); ok(mon != NULL, "mon == NULL\n");
hres = IMoniker_GetDisplayName(mon, bctx, 0, &name); - ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: %08lx\n", hres); ok(!lstrcmpW(name, winehq_urlW), "wrong display name %s\n", wine_dbgstr_w(name)); CoTaskMemFree(name);
hres = IMoniker_IsSystemMoniker(mon, &issys); - ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres); - ok(issys == MKSYS_URLMONIKER, "issys=%x\n", issys); + ok(hres == S_OK, "IsSystemMoniker failed: %08lx\n", hres); + ok(issys == MKSYS_URLMONIKER, "issys=%lx\n", issys);
IMoniker_Release(mon);
hres = HlinkParseDisplayName(bctx, clsid_nameW, FALSE, &eaten, &mon); - ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); - ok(eaten == ARRAY_SIZE(clsid_nameW)-1, "eaten=%d\n", eaten); + ok(hres == S_OK, "HlinkParseDisplayName failed: %08lx\n", hres); + ok(eaten == ARRAY_SIZE(clsid_nameW)-1, "eaten=%ld\n", eaten); ok(mon != NULL, "mon == NULL\n");
hres = IMoniker_IsSystemMoniker(mon, &issys); - ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres); - ok(issys == MKSYS_CLASSMONIKER, "issys=%x\n", issys); + ok(hres == S_OK, "IsSystemMoniker failed: %08lx\n", hres); + ok(issys == MKSYS_CLASSMONIKER, "issys=%lx\n", issys);
IMoniker_Release(mon);
hres = HlinkParseDisplayName(bctx, invalid_urlW, FALSE, &eaten, &mon); - ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); - ok(eaten == ARRAY_SIZE(invalid_urlW)-1, "eaten=%d\n", eaten); + ok(hres == S_OK, "HlinkParseDisplayName failed: %08lx\n", hres); + ok(eaten == ARRAY_SIZE(invalid_urlW)-1, "eaten=%ld\n", eaten); ok(mon != NULL, "mon == NULL\n");
hres = IMoniker_GetDisplayName(mon, bctx, 0, &name); - ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: %08lx\n", hres); ok(!lstrcmpW(name, invalid_urlW), "wrong display name %s\n", wine_dbgstr_w(name)); CoTaskMemFree(name);
hres = IMoniker_IsSystemMoniker(mon, &issys); - ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres); - ok(issys == MKSYS_FILEMONIKER, "issys=%x\n", issys); + ok(hres == S_OK, "IsSystemMoniker failed: %08lx\n", hres); + ok(issys == MKSYS_FILEMONIKER, "issys=%lx\n", issys);
IMoniker_Release(mon);
hres = HlinkParseDisplayName(bctx, file_urlW, FALSE, &eaten, &mon); - ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); - ok(eaten == ARRAY_SIZE(file_urlW)-1, "eaten=%d\n", eaten); + ok(hres == S_OK, "HlinkParseDisplayName failed: %08lx\n", hres); + ok(eaten == ARRAY_SIZE(file_urlW)-1, "eaten=%ld\n", eaten); ok(mon != NULL, "mon == NULL\n");
hres = IMoniker_GetDisplayName(mon, bctx, 0, &name); - ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: %08lx\n", hres); ok(!lstrcmpW(name, file_urlW+8), "wrong display name %s\n", wine_dbgstr_w(name)); CoTaskMemFree(name);
hres = IMoniker_IsSystemMoniker(mon, &issys); - ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres); - ok(issys == MKSYS_FILEMONIKER, "issys=%x\n", issys); + ok(hres == S_OK, "IsSystemMoniker failed: %08lx\n", hres); + ok(issys == MKSYS_FILEMONIKER, "issys=%lx\n", issys);
IMoniker_Release(mon); IBindCtx_Release(bctx); @@ -808,7 +808,7 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac { CHECK_EXPECT(BindStatusCallback_OnStopBinding);
- ok(hr == S_OK, "got hr %#x\n", hr); + ok(hr == S_OK, "got hr %#lx\n", hr); ok(!error, "got error %s\n", wine_dbgstr_w(error));
return 0xdeadbeef; @@ -906,7 +906,7 @@ static HRESULT WINAPI HlinkBrowseContext_GetObject(IHlinkBrowseContext *iface,
CreateBindCtx(0, &bctx); hr = IMoniker_GetDisplayName(pimk, bctx, NULL, &name); - ok(hr == S_OK, "Failed to get display name, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get display name, hr %#lx.\n", hr); ok(!lstrcmpW(winehq_urlW, name) || !lstrcmpW(winehq_404W, name), "got unexpected url\n"); CoTaskMemFree(name); IBindCtx_Release(bctx); @@ -1066,7 +1066,7 @@ static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, { CHECK_EXPECT(HT_Navigate);
- ok(grfHLNF == 0, "grfHLNF = %x\n", grfHLNF); + ok(grfHLNF == 0, "grfHLNF = %lx\n", grfHLNF); ok(pwzJumpLocation == NULL, "pwzJumpLocation = %s\n", wine_dbgstr_w(pwzJumpLocation)); return S_OK; } @@ -1168,10 +1168,10 @@ static HRESULT WINAPI Moniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoni if (async_bind) { hr = IBindCtx_GetObjectParam(pbc, bscb_holderW, &bind_callback_holder); - ok(hr == S_OK, "Failed to get IBindStatusCallback holder, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get IBindStatusCallback holder, hr %#lx.\n", hr); hr = IUnknown_QueryInterface(bind_callback_holder, &IID_IBindStatusCallback, (void **)&async_bind_callback); - ok(hr == S_OK, "Failed to get IBindStatusCallback interface, hr %#x.\n", hr); + ok(hr == S_OK, "Failed to get IBindStatusCallback interface, hr %#lx.\n", hr); IUnknown_Release(bind_callback_holder); return MK_S_ASYNCHRONOUS; } @@ -1197,7 +1197,7 @@ static HRESULT WINAPI Moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMon ok(*ppv == NULL, "*ppv=%p\n", *ppv);
hres = IBindCtx_GetObjectParam(pbc, BSCBHolder, &unk); - ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres); + ok(hres == S_OK, "GetObjectParam failed: %08lx\n", hres); ok(unk != NULL, "unk == NULL\n");
IUnknown_Release(unk); @@ -1341,7 +1341,7 @@ static void test_HlinkResolveMonikerForData(void) SET_EXPECT(BindToStorage);
hres = HlinkResolveMonikerForData(&Moniker, 0, bctx, 0, NULL, &BindStatusCallback, NULL); - ok(hres == S_OK, "HlinkResolveMonikerForData failed: %08x\n", hres); + ok(hres == S_OK, "HlinkResolveMonikerForData failed: %08lx\n", hres);
CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName); @@ -1363,18 +1363,18 @@ static void test_HlinkGetSetMonikerReference(void)
/* create two dummy monikers to use as targets */ hres = CreateItemMoniker(one, one, &dummy); - ok(hres == S_OK, "CreateItemMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateItemMoniker failed: 0x%08lx\n", hres);
hres = CreateItemMoniker(two, two, &dummy2); - ok(hres == S_OK, "CreateItemMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateItemMoniker failed: 0x%08lx\n", hres);
/* create a new hlink: target => dummy, location => one */ hres = HlinkCreateFromMoniker(dummy, one, name, NULL, 0, NULL, &IID_IHlink, (void**)&hlink); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08lx\n", hres);
/* validate the target and location */ hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy, "Found target should've been %p, was: %p\n", dummy, found_trgt); ok(lstrcmpW(found_loc, one) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1382,10 +1382,10 @@ static void test_HlinkGetSetMonikerReference(void)
/* set location => two */ hres = IHlink_SetMonikerReference(hlink, HLINKSETF_LOCATION, dummy2, two); - ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08lx\n", hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy, "Found target should've been %p, was: %p\n", dummy, found_trgt); ok(lstrcmpW(found_loc, two) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1393,10 +1393,10 @@ static void test_HlinkGetSetMonikerReference(void)
/* set target => dummy2 */ hres = IHlink_SetMonikerReference(hlink, HLINKSETF_TARGET, dummy2, one); - ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08lx\n", hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy2, "Found target should've been %p, was: %p\n", dummy2, found_trgt); ok(lstrcmpW(found_loc, two) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1404,10 +1404,10 @@ static void test_HlinkGetSetMonikerReference(void)
/* set target => dummy, location => one */ hres = IHlink_SetMonikerReference(hlink, HLINKSETF_TARGET | HLINKSETF_LOCATION, dummy, one); - ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08lx\n", hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy, "Found target should've been %p, was: %p\n", dummy, found_trgt); ok(lstrcmpW(found_loc, one) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1415,10 +1415,10 @@ static void test_HlinkGetSetMonikerReference(void)
/* no HLINKSETF flags */ hres = IHlink_SetMonikerReference(hlink, 0, dummy2, two); - ok(hres == E_INVALIDARG, "IHlink_SetMonikerReference should've failed with E_INVALIDARG (0x%08x), failed with 0x%08x\n", E_INVALIDARG, hres); + ok(hres == E_INVALIDARG, "IHlink_SetMonikerReference should've failed with E_INVALIDARG (0x%08lx), failed with 0x%08lx\n", E_INVALIDARG, hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy, "Found target should've been %p, was: %p\n", dummy, found_trgt); ok(lstrcmpW(found_loc, one) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1430,7 +1430,7 @@ static void test_HlinkGetSetMonikerReference(void) IHlink_SetMonikerReference(hlink, 12, dummy2, two);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy, "Found target should've been %p, was: %p\n", dummy, found_trgt); ok(lstrcmpW(found_loc, one) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1438,10 +1438,10 @@ static void test_HlinkGetSetMonikerReference(void)
/* valid & invalid HLINKSETF flags */ hres = IHlink_SetMonikerReference(hlink, 12 | HLINKSETF_TARGET, dummy2, two); - ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08lx\n", hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == dummy2, "Found target should've been %p, was: %p\n", dummy2, found_trgt); ok(lstrcmpW(found_loc, one) == 0, "Found location should've been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(found_loc)); IMoniker_Release(found_trgt); @@ -1449,10 +1449,10 @@ static void test_HlinkGetSetMonikerReference(void)
/* NULL args */ hres = IHlink_SetMonikerReference(hlink, HLINKSETF_TARGET | HLINKSETF_LOCATION, NULL, NULL); - ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08lx\n", hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &found_trgt, &found_loc); - ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres); ok(found_trgt == NULL, "Found target should've been %p, was: %p\n", NULL, found_trgt); ok(found_loc == NULL, "Found location should've been %s, was: %s\n", wine_dbgstr_w(NULL), wine_dbgstr_w(found_loc)); if(found_trgt) @@ -1468,11 +1468,11 @@ static void test_HlinkGetSetMonikerReference(void) SET_EXPECT(GetDisplayName); hres = HlinkCreateFromMoniker(&Moniker, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void **)&hlink); - ok(hres == S_OK, "CreateFromMoniker failed: %08x\n", hres); + ok(hres == S_OK, "CreateFromMoniker failed: %08lx\n", hres);
hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_ABSOLUTE, &found_trgt, &found_loc); - ok(hres == S_OK, "CreateFromMoniker failed: %08x\n", hres); + ok(hres == S_OK, "CreateFromMoniker failed: %08lx\n", hres); ok(found_trgt == &Moniker, "Got unexpected moniker: %p\n", found_trgt); ok(found_loc == NULL, "Got unexpected location: %p\n", found_loc); todo_wine CHECK_CALLED(Reduce); @@ -1495,31 +1495,31 @@ static void test_HlinkGetSetStringReference(void)
/* create a new hlink: target => NULL, location => one */ hres = HlinkCreateFromMoniker(NULL, one, empty, NULL, 0, NULL, &IID_IHlink, (void**)&link); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08lx\n", hres);
/* test setting/getting location */ hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(fnd_tgt == NULL, "Found target should have been NULL, was: %s\n", wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, one), "Found location should have been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_loc);
hres = IHlink_SetStringReference(link, HLINKSETF_LOCATION, one, two); - ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres);
hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(fnd_tgt == NULL, "Found target should have been NULL, was: %s\n", wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, two), "Found location should have been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_loc);
hres = IHlink_SetStringReference(link, -HLINKSETF_LOCATION, two, one); - ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres);
hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(fnd_tgt == NULL, "Found target should have been NULL, was: %s\n", wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, one), "Found location should have been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); @@ -1527,20 +1527,20 @@ static void test_HlinkGetSetStringReference(void)
/* test setting/getting target */ hres = IHlink_SetStringReference(link, HLINKSETF_TARGET, two, three); - ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres);
hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(!lstrcmpW(fnd_tgt, two), "Found target should have been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, one), "Found location should have been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_loc);
hres = IHlink_SetStringReference(link, -HLINKSETF_TARGET, three, two); - ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres);
hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(!lstrcmpW(fnd_tgt, three), "Found target should have been %s, was: %s\n", wine_dbgstr_w(three), wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, two), "Found location should have been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); @@ -1548,20 +1548,20 @@ static void test_HlinkGetSetStringReference(void)
/* test setting/getting both */ hres = IHlink_SetStringReference(link, HLINKSETF_TARGET | HLINKSETF_LOCATION, one, two); - ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres);
hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(!lstrcmpW(fnd_tgt, one), "Found target should have been %s, was: %s\n", wine_dbgstr_w(one), wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, two), "Found location should have been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_loc);
hres = IHlink_SetStringReference(link, -(HLINKSETF_TARGET | HLINKSETF_LOCATION), three, one); - ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres);
hres = IHlink_GetStringReference(link, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok(hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres); ok(!lstrcmpW(fnd_tgt, three), "Found target should have been %s, was: %s\n", wine_dbgstr_w(three), wine_dbgstr_w(fnd_tgt)); ok(!lstrcmpW(fnd_loc, two), "Found location should have been %s, was: %s\n", wine_dbgstr_w(two), wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); @@ -1570,7 +1570,7 @@ static void test_HlinkGetSetStringReference(void) /* test invalid flags/params */ hres = IHlink_GetStringReference(link, 4, &fnd_tgt, &fnd_loc); ok(hres == E_INVALIDARG, "IHlink_GetStringReference should have failed " - "with E_INVALIDARG (0x%08x), instead: 0x%08x\n", E_INVALIDARG, hres); + "with E_INVALIDARG (0x%08lx), instead: 0x%08lx\n", E_INVALIDARG, hres); ok(fnd_tgt == NULL, "Found target should have been NULL, was: %s\n", wine_dbgstr_w(fnd_tgt)); ok(fnd_loc == NULL, "Found location should have been NULL, was: %s\n", wine_dbgstr_w(fnd_loc)); CoTaskMemFree(fnd_tgt); @@ -1578,25 +1578,25 @@ static void test_HlinkGetSetStringReference(void)
hres = IHlink_GetStringReference(link, -1, &fnd_tgt, NULL); todo_wine ok(hres == E_FAIL, "IHlink_GetStringReference should have failed " - "with E_FAIL (0x%08x), instead: 0x%08x\n", E_FAIL, hres); + "with E_FAIL (0x%08lx), instead: 0x%08lx\n", E_FAIL, hres); CoTaskMemFree(fnd_tgt);
hres = IHlink_GetStringReference(link, -1, NULL, NULL); - ok(hres == S_OK, "failed, hres=%08x\n", hres); + ok(hres == S_OK, "failed, hres=%08lx\n", hres);
hres = IHlink_GetStringReference(link, -1, NULL, &fnd_loc); - ok(hres == S_OK, "failed, hres=%08x\n", hres); + ok(hres == S_OK, "failed, hres=%08lx\n", hres); CoTaskMemFree(fnd_loc);
hres = IHlink_GetStringReference(link, -1, &fnd_tgt, &fnd_loc); todo_wine ok(hres == E_FAIL, "IHlink_GetStringReference should have failed " - "with E_FAIL (0x%08x), instead: 0x%08x\n", E_FAIL, hres); + "with E_FAIL (0x%08lx), instead: 0x%08lx\n", E_FAIL, hres); CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_loc);
hres = IHlink_GetStringReference(link, -2, &fnd_tgt, &fnd_loc); ok(hres == E_INVALIDARG, "IHlink_GetStringReference should have failed " - "with E_INVALIDARG (0x%08x), instead: 0x%08x\n", E_INVALIDARG, hres); + "with E_INVALIDARG (0x%08lx), instead: 0x%08lx\n", E_INVALIDARG, hres); CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_loc);
@@ -1615,7 +1615,7 @@ static void r_setStringRef(unsigned line, IHlink *hlink, DWORD flags, const WCHA { HRESULT hres; hres = IHlink_SetStringReference(hlink, flags, tgt, loc); - ok_(__FILE__,line) (hres == S_OK, "IHlink_SetStringReference failed: 0x%08x\n", hres); + ok_(__FILE__,line) (hres == S_OK, "IHlink_SetStringReference failed: 0x%08lx\n", hres); }
#define getStringRef(h,t,l) r_getStringRef(__LINE__,h,t,l) @@ -1625,7 +1625,7 @@ static void r_getStringRef(unsigned line, IHlink *hlink, const WCHAR *exp_tgt, c WCHAR *fnd_tgt, *fnd_loc;
hres = IHlink_GetStringReference(hlink, HLINKGETREF_DEFAULT, &fnd_tgt, &fnd_loc); - ok_(__FILE__,line) (hres == S_OK, "IHlink_GetStringReference failed: 0x%08x\n", hres); + ok_(__FILE__,line) (hres == S_OK, "IHlink_GetStringReference failed: 0x%08lx\n", hres);
if(exp_tgt) ok_(__FILE__,line) (!lstrcmpW(fnd_tgt, exp_tgt), "Found string target should have been %s, was: %s\n", wine_dbgstr_w(exp_tgt), wine_dbgstr_w(fnd_tgt)); @@ -1646,7 +1646,7 @@ static void r_setMonikerRef(unsigned line, IHlink *hlink, DWORD flags, IMoniker { HRESULT hres; hres = IHlink_SetMonikerReference(hlink, flags, tgt, loc); - ok_(__FILE__,line) (hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08x\n", hres); + ok_(__FILE__,line) (hres == S_OK, "IHlink_SetMonikerReference failed: 0x%08lx\n", hres); }
/* passing 0xFFFFFFFF as exp_tgt will return the retrieved target & not test it */ @@ -1658,7 +1658,7 @@ static IMoniker *r_getMonikerRef(unsigned line, IHlink *hlink, IMoniker *exp_tgt WCHAR *fnd_loc;
hres = IHlink_GetMonikerReference(hlink, ref, &fnd_tgt, &fnd_loc); - ok_(__FILE__,line) (hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08x\n", hres); + ok_(__FILE__,line) (hres == S_OK, "IHlink_GetMonikerReference failed: 0x%08lx\n", hres);
if(exp_loc) ok_(__FILE__,line) (!lstrcmpW(fnd_loc, exp_loc), "Found string location should have been %s, was: %s\n", wine_dbgstr_w(exp_loc), wine_dbgstr_w(fnd_loc)); @@ -1689,7 +1689,7 @@ static void test_HlinkMoniker(void) HRESULT hres;
hres = HlinkCreateFromString(NULL, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void**)&hlink); - ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08lx\n", hres); getStringRef(hlink, NULL, NULL); getMonikerRef(hlink, NULL, NULL, HLINKGETREF_RELATIVE);
@@ -1710,7 +1710,7 @@ static void test_HlinkMoniker(void) /* setting a moniker target also sets the target string to that moniker's * display name */ hres = CreateFileMoniker(bW, &file_mon); - ok(hres == S_OK, "CreateFileMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateFileMoniker failed: 0x%08lx\n", hres);
setMonikerRef(hlink, HLINKSETF_TARGET | HLINKSETF_LOCATION, file_mon, wordsW); getStringRef(hlink, bW, wordsW); @@ -1736,7 +1736,7 @@ static void test_HashLink(void)
/* simple single hash test */ hres = HlinkCreateFromString(hash_targetW, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void*)&hlink); - ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08lx\n", hres); ok(hlink != NULL, "Didn't get an hlink\n");
if(hlink){ @@ -1754,7 +1754,7 @@ static void test_HashLink(void)
/* two hashes in the target */ hres = HlinkCreateFromString(two_hash_targetW, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void*)&hlink); - ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08lx\n", hres); ok(hlink != NULL, "Didn't get an hlink\n");
if(hlink){ @@ -1769,7 +1769,7 @@ static void test_HashLink(void)
/* target with hash plus a location string */ hres = HlinkCreateFromString(hash_targetW, test_locW, NULL, NULL, 0, NULL, &IID_IHlink, (void*)&hlink); - ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08lx\n", hres); ok(hlink != NULL, "Didn't get an hlink\n");
if(hlink){ @@ -1784,7 +1784,7 @@ static void test_HashLink(void)
/* target with hash containing no "target part" */ hres = HlinkCreateFromString(hash_no_tgtW, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void*)&hlink); - ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: 0x%08lx\n", hres); ok(hlink != NULL, "Didn't get an hlink\n");
if(hlink){ @@ -1819,7 +1819,7 @@ static HRESULT WINAPI hls_site_Moniker_ComposeWith(IMoniker *iface, CHECK_EXPECT(ComposeWith);
hres = IMoniker_GetDisplayName(right, NULL, NULL, &rightName); - ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: %08lx\n", hres); ok(!lstrcmpW(rightName, ref_monikerW), "Expected to get moniker set via SetMonikerReference, instead got: %s\n", wine_dbgstr_w(rightName)); @@ -1928,7 +1928,7 @@ static ULONG WINAPI hls_Release(IHlinkSite *iface) static HRESULT WINAPI hls_QueryService(IHlinkSite *iface, DWORD siteData, REFGUID service, REFIID riid, IUnknown **punk) { - ok(0, "QS: %p %x %s %s %p\n", iface, siteData, wine_dbgstr_guid(service), + ok(0, "QS: %p %lx %s %s %p\n", iface, siteData, wine_dbgstr_guid(service), wine_dbgstr_guid(riid), punk); return E_NOTIMPL; } @@ -1940,7 +1940,7 @@ static HRESULT WINAPI hls_GetMoniker(IHlinkSite *iface, DWORD siteData, DWORD assign, DWORD which, IMoniker **pmk) { ok(siteData == SITEDATA_NOTIMPL || - siteData == SITEDATA_SUCCESS, "Unexpected site data: %u\n", siteData); + siteData == SITEDATA_SUCCESS, "Unexpected site data: %lu\n", siteData);
if(siteData == SITEDATA_SUCCESS){ *pmk = &hls_site_Moniker; @@ -1953,7 +1953,7 @@ static HRESULT WINAPI hls_GetMoniker(IHlinkSite *iface, DWORD siteData, static HRESULT WINAPI hls_ReadyToNavigate(IHlinkSite *iface, DWORD siteData, DWORD reserved) { - ok(0, "RTN: %p %x %x\n", iface, siteData, reserved); + ok(0, "RTN: %p %lx %lx\n", iface, siteData, reserved); return E_NOTIMPL; }
@@ -1961,8 +1961,8 @@ static HRESULT WINAPI hls_OnNavigationComplete(IHlinkSite *iface, DWORD siteData, DWORD reserved, HRESULT error, LPCWSTR errorStr) { CHECK_EXPECT(OnNavigationComplete); - ok(siteData == SITEDATA_SUCCESS, "Unexpected site data: %u\n", siteData); - ok(error == E_OUTOFMEMORY, "Expected E_OUTOFMEMORY, got: %08x\n", error); + ok(siteData == SITEDATA_SUCCESS, "Unexpected site data: %lu\n", siteData); + ok(error == E_OUTOFMEMORY, "Expected E_OUTOFMEMORY, got: %08lx\n", error); return E_NOTIMPL; }
@@ -1987,26 +1987,26 @@ static void test_HlinkSite(void)
hres = HlinkCreateFromString(NULL, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (LPVOID*)&hl); - ok(hres == S_OK, "HlinkCreateFromString failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: %08lx\n", hres); getMonikerRef(hl, NULL, NULL, HLINKGETREF_RELATIVE);
hres = IHlink_SetHlinkSite(hl, &HlinkSite, SITEDATA_SUCCESS); - ok(hres == S_OK, "SetHlinkSite failed: %08x\n", hres); + ok(hres == S_OK, "SetHlinkSite failed: %08lx\n", hres); getMonikerRef(hl, NULL, NULL, HLINKGETREF_RELATIVE); getStringRef(hl, NULL, NULL);
hres = IHlink_GetMonikerReference(hl, HLINKGETREF_RELATIVE, &mon_ref, NULL); - ok(hres == S_OK, "GetMonikerReference failed: %08x\n", hres); + ok(hres == S_OK, "GetMonikerReference failed: %08lx\n", hres); ok(mon_ref == NULL, "Didn't get expected moniker, instead: %p\n", mon_ref);
hres = IHlink_GetMonikerReference(hl, HLINKGETREF_ABSOLUTE, &mon_ref, NULL); - ok(hres == S_OK, "GetMonikerReference failed: %08x\n", hres); + ok(hres == S_OK, "GetMonikerReference failed: %08lx\n", hres); ok(mon_ref == &hls_site_Moniker, "Didn't get expected moniker, instead: %p\n", mon_ref);
SET_EXPECT(Reduce); SET_EXPECT(Enum); hres = IHlink_SetMonikerReference(hl, HLINKSETF_TARGET, &hls_ref_Moniker, NULL); - ok(hres == S_OK, "SetMonikerReference failed: %08x\n", hres); + ok(hres == S_OK, "SetMonikerReference failed: %08lx\n", hres); todo_wine CHECK_CALLED(Reduce); todo_wine CHECK_CALLED(Enum);
@@ -2017,23 +2017,23 @@ static void test_HlinkSite(void) todo_wine CHECK_CALLED(Enum);
hres = IHlink_GetMonikerReference(hl, HLINKGETREF_RELATIVE, &mon_ref, NULL); - ok(hres == S_OK, "GetMonikerReference failed: %08x\n", hres); + ok(hres == S_OK, "GetMonikerReference failed: %08lx\n", hres); ok(mon_ref == &hls_ref_Moniker, "Didn't get expected moniker, instead: %p\n", mon_ref); IMoniker_Release(mon_ref);
SET_EXPECT(ComposeWith); hres = IHlink_GetMonikerReference(hl, HLINKGETREF_ABSOLUTE, &mon_ref, NULL); - ok(hres == E_OUTOFMEMORY, "Expected E_OUTOFMEMORY, got: %08x\n", hres); + ok(hres == E_OUTOFMEMORY, "Expected E_OUTOFMEMORY, got: %08lx\n", hres); ok(mon_ref == NULL, "Shouldn't have got a Moniker, got: %p\n", mon_ref); CHECK_CALLED(ComposeWith);
hres = CreateBindCtx(0, &pbc); - ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres); + ok(hres == S_OK, "CreateBindCtx failed: %08lx\n", hres);
SET_EXPECT(ComposeWith); SET_EXPECT(OnNavigationComplete); hres = IHlink_Navigate(hl, 0, pbc, NULL, NULL); - ok(hres == E_OUTOFMEMORY, "Navigate should've failed: %08x\n", hres); + ok(hres == E_OUTOFMEMORY, "Navigate should've failed: %08lx\n", hres); CHECK_CALLED(ComposeWith); CHECK_CALLED(OnNavigationComplete);
@@ -2044,7 +2044,7 @@ static void test_HlinkSite(void) SET_EXPECT(Enum); hres = HlinkCreateFromMoniker(&hls_ref_Moniker, NULL, NULL, &HlinkSite, SITEDATA_SUCCESS, NULL, &IID_IHlink, (LPVOID*)&hl); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08lx\n", hres); todo_wine CHECK_CALLED(Reduce); todo_wine CHECK_CALLED(Enum); getMonikerRef(hl, &hls_ref_Moniker, NULL, HLINKGETREF_RELATIVE); @@ -2052,7 +2052,7 @@ static void test_HlinkSite(void)
hres = HlinkCreateFromMoniker(NULL, NULL, NULL, &HlinkSite, SITEDATA_SUCCESS, NULL, &IID_IHlink, (LPVOID*)&hl); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08lx\n", hres); getMonikerRef(hl, NULL, NULL, HLINKGETREF_RELATIVE); IHlink_Release(hl);
@@ -2062,7 +2062,7 @@ static void test_HlinkSite(void) SET_EXPECT(GetDisplayName); hres = HlinkCreateFromMoniker(&Moniker, NULL, NULL, &HlinkSite, SITEDATA_NOTIMPL, NULL, &IID_IHlink, (LPVOID*)&hl); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08lx\n", hres); getMonikerRef(hl, &Moniker, NULL, HLINKGETREF_ABSOLUTE); IHlink_Release(hl); todo_wine CHECK_CALLED(Reduce); @@ -2084,14 +2084,14 @@ static void test_HlinkClone(void) const WCHAR name[] = {'a',0};
hres = HlinkClone(NULL, NULL, NULL, 0, NULL); - ok(hres == E_INVALIDARG, "Got wrong failure code: %08x\n", hres); + ok(hres == E_INVALIDARG, "Got wrong failure code: %08lx\n", hres);
hres = HlinkCreateFromString(NULL, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void**)&hl); - ok(hres == S_OK, "HlinkCreateFromString failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromString failed: %08lx\n", hres);
hres = HlinkClone(hl, &IID_IHlink, NULL, 0, NULL); - ok(hres == E_INVALIDARG, "Got wrong failure code: %08x\n", hres); + ok(hres == E_INVALIDARG, "Got wrong failure code: %08lx\n", hres);
if (0) { @@ -2102,7 +2102,7 @@ static void test_HlinkClone(void) }
hres = HlinkClone(hl, &IID_IHlink, NULL, 0, (void**)&cloned); - ok(hres == S_OK, "HlinkClone failed: %08x\n", hres); + ok(hres == S_OK, "HlinkClone failed: %08lx\n", hres); ok(cloned != NULL, "Didn't get a clone\n"); getMonikerRef(cloned, NULL, NULL, HLINKGETREF_RELATIVE); IHlink_Release(cloned); @@ -2114,7 +2114,7 @@ static void test_HlinkClone(void) hres = HlinkCreateFromMoniker(&hls_ref_Moniker, two, NULL, NULL, 0, NULL, &IID_IHlink, (void**)&hl); todo_wine CHECK_CALLED(Reduce); todo_wine CHECK_CALLED(Enum); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08lx\n", hres); getMonikerRef(hl, &hls_ref_Moniker, two, HLINKGETREF_RELATIVE);
SET_EXPECT(Save); @@ -2122,7 +2122,7 @@ static void test_HlinkClone(void) cloned = (IHlink*)0xdeadbeef; hres = HlinkClone(hl, &IID_IHlink, NULL, 0, (void**)&cloned); /* fails because of invalid CLSID given by Moniker_GetClassID */ - ok(hres == REGDB_E_CLASSNOTREG, "Wrong error code: %08x\n", hres); + ok(hres == REGDB_E_CLASSNOTREG, "Wrong error code: %08lx\n", hres); ok(cloned == NULL, "Shouldn't have gotten a clone\n"); CHECK_CALLED(Save); CHECK_CALLED(GetClassID); @@ -2130,15 +2130,15 @@ static void test_HlinkClone(void) IHlink_Release(hl);
hres = CreateItemMoniker(one, one, &dummy); - ok(hres == S_OK, "CreateItemMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "CreateItemMoniker failed: 0x%08lx\n", hres);
hres = HlinkCreateFromMoniker(dummy, two, name, &HlinkSite, SITEDATA_SUCCESS, NULL, &IID_IHlink, (void**)&hl); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08lx\n", hres); getMonikerRef(hl, dummy, two, HLINKGETREF_RELATIVE);
cloned = NULL; hres = HlinkClone(hl, &IID_IHlink, NULL, 0, (void**)&cloned); - ok(hres == S_OK, "HlinkClone failed: %08x\n", hres); + ok(hres == S_OK, "HlinkClone failed: %08lx\n", hres); ok(cloned != NULL, "Should have gotten a clone\n");
fnd_mk = getMonikerRef(cloned, (IMoniker*)0xFFFFFFFF, two, HLINKGETREF_RELATIVE); @@ -2147,7 +2147,7 @@ static void test_HlinkClone(void)
fnd_name = NULL; hres = IHlink_GetFriendlyName(cloned, HLFNAMEF_DEFAULT, &fnd_name); - ok(hres == S_OK, "GetFriendlyName failed: %08x\n", hres); + ok(hres == S_OK, "GetFriendlyName failed: %08lx\n", hres); ok(fnd_name != NULL, "Expected friendly name to be non-NULL\n"); ok(lstrcmpW(fnd_name, name) == 0, "Expected friendly name to be %s, was %s\n", wine_dbgstr_w(name), wine_dbgstr_w(fnd_name)); @@ -2156,20 +2156,20 @@ static void test_HlinkClone(void) fnd_site = (IHlinkSite*)0xdeadbeef; fnd_data = 4; hres = IHlink_GetHlinkSite(cloned, &fnd_site, &fnd_data); - ok(hres == S_OK, "GetHlinkSite failed: %08x\n", hres); + ok(hres == S_OK, "GetHlinkSite failed: %08lx\n", hres); ok(fnd_site == NULL, "Expected NULL site\n"); - ok(fnd_data == 4, "Expected site data to be 4, was: %d\n", fnd_data); + ok(fnd_data == 4, "Expected site data to be 4, was: %ld\n", fnd_data);
IHlink_Release(cloned); IHlink_Release(hl);
hres = HlinkCreateFromMoniker(dummy, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void**)&hl); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: 0x%08lx\n", hres); getMonikerRef(hl, dummy, NULL, HLINKGETREF_RELATIVE);
cloned = NULL; hres = HlinkClone(hl, &IID_IHlink, &HlinkSite, SITEDATA_SUCCESS, (void**)&cloned); - ok(hres == S_OK, "HlinkClone failed: %08x\n", hres); + ok(hres == S_OK, "HlinkClone failed: %08lx\n", hres); ok(cloned != NULL, "Should have gotten a clone\n");
fnd_mk = getMonikerRef(cloned, (IMoniker*)0xFFFFFFFF, NULL, HLINKGETREF_RELATIVE); @@ -2179,9 +2179,9 @@ static void test_HlinkClone(void) fnd_site = (IHlinkSite*)0xdeadbeef; fnd_data = 4; hres = IHlink_GetHlinkSite(cloned, &fnd_site, &fnd_data); - ok(hres == S_OK, "GetHlinkSite failed: %08x\n", hres); + ok(hres == S_OK, "GetHlinkSite failed: %08lx\n", hres); ok(fnd_site == &HlinkSite, "Expected found site to be HlinkSite, was: %p\n", fnd_site); - ok(fnd_data == SITEDATA_SUCCESS, "Unexpected site data: %u\n", fnd_data); + ok(fnd_data == SITEDATA_SUCCESS, "Unexpected site data: %lu\n", fnd_data);
IHlink_Release(cloned); IHlink_Release(hl); @@ -2199,28 +2199,28 @@ static void test_StdHlink(void)
hres = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IHlink, (void**)&hlink); - ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
str = (void*)0xdeadbeef; hres = IHlink_GetTargetFrameName(hlink, &str); - ok(hres == S_FALSE, "GetTargetFrameName failed: %08x\n", hres); + ok(hres == S_FALSE, "GetTargetFrameName failed: %08lx\n", hres); ok(!str, "str = %s\n", wine_dbgstr_w(str));
hres = IHlink_SetTargetFrameName(hlink, testW); - ok(hres == S_OK, "SetTargetFrameName failed: %08x\n", hres); + ok(hres == S_OK, "SetTargetFrameName failed: %08lx\n", hres);
str = (void*)0xdeadbeef; hres = IHlink_GetTargetFrameName(hlink, &str); - ok(hres == S_OK, "GetTargetFrameName failed: %08x\n", hres); + ok(hres == S_OK, "GetTargetFrameName failed: %08lx\n", hres); ok(!lstrcmpW(str, testW), "str = %s\n", wine_dbgstr_w(str)); CoTaskMemFree(str);
hres = IHlink_SetTargetFrameName(hlink, NULL); - ok(hres == S_OK, "SetTargetFrameName failed: %08x\n", hres); + ok(hres == S_OK, "SetTargetFrameName failed: %08lx\n", hres);
str = (void*)0xdeadbeef; hres = IHlink_GetTargetFrameName(hlink, &str); - ok(hres == S_FALSE, "GetTargetFrameName failed: %08x\n", hres); + ok(hres == S_FALSE, "GetTargetFrameName failed: %08lx\n", hres); ok(!str, "str = %s\n", wine_dbgstr_w(str));
IHlink_Release(hlink); @@ -2235,7 +2235,7 @@ static void test_Hlink_Navigate(void) HRESULT hres;
hres = CreateBindCtx(0, &pbc); - ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres); + ok(hres == S_OK, "CreateBindCtx failed: %08lx\n", hres); _bctx = pbc;
HBC_object = NULL; @@ -2246,7 +2246,7 @@ static void test_Hlink_Navigate(void) SET_EXPECT(GetDisplayName); hres = HlinkCreateFromMoniker(&Moniker, NULL, NULL, NULL, 0, NULL, &IID_IHlink, (void**)&hlink); - ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08x\n", hres); + ok(hres == S_OK, "HlinkCreateFromMoniker failed: %08lx\n", hres); todo_wine CHECK_CALLED(Reduce); todo_wine CHECK_CALLED(Enum); todo_wine CHECK_CALLED(IsSystemMoniker); @@ -2264,7 +2264,7 @@ static void test_Hlink_Navigate(void) SET_EXPECT(HT_Navigate); SET_EXPECT(HT_GetFriendlyName); hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == S_OK, "Navigate failed: %08x\n", hres); + ok(hres == S_OK, "Navigate failed: %08lx\n", hres); CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName); CHECK_CALLED(HBC_GetObject); @@ -2287,7 +2287,7 @@ static void test_Hlink_Navigate(void) SET_EXPECT(HT_Navigate); SET_EXPECT(HT_GetFriendlyName); hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == S_OK, "Navigate failed: %08x\n", hres); + ok(hres == S_OK, "Navigate failed: %08lx\n", hres); CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName); CHECK_CALLED(HBC_GetObject); @@ -2301,13 +2301,13 @@ if (0) { /* these currently open a browser window on wine */ /* Test from string */ SET_EXPECT(HBC_GetObject); hres = HlinkNavigateToStringReference(winehq_404W, NULL, NULL, 0, NULL, 0, pbc, NULL, &HlinkBrowseContext); - todo_wine ok(hres == INET_E_OBJECT_NOT_FOUND, "Expected INET_E_OBJECT_NOT_FOUND, got %08x\n", hres); + todo_wine ok(hres == INET_E_OBJECT_NOT_FOUND, "Expected INET_E_OBJECT_NOT_FOUND, got %08lx\n", hres); CHECK_CALLED(HBC_GetObject);
/* MSDN claims browse context and bind context can't be null, but they can */ SET_EXPECT(HBC_GetObject); hres = HlinkNavigateToStringReference(winehq_404W, NULL, NULL, 0, NULL, 0, NULL, NULL, &HlinkBrowseContext); - todo_wine ok(hres == INET_E_OBJECT_NOT_FOUND, "Expected INET_E_OBJECT_NOT_FOUND, got %08x\n", hres); + todo_wine ok(hres == INET_E_OBJECT_NOT_FOUND, "Expected INET_E_OBJECT_NOT_FOUND, got %08lx\n", hres); CHECK_CALLED(HBC_GetObject); }
@@ -2318,13 +2318,13 @@ if (0) { /* these currently open a browser window on wine */ SET_EXPECT(IsSystemMoniker); SET_EXPECT(GetDisplayName); hres = IHlink_Navigate(hlink, 0, NULL, NULL, NULL); - ok(hres == DRAGDROP_S_DROP, "Expected DRAGDROP_S_DROP, got %08x\n", hres); + ok(hres == DRAGDROP_S_DROP, "Expected DRAGDROP_S_DROP, got %08lx\n", hres); CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName);
/* same, from string */ hres = HlinkNavigateToStringReference(winehq_404W, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL); - ok(hres == DRAGDROP_S_DROP, "Expected DRAGDROP_S_DROP, got %08x\n", hres); + ok(hres == DRAGDROP_S_DROP, "Expected DRAGDROP_S_DROP, got %08lx\n", hres);
/* try basic test with valid URL */ SET_EXPECT(HBC_GetObject); @@ -2333,7 +2333,7 @@ if (0) { /* these currently open a browser window on wine */ SET_EXPECT(HBC_QueryInterface_IdentityUnmarshal); SET_EXPECT(HBC_QueryInterface_IUnknown); hres = HlinkNavigateToStringReference(winehq_urlW, NULL, NULL, 0, NULL, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == S_OK, "Expected S_OK, got %08x\n", hres); + ok(hres == S_OK, "Expected S_OK, got %08lx\n", hres); CHECK_CALLED(HBC_GetObject); todo_wine CHECK_CALLED(HBC_QueryInterface_IHlinkHistory); todo_wine CHECK_CALLED(HBC_QueryInterface_IMarshal); @@ -2360,7 +2360,7 @@ if (0) { /* these currently open a browser window on wine */ SET_EXPECT(HT_GetFriendlyName); SET_EXPECT(BindStatusCallback_OnStopBinding); hres = IHlink_Navigate(hlink, 0, pbc, &BindStatusCallback, &HlinkBrowseContext); - ok(hres == S_OK, "Navigate failed: %#x\n", hres); + ok(hres == S_OK, "Navigate failed: %#lx\n", hres); CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName); CHECK_CALLED(HBC_GetObject); @@ -2385,8 +2385,8 @@ todo_wine { todo_wine CHECK_CALLED(BindStatusCallback_OnStopBinding);
- ok(bind_callback_refs == 1, "Got unexpected refcount %d.\n", bind_callback_refs); - ok(browse_ctx_refs == 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(bind_callback_refs == 1, "Got unexpected refcount %ld.\n", bind_callback_refs); + ok(browse_ctx_refs == 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
/* test asynchronous binding */ async_bind = TRUE; @@ -2396,7 +2396,7 @@ todo_wine { SET_EXPECT(Reduce); SET_EXPECT(BindToObject); hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == MK_S_ASYNCHRONOUS, "Navigate failed: %#x\n", hres); + ok(hres == MK_S_ASYNCHRONOUS, "Navigate failed: %#lx\n", hres); CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName); CHECK_CALLED(HBC_GetObject); @@ -2404,16 +2404,16 @@ todo_wine { CHECK_CALLED(Reduce); CHECK_CALLED(BindToObject);
- ok(browse_ctx_refs > 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(browse_ctx_refs > 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == E_UNEXPECTED, "Got hr %#x.\n", hres); + ok(hres == E_UNEXPECTED, "Got hr %#lx.\n", hres);
hres = IBindStatusCallback_GetBindInfo(async_bind_callback, &bind_flags, &bind_info); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres);
hres = IBindStatusCallback_OnStartBinding(async_bind_callback, 0, NULL); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres);
SET_EXPECT(HT_QueryInterface_IHlinkTarget); SET_EXPECT(HT_GetBrowseContext); @@ -2423,7 +2423,7 @@ todo_wine { SET_EXPECT(HT_GetFriendlyName); hres = IBindStatusCallback_OnObjectAvailable(async_bind_callback, &IID_IUnknown, (IUnknown *)&HlinkTarget); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres); CHECK_CALLED(HT_QueryInterface_IHlinkTarget); todo_wine CHECK_CALLED(HT_GetBrowseContext); @@ -2435,14 +2435,14 @@ todo_wine { CHECK_CALLED(HT_GetFriendlyName);
hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == E_UNEXPECTED, "Got hr %#x.\n", hres); + ok(hres == E_UNEXPECTED, "Got hr %#lx.\n", hres);
- ok(browse_ctx_refs > 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(browse_ctx_refs > 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
hres = IBindStatusCallback_OnStopBinding(async_bind_callback, S_OK, NULL); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres);
- ok(browse_ctx_refs == 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(browse_ctx_refs == 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
IBindStatusCallback_Release(async_bind_callback);
@@ -2453,7 +2453,7 @@ todo_wine { SET_EXPECT(Reduce); SET_EXPECT(BindToObject); hres = IHlink_Navigate(hlink, 0, pbc, &BindStatusCallback, &HlinkBrowseContext); - ok(hres == MK_S_ASYNCHRONOUS, "Navigate failed: %#x\n", hres); + ok(hres == MK_S_ASYNCHRONOUS, "Navigate failed: %#lx\n", hres); CHECK_CALLED(IsSystemMoniker); CHECK_CALLED(GetDisplayName); todo_wine @@ -2463,20 +2463,20 @@ todo_wine { CHECK_CALLED(Reduce); CHECK_CALLED(BindToObject);
- ok(bind_callback_refs > 1, "Got unexpected refcount %d.\n", bind_callback_refs); - ok(browse_ctx_refs > 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(bind_callback_refs > 1, "Got unexpected refcount %ld.\n", bind_callback_refs); + ok(browse_ctx_refs > 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == E_UNEXPECTED, "Got hr %#x.\n", hres); + ok(hres == E_UNEXPECTED, "Got hr %#lx.\n", hres);
SET_EXPECT(BindStatusCallback_GetBindInfo); hres = IBindStatusCallback_GetBindInfo(async_bind_callback, &bind_flags, &bind_info); - ok(hres == E_NOTIMPL, "Got hr %#x.\n", hres); + ok(hres == E_NOTIMPL, "Got hr %#lx.\n", hres); CHECK_CALLED(BindStatusCallback_GetBindInfo);
SET_EXPECT(BindStatusCallback_OnStartBinding); hres = IBindStatusCallback_OnStartBinding(async_bind_callback, 0, NULL); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres); CHECK_CALLED(BindStatusCallback_OnStartBinding);
SET_EXPECT(BindStatusCallback_OnObjectAvailable); @@ -2488,7 +2488,7 @@ todo_wine { SET_EXPECT(HT_GetFriendlyName); hres = IBindStatusCallback_OnObjectAvailable(async_bind_callback, &IID_IUnknown, (IUnknown *)&HlinkTarget); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres); CHECK_CALLED(BindStatusCallback_OnObjectAvailable); CHECK_CALLED(HT_QueryInterface_IHlinkTarget); todo_wine @@ -2501,18 +2501,18 @@ todo_wine { CHECK_CALLED(HT_GetFriendlyName);
hres = IHlink_Navigate(hlink, 0, pbc, NULL, &HlinkBrowseContext); - ok(hres == E_UNEXPECTED, "Got hr %#x.\n", hres); + ok(hres == E_UNEXPECTED, "Got hr %#lx.\n", hres);
- ok(bind_callback_refs > 1, "Got unexpected refcount %d.\n", bind_callback_refs); - ok(browse_ctx_refs > 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(bind_callback_refs > 1, "Got unexpected refcount %ld.\n", bind_callback_refs); + ok(browse_ctx_refs > 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
SET_EXPECT(BindStatusCallback_OnStopBinding); hres = IBindStatusCallback_OnStopBinding(async_bind_callback, S_OK, NULL); - ok(hres == S_OK, "Got hr %#x.\n", hres); + ok(hres == S_OK, "Got hr %#lx.\n", hres); CHECK_CALLED(BindStatusCallback_OnStopBinding);
- ok(bind_callback_refs == 1, "Got unexpected refcount %d.\n", bind_callback_refs); - ok(browse_ctx_refs == 1, "Got unexpected refcount %d.\n", browse_ctx_refs); + ok(bind_callback_refs == 1, "Got unexpected refcount %ld.\n", bind_callback_refs); + ok(browse_ctx_refs == 1, "Got unexpected refcount %ld.\n", browse_ctx_refs);
IBindStatusCallback_Release(async_bind_callback);
@@ -2594,16 +2594,16 @@ static void test_HlinkUpdateStackItem(void) HRESULT hr;
hr = HlinkUpdateStackItem(NULL, NULL, HLID_CURRENT, &Moniker, location, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
SET_EXPECT(HBC_UpdateHlink); hr = HlinkUpdateStackItem(NULL, &HlinkBrowseContext, HLID_CURRENT, &Moniker, location, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); CHECK_CALLED(HBC_UpdateHlink);
SET_EXPECT(HLF_UpdateHlink); hr = HlinkUpdateStackItem(&testframe, &HlinkBrowseContext, HLID_CURRENT, &Moniker, location, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); CHECK_CALLED(HLF_UpdateHlink); }
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/hnetcfg/tests/Makefile.in | 1 dlls/hnetcfg/tests/policy.c | 102 ++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 52 deletions(-)
diff --git a/dlls/hnetcfg/tests/Makefile.in b/dlls/hnetcfg/tests/Makefile.in index c02bef9ea54..922370ae5e3 100644 --- a/dlls/hnetcfg/tests/Makefile.in +++ b/dlls/hnetcfg/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = hnetcfg.dll IMPORTS = ole32 uuid oleaut32 advapi32 mpr
diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c index 3b614e6e05a..4a50bf6d23b 100644 --- a/dlls/hnetcfg/tests/policy.c +++ b/dlls/hnetcfg/tests/policy.c @@ -42,23 +42,23 @@ static void test_policy2_rules(INetFwPolicy2 *policy2) INetFwServiceRestriction *restriction;
hr = INetFwPolicy2_QueryInterface(policy2, &IID_INetFwRules, (void**)&rules); - ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = INetFwPolicy2_get_Rules(policy2, &rules); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
hr = INetFwPolicy2_get_Rules(policy2, &rules2); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(rules == rules2, "Different pointers\n");
hr = INetFwPolicy2_get_ServiceRestriction(policy2, &restriction); - todo_wine ok(hr == S_OK, "got %08x\n", hr); + todo_wine ok(hr == S_OK, "got %08lx\n", hr); if(hr == S_OK) { INetFwRules *rules3;
hr = INetFwServiceRestriction_get_Rules(restriction, &rules3); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(rules != rules3, "same pointers\n");
if(rules3) @@ -67,7 +67,7 @@ static void test_policy2_rules(INetFwPolicy2 *policy2) }
hr = INetFwRules_get__NewEnum(rules, NULL); - ok(hr == E_POINTER, "got %08x\n", hr); + ok(hr == E_POINTER, "got %08lx\n", hr);
INetFwRules_Release(rules); INetFwRules_Release(rules2); @@ -82,19 +82,19 @@ static void test_interfaces(void)
hr = CoCreateInstance(&CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_INetFwMgr, (void**)&manager); - ok(hr == S_OK, "NetFwMgr create failed: %08x\n", hr); + ok(hr == S_OK, "NetFwMgr create failed: %08lx\n", hr);
hr = INetFwMgr_QueryInterface(manager, &IID_INetFwPolicy, (void**)&policy); - ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = INetFwMgr_QueryInterface(manager, &IID_INetFwPolicy2, (void**)&policy2); - ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = INetFwMgr_get_LocalPolicy(manager, &policy); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = INetFwPolicy_QueryInterface(policy, &IID_INetFwPolicy2, (void**)&policy2); - ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
INetFwPolicy_Release(policy);
@@ -107,7 +107,7 @@ static void test_interfaces(void) INetFwPolicy2_Release(policy2); } else - win_skip("NetFwPolicy2 object is not supported: %08x\n", hr); + win_skip("NetFwPolicy2 object is not supported: %08lx\n", hr);
INetFwMgr_Release(manager); } @@ -126,27 +126,27 @@ static void test_NetFwAuthorizedApplication(void)
hr = CoCreateInstance(&CLSID_NetFwAuthorizedApplication, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_INetFwAuthorizedApplication, (void**)&app); - ok(hr == S_OK, "got: %08x\n", hr); + ok(hr == S_OK, "got: %08lx\n", hr);
hr = GetModuleFileNameW(NULL, image, ARRAY_SIZE(image)); - ok(hr, "GetModuleFileName failed: %u\n", GetLastError()); + ok(hr, "GetModuleFileName failed: %lu\n", GetLastError());
hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, NULL); - ok(hr == E_POINTER, "got: %08x\n", hr); + ok(hr == E_POINTER, "got: %08lx\n", hr);
hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr); - ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY), "got: %08x\n", hr); + ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY), "got: %08lx\n", hr); ok(!bstr, "got: %s\n", wine_dbgstr_w(bstr));
hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, NULL); - ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "got: %08x\n", hr); + ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "got: %08lx\n", hr);
hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, empty); - ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "got: %08x\n", hr); + ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "got: %08lx\n", hr);
bstr = SysAllocString(image); hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, bstr); - ok(hr == S_OK, "got: %08x\n", hr); + ok(hr == S_OK, "got: %08lx\n", hr); SysFreeString(bstr);
GetFullPathNameW(image, ARRAY_SIZE(fullpath), fullpath, NULL); @@ -162,7 +162,7 @@ static void test_NetFwAuthorizedApplication(void) }
hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr); - ok(hr == S_OK, "got: %08x\n", hr); + ok(hr == S_OK, "got: %08lx\n", hr); ok(!lstrcmpW(bstr,info->lpUniversalName), "expected %s, got %s\n", wine_dbgstr_w(info->lpUniversalName), wine_dbgstr_w(bstr)); SysFreeString(bstr); @@ -184,21 +184,21 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p
refcount = get_refcount((IUnknown *)ports); hr = IStaticPortMappingCollection_get__NewEnum(ports, &unk); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IEnumVARIANT, (void **)&enum_ports); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); IUnknown_Release( unk );
refcount2 = get_refcount((IUnknown *)ports); - ok(refcount2 == refcount, "Got unexpected refcount %u, refcount2 %u.\n", refcount, refcount2); + ok(refcount2 == refcount, "Got unexpected refcount %lu, refcount2 %lu.\n", refcount, refcount2);
hr = IEnumVARIANT_Reset(enum_ports); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
count = 0xdeadbeef; hr = IStaticPortMappingCollection_get_Count(ports, &count); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Item(ports, 12345, (BSTR)L"UDP", &pm); if (SUCCEEDED(hr)) @@ -213,35 +213,35 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p
hr = IStaticPortMappingCollection_Add(ports, 12345, (BSTR)L"udp", 12345, (BSTR)L"1.2.3.4", VARIANT_TRUE, (BSTR)L"wine_test", &pm); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); hr = IStaticPortMappingCollection_Add(ports, 12345, (BSTR)L"UDP", 12345, (BSTR)L"1.2.3.4", VARIANT_TRUE, (BSTR)L"wine_test", &pm); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Count(ports, &count2); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - ok(count2 == expected_count, "Got unexpected count2 %u, expected %u.\n", count2, expected_count); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(count2 == expected_count, "Got unexpected count2 %lu, expected %lu.\n", count2, expected_count);
hr = IStaticPortMappingCollection_get_Item(ports, 12345, NULL, &pm); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Item(ports, 12345, (BSTR)L"UDP", NULL); - ok(hr == E_POINTER, "Got unexpected hr %#x.\n", hr); + ok(hr == E_POINTER, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Item(ports, 12345, (BSTR)L"udp", &pm); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Item(ports, -1, (BSTR)L"UDP", &pm); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Item(ports, 65536, (BSTR)L"UDP", &pm); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_get_Item(ports, 12346, (BSTR)L"UDP", &pm); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#x.\n", hr); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
hr = IEnumVARIANT_Reset(enum_ports); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
for (i = 0; i < count2; ++i) { @@ -249,23 +249,23 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p
fetched = 0xdeadbeef; hr = IEnumVARIANT_Next(enum_ports, 1, &var, &fetched); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - ok(fetched == 1, "Got unexpected fetched %u.\n", fetched); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ok(fetched == 1, "Got unexpected fetched %lu.\n", fetched); ok(V_VT(&var) == VT_DISPATCH, "Got unexpected variant type %u.\n", V_VT(&var));
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IStaticPortMapping, (void **)&pm); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMapping_get_Protocol(pm, &protocol); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); external_port = 0xdeadbeef; hr = IStaticPortMapping_get_ExternalPort(pm, &external_port); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!wcscmp(protocol, L"UDP") || !wcscmp(protocol, L"TCP"), "Got unexpected protocol %s.\n", debugstr_w(protocol)); hr = IStaticPortMappingCollection_get_Item(ports, external_port, protocol, &pm2); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(pm2 != pm, "Got same interface.\n");
IStaticPortMapping_Release(pm); @@ -276,10 +276,10 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p VariantClear(&var); } hr = IEnumVARIANT_Next(enum_ports, 1, &var, &fetched); - ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
hr = IStaticPortMappingCollection_Remove(ports, 12345, (BSTR)L"UDP"); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
IEnumVARIANT_Release(enum_ports); } @@ -295,19 +295,19 @@ static void test_IUPnPNAT(void) HRESULT hr;
hr = CoCreateInstance(&CLSID_UPnPNAT, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUPnPNAT, (void**)&nat); - ok(hr == S_OK, "got: %08x\n", hr); + ok(hr == S_OK, "got: %08lx\n", hr);
hr = IUPnPNAT_QueryInterface(nat, &IID_IProvideClassInfo, (void**)&provider); - ok(hr == E_NOINTERFACE, "got: %08x\n", hr); + ok(hr == E_NOINTERFACE, "got: %08lx\n", hr);
refcount = get_refcount((IUnknown *)nat); hr = IUPnPNAT_get_StaticPortMappingCollection(nat, &static_ports);
- ok(hr == S_OK, "got: %08x\n", hr); + ok(hr == S_OK, "got: %08lx\n", hr); if(hr == S_OK && static_ports) { refcount2 = get_refcount((IUnknown *)nat); - ok(refcount2 == refcount, "Got unexpected refcount %u, refcount2 %u.\n", refcount, refcount2); + ok(refcount2 == refcount, "Got unexpected refcount %lu, refcount2 %lu.\n", refcount, refcount2); test_static_port_mapping_collection( static_ports ); IStaticPortMappingCollection_Release(static_ports); } @@ -316,12 +316,12 @@ static void test_IUPnPNAT(void) skip( "UPNP gateway not found.\n" ); } hr = IUPnPNAT_get_DynamicPortMappingCollection(nat, &dync_ports); - ok(hr == S_OK || hr == E_NOTIMPL /* Windows 8.1 */, "got: %08x\n", hr); + ok(hr == S_OK || hr == E_NOTIMPL /* Windows 8.1 */, "got: %08lx\n", hr); if(hr == S_OK && dync_ports) IDynamicPortMappingCollection_Release(dync_ports);
hr = IUPnPNAT_get_NATEventManager(nat, &manager); - todo_wine ok(hr == S_OK, "got: %08x\n", hr); + todo_wine ok(hr == S_OK, "got: %08lx\n", hr); if(hr == S_OK && manager) INATEventManager_Release(manager);
@@ -339,7 +339,7 @@ START_TEST(policy) &IID_INetFwMgr, (void**)&manager); if(FAILED(hr)) { - win_skip("NetFwMgr object is not supported: %08x\n", hr); + win_skip("NetFwMgr object is not supported: %08lx\n", hr); CoUninitialize(); return; }
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/httpapi/tests/Makefile.in | 1 dlls/httpapi/tests/httpapi.c | 528 ++++++++++++++++++++-------------------- 2 files changed, 265 insertions(+), 264 deletions(-)
diff --git a/dlls/httpapi/tests/Makefile.in b/dlls/httpapi/tests/Makefile.in index 7a078277448..20210a34510 100644 --- a/dlls/httpapi/tests/Makefile.in +++ b/dlls/httpapi/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = httpapi.dll IMPORTS = httpapi ws2_32
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c index b0431b0f3fd..78180822f03 100644 --- a/dlls/httpapi/tests/httpapi.c +++ b/dlls/httpapi/tests/httpapi.c @@ -77,7 +77,7 @@ static SOCKET create_client_socket(unsigned short port) }; SOCKET s = socket(AF_INET, SOCK_STREAM, 0), ret; ret = connect(s, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); - ok(!ret, "Failed to connect socket, error %u.\n", GetLastError()); + ok(!ret, "Failed to connect socket, error %lu.\n", GetLastError()); return s; }
@@ -108,9 +108,9 @@ static unsigned short add_url_v1(HANDLE queue) swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port); if (!(ret = HttpAddUrl(queue, url, NULL))) return port; - ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %u.\n", debugstr_w(url), ret); + ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %lu.\n", debugstr_w(url), ret); } - ok(0, "Failed to add url %s, error %u.\n", debugstr_w(url), ret); + ok(0, "Failed to add url %s, error %lu.\n", debugstr_w(url), ret); return 0; }
@@ -125,9 +125,9 @@ static ULONG add_url_v2(HTTP_URL_GROUP_ID group) swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port); if (!(ret = pHttpAddUrlToUrlGroup(group, url, 0xdeadbeef, 0))) return port; - ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %u.\n", debugstr_w(url), ret); + ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %lu.\n", debugstr_w(url), ret); } - ok(0, "Failed to add url %s, error %u.\n", debugstr_w(url), ret); + ok(0, "Failed to add url %s, error %lu.\n", debugstr_w(url), ret); return 0; }
@@ -158,62 +158,62 @@ static void test_v1_server(void) OVERLAPPED ovl; DWORD ret_size; WCHAR url[50]; + int len, got; ULONG ret; SOCKET s; - int len;
ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL); memset(req_buffer, 0xcc, sizeof(req_buffer));
ret = HttpCreateHttpHandle(NULL, 0); - ok(ret == ERROR_INVALID_PARAMETER, "Unexpected error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected error %lu.\n", ret);
/* Non-zero reserved parameter is accepted on XP/2k3. */ queue = NULL; ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Unexpected ret value %u.\n", ret); + ok(!ret, "Unexpected ret value %lu.\n", ret); ok(!!queue, "Unexpected handle value %p.\n", queue);
queue2 = NULL; ret = HttpCreateHttpHandle(&queue2, 0); - ok(!ret, "Unexpected ret value %u.\n", ret); + ok(!ret, "Unexpected ret value %lu.\n", ret); ok(queue2 && queue2 != queue, "Unexpected handle %p.\n", queue2); ret = CloseHandle(queue2); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError());
ret_size = 0xdeadbeef; ret = HttpReceiveHttpRequest(NULL, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(ret == ERROR_INVALID_HANDLE, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(NULL, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_INVALID_HANDLE, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, 0xdeadbeef, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
SetLastError(0xdeadbeef); ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %lu.\n", GetLastError());
ret = HttpAddUrl(NULL, L"http://localhost:50000/", NULL); - ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_INVALID_PARAMETER /* < Vista */, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_INVALID_PARAMETER /* < Vista */, "Got error %lu.\n", ret); ret = HttpAddUrl(queue, L"http://localhost:50000", NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = HttpAddUrl(queue, L"localhost:50000", NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = HttpAddUrl(queue, L"localhost:50000/", NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = HttpAddUrl(queue, L"http://localhost/", NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = HttpAddUrl(queue, L"http://localhost:/", NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = HttpAddUrl(queue, L"http://localhost:0/", NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); port = add_url_v1(queue); swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port); ret = HttpAddUrl(queue, url, NULL); - ok(ret == ERROR_ALREADY_EXISTS, "Got error %u.\n", ret); + ok(ret == ERROR_ALREADY_EXISTS, "Got error %lu.\n", ret);
s = create_client_socket(port); len = sizeof(sockaddr); @@ -223,15 +223,15 @@ static void test_v1_server(void) SetLastError(0xdeadbeef); ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %lu.\n", GetLastError());
sprintf(req_text, simple_req, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret = GetOverlappedResult(queue, &ovl, &ret_size, TRUE); - ok(ret, "Got error %u.\n", GetLastError()); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(ret, "Got error %lu.\n", GetLastError()); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
/* Various versions of Windows (observed on 64-bit Windows 8 and Windows 10 * version 1507, but probably affecting others) suffer from a bug where the @@ -240,7 +240,7 @@ static void test_v1_server(void) * around this. */ Sleep(100);
- ok(!req->Flags, "Got flags %#x.\n", req->Flags); + ok(!req->Flags, "Got flags %#lx.\n", req->Flags); ok(req->ConnectionId, "Expected nonzero connection ID.\n"); ok(req->RequestId, "Expected nonzero connection ID.\n"); ok(!req->UrlContext, "Got URL context %s.\n", wine_dbgstr_longlong(req->UrlContext)); @@ -265,7 +265,7 @@ static void test_v1_server(void) sin = (SOCKADDR_IN *)req->Address.pLocalAddress; ok(sin->sin_family == AF_INET, "Got family %u.\n", sin->sin_family); ok(ntohs(sin->sin_port) == port, "Got wrong port %u.\n", ntohs(sin->sin_port)); - ok(sin->sin_addr.S_un.S_addr == inet_addr("127.0.0.1"), "Got address %08x.\n", sin->sin_addr.S_un.S_addr); + ok(sin->sin_addr.S_un.S_addr == inet_addr("127.0.0.1"), "Got address %08lx.\n", sin->sin_addr.S_un.S_addr); ok(!req->Headers.UnknownHeaderCount, "Got %u unknown headers.\n", req->Headers.UnknownHeaderCount); ok(!req->Headers.pUnknownHeaders, "Got unknown headers %p.\n", req->Headers.pUnknownHeaders); for (i = 0; i < ARRAY_SIZE(req->Headers.KnownHeaders); ++i) @@ -313,57 +313,57 @@ static void test_v1_server(void) response.Headers.KnownHeaders[HttpHeaderRetryAfter].pRawValue = "120"; response.Headers.KnownHeaders[HttpHeaderRetryAfter].RawValueLength = 3; ret = HttpSendHttpResponse(queue, 0xdeadbeef, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl, NULL); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret); ret = HttpSendHttpResponse(queue, req->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); - ok(ret, "Got error %u.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError());
- ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret == ret_size, "Expected size %u, got %u.\n", ret_size, ret); + got = recv(s, response_buffer, sizeof(response_buffer), 0); + ok(got == ret_size, "Expected size %lu, got %u.\n", ret_size, got);
if (winetest_debug > 1) - trace("%.*s\n", ret, response_buffer); + trace("%.*s\n", got, response_buffer);
ok(!strncmp(response_buffer, "HTTP/1.1 418 I'm a teapot\r\n", 27), "Got incorrect status line.\n"); ok(!!strstr(response_buffer, "\r\nRetry-After: 120\r\n"), "Missing or malformed Retry-After header.\n"); ok(!!strstr(response_buffer, "\r\nDate:"), "Missing Date header.\n");
ret = HttpReceiveHttpRequest(queue, req->RequestId, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret);
/* HttpReceiveHttpRequest() may return synchronously, but this cannot be * reliably tested. Introducing a delay after send() and before * HttpReceiveHttpRequest() confirms this. */
ret = remove_url_v1(NULL, port); - ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ret = remove_url_v1(queue, port); - ok(ret == ERROR_FILE_NOT_FOUND, "Got error %u.\n", ret); + ok(ret == ERROR_FILE_NOT_FOUND, "Got error %lu.\n", ret);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
ret = CancelIo(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError());
ret = WaitForSingleObject(ovl.hEvent, 100); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret); ret_size = 0xdeadbeef; ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_OPERATION_ABORTED, "Got error %u.\n", GetLastError()); - ok(!ret_size, "Got size %u.\n", ret_size); + ok(GetLastError() == ERROR_OPERATION_ABORTED, "Got error %lu.\n", GetLastError()); + ok(!ret_size, "Got size %lu.\n", ret_size);
closesocket(s); CloseHandle(ovl.hEvent); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError());
ret = HttpAddUrl(queue, L"http://localhost:50000/", NULL); - ok(ret == ERROR_INVALID_HANDLE, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "Got error %lu.\n", ret); }
static void test_v1_completion_port(void) @@ -383,62 +383,62 @@ static void test_v1_completion_port(void) ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
port = CreateIoCompletionPort(queue, NULL, 123, 0); - ok(!!port, "Failed to create completion port, error %u.\n", GetLastError()); + ok(!!port, "Failed to create completion port, error %lu.\n", GetLastError());
ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 0); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "Got error %lu.\n", GetLastError());
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
tcp_port = add_url_v1(queue); s = create_client_socket(tcp_port);
ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 0); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "Got error %lu.\n", GetLastError());
sprintf(req_text, simple_req, tcp_port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret_size = key = 0xdeadbeef; ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 1000); - ok(ret, "Got error %u.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError()); ok(povl == &ovl, "OVERLAPPED pointers didn't match.\n"); - ok(key == 123, "Got unexpected key %lu.\n", key); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(key == 123, "Got unexpected key %Iu.\n", key); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 0); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "Got error %lu.\n", GetLastError());
response.StatusCode = 418; response.pReason = "I'm a teapot"; response.ReasonLength = 12; ret = HttpSendHttpResponse(queue, req->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
ret_size = key = 0xdeadbeef; ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 1000); - ok(ret, "Got error %u.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError()); ok(povl == &ovl, "OVERLAPPED pointers didn't match.\n"); - ok(key == 123, "Got unexpected key %lu.\n", key); + ok(key == 123, "Got unexpected key %Iu.\n", key);
ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret == ret_size, "Expected size %u, got %u.\n", ret_size, ret); + ok(ret == ret_size, "Expected size %lu, got %lu.\n", ret_size, ret);
ret = remove_url_v1(queue, tcp_port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); CloseHandle(port); CloseHandle(ovl.hEvent); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_multiple_requests(void) @@ -461,37 +461,37 @@ static void test_v1_multiple_requests(void) ovl2.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); port = add_url_v1(queue);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req1, sizeof(req_buffer1), NULL, &ovl1); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req2, sizeof(req_buffer2), NULL, &ovl2); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
SetLastError(0xdeadbeef); ret = GetOverlappedResult(queue, &ovl1, &ret_size, FALSE); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %lu.\n", GetLastError());
s1 = create_client_socket(port); sprintf(req_text, simple_req, port); ret = send(s1, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret = WaitForSingleObject(ovl1.hEvent, 100); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret); ret = WaitForSingleObject(ovl2.hEvent, 100); - ok(ret == WAIT_TIMEOUT, "Got %u.\n", ret); + ok(ret == WAIT_TIMEOUT, "Got %lu.\n", ret);
s2 = create_client_socket(port); ret = send(s2, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret = WaitForSingleObject(ovl1.hEvent, 0); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret); ret = WaitForSingleObject(ovl2.hEvent, 100); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret);
len = sizeof(sockaddr); getsockname(s1, (struct sockaddr *)&sockaddr, &len); @@ -508,44 +508,44 @@ static void test_v1_multiple_requests(void) response.pReason = "I'm a teapot"; response.ReasonLength = 12; ret = HttpSendHttpResponse(queue, req1->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl1, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ret = HttpSendHttpResponse(queue, req2->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl2, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
/* Test sending multiple requests from the same socket. */
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req1, sizeof(req_buffer1), NULL, &ovl1); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req2, sizeof(req_buffer2), NULL, &ovl2); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
ret = send(s1, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret); ret = send(s1, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret = WaitForSingleObject(ovl1.hEvent, 100); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret); ret = WaitForSingleObject(ovl2.hEvent, 100); - ok(ret == WAIT_TIMEOUT, "Got %u.\n", ret); + ok(ret == WAIT_TIMEOUT, "Got %lu.\n", ret);
ret = HttpSendHttpResponse(queue, req1->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl1, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
ret = WaitForSingleObject(ovl2.hEvent, 100); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret); ok(req1->ConnectionId == req2->ConnectionId, "Expected same connection IDs.\n"); ok(req1->RequestId != req2->RequestId, "Expected different request IDs, but got %s.\n", wine_dbgstr_longlong(req1->RequestId));
ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s1); closesocket(s2); CloseHandle(ovl1.hEvent); CloseHandle(ovl2.hEvent); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_short_buffer(void) @@ -565,20 +565,20 @@ static void test_v1_short_buffer(void) ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); port = add_url_v1(queue);
s = create_client_socket(port); sprintf(req_text, simple_req, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(HTTP_REQUEST_V1) - 1, &ret_size, NULL); - ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got error %u.\n", ret); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(HTTP_REQUEST_V1), &ret_size, NULL); - ok(ret == ERROR_MORE_DATA, "Got error %u.\n", ret); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(ret == ERROR_MORE_DATA, "Got error %lu.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size); ok(!!req->ConnectionId, "Got connection ID %s.\n", wine_dbgstr_longlong(req->ConnectionId)); ok(!!req->RequestId, "Got request ID %s.\n", wine_dbgstr_longlong(req->RequestId)); ok(!req->Version.MajorVersion || req->Version.MajorVersion == 0xcccc /* < Vista */, @@ -589,26 +589,26 @@ static void test_v1_short_buffer(void) /* At this point the request has been assigned a specific ID, and one cannot * receive it by calling with HTTP_NULL_ID. */ ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req2, sizeof(req_buffer2), NULL, &ovl); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
req_id = req->RequestId; memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, req_id, 0, (HTTP_REQUEST *)req, ret_size - 1, &ret_size, NULL); - ok(ret == ERROR_MORE_DATA, "Got error %u.\n", ret); + ok(ret == ERROR_MORE_DATA, "Got error %lu.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, req_id, 0, (HTTP_REQUEST *)req, ret_size, &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ok(req->RequestId == req_id, "Got request ID %s.\n", wine_dbgstr_longlong(req->RequestId));
CancelIo(queue);
ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); CloseHandle(ovl.hEvent); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_entity_body(void) @@ -625,6 +625,7 @@ static void test_v1_entity_body(void) DWORD ret_size; HANDLE queue; SOCKET s; + int got;
static const char post_req[] = "POST /xyzzy HTTP/1.1\r\n" @@ -647,13 +648,13 @@ static void test_v1_entity_body(void) req_body[i] = i / 111;
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); port = add_url_v1(queue);
s = create_client_socket(port); sprintf(req_text, post_req, port); ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); /* Windows versions before 8 will return success, and report that an entity * body exists in the Flags member, but fail to account for it in the * BytesReceived member or actually copy it to the buffer, if @@ -663,9 +664,9 @@ static void test_v1_entity_body(void)
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); - ok(req->Flags == HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS, "Got flags %#x.\n", req->Flags); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size); + ok(req->Flags == HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS, "Got flags %#lx.\n", req->Flags); ok(req->BytesReceived == strlen(req_text) + 1, "Got %s bytes.\n", wine_dbgstr_longlong(req->BytesReceived)); ok(req->Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength == 1, "Got header length %u.\n", req->Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength); @@ -686,42 +687,42 @@ static void test_v1_entity_body(void) chunks[1].FromMemory.pBuffer = (void *)"pang"; chunks[1].FromMemory.BufferLength = 4; ret = HttpSendHttpResponse(queue, req->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, NULL, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
memset(response_buffer, 0, sizeof(response_buffer));
- ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret > 0, "recv() failed.\n"); + got = recv(s, response_buffer, sizeof(response_buffer), 0); + ok(got > 0, "recv() failed.\n"); if (winetest_debug > 1) - trace("%.*s\n", ret, response_buffer); + trace("%.*s\n", got, response_buffer); ok(!strncmp(response_buffer, "HTTP/1.1 418 I'm a teapot\r\n", 27), "Got incorrect status line.\n"); ok(!!strstr(response_buffer, "\r\nContent-Length: 8\r\n"), "Missing or malformed Content-Length header.\n"); ok(!!strstr(response_buffer, "\r\nDate:"), "Missing Date header.\n"); ok(!memcmp(response_buffer + ret - 12, "\r\n\r\npongpang", 12), "Response did not end with entity data.\n");
ret = HttpReceiveHttpRequest(queue, req->RequestId, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret);
/* http won't overwrite a Content-Length header if we manually supply one, * but it also won't truncate the entity body to match. It will however * always write its own Date header. */
ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
response.Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength = 1; response.Headers.KnownHeaders[HttpHeaderContentLength].pRawValue = "6"; response.Headers.KnownHeaders[HttpHeaderDate].RawValueLength = 10; response.Headers.KnownHeaders[HttpHeaderDate].pRawValue = "yesteryear"; ret = HttpSendHttpResponse(queue, req->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, NULL, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
- ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret > 0, "recv() failed.\n"); + got = recv(s, response_buffer, sizeof(response_buffer), 0); + ok(got > 0, "recv() failed.\n"); if (winetest_debug > 1) - trace("%.*s\n", ret, response_buffer); + trace("%.*s\n", got, response_buffer); ok(!strncmp(response_buffer, "HTTP/1.1 418 I'm a teapot\r\n", 27), "Got incorrect status line.\n"); ok(!!strstr(response_buffer, "\r\nContent-Length: 6\r\n"), "Missing or malformed Content-Length header.\n"); ok(!!strstr(response_buffer, "\r\nDate:"), "Missing Date header.\n"); @@ -731,14 +732,14 @@ static void test_v1_entity_body(void) /* Test the COPY_BODY flag. */
ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); - ok(!req->Flags, "Got flags %#x.\n", req->Flags); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size); + ok(!req->Flags, "Got flags %#lx.\n", req->Flags); ok(req->BytesReceived == strlen(req_text) + 1, "Got %s bytes.\n", wine_dbgstr_longlong(req->BytesReceived)); ok(req->Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength == 1, "Got header length %u.\n", req->Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength); @@ -748,7 +749,7 @@ static void test_v1_entity_body(void) ok(req->pEntityChunks[0].DataChunkType == HttpDataChunkFromMemory, "Got chunk type %u.\n", req->pEntityChunks[0].DataChunkType); ok(req->pEntityChunks[0].FromMemory.BufferLength == 5, - "Got chunk length %u.\n", req->pEntityChunks[0].FromMemory.BufferLength); + "Got chunk length %lu.\n", req->pEntityChunks[0].FromMemory.BufferLength); ok(!memcmp(req->pEntityChunks[0].FromMemory.pBuffer, "ping", 5), "Got chunk data '%s'.\n", (char *)req->pEntityChunks[0].FromMemory.pBuffer);
@@ -756,17 +757,17 @@ static void test_v1_entity_body(void)
sprintf(req_text, post_req2, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret); ret = send(s, req_body, sizeof(req_body), 0); - ok(ret == sizeof(req_body), "send() returned %d.\n", ret); + ok(ret == sizeof(req_body), "send() returned %ld.\n", ret);
Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY, (HTTP_REQUEST *)req, 2000, &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size == 2000, "Got size %u.\n", ret_size); - ok(req->Flags == HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS, "Got flags %#x.\n", req->Flags); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size == 2000, "Got size %lu.\n", ret_size); + ok(req->Flags == HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS, "Got flags %#lx.\n", req->Flags); ok(req->BytesReceived == strlen(req_text) + 2048, "Got %s bytes.\n", wine_dbgstr_longlong(req->BytesReceived)); ok(req->Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength == 4, "Got header length %u.\n", req->Headers.KnownHeaders[HttpHeaderContentLength].RawValueLength); @@ -776,7 +777,7 @@ static void test_v1_entity_body(void) ok(req->pEntityChunks[0].DataChunkType == HttpDataChunkFromMemory, "Got chunk type %u.\n", req->pEntityChunks[0].DataChunkType); chunk_size = req->pEntityChunks[0].FromMemory.BufferLength; - ok(chunk_size > 0 && chunk_size < 2000, "Got chunk size %u.\n", chunk_size); + ok(chunk_size > 0 && chunk_size < 2000, "Got chunk size %lu.\n", chunk_size); ok(!memcmp(req->pEntityChunks[0].FromMemory.pBuffer, req_body, chunk_size), "Chunk data didn't match.\n");
send_response_v1(queue, req->RequestId, s); @@ -785,128 +786,128 @@ static void test_v1_entity_body(void)
ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(NULL, HTTP_NULL_ID, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(ret == ERROR_INVALID_HANDLE, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "Got error %lu.\n", ret); ret = HttpReceiveRequestEntityBody(NULL, HTTP_NULL_ID, 0, recv_body, sizeof(recv_body), NULL, &ovl); - ok(ret == ERROR_INVALID_HANDLE, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "Got error %lu.\n", ret);
sprintf(req_text, post_req, port); ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
ret = HttpReceiveRequestEntityBody(queue, HTTP_NULL_ID, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret);
ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size == 5, "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size == 5, "Got size %lu.\n", ret_size); ok(!memcmp(recv_body, "ping", 5), "Entity body didn't match.\n");
ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(ret == ERROR_HANDLE_EOF, "Got error %u.\n", ret); - ok(ret_size == 0xdeadbeef || !ret_size /* Win10+ */, "Got size %u.\n", ret_size); + ok(ret == ERROR_HANDLE_EOF, "Got error %lu.\n", ret); + ok(ret_size == 0xdeadbeef || !ret_size /* Win10+ */, "Got size %lu.\n", ret_size);
send_response_v1(queue, req->RequestId, s);
ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret);
ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
memset(recv_body, 0xcc, sizeof(recv_body)); ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, 2, &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size == 2, "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size == 2, "Got size %lu.\n", ret_size); ok(!memcmp(recv_body, "pi", 2), "Entity body didn't match.\n");
ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, 4, &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size == 3, "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size == 3, "Got size %lu.\n", ret_size); ok(!memcmp(recv_body, "ng", 3), "Entity body didn't match.\n");
ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(ret == ERROR_HANDLE_EOF, "Got error %u.\n", ret); - ok(ret_size == 0xdeadbeef || !ret_size /* Win10+ */, "Got size %u.\n", ret_size); + ok(ret == ERROR_HANDLE_EOF, "Got error %lu.\n", ret); + ok(ret_size == 0xdeadbeef || !ret_size /* Win10+ */, "Got size %lu.\n", ret_size);
send_response_v1(queue, req->RequestId, s);
ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
memset(recv_body, 0xcc, sizeof(recv_body)); ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), NULL, &ovl); - ok(!ret || ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(!ret || ret == ERROR_IO_PENDING, "Got error %lu.\n", ret); ret = GetOverlappedResult(queue, &ovl, &ret_size, TRUE); - ok(ret, "Got error %u.\n", GetLastError()); - ok(ret_size == 5, "Got size %u.\n", ret_size); + ok(ret, "Got error %lu.\n", GetLastError()); + ok(ret_size == 5, "Got size %lu.\n", ret_size); ok(!memcmp(recv_body, "ping", 5), "Entity body didn't match.\n");
ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), NULL, &ovl); - ok(ret == ERROR_HANDLE_EOF, "Got error %u.\n", ret); + ok(ret == ERROR_HANDLE_EOF, "Got error %lu.\n", ret);
send_response_v1(queue, req->RequestId, s);
ret = send(s, req_text, strlen(req_text) + 1, 0); - ok(ret == strlen(req_text) + 1, "send() returned %d.\n", ret); + ok(ret == strlen(req_text) + 1, "send() returned %ld.\n", ret); Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), NULL, &ovl); - ok(ret == ERROR_HANDLE_EOF, "Got error %u.\n", ret); + ok(ret == ERROR_HANDLE_EOF, "Got error %lu.\n", ret);
send_response_v1(queue, req->RequestId, s);
sprintf(req_text, post_req2, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret); ret = send(s, req_body, sizeof(req_body), 0); - ok(ret == sizeof(req_body), "send() returned %d.\n", ret); + ok(ret == sizeof(req_body), "send() returned %ld.\n", ret);
Sleep(100);
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY, (HTTP_REQUEST *)req, 2000, &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size == 2000, "Got size %u.\n", ret_size); - ok(req->Flags == HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS, "Got flags %#x.\n", req->Flags); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size == 2000, "Got size %lu.\n", ret_size); + ok(req->Flags == HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS, "Got flags %#lx.\n", req->Flags); chunk_size = req->pEntityChunks[0].FromMemory.BufferLength;
memset(recv_body, 0xcc, sizeof(recv_body)); ret_size = 0xdeadbeef; ret = HttpReceiveRequestEntityBody(queue, req->RequestId, 0, recv_body, sizeof(recv_body), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size == 2048 - chunk_size, "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size == 2048 - chunk_size, "Got size %lu.\n", ret_size); ok(!memcmp(recv_body, req_body + chunk_size, ret_size), "Entity body didn't match.\n");
send_response_v1(queue, req->RequestId, s);
CloseHandle(ovl.hEvent); ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_bad_request(void) @@ -916,26 +917,27 @@ static void test_v1_bad_request(void) HANDLE queue; ULONG ret; SOCKET s; + int got;
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); port = add_url_v1(queue);
s = create_client_socket(port); ret = send(s, "foo\r\n", strlen("foo\r\n"), 0); - ok(ret == strlen("foo\r\n"), "send() returned %d.\n", ret); + ok(ret == strlen("foo\r\n"), "send() returned %ld.\n", ret);
- ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret > 0, "recv() failed.\n"); + got = recv(s, response_buffer, sizeof(response_buffer), 0); + ok(got > 0, "recv() failed.\n");
if (winetest_debug > 1) - trace("%.*s\n", ret, response_buffer); + trace("%.*s\n", got, response_buffer);
ok(!strncmp(response_buffer, "HTTP/1.1 400 Bad Request\r\n", 26), "Got incorrect status line.\n"); ok(!!strstr(response_buffer, "\r\nConnection: close\r\n"), "Missing or malformed Connection header.\n");
ret = send(s, "foo\r\n", strlen("foo\r\n"), 0); - ok(ret == strlen("foo\r\n"), "send() returned %d.\n", ret); + ok(ret == strlen("foo\r\n"), "send() returned %ld.\n", ret);
WSASetLastError(0xdeadbeef); ret = recv(s, response_buffer, sizeof(response_buffer), 0); @@ -943,10 +945,10 @@ static void test_v1_bad_request(void) ok(!WSAGetLastError(), "Got error %u.\n", WSAGetLastError());
ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_cooked_url(void) @@ -974,18 +976,18 @@ static void test_v1_cooked_url(void) "\r\n";
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); port = add_url_v1(queue);
s = create_client_socket(port); sprintf(req_text, req1, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size); ok(req->RawUrlLength == 11, "Got raw URL length %u.\n", req->RawUrlLength); ok(!strcmp(req->pRawUrl, "/foobar?a=b"), "Got raw URL %s.\n", req->pRawUrl); ok(req->CookedUrl.FullUrlLength == 66, "Got full URL length %u.\n", req->CookedUrl.FullUrlLength); @@ -1005,12 +1007,12 @@ static void test_v1_cooked_url(void)
sprintf(req_text, req2, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size); ok(req->RawUrlLength == 23, "Got raw URL length %u.\n", req->RawUrlLength); sprintf(expect, "http://localhost:%u/", port); ok(!strcmp(req->pRawUrl, expect), "Expected raw URL "%s", got "%s".\n", expect, req->pRawUrl); @@ -1029,10 +1031,10 @@ static void test_v1_cooked_url(void) send_response_v1(queue, req->RequestId, s);
ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_unknown_tokens(void) @@ -1054,17 +1056,17 @@ static void test_v1_unknown_tokens(void) "\r\n";
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); port = add_url_v1(queue);
s = create_client_socket(port); sprintf(req_text, req1, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ok(req->Verb == HttpVerbUnknown, "Got verb %u.\n", req->Verb); ok(req->UnknownVerbLength == 5, "Got unknown verb length %u.\n", req->UnknownVerbLength); ok(!strcmp(req->pUnknownVerb, "xyzzy"), "Got unknown verb %s.\n", req->pUnknownVerb); @@ -1079,10 +1081,10 @@ static void test_v1_unknown_tokens(void) req->Headers.pUnknownHeaders[0].pRawValue);
ret = remove_url_v1(queue, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_v1_urls(void) @@ -1098,7 +1100,7 @@ static void test_v1_urls(void) SOCKET s;
ret = HttpCreateHttpHandle(&queue, 0); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
for (port = 50000; port < 51000; ++port) { @@ -1111,28 +1113,28 @@ static void test_v1_urls(void) CloseHandle(queue); return; } - ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %u.\n", debugstr_w(url), ret); + ok(ret == ERROR_SHARING_VIOLATION, "Failed to add %s, error %lu.\n", debugstr_w(url), ret); }
- ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
s = create_client_socket(port); sprintf(req_text, simple_req, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer)); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL); - ok(!ret, "Got error %u.\n", ret); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(!ret, "Got error %lu.\n", ret); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
send_response_v1(queue, req->RequestId, s);
ret = HttpRemoveUrl(queue, url); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); ret = CloseHandle(queue); - ok(ret, "Failed to close queue handle, error %u.\n", GetLastError()); + ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError()); }
static void test_HttpCreateServerSession(void) @@ -1144,34 +1146,34 @@ static void test_HttpCreateServerSession(void) version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, NULL, 0); - ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %lu.\n", ret);
version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 1; ret = pHttpCreateServerSession(version, &session, 0); - ok(ret == ERROR_REVISION_MISMATCH, "Unexpected return value %u.\n", ret); + ok(ret == ERROR_REVISION_MISMATCH, "Unexpected return value %lu.\n", ret);
version.HttpApiMajorVersion = 3; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); - ok(ret == ERROR_REVISION_MISMATCH, "Unexpected return value %u.\n", ret); + ok(ret == ERROR_REVISION_MISMATCH, "Unexpected return value %lu.\n", ret);
version.HttpApiMajorVersion = 2; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret); ret = pHttpCloseServerSession(session); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret); ret = pHttpCloseServerSession(session); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
ret = pHttpCloseServerSession(0xdead); - ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %lu.\n", ret); }
static void test_HttpCreateUrlGroup(void) @@ -1183,41 +1185,41 @@ static void test_HttpCreateUrlGroup(void)
group_id = 1; ret = pHttpCreateUrlGroup(0, &group_id, 0); - ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %lu.\n", ret); ok(group_id == 1, "Unexpected group id %s.\n", wine_dbgstr_longlong(group_id));
/* Create session, url group, close session. */ version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
group_id = 0; ret = pHttpCreateUrlGroup(session, &group_id, 0); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret); ok(group_id != 0, "Unexpected group id %s.\n", wine_dbgstr_longlong(group_id));
ret = pHttpCloseServerSession(session); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
/* Groups are closed together with their session. */ ret = pHttpCloseUrlGroup(group_id); - ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %lu.\n", ret);
/* Create session, url group, close group. */ ret = pHttpCreateServerSession(version, &session, 0); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
group_id = 0; ret = pHttpCreateUrlGroup(session, &group_id, 0); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret); ok(group_id != 0, "Unexpected group id %s.\n", wine_dbgstr_longlong(group_id));
ret = pHttpCloseUrlGroup(group_id); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
ret = pHttpCloseServerSession(session); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret); }
static void test_v2_server(void) @@ -1238,53 +1240,53 @@ static void test_v2_server(void) DWORD ret_size; WCHAR url[50]; HANDLE queue; + int len, got; ULONG ret; SOCKET s; - int len;
ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL); memset(req_buffer, 0xcc, sizeof(req_buffer));
ret = pHttpCreateServerSession(version, &session, 0); - ok(!ret, "Failed to create session, error %u.\n", ret); + ok(!ret, "Failed to create session, error %lu.\n", ret); ret = pHttpCreateUrlGroup(session, &group, 0); - ok(!ret, "Failed to create URL group, error %u.\n", ret); + ok(!ret, "Failed to create URL group, error %lu.\n", ret); ret = pHttpCreateRequestQueue(version, NULL, NULL, 0, &queue); - ok(!ret, "Failed to create request queue, error %u.\n", ret); + ok(!ret, "Failed to create request queue, error %lu.\n", ret); binding.Flags.Present = 1; binding.RequestQueueHandle = queue; ret = pHttpSetUrlGroupProperty(group, HttpServerBindingProperty, &binding, sizeof(binding)); - ok(!ret, "Failed to bind request queue, error %u.\n", ret); + ok(!ret, "Failed to bind request queue, error %lu.\n", ret);
ret = HttpReceiveHttpRequest(NULL, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_INVALID_HANDLE, "Got error %u.\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, 0xdeadbeef, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret); ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
SetLastError(0xdeadbeef); ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %lu.\n", GetLastError());
port = add_url_v2(group);
ret = pHttpAddUrlToUrlGroup(group, L"http://localhost:50000", 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = pHttpAddUrlToUrlGroup(group, L"localhost:50000", 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = pHttpAddUrlToUrlGroup(group, L"localhost:50000/", 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = pHttpAddUrlToUrlGroup(group, L"http://localhost/", 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = pHttpAddUrlToUrlGroup(group, L"http://localhost:/", 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); ret = pHttpAddUrlToUrlGroup(group, L"http://localhost:0/", 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %lu.\n", ret); swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port); ret = pHttpAddUrlToUrlGroup(group, url, 0xdeadbeef, 0); - todo_wine ok(ret == ERROR_ALREADY_EXISTS, "Got error %u.\n", ret); + todo_wine ok(ret == ERROR_ALREADY_EXISTS, "Got error %lu.\n", ret);
s = create_client_socket(port); len = sizeof(sockaddr); @@ -1294,22 +1296,22 @@ static void test_v2_server(void) SetLastError(0xdeadbeef); ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "Got error %lu.\n", GetLastError());
sprintf(req_text, simple_req, port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret = WaitForSingleObject(ovl.hEvent, 100); - ok(!ret, "Got %u.\n", ret); + ok(!ret, "Got %lu.\n", ret);
Sleep(100);
ret = GetOverlappedResult(queue, &ovl, &ret_size, TRUE); - ok(ret, "Got error %u.\n", GetLastError()); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(ret, "Got error %lu.\n", GetLastError()); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
- ok(!req->Flags, "Got flags %#x.\n", req->Flags); + ok(!req->Flags, "Got flags %#lx.\n", req->Flags); ok(req->ConnectionId, "Expected nonzero connection ID.\n"); ok(req->RequestId, "Expected nonzero connection ID.\n"); ok(req->UrlContext == 0xdeadbeef, "Got URL context %s.\n", wine_dbgstr_longlong(req->UrlContext)); @@ -1335,7 +1337,7 @@ static void test_v2_server(void) sin = (SOCKADDR_IN *)req->Address.pLocalAddress; ok(sin->sin_family == AF_INET, "Got family %u.\n", sin->sin_family); ok(ntohs(sin->sin_port) == port, "Got wrong port %u.\n", ntohs(sin->sin_port)); - ok(sin->sin_addr.S_un.S_addr == inet_addr("127.0.0.1"), "Got address %08x.\n", sin->sin_addr.S_un.S_addr); + ok(sin->sin_addr.S_un.S_addr == inet_addr("127.0.0.1"), "Got address %08lx.\n", sin->sin_addr.S_un.S_addr); ok(!req->Headers.UnknownHeaderCount, "Got %u unknown headers.\n", req->Headers.UnknownHeaderCount); ok(!req->Headers.pUnknownHeaders, "Got unknown headers %p.\n", req->Headers.pUnknownHeaders); for (i = 0; i < ARRAY_SIZE(req->Headers.KnownHeaders); ++i) @@ -1384,38 +1386,38 @@ static void test_v2_server(void) response.s.Headers.KnownHeaders[HttpHeaderRetryAfter].pRawValue = "120"; response.s.Headers.KnownHeaders[HttpHeaderRetryAfter].RawValueLength = 3; ret = HttpSendHttpResponse(queue, 0xdeadbeef, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl, NULL); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret); ret = HttpSendHttpResponse(queue, req->RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ret = GetOverlappedResult(queue, &ovl, &ret_size, FALSE); - ok(ret, "Got error %u.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError());
- ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret == ret_size, "Expected size %u, got %u.\n", ret_size, ret); + got = recv(s, response_buffer, sizeof(response_buffer), 0); + ok(got == ret_size, "Expected size %lu, got %u.\n", ret_size, got);
if (winetest_debug > 1) - trace("%.*s\n", ret, response_buffer); + trace("%.*s\n", got, response_buffer);
ok(!strncmp(response_buffer, "HTTP/1.1 418 I'm a teapot\r\n", 27), "Got incorrect status line.\n"); ok(!!strstr(response_buffer, "\r\nRetry-After: 120\r\n"), "Missing or malformed Retry-After header.\n"); ok(!!strstr(response_buffer, "\r\nDate:"), "Missing Date header.\n");
ret = HttpReceiveHttpRequest(queue, req->RequestId, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_CONNECTION_INVALID, "Got error %u.\n", ret); + ok(ret == ERROR_CONNECTION_INVALID, "Got error %lu.\n", ret);
ret = remove_url_v2(group, port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); ret = remove_url_v2(group, port); - ok(ret == ERROR_FILE_NOT_FOUND, "Got error %u.\n", ret); + ok(ret == ERROR_FILE_NOT_FOUND, "Got error %lu.\n", ret);
closesocket(s); CloseHandle(ovl.hEvent); ret = pHttpCloseRequestQueue(queue); - ok(!ret, "Failed to close queue handle, error %u.\n", ret); + ok(!ret, "Failed to close queue handle, error %lu.\n", ret); ret = pHttpCloseUrlGroup(group); - ok(!ret, "Failed to close group, error %u.\n", ret); + ok(!ret, "Failed to close group, error %lu.\n", ret); ret = pHttpCloseServerSession(session); - ok(!ret, "Failed to close group, error %u.\n", ret); + ok(!ret, "Failed to close group, error %lu.\n", ret); }
static void test_v2_completion_port(void) @@ -1439,74 +1441,74 @@ static void test_v2_completion_port(void) ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
ret = pHttpCreateServerSession(version, &session, 0); - ok(!ret, "Failed to create session, error %u.\n", ret); + ok(!ret, "Failed to create session, error %lu.\n", ret); ret = pHttpCreateUrlGroup(session, &group, 0); - ok(!ret, "Failed to create URL group, error %u.\n", ret); + ok(!ret, "Failed to create URL group, error %lu.\n", ret); ret = pHttpCreateRequestQueue(version, NULL, NULL, 0, &queue); - ok(!ret, "Failed to create request queue, error %u.\n", ret); + ok(!ret, "Failed to create request queue, error %lu.\n", ret); binding.Flags.Present = 1; binding.RequestQueueHandle = queue; ret = pHttpSetUrlGroupProperty(group, HttpServerBindingProperty, &binding, sizeof(binding)); - ok(!ret, "Failed to bind request queue, error %u.\n", ret); + ok(!ret, "Failed to bind request queue, error %lu.\n", ret);
port = CreateIoCompletionPort(queue, NULL, 123, 0); - ok(!!port, "Failed to create completion port, error %u.\n", GetLastError()); + ok(!!port, "Failed to create completion port, error %lu.\n", GetLastError());
ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 0); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "Got error %lu.\n", GetLastError());
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), NULL, &ovl); - ok(ret == ERROR_IO_PENDING, "Got error %u.\n", ret); + ok(ret == ERROR_IO_PENDING, "Got error %lu.\n", ret);
tcp_port = add_url_v2(group); s = create_client_socket(tcp_port);
ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 0); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "Got error %lu.\n", GetLastError());
sprintf(req_text, simple_req, tcp_port); ret = send(s, req_text, strlen(req_text), 0); - ok(ret == strlen(req_text), "send() returned %d.\n", ret); + ok(ret == strlen(req_text), "send() returned %ld.\n", ret);
ret_size = key = 0xdeadbeef; ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 1000); - ok(ret, "Got error %u.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError()); ok(povl == &ovl, "OVERLAPPED pointers didn't match.\n"); - ok(key == 123, "Got unexpected key %lu.\n", key); - ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size); + ok(key == 123, "Got unexpected key %Iu.\n", key); + ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 0); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "Got error %lu.\n", GetLastError());
response.s.StatusCode = 418; response.s.pReason = "I'm a teapot"; response.s.ReasonLength = 12; ret = HttpSendHttpResponse(queue, req->s.RequestId, 0, (HTTP_RESPONSE *)&response, NULL, NULL, NULL, 0, &ovl, NULL); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret);
ret_size = key = 0xdeadbeef; ret = GetQueuedCompletionStatus(port, &ret_size, &key, &povl, 1000); - ok(ret, "Got error %u.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError()); ok(povl == &ovl, "OVERLAPPED pointers didn't match.\n"); - ok(key == 123, "Got unexpected key %lu.\n", key); + ok(key == 123, "Got unexpected key %Iu.\n", key);
ret = recv(s, response_buffer, sizeof(response_buffer), 0); - ok(ret == ret_size, "Expected size %u, got %u.\n", ret_size, ret); + ok(ret == ret_size, "Expected size %lu, got %lu.\n", ret_size, ret);
ret = remove_url_v2(group, tcp_port); - ok(!ret, "Got error %u.\n", ret); + ok(!ret, "Got error %lu.\n", ret); closesocket(s); CloseHandle(port); CloseHandle(ovl.hEvent); ret = pHttpCloseRequestQueue(queue); - ok(!ret, "Failed to close queue handle, error %u.\n", ret); + ok(!ret, "Failed to close queue handle, error %lu.\n", ret); ret = pHttpCloseUrlGroup(group); - ok(!ret, "Failed to close group, error %u.\n", ret); + ok(!ret, "Failed to close group, error %lu.\n", ret); ret = pHttpCloseServerSession(session); - ok(!ret, "Failed to close group, error %u.\n", ret); + ok(!ret, "Failed to close group, error %lu.\n", ret); }
START_TEST(httpapi) @@ -1520,7 +1522,7 @@ START_TEST(httpapi) WSAStartup(MAKEWORD(1,1), &wsadata);
ret = HttpInitialize(version, HTTP_INITIALIZE_SERVER, NULL); - ok(!ret, "Failed to initialize library, ret %u.\n", ret); + ok(!ret, "Failed to initialize library, ret %lu.\n", ret);
test_v1_server(); test_v1_completion_port(); @@ -1533,7 +1535,7 @@ START_TEST(httpapi) test_v1_urls();
ret = HttpTerminate(HTTP_INITIALIZE_SERVER, NULL); - ok(!ret, "Failed to terminate, ret %u.\n", ret); + ok(!ret, "Failed to terminate, ret %lu.\n", ret);
version.HttpApiMajorVersion = 2; if (!HttpInitialize(version, HTTP_INITIALIZE_SERVER, NULL)) @@ -1544,7 +1546,7 @@ START_TEST(httpapi) test_v2_completion_port();
ret = HttpTerminate(HTTP_INITIALIZE_SERVER, NULL); - ok(!ret, "Failed to terminate, ret %u.\n", ret); + ok(!ret, "Failed to terminate, ret %lu.\n", ret); } else win_skip("Version 2 is not supported.\n");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=109413
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w7u_adm (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w7u_el (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w8 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w8adm (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w864 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064v1507 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064v1809 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064_tsign (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w10pro64 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w864 (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064v1507 (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064v1809 (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064 (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064_2qxl (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w1064_tsign (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w10pro64 (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w10pro64_ar (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w10pro64_he (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w10pro64_ja (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== w10pro64_zh_CN (64 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit Arabic:Morocco report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit German report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit French report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit Hebrew:Israel report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit Hindi:India report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit Japanese:Japan report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit Chinese:China report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (32 bit WoW report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
=== debian11 (64 bit WoW report) ===
httpapi: httpapi.c:701: Test failed: Response did not end with entity data. httpapi.c:730: Test failed: Response did not end with entity data.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/ieframe/tests/Makefile.in | 1 dlls/ieframe/tests/ie.c | 36 +- dlls/ieframe/tests/intshcut.c | 72 ++-- dlls/ieframe/tests/webbrowser.c | 630 ++++++++++++++++++++------------------- 4 files changed, 369 insertions(+), 370 deletions(-)
diff --git a/dlls/ieframe/tests/Makefile.in b/dlls/ieframe/tests/Makefile.in index de5da8a28cd..b2ea9a26054 100644 --- a/dlls/ieframe/tests/Makefile.in +++ b/dlls/ieframe/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = ieframe.dll IMPORTS = ole32 oleaut32 user32 gdi32 advapi32
diff --git a/dlls/ieframe/tests/ie.c b/dlls/ieframe/tests/ie.c index b2c39e7baa7..f5f565aa7fd 100644 --- a/dlls/ieframe/tests/ie.c +++ b/dlls/ieframe/tests/ie.c @@ -135,22 +135,22 @@ static void advise_cp(IUnknown *unk, BOOL init) static DWORD cookie = 100;
hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container); - ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres); if(FAILED(hres)) return;
hres = IConnectionPointContainer_FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point); IConnectionPointContainer_Release(container); - ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres); + ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres); if(FAILED(hres)) return;
if(init) { hres = IConnectionPoint_Advise(point, (IUnknown*)&Dispatch, &cookie); - ok(hres == S_OK, "Advise failed: %08x\n", hres); + ok(hres == S_OK, "Advise failed: %08lx\n", hres); }else { hres = IConnectionPoint_Unadvise(point, cookie); - ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08lx\n", hres); }
IConnectionPoint_Release(point); @@ -164,19 +164,19 @@ static void test_visible(IWebBrowser2 *wb)
b = 0x100; hres = IWebBrowser2_get_Visible(wb, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "Visible = %x\n", b);
hres = IWebBrowser2_put_Visible(wb, VARIANT_TRUE); - ok(hres == S_OK, "put_Visible failed: %08x\n", hres); + ok(hres == S_OK, "put_Visible failed: %08lx\n", hres);
b = 0x100; hres = IWebBrowser2_get_Visible(wb, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
hres = IWebBrowser2_put_Visible(wb, VARIANT_FALSE); - ok(hres == S_OK, "put_Visible failed: %08x\n", hres); + ok(hres == S_OK, "put_Visible failed: %08lx\n", hres); }
static void test_html_window(IWebBrowser2 *wb) @@ -186,11 +186,11 @@ static void test_html_window(IWebBrowser2 *wb) HRESULT hres;
hres = IWebBrowser2_QueryInterface(wb, &IID_IServiceProvider, (void**)&sp); - ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres);
hres = IServiceProvider_QueryService(sp, &SID_SHTMLWindow, &IID_IHTMLWindow2, (void**)&html_window); IServiceProvider_Release(sp); - ok(hres == S_OK, "Could not get SHTMLWindow service: %08x\n", hres); + ok(hres == S_OK, "Could not get SHTMLWindow service: %08lx\n", hres);
IHTMLWindow2_Release(html_window); } @@ -203,7 +203,7 @@ static void test_window(IWebBrowser2 *wb) HRESULT hres;
hres = IWebBrowser2_get_HWND(wb, &handle); - ok(hres == S_OK, "get_HWND failed: %08x\n", hres); + ok(hres == S_OK, "get_HWND failed: %08lx\n", hres); ok(handle, "handle == 0\n");
hwnd = (HWND)handle; @@ -223,7 +223,7 @@ static void test_navigate(IWebBrowser2 *wb, const WCHAR *url) V_BSTR(&urlv) = SysAllocString(url); V_VT(&emptyv) = VT_EMPTY; hres = IWebBrowser2_Navigate2(wb, &urlv, &emptyv, &emptyv, &emptyv, &emptyv); - ok(hres == S_OK, "Navigate2 failed: %08x\n", hres); + ok(hres == S_OK, "Navigate2 failed: %08lx\n", hres); SysFreeString(V_BSTR(&urlv));
while(!navigate_complete && GetMessageW(&msg, NULL, 0, 0)) { @@ -241,7 +241,7 @@ static void test_busy(IWebBrowser2 *wb)
b = 0xdead; hres = IWebBrowser2_get_Busy(wb, &b); - ok(hres == S_OK, "get_Busy failed: %08x\n", hres); + ok(hres == S_OK, "get_Busy failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "Busy = %x\n", b); }
@@ -254,13 +254,13 @@ static void test_InternetExplorer(void)
hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_SERVER, &IID_IUnknown, (void**)&unk); - ok(hres == S_OK, "Could not create InternetExplorer instance: %08x\n", hres); + ok(hres == S_OK, "Could not create InternetExplorer instance: %08lx\n", hres);
if(hres != S_OK) return;
hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb); - ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres); + ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08lx\n", hres); if (hres != S_OK) { IUnknown_Release(unk); return; @@ -278,7 +278,7 @@ static void test_InternetExplorer(void)
IWebBrowser2_Release(wb); ref = IUnknown_Release(unk); - ok(!ref, "object not destroyed, ref=%u\n", ref); + ok(!ref, "object not destroyed, ref=%lu\n", ref); }
static void test_InternetExplorerManager(void) @@ -289,7 +289,7 @@ static void test_InternetExplorerManager(void)
hres = CoCreateInstance(&CLSID_InternetExplorerManager, NULL, CLSCTX_LOCAL_SERVER, &IID_IInternetExplorerManager, (void**)&unk); - ok(hres == S_OK || broken(hres == REGDB_E_CLASSNOTREG), "Could not create InternetExplorerManager instance: %08x\n", hres); + ok(hres == S_OK || broken(hres == REGDB_E_CLASSNOTREG), "Could not create InternetExplorerManager instance: %08lx\n", hres);
if(hres != S_OK) { @@ -298,7 +298,7 @@ static void test_InternetExplorerManager(void) }
ref = IUnknown_Release(unk); - ok(!ref, "object not destroyed, ref=%u\n", ref); + ok(!ref, "object not destroyed, ref=%lu\n", ref); }
START_TEST(ie) diff --git a/dlls/ieframe/tests/intshcut.c b/dlls/ieframe/tests/intshcut.c index d2135d0ebb3..4e86000d610 100644 --- a/dlls/ieframe/tests/intshcut.c +++ b/dlls/ieframe/tests/intshcut.c @@ -75,17 +75,17 @@ static void test_Aggregability(void) IUnknown *pUnknown = NULL;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown); - ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUnknown, hr = 0x%x\n", hr); + ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUnknown, hr = 0x%lx\n", hr); if (pUnknown) IUnknown_Release(pUnknown);
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&pUnknown); - ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUniformResourceLocatorA, hr = 0x%x\n", hr); + ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUniformResourceLocatorA, hr = 0x%lx\n", hr); if (pUnknown) IUnknown_Release(pUnknown);
hr = CoCreateInstance(&CLSID_InternetShortcut, &unknown, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown); - ok(hr == CLASS_E_NOAGGREGATION, "aggregation didn't fail like it should, hr = 0x%x\n", hr); + ok(hr == CLASS_E_NOAGGREGATION, "aggregation didn't fail like it should, hr = 0x%lx\n", hr); if (pUnknown) IUnknown_Release(pUnknown); } @@ -106,7 +106,7 @@ static void test_QueryInterface(void) IUnknown *pUnknown;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown); - ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr); + ok(hr == S_OK, "Could not create InternetShortcut object: %08lx\n", hr);
can_query_interface(pUnknown, &IID_IUniformResourceLocatorA); can_query_interface(pUnknown, &IID_IUniformResourceLocatorW); @@ -122,10 +122,10 @@ static void _test_shortcut_url(unsigned line, IUnknown *unk, const char *exurl) HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IUniformResourceLocatorA, (void**)&locator_a); - ok_(__FILE__,line)(hres == S_OK, "Could not get IUniformResourceLocatorA iface: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "Could not get IUniformResourceLocatorA iface: %08lx\n", hres);
hres = locator_a->lpVtbl->GetURL(locator_a, &url_a); - ok_(__FILE__,line)(hres == S_OK, "GetURL failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "GetURL failed: %08lx\n", hres); ok_(__FILE__,line)(!strcmp(url_a, exurl), "unexpected URL, got %s, expected %s\n", url_a, exurl); CoTaskMemFree(url_a);
@@ -140,7 +140,7 @@ static void _check_string_transform(unsigned line, IUniformResourceLocatorA *url HRESULT hr;
hr = urlA->lpVtbl->SetURL(urlA, input, flags); - ok_(__FILE__,line)(hr == S_OK, "SetUrl failed, hr=0x%x\n", hr); + ok_(__FILE__,line)(hr == S_OK, "SetUrl failed, hr=0x%lx\n", hr); if (FAILED(hr)) return;
@@ -148,14 +148,14 @@ static void _check_string_transform(unsigned line, IUniformResourceLocatorA *url hr = urlA->lpVtbl->GetURL(urlA, &output); if(expectedOutput) { todo_wine_if(is_todo) { - ok_(__FILE__,line)(hr == S_OK, "GetUrl failed, hr=0x%x\n", hr); + ok_(__FILE__,line)(hr == S_OK, "GetUrl failed, hr=0x%lx\n", hr); } todo_wine ok_(__FILE__,line)(!lstrcmpA(output, expectedOutput), "unexpected URL change %s -> %s (expected %s)\n", input, output, expectedOutput); }else { todo_wine - ok_(__FILE__,line)(hr == S_FALSE, "GetUrl failed, hr=0x%x\n", hr); + ok_(__FILE__,line)(hr == S_FALSE, "GetUrl failed, hr=0x%lx\n", hr); todo_wine ok_(__FILE__,line)(!output, "GetUrl returned %s\n", output); } @@ -184,7 +184,7 @@ static void test_ReadAndWriteProperties(void) lstrcatW(fileNameW, L"testshortcut.url");
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA); - ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hr); + ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08lx\n", hr); if (hr == S_OK) { IPersistFile *pf; @@ -194,14 +194,14 @@ static void test_ReadAndWriteProperties(void)
/* We need to set a URL -- IPersistFile refuses to save without one. */ hr = urlA->lpVtbl->SetURL(urlA, testurl, 0); - ok(hr == S_OK, "Failed to set a URL. hr=0x%x\n", hr); + ok(hr == S_OK, "Failed to set a URL. hr=0x%lx\n", hr);
/* Write this shortcut out to a file so that we can test reading it in again. */ hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPersistFile, (void **) &pf); - ok(hr == S_OK, "Failed to get the IPersistFile for writing. hr=0x%x\n", hr); + ok(hr == S_OK, "Failed to get the IPersistFile for writing. hr=0x%lx\n", hr);
hr = IPersistFile_Save(pf, fileNameW, TRUE); - ok(hr == S_OK, "Failed to save via IPersistFile. hr=0x%x\n", hr); + ok(hr == S_OK, "Failed to save via IPersistFile. hr=0x%lx\n", hr);
IPersistFile_Release(pf);
@@ -210,16 +210,16 @@ static void test_ReadAndWriteProperties(void) pv[1].vt = VT_I4; U(pv[1]).lVal = iconIndex; hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPropertySetStorage, (void **) &pPropSetStg); - ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hr);
hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &pPropStgWrite); - ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%lx\n", hr);
hr = IPropertyStorage_WriteMultiple(pPropStgWrite, 2, ps, pv, 0); - ok(hr == S_OK, "Unable to set properties, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to set properties, hr=0x%lx\n", hr);
hr = IPropertyStorage_Commit(pPropStgWrite, STGC_DEFAULT); - ok(hr == S_OK, "Failed to commit properties, hr=0x%x\n", hr); + ok(hr == S_OK, "Failed to commit properties, hr=0x%lx\n", hr);
pPropStgWrite->lpVtbl->Release(pPropStgWrite); urlA->lpVtbl->Release(urlA); @@ -227,7 +227,7 @@ static void test_ReadAndWriteProperties(void) }
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlAFromFile); - ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hr); + ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08lx\n", hr); if (hr == S_OK) { IPropertySetStorage *pPropSetStg; @@ -238,29 +238,29 @@ static void test_ReadAndWriteProperties(void)
/* Now read that .url file back in. */ hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPersistFile, (void **) &pf); - ok(hr == S_OK, "Failed to get the IPersistFile for reading. hr=0x%x\n", hr); + ok(hr == S_OK, "Failed to get the IPersistFile for reading. hr=0x%lx\n", hr);
hr = IPersistFile_Load(pf, fileNameW, 0); - ok(hr == S_OK, "Failed to load via IPersistFile. hr=0x%x\n", hr); + ok(hr == S_OK, "Failed to load via IPersistFile. hr=0x%lx\n", hr); IPersistFile_Release(pf);
hr = urlAFromFile->lpVtbl->GetURL(urlAFromFile, &url); - ok(hr == S_OK, "Unable to get url from file, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to get url from file, hr=0x%lx\n", hr); ok(lstrcmpA(url, testurl) == 0, "Wrong url read from file: %s\n",url); CoTaskMemFree(url);
hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPropertySetStorage, (void **) &pPropSetStg); - ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hr);
hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStgRead); - ok(hr == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%lx\n", hr);
memset(pvread, 0, sizeof(pvread)); hr = IPropertyStorage_ReadMultiple(pPropStgRead, 2, ps, pvread); todo_wine /* Wine doesn't yet support setting properties after save */ { - ok(hr == S_OK, "Unable to read properties, hr=0x%x\n", hr); + ok(hr == S_OK, "Unable to read properties, hr=0x%lx\n", hr); ok(pvread[1].vt == VT_I4, "got %d\n", pvread[1].vt); ok(U(pvread[1]).lVal == iconIndex, "Read wrong icon index: %d\n", U(pvread[1]).iVal); ok(pvread[0].vt == VT_LPWSTR, "got %d\n", pvread[0].vt); @@ -282,17 +282,17 @@ static void test_NullURLs(void) IUniformResourceLocatorA *urlA;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA); - ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr); + ok(hr == S_OK, "Could not create InternetShortcut object: %08lx\n", hr);
hr = urlA->lpVtbl->GetURL(urlA, &url); - ok(hr == S_FALSE, "getting uninitialized URL unexpectedly failed, hr=0x%x\n", hr); + ok(hr == S_FALSE, "getting uninitialized URL unexpectedly failed, hr=0x%lx\n", hr); ok(url == NULL, "uninitialized URL is not NULL but %s\n", url);
hr = urlA->lpVtbl->SetURL(urlA, NULL, 0); - ok(hr == S_OK, "setting NULL URL unexpectedly failed, hr=0x%x\n", hr); + ok(hr == S_OK, "setting NULL URL unexpectedly failed, hr=0x%lx\n", hr);
hr = urlA->lpVtbl->GetURL(urlA, &url); - ok(hr == S_FALSE, "getting NULL URL unexpectedly failed, hr=0x%x\n", hr); + ok(hr == S_FALSE, "getting NULL URL unexpectedly failed, hr=0x%lx\n", hr); ok(url == NULL, "URL unexpectedly not NULL but %s\n", url);
urlA->lpVtbl->Release(urlA); @@ -342,31 +342,31 @@ static void test_Load(void) CloseHandle(file);
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IPersistFile, (void**)&persist_file); - ok(hres == S_OK, "Could not create InternetShortcut instance: %08x\n", hres); + ok(hres == S_OK, "Could not create InternetShortcut instance: %08lx\n", hres);
hres = IPersistFile_Load(persist_file, file_path, 0); - ok(hres == S_OK, "Load failed: %08x\n", hres); + ok(hres == S_OK, "Load failed: %08lx\n", hres);
test_shortcut_url((IUnknown*)persist_file, test->url);
hres = IPersistFile_QueryInterface(persist_file, &IID_IPropertySetStorage, (void **)&propsetstorage); - ok(hres == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hres); + ok(hres == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hres);
hres = IPropertySetStorage_Open(propsetstorage, &FMTID_Intshcut, STGM_READ | STGM_SHARE_EXCLUSIVE, &propstorage); - ok(hres == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%x\n", hres); + ok(hres == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%lx\n", hres);
ps.ulKind = PRSPEC_PROPID; U(ps).propid = PID_IS_ICONFILE; v.vt = VT_NULL; hres = IPropertyStorage_ReadMultiple(propstorage, 1, &ps, &v); - ok(hres == S_FALSE, "got 0x%08x\n", hres); + ok(hres == S_FALSE, "got 0x%08lx\n", hres); ok(v.vt == VT_EMPTY, "got %d\n", v.vt);
ps.ulKind = PRSPEC_PROPID; U(ps).propid = PID_IS_ICONINDEX; v.vt = VT_EMPTY; hres = IPropertyStorage_ReadMultiple(propstorage, 1, &ps, &v); - ok(hres == S_FALSE, "got 0x%08x\n", hres); + ok(hres == S_FALSE, "got 0x%08lx\n", hres); ok(v.vt == VT_EMPTY, "got %d\n", v.vt);
IPropertyStorage_Release(propstorage); @@ -383,7 +383,7 @@ static void test_SetURLFlags(void) IUniformResourceLocatorA *urlA;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA); - ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr); + ok(hr == S_OK, "Could not create InternetShortcut object: %08lx\n", hr);
check_string_transform(urlA, "somerandomstring", 0, NULL, TRUE); check_string_transform(urlA, "www.winehq.org", 0, NULL, TRUE); @@ -400,7 +400,7 @@ static void test_InternetShortcut(void) HRESULT hres;
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&url); - ok(hres == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hres); + ok(hres == S_OK, "Could not create CLSID_InternetShortcut instance: %08lx\n", hres); if(FAILED(hres)) return; url->lpVtbl->Release(url); diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index 864a8baf27f..584da6e9022 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -244,7 +244,7 @@ static IWebBrowser2 *_create_webbrowser(unsigned line)
hres = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IWebBrowser2, (void**)&ret); - ok_(__FILE__,line)(hres == S_OK, "Creating WebBrowser object failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "Creating WebBrowser object failed: %08lx\n", hres); return ret; }
@@ -255,7 +255,7 @@ static void _test_LocationURL(unsigned line, IWebBrowser2 *wb, const WCHAR *exur HRESULT hres;
hres = IWebBrowser2_get_LocationURL(wb, &url); - ok_(__FILE__,line) (hres == (*exurl ? S_OK : S_FALSE), "get_LocationURL failed: %08x\n", hres); + ok_(__FILE__,line) (hres == (*exurl ? S_OK : S_FALSE), "get_LocationURL failed: %08lx\n", hres); if (SUCCEEDED(hres)) { ok_(__FILE__,line) (!lstrcmpW(url, exurl), "unexpected URL: %s\n", wine_dbgstr_w(url)); @@ -270,7 +270,7 @@ static void _test_LocationName(unsigned line, IWebBrowser2 *wb, const WCHAR *exn HRESULT hres;
hres = IWebBrowser2_get_LocationName(wb, &name); - ok_(__FILE__,line) (hres == (*exname ? S_OK : S_FALSE), "get_LocationName failed: %08x\n", hres); + ok_(__FILE__,line) (hres == (*exname ? S_OK : S_FALSE), "get_LocationName failed: %08lx\n", hres); ok_(__FILE__,line) (!lstrcmpW(name, exname) || broken(is_http && !lstrcmpW(name, current_url)) /* Win10 2004 */, "expected %s, got %s\n", wine_dbgstr_w(exname), wine_dbgstr_w(name)); SysFreeString(name); @@ -284,17 +284,17 @@ static void _test_ready_state(unsigned line, READYSTATE exstate, VARIANT_BOOL ex HRESULT hres;
hres = IWebBrowser2_get_ReadyState(wb, &state); - ok_(__FILE__,line)(hres == S_OK, "get_ReadyState failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "get_ReadyState failed: %08lx\n", hres); ok_(__FILE__,line)(state == exstate, "ReadyState = %d, expected %d\n", state, exstate);
hres = IWebBrowser2_get_Busy(wb, &busy); if(expect_busy != BUSY_FAIL) { - ok_(__FILE__,line)(hres == S_OK, "get_ReadyState failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "get_ReadyState failed: %08lx\n", hres); ok_(__FILE__,line)(busy == expect_busy, "Busy = %x, expected %x for ready state %d\n", busy, expect_busy, state); }else { todo_wine - ok_(__FILE__,line)(hres == E_FAIL, "get_ReadyState returned: %08x\n", hres); + ok_(__FILE__,line)(hres == E_FAIL, "get_ReadyState returned: %08lx\n", hres); } }
@@ -307,11 +307,11 @@ static IHTMLDocument2 *_get_document(unsigned line, IWebBrowser2 *wb)
disp = NULL; hres = IWebBrowser2_get_Document(wb, &disp); - ok_(__FILE__,line)(hres == S_OK, "get_Document failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "get_Document failed: %08lx\n", hres); ok_(__FILE__,line)(disp != NULL, "doc_disp == NULL\n");
hres = IDispatch_QueryInterface(disp, &IID_IHTMLDocument2, (void**)&html_doc); - ok_(__FILE__,line)(hres == S_OK, "Could not get IHTMLDocument iface: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "Could not get IHTMLDocument iface: %08lx\n", hres); ok(disp == (IDispatch*)html_doc, "disp != html_doc\n"); IDispatch_Release(disp);
@@ -329,11 +329,11 @@ static IOleClientSite *_get_dochost(unsigned line, IWebBrowser2 *unk) doc = _get_document(line, unk); hres = IHTMLDocument2_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj); IHTMLDocument2_Release(doc); - ok_(__FILE__,line)(hres == S_OK, "Got 0x%08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "Got 0x%08lx\n", hres);
hres = IOleObject_GetClientSite(oleobj, &client_site); IOleObject_Release(oleobj); - ok_(__FILE__,line)(hres == S_OK, "Got 0x%08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "Got 0x%08lx\n", hres);
return client_site; } @@ -361,7 +361,7 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) { ok(!pguidCmdGroup, "pguidCmdGroup != MULL\n"); - ok(cCmds == 1, "cCmds=%d, expected 1\n", cCmds); + ok(cCmds == 1, "cCmds=%ld, expected 1\n", cCmds); ok(!pCmdText, "pCmdText != NULL\n");
switch(prgCmds[0].cmdID) { @@ -383,7 +383,7 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con prgCmds[0].cmdf = 0; return S_OK; default: - ok(0, "unexpected command %d\n", prgCmds[0].cmdID); + ok(0, "unexpected command %ld\n", prgCmds[0].cmdID); }
return E_FAIL; @@ -396,7 +396,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID switch(nCmdID) { case OLECMDID_SETPROGRESSMAX: CHECK_EXPECT2(Exec_SETPROGRESSMAX); - ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt); + ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(pvaIn != NULL, "pvaIn == NULL\n"); if(pvaIn) ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn)); @@ -404,7 +404,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID return S_OK; case OLECMDID_SETPROGRESSPOS: CHECK_EXPECT2(Exec_SETPROGRESSPOS); - ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt); + ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(pvaIn != NULL, "pvaIn == NULL\n"); if(pvaIn) ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn)); @@ -413,9 +413,9 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID case OLECMDID_SETDOWNLOADSTATE: if(is_downloading) ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER || !nCmdexecopt, - "nCmdexecopts=%08x\n", nCmdexecopt); + "nCmdexecopts=%08lx\n", nCmdexecopt); else - ok(!nCmdexecopt, "nCmdexecopts=%08x\n", nCmdexecopt); + ok(!nCmdexecopt, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut); ok(pvaIn != NULL, "pvaIn == NULL\n"); ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d\n", V_VT(pvaIn)); @@ -427,12 +427,12 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_1); break; default: - ok(0, "unexpected V_I4(pvaIn)=%d\n", V_I4(pvaIn)); + ok(0, "unexpected V_I4(pvaIn)=%ld\n", V_I4(pvaIn)); } return S_OK; case OLECMDID_UPDATECOMMANDS: CHECK_EXPECT2(Exec_UPDATECOMMANDS); - ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt); + ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08lx\n", nCmdexecopt); ok(!pvaIn, "pvaIn != NULL\n"); ok(!pvaOut, "pvaOut=%p, expected NULL\n", pvaOut); return S_OK; @@ -457,7 +457,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID case 6058: /* TODO */ return E_NOTIMPL; default: - ok(0, "unexpected nCmdID %d\n", nCmdID); + ok(0, "unexpected nCmdID %ld\n", nCmdID); } }else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) { switch(nCmdID) { @@ -475,7 +475,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID case 119: /* IE11 */ return E_FAIL; default: - ok(0, "unexpected nCmdID %d\n", nCmdID); + ok(0, "unexpected nCmdID %ld\n", nCmdID); } }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { switch(nCmdID) { @@ -497,14 +497,14 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID case 182: /* win10 */ return E_FAIL; default: - ok(0, "unexpected nCmdID %d\n", nCmdID); + ok(0, "unexpected nCmdID %ld\n", nCmdID); } }else if(IsEqualGUID(&CGID_DocHostCmdPriv, pguidCmdGroup)) { switch(nCmdID) { case 11: /* TODO */ break; default: - ok(0, "unexpected nCmdID %d of CGID_DocHostCmdPriv\n", nCmdID); + ok(0, "unexpected nCmdID %ld of CGID_DocHostCmdPriv\n", nCmdID); } }else if(IsEqualGUID(&CGID_DocHostCommandHandler, pguidCmdGroup)) { switch(nCmdID) { @@ -514,7 +514,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID CHECK_EXPECT(Exec_DocHostCommandHandler_2300); return E_NOTIMPL; default: - ok(0, "unexpected nCmdID %d of CGID_DocHostCommandHandler\n", nCmdID); + ok(0, "unexpected nCmdID %ld of CGID_DocHostCommandHandler\n", nCmdID); } }else { ok(0, "unexpected pguidCmdGroup %s\n", wine_dbgstr_guid(pguidCmdGroup)); @@ -673,7 +673,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF return S_OK; }
- ok(0, "unexpected dispIdMember %d\n", dispIdMember); + ok(0, "unexpected dispIdMember %ld\n", dispIdMember); return E_NOTIMPL; }
@@ -748,9 +748,9 @@ static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const f = V_I4(V_VARIANTREF(flags)); f &= ~0x100; /* IE11 sets this flag */ if(is_first_load) - ok(!f, "flags = %x, expected 0\n", V_I4(V_VARIANTREF(flags))); + ok(!f, "flags = %lx, expected 0\n", V_I4(V_VARIANTREF(flags))); else - ok(!(f & ~0x40), "flags = %x, expected 0x40 or 0\n", V_I4(V_VARIANTREF(flags))); + ok(!(f & ~0x40), "flags = %lx, expected 0x40 or 0\n", V_I4(V_VARIANTREF(flags))); }
ok(V_VT(frame) == (VT_BYREF|VT_VARIANT), "V_VT(frame)=%x, expected VT_BYREF|VT_VARIANT\n", @@ -937,7 +937,7 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe ok(V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEFORWARD || V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEBACK || V_I4(pDispParams->rgvarg+1) == CSC_UPDATECOMMANDS, - "V_I4(pDispParams->rgvarg+1) = %x\n", V_I4(pDispParams->rgvarg+1)); + "V_I4(pDispParams->rgvarg+1) = %lx\n", V_I4(pDispParams->rgvarg+1));
if (V_I4(pDispParams->rgvarg+1) == CSC_NAVIGATEFORWARD) { @@ -1052,7 +1052,7 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe break;
default: - ok(0, "unexpected dispIdMember %d\n", dispIdMember); + ok(0, "unexpected dispIdMember %ld\n", dispIdMember); }
return S_OK; @@ -1573,7 +1573,7 @@ static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface) static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdicpReserved) { - ok(0, "unexpected call %d %p %p %p\n", dwID, ppt, pcmdtReserved, pdicpReserved); + ok(0, "unexpected call %ld %p %p %p\n", dwID, ppt, pcmdtReserved, pdicpReserved); return S_FALSE; }
@@ -1582,9 +1582,9 @@ static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface, DO CHECK_EXPECT2(GetHostInfo); ok(pInfo != NULL, "pInfo=NULL\n"); if(pInfo) { - ok(pInfo->cbSize == sizeof(DOCHOSTUIINFO) || broken(!pInfo->cbSize), "pInfo->cbSize=%u\n", pInfo->cbSize); - ok(!pInfo->dwFlags, "pInfo->dwFlags=%08x, expected 0\n", pInfo->dwFlags); - ok(!pInfo->dwDoubleClick, "pInfo->dwDoubleClick=%08x, expected 0\n", pInfo->dwDoubleClick); + ok(pInfo->cbSize == sizeof(DOCHOSTUIINFO) || broken(!pInfo->cbSize), "pInfo->cbSize=%lu\n", pInfo->cbSize); + ok(!pInfo->dwFlags, "pInfo->dwFlags=%08lx, expected 0\n", pInfo->dwFlags); + ok(!pInfo->dwDoubleClick, "pInfo->dwDoubleClick=%08lx, expected 0\n", pInfo->dwDoubleClick); ok(!pInfo->pchHostCss, "pInfo->pchHostCss=%p, expected NULL\n", pInfo->pchHostCss); ok(!pInfo->pchHostNS, "pInfo->pchhostNS=%p, expected NULL\n", pInfo->pchHostNS); } @@ -1658,7 +1658,7 @@ static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *ifac ok(pchKey != NULL, "pchKey==NULL\n"); if(pchKey) ok(*pchKey == NULL, "*pchKey=%p\n", *pchKey); - ok(!dw, "dw=%x\n", dw); + ok(!dw, "dw=%lx\n", dw); return E_NOTIMPL; }
@@ -1698,7 +1698,7 @@ static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *if ok(pchKey != NULL, "pchKey==NULL\n"); if(pchKey) ok(*pchKey == NULL, "*pchKey=%p\n", *pchKey); - ok(!dw, "dw=%x\n", dw); + ok(!dw, "dw=%lx\n", dw); return E_NOTIMPL; }
@@ -1859,12 +1859,12 @@ static void test_DoVerb(IWebBrowser2 *unk) DWORD connection;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08lx\n", hres); if(FAILED(hres)) return;
hres = IOleObject_Advise(oleobj, &test_sink, &connection); - ok(hres == S_OK, "Advise failed: %08x\n", hres); + ok(hres == S_OK, "Advise failed: %08lx\n", hres);
SET_EXPECT(CanInPlaceActivate); SET_EXPECT(Site_GetWindow); @@ -1881,7 +1881,7 @@ static void test_DoVerb(IWebBrowser2 *unk)
hres = IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, &ClientSite, 0, (HWND)0xdeadbeef, &rect); - ok(hres == S_OK, "DoVerb failed: %08x\n", hres); + ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
CHECK_CALLED(CanInPlaceActivate); CHECK_CALLED(Site_GetWindow); @@ -1898,10 +1898,10 @@ static void test_DoVerb(IWebBrowser2 *unk)
hres = IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, &ClientSite, 0, (HWND)0xdeadbeef, &rect); - ok(hres == S_OK, "DoVerb failed: %08x\n", hres); + ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
hres = IOleObject_Unadvise(oleobj, connection); - ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IOleObject_Release(oleobj); } @@ -1913,13 +1913,13 @@ static void call_DoVerb(IWebBrowser2 *unk, LONG verb) HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08lx\n", hres); if(FAILED(hres)) return;
hres = IOleObject_DoVerb(oleobj, verb, NULL, &ClientSite, -1, container_hwnd, &rect); - ok(hres == S_OK, "DoVerb failed: %08x\n", hres); + ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
IOleObject_Release(oleobj); } @@ -1931,10 +1931,10 @@ static HWND get_hwnd(IWebBrowser2 *unk) HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleInPlaceObject, (void**)&inplace); - ok(hres == S_OK, "QueryInterface(IID_OleInPlaceObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleInPlaceObject) failed: %08lx\n", hres);
hres = IOleInPlaceObject_GetWindow(inplace, &hwnd); - ok(hres == S_OK, "GetWindow failed: %08x\n", hres); + ok(hres == S_OK, "GetWindow failed: %08lx\n", hres);
IOleInPlaceObject_Release(inplace); return hwnd; @@ -1948,10 +1948,10 @@ static void test_GetMiscStatus(IOleObject *oleobj) for(i=0; i<10; i++) { st = 0xdeadbeef; hres = IOleObject_GetMiscStatus(oleobj, i, &st); - ok(hres == S_OK, "GetMiscStatus failed: %08x\n", hres); + ok(hres == S_OK, "GetMiscStatus failed: %08lx\n", hres); ok(st == (OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_INSIDEOUT |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE), - "st=%08x, expected OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|" + "st=%08lx, expected OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|" "OLEMISC_INSIDEOUT|OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE)\n", st); } } @@ -1961,7 +1961,7 @@ static void test_SetHostNames(IOleObject *oleobj) HRESULT hres;
hres = IOleObject_SetHostNames(oleobj, L"test app", (void*)0xdeadbeef); - ok(hres == S_OK, "SetHostNames failed: %08x\n", hres); + ok(hres == S_OK, "SetHostNames failed: %08lx\n", hres); }
static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop_download) @@ -1973,7 +1973,7 @@ static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08lx\n", hres); if(FAILED(hres)) return;
@@ -1981,14 +1981,14 @@ static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop test_SetHostNames(oleobj);
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleInPlaceObject, (void**)&inplace); - ok(hres == S_OK, "QueryInterface(IID_OleInPlaceObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleInPlaceObject) failed: %08lx\n", hres); if(FAILED(hres)) { IOleObject_Release(oleobj); return; }
hres = IOleInPlaceObject_GetWindow(inplace, &hwnd); - ok(hres == S_OK, "GetWindow failed: %08x\n", hres); + ok(hres == S_OK, "GetWindow failed: %08lx\n", hres); ok((hwnd == NULL) ^ (client == NULL), "unexpected hwnd %p\n", hwnd);
if(client) { @@ -2017,11 +2017,11 @@ static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop }
hres = IOleObject_SetClientSite(oleobj, client); - ok(hres == S_OK, "SetClientSite failed: %08x\n", hres); + ok(hres == S_OK, "SetClientSite failed: %08lx\n", hres);
if(client) { DWORD count = pSetQueryNetSessionCount(SESSION_QUERY); - ok(count == session_count + 1, "count = %u expected %u\n", count, session_count + 1); + ok(count == session_count + 1, "count = %lu expected %lu\n", count, session_count + 1);
CHECK_CALLED(GetContainer); CHECK_CALLED(Site_GetWindow); @@ -2046,7 +2046,7 @@ static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop }
hres = IOleInPlaceObject_GetWindow(inplace, &hwnd); - ok(hres == S_OK, "GetWindow failed: %08x\n", hres); + ok(hres == S_OK, "GetWindow failed: %08lx\n", hres); ok((hwnd == NULL) == (client == NULL), "unexpected hwnd %p\n", hwnd);
shell_embedding_hwnd = hwnd; @@ -2068,7 +2068,7 @@ static void test_change_ClientSite(IWebBrowser2 *unk) HWND hwnd;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08lx\n", hres); if(FAILED(hres)) return;
@@ -2079,7 +2079,7 @@ static void test_change_ClientSite(IWebBrowser2 *unk) SET_EXPECT(Invoke_AMBIENT_SILENT);
hres = IOleObject_SetClientSite(oleobj, &ClientSite2); - ok(hres == S_OK, "SetClientSite failed: %08x\n", hres); + ok(hres == S_OK, "SetClientSite failed: %08lx\n", hres); IOleObject_Release(oleobj);
CHECK_CALLED(Site_GetWindow); @@ -2088,13 +2088,13 @@ static void test_change_ClientSite(IWebBrowser2 *unk)
doc_clientsite = get_dochost(unk); hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IOleCommandTarget, (void**)&olecmd); - ok(hres == S_OK, "QueryInterface(IOleCommandTarget) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IOleCommandTarget) failed: %08lx\n", hres); IOleClientSite_Release(doc_clientsite);
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleInPlaceObject, (void**)&inplace); - ok(hres == S_OK, "QueryInterface(OleInPlaceObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(OleInPlaceObject) failed: %08lx\n", hres); hres = IOleInPlaceObject_GetWindow(inplace, &hwnd); - ok(hres == S_OK, "GetWindow failed: %08x\n", hres); + ok(hres == S_OK, "GetWindow failed: %08lx\n", hres); ok(hwnd == shell_embedding_hwnd, "unexpected hwnd %p\n", hwnd); IOleInPlaceObject_Release(inplace);
@@ -2103,7 +2103,7 @@ static void test_change_ClientSite(IWebBrowser2 *unk)
hres = IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_UPDATECOMMANDS, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); - ok(hres == S_OK, "Exec(OLECMDID_UPDATECOMMAND) failed: %08x\n", hres); + ok(hres == S_OK, "Exec(OLECMDID_UPDATECOMMAND) failed: %08lx\n", hres);
CHECK_CALLED(Exec_UPDATECOMMANDS); use_container_olecmd = TRUE; @@ -2121,35 +2121,35 @@ static void test_ClassInfo(IWebBrowser2 *unk) HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IProvideClassInfo2, (void**)&class_info); - ok(hres == S_OK, "QueryInterface(IID_IProvideClassInfo) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_IProvideClassInfo) failed: %08lx\n", hres); if(FAILED(hres)) return;
hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &guid); - ok(hres == S_OK, "GetGUID failed: %08x\n", hres); + ok(hres == S_OK, "GetGUID failed: %08lx\n", hres); ok(IsEqualGUID(wb_version > 1 ? &DIID_DWebBrowserEvents2 : &DIID_DWebBrowserEvents, &guid), "wrong guid\n");
hres = IProvideClassInfo2_GetGUID(class_info, 0, &guid); - ok(hres == E_FAIL, "GetGUID failed: %08x, expected E_FAIL\n", hres); + ok(hres == E_FAIL, "GetGUID failed: %08lx, expected E_FAIL\n", hres); ok(IsEqualGUID(&IID_NULL, &guid), "wrong guid\n");
hres = IProvideClassInfo2_GetGUID(class_info, 2, &guid); - ok(hres == E_FAIL, "GetGUID failed: %08x, expected E_FAIL\n", hres); + ok(hres == E_FAIL, "GetGUID failed: %08lx, expected E_FAIL\n", hres); ok(IsEqualGUID(&IID_NULL, &guid), "wrong guid\n");
hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, NULL); - ok(hres == E_POINTER, "GetGUID failed: %08x, expected E_POINTER\n", hres); + ok(hres == E_POINTER, "GetGUID failed: %08lx, expected E_POINTER\n", hres);
hres = IProvideClassInfo2_GetGUID(class_info, 0, NULL); - ok(hres == E_POINTER, "GetGUID failed: %08x, expected E_POINTER\n", hres); + ok(hres == E_POINTER, "GetGUID failed: %08lx, expected E_POINTER\n", hres);
typeinfo = NULL; hres = IProvideClassInfo2_GetClassInfo(class_info, &typeinfo); - ok(hres == S_OK, "GetClassInfo failed: %08x\n", hres); + ok(hres == S_OK, "GetClassInfo failed: %08lx\n", hres); ok(typeinfo != NULL, "typeinfo == NULL\n");
hres = ITypeInfo_GetTypeAttr(typeinfo, &type_attr); - ok(hres == S_OK, "GetTypeAtr failed: %08x\n", hres); + ok(hres == S_OK, "GetTypeAtr failed: %08lx\n", hres);
ok(IsEqualGUID(&type_attr->guid, wb_version > 1 ? &CLSID_WebBrowser : &CLSID_WebBrowser_V1), "guid = %s\n", wine_dbgstr_guid(&type_attr->guid)); @@ -2163,10 +2163,10 @@ static void test_ClassInfo(IWebBrowser2 *unk) #define expect_oleverb(a,b) _expect_oleverb(__LINE__,a,b) static void _expect_oleverb(unsigned line, const OLEVERB *verb, LONG exverb) { - ok_(__FILE__,line)(verb->lVerb == exverb, "verb->lVerb = %d, expected %d\n", verb->lVerb, exverb); + ok_(__FILE__,line)(verb->lVerb == exverb, "verb->lVerb = %ld, expected %ld\n", verb->lVerb, exverb); ok_(__FILE__,line)(!verb->lpszVerbName, "verb->lpszVerbName = %s\n", wine_dbgstr_w(verb->lpszVerbName)); - ok_(__FILE__,line)(!verb->fuFlags, "verb->fuFlags = %x\n", verb->fuFlags); - ok_(__FILE__,line)(!verb->grfAttribs, "verb->grfAttribs = %x\n", verb->grfAttribs); + ok_(__FILE__,line)(!verb->fuFlags, "verb->fuFlags = %lx\n", verb->fuFlags); + ok_(__FILE__,line)(!verb->grfAttribs, "verb->grfAttribs = %lx\n", verb->grfAttribs); }
#define test_next_oleverb(a,b) _test_next_oleverb(__LINE__,a,b) @@ -2179,8 +2179,8 @@ static void _test_next_oleverb(unsigned line, IEnumOLEVERB *enum_verbs, LONG exv fetched = 0xdeadbeef; memset(&verb, 0xa, sizeof(verb)); hres = IEnumOLEVERB_Next(enum_verbs, 1, &verb, &fetched); - ok_(__FILE__,line)(hres == S_OK, "Next failed: %08x\n", hres); - ok_(__FILE__,line)(!fetched, "fetched = %d\n", fetched); + ok_(__FILE__,line)(hres == S_OK, "Next failed: %08lx\n", hres); + ok_(__FILE__,line)(!fetched, "fetched = %ld\n", fetched); _expect_oleverb(line, &verb, exverb); }
@@ -2193,23 +2193,23 @@ static void test_EnumVerbs(IWebBrowser2 *wb) HRESULT hres;
hres = IWebBrowser2_QueryInterface(wb, &IID_IOleObject, (void**)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %08lx\n", hres);
hres = IOleObject_EnumVerbs(oleobj, &enum_verbs); IOleObject_Release(oleobj); - ok(hres == S_OK, "EnumVerbs failed: %08x\n", hres); + ok(hres == S_OK, "EnumVerbs failed: %08lx\n", hres); ok(enum_verbs != NULL, "enum_verbs == NULL\n");
fetched = 0xdeadbeef; memset(verbs, 0xa, sizeof(verbs)); verbs[1].lVerb = 0xdeadbeef; hres = IEnumOLEVERB_Next(enum_verbs, ARRAY_SIZE(verbs), verbs, &fetched); - ok(hres == S_OK, "Next failed: %08x\n", hres); - ok(!fetched, "fetched = %d\n", fetched); + ok(hres == S_OK, "Next failed: %08lx\n", hres); + ok(!fetched, "fetched = %ld\n", fetched); /* Although fetched==0, an element is returned. */ expect_oleverb(verbs, OLEIVERB_PRIMARY); /* The first argument is ignored and always one element is returned. */ - ok(verbs[1].lVerb == 0xdeadbeef, "verbs[1].lVerb = %x\n", verbs[1].lVerb); + ok(verbs[1].lVerb == 0xdeadbeef, "verbs[1].lVerb = %lx\n", verbs[1].lVerb);
test_next_oleverb(enum_verbs, OLEIVERB_INPLACEACTIVATE); test_next_oleverb(enum_verbs, OLEIVERB_UIACTIVATE); @@ -2221,32 +2221,32 @@ static void test_EnumVerbs(IWebBrowser2 *wb) memset(verbs, 0xa, sizeof(verbs)); verbs[0].lVerb = 0xdeadbeef; hres = IEnumOLEVERB_Next(enum_verbs, ARRAY_SIZE(verbs), verbs, &fetched); - todo_wine ok(hres == S_OK, "Next failed: %08x\n", hres); - todo_wine ok(fetched == 1, "fetched = %d\n", fetched); - todo_wine ok(verbs[0].lVerb != 0xdeadbeef, "verbs[0].lVerb = %x\n", verbs[0].lVerb); + todo_wine ok(hres == S_OK, "Next failed: %08lx\n", hres); + todo_wine ok(fetched == 1, "fetched = %ld\n", fetched); + todo_wine ok(verbs[0].lVerb != 0xdeadbeef, "verbs[0].lVerb = %lx\n", verbs[0].lVerb);
hres = IEnumOLEVERB_Next(enum_verbs, ARRAY_SIZE(verbs), verbs, &fetched); - ok(hres == S_FALSE, "Next failed: %08x\n", hres); - ok(!fetched, "fetched = %d\n", fetched); + ok(hres == S_FALSE, "Next failed: %08lx\n", hres); + ok(!fetched, "fetched = %ld\n", fetched);
hres = IEnumOLEVERB_Reset(enum_verbs); - ok(hres == S_OK, "Reset failed: %08x\n", hres); + ok(hres == S_OK, "Reset failed: %08lx\n", hres);
fetched = 0xdeadbeef; hres = IEnumOLEVERB_Next(enum_verbs, 1, verbs, &fetched); - ok(hres == S_OK, "Next failed: %08x\n", hres); - ok(!fetched, "fetched = %d\n", fetched); + ok(hres == S_OK, "Next failed: %08lx\n", hres); + ok(!fetched, "fetched = %ld\n", fetched);
hres = IEnumOLEVERB_Next(enum_verbs, 1, verbs, NULL); - ok(hres == S_OK, "Next failed: %08x\n", hres); + ok(hres == S_OK, "Next failed: %08lx\n", hres);
hres = IEnumOLEVERB_Skip(enum_verbs, 20); - ok(hres == S_OK, "Reset failed: %08x\n", hres); + ok(hres == S_OK, "Reset failed: %08lx\n", hres);
fetched = 0xdeadbeef; hres = IEnumOLEVERB_Next(enum_verbs, 1, verbs, &fetched); - ok(hres == S_OK, "Next failed: %08x\n", hres); - ok(!fetched, "fetched = %d\n", fetched); + ok(hres == S_OK, "Next failed: %08lx\n", hres); + ok(!fetched, "fetched = %ld\n", fetched);
test_next_oleverb(enum_verbs, OLEIVERB_SHOW);
@@ -2260,10 +2260,10 @@ static void test_Persist(IWebBrowser2 *wb, int version) HRESULT hr;
hr = IWebBrowser2_QueryInterface(wb, &IID_IPersist, (void **)&persist); - ok(hr == S_OK, "QueryInterface(IID_IPersist) failed: %08x\n", hr); + ok(hr == S_OK, "QueryInterface(IID_IPersist) failed: %08lx\n", hr);
hr = IPersist_GetClassID(persist, &guid); - ok(hr == S_OK, "GetClassID failed: %08x\n", hr); + ok(hr == S_OK, "GetClassID failed: %08lx\n", hr); if (version == 1) ok(IsEqualGUID(&guid, &CLSID_WebBrowser_V1), "got wrong CLSID: %s\n", wine_dbgstr_guid(&guid)); else @@ -2279,10 +2279,10 @@ static void test_OleObject(IWebBrowser2 *wb, int version) HRESULT hr;
hr = IWebBrowser2_QueryInterface(wb, &IID_IOleObject, (void **)&oleobj); - ok(hr == S_OK, "QueryInterface(IID_IOleObject) failed: %08x\n", hr); + ok(hr == S_OK, "QueryInterface(IID_IOleObject) failed: %08lx\n", hr);
hr = IOleObject_GetUserClassID(oleobj, &clsid); - ok(hr == S_OK, "GetUserClassID failed: %08x\n", hr); + ok(hr == S_OK, "GetUserClassID failed: %08lx\n", hr); if (version == 1) ok(IsEqualGUID(&clsid, &CLSID_WebBrowser_V1), "got wrong CLSID: %s\n", wine_dbgstr_guid(&clsid)); else @@ -2304,218 +2304,218 @@ static void test_ie_funcs(IWebBrowser2 *wb)
hwnd = 0xdeadbeef; hres = IWebBrowser2_get_HWND(wb, &hwnd); - ok(hres == E_FAIL, "get_HWND failed: %08x, expected E_FAIL\n", hres); + ok(hres == E_FAIL, "get_HWND failed: %08lx, expected E_FAIL\n", hres); ok(hwnd == 0, "unexpected hwnd %p\n", (PVOID)hwnd);
/* MenuBar */
hres = IWebBrowser2_get_MenuBar(wb, &b); - ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "get_MenuBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONMENUBAR); hres = IWebBrowser2_put_MenuBar(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "put_MenuBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONMENUBAR);
hres = IWebBrowser2_get_MenuBar(wb, &b); - ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "get_MenuBar failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
SET_EXPECT(Invoke_ONMENUBAR); hres = IWebBrowser2_put_MenuBar(wb, (exvb = 100)); - ok(hres == S_OK, "put_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "put_MenuBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONMENUBAR);
hres = IWebBrowser2_get_MenuBar(wb, &b); - ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "get_MenuBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
/* AddressBar */
hres = IWebBrowser2_get_AddressBar(wb, &b); - ok(hres == S_OK, "get_AddressBar failed: %08x\n", hres); + ok(hres == S_OK, "get_AddressBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONADDRESSBAR); hres = IWebBrowser2_put_AddressBar(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_AddressBar failed: %08x\n", hres); + ok(hres == S_OK, "put_AddressBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONADDRESSBAR);
hres = IWebBrowser2_get_AddressBar(wb, &b); - ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "get_MenuBar failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
SET_EXPECT(Invoke_ONADDRESSBAR); hres = IWebBrowser2_put_AddressBar(wb, (exvb = 100)); - ok(hres == S_OK, "put_AddressBar failed: %08x\n", hres); + ok(hres == S_OK, "put_AddressBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONADDRESSBAR);
hres = IWebBrowser2_get_AddressBar(wb, &b); - ok(hres == S_OK, "get_AddressBar failed: %08x\n", hres); + ok(hres == S_OK, "get_AddressBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONADDRESSBAR); hres = IWebBrowser2_put_AddressBar(wb, (exvb = VARIANT_TRUE)); - ok(hres == S_OK, "put_MenuBar failed: %08x\n", hres); + ok(hres == S_OK, "put_MenuBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONADDRESSBAR);
/* StatusBar */
hres = IWebBrowser2_get_StatusBar(wb, &b); - ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "get_StatusBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONSTATUSBAR); hres = IWebBrowser2_put_StatusBar(wb, (exvb = VARIANT_TRUE)); - ok(hres == S_OK, "put_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "put_StatusBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONSTATUSBAR);
hres = IWebBrowser2_get_StatusBar(wb, &b); - ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "get_StatusBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONSTATUSBAR); hres = IWebBrowser2_put_StatusBar(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "put_StatusBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONSTATUSBAR);
hres = IWebBrowser2_get_StatusBar(wb, &b); - ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "get_StatusBar failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
SET_EXPECT(Invoke_ONSTATUSBAR); hres = IWebBrowser2_put_StatusBar(wb, (exvb = 100)); - ok(hres == S_OK, "put_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "put_StatusBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONSTATUSBAR);
hres = IWebBrowser2_get_StatusBar(wb, &b); - ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres); + ok(hres == S_OK, "get_StatusBar failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
/* ToolBar */
hres = IWebBrowser2_get_ToolBar(wb, &i); - ok(hres == S_OK, "get_ToolBar failed: %08x\n", hres); + ok(hres == S_OK, "get_ToolBar failed: %08lx\n", hres); ok(i, "i=%x\n", i);
SET_EXPECT(Invoke_ONTOOLBAR); hres = IWebBrowser2_put_ToolBar(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_ToolBar failed: %08x\n", hres); + ok(hres == S_OK, "put_ToolBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONTOOLBAR);
hres = IWebBrowser2_get_ToolBar(wb, &i); - ok(hres == S_OK, "get_ToolBar failed: %08x\n", hres); + ok(hres == S_OK, "get_ToolBar failed: %08lx\n", hres); ok(i == VARIANT_FALSE, "b=%x\n", i);
SET_EXPECT(Invoke_ONTOOLBAR); hres = IWebBrowser2_put_ToolBar(wb, (exvb = 100)); - ok(hres == S_OK, "put_ToolBar failed: %08x\n", hres); + ok(hres == S_OK, "put_ToolBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONTOOLBAR);
hres = IWebBrowser2_get_ToolBar(wb, &i); - ok(hres == S_OK, "get_ToolBar failed: %08x\n", hres); + ok(hres == S_OK, "get_ToolBar failed: %08lx\n", hres); ok(i, "i=%x\n", i);
SET_EXPECT(Invoke_ONTOOLBAR); hres = IWebBrowser2_put_ToolBar(wb, (exvb = VARIANT_TRUE)); - ok(hres == S_OK, "put_ToolBar failed: %08x\n", hres); + ok(hres == S_OK, "put_ToolBar failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONTOOLBAR);
/* FullScreen */
hres = IWebBrowser2_get_FullScreen(wb, &b); - ok(hres == S_OK, "get_FullScreen failed: %08x\n", hres); + ok(hres == S_OK, "get_FullScreen failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
SET_EXPECT(Invoke_ONFULLSCREEN); hres = IWebBrowser2_put_FullScreen(wb, (exvb = VARIANT_TRUE)); - ok(hres == S_OK, "put_FullScreen failed: %08x\n", hres); + ok(hres == S_OK, "put_FullScreen failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONFULLSCREEN);
hres = IWebBrowser2_get_FullScreen(wb, &b); - ok(hres == S_OK, "get_FullScreen failed: %08x\n", hres); + ok(hres == S_OK, "get_FullScreen failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONFULLSCREEN); hres = IWebBrowser2_put_FullScreen(wb, (exvb = 100)); - ok(hres == S_OK, "put_FullScreen failed: %08x\n", hres); + ok(hres == S_OK, "put_FullScreen failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONFULLSCREEN);
hres = IWebBrowser2_get_FullScreen(wb, &b); - ok(hres == S_OK, "get_FullScreen failed: %08x\n", hres); + ok(hres == S_OK, "get_FullScreen failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONFULLSCREEN); hres = IWebBrowser2_put_FullScreen(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_FullScreen failed: %08x\n", hres); + ok(hres == S_OK, "put_FullScreen failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONFULLSCREEN);
/* TheaterMode */
hres = IWebBrowser2_get_TheaterMode(wb, &b); - ok(hres == S_OK, "get_TheaterMode failed: %08x\n", hres); + ok(hres == S_OK, "get_TheaterMode failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
SET_EXPECT(Invoke_ONTHEATERMODE); hres = IWebBrowser2_put_TheaterMode(wb, (exvb = VARIANT_TRUE)); - ok(hres == S_OK, "put_TheaterMode failed: %08x\n", hres); + ok(hres == S_OK, "put_TheaterMode failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_get_TheaterMode(wb, &b); - ok(hres == S_OK, "get_TheaterMode failed: %08x\n", hres); + ok(hres == S_OK, "get_TheaterMode failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONTHEATERMODE); hres = IWebBrowser2_put_TheaterMode(wb, (exvb = 100)); - ok(hres == S_OK, "put_TheaterMode failed: %08x\n", hres); + ok(hres == S_OK, "put_TheaterMode failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_get_TheaterMode(wb, &b); - ok(hres == S_OK, "get_TheaterMode failed: %08x\n", hres); + ok(hres == S_OK, "get_TheaterMode failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONTHEATERMODE); hres = IWebBrowser2_put_TheaterMode(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_TheaterMode failed: %08x\n", hres); + ok(hres == S_OK, "put_TheaterMode failed: %08lx\n", hres); CHECK_CALLED(Invoke_ONTHEATERMODE);
/* Resizable */
b = 0x100; hres = IWebBrowser2_get_Resizable(wb, &b); - ok(hres == E_NOTIMPL, "get_Resizable failed: %08x\n", hres); + ok(hres == E_NOTIMPL, "get_Resizable failed: %08lx\n", hres); ok(b == 0x100, "b=%x\n", b);
SET_EXPECT(Invoke_WINDOWSETRESIZABLE); hres = IWebBrowser2_put_Resizable(wb, (exvb = VARIANT_TRUE)); - ok(hres == S_OK, "put_Resizable failed: %08x\n", hres); + ok(hres == S_OK, "put_Resizable failed: %08lx\n", hres); CHECK_CALLED(Invoke_WINDOWSETRESIZABLE);
SET_EXPECT(Invoke_WINDOWSETRESIZABLE); hres = IWebBrowser2_put_Resizable(wb, (exvb = VARIANT_FALSE)); - ok(hres == S_OK, "put_Resizable failed: %08x\n", hres); + ok(hres == S_OK, "put_Resizable failed: %08lx\n", hres); CHECK_CALLED(Invoke_WINDOWSETRESIZABLE);
hres = IWebBrowser2_get_Resizable(wb, &b); - ok(hres == E_NOTIMPL, "get_Resizable failed: %08x\n", hres); + ok(hres == E_NOTIMPL, "get_Resizable failed: %08lx\n", hres); ok(b == 0x100, "b=%x\n", b);
/* Application */
disp = NULL; hres = IWebBrowser2_get_Application(wb, &disp); - ok(hres == S_OK, "get_Application failed: %08x\n", hres); + ok(hres == S_OK, "get_Application failed: %08lx\n", hres); ok(disp == (void*)wb, "disp=%p, expected %p\n", disp, wb); if(disp) IDispatch_Release(disp);
hres = IWebBrowser2_get_Application(wb, NULL); - ok(hres == E_POINTER, "get_Application failed: %08x, expected E_POINTER\n", hres); + ok(hres == E_POINTER, "get_Application failed: %08lx, expected E_POINTER\n", hres);
/* Name */ hres = IWebBrowser2_get_Name(wb, &sName); - ok(hres == S_OK, "getName failed: %08x, expected S_OK\n", hres); + ok(hres == S_OK, "getName failed: %08lx, expected S_OK\n", hres); if (is_lang_english()) ok(!lstrcmpW(sName, L"Microsoft Web Browser Control"), "got '%s', expected 'Microsoft Web Browser Control'\n", wine_dbgstr_w(sName)); else /* Non-English cannot be blank. */ @@ -2524,12 +2524,12 @@ static void test_ie_funcs(IWebBrowser2 *wb)
/* RegisterAsDropTarget */ hres = IWebBrowser2_get_RegisterAsDropTarget(wb, NULL); - ok(hres == E_INVALIDARG, "get_RegisterAsDropTarget returned: %08x\n", hres); + ok(hres == E_INVALIDARG, "get_RegisterAsDropTarget returned: %08lx\n", hres);
/* Quit */
hres = IWebBrowser2_Quit(wb); - ok(hres == E_FAIL, "Quit failed: %08x, expected E_FAIL\n", hres); + ok(hres == E_FAIL, "Quit failed: %08lx, expected E_FAIL\n", hres); }
static void test_Silent(IWebBrowser2 *wb, IOleControl *control, BOOL is_clientsite) @@ -2539,49 +2539,49 @@ static void test_Silent(IWebBrowser2 *wb, IOleControl *control, BOOL is_clientsi
b = 100; hres = IWebBrowser2_get_Silent(wb, &b); - ok(hres == S_OK, "get_Silent failed: %08x\n", hres); + ok(hres == S_OK, "get_Silent failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
hres = IWebBrowser2_put_Silent(wb, VARIANT_TRUE); - ok(hres == S_OK, "set_Silent failed: %08x\n", hres); + ok(hres == S_OK, "set_Silent failed: %08lx\n", hres);
b = 100; hres = IWebBrowser2_get_Silent(wb, &b); - ok(hres == S_OK, "get_Silent failed: %08x\n", hres); + ok(hres == S_OK, "get_Silent failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
hres = IWebBrowser2_put_Silent(wb, 100); - ok(hres == S_OK, "set_Silent failed: %08x\n", hres); + ok(hres == S_OK, "set_Silent failed: %08lx\n", hres);
b = 100; hres = IWebBrowser2_get_Silent(wb, &b); - ok(hres == S_OK, "get_Silent failed: %08x\n", hres); + ok(hres == S_OK, "get_Silent failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
hres = IWebBrowser2_put_Silent(wb, VARIANT_FALSE); - ok(hres == S_OK, "set_Silent failed: %08x\n", hres); + ok(hres == S_OK, "set_Silent failed: %08lx\n", hres);
b = 100; hres = IWebBrowser2_get_Silent(wb, &b); - ok(hres == S_OK, "get_Silent failed: %08x\n", hres); + ok(hres == S_OK, "get_Silent failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
if(is_clientsite) { hres = IWebBrowser2_put_Silent(wb, VARIANT_TRUE); - ok(hres == S_OK, "set_Silent failed: %08x\n", hres); + ok(hres == S_OK, "set_Silent failed: %08lx\n", hres);
SET_EXPECT(Invoke_AMBIENT_SILENT); }
hres = IOleControl_OnAmbientPropertyChange(control, DISPID_AMBIENT_SILENT); - ok(hres == S_OK, "OnAmbientPropertyChange failed %08x\n", hres); + ok(hres == S_OK, "OnAmbientPropertyChange failed %08lx\n", hres);
if(is_clientsite) CHECK_CALLED(Invoke_AMBIENT_SILENT);
b = 100; hres = IWebBrowser2_get_Silent(wb, &b); - ok(hres == S_OK, "get_Silent failed: %08x\n", hres); + ok(hres == S_OK, "get_Silent failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b); }
@@ -2592,49 +2592,49 @@ static void test_Offline(IWebBrowser2 *wb, IOleControl *control, BOOL is_clients
b = 100; hres = IWebBrowser2_get_Offline(wb, &b); - ok(hres == S_OK, "get_Offline failed: %08x\n", hres); + ok(hres == S_OK, "get_Offline failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
hres = IWebBrowser2_put_Offline(wb, VARIANT_TRUE); - ok(hres == S_OK, "set_Offline failed: %08x\n", hres); + ok(hres == S_OK, "set_Offline failed: %08lx\n", hres);
b = 100; hres = IWebBrowser2_get_Offline(wb, &b); - ok(hres == S_OK, "get_Offline failed: %08x\n", hres); + ok(hres == S_OK, "get_Offline failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
hres = IWebBrowser2_put_Offline(wb, 100); - ok(hres == S_OK, "set_Offline failed: %08x\n", hres); + ok(hres == S_OK, "set_Offline failed: %08lx\n", hres);
b = 100; hres = IWebBrowser2_get_Offline(wb, &b); - ok(hres == S_OK, "get_Offline failed: %08x\n", hres); + ok(hres == S_OK, "get_Offline failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "b=%x\n", b);
hres = IWebBrowser2_put_Offline(wb, VARIANT_FALSE); - ok(hres == S_OK, "set_Offline failed: %08x\n", hres); + ok(hres == S_OK, "set_Offline failed: %08lx\n", hres);
b = 100; hres = IWebBrowser2_get_Offline(wb, &b); - ok(hres == S_OK, "get_Offline failed: %08x\n", hres); + ok(hres == S_OK, "get_Offline failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b);
if(is_clientsite) { hres = IWebBrowser2_put_Offline(wb, VARIANT_TRUE); - ok(hres == S_OK, "set_Offline failed: %08x\n", hres); + ok(hres == S_OK, "set_Offline failed: %08lx\n", hres);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); }
hres = IOleControl_OnAmbientPropertyChange(control, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED); - ok(hres == S_OK, "OnAmbientPropertyChange failed %08x\n", hres); + ok(hres == S_OK, "OnAmbientPropertyChange failed %08lx\n", hres);
if(is_clientsite) CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
b = 100; hres = IWebBrowser2_get_Offline(wb, &b); - ok(hres == S_OK, "get_Offline failed: %08x\n", hres); + ok(hres == S_OK, "get_Offline failed: %08lx\n", hres); ok(b == VARIANT_FALSE, "b=%x\n", b); }
@@ -2650,7 +2650,7 @@ static void test_ambient_unknown(IWebBrowser2 *wb, IOleControl *control, BOOL is SET_EXPECT(Invoke_AMBIENT_PALETTE);
hres = IOleControl_OnAmbientPropertyChange(control, DISPID_UNKNOWN); - ok(hres == S_OK, "OnAmbientPropertyChange failed %08x\n", hres); + ok(hres == S_OK, "OnAmbientPropertyChange failed %08lx\n", hres);
CHECK_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_EXPECT(Invoke_AMBIENT_SILENT); @@ -2673,7 +2673,7 @@ static void test_wb_funcs(IWebBrowser2 *wb, BOOL is_clientsite) HRESULT hres;
hres = IWebBrowser2_QueryInterface(wb, &IID_IOleControl, (void**)&control); - ok(hres == S_OK, "Could not get IOleControl interface: %08x\n", hres); + ok(hres == S_OK, "Could not get IOleControl interface: %08lx\n", hres);
test_Silent(wb, control, is_clientsite); test_Offline(wb, control, is_clientsite); @@ -2689,14 +2689,14 @@ static void test_GetControlInfo(IWebBrowser2 *unk) HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleControl, (void**)&control); - ok(hres == S_OK, "Could not get IOleControl: %08x\n", hres); + ok(hres == S_OK, "Could not get IOleControl: %08lx\n", hres); if(FAILED(hres)) return;
hres = IOleControl_GetControlInfo(control, &info); - ok(hres == E_NOTIMPL, "GetControlInfo failed: %08x, expected E_NOTIMPL\n", hres); + ok(hres == E_NOTIMPL, "GetControlInfo failed: %08lx, expected E_NOTIMPL\n", hres); hres = IOleControl_GetControlInfo(control, NULL); - ok(hres == E_NOTIMPL, "GetControlInfo failed: %08x, expected E_NOTIMPL\n", hres); + ok(hres == E_NOTIMPL, "GetControlInfo failed: %08lx, expected E_NOTIMPL\n", hres);
IOleControl_Release(control); } @@ -2716,66 +2716,66 @@ static void test_Extent(IWebBrowser2 *unk) dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); ReleaseDC(0, hdc); if (dpi_x != 96 || dpi_y != 96) - trace("dpi: %d / %d\n", dpi_y, dpi_y); + trace("dpi: %ld / %ld\n", dpi_y, dpi_y);
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj); - ok(hres == S_OK, "Could not get IOleObject: %08x\n", hres); + ok(hres == S_OK, "Could not get IOleObject: %08lx\n", hres); if(FAILED(hres)) return;
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); /* Default size is 50x20 pixels, in himetric units */ expected.cx = MulDiv( 50, 2540, dpi_x ); expected.cy = MulDiv( 20, 2540, dpi_y ); - ok(size.cx == expected.cx && size.cy == expected.cy, "size = {%d %d} (expected %d %d)\n", + ok(size.cx == expected.cx && size.cy == expected.cy, "size = {%ld %ld} (expected %ld %ld)\n", size.cx, size.cy, expected.cx, expected.cy );
size.cx = 800; size.cy = 700; hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &size); - ok(hres == S_OK, "SetExtent failed: %08x\n", hres); + ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 800 && size.cy == 700, "size = {%d %d}\n", size.cx, size.cy); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); + ok(size.cx == 800 && size.cy == 700, "size = {%ld %ld}\n", size.cx, size.cy);
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, 0, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 800 && size.cy == 700, "size = {%d %d}\n", size.cx, size.cy); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); + ok(size.cx == 800 && size.cy == 700, "size = {%ld %ld}\n", size.cx, size.cy);
size.cx = 900; size.cy = 800; hres = IOleObject_SetExtent(oleobj, 0, &size); - ok(hres == S_OK, "SetExtent failed: %08x\n", hres); + ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, 0, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 900 && size.cy == 800, "size = {%d %d}\n", size.cx, size.cy); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); + ok(size.cx == 900 && size.cy == 800, "size = {%ld %ld}\n", size.cx, size.cy);
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, 0xdeadbeef, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 900 && size.cy == 800, "size = {%d %d}\n", size.cx, size.cy); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); + ok(size.cx == 900 && size.cy == 800, "size = {%ld %ld}\n", size.cx, size.cy);
size.cx = 1000; size.cy = 900; hres = IOleObject_SetExtent(oleobj, 0xdeadbeef, &size); - ok(hres == S_OK, "SetExtent failed: %08x\n", hres); + ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, 0xdeadbeef, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 1000 && size.cy == 900, "size = {%d %d}\n", size.cx, size.cy); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); + ok(size.cx == 1000 && size.cy == 900, "size = {%ld %ld}\n", size.cx, size.cy);
size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size); - ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 1000 && size.cy == 900, "size = {%d %d}\n", size.cx, size.cy); + ok(hres == S_OK, "GetExtent failed: %08lx\n", hres); + ok(size.cx == 1000 && size.cy == 900, "size = {%ld %ld}\n", size.cx, size.cy);
IOleObject_Release(oleobj); } @@ -2789,23 +2789,23 @@ static void test_ConnectionPoint(IWebBrowser2 *unk, BOOL init) static DWORD dw = 100;
hres = IWebBrowser2_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container); - ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres); if(FAILED(hres)) return;
hres = IConnectionPointContainer_FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point); IConnectionPointContainer_Release(container); - ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres); + ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres); if(FAILED(hres)) return;
if(init) { hres = IConnectionPoint_Advise(point, (IUnknown*)&WebBrowserEvents2, &dw); - ok(hres == S_OK, "Advise failed: %08x\n", hres); - ok(dw == 1, "dw=%d, expected 1\n", dw); + ok(hres == S_OK, "Advise failed: %08lx\n", hres); + ok(dw == 1, "dw=%ld, expected 1\n", dw); }else { hres = IConnectionPoint_Unadvise(point, dw); - ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08lx\n", hres); }
IConnectionPoint_Release(point); @@ -2863,7 +2863,7 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const WCHAR *nav_url) }
hres = IWebBrowser2_Navigate2(webbrowser, &url, NULL, NULL, NULL, NULL); - ok(hres == S_OK, "Navigate2 failed: %08x\n", hres); + ok(hres == S_OK, "Navigate2 failed: %08lx\n", hres);
if(is_first_load) { CHECK_CALLED(Invoke_AMBIENT_USERMODE); @@ -2932,14 +2932,14 @@ static void test_QueryStatusWB(IWebBrowser2 *webbrowser, BOOL has_document) status = 0xdeadbeef; if (use_container_olecmd) SET_EXPECT(QueryStatus_STOP); hres = IWebBrowser2_QueryStatusWB(webbrowser, OLECMDID_STOP, &status); - ok(hres == success_state, "QueryStatusWB failed: %08x %08x\n", hres, success_state); + ok(hres == success_state, "QueryStatusWB failed: %08lx %08lx\n", hres, success_state); todo_wine_if (!use_container_olecmd && has_document) ok((has_document && status == success_flags) || (!has_document && status == 0xdeadbeef), "OLECMDID_STOP not enabled/supported: %08x %08x\n", status, success_flags); status = 0xdeadbeef; if (use_container_olecmd) SET_EXPECT(QueryStatus_IDM_STOP); hres = IWebBrowser2_QueryStatusWB(webbrowser, IDM_STOP, &status); - ok(hres == success_state, "QueryStatusWB failed: %08x %08x\n", hres, success_state); + ok(hres == success_state, "QueryStatusWB failed: %08lx %08lx\n", hres, success_state); ok((has_document && status == 0) || (!has_document && status == 0xdeadbeef), "IDM_STOP is enabled/supported: %08x %d\n", status, has_document); } @@ -2973,16 +2973,16 @@ static void test_ExecWB(IWebBrowser2 *webbrowser, BOOL has_document) } hres = IWebBrowser2_ExecWB(webbrowser, OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); if(!use_container_olecmd && has_document) { - todo_wine ok(hres == olecmdid_state, "ExecWB failed: %08x %08x\n", hres, olecmdid_state); + todo_wine ok(hres == olecmdid_state, "ExecWB failed: %08lx %08lx\n", hres, olecmdid_state); CLEAR_CALLED(Invoke_STATUSTEXTCHANGE); /* Called by IE9 */ CLEAR_CALLED(SetStatusText); /* Called by IE9 */ }else { - ok(hres == olecmdid_state, "ExecWB failed: %08x %08x\n", hres, olecmdid_state); + ok(hres == olecmdid_state, "ExecWB failed: %08lx %08lx\n", hres, olecmdid_state); } if (use_container_olecmd) SET_EXPECT(Exec_IDM_STOP); hres = IWebBrowser2_ExecWB(webbrowser, IDM_STOP, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); - ok(hres == idm_state, "ExecWB failed: %08x %08x\n", hres, idm_state); + ok(hres == idm_state, "ExecWB failed: %08lx %08lx\n", hres, idm_state); }
static void test_download(DWORD flags) @@ -3166,10 +3166,10 @@ static void test_Refresh(IWebBrowser2 *webbrowser, BOOL use_refresh2) V_I4(&v) = REFRESH_NORMAL;
hres = IWebBrowser2_Refresh2(webbrowser, &v); - ok(hres == S_OK, "Refresh failed: %08x\n", hres); + ok(hres == S_OK, "Refresh failed: %08lx\n", hres); }else { hres = IWebBrowser2_Refresh(webbrowser); - ok(hres == S_OK, "Refresh failed: %08x\n", hres); + ok(hres == S_OK, "Refresh failed: %08lx\n", hres); }
if(use_container_olecmd) @@ -3185,7 +3185,7 @@ static void test_olecmd(IWebBrowser2 *unk, BOOL loaded) HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleCommandTarget, (void**)&cmdtrg); - ok(hres == S_OK, "Could not get IOleCommandTarget iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IOleCommandTarget iface: %08lx\n", hres); if(FAILED(hres)) return;
@@ -3195,14 +3195,14 @@ static void test_olecmd(IWebBrowser2 *unk, BOOL loaded) cmds[1].cmdf = 0xdeadbeef; hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmds, NULL); if(loaded) { - ok(hres == S_OK, "QueryStatus failed: %08x\n", hres); - ok(cmds[0].cmdf == OLECMDF_SUPPORTED, "OLECMDID_SPELL cmdf = %x\n", cmds[0].cmdf); + ok(hres == S_OK, "QueryStatus failed: %08lx\n", hres); + ok(cmds[0].cmdf == OLECMDF_SUPPORTED, "OLECMDID_SPELL cmdf = %lx\n", cmds[0].cmdf); ok(cmds[1].cmdf == (OLECMDF_ENABLED|OLECMDF_SUPPORTED), - "OLECMDID_REFRESH cmdf = %x\n", cmds[1].cmdf); + "OLECMDID_REFRESH cmdf = %lx\n", cmds[1].cmdf); }else { - ok(hres == 0x80040104, "QueryStatus failed: %08x\n", hres); - ok(cmds[0].cmdf == 0xdeadbeef, "OLECMDID_SPELL cmdf = %x\n", cmds[0].cmdf); - ok(cmds[1].cmdf == 0xdeadbeef, "OLECMDID_REFRESH cmdf = %x\n", cmds[0].cmdf); + ok(hres == 0x80040104, "QueryStatus failed: %08lx\n", hres); + ok(cmds[0].cmdf == 0xdeadbeef, "OLECMDID_SPELL cmdf = %lx\n", cmds[0].cmdf); + ok(cmds[1].cmdf == 0xdeadbeef, "OLECMDID_REFRESH cmdf = %lx\n", cmds[0].cmdf); }
IOleCommandTarget_Release(cmdtrg); @@ -3215,18 +3215,18 @@ static void test_IServiceProvider(IWebBrowser2 *unk) HRESULT hres;
hres = IWebBrowser2_QueryInterface(unk, &IID_IServiceProvider, (void**)&servprov); - ok(hres == S_OK, "QueryInterface returned %08x, expected S_OK\n", hres); + ok(hres == S_OK, "QueryInterface returned %08lx, expected S_OK\n", hres); if(FAILED(hres)) return;
hres = IServiceProvider_QueryService(servprov, &SID_STopLevelBrowser, &IID_IBrowserService2, (LPVOID*)&iface); - ok(hres == E_FAIL, "QueryService returned %08x, expected E_FAIL\n", hres); + ok(hres == E_FAIL, "QueryService returned %08lx, expected E_FAIL\n", hres); ok(!iface, "QueryService returned %p, expected NULL\n", iface); if(hres == S_OK) IUnknown_Release(iface);
hres = IServiceProvider_QueryService(servprov, &SID_SHTMLWindow, &IID_IHTMLWindow2, (LPVOID*)&iface); - ok(hres == S_OK, "QueryService returned %08x, expected S_OK\n", hres); + ok(hres == S_OK, "QueryService returned %08lx, expected S_OK\n", hres); ok(iface != NULL, "QueryService returned NULL\n"); if(hres == S_OK) IUnknown_Release(iface); @@ -3248,7 +3248,7 @@ static void test_put_href(IWebBrowser2 *unk, const WCHAR *url) location = NULL; hres = IHTMLDocument2_get_location(doc, &location); IHTMLDocument2_Release(doc); - ok(hres == S_OK, "get_location failed: %08x\n", hres); + ok(hres == S_OK, "get_location failed: %08lx\n", hres); ok(location != NULL, "location == NULL\n");
is_http = !wcsncmp(url, L"http:", 5); @@ -3271,7 +3271,7 @@ static void test_put_href(IWebBrowser2 *unk, const WCHAR *url)
IHTMLLocation_Release(location); SysFreeString(str); - ok(hres == S_OK, "put_href failed: %08x\n", hres); + ok(hres == S_OK, "put_href failed: %08lx\n", hres);
test_ready_state(READYSTATE_COMPLETE, VARIANT_FALSE); } @@ -3297,7 +3297,7 @@ static void test_go_back(IWebBrowser2 *wb, const WCHAR *back_url, int back_enabl nav_forward_todo = forward_todo; SET_EXPECT(Invoke_PROPERTYCHANGE); hres = IWebBrowser2_GoBack(wb); - ok(hres == S_OK, "GoBack failed: %08x\n", hres); + ok(hres == S_OK, "GoBack failed: %08lx\n", hres); CHECK_CALLED(Invoke_BEFORENAVIGATE2); nav_forward_todo = FALSE;
@@ -3338,7 +3338,7 @@ static void test_go_forward(IWebBrowser2 *wb, const WCHAR *forward_url, int back SET_EXPECT(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_FALSE);
hres = IWebBrowser2_GoForward(wb); - ok(hres == S_OK, "GoForward failed: %08x\n", hres); + ok(hres == S_OK, "GoForward failed: %08lx\n", hres); CHECK_CALLED(Invoke_BEFORENAVIGATE2);
if(back_enable) @@ -3367,39 +3367,39 @@ static void test_QueryInterface(IWebBrowser2 *wb) HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IQuickActivate, (void**)&qa); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(qa == NULL, "qa=%p, expected NULL\n", qa);
hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&runnable); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(runnable == NULL, "runnable=%p, expected NULL\n", runnable);
hres = IUnknown_QueryInterface(unk, &IID_IPerPropertyBrowsing, (void**)&propbrowse); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(propbrowse == NULL, "propbrowse=%p, expected NULL\n", propbrowse);
hres = IUnknown_QueryInterface(unk, &IID_IOleCache, (void**)&cache); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(cache == NULL, "cache=%p, expected NULL\n", cache);
hres = IUnknown_QueryInterface(unk, &IID_IOleInPlaceSite, (void**)&inplace); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(inplace == NULL, "inplace=%p, expected NULL\n", inplace);
hres = IUnknown_QueryInterface(unk, &IID_IObjectWithSite, (void**)&site); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(site == NULL, "site=%p, expected NULL\n", site);
hres = IUnknown_QueryInterface(unk, &IID_IViewObjectEx, (void**)&viewex); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(viewex == NULL, "viewex=%p, expected NULL\n", viewex);
hres = IUnknown_QueryInterface(unk, &IID_IOleLink, (void**)&link); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(link == NULL, "link=%p, expected NULL\n", link);
hres = IUnknown_QueryInterface(unk, &IID_IMarshal, (void**)&marshal); - ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); ok(marshal == NULL, "marshal=%p, expected NULL\n", marshal);
} @@ -3413,7 +3413,7 @@ static void test_UIActivate(IWebBrowser2 *unk, BOOL activate) doc = get_document(unk);
hres = IHTMLDocument2_QueryInterface(doc, &IID_IOleDocumentView, (void**)&docview); - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) { if(activate) { SET_EXPECT(RequestUIActivate); @@ -3424,7 +3424,7 @@ static void test_UIActivate(IWebBrowser2 *unk, BOOL activate)
hres = IOleDocumentView_UIActivate(docview, activate); todo_wine_if(activate) - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres);
if(activate) { todo_wine { @@ -3451,7 +3451,7 @@ static void test_external(IWebBrowser2 *unk) client = get_dochost(unk);
hres = IOleClientSite_QueryInterface(client, &IID_IDocHostUIHandler2, (void**)&dochost); - ok(hres == S_OK, "Could not get IDocHostUIHandler2 iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDocHostUIHandler2 iface: %08lx\n", hres); IOleClientSite_Release(client);
if(use_container_dochostui) @@ -3460,16 +3460,16 @@ static void test_external(IWebBrowser2 *unk) hres = IDocHostUIHandler2_GetExternal(dochost, &disp); if(use_container_dochostui) { CHECK_CALLED(GetExternal); - ok(hres == S_FALSE, "GetExternal failed: %08x\n", hres); + ok(hres == S_FALSE, "GetExternal failed: %08lx\n", hres); ok(!disp, "disp = %p\n", disp); }else { IShellUIHelper *uihelper;
- ok(hres == S_OK, "GetExternal failed: %08x\n", hres); + ok(hres == S_OK, "GetExternal failed: %08lx\n", hres); ok(disp != NULL, "disp == NULL\n");
hres = IDispatch_QueryInterface(disp, &IID_IShellUIHelper, (void**)&uihelper); - ok(hres == S_OK, "Could not get IShellUIHelper iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IShellUIHelper iface: %08lx\n", hres); IShellUIHelper_Release(uihelper); IDispatch_Release(disp); } @@ -3486,13 +3486,13 @@ static void test_htmlwindow_close(IWebBrowser2 *wb) doc = get_document(wb);
hres = IHTMLDocument2_get_parentWindow(doc, &window); - ok(hres == S_OK, "get_parentWindow failed: %08x\n", hres); + ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres); IHTMLDocument2_Release(doc);
SET_EXPECT(Invoke_WINDOWCLOSING);
hres = IHTMLWindow2_close(window); - ok(hres == S_OK, "close failed: %08x\n", hres); + ok(hres == S_OK, "close failed: %08lx\n", hres);
CHECK_CALLED(Invoke_WINDOWCLOSING);
@@ -3515,19 +3515,19 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk) test_Navigate2(unk, L"about:blank");
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleInPlaceActiveObject, (void**)&pao); - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) { /* One accelerator that should be handled by mshtml */ msg_a.message = WM_KEYDOWN; msg_a.wParam = VK_F1; hres = IOleInPlaceActiveObject_TranslateAccelerator(pao, &msg_a); - ok(hres == S_FALSE, "Got 0x%08x (%04x::%02lx)\n", hres, msg_a.message, msg_a.wParam); + ok(hres == S_FALSE, "Got 0x%08lx (%04x::%02Ix)\n", hres, msg_a.message, msg_a.wParam);
/* And one that should not */ msg_a.message = WM_KEYDOWN; msg_a.wParam = VK_F5; hres = IOleInPlaceActiveObject_TranslateAccelerator(pao, &msg_a); - ok(hres == S_FALSE, "Got 0x%08x (%04x::%02lx)\n", hres, msg_a.message, msg_a.wParam); + ok(hres == S_FALSE, "Got 0x%08lx (%04x::%02Ix)\n", hres, msg_a.message, msg_a.wParam);
IOleInPlaceActiveObject_Release(pao); } @@ -3536,7 +3536,7 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk)
/* Test again after UIActivate */ hres = IWebBrowser2_QueryInterface(unk, &IID_IOleInPlaceActiveObject, (void**)&pao); - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) { /* One accelerator that should be handled by mshtml */ msg_a.message = WM_KEYDOWN; @@ -3544,7 +3544,7 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk) SET_EXPECT(DocHost_TranslateAccelerator); SET_EXPECT(ControlSite_TranslateAccelerator); hres = IOleInPlaceActiveObject_TranslateAccelerator(pao, &msg_a); - ok(hres == S_FALSE, "Got 0x%08x (%04x::%02lx)\n", hres, msg_a.message, msg_a.wParam); + ok(hres == S_FALSE, "Got 0x%08lx (%04x::%02Ix)\n", hres, msg_a.message, msg_a.wParam); todo_wine CHECK_CALLED(DocHost_TranslateAccelerator); todo_wine CHECK_CALLED(ControlSite_TranslateAccelerator);
@@ -3553,7 +3553,7 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk) msg_a.wParam = VK_F5; SET_EXPECT(DocHost_TranslateAccelerator); hres = IOleInPlaceActiveObject_TranslateAccelerator(pao, &msg_a); - todo_wine ok(hres == S_OK, "Got 0x%08x (%04x::%02lx)\n", hres, msg_a.message, msg_a.wParam); + todo_wine ok(hres == S_OK, "Got 0x%08lx (%04x::%02Ix)\n", hres, msg_a.message, msg_a.wParam); todo_wine CHECK_CALLED(DocHost_TranslateAccelerator);
IOleInPlaceActiveObject_Release(pao); @@ -3566,19 +3566,19 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk) IUnknown *unk_test;
hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IOleInPlaceFrame, (void**)&unk_test); - ok(hres == E_NOINTERFACE, "Got 0x%08x\n", hres); + ok(hres == E_NOINTERFACE, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) IUnknown_Release(unk_test);
hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IDocHostShowUI, (void**)&unk_test); - todo_wine ok(hres == S_OK, "Got 0x%08x\n", hres); + todo_wine ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) IUnknown_Release(unk_test);
hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IDocHostUIHandler, (void**)&unk_test); - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) IUnknown_Release(unk_test);
hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IDocHostUIHandler2, (void**)&dochost); - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) { msg_a.message = WM_KEYDOWN; hr_dochost_TranslateAccelerator = 0xdeadbeef; @@ -3586,21 +3586,21 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk) msg_a.wParam = keycode; SET_EXPECT(DocHost_TranslateAccelerator); hres = IDocHostUIHandler2_TranslateAccelerator(dochost, &msg_a, &CGID_MSHTML, 1234); - ok(hres == 0xdeadbeef, "Got 0x%08x\n", hres); + ok(hres == 0xdeadbeef, "Got 0x%08lx\n", hres); CHECK_CALLED(DocHost_TranslateAccelerator); } hr_dochost_TranslateAccelerator = E_NOTIMPL;
SET_EXPECT(DocHost_TranslateAccelerator); hres = IDocHostUIHandler2_TranslateAccelerator(dochost, &msg_a, &CGID_MSHTML, 1234); - ok(hres == E_NOTIMPL, "Got 0x%08x\n", hres); + ok(hres == E_NOTIMPL, "Got 0x%08lx\n", hres); CHECK_CALLED(DocHost_TranslateAccelerator);
IDocHostUIHandler2_Release(dochost); }
hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IOleControlSite, (void**)&doc_controlsite); - ok(hres == S_OK, "Got 0x%08x\n", hres); + ok(hres == S_OK, "Got 0x%08lx\n", hres); if(SUCCEEDED(hres)) { msg_a.message = WM_KEYDOWN; hr_site_TranslateAccelerator = 0xdeadbeef; @@ -3609,28 +3609,28 @@ static void test_TranslateAccelerator(IWebBrowser2 *unk) SET_EXPECT(ControlSite_TranslateAccelerator); hres = IOleControlSite_TranslateAccelerator(doc_controlsite, &msg_a, 0); if(keycode == 0x9 || keycode == 0x75) - todo_wine ok(hres == S_OK, "Got 0x%08x (keycode: %04x)\n", hres, keycode); + todo_wine ok(hres == S_OK, "Got 0x%08lx (keycode: %04lx)\n", hres, keycode); else - ok(hres == S_FALSE, "Got 0x%08x (keycode: %04x)\n", hres, keycode); + ok(hres == S_FALSE, "Got 0x%08lx (keycode: %04lx)\n", hres, keycode);
CHECK_CALLED(ControlSite_TranslateAccelerator); } msg_a.wParam = VK_LEFT; SET_EXPECT(ControlSite_TranslateAccelerator); hres = IOleControlSite_TranslateAccelerator(doc_controlsite, &msg_a, 0); - ok(hres == S_FALSE, "Got 0x%08x (keycode: %04x)\n", hres, keycode); + ok(hres == S_FALSE, "Got 0x%08lx (keycode: %04lx)\n", hres, keycode); CHECK_CALLED(ControlSite_TranslateAccelerator);
hr_site_TranslateAccelerator = S_OK; SET_EXPECT(ControlSite_TranslateAccelerator); hres = IOleControlSite_TranslateAccelerator(doc_controlsite, &msg_a, 0); - ok(hres == S_OK, "Got 0x%08x (keycode: %04x)\n", hres, keycode); + ok(hres == S_OK, "Got 0x%08lx (keycode: %04lx)\n", hres, keycode); CHECK_CALLED(ControlSite_TranslateAccelerator);
hr_site_TranslateAccelerator = E_NOTIMPL; SET_EXPECT(ControlSite_TranslateAccelerator); hres = IOleControlSite_TranslateAccelerator(doc_controlsite, &msg_a, 0); - ok(hres == S_FALSE, "Got 0x%08x (keycode: %04x)\n", hres, keycode); + ok(hres == S_FALSE, "Got 0x%08lx (keycode: %04lx)\n", hres, keycode); CHECK_CALLED(ControlSite_TranslateAccelerator);
IOleControlSite_Release(doc_controlsite); @@ -3652,33 +3652,33 @@ static void test_dochost_qs(IWebBrowser2 *webbrowser) client_site = get_dochost(webbrowser); hres = IOleClientSite_QueryInterface(client_site, &IID_IServiceProvider, (void**)&serv_prov); IOleClientSite_Release(client_site); - ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres);
hres = IServiceProvider_QueryService(serv_prov, &IID_IHlinkFrame, &IID_IHlinkFrame, (void**)&service); - ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(hres == S_OK, "QueryService failed: %08lx\n", hres); ok(iface_cmp(service, (IUnknown*)webbrowser), "service != unk\n"); IUnknown_Release(service);
hres = IServiceProvider_QueryService(serv_prov, &IID_IWebBrowserApp, &IID_IHlinkFrame, (void**)&service); - ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(hres == S_OK, "QueryService failed: %08lx\n", hres); ok(iface_cmp(service, (IUnknown*)webbrowser), "service != unk\n"); IUnknown_Release(service);
hres = IServiceProvider_QueryService(serv_prov, &IID_ITargetFrame, &IID_ITargetFrame, (void**)&service); - ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(hres == S_OK, "QueryService failed: %08lx\n", hres); ok(iface_cmp(service, (IUnknown*)webbrowser), "service != unk\n"); IUnknown_Release(service);
hres = IServiceProvider_QueryService(serv_prov, &IID_IShellBrowser, &IID_IShellBrowser, (void**)&service); - ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(hres == S_OK, "QueryService failed: %08lx\n", hres); IUnknown_Release(service);
hres = IServiceProvider_QueryService(serv_prov, &IID_IShellBrowser, &IID_IBrowserService, (void**)&service); - ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(hres == S_OK, "QueryService failed: %08lx\n", hres); IUnknown_Release(service);
hres = IServiceProvider_QueryService(serv_prov, &IID_IShellBrowser, &IID_IDocObjectService, (void**)&service); - ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(hres == S_OK, "QueryService failed: %08lx\n", hres); IUnknown_Release(service);
IServiceProvider_Release(serv_prov); @@ -3691,7 +3691,7 @@ static void test_Close(IWebBrowser2 *wb, BOOL do_download) HRESULT hres;
hres = IWebBrowser2_QueryInterface(wb, &IID_IOleObject, (void**)&oo); - ok(hres == S_OK, "QueryInterface failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface failed: %08lx\n", hres); if(hres != S_OK) return;
@@ -3718,7 +3718,7 @@ static void test_Close(IWebBrowser2 *wb, BOOL do_download) } SET_EXPECT(Advise_OnClose); hres = IOleObject_Close(oo, OLECLOSE_NOSAVE); - ok(hres == S_OK, "OleObject_Close failed: %x\n", hres); + ok(hres == S_OK, "OleObject_Close failed: %lx\n", hres); CHECK_CALLED(Frame_SetActiveObject); CHECK_CALLED(UIWindow_SetActiveObject); CHECK_CALLED(OnUIDeactivate); @@ -3741,7 +3741,7 @@ static void test_Close(IWebBrowser2 *wb, BOOL do_download) CHECK_CALLED(Advise_OnClose);
hres = IOleObject_GetClientSite(oo, &ocs); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres); ok(!ocs, "ocs != NULL\n");
SET_EXPECT(GetContainer); @@ -3750,14 +3750,14 @@ static void test_Close(IWebBrowser2 *wb, BOOL do_download) SET_EXPECT(Invoke_AMBIENT_SILENT); hres = IOleObject_DoVerb(oo, OLEIVERB_HIDE, NULL, (IOleClientSite*)0xdeadbeef, 0, (HWND)0xdeadbeef, NULL); - ok(hres == S_OK, "DoVerb failed: %08x\n", hres); + ok(hres == S_OK, "DoVerb failed: %08lx\n", hres); CHECK_CALLED(GetContainer); CHECK_CALLED(Site_GetWindow); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); CHECK_CALLED(Invoke_AMBIENT_SILENT);
hres = IOleObject_GetClientSite(oo, &ocs); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres); ok(ocs == &ClientSite, "ocs != &ClientSite\n"); if(ocs) IOleClientSite_Release(ocs); @@ -3767,7 +3767,7 @@ static void test_Close(IWebBrowser2 *wb, BOOL do_download) SET_EXPECT(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_FALSE); SET_EXPECT(Advise_OnClose); hres = IOleObject_Close(oo, OLECLOSE_NOSAVE); - ok(hres == S_OK, "OleObject_Close failed: %x\n", hres); + ok(hres == S_OK, "OleObject_Close failed: %lx\n", hres); CHECK_NOT_CALLED(OnFocus_FALSE); todo_wine CHECK_NOT_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEBACK_FALSE); todo_wine CHECK_NOT_CALLED(Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD_FALSE); @@ -3785,42 +3785,42 @@ static void test_Advise(IWebBrowser2 *wb) HRESULT hres;
hres = IWebBrowser2_QueryInterface(wb, &IID_IOleObject, (void **)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %08lx\n", hres);
hres = IOleObject_Unadvise(oleobj, 0); - ok(hres == OLE_E_NOCONNECTION, "Unadvise returned: %08x\n", hres); + ok(hres == OLE_E_NOCONNECTION, "Unadvise returned: %08lx\n", hres);
data = (void *)0xdeadbeef; hres = IOleObject_EnumAdvise(oleobj, &data); - ok(hres == E_NOTIMPL, "EnumAdvise returned: %08x\n", hres); + ok(hres == E_NOTIMPL, "EnumAdvise returned: %08lx\n", hres); ok(data == NULL, "got data %p\n", data);
connection[0] = 0xdeadbeef; hres = IOleObject_Advise(oleobj, NULL, &connection[0]); - ok(hres == E_INVALIDARG, "Advise returned: %08x\n", hres); - ok(connection[0] == 0, "got connection %u\n", connection[0]); + ok(hres == E_INVALIDARG, "Advise returned: %08lx\n", hres); + ok(connection[0] == 0, "got connection %lu\n", connection[0]);
hres = IOleObject_Advise(oleobj, &test_sink, NULL); - ok(hres == E_INVALIDARG, "Advise returned: %08x\n", hres); + ok(hres == E_INVALIDARG, "Advise returned: %08lx\n", hres);
connection[0] = 0xdeadbeef; hres = IOleObject_Advise(oleobj, &test_sink, &connection[0]); - ok(hres == S_OK, "Advise returned: %08x\n", hres); - ok(connection[0] != 0xdeadbeef, "got connection %u\n", connection[0]); + ok(hres == S_OK, "Advise returned: %08lx\n", hres); + ok(connection[0] != 0xdeadbeef, "got connection %lu\n", connection[0]);
connection[1] = 0xdeadbeef; hres = IOleObject_Advise(oleobj, &test_sink, &connection[1]); - ok(hres == S_OK, "Advise returned: %08x\n", hres); - ok(connection[1] == connection[0] + 1, "got connection %u\n", connection[1]); + ok(hres == S_OK, "Advise returned: %08lx\n", hres); + ok(connection[1] == connection[0] + 1, "got connection %lu\n", connection[1]);
hres = IOleObject_Unadvise(oleobj, connection[1]); - ok(hres == S_OK, "Unadvise returned: %08x\n", hres); + ok(hres == S_OK, "Unadvise returned: %08lx\n", hres);
hres = IOleObject_Unadvise(oleobj, connection[1]); - ok(hres == OLE_E_NOCONNECTION, "Unadvise returned: %08x\n", hres); + ok(hres == OLE_E_NOCONNECTION, "Unadvise returned: %08lx\n", hres);
hres = IOleObject_Unadvise(oleobj, connection[0]); - ok(hres == S_OK, "Unadvise returned: %08x\n", hres); + ok(hres == S_OK, "Unadvise returned: %08lx\n", hres);
IOleObject_Release(oleobj); } @@ -3854,10 +3854,10 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) init_test(webbrowser, flags);
hres = IWebBrowser2_QueryInterface(webbrowser, &IID_IOleObject, (void **)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08lx\n", hres);
hres = IOleObject_Advise(oleobj, &test_sink, &connection); - ok(hres == S_OK, "Advise failed: %08x\n", hres); + ok(hres == S_OK, "Advise failed: %08lx\n", hres);
test_QueryStatusWB(webbrowser, FALSE); test_ExecWB(webbrowser, FALSE); @@ -3964,12 +3964,12 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) test_IServiceProvider(webbrowser);
hres = IOleObject_Unadvise(oleobj, connection); - ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IOleObject_Release(oleobj);
ref = IWebBrowser2_Release(webbrowser); - ok(ref == 0 || broken(do_download && !do_close), "ref=%d, expected 0\n", ref); + ok(ref == 0 || broken(do_download && !do_close), "ref=%ld, expected 0\n", ref); }
static void test_WebBrowserV1(void) @@ -3981,16 +3981,16 @@ static void test_WebBrowserV1(void)
hres = CoCreateInstance(&CLSID_WebBrowser_V1, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IWebBrowser2, (void**)&wb); - ok(hres == S_OK, "Could not get WebBrowserV1 instance: %08x\n", hres); + ok(hres == S_OK, "Could not get WebBrowserV1 instance: %08lx\n", hres);
init_test(wb, 0); wb_version = 1;
hres = IWebBrowser2_QueryInterface(wb, &IID_IOleObject, (void **)&oleobj); - ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres); + ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08lx\n", hres);
hres = IOleObject_Advise(oleobj, &test_sink, &connection); - ok(hres == S_OK, "Advise failed: %08x\n", hres); + ok(hres == S_OK, "Advise failed: %08lx\n", hres);
test_QueryStatusWB(wb, FALSE); test_ExecWB(wb, FALSE); @@ -4003,12 +4003,12 @@ static void test_WebBrowserV1(void) test_Advise(wb);
hres = IOleObject_Unadvise(oleobj, connection); - ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IOleObject_Release(oleobj);
ref = IWebBrowser2_Release(wb); - ok(ref == 0, "ref=%d, expected 0\n", ref); + ok(ref == 0, "ref=%ld, expected 0\n", ref); }
static void test_WebBrowser_slim_container(void) @@ -4034,7 +4034,7 @@ static void test_WebBrowser_slim_container(void) test_ConnectionPoint(webbrowser, FALSE);
ref = IWebBrowser2_Release(webbrowser); - ok(ref == 0, "ref=%d, expected 0\n", ref); + ok(ref == 0, "ref=%ld, expected 0\n", ref); }
static void test_WebBrowser_DoVerb(void) @@ -4072,7 +4072,7 @@ static void test_WebBrowser_DoVerb(void)
memset(&rect, 0xa, sizeof(rect)); res = GetWindowRect(hwnd, &rect); - ok(res, "GetWindowRect failed: %u\n", GetLastError()); + ok(res, "GetWindowRect failed: %lu\n", GetLastError());
SET_EXPECT(OnInPlaceDeactivate); call_DoVerb(webbrowser, OLEIVERB_HIDE); @@ -4080,7 +4080,7 @@ static void test_WebBrowser_DoVerb(void)
b = 0x100; hres = IWebBrowser2_get_Visible(webbrowser, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
SET_EXPECT(CanInPlaceActivate); @@ -4111,7 +4111,7 @@ static void test_WebBrowser_DoVerb(void)
b = 0x100; hres = IWebBrowser2_get_Visible(webbrowser, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
call_DoVerb(webbrowser, OLEIVERB_SHOW); @@ -4133,7 +4133,7 @@ static void test_WebBrowser_DoVerb(void)
b = 0x100; hres = IWebBrowser2_get_Visible(webbrowser, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
SET_EXPECT(CanInPlaceActivate); @@ -4164,7 +4164,7 @@ static void test_WebBrowser_DoVerb(void)
b = 0x100; hres = IWebBrowser2_get_Visible(webbrowser, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
SET_EXPECT(Frame_SetActiveObject); @@ -4185,7 +4185,7 @@ static void test_WebBrowser_DoVerb(void)
b = 0x100; hres = IWebBrowser2_get_Visible(webbrowser, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
SET_EXPECT(CanInPlaceActivate); @@ -4216,7 +4216,7 @@ static void test_WebBrowser_DoVerb(void)
b = 0x100; hres = IWebBrowser2_get_Visible(webbrowser, &b); - ok(hres == S_OK, "get_Visible failed: %08x\n", hres); + ok(hres == S_OK, "get_Visible failed: %08lx\n", hres); ok(b == VARIANT_TRUE, "Visible = %x\n", b);
call_DoVerb(webbrowser, OLEIVERB_SHOW); @@ -4224,7 +4224,7 @@ static void test_WebBrowser_DoVerb(void) test_ClientSite(webbrowser, NULL, FALSE);
ref = IWebBrowser2_Release(webbrowser); - ok(ref == 0, "ref=%d, expected 0\n", ref); + ok(ref == 0, "ref=%ld, expected 0\n", ref); }
@@ -4285,7 +4285,7 @@ static void test_FileProtocol(void) test_ClientSite(webbrowser, NULL, TRUE);
ref = IWebBrowser2_Release(webbrowser); - ok(ref == 0, "ref=%u, expected 0\n", ref); + ok(ref == 0, "ref=%lu, expected 0\n", ref);
if(file != INVALID_HANDLE_VALUE) DeleteFileW(file_path); @@ -4322,7 +4322,7 @@ static void WINAPI sink_OnDataChange(IAdviseSink *iface, FORMATETC *format, STGM
static void WINAPI sink_OnViewChange(IAdviseSink *iface, DWORD aspect, LONG index) { - trace("OnViewChange(%p, %08x, %d)\n", iface, aspect, index); + trace("OnViewChange(%p, %08lx, %ld)\n", iface, aspect, index); }
static void WINAPI sink_OnRename(IAdviseSink *iface, IMoniker *moniker) @@ -4369,37 +4369,37 @@ static void test_SetAdvise(void) init_test(browser, 0);
hr = IWebBrowser2_QueryInterface(browser, &IID_IViewObject2, (void **)&view); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); if (FAILED(hr)) return;
aspects = flags = 0xdeadbeef; sink = (IAdviseSink *)0xdeadbeef; hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink); - ok(hr == S_OK, "got %08x\n", hr); - ok(!aspects, "got %08x\n", aspects); - ok(!flags, "got %08x\n", aspects); + ok(hr == S_OK, "got %08lx\n", hr); + ok(!aspects, "got %08lx\n", aspects); + ok(!flags, "got %08lx\n", aspects); ok(sink == NULL, "got %p\n", sink);
hr = IViewObject2_SetAdvise(view, DVASPECT_CONTENT, 0, &test_sink); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
aspects = flags = 0xdeadbeef; sink = (IAdviseSink *)0xdeadbeef; hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink); - ok(hr == S_OK, "got %08x\n", hr); - ok(aspects == DVASPECT_CONTENT, "got %08x\n", aspects); - ok(!flags, "got %08x\n", aspects); + ok(hr == S_OK, "got %08lx\n", hr); + ok(aspects == DVASPECT_CONTENT, "got %08lx\n", aspects); + ok(!flags, "got %08lx\n", aspects); ok(sink == &test_sink, "got %p\n", sink);
hr = IWebBrowser2_QueryInterface(browser, &IID_IOleObject, (void **)&oleobj); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
SET_EXPECT(GetContainer); SET_EXPECT(Site_GetWindow); SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); SET_EXPECT(Invoke_AMBIENT_SILENT); hr = IOleObject_SetClientSite(oleobj, &ClientSite); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); CHECK_CALLED(GetContainer); CHECK_CALLED(Site_GetWindow); CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); @@ -4407,24 +4407,24 @@ static void test_SetAdvise(void)
sink = (IAdviseSink *)0xdeadbeef; hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(sink == &test_sink, "got %p\n", sink);
hr = IOleObject_SetClientSite(oleobj, NULL); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
aspects = flags = 0xdeadbeef; sink = (IAdviseSink *)0xdeadbeef; hr = IViewObject2_GetAdvise(view, &aspects, &flags, &sink); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(sink == &test_sink, "got %p\n", sink);
hr = IViewObject2_SetAdvise(view, 0, 0, NULL); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
doc = (void*)0xdeadbeef; hr = IWebBrowser2_get_Document(browser, &doc); - ok(hr == S_FALSE, "get_Document failed: %08x\n", hr); + ok(hr == S_FALSE, "get_Document failed: %08lx\n", hr); ok(!doc, "doc = %p\n", doc);
IOleObject_Release(oleobj); @@ -4437,19 +4437,19 @@ static void test_SetQueryNetSessionCount(void) LONG count, init_count;
init_count = pSetQueryNetSessionCount(SESSION_QUERY); - trace("init_count %d\n", init_count); + trace("init_count %ld\n", init_count);
count = pSetQueryNetSessionCount(SESSION_INCREMENT); - ok(count == init_count + 1, "count = %d\n", count); + ok(count == init_count + 1, "count = %ld\n", count);
count = pSetQueryNetSessionCount(SESSION_QUERY); - ok(count == init_count + 1, "count = %d\n", count); + ok(count == init_count + 1, "count = %ld\n", count);
count = pSetQueryNetSessionCount(SESSION_DECREMENT); - ok(count == init_count, "count = %d\n", count); + ok(count == init_count, "count = %ld\n", count);
count = pSetQueryNetSessionCount(SESSION_QUERY); - ok(count == init_count, "count = %d\n", count); + ok(count == init_count, "count = %ld\n", count); }
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) @@ -4489,19 +4489,19 @@ static void test_com_aggregation(void) IUnknown *unk2 = NULL;
hr = CoGetClassObject(&CLSID_WebBrowser, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&class_factory); - ok(hr == S_OK, "CoGetClassObject failed: %08x\n", hr); + ok(hr == S_OK, "CoGetClassObject failed: %08lx\n", hr);
hr = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk); - ok(hr == S_OK, "CreateInstance returned hr = %08x\n", hr); - ok(unk != NULL, "result NULL, hr = %08x\n", hr); + ok(hr == S_OK, "CreateInstance returned hr = %08lx\n", hr); + ok(unk != NULL, "result NULL, hr = %08lx\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IWebBrowser, (void**)&web_browser); - ok(hr == S_OK, "QI to IWebBrowser failed, hr=%08x\n", hr); + ok(hr == S_OK, "QI to IWebBrowser failed, hr=%08lx\n", hr);
SET_EXPECT(outer_QI_test); hr = IWebBrowser_QueryInterface(web_browser, &outer_test_iid, (void**)&unk2); CHECK_CALLED(outer_QI_test); - ok(hr == S_OK, "Could not get test iface: %08x\n", hr); + ok(hr == S_OK, "Could not get test iface: %08lx\n", hr); ok(unk2 == (IUnknown*)0xdeadbeef, "unexpected unk2\n");
IWebBrowser_Release(web_browser);
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/imagehlp/tests/Makefile.in | 1 - dlls/imagehlp/tests/image.c | 40 +++++++++++----------- dlls/imagehlp/tests/integrity.c | 70 ++++++++++++++++++++------------------- 3 files changed, 55 insertions(+), 56 deletions(-)
diff --git a/dlls/imagehlp/tests/Makefile.in b/dlls/imagehlp/tests/Makefile.in index 57ef2867985..1a5c393add5 100644 --- a/dlls/imagehlp/tests/Makefile.in +++ b/dlls/imagehlp/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = imagehlp.dll IMPORTS = imagehlp psapi
diff --git a/dlls/imagehlp/tests/image.c b/dlls/imagehlp/tests/image.c index e2aa9485510..0d9019fe938 100644 --- a/dlls/imagehlp/tests/image.c +++ b/dlls/imagehlp/tests/image.c @@ -41,11 +41,11 @@ static char *load_resource(const char *name) strcat(path, name);
file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s, error %u.\n", + ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s, error %lu.\n", debugstr_a(path), GetLastError());
res = FindResourceA(NULL, name, "TESTDLL"); - ok(!!res, "Failed to load resource, error %u.\n", GetLastError()); + ok(!!res, "Failed to load resource, error %lu.\n", GetLastError()); ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res)); WriteFile(file, ptr, SizeofResource( GetModuleHandleA(NULL), res), &written, NULL); ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource.\n"); @@ -204,15 +204,15 @@ static void check_updates(LPCSTR header, const struct expected_update_accum *exp DWORD i;
todo_wine_if (expected->todo) - ok(expected->cUpdates == got->cUpdates, "%s: expected %d updates, got %d\n", + ok(expected->cUpdates == got->cUpdates, "%s: expected %ld updates, got %ld\n", header, expected->cUpdates, got->cUpdates); for (i = 0; i < min(expected->cUpdates, got->cUpdates); i++) { - ok(expected->updates[i].cb == got->updates[i].cb, "%s, update %d: expected %d bytes, got %d\n", + ok(expected->updates[i].cb == got->updates[i].cb, "%s, update %ld: expected %ld bytes, got %ld\n", header, i, expected->updates[i].cb, got->updates[i].cb); if (expected->updates[i].cb && expected->updates[i].cb == got->updates[i].cb) ok(!memcmp(expected->updates[i].pb, got->updates[i].pb, got->updates[i].cb), - "%s, update %d: unexpected value\n", header, i); + "%s, update %ld: unexpected value\n", header, i); } }
@@ -304,7 +304,7 @@ static void test_get_digest_stream(void) SetLastError(0xdeadbeef); ret = ImageGetDigestStream(NULL, 0, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); file = create_temp_file(temp_file); if (file == INVALID_HANDLE_VALUE) { @@ -314,16 +314,16 @@ static void test_get_digest_stream(void) SetLastError(0xdeadbeef); ret = ImageGetDigestStream(file, 0, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = ImageGetDigestStream(NULL, 0, accumulating_stream_output, &accum); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); /* Even with "valid" parameters, it fails with an empty file */ SetLastError(0xdeadbeef); ret = ImageGetDigestStream(file, 0, accumulating_stream_output, &accum); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); /* Finally, with a valid executable in the file, it succeeds. Note that * the file pointer need not be positioned at the beginning. */ @@ -337,12 +337,12 @@ static void test_get_digest_stream(void) bin.nt_headers.OptionalHeader.SizeOfImage = 0;
ret = ImageGetDigestStream(file, 0, accumulating_stream_output, &accum); - ok(ret, "ImageGetDigestStream failed: %d\n", GetLastError()); + ok(ret, "ImageGetDigestStream failed: %ld\n", GetLastError()); check_updates("flags = 0", &a1, &accum); free_updates(&accum); ret = ImageGetDigestStream(file, CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO, accumulating_stream_output, &accum); - ok(ret, "ImageGetDigestStream failed: %d\n", GetLastError()); + ok(ret, "ImageGetDigestStream failed: %ld\n", GetLastError()); check_updates("flags = CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO", &a2, &accum); free_updates(&accum); CloseHandle(file); @@ -374,7 +374,7 @@ static BOOL WINAPI bind_image_cb(IMAGEHLP_STATUS_REASON reason, const char *file
todo_wine ok(!!va, "expected nonzero VA\n"); ret = SearchPathA(NULL, last_module, ".dll", sizeof(full_path), full_path, NULL); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(module, full_path), "expected %s, got %s\n", debugstr_a(full_path), debugstr_a(module));
if (!strcmp((const char *)param, "SysAllocString")) @@ -410,17 +410,17 @@ static void test_bind_image_ex(void) "nonexistent.dll", 0, 0, bind_image_cb); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER, - "got error %u\n", GetLastError()); + "got error %lu\n", GetLastError());
ret = BindImageEx(BIND_ALL_IMAGES | BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE, filename, NULL, NULL, bind_image_cb); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(got_SysAllocString == 1, "got %u imports of SysAllocString\n", got_SysAllocString); ok(got_GetOpenFileNameA == 1, "got %u imports of GetOpenFileNameA\n", got_GetOpenFileNameA); todo_wine ok(got_SHRegGetIntW == 1, "got %u imports of SHRegGetIntW\n", got_SHRegGetIntW);
ret = DeleteFileA(filename); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); }
static void test_image_load(void) @@ -460,7 +460,7 @@ static void test_image_load(void) "FileHeader doesn't point to IMAGE_NT_HEADERS32\n"); } ok(img->NumberOfSections == 3, - "unexpected NumberOfSections, got %d instead of 3\n", img->NumberOfSections); + "unexpected NumberOfSections, got %ld instead of 3\n", img->NumberOfSections); if (img->NumberOfSections >= 3) { ok(!strcmp((const char *)img->Sections[0].Name, ".text"), @@ -474,7 +474,7 @@ static void test_image_load(void) (const char *)img->Sections[2].Name); } ok(img->Characteristics == 0x102, - "unexpected Characteristics, got 0x%x instead of 0x102\n", img->Characteristics); + "unexpected Characteristics, got 0x%lx instead of 0x102\n", img->Characteristics); ok(img->fSystemImage == 0, "unexpected fSystemImage, got %d instead of 0\n", img->fSystemImage); ok(img->fDOSImage == 0, @@ -484,14 +484,14 @@ static void test_image_load(void) todo_wine ok(img->Version == 1 || broken(!img->Version) /* <= WinXP */, "unexpected Version, got %d instead of 1\n", img->Version); ok(img->SizeOfImage == 0x600, - "unexpected SizeOfImage, got 0x%x instead of 0x600\n", img->SizeOfImage); + "unexpected SizeOfImage, got 0x%lx instead of 0x600\n", img->SizeOfImage);
count = 0xdeadbeef; ret = GetImageUnusedHeaderBytes(img, &count); todo_wine - ok(ret == 448, "GetImageUnusedHeaderBytes returned %u instead of 448\n", ret); + ok(ret == 448, "GetImageUnusedHeaderBytes returned %lu instead of 448\n", ret); todo_wine - ok(count == 64, "unexpected size for unused header bytes, got %u instead of 64\n", count); + ok(count == 64, "unexpected size for unused header bytes, got %lu instead of 64\n", count);
ImageUnload(img); } diff --git a/dlls/imagehlp/tests/integrity.c b/dlls/imagehlp/tests/integrity.c index fbe40995f2f..ae3b2d23d64 100644 --- a/dlls/imagehlp/tests/integrity.c +++ b/dlls/imagehlp/tests/integrity.c @@ -183,8 +183,8 @@ static DWORD test_add_certificate(const char *cert_data, int len) CopyMemory(cert->bCertificate, cert_data, len);
ret = ImageAddCertificate(hFile, cert, &index); - ok(ret, "Unable to add certificate to image, error %x\n", GetLastError()); - trace("added cert index %d\n", index); + ok(ret, "Unable to add certificate to image, error %lx\n", GetLastError()); + trace("added cert index %ld\n", index);
HeapFree(GetProcessHeap(), 0, cert); CloseHandle(hFile); @@ -210,7 +210,7 @@ static void test_get_certificate(const char *cert_data, int index) ret = ImageGetCertificateData(hFile, index, NULL, &cert_len); err = GetLastError();
- ok ((ret == FALSE) && (err == ERROR_INSUFFICIENT_BUFFER), "ImageGetCertificateData gave unexpected result; ret=%d / err=%x\n", ret, err); + ok ((ret == FALSE) && (err == ERROR_INSUFFICIENT_BUFFER), "ImageGetCertificateData gave unexpected result; ret=%d / err=%lx\n", ret, err);
cert = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cert_len);
@@ -222,7 +222,7 @@ static void test_get_certificate(const char *cert_data, int index) }
ret = ImageGetCertificateData(hFile, index, cert, &cert_len); - ok(ret, "Unable to retrieve certificate; err=%x\n", GetLastError()); + ok(ret, "Unable to retrieve certificate; err=%lx\n", GetLastError()); ok(memcmp(cert->bCertificate, cert_data, cert_len - sizeof(WIN_CERTIFICATE)) == 0, "Certificate retrieved did not match original\n");
HeapFree(GetProcessHeap(), 0, cert); @@ -244,13 +244,13 @@ static void test_remove_certificate(int index) }
ret = ImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &orig_count, NULL, 0); - ok (ret, "Unable to enumerate certificates in file; err=%x\n", GetLastError()); + ok (ret, "Unable to enumerate certificates in file; err=%lx\n", GetLastError()); ret = ImageRemoveCertificate(hFile, index); - ok (ret, "Unable to remove certificate from file; err=%x\n", GetLastError()); + ok (ret, "Unable to remove certificate from file; err=%lx\n", GetLastError());
/* Test to see if the certificate has actually been removed */ ImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &count, NULL, 0); - ok (count == orig_count - 1, "Certificate count mismatch; orig=%d new=%d\n", orig_count, count); + ok (count == orig_count - 1, "Certificate count mismatch; orig=%ld new=%ld\n", orig_count, count);
CloseHandle(hFile); } @@ -268,60 +268,60 @@ static void test_pe_checksum(void) ret = CheckSumMappedFile(NULL, 0, &checksum_orig, &checksum_new); ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret); ok(((GetLastError() == ERROR_INVALID_PARAMETER)||(GetLastError() == 0xdeadbeef)), - "Expected 0xdeadbeef (XP) or ERROR_INVALID_PARAMETER (Vista+), got %x\n", GetLastError()); + "Expected 0xdeadbeef (XP) or ERROR_INVALID_PARAMETER (Vista+), got %lx\n", GetLastError());
SetLastError(0xdeadbeef); ret = CheckSumMappedFile((void *)0xdeadbeef, 0, &checksum_orig, &checksum_new); ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret); ok(((GetLastError() == ERROR_INVALID_PARAMETER)||(GetLastError() == 0xdeadbeef)), - "Expected 0xdeadbeef (XP) or ERROR_INVALID_PARAMETER (Vista+), got %x\n", GetLastError()); + "Expected 0xdeadbeef (XP) or ERROR_INVALID_PARAMETER (Vista+), got %lx\n", GetLastError());
/* basic checksum tests */ memset(buffer, 0x11, sizeof(buffer)); checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new); ok(ret == NULL, "Expected NULL, got %p\n", ret); - todo_wine ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); - todo_wine ok(checksum_new == 0xaabe, "Expected 0xaabe, got %x\n", checksum_new); + todo_wine ok(checksum_orig == 0, "Expected 0, got %lx\n", checksum_orig); + todo_wine ok(checksum_new == 0xaabe, "Expected 0xaabe, got %lx\n", checksum_new);
memset(buffer, 0x22, sizeof(buffer)); checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new); ok(ret == NULL, "Expected NULL, got %p\n", ret); - todo_wine ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); - todo_wine ok(checksum_new == 0x5569, "Expected 0x5569, got %x\n", checksum_new); + todo_wine ok(checksum_orig == 0, "Expected 0, got %lx\n", checksum_orig); + todo_wine ok(checksum_new == 0x5569, "Expected 0x5569, got %lx\n", checksum_new);
memset(buffer, 0x22, sizeof(buffer)); checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(buffer, 10, &checksum_orig, &checksum_new); ok(ret == NULL, "Expected NULL, got %p\n", ret); - todo_wine ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); - todo_wine ok(checksum_new == 0xaab4, "Expected 0xaab4, got %x\n", checksum_new); + todo_wine ok(checksum_orig == 0, "Expected 0, got %lx\n", checksum_orig); + todo_wine ok(checksum_new == 0xaab4, "Expected 0xaab4, got %lx\n", checksum_new);
memset(buffer, 0x22, sizeof(buffer)); checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(buffer, 11, &checksum_orig, &checksum_new); ok(ret == NULL, "Expected NULL, got %p\n", ret); - todo_wine ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); - todo_wine ok(checksum_new == 0xaad7, "Expected 0xaad7, got %x\n", checksum_new); + todo_wine ok(checksum_orig == 0, "Expected 0, got %lx\n", checksum_orig); + todo_wine ok(checksum_new == 0xaad7, "Expected 0xaad7, got %lx\n", checksum_new);
/* test checksum of PE module */ checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(test_pe_executable, sizeof(test_pe_executable), &checksum_orig, &checksum_new); ok((char *)ret == test_pe_executable + 0x80, "Expected %p, got %p\n", test_pe_executable + 0x80, ret); - ok(checksum_orig == 0xabcdef11, "Expected 0xabcdef11, got %x\n", checksum_orig); - ok(checksum_new == 0xaa4, "Expected 0xaa4, got %x\n", checksum_new); + ok(checksum_orig == 0xabcdef11, "Expected 0xabcdef11, got %lx\n", checksum_orig); + ok(checksum_new == 0xaa4, "Expected 0xaa4, got %lx\n", checksum_new);
ret_bool = GetModuleInformation(GetCurrentProcess(), GetModuleHandleA(NULL), &modinfo, sizeof(modinfo)); - ok(ret_bool, "GetModuleInformation failed, error: %x\n", GetLastError()); + ok(ret_bool, "GetModuleInformation failed, error: %lx\n", GetLastError());
SetLastError(0xdeadbeef); checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, &checksum_orig, &checksum_new); ok(ret != NULL, "Expected CheckSumMappedFile to succeed\n"); - ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %lx\n", GetLastError()); ok(checksum_orig != 0xdeadbeef, "Expected orig checksum != 0xdeadbeef\n"); ok(checksum_new != 0xdeadbeef, "Expected new checksum != 0xdeadbeef\n");
@@ -330,9 +330,9 @@ static void test_pe_checksum(void) ret = CheckSumMappedFile((char *)modinfo.lpBaseOfDll + 100, modinfo.SizeOfImage - 100, &checksum_orig, &checksum_new); ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret); - ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError()); - todo_wine ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); - todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %lx\n", GetLastError()); + todo_wine ok(checksum_orig == 0, "Expected 0, got %lx\n", checksum_orig); + todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %lx\n", checksum_new);
nt_header = ImageNtHeader( modinfo.lpBaseOfDll ); checksum_correct = nt_header->OptionalHeader.CheckSum; @@ -341,28 +341,28 @@ static void test_pe_checksum(void) ret = CheckSumMappedFile(modinfo.lpBaseOfDll, (char *)nt_header - (char *)modinfo.lpBaseOfDll, &checksum_orig, &checksum_new); ok(!ret || (ret == nt_header), "Expected CheckSumMappedFile to fail, got %p\n", ret); - ok((checksum_orig == 0) || (checksum_orig == checksum_correct), "Expected %x, got %x\n", checksum_correct, checksum_orig); - ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + ok((checksum_orig == 0) || (checksum_orig == checksum_correct), "Expected %lx, got %lx\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %lx\n", checksum_new);
checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(modinfo.lpBaseOfDll, sizeof(IMAGE_DOS_HEADER), &checksum_orig, &checksum_new); ok(!ret || (ret == nt_header), "Expected CheckSumMappedFile to fail, got %p\n", ret); - ok((checksum_orig == 0) || (checksum_orig == checksum_correct), "Expected %x, got %x\n", checksum_correct, checksum_orig); - ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + ok((checksum_orig == 0) || (checksum_orig == checksum_correct), "Expected %lx, got %lx\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %lx\n", checksum_new);
checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile(modinfo.lpBaseOfDll, 0, &checksum_orig, &checksum_new); ok(!ret || (ret == nt_header), "Expected CheckSumMappedFile to fail, got %p\n", ret); - ok((checksum_orig == 0xdeadbeef) || (checksum_orig == checksum_correct), "Expected %x, got %x\n", checksum_correct, checksum_orig); - ok((checksum_new == 0xdeadbeef) || (checksum_new != 0 && checksum_new != 0xdeadbeef), "Got unexpected value %x\n", checksum_new); + ok((checksum_orig == 0xdeadbeef) || (checksum_orig == checksum_correct), "Expected %lx, got %lx\n", checksum_correct, checksum_orig); + ok((checksum_new == 0xdeadbeef) || (checksum_new != 0 && checksum_new != 0xdeadbeef), "Got unexpected value %lx\n", checksum_new);
checksum_orig = checksum_new = 0xdeadbeef; ret = CheckSumMappedFile((char *)modinfo.lpBaseOfDll + 1, 0, &checksum_orig, &checksum_new); ok(ret == NULL, "Expected NULL, got %p\n", ret); - ok((checksum_orig == 0) || (checksum_orig == 0xdeadbeef), "Expected 0, got %x\n", checksum_orig); - ok((checksum_new == 0) || (checksum_new == 0xdeadbeef), "Expected 0, got %x\n", checksum_new); + ok((checksum_orig == 0) || (checksum_orig == 0xdeadbeef), "Expected 0, got %lx\n", checksum_orig); + ok((checksum_new == 0) || (checksum_new == 0xdeadbeef), "Expected 0, got %lx\n", checksum_new); }
START_TEST(integrity) @@ -379,12 +379,12 @@ START_TEST(integrity) test_remove_certificate(first);
file_size = get_file_size(); - ok(file_size == file_size_orig, "File size different after add and remove (old: %d; new: %d)\n", file_size_orig, file_size); + ok(file_size == file_size_orig, "File size different after add and remove (old: %ld; new: %ld)\n", file_size_orig, file_size);
/* Try adding multiple certificates */ first = test_add_certificate(test_cert_data, sizeof(test_cert_data)); second = test_add_certificate(test_cert_data_2, sizeof(test_cert_data_2)); - ok(second == first + 1, "got %d %d\n", first, second); + ok(second == first + 1, "got %ld %ld\n", first, second);
test_get_certificate(test_cert_data, first); test_get_certificate(test_cert_data_2, second); @@ -397,7 +397,7 @@ START_TEST(integrity) test_remove_certificate(second);
file_size = get_file_size(); - ok(file_size == file_size_orig, "File size different after add and remove (old: %d; new: %d)\n", file_size_orig, file_size); + ok(file_size == file_size_orig, "File size different after add and remove (old: %ld; new: %ld)\n", file_size_orig, file_size);
test_pe_checksum();
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/imm32/tests/Makefile.in | 1 dlls/imm32/tests/imm32.c | 206 +++++++++++++++++++++--------------------- 2 files changed, 103 insertions(+), 104 deletions(-)
diff --git a/dlls/imm32/tests/Makefile.in b/dlls/imm32/tests/Makefile.in index d3edbd75fa5..d0881429e34 100644 --- a/dlls/imm32/tests/Makefile.in +++ b/dlls/imm32/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = imm32.dll IMPORTS = imm32 ole32 user32
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index cb49478e390..3f2e503b5e5 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -219,7 +219,7 @@ static LRESULT WINAPI wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_IME_SETCONTEXT: if (wParam) CHECK_EXPECT(WM_IME_SETCONTEXT_ACTIVATE); else CHECK_EXPECT(WM_IME_SETCONTEXT_DEACTIVATE); - ok(lParam == ISC_SHOWUIALL || !lParam, "lParam = %lx\n", lParam); + ok(lParam == ISC_SHOWUIALL || !lParam, "lParam = %Ix\n", lParam); return TRUE; case WM_NCCREATE: default_ime_wnd = get_ime_window(); @@ -441,7 +441,7 @@ static LRESULT WINAPI test_ime_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPAR imc = ImmGetContext(hWnd); size = ImmGetCompositionStringW(imc, GCS_RESULTSTR, wstring, sizeof(wstring)); - ok(size > 0, "ImmGetCompositionString(GCS_RESULTSTR) is %d\n", size); + ok(size > 0, "ImmGetCompositionString(GCS_RESULTSTR) is %ld\n", size); ImmReleaseContext(hwnd, imc);
ime_composition_test.catch_result_str = TRUE; @@ -507,11 +507,11 @@ static void test_ImmGetCompositionString(void) memset(cstring, 0x1a, sizeof(cstring));
len = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, alen); - ok(len == alen, "Unexpected length %d.\n", len); + ok(len == alen, "Unexpected length %ld.\n", len); ok(cstring[alen] == 0x1a, "Unexpected buffer contents.\n");
len = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, wlen); - ok(len == wlen, "Unexpected length %d.\n", len); + ok(len == wlen, "Unexpected length %ld.\n", len); ok(wstring[wlen/sizeof(WCHAR)] == 0x1a1a, "Unexpected buffer contents.\n");
/* Get strings with exactly smaller buffer sizes. */ @@ -520,11 +520,11 @@ static void test_ImmGetCompositionString(void)
/* Returns 0 but still fills buffer. */ len = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, alen - 1); - ok(!len, "Unexpected length %d.\n", len); + ok(!len, "Unexpected length %ld.\n", len); ok(cstring[0] == 'w', "Unexpected buffer contents %s.\n", cstring);
len = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, wlen - 1); - ok(len == wlen - 1, "Unexpected length %d.\n", len); + ok(len == wlen - 1, "Unexpected length %ld.\n", len); ok(!memcmp(wstring, string, wlen - 1), "Unexpected buffer contents.\n");
/* Get the size of the required output buffer. */ @@ -532,11 +532,11 @@ static void test_ImmGetCompositionString(void) memset(cstring, 0x1a, sizeof(cstring));
len = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 0); - ok(len == alen, "Unexpected length %d.\n", len); + ok(len == alen, "Unexpected length %ld.\n", len); ok(cstring[0] == 0x1a, "Unexpected buffer contents %s.\n", cstring);
len = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 0); - ok(len == wlen, "Unexpected length %d.\n", len); + ok(len == wlen, "Unexpected length %ld.\n", len); ok(wstring[0] == 0x1a1a, "Unexpected buffer contents.\n"); } else @@ -623,7 +623,7 @@ static void test_ImmSetCompositionString(void)
SetLastError(0xdeadbeef); imc = ImmGetContext(hwnd); - ok(imc != 0, "ImmGetContext() failed. Last error: %u\n", GetLastError()); + ok(imc != 0, "ImmGetContext() failed. Last error: %lu\n", GetLastError()); if (!imc) return;
@@ -1077,7 +1077,7 @@ static void test_ImmGetContext(void) himc = ImmGetContext((HWND)0xffffffff); err = GetLastError(); ok(himc == NULL, "ImmGetContext succeeded\n"); - ok(err == ERROR_INVALID_WINDOW_HANDLE, "got %u\n", err); + ok(err == ERROR_INVALID_WINDOW_HANDLE, "got %lu\n", err);
himc = ImmGetContext(hwnd); ok(himc != NULL, "ImmGetContext failed\n"); @@ -1184,9 +1184,9 @@ static void test_ImmDefaultHwnd(void) GetWindowTextA(def1, title, sizeof(title)); ok(!strcmp(title, "Default IME"), "got %s\n", title); style = GetWindowLongA(def1, GWL_STYLE); - ok(style == (WS_DISABLED | WS_POPUP | WS_CLIPSIBLINGS), "got %08x\n", style); + ok(style == (WS_DISABLED | WS_POPUP | WS_CLIPSIBLINGS), "got %08lx\n", style); style = GetWindowLongA(def1, GWL_EXSTYLE); - ok(style == 0, "got %08x\n", style); + ok(style == 0, "got %08lx\n", style);
imc2 = ImmCreateContext(); ImmSetOpenStatus(imc2, TRUE); @@ -1379,7 +1379,7 @@ static void test_default_ime_window_creation(void) for (i = 0; i < ARRAY_SIZE(testcases); i++) { thread = CreateThread(NULL, 0, test_default_ime_window_cb, &testcases[i], 0, NULL); - ok(thread != NULL, "CreateThread failed with error %u\n", GetLastError()); + ok(thread != NULL, "CreateThread failed with error %lu\n", GetLastError()); while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0 + 1) { MSG msg; @@ -1394,7 +1394,7 @@ static void test_default_ime_window_creation(void) if (testcases[i].top_level_window) { thread = CreateThread(NULL, 0, test_default_ime_window_cancel_cb, &testcases[i], 0, NULL); - ok(thread != NULL, "CreateThread failed with error %u\n", GetLastError()); + ok(thread != NULL, "CreateThread failed with error %lu\n", GetLastError()); WaitForSingleObject(thread, INFINITE); CloseHandle(thread); } @@ -1423,32 +1423,32 @@ static void test_ImmGetIMCLockCount(void) count = ImmGetIMCLockCount((HIMC)0xdeadcafe); ok(count == 0, "Invalid IMC should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); count = ImmGetIMCLockCount(0x00000000); ok(count == 0, "NULL IMC should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "Last Error should remain unchanged: %08x\n",ret); + ok(ret == 0xdeadbeef, "Last Error should remain unchanged: %08lx\n",ret); count = ImmGetIMCLockCount(imc); ok(count == 0, "Destroyed IMC should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
imc = ImmCreateContext(); count = ImmGetIMCLockCount(imc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count); ic = ImmLockIMC(imc); ok(ic != NULL, "ImmLockIMC failed!\n"); count = ImmGetIMCLockCount(imc); - ok(count == 1, "expect 1, returned %d\n", count); + ok(count == 1, "expect 1, returned %ld\n", count); ret = ImmUnlockIMC(imc); - ok(ret == TRUE, "expect TRUE, ret %d\n", ret); + ok(ret == TRUE, "expect TRUE, ret %ld\n", ret); count = ImmGetIMCLockCount(imc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count); ret = ImmUnlockIMC(imc); - ok(ret == TRUE, "expect TRUE, ret %d\n", ret); + ok(ret == TRUE, "expect TRUE, ret %ld\n", ret); count = ImmGetIMCLockCount(imc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count);
for (i = 0; i < GMEM_LOCKCOUNT * 2; i++) { @@ -1456,15 +1456,15 @@ static void test_ImmGetIMCLockCount(void) ok(ic != NULL, "ImmLockIMC failed!\n"); } count = ImmGetIMCLockCount(imc); - todo_wine ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %d\n", count); + todo_wine ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %ld\n", count);
for (i = 0; i < GMEM_LOCKCOUNT - 1; i++) ImmUnlockIMC(imc); count = ImmGetIMCLockCount(imc); - todo_wine ok(count == 1, "expect 1, returned %d\n", count); + todo_wine ok(count == 1, "expect 1, returned %ld\n", count); ImmUnlockIMC(imc); count = ImmGetIMCLockCount(imc); - todo_wine ok(count == 0, "expect 0, returned %d\n", count); + todo_wine ok(count == 0, "expect 0, returned %ld\n", count);
ImmDestroyContext(imc); } @@ -1478,18 +1478,18 @@ static void test_ImmGetIMCCLockCount(void)
imcc = ImmCreateIMCC(sizeof(CANDIDATEINFO)); count = ImmGetIMCCLockCount(imcc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count); ImmLockIMCC(imcc); count = ImmGetIMCCLockCount(imcc); - ok(count == 1, "expect 1, returned %d\n", count); + ok(count == 1, "expect 1, returned %ld\n", count); ret = ImmUnlockIMCC(imcc); ok(ret == FALSE, "expect FALSE, ret %d\n", ret); count = ImmGetIMCCLockCount(imcc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count); ret = ImmUnlockIMCC(imcc); ok(ret == FALSE, "expect FALSE, ret %d\n", ret); count = ImmGetIMCCLockCount(imcc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count);
p = ImmLockIMCC(imcc); ok(GlobalHandle(p) == imcc, "expect %p, returned %p\n", imcc, GlobalHandle(p)); @@ -1499,18 +1499,18 @@ static void test_ImmGetIMCCLockCount(void) ImmLockIMCC(imcc); count = ImmGetIMCCLockCount(imcc); g_count = GlobalFlags(imcc) & GMEM_LOCKCOUNT; - ok(count == g_count, "count %d, g_count %d\n", count, g_count); + ok(count == g_count, "count %ld, g_count %ld\n", count, g_count); } count = ImmGetIMCCLockCount(imcc); - ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %d\n", count); + ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %ld\n", count);
for (i = 0; i < GMEM_LOCKCOUNT - 1; i++) GlobalUnlock(imcc); count = ImmGetIMCCLockCount(imcc); - ok(count == 1, "expect 1, returned %d\n", count); + ok(count == 1, "expect 1, returned %ld\n", count); GlobalUnlock(imcc); count = ImmGetIMCCLockCount(imcc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count);
ImmDestroyIMCC(imcc); } @@ -1523,11 +1523,11 @@ static void test_ImmDestroyContext(void)
imc = ImmCreateContext(); count = ImmGetIMCLockCount(imc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count); ic = ImmLockIMC(imc); ok(ic != NULL, "ImmLockIMC failed!\n"); count = ImmGetIMCLockCount(imc); - ok(count == 1, "expect 1, returned %d\n", count); + ok(count == 1, "expect 1, returned %ld\n", count); ret = ImmDestroyContext(imc); ok(ret == TRUE, "Destroy a locked IMC should success!\n"); ic = ImmLockIMC(imc); @@ -1540,7 +1540,7 @@ static void test_ImmDestroyContext(void) ret = ImmDestroyContext(imc); ok(ret == FALSE, "Destroy a destroyed IMC should fail!\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); }
static void test_ImmDestroyIMCC(void) @@ -1551,13 +1551,13 @@ static void test_ImmDestroyIMCC(void)
imcc = ImmCreateIMCC(sizeof(CANDIDATEINFO)); count = ImmGetIMCCLockCount(imcc); - ok(count == 0, "expect 0, returned %d\n", count); + ok(count == 0, "expect 0, returned %ld\n", count); p = ImmLockIMCC(imcc); ok(p != NULL, "ImmLockIMCC failed!\n"); count = ImmGetIMCCLockCount(imcc); - ok(count == 1, "expect 1, returned %d\n", count); + ok(count == 1, "expect 1, returned %ld\n", count); size = ImmGetIMCCSize(imcc); - ok(size == sizeof(CANDIDATEINFO), "returned %d\n", size); + ok(size == sizeof(CANDIDATEINFO), "returned %ld\n", size); p = ImmDestroyIMCC(imcc); ok(p == NULL, "Destroy a locked IMCC should success!\n"); p = ImmLockIMCC(imcc); @@ -1572,7 +1572,7 @@ static void test_ImmDestroyIMCC(void) p = ImmDestroyIMCC(imcc); ok(p != NULL, "returned NULL\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); }
static void test_ImmMessages(void) @@ -1807,7 +1807,7 @@ static void test_InvalidIMC(void) oldimc = ImmAssociateContext(hwnd, imc_destroy); ok(!oldimc, "Associating to a destroyed imc should fail!\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); imc2 = ImmGetContext(hwnd); ok(imc1 == imc2, "imc should not changed! imc1 %p, imc2 %p\n", imc1, imc2);
@@ -1838,7 +1838,7 @@ static void test_InvalidIMC(void) oldimc = ImmAssociateContext(hwnd, imc_bad); ok(!oldimc, "Associating to a destroyed imc should fail!\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); imc2 = ImmGetContext(hwnd); ok(imc1 == imc2, "imc should not changed! imc1 %p, imc2 %p\n", imc1, imc2);
@@ -1848,306 +1848,306 @@ static void test_InvalidIMC(void) ret = ImmGetCandidateListA(imc_bad, 0, NULL, 0); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCandidateListA(imc_null, 0, NULL, 0); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCandidateListA(imc_destroy, 0, NULL, 0); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetCandidateListCountA*/ SetLastError(0xdeadbeef); ret = ImmGetCandidateListCountA(imc_bad,&count); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCandidateListCountA(imc_null,&count); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCandidateListCountA(imc_destroy,&count); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetCandidateWindow */ SetLastError(0xdeadbeef); ret = ImmGetCandidateWindow(imc_bad, 0, (LPCANDIDATEFORM)buffer); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCandidateWindow(imc_null, 0, (LPCANDIDATEFORM)buffer); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCandidateWindow(imc_destroy, 0, (LPCANDIDATEFORM)buffer); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetCompositionFontA */ SetLastError(0xdeadbeef); ret = ImmGetCompositionFontA(imc_bad, (LPLOGFONTA)buffer); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCompositionFontA(imc_null, (LPLOGFONTA)buffer); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCompositionFontA(imc_destroy, (LPLOGFONTA)buffer); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetCompositionWindow */ SetLastError(0xdeadbeef); ret = ImmGetCompositionWindow(imc_bad, (LPCOMPOSITIONFORM)buffer); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCompositionWindow(imc_null, (LPCOMPOSITIONFORM)buffer); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCompositionWindow(imc_destroy, (LPCOMPOSITIONFORM)buffer); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetCompositionStringA */ SetLastError(0xdeadbeef); ret = ImmGetCompositionStringA(imc_bad, GCS_COMPSTR, NULL, 0); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCompositionStringA(imc_null, GCS_COMPSTR, NULL, 0); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetCompositionStringA(imc_destroy, GCS_COMPSTR, NULL, 0); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmSetOpenStatus */ SetLastError(0xdeadbeef); ret = ImmSetOpenStatus(imc_bad, 1); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetOpenStatus(imc_null, 1); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetOpenStatus(imc_destroy, 1); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetOpenStatus */ SetLastError(0xdeadbeef); ret = ImmGetOpenStatus(imc_bad); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetOpenStatus(imc_null); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetOpenStatus(imc_destroy); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetStatusWindowPos */ SetLastError(0xdeadbeef); ret = ImmGetStatusWindowPos(imc_bad, NULL); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetStatusWindowPos(imc_null, NULL); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetStatusWindowPos(imc_destroy, NULL); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmRequestMessageA */ SetLastError(0xdeadbeef); ret = ImmRequestMessageA(imc_bad, WM_CHAR, 0); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmRequestMessageA(imc_null, WM_CHAR, 0); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmRequestMessageA(imc_destroy, WM_CHAR, 0); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmSetCompositionFontA */ SetLastError(0xdeadbeef); ret = ImmSetCompositionFontA(imc_bad, &lf); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetCompositionFontA(imc_null, &lf); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetCompositionFontA(imc_destroy, &lf); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmSetCompositionWindow */ SetLastError(0xdeadbeef); ret = ImmSetCompositionWindow(imc_bad, NULL); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetCompositionWindow(imc_null, NULL); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetCompositionWindow(imc_destroy, NULL); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmSetConversionStatus */ SetLastError(0xdeadbeef); ret = ImmSetConversionStatus(imc_bad, 0, 0); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetConversionStatus(imc_null, 0, 0); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetConversionStatus(imc_destroy, 0, 0); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmSetStatusWindowPos */ SetLastError(0xdeadbeef); ret = ImmSetStatusWindowPos(imc_bad, 0); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetStatusWindowPos(imc_null, 0); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmSetStatusWindowPos(imc_destroy, 0); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGetImeMenuItemsA */ SetLastError(0xdeadbeef); ret = ImmGetImeMenuItemsA(imc_bad, 0, 0, NULL, NULL, 0); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetImeMenuItemsA(imc_null, 0, 0, NULL, NULL, 0); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGetImeMenuItemsA(imc_destroy, 0, 0, NULL, NULL, 0); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmLockIMC */ SetLastError(0xdeadbeef); ic = ImmLockIMC(imc_bad); ok(ic == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ic = ImmLockIMC(imc_null); ok(ic == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ic = ImmLockIMC(imc_destroy); ok(ic == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmUnlockIMC */ SetLastError(0xdeadbeef); ret = ImmUnlockIMC(imc_bad); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmUnlockIMC(imc_null); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "last error should remain unchanged %08x!\n", ret); + ok(ret == 0xdeadbeef, "last error should remain unchanged %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmUnlockIMC(imc_destroy); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret);
/* Test ImmGenerateMessage */ SetLastError(0xdeadbeef); ret = ImmGenerateMessage(imc_bad); ok(ret == 0, "Bad IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGenerateMessage(imc_null); ok(ret == 0, "NULL IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); SetLastError(0xdeadbeef); ret = ImmGenerateMessage(imc_destroy); ok(ret == 0, "Destroyed IME should return 0\n"); ret = GetLastError(); - ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08x!\n", ret); + ok(ret == ERROR_INVALID_HANDLE, "wrong last error %08lx!\n", ret); }
#define test_apttype(apttype) _test_apttype(apttype, __LINE__) @@ -2159,7 +2159,7 @@ static void _test_apttype(APTTYPE apttype, unsigned int line)
hr = CoGetApartmentType(&type, &qualifier); hr_expected = (apttype == -1 ? CO_E_NOTINITIALIZED : S_OK); - ok_(__FILE__, line)(hr == hr_expected, "CoGetApartmentType returned %x\n", hr); + ok_(__FILE__, line)(hr == hr_expected, "CoGetApartmentType returned %lx\n", hr); if (FAILED(hr)) return;
@@ -2178,7 +2178,7 @@ static DWORD WINAPI com_initialization_thread(void *arg) ok(r, "ImmSetActiveContext failed\n"); test_apttype(APTTYPE_MAINSTA); hr = CoInitialize(NULL); - ok(hr == S_OK, "CoInitialize returned %x\n", hr); + ok(hr == S_OK, "CoInitialize returned %lx\n", hr); CoUninitialize(); test_apttype(-1);
@@ -2187,7 +2187,7 @@ static DWORD WINAPI com_initialization_thread(void *arg) ok(r, "ImmSetActiveContext failed\n"); test_apttype(APTTYPE_MAINSTA); hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); - ok(hr == S_OK, "CoInitialize returned %x\n", hr); + ok(hr == S_OK, "CoInitialize returned %lx\n", hr); test_apttype(APTTYPE_MTA); CoUninitialize(); test_apttype(-1); @@ -2228,7 +2228,7 @@ static void test_com_initialization(void) ok(r, "ImmSetActiveContext failed\n"); test_apttype(APTTYPE_MAINSTA); hr = CoInitialize(NULL); - ok(hr == S_OK, "CoInitialize returned %x\n", hr); + ok(hr == S_OK, "CoInitialize returned %lx\n", hr); CoUninitialize(); test_apttype(-1);
@@ -2240,7 +2240,7 @@ static void test_com_initialization(void) ok(r, "ImmSetActiveContext failed\n"); test_apttype(APTTYPE_MAINSTA); hr = CoInitialize(NULL); - ok(hr == S_OK, "CoInitialize returned %x\n", hr); + ok(hr == S_OK, "CoInitialize returned %lx\n", hr); CoUninitialize(); test_apttype(APTTYPE_MAINSTA); DestroyWindow(wnd); @@ -2251,7 +2251,7 @@ static void test_com_initialization(void) r = ImmSetActiveContext(NULL, NULL, TRUE); CoUninitialize(); hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); - ok(hr == S_OK, "CoInitialize returned %x\n", hr); + ok(hr == S_OK, "CoInitialize returned %lx\n", hr); test_apttype(APTTYPE_MTA); DestroyWindow(wnd); test_apttype(-1);
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/inetcomm/tests/Makefile.in | 1 dlls/inetcomm/tests/mimeintl.c | 78 ++++---- dlls/inetcomm/tests/mimeole.c | 396 ++++++++++++++++++++------------------- 3 files changed, 237 insertions(+), 238 deletions(-)
diff --git a/dlls/inetcomm/tests/Makefile.in b/dlls/inetcomm/tests/Makefile.in index e885e62943f..5a5b16d538d 100644 --- a/dlls/inetcomm/tests/Makefile.in +++ b/dlls/inetcomm/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = inetcomm.dll IMPORTS = inetcomm urlmon oleaut32 ole32
diff --git a/dlls/inetcomm/tests/mimeintl.c b/dlls/inetcomm/tests/mimeintl.c index abd18f6b3a9..3eaa86fe7e3 100644 --- a/dlls/inetcomm/tests/mimeintl.c +++ b/dlls/inetcomm/tests/mimeintl.c @@ -41,9 +41,9 @@ static void test_create(void) ULONG ref;
hr = MimeOleGetInternat(&internat); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = MimeOleGetInternat(&internat2); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
/* Under w2k8 it's no longer a singleton */ if(internat == internat2) @@ -53,18 +53,18 @@ static void test_create(void) ref = IMimeInternational_Release(internat2); ok(ref == 2 || ref == 1, /* win95 - object is a static singleton */ - "got %d\n", ref); + "got %ld\n", ref);
ref = IMimeInternational_Release(internat); - ok(ref == 1, "got %d\n", ref); + ok(ref == 1, "got %ld\n", ref); } else { ref = IMimeInternational_Release(internat2); - ok(ref == 0, "got %d\n", ref); + ok(ref == 0, "got %ld\n", ref);
ref = IMimeInternational_Release(internat); - ok(ref == 0, "got %d\n", ref); + ok(ref == 0, "got %ld\n", ref); }
} @@ -153,46 +153,46 @@ static void test_charset(void) MIMECSETINFO mlang_cs_info;
hr = MimeOleGetInternat(&internat); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeInternational_FindCharset(internat, "nonexistent", &hcs); - ok(hr == MIME_E_NOT_FOUND, "got %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "got %08lx\n", hr);
hr = IMimeInternational_FindCharset(internat, "windows-1252", &hcs_windows_1252); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); hr = IMimeInternational_FindCharset(internat, "windows-1252", &hcs); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(hcs_windows_1252 == hcs, "got different hcharsets for the same name\n"); hr = IMimeInternational_FindCharset(internat, "WiNdoWs-1252", &hcs); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(hcs_windows_1252 == hcs, "got different hcharsets for the same name\n");
hr = IMimeInternational_FindCharset(internat, "windows-1251", &hcs_windows_1251); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(hcs_windows_1252 != hcs_windows_1251, "got the same hcharset for the different names\n");
hr = IMimeInternational_GetCharsetInfo(internat, hcs_windows_1252, &cs_info); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
hr = mlang_getcsetinfo("windows-1252", &mlang_cs_info); - ok(hr == S_OK, "got %08x\n", hr); - ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %d while mlang uiCodePage %d\n", + ok(hr == S_OK, "got %08lx\n", hr); + ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %ld while mlang uiCodePage %d\n", cs_info.cpiWindows, mlang_cs_info.uiCodePage); - ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %d while mlang uiInternetEncoding %d\n", + ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %ld while mlang uiInternetEncoding %d\n", cs_info.cpiInternet, mlang_cs_info.uiInternetEncoding); ok(cs_info.hCharset == hcs_windows_1252, "hCharset doesn't match requested\n"); ok(!strcmp(cs_info.szName, "windows-1252"), "szName doesn't match requested\n");
hr = IMimeInternational_GetCodePageCharset(internat, 1252, CHARSET_BODY, &hcs); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); hr = IMimeInternational_GetCharsetInfo(internat, hcs, &cs_info); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
hr = mlang_getcsetinfo_from_cp(1252, CHARSET_BODY, &mlang_cs_info); - ok(hr == S_OK, "got %08x\n", hr); - ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %d while mlang uiCodePage %d\n", + ok(hr == S_OK, "got %08lx\n", hr); + ok(cs_info.cpiWindows == mlang_cs_info.uiCodePage, "cpiWindows %ld while mlang uiCodePage %d\n", cs_info.cpiWindows, mlang_cs_info.uiCodePage); - ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %d while mlang uiInternetEncoding %d\n", + ok(cs_info.cpiInternet == mlang_cs_info.uiInternetEncoding, "cpiInternet %ld while mlang uiInternetEncoding %d\n", cs_info.cpiInternet, mlang_cs_info.uiInternetEncoding);
IMimeInternational_Release(internat); @@ -205,24 +205,24 @@ static void test_defaultcharset(void) HCHARSET hcs_default, hcs, hcs_windows_1251;
hr = MimeOleGetInternat(&internat); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeInternational_GetDefaultCharset(internat, &hcs_default); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeInternational_GetCodePageCharset(internat, GetACP(), CHARSET_BODY, &hcs); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(hcs_default == hcs, "Unexpected default charset\n");
hr = IMimeInternational_FindCharset(internat, "windows-1251", &hcs_windows_1251); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr); hr = IMimeInternational_SetDefaultCharset(internat, hcs_windows_1251); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeInternational_GetDefaultCharset(internat, &hcs); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(hcs == hcs_windows_1251, "didn't retrieve recently set default\n"); /* Set the old default back again */ hr = IMimeInternational_SetDefaultCharset(internat, hcs_default); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
IMimeInternational_Release(internat); } @@ -238,27 +238,27 @@ static void test_convert(void) static WCHAR test_stringW[] = L"test string";
hr = MimeOleGetInternat(&internat); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
src.pBlobData = (BYTE*)test_string; src.cbSize = sizeof(test_string); hr = IMimeInternational_ConvertBuffer(internat, 1252, 28591, &src, &dst, &read); - ok(hr == S_OK, "ret %08x\n", hr); - ok(read == sizeof(test_string), "got %d\n", read); - ok(dst.cbSize == sizeof(test_string), "got %d\n", dst.cbSize); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(read == sizeof(test_string), "got %ld\n", read); + ok(dst.cbSize == sizeof(test_string), "got %ld\n", dst.cbSize); CoTaskMemFree(dst.pBlobData);
src.cbSize = 2; hr = IMimeInternational_ConvertBuffer(internat, 1252, 28591, &src, &dst, &read); - ok(hr == S_OK, "ret %08x\n", hr); - ok(read == 2, "got %d\n", read); - ok(dst.cbSize == 2, "got %d\n", dst.cbSize); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(read == 2, "got %ld\n", read); + ok(dst.cbSize == 2, "got %ld\n", dst.cbSize); CoTaskMemFree(dst.pBlobData);
prop_in.vt = VT_LPWSTR; prop_in.pwszVal = test_stringW; hr = IMimeInternational_ConvertString(internat, CP_UNICODE, 1252, &prop_in, &prop_out); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(prop_out.vt == VT_LPSTR, "got %d\n", prop_out.vt); ok(!strcmp(prop_out.pszVal, test_string), "got %s\n", prop_out.pszVal); PropVariantClear(&prop_out); @@ -267,7 +267,7 @@ static void test_convert(void) prop_in.vt = VT_LPWSTR; prop_in.pwszVal = test_stringW; hr = IMimeInternational_ConvertString(internat, 28591, 1252, &prop_in, &prop_out); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(prop_out.vt == VT_LPSTR, "got %d\n", prop_out.vt); ok(!strcmp(prop_out.pszVal, test_string), "got %s\n", prop_out.pszVal); PropVariantClear(&prop_out); @@ -275,7 +275,7 @@ static void test_convert(void) prop_in.vt = VT_LPSTR; prop_in.pszVal = test_string; hr = IMimeInternational_ConvertString(internat, 28591, CP_UNICODE, &prop_in, &prop_out); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(prop_out.vt == VT_LPWSTR, "got %d\n", prop_out.vt); ok(!lstrcmpW(prop_out.pwszVal, test_stringW), "mismatched strings\n"); PropVariantClear(&prop_out); @@ -284,7 +284,7 @@ static void test_convert(void) prop_in.vt = VT_LPSTR; prop_in.pszVal = test_string; hr = IMimeInternational_ConvertString(internat, CP_UNICODE, CP_UNICODE, &prop_in, &prop_out); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(prop_out.vt == VT_LPWSTR, "got %d\n", prop_out.vt); ok(!lstrcmpW(prop_out.pwszVal, test_stringW), "mismatched strings\n"); PropVariantClear(&prop_out); diff --git a/dlls/inetcomm/tests/mimeole.c b/dlls/inetcomm/tests/mimeole.c index 50756fa59ea..1168341610f 100644 --- a/dlls/inetcomm/tests/mimeole.c +++ b/dlls/inetcomm/tests/mimeole.c @@ -118,7 +118,7 @@ static void test_CreateVirtualStream(void) IStream *pstm;
hr = MimeOleCreateVirtualStream(&pstm); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
IStream_Release(pstm); } @@ -129,7 +129,7 @@ static void test_CreateSecurity(void) IMimeSecurity *sec;
hr = MimeOleCreateSecurity(&sec); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
IMimeSecurity_Release(sec); } @@ -141,14 +141,14 @@ static IStream *create_stream_from_string(const char *data) HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IStream_Write(stream, data, strlen(data), NULL); - ok(hr == S_OK, "Write failed: %08x\n", hr); + ok(hr == S_OK, "Write failed: %08lx\n", hr);
off.QuadPart = 0; hr = IStream_Seek(stream, off, STREAM_SEEK_SET, NULL); - ok(hr == S_OK, "Seek failed: %08x\n", hr); + ok(hr == S_OK, "Seek failed: %08lx\n", hr);
return stream; } @@ -160,7 +160,7 @@ static void _test_current_encoding(unsigned line, IMimeBody *mime_body, ENCODING HRESULT hres;
hres = IMimeBody_GetCurrentEncoding(mime_body, ¤t_encoding); - ok_(__FILE__,line)(hres == S_OK, "GetCurrentEncoding failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "GetCurrentEncoding failed: %08lx\n", hres); ok_(__FILE__,line)(current_encoding == encoding, "encoding = %d, expected %d\n", current_encoding, encoding); }
@@ -179,77 +179,77 @@ static void test_CreateBody(void) CLSID clsid;
hr = CoCreateInstance(&CLSID_IMimeBody, NULL, CLSCTX_INPROC_SERVER, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetClassID(body, NULL); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetClassID(body, &clsid); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(IsEqualGUID(&clsid, &IID_IMimeBody), "got %s\n", wine_dbgstr_guid(&clsid));
hr = IMimeBody_GetHandle(body, &handle); - ok(hr == MIME_E_NO_DATA, "ret %08x\n", hr); + ok(hr == MIME_E_NO_DATA, "ret %08lx\n", hr); ok(handle == NULL, "handle %p\n", handle);
in = create_stream_from_string(msg1);
/* Need to call InitNew before Load otherwise Load crashes with native inetcomm */ hr = IMimeBody_InitNew(body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
test_current_encoding(body, IET_7BIT);
hr = IMimeBody_Load(body, in); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); off.QuadPart = 0; IStream_Seek(in, off, STREAM_SEEK_CUR, &pos); - ok(pos.u.LowPart == 359, "pos %u\n", pos.u.LowPart); + ok(pos.u.LowPart == 359, "pos %lu\n", pos.u.LowPart);
hr = IMimeBody_IsContentType(body, "multipart", "mixed"); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeBody_IsContentType(body, "text", "plain"); - ok(hr == S_FALSE, "ret %08x\n", hr); + ok(hr == S_FALSE, "ret %08lx\n", hr); hr = IMimeBody_IsContentType(body, NULL, "mixed"); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeBody_IsType(body, IBT_EMPTY); - ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08lx\n", hr);
hr = IMimeBody_SetData(body, IET_8BIT, "text", "plain", &IID_IStream, in); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeBody_IsContentType(body, "text", "plain"); todo_wine - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); test_current_encoding(body, IET_8BIT);
memset(&offsets, 0xcc, sizeof(offsets)); hr = IMimeBody_GetOffsets(body, &offsets); - ok(hr == MIME_E_NO_DATA, "ret %08x\n", hr); - ok(offsets.cbBoundaryStart == 0, "got %d\n", offsets.cbBoundaryStart); - ok(offsets.cbHeaderStart == 0, "got %d\n", offsets.cbHeaderStart); - ok(offsets.cbBodyStart == 0, "got %d\n", offsets.cbBodyStart); - ok(offsets.cbBodyEnd == 0, "got %d\n", offsets.cbBodyEnd); + ok(hr == MIME_E_NO_DATA, "ret %08lx\n", hr); + ok(offsets.cbBoundaryStart == 0, "got %ld\n", offsets.cbBoundaryStart); + ok(offsets.cbHeaderStart == 0, "got %ld\n", offsets.cbHeaderStart); + ok(offsets.cbBodyStart == 0, "got %ld\n", offsets.cbBodyStart); + ok(offsets.cbBodyEnd == 0, "got %ld\n", offsets.cbBodyEnd);
hr = IMimeBody_IsType(body, IBT_EMPTY); - ok(hr == S_FALSE, "got %08x\n", hr); + ok(hr == S_FALSE, "got %08lx\n", hr);
hr = MimeOleGetAllocator(&alloc); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetParameters(body, "nothere", &count, ¶m_info); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); - ok(count == 0, "got %d\n", count); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr); + ok(count == 0, "got %ld\n", count); ok(!param_info, "got %p\n", param_info);
hr = IMimeBody_GetParameters(body, "bar", &count, ¶m_info); - ok(hr == S_OK, "ret %08x\n", hr); - ok(count == 0, "got %d\n", count); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(count == 0, "got %ld\n", count); ok(!param_info, "got %p\n", param_info);
hr = IMimeBody_GetParameters(body, "Content-Type", &count, ¶m_info); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); todo_wine /* native adds a charset parameter */ - ok(count == 4, "got %d\n", count); + ok(count == 4, "got %ld\n", count); ok(param_info != NULL, "got %p\n", param_info);
found_param = 0; @@ -268,10 +268,10 @@ static void test_CreateBody(void) "got %s\n", param_info[i].pszData); } } - ok(found_param == 2, "matched %d params\n", found_param); + ok(found_param == 2, "matched %ld params\n", found_param);
hr = IMimeAllocator_FreeParamInfoArray(alloc, count, param_info, TRUE); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); IMimeAllocator_Release(alloc);
IStream_Release(in); @@ -347,7 +347,7 @@ static HRESULT WINAPI Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD
if(dwOrigin == STREAM_SEEK_END) { CHECK_EXPECT(Stream_Seek_END); - ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %u\n", dlibMove.u.LowPart); + ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %lu\n", dlibMove.u.LowPart); if(plibNewPosition) plibNewPosition->QuadPart = 10; return S_OK; @@ -355,8 +355,8 @@ static HRESULT WINAPI Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD
CHECK_EXPECT(Stream_Seek);
- ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %u\n", dlibMove.u.LowPart); - ok(dwOrigin == STREAM_SEEK_SET, "dwOrigin = %d\n", dwOrigin); + ok(dlibMove.QuadPart == expect_seek_pos, "unexpected seek pos %lu\n", dlibMove.u.LowPart); + ok(dwOrigin == STREAM_SEEK_SET, "dwOrigin = %ld\n", dwOrigin); This->pos = dlibMove.QuadPart; if(plibNewPosition) plibNewPosition->QuadPart = This->pos; @@ -405,7 +405,7 @@ static HRESULT WINAPI Stream_UnlockRegion(IStream *iface, static HRESULT WINAPI Stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD dwStatFlag) { CHECK_EXPECT(Stream_Stat); - ok(dwStatFlag == STATFLAG_NONAME, "dwStatFlag = %x\n", dwStatFlag); + ok(dwStatFlag == STATFLAG_NONAME, "dwStatFlag = %lx\n", dwStatFlag); return E_NOTIMPL; }
@@ -453,8 +453,8 @@ static void _test_stream_read(unsigned line, IStream *stream, HRESULT exhres, co read_size = sizeof(buf)-1;
hres = IStream_Read(stream, buf, read_size, &read); - ok_(__FILE__,line)(hres == exhres, "Read returned %08x, expected %08x\n", hres, exhres); - ok_(__FILE__,line)(read == exread, "unexpected read size %u, expected %u\n", read, exread); + ok_(__FILE__,line)(hres == exhres, "Read returned %08lx, expected %08lx\n", hres, exhres); + ok_(__FILE__,line)(read == exread, "unexpected read size %lu, expected %lu\n", read, exread); buf[read] = 0; ok_(__FILE__,line)(read == exread && !memcmp(buf, exdata, read), "unexpected data %s\n", buf); } @@ -466,24 +466,24 @@ static void test_SetData(void) HRESULT hr;
hr = CoCreateInstance(&CLSID_IMimeBody, NULL, CLSCTX_INPROC_SERVER, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
/* Need to call InitNew before Load otherwise Load crashes with native inetcomm */ hr = IMimeBody_InitNew(body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
stream = create_stream_from_string(msg1); hr = IMimeBody_Load(body, stream); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); IStream_Release(stream);
test_stream = create_test_stream(); hr = IMimeBody_SetData(body, IET_BINARY, "text", "plain", &IID_IStream, test_stream);
- ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeBody_IsContentType(body, "text", "plain"); todo_wine - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
test_current_encoding(body, IET_BINARY);
@@ -492,7 +492,7 @@ static void test_SetData(void) hr = IMimeBody_GetData(body, IET_BINARY, &stream); CHECK_CALLED(Stream_Stat); CHECK_CALLED(Stream_Seek_END); - ok(hr == S_OK, "GetData failed %08x\n", hr); + ok(hr == S_OK, "GetData failed %08lx\n", hr); ok(stream != test_stream, "unexpected stream\n");
SET_EXPECT(Stream_Seek); @@ -506,7 +506,7 @@ static void test_SetData(void) hr = IMimeBody_GetData(body, IET_BINARY, &stream2); CHECK_CALLED(Stream_Stat); CHECK_CALLED(Stream_Seek_END); - ok(hr == S_OK, "GetData failed %08x\n", hr); + ok(hr == S_OK, "GetData failed %08lx\n", hr); ok(stream2 != stream, "unexpected stream\n");
SET_EXPECT(Stream_Seek); @@ -529,12 +529,12 @@ static void test_SetData(void) stream = create_stream_from_string(" \t\r\n|}~YWJj ZGV|}~mZw== \t"); /* "abcdefg" in base64 obscured by invalid chars */ hr = IMimeBody_SetData(body, IET_BASE64, "text", "plain", &IID_IStream, stream); IStream_Release(stream); - ok(hr == S_OK, "SetData failed: %08x\n", hr); + ok(hr == S_OK, "SetData failed: %08lx\n", hr);
test_current_encoding(body, IET_BASE64);
hr = IMimeBody_GetData(body, IET_BINARY, &stream); - ok(hr == S_OK, "GetData failed %08x\n", hr); + ok(hr == S_OK, "GetData failed %08lx\n", hr);
test_stream_read(stream, S_OK, "abc", 3); test_stream_read(stream, S_OK, "defg", -1); @@ -542,7 +542,7 @@ static void test_SetData(void) IStream_Release(stream);
hr = IMimeBody_GetData(body, IET_BASE64, &stream); - ok(hr == S_OK, "GetData failed %08x\n", hr); + ok(hr == S_OK, "GetData failed %08lx\n", hr);
test_stream_read(stream, S_OK, " \t\r", 3); IStream_Release(stream); @@ -550,12 +550,12 @@ static void test_SetData(void) stream = create_stream_from_string(" =3d=3D"one" \t=\r\ntw= o=\nx3\n=34\r\n5"); hr = IMimeBody_SetData(body, IET_QP, "text", "plain", &IID_IStream, stream); IStream_Release(stream); - ok(hr == S_OK, "SetData failed: %08x\n", hr); + ok(hr == S_OK, "SetData failed: %08lx\n", hr);
test_current_encoding(body, IET_QP);
hr = IMimeBody_GetData(body, IET_BINARY, &stream); - ok(hr == S_OK, "GetData failed %08x\n", hr); + ok(hr == S_OK, "GetData failed %08lx\n", hr);
test_stream_read(stream, S_OK, " =="one" \ttw=o=3\n4\r\n5", -1);
@@ -570,7 +570,7 @@ static void test_Allocator(void) IMimeAllocator *alloc;
hr = MimeOleGetAllocator(&alloc); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); IMimeAllocator_Release(alloc); }
@@ -594,74 +594,74 @@ static void test_CreateMessage(void) static const char att_pritype[] = "att:pri-content-type";
hr = MimeOleCreateMessage(NULL, &msg); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
stream = create_stream_from_string(msg1);
hr = IMimeMessage_Load(msg, stream); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_CountBodies(msg, HBODY_ROOT, TRUE, &count); - ok(hr == S_OK, "ret %08x\n", hr); - ok(count == 3, "got %d\n", count); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(count == 3, "got %ld\n", count);
hr = IMimeMessage_CountBodies(msg, HBODY_ROOT, FALSE, &count); - ok(hr == S_OK, "ret %08x\n", hr); - ok(count == 3, "got %d\n", count); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(count == 3, "got %ld\n", count);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeBody_GetOffsets(body, &offsets); - ok(hr == S_OK, "ret %08x\n", hr); - ok(offsets.cbBoundaryStart == 0, "got %d\n", offsets.cbBoundaryStart); - ok(offsets.cbHeaderStart == 0, "got %d\n", offsets.cbHeaderStart); - ok(offsets.cbBodyStart == 359, "got %d\n", offsets.cbBodyStart); - ok(offsets.cbBodyEnd == 666, "got %d\n", offsets.cbBodyEnd); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(offsets.cbBoundaryStart == 0, "got %ld\n", offsets.cbBoundaryStart); + ok(offsets.cbHeaderStart == 0, "got %ld\n", offsets.cbHeaderStart); + ok(offsets.cbBodyStart == 359, "got %ld\n", offsets.cbBodyStart); + ok(offsets.cbBodyEnd == 666, "got %ld\n", offsets.cbBodyEnd); IMimeBody_Release(body);
hr = IMimeMessage_GetBody(msg, IBL_ROOT, NULL, &hbody); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, NULL); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, &handle); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(handle != NULL, "handle %p\n", handle);
hr = IMimeMessage_GetBody(msg, IBL_PARENT, hbody, NULL); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hbody2 = (HBODY)0xdeadbeef; hr = IMimeMessage_GetBody(msg, IBL_PARENT, hbody, &hbody2); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr); ok(hbody2 == NULL, "hbody2 %p\n", hbody2);
PropVariantInit(&prop); hr = IMimeMessage_GetBodyProp(msg, hbody, att_pritype, 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(prop.vt == VT_LPSTR, "vt %08x\n", prop.vt); ok(!strcasecmp(prop.pszVal, "multipart"), "got %s\n", prop.pszVal); PropVariantClear(&prop);
hr = IMimeMessage_GetBody(msg, IBL_FIRST, hbody, &hbody); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeMessage_BindToObject(msg, hbody, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, &handle); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(handle == hbody, "handle %p\n", handle);
hr = IMimeBody_GetOffsets(body, &offsets); - ok(hr == S_OK, "ret %08x\n", hr); - ok(offsets.cbBoundaryStart == 405, "got %d\n", offsets.cbBoundaryStart); - ok(offsets.cbHeaderStart == 428, "got %d\n", offsets.cbHeaderStart); - ok(offsets.cbBodyStart == 518, "got %d\n", offsets.cbBodyStart); - ok(offsets.cbBodyEnd == 523, "got %d\n", offsets.cbBodyEnd); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(offsets.cbBoundaryStart == 405, "got %ld\n", offsets.cbBoundaryStart); + ok(offsets.cbHeaderStart == 428, "got %ld\n", offsets.cbHeaderStart); + ok(offsets.cbBodyStart == 518, "got %ld\n", offsets.cbBodyStart); + ok(offsets.cbBodyEnd == 523, "got %ld\n", offsets.cbBodyEnd);
hr = IMimeBody_GetCharset(body, &hcs); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); todo_wine { ok(hcs != NULL, "Expected non-NULL charset\n"); @@ -670,37 +670,37 @@ static void test_CreateMessage(void) IMimeBody_Release(body);
hr = IMimeMessage_GetBody(msg, IBL_NEXT, hbody, &hbody); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); hr = IMimeMessage_BindToObject(msg, hbody, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetHandle(body, &handle); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(handle == hbody, "handle %p\n", handle);
hr = IMimeBody_GetOffsets(body, &offsets); - ok(hr == S_OK, "ret %08x\n", hr); - ok(offsets.cbBoundaryStart == 525, "got %d\n", offsets.cbBoundaryStart); - ok(offsets.cbHeaderStart == 548, "got %d\n", offsets.cbHeaderStart); - ok(offsets.cbBodyStart == 629, "got %d\n", offsets.cbBodyStart); - ok(offsets.cbBodyEnd == 639, "got %d\n", offsets.cbBodyEnd); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(offsets.cbBoundaryStart == 525, "got %ld\n", offsets.cbBoundaryStart); + ok(offsets.cbHeaderStart == 548, "got %ld\n", offsets.cbHeaderStart); + ok(offsets.cbBodyStart == 629, "got %ld\n", offsets.cbBodyStart); + ok(offsets.cbBodyEnd == 639, "got %ld\n", offsets.cbBodyEnd); IMimeBody_Release(body);
find_struct.pszPriType = text; find_struct.pszSubType = NULL;
hr = IMimeMessage_FindFirst(msg, &find_struct, &hbody); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_FindNext(msg, &find_struct, &hbody); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_FindNext(msg, &find_struct, &hbody); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
hr = IMimeMessage_GetAttachments(msg, &count, &body_list); - ok(hr == S_OK, "ret %08x\n", hr); - ok(count == 2, "got %d\n", count); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(count == 2, "got %ld\n", count); if(count == 2) { IMimeBody *attachment; @@ -709,50 +709,50 @@ static void test_CreateMessage(void) PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, body_list[0], &IID_IMimeBody, (void**)&attachment); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(attachment, "multipart", NULL); - ok(hr == S_FALSE, "ret %08x\n", hr); + ok(hr == S_FALSE, "ret %08lx\n", hr);
test_current_encoding(attachment, IET_8BIT);
prop.vt = VT_LPSTR; hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); ok(!strcmp(prop.pszVal, "8bit"), "got %s\n", prop.pszVal); PropVariantClear(&prop);
hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT); - todo_wine ok(hr == S_FALSE, "ret %08x\n", hr); + todo_wine ok(hr == S_FALSE, "ret %08lx\n", hr);
IMimeBody_Release(attachment);
hr = IMimeMessage_BindToObject(msg, body_list[1], &IID_IMimeBody, (void**)&attachment); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_IsContentType(attachment, "multipart", NULL); - ok(hr == S_FALSE, "ret %08x\n", hr); + ok(hr == S_FALSE, "ret %08lx\n", hr);
test_current_encoding(attachment, IET_7BIT);
prop.vt = VT_LPSTR; hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); ok(!strcmp(prop.pszVal, "7bit"), "got %s\n", prop.pszVal); PropVariantClear(&prop);
hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
IMimeBody_Release(attachment); } CoTaskMemFree(body_list);
hr = IMimeBody_GetCharset(body, &hcs); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); todo_wine { ok(hcs != NULL, "Expected non-NULL charset\n"); @@ -763,7 +763,7 @@ static void test_CreateMessage(void) ref = IStream_AddRef(stream); ok(ref == 2 || broken(ref == 1), /* win95 */ - "ref %d\n", ref); + "ref %ld\n", ref); IStream_Release(stream);
IStream_Release(stream); @@ -779,26 +779,26 @@ static void test_mhtml_message(void) HRESULT hres;
hres = MimeOleCreateMessage(NULL, &mime_message); - ok(hres == S_OK, "MimeOleCreateMessage failed: %08x\n", hres); + ok(hres == S_OK, "MimeOleCreateMessage failed: %08lx\n", hres);
stream = create_stream_from_string(mhtml_page1); hres = IMimeMessage_Load(mime_message, stream); IStream_Release(stream); - ok(hres == S_OK, "Load failed: %08x\n", hres); + ok(hres == S_OK, "Load failed: %08lx\n", hres);
hres = IMimeMessage_CountBodies(mime_message, HBODY_ROOT, TRUE, &count); - ok(hres == S_OK, "CountBodies failed: %08x\n", hres); - ok(count == 3, "got %d\n", count); + ok(hres == S_OK, "CountBodies failed: %08lx\n", hres); + ok(count == 3, "got %ld\n", count);
hres = IMimeMessage_GetAttachments(mime_message, &count, &body_list); - ok(hres == S_OK, "GetAttachments failed: %08x\n", hres); - ok(count == 2, "count = %u\n", count); + ok(hres == S_OK, "GetAttachments failed: %08lx\n", hres); + ok(count == 2, "count = %lu\n", count);
hres = IMimeMessage_BindToObject(mime_message, body_list[0], &IID_IMimeBody, (void**)&mime_body); - ok(hres == S_OK, "BindToObject failed: %08x\n", hres); + ok(hres == S_OK, "BindToObject failed: %08lx\n", hres);
hres = IMimeBody_GetData(mime_body, IET_BINARY, &stream); - ok(hres == S_OK, "GetData failed: %08x\n", hres); + ok(hres == S_OK, "GetData failed: %08lx\n", hres); test_stream_read(stream, S_OK, "<HTML></HTML>", -1); IStream_Release(stream);
@@ -807,12 +807,12 @@ static void test_mhtml_message(void) IMimeBody_Release(mime_body);
hres = IMimeMessage_BindToObject(mime_message, body_list[1], &IID_IMimeBody, (void**)&mime_body); - ok(hres == S_OK, "BindToObject failed: %08x\n", hres); + ok(hres == S_OK, "BindToObject failed: %08lx\n", hres);
test_current_encoding(mime_body, IET_BASE64);
hres = IMimeBody_GetData(mime_body, IET_BINARY, &stream); - ok(hres == S_OK, "GetData failed: %08x\n", hres); + ok(hres == S_OK, "GetData failed: %08lx\n", hres); test_stream_read(stream, S_OK, "Test", -1); IStream_Release(stream);
@@ -832,38 +832,38 @@ static void test_MessageSetProp(void) PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_SetProp(body, NULL, 0, &prop); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_SetProp(body, "Thread-Topic", 0, NULL); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
prop.vt = VT_LPSTR; prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, "Thread-Topic", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
hr = IMimeBody_GetProp(body, NULL, 0, &prop); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, "Thread-Topic", 0, NULL); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, "Wine-Topic", 0, &prop); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
prop.vt = VT_LPSTR; hr = IMimeBody_GetProp(body, "Thread-Topic", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); @@ -875,12 +875,12 @@ static void test_MessageSetProp(void) prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
prop.vt = VT_LPSTR; hr = IMimeBody_GetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); @@ -891,7 +891,7 @@ static void test_MessageSetProp(void) /* Using the name or PID returns the same result. */ prop.vt = VT_LPSTR; hr = IMimeBody_GetProp(body, "Subject", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); @@ -901,7 +901,7 @@ static void test_MessageSetProp(void)
prop.vt = VT_LPWSTR; hr = IMimeBody_GetProp(body, "Subject", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { ok(prop.vt == VT_LPWSTR, "type %d\n", prop.vt); @@ -913,7 +913,7 @@ static void test_MessageSetProp(void) prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_TO), 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
/* Out of Range PID */ @@ -921,7 +921,7 @@ static void test_MessageSetProp(void) prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, PIDTOSTR(124), 0, &prop); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr); PropVariantClear(&prop);
IMimeBody_Release(body); @@ -939,60 +939,60 @@ static void test_MessageGetPropInfo(void) MIMEPROPINFO info;
hr = MimeOleCreateMessage(NULL, &msg); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
prop.vt = VT_LPSTR; prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, "Thread-Topic", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
prop.vt = VT_LPSTR; prop.pszVal = CoTaskMemAlloc(strlen(subject)+1); strcpy(prop.pszVal, subject); hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
memset(&info, 0, sizeof(info)); info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID; hr = IMimeBody_GetPropInfo(body, NULL, &info); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
memset(&info, 0, sizeof(info)); info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID; hr = IMimeBody_GetPropInfo(body, "Subject", NULL); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); + ok(hr == E_INVALIDARG, "ret %08lx\n", hr);
memset(&info, 0xfe, sizeof(info)); info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID; hr = IMimeBody_GetPropInfo(body, "Subject", &info); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { - ok(info.dwMask & (PIM_ENCODINGTYPE | PIM_FLAGS| PIM_PROPID), "Invalid mask 0x%08x\n", info.dwFlags); - todo_wine ok(info.dwFlags & 0x10000000, "Invalid flags 0x%08x\n", info.dwFlags); + ok(info.dwMask & (PIM_ENCODINGTYPE | PIM_FLAGS| PIM_PROPID), "Invalid mask 0x%08lx\n", info.dwFlags); + todo_wine ok(info.dwFlags & 0x10000000, "Invalid flags 0x%08lx\n", info.dwFlags); ok(info.ietEncoding == 0, "Invalid encoding %d\n", info.ietEncoding); - ok(info.dwPropId == PID_HDR_SUBJECT, "Invalid propid %d\n", info.dwPropId); - ok(info.cValues == 0xfefefefe, "Invalid cValues %d\n", info.cValues); + ok(info.dwPropId == PID_HDR_SUBJECT, "Invalid propid %ld\n", info.dwPropId); + ok(info.cValues == 0xfefefefe, "Invalid cValues %ld\n", info.cValues); }
memset(&info, 0xfe, sizeof(info)); info.dwMask = 0; hr = IMimeBody_GetPropInfo(body, "Subject", &info); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { - ok(info.dwMask == 0, "Invalid mask 0x%08x\n", info.dwFlags); - ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08x\n", info.dwFlags); + ok(info.dwMask == 0, "Invalid mask 0x%08lx\n", info.dwFlags); + ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08lx\n", info.dwFlags); ok(info.ietEncoding == -16843010, "Invalid encoding %d\n", info.ietEncoding); - ok(info.dwPropId == -16843010, "Invalid propid %d\n", info.dwPropId); + ok(info.dwPropId == -16843010, "Invalid propid %ld\n", info.dwPropId); }
memset(&info, 0xfe, sizeof(info)); @@ -1000,19 +1000,19 @@ static void test_MessageGetPropInfo(void) info.dwPropId = 1024; info.ietEncoding = 99; hr = IMimeBody_GetPropInfo(body, "Subject", &info); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); if(hr == S_OK) { - ok(info.dwMask == 0, "Invalid mask 0x%08x\n", info.dwFlags); - ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08x\n", info.dwFlags); + ok(info.dwMask == 0, "Invalid mask 0x%08lx\n", info.dwFlags); + ok(info.dwFlags == 0xfefefefe, "Invalid flags 0x%08lx\n", info.dwFlags); ok(info.ietEncoding == 99, "Invalid encoding %d\n", info.ietEncoding); - ok(info.dwPropId == 1024, "Invalid propid %d\n", info.dwPropId); + ok(info.dwPropId == 1024, "Invalid propid %ld\n", info.dwPropId); }
memset(&info, 0, sizeof(info)); info.dwMask = PIM_ENCODINGTYPE | PIM_FLAGS | PIM_PROPID; hr = IMimeBody_GetPropInfo(body, "Invalid Property", &info); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
IMimeBody_Release(body); IMimeMessage_Release(msg); @@ -1027,18 +1027,18 @@ static void test_MessageOptions(void) PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
prop.vt = VT_BOOL; prop.boolVal = TRUE; hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop); - todo_wine ok(hr == S_OK, "ret %08x\n", hr); + todo_wine ok(hr == S_OK, "ret %08lx\n", hr); todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt); todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal); PropVariantClear(&prop); @@ -1047,11 +1047,11 @@ static void test_MessageOptions(void) prop.pszVal = CoTaskMemAlloc(strlen(string)+1); strcpy(prop.pszVal, string); hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop); - todo_wine ok(hr == S_OK, "ret %08x\n", hr); + todo_wine ok(hr == S_OK, "ret %08lx\n", hr); todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt); todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal); PropVariantClear(&prop); @@ -1061,11 +1061,11 @@ static void test_MessageOptions(void) prop.pszVal = CoTaskMemAlloc(strlen(zero)+1); strcpy(prop.pszVal, zero); hr = IMimeMessage_SetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
hr = IMimeMessage_GetOption(msg, OID_HIDE_TNEF_ATTACHMENTS, &prop); - todo_wine ok(hr == S_OK, "ret %08x\n", hr); + todo_wine ok(hr == S_OK, "ret %08lx\n", hr); todo_wine ok(prop.vt == VT_BOOL, "vt %08x\n", prop.vt); todo_wine ok(prop.boolVal == TRUE, "Hide Attachments got %d\n", prop.boolVal); PropVariantClear(&prop); @@ -1074,14 +1074,14 @@ static void test_MessageOptions(void) prop.vt = VT_BOOL; prop.boolVal = TRUE; hr = IMimeMessage_SetOption(msg, 0xff00000a, &prop); - ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08x\n", hr); + ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08lx\n", hr); PropVariantClear(&prop);
/* Out of range before type. */ prop.vt = VT_I4; prop.lVal = 1; hr = IMimeMessage_SetOption(msg, 0xff00000a, &prop); - ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08x\n", hr); + ok(hr == MIME_E_INVALID_OPTION_ID, "ret %08lx\n", hr); PropVariantClear(&prop);
IMimeMessage_Release(msg); @@ -1095,14 +1095,14 @@ static void test_BindToObject(void) ULONG count;
hr = MimeOleCreateMessage(NULL, &msg); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeMessage_CountBodies(msg, HBODY_ROOT, TRUE, &count); - ok(hr == S_OK, "ret %08x\n", hr); - ok(count == 1, "got %d\n", count); + ok(hr == S_OK, "ret %08lx\n", hr); + ok(count == 1, "got %ld\n", count);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); IMimeBody_Release(body);
IMimeMessage_Release(msg); @@ -1117,44 +1117,44 @@ static void test_BodyDeleteProp(void) PROPVARIANT prop;
hr = MimeOleCreateMessage(NULL, &msg); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
PropVariantInit(&prop);
hr = IMimeMessage_BindToObject(msg, HBODY_ROOT, &IID_IMimeBody, (void**)&body); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_DeleteProp(body, "Subject"); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
hr = IMimeBody_DeleteProp(body, PIDTOSTR(PID_HDR_SUBJECT)); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
prop.vt = VT_LPSTR; prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, "Subject", 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
hr = IMimeBody_DeleteProp(body, "Subject"); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, "Subject", 0, &prop); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
prop.vt = VT_LPSTR; prop.pszVal = CoTaskMemAlloc(strlen(topic)+1); strcpy(prop.pszVal, topic); hr = IMimeBody_SetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr); PropVariantClear(&prop);
hr = IMimeBody_DeleteProp(body, PIDTOSTR(PID_HDR_SUBJECT)); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
hr = IMimeBody_GetProp(body, PIDTOSTR(PID_HDR_SUBJECT), 0, &prop); - ok(hr == MIME_E_NOT_FOUND, "ret %08x\n", hr); + ok(hr == MIME_E_NOT_FOUND, "ret %08lx\n", hr);
IMimeBody_Release(body); IMimeMessage_Release(msg); @@ -1166,7 +1166,7 @@ static void test_MimeOleGetPropertySchema(void) IMimePropertySchema *schema = NULL;
hr = MimeOleGetPropertySchema(&schema); - ok(hr == S_OK, "ret %08x\n", hr); + ok(hr == S_OK, "ret %08lx\n", hr);
IMimePropertySchema_Release(schema); } @@ -1224,7 +1224,7 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB
ok(grfBINDF != NULL, "grfBINDF == NULL\n"); ok(pbindinfo != NULL, "pbindinfo == NULL\n"); - ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %d\n", pbindinfo->cbSize); + ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %ld\n", pbindinfo->cbSize);
*grfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON | BINDF_NEEDFILE; return S_OK; @@ -1332,7 +1332,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, CHECK_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); return S_OK; default: - ok(0, "unexpected call %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText)); + ok(0, "unexpected call %lu %s\n", ulStatusCode, wine_dbgstr_w(szStatusText)); }
return E_NOTIMPL; @@ -1347,19 +1347,19 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
CHECK_EXPECT(ReportData);
- ok(!ulProgress, "ulProgress = %u\n", ulProgress); + ok(!ulProgress, "ulProgress = %lu\n", ulProgress); ok(ulProgress == ulProgressMax, "ulProgress != ulProgressMax\n"); ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_INTERMEDIATEDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE | BSCF_AVAILABLEDATASIZEUNKNOWN), - "grcf = %08x\n", grfBSCF); + "grcf = %08lx\n", grfBSCF);
hres = IInternetProtocol_Read(current_binding_protocol, buf, sizeof(buf), &read); - ok(hres == S_OK, "Read failed: %08x\n", hres); + ok(hres == S_OK, "Read failed: %08lx\n", hres); buf[read] = 0; ok(!strcmp(buf, current_binding_test->data), "unexpected data: %s\n", buf);
hres = IInternetProtocol_Read(current_binding_protocol, buf, sizeof(buf), &read); - ok(hres == S_FALSE, "Read failed: %08x\n", hres); + ok(hres == S_FALSE, "Read failed: %08lx\n", hres); return S_OK; }
@@ -1367,8 +1367,8 @@ static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HR LPCWSTR szResult) { CHECK_EXPECT(ReportResult); - ok(hrResult == S_OK, "hrResult = %08x\n", hrResult); - ok(!dwError, "dwError = %u\n", dwError); + ok(hrResult == S_OK, "hrResult = %08lx\n", hrResult); + ok(!dwError, "dwError = %lu\n", dwError); ok(!szResult, "szResult = %s\n", wine_dbgstr_w(szResult)); return S_OK; } @@ -1411,7 +1411,7 @@ static void test_mhtml_protocol_binding(const mhtml_binding_test_t *test) MultiByteToWideChar(CP_ACP, 0, urla, -1, test_url, ARRAY_SIZE(test_url));
hres = CoCreateInstance(&CLSID_IMimeHtmlProtocol, NULL, CLSCTX_INPROC_SERVER, &IID_IInternetProtocol, (void**)&protocol); - ok(hres == S_OK, "Could not create protocol handler: %08x\n", hres); + ok(hres == S_OK, "Could not create protocol handler: %08lx\n", hres);
hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetProtocolEx, (void**)&unk); ok(hres == E_NOINTERFACE, "Could get IInternetProtocolEx\n"); @@ -1425,7 +1425,7 @@ static void test_mhtml_protocol_binding(const mhtml_binding_test_t *test) SET_EXPECT(ReportData); SET_EXPECT(ReportResult); hres = IInternetProtocol_Start(protocol, test_url, &protocol_sink, &bind_info, 0, 0); - ok(hres == S_OK, "Start failed: %08x\n", hres); + ok(hres == S_OK, "Start failed: %08lx\n", hres); CHECK_CALLED(GetBindInfo); CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); todo_wine CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE); @@ -1434,7 +1434,7 @@ static void test_mhtml_protocol_binding(const mhtml_binding_test_t *test)
IInternetProtocol_Release(protocol); ret = DeleteFileA("winetest.mht"); - ok(ret, "DeleteFile failed: %u\n", GetLastError()); + ok(ret, "DeleteFile failed: %lu\n", GetLastError()); }
static const struct { @@ -1489,7 +1489,7 @@ static void test_mhtml_protocol_info(void)
hres = CoCreateInstance(&CLSID_IMimeHtmlProtocol, NULL, CLSCTX_INPROC_SERVER, &IID_IInternetProtocolInfo, (void**)&protocol_info); - ok(hres == S_OK, "Could not create protocol info: %08x\n", hres); + ok(hres == S_OK, "Could not create protocol info: %08lx\n", hres);
for(i = 0; i < ARRAY_SIZE(combine_tests); i++) { combined_len = 0xdeadbeef; @@ -1497,10 +1497,10 @@ static void test_mhtml_protocol_info(void) combine_tests[i].relative_url, ICU_BROWSER_MODE, combined_url, ARRAY_SIZE(combined_url), &combined_len, 0); todo_wine_if(combine_tests[i].todo) - ok(hres == S_OK, "[%u] CombineUrl failed: %08x\n", i, hres); + ok(hres == S_OK, "[%u] CombineUrl failed: %08lx\n", i, hres); if(SUCCEEDED(hres)) { exlen = lstrlenW(combine_tests[i].expected_result); - ok(combined_len == exlen, "[%u] combined len is %u, expected %u\n", i, combined_len, exlen); + ok(combined_len == exlen, "[%u] combined len is %lu, expected %u\n", i, combined_len, exlen); ok(!lstrcmpW(combined_url, combine_tests[i].expected_result), "[%u] combined URL is %s, expected %s\n", i, wine_dbgstr_w(combined_url), wine_dbgstr_w(combine_tests[i].expected_result));
@@ -1508,15 +1508,15 @@ static void test_mhtml_protocol_info(void) hres = IInternetProtocolInfo_CombineUrl(protocol_info, combine_tests[i].base_url, combine_tests[i].relative_url, ICU_BROWSER_MODE, combined_url, exlen, &combined_len, 0); - ok(hres == E_FAIL, "[%u] CombineUrl returned: %08x\n", i, hres); - ok(!combined_len, "[%u] combined_len = %u\n", i, combined_len); + ok(hres == E_FAIL, "[%u] CombineUrl returned: %08lx\n", i, hres); + ok(!combined_len, "[%u] combined_len = %lu\n", i, combined_len); } }
hres = IInternetProtocolInfo_CombineUrl(protocol_info, L"http://test.org", L"http://test.org", ICU_BROWSER_MODE, combined_url, ARRAY_SIZE(combined_url), &combined_len, 0); - ok(hres == E_FAIL, "CombineUrl failed: %08x\n", hres); + ok(hres == E_FAIL, "CombineUrl failed: %08lx\n", hres);
IInternetProtocolInfo_Release(protocol_info); } @@ -1555,24 +1555,24 @@ static void test_mhtml_protocol(void)
/* test class factory */ hres = CoGetClassObject(&CLSID_IMimeHtmlProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk); - ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres); + ok(hres == S_OK, "CoGetClassObject failed: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&unk2); ok(hres == E_NOINTERFACE, "IInternetProtocolInfo supported\n");
hres = IUnknown_QueryInterface(unk, &IID_IClassFactory, (void**)&class_factory); - ok(hres == S_OK, "Could not get IClassFactory iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IClassFactory iface: %08lx\n", hres); IUnknown_Release(unk);
hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk); - ok(hres == S_OK, "CreateInstance returned: %08x\n", hres); + ok(hres == S_OK, "CreateInstance returned: %08lx\n", hres); hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocol, (void**)&unk2); - ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol iface: %08lx\n", hres); IUnknown_Release(unk2); IUnknown_Release(unk);
hres = IClassFactory_CreateInstance(class_factory, (IUnknown*)0xdeadbeef, &IID_IInternetProtocol, (void**)&unk2); - ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08x\n", hres); + ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08lx\n", hres);
IClassFactory_Release(class_factory);
@@ -1604,13 +1604,13 @@ static void test_MimeOleObjectFromMoniker(void)
for(i = 0; i < ARRAY_SIZE(tests); i++) { hres = CreateURLMoniker(NULL, tests[i].url, &mon); - ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres); + ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
hres = CreateBindCtx(0, &bind_ctx); - ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres); + ok(hres == S_OK, "CreateBindCtx failed: %08lx\n", hres);
hres = MimeOleObjectFromMoniker(0, mon, bind_ctx, &IID_IUnknown, (void**)&unk, &new_mon); - ok(hres == S_OK || broken(!i && hres == INET_E_RESOURCE_NOT_FOUND), "MimeOleObjectFromMoniker failed: %08x\n", hres); + ok(hres == S_OK || broken(!i && hres == INET_E_RESOURCE_NOT_FOUND), "MimeOleObjectFromMoniker failed: %08lx\n", hres); IBindCtx_Release(bind_ctx); if(hres == INET_E_RESOURCE_NOT_FOUND) { /* winxp */ win_skip("Broken MHTML behaviour found. Skipping some tests.\n"); @@ -1619,7 +1619,7 @@ static void test_MimeOleObjectFromMoniker(void) }
hres = IMoniker_GetDisplayName(new_mon, NULL, NULL, &mhtml_url); - ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres); + ok(hres == S_OK, "GetDisplayName failed: %08lx\n", hres); ok(!lstrcmpW(mhtml_url, tests[i].mhtml_url), "[%d] unexpected mhtml URL: %s\n", i, wine_dbgstr_w(mhtml_url)); CoTaskMemFree(mhtml_url);
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/inetmib1/tests/Makefile.in | 1 - dlls/inetmib1/tests/main.c | 58 ++++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/dlls/inetmib1/tests/Makefile.in b/dlls/inetmib1/tests/Makefile.in index 82417f742ce..9229fb660a8 100644 --- a/dlls/inetmib1/tests/Makefile.in +++ b/dlls/inetmib1/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = inetmib1.dll IMPORTS = snmpapi
diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index 32785fcc3fe..25ff35fe41e 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -65,7 +65,7 @@ if (0) /* crashes on native */ }
ret = pSnmpExtensionInit(0, &event, &oid); - ok(ret, "SnmpExtensionInit failed: %d\n", GetLastError()); + ok(ret, "SnmpExtensionInit failed: %ld\n", GetLastError()); ok(!strcmp("1.3.6.1.2.1.1", SnmpUtilOidToA(&oid)), "Expected 1.3.6.1.2.1.1, got %s\n", SnmpUtilOidToA(&oid));
@@ -115,10 +115,10 @@ if (0) /* crashes on native */ error = 0xdeadbeef; index = 0xdeadbeef; ret = pSnmpExtensionQuery(SNMP_PDU_GET, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOERROR, - "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); - ok(index == 0, "expected index 0, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOERROR, got %ld\n", error); + ok(index == 0, "expected index 0, got %ld\n", index);
/* Oddly enough, this "succeeds," even though the OID is clearly * unsupported. @@ -132,15 +132,15 @@ if (0) /* crashes on native */ error = 0xdeadbeef; index = 0xdeadbeef; ret = pSnmpExtensionQuery(SNMP_PDU_GET, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOERROR || broken(error == ERROR_FILE_NOT_FOUND) /* NT4 */, - "expected SNMP_ERRORSTATUS_NOERROR or ERROR_FILE_NOT_FOUND, got %d\n", + "expected SNMP_ERRORSTATUS_NOERROR or ERROR_FILE_NOT_FOUND, got %ld\n", error); if (error == SNMP_ERRORSTATUS_NOERROR) - ok(index == 0, "expected index 0, got %d\n", index); + ok(index == 0, "expected index 0, got %ld\n", index); else if (error == ERROR_FILE_NOT_FOUND) - ok(index == 1, "expected index 1, got %d\n", index); + ok(index == 1, "expected index 1, got %ld\n", index); /* The OID isn't changed either: */ ok(!strcmp("1.2.3.4", SnmpUtilOidToA(&vars[0].name)), "expected 1.2.3.4, got %s\n", SnmpUtilOidToA(&vars[0].name)); @@ -152,11 +152,11 @@ if (0) /* crashes on native */ error = 0xdeadbeef; index = 0xdeadbeef; ret = pSnmpExtensionQuery(SNMP_PDU_GET, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOSUCHNAME, - "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error); + "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %ld\n", error); /* The index is 1-based rather than 0-based */ - ok(index == 1, "expected index 1, got %d\n", index); + ok(index == 1, "expected index 1, got %ld\n", index);
/* A Get fails on something that specifies a table (but not a particular * entry in it)... @@ -172,10 +172,10 @@ if (0) /* crashes on native */ error = 0xdeadbeef; index = 0xdeadbeef; ret = pSnmpExtensionQuery(SNMP_PDU_GET, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOSUCHNAME, - "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error); - ok(index == 1, "expected index 1, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %ld\n", error); + ok(index == 1, "expected index 1, got %ld\n", index); /* but a GetNext succeeds with the same values, because GetNext gets the * entry after the specified OID, not the entry specified by it. The * successor to the table is the first entry in the table. @@ -194,10 +194,10 @@ if (0) /* crashes on native */ error = 0xdeadbeef; index = 0xdeadbeef; ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOERROR, - "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); - ok(index == 0, "expected index 0, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOERROR, got %ld\n", error); + ok(index == 0, "expected index 0, got %ld\n", index); if (!ret) moreData = FALSE; else if (error) @@ -276,10 +276,10 @@ if (0) /* crashes on native */ list.list = vars2; noChange = FALSE; ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOERROR, - "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); - ok(index == 0, "expected index 0, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOERROR, got %ld\n", error); + ok(index == 0, "expected index 0, got %ld\n", index); vars3[0].name.idLength = ARRAY_SIZE(mib2If); vars3[0].name.ids = mib2If; ok(!SnmpUtilOidNCmp(&vars2[0].name, &vars[0].name, vars[0].name.idLength) || @@ -298,10 +298,10 @@ if (0) /* crashes on native */ moreData = TRUE; do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOERROR, - "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); - ok(index == 0, "expected index 0, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOERROR, got %ld\n", error); + ok(index == 0, "expected index 0, got %ld\n", index); if (!ret) moreData = FALSE; else if (error) @@ -364,10 +364,10 @@ if (0) /* crashes on native */ noChange = FALSE; do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); ok(error == SNMP_ERRORSTATUS_NOERROR, - "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); - ok(index == 0, "expected index 0, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOERROR, got %ld\n", error); + ok(index == 0, "expected index 0, got %ld\n", index); if (!ret) moreData = FALSE; else if (error) @@ -430,7 +430,7 @@ if (0) /* crashes on native */ noChange = FALSE; do { ret = pSnmpExtensionQuery(SNMP_PDU_GETNEXT, &list, &error, &index); - ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index); + ok(ret, "SnmpExtensionQuery failed: %ld, %ld\n", error, index); /* FIXME: error and index aren't checked here because the UDP table is * the last OID currently supported by Wine, so the last GetNext fails. * todo_wine is also not effective because it will succeed for all but @@ -439,8 +439,8 @@ if (0) /* crashes on native */ */ if (0) { ok(error == SNMP_ERRORSTATUS_NOERROR, - "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); - ok(index == 0, "expected index 0, got %d\n", index); + "expected SNMP_ERRORSTATUS_NOERROR, got %ld\n", error); + ok(index == 0, "expected index 0, got %ld\n", index); } if (!ret) moreData = FALSE;
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/infosoft/tests/Makefile.in | 1 - dlls/infosoft/tests/infosoft.c | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/infosoft/tests/Makefile.in b/dlls/infosoft/tests/Makefile.in index 037957adef9..971d67b9f48 100644 --- a/dlls/infosoft/tests/Makefile.in +++ b/dlls/infosoft/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = infosoft.dll IMPORTS = ole32
diff --git a/dlls/infosoft/tests/infosoft.c b/dlls/infosoft/tests/infosoft.c index 996af73ca20..72b33f25ce7 100644 --- a/dlls/infosoft/tests/infosoft.c +++ b/dlls/infosoft/tests/infosoft.c @@ -76,10 +76,10 @@ static HRESULT WINAPI ws_PutWord(IWordSink *iface, ULONG cwc, const WCHAR *pwcIn winetest_push_context("word %d", wordnum); if (wordnum < ARRAY_SIZE(testres)) { - ok(testres[wordnum].len == cwcSrcLen, "expected length %d, got %d\n", + ok(testres[wordnum].len == cwcSrcLen, "expected length %d, got %ld\n", testres[wordnum].len, cwcSrcLen); ok(!cwcSrcPos || (testres[wordnum].ofs == cwcSrcPos), - "expected offset %d, got %d\n", testres[wordnum].ofs, cwcSrcPos); + "expected offset %d, got %ld\n", testres[wordnum].ofs, cwcSrcPos); ok(!memcmp(testres[wordnum].data, pwcInBuf, cwcSrcLen), "expected data %s, got %s\n", wine_dbgstr_wn(testres[wordnum].data, cwcSrcLen), @@ -176,7 +176,7 @@ START_TEST(infosoft) TEXT_SOURCE ts;
r = CoInitialize(NULL); - ok( r == S_OK, "failed: %08x\n", r); + ok( r == S_OK, "failed: %08lx\n", r);
r = CoCreateInstance( &CLSID_wb_neutral, NULL, CLSCTX_INPROC_SERVER, &_IID_IWordBreaker, (LPVOID)&wb); @@ -194,7 +194,7 @@ START_TEST(infosoft) ts.iEnd = lstrlenW(ts.awcBuffer); ts.iCur = 0; r = IWordBreaker_BreakText(wb, &ts, &wordsink.IWordSink_iface, NULL); - ok( r == S_OK, "failed: %08x\n", r); + ok( r == S_OK, "failed: %08lx\n", r);
ok(wordnum == 4, "expected 4 words, got %d\n", wordnum);
@@ -205,10 +205,10 @@ START_TEST(infosoft) ts.iCur = 0;
r = fillbuf_many(&ts); - ok( r == S_OK, "failed: %08x\n", r); + ok( r == S_OK, "failed: %08lx\n", r);
r = IWordBreaker_BreakText(wb, &ts, &wordsink.IWordSink_iface, NULL); - ok( r == S_OK, "failed: %08x\n", r); + ok( r == S_OK, "failed: %08lx\n", r);
ok(wordnum == 4, "expected 4 words, got %d\n", wordnum); IWordBreaker_Release( wb );
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/iphlpapi/tests/Makefile.in | 1 dlls/iphlpapi/tests/iphlpapi.c | 946 ++++++++++++++++++++------------------- 2 files changed, 473 insertions(+), 474 deletions(-)
diff --git a/dlls/iphlpapi/tests/Makefile.in b/dlls/iphlpapi/tests/Makefile.in index 6d95690a72e..d8131013546 100644 --- a/dlls/iphlpapi/tests/Makefile.in +++ b/dlls/iphlpapi/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = iphlpapi.dll IMPORTS = iphlpapi
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index be50cc0b476..c40ae3989c6 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -104,7 +104,7 @@ static const char *ntoa( DWORD ip )
ip = htonl(ip); i = (i + 1) % ARRAY_SIZE(buffers); - sprintf( buffers[i], "%u.%u.%u.%u", (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff ); + sprintf( buffers[i], "%lu.%lu.%lu.%lu", (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff ); return buffers[i]; }
@@ -138,13 +138,13 @@ static void testGetNumberOfInterfaces(void) if (apiReturn == ERROR_NOT_SUPPORTED) return; ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetNumberOfInterfaces(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetNumberOfInterfaces(NULL) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); }
apiReturn = GetNumberOfInterfaces(&numInterfaces); ok(apiReturn == NO_ERROR, - "GetNumberOfInterfaces returned %d, expected 0\n", apiReturn); + "GetNumberOfInterfaces returned %ld, expected 0\n", apiReturn); }
static void testGetIfEntry(DWORD index) @@ -159,18 +159,18 @@ static void testGetIfEntry(DWORD index) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIfEntry(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetIfEntry(NULL) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); row.dwIndex = -1; /* hope that's always bogus! */ apiReturn = GetIfEntry(&row); ok(apiReturn == ERROR_INVALID_DATA || apiReturn == ERROR_FILE_NOT_FOUND /* Vista */, - "GetIfEntry(bogus row) returned %d, expected ERROR_INVALID_DATA or ERROR_FILE_NOT_FOUND\n", + "GetIfEntry(bogus row) returned %ld, expected ERROR_INVALID_DATA or ERROR_FILE_NOT_FOUND\n", apiReturn); row.dwIndex = index; apiReturn = GetIfEntry(&row); ok(apiReturn == NO_ERROR, - "GetIfEntry returned %d, expected NO_ERROR\n", apiReturn); + "GetIfEntry returned %ld, expected NO_ERROR\n", apiReturn); }
static void testGetIpAddrTable(void) @@ -184,18 +184,18 @@ static void testGetIpAddrTable(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpAddrTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetIpAddrTable(NULL, NULL, FALSE) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetIpAddrTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIpAddrTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + "GetIpAddrTable(NULL, &dwSize, FALSE) returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_IPADDRTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
apiReturn = GetIpAddrTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, - "GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + "GetIpAddrTable(buf, &dwSize, FALSE) returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && buf->dwNumEntries) { @@ -204,9 +204,9 @@ static void testGetIpAddrTable(void) for (i = 0; i < buf->dwNumEntries; i++) { ok (buf->table[i].wType != 0, "Test[%d]: expected wType > 0\n", i); - ok (buf->table[i].dwBCastAddr == 1, "Test[%d]: got %08x\n", i, buf->table[i].dwBCastAddr); - ok (buf->table[i].dwReasmSize == 0xffff, "Test[%d]: got %08x\n", i, buf->table[i].dwReasmSize); - trace("Entry[%d]: addr %s, dwIndex %u, wType 0x%x\n", i, + ok (buf->table[i].dwBCastAddr == 1, "Test[%d]: got %08lx\n", i, buf->table[i].dwBCastAddr); + ok (buf->table[i].dwReasmSize == 0xffff, "Test[%d]: got %08lx\n", i, buf->table[i].dwReasmSize); + trace("Entry[%d]: addr %s, dwIndex %lu, wType 0x%x\n", i, ntoa(buf->table[i].dwAddr), buf->table[i].dwIndex, buf->table[i].wType); } } @@ -225,18 +225,18 @@ static void testGetIfTable(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIfTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetIfTable(NULL, NULL, FALSE) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetIfTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIfTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + "GetIfTable(NULL, &dwSize, FALSE) returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_IFTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
apiReturn = GetIfTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, - "GetIfTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n\n", + "GetIfTable(buf, &dwSize, FALSE) returned %ld, expected NO_ERROR\n\n", apiReturn);
if (apiReturn == NO_ERROR) @@ -245,7 +245,7 @@ static void testGetIfTable(void) WCHAR name[MAX_INTERFACE_NAME_LEN]; DWORD i, index;
- if (winetest_debug > 1) trace( "interface table: %u entries\n", buf->dwNumEntries ); + if (winetest_debug > 1) trace( "interface table: %lu entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) { MIB_IFROW *row = &buf->table[i]; @@ -254,20 +254,20 @@ static void testGetIfTable(void)
if (winetest_debug > 1) { - trace( "%u: '%s' type %u mtu %u speed %u\n", + trace( "%lu: '%s' type %lu mtu %lu speed %lu\n", row->dwIndex, debugstr_w(row->wszName), row->dwType, row->dwMtu, row->dwSpeed ); - trace( " in: bytes %u upkts %u nupkts %u disc %u err %u unk %u\n", + trace( " in: bytes %lu upkts %lu nupkts %lu disc %lu err %lu unk %lu\n", row->dwInOctets, row->dwInUcastPkts, row->dwInNUcastPkts, row->dwInDiscards, row->dwInErrors, row->dwInUnknownProtos ); - trace( " out: bytes %u upkts %u nupkts %u disc %u err %u\n", + trace( " out: bytes %lu upkts %lu nupkts %lu disc %lu err %lu\n", row->dwOutOctets, row->dwOutUcastPkts, row->dwOutNUcastPkts, row->dwOutDiscards, row->dwOutErrors ); } apiReturn = GetAdapterIndex( row->wszName, &index ); - ok( !apiReturn, "got %d\n", apiReturn ); + ok( !apiReturn, "got %ld\n", apiReturn ); ok( index == row->dwIndex || broken( index != row->dwIndex && index ), /* Win8 can have identical guids for two different ifaces */ - "got %d vs %d\n", index, row->dwIndex ); + "got %ld vs %ld\n", index, row->dwIndex ); memset( &row2, 0, sizeof(row2) ); row2.InterfaceIndex = row->dwIndex; GetIfEntry2( &row2 ); @@ -294,41 +294,41 @@ static void testGetIpForwardTable(void) MIB_UNICASTIPADDRESS_TABLE *unicast;
err = GetIpForwardTable( NULL, NULL, FALSE ); - ok( err == ERROR_INVALID_PARAMETER, "got %d\n", err ); + ok( err == ERROR_INVALID_PARAMETER, "got %ld\n", err );
err = GetIpForwardTable( NULL, &size, FALSE ); - ok( err == ERROR_INSUFFICIENT_BUFFER, "got %d\n", err ); + ok( err == ERROR_INSUFFICIENT_BUFFER, "got %ld\n", err );
buf = malloc( size ); err = GetIpForwardTable( buf, &size, FALSE ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
err = GetIpForwardTable2( AF_INET, &table2 ); - ok( !err, "got %d\n", err ); - ok( buf->dwNumEntries == table2->NumEntries, "got %d vs %d\n", + ok( !err, "got %ld\n", err ); + ok( buf->dwNumEntries == table2->NumEntries, "got %ld vs %ld\n", buf->dwNumEntries, table2->NumEntries );
err = GetUnicastIpAddressTable( AF_INET, &unicast ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
- trace( "IP forward table: %u entries\n", buf->dwNumEntries ); + trace( "IP forward table: %lu entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) { MIB_IPFORWARDROW *row = buf->table + i; MIB_IPFORWARD_ROW2 *row2 = table2->Table + i; DWORD mask, next_hop;
- winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i );
- trace( "dest %s mask %s gw %s if %u type %u proto %u\n", + trace( "dest %s mask %s gw %s if %lu type %lu proto %lu\n", ntoa( row->dwForwardDest ), ntoa( row->dwForwardMask ), ntoa( row->dwForwardNextHop ), row->dwForwardIfIndex, row->dwForwardType, row->dwForwardProto ); ok( row->dwForwardDest == row2->DestinationPrefix.Prefix.Ipv4.sin_addr.s_addr, - "got %08x vs %08x\n", row->dwForwardDest, row2->DestinationPrefix.Prefix.Ipv4.sin_addr.s_addr ); + "got %08lx vs %08lx\n", row->dwForwardDest, row2->DestinationPrefix.Prefix.Ipv4.sin_addr.s_addr ); ConvertLengthToIpv4Mask( row2->DestinationPrefix.PrefixLength, &mask ); - ok( row->dwForwardMask == mask, "got %08x vs %08x\n", row->dwForwardMask, mask ); - ok( row->dwForwardPolicy == 0, "got %d\n", row->dwForwardPolicy ); + ok( row->dwForwardMask == mask, "got %08lx vs %08lx\n", row->dwForwardMask, mask ); + ok( row->dwForwardPolicy == 0, "got %ld\n", row->dwForwardPolicy );
next_hop = row2->NextHop.Ipv4.sin_addr.s_addr; if (!next_hop) /* for direct addresses, dwForwardNextHop is set to the address of the appropriate interface */ @@ -342,22 +342,22 @@ static void testGetIpForwardTable(void) } } } - ok( row->dwForwardNextHop == next_hop, "got %08x vs %08x\n", row->dwForwardNextHop, next_hop ); + ok( row->dwForwardNextHop == next_hop, "got %08lx vs %08lx\n", row->dwForwardNextHop, next_hop );
- ok( row->dwForwardIfIndex == row2->InterfaceIndex, "got %d vs %d\n", row->dwForwardIfIndex, row2->InterfaceIndex ); + ok( row->dwForwardIfIndex == row2->InterfaceIndex, "got %ld vs %ld\n", row->dwForwardIfIndex, row2->InterfaceIndex ); if (!row2->NextHop.Ipv4.sin_addr.s_addr) - ok( buf->table[i].dwForwardType == MIB_IPROUTE_TYPE_DIRECT, "got %d\n", buf->table[i].dwForwardType ); + ok( buf->table[i].dwForwardType == MIB_IPROUTE_TYPE_DIRECT, "got %ld\n", buf->table[i].dwForwardType ); else - ok( buf->table[i].dwForwardType == MIB_IPROUTE_TYPE_INDIRECT, "got %d\n", buf->table[i].dwForwardType ); - ok( row->dwForwardProto == row2->Protocol, "got %d vs %d\n", row->dwForwardProto, row2->Protocol ); - ok( row->dwForwardAge == row2->Age, "got %d vs %d\n", row->dwForwardAge, row2->Age ); - ok( row->dwForwardNextHopAS == 0, "got %08x\n", row->dwForwardNextHopAS ); + ok( buf->table[i].dwForwardType == MIB_IPROUTE_TYPE_INDIRECT, "got %ld\n", buf->table[i].dwForwardType ); + ok( row->dwForwardProto == row2->Protocol, "got %ld vs %d\n", row->dwForwardProto, row2->Protocol ); + ok( row->dwForwardAge == row2->Age, "got %ld vs %ld\n", row->dwForwardAge, row2->Age ); + ok( row->dwForwardNextHopAS == 0, "got %08lx\n", row->dwForwardNextHopAS ); /* FIXME: need to add the interface's metric from GetIpInterfaceTable() */ - ok( row->dwForwardMetric1 >= row2->Metric, "got %d vs %d\n", row->dwForwardMetric1, row2->Metric ); - ok( row->dwForwardMetric2 == 0, "got %d\n", row->dwForwardMetric2 ); - ok( row->dwForwardMetric3 == 0, "got %d\n", row->dwForwardMetric3 ); - ok( row->dwForwardMetric4 == 0, "got %d\n", row->dwForwardMetric4 ); - ok( row->dwForwardMetric5 == 0, "got %d\n", row->dwForwardMetric5 ); + ok( row->dwForwardMetric1 >= row2->Metric, "got %ld vs %ld\n", row->dwForwardMetric1, row2->Metric ); + ok( row->dwForwardMetric2 == 0, "got %ld\n", row->dwForwardMetric2 ); + ok( row->dwForwardMetric3 == 0, "got %ld\n", row->dwForwardMetric3 ); + ok( row->dwForwardMetric4 == 0, "got %ld\n", row->dwForwardMetric4 ); + ok( row->dwForwardMetric5 == 0, "got %ld\n", row->dwForwardMetric5 );
winetest_pop_context(); } @@ -377,11 +377,11 @@ static void testGetIpNetTable(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpNetTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetIpNetTable(NULL, NULL, FALSE) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetIpNetTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIpNetTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_NO_DATA or ERROR_INSUFFICIENT_BUFFER\n", + "GetIpNetTable(NULL, &dwSize, FALSE) returned %ld, expected ERROR_NO_DATA or ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_NO_DATA) ; /* empty ARP table's okay */ @@ -391,17 +391,17 @@ static void testGetIpNetTable(void) apiReturn = GetIpNetTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR || apiReturn == ERROR_NO_DATA, /* empty ARP table's okay */ - "GetIpNetTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + "GetIpNetTable(buf, &dwSize, FALSE) returned %ld, expected NO_ERROR\n", apiReturn);
if (apiReturn == NO_ERROR && winetest_debug > 1) { DWORD i, j;
- trace( "IP net table: %u entries\n", buf->dwNumEntries ); + trace( "IP net table: %lu entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) { - trace( "%u: idx %u type %u addr %s phys", + trace( "%lu: idx %lu type %lu addr %s phys", i, buf->table[i].dwIndex, U(buf->table[i]).dwType, ntoa( buf->table[i].dwAddr )); for (j = 0; j < buf->table[i].dwPhysAddrLen; j++) printf( " %02x", buf->table[i].bPhysAddr[j] ); @@ -423,7 +423,7 @@ static void testGetIcmpStatistics(void) if (apiReturn == ERROR_NOT_SUPPORTED) return; ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIcmpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetIcmpStatistics(NULL) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); }
@@ -434,23 +434,23 @@ static void testGetIcmpStatistics(void) return; } ok(apiReturn == NO_ERROR, - "GetIcmpStatistics returned %d, expected NO_ERROR\n", apiReturn); + "GetIcmpStatistics returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "ICMP stats: %8s %8s\n", "in", "out" ); - trace( " dwMsgs: %8u %8u\n", stats.stats.icmpInStats.dwMsgs, stats.stats.icmpOutStats.dwMsgs ); - trace( " dwErrors: %8u %8u\n", stats.stats.icmpInStats.dwErrors, stats.stats.icmpOutStats.dwErrors ); - trace( " dwDestUnreachs: %8u %8u\n", stats.stats.icmpInStats.dwDestUnreachs, stats.stats.icmpOutStats.dwDestUnreachs ); - trace( " dwTimeExcds: %8u %8u\n", stats.stats.icmpInStats.dwTimeExcds, stats.stats.icmpOutStats.dwTimeExcds ); - trace( " dwParmProbs: %8u %8u\n", stats.stats.icmpInStats.dwParmProbs, stats.stats.icmpOutStats.dwParmProbs ); - trace( " dwSrcQuenchs: %8u %8u\n", stats.stats.icmpInStats.dwSrcQuenchs, stats.stats.icmpOutStats.dwSrcQuenchs ); - trace( " dwRedirects: %8u %8u\n", stats.stats.icmpInStats.dwRedirects, stats.stats.icmpOutStats.dwRedirects ); - trace( " dwEchos: %8u %8u\n", stats.stats.icmpInStats.dwEchos, stats.stats.icmpOutStats.dwEchos ); - trace( " dwEchoReps: %8u %8u\n", stats.stats.icmpInStats.dwEchoReps, stats.stats.icmpOutStats.dwEchoReps ); - trace( " dwTimestamps: %8u %8u\n", stats.stats.icmpInStats.dwTimestamps, stats.stats.icmpOutStats.dwTimestamps ); - trace( " dwTimestampReps: %8u %8u\n", stats.stats.icmpInStats.dwTimestampReps, stats.stats.icmpOutStats.dwTimestampReps ); - trace( " dwAddrMasks: %8u %8u\n", stats.stats.icmpInStats.dwAddrMasks, stats.stats.icmpOutStats.dwAddrMasks ); - trace( " dwAddrMaskReps: %8u %8u\n", stats.stats.icmpInStats.dwAddrMaskReps, stats.stats.icmpOutStats.dwAddrMaskReps ); + trace( " dwMsgs: %8lu %8lu\n", stats.stats.icmpInStats.dwMsgs, stats.stats.icmpOutStats.dwMsgs ); + trace( " dwErrors: %8lu %8lu\n", stats.stats.icmpInStats.dwErrors, stats.stats.icmpOutStats.dwErrors ); + trace( " dwDestUnreachs: %8lu %8lu\n", stats.stats.icmpInStats.dwDestUnreachs, stats.stats.icmpOutStats.dwDestUnreachs ); + trace( " dwTimeExcds: %8lu %8lu\n", stats.stats.icmpInStats.dwTimeExcds, stats.stats.icmpOutStats.dwTimeExcds ); + trace( " dwParmProbs: %8lu %8lu\n", stats.stats.icmpInStats.dwParmProbs, stats.stats.icmpOutStats.dwParmProbs ); + trace( " dwSrcQuenchs: %8lu %8lu\n", stats.stats.icmpInStats.dwSrcQuenchs, stats.stats.icmpOutStats.dwSrcQuenchs ); + trace( " dwRedirects: %8lu %8lu\n", stats.stats.icmpInStats.dwRedirects, stats.stats.icmpOutStats.dwRedirects ); + trace( " dwEchos: %8lu %8lu\n", stats.stats.icmpInStats.dwEchos, stats.stats.icmpOutStats.dwEchos ); + trace( " dwEchoReps: %8lu %8lu\n", stats.stats.icmpInStats.dwEchoReps, stats.stats.icmpOutStats.dwEchoReps ); + trace( " dwTimestamps: %8lu %8lu\n", stats.stats.icmpInStats.dwTimestamps, stats.stats.icmpOutStats.dwTimestamps ); + trace( " dwTimestampReps: %8lu %8lu\n", stats.stats.icmpInStats.dwTimestampReps, stats.stats.icmpOutStats.dwTimestampReps ); + trace( " dwAddrMasks: %8lu %8lu\n", stats.stats.icmpInStats.dwAddrMasks, stats.stats.icmpOutStats.dwAddrMasks ); + trace( " dwAddrMaskReps: %8lu %8lu\n", stats.stats.icmpInStats.dwAddrMaskReps, stats.stats.icmpOutStats.dwAddrMaskReps ); } }
@@ -465,37 +465,37 @@ static void testGetIpStatistics(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetIpStatistics(NULL) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetIpStatistics(&stats); ok(apiReturn == NO_ERROR, - "GetIpStatistics returned %d, expected NO_ERROR\n", apiReturn); + "GetIpStatistics returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "IP stats:\n" ); - trace( " dwForwarding: %u\n", U(stats).dwForwarding ); - trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); - trace( " dwInReceives: %u\n", stats.dwInReceives ); - trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); - trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); - trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); - trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); - trace( " dwInDiscards: %u\n", stats.dwInDiscards ); - trace( " dwInDelivers: %u\n", stats.dwInDelivers ); - trace( " dwOutRequests: %u\n", stats.dwOutRequests ); - trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); - trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); - trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); - trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); - trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); - trace( " dwReasmOks: %u\n", stats.dwReasmOks ); - trace( " dwReasmFails: %u\n", stats.dwReasmFails ); - trace( " dwFragOks: %u\n", stats.dwFragOks ); - trace( " dwFragFails: %u\n", stats.dwFragFails ); - trace( " dwFragCreates: %u\n", stats.dwFragCreates ); - trace( " dwNumIf: %u\n", stats.dwNumIf ); - trace( " dwNumAddr: %u\n", stats.dwNumAddr ); - trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); + trace( " dwForwarding: %lu\n", U(stats).dwForwarding ); + trace( " dwDefaultTTL: %lu\n", stats.dwDefaultTTL ); + trace( " dwInReceives: %lu\n", stats.dwInReceives ); + trace( " dwInHdrErrors: %lu\n", stats.dwInHdrErrors ); + trace( " dwInAddrErrors: %lu\n", stats.dwInAddrErrors ); + trace( " dwForwDatagrams: %lu\n", stats.dwForwDatagrams ); + trace( " dwInUnknownProtos: %lu\n", stats.dwInUnknownProtos ); + trace( " dwInDiscards: %lu\n", stats.dwInDiscards ); + trace( " dwInDelivers: %lu\n", stats.dwInDelivers ); + trace( " dwOutRequests: %lu\n", stats.dwOutRequests ); + trace( " dwRoutingDiscards: %lu\n", stats.dwRoutingDiscards ); + trace( " dwOutDiscards: %lu\n", stats.dwOutDiscards ); + trace( " dwOutNoRoutes: %lu\n", stats.dwOutNoRoutes ); + trace( " dwReasmTimeout: %lu\n", stats.dwReasmTimeout ); + trace( " dwReasmReqds: %lu\n", stats.dwReasmReqds ); + trace( " dwReasmOks: %lu\n", stats.dwReasmOks ); + trace( " dwReasmFails: %lu\n", stats.dwReasmFails ); + trace( " dwFragOks: %lu\n", stats.dwFragOks ); + trace( " dwFragFails: %lu\n", stats.dwFragFails ); + trace( " dwFragCreates: %lu\n", stats.dwFragCreates ); + trace( " dwNumIf: %lu\n", stats.dwNumIf ); + trace( " dwNumAddr: %lu\n", stats.dwNumAddr ); + trace( " dwNumRoutes: %lu\n", stats.dwNumRoutes ); } }
@@ -510,29 +510,29 @@ static void testGetTcpStatistics(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetTcpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetTcpStatistics(NULL) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetTcpStatistics(&stats); ok(apiReturn == NO_ERROR, - "GetTcpStatistics returned %d, expected NO_ERROR\n", apiReturn); + "GetTcpStatistics returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "TCP stats:\n" ); - trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); - trace( " dwRtoMin: %u\n", stats.dwRtoMin ); - trace( " dwRtoMax: %u\n", stats.dwRtoMax ); - trace( " dwMaxConn: %u\n", stats.dwMaxConn ); - trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); - trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); - trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); - trace( " dwEstabResets: %u\n", stats.dwEstabResets ); - trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); - trace( " dwInSegs: %u\n", stats.dwInSegs ); - trace( " dwOutSegs: %u\n", stats.dwOutSegs ); - trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); - trace( " dwInErrs: %u\n", stats.dwInErrs ); - trace( " dwOutRsts: %u\n", stats.dwOutRsts ); - trace( " dwNumConns: %u\n", stats.dwNumConns ); + trace( " dwRtoAlgorithm: %lu\n", U(stats).dwRtoAlgorithm ); + trace( " dwRtoMin: %lu\n", stats.dwRtoMin ); + trace( " dwRtoMax: %lu\n", stats.dwRtoMax ); + trace( " dwMaxConn: %lu\n", stats.dwMaxConn ); + trace( " dwActiveOpens: %lu\n", stats.dwActiveOpens ); + trace( " dwPassiveOpens: %lu\n", stats.dwPassiveOpens ); + trace( " dwAttemptFails: %lu\n", stats.dwAttemptFails ); + trace( " dwEstabResets: %lu\n", stats.dwEstabResets ); + trace( " dwCurrEstab: %lu\n", stats.dwCurrEstab ); + trace( " dwInSegs: %lu\n", stats.dwInSegs ); + trace( " dwOutSegs: %lu\n", stats.dwOutSegs ); + trace( " dwRetransSegs: %lu\n", stats.dwRetransSegs ); + trace( " dwInErrs: %lu\n", stats.dwInErrs ); + trace( " dwOutRsts: %lu\n", stats.dwOutRsts ); + trace( " dwNumConns: %lu\n", stats.dwNumConns ); } }
@@ -547,19 +547,19 @@ static void testGetUdpStatistics(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetUdpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetUdpStatistics(NULL) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetUdpStatistics(&stats); ok(apiReturn == NO_ERROR, - "GetUdpStatistics returned %d, expected NO_ERROR\n", apiReturn); + "GetUdpStatistics returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "UDP stats:\n" ); - trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); - trace( " dwNoPorts: %u\n", stats.dwNoPorts ); - trace( " dwInErrors: %u\n", stats.dwInErrors ); - trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); - trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); + trace( " dwInDatagrams: %lu\n", stats.dwInDatagrams ); + trace( " dwNoPorts: %lu\n", stats.dwNoPorts ); + trace( " dwInErrors: %lu\n", stats.dwInErrors ); + trace( " dwOutDatagrams: %lu\n", stats.dwOutDatagrams ); + trace( " dwNumAddrs: %lu\n", stats.dwNumAddrs ); } }
@@ -572,36 +572,36 @@ static void testGetIcmpStatisticsEx(void) if (1) { apiReturn = GetIcmpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIcmpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetIcmpStatisticsEx(NULL, AF_INET) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); }
apiReturn = GetIcmpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIcmpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetIcmpStatisticsEx(&stats, AF_BAN) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetIcmpStatisticsEx(&stats, AF_INET); - ok(apiReturn == NO_ERROR, "GetIcmpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + ok(apiReturn == NO_ERROR, "GetIcmpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { INT i; trace( "ICMP IPv4 Ex stats: %8s %8s\n", "in", "out" ); - trace( " dwMsgs: %8u %8u\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); - trace( " dwErrors: %8u %8u\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); + trace( " dwMsgs: %8lu %8lu\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); + trace( " dwErrors: %8lu %8lu\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); for (i = 0; i < 256; i++) - trace( " rgdwTypeCount[%3i]: %8u %8u\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); + trace( " rgdwTypeCount[%3i]: %8lu %8lu\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); }
apiReturn = GetIcmpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), - "GetIcmpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + "GetIcmpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { INT i; trace( "ICMP IPv6 Ex stats: %8s %8s\n", "in", "out" ); - trace( " dwMsgs: %8u %8u\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); - trace( " dwErrors: %8u %8u\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); + trace( " dwMsgs: %8lu %8lu\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); + trace( " dwErrors: %8lu %8lu\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); for (i = 0; i < 256; i++) - trace( " rgdwTypeCount[%3i]: %8u %8u\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); + trace( " rgdwTypeCount[%3i]: %8lu %8lu\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); } }
@@ -612,71 +612,71 @@ static void testGetIpStatisticsEx(void)
apiReturn = GetIpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetIpStatisticsEx(NULL, AF_INET) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetIpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetIpStatisticsEx(&stats, AF_BAN) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetIpStatisticsEx(&stats, AF_INET); - ok(apiReturn == NO_ERROR, "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + ok(apiReturn == NO_ERROR, "GetIpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "IP IPv4 Ex stats:\n" ); - trace( " dwForwarding: %u\n", U(stats).dwForwarding ); - trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); - trace( " dwInReceives: %u\n", stats.dwInReceives ); - trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); - trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); - trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); - trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); - trace( " dwInDiscards: %u\n", stats.dwInDiscards ); - trace( " dwInDelivers: %u\n", stats.dwInDelivers ); - trace( " dwOutRequests: %u\n", stats.dwOutRequests ); - trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); - trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); - trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); - trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); - trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); - trace( " dwReasmOks: %u\n", stats.dwReasmOks ); - trace( " dwReasmFails: %u\n", stats.dwReasmFails ); - trace( " dwFragOks: %u\n", stats.dwFragOks ); - trace( " dwFragFails: %u\n", stats.dwFragFails ); - trace( " dwFragCreates: %u\n", stats.dwFragCreates ); - trace( " dwNumIf: %u\n", stats.dwNumIf ); - trace( " dwNumAddr: %u\n", stats.dwNumAddr ); - trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); + trace( " dwForwarding: %lu\n", U(stats).dwForwarding ); + trace( " dwDefaultTTL: %lu\n", stats.dwDefaultTTL ); + trace( " dwInReceives: %lu\n", stats.dwInReceives ); + trace( " dwInHdrErrors: %lu\n", stats.dwInHdrErrors ); + trace( " dwInAddrErrors: %lu\n", stats.dwInAddrErrors ); + trace( " dwForwDatagrams: %lu\n", stats.dwForwDatagrams ); + trace( " dwInUnknownProtos: %lu\n", stats.dwInUnknownProtos ); + trace( " dwInDiscards: %lu\n", stats.dwInDiscards ); + trace( " dwInDelivers: %lu\n", stats.dwInDelivers ); + trace( " dwOutRequests: %lu\n", stats.dwOutRequests ); + trace( " dwRoutingDiscards: %lu\n", stats.dwRoutingDiscards ); + trace( " dwOutDiscards: %lu\n", stats.dwOutDiscards ); + trace( " dwOutNoRoutes: %lu\n", stats.dwOutNoRoutes ); + trace( " dwReasmTimeout: %lu\n", stats.dwReasmTimeout ); + trace( " dwReasmReqds: %lu\n", stats.dwReasmReqds ); + trace( " dwReasmOks: %lu\n", stats.dwReasmOks ); + trace( " dwReasmFails: %lu\n", stats.dwReasmFails ); + trace( " dwFragOks: %lu\n", stats.dwFragOks ); + trace( " dwFragFails: %lu\n", stats.dwFragFails ); + trace( " dwFragCreates: %lu\n", stats.dwFragCreates ); + trace( " dwNumIf: %lu\n", stats.dwNumIf ); + trace( " dwNumAddr: %lu\n", stats.dwNumAddr ); + trace( " dwNumRoutes: %lu\n", stats.dwNumRoutes ); }
apiReturn = GetIpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), - "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + "GetIpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "IP IPv6 Ex stats:\n" ); - trace( " dwForwarding: %u\n", U(stats).dwForwarding ); - trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); - trace( " dwInReceives: %u\n", stats.dwInReceives ); - trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); - trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); - trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); - trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); - trace( " dwInDiscards: %u\n", stats.dwInDiscards ); - trace( " dwInDelivers: %u\n", stats.dwInDelivers ); - trace( " dwOutRequests: %u\n", stats.dwOutRequests ); - trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); - trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); - trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); - trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); - trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); - trace( " dwReasmOks: %u\n", stats.dwReasmOks ); - trace( " dwReasmFails: %u\n", stats.dwReasmFails ); - trace( " dwFragOks: %u\n", stats.dwFragOks ); - trace( " dwFragFails: %u\n", stats.dwFragFails ); - trace( " dwFragCreates: %u\n", stats.dwFragCreates ); - trace( " dwNumIf: %u\n", stats.dwNumIf ); - trace( " dwNumAddr: %u\n", stats.dwNumAddr ); - trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); + trace( " dwForwarding: %lu\n", U(stats).dwForwarding ); + trace( " dwDefaultTTL: %lu\n", stats.dwDefaultTTL ); + trace( " dwInReceives: %lu\n", stats.dwInReceives ); + trace( " dwInHdrErrors: %lu\n", stats.dwInHdrErrors ); + trace( " dwInAddrErrors: %lu\n", stats.dwInAddrErrors ); + trace( " dwForwDatagrams: %lu\n", stats.dwForwDatagrams ); + trace( " dwInUnknownProtos: %lu\n", stats.dwInUnknownProtos ); + trace( " dwInDiscards: %lu\n", stats.dwInDiscards ); + trace( " dwInDelivers: %lu\n", stats.dwInDelivers ); + trace( " dwOutRequests: %lu\n", stats.dwOutRequests ); + trace( " dwRoutingDiscards: %lu\n", stats.dwRoutingDiscards ); + trace( " dwOutDiscards: %lu\n", stats.dwOutDiscards ); + trace( " dwOutNoRoutes: %lu\n", stats.dwOutNoRoutes ); + trace( " dwReasmTimeout: %lu\n", stats.dwReasmTimeout ); + trace( " dwReasmReqds: %lu\n", stats.dwReasmReqds ); + trace( " dwReasmOks: %lu\n", stats.dwReasmOks ); + trace( " dwReasmFails: %lu\n", stats.dwReasmFails ); + trace( " dwFragOks: %lu\n", stats.dwFragOks ); + trace( " dwFragFails: %lu\n", stats.dwFragFails ); + trace( " dwFragCreates: %lu\n", stats.dwFragCreates ); + trace( " dwNumIf: %lu\n", stats.dwNumIf ); + trace( " dwNumAddr: %lu\n", stats.dwNumAddr ); + trace( " dwNumRoutes: %lu\n", stats.dwNumRoutes ); } }
@@ -687,55 +687,55 @@ static void testGetTcpStatisticsEx(void)
apiReturn = GetTcpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetTcpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetTcpStatisticsEx(NULL, AF_INET); returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetTcpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, - "GetTcpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetTcpStatisticsEx(&stats, AF_BAN) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetTcpStatisticsEx(&stats, AF_INET); - ok(apiReturn == NO_ERROR, "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + ok(apiReturn == NO_ERROR, "GetTcpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "TCP IPv4 Ex stats:\n" ); - trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); - trace( " dwRtoMin: %u\n", stats.dwRtoMin ); - trace( " dwRtoMax: %u\n", stats.dwRtoMax ); - trace( " dwMaxConn: %u\n", stats.dwMaxConn ); - trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); - trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); - trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); - trace( " dwEstabResets: %u\n", stats.dwEstabResets ); - trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); - trace( " dwInSegs: %u\n", stats.dwInSegs ); - trace( " dwOutSegs: %u\n", stats.dwOutSegs ); - trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); - trace( " dwInErrs: %u\n", stats.dwInErrs ); - trace( " dwOutRsts: %u\n", stats.dwOutRsts ); - trace( " dwNumConns: %u\n", stats.dwNumConns ); + trace( " dwRtoAlgorithm: %lu\n", U(stats).dwRtoAlgorithm ); + trace( " dwRtoMin: %lu\n", stats.dwRtoMin ); + trace( " dwRtoMax: %lu\n", stats.dwRtoMax ); + trace( " dwMaxConn: %lu\n", stats.dwMaxConn ); + trace( " dwActiveOpens: %lu\n", stats.dwActiveOpens ); + trace( " dwPassiveOpens: %lu\n", stats.dwPassiveOpens ); + trace( " dwAttemptFails: %lu\n", stats.dwAttemptFails ); + trace( " dwEstabResets: %lu\n", stats.dwEstabResets ); + trace( " dwCurrEstab: %lu\n", stats.dwCurrEstab ); + trace( " dwInSegs: %lu\n", stats.dwInSegs ); + trace( " dwOutSegs: %lu\n", stats.dwOutSegs ); + trace( " dwRetransSegs: %lu\n", stats.dwRetransSegs ); + trace( " dwInErrs: %lu\n", stats.dwInErrs ); + trace( " dwOutRsts: %lu\n", stats.dwOutRsts ); + trace( " dwNumConns: %lu\n", stats.dwNumConns ); }
apiReturn = GetTcpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), - "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + "GetTcpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "TCP IPv6 Ex stats:\n" ); - trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); - trace( " dwRtoMin: %u\n", stats.dwRtoMin ); - trace( " dwRtoMax: %u\n", stats.dwRtoMax ); - trace( " dwMaxConn: %u\n", stats.dwMaxConn ); - trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); - trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); - trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); - trace( " dwEstabResets: %u\n", stats.dwEstabResets ); - trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); - trace( " dwInSegs: %u\n", stats.dwInSegs ); - trace( " dwOutSegs: %u\n", stats.dwOutSegs ); - trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); - trace( " dwInErrs: %u\n", stats.dwInErrs ); - trace( " dwOutRsts: %u\n", stats.dwOutRsts ); - trace( " dwNumConns: %u\n", stats.dwNumConns ); + trace( " dwRtoAlgorithm: %lu\n", U(stats).dwRtoAlgorithm ); + trace( " dwRtoMin: %lu\n", stats.dwRtoMin ); + trace( " dwRtoMax: %lu\n", stats.dwRtoMax ); + trace( " dwMaxConn: %lu\n", stats.dwMaxConn ); + trace( " dwActiveOpens: %lu\n", stats.dwActiveOpens ); + trace( " dwPassiveOpens: %lu\n", stats.dwPassiveOpens ); + trace( " dwAttemptFails: %lu\n", stats.dwAttemptFails ); + trace( " dwEstabResets: %lu\n", stats.dwEstabResets ); + trace( " dwCurrEstab: %lu\n", stats.dwCurrEstab ); + trace( " dwInSegs: %lu\n", stats.dwInSegs ); + trace( " dwOutSegs: %lu\n", stats.dwOutSegs ); + trace( " dwRetransSegs: %lu\n", stats.dwRetransSegs ); + trace( " dwInErrs: %lu\n", stats.dwInErrs ); + trace( " dwOutRsts: %lu\n", stats.dwOutRsts ); + trace( " dwNumConns: %lu\n", stats.dwNumConns ); } }
@@ -746,35 +746,35 @@ static void testGetUdpStatisticsEx(void)
apiReturn = GetUdpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetUdpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetUdpStatisticsEx(NULL, AF_INET); returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetUdpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, - "GetUdpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + "GetUdpStatisticsEx(&stats, AF_BAN) returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn);
apiReturn = GetUdpStatisticsEx(&stats, AF_INET); - ok(apiReturn == NO_ERROR, "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + ok(apiReturn == NO_ERROR, "GetUdpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "UDP IPv4 Ex stats:\n" ); - trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); - trace( " dwNoPorts: %u\n", stats.dwNoPorts ); - trace( " dwInErrors: %u\n", stats.dwInErrors ); - trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); - trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); + trace( " dwInDatagrams: %lu\n", stats.dwInDatagrams ); + trace( " dwNoPorts: %lu\n", stats.dwNoPorts ); + trace( " dwInErrors: %lu\n", stats.dwInErrors ); + trace( " dwOutDatagrams: %lu\n", stats.dwOutDatagrams ); + trace( " dwNumAddrs: %lu\n", stats.dwNumAddrs ); }
apiReturn = GetUdpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), - "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + "GetUdpStatisticsEx returned %ld, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "UDP IPv6 Ex stats:\n" ); - trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); - trace( " dwNoPorts: %u\n", stats.dwNoPorts ); - trace( " dwInErrors: %u\n", stats.dwInErrors ); - trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); - trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); + trace( " dwInDatagrams: %lu\n", stats.dwInDatagrams ); + trace( " dwNoPorts: %lu\n", stats.dwNoPorts ); + trace( " dwInErrors: %lu\n", stats.dwInErrors ); + trace( " dwOutDatagrams: %lu\n", stats.dwOutDatagrams ); + trace( " dwNumAddrs: %lu\n", stats.dwNumAddrs ); } }
@@ -789,23 +789,23 @@ static void testGetTcpTable(void) return; } ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetTcpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + "GetTcpTable(NULL, &dwSize, FALSE) returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_TCPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
apiReturn = GetTcpTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, - "GetTcpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + "GetTcpTable(buf, &dwSize, FALSE) returned %ld, expected NO_ERROR\n", apiReturn);
if (apiReturn == NO_ERROR && winetest_debug > 1) { DWORD i; - trace( "TCP table: %u entries\n", buf->dwNumEntries ); + trace( "TCP table: %lu entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) { - trace( "%u: local %s:%u remote %s:%u state %u\n", i, + trace( "%lu: local %s:%u remote %s:%u state %lu\n", i, ntoa(buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalPort), ntoa(buf->table[i].dwRemoteAddr), ntohs(buf->table[i].dwRemotePort), U(buf->table[i]).dwState ); @@ -826,22 +826,22 @@ static void testGetUdpTable(void) return; } ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetUdpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + "GetUdpTable(NULL, &dwSize, FALSE) returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_UDPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
apiReturn = GetUdpTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, - "GetUdpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + "GetUdpTable(buf, &dwSize, FALSE) returned %ld, expected NO_ERROR\n", apiReturn);
if (apiReturn == NO_ERROR && winetest_debug > 1) { DWORD i; - trace( "UDP table: %u entries\n", buf->dwNumEntries ); + trace( "UDP table: %lu entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) - trace( "%u: %s:%u\n", + trace( "%lu: %s:%u\n", i, ntoa( buf->table[i].dwLocalAddr ), ntohs(buf->table[i].dwLocalPort) ); } HeapFree(GetProcessHeap(), 0, buf); @@ -857,7 +857,7 @@ static void testSetTcpEntry(void) if(0) /* This test crashes in OS >= VISTA */ { ret = SetTcpEntry(NULL); - ok( ret == ERROR_INVALID_PARAMETER, "got %u, expected %u\n", ret, ERROR_INVALID_PARAMETER); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu, expected %u\n", ret, ERROR_INVALID_PARAMETER); }
ret = SetTcpEntry(&row); @@ -866,12 +866,12 @@ static void testSetTcpEntry(void) win_skip("SetTcpEntry failed with access error. Skipping test.\n"); return; } - todo_wine ok( ret == ERROR_INVALID_PARAMETER, "got %u, expected %u\n", ret, ERROR_INVALID_PARAMETER); + todo_wine ok( ret == ERROR_INVALID_PARAMETER, "got %lu, expected %u\n", ret, ERROR_INVALID_PARAMETER);
U(row).dwState = MIB_TCP_STATE_DELETE_TCB; ret = SetTcpEntry(&row); todo_wine ok( ret == ERROR_MR_MID_NOT_FOUND || broken(ret == ERROR_INVALID_PARAMETER), - "got %u, expected %u\n", ret, ERROR_MR_MID_NOT_FOUND); + "got %lu, expected %u\n", ret, ERROR_MR_MID_NOT_FOUND); }
static BOOL icmp_send_echo_test_apc_expect; @@ -885,9 +885,9 @@ static void WINAPI icmp_send_echo_test_apc_xp(void *context) static void WINAPI icmp_send_echo_test_apc(void *context, IO_STATUS_BLOCK *io_status, ULONG reserved) { icmp_send_echo_test_apc_xp(context); - ok(io_status->Status == 0, "Got IO Status 0x%08x\n", io_status->Status); + ok(io_status->Status == 0, "Got IO Status 0x%08lx\n", io_status->Status); ok(io_status->Information == sizeof(ICMP_ECHO_REPLY) + 32 /* sizeof(senddata) */, - "Got IO Information %lu\n", io_status->Information); + "Got IO Information %Iu\n", io_status->Information); }
static void testIcmpSendEcho(void) @@ -914,7 +914,7 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INVALID_HANDLE) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
address = htonl(INADDR_LOOPBACK); SetLastError(0xdeadbeef); @@ -923,10 +923,10 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INVALID_HANDLE) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
icmp = IcmpCreateFile(); - ok (icmp != INVALID_HANDLE_VALUE, "IcmpCreateFile failed unexpectedly with error %d\n", GetLastError()); + ok (icmp != INVALID_HANDLE_VALUE, "IcmpCreateFile failed unexpectedly with error %ld\n", GetLastError());
address = 0; SetLastError(0xdeadbeef); @@ -935,7 +935,7 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_NETNAME || broken(error == IP_BAD_DESTINATION) /* <= 2003 */, - "expected 1214, got %d\n", error); + "expected 1214, got %ld\n", error);
address = htonl(INADDR_LOOPBACK); if (0) /* crashes in XP */ @@ -952,18 +952,18 @@ static void testIcmpSendEcho(void) skip( "ICMP is not available.\n" ); return; } - ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + ok (ret, "IcmpSendEcho failed unexpectedly with error %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho(icmp, address, NULL, 0, NULL, replydata, replysz, 1000); error = GetLastError(); - ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + ok (ret, "IcmpSendEcho failed unexpectedly with error %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); - ok (error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error); + ok (error == ERROR_INVALID_PARAMETER, "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, 0, 1000); @@ -971,7 +971,7 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000); @@ -979,7 +979,7 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); replysz = sizeof(replydata) - 1; @@ -988,19 +988,19 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == IP_GENERAL_FAILURE || broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */, - "expected 11050, got %d\n", error); + "expected 11050, got %ld\n", error);
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY); ret = IcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); error = GetLastError(); - ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + ok (ret, "IcmpSendEcho failed unexpectedly with error %ld\n", error);
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN; ret = IcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz, 1000); error = GetLastError(); - ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + ok (ret, "IcmpSendEcho failed unexpectedly with error %ld\n", error);
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN; @@ -1009,7 +1009,7 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == IP_GENERAL_FAILURE || broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */, - "expected 11050, got %d\n", error); + "expected 11050, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz - 1, 1000); @@ -1017,19 +1017,19 @@ static void testIcmpSendEcho(void) ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == IP_GENERAL_FAILURE || broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */, - "expected 11050, got %d\n", error); + "expected 11050, got %ld\n", error);
/* in windows >= vista the timeout can't be invalid */ SetLastError(0xdeadbeef); replysz = sizeof(replydata); ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 0); error = GetLastError(); - if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error); + if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, -1); error = GetLastError(); - if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error); + if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %ld\n", error);
/* real ping test */ SetLastError(0xdeadbeef); @@ -1038,16 +1038,16 @@ static void testIcmpSendEcho(void) error = GetLastError(); if (!ret) { - skip ("Failed to ping with error %d, is lo interface down?.\n", error); + skip ("Failed to ping with error %ld, is lo interface down?.\n", error); } else if (winetest_debug > 1) { PICMP_ECHO_REPLY pong = (PICMP_ECHO_REPLY) replydata; trace ("send addr : %s\n", ntoa(address)); trace ("reply addr : %s\n", ntoa(pong->Address)); - trace ("reply size : %u\n", replysz); - trace ("roundtrip : %u ms\n", pong->RoundTripTime); - trace ("status : %u\n", pong->Status); + trace ("reply size : %lu\n", replysz); + trace ("roundtrip : %lu ms\n", pong->RoundTripTime); + trace ("status : %lu\n", pong->Status); trace ("recv size : %u\n", pong->DataSize); trace ("ttl : %u\n", pong->Options.Ttl); trace ("flags : 0x%x\n", pong->Options.Flags); @@ -1061,10 +1061,10 @@ static void testIcmpSendEcho(void) error = GetLastError(); reply = (ICMP_ECHO_REPLY *)replydata; ok(ret, "IcmpSendEcho failed unexpectedly\n"); - ok(error == NO_ERROR, "Expect last error:0x%08x, got:0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error:0x%08x, got:0x%08lx\n", NO_ERROR, error); ok(INADDR_LOOPBACK == ntohl(reply->Address), "Address mismatch, expect:%s, got: %s\n", ntoa(INADDR_LOOPBACK), ntoa(reply->Address)); - ok(reply->Status == IP_SUCCESS, "Expect status:0x%08x, got:0x%08x\n", IP_SUCCESS, reply->Status); + ok(reply->Status == IP_SUCCESS, "Expect status:0x%08x, got:0x%08lx\n", IP_SUCCESS, reply->Status); ok(reply->DataSize == sizeof(senddata), "Got size:%d\n", reply->DataSize); ok(!memcmp(senddata, reply->Data, min(sizeof(senddata), reply->DataSize)), "Data mismatch\n");
@@ -1082,10 +1082,10 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_NETNAME || broken(error == IP_BAD_DESTINATION) /* <= 2003 */, - "expected 1214, got %d\n", error); + "expected 1214, got %ld\n", error);
event = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(event != NULL, "CreateEventW failed unexpectedly with error %d\n", GetLastError()); + ok(event != NULL, "CreateEventW failed unexpectedly with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = IcmpSendEcho2(icmp, event, NULL, NULL, address, senddata, sizeof(senddata), NULL, replydata2, replysz, 1000); @@ -1093,11 +1093,11 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 returned success unexpectedly\n"); ok(error == ERROR_INVALID_NETNAME || broken(error == ERROR_IO_PENDING) /* <= 2003 */, - "Got last error: 0x%08x\n", error); + "Got last error: 0x%08lx\n", error); if (error == ERROR_IO_PENDING) { ret = WaitForSingleObjectEx(event, 2000, TRUE); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObjectEx failed unexpectedly with %u\n", ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObjectEx failed unexpectedly with %lu\n", ret); }
address = htonl(INADDR_LOOPBACK); @@ -1107,7 +1107,7 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_NOACCESS) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho2(icmp, event, NULL, NULL, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000); @@ -1115,7 +1115,7 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_NOACCESS) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error); ok(WaitForSingleObjectEx(event, 0, TRUE) == WAIT_TIMEOUT, "Event was unexpectedly signalled.\n");
SetLastError(0xdeadbeef); @@ -1124,7 +1124,7 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho2(icmp, event, NULL, NULL, address, senddata, sizeof(senddata), NULL, replydata2, 0, 1000); @@ -1132,7 +1132,7 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error); ok(WaitForSingleObjectEx(event, 0, TRUE) == WAIT_TIMEOUT, "Event was unexpectedly signalled.\n");
SetLastError(0xdeadbeef); @@ -1141,7 +1141,7 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error);
SetLastError(0xdeadbeef); ret = IcmpSendEcho2(icmp, event, NULL, NULL, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000); @@ -1149,7 +1149,7 @@ static void testIcmpSendEcho(void) ok(!ret, "IcmpSendEcho2 succeeded unexpectedly\n"); ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, - "expected 87, got %d\n", error); + "expected 87, got %ld\n", error); ok(WaitForSingleObjectEx(event, 0, TRUE) == WAIT_TIMEOUT, "Event was unexpectedly signalled.\n");
/* synchronous tests */ @@ -1157,20 +1157,20 @@ static void testIcmpSendEcho(void) address = htonl(INADDR_LOOPBACK); replysz = sizeof(ICMP_ECHO_REPLY) + sizeof(IO_STATUS_BLOCK); ret = IcmpSendEcho2(icmp, NULL, NULL, NULL, address, senddata, 0, NULL, replydata2, replysz, 1000); - ok(ret, "IcmpSendEcho2 failed unexpectedly with error %d\n", GetLastError()); + ok(ret, "IcmpSendEcho2 failed unexpectedly with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = IcmpSendEcho2(icmp, NULL, NULL, NULL, address, NULL, 0, NULL, replydata2, replysz, 1000); - ok(ret, "IcmpSendEcho2 failed unexpectedly with error %d\n", GetLastError()); + ok(ret, "IcmpSendEcho2 failed unexpectedly with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = IcmpSendEcho2(icmp, NULL, NULL, NULL, address, senddata, 0, NULL, replydata2, replysz, 1000); - ok(ret, "IcmpSendEcho2 failed unexpectedly with error %d\n", GetLastError()); + ok(ret, "IcmpSendEcho2 failed unexpectedly with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY) + sizeof(IO_STATUS_BLOCK) + ICMP_MINLEN; ret = IcmpSendEcho2(icmp, NULL, NULL, NULL, address, senddata, ICMP_MINLEN, NULL, replydata2, replysz, 1000); - ok(ret, "IcmpSendEcho2 failed unexpectedly with error %d\n", GetLastError()); + ok(ret, "IcmpSendEcho2 failed unexpectedly with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); replysz = sizeof(replydata2); @@ -1178,16 +1178,16 @@ static void testIcmpSendEcho(void) if (!ret) { error = GetLastError(); - skip("Failed to ping with error %d, is lo interface down?\n", error); + skip("Failed to ping with error %ld, is lo interface down?\n", error); } else if (winetest_debug > 1) { reply = (ICMP_ECHO_REPLY*)replydata2; trace("send addr : %s\n", ntoa(address)); trace("reply addr : %s\n", ntoa(reply->Address)); - trace("reply size : %u\n", replysz); - trace("roundtrip : %u ms\n", reply->RoundTripTime); - trace("status : %u\n", reply->Status); + trace("reply size : %lu\n", replysz); + trace("roundtrip : %lu ms\n", reply->RoundTripTime); + trace("status : %lu\n", reply->Status); trace("recv size : %u\n", reply->DataSize); trace("ttl : %u\n", reply->Options.Ttl); trace("flags : 0x%x\n", reply->Options.Flags); @@ -1199,10 +1199,10 @@ static void testIcmpSendEcho(void) error = GetLastError(); reply = (ICMP_ECHO_REPLY*)replydata2; ok(ret, "IcmpSendEcho2 failed unexpectedly\n"); - ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08lx\n", NO_ERROR, error); ok(ntohl(reply->Address) == INADDR_LOOPBACK, "Address mismatch, expect: %s, got: %s\n", ntoa(INADDR_LOOPBACK), ntoa(reply->Address)); - ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08x\n", IP_SUCCESS, reply->Status); + ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08lx\n", IP_SUCCESS, reply->Status); ok(reply->DataSize == sizeof(senddata), "Got size: %d\n", reply->DataSize); ok(!memcmp(senddata, reply->Data, min(sizeof(senddata), reply->DataSize)), "Data mismatch\n");
@@ -1215,27 +1215,27 @@ static void testIcmpSendEcho(void) error = GetLastError(); if (!ret && error != ERROR_IO_PENDING) { - skip("Failed to ping with error %d, is lo interface down?\n", error); + skip("Failed to ping with error %ld, is lo interface down?\n", error); } else { ok(!ret, "IcmpSendEcho2 returned success unexpectedly\n"); - ok(error == ERROR_IO_PENDING, "Expect last error: 0x%08x, got: 0x%08x\n", ERROR_IO_PENDING, error); + ok(error == ERROR_IO_PENDING, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_IO_PENDING, error); ret = WaitForSingleObjectEx(event, 2000, TRUE); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObjectEx failed unexpectedly with %u\n", ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObjectEx failed unexpectedly with %lu\n", ret); reply = (ICMP_ECHO_REPLY*)replydata2; ok(ntohl(reply->Address) == INADDR_LOOPBACK, "Address mismatch, expect: %s, got: %s\n", ntoa(INADDR_LOOPBACK), ntoa(reply->Address)); - ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08x\n", IP_SUCCESS, reply->Status); + ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08lx\n", IP_SUCCESS, reply->Status); ok(reply->DataSize == sizeof(senddata), "Got size: %d\n", reply->DataSize); if (winetest_debug > 1) { reply = (ICMP_ECHO_REPLY*)replydata2; trace("send addr : %s\n", ntoa(address)); trace("reply addr : %s\n", ntoa(reply->Address)); - trace("reply size : %u\n", replysz); - trace("roundtrip : %u ms\n", reply->RoundTripTime); - trace("status : %u\n", reply->Status); + trace("reply size : %lu\n", replysz); + trace("roundtrip : %lu ms\n", reply->RoundTripTime); + trace("status : %lu\n", reply->Status); trace("recv size : %u\n", reply->DataSize); trace("ttl : %u\n", reply->Options.Ttl); trace("flags : 0x%x\n", reply->Options.Flags); @@ -1247,13 +1247,13 @@ static void testIcmpSendEcho(void) ret = IcmpSendEcho2(icmp, event, NULL, NULL, address, senddata, sizeof(senddata), NULL, replydata2, replysz, 1000); error = GetLastError(); ok(!ret, "IcmpSendEcho2 returned success unexpectedly\n"); - ok(error == ERROR_IO_PENDING, "Expect last error: 0x%08x, got: 0x%08x\n", ERROR_IO_PENDING, error); + ok(error == ERROR_IO_PENDING, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_IO_PENDING, error); ret = WaitForSingleObjectEx(event, 2000, TRUE); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObjectEx failed unexpectedly with %u\n", ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObjectEx failed unexpectedly with %lu\n", ret); reply = (ICMP_ECHO_REPLY*)replydata2; ok(ntohl(reply->Address) == INADDR_LOOPBACK, "Address mismatch, expect: %s, got: %s\n", ntoa(INADDR_LOOPBACK), ntoa(reply->Address)); - ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08x\n", IP_SUCCESS, reply->Status); + ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08lx\n", IP_SUCCESS, reply->Status); ok(reply->DataSize == sizeof(senddata), "Got size: %d\n", reply->DataSize); /* pre-Vista, reply->Data is an offset; otherwise it's a pointer, so hardcode the offset */ ok(!memcmp(senddata, reply + 1, min(sizeof(senddata), reply->DataSize)), "Data mismatch\n"); @@ -1272,14 +1272,14 @@ static void testIcmpSendEcho(void) ret = IcmpSendEcho2(icmp, NULL, apc, (void*)0xdeadc0de, address, senddata, sizeof(senddata), NULL, replydata2, replysz, 1000); error = GetLastError(); ok(!ret, "IcmpSendEcho2 returned success unexpectedly\n"); - ok(error == ERROR_IO_PENDING, "Expect last error: 0x%08x, got: 0x%08x\n", ERROR_IO_PENDING, error); + ok(error == ERROR_IO_PENDING, "Expect last error: 0x%08x, got: 0x%08lx\n", ERROR_IO_PENDING, error); SleepEx(200, TRUE); SleepEx(0, TRUE); ok(icmp_send_echo_test_apc_expect == FALSE, "APC was not executed!\n"); reply = (ICMP_ECHO_REPLY*)replydata2; ok(ntohl(reply->Address) == INADDR_LOOPBACK, "Address mismatch, expect: %s, got: %s\n", ntoa(INADDR_LOOPBACK), ntoa(reply->Address)); - ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08x\n", IP_SUCCESS, reply->Status); + ok(reply->Status == IP_SUCCESS, "Expect status: 0x%08x, got: 0x%08lx\n", IP_SUCCESS, reply->Status); ok(reply->DataSize == sizeof(senddata), "Got size: %d\n", reply->DataSize); /* pre-Vista, reply->Data is an offset; otherwise it's a pointer, so hardcode the offset */ ok(!memcmp(senddata, reply + 1, min(sizeof(senddata), reply->DataSize)), "Data mismatch\n"); @@ -1294,30 +1294,30 @@ static void testIcmpParseReplies( void )
SetLastError( 0xdeadbeef ); ret = IcmpParseReplies( &reply, sizeof(reply) ); - ok( ret == 0, "ret %d\n", ret ); - ok( GetLastError() == 0, "gle %d\n", GetLastError() ); + ok( ret == 0, "ret %ld\n", ret ); + ok( GetLastError() == 0, "gle %ld\n", GetLastError() );
reply.Status = 12345; SetLastError( 0xdeadbeef ); ret = IcmpParseReplies( &reply, sizeof(reply) ); - ok( ret == 0, "ret %d\n", ret ); - ok( GetLastError() == 12345, "gle %d\n", GetLastError() ); - ok( reply.Status == 12345, "status %d\n", reply.Status ); + ok( ret == 0, "ret %ld\n", ret ); + ok( GetLastError() == 12345, "gle %ld\n", GetLastError() ); + ok( reply.Status == 12345, "status %ld\n", reply.Status );
reply.Reserved = 1; SetLastError( 0xdeadbeef ); ret = IcmpParseReplies( &reply, sizeof(reply) ); - ok( ret == 1, "ret %d\n", ret ); - ok( GetLastError() == 0xdeadbeef, "gle %d\n", GetLastError() ); - ok( reply.Status == 12345, "status %d\n", reply.Status ); + ok( ret == 1, "ret %ld\n", ret ); + ok( GetLastError() == 0xdeadbeef, "gle %ld\n", GetLastError() ); + ok( reply.Status == 12345, "status %ld\n", reply.Status ); ok( !reply.Reserved, "reserved %d\n", reply.Reserved );
reply.Reserved = 3; SetLastError( 0xdeadbeef ); ret = IcmpParseReplies( &reply, sizeof(reply) ); - ok( ret == 3, "ret %d\n", ret ); - ok( GetLastError() == 0xdeadbeef, "gle %d\n", GetLastError() ); - ok( reply.Status == 12345, "status %d\n", reply.Status ); + ok( ret == 3, "ret %ld\n", ret ); + ok( GetLastError() == 0xdeadbeef, "gle %ld\n", GetLastError() ); + ok( reply.Status == 12345, "status %ld\n", reply.Status ); ok( !reply.Reserved, "reserved %d\n", reply.Reserved ); }
@@ -1354,18 +1354,18 @@ static void testGetInterfaceInfo(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetInterfaceInfo returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetInterfaceInfo returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetInterfaceInfo(NULL, &len); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetInterfaceInfo returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + "GetInterfaceInfo returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PIP_INTERFACE_INFO buf = HeapAlloc(GetProcessHeap(), 0, len);
apiReturn = GetInterfaceInfo(buf, &len); ok(apiReturn == NO_ERROR, - "GetInterfaceInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", + "GetInterfaceInfo(buf, &dwSize) returned %ld, expected NO_ERROR\n", apiReturn);
for (i = 0; i < buf->NumAdapters; i++) @@ -1391,14 +1391,14 @@ static void testGetAdaptersInfo(void) MIB_IFROW row;
err = GetAdaptersInfo( NULL, NULL ); - ok( err == ERROR_INVALID_PARAMETER, "got %d\n", err ); + ok( err == ERROR_INVALID_PARAMETER, "got %ld\n", err ); err = GetAdaptersInfo( NULL, &len ); - ok( err == ERROR_NO_DATA || err == ERROR_BUFFER_OVERFLOW, "got %d\n", err ); + ok( err == ERROR_NO_DATA || err == ERROR_BUFFER_OVERFLOW, "got %ld\n", err ); if (err == ERROR_NO_DATA) return;
buf = malloc( len ); err = GetAdaptersInfo( buf, &len ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ptr = buf; while (ptr) { @@ -1415,9 +1415,9 @@ static void testGetAdaptersInfo(void) guid.Data4[6], guid.Data4[7] ); ok( !strcmp( ptr->AdapterName, name ), "expected '%s' got '%s'\n", ptr->AdapterName, name ); ok( !strcmp( ptr->Description, (char *)row.bDescr ), "got %s vs %s\n", ptr->Description, (char *)row.bDescr ); - ok( ptr->AddressLength == row.dwPhysAddrLen, "got %d vs %d\n", ptr->AddressLength, row.dwPhysAddrLen ); + ok( ptr->AddressLength == row.dwPhysAddrLen, "got %d vs %ld\n", ptr->AddressLength, row.dwPhysAddrLen ); ok( !memcmp(ptr->Address, row.bPhysAddr, ptr->AddressLength ), "mismatch\n" ); - ok( ptr->Type == row.dwType, "got %d vs %d\n", ptr->Type, row.dwType ); + ok( ptr->Type == row.dwType, "got %d vs %ld\n", ptr->Type, row.dwType ); ok( ptr->Type != MIB_IF_TYPE_LOOPBACK, "shouldn't get loopback\n" ); ok( ptr->IpAddressList.IpAddress.String[0], "A valid IP address must be present\n" ); ok( ptr->IpAddressList.IpMask.String[0], "A valid mask must be present\n" ); @@ -1439,18 +1439,18 @@ static void testGetNetworkParams(void) return; } ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetNetworkParams returned %d, expected ERROR_INVALID_PARAMETER\n", + "GetNetworkParams returned %ld, expected ERROR_INVALID_PARAMETER\n", apiReturn); apiReturn = GetNetworkParams(NULL, &len); ok(apiReturn == ERROR_BUFFER_OVERFLOW, - "GetNetworkParams returned %d, expected ERROR_BUFFER_OVERFLOW\n", + "GetNetworkParams returned %ld, expected ERROR_BUFFER_OVERFLOW\n", apiReturn); if (apiReturn == ERROR_BUFFER_OVERFLOW) { PFIXED_INFO buf = HeapAlloc(GetProcessHeap(), 0, len);
apiReturn = GetNetworkParams(buf, &len); ok(apiReturn == NO_ERROR, - "GetNetworkParams(buf, &dwSize) returned %d, expected NO_ERROR\n", + "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n", apiReturn); HeapFree(GetProcessHeap(), 0, buf); } @@ -1477,15 +1477,15 @@ static void testGetPerAdapterInfo(void) void *buffer;
ret = GetPerAdapterInfo(1, NULL, NULL); - ok( ret == ERROR_INVALID_PARAMETER, "got %u instead of ERROR_INVALID_PARAMETER\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu instead of ERROR_INVALID_PARAMETER\n", ret ); needed = 0xdeadbeef; ret = GetPerAdapterInfo(1, NULL, &needed); if (ret == ERROR_NO_DATA) return; /* no such adapter */ - ok( ret == ERROR_BUFFER_OVERFLOW, "got %u instead of ERROR_BUFFER_OVERFLOW\n", ret ); + ok( ret == ERROR_BUFFER_OVERFLOW, "got %lu instead of ERROR_BUFFER_OVERFLOW\n", ret ); ok( needed != 0xdeadbeef, "needed not set\n" ); buffer = HeapAlloc( GetProcessHeap(), 0, needed ); ret = GetPerAdapterInfo(1, buffer, &needed); - ok( ret == NO_ERROR, "got %u instead of NO_ERROR\n", ret ); + ok( ret == NO_ERROR, "got %lu instead of NO_ERROR\n", ret ); HeapFree( GetProcessHeap(), 0, buffer ); }
@@ -1499,9 +1499,9 @@ static void testNotifyAddrChange(void) handle = NULL; ZeroMemory(&overlapped, sizeof(overlapped)); ret = NotifyAddrChange(&handle, &overlapped); - ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected ERROR_IO_PENDING\n", ret); + ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %ld, expected ERROR_IO_PENDING\n", ret); ret = GetLastError(); - todo_wine ok(ret == ERROR_IO_PENDING, "GetLastError returned %d, expected ERROR_IO_PENDING\n", ret); + todo_wine ok(ret == ERROR_IO_PENDING, "GetLastError returned %ld, expected ERROR_IO_PENDING\n", ret); success = CancelIPChangeNotify(&overlapped); todo_wine ok(success == TRUE, "CancelIPChangeNotify returned FALSE, expected TRUE\n");
@@ -1513,12 +1513,12 @@ static void testNotifyAddrChange(void) ZeroMemory(&overlapped, sizeof(overlapped)); overlapped.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); ret = NotifyAddrChange(&handle, &overlapped); - ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected ERROR_IO_PENDING\n", ret); + ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %ld, expected ERROR_IO_PENDING\n", ret); todo_wine ok(handle != INVALID_HANDLE_VALUE, "NotifyAddrChange returned invalid file handle\n"); success = GetOverlappedResult(handle, &overlapped, &bytes, FALSE); ok(success == FALSE, "GetOverlappedResult returned TRUE, expected FALSE\n"); ret = GetLastError(); - ok(ret == ERROR_IO_INCOMPLETE, "GetLastError returned %d, expected ERROR_IO_INCOMPLETE\n", ret); + ok(ret == ERROR_IO_INCOMPLETE, "GetLastError returned %ld, expected ERROR_IO_INCOMPLETE\n", ret); success = CancelIPChangeNotify(&overlapped); todo_wine ok(success == TRUE, "CancelIPChangeNotify returned FALSE, expected TRUE\n");
@@ -1530,7 +1530,7 @@ static void testNotifyAddrChange(void) trace("Testing asynchronous ipv4 address change notification. Please " "change the ipv4 address of one of your network interfaces\n"); ret = NotifyAddrChange(&handle, &overlapped); - ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected NO_ERROR\n", ret); + ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %ld, expected NO_ERROR\n", ret); success = GetOverlappedResult(handle, &overlapped, &bytes, TRUE); ok(success == TRUE, "GetOverlappedResult returned FALSE, expected TRUE\n"); } @@ -1541,7 +1541,7 @@ static void testNotifyAddrChange(void) trace("Testing synchronous ipv4 address change notification. Please " "change the ipv4 address of one of your network interfaces\n"); ret = NotifyAddrChange(NULL, NULL); - todo_wine ok(ret == NO_ERROR, "NotifyAddrChange returned %d, expected NO_ERROR\n", ret); + todo_wine ok(ret == NO_ERROR, "NotifyAddrChange returned %ld, expected NO_ERROR\n", ret); } }
@@ -1572,23 +1572,23 @@ static void test_GetAdaptersAddresses(void) IP_ADAPTER_UNICAST_ADDRESS *ua;
ret = GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); - ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", ret);
/* size should be ignored and overwritten if buffer is NULL */ size = 0x7fffffff; ret = GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size); - ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); + ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %lu\n", ret); if (ret != ERROR_BUFFER_OVERFLOW) return;
/* GAA_FLAG_SKIP_FRIENDLY_NAME is ignored */ osize = 0x7fffffff; ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_FRIENDLY_NAME, NULL, NULL, &osize); - ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); - ok(osize == size, "expected %d, got %d\n", size, osize); + ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %lu\n", ret); + ok(osize == size, "expected %ld, got %ld\n", size, osize);
ptr = HeapAlloc(GetProcessHeap(), 0, size); ret = GetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &size); - ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); + ok(!ret, "expected ERROR_SUCCESS got %lu\n", ret); HeapFree(GetProcessHeap(), 0, ptr);
/* higher size must not be changed to lower size */ @@ -1596,8 +1596,8 @@ static void test_GetAdaptersAddresses(void) osize = size; ptr = HeapAlloc(GetProcessHeap(), 0, osize); ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_SKIP_FRIENDLY_NAME, NULL, ptr, &osize); - ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); - ok(osize == size, "expected %d, got %d\n", size, osize); + ok(!ret, "expected ERROR_SUCCESS got %lu\n", ret); + ok(osize == size, "expected %ld, got %ld\n", size, osize);
for (aa = ptr; !ret && aa; aa = aa->Next) { @@ -1608,7 +1608,7 @@ static void test_GetAdaptersAddresses(void)
ok(S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_LH) || S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_XP), - "Unknown structure size of %u bytes\n", S(U(*aa)).Length); + "Unknown structure size of %lu bytes\n", S(U(*aa)).Length); ok(aa->DnsSuffix != NULL, "DnsSuffix is not a valid pointer\n"); ok(aa->Description != NULL, "Description is not a valid pointer\n"); ok(aa->FriendlyName != NULL, "FriendlyName is not a valid pointer\n"); @@ -1616,7 +1616,7 @@ static void test_GetAdaptersAddresses(void) for (i = 0; i < aa->PhysicalAddressLength; i++) sprintf(temp + i * 3, "%02X-", aa->PhysicalAddress[i]); temp[i ? i * 3 - 1 : 0] = '\0'; - trace("idx %u name %s %s dns %s descr %s phys %s mtu %u flags %08x type %u\n", + trace("idx %lu name %s %s dns %s descr %s phys %s mtu %lu flags %08lx type %lu\n", S(U(*aa)).IfIndex, aa->AdapterName, wine_dbgstr_w(aa->FriendlyName), wine_dbgstr_w(aa->DnsSuffix), wine_dbgstr_w(aa->Description), temp, aa->Mtu, aa->Flags, aa->IfType ); @@ -1625,7 +1625,7 @@ static void test_GetAdaptersAddresses(void) { ok(S(U(*ua)).Length == sizeof(IP_ADAPTER_UNICAST_ADDRESS_LH) || S(U(*ua)).Length == sizeof(IP_ADAPTER_UNICAST_ADDRESS_XP), - "Unknown structure size of %u bytes\n", S(U(*ua)).Length); + "Unknown structure size of %lu bytes\n", S(U(*ua)).Length); ok(ua->PrefixOrigin != IpPrefixOriginOther, "bad address config value %d\n", ua->PrefixOrigin); ok(ua->SuffixOrigin != IpSuffixOriginOther, @@ -1641,7 +1641,7 @@ static void test_GetAdaptersAddresses(void) /* Is the address ok in the network (not duplicated)? */ ok(ua->DadState != IpDadStateInvalid && ua->DadState != IpDadStateDuplicate, "bad address duplication value %d\n", ua->DadState); - trace(" flags %08x origin %u/%u state %u lifetime %u/%u/%u prefix %u\n", + trace(" flags %08lx origin %u/%u state %u lifetime %lu/%lu/%lu prefix %u\n", S(U(*ua)).Flags, ua->PrefixOrigin, ua->SuffixOrigin, ua->DadState, ua->ValidLifetime, ua->PreferredLifetime, ua->LeaseLifetime, S(U(*ua)).Length < sizeof(IP_ADAPTER_UNICAST_ADDRESS_LH) ? 0 : ua->OnLinkPrefixLength); @@ -1652,25 +1652,25 @@ static void test_GetAdaptersAddresses(void) ua = ua->Next; } for (i = 0, temp[0] = '\0'; i < ARRAY_SIZE(aa->ZoneIndices); i++) - sprintf(temp + strlen(temp), "%d ", aa->ZoneIndices[i]); - trace("status %u index %u zone %s\n", aa->OperStatus, aa->Ipv6IfIndex, temp ); + sprintf(temp + strlen(temp), "%ld ", aa->ZoneIndices[i]); + trace("status %u index %lu zone %s\n", aa->OperStatus, aa->Ipv6IfIndex, temp ); prefix = aa->FirstPrefix; while (prefix) { - trace( " prefix %u/%u flags %08x\n", prefix->Address.iSockaddrLength, + trace( " prefix %u/%lu flags %08lx\n", prefix->Address.iSockaddrLength, prefix->PrefixLength, S(U(*prefix)).Flags ); prefix = prefix->Next; }
if (S(U(*aa)).Length < sizeof(IP_ADAPTER_ADDRESSES_LH)) continue; - trace("speed %s/%s metrics %u/%u guid %s type %u/%u\n", + trace("speed %s/%s metrics %lu/%lu guid %s type %u/%u\n", wine_dbgstr_longlong(aa->TransmitLinkSpeed), wine_dbgstr_longlong(aa->ReceiveLinkSpeed), aa->Ipv4Metric, aa->Ipv6Metric, wine_dbgstr_guid((GUID*) &aa->NetworkGuid), aa->ConnectionType, aa->TunnelType);
status = ConvertInterfaceLuidToGuid(&aa->Luid, &guid); - ok(!status, "got %u\n", status); + ok(!status, "got %lu\n", status); sprintf(buf, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], @@ -1694,60 +1694,60 @@ static void test_GetExtendedTcpTable(void) return; } ret = pGetExtendedTcpTable( NULL, NULL, TRUE, AF_INET, TCP_TABLE_BASIC_ALL, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_BASIC_ALL, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedTcpTable( table, &size, TRUE, AF_INET, TCP_TABLE_BASIC_ALL, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table );
size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_BASIC_LISTENER, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedTcpTable( table, &size, TRUE, AF_INET, TCP_TABLE_BASIC_LISTENER, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table );
size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table_pid = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table_pid );
size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table_pid = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table_pid );
size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_ALL, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table_module = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedTcpTable( table_module, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_ALL, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table_module );
size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_LISTENER, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table_module = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedTcpTable( table_module, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_LISTENER, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table_module ); }
@@ -1766,29 +1766,29 @@ static void test_AllocateAndGetTcpExTableFromStack(void) { /* crashes on native */ ret = pAllocateAndGetTcpExTableFromStack( NULL, FALSE, INVALID_HANDLE_VALUE, 0, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); ret = pAllocateAndGetTcpExTableFromStack( (void **)&table_ex, FALSE, INVALID_HANDLE_VALUE, 0, AF_INET ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); ret = pAllocateAndGetTcpExTableFromStack( NULL, FALSE, GetProcessHeap(), 0, AF_INET ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); }
ret = pAllocateAndGetTcpExTableFromStack( (void **)&table_ex, FALSE, GetProcessHeap(), 0, 0 ); - ok( ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_NOT_SUPPORTED) /* win2k */, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_NOT_SUPPORTED) /* win2k */, "got %lu\n", ret );
ret = pAllocateAndGetTcpExTableFromStack( (void **)&table_ex, FALSE, GetProcessHeap(), 0, AF_INET ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret );
if (ret == NO_ERROR && winetest_debug > 1) { DWORD i; - trace( "AllocateAndGetTcpExTableFromStack table: %u entries\n", table_ex->dwNumEntries ); + trace( "AllocateAndGetTcpExTableFromStack table: %lu entries\n", table_ex->dwNumEntries ); for (i = 0; i < table_ex->dwNumEntries; i++) { char remote_ip[16];
strcpy(remote_ip, ntoa(table_ex->table[i].dwRemoteAddr)); - trace( "%u: local %s:%u remote %s:%u state %u pid %u\n", i, + trace( "%lu: local %s:%u remote %s:%u state %lu pid %lu\n", i, ntoa(table_ex->table[i].dwLocalAddr), ntohs(table_ex->table[i].dwLocalPort), remote_ip, ntohs(table_ex->table[i].dwRemotePort), U(table_ex->table[i]).dwState, table_ex->table[i].dwOwningPid ); @@ -1797,7 +1797,7 @@ static void test_AllocateAndGetTcpExTableFromStack(void) HeapFree(GetProcessHeap(), 0, table_ex);
ret = pAllocateAndGetTcpExTableFromStack( (void **)&table_ex, FALSE, GetProcessHeap(), 0, AF_INET6 ); - ok( ret == ERROR_NOT_SUPPORTED, "got %u\n", ret ); + ok( ret == ERROR_NOT_SUPPORTED, "got %lu\n", ret ); }
static void test_GetExtendedUdpTable(void) @@ -1813,33 +1813,33 @@ static void test_GetExtendedUdpTable(void) return; } ret = pGetExtendedUdpTable( NULL, NULL, TRUE, AF_INET, UDP_TABLE_BASIC, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
size = 0; ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_BASIC, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedUdpTable( table, &size, TRUE, AF_INET, UDP_TABLE_BASIC, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table );
size = 0; ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_OWNER_PID, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table_pid = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedUdpTable( table_pid, &size, TRUE, AF_INET, UDP_TABLE_OWNER_PID, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table_pid );
size = 0; ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_OWNER_MODULE, 0 ); - ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", ret );
table_module = HeapAlloc( GetProcessHeap(), 0, size ); ret = pGetExtendedUdpTable( table_module, &size, TRUE, AF_INET, UDP_TABLE_OWNER_MODULE, 0 ); - ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( ret == ERROR_SUCCESS, "got %lu\n", ret ); HeapFree( GetProcessHeap(), 0, table_module ); }
@@ -1864,22 +1864,22 @@ static void test_CreateSortedAddressPairs(void)
pair_count = 0xdeadbeef; ret = pCreateSortedAddressPairs( NULL, 0, dst, 1, 0, NULL, &pair_count ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); - ok( pair_count == 0xdeadbeef, "got %u\n", pair_count ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); + ok( pair_count == 0xdeadbeef, "got %lu\n", pair_count );
pair = (SOCKADDR_IN6_PAIR *)0xdeadbeef; pair_count = 0xdeadbeef; ret = pCreateSortedAddressPairs( NULL, 0, NULL, 1, 0, &pair, &pair_count ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); ok( pair == (SOCKADDR_IN6_PAIR *)0xdeadbeef, "got %p\n", pair ); - ok( pair_count == 0xdeadbeef, "got %u\n", pair_count ); + ok( pair_count == 0xdeadbeef, "got %lu\n", pair_count );
pair = NULL; pair_count = 0xdeadbeef; ret = pCreateSortedAddressPairs( NULL, 0, dst, 1, 0, &pair, &pair_count ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret ); ok( pair != NULL, "pair not set\n" ); - ok( pair_count >= 1, "got %u\n", pair_count ); + ok( pair_count >= 1, "got %lu\n", pair_count ); ok( pair[0].SourceAddress != NULL, "src address not set\n" ); ok( pair[0].DestinationAddress != NULL, "dst address not set\n" ); FreeMibTable( pair ); @@ -1892,9 +1892,9 @@ static void test_CreateSortedAddressPairs(void) pair = NULL; pair_count = 0xdeadbeef; ret = pCreateSortedAddressPairs( NULL, 0, dst, 2, 0, &pair, &pair_count ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret ); ok( pair != NULL, "pair not set\n" ); - ok( pair_count >= 2, "got %u\n", pair_count ); + ok( pair_count >= 2, "got %lu\n", pair_count ); ok( pair[0].SourceAddress != NULL, "src address not set\n" ); ok( pair[0].DestinationAddress != NULL, "dst address not set\n" ); ok( pair[1].SourceAddress != NULL, "src address not set\n" ); @@ -1974,7 +1974,7 @@ static void test_interface_identifier_conversion(void) MIB_IF_TABLE2 *table;
ret = GetIfTable2( &table ); - ok( !ret, "got %d\n", ret ); + ok( !ret, "got %ld\n", ret );
for (i = 0; i < table->NumEntries; i++) { @@ -1982,66 +1982,66 @@ static void test_interface_identifier_conversion(void)
/* ConvertInterfaceIndexToLuid */ ret = ConvertInterfaceIndexToLuid( 0, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &luid, 0xff, sizeof(luid) ); ret = ConvertInterfaceIndexToLuid( 0, &luid ); - ok( ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret ); + ok( ret == ERROR_FILE_NOT_FOUND, "got %lu\n", ret ); ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); ok( !luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); ok( !luid.Info.IfType, "got %u\n", luid.Info.IfType );
luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; ret = ConvertInterfaceIndexToLuid( row->InterfaceIndex, &luid ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( luid.Value == row->InterfaceLuid.Value, "mismatch\n" );
/* ConvertInterfaceLuidToIndex */ ret = ConvertInterfaceLuidToIndex( NULL, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToIndex( NULL, &index ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToIndex( &luid, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToIndex( &luid, &index ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( index == row->InterfaceIndex, "mismatch\n" );
/* ConvertInterfaceLuidToGuid */ ret = ConvertInterfaceLuidToGuid( NULL, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &guid, 0xff, sizeof(guid) ); ret = ConvertInterfaceLuidToGuid( NULL, &guid ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); ok( guid.Data1 == 0xffffffff, "got %s\n", debugstr_guid(&guid) );
ret = ConvertInterfaceLuidToGuid( &luid, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &guid, 0, sizeof(guid) ); ret = ConvertInterfaceLuidToGuid( &luid, &guid ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( IsEqualGUID( &guid, &row->InterfaceGuid ), "mismatch\n" );
/* ConvertInterfaceGuidToLuid */ ret = ConvertInterfaceGuidToLuid( NULL, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
luid.Info.NetLuidIndex = 1; ret = ConvertInterfaceGuidToLuid( NULL, &luid ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); ok( luid.Info.NetLuidIndex == 1, "got %u\n", luid.Info.NetLuidIndex );
ret = ConvertInterfaceGuidToLuid( &guid, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; ret = ConvertInterfaceGuidToLuid( &guid, &luid ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( luid.Value == row->InterfaceLuid.Value || broken( luid.Value != row->InterfaceLuid.Value), /* Win8 can have identical guids for two different ifaces */ "mismatch\n" ); @@ -2049,100 +2049,100 @@ static void test_interface_identifier_conversion(void)
/* ConvertInterfaceLuidToNameW */ ret = ConvertInterfaceLuidToNameW( NULL, NULL, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToNameW( &luid, NULL, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToNameW( NULL, nameW, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToNameW( &luid, nameW, 0 ); - ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %lu\n", ret );
nameW[0] = 0; len = ARRAY_SIZE(nameW); ret = ConvertInterfaceLuidToNameW( &luid, nameW, len ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); convert_luid_to_name( &luid, expect_nameW, len ); ok( !wcscmp( nameW, expect_nameW ), "got %s vs %s\n", debugstr_w( nameW ), debugstr_w( expect_nameW ) );
/* ConvertInterfaceLuidToNameA */ ret = ConvertInterfaceLuidToNameA( NULL, NULL, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToNameA( &luid, NULL, 0 ); - ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %lu\n", ret );
ret = ConvertInterfaceLuidToNameA( NULL, nameA, 0 ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = ConvertInterfaceLuidToNameA( &luid, nameA, 0 ); - ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %lu\n", ret );
nameA[0] = 0; len = ARRAY_SIZE(nameA); ret = ConvertInterfaceLuidToNameA( &luid, nameA, len ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( nameA[0], "name not set\n" );
/* ConvertInterfaceNameToLuidW */ ret = ConvertInterfaceNameToLuidW( NULL, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; ret = ConvertInterfaceNameToLuidW( NULL, &luid ); - ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( ret == ERROR_INVALID_NAME, "got %lu\n", ret ); ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); ok( !luid.Info.IfType, "got %u\n", luid.Info.IfType );
ret = ConvertInterfaceNameToLuidW( nameW, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; ret = ConvertInterfaceNameToLuidW( nameW, &luid ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( luid.Value == row->InterfaceLuid.Value, "mismatch\n" );
/* ConvertInterfaceNameToLuidA */ ret = ConvertInterfaceNameToLuidA( NULL, NULL ); - ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( ret == ERROR_INVALID_NAME, "got %lu\n", ret );
luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; ret = ConvertInterfaceNameToLuidA( NULL, &luid ); - ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( ret == ERROR_INVALID_NAME, "got %lu\n", ret ); ok( luid.Info.Reserved == 0xdead, "reserved set\n" ); ok( luid.Info.NetLuidIndex == 0xdead, "index set\n" ); ok( luid.Info.IfType == 0xdead, "type set\n" );
ret = ConvertInterfaceNameToLuidA( nameA, NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; ret = ConvertInterfaceNameToLuidA( nameA, &luid ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( luid.Value == row->InterfaceLuid.Value, "mismatch\n" );
/* ConvertInterfaceAliasToLuid */ ret = ConvertInterfaceAliasToLuid( row->Alias, &luid ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( luid.Value == row->InterfaceLuid.Value, "mismatch\n" );
/* ConvertInterfaceLuidToAlias */ ret = ConvertInterfaceLuidToAlias( &row->InterfaceLuid, alias, ARRAY_SIZE(alias) ); - ok( !ret, "got %u\n", ret ); + ok( !ret, "got %lu\n", ret ); ok( !wcscmp( alias, row->Alias ), "got %s vs %s\n", wine_dbgstr_w( alias ), wine_dbgstr_w( row->Alias ) );
index = if_nametoindex( NULL ); - ok( !index, "Got unexpected index %u\n", index ); + ok( !index, "Got unexpected index %lu\n", index ); index = if_nametoindex( nameA ); - ok( index == row->InterfaceIndex, "Got index %u for %s, expected %u\n", index, nameA, row->InterfaceIndex ); + ok( index == row->InterfaceIndex, "Got index %lu for %s, expected %lu\n", index, nameA, row->InterfaceIndex ); /* Wargaming.net Game Center passes a GUID-like string. */ index = if_nametoindex( "{00000001-0000-0000-0000-000000000000}" ); - ok( !index, "Got unexpected index %u\n", index ); + ok( !index, "Got unexpected index %lu\n", index ); index = if_nametoindex( wine_dbgstr_guid( &guid ) ); - ok( !index, "Got unexpected index %u for input %s\n", index, wine_dbgstr_guid( &guid ) ); + ok( !index, "Got unexpected index %lu for input %s\n", index, wine_dbgstr_guid( &guid ) );
name = if_indextoname( 0, NULL ); ok( name == NULL, "got %s\n", name ); @@ -2175,17 +2175,17 @@ static void test_GetIfEntry2(void) }
ret = GetIfEntry2( NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); ret = GetIfEntry2( &row ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); row.InterfaceIndex = index; ret = GetIfEntry2( &row ); - ok( ret == NO_ERROR, "got %u\n", ret ); - ok( row.InterfaceIndex == index, "got %u\n", index ); + ok( ret == NO_ERROR, "got %lu\n", ret ); + ok( row.InterfaceIndex == index, "got %lu\n", index ); }
static void test_GetIfTable2(void) @@ -2195,7 +2195,7 @@ static void test_GetIfTable2(void)
table = NULL; ret = GetIfTable2( &table ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret ); ok( table != NULL, "table not set\n" ); FreeMibTable( table ); } @@ -2207,25 +2207,25 @@ static void test_GetIfTable2Ex(void)
table = NULL; ret = GetIfTable2Ex( MibIfTableNormal, &table ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret ); ok( table != NULL, "table not set\n" ); FreeMibTable( table );
table = NULL; ret = GetIfTable2Ex( MibIfTableRaw, &table ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret ); ok( table != NULL, "table not set\n" ); FreeMibTable( table );
table = NULL; ret = GetIfTable2Ex( MibIfTableNormalWithoutStatistics, &table ); - ok( ret == NO_ERROR || broken(ret == ERROR_INVALID_PARAMETER), "got %u\n", ret ); + ok( ret == NO_ERROR || broken(ret == ERROR_INVALID_PARAMETER), "got %lu\n", ret ); ok( table != NULL || broken(!table), "table not set\n" ); FreeMibTable( table );
table = NULL; ret = GetIfTable2Ex( 3, &table ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret ); ok( !table, "table should not be set\n" ); FreeMibTable( table ); } @@ -2243,23 +2243,23 @@ static void test_GetUnicastIpAddressEntry(void) }
ret = pGetUnicastIpAddressEntry( NULL ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); row.Address.Ipv4.sin_family = AF_INET; row.Address.Ipv4.sin_port = 0; row.Address.Ipv4.sin_addr.S_un.S_addr = 0x01020304; ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret ); + ok( ret == ERROR_FILE_NOT_FOUND, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); row.InterfaceIndex = 123; ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); row.InterfaceIndex = get_interface_index(); @@ -2267,7 +2267,7 @@ static void test_GetUnicastIpAddressEntry(void) row.Address.Ipv4.sin_port = 0; row.Address.Ipv4.sin_addr.S_un.S_addr = 0x01020304; ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == ERROR_NOT_FOUND, "got %u\n", ret ); + ok( ret == ERROR_NOT_FOUND, "got %lu\n", ret );
memset( &row, 0, sizeof(row) ); row.InterfaceIndex = 123; @@ -2275,15 +2275,15 @@ static void test_GetUnicastIpAddressEntry(void) row.Address.Ipv4.sin_port = 0; row.Address.Ipv4.sin_addr.S_un.S_addr = 0x01020304; ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret ); + ok( ret == ERROR_FILE_NOT_FOUND, "got %lu\n", ret );
ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, NULL, &size); - ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); + ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %lu\n", ret); if (ret != ERROR_BUFFER_OVERFLOW) return;
ptr = HeapAlloc(GetProcessHeap(), 0, size); ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, ptr, &size); - ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); + ok(!ret, "expected ERROR_SUCCESS got %lu\n", ret);
for (aa = ptr; !ret && aa; aa = aa->Next) { @@ -2297,14 +2297,14 @@ static void test_GetUnicastIpAddressEntry(void) memcpy(&row.InterfaceLuid, &aa->Luid, sizeof(aa->Luid)); memcpy(&row.Address, ua->Address.lpSockaddr, ua->Address.iSockaddrLength); ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret );
/* test with index */ memset( &row, 0, sizeof(row) ); row.InterfaceIndex = S(U(*aa)).IfIndex; memcpy(&row.Address, ua->Address.lpSockaddr, ua->Address.iSockaddrLength); ret = pGetUnicastIpAddressEntry( &row ); - ok( ret == NO_ERROR, "got %u\n", ret ); + ok( ret == NO_ERROR, "got %lu\n", ret ); if (ret == NO_ERROR) { ok(row.InterfaceLuid.Info.Reserved == aa->Luid.Info.Reserved, "Expected %d, got %d\n", @@ -2313,22 +2313,22 @@ static void test_GetUnicastIpAddressEntry(void) aa->Luid.Info.NetLuidIndex, row.InterfaceLuid.Info.NetLuidIndex); ok(row.InterfaceLuid.Info.IfType == aa->Luid.Info.IfType, "Expected %d, got %d\n", aa->Luid.Info.IfType, row.InterfaceLuid.Info.IfType); - ok(row.InterfaceIndex == S(U(*aa)).IfIndex, "Expected %d, got %d\n", + ok(row.InterfaceIndex == S(U(*aa)).IfIndex, "Expected %ld, got %ld\n", S(U(*aa)).IfIndex, row.InterfaceIndex); ok(row.PrefixOrigin == ua->PrefixOrigin, "Expected %d, got %d\n", ua->PrefixOrigin, row.PrefixOrigin); ok(row.SuffixOrigin == ua->SuffixOrigin, "Expected %d, got %d\n", ua->SuffixOrigin, row.SuffixOrigin); - ok(row.ValidLifetime == ua->ValidLifetime, "Expected %d, got %d\n", + ok(row.ValidLifetime == ua->ValidLifetime, "Expected %ld, got %ld\n", ua->ValidLifetime, row.ValidLifetime); - ok(row.PreferredLifetime == ua->PreferredLifetime, "Expected %d, got %d\n", + ok(row.PreferredLifetime == ua->PreferredLifetime, "Expected %ld, got %ld\n", ua->PreferredLifetime, row.PreferredLifetime); ok(row.OnLinkPrefixLength == ua->OnLinkPrefixLength, "Expected %d, got %d\n", ua->OnLinkPrefixLength, row.OnLinkPrefixLength); ok(row.SkipAsSource == 0, "Expected 0, got %d\n", row.SkipAsSource); ok(row.DadState == ua->DadState, "Expected %d, got %d\n", ua->DadState, row.DadState); if (row.Address.si_family == AF_INET6) - ok(row.ScopeId.Value == row.Address.Ipv6.sin6_scope_id, "Expected %d, got %d\n", + ok(row.ScopeId.Value == row.Address.Ipv6.sin6_scope_id, "Expected %ld, got %ld\n", row.Address.Ipv6.sin6_scope_id, row.ScopeId.Value); ok(row.CreationTimeStamp.QuadPart, "CreationTimeStamp is 0\n"); } @@ -2351,41 +2351,41 @@ static void test_GetUnicastIpAddressTable(void) }
ret = pGetUnicastIpAddressTable(AF_UNSPEC, NULL); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = pGetUnicastIpAddressTable(AF_BAN, &table); - ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %lu\n", ret );
ret = pGetUnicastIpAddressTable(AF_INET, &table); - ok( ret == NO_ERROR, "got %u\n", ret ); - trace("GetUnicastIpAddressTable(AF_INET): NumEntries %u\n", table->NumEntries); + ok( ret == NO_ERROR, "got %lu\n", ret ); + trace("GetUnicastIpAddressTable(AF_INET): NumEntries %lu\n", table->NumEntries); FreeMibTable( table );
ret = pGetUnicastIpAddressTable(AF_INET6, &table); - ok( ret == NO_ERROR, "got %u\n", ret ); - trace("GetUnicastIpAddressTable(AF_INET6): NumEntries %u\n", table->NumEntries); + ok( ret == NO_ERROR, "got %lu\n", ret ); + trace("GetUnicastIpAddressTable(AF_INET6): NumEntries %lu\n", table->NumEntries); FreeMibTable( table );
ret = pGetUnicastIpAddressTable(AF_UNSPEC, &table); - ok( ret == NO_ERROR, "got %u\n", ret ); - trace("GetUnicastIpAddressTable(AF_UNSPEC): NumEntries %u\n", table->NumEntries); + ok( ret == NO_ERROR, "got %lu\n", ret ); + trace("GetUnicastIpAddressTable(AF_UNSPEC): NumEntries %lu\n", table->NumEntries); for (i = 0; i < table->NumEntries && winetest_debug > 1; i++) { - trace("Index %u:\n", i); + trace("Index %lu:\n", i); trace("Address.si_family: %u\n", table->Table[i].Address.si_family); trace("InterfaceLuid.Info.Reserved: %u\n", table->Table[i].InterfaceLuid.Info.Reserved); trace("InterfaceLuid.Info.NetLuidIndex: %u\n", table->Table[i].InterfaceLuid.Info.NetLuidIndex); trace("InterfaceLuid.Info.IfType: %u\n", table->Table[i].InterfaceLuid.Info.IfType); - trace("InterfaceIndex: %u\n", table->Table[i].InterfaceIndex); + trace("InterfaceIndex: %lu\n", table->Table[i].InterfaceIndex); trace("PrefixOrigin: %u\n", table->Table[i].PrefixOrigin); trace("SuffixOrigin: %u\n", table->Table[i].SuffixOrigin); - trace("ValidLifetime: %u seconds\n", table->Table[i].ValidLifetime); - trace("PreferredLifetime: %u seconds\n", table->Table[i].PreferredLifetime); + trace("ValidLifetime: %lu seconds\n", table->Table[i].ValidLifetime); + trace("PreferredLifetime: %lu seconds\n", table->Table[i].PreferredLifetime); trace("OnLinkPrefixLength: %u\n", table->Table[i].OnLinkPrefixLength); trace("SkipAsSource: %u\n", table->Table[i].SkipAsSource); trace("DadState: %u\n", table->Table[i].DadState); - trace("ScopeId.Value: %u\n", table->Table[i].ScopeId.Value); - trace("CreationTimeStamp: %08x%08x\n", table->Table[i].CreationTimeStamp.HighPart, table->Table[i].CreationTimeStamp.LowPart); + trace("ScopeId.Value: %lu\n", table->Table[i].ScopeId.Value); + trace("CreationTimeStamp: %08lx%08lx\n", table->Table[i].CreationTimeStamp.HighPart, table->Table[i].CreationTimeStamp.LowPart); }
FreeMibTable( table ); @@ -2413,15 +2413,15 @@ static void test_ConvertLengthToIpv4Mask(void) expected = 0;
ret = pConvertLengthToIpv4Mask( n, &mask ); - ok( ret == NO_ERROR, "ConvertLengthToIpv4Mask returned 0x%08x, expected 0x%08x\n", ret, NO_ERROR ); - ok( mask == expected, "ConvertLengthToIpv4Mask mask value 0x%08x, expected 0x%08x\n", mask, expected ); + ok( ret == NO_ERROR, "ConvertLengthToIpv4Mask returned 0x%08lx, expected 0x%08x\n", ret, NO_ERROR ); + ok( mask == expected, "ConvertLengthToIpv4Mask mask value 0x%08lx, expected 0x%08lx\n", mask, expected ); }
/* Testing for out of range. In this case both mask and return are changed to indicate error. */ mask = 0xdeadbeef; ret = pConvertLengthToIpv4Mask( 33, &mask ); - ok( ret == ERROR_INVALID_PARAMETER, "ConvertLengthToIpv4Mask returned 0x%08x, expected 0x%08x\n", ret, ERROR_INVALID_PARAMETER ); - ok( mask == INADDR_NONE, "ConvertLengthToIpv4Mask mask value 0x%08x, expected 0x%08x\n", mask, INADDR_NONE ); + ok( ret == ERROR_INVALID_PARAMETER, "ConvertLengthToIpv4Mask returned 0x%08lx, expected 0x%08x\n", ret, ERROR_INVALID_PARAMETER ); + ok( mask == INADDR_NONE, "ConvertLengthToIpv4Mask mask value 0x%08lx, expected 0x%08x\n", mask, INADDR_NONE ); }
static void test_GetTcp6Table(void) @@ -2443,22 +2443,22 @@ static void test_GetTcp6Table(void) return; } ok(ret == ERROR_INSUFFICIENT_BUFFER, - "GetTcp6Table(NULL, &size, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", ret); + "GetTcp6Table(NULL, &size, FALSE) returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", ret); if (ret != ERROR_INSUFFICIENT_BUFFER) return;
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = pGetTcp6Table(buf, &size, FALSE); ok(ret == NO_ERROR, - "GetTcp6Table(buf, &size, FALSE) returned %d, expected NO_ERROR\n", ret); + "GetTcp6Table(buf, &size, FALSE) returned %ld, expected NO_ERROR\n", ret);
if (ret == NO_ERROR && winetest_debug > 1) { DWORD i; - trace("TCP6 table: %u entries\n", buf->dwNumEntries); + trace("TCP6 table: %lu entries\n", buf->dwNumEntries); for (i = 0; i < buf->dwNumEntries; i++) { - trace("%u: local %s%%%u:%u remote %s%%%u:%u state %u\n", i, + trace("%lu: local %s%%%u:%u remote %s%%%u:%u state %u\n", i, ntoa6(&buf->table[i].LocalAddr), ntohs(buf->table[i].dwLocalScopeId), ntohs(buf->table[i].dwLocalPort), ntoa6(&buf->table[i].RemoteAddr), ntohs(buf->table[i].dwRemoteScopeId), ntohs(buf->table[i].dwRemotePort), @@ -2485,22 +2485,22 @@ static void test_GetUdp6Table(void) return; } ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetUdp6Table(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + "GetUdp6Table(NULL, &dwSize, FALSE) returned %ld, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_UDP6TABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
apiReturn = pGetUdp6Table(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, - "GetUdp6Table(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + "GetUdp6Table(buf, &dwSize, FALSE) returned %ld, expected NO_ERROR\n", apiReturn);
if (apiReturn == NO_ERROR && winetest_debug > 1) { DWORD i; - trace( "UDP6 table: %u entries\n", buf->dwNumEntries ); + trace( "UDP6 table: %lu entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) - trace( "%u: %s%%%u:%u\n", + trace( "%lu: %s%%%u:%u\n", i, ntoa6(&buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalScopeId), ntohs(buf->table[i].dwLocalPort) ); } HeapFree(GetProcessHeap(), 0, buf); @@ -2556,10 +2556,10 @@ static void test_ParseNetworkString(void) }
ret = pParseNetworkString(wstr, -1, NULL, NULL, NULL); - ok(ret == ERROR_SUCCESS, "expected success, got %d\n", ret); + ok(ret == ERROR_SUCCESS, "expected success, got %ld\n", ret);
ret = pParseNetworkString(NULL, NET_STRING_IPV4_SERVICE, &info, NULL, NULL); - ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", ret);
for (i = 0; i < ARRAY_SIZE(ipv4_address_tests); i++) { @@ -2572,7 +2572,7 @@ static void test_ParseNetworkString(void) ret = pParseNetworkString(wstr, NET_STRING_IPV4_ADDRESS, &info, &port, &prefix_len);
ok(ret == ipv4_address_tests[i].ret, - "%s gave error %d\n", ipv4_address_tests[i].str, ret); + "%s gave error %ld\n", ipv4_address_tests[i].str, ret); ok(info.Format == ret ? NET_ADDRESS_FORMAT_UNSPECIFIED : NET_ADDRESS_IPV4, "%s gave format %d\n", ipv4_address_tests[i].str, info.Format); ok(info.Ipv4Address.sin_addr.S_un.S_addr == (ret ? 0x99999999 : ipv4_address_tests[i].addr.S_un.S_addr), @@ -2598,7 +2598,7 @@ static void test_ParseNetworkString(void) ret = pParseNetworkString(wstr, NET_STRING_IPV4_SERVICE, &info, &port, &prefix_len);
ok(ret == ipv4_service_tests[i].ret, - "%s gave error %d\n", ipv4_service_tests[i].str, ret); + "%s gave error %ld\n", ipv4_service_tests[i].str, ret); ok(info.Format == ret ? NET_ADDRESS_FORMAT_UNSPECIFIED : NET_ADDRESS_IPV4, "%s gave format %d\n", ipv4_address_tests[i].str, info.Format); ok(info.Ipv4Address.sin_addr.S_un.S_addr == (ret ? 0x99999999 : ipv4_service_tests[i].addr.S_un.S_addr), @@ -2641,11 +2641,11 @@ static void test_NotifyUnicastIpAddressChange(void) callback_called = FALSE; ret = pNotifyUnicastIpAddressChange(AF_INET, test_ipaddtess_change_callback, &callback_called, TRUE, &handle); - ok(ret == NO_ERROR, "Unexpected ret %#x.\n", ret); + ok(ret == NO_ERROR, "Unexpected ret %#lx.\n", ret); ok(callback_called, "Callback was not called.\n");
ret = pCancelMibChangeNotify2(handle); - ok(ret == NO_ERROR, "Unexpected ret %#x.\n", ret); + ok(ret == NO_ERROR, "Unexpected ret %#lx.\n", ret); ok(!CloseHandle(handle), "CloseHandle() succeeded.\n"); }
@@ -2657,23 +2657,23 @@ static void test_ConvertGuidToString( void ) GUID guid = { 0xa, 0xb, 0xc, { 0xd, 0, 0xe, 0xf } }, guid2;
err = ConvertGuidToStringA( &guid, bufA, 38 ); - ok( err, "got %d\n", err ); + ok( err, "got %ld\n", err ); err = ConvertGuidToStringA( &guid, bufA, 39 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( !strcmp( bufA, "{0000000A-000B-000C-0D00-0E0F00000000}" ), "got %s\n", bufA );
err = ConvertGuidToStringW( &guid, bufW, 38 ); - ok( err, "got %d\n", err ); + ok( err, "got %ld\n", err ); err = ConvertGuidToStringW( &guid, bufW, 39 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( !wcscmp( bufW, L"{0000000A-000B-000C-0D00-0E0F00000000}" ), "got %s\n", debugstr_w( bufW ) );
err = ConvertStringToGuidW( bufW, &guid2 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( IsEqualGUID( &guid, &guid2 ), "guid mismatch\n" );
err = ConvertStringToGuidW( L"foo", &guid2 ); - ok( err == ERROR_INVALID_PARAMETER, "got %d\n", err ); + ok( err == ERROR_INVALID_PARAMETER, "got %ld\n", err ); }
START_TEST(iphlpapi)
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/itss/tests/Makefile.in | 1 dlls/itss/tests/protocol.c | 130 ++++++++++++++++++++++--------------------- 2 files changed, 65 insertions(+), 66 deletions(-)
diff --git a/dlls/itss/tests/Makefile.in b/dlls/itss/tests/Makefile.in index 8f2fd415e5c..c1e9a192a2e 100644 --- a/dlls/itss/tests/Makefile.in +++ b/dlls/itss/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = itss.dll IMPORTS = ole32
diff --git a/dlls/itss/tests/protocol.c b/dlls/itss/tests/protocol.c index 43d867b9cfb..db4c3ef2f45 100644 --- a/dlls/itss/tests/protocol.c +++ b/dlls/itss/tests/protocol.c @@ -139,7 +139,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, ok(!szStatusText, "szStatusText != NULL\n"); break; default: - ok(0, "unexpected ulStatusCode %d\n", ulStatusCode); + ok(0, "unexpected ulStatusCode %ld\n", ulStatusCode); break; }
@@ -153,9 +153,9 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
ok(ulProgress == ulProgressMax, "ulProgress != ulProgressMax\n"); if(test_protocol == ITS_PROTOCOL) - ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), "grcf = %08x\n", grfBSCF); + ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), "grcf = %08lx\n", grfBSCF); else - ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION), "grcf = %08x\n", grfBSCF); + ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION), "grcf = %08lx\n", grfBSCF);
if(read_protocol) { BYTE buf[100]; @@ -163,8 +163,8 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR HRESULT hres;
hres = IInternetProtocol_Read(read_protocol, buf, sizeof(buf), &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 13, "cb=%u expected 13\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 13, "cb=%lu expected 13\n", cb); ok(!memcmp(buf, "<html></html>", 13), "unexpected data\n"); }
@@ -176,8 +176,8 @@ static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HR { CHECK_EXPECT(ReportResult);
- ok(hrResult == expect_hrResult, "expected: %08x got: %08x\n", expect_hrResult, hrResult); - ok(dwError == 0, "dwError = %d\n", dwError); + ok(hrResult == expect_hrResult, "expected: %08lx got: %08lx\n", expect_hrResult, hrResult); + ok(dwError == 0, "dwError = %ld\n", dwError); ok(!szResult, "szResult != NULL\n");
return S_OK; @@ -224,7 +224,7 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB if(grfBINDF) ok(!*grfBINDF, "*grfBINDF != 0\n"); ok(pbindinfo != NULL, "pbindinfo == NULL\n"); - ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %d\n", pbindinfo->cbSize); + ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %ld\n", pbindinfo->cbSize);
*grfBINDF = bindf; return S_OK; @@ -258,7 +258,7 @@ static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT
expect_hrResult = expected_hres; hres = IInternetProtocol_Start(protocol, url, &protocol_sink, &bind_info, 0, 0); - ok(hres == expected_hres, "expected: %08x got: %08x\n", expected_hres, hres); + ok(hres == expected_hres, "expected: %08lx got: %08lx\n", expected_hres, hres);
CHECK_CALLED(GetBindInfo); CHECK_CALLED(ReportResult); @@ -324,7 +324,7 @@ static void test_protocol_url(IClassFactory *factory, LPCWSTR url, BOOL expect_m HRESULT hres;
hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol); - ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(FAILED(hres)) return;
@@ -335,90 +335,90 @@ static void test_protocol_url(IClassFactory *factory, LPCWSTR url, BOOL expect_m }
hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 13, "cb=%u expected 13\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 13, "cb=%lu expected 13\n", cb); ok(!memcmp(buf, "<html></html>", 13), "unexpected data\n"); ref = IInternetProtocol_Release(protocol); - ok(!ref, "protocol ref=%d\n", ref); + ok(!ref, "protocol ref=%ld\n", ref);
hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol); - ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(FAILED(hres)) return;
cb = 0xdeadbeef; hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); ok(hres == (test_protocol == ITS_PROTOCOL ? INET_E_DATA_NOT_AVAILABLE : E_FAIL), - "Read returned %08x\n", hres); - ok(cb == 0xdeadbeef, "cb=%u expected 0xdeadbeef\n", cb); + "Read returned %08lx\n", hres); + ok(cb == 0xdeadbeef, "cb=%lu expected 0xdeadbeef\n", cb);
protocol_start(protocol, url, expect_mime); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 2, "cb=%u expected 2\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 2, "cb=%lu expected 2\n", cb); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 11, "cb=%u, expected 11\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 11, "cb=%lu, expected 11\n", cb); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); - ok(hres == S_FALSE, "Read failed: %08x expected S_FALSE\n", hres); - ok(cb == 0, "cb=%u expected 0\n", cb); + ok(hres == S_FALSE, "Read failed: %08lx expected S_FALSE\n", hres); + ok(cb == 0, "cb=%lu expected 0\n", cb); hres = IInternetProtocol_UnlockRequest(protocol); - ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres); ref = IInternetProtocol_Release(protocol); - ok(!ref, "protocol ref=%d\n", ref); + ok(!ref, "protocol ref=%ld\n", ref);
hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol); - ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(FAILED(hres)) return;
protocol_start(protocol, url, expect_mime); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); + ok(hres == S_OK, "Read failed: %08lx\n", hres); hres = IInternetProtocol_LockRequest(protocol, 0); - ok(hres == S_OK, "LockRequest failed: %08x\n", hres); + ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_UnlockRequest(protocol); - ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 11, "cb=%u, expected 11\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 11, "cb=%lu, expected 11\n", cb); ref = IInternetProtocol_Release(protocol); - ok(!ref, "protocol ref=%d\n", ref); + ok(!ref, "protocol ref=%ld\n", ref);
hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol); - ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(FAILED(hres)) return;
protocol_start(protocol, url, expect_mime); hres = IInternetProtocol_LockRequest(protocol, 0); - ok(hres == S_OK, "LockRequest failed: %08x\n", hres); + ok(hres == S_OK, "LockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Terminate(protocol, 0); - ok(hres == S_OK, "Terminate failed: %08x\n", hres); + ok(hres == S_OK, "Terminate failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 2, "cb=%u, expected 2\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 2, "cb=%lu, expected 2\n", cb); hres = IInternetProtocol_UnlockRequest(protocol); - ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres); + ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 2, "cb=%u, expected 2\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 2, "cb=%lu, expected 2\n", cb); hres = IInternetProtocol_Terminate(protocol, 0); - ok(hres == S_OK, "Terminate failed: %08x\n", hres); + ok(hres == S_OK, "Terminate failed: %08lx\n", hres); hres = IInternetProtocol_Read(protocol, buf, 2, &cb); - ok(hres == S_OK, "Read failed: %08x\n", hres); - ok(cb == 2, "cb=%u expected 2\n", cb); + ok(hres == S_OK, "Read failed: %08lx\n", hres); + ok(cb == 2, "cb=%lu expected 2\n", cb); ref = IInternetProtocol_Release(protocol); - ok(!ref, "protocol ref=%d\n", ref); + ok(!ref, "protocol ref=%ld\n", ref);
hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&read_protocol); - ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(FAILED(hres)) return;
protocol_start(read_protocol, url, expect_mime); ref = IInternetProtocol_Release(read_protocol); - ok(!ref, "protocol ref=%d\n", ref); + ok(!ref, "protocol ref=%ld\n", ref); read_protocol = NULL; }
@@ -461,7 +461,7 @@ static void test_its_protocol_info(IInternetProtocol *protocol) HRESULT hres;
hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetProtocolInfo, (void**)&info); - ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08lx\n", hres); if(FAILED(hres)) return;
@@ -470,7 +470,7 @@ static void test_its_protocol_info(IInternetProtocol *protocol) hres = IInternetProtocolInfo_ParseUrl(info, blank_url1, i, 0, buf, ARRAY_SIZE(buf), &size, 0); ok(hres == INET_E_DEFAULT_ACTION, - "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n", i, hres); + "[%ld] failed: %08lx, expected INET_E_DEFAULT_ACTION\n", i, hres); } }
@@ -479,12 +479,12 @@ static void test_its_protocol_info(IInternetProtocol *protocol) memset(buf, 0xfe, sizeof(buf)); hres = IInternetProtocolInfo_CombineUrl(info, combine_tests[i].base_url, combine_tests[i].rel_url, combine_tests[i].flags, buf, ARRAY_SIZE(buf), &size, 0); - ok(hres == combine_tests[i].hres, "[%d] CombineUrl returned %08x, expected %08x\n", + ok(hres == combine_tests[i].hres, "[%ld] CombineUrl returned %08lx, expected %08lx\n", i, hres, combine_tests[i].hres); ok(size == (combine_tests[i].combined_url ? lstrlenW(combine_tests[i].combined_url)+1 - : 0xdeadbeef), "[%d] unexpected size=%d\n", i, size); + : 0xdeadbeef), "[%ld] unexpected size=%ld\n", i, size); if(combine_tests[i].combined_url) - ok(!lstrcmpW(buf, combine_tests[i].combined_url), "[%d] unexpected result: %s\n", i, wine_dbgstr_w(buf)); + ok(!lstrcmpW(buf, combine_tests[i].combined_url), "[%ld] unexpected result: %s\n", i, wine_dbgstr_w(buf)); else ok(buf[0] == 0xfefe, "buf changed\n"); } @@ -493,8 +493,8 @@ static void test_its_protocol_info(IInternetProtocol *protocol) memset(buf, 0xfe, sizeof(buf)); hres = IInternetProtocolInfo_CombineUrl(info, L"its:test.chm::/blank.html", L"test.html", 0, buf, 1, &size, 0); - ok(hres == E_OUTOFMEMORY, "CombineUrl failed: %08x\n", hres); - ok(size == 25, "size=%d\n", size); + ok(hres == E_OUTOFMEMORY, "CombineUrl failed: %08lx\n", hres); + ok(size == 25, "size=%ld\n", size); ok(buf[0] == 0xfefe, "buf changed\n");
IInternetProtocolInfo_Release(info); @@ -519,12 +519,12 @@ static void test_its_protocol(void) hres = CoGetClassObject(&CLSID_ITSProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk); ok(hres == S_OK || broken(hres == REGDB_E_CLASSNOTREG), /* Some W95 and NT4 */ - "CoGetClassObject failed: %08x\n", hres); + "CoGetClassObject failed: %08lx\n", hres); if(FAILED(hres)) return;
hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&info); - ok(hres == E_NOINTERFACE, "Could not get IInternetProtocolInfo: %08x\n", hres); + ok(hres == E_NOINTERFACE, "Could not get IInternetProtocolInfo: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IClassFactory, (void**)&factory); ok(hres == S_OK, "Could not get IClassFactory interface\n"); @@ -532,7 +532,7 @@ static void test_its_protocol(void) IInternetProtocol *protocol;
hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol); - ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres); if(SUCCEEDED(hres)) { test_its_protocol_info(protocol);
@@ -542,14 +542,14 @@ static void test_its_protocol(void)
hres = IInternetProtocol_Start(protocol, wrong_url4, &protocol_sink, &bind_info, 0, 0); ok(hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER, - "Start failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres); + "Start failed: %08lx, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres);
hres = IInternetProtocol_Start(protocol, wrong_url5, &protocol_sink, &bind_info, 0, 0); ok(hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER, - "Start failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres); + "Start failed: %08lx, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres);
ref = IInternetProtocol_Release(protocol); - ok(!ref, "protocol ref=%d\n", ref); + ok(!ref, "protocol ref=%ld\n", ref);
test_protocol_url(factory, blank_url1, TRUE); test_protocol_url(factory, blank_url2, TRUE); @@ -580,7 +580,7 @@ static void test_mk_protocol(void) (void**)&cf); ok(hres == S_OK || broken(hres == REGDB_E_CLASSNOTREG), /* Some W95 and NT4 */ - "CoGetClassObject failed: %08x\n", hres); + "CoGetClassObject failed: %08lx\n", hres); if(FAILED(hres)) return;
@@ -619,7 +619,7 @@ static void delete_chm(void) BOOL ret;
ret = DeleteFileA("test.chm"); - ok(ret, "DeleteFileA failed: %d\n", GetLastError()); + ok(ret, "DeleteFileA failed: %ld\n", GetLastError()); }
static const IID outer_test_iid = {0xabcabc00,0,0,{0,0,0,0,0,0,0,0x66}}; @@ -659,18 +659,18 @@ static void test_com_aggregation(const CLSID *clsid) HRESULT hres;
hres = CoGetClassObject(clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&class_factory); - ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres); + ok(hres == S_OK, "CoGetClassObject failed: %08lx\n", hres);
hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk); - ok(hres == S_OK, "CreateInstance returned: %08x\n", hres); + ok(hres == S_OK, "CreateInstance returned: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocol, (void**)&unk2); - ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol iface: %08lx\n", hres);
SET_EXPECT(outer_QI_test); hres = IUnknown_QueryInterface(unk2, &outer_test_iid, (void**)&unk3); CHECK_CALLED(outer_QI_test); - ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IInternetProtocol iface: %08lx\n", hres); ok(unk3 == (IUnknown*)0xdeadbeef, "unexpected unk2\n");
IUnknown_Release(unk2); @@ -678,7 +678,7 @@ static void test_com_aggregation(const CLSID *clsid)
unk = (void*)0xdeadbeef; hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IInternetProtocol, (void**)&unk); - ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08x\n", hres); + ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08lx\n", hres); ok(!unk, "unk = %p\n", unk);
IClassFactory_Release(class_factory);
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/jscript/tests/Makefile.in | 1 dlls/jscript/tests/activex.c | 60 ++-- dlls/jscript/tests/caller.c | 32 +- dlls/jscript/tests/jscript.c | 608 ++++++++++++++++++++-------------------- dlls/jscript/tests/run.c | 434 ++++++++++++++--------------- 5 files changed, 567 insertions(+), 568 deletions(-)
diff --git a/dlls/jscript/tests/Makefile.in b/dlls/jscript/tests/Makefile.in index 3be4e342885..a4493d6ed89 100644 --- a/dlls/jscript/tests/Makefile.in +++ b/dlls/jscript/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = jscript.dll IMPORTS = oleaut32 ole32 advapi32
diff --git a/dlls/jscript/tests/activex.c b/dlls/jscript/tests/activex.c index 9b2d7b0b23b..d1026134295 100644 --- a/dlls/jscript/tests/activex.c +++ b/dlls/jscript/tests/activex.c @@ -140,7 +140,7 @@ static HRESULT WINAPI ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *p ok(pUnkSite != NULL, "pUnkSite == NULL\n");
hres = IUnknown_QueryInterface(pUnkSite, &IID_IServiceProvider, (void**)&sp); - ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres); IServiceProvider_Release(sp);
return SetSite_hres; @@ -223,7 +223,7 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) { - ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); + ok(0, "unexpected call %s %lx\n", wine_dbgstr_w(bstrName), grfdex); return E_NOTIMPL; }
@@ -260,7 +260,7 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!lstrcmpW(bstrName, L"reportSuccess")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %lx\n", grfdex); *pid = DISPID_TEST_REPORTSUCCESS; return S_OK; } @@ -316,7 +316,7 @@ static IDispatchEx testObj = { &testObjVtbl }; static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!lstrcmpW(bstrName, L"ok")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %lx\n", grfdex); *pid = DISPID_GLOBAL_OK; return S_OK; } @@ -449,14 +449,14 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost { CHECK_EXPECT(ProcessUrlAction);
- ok(dwAction == URLACTION_ACTIVEX_RUN, "dwAction = %x\n", dwAction); + ok(dwAction == URLACTION_ACTIVEX_RUN, "dwAction = %lx\n", dwAction); ok(pPolicy != NULL, "pPolicy == NULL\n"); - ok(cbPolicy == sizeof(DWORD), "cbPolicy = %d\n", cbPolicy); + ok(cbPolicy == sizeof(DWORD), "cbPolicy = %ld\n", cbPolicy); ok(pContext != NULL, "pContext == NULL\n"); - ok(cbContext == sizeof(GUID), "cbContext = %d\n", cbContext); + ok(cbContext == sizeof(GUID), "cbContext = %ld\n", cbContext); ok(IsEqualGUID(pContext, &CLSID_TestObj), "pContext = %s\n", wine_dbgstr_guid((const IID*)pContext)); - ok(!dwFlags, "dwFlags = %x\n", dwFlags); - ok(!dwReserved, "dwReserved = %x\n", dwReserved); + ok(!dwFlags, "dwFlags = %lx\n", dwFlags); + ok(!dwReserved, "dwReserved = %lx\n", dwReserved);
if(SUCCEEDED(ProcessUrlAction_hres)) *(DWORD*)pPolicy = ProcessUrlAction_policy; @@ -476,12 +476,12 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos ok(ppPolicy != NULL, "ppPolicy == NULL\n"); ok(pcbPolicy != NULL, "pcbPolicy == NULL\n"); ok(pContext != NULL, "pContext == NULL\n"); - ok(cbContext == sizeof(struct CONFIRMSAFETY), "cbContext = %d\n", cbContext); - ok(!dwReserved, "dwReserved = %x\n", dwReserved); + ok(cbContext == sizeof(struct CONFIRMSAFETY), "cbContext = %ld\n", cbContext); + ok(!dwReserved, "dwReserved = %lx\n", dwReserved);
/* TODO: CLSID */ ok(cs->pUnk != NULL, "cs->pUnk == NULL\n"); - ok(!cs->dwFlags, "dwFlags = %x\n", cs->dwFlags); + ok(!cs->dwFlags, "dwFlags = %lx\n", cs->dwFlags);
if(FAILED(QueryCustomPolicy_hres)) return QueryCustomPolicy_hres; @@ -592,7 +592,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti) { - ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask); + ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %lx\n", dwReturnMask); ok(!ppti, "ppti != NULL\n"); ok(!lstrcmpW(pstrName, L"test"), "pstrName = %s\n", wine_dbgstr_w(pstrName));
@@ -656,7 +656,7 @@ static void set_safety_options(IUnknown *unk, BOOL use_sec_mgr) HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&safety); - ok(hres == S_OK, "Could not get IObjectSafety: %08x\n", hres); + ok(hres == S_OK, "Could not get IObjectSafety: %08lx\n", hres); if(FAILED(hres)) return;
@@ -667,13 +667,13 @@ static void set_safety_options(IUnknown *unk, BOOL use_sec_mgr) options_set = INTERFACE_USES_DISPEX;
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, options_all, options_set); - ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); - ok(supported == options_all, "supported=%x, expected %x\n", supported, options_all); - ok(enabled == options_set, "enabled=%x, expected %x\n", enabled, options_set); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); + ok(supported == options_all, "supported=%lx, expected %lx\n", supported, options_all); + ok(enabled == options_set, "enabled=%lx, expected %lx\n", enabled, options_set);
IObjectSafety_Release(safety); } @@ -684,7 +684,7 @@ static void _parse_script(unsigned line, IActiveScriptParse *parser, const WCHAR HRESULT hres;
hres = IActiveScriptParse_ParseScriptText(parser, script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); }
static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr) @@ -707,7 +707,7 @@ static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr) hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&script); if(!skip_tests) - ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres); if(FAILED(hres)) return NULL;
@@ -715,20 +715,20 @@ static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr) set_safety_options((IUnknown*)script, use_sec_mgr);
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(script, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
IActiveScript_Release(script);
@@ -757,16 +757,16 @@ static IDispatchEx *parse_procedure(IActiveScriptParse *parser, const WCHAR *src HRESULT hres;
hres = IActiveScriptParse_QueryInterface(parser, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc); - ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2: %08lx\n", hres);
hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, src, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, &disp); IActiveScriptParseProcedure2_Release(parse_proc); - ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres); + ok(hres == S_OK, "ParseProcedureText failed: %08lx\n", hres); ok(disp != NULL, "disp == NULL\n");
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); IDispatch_Release(disp); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
return dispex; } @@ -779,7 +779,7 @@ static void _call_procedure(unsigned line, IDispatchEx *proc, IServiceProvider * HRESULT hres;
hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, NULL, &ei, caller); - ok_(__FILE__,line)(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
}
@@ -1080,7 +1080,7 @@ static BOOL register_activex(void)
hres = CoRegisterClassObject(&CLSID_TestObj, (IUnknown *)&activex_cf, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®id); - ok(hres == S_OK, "Could not register script engine: %08x\n", hres); + ok(hres == S_OK, "Could not register script engine: %08lx\n", hres);
return TRUE; } diff --git a/dlls/jscript/tests/caller.c b/dlls/jscript/tests/caller.c index 19323e8eaf1..0da8c9abb08 100644 --- a/dlls/jscript/tests/caller.c +++ b/dlls/jscript/tests/caller.c @@ -102,7 +102,7 @@ static void _call_change_type(unsigned line, IVariantChangeType *change_type, VA SET_EXPECT(OnLeaveScript); } hres = IVariantChangeType_ChangeType(change_type, dst, src, 0, vt); - ok_(__FILE__,line)(hres == S_OK, "ChangeType(%d) failed: %08x\n", vt, hres); + ok_(__FILE__,line)(hres == S_OK, "ChangeType(%d) failed: %08lx\n", vt, hres); ok_(__FILE__,line)(V_VT(dst) == vt, "V_VT(dst) = %d\n", V_VT(dst)); if(V_VT(src) == VT_DISPATCH && vt != VT_BOOL) { CHECK_CALLED(OnEnterScript); @@ -118,7 +118,7 @@ static void _change_type_fail(unsigned line, IVariantChangeType *change_type, VA
V_VT(&v) = VT_EMPTY; hres = IVariantChangeType_ChangeType(change_type, &v, src, 0, vt); - ok_(__FILE__,line)(hres == exhres, "ChangeType failed: %08x, expected %08x\n", hres, exhres); + ok_(__FILE__,line)(hres == exhres, "ChangeType failed: %08lx, expected %08lx\n", hres, exhres); }
static void test_change_type(IVariantChangeType *change_type, VARIANT *src, const conv_results_t *ex) @@ -126,7 +126,7 @@ static void test_change_type(IVariantChangeType *change_type, VARIANT *src, cons VARIANT v;
call_change_type(change_type, &v, src, VT_I4); - ok(V_I4(&v) == ex->int_result, "V_I4(v) = %d, expected %d\n", V_I4(&v), ex->int_result); + ok(V_I4(&v) == ex->int_result, "V_I4(v) = %ld, expected %d\n", V_I4(&v), ex->int_result);
call_change_type(change_type, &v, src, VT_UI2); ok(V_UI2(&v) == (UINT16)ex->int_result, "V_UI2(v) = %u, expected %u\n", V_UI2(&v), (UINT16)ex->int_result); @@ -208,14 +208,14 @@ static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_di V_BOOL(&v) = VARIANT_FALSE; V_VT(&dst) = 0xdead; hres = IVariantChangeType_ChangeType(change_type, &dst, &v, 0, VT_I4); - ok(hres == DISP_E_BADVARTYPE, "ChangeType failed: %08x, expected DISP_E_BADVARTYPE\n", hres); + ok(hres == DISP_E_BADVARTYPE, "ChangeType failed: %08lx, expected DISP_E_BADVARTYPE\n", hres); ok(V_VT(&dst) == 0xdead, "V_VT(dst) = %d\n", V_VT(&dst));
/* Test conversion in place */ V_VT(&v) = VT_BSTR; V_BSTR(&v) = str = SysAllocString(L"test"); hres = IVariantChangeType_ChangeType(change_type, &v, &v, 0, VT_BSTR); - ok(hres == S_OK, "ChangeType failed: %08x\n", hres); + ok(hres == S_OK, "ChangeType failed: %08lx\n", hres); ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); ok(V_BSTR(&v) != str, "V_BSTR(v) == str\n"); ok(!lstrcmpW(V_BSTR(&v), L"test"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); @@ -228,7 +228,7 @@ static void test_caller(IServiceProvider *caller, IDispatch *arg_obj) HRESULT hres;
hres = IServiceProvider_QueryService(caller, &SID_VariantConversion, &IID_IVariantChangeType, (void**)&change_type); - ok(hres == S_OK, "Could not get SID_VariantConversion service: %08x\n", hres); + ok(hres == S_OK, "Could not get SID_VariantConversion service: %08lx\n", hres);
ok(change_type == script_change_type, "change_type != script_change_type\n"); test_change_types(change_type, arg_obj); @@ -291,7 +291,7 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) { - ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); + ok(0, "unexpected call %s %lx\n", wine_dbgstr_w(bstrName), grfdex); return E_NOTIMPL; }
@@ -328,7 +328,7 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!lstrcmpW(bstrName, L"testArgConv")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %lx\n", grfdex); *pid = DISPID_TEST_TESTARGCONV; return S_OK; } @@ -424,7 +424,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti) { - ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask); + ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %lx\n", dwReturnMask); ok(!ppti, "ppti != NULL\n"); ok(!lstrcmpW(pstrName, L"test"), "pstrName = %s\n", wine_dbgstr_w(pstrName));
@@ -487,7 +487,7 @@ static void _parse_script(unsigned line, IActiveScriptParse *parser, const WCHAR HRESULT hres;
hres = IActiveScriptParse_ParseScriptText(parser, script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); }
static IActiveScriptParse *create_script(void) @@ -502,20 +502,20 @@ static IActiveScriptParse *create_script(void) return NULL;
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(script, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
IActiveScript_Release(script);
@@ -530,7 +530,7 @@ static void run_scripts(void) parser = create_script();
hres = IActiveScriptParse_QueryInterface(parser, &IID_IVariantChangeType, (void**)&script_change_type); - ok(hres == S_OK, "Could not get IVariantChangeType iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IVariantChangeType iface: %08lx\n", hres);
SET_EXPECT(OnEnterScript); /* checked in callback */ SET_EXPECT(testArgConv); diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c index b5803aed87d..8c985e5c6a5 100644 --- a/dlls/jscript/tests/jscript.c +++ b/dlls/jscript/tests/jscript.c @@ -123,7 +123,7 @@ static void _test_state(unsigned line, IActiveScript *script, SCRIPTSTATE exstat HRESULT hres;
hres = IActiveScript_GetScriptState(script, &state); - ok_(__FILE__,line) (hres == S_OK, "GetScriptState failed: %08x\n", hres); + ok_(__FILE__,line) (hres == S_OK, "GetScriptState failed: %08lx\n", hres); ok_(__FILE__,line) (state == exstate, "state=%d, expected %d\n", state, exstate); }
@@ -241,7 +241,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID id, REFIID riid, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, UINT *err) { CHECK_EXPECT(testCall); - ok(id == 1, "id = %u\n", id); + ok(id == 1, "id = %lu\n", id); ok(flags == DISPATCH_METHOD, "flags = %x\n", flags); ok(!dp->cArgs, "cArgs = %u\n", dp->cArgs); ok(!res, "res = %p\n", res); @@ -342,7 +342,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti) { - ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "dwReturnMask = %x\n", dwReturnMask); + ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "dwReturnMask = %lx\n", dwReturnMask); if(!wcscmp(pstrName, L"globalItem")) { CHECK_EXPECT(GetItemInfo_global); IDispatch_AddRef(&global_named_item); @@ -464,16 +464,16 @@ static void test_script_dispatch(IDispatchEx *dispex) str = SysAllocString(L"ActiveXObject"); hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
str = SysAllocString(L"Math"); hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
memset(&ei, 0, sizeof(ei)); hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n"); VariantClear(&v); @@ -481,11 +481,11 @@ static void test_script_dispatch(IDispatchEx *dispex) str = SysAllocString(L"String"); hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
memset(&ei, 0, sizeof(ei)); hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n"); VariantClear(&v); @@ -499,11 +499,11 @@ static IDispatchEx *get_script_dispatch(IActiveScript *script, const WCHAR *item
disp = (void*)0xdeadbeef; hres = IActiveScript_GetScriptDispatch(script, item_name, &disp); - ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres);
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); IDispatch_Release(disp); - ok(hres == S_OK, "Could not get IDispatch iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatch iface: %08lx\n", hres); return dispex; }
@@ -515,7 +515,7 @@ static void parse_script(IActiveScriptParse *parser, const WCHAR *src) SET_EXPECT(OnLeaveScript);
hres = IActiveScriptParse_ParseScriptText(parser, src, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -530,12 +530,12 @@ static void _get_disp_id(unsigned line, IDispatchEx *dispex, const WCHAR *name,
str = SysAllocString(name); hr = IDispatchEx_GetDispID(dispex, str, 0, id); - ok_(__FILE__,line)(hr == exhr, "GetDispID(%s) returned %08x, expected %08x\n", + ok_(__FILE__,line)(hr == exhr, "GetDispID(%s) returned %08lx, expected %08lx\n", wine_dbgstr_w(name), hr, exhr);
hr = IDispatchEx_GetIDsOfNames(dispex, &IID_NULL, &str, 1, 0, &id2); SysFreeString(str); - ok_(__FILE__,line)(hr == exhr, "GetIDsOfNames(%s) returned %08x, expected %08x\n", + ok_(__FILE__,line)(hr == exhr, "GetIDsOfNames(%s) returned %08lx, expected %08lx\n", wine_dbgstr_w(name), hr, exhr); ok_(__FILE__,line)(*id == id2, "GetIDsOfNames(%s) id != id2\n", wine_dbgstr_w(name)); } @@ -547,7 +547,7 @@ static void test_no_script_dispatch(IActiveScript *script)
disp = (void*)0xdeadbeef; hres = IActiveScript_GetScriptDispatch(script, NULL, &disp); - ok(hres == E_UNEXPECTED, "hres = %08x, expected E_UNEXPECTED\n", hres); + ok(hres == E_UNEXPECTED, "hres = %08lx, expected E_UNEXPECTED\n", hres); ok(!disp, "disp != NULL\n"); }
@@ -558,86 +558,86 @@ static void test_safety(IUnknown *unk) HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&safety); - ok(hres == S_OK, "Could not get IObjectSafety: %08x\n", hres); + ok(hres == S_OK, "Could not get IObjectSafety: %08lx\n", hres); if(FAILED(hres)) return;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, &supported, NULL); - ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08x, expected E_POINTER\n", hres); + ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08lx, expected E_POINTER\n", hres); hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, NULL, &enabled); - ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08x, expected E_POINTER\n", hres); + ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08lx, expected E_POINTER\n", hres);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); - ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled); + "supported=%lx\n", supported); + ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScript, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); - ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled); + "supported=%lx\n", supported); + ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); - ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled); + "supported=%lx\n", supported); + ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER |INTERFACESAFE_FOR_UNTRUSTED_CALLER, INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER); - ok(hres == E_FAIL, "SetInterfaceSafetyOptions failed: %08x, expected E_FAIL\n", hres); + ok(hres == E_FAIL, "SetInterfaceSafetyOptions failed: %08lx, expected E_FAIL\n", hres);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER, INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER); - ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); + "supported=%lx\n", supported); ok(enabled == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "enabled=%x\n", enabled); + "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA, 0); - ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); - ok(enabled == (INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), "enabled=%x\n", enabled); + "supported=%lx\n", supported); + ok(enabled == (INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER, 0); - ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); - ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled); + "supported=%lx\n", supported); + ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACE_USES_DISPEX, 0); - ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef; hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); - ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres); ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), - "supported=%x\n", supported); - ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled); + "supported=%lx\n", supported); + ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
IObjectSafety_Release(safety); } @@ -649,7 +649,7 @@ static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *v
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty, (void**)&script_prop); - ok(hres == S_OK, "Could not get IActiveScriptProperty: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptProperty: %08lx\n", hres); if(FAILED(hres)) return hres;
@@ -669,22 +669,22 @@ static void test_invoke_versioning(IActiveScript *script) win_skip("SCRIPTPROP_INVOKESTRING not supported\n"); return; } - ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
V_VT(&v) = VT_I2; V_I2(&v) = 0; hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); - ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
V_VT(&v) = VT_I4; V_I4(&v) = 16; hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); - ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
V_VT(&v) = VT_I4; V_I4(&v) = 2; hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); - ok(hres == S_OK, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + ok(hres == S_OK, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres); }
static IActiveScript *create_jscript(void) @@ -694,7 +694,7 @@ static IActiveScript *create_jscript(void)
hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&ret); - ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
return ret; } @@ -710,20 +710,20 @@ static void test_jscript(void) script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED); test_safety((IUnknown*)script); test_invoke_versioning(script);
hres = IActiveScriptParse_InitNew(parse); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parse); - ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n", hres); + ok(hres == E_UNEXPECTED, "InitNew failed: %08lx, expected E_UNEXPECTED\n", hres);
hres = IActiveScript_SetScriptSite(script, NULL); - ok(hres == E_POINTER, "SetScriptSite failed: %08x, expected E_POINTER\n", hres); + ok(hres == E_POINTER, "SetScriptSite failed: %08lx, expected E_POINTER\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED); test_no_script_dispatch(script); @@ -731,28 +731,28 @@ static void test_jscript(void) SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED);
test_state(script, SCRIPTSTATE_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres); + ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08lx, expected E_UNEXPECTED\n", hres);
dispex = get_script_dispatch(script, NULL); test_script_dispatch(dispex);
SET_EXPECT(OnStateChange_STARTED); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_STARTED);
test_state(script, SCRIPTSTATE_STARTED);
SET_EXPECT(OnStateChange_CLOSED); hres = IActiveScript_Close(script); - ok(hres == S_OK, "Close failed: %08x\n", hres); + ok(hres == S_OK, "Close failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_CLOSED);
test_state(script, SCRIPTSTATE_CLOSED); @@ -763,7 +763,7 @@ static void test_jscript(void) IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script); - ok(!ref, "ref = %d\n", ref); + ok(!ref, "ref = %ld\n", ref); }
static void test_jscript2(void) @@ -776,28 +776,28 @@ static void test_jscript2(void) script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
SET_EXPECT(GetLCID); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres); CHECK_CALLED(GetLCID);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
SET_EXPECT(OnStateChange_INITIALIZED); hres = IActiveScriptParse_InitNew(parse); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_INITIALIZED);
hres = IActiveScriptParse_InitNew(parse); - ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n", hres); + ok(hres == E_UNEXPECTED, "InitNew failed: %08lx, expected E_UNEXPECTED\n", hres);
SET_EXPECT(OnStateChange_CONNECTED); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_CONNECTED);
test_state(script, SCRIPTSTATE_CONNECTED); @@ -806,7 +806,7 @@ static void test_jscript2(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_CLOSED); hres = IActiveScript_Close(script); - ok(hres == S_OK, "Close failed: %08x\n", hres); + ok(hres == S_OK, "Close failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_CLOSED); @@ -817,7 +817,7 @@ static void test_jscript2(void) IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script); - ok(!ref, "ref = %d\n", ref); + ok(!ref, "ref = %ld\n", ref); }
static void test_jscript_uninitializing(void) @@ -831,42 +831,42 @@ static void test_jscript_uninitializing(void) script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hres = IActiveScriptParse_InitNew(parse); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED);
test_state(script, SCRIPTSTATE_INITIALIZED);
hres = IActiveScriptParse_ParseScriptText(parse, L"function f() {}", NULL, NULL, NULL, 0, 1, 0x42, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres); + ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08lx, expected E_UNEXPECTED\n", hres);
SET_EXPECT(OnStateChange_UNINITIALIZED); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_UNINITIALIZED);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres);
SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED);
@@ -874,7 +874,7 @@ static void test_jscript_uninitializing(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_CONNECTED); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -889,7 +889,7 @@ static void test_jscript_uninitializing(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_UNINITIALIZED); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_UNINITIALIZED); @@ -897,19 +897,19 @@ static void test_jscript_uninitializing(void) test_state(script, SCRIPTSTATE_UNINITIALIZED);
hres = IActiveScript_Close(script); - ok(hres == S_OK, "Close failed: %08x\n", hres); + ok(hres == S_OK, "Close failed: %08lx\n", hres);
test_state(script, SCRIPTSTATE_CLOSED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x, expected E_UNEXPECTED\n", hres); + ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx, expected E_UNEXPECTED\n", hres);
test_state(script, SCRIPTSTATE_CLOSED);
IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script); - ok(!ref, "ref = %d\n", ref); + ok(!ref, "ref = %ld\n", ref); }
static void test_aggregation(void) @@ -920,7 +920,7 @@ static void test_aggregation(void) hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void**)&unk); ok(hres == CLASS_E_NOAGGREGATION, - "CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres); + "CoCreateInstance failed: %08lx, expected CLASS_E_NOAGGREGATION\n", hres); ok(!unk || broken(unk != NULL), "unk = %p\n", unk); }
@@ -938,43 +938,43 @@ static void test_param_ids(void) script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); - ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hr); + ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08lx\n", hr);
SET_EXPECT(GetLCID); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScriptParse_InitNew(parser); - ok(hr == S_OK, "InitNew failed: %08x\n", hr); + ok(hr == S_OK, "InitNew failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED);
parse_script(parser, L"function test(a, b, c, foo) { return a + b + c - foo; }\nfunction bar() { }"); disp = get_script_dispatch(script, NULL);
hr = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, (WCHAR**)names1, ARRAY_SIZE(names1), 0, id); - ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08x, expected %08x\n", hr, DISP_E_UNKNOWNNAME); - ok(id[0] > 0, "Unexpected DISPID for "test": %d\n", id[0]); - ok(id[4] == DISPID_UNKNOWN, "Unexpected DISPID for "a" parameter: %d\n", id[4]); - ok(id[3] == DISPID_UNKNOWN, "Unexpected DISPID for "b" parameter: %d\n", id[3]); - ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for "c" parameter: %d\n", id[1]); - ok(id[2] == DISPID_UNKNOWN, "Unexpected DISPID for "foo" parameter: %d\n", id[2]); + ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08lx, expected %08lx\n", hr, DISP_E_UNKNOWNNAME); + ok(id[0] > 0, "Unexpected DISPID for "test": %ld\n", id[0]); + ok(id[4] == DISPID_UNKNOWN, "Unexpected DISPID for "a" parameter: %ld\n", id[4]); + ok(id[3] == DISPID_UNKNOWN, "Unexpected DISPID for "b" parameter: %ld\n", id[3]); + ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for "c" parameter: %ld\n", id[1]); + ok(id[2] == DISPID_UNKNOWN, "Unexpected DISPID for "foo" parameter: %ld\n", id[2]);
hr = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, (WCHAR**)names2, ARRAY_SIZE(names2), 0, id); - ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08x, expected %08x\n", hr, DISP_E_UNKNOWNNAME); - ok(id[0] > 0, "Unexpected DISPID for "test": %d\n", id[0]); - ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for "bar": %d\n", id[1]); + ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08lx, expected %08lx\n", hr, DISP_E_UNKNOWNNAME); + ok(id[0] > 0, "Unexpected DISPID for "test": %ld\n", id[0]); + ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for "bar": %ld\n", id[1]);
hr = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, (WCHAR**)names3, ARRAY_SIZE(names3), 0, id); - ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08x, expected %08x\n", hr, DISP_E_UNKNOWNNAME); - ok(id[0] > 0, "Unexpected DISPID for "bar": %d\n", id[0]); - ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for "test": %d\n", id[1]); + ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08lx, expected %08lx\n", hr, DISP_E_UNKNOWNNAME); + ok(id[0] > 0, "Unexpected DISPID for "bar": %ld\n", id[0]); + ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for "test": %ld\n", id[1]);
IDispatchEx_Release(disp); IActiveScriptParse_Release(parser); @@ -983,7 +983,7 @@ static void test_param_ids(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_CLOSED); hr = IActiveScript_Close(script); - ok(hr == S_OK, "Close failed: %08x\n", hr); + ok(hr == S_OK, "Close failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_CLOSED); @@ -1004,18 +1004,18 @@ static void test_code_persistence(void) script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); - ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hr); + ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08lx\n", hr); test_state(script, SCRIPTSTATE_UNINITIALIZED); test_safety((IUnknown*)script);
SET_EXPECT(GetLCID); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScriptParse_InitNew(parse); - ok(hr == S_OK, "InitNew failed: %08x\n", hr); + ok(hr == S_OK, "InitNew failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_INITIALIZED); test_state(script, SCRIPTSTATE_INITIALIZED);
@@ -1023,50 +1023,50 @@ static void test_code_persistence(void) L"var x = 1;\n" L"var y = 2;\n", NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
hr = IActiveScriptParse_ParseScriptText(parse, L"var z = 3;\n" L"var y = 42;\n" L"var v = 10;\n", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
/* Pending code does not add identifiers to the global scope */ dispex = get_script_dispatch(script, NULL); id = 0; get_disp_id(dispex, L"x", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); id = 0; get_disp_id(dispex, L"y", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); id = 0; get_disp_id(dispex, L"z", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); IDispatchEx_Release(dispex);
/* Uninitialized state removes code without SCRIPTTEXT_ISPERSISTENT */ SET_EXPECT(OnStateChange_UNINITIALIZED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_UNINITIALIZED); test_no_script_dispatch(script);
SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_ParseScriptText(parse, L"v = 20;\n", NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
SET_EXPECT(OnStateChange_CONNECTED); SET_EXPECT_MULTI(OnEnterScript, 2); SET_EXPECT_MULTI(OnLeaveScript, 2); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED); CHECK_CALLED_MULTI(OnEnterScript, 2); CHECK_CALLED_MULTI(OnLeaveScript, 2); @@ -1075,7 +1075,7 @@ static void test_code_persistence(void) dispex = get_script_dispatch(script, NULL); id = 0; get_disp_id(dispex, L"x", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); id = 0; get_disp_id(dispex, L"y", S_OK, &id); ok(id != -1, "id = -1\n"); @@ -1087,7 +1087,7 @@ static void test_code_persistence(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"y", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_I4 && V_I2(&var) == 42, "V_VT(y) = %d, V_I2(y) = %d\n", V_VT(&var), V_I2(&var)); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -1095,7 +1095,7 @@ static void test_code_persistence(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"v", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_I4 && V_I2(&var) == 20, "V_VT(var) = %d, V_I2(var) = %d\n", V_VT(&var), V_I2(&var)); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -1105,7 +1105,7 @@ static void test_code_persistence(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_UNINITIALIZED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_UNINITIALIZED); @@ -1114,21 +1114,21 @@ static void test_code_persistence(void) SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED);
dispex = get_script_dispatch(script, NULL); id = 0; get_disp_id(dispex, L"z", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); IDispatchEx_Release(dispex);
SET_EXPECT(OnStateChange_CONNECTED); SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -1143,7 +1143,7 @@ static void test_code_persistence(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"y", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_I4 && V_I2(&var) == 42, "V_VT(y) = %d, V_I2(y) = %d\n", V_VT(&var), V_I2(&var)); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -1151,7 +1151,7 @@ static void test_code_persistence(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"v", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_I4 && V_I2(&var) == 10, "V_VT(var) = %d, V_I2(var) = %d\n", V_VT(&var), V_I2(&var)); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); @@ -1160,7 +1160,7 @@ static void test_code_persistence(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_UNINITIALIZED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_UNINITIALIZED); @@ -1168,17 +1168,17 @@ static void test_code_persistence(void) SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_ParseScriptText(parse, L"y = 2;\n", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
/* Closing the script engine removes all code (even if it's pending and persistent) */ SET_EXPECT(OnStateChange_CLOSED); hr = IActiveScript_Close(script); - ok(hr == S_OK, "Close failed: %08x\n", hr); + ok(hr == S_OK, "Close failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CLOSED); test_state(script, SCRIPTSTATE_CLOSED); test_no_script_dispatch(script); @@ -1186,24 +1186,24 @@ static void test_code_persistence(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(GetLCID); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(GetLCID); test_state(script, SCRIPTSTATE_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED); test_state(script, SCRIPTSTATE_CONNECTED);
dispex = get_script_dispatch(script, NULL); id = 0; get_disp_id(dispex, L"y", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); id = 0; get_disp_id(dispex, L"z", DISP_E_UNKNOWNNAME, &id); - ok(id == -1, "id = %d, expected -1\n", id); + ok(id == -1, "id = %ld, expected -1\n", id); IDispatchEx_Release(dispex);
IActiveScriptParse_Release(parse); @@ -1212,7 +1212,7 @@ static void test_code_persistence(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_CLOSED); ref = IActiveScript_Release(script); - ok(!ref, "ref = %d\n", ref); + ok(!ref, "ref = %ld\n", ref); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_CLOSED); @@ -1270,51 +1270,51 @@ static void test_named_items(void) script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); - ok(hr == S_OK, "Could not get IActiveScriptParse: %08x\n", hr); + ok(hr == S_OK, "Could not get IActiveScriptParse: %08lx\n", hr);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hr = IActiveScript_AddNamedItem(script, L"visibleItem", SCRIPTITEM_ISVISIBLE); - ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr); + ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr); hr = IActiveScript_AddNamedItem(script, L"globalItem", SCRIPTITEM_GLOBALMEMBERS); - ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr); + ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr); hr = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY); - ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr); + ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr); hr = IActiveScript_AddNamedItem(script, L"persistent", SCRIPTITEM_ISPERSISTENT | SCRIPTITEM_CODEONLY); - ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr); + ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr);
SET_EXPECT(GetLCID); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID);
SET_EXPECT(GetItemInfo_global); hr = IActiveScript_AddNamedItem(script, L"globalItem", SCRIPTITEM_GLOBALMEMBERS); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr); CHECK_CALLED(GetItemInfo_global);
hr = IActiveScript_AddNamedItem(script, L"visibleItem", SCRIPTITEM_ISVISIBLE); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr); hr = IActiveScript_AddNamedItem(script, L"visibleCodeItem", SCRIPTITEM_ISVISIBLE | SCRIPTITEM_CODEONLY); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr); hr = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr); hr = IActiveScript_AddNamedItem(script, L"persistent", SCRIPTITEM_ISPERSISTENT | SCRIPTITEM_CODEONLY); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
- ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref); - ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); - ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); - ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); + ok(global_named_item_ref > 0, "global_named_item_ref = %lu\n", global_named_item_ref); + ok(visible_named_item_ref == 0, "visible_named_item_ref = %lu\n", visible_named_item_ref); + ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
hr = IActiveScript_GetScriptDispatch(script, L"noContext", &disp); - ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08lx\n", hr); hr = IActiveScript_GetScriptDispatch(script, L"codeONLYItem", &disp); - ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08lx\n", hr);
SET_EXPECT(GetItemInfo_global_code); hr = IActiveScript_AddNamedItem(script, L"globalCodeItem", SCRIPTITEM_GLOBALMEMBERS | SCRIPTITEM_CODEONLY); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr); CHECK_CALLED(GetItemInfo_global_code);
dispex = get_script_dispatch(script, NULL); @@ -1329,12 +1329,12 @@ static void test_named_items(void)
SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScriptParse_InitNew(parse); - ok(hr == S_OK, "InitNew failed: %08x\n", hr); + ok(hr == S_OK, "InitNew failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED);
SET_EXPECT(testCall); @@ -1351,7 +1351,7 @@ static void test_named_items(void) SET_EXPECT(OnLeaveScript); SET_EXPECT(testCall); hr = IActiveScriptParse_ParseScriptText(parse, L"testCall();", L"visibleCodeItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); CHECK_CALLED(testCall); @@ -1361,18 +1361,18 @@ static void test_named_items(void) SET_EXPECT(OnScriptError); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"codeOnlyItem();", L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(FAILED(hr), "ParseScriptText returned: %08x\n", hr); + ok(FAILED(hr), "ParseScriptText returned: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(GetIDsOfNames); CHECK_CALLED(OnScriptError); CHECK_CALLED(OnLeaveScript);
hr = IActiveScript_GetScriptDispatch(script, L"visibleCodeItem", &disp); - ok(hr == S_OK, "GetScriptDispatch returned: %08x\n", hr); + ok(hr == S_OK, "GetScriptDispatch returned: %08lx\n", hr); SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"visibleCodeItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == disp, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1386,17 +1386,17 @@ static void test_named_items(void) CHECK_CALLED(GetItemInfo_visible_code); CHECK_CALLED(testCall);
- ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref); - ok(visible_named_item_ref > 0, "visible_named_item_ref = %u\n", visible_named_item_ref); - ok(visible_code_named_item_ref > 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); - ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); + ok(global_named_item_ref > 0, "global_named_item_ref = %lu\n", global_named_item_ref); + ok(visible_named_item_ref > 0, "visible_named_item_ref = %lu\n", visible_named_item_ref); + ok(visible_code_named_item_ref > 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
SET_EXPECT(testCall); parse_script(parse, L"visibleItem.testCall();"); CHECK_CALLED(testCall);
hr = IActiveScriptParse_ParseScriptText(parse, L"function testFunc() { }", L"CodeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == E_INVALIDARG, "ParseScriptText returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "ParseScriptText returned: %08lx\n", hr);
SET_EXPECT(OnEnterScript); SET_EXPECT(GetIDsOfNames); @@ -1408,7 +1408,7 @@ static void test_named_items(void) "var testVar_global = 10;\n" "function testClassFunc() { this.x = 10; }\n", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(GetIDsOfNames); CHECK_CALLED(OnLeaveScript); @@ -1416,7 +1416,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"function testFunc() { }\n", L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
@@ -1427,7 +1427,7 @@ static void test_named_items(void) "testVar_global = 5;\n" "var testFuncConstr = new Function("return testVar;");\n", L"codeOnlyItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
@@ -1435,7 +1435,7 @@ static void test_named_items(void) SET_EXPECT(GetIDsOfNames_visible); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"var abc;\n", L"visibleItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(GetIDsOfNames_visible); CHECK_CALLED(OnLeaveScript); @@ -1443,14 +1443,14 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"abc = 5;\n", L"visibleItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); SET_EXPECT(OnEnterScript); SET_EXPECT(GetIDsOfNames_visible); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"testVar_global = 5;\n", L"visibleItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(GetIDsOfNames_visible); CHECK_CALLED(OnLeaveScript); @@ -1458,21 +1458,21 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"var abc; testVar_global = 5;\n", L"visibleCodeItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"global_this = this;\n", L"globalItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"globalCode_this = this;\n", L"globalCodeItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
@@ -1481,13 +1481,13 @@ static void test_named_items(void) bstr = SysAllocString(global_idents[i]); id = 0; hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - ok(hr == S_OK, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr); + ok(hr == S_OK, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr); ok(id != -1, "[%s] id = -1\n", wine_dbgstr_w(global_idents[i]));
id = 0; hr = IDispatchEx_GetDispID(dispex2, bstr, 0, &id); - ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr); - ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(global_idents[i]), id); + ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr); + ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(global_idents[i]), id); SysFreeString(bstr); }
@@ -1496,11 +1496,11 @@ static void test_named_items(void) bstr = SysAllocString(context_idents[i]); id = 0; hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr); - ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(context_idents[i]), id); + ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr); + ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(context_idents[i]), id); id = 0; hr = IDispatchEx_GetDispID(dispex2, bstr, 0, &id); - ok(hr == S_OK, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr); + ok(hr == S_OK, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr); ok(id != -1, "[%s] id = -1\n", wine_dbgstr_w(context_idents[i])); SysFreeString(bstr); } @@ -1510,7 +1510,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr); + ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
@@ -1518,7 +1518,7 @@ static void test_named_items(void) SET_EXPECT(GetIDsOfNames); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr); + ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); } @@ -1530,7 +1530,7 @@ static void test_named_items(void) SET_EXPECT(OnScriptError); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(FAILED(hr), "ParseScriptText(%s) returned: %08x\n", wine_dbgstr_w(context_code_test[i]), hr); + ok(FAILED(hr), "ParseScriptText(%s) returned: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(GetIDsOfNames); CHECK_CALLED(OnScriptError); @@ -1539,7 +1539,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(context_code_test[i]), hr); + ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); } @@ -1547,7 +1547,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &global_named_item, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1557,7 +1557,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"visibleItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &visible_named_item, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1567,7 +1567,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"codeOnlyItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex2, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1577,7 +1577,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"globalCode_this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &global_named_item, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1591,7 +1591,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1602,20 +1602,20 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"var x = 13;\n", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"x = 10;\n", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"x", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); - ok(V_VT(&var) == VT_I4 && V_I4(&var) == 10, "Unexpected 'x': V_VT = %d, V_I4 = %d\n", V_VT(&var), V_I4(&var)); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); + ok(V_VT(&var) == VT_I4 && V_I4(&var) == 10, "Unexpected 'x': V_VT = %d, V_I4 = %ld\n", V_VT(&var), V_I4(&var)); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
@@ -1627,39 +1627,39 @@ static void test_named_items(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_UNINITIALIZED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_UNINITIALIZED); test_no_script_dispatch(script);
- ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref); - ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); - ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); - ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); + ok(global_named_item_ref == 0, "global_named_item_ref = %lu\n", global_named_item_ref); + ok(visible_named_item_ref == 0, "visible_named_item_ref = %lu\n", visible_named_item_ref); + ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
hr = IActiveScript_GetScriptDispatch(script, L"codeOnlyItem", &disp); - ok(hr == E_UNEXPECTED, "hr = %08x, expected E_UNEXPECTED\n", hr); + ok(hr == E_UNEXPECTED, "hr = %08lx, expected E_UNEXPECTED\n", hr);
SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(GetItemInfo_persistent); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(GetItemInfo_persistent); - ok(persistent_named_item_ref > 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); + ok(persistent_named_item_ref > 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
hr = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY); - ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr); + ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
SET_EXPECT(OnStateChange_CONNECTED); SET_EXPECT_MULTI(OnEnterScript, 5); SET_EXPECT_MULTI(OnLeaveScript, 5); SET_EXPECT(GetIDsOfNames_persistent); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED); CHECK_CALLED_MULTI(OnEnterScript, 5); CHECK_CALLED_MULTI(OnLeaveScript, 5); @@ -1673,8 +1673,8 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"x", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); - ok(V_VT(&var) == VT_I4 && V_I4(&var) == 13, "Unexpected 'x': V_VT = %d, V_I4 = %d\n", V_VT(&var), V_I4(&var)); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); + ok(V_VT(&var) == VT_I4 && V_I4(&var) == 13, "Unexpected 'x': V_VT = %d, V_I4 = %ld\n", V_VT(&var), V_I4(&var)); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript);
@@ -1682,7 +1682,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &persistent_named_item, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1694,7 +1694,7 @@ static void test_named_items(void) SET_EXPECT(OnLeaveScript); SET_EXPECT(GetIDsOfNames_persistent); hr = IActiveScriptParse_ParseScriptText(parse, L"var abc123;", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); CHECK_CALLED(GetIDsOfNames_persistent); @@ -1704,7 +1704,7 @@ static void test_named_items(void) SET_EXPECT(GetIDsOfNames_persistent); SET_EXPECT(OnScriptError); hr = IActiveScriptParse_ParseScriptText(parse, L"testCall();", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(FAILED(hr), "ParseScriptText returned: %08x\n", hr); + ok(FAILED(hr), "ParseScriptText returned: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); CHECK_CALLED(GetIDsOfNames_persistent); @@ -1716,7 +1716,7 @@ static void test_named_items(void) bstr = SysAllocString(global_idents[i]); id = 0; hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - ok(hr == S_OK, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr); + ok(hr == S_OK, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr); ok(id != -1, "[%s] id = -1\n", wine_dbgstr_w(global_idents[i])); SysFreeString(bstr); } @@ -1726,15 +1726,15 @@ static void test_named_items(void) bstr = SysAllocString(context_idents[i]); id = 0; hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr); - ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(context_idents[i]), id); + ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr); + ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(context_idents[i]), id); SysFreeString(bstr); }
SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"global_this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1744,7 +1744,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"globalCode_this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex, "Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var)); VariantClear(&var); @@ -1754,7 +1754,7 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, L"global_this = 0; globalCode_this = 0;\n", NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr); + ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); IDispatchEx_Release(dispex); @@ -1765,8 +1765,8 @@ static void test_named_items(void) bstr = SysAllocString(global_idents[i]); id = 0; hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr); - ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(global_idents[i]), id); + ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr); + ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(global_idents[i]), id); SysFreeString(bstr); }
@@ -1775,8 +1775,8 @@ static void test_named_items(void) bstr = SysAllocString(context_idents[i]); id = 0; hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id); - ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr); - ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(context_idents[i]), id); + ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr); + ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(context_idents[i]), id); SysFreeString(bstr); } IDispatchEx_Release(dispex); @@ -1786,13 +1786,13 @@ static void test_named_items(void) SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr); + ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr); + ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); } @@ -1803,7 +1803,7 @@ static void test_named_items(void) SET_EXPECT(OnScriptError); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(FAILED(hr), "ParseScriptText(%s) returned: %08x\n", wine_dbgstr_w(context_code_test[i]), hr); + ok(FAILED(hr), "ParseScriptText(%s) returned: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnScriptError); CHECK_CALLED(OnLeaveScript); @@ -1812,7 +1812,7 @@ static void test_named_items(void) SET_EXPECT(OnScriptError); SET_EXPECT(OnLeaveScript); hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL); - ok(FAILED(hr), "ParseScriptText(%s) returned: %08x\n", wine_dbgstr_w(context_code_test[i]), hr); + ok(FAILED(hr), "ParseScriptText(%s) returned: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr); CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnScriptError); CHECK_CALLED(OnLeaveScript); @@ -1822,21 +1822,21 @@ static void test_named_items(void) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_CLOSED); hr = IActiveScript_Close(script); - ok(hr == S_OK, "Close failed: %08x\n", hr); + ok(hr == S_OK, "Close failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_CLOSED);
- ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref); - ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); - ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); - ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); + ok(global_named_item_ref == 0, "global_named_item_ref = %lu\n", global_named_item_ref); + ok(visible_named_item_ref == 0, "visible_named_item_ref = %lu\n", visible_named_item_ref); + ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
test_state(script, SCRIPTSTATE_CLOSED); IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script); - ok(!ref, "ref = %d\n", ref); + ok(!ref, "ref = %ld\n", ref); }
static void test_typeinfo(const WCHAR *parse_func_name) @@ -1919,21 +1919,21 @@ static void test_typeinfo(const WCHAR *parse_func_name) script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); - ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hr); + ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08lx\n", hr);
SET_EXPECT(GetLCID); hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite); - ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr); CHECK_CALLED(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED); hr = IActiveScriptParse_InitNew(parser); - ok(hr == S_OK, "InitNew failed: %08x\n", hr); + ok(hr == S_OK, "InitNew failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED); hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); - ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr); + ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_CONNECTED);
if (parse_func_name) @@ -1942,15 +1942,15 @@ static void test_typeinfo(const WCHAR *parse_func_name) IDispatch *proc_disp;
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc); - ok(hr == S_OK, "Could not get IActiveScriptParse: %08x\n", hr); + ok(hr == S_OK, "Could not get IActiveScriptParse: %08lx\n", hr);
hr = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, source, NULL, parse_func_name, NULL, NULL, NULL, 0, 0, SCRIPTPROC_IMPLICIT_THIS | SCRIPTPROC_IMPLICIT_PARENTS, &proc_disp); - ok(hr == S_OK, "ParseProcedureText failed: %08x\n", hr); + ok(hr == S_OK, "ParseProcedureText failed: %08lx\n", hr); IActiveScriptParseProcedure2_Release(parse_proc);
hr = IDispatch_QueryInterface(proc_disp, &IID_IDispatchEx, (void**)&disp); - ok(hr == S_OK, "Could not get IDispatchEx: %08x\n", hr); + ok(hr == S_OK, "Could not get IDispatchEx: %08lx\n", hr); IDispatch_Release(proc_disp); } else @@ -1960,37 +1960,37 @@ static void test_typeinfo(const WCHAR *parse_func_name) }
hr = IDispatchEx_QueryInterface(disp, &IID_ITypeInfo, (void**)&typeinfo); - ok(hr == E_NOINTERFACE, "QueryInterface(IID_ITypeInfo) returned: %08x\n", hr); + ok(hr == E_NOINTERFACE, "QueryInterface(IID_ITypeInfo) returned: %08lx\n", hr); hr = IDispatchEx_GetTypeInfo(disp, 1, LOCALE_USER_DEFAULT, &typeinfo); - ok(hr == DISP_E_BADINDEX, "GetTypeInfo returned: %08x\n", hr); + ok(hr == DISP_E_BADINDEX, "GetTypeInfo returned: %08lx\n", hr); hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo); - ok(hr == S_OK, "GetTypeInfo failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeInfo failed: %08lx\n", hr); hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo2); - ok(hr == S_OK, "GetTypeInfo failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeInfo failed: %08lx\n", hr); ok(typeinfo != typeinfo2, "TypeInfo was not supposed to be shared.\n"); ITypeInfo_Release(typeinfo2);
obj = (void*)0xdeadbeef; hr = ITypeInfo_CreateInstance(typeinfo, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "CreateInstance returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "CreateInstance returned: %08lx\n", hr); hr = ITypeInfo_CreateInstance(typeinfo, NULL, NULL, &obj); - ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08x\n", hr); + ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08lx\n", hr); hr = ITypeInfo_CreateInstance(typeinfo, NULL, &IID_IDispatch, &obj); - ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08x\n", hr); + ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08lx\n", hr); ok(!obj, "Unexpected non-null obj %p.\n", obj);
hr = ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &bstr, NULL, NULL, NULL); - ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08x\n", hr); + ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08lx\n", hr); ok(!lstrcmpW(bstr, L"JScriptTypeInfo"), "Unexpected TypeInfo name %s\n", wine_dbgstr_w(bstr)); SysFreeString(bstr);
hr = ITypeInfo_GetTypeAttr(typeinfo, &attr); - ok(hr == S_OK, "GetTypeAttr failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeAttr failed: %08lx\n", hr); ok(IsEqualGUID(&attr->guid, &IID_IScriptTypeInfo), "Unexpected GUID %s\n", wine_dbgstr_guid(&attr->guid)); - ok(attr->lcid == LOCALE_USER_DEFAULT, "Unexpected LCID %u\n", attr->lcid); - ok(attr->memidConstructor == MEMBERID_NIL, "Unexpected constructor memid %u\n", attr->memidConstructor); - ok(attr->memidDestructor == MEMBERID_NIL, "Unexpected destructor memid %u\n", attr->memidDestructor); - ok(attr->cbSizeInstance == 4, "Unexpected cbSizeInstance %u\n", attr->cbSizeInstance); + ok(attr->lcid == LOCALE_USER_DEFAULT, "Unexpected LCID %lu\n", attr->lcid); + ok(attr->memidConstructor == MEMBERID_NIL, "Unexpected constructor memid %lu\n", attr->memidConstructor); + ok(attr->memidDestructor == MEMBERID_NIL, "Unexpected destructor memid %lu\n", attr->memidDestructor); + ok(attr->cbSizeInstance == 4, "Unexpected cbSizeInstance %lu\n", attr->cbSizeInstance); ok(attr->typekind == TKIND_DISPATCH, "Unexpected typekind %u\n", attr->typekind); ok(attr->cFuncs == expected_funcs_cnt, "Unexpected cFuncs %u\n", attr->cFuncs); ok(attr->cVars == expected_vars_cnt, "Unexpected cVars %u\n", attr->cVars); @@ -2004,39 +2004,39 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* The type inherits from IDispatch */ hr = ITypeInfo_GetImplTypeFlags(typeinfo, 0, NULL); - ok(hr == E_INVALIDARG, "GetImplTypeFlags returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetImplTypeFlags returned: %08lx\n", hr); hr = ITypeInfo_GetImplTypeFlags(typeinfo, 1, &implTypeFlags); - ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08x\n", hr); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08lx\n", hr); hr = ITypeInfo_GetImplTypeFlags(typeinfo, -1, &implTypeFlags); - ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08x\n", hr); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08lx\n", hr); hr = ITypeInfo_GetImplTypeFlags(typeinfo, 0, &implTypeFlags); - ok(hr == S_OK, "GetImplTypeFlags failed: %08x\n", hr); + ok(hr == S_OK, "GetImplTypeFlags failed: %08lx\n", hr); ok(implTypeFlags == 0, "Unexpected implTypeFlags 0x%x\n", implTypeFlags);
hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 0, NULL); - ok(hr == E_INVALIDARG, "GetRefTypeOfImplType returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetRefTypeOfImplType returned: %08lx\n", hr); hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 1, &reftype); - ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType returned: %08x\n", hr); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType returned: %08lx\n", hr); hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, -1, &reftype); - ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType failed: %08x\n", hr); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType failed: %08lx\n", hr); hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 0, &reftype); - ok(hr == S_OK, "GetRefTypeOfImplType failed: %08x\n", hr); - ok(reftype == 1, "Unexpected reftype %d\n", reftype); + ok(hr == S_OK, "GetRefTypeOfImplType failed: %08lx\n", hr); + ok(reftype == 1, "Unexpected reftype %ld\n", reftype);
hr = ITypeInfo_GetRefTypeInfo(typeinfo, reftype, NULL); - ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08lx\n", hr); hr = ITypeInfo_GetRefTypeInfo(typeinfo, -1, &typeinfo2); - ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08lx\n", hr); hr = ITypeInfo_GetRefTypeInfo(typeinfo, 4, &typeinfo2); - ok(hr == E_FAIL, "GetRefTypeInfo returned: %08x\n", hr); + ok(hr == E_FAIL, "GetRefTypeInfo returned: %08lx\n", hr); hr = ITypeInfo_GetRefTypeInfo(typeinfo, 0, &typeinfo2); - ok(hr == S_OK, "GetRefTypeInfo failed: %08x\n", hr); + ok(hr == S_OK, "GetRefTypeInfo failed: %08lx\n", hr); ok(typeinfo == typeinfo2, "Unexpected TypeInfo %p (expected %p)\n", typeinfo2, typeinfo); ITypeInfo_Release(typeinfo2); hr = ITypeInfo_GetRefTypeInfo(typeinfo, reftype, &typeinfo2); - ok(hr == S_OK, "GetRefTypeInfo failed: %08x\n", hr); + ok(hr == S_OK, "GetRefTypeInfo failed: %08lx\n", hr); hr = ITypeInfo_GetDocumentation(typeinfo2, MEMBERID_NIL, &bstr, NULL, NULL, NULL); - ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08x\n", hr); + ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08lx\n", hr); ok(!lstrcmpW(bstr, L"IDispatch"), "Unexpected TypeInfo name %s\n", wine_dbgstr_w(bstr)); ITypeInfo_Release(typeinfo2); SysFreeString(bstr); @@ -2044,29 +2044,29 @@ static void test_typeinfo(const WCHAR *parse_func_name) /* GetIDsOfNames looks into the inherited types as well */ wcscpy(str, L"queryinterface"); hr = ITypeInfo_GetIDsOfNames(typeinfo, NULL, 1, &memid); - ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08lx\n", hr); hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, NULL); - ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08lx\n", hr); hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 0, &memid); - ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08lx\n", hr); hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, &memid); - ok(hr == S_OK, "GetIDsOfNames failed: %08x\n", hr); + ok(hr == S_OK, "GetIDsOfNames failed: %08lx\n", hr); ok(!lstrcmpW(str, L"queryinterface"), "Unexpected string %s\n", wine_dbgstr_w(str)); if (expected_funcs_cnt) { wcscpy(str, L"Math"); hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, &memid); - ok(hr == S_OK, "GetIDsOfNames failed: %08x\n", hr); + ok(hr == S_OK, "GetIDsOfNames failed: %08lx\n", hr); ok(!lstrcmpW(str, L"Math"), "Unexpected string %s\n", wine_dbgstr_w(str)); hr = ITypeInfo_GetNames(typeinfo, memid, NULL, 1, &count); - ok(hr == E_INVALIDARG, "GetNames returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetNames returned: %08lx\n", hr); hr = ITypeInfo_GetNames(typeinfo, memid, bstrs, 1, NULL); - ok(hr == E_INVALIDARG, "GetNames returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetNames returned: %08lx\n", hr); hr = ITypeInfo_GetNames(typeinfo, memid, bstrs, 0, &count); - ok(hr == S_OK, "GetNames failed: %08x\n", hr); + ok(hr == S_OK, "GetNames failed: %08lx\n", hr); ok(count == 0, "Unexpected count %u\n", count); hr = ITypeInfo_GetNames(typeinfo, memid, bstrs, ARRAY_SIZE(bstrs), &count); - ok(hr == S_OK, "GetNames failed: %08x\n", hr); + ok(hr == S_OK, "GetNames failed: %08lx\n", hr); ok(count == 3, "Unexpected count %u\n", count); ok(!lstrcmpW(bstrs[0], L"math"), "Unexpected function name %s\n", wine_dbgstr_w(bstrs[0])); ok(!lstrcmpW(bstrs[1], L"x"), "Unexpected function first param name %s\n", wine_dbgstr_w(bstrs[1])); @@ -2074,56 +2074,56 @@ static void test_typeinfo(const WCHAR *parse_func_name) for (i = 0; i < count; i++) SysFreeString(bstrs[i]);
hr = ITypeInfo_GetMops(typeinfo, memid, NULL); - ok(hr == E_INVALIDARG, "GetMops returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetMops returned: %08lx\n", hr); hr = ITypeInfo_GetMops(typeinfo, memid, &bstr); - ok(hr == S_OK, "GetMops failed: %08x\n", hr); + ok(hr == S_OK, "GetMops failed: %08lx\n", hr); ok(!bstr, "Unexpected non-null string %s\n", wine_dbgstr_w(bstr)); hr = ITypeInfo_GetMops(typeinfo, MEMBERID_NIL, &bstr); - ok(hr == S_OK, "GetMops failed: %08x\n", hr); + ok(hr == S_OK, "GetMops failed: %08lx\n", hr); ok(!bstr, "Unexpected non-null string %s\n", wine_dbgstr_w(bstr));
/* These always fail */ obj = (void*)0xdeadbeef; hr = ITypeInfo_AddressOfMember(typeinfo, memid, INVOKE_FUNC, NULL); - ok(hr == E_INVALIDARG, "AddressOfMember returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "AddressOfMember returned: %08lx\n", hr); hr = ITypeInfo_AddressOfMember(typeinfo, memid, INVOKE_FUNC, &obj); - ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08x\n", hr); + ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08lx\n", hr); ok(!obj, "Unexpected non-null obj %p.\n", obj); bstr = (BSTR)0xdeadbeef; hr = ITypeInfo_GetDllEntry(typeinfo, memid, INVOKE_FUNC, &bstr, NULL, NULL); - ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08x\n", hr); + ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08lx\n", hr); ok(!bstr, "Unexpected non-null str %p.\n", bstr); wcscpy(str, L"Invoke"); hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, &memid); - ok(hr == S_OK, "GetIDsOfNames failed: %08x\n", hr); + ok(hr == S_OK, "GetIDsOfNames failed: %08lx\n", hr); obj = (void*)0xdeadbeef; hr = ITypeInfo_AddressOfMember(typeinfo, memid, INVOKE_FUNC, &obj); - ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08x\n", hr); + ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08lx\n", hr); ok(!obj, "Unexpected non-null obj %p.\n", obj); bstr = (BSTR)0xdeadbeef; hr = ITypeInfo_GetDllEntry(typeinfo, memid, INVOKE_FUNC, &bstr, NULL, NULL); - ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08x\n", hr); + ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08lx\n", hr); ok(!bstr, "Unexpected non-null str %p.\n", bstr); }
/* Check variable descriptions */ hr = ITypeInfo_GetVarDesc(typeinfo, 0, NULL); - ok(hr == E_INVALIDARG, "GetVarDesc returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetVarDesc returned: %08lx\n", hr); hr = ITypeInfo_GetVarDesc(typeinfo, 1337, &vardesc); - ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetVarDesc returned: %08x\n", hr); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetVarDesc returned: %08lx\n", hr); for (i = 0; i < expected_vars_cnt; i++) { hr = ITypeInfo_GetVarDesc(typeinfo, i, &vardesc); - ok(hr == S_OK, "GetVarDesc(%u) failed: %08x\n", i, hr); + ok(hr == S_OK, "GetVarDesc(%u) failed: %08lx\n", i, hr); hr = ITypeInfo_GetDocumentation(typeinfo, vardesc->memid, &bstr, &bstrs[0], NULL, NULL); - ok(hr == S_OK, "[%u] GetDocumentation failed: %08x\n", i, hr); + ok(hr == S_OK, "[%u] GetDocumentation failed: %08lx\n", i, hr); ok(!lstrcmpW(bstr, var[i].name), "[%u] Unexpected variable name %s (expected %s)\n", i, wine_dbgstr_w(bstr), wine_dbgstr_w(var[i].name)); ok(!bstrs[0], "[%u] Unexpected doc string %s\n", i, wine_dbgstr_w(bstrs[0])); SysFreeString(bstr); - ok(vardesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%x\n", i, vardesc->memid); + ok(vardesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%lx\n", i, vardesc->memid); ok(vardesc->lpstrSchema == NULL, "[%u] Unexpected lpstrSchema %p\n", i, vardesc->lpstrSchema); - ok(vardesc->oInst == 0, "[%u] Unexpected oInst %u\n", i, vardesc->oInst); + ok(vardesc->oInst == 0, "[%u] Unexpected oInst %lu\n", i, vardesc->oInst); ok(vardesc->varkind == VAR_DISPATCH, "[%u] Unexpected varkind %d\n", i, vardesc->varkind); ok(vardesc->wVarFlags == 0, "[%u] Unexpected wVarFlags 0x%x\n", i, vardesc->wVarFlags); ok(vardesc->elemdescVar.tdesc.vt == VT_VARIANT, @@ -2137,20 +2137,20 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* Check function descriptions */ hr = ITypeInfo_GetFuncDesc(typeinfo, 0, NULL); - ok(hr == E_INVALIDARG, "GetFuncDesc returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetFuncDesc returned: %08lx\n", hr); hr = ITypeInfo_GetFuncDesc(typeinfo, 1337, &funcdesc); - ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetFuncDesc returned: %08x\n", hr); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetFuncDesc returned: %08lx\n", hr); for (i = 0; i < expected_funcs_cnt; i++) { hr = ITypeInfo_GetFuncDesc(typeinfo, i, &funcdesc); - ok(hr == S_OK, "GetFuncDesc(%u) failed: %08x\n", i, hr); + ok(hr == S_OK, "GetFuncDesc(%u) failed: %08lx\n", i, hr); hr = ITypeInfo_GetDocumentation(typeinfo, funcdesc->memid, &bstr, &bstrs[0], NULL, NULL); - ok(hr == S_OK, "[%u] GetDocumentation failed: %08x\n", i, hr); + ok(hr == S_OK, "[%u] GetDocumentation failed: %08lx\n", i, hr); ok(!lstrcmpW(bstr, func[i].name), "[%u] Unexpected function name %s (expected %s)\n", i, wine_dbgstr_w(bstr), wine_dbgstr_w(func[i].name)); ok(!bstrs[0], "[%u] Unexpected doc string %s\n", i, wine_dbgstr_w(bstrs[0])); SysFreeString(bstr); - ok(funcdesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%x\n", i, funcdesc->memid); + ok(funcdesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%lx\n", i, funcdesc->memid); ok(funcdesc->lprgscode == NULL, "[%u] Unexpected lprgscode %p\n", i, funcdesc->lprgscode); ok(func[i].num_args ? (funcdesc->lprgelemdescParam != NULL) : (funcdesc->lprgelemdescParam == NULL), "[%u] Unexpected lprgelemdescParam %p\n", i, funcdesc->lprgelemdescParam); @@ -2183,28 +2183,28 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* Test TypeComp Binds */ hr = ITypeInfo_QueryInterface(typeinfo, &IID_ITypeComp, (void**)&typecomp); - ok(hr == S_OK, "QueryInterface(IID_ITypeComp) failed: %08x\n", hr); + ok(hr == S_OK, "QueryInterface(IID_ITypeComp) failed: %08lx\n", hr); hr = ITypeInfo_GetTypeComp(typeinfo, NULL); - ok(hr == E_INVALIDARG, "GetTypeComp returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "GetTypeComp returned: %08lx\n", hr); hr = ITypeInfo_GetTypeComp(typeinfo, &typecomp2); - ok(hr == S_OK, "GetTypeComp failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeComp failed: %08lx\n", hr); ok(typecomp == typecomp2, "QueryInterface(IID_ITypeComp) and GetTypeComp returned different TypeComps\n"); ITypeComp_Release(typecomp2); wcscpy(str, L"not_found"); hr = ITypeComp_Bind(typecomp, NULL, 0, 0, &typeinfo2, &desckind, &bindptr); - ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr); hr = ITypeComp_Bind(typecomp, str, 0, 0, NULL, &desckind, &bindptr); - ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr); hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, NULL, &bindptr); - ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr); hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, &desckind, NULL); - ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr); hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, &desckind, &bindptr); - ok(hr == S_OK, "Bind failed: %08x\n", hr); + ok(hr == S_OK, "Bind failed: %08lx\n", hr); ok(desckind == DESCKIND_NONE, "Unexpected desckind %u\n", desckind); wcscpy(str, L"addRef"); hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, &desckind, &bindptr); - ok(hr == S_OK, "Bind failed: %08x\n", hr); + ok(hr == S_OK, "Bind failed: %08lx\n", hr); ok(desckind == DESCKIND_FUNCDESC, "Unexpected desckind %u\n", desckind); ok(!lstrcmpW(str, L"addRef"), "Unexpected string %s\n", wine_dbgstr_w(str)); ITypeInfo_ReleaseFuncDesc(typeinfo2, bindptr.lpfuncdesc); @@ -2213,7 +2213,7 @@ static void test_typeinfo(const WCHAR *parse_func_name) { wcscpy(str, var[i].name); hr = ITypeComp_Bind(typecomp, str, 0, INVOKE_PROPERTYGET, &typeinfo2, &desckind, &bindptr); - ok(hr == S_OK, "Bind failed: %08x\n", hr); + ok(hr == S_OK, "Bind failed: %08lx\n", hr); ok(desckind == DESCKIND_VARDESC, "Unexpected desckind %u\n", desckind); ITypeInfo_ReleaseVarDesc(typeinfo2, bindptr.lpvardesc); ITypeInfo_Release(typeinfo2); @@ -2222,30 +2222,30 @@ static void test_typeinfo(const WCHAR *parse_func_name) { wcscpy(str, func[i].name); hr = ITypeComp_Bind(typecomp, str, 0, INVOKE_FUNC, &typeinfo2, &desckind, &bindptr); - ok(hr == S_OK, "Bind failed: %08x\n", hr); + ok(hr == S_OK, "Bind failed: %08lx\n", hr); ok(desckind == DESCKIND_FUNCDESC, "Unexpected desckind %u\n", desckind); ITypeInfo_ReleaseFuncDesc(typeinfo2, bindptr.lpfuncdesc); ITypeInfo_Release(typeinfo2); } wcscpy(str, L"JScriptTypeInfo"); hr = ITypeComp_BindType(typecomp, NULL, 0, &typeinfo2, &typecomp2); - ok(hr == E_INVALIDARG, "BindType returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "BindType returned: %08lx\n", hr); hr = ITypeComp_BindType(typecomp, str, 0, NULL, &typecomp2); - ok(hr == E_INVALIDARG, "BindType returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "BindType returned: %08lx\n", hr); hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, NULL); - ok(hr == E_INVALIDARG, "BindType returned: %08x\n", hr); + ok(hr == E_INVALIDARG, "BindType returned: %08lx\n", hr); hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, &typecomp2); - ok(hr == S_OK, "BindType failed: %08x\n", hr); + ok(hr == S_OK, "BindType failed: %08lx\n", hr); ok(!typeinfo2, "Unexpected TypeInfo %p (expected null)\n", typeinfo2); ok(!typecomp2, "Unexpected TypeComp %p (expected null)\n", typecomp2); wcscpy(str, L"C"); hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, &typecomp2); - ok(hr == S_OK, "BindType failed: %08x\n", hr); + ok(hr == S_OK, "BindType failed: %08lx\n", hr); ok(!typeinfo2, "Unexpected TypeInfo %p (expected null)\n", typeinfo2); ok(!typecomp2, "Unexpected TypeComp %p (expected null)\n", typecomp2); wcscpy(str, L"IDispatch"); hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, &typecomp2); - ok(hr == S_OK, "BindType failed: %08x\n", hr); + ok(hr == S_OK, "BindType failed: %08lx\n", hr); ok(!typeinfo2, "Unexpected TypeInfo %p (expected null)\n", typeinfo2); ok(!typecomp2, "Unexpected TypeComp %p (expected null)\n", typecomp2); ITypeComp_Release(typecomp); @@ -2259,14 +2259,14 @@ static void test_typeinfo(const WCHAR *parse_func_name) "function new_func() { }\n");
hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo2); - ok(hr == S_OK, "GetTypeInfo failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeInfo failed: %08lx\n", hr); hr = ITypeInfo_GetTypeAttr(typeinfo, &attr); - ok(hr == S_OK, "GetTypeAttr failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeAttr failed: %08lx\n", hr); ok(attr->cFuncs == expected_funcs_cnt, "Unexpected cFuncs %u\n", attr->cFuncs); ok(attr->cVars == expected_vars_cnt, "Unexpected cVars %u\n", attr->cVars); ITypeInfo_ReleaseTypeAttr(typeinfo, attr); hr = ITypeInfo_GetTypeAttr(typeinfo2, &attr); - ok(hr == S_OK, "GetTypeAttr failed: %08x\n", hr); + ok(hr == S_OK, "GetTypeAttr failed: %08lx\n", hr); ok(attr->cFuncs == expected_funcs_cnt + 1, "Unexpected cFuncs %u\n", attr->cFuncs); ok(attr->cVars == expected_vars_cnt + 1, "Unexpected cVars %u\n", attr->cVars); ITypeInfo_ReleaseTypeAttr(typeinfo2, attr); @@ -2276,7 +2276,7 @@ static void test_typeinfo(const WCHAR *parse_func_name) when retrieving the TypeInfo, even though it is valid jscript. */ parse_script(parser, L"var NEW_FUNC;\n"); hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo2); - ok(hr == TYPE_E_AMBIGUOUSNAME, "GetTypeInfo returned: %08x\n", hr); + ok(hr == TYPE_E_AMBIGUOUSNAME, "GetTypeInfo returned: %08lx\n", hr); }
ITypeInfo_Release(typeinfo); @@ -2287,7 +2287,7 @@ static void test_typeinfo(const WCHAR *parse_func_name) SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_CLOSED); hr = IActiveScript_Close(script); - ok(hr == S_OK, "Close failed: %08x\n", hr); + ok(hr == S_OK, "Close failed: %08lx\n", hr); CHECK_CALLED(OnStateChange_DISCONNECTED); CHECK_CALLED(OnStateChange_INITIALIZED); CHECK_CALLED(OnStateChange_CLOSED); diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 0e2f6333abc..63d81150e0e 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -217,7 +217,7 @@ static BOOL is_lang_english(void) static void _test_grfdex(unsigned line, DWORD grfdex, DWORD expect) { expect |= invoke_version << 28; - ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect); + ok_(__FILE__,line)(grfdex == expect, "grfdex = %lx, expected %lx\n", grfdex, expect); }
static void close_script(IActiveScript *script) @@ -226,10 +226,10 @@ static void close_script(IActiveScript *script) ULONG ref;
hres = IActiveScript_Close(script); - ok(hres == S_OK, "Close failed: %08x\n", hres); + ok(hres == S_OK, "Close failed: %08lx\n", hres);
ref = IActiveScript_Release(script); - ok(!ref, "ref=%u\n", ref); + ok(!ref, "ref=%lu\n", ref); }
static HRESULT WINAPI EnumVARIANT_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv) @@ -263,7 +263,7 @@ static HRESULT WINAPI EnumVARIANT_Next( ULONG *pCeltFetched) { ok(rgVar != NULL, "rgVar is NULL\n"); - ok(celt == 1, "celt = %d\n", celt); + ok(celt == 1, "celt = %ld\n", celt); ok(pCeltFetched == NULL, "pCeltFetched is not NULL\n");
if (!rgVar) @@ -394,7 +394,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) { - ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); + ok(0, "unexpected call %s %lx\n", wine_dbgstr_w(bstrName), grfdex); return E_NOTIMPL; }
@@ -446,7 +446,7 @@ static HRESULT WINAPI testObj_Invoke(IDispatchEx *iface, DISPID id, return S_OK; }
- ok(0, "unexpected call %x\n", id); + ok(0, "unexpected call %lx\n", id); return DISP_E_MEMBERNOTFOUND; }
@@ -559,7 +559,7 @@ static HRESULT WINAPI testObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, return S_OK; }
- ok(0, "unexpected call %x\n", id); + ok(0, "unexpected call %lx\n", id); return DISP_E_MEMBERNOTFOUND; }
@@ -612,7 +612,7 @@ static HRESULT WINAPI dispexFunc_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc ok(pdp != NULL, "pdp == NULL\n"); ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs != NULL\n"); - ok(*pdp->rgdispidNamedArgs == DISPID_THIS, "*rgdispidNamedArgs = %d\n", *pdp->rgdispidNamedArgs); + ok(*pdp->rgdispidNamedArgs == DISPID_THIS, "*rgdispidNamedArgs = %ld\n", *pdp->rgdispidNamedArgs); ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs); ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); ok(res != NULL, "res == NULL\n"); @@ -633,7 +633,7 @@ static HRESULT WINAPI dispexFunc_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc V_VT(res) = VT_NULL; return S_OK; default: - ok(0, "unexpected call %x\n", id); + ok(0, "unexpected call %lx\n", id); return DISP_E_MEMBERNOTFOUND; } } @@ -1145,11 +1145,11 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n"); ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); - ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]); + ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]); ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg)); - ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg)=%d\n", V_I4(pdp->rgvarg)); + ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg)=%ld\n", V_I4(pdp->rgvarg)); return S_OK;
case DISPID_GLOBAL_TESTPROPPUTREF: @@ -1161,7 +1161,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n"); ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); - ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]); + ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]); ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg)); @@ -1418,7 +1418,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, HRESULT hres;
hres = IActiveScript_GetScriptState(script_engine, &state); - ok(hres == S_OK, "GetScriptState failed: %08x\n", hres); + ok(hres == S_OK, "GetScriptState failed: %08lx\n", hres);
V_VT(pvarRes) = VT_I4; V_I4(pvarRes) = state; @@ -1438,18 +1438,18 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n"); ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs); ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); - ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]); + ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]); ok(!pvarRes, "pvarRes != NULL\n"); ok(pei != NULL, "pei == NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg)); - ok(V_I4(pdp->rgvarg) == 2, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg)); + ok(V_I4(pdp->rgvarg) == 2, "V_I4(pdp->rgvarg) = %ld\n", V_I4(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1)); - ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1)); + ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2)); - ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2)); + ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %ld\n", V_I4(pdp->rgvarg+2)); return S_OK;
case DISPID_GLOBAL_PROPARGPUTOP: @@ -1468,10 +1468,10 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(pvarRes != NULL, "pvarRes = NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg)); - ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg)); + ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg) = %ld\n", V_I4(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1)); - ok(V_I4(pdp->rgvarg+1) == 0, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1)); + ok(V_I4(pdp->rgvarg+1) == 0, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
V_VT(pvarRes) = VT_I4; V_I4(pvarRes) = 6; @@ -1480,20 +1480,20 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, CHECK_EXPECT(global_propargputop_put_i);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); - ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]); + ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]); ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n"); ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs); ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg)); - ok(V_I4(pdp->rgvarg) == 8, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg)); + ok(V_I4(pdp->rgvarg) == 8, "V_I4(pdp->rgvarg) = %ld\n", V_I4(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1)); - ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1)); + ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2)); - ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2)); + ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %ld\n", V_I4(pdp->rgvarg+2)); break; default: ok(0, "wFlags = %x\n", wFlags); @@ -1507,41 +1507,41 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, HRESULT hres;
hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&dispex); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres);
str = SysAllocString(L"Object"); hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); SysFreeString(str); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, NULL, pei, pspCaller); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, pvarRes, pei, pspCaller); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres); ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); VariantClear(pvarRes);
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD|DISPATCH_PROPERTYGET, pdp, NULL, pei, pspCaller); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, pvarRes, pei, pspCaller); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres); ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); VariantClear(pvarRes);
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, NULL, pei, pspCaller); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT|DISPATCH_PROPERTYGET, pdp, pvarRes, pei, pspCaller); - ok(hres == E_INVALIDARG, "hres = %x\n", hres); + ok(hres == E_INVALIDARG, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); - ok(hres == S_OK, "hres = %x\n", hres); + ok(hres == S_OK, "hres = %lx\n", hres); ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); IDispatchEx_Release(dispex); return S_OK; @@ -1615,16 +1615,16 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1)); - ok(V_I4(pdp->rgvarg+1) == 10, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1)); + ok(V_I4(pdp->rgvarg+1) == 10, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2)); - ok(V_I4(pdp->rgvarg+2) == 10, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2)); + ok(V_I4(pdp->rgvarg+2) == 10, "V_I4(pdp->rgvarg+2) = %ld\n", V_I4(pdp->rgvarg+2));
ok(V_VT(pdp->rgvarg+3) == VT_I4, "V_VT(pdp->rgvarg+3) = %d\n", V_VT(pdp->rgvarg+3)); - ok(V_I4(pdp->rgvarg+3) == 22, "V_I4(pdp->rgvarg+3) = %d\n", V_I4(pdp->rgvarg+3)); + ok(V_I4(pdp->rgvarg+3) == 22, "V_I4(pdp->rgvarg+3) = %ld\n", V_I4(pdp->rgvarg+3));
ok(V_VT(pdp->rgvarg+4) == VT_I4, "V_VT(pdp->rgvarg+4) = %d\n", V_VT(pdp->rgvarg+4)); - ok(V_I4(pdp->rgvarg+4) == 22, "V_I4(pdp->rgvarg+4) = %d\n", V_I4(pdp->rgvarg+4)); + ok(V_I4(pdp->rgvarg+4) == 22, "V_I4(pdp->rgvarg+4) = %ld\n", V_I4(pdp->rgvarg+4));
ok(V_VT(pdp->rgvarg+5) == VT_DISPATCH, "V_VT(pdp->rgvarg+5) = %d\n", V_VT(pdp->rgvarg+5)); ok(V_DISPATCH(pdp->rgvarg+5) == (IDispatch*)&testObj, "V_DISPATCH(pdp->rgvarg+5) != testObj\n"); @@ -1654,7 +1654,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, V_VT(&v) = VT_I4; V_I4(&v) = 2; hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL); - ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
return S_OK; } @@ -1677,7 +1677,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg)); hres = IDispatch_QueryInterface(V_DISPATCH(pdp->rgvarg), &IID_IDispatchEx, (void**)&eval_func); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
params.rgvarg = &arg; params.rgdispidNamedArgs = NULL; @@ -1688,9 +1688,9 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, V_BSTR(&arg) = SysAllocString(L"var x = 5; v"); V_VT(&res) = VT_ERROR; hres = IDispatchEx_InvokeEx(eval_func, DISPID_VALUE, 0, DISPATCH_METHOD, ¶ms, &res, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res)); - ok(V_I4(&res) == 2, "eval returned %d\n", V_I4(&res)); + ok(V_I4(&res) == 2, "eval returned %ld\n", V_I4(&res)); SysFreeString(V_BSTR(&arg)); IDispatchEx_Release(eval_func); return S_OK; @@ -1764,7 +1764,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, } }
- ok(0, "unexpected call %x\n", id); + ok(0, "unexpected call %lx\n", id); return DISP_E_MEMBERNOTFOUND; }
@@ -1781,7 +1781,7 @@ static HRESULT WINAPI Global_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) CHECK_EXPECT(DeleteMemberByDispID_error); return E_FAIL; default: - ok(0, "id = %d\n", id); + ok(0, "id = %ld\n", id); }
return E_FAIL; @@ -1841,7 +1841,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti) { - ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask); + ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %lx\n", dwReturnMask); ok(!ppti, "ppti != NULL\n");
if(!lstrcmpW(pstrName, L"testVal")) @@ -1935,7 +1935,7 @@ static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *v
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty, (void**)&script_prop); - ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08lx\n", hres);
hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val); IActiveScriptProperty_Release(script_prop); @@ -1951,12 +1951,12 @@ static IActiveScript *create_script(void)
hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&script); - ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
V_VT(&v) = VT_I4; V_I4(&v) = invoke_version; hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); - ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres); if(invoke_version && FAILED(hres)) { IActiveScript_Release(script); return NULL; @@ -1976,7 +1976,7 @@ static HRESULT parse_script(DWORD flags, const WCHAR *script_str) return S_OK;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres); if (FAILED(hres)) { IActiveScript_Release(engine); @@ -1984,20 +1984,20 @@ static HRESULT parse_script(DWORD flags, const WCHAR *script_str) }
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp); - ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres); ok(script_disp != NULL, "script_disp == NULL\n"); ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
@@ -2026,32 +2026,32 @@ static HRESULT invoke_procedure(const WCHAR *args, const WCHAR *source, DISPPARA return S_OK;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, source, args, L"", NULL, NULL, NULL, 0, 0, SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp); - ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres); + ok(hres == S_OK, "ParseProcedureText failed: %08lx\n", hres);
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); IDispatch_Release(disp);
V_VT(&res) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, 0, DISPATCH_METHOD, dp, &res, &ei, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); - ok(V_VT(&res) == VT_BOOL && V_BOOL(&res), "InvokeEx returned vt %d (%x)\n", V_VT(&res), V_I4(&res)); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + ok(V_VT(&res) == VT_BOOL && V_BOOL(&res), "InvokeEx returned vt %d (%lx)\n", V_VT(&res), V_I4(&res)); IDispatchEx_Release(dispex);
IActiveScriptParseProcedure2_Release(parse_proc); @@ -2072,7 +2072,7 @@ static HRESULT parse_htmlscript(const WCHAR *script_str) return E_FAIL;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres); if (FAILED(hres)) { IActiveScript_Release(engine); @@ -2080,17 +2080,17 @@ static HRESULT parse_htmlscript(const WCHAR *script_str) }
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, L"</SCRIPT>", 0, 0, 0, NULL, NULL);
@@ -2334,23 +2334,23 @@ static void test_error_reports(void) engine = create_script();
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite_CheckError); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp); - ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres); ok(script_disp != NULL, "script_disp == NULL\n"); ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
@@ -2359,7 +2359,7 @@ static void test_error_reports(void) hres = IActiveScriptParse_ParseScriptText(parser, tests[i].script, NULL, NULL, NULL, 10, 0, 0, NULL, NULL); todo_wine_if(tests[i].todo_flags & ERROR_TODO_PARSE) ok(hres == SCRIPT_E_REPORTED || (tests[i].error == JS_E_EXCEPTION_THROWN && hres == SCRIPT_E_PROPAGATE), - "[%u] got: 0x%08x for %s\n", i, hres, wine_dbgstr_w(tests[i].script)); + "[%u] got: 0x%08lx for %s\n", i, hres, wine_dbgstr_w(tests[i].script)); todo_wine_if(tests[i].todo_flags & ERROR_TODO_PARSE) CHECK_CALLED(ActiveScriptSite_OnScriptError);
@@ -2372,43 +2372,43 @@ static void test_error_reports(void) EXCEPINFO ei;
hres = IActiveScriptError_GetSourcePosition(script_error, NULL, NULL, NULL); - ok(hres == S_OK, "GetSourcePosition failed %08x\n", hres); + ok(hres == S_OK, "GetSourcePosition failed %08lx\n", hres);
source_context = 0xdeadbeef; hres = IActiveScriptError_GetSourcePosition(script_error, &source_context, NULL, NULL); - ok(hres == S_OK, "GetSourcePosition failed0x%08x\n", hres); - ok(source_context == 10, "source_context = %x\n", source_context); + ok(hres == S_OK, "GetSourcePosition failed0x%08lx\n", hres); + ok(source_context == 10, "source_context = %lx\n", source_context);
line_number = 0xdeadbeef; hres = IActiveScriptError_GetSourcePosition(script_error, NULL, &line_number, NULL); - ok(hres == S_OK, "GetSourcePosition failed%08x\n", hres); - ok(line_number == tests[i].line, "[%u] line = %u expected %u\n", i, line_number, tests[i].line); + ok(hres == S_OK, "GetSourcePosition failed%08lx\n", hres); + ok(line_number == tests[i].line, "[%u] line = %lu expected %u\n", i, line_number, tests[i].line);
character = 0xdeadbeef; hres = IActiveScriptError_GetSourcePosition(script_error, NULL, NULL, &character); - ok(hres == S_OK, "GetSourcePosition failed: %08x\n", hres); - ok(character == tests[i].character, "[%u] character = %u expected %u\n", i, character, tests[i].character); + ok(hres == S_OK, "GetSourcePosition failed: %08lx\n", hres); + ok(character == tests[i].character, "[%u] character = %lu expected %u\n", i, character, tests[i].character);
hres = IActiveScriptError_GetSourceLineText(script_error, NULL); - ok(hres == E_POINTER, "GetSourceLineText returned %08x\n", hres); + ok(hres == E_POINTER, "GetSourceLineText returned %08lx\n", hres);
line_text = (BSTR)0xdeadbeef; hres = IActiveScriptError_GetSourceLineText(script_error, &line_text); if (tests[i].line_text) { - ok(hres == S_OK, "GetSourceLineText failed: %08x\n", hres); + ok(hres == S_OK, "GetSourceLineText failed: %08lx\n", hres); ok(line_text != NULL && !lstrcmpW(line_text, tests[i].line_text), "[%u] GetSourceLineText returned %s expected %s\n", i, wine_dbgstr_w(line_text), wine_dbgstr_w(tests[i].line_text)); } else { - ok(hres == E_FAIL, "GetSourceLineText failed: %08x\n", hres); + ok(hres == E_FAIL, "GetSourceLineText failed: %08lx\n", hres); } if (SUCCEEDED(hres)) SysFreeString(line_text);
hres = IActiveScriptError_GetExceptionInfo(script_error, NULL); - ok(hres == E_POINTER, "GetExceptionInfo failed: %08x\n", hres); + ok(hres == E_POINTER, "GetExceptionInfo failed: %08lx\n", hres);
ei.wCode = 0xdead; ei.wReserved = 0xdead; @@ -2421,13 +2421,13 @@ static void test_error_reports(void) ei.scode = 0xdeadbeef;
hres = IActiveScriptError_GetExceptionInfo(script_error, &ei); - ok(hres == S_OK, "GetExceptionInfo failed: %08x\n", hres); + ok(hres == S_OK, "GetExceptionInfo failed: %08lx\n", hres);
todo_wine_if(tests[i].todo_flags & ERROR_TODO_SCODE) - ok(ei.scode == tests[i].error, "[%u] scode = %08x, expected %08x\n", i, ei.scode, tests[i].error); + ok(ei.scode == tests[i].error, "[%u] scode = %08lx, expected %08lx\n", i, ei.scode, tests[i].error); ok(ei.wCode == 0, "wCode = %x\n", ei.wCode); todo_wine_if(tests[i].reserved_lcid) - ok(ei.wReserved == (tests[i].reserved_lcid ? GetUserDefaultLCID() : 0), "[%u] wReserved = %x expected %x\n", + ok(ei.wReserved == (tests[i].reserved_lcid ? GetUserDefaultLCID() : 0), "[%u] wReserved = %x expected %lx\n", i, ei.wReserved, (tests[i].reserved_lcid ? GetUserDefaultLCID() : 0)); if (is_lang_english()) { @@ -2444,7 +2444,7 @@ static void test_error_reports(void) ok(!ei.bstrDescription, "[%u] bstrDescription = %s expected NULL\n", i, wine_dbgstr_w(ei.bstrDescription)); } ok(!ei.bstrHelpFile, "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile)); - ok(!ei.dwHelpContext, "dwHelpContext = %d\n", ei.dwHelpContext); + ok(!ei.dwHelpContext, "dwHelpContext = %ld\n", ei.dwHelpContext); ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved); ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn);
@@ -2467,7 +2467,7 @@ static void _run_script(unsigned line, const WCHAR *src) HRESULT hres;
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); - ok_(__FILE__,line)(hres == S_OK, "script %s failed: %08x\n", wine_dbgstr_w(src), hres); + ok_(__FILE__,line)(hres == S_OK, "script %s failed: %08lx\n", wine_dbgstr_w(src), hres); }
static BSTR get_script_from_file(const char *filename) @@ -2479,7 +2479,7 @@ static BSTR get_script_from_file(const char *filename)
file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); if(file == INVALID_HANDLE_VALUE) { - trace("Could not open file: %u\n", GetLastError()); + trace("Could not open file: %lu\n", GetLastError()); return NULL; }
@@ -2488,14 +2488,14 @@ static BSTR get_script_from_file(const char *filename) map = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(file); if(map == INVALID_HANDLE_VALUE) { - trace("Could not create file mapping: %u\n", GetLastError()); + trace("Could not create file mapping: %lu\n", GetLastError()); return NULL; }
file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0); CloseHandle(map); if(!file_map) { - trace("MapViewOfFile failed: %u\n", GetLastError()); + trace("MapViewOfFile failed: %lu\n", GetLastError()); return NULL; }
@@ -2520,7 +2520,7 @@ static void run_from_file(const char *filename) strict_dispid_check = FALSE; hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str); SysFreeString(script_str); - ok(hres == S_OK, "parse_script failed: %08x\n", hres); + ok(hres == S_OK, "parse_script failed: %08lx\n", hres); }
static BSTR load_res(const char *name) @@ -2559,7 +2559,7 @@ static void run_from_res(const char *name) CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i);
- ok(hres == S_OK, "parse_script failed: %08x\n", hres); + ok(hres == S_OK, "parse_script failed: %08lx\n", hres); SysFreeString(str); }
@@ -2574,7 +2574,7 @@ static void test_isvisible(BOOL global_members) return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres); if (FAILED(hres)) { IActiveScript_Release(engine); @@ -2582,32 +2582,32 @@ static void test_isvisible(BOOL global_members) }
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
if(global_members) SET_EXPECT(GetItemInfo_testVal); hres = IActiveScript_AddNamedItem(engine, L"testVal", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE| (global_members ? SCRIPTITEM_GLOBALMEMBERS : 0)); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres); if(global_members) CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
if(!global_members) SET_EXPECT(GetItemInfo_testVal); hres = IActiveScriptParse_ParseScriptText(parser, L"var v = testVal;", NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); if(!global_members) CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScriptParse_ParseScriptText(parser, L"var v = testVal;", NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
IActiveScript_Release(engine); IActiveScriptParse_Release(parser); @@ -2625,27 +2625,27 @@ static void test_start(void) return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
str = SysAllocString(L"ok(getScriptState() === 5, "getScriptState = " + getScriptState());\n" L"reportSuccess();"); hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); SysFreeString(str);
SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i);
@@ -2666,28 +2666,28 @@ static void test_automagic(void) return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
str = SysAllocString(L"function bindEventHandler::eventName() {}\n" L"reportSuccess();"); hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); SysFreeString(str);
SET_EXPECT(BindHandler); SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres); CHECK_CALLED(BindHandler); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); @@ -2708,22 +2708,22 @@ static HRESULT parse_script_expr(const WCHAR *expr, VARIANT *res, IActiveScript return E_FAIL;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
SET_EXPECT(GetItemInfo_testVal); hres = IActiveScript_AddNamedItem(engine, L"testVal", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres); CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScriptParse_ParseScriptText(parser, expr, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, res, NULL); IActiveScriptParse_Release(parser); @@ -2750,18 +2750,18 @@ static void test_retval(void) return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
SET_EXPECT(GetItemInfo_testVal); hres = IActiveScript_AddNamedItem(engine, L"testVal", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres); CHECK_CALLED(GetItemInfo_testVal);
str = SysAllocString(L"reportSuccess(), true"); @@ -2771,16 +2771,16 @@ static void test_retval(void) hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, &res, NULL); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); ok(V_VT(&res) == VT_EMPTY, "V_VT(&res) = %d\n", V_VT(&res)); SysFreeString(str);
hres = IActiveScript_GetScriptState(engine, &state); - ok(hres == S_OK, "GetScriptState failed: %08x\n", hres); + ok(hres == S_OK, "GetScriptState failed: %08lx\n", hres); ok(state == SCRIPTSTATE_INITIALIZED, "state = %d\n", state);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
IActiveScriptParse_Release(parser);
@@ -2797,13 +2797,13 @@ static void test_default_value(void) HRESULT hres;
hres = parse_script_expr(L"new Date()", &v, NULL); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08x\n", hres); + ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08lx\n", hres); if(hres == S_OK) { ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); @@ -2812,26 +2812,26 @@ static void test_default_value(void) IDispatch_Release(disp);
hres = parse_script_expr(L"var arr = [5]; arr.toString = function() {return "foo";}; arr.valueOf = function() {return 42;}; arr", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); ok(V_I4(&v) == 42, "V_I4(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); IDispatch_Release(disp); close_script(script);
hres = parse_script_expr(L"var arr = [5]; arr.toString = function() {return "foo";}; arr", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); ok(!lstrcmpW(V_BSTR(&v), L"foo"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v); @@ -2839,13 +2839,13 @@ static void test_default_value(void) close_script(script);
hres = parse_script_expr(L"var arr = [5]; arr", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); ok(!lstrcmpW(V_BSTR(&v), L"5"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v); @@ -2853,13 +2853,13 @@ static void test_default_value(void) close_script(script);
hres = parse_script_expr(L"var obj = Object.prototype; delete obj.valueOf; obj", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); ok(!lstrcmpW(V_BSTR(&v), L"[object Object]"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); VariantClear(&v); @@ -2867,18 +2867,18 @@ static void test_default_value(void) close_script(script);
hres = parse_script_expr(L"var obj = Object.prototype; delete obj.toString; obj", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08x\n", hres); + ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08lx\n", hres); IDispatch_Release(disp); close_script(script);
hres = parse_script_expr(L"Object.prototype", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
@@ -2887,18 +2887,18 @@ static void test_default_value(void) dp.rgvarg = &v; V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dp, NULL, NULL, NULL); - ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08x\n", hres); + ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08lx\n", hres); IDispatch_Release(disp); close_script(script);
hres = parse_script_expr(L"var f = function() {return 42;}; f", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dp, NULL, NULL, NULL); - ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08x\n", hres); + ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08lx\n", hres); IDispatch_Release(disp); close_script(script); } @@ -2911,38 +2911,38 @@ static void test_script_exprs(void) testing_expr = TRUE;
hres = parse_script_expr(L"true", &v, NULL); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
hres = parse_script_expr(L"false, true", &v, NULL); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); hres = parse_script_expr(L"reportSuccess(); true", &v, NULL); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v)); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i);
hres = parse_script_expr(L"if(false) true", &v, NULL); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
hres = parse_script_expr(L"return testPropGet", &v, NULL); - ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres); + ok(hres == 0x800a03fa, "parse_script_expr failed: %08lx\n", hres);
hres = parse_script_expr(L"reportSuccess(); return true", &v, NULL); - ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres); + ok(hres == 0x800a03fa, "parse_script_expr failed: %08lx\n", hres);
SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); hres = parse_script_expr(L"reportSuccess(); true", NULL, NULL); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i);
@@ -2963,65 +2963,65 @@ static void test_invokeex(void) HRESULT hres;
hres = parse_script_expr(L"var o = {func: function() {return 3;}, prop: 6}; o", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); VariantClear(&v);
str = SysAllocString(L"func"); hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
str = SysAllocString(L"prop"); hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); - ok(V_I4(&v) == 3, "V_I4(v) = %d\n", V_I4(&v)); + ok(V_I4(&v) == 3, "V_I4(v) = %ld\n", V_I4(&v));
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); - ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v)); + ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
str = SysAllocString(L"func"); hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); - ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08x\n", hres); + ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); - ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v)); + ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
IDispatchEx_Release(dispex); IActiveScript_Release(script);
/* test InvokeEx following prototype chain of builtin object (PROP_PROTREF) */ hres = parse_script_expr(L"o = new Array(); o.push("foo"); o", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); VariantClear(&v);
str = SysAllocString(L"push"); hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
dp.rgvarg = &arg; dp.cArgs = 1; @@ -3029,17 +3029,17 @@ static void test_invokeex(void) V_BSTR(&arg) = SysAllocString(L"bar");
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); SysFreeString(V_BSTR(&arg));
str = SysAllocString(L"join"); hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
V_BSTR(&arg) = SysAllocString(L";"); hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); SysFreeString(V_BSTR(&arg)); ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); ok(!lstrcmpW(V_BSTR(&v), L"foo;bar"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v))); @@ -3056,40 +3056,40 @@ static void test_invokeex(void) hres = parse_script_expr(L"function c() { this.func = function() { return this.prop1 * this.prop2 };" L"this.prop1 = 6; this.prop2 = 9; }; var o = new c(); o.prop2 = 7; o", &v, &script); - ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); VariantClear(&v);
str = SysAllocString(L"prop1"); hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); - ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v)); + ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
str = SysAllocString(L"prop2"); hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); - ok(V_I4(&v) == 7, "V_I4(v) = %d\n", V_I4(&v)); + ok(V_I4(&v) == 7, "V_I4(v) = %ld\n", V_I4(&v));
str = SysAllocString(L"func"); hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); SysFreeString(str); - ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); ok(V_I4(&v) == 42, "V_I4(v) = %s\n", wine_dbgstr_variant(&v));
@@ -3112,34 +3112,34 @@ static void test_eval(void) engine = create_script();
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
SET_EXPECT(GetItemInfo_testVal); hres = IActiveScript_AddNamedItem(engine, L"testVal", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres); CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp); - ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres); ok(script_disp != NULL, "script_disp == NULL\n");
hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&script_dispex); - ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); IDispatch_Release(script_disp);
str = SysAllocString(L"eval"); hres = IDispatchEx_GetDispID(script_dispex, str, 0, &id); - ok(hres == S_OK, "Could not get eval dispid: %08x\n", hres); + ok(hres == S_OK, "Could not get eval dispid: %08lx\n", hres); SysFreeString(str);
params.rgvarg = &arg; @@ -3151,30 +3151,30 @@ static void test_eval(void) V_BSTR(&arg) = SysAllocString(L"var v = 1;"); V_VT(&res) = VT_ERROR; hres = IDispatchEx_InvokeEx(script_dispex, id, 0, DISPATCH_METHOD, ¶ms, &res, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&res) == VT_EMPTY, "eval returned type %u\n", V_VT(&res)); SysFreeString(V_BSTR(&arg));
V_BSTR(&arg) = SysAllocString(L"v"); V_VT(&res) = VT_ERROR; hres = IDispatchEx_InvokeEx(script_dispex, id, 0, DISPATCH_METHOD, ¶ms, &res, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res)); - ok(V_I4(&res) == 1, "eval returned %d\n", V_I4(&res)); + ok(V_I4(&res) == 1, "eval returned %ld\n", V_I4(&res)); SysFreeString(V_BSTR(&arg));
str = SysAllocString(L"v"); hres = IDispatchEx_GetDispID(script_dispex, str, 0, &v_id); - ok(hres == S_OK, "Could not get v dispid: %08x\n", hres); + ok(hres == S_OK, "Could not get v dispid: %08lx\n", hres); SysFreeString(str);
params.rgvarg = NULL; params.cArgs = 0; V_VT(&res) = VT_ERROR; hres = IDispatchEx_InvokeEx(script_dispex, v_id, 0, DISPATCH_PROPERTYGET, ¶ms, &res, NULL, NULL); - ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res)); - ok(V_I4(&res) == 1, "eval returned %d\n", V_I4(&res)); + ok(V_I4(&res) == 1, "eval returned %ld\n", V_I4(&res));
SET_EXPECT(global_calleval_i); hres = IActiveScriptParse_ParseScriptText(parser, @@ -3184,12 +3184,12 @@ static void test_eval(void) L" ok(x === 5, 'x = ' + x);" L"})();", NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); CHECK_CALLED(global_calleval_i);
str = SysAllocString(L"x"); hres = IDispatchEx_GetDispID(script_dispex, str, 0, &id); - ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(x) returned %08x\n", hres); + ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(x) returned %08lx\n", hres); SysFreeString(str);
IDispatchEx_Release(script_dispex); @@ -3232,7 +3232,7 @@ static void run_bom_tests(void) SET_EXPECT(global_success_i); src = SysAllocString(bom_tests[i].str); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); - ok(hres == S_OK, "test %s failed with %08x\n", wine_dbgstr_w(src), hres); + ok(hres == S_OK, "test %s failed with %08lx\n", wine_dbgstr_w(src), hres); SysFreeString(src); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); @@ -3241,7 +3241,7 @@ static void run_bom_tests(void) { src = SysAllocString(bom_tests[i].str); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); - todo_wine ok(hres == bom_tests[i].hres, "test %s returned with %08x\n", wine_dbgstr_w(src), hres); + todo_wine ok(hres == bom_tests[i].hres, "test %s returned with %08lx\n", wine_dbgstr_w(src), hres); SysFreeString(src); } } @@ -3320,7 +3320,7 @@ static BOOL run_tests(void) SET_EXPECT(global_propdeleteerror_d); SET_EXPECT(DeleteMemberByDispID_error); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, L"delete testPropDeleteError;"); - ok(hres == E_FAIL, "unexpected result %08x\n", hres); + ok(hres == E_FAIL, "unexpected result %08lx\n", hres); CHECK_CALLED(global_propdeleteerror_d); CHECK_CALLED(DeleteMemberByDispID_error);
@@ -3473,14 +3473,14 @@ static BOOL run_tests(void)
SET_EXPECT(testobj_getidfail_d); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, L"testObj.notExists = testObj.getIDFail;"); - ok(hres == E_FAIL, "parse_script returned %08x\n", hres); + ok(hres == E_FAIL, "parse_script returned %08lx\n", hres); CHECK_CALLED(testobj_getidfail_d);
SET_EXPECT(global_propget_d); SET_EXPECT(global_propget_i); SET_EXPECT(testobj_getidfail_d); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, L"testObj.getIDFail = testPropGet;"); - ok(hres == E_FAIL, "parse_script returned %08x\n", hres); + ok(hres == E_FAIL, "parse_script returned %08lx\n", hres); CHECK_CALLED(global_propget_d); CHECK_CALLED(global_propget_i); CHECK_CALLED(testobj_getidfail_d); @@ -3600,20 +3600,20 @@ static BOOL run_tests(void) test_automagic();
hres = parse_script(0, L"test.testThis2(this);"); - ok(hres == S_OK, "unexpected result %08x\n", hres); + ok(hres == S_OK, "unexpected result %08lx\n", hres); hres = parse_script(0, L"(function () { test.testThis2(this); })();"); - ok(hres == S_OK, "unexpected result %08x\n", hres); + ok(hres == S_OK, "unexpected result %08lx\n", hres);
hres = parse_htmlscript(L"<!--"); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); hres = parse_htmlscript(L"-->"); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); hres = parse_htmlscript(L"<!--\nvar a=1;\n-->\n"); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); hres = parse_htmlscript(L"<!--\n<!-- ignore this\n-->\n"); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); hres = parse_htmlscript(L"var a=1;\nif(a-->0) a=5;\n"); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres); hres = parse_htmlscript(L"var a=1;\nif(a\n-->0) a=5;\n"); ok(hres != S_OK, "ParseScriptText have not failed\n");
@@ -3689,31 +3689,31 @@ static void run_encoded_tests(void) src = SysAllocString(L"#@~^EAA*AA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); SysFreeString(src); - ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* vv */ src = SysAllocString(L"#@~^EAAAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); SysFreeString(src); - ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* v */ src = SysAllocString(L"#@~^EAAAAA^=.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); SysFreeString(src); - ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* v */ src = SysAllocString(L"#@~^EAAAAA==.\x7fwGMYUEm1ekd`*iAQYAAA==^#~@"); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); SysFreeString(src); - ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* vv */ src = SysAllocString(L"#@~^EAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^~#@"); hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); SysFreeString(src); - ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres); }
static void run_benchmark(const char *script_name) @@ -3729,33 +3729,33 @@ static void run_benchmark(const char *script_name) return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); - ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres); if (FAILED(hres)) { IActiveScript_Release(engine); return; }
hres = IActiveScriptParse_InitNew(parser); - ok(hres == S_OK, "InitNew failed: %08x\n", hres); + ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); - ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE); - ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
src = load_res(script_name);
start = GetTickCount(); hres = IActiveScriptParse_ParseScriptText(parser, src, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); end = GetTickCount(); - ok(hres == S_OK, "%s: ParseScriptText failed: %08x\n", script_name, hres); + ok(hres == S_OK, "%s: ParseScriptText failed: %08lx\n", script_name, hres);
- trace("%s ran in %u ms\n", script_name, end-start); + trace("%s ran in %lu ms\n", script_name, end-start);
IActiveScript_Release(engine); IActiveScriptParse_Release(parser);
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/jsproxy/tests/Makefile.in | 1 - dlls/jsproxy/tests/jsproxy.c | 42 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/dlls/jsproxy/tests/Makefile.in b/dlls/jsproxy/tests/Makefile.in index 216fbb34cd9..356947694d3 100644 --- a/dlls/jsproxy/tests/Makefile.in +++ b/dlls/jsproxy/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = jsproxy.dll IMPORTS = jsproxy
diff --git a/dlls/jsproxy/tests/jsproxy.c b/dlls/jsproxy/tests/jsproxy.c index d1c905c2e99..59b3c5dfb9e 100644 --- a/dlls/jsproxy/tests/jsproxy.c +++ b/dlls/jsproxy/tests/jsproxy.c @@ -49,48 +49,48 @@ static void test_InternetInitializeAutoProxyDll(void) ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); err = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( err == ERROR_INVALID_PARAMETER, "got %u\n", err ); + ok( err == ERROR_INVALID_PARAMETER, "got %lu\n", err );
buf.dwScriptBufferSize = strlen(script) + 1; ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
ret = pInternetGetProxyInfo( url, strlen(url), host, strlen(host), &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "DIRECT" ), "got "%s"\n", proxy ); GlobalFree( proxy );
buf.dwScriptBufferSize = strlen(script2) + 1; buf.lpszScriptBuffer = script2; ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
ret = pInternetGetProxyInfo( url, strlen(url), host, strlen(host), &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "PROXY 10.0.0.1:8080" ), "got "%s"\n", proxy ); GlobalFree( proxy );
buf.dwScriptBufferSize = strlen(script2) + 2; ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
ret = pInternetGetProxyInfo( url, strlen(url), host, strlen(host), &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "PROXY 10.0.0.1:8080" ), "got "%s"\n", proxy ); GlobalFree( proxy );
buf.lpszScriptBuffer = script3; buf.dwScriptBufferSize = strlen(script3); ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); - ok( ret || broken(old_jsproxy && !ret), "got %u\n", GetLastError() ); + ok( ret || broken(old_jsproxy && !ret), "got %lu\n", GetLastError() );
buf.dwScriptBufferSize = 1; script3[0] = 0; ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
ret = pInternetDeInitializeAutoProxyDll( NULL, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); }
static void test_InternetGetProxyInfo(void) @@ -106,48 +106,48 @@ static void test_InternetGetProxyInfo(void) ret = pInternetGetProxyInfo( url, strlen(url), host, strlen(host), &proxy, &len ); err = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( err == ERROR_CAN_NOT_COMPLETE, "got %u\n", err ); + ok( err == ERROR_CAN_NOT_COMPLETE, "got %lu\n", err );
buf.dwStructSize = sizeof(buf); buf.lpszScriptBuffer = script; buf.dwScriptBufferSize = strlen(script) + 1; ret = pInternetInitializeAutoProxyDll( 0, NULL, NULL, NULL, &buf ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
len = 0; proxy = NULL; ret = pInternetGetProxyInfo( url, strlen(url), host, strlen(host), &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "DIRECT" ), "got "%s"\n", proxy ); - ok( len == strlen("DIRECT") + 1, "got %u\n", len ); + ok( len == strlen("DIRECT") + 1, "got %lu\n", len ); GlobalFree( proxy );
len = 0; proxy = NULL; ret = pInternetGetProxyInfo( url, strlen(url) + 1, host, strlen(host), &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "DIRECT" ), "got "%s"\n", proxy ); - ok( len == strlen("DIRECT") + 1, "got %u\n", len ); + ok( len == strlen("DIRECT") + 1, "got %lu\n", len ); GlobalFree( proxy );
len = 0; proxy = NULL; ret = pInternetGetProxyInfo( url, strlen(url) - 1, host, strlen(host), &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "DIRECT" ), "got "%s"\n", proxy ); - ok( len == strlen("DIRECT") + 1, "got %u\n", len ); + ok( len == strlen("DIRECT") + 1, "got %lu\n", len ); GlobalFree( proxy );
len = 0; proxy = NULL; ret = pInternetGetProxyInfo( url, strlen(url), host, strlen(host) + 1, &proxy, &len ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !strcmp( proxy, "DIRECT" ), "got "%s"\n", proxy ); - ok( len == strlen("DIRECT") + 1, "got %u\n", len ); + ok( len == strlen("DIRECT") + 1, "got %lu\n", len ); GlobalFree( proxy );
ret = pInternetDeInitializeAutoProxyDll( NULL, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); }
START_TEST(jsproxy)
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/kernel32/tests/Makefile.in | 1 dlls/kernel32/tests/actctx.c | 604 ++++++------ dlls/kernel32/tests/atom.c | 32 - dlls/kernel32/tests/change.c | 158 ++- dlls/kernel32/tests/codepage.c | 186 ++-- dlls/kernel32/tests/comm.c | 352 ++++--- dlls/kernel32/tests/console.c | 880 +++++++++--------- dlls/kernel32/tests/debugger.c | 510 +++++------ dlls/kernel32/tests/directory.c | 104 +- dlls/kernel32/tests/drive.c | 36 - dlls/kernel32/tests/environ.c | 212 ++-- dlls/kernel32/tests/fiber.c | 137 +-- dlls/kernel32/tests/file.c | 1548 ++++++++++++++++---------------- dlls/kernel32/tests/format_msg.c | 546 ++++++----- dlls/kernel32/tests/heap.c | 178 ++-- dlls/kernel32/tests/loader.c | 968 ++++++++++---------- dlls/kernel32/tests/locale.c | 858 +++++++++--------- dlls/kernel32/tests/mailslot.c | 52 + dlls/kernel32/tests/module.c | 284 +++--- dlls/kernel32/tests/path.c | 400 ++++---- dlls/kernel32/tests/pipe.c | 948 ++++++++++---------- dlls/kernel32/tests/power.c | 10 dlls/kernel32/tests/process.c | 938 ++++++++++--------- dlls/kernel32/tests/profile.c | 346 ++++--- dlls/kernel32/tests/resource.c | 46 - dlls/kernel32/tests/sync.c | 462 +++++----- dlls/kernel32/tests/thread.c | 384 ++++---- dlls/kernel32/tests/time.c | 138 +-- dlls/kernel32/tests/timer.c | 28 - dlls/kernel32/tests/toolhelp.c | 16 dlls/kernel32/tests/version.c | 80 +- dlls/kernel32/tests/virtual.c | 1838 +++++++++++++++++++------------------- dlls/kernel32/tests/volume.c | 422 ++++----- 33 files changed, 6851 insertions(+), 6851 deletions(-)
diff --git a/dlls/kernel32/tests/Makefile.in b/dlls/kernel32/tests/Makefile.in index db106ab9fc9..e9516603ce9 100644 --- a/dlls/kernel32/tests/Makefile.in +++ b/dlls/kernel32/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = kernel32.dll IMPORTS = user32 advapi32
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index c26eb08f306..8f925b0500f 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -562,7 +562,7 @@ static BOOL create_manifest_file(const char *filename, const char *manifest, int
file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); if(file == INVALID_HANDLE_VALUE) return FALSE; WriteFile(file, manifest, manifest_len, &size, NULL); @@ -574,7 +574,7 @@ static BOOL create_manifest_file(const char *filename, const char *manifest, int GetFullPathNameW(path, ARRAY_SIZE(depmanifest_path), depmanifest_path, NULL); file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); if(file == INVALID_HANDLE_VALUE) return FALSE; WriteFile(file, depmanifest, strlen(depmanifest), &size, NULL); @@ -651,8 +651,8 @@ static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int b = QueryActCtxW(0, handle, NULL, ActivationContextDetailedInformation, &detailed_info_tmp, sizeof(detailed_info_tmp), &size); ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n"); - ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError()); - ok_(__FILE__, line)(size == exsize, "size=%ld, expected %ld\n", size, exsize); + ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %lu\n", GetLastError()); + ok_(__FILE__, line)(size == exsize, "size=%Id, expected %Id\n", size, exsize); }else { size = sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION); } @@ -660,35 +660,35 @@ static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int detailed_info = HeapAlloc(GetProcessHeap(), 0, size); memset(detailed_info, 0xfe, size); b = QueryActCtxW(0, handle, NULL, ActivationContextDetailedInformation, detailed_info, size, &retsize); - ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError()); - ok_(__FILE__, line)(retsize == exsize, "size=%ld, expected %ld\n", retsize, exsize); + ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError()); + ok_(__FILE__, line)(retsize == exsize, "size=%Id, expected %Id\n", retsize, exsize);
- ok_(__FILE__, line)(detailed_info->dwFlags == 0, "detailed_info->dwFlags=%x\n", detailed_info->dwFlags); + ok_(__FILE__, line)(detailed_info->dwFlags == 0, "detailed_info->dwFlags=%lx\n", detailed_info->dwFlags); ok_(__FILE__, line)(detailed_info->ulFormatVersion == exinfo->format_version, - "detailed_info->ulFormatVersion=%u, expected %u\n", detailed_info->ulFormatVersion, + "detailed_info->ulFormatVersion=%lu, expected %lu\n", detailed_info->ulFormatVersion, exinfo->format_version); ok_(__FILE__, line)(exinfo->assembly_cnt_min <= detailed_info->ulAssemblyCount && detailed_info->ulAssemblyCount <= exinfo->assembly_cnt_max, - "detailed_info->ulAssemblyCount=%u, expected between %u and %u\n", detailed_info->ulAssemblyCount, + "detailed_info->ulAssemblyCount=%lu, expected between %lu and %lu\n", detailed_info->ulAssemblyCount, exinfo->assembly_cnt_min, exinfo->assembly_cnt_max); ok_(__FILE__, line)(detailed_info->ulRootManifestPathType == exinfo->root_manifest_type, - "detailed_info->ulRootManifestPathType=%u, expected %u\n", + "detailed_info->ulRootManifestPathType=%lu, expected %lu\n", detailed_info->ulRootManifestPathType, exinfo->root_manifest_type); ok_(__FILE__, line)(detailed_info->ulRootManifestPathChars == (exinfo->root_manifest_path ? lstrlenW(exinfo->root_manifest_path) : 0), - "detailed_info->ulRootManifestPathChars=%u, expected %u\n", + "detailed_info->ulRootManifestPathChars=%lu, expected %u\n", detailed_info->ulRootManifestPathChars, exinfo->root_manifest_path ?lstrlenW(exinfo->root_manifest_path) : 0); ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathType == exinfo->root_config_type, - "detailed_info->ulRootConfigurationPathType=%u, expected %u\n", + "detailed_info->ulRootConfigurationPathType=%lu, expected %lu\n", detailed_info->ulRootConfigurationPathType, exinfo->root_config_type); ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathChars == 0, - "detailed_info->ulRootConfigurationPathChars=%d\n", detailed_info->ulRootConfigurationPathChars); + "detailed_info->ulRootConfigurationPathChars=%ld\n", detailed_info->ulRootConfigurationPathChars); ok_(__FILE__, line)(detailed_info->ulAppDirPathType == exinfo->app_dir_type, - "detailed_info->ulAppDirPathType=%u, expected %u\n", detailed_info->ulAppDirPathType, + "detailed_info->ulAppDirPathType=%lu, expected %lu\n", detailed_info->ulAppDirPathType, exinfo->app_dir_type); ok_(__FILE__, line)(detailed_info->ulAppDirPathChars == (exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0), - "detailed_info->ulAppDirPathChars=%u, expected %u\n", + "detailed_info->ulAppDirPathChars=%lu, expected %u\n", detailed_info->ulAppDirPathChars, exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0); if(exinfo->root_manifest_path) { ok_(__FILE__, line)(detailed_info->lpRootManifestPath != NULL, "detailed_info->lpRootManifestPath == NULL\n"); @@ -789,9 +789,9 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl size = 0xdeadbeef; b = QueryActCtxW(0, handle, &id, AssemblyDetailedInformationInActivationContext, &info_tmp, sizeof(info_tmp), &size); ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n"); - ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError()); + ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %lu\n", GetLastError());
- ok_(__FILE__, line)(size >= exsize, "size=%lu, expected %lu\n", size, exsize); + ok_(__FILE__, line)(size >= exsize, "size=%Iu, expected %Iu\n", size, exsize);
if (size == 0xdeadbeef) { @@ -804,52 +804,52 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl
size = 0xdeadbeef; b = QueryActCtxW(0, handle, &id, AssemblyDetailedInformationInActivationContext, info, size, &size); - ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError()); + ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError()); if (!exinfo->manifest_path) exsize += info->ulManifestPathLength + sizeof(WCHAR); if (!exinfo->encoded_assembly_id) exsize += info->ulEncodedAssemblyIdentityLength + sizeof(WCHAR); if (exinfo->has_assembly_dir) exsize += info->ulAssemblyDirectoryNameLength + sizeof(WCHAR); - ok_(__FILE__, line)(size == exsize, "size=%lu, expected %lu\n", size, exsize); + ok_(__FILE__, line)(size == exsize, "size=%Iu, expected %Iu\n", size, exsize);
if (0) /* FIXME: flags meaning unknown */ { - ok_(__FILE__, line)((info->ulFlags) == exinfo->flags, "info->ulFlags = %x, expected %x\n", + ok_(__FILE__, line)((info->ulFlags) == exinfo->flags, "info->ulFlags = %lx, expected %lx\n", info->ulFlags, exinfo->flags); } if(exinfo->encoded_assembly_id) { len = lstrlenW(exinfo->encoded_assembly_id)*sizeof(WCHAR); ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength == len, - "info->ulEncodedAssemblyIdentityLength = %u, expected %u\n", + "info->ulEncodedAssemblyIdentityLength = %lu, expected %lu\n", info->ulEncodedAssemblyIdentityLength, len); } else { ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength != 0, "info->ulEncodedAssemblyIdentityLength == 0\n"); } ok_(__FILE__, line)(info->ulManifestPathType == ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE, - "info->ulManifestPathType = %x\n", info->ulManifestPathType); + "info->ulManifestPathType = %lx\n", info->ulManifestPathType); if(exinfo->manifest_path) { len = lstrlenW(exinfo->manifest_path)*sizeof(WCHAR); - ok_(__FILE__, line)(info->ulManifestPathLength == len, "info->ulManifestPathLength = %u, expected %u\n", + ok_(__FILE__, line)(info->ulManifestPathLength == len, "info->ulManifestPathLength = %lu, expected %lu\n", info->ulManifestPathLength, len); } else { ok_(__FILE__, line)(info->ulManifestPathLength != 0, "info->ulManifestPathLength == 0\n"); }
ok_(__FILE__, line)(info->ulPolicyPathType == ACTIVATION_CONTEXT_PATH_TYPE_NONE, - "info->ulPolicyPathType = %x\n", info->ulPolicyPathType); + "info->ulPolicyPathType = %lx\n", info->ulPolicyPathType); ok_(__FILE__, line)(info->ulPolicyPathLength == 0, - "info->ulPolicyPathLength = %u, expected 0\n", info->ulPolicyPathLength); - ok_(__FILE__, line)(info->ulMetadataSatelliteRosterIndex == 0, "info->ulMetadataSatelliteRosterIndex = %x\n", + "info->ulPolicyPathLength = %lu, expected 0\n", info->ulPolicyPathLength); + ok_(__FILE__, line)(info->ulMetadataSatelliteRosterIndex == 0, "info->ulMetadataSatelliteRosterIndex = %lx\n", info->ulMetadataSatelliteRosterIndex); - ok_(__FILE__, line)(info->ulManifestVersionMajor == 1,"info->ulManifestVersionMajor = %x\n", + ok_(__FILE__, line)(info->ulManifestVersionMajor == 1,"info->ulManifestVersionMajor = %lx\n", info->ulManifestVersionMajor); - ok_(__FILE__, line)(info->ulManifestVersionMinor == 0, "info->ulManifestVersionMinor = %x\n", + ok_(__FILE__, line)(info->ulManifestVersionMinor == 0, "info->ulManifestVersionMinor = %lx\n", info->ulManifestVersionMinor); - ok_(__FILE__, line)(info->ulPolicyVersionMajor == 0, "info->ulPolicyVersionMajor = %x\n", + ok_(__FILE__, line)(info->ulPolicyVersionMajor == 0, "info->ulPolicyVersionMajor = %lx\n", info->ulPolicyVersionMajor); - ok_(__FILE__, line)(info->ulPolicyVersionMinor == 0, "info->ulPolicyVersionMinor = %x\n", + ok_(__FILE__, line)(info->ulPolicyVersionMinor == 0, "info->ulPolicyVersionMinor = %lx\n", info->ulPolicyVersionMinor); if(exinfo->has_assembly_dir) ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength != 0, @@ -899,8 +899,8 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil b = QueryActCtxW(0, handle, &index, FileInformationInAssemblyOfAssemblyInActivationContext, &info_tmp, sizeof(info_tmp), &size); ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n"); - ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError()); - ok_(__FILE__, line)(size == exsize, "size=%lu, expected %lu\n", size, exsize); + ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %lu\n", GetLastError()); + ok_(__FILE__, line)(size == exsize, "size=%Iu, expected %Iu\n", size, exsize);
if(size == 0xdeadbeef) { @@ -912,14 +912,14 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil memset(info, 0xfe, size);
b = QueryActCtxW(0, handle, &index, FileInformationInAssemblyOfAssemblyInActivationContext, info, size, &size); - ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError()); - ok_(__FILE__, line)(!size, "size=%lu, expected 0\n", size); + ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError()); + ok_(__FILE__, line)(!size, "size=%Iu, expected 0\n", size);
- ok_(__FILE__, line)(info->ulFlags == 2, "info->ulFlags=%x, expected 2\n", info->ulFlags); + ok_(__FILE__, line)(info->ulFlags == 2, "info->ulFlags=%lx, expected 2\n", info->ulFlags); ok_(__FILE__, line)(info->ulFilenameLength == lstrlenW(filename)*sizeof(WCHAR), - "info->ulFilenameLength=%u, expected %u*sizeof(WCHAR)\n", + "info->ulFilenameLength=%lu, expected %u*sizeof(WCHAR)\n", info->ulFilenameLength, lstrlenW(filename)); - ok_(__FILE__, line)(info->ulPathLength == 0, "info->ulPathLength=%u\n", info->ulPathLength); + ok_(__FILE__, line)(info->ulPathLength == 0, "info->ulPathLength=%lu\n", info->ulPathLength); ok_(__FILE__, line)(info->lpFileName != NULL, "info->lpFileName == NULL\n"); if(info->lpFileName) ok_(__FILE__, line)(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n"); @@ -967,14 +967,14 @@ static void test_runlevel_info(HANDLE handle, const runlevel_info_t *exinfo, int return; }
- ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError()); - ok_(__FILE__, line)(retsize == size, "size=%ld, expected %ld\n", retsize, size); + ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError()); + ok_(__FILE__, line)(retsize == size, "size=%Id, expected %Id\n", retsize, size);
- ok_(__FILE__, line)(runlevel_info.ulFlags == 0, "runlevel_info.ulFlags=%x\n", runlevel_info.ulFlags); + ok_(__FILE__, line)(runlevel_info.ulFlags == 0, "runlevel_info.ulFlags=%lx\n", runlevel_info.ulFlags); ok_(__FILE__, line)(runlevel_info.RunLevel == exinfo->run_level, "runlevel_info.RunLevel=%u, expected %u\n", runlevel_info.RunLevel, exinfo->run_level); ok_(__FILE__, line)(runlevel_info.UiAccess == exinfo->ui_access, - "runlevel_info.UiAccess=%u, expected %u\n", runlevel_info.UiAccess, exinfo->ui_access); + "runlevel_info.UiAccess=%lu, expected %lu\n", runlevel_info.UiAccess, exinfo->ui_access); }
static HANDLE test_create(const char *file) @@ -992,8 +992,8 @@ static HANDLE test_create(const char *file) /* to be tested outside of this helper, including last error */ if (handle == INVALID_HANDLE_VALUE) return handle;
- ok(actctx.cbSize == sizeof(actctx), "actctx.cbSize=%d\n", actctx.cbSize); - ok(actctx.dwFlags == 0, "actctx.dwFlags=%d\n", actctx.dwFlags); + ok(actctx.cbSize == sizeof(actctx), "actctx.cbSize=%ld\n", actctx.cbSize); + ok(actctx.dwFlags == 0, "actctx.dwFlags=%ld\n", actctx.dwFlags); ok(actctx.lpSource == path, "actctx.lpSource=%p\n", actctx.lpSource); ok(actctx.wProcessorArchitecture == 0, "actctx.wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture); @@ -1030,7 +1030,7 @@ static void test_create_and_fail(const char *manifest, const char *depmanifest, ok(handle == INVALID_HANDLE_VALUE, "Unexpected context handle %p.\n", handle);
if (handle == INVALID_HANDLE_VALUE) - ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "Unexpected error %d.\n", GetLastError()); + ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "Unexpected error %ld.\n", GetLastError()); } if (handle != INVALID_HANDLE_VALUE) ReleaseActCtx( handle ); DeleteFileA("bad.manifest"); @@ -1051,7 +1051,7 @@ static void test_create_wide_and_fail(const char *manifest, BOOL fBOM) create_wide_manifest("bad.manifest", manifest, fBOM, FALSE); handle = CreateActCtxW(&actctx); ok(handle == INVALID_HANDLE_VALUE, "handle != INVALID_HANDLE_VALUE\n"); - ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "GetLastError == %u\n", GetLastError()); + ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "GetLastError == %lu\n", GetLastError());
if (handle != INVALID_HANDLE_VALUE) ReleaseActCtx( handle ); DeleteFileA("bad.manifest"); @@ -1070,7 +1070,7 @@ static void test_create_fail(void)
handle = CreateActCtxW(&actctx); ok(handle == INVALID_HANDLE_VALUE, "handle != INVALID_HANDLE_VALUE\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError == %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError == %lu\n", GetLastError());
trace("wrong_manifest1\n"); test_create_and_fail(wrong_manifest1, NULL, 0, FALSE); @@ -1203,34 +1203,34 @@ static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid data.cbSize = sizeof(data);
ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, libname, &data); - ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu\n", GetLastError()); if (!ret) return;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(data.ulLength == offsetof( struct dllredirect_data, paths[0]), "data.ulLength=%u\n", data.ulLength); + ok_(__FILE__, line)(data.ulLength == offsetof( struct dllredirect_data, paths[0]), "data.ulLength=%lu\n", data.ulLength);
if (data.lpData) { struct dllredirect_data *dlldata = (struct dllredirect_data*)data.lpData; ok_(__FILE__, line)(dlldata->size == offsetof( struct dllredirect_data, paths[dlldata->paths_count]), - "got wrong size %d\n", dlldata->size); + "got wrong size %ld\n", dlldata->size); ok_(__FILE__, line)(dlldata->flags == DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT, - "got wrong flags value %x\n", dlldata->flags); - ok_(__FILE__, line)(dlldata->total_len == 0, "got wrong total len value %d\n", dlldata->total_len); - ok_(__FILE__, line)(dlldata->paths_count == 0, "got wrong paths count value %d\n", dlldata->paths_count); - ok_(__FILE__, line)(dlldata->paths_offset == 0, "got wrong paths offset value %d\n", dlldata->paths_offset); + "got wrong flags value %lx\n", dlldata->flags); + ok_(__FILE__, line)(dlldata->total_len == 0, "got wrong total len value %ld\n", dlldata->total_len); + ok_(__FILE__, line)(dlldata->paths_count == 0, "got wrong paths count value %ld\n", dlldata->paths_count); + ok_(__FILE__, line)(dlldata->paths_offset == 0, "got wrong paths offset value %ld\n", dlldata->paths_offset); }
ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid);
memset(&data, 0xfe, sizeof(data)); @@ -1238,21 +1238,21 @@ static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid
ret = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, libname, &data); - ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu\n", GetLastError()); if (!ret) return;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength); + ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%lu\n", data.ulLength); ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid);
ReleaseActCtx(handle); @@ -1269,19 +1269,19 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, i data.cbSize = sizeof(data);
ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, clsname, &data); - ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u, class %s\n", GetLastError(), + ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu, class %s\n", GetLastError(), wine_dbgstr_w(clsname)); if (!ret) return;
header = (struct strsection_header*)data.lpSectionBase; wnddata = (struct wndclass_redirect_data*)data.lpData;
- ok_(__FILE__, line)(header->magic == 0x64487353, "got wrong magic 0x%08x\n", header->magic); - ok_(__FILE__, line)(header->count > 0, "got count %d\n", header->count); - ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(header->magic == 0x64487353, "got wrong magic 0x%08lx\n", header->magic); + ok_(__FILE__, line)(header->count > 0, "got count %ld\n", header->count); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(wnddata->size == sizeof(*wnddata), "got %d for header size\n", wnddata->size); + ok_(__FILE__, line)(wnddata->size == sizeof(*wnddata), "got %ld for header size\n", wnddata->size); if (data.lpData && wnddata->size == sizeof(*wnddata)) { static const WCHAR verW[] = {'6','.','5','.','4','.','3','!',0}; @@ -1289,10 +1289,10 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, i WCHAR *ptr; ULONG len;
- ok_(__FILE__, line)(wnddata->res == 0, "got reserved as %d\n", wnddata->res); + ok_(__FILE__, line)(wnddata->res == 0, "got reserved as %ld\n", wnddata->res); /* redirect class name (versioned or not) is stored just after header data */ - ok_(__FILE__, line)(wnddata->name_offset == wnddata->size, "got name offset as %d\n", wnddata->name_offset); - ok_(__FILE__, line)(wnddata->module_len > 0, "got module name length as %d\n", wnddata->module_len); + ok_(__FILE__, line)(wnddata->name_offset == wnddata->size, "got name offset as %ld\n", wnddata->name_offset); + ok_(__FILE__, line)(wnddata->module_len > 0, "got module name length as %ld\n", wnddata->module_len);
/* expected versioned name */ lstrcpyW(buff, verW); @@ -1300,11 +1300,11 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, i ptr = (WCHAR*)((BYTE*)wnddata + wnddata->name_offset); ok_(__FILE__, line)(!lstrcmpW(ptr, buff), "got wrong class name %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(buff)); ok_(__FILE__, line)(lstrlenW(ptr)*sizeof(WCHAR) == wnddata->name_len, - "got wrong class name length %d, expected %d\n", wnddata->name_len, lstrlenW(ptr)); + "got wrong class name length %ld, expected %d\n", wnddata->name_len, lstrlenW(ptr));
/* data length is simply header length + string data length including nulls */ len = wnddata->size + wnddata->name_len + wnddata->module_len + 2*sizeof(WCHAR); - ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); + ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
if (data.ulSectionTotalLength > wnddata->module_offset) { @@ -1318,13 +1318,13 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, i }
ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid);
memset(&data, 0xfe, sizeof(data)); @@ -1332,21 +1332,21 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, i
ret = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, clsname, &data); - ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u, class %s\n", GetLastError(), + ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu, class %s\n", GetLastError(), wine_dbgstr_w(clsname)); if (!ret) return;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(data.ulLength > 0, "data.ulLength=%u\n", data.ulLength); + ok_(__FILE__, line)(data.ulLength > 0, "data.ulLength=%lu\n", data.ulLength); ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", data.ulSectionTotalLength); + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid);
ReleaseActCtx(handle); @@ -1359,29 +1359,29 @@ static void test_find_string_fail(void)
ret = FindActCtxSectionStringW(0, NULL, 100, testlib_dll, &data); ok(!ret, "FindActCtxSectionStringW succeeded\n"); - ok(GetLastError() == ERROR_SXS_SECTION_NOT_FOUND, "GetLastError()=%u\n", GetLastError()); + ok(GetLastError() == ERROR_SXS_SECTION_NOT_FOUND, "GetLastError()=%lu\n", GetLastError());
ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib2_dll, &data); ok(!ret, "FindActCtxSectionStringW succeeded\n"); - ok(GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "GetLastError()=%u\n", GetLastError()); + ok(GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "GetLastError()=%lu\n", GetLastError());
ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib_dll, NULL); ok(!ret, "FindActCtxSectionStringW succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, NULL, &data); ok(!ret, "FindActCtxSectionStringW succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
data.cbSize = 0; ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib_dll, &data); ok(!ret, "FindActCtxSectionStringW succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
data.cbSize = 35; ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib_dll, &data); ok(!ret, "FindActCtxSectionStringW succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError()); }
@@ -1396,7 +1396,7 @@ static void test_basic_info(HANDLE handle, int line)
ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n"); ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n"); - ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags); + ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %lx\n",basic.dwFlags); ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
b = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX | QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL, @@ -1407,14 +1407,14 @@ static void test_basic_info(HANDLE handle, int line) ok_(__FILE__, line) (!b,"ActivationContextBasicInformation succeeded\n"); ok_(__FILE__, line) (size == 0,"size mismatch\n"); ok_(__FILE__, line) (GetLastError() == ERROR_INVALID_PARAMETER, "Wrong last error\n"); - ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags); + ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %lx\n",basic.dwFlags); ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n"); } else { ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n"); ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n"); - ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags); + ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %lx\n",basic.dwFlags); ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n"); } } @@ -1484,66 +1484,66 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU skip("failed for guid %s\n", wine_dbgstr_guid(clsid)); return; } - ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
comclass = (struct comclassredirect_data*)data.lpData;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(comclass->size == sizeof(*comclass), "got %d for header size\n", comclass->size); + ok_(__FILE__, line)(comclass->size == sizeof(*comclass), "got %ld for header size\n", comclass->size); if (data.lpData && comclass->size == sizeof(*comclass)) { ULONG len, miscmask; WCHAR *ptr;
- ok_(__FILE__, line)(comclass->model == ThreadingModel_Neutral, "got model %d\n", comclass->model); + ok_(__FILE__, line)(comclass->model == ThreadingModel_Neutral, "got model %ld\n", comclass->model); ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&comclass->clsid)); ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid2, clsid), "got wrong clsid2 %s\n", wine_dbgstr_guid(&comclass->clsid2)); if (tlid) ok_(__FILE__, line)(IsEqualGUID(&comclass->tlid, tlid), "got wrong tlid %s\n", wine_dbgstr_guid(&comclass->tlid)); - ok_(__FILE__, line)(comclass->name_len > 0, "got modulename len %d\n", comclass->name_len); + ok_(__FILE__, line)(comclass->name_len > 0, "got modulename len %ld\n", comclass->name_len);
if (progid) { len = comclass->size + comclass->clrdata_len; - ok_(__FILE__, line)(comclass->progid_offset == len, "got progid offset %d, expected %d\n", comclass->progid_offset, len); + ok_(__FILE__, line)(comclass->progid_offset == len, "got progid offset %ld, expected %ld\n", comclass->progid_offset, len); } else - ok_(__FILE__, line)(comclass->progid_offset == 0, "got progid offset %d, expected 0\n", comclass->progid_offset); + ok_(__FILE__, line)(comclass->progid_offset == 0, "got progid offset %ld, expected 0\n", comclass->progid_offset);
if (comclass->progid_offset) { ptr = (WCHAR*)((BYTE*)comclass + comclass->progid_offset); ok_(__FILE__, line)(!lstrcmpW(ptr, progid), "got wrong progid %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(progid)); ok_(__FILE__, line)(lstrlenW(progid)*sizeof(WCHAR) == comclass->progid_len, - "got progid name length %d\n", comclass->progid_len); + "got progid name length %ld\n", comclass->progid_len); }
/* data length is simply header length + string data length including nulls */ len = comclass->size + comclass->clrdata_len; if (comclass->progid_len) len += comclass->progid_len + sizeof(WCHAR); - ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); + ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
/* keyed data structure doesn't include module name, it's available from section data */ - ok_(__FILE__, line)(data.ulSectionTotalLength > comclass->name_offset, "got wrong offset %d\n", comclass->name_offset); + ok_(__FILE__, line)(data.ulSectionTotalLength > comclass->name_offset, "got wrong offset %ld\n", comclass->name_offset);
/* check misc fields are set */ miscmask = (comclass->flags >> 8) & 0xff; if (miscmask) { if (miscmask & MiscStatus) - ok_(__FILE__, line)(comclass->miscstatus != 0, "got miscstatus 0x%08x\n", comclass->miscstatus); + ok_(__FILE__, line)(comclass->miscstatus != 0, "got miscstatus 0x%08lx\n", comclass->miscstatus); if (miscmask & MiscStatusIcon) - ok_(__FILE__, line)(comclass->miscstatusicon != 0, "got miscstatusicon 0x%08x\n", comclass->miscstatusicon); + ok_(__FILE__, line)(comclass->miscstatusicon != 0, "got miscstatusicon 0x%08lx\n", comclass->miscstatusicon); if (miscmask & MiscStatusContent) - ok_(__FILE__, line)(comclass->miscstatuscontent != 0, "got miscstatuscontent 0x%08x\n", comclass->miscstatuscontent); + ok_(__FILE__, line)(comclass->miscstatuscontent != 0, "got miscstatuscontent 0x%08lx\n", comclass->miscstatuscontent); if (miscmask & MiscStatusThumbnail) - ok_(__FILE__, line)(comclass->miscstatusthumbnail != 0, "got miscstatusthumbnail 0x%08x\n", comclass->miscstatusthumbnail); + ok_(__FILE__, line)(comclass->miscstatusthumbnail != 0, "got miscstatusthumbnail 0x%08lx\n", comclass->miscstatusthumbnail); if (miscmask & MiscStatusDocPrint) - ok_(__FILE__, line)(comclass->miscstatusdocprint != 0, "got miscstatusdocprint 0x%08x\n", comclass->miscstatusdocprint); + ok_(__FILE__, line)(comclass->miscstatusdocprint != 0, "got miscstatusdocprint 0x%08lx\n", comclass->miscstatusdocprint); } - ok_(__FILE__, line)(!(comclass->flags & 0xffff00ff), "Unexpected flags %#x.\n", comclass->flags); + ok_(__FILE__, line)(!(comclass->flags & 0xffff00ff), "Unexpected flags %#lx.\n", comclass->flags);
/* part used for clrClass only */ if (comclass->clrdata_len) @@ -1554,24 +1554,24 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU WCHAR *ptrW;
clrclass = (struct clrclass_data*)((BYTE*)data.lpData + comclass->clrdata_offset); - ok_(__FILE__, line)(clrclass->size == sizeof(*clrclass), "clrclass: got size %d\n", clrclass->size); - ok_(__FILE__, line)(clrclass->res[0] == 0, "clrclass: got res[0]=0x%08x\n", clrclass->res[0]); - ok_(__FILE__, line)(clrclass->res[1] == 2, "clrclass: got res[1]=0x%08x\n", clrclass->res[1]); - ok_(__FILE__, line)(clrclass->module_len == lstrlenW(mscoreeW)*sizeof(WCHAR), "clrclass: got module len %d\n", clrclass->module_len); - ok_(__FILE__, line)(clrclass->module_offset > 0, "clrclass: got module offset %d\n", clrclass->module_offset); + ok_(__FILE__, line)(clrclass->size == sizeof(*clrclass), "clrclass: got size %ld\n", clrclass->size); + ok_(__FILE__, line)(clrclass->res[0] == 0, "clrclass: got res[0]=0x%08lx\n", clrclass->res[0]); + ok_(__FILE__, line)(clrclass->res[1] == 2, "clrclass: got res[1]=0x%08lx\n", clrclass->res[1]); + ok_(__FILE__, line)(clrclass->module_len == lstrlenW(mscoreeW)*sizeof(WCHAR), "clrclass: got module len %ld\n", clrclass->module_len); + ok_(__FILE__, line)(clrclass->module_offset > 0, "clrclass: got module offset %ld\n", clrclass->module_offset);
- ok_(__FILE__, line)(clrclass->name_len > 0, "clrclass: got name len %d\n", clrclass->name_len); - ok_(__FILE__, line)(clrclass->name_offset == clrclass->size, "clrclass: got name offset %d\n", clrclass->name_offset); - ok_(__FILE__, line)(clrclass->version_len > 0, "clrclass: got version len %d\n", clrclass->version_len); - ok_(__FILE__, line)(clrclass->version_offset > 0, "clrclass: got version offset %d\n", clrclass->version_offset); + ok_(__FILE__, line)(clrclass->name_len > 0, "clrclass: got name len %ld\n", clrclass->name_len); + ok_(__FILE__, line)(clrclass->name_offset == clrclass->size, "clrclass: got name offset %ld\n", clrclass->name_offset); + ok_(__FILE__, line)(clrclass->version_len > 0, "clrclass: got version len %ld\n", clrclass->version_len); + ok_(__FILE__, line)(clrclass->version_offset > 0, "clrclass: got version offset %ld\n", clrclass->version_offset);
- ok_(__FILE__, line)(clrclass->res2[0] == 0, "clrclass: got res2[0]=0x%08x\n", clrclass->res2[0]); - ok_(__FILE__, line)(clrclass->res2[1] == 0, "clrclass: got res2[1]=0x%08x\n", clrclass->res2[1]); + ok_(__FILE__, line)(clrclass->res2[0] == 0, "clrclass: got res2[0]=0x%08lx\n", clrclass->res2[0]); + ok_(__FILE__, line)(clrclass->res2[1] == 0, "clrclass: got res2[1]=0x%08lx\n", clrclass->res2[1]);
/* clrClass uses mscoree.dll as module name, but in two variants - comclass data points to module name in lower case, clsclass subsection - in upper case */ - ok_(__FILE__, line)(comclass->name_len == lstrlenW(mscoree2W)*sizeof(WCHAR), "clrclass: got com name len %d\n", comclass->name_len); - ok_(__FILE__, line)(comclass->name_offset > 0, "clrclass: got name offset %d\n", clrclass->name_offset); + ok_(__FILE__, line)(comclass->name_len == lstrlenW(mscoree2W)*sizeof(WCHAR), "clrclass: got com name len %ld\n", comclass->name_len); + ok_(__FILE__, line)(comclass->name_offset > 0, "clrclass: got name offset %ld\n", clrclass->name_offset);
ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + comclass->name_offset); ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoreeW), "clrclass: module name %s\n", wine_dbgstr_w(ptrW)); @@ -1583,23 +1583,23 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU
header = (struct guidsection_header*)data.lpSectionBase; ok_(__FILE__, line)(data.lpSectionGlobalData == ((BYTE*)header + header->names_offset), "data.lpSectionGlobalData == NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->names_len, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->names_len, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid);
/* generated guid for this class works as key guid in search */ memset(&data2, 0xfe, sizeof(data2)); data2.cbSize = sizeof(data2); ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, &comclass->alias, &data2); - ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
comclass2 = (struct comclassredirect_data*)data2.lpData; - ok_(__FILE__, line)(comclass->size == comclass2->size, "got wrong data length %d, expected %d\n", comclass2->size, comclass->size); + ok_(__FILE__, line)(comclass->size == comclass2->size, "got wrong data length %ld, expected %ld\n", comclass2->size, comclass->size); ok_(__FILE__, line)(!memcmp(comclass, comclass2, comclass->size), "got wrong data\n"); }
@@ -1632,14 +1632,14 @@ static void test_find_ifaceps_redirection(HANDLE handle, const GUID *iid, const data.cbSize = sizeof(data);
ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, iid, &data); - ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
ifaceps = (struct ifacepsredirect_data*)data.lpData;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(ifaceps->size == sizeof(*ifaceps), "got %d for header size\n", ifaceps->size); + ok_(__FILE__, line)(ifaceps->size == sizeof(*ifaceps), "got %ld for header size\n", ifaceps->size); if (data.lpData && ifaceps->size == sizeof(*ifaceps)) { ULONG len; @@ -1653,29 +1653,29 @@ static void test_find_ifaceps_redirection(HANDLE handle, const GUID *iid, const ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, iid), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid));
ok_(__FILE__, line)(IsEqualGUID(&ifaceps->tlbid, tlbid), "got wrong tlid %s\n", wine_dbgstr_guid(&ifaceps->tlbid)); - ok_(__FILE__, line)(ifaceps->name_len > 0, "got modulename len %d\n", ifaceps->name_len); - ok_(__FILE__, line)(ifaceps->name_offset == ifaceps->size, "got progid offset %d\n", ifaceps->name_offset); + ok_(__FILE__, line)(ifaceps->name_len > 0, "got modulename len %ld\n", ifaceps->name_len); + ok_(__FILE__, line)(ifaceps->name_offset == ifaceps->size, "got progid offset %ld\n", ifaceps->name_offset);
/* data length is simply header length + string data length including nulls */ len = ifaceps->size + ifaceps->name_len + sizeof(WCHAR); - ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); + ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
/* mask purpose is to indicate if attribute was specified, for testing purposes assume that manifest always has non-zero value for it */ if (ifaceps->mask & NumMethods) - ok_(__FILE__, line)(ifaceps->nummethods != 0, "got nummethods %d\n", ifaceps->nummethods); + ok_(__FILE__, line)(ifaceps->nummethods != 0, "got nummethods %ld\n", ifaceps->nummethods); if (ifaceps->mask & BaseIface) ok_(__FILE__, line)(IsEqualGUID(&ifaceps->base, base), "got base %s\n", wine_dbgstr_guid(&ifaceps->base)); }
ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid); }
@@ -1706,30 +1706,30 @@ static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *n skip("surrogate sections are not supported\n"); return; } - ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
surrogate = (struct clrsurrogate_data*)data.lpData;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(surrogate->size == sizeof(*surrogate), "got %d for header size\n", surrogate->size); + ok_(__FILE__, line)(surrogate->size == sizeof(*surrogate), "got %ld for header size\n", surrogate->size); if (data.lpData && surrogate->size == sizeof(*surrogate)) { WCHAR *ptrW; ULONG len;
- ok_(__FILE__, line)(surrogate->res == 0, "invalid res value %d\n", surrogate->res); + ok_(__FILE__, line)(surrogate->res == 0, "invalid res value %ld\n", surrogate->res); ok_(__FILE__, line)(IsEqualGUID(&surrogate->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&surrogate->clsid));
- ok_(__FILE__, line)(surrogate->version_len == lstrlenW(version)*sizeof(WCHAR), "got version len %d\n", surrogate->version_len); - ok_(__FILE__, line)(surrogate->version_offset == surrogate->size, "got version offset %d\n", surrogate->version_offset); + ok_(__FILE__, line)(surrogate->version_len == lstrlenW(version)*sizeof(WCHAR), "got version len %ld\n", surrogate->version_len); + ok_(__FILE__, line)(surrogate->version_offset == surrogate->size, "got version offset %ld\n", surrogate->version_offset);
- ok_(__FILE__, line)(surrogate->name_len == lstrlenW(name)*sizeof(WCHAR), "got name len %d\n", surrogate->name_len); - ok_(__FILE__, line)(surrogate->name_offset > surrogate->version_offset, "got name offset %d\n", surrogate->name_offset); + ok_(__FILE__, line)(surrogate->name_len == lstrlenW(name)*sizeof(WCHAR), "got name len %ld\n", surrogate->name_len); + ok_(__FILE__, line)(surrogate->name_offset > surrogate->version_offset, "got name offset %ld\n", surrogate->name_offset);
len = surrogate->size + surrogate->name_len + surrogate->version_len + 2*sizeof(WCHAR); - ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); + ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->name_offset); ok(!lstrcmpW(ptrW, name), "got wrong name %s\n", wine_dbgstr_w(ptrW)); @@ -1739,13 +1739,13 @@ static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *n }
ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid); }
@@ -1761,20 +1761,20 @@ static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const data.cbSize = sizeof(data);
ret = FindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION, progid, &data); - ok_(__FILE__, line)(ret, "FindActCtxSectionStringA failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionStringA failed: %lu\n", GetLastError());
progiddata = (struct progidredirect_data*)data.lpData;
- ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); - ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion); ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); - ok_(__FILE__, line)(progiddata->size == sizeof(*progiddata), "got %d for header size\n", progiddata->size); + ok_(__FILE__, line)(progiddata->size == sizeof(*progiddata), "got %ld for header size\n", progiddata->size); if (data.lpData && progiddata->size == sizeof(*progiddata)) { GUID *guid;
- ok_(__FILE__, line)(progiddata->reserved == 0, "got reserved as %d\n", progiddata->reserved); - ok_(__FILE__, line)(progiddata->clsid_offset > 0, "got clsid_offset as %d\n", progiddata->clsid_offset); + ok_(__FILE__, line)(progiddata->reserved == 0, "got reserved as %ld\n", progiddata->reserved); + ok_(__FILE__, line)(progiddata->clsid_offset > 0, "got clsid_offset as %ld\n", progiddata->clsid_offset);
/* progid data points to generated alias guid */ guid = (GUID*)((BYTE*)data.lpSectionBase + progiddata->clsid_offset); @@ -1782,7 +1782,7 @@ static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const memset(&data2, 0, sizeof(data2)); data2.cbSize = sizeof(data2); ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, guid, &data2); - ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
comclass = (struct comclassredirect_data*)data2.lpData; ok_(__FILE__, line)(IsEqualGUID(guid, &comclass->alias), "got wrong alias referenced from progid %s, %s\n", progid, wine_dbgstr_guid(guid)); @@ -1791,11 +1791,11 @@ static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const
header = (struct strsection_header*)data.lpSectionBase; ok_(__FILE__, line)(data.lpSectionGlobalData == (BYTE*)header + header->global_offset, "data.lpSectionGlobalData == NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->global_len, "data.ulSectionGlobalDataLength=%u\n", data.ulSectionGlobalDataLength); + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->global_len, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength); ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); - ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", data.ulSectionTotalLength); + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength); ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); - ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n", data.ulAssemblyRosterIndex, exid); }
@@ -1816,14 +1816,14 @@ static void test_wndclass_section(void) create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
handle = test_create("main_wndcls.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
DeleteFileA("testdep1.manifest"); DeleteFileA("testdep2.manifest"); DeleteFileA("main_wndcls.manifest");
ret = ActivateActCtx(handle, &cookie); - ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
memset(&data, 0, sizeof(data)); memset(&data2, 0, sizeof(data2)); @@ -1837,12 +1837,12 @@ static void test_wndclass_section(void) ok(ret, "got %d\n", ret);
section = (struct strsection_header*)data.lpSectionBase; - ok(section->count == 4, "got %d\n", section->count); - ok(section->size == sizeof(*section), "got %d\n", section->size); + ok(section->count == 4, "got %ld\n", section->count); + ok(section->size == sizeof(*section), "got %ld\n", section->size);
/* For both string same section is returned, meaning it's one wndclass section per context */ ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase); - ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %u, %u\n", data.ulSectionTotalLength, + ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %lu, %lu\n", data.ulSectionTotalLength, data2.ulSectionTotalLength);
/* wndClass1 is versioned, wndClass3 is not */ @@ -1855,7 +1855,7 @@ static void test_wndclass_section(void) ok(!lstrcmpW(ptrW, wndClass3W), "got %s\n", wine_dbgstr_w(ptrW));
ret = DeactivateActCtx(0, cookie); - ok(ret, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
ReleaseActCtx(handle); } @@ -1876,14 +1876,14 @@ static void test_dllredirect_section(void) create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
handle = test_create("main_wndcls.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
DeleteFileA("testdep1.manifest"); DeleteFileA("testdep2.manifest"); DeleteFileA("main_wndcls.manifest");
ret = ActivateActCtx(handle, &cookie); - ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
memset(&data, 0, sizeof(data)); memset(&data2, 0, sizeof(data2)); @@ -1897,16 +1897,16 @@ static void test_dllredirect_section(void) ok(ret, "got %d\n", ret);
section = (struct strsection_header*)data.lpSectionBase; - ok(section->count == 4, "got %d\n", section->count); - ok(section->size == sizeof(*section), "got %d\n", section->size); + ok(section->count == 4, "got %ld\n", section->count); + ok(section->size == sizeof(*section), "got %ld\n", section->size);
/* For both string same section is returned, meaning it's one dll redirect section per context */ ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase); - ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %u, %u\n", data.ulSectionTotalLength, + ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %lu, %lu\n", data.ulSectionTotalLength, data2.ulSectionTotalLength);
ret = DeactivateActCtx(0, cookie); - ok(ret, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
ReleaseActCtx(handle); } @@ -1927,14 +1927,14 @@ static void test_typelib_section(void) create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
handle = test_create("main_wndcls.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
DeleteFileA("testdep1.manifest"); DeleteFileA("testdep2.manifest"); DeleteFileA("main_wndcls.manifest");
ret = ActivateActCtx(handle, &cookie); - ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
memset(&data, 0, sizeof(data)); memset(&data2, 0, sizeof(data2)); @@ -1950,29 +1950,29 @@ static void test_typelib_section(void) ok(ret, "got %d\n", ret);
section = (struct guidsection_header*)data.lpSectionBase; - ok(section->count == 4, "got %d\n", section->count); - ok(section->size == sizeof(*section), "got %d\n", section->size); + ok(section->count == 4, "got %ld\n", section->count); + ok(section->size == sizeof(*section), "got %ld\n", section->size);
/* For both GUIDs same section is returned */ ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase); - ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %u, %u\n", data.ulSectionTotalLength, + ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %lu, %lu\n", data.ulSectionTotalLength, data2.ulSectionTotalLength);
ok(data.lpSectionGlobalData == ((BYTE*)section + section->names_offset), "data.lpSectionGlobalData == NULL\n"); - ok(data.ulSectionGlobalDataLength == section->names_len, "data.ulSectionGlobalDataLength=%u\n", + ok(data.ulSectionGlobalDataLength == section->names_len, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength);
/* test some actual data */ tlib = (struct tlibredirect_data*)data.lpData; - ok(tlib->size == sizeof(*tlib), "got %d\n", tlib->size); + ok(tlib->size == sizeof(*tlib), "got %ld\n", tlib->size); ok(tlib->major_version == 1, "got %d\n", tlib->major_version); ok(tlib->minor_version == 0, "got %d\n", tlib->minor_version); - ok(tlib->help_offset > 0, "got %d\n", tlib->help_offset); - ok(tlib->help_len == sizeof(helpW), "got %d\n", tlib->help_len); + ok(tlib->help_offset > 0, "got %ld\n", tlib->help_offset); + ok(tlib->help_len == sizeof(helpW), "got %ld\n", tlib->help_len); ok(tlib->flags == (LIBFLAG_FHIDDEN|LIBFLAG_FCONTROL|LIBFLAG_FRESTRICTED), "got %x\n", tlib->flags);
ret = DeactivateActCtx(0, cookie); - ok(ret, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
ReleaseActCtx(handle); } @@ -2010,7 +2010,7 @@ static void test_actctx(void)
b = GetCurrentActCtx(&handle); ok(handle == NULL, "handle = %p, expected NULL\n", handle); - ok(b, "GetCurrentActCtx failed: %u\n", GetLastError()); + ok(b, "GetCurrentActCtx failed: %lu\n", GetLastError()); if(b) { test_basic_info(handle, __LINE__); test_detailed_info(handle, &detailed_info0, __LINE__); @@ -2021,7 +2021,7 @@ static void test_actctx(void) /* test for whitespace handling in Eq ::= S? '=' S? */ create_manifest_file("test1_1.manifest", manifest1_1, -1, NULL, NULL); handle = test_create("test1_1.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test1_1.manifest"); ReleaseActCtx(handle);
@@ -2033,7 +2033,7 @@ static void test_actctx(void) trace("manifest1\n");
handle = test_create("test1.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -2045,7 +2045,7 @@ static void test_actctx(void) /* CloseHandle will generate an exception if a debugger is present */ b = CloseHandle(handle); ok(!b, "CloseHandle succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %lu\n", GetLastError()); }
ReleaseActCtx(handle); @@ -2059,7 +2059,7 @@ static void test_actctx(void) trace("manifest2 depmanifest1\n");
handle = test_create("test2.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -2078,7 +2078,7 @@ static void test_actctx(void) trace("manifest2 depmanifest2\n");
handle = test_create("test2-2.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test2-2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -2090,11 +2090,11 @@ static void test_actctx(void) test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
b = ActivateActCtx(handle, &cookie); - ok(b, "ActivateActCtx failed: %u\n", GetLastError()); + ok(b, "ActivateActCtx failed: %lu\n", GetLastError()); test_find_dll_redirection(handle, testlib_dll, 2, __LINE__); test_find_dll_redirection(handle, testlib2_dll, 2, __LINE__); b = DeactivateActCtx(0, cookie); - ok(b, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(b, "DeactivateActCtx failed: %lu\n", GetLastError());
ReleaseActCtx(handle); } @@ -2107,7 +2107,7 @@ static void test_actctx(void) }
handle = test_create("test2-3.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test2-3.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -2119,13 +2119,13 @@ static void test_actctx(void) test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
b = ActivateActCtx(handle, &cookie); - ok(b, "ActivateActCtx failed: %u\n", GetLastError()); + ok(b, "ActivateActCtx failed: %lu\n", GetLastError()); test_find_dll_redirection(handle, testlib_dll, 2, __LINE__); test_find_dll_redirection(handle, testlib2_dll, 2, __LINE__); test_find_window_class(handle, wndClassW, 2, __LINE__); test_find_window_class(handle, wndClass2W, 2, __LINE__); b = DeactivateActCtx(0, cookie); - ok(b, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(b, "DeactivateActCtx failed: %lu\n", GetLastError());
ReleaseActCtx(handle); } @@ -2139,7 +2139,7 @@ static void test_actctx(void)
handle = test_create("test3.manifest"); ok(handle != INVALID_HANDLE_VALUE || broken(handle == INVALID_HANDLE_VALUE) /* XP pre-SP2, win2k3 w/o SP */, - "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); if (handle == INVALID_HANDLE_VALUE) win_skip("Some activation context features not supported, skipping a test (possibly old XP/Win2k3 system\n"); DeleteFileA("test3.manifest"); @@ -2155,7 +2155,7 @@ static void test_actctx(void) test_file_info(handle, 0, 0, testlib_dll, __LINE__);
b = ActivateActCtx(handle, &cookie); - ok(b, "ActivateActCtx failed: %u\n", GetLastError()); + ok(b, "ActivateActCtx failed: %lu\n", GetLastError()); test_find_dll_redirection(handle, testlib_dll, 1, __LINE__); test_find_dll_redirection(handle, testlib_dll, 1, __LINE__); test_find_com_redirection(handle, &IID_CoTest, &IID_TlibTest, progidW, 1, __LINE__); @@ -2182,7 +2182,7 @@ static void test_actctx(void) test_find_string_fail();
b = DeactivateActCtx(0, cookie); - ok(b, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(b, "DeactivateActCtx failed: %lu\n", GetLastError()); ReleaseActCtx(handle); }
@@ -2207,7 +2207,7 @@ static void test_actctx(void)
if(create_manifest_file("test7.manifest", manifest7, -1, NULL, NULL)) { handle = test_create("test7.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test7.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) @@ -2223,7 +2223,7 @@ static void test_actctx(void)
if(create_manifest_file("test8.manifest", manifest8, -1, NULL, NULL)) { handle = test_create("test8.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test8.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) @@ -2239,7 +2239,7 @@ static void test_actctx(void)
if(create_manifest_file("test9.manifest", manifest9, -1, NULL, NULL)) { handle = test_create("test9.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test9.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) @@ -2253,7 +2253,7 @@ static void test_actctx(void)
if(create_manifest_file("test10.manifest", manifest10, -1, NULL, NULL)) { handle = test_create("test10.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test10.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) @@ -2268,7 +2268,7 @@ static void test_actctx(void) if (create_manifest_file("test11.manifest", manifest11, -1, NULL, NULL)) { handle = test_create("test11.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "Failed to create activation context for %s, error %u\n", + ok(handle != INVALID_HANDLE_VALUE, "Failed to create activation context for %s, error %lu\n", "manifest11", GetLastError()); DeleteFileA("test11.manifest"); if (handle != INVALID_HANDLE_VALUE) @@ -2285,7 +2285,7 @@ static void test_actctx(void) }
handle = test_create("test4.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test4.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -2306,7 +2306,7 @@ static void test_actctx(void) return; } handle = test_create("..\test1.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("..\test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -2327,7 +2327,7 @@ static void test_actctx(void) }
handle = test_create("test1.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -2343,7 +2343,7 @@ static void test_actctx(void) }
handle = test_create("test1.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -2367,7 +2367,7 @@ static void test_app_manifest(void)
b = GetCurrentActCtx(&handle); ok(handle == NULL, "handle != NULL\n"); - ok(b, "GetCurrentActCtx failed: %u\n", GetLastError()); + ok(b, "GetCurrentActCtx failed: %lu\n", GetLastError()); if(b) { test_basic_info(handle, __LINE__); test_detailed_info(handle, &detailed_info1_child, __LINE__); @@ -2383,7 +2383,7 @@ static HANDLE create_manifest(const char *filename, const char *data, int line)
handle = test_create(filename); ok_(__FILE__, line)(handle != INVALID_HANDLE_VALUE, - "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
DeleteFileA(filename); return handle; @@ -2408,7 +2408,7 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should "FindActCtxSectionStringA: expected ret = %u, got %u\n", should_find, ret); todo_wine_if(todo) ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND), - "FindActCtxSectionStringA: unexpected error %u\n", err); + "FindActCtxSectionStringA: unexpected error %lu\n", err);
memset(&data, 0xfe, sizeof(data)); data.cbSize = sizeof(data); @@ -2420,7 +2420,7 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should "FindActCtxSectionStringW: expected ret = %u, got %u\n", should_find, ret); todo_wine_if(todo) ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND), - "FindActCtxSectionStringW: unexpected error %u\n", err); + "FindActCtxSectionStringW: unexpected error %lu\n", err);
SetLastError(0); ret = FindActCtxSectionStringA(0, NULL, section, string_to_find, NULL); @@ -2428,7 +2428,7 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should ok_(__FILE__, line)(!ret, "FindActCtxSectionStringA: expected failure, got %u\n", ret); ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER, - "FindActCtxSectionStringA: unexpected error %u\n", err); + "FindActCtxSectionStringA: unexpected error %lu\n", err);
SetLastError(0); ret = FindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, NULL); @@ -2436,7 +2436,7 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should ok_(__FILE__, line)(!ret, "FindActCtxSectionStringW: expected failure, got %u\n", ret); ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER, - "FindActCtxSectionStringW: unexpected error %u\n", err); + "FindActCtxSectionStringW: unexpected error %lu\n", err);
pRtlFreeUnicodeString(&string_to_findW); } @@ -2455,12 +2455,12 @@ static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_fi ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, &data); todo_wine_if(todo) ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND), - "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret); + "RtlFindActivationContextSectionString: unexpected status 0x%lx\n", ret);
ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL); todo_wine_if(todo) ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND), - "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret); + "RtlFindActivationContextSectionString: unexpected status 0x%lx\n", ret);
pRtlFreeUnicodeString(&string_to_findW); } @@ -2473,7 +2473,7 @@ static void test_findsectionstring(void)
handle = create_manifest("test.manifest", testdep_manifest3, __LINE__); ret = ActivateActCtx(handle, &cookie); - ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
/* first we show the parameter validation from kernel32 */ kernel32_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__); @@ -2494,7 +2494,7 @@ static void test_findsectionstring(void) ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
ret = DeactivateActCtx(0, cookie); - ok(ret, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError()); ReleaseActCtx(handle); }
@@ -2529,7 +2529,7 @@ static void run_child_process(void) } sprintf(cmdline, ""%s" %s manifest1", argv[0], argv[1]); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "Could not create process: %u\n", GetLastError()); + ok(ret, "Could not create process: %lu\n", GetLastError()); wait_child_process( pi.hProcess ); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); @@ -2570,7 +2570,7 @@ static void write_manifest(const char *filename, const char *manifest) strcat(path, filename);
file = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); WriteFile(file, manifest, strlen(manifest), &size, NULL); CloseHandle(file); } @@ -2592,7 +2592,7 @@ static void extract_resource(const char *name, const char *type, const char *pat void *ptr;
file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", path, GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", path, GetLastError());
res = FindResourceA(NULL, name, type); ok( res != 0, "couldn't find resource\n" ); @@ -2621,7 +2621,7 @@ static void test_CreateActCtx(void)
/* create using lpSource without specified directory */ handle = CreateActCtxA(&actctx); - ok(handle != INVALID_HANDLE_VALUE, "failed to generate context, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "failed to generate context, error %lu\n", GetLastError()); ReleaseActCtx(handle);
/* with specified directory, that doesn't contain dependent assembly */ @@ -2637,7 +2637,7 @@ static void test_CreateActCtx(void) handle = CreateActCtxA(&actctx); todo_wine { ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); - ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "got error %d\n", GetLastError()); + ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "got error %ld\n", GetLastError()); } if (handle != INVALID_HANDLE_VALUE) ReleaseActCtx(handle);
@@ -2653,7 +2653,7 @@ todo_wine { strcat(dll, "testdep1.dll"); extract_resource("dummy.dll", "TESTDLL", dll); handle = CreateActCtxA(&actctx); - ok(handle != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX) , "got error %d\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX) , "got error %ld\n", GetLastError()); ReleaseActCtx(handle); DeleteFileA(dll);
@@ -2670,7 +2670,7 @@ todo_wine { ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); todo_wine ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY) /* XP, win2k3 */, - "got error %d\n", GetLastError()); + "got error %ld\n", GetLastError());
/* create from HMODULE - resource doesn't exist, lpSource is set */ memset(&actctx, 0, sizeof(ACTCTXA)); @@ -2683,7 +2683,7 @@ todo_wine { SetLastError(0xdeadbeef); handle = CreateActCtxA(&actctx); ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); - ok(GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "got error %d\n", GetLastError()); + ok(GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "got error %ld\n", GetLastError());
/* load manifest from lpAssemblyDirectory directory */ write_manifest("testdir.manifest", manifest1); @@ -2704,7 +2704,7 @@ todo_wine { ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); ok(GetLastError()==ERROR_PATH_NOT_FOUND || broken(GetLastError()==ERROR_FILE_NOT_FOUND) /* WinXP */, - "got error %d\n", GetLastError()); + "got error %ld\n", GetLastError());
CreateDirectoryA(dir, NULL); memset(&actctx, 0, sizeof(actctx)); @@ -2716,7 +2716,7 @@ todo_wine { SetLastError(0xdeadbeef); handle = CreateActCtxA(&actctx); ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %ld\n", GetLastError()); SetCurrentDirectoryW(work_dir);
write_manifest("assembly_dir\testdir.manifest", manifest1); @@ -2771,33 +2771,33 @@ static void test_ZombifyActCtx(void) SetLastError(0xdeadbeef); ret = ZombifyActCtx(NULL); todo_wine - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
handle = create_manifest("test.manifest", testdep_manifest3, __LINE__);
ret = GetCurrentActCtx(¤t); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(current == NULL, "got %p\n", current);
ret = ActivateActCtx(handle, &cookie); - ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
ret = GetCurrentActCtx(¤t); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(handle == current, "got %p, %p\n", current, handle);
memset(&basicinfo, 0xff, sizeof(basicinfo)); ret = QueryActCtxW(0, handle, 0, ActivationContextBasicInformation, &basicinfo, sizeof(basicinfo), NULL); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx); - ok(basicinfo.dwFlags == 0, "got %x\n", basicinfo.dwFlags); + ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
memset(&basicinfo, 0xff, sizeof(basicinfo)); ret = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, NULL, 0, ActivationContextBasicInformation, &basicinfo, sizeof(basicinfo), NULL); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx); - ok(basicinfo.dwFlags == 0, "got %x\n", basicinfo.dwFlags); + ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
ret = ZombifyActCtx(handle); todo_wine @@ -2805,19 +2805,19 @@ static void test_ZombifyActCtx(void)
memset(&basicinfo, 0xff, sizeof(basicinfo)); ret = QueryActCtxW(0, handle, 0, ActivationContextBasicInformation, &basicinfo, sizeof(basicinfo), NULL); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx); - ok(basicinfo.dwFlags == 0, "got %x\n", basicinfo.dwFlags); + ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
memset(&basicinfo, 0xff, sizeof(basicinfo)); ret = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, NULL, 0, ActivationContextBasicInformation, &basicinfo, sizeof(basicinfo), NULL); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx); - ok(basicinfo.dwFlags == 0, "got %x\n", basicinfo.dwFlags); + ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
ret = GetCurrentActCtx(¤t); - ok(ret, "got %d, error %d\n", ret, GetLastError()); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); ok(current == handle, "got %p\n", current);
/* one more time */ @@ -2826,7 +2826,7 @@ static void test_ZombifyActCtx(void) ok(ret, "got %d\n", ret);
ret = DeactivateActCtx(0, cookie); - ok(ret, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError()); ReleaseActCtx(handle); }
@@ -2863,8 +2863,8 @@ static void test_no_compat(HANDLE handle, int line) ok_(__FILE__, line)(b, "CompatibilityInformationInActivationContext failed\n"); ok_(__FILE__, line)(size == offsetof(test_act_ctx_compat_info,Elements[0]) || broken(size == offsetof(old_win10_test_act_ctx_compat_info,Elements[0])), - "size mismatch got %lu\n", size); - ok_(__FILE__, line)(compat_info.ElementCount == 0, "unexpected ElementCount %u\n", compat_info.ElementCount); + "size mismatch got %Iu\n", size); + ok_(__FILE__, line)(compat_info.ElementCount == 0, "unexpected ElementCount %lu\n", compat_info.ElementCount); }
static void test_with_compat(HANDLE handle, DWORD num_compat, DWORD num_version, @@ -2882,10 +2882,10 @@ static void test_with_compat(HANDLE handle, DWORD num_compat, DWORD num_version, ok_(__FILE__, line)(b, "CompatibilityInformationInActivationContext failed\n"); ok_(__FILE__, line)(size == offsetof(test_act_ctx_compat_info,Elements[num_compat + num_version]) || broken(size == offsetof(old_win10_test_act_ctx_compat_info,Elements[num_compat])), - "size mismatch got %lu\n", size); + "size mismatch got %Iu\n", size); ok_(__FILE__, line)(compat_info.ElementCount == num_compat + num_version || broken(compat_info.ElementCount == num_compat), - "unexpected ElementCount %u\n", compat_info.ElementCount); + "unexpected ElementCount %lu\n", compat_info.ElementCount);
if (size == offsetof(old_win10_test_act_ctx_compat_info,Elements[num_compat])) { @@ -2893,12 +2893,12 @@ static void test_with_compat(HANDLE handle, DWORD num_compat, DWORD num_version, { old_win10_test_act_ctx_compat_info *info = (old_win10_test_act_ctx_compat_info *)&compat_info; ok_(__FILE__, line)(IsEqualGUID(&info->Elements[n].Id, expected_compat[n]), - "got wrong clsid %s, expected %s for %u\n", + "got wrong clsid %s, expected %s for %lu\n", wine_dbgstr_guid(&info->Elements[n].Id), wine_dbgstr_guid(expected_compat[n]), n); ok_(__FILE__, line)(info->Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS, - "Wrong type, got %u for %u\n", (DWORD)info->Elements[n].Type, n); + "Wrong type, got %lu for %lu\n", (DWORD)info->Elements[n].Type, n); } } else @@ -2906,19 +2906,19 @@ static void test_with_compat(HANDLE handle, DWORD num_compat, DWORD num_version, for (n = 0; n < num_compat; ++n) { ok_(__FILE__, line)(IsEqualGUID(&compat_info.Elements[n].Id, expected_compat[n]), - "got wrong clsid %s, expected %s for %u\n", + "got wrong clsid %s, expected %s for %lu\n", wine_dbgstr_guid(&compat_info.Elements[n].Id), wine_dbgstr_guid(expected_compat[n]), n); ok_(__FILE__, line)(compat_info.Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS, - "Wrong type, got %u for %u\n", (DWORD)compat_info.Elements[n].Type, n); + "Wrong type, got %lu for %lu\n", (DWORD)compat_info.Elements[n].Type, n); } for (; n < num_compat + num_version; ++n) { ok_(__FILE__, line)(compat_info.Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MAXVERSIONTESTED, - "Wrong type, got %u for %u\n", (DWORD)compat_info.Elements[n].Type, n); + "Wrong type, got %lu for %lu\n", (DWORD)compat_info.Elements[n].Type, n); ok_(__FILE__, line)(compat_info.Elements[n].MaxVersionTested == expected_version[n - num_compat], - "Wrong version, got %s for %u\n", wine_dbgstr_longlong(compat_info.Elements[n].MaxVersionTested), n); + "Wrong version, got %s for %lu\n", wine_dbgstr_longlong(compat_info.Elements[n].MaxVersionTested), n); } } } @@ -2935,7 +2935,7 @@ static void test_compatibility(void) return; } handle = test_create("test1.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -2967,7 +2967,7 @@ static void test_compatibility(void) return; } handle = test_create("no_supportedOs.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("no_supportedOs.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -2984,7 +2984,7 @@ static void test_compatibility(void) return; } handle = test_create("manifest_vista.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("manifest_vista.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -3005,7 +3005,7 @@ static void test_compatibility(void) return; } handle = test_create("manifest_vista_7_8_10_81.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("manifest_vista_7_8_10_81.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -3035,7 +3035,7 @@ static void test_compatibility(void) return; } handle = test_create("manifest_other_guid.manifest"); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError()); DeleteFileA("manifest_other_guid.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -3069,100 +3069,100 @@ static void test_settings(void) } create_manifest_file( "manifest_settings.manifest", settings_manifest, -1, NULL, NULL ); handle = test_create("manifest_settings.manifest"); - ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError() ); + ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() ); DeleteFileA( "manifest_settings.manifest" );
SetLastError( 0xdeadbeef ); ret = pQueryActCtxSettingsW( 1, handle, NULL, dpiAwareW, buffer, 80, &size ); - ok( !ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( !ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pQueryActCtxSettingsW( 0, handle, dummyW, dpiAwareW, buffer, 80, &size ); - ok( !ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( !ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size ); - ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); + ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == lstrlenW( buffer ) + 1, "wrong len %lu\n", size ); + ok( size == lstrlenW( buffer ) + 1, "wrong len %Iu\n", size ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dummyW, buffer, 80, &size ); ok( !ret, "QueryActCtxSettingsW succeeded\n" ); - ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() ); ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwareW, buffer, 80, &size ); - ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); + ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size ); + ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwareW, buffer, lstrlenW(trueW) + 1, &size ); - ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); + ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size ); + ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, namespace2016W, dpiAwareW, buffer, lstrlenW(trueW) + 1, &size ); ok( !ret, "QueryActCtxSettingsW succeeded\n" ); ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND || broken( GetLastError() == ERROR_INVALID_PARAMETER ), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwarenessW, buffer, lstrlenW(trueW) + 1, &size ); ok( !ret, "QueryActCtxSettingsW succeeded\n" ); - ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() ); ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwarenessW, buffer, lstrlenW(trueW) + 1, &size ); ok( !ret, "QueryActCtxSettingsW succeeded\n" ); - ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() ); ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, namespace2016W, dpiAwarenessW, buffer, lstrlenW(trueW) + 1, &size ); ok( ret || broken( GetLastError() == ERROR_INVALID_PARAMETER ), - "QueryActCtxSettingsW failed err %u\n", GetLastError() ); + "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); if (ret) { ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size ); + ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size ); } else ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, lstrlenW(trueW), &size ); - ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); + ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size ); + ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, lstrlenW(trueW) - 1, &size ); - ok( !ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); - ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %u\n", GetLastError() ); + ok( !ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %lu\n", GetLastError() ); ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size ); + ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size ); ReleaseActCtx(handle);
create_manifest_file( "manifest_settings2.manifest", settings_manifest2, -1, NULL, NULL ); handle = test_create("manifest_settings2.manifest"); ok( handle != INVALID_HANDLE_VALUE || broken( handle == INVALID_HANDLE_VALUE ), /* <= vista */ - "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError() ); + "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() ); DeleteFileA( "manifest_settings2.manifest" ); if (handle != INVALID_HANDLE_VALUE) { @@ -3170,22 +3170,22 @@ static void test_settings(void) size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size ); - ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() ); + ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( size == lstrlenW( buffer ) + 1, "wrong len %lu\n", size ); + ok( size == lstrlenW( buffer ) + 1, "wrong len %Iu\n", size ); ReleaseActCtx(handle); }
create_manifest_file( "manifest_settings3.manifest", settings_manifest3, -1, NULL, NULL ); handle = test_create("manifest_settings3.manifest"); - ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError() ); + ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() ); DeleteFileA( "manifest_settings3.manifest" ); SetLastError( 0xdeadbeef ); size = 0xdead; memset( buffer, 0xcc, sizeof(buffer) ); ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size ); ok( !ret, "QueryActCtxSettingsW succeeded\n" ); - ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() ); ReleaseActCtx(handle); }
@@ -3228,7 +3228,7 @@ static BOOL fill_sxs_info(sxs_info *info, const char *temp, const char *path_dll info->handle_context = CreateActCtxA(&info->context); ok((info->handle_context != NULL && info->handle_context != INVALID_HANDLE_VALUE ) || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX), /* XP doesn't support manifests outside of PE files */ - "CreateActCtxA failed: %d\n", GetLastError()); + "CreateActCtxA failed: %ld\n", GetLastError()); if (GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX) { skip("Failed to create activation context.\n"); @@ -3238,7 +3238,7 @@ static BOOL fill_sxs_info(sxs_info *info, const char *temp, const char *path_dll if (do_load) { success = ActivateActCtx(info->handle_context, &info->cookie); - ok(success, "ActivateActCtx failed: %d\n", GetLastError()); + ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
info->module = LoadLibraryA("sxs_dll.dll"); ok(info->module != NULL, "LoadLibrary failed\n"); @@ -3258,22 +3258,22 @@ static void clean_sxs_info(sxs_info *info) if (*info->path_dll) { BOOL ret = DeleteFileA(info->path_dll); - ok(ret, "DeleteFileA failed for %s: %d\n", info->path_dll, GetLastError()); + ok(ret, "DeleteFileA failed for %s: %ld\n", info->path_dll, GetLastError()); } if (*info->path_manifest_exe) { BOOL ret = DeleteFileA(info->path_manifest_exe); - ok(ret, "DeleteFileA failed for %s: %d\n", info->path_manifest_exe, GetLastError()); + ok(ret, "DeleteFileA failed for %s: %ld\n", info->path_manifest_exe, GetLastError()); } if (*info->path_manifest_dll) { BOOL ret = DeleteFileA(info->path_manifest_dll); - ok(ret, "DeleteFileA failed for %s: %d\n", info->path_manifest_dll, GetLastError()); + ok(ret, "DeleteFileA failed for %s: %ld\n", info->path_manifest_dll, GetLastError()); } if (*info->path_tmp) { BOOL ret = RemoveDirectoryA(info->path_tmp); - ok(ret, "RemoveDirectoryA failed for %s: %d\n", info->path_tmp, GetLastError()); + ok(ret, "RemoveDirectoryA failed for %s: %ld\n", info->path_tmp, GetLastError()); } }
@@ -3348,7 +3348,7 @@ cleanup: if (*path_dll_local) { BOOL success = DeleteFileA(path_dll_local); - ok(success, "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError()); + ok(success, "DeleteFileA failed for %s: %ld\n", path_dll_local, GetLastError()); } clean_sxs_info(&dll); } @@ -3388,7 +3388,7 @@ cleanup: if (*path_dll_local) { BOOL success = DeleteFileA(path_dll_local); - ok(success, "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError()); + ok(success, "DeleteFileA failed for %s: %ld\n", path_dll_local, GetLastError()); } clean_sxs_info(&dll); } @@ -3414,7 +3414,7 @@ static void test_one_with_sxs_and_GetModuleHandleA(void) goto cleanup;
success = ActivateActCtx(dll.handle_context, &dll.cookie); - ok(success, "ActivateActCtx failed: %d\n", GetLastError()); + ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
module_temp = GetModuleHandleA("sxs_dll.dll"); ok (module_temp == 0, "Expected 0, got %p\n", module_temp); @@ -3429,7 +3429,7 @@ cleanup: if (*path_dll_local) { success = DeleteFileA(path_dll_local); - ok(success, "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError()); + ok(success, "DeleteFileA failed for %s: %ld\n", path_dll_local, GetLastError()); } clean_sxs_info(&dll); } @@ -3459,7 +3459,7 @@ static void test_builtin_sxs(void) handle_context = CreateActCtxA(&context); ok((handle_context != NULL && handle_context != INVALID_HANDLE_VALUE ) || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX), /* XP doesn't support manifests outside of PE files */ - "CreateActCtxA failed: %d\n", GetLastError()); + "CreateActCtxA failed: %ld\n", GetLastError()); if (GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX) { skip("Failed to create activation context.\n"); @@ -3468,12 +3468,12 @@ static void test_builtin_sxs(void)
success = ActivateActCtx(handle_context, &cookie); - ok(success, "ActivateActCtx failed: %d\n", GetLastError()); + ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
module_msvcp = LoadLibraryA("msvcp90.dll"); - ok (module_msvcp != 0 || broken(module_msvcp == 0), "LoadLibraryA failed, %d\n", GetLastError()); + ok (module_msvcp != 0 || broken(module_msvcp == 0), "LoadLibraryA failed, %ld\n", GetLastError()); module_msvcr = LoadLibraryA("msvcr90.dll"); - ok (module_msvcr != 0 || broken(module_msvcr == 0), "LoadLibraryA failed, %d\n", GetLastError()); + ok (module_msvcr != 0 || broken(module_msvcr == 0), "LoadLibraryA failed, %ld\n", GetLastError()); if (!module_msvcp || !module_msvcr) { skip("Failed to find msvcp90 or msvcr90.\n"); @@ -3495,7 +3495,7 @@ cleanup: if (*path_manifest) { success = DeleteFileA(path_manifest); - ok(success, "DeleteFileA failed for %s: %d\n", path_manifest, GetLastError()); + ok(success, "DeleteFileA failed for %s: %ld\n", path_manifest, GetLastError()); } }
@@ -3540,7 +3540,7 @@ static void run_child_process_two_dll(int run)
si.cb = sizeof(si); ret = CreateProcessA(exe, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "Could not create process: %u\n", GetLastError()); + ok(ret, "Could not create process: %lu\n", GetLastError());
wait_child_process( pi.hProcess );
@@ -3566,7 +3566,7 @@ static void test_manifest_in_module(void) ctx.lpResourceName = (LPWSTR)124; ctx.hModule = GetModuleHandleW(NULL); handle = CreateActCtxW(&ctx); - ok(handle != 0, "CreateActCtx error %u\n", GetLastError()); + ok(handle != 0, "CreateActCtx error %lu\n", GetLastError());
test_basic_info(handle, __LINE__); test_detailed_info(handle, &detailed_info3, __LINE__); diff --git a/dlls/kernel32/tests/atom.c b/dlls/kernel32/tests/atom.c index 4796d41d23d..6d37c97388f 100644 --- a/dlls/kernel32/tests/atom.c +++ b/dlls/kernel32/tests/atom.c @@ -115,20 +115,20 @@ static void test_add_atom(void) { SetLastError( 0xdeadbeef ); ok( GlobalAddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef, - "failed to add atom %lx\n", i ); + "failed to add atom %Ix\n", i ); if (unicode_OS) { SetLastError( 0xdeadbeef ); ok( GlobalAddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef, - "failed to add atom %lx\n", i ); + "failed to add atom %Ix\n", i ); } }
for (i = 0xc000; i <= 0xffff; i++) { - ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %lx\n", i ); + ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %Ix\n", i ); if (unicode_OS) - ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %lx\n", i ); + ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %Ix\n", i ); } }
@@ -196,7 +196,7 @@ static void test_get_atom_name(void) len = GlobalGetAtomNameA( (ATOM)i, buf, 2); ok(!len, "bad length %d\n", len); ok(GetLastError() == ERROR_MORE_DATA || GetLastError() == ERROR_INVALID_PARAMETER, - "wrong error conditions %u for %u\n", GetLastError(), i); + "wrong error conditions %lu for %u\n", GetLastError(), i); }
memset( buf, '.', sizeof(buf) ); @@ -229,7 +229,7 @@ static void test_get_atom_name(void) SetLastError(0xdeadbeef); len = GlobalGetAtomNameA(atom, out, 10); ok(!len, "bad length %d\n", len); - ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%u instead of %u)\n", GetLastError(), ERROR_MORE_DATA); + ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%lu instead of %u)\n", GetLastError(), ERROR_MORE_DATA); for (i = 0; i < 9; i++) { ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]); @@ -266,7 +266,7 @@ static void test_get_atom_name(void) { /* len == 0 with ERROR_MORE_DATA is on NT3.51 */ ok(len == 1 || (len == 0 && GetLastError() == ERROR_MORE_DATA), - "0x%04x: got %u with %d (expected '1' or '0' with " + "0x%04x: got %u with %ld (expected '1' or '0' with " "ERROR_MORE_DATA)\n", i, len, GetLastError()); ok(outW[1] == DOUBLE('.'), "buffer overwrite\n"); } @@ -373,20 +373,20 @@ static void test_local_add_atom(void) { SetLastError( 0xdeadbeef ); ok( AddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef, - "failed to add atom %lx\n", i ); + "failed to add atom %Ix\n", i ); if (unicode_OS) { SetLastError( 0xdeadbeef ); ok( AddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef, - "failed to add atom %lx\n", i ); + "failed to add atom %Ix\n", i ); } }
for (i = 0xc000; i <= 0xffff; i++) { - ok( !AddAtomA((LPCSTR)i), "succeeded adding %lx\n", i ); + ok( !AddAtomA((LPCSTR)i), "succeeded adding %Ix\n", i ); if (unicode_OS) - ok( !AddAtomW((LPCWSTR)i), "succeeded adding %lx\n", i ); + ok( !AddAtomW((LPCWSTR)i), "succeeded adding %Ix\n", i ); } }
@@ -472,11 +472,11 @@ static void test_local_get_atom_name(void) if (i) ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER || GetLastError() == ERROR_MORE_DATA, - "wrong error conditions %u for %u\n", GetLastError(), i); + "wrong error conditions %lu for %u\n", GetLastError(), i); else ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_MORE_DATA, - "wrong error conditions %u for %u\n", GetLastError(), i); + "wrong error conditions %lu for %u\n", GetLastError(), i); } /* test string limits & overflow */ do_initA(in, "abcdefghij", 255); @@ -505,7 +505,7 @@ static void test_local_get_atom_name(void) /* ERROR_MORE_DATA is on nt3.51 sp5 */ ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_MORE_DATA, - "wrong error code (%u)\n", GetLastError()); + "wrong error code (%lu)\n", GetLastError());
if (unicode_OS) { @@ -532,7 +532,7 @@ static void test_local_get_atom_name(void) /* ERROR_MORE_DATA is on nt3.51 sp5 */ ok(GetLastError() == ERROR_MORE_DATA || GetLastError() == (i ? ERROR_INSUFFICIENT_BUFFER : ERROR_INVALID_PARAMETER), - "wrong error conditions %u for %u\n", GetLastError(), i); + "wrong error conditions %lu for %u\n", GetLastError(), i); } do_initW(inW, "abcdefghij", 255); atom = AddAtomW(inW); @@ -560,7 +560,7 @@ static void test_local_get_atom_name(void) /* ERROR_MORE_DATA is on nt3.51 sp5 */ ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_MORE_DATA, - "wrong error code (%u)\n", GetLastError()); + "wrong error code (%lu)\n", GetLastError()); } }
diff --git a/dlls/kernel32/tests/change.c b/dlls/kernel32/tests/change.c index c0fcf00ba68..609cf30bcfa 100644 --- a/dlls/kernel32/tests/change.c +++ b/dlls/kernel32/tests/change.c @@ -51,7 +51,7 @@ static DWORD CALLBACK NotificationThread(LPVOID arg) }
ret = FindCloseChangeNotification(change); - ok( ret, "FindCloseChangeNotification error: %d\n", + ok( ret, "FindCloseChangeNotification error: %ld\n", GetLastError());
ExitThread((DWORD)notified); @@ -63,10 +63,10 @@ static HANDLE StartNotificationThread(LPCSTR path, BOOL subtree, DWORD flags) DWORD threadId;
change = FindFirstChangeNotificationA(path, subtree, flags); - ok(change != INVALID_HANDLE_VALUE, "FindFirstChangeNotification error: %d\n", GetLastError()); + ok(change != INVALID_HANDLE_VALUE, "FindFirstChangeNotification error: %ld\n", GetLastError());
thread = CreateThread(NULL, 0, NotificationThread, change, 0, &threadId); - ok(thread != NULL, "CreateThread error: %d\n", GetLastError()); + ok(thread != NULL, "CreateThread error: %ld\n", GetLastError());
return thread; } @@ -76,7 +76,7 @@ static DWORD FinishNotificationThread(HANDLE thread) DWORD status, exitcode;
status = WaitForSingleObject(thread, 5000); - ok(status == WAIT_OBJECT_0, "WaitForSingleObject status %d error %d\n", status, GetLastError()); + ok(status == WAIT_OBJECT_0, "WaitForSingleObject status %ld error %ld\n", status, GetLastError());
ok(GetExitCodeThread(thread, &exitcode), "Could not retrieve thread exit code\n"); CloseHandle(thread); @@ -100,46 +100,46 @@ static void test_FindFirstChangeNotification(void) change = FindFirstChangeNotificationA("not-a-file", FALSE, FILE_NOTIFY_CHANGE_FILE_NAME); ok(change == INVALID_HANDLE_VALUE, "Expected INVALID_HANDLE_VALUE, got %p\n", change); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "FindFirstChangeNotification error: %d\n", GetLastError()); + "FindFirstChangeNotification error: %ld\n", GetLastError());
change = FindFirstChangeNotificationA(NULL, FALSE, FILE_NOTIFY_CHANGE_FILE_NAME); ok(change == INVALID_HANDLE_VALUE || broken(change == NULL) /* < win7 */, "Expected INVALID_HANDLE_VALUE, got %p\n", change); ok(GetLastError() == ERROR_PATH_NOT_FOUND, - "FindFirstChangeNotification error: %u\n", GetLastError()); + "FindFirstChangeNotification error: %lu\n", GetLastError());
ret = FindNextChangeNotification(NULL); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FindNextChangeNotification error: %d\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FindNextChangeNotification error: %ld\n", GetLastError());
ret = FindCloseChangeNotification(NULL); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FindCloseChangeNotification error: %d\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FindCloseChangeNotification error: %ld\n", GetLastError());
ret = GetTempPathA(MAX_PATH, dirname1); - ok(ret, "GetTempPathA error: %d\n", GetLastError()); + ok(ret, "GetTempPathA error: %ld\n", GetLastError());
ret = GetTempFileNameA(dirname1, "ffc", 0, workdir); - ok(ret, "GetTempFileNameA error: %d\n", GetLastError()); + ok(ret, "GetTempFileNameA error: %ld\n", GetLastError()); DeleteFileA( workdir );
ret = CreateDirectoryA(workdir, NULL); - ok(ret, "CreateDirectoryA error: %d\n", GetLastError()); + ok(ret, "CreateDirectoryA error: %ld\n", GetLastError());
ret = GetTempFileNameA(workdir, prefix, 0, filename1); - ok(ret, "GetTempFileNameA error: %d\n", GetLastError()); + ok(ret, "GetTempFileNameA error: %ld\n", GetLastError());
file = CreateFileA(filename1, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %ld\n", GetLastError()); ret = CloseHandle(file); - ok( ret, "CloseHandle error: %d\n", GetLastError()); + ok( ret, "CloseHandle error: %ld\n", GetLastError());
/* Try to register notification for a file */ change = FindFirstChangeNotificationA(filename1, FALSE, FILE_NOTIFY_CHANGE_FILE_NAME); ok(change == INVALID_HANDLE_VALUE, "Expected INVALID_HANDLE_VALUE, got %p\n", change); ok(GetLastError() == ERROR_DIRECTORY, - "FindFirstChangeNotification error: %d\n", GetLastError()); + "FindFirstChangeNotification error: %ld\n", GetLastError());
lstrcpyA(dirname1, filename1); lstrcatA(dirname1, "dir"); @@ -148,18 +148,18 @@ static void test_FindFirstChangeNotification(void) lstrcatA(dirname2, "new");
ret = CreateDirectoryA(dirname1, NULL); - ok(ret, "CreateDirectoryA error: %d\n", GetLastError()); + ok(ret, "CreateDirectoryA error: %ld\n", GetLastError());
/* What if we move the directory we registered notification for? */ thread = StartNotificationThread(dirname1, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); ret = MoveFileA(dirname1, dirname2); - ok(ret, "MoveFileA error: %d\n", GetLastError()); + ok(ret, "MoveFileA error: %ld\n", GetLastError()); ok(!FinishNotificationThread(thread), "Got notification\n");
/* What if we remove the directory we registered notification for? */ thread = StartNotificationThread(dirname2, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); ret = RemoveDirectoryA(dirname2); - ok(ret, "RemoveDirectoryA error: %d\n", GetLastError()); + ok(ret, "RemoveDirectoryA error: %ld\n", GetLastError()); ret = FinishNotificationThread(thread); todo_wine ok(ret, "Missed notification\n");
@@ -168,19 +168,19 @@ static void test_FindFirstChangeNotification(void) /* Create a directory */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); ret = CreateDirectoryA(dirname1, NULL); - ok(ret, "CreateDirectoryA error: %d\n", GetLastError()); + ok(ret, "CreateDirectoryA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* Rename a directory */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); ret = MoveFileA(dirname1, dirname2); - ok(ret, "MoveFileA error: %d\n", GetLastError()); + ok(ret, "MoveFileA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* Delete a directory */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_DIR_NAME); ret = RemoveDirectoryA(dirname2); - ok(ret, "RemoveDirectoryA error: %d\n", GetLastError()); + ok(ret, "RemoveDirectoryA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
lstrcpyA(filename2, filename1); @@ -189,64 +189,64 @@ static void test_FindFirstChangeNotification(void) /* Rename a file */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_FILE_NAME); ret = MoveFileA(filename1, filename2); - ok(ret, "MoveFileA error: %d\n", GetLastError()); + ok(ret, "MoveFileA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* Delete a file */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_FILE_NAME); ret = DeleteFileA(filename2); - ok(ret, "DeleteFileA error: %d\n", GetLastError()); + ok(ret, "DeleteFileA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* Create a file */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_FILE_NAME); file = CreateFileA(filename2, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %ld\n", GetLastError()); ret = CloseHandle(file); - ok( ret, "CloseHandle error: %d\n", GetLastError()); + ok( ret, "CloseHandle error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
attributes = GetFileAttributesA(filename2); - ok(attributes != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA error: %d\n", GetLastError()); + ok(attributes != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA error: %ld\n", GetLastError()); attributes &= FILE_ATTRIBUTE_READONLY;
/* Change file attributes */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_ATTRIBUTES); ret = SetFileAttributesA(filename2, attributes); - ok(ret, "SetFileAttributesA error: %d\n", GetLastError()); + ok(ret, "SetFileAttributesA error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* Change last write time by writing to a file */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE); file = CreateFileA(filename2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %ld\n", GetLastError()); memset(buffer, 0, sizeof(buffer)); ret = WriteFile(file, buffer, sizeof(buffer), &count, NULL); - ok(ret && count == sizeof(buffer), "WriteFile error: %d\n", GetLastError()); + ok(ret && count == sizeof(buffer), "WriteFile error: %ld\n", GetLastError()); ret = CloseHandle(file); - ok( ret, "CloseHandle error: %d\n", GetLastError()); + ok( ret, "CloseHandle error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* Change file size by truncating a file */ thread = StartNotificationThread(workdir, FALSE, FILE_NOTIFY_CHANGE_SIZE); file = CreateFileA(filename2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA error: %ld\n", GetLastError()); ret = WriteFile(file, buffer, sizeof(buffer) / 2, &count, NULL); - ok(ret && count == sizeof(buffer) / 2, "WriteFileA error: %d\n", GetLastError()); + ok(ret && count == sizeof(buffer) / 2, "WriteFileA error: %ld\n", GetLastError()); ret = CloseHandle(file); - ok( ret, "CloseHandle error: %d\n", GetLastError()); + ok( ret, "CloseHandle error: %ld\n", GetLastError()); ok(FinishNotificationThread(thread), "Missed notification\n");
/* clean up */
ret = DeleteFileA(filename2); - ok(ret, "DeleteFileA error: %d\n", GetLastError()); + ok(ret, "DeleteFileA error: %ld\n", GetLastError());
ret = RemoveDirectoryA(workdir); - ok(ret, "RemoveDirectoryA error: %d\n", GetLastError()); + ok(ret, "RemoveDirectoryA error: %ld\n", GetLastError()); }
/* this test concentrates more on the wait behaviour of the handle */ @@ -287,7 +287,7 @@ static void test_ffcn(void)
file = CreateFileW( filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); CloseHandle(file);
r = WaitForSingleObject( handle, 0 ); @@ -364,20 +364,20 @@ static void test_ffcnMultipleThreads(void) char tmp[MAX_PATH], path[MAX_PATH];
r = GetTempPathA(MAX_PATH, tmp); - ok(r, "GetTempPathA error: %d\n", GetLastError()); + ok(r, "GetTempPathA error: %ld\n", GetLastError());
r = GetTempFileNameA(tmp, "ffc", 0, path); - ok(r, "GetTempFileNameA error: %d\n", GetLastError()); + ok(r, "GetTempFileNameA error: %ld\n", GetLastError()); DeleteFileA( path );
r = CreateDirectoryA(path, NULL); - ok(r, "CreateDirectoryA error: %d\n", GetLastError()); + ok(r, "CreateDirectoryA error: %ld\n", GetLastError());
filter = FILE_NOTIFY_CHANGE_FILE_NAME; filter |= FILE_NOTIFY_CHANGE_DIR_NAME;
handles[0] = FindFirstChangeNotificationA(path, FALSE, filter); - ok(handles[0] != INVALID_HANDLE_VALUE, "FindFirstChangeNotification error: %d\n", GetLastError()); + ok(handles[0] != INVALID_HANDLE_VALUE, "FindFirstChangeNotification error: %ld\n", GetLastError());
/* Test behavior if a waiting thread holds the last reference to a change * directory object with an empty wine user APC queue for this thread (bug #7286) */ @@ -385,10 +385,10 @@ static void test_ffcnMultipleThreads(void) /* Create our notification thread */ handles[1] = CreateThread(NULL, 0, NotificationThread, handles[0], 0, &threadId); - ok(handles[1] != NULL, "CreateThread error: %d\n", GetLastError()); + ok(handles[1] != NULL, "CreateThread error: %ld\n", GetLastError());
status = WaitForMultipleObjects(2, handles, FALSE, 5000); - ok(status == WAIT_OBJECT_0 || status == WAIT_OBJECT_0+1, "WaitForMultipleObjects status %d error %d\n", status, GetLastError()); + ok(status == WAIT_OBJECT_0 || status == WAIT_OBJECT_0+1, "WaitForMultipleObjects status %ld error %ld\n", status, GetLastError()); ok(GetExitCodeThread(handles[1], &exitcode), "Could not retrieve thread exit code\n");
/* Clean up */ @@ -614,18 +614,18 @@ static void test_readdirectorychanges(void) /* we may get a notification for the parent dir too */ if (pfni->Action == FILE_ACTION_MODIFIED && pfni->NextEntryOffset) { - ok( pfni->FileNameLength == 3*sizeof(WCHAR), "len wrong %u\n", pfni->FileNameLength ); + ok( pfni->FileNameLength == 3*sizeof(WCHAR), "len wrong %lu\n", pfni->FileNameLength ); ok( !memcmp(pfni->FileName,&szGa[1],3*sizeof(WCHAR)), "name wrong\n" ); pfni = (PFILE_NOTIFY_INFORMATION)((char *)pfni + pfni->NextEntryOffset); } - ok( pfni->NextEntryOffset == 0, "offset wrong %u\n", pfni->NextEntryOffset ); - ok( pfni->Action == FILE_ACTION_REMOVED, "action wrong %u\n", pfni->Action ); - ok( pfni->FileNameLength == 6*sizeof(WCHAR), "len wrong %u\n", pfni->FileNameLength ); + ok( pfni->NextEntryOffset == 0, "offset wrong %lu\n", pfni->NextEntryOffset ); + ok( pfni->Action == FILE_ACTION_REMOVED, "action wrong %lu\n", pfni->Action ); + ok( pfni->FileNameLength == 6*sizeof(WCHAR), "len wrong %lu\n", pfni->FileNameLength ); ok( !memcmp(pfni->FileName,&szGa[1],6*sizeof(WCHAR)), "name wrong\n" );
ok( (NTSTATUS)ov.Internal == STATUS_SUCCESS, "ov.Internal wrong\n"); dwCount = (char *)&pfni->FileName[pfni->FileNameLength/sizeof(WCHAR)] - buffer; - ok( ov.InternalHigh == dwCount, "ov.InternalHigh wrong %lu/%u\n",ov.InternalHigh, dwCount ); + ok( ov.InternalHigh == dwCount, "ov.InternalHigh wrong %Iu/%lu\n",ov.InternalHigh, dwCount );
CloseHandle(hdir);
@@ -799,7 +799,7 @@ static void test_readdirectorychanges_filedir(void)
static void CALLBACK readdirectorychanges_cr(DWORD error, DWORD len, LPOVERLAPPED ov) { - ok(error == 0, "ReadDirectoryChangesW error %d\n", error); + ok(error == 0, "ReadDirectoryChangesW error %ld\n", error); ok(ov->hEvent == (void*)0xdeadbeef, "hEvent should not have changed\n"); }
@@ -853,9 +853,9 @@ static void test_readdirectorychanges_cr(void) r = SleepEx(1000, TRUE); ok(r != 0, "failed to receive file creation event\n"); ok(fni->NextEntryOffset == 0, "there should be no more events in buffer\n"); - ok(fni->Action == FILE_ACTION_ADDED, "Action = %d\n", fni->Action); + ok(fni->Action == FILE_ACTION_ADDED, "Action = %ld\n", fni->Action); ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), - "FileNameLength = %d\n", fni->FileNameLength); + "FileNameLength = %ld\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR)));
@@ -873,9 +873,9 @@ static void test_readdirectorychanges_cr(void) r = SleepEx(1000, TRUE); ok(r != 0, "failed to receive file move event\n"); ok(fni->NextEntryOffset == 0, "there should be no more events in buffer\n"); - ok(fni->Action == FILE_ACTION_REMOVED, "Action = %d\n", fni->Action); + ok(fni->Action == FILE_ACTION_REMOVED, "Action = %ld\n", fni->Action); ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), - "FileNameLength = %d\n", fni->FileNameLength); + "FileNameLength = %ld\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR)));
@@ -889,9 +889,9 @@ static void test_readdirectorychanges_cr(void) r = SleepEx(1000, TRUE); ok(r != 0, "failed to receive file move event\n"); ok(fni->NextEntryOffset == 0, "there should be no more events in buffer\n"); - ok(fni->Action == FILE_ACTION_ADDED, "Action = %d\n", fni->Action); + ok(fni->Action == FILE_ACTION_ADDED, "Action = %ld\n", fni->Action); ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), - "FileNameLength = %d\n", fni->FileNameLength); + "FileNameLength = %ld\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR)));
@@ -905,9 +905,9 @@ static void test_readdirectorychanges_cr(void) r = SleepEx(1000, TRUE); ok(r != 0, "failed to receive file removal event\n"); ok(fni->NextEntryOffset == 0, "there should be no more events in buffer\n"); - ok(fni->Action == FILE_ACTION_REMOVED, "Action = %d\n", fni->Action); + ok(fni->Action == FILE_ACTION_REMOVED, "Action = %ld\n", fni->Action); ok(fni->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), - "FileNameLength = %d\n", fni->FileNameLength); + "FileNameLength = %ld\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR)));
@@ -929,17 +929,17 @@ static void test_readdirectorychanges_cr(void) ok(r != 0, "failed to receive directory move event\n"); if (fni->Action == FILE_ACTION_RENAMED_OLD_NAME) { - ok(fni->Action == FILE_ACTION_RENAMED_OLD_NAME, "Action = %d\n", fni->Action); + ok(fni->Action == FILE_ACTION_RENAMED_OLD_NAME, "Action = %ld\n", fni->Action); ok(fni->FileNameLength == lstrlenW(szDir)*sizeof(WCHAR), - "FileNameLength = %d\n", fni->FileNameLength); + "FileNameLength = %ld\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szDir, lstrlenW(szDir)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); ok(fni->NextEntryOffset != 0, "no next entry in movement event\n"); fni_next = (FILE_NOTIFY_INFORMATION*)((char*)fni+fni->NextEntryOffset); ok(fni_next->NextEntryOffset == 0, "there should be no more events in buffer\n"); - ok(fni_next->Action == FILE_ACTION_RENAMED_NEW_NAME, "Action = %d\n", fni_next->Action); + ok(fni_next->Action == FILE_ACTION_RENAMED_NEW_NAME, "Action = %ld\n", fni_next->Action); ok(fni_next->FileNameLength == lstrlenW(szFile)*sizeof(WCHAR), - "FileNameLength = %d\n", fni_next->FileNameLength); + "FileNameLength = %ld\n", fni_next->FileNameLength); ok(!memcmp(fni_next->FileName, szFile, lstrlenW(szFile)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni_next->FileName, fni_next->FileNameLength/sizeof(WCHAR))); } @@ -970,9 +970,9 @@ static void test_readdirectorychanges_cr(void)
r = SleepEx(1000, TRUE); ok(r != 0, "failed to receive directory creation event\n"); - ok(fni->Action == FILE_ACTION_ADDED, "Action = %d\n", fni->Action); + ok(fni->Action == FILE_ACTION_ADDED, "Action = %ld\n", fni->Action); ok(fni->FileNameLength == lstrlenW(szDir)*sizeof(WCHAR), - "FileNameLength = %d\n", fni->FileNameLength); + "FileNameLength = %ld\n", fni->FileNameLength); ok(!memcmp(fni->FileName, szDir, lstrlenW(szDir)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni->FileName, fni->FileNameLength/sizeof(WCHAR))); if (fni->NextEntryOffset) @@ -988,9 +988,9 @@ static void test_readdirectorychanges_cr(void) fni_next = fni; } ok(fni_next->NextEntryOffset == 0, "there should be no more events in buffer\n"); - ok(fni_next->Action == FILE_ACTION_REMOVED, "Action = %d\n", fni_next->Action); + ok(fni_next->Action == FILE_ACTION_REMOVED, "Action = %ld\n", fni_next->Action); ok(fni_next->FileNameLength == lstrlenW(szDir)*sizeof(WCHAR), - "FileNameLength = %d\n", fni_next->FileNameLength); + "FileNameLength = %ld\n", fni_next->FileNameLength); ok(!memcmp(fni_next->FileName, szDir, lstrlenW(szDir)*sizeof(WCHAR)), "FileName = %s\n", wine_dbgstr_wn(fni_next->FileName, fni_next->FileNameLength/sizeof(WCHAR)));
@@ -1010,21 +1010,21 @@ static void test_ffcn_directory_overlap(void) /* Setup directory hierarchy */ ret = GetTempPathA(MAX_PATH, workdir); ok((ret > 0) && (ret <= MAX_PATH), - "GetTempPathA error: %d\n", GetLastError()); + "GetTempPathA error: %ld\n", GetLastError());
ret = GetTempFileNameA(workdir, "fcn", 0, tempfile); - ok(ret, "GetTempFileNameA error: %d\n", GetLastError()); + ok(ret, "GetTempFileNameA error: %ld\n", GetLastError()); ret = DeleteFileA(tempfile); - ok(ret, "DeleteFileA error: %d\n", GetLastError()); + ok(ret, "DeleteFileA error: %ld\n", GetLastError());
lstrcpyA(parentdir, tempfile); ret = CreateDirectoryA(parentdir, NULL); - ok(ret, "CreateDirectoryA error: %d\n", GetLastError()); + ok(ret, "CreateDirectoryA error: %ld\n", GetLastError());
lstrcpyA(childdir, parentdir); lstrcatA(childdir, "\c"); ret = CreateDirectoryA(childdir, NULL); - ok(ret, "CreateDirectoryA error: %d\n", GetLastError()); + ok(ret, "CreateDirectoryA error: %ld\n", GetLastError());
/* When recursively watching overlapping directories, changes in child @@ -1036,7 +1036,7 @@ static void test_ffcn_directory_overlap(void)
/* Create a file in child */ ret = GetTempFileNameA(childdir, "fcn", 0, tempfile); - ok(ret, "GetTempFileNameA error: %d\n", GetLastError()); + ok(ret, "GetTempFileNameA error: %ld\n", GetLastError());
/* Both watches should trigger */ ret = FinishNotificationThread(parent_thread); @@ -1045,7 +1045,7 @@ static void test_ffcn_directory_overlap(void) ok(ret, "Missed child notification\n");
ret = DeleteFileA(tempfile); - ok(ret, "DeleteFileA error: %d\n", GetLastError()); + ok(ret, "DeleteFileA error: %ld\n", GetLastError());
/* Removing a recursive parent watch should not affect child watches. Doing @@ -1053,22 +1053,22 @@ static void test_ffcn_directory_overlap(void) parent_watch = FindFirstChangeNotificationA(parentdir, TRUE, FILE_NOTIFY_CHANGE_FILE_NAME); ok(parent_watch != INVALID_HANDLE_VALUE, - "FindFirstChangeNotification error: %d\n", GetLastError()); + "FindFirstChangeNotification error: %ld\n", GetLastError()); child_watch = FindFirstChangeNotificationA(childdir, TRUE, FILE_NOTIFY_CHANGE_FILE_NAME); ok(child_watch != INVALID_HANDLE_VALUE, - "FindFirstChangeNotification error: %d\n", GetLastError()); + "FindFirstChangeNotification error: %ld\n", GetLastError());
ret = FindCloseChangeNotification(parent_watch); - ok(ret, "FindCloseChangeNotification error: %d\n", GetLastError()); + ok(ret, "FindCloseChangeNotification error: %ld\n", GetLastError());
child_thread = CreateThread(NULL, 0, NotificationThread, child_watch, 0, &threadId); - ok(child_thread != NULL, "CreateThread error: %d\n", GetLastError()); + ok(child_thread != NULL, "CreateThread error: %ld\n", GetLastError());
/* Create a file in child */ ret = GetTempFileNameA(childdir, "fcn", 0, tempfile); - ok(ret, "GetTempFileNameA error: %d\n", GetLastError()); + ok(ret, "GetTempFileNameA error: %ld\n", GetLastError());
/* Child watch should trigger */ ret = FinishNotificationThread(child_thread); @@ -1076,13 +1076,13 @@ static void test_ffcn_directory_overlap(void)
/* clean up */ ret = DeleteFileA(tempfile); - ok(ret, "DeleteFileA error: %d\n", GetLastError()); + ok(ret, "DeleteFileA error: %ld\n", GetLastError());
ret = RemoveDirectoryA(childdir); - ok(ret, "RemoveDirectoryA error: %d\n", GetLastError()); + ok(ret, "RemoveDirectoryA error: %ld\n", GetLastError());
ret = RemoveDirectoryA(parentdir); - ok(ret, "RemoveDirectoryA error: %d\n", GetLastError()); + ok(ret, "RemoveDirectoryA error: %ld\n", GetLastError()); }
START_TEST(change) diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c index 42e49888e05..33eeebcc617 100644 --- a/dlls/kernel32/tests/codepage.c +++ b/dlls/kernel32/tests/codepage.c @@ -40,7 +40,7 @@ static void test_destination_buffer(void)
SetLastError(0xdeadbeef); needed = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, NULL, 0, NULL, NULL); - ok( (needed > 0), "returned %d with %u (expected '> 0')\n", + ok( (needed > 0), "returned %d with %lu (expected '> 0')\n", needed, GetLastError());
maxsize = needed*2; @@ -52,14 +52,14 @@ static void test_destination_buffer(void) buffer[maxsize] = '\0'; SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, needed+1, NULL, NULL); - ok( (len > 0), "returned %d with %u and '%s' (expected '> 0')\n", + ok( (len > 0), "returned %d with %lu and '%s' (expected '> 0')\n", len, GetLastError(), buffer);
memset(buffer, 'x', maxsize); buffer[maxsize] = '\0'; SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, needed, NULL, NULL); - ok( (len > 0), "returned %d with %u and '%s' (expected '> 0')\n", + ok( (len > 0), "returned %d with %lu and '%s' (expected '> 0')\n", len, GetLastError(), buffer);
memset(buffer, 'x', maxsize); @@ -67,7 +67,7 @@ static void test_destination_buffer(void) SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, needed-1, NULL, NULL); ok( !len && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), - "returned %d with %u and '%s' (expected '0' with " + "returned %d with %lu and '%s' (expected '0' with " "ERROR_INSUFFICIENT_BUFFER)\n", len, GetLastError(), buffer);
memset(buffer, 'x', maxsize); @@ -75,18 +75,18 @@ static void test_destination_buffer(void) SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, 1, NULL, NULL); ok( !len && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), - "returned %d with %u and '%s' (expected '0' with " + "returned %d with %lu and '%s' (expected '0' with " "ERROR_INSUFFICIENT_BUFFER)\n", len, GetLastError(), buffer);
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, 0, NULL, NULL); - ok( (len > 0), "returned %d with %u (expected '> 0')\n", + ok( (len > 0), "returned %d with %lu (expected '> 0')\n", len, GetLastError());
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, NULL, needed, NULL, NULL); ok( !len && (GetLastError() == ERROR_INVALID_PARAMETER), - "returned %d with %u (expected '0' with " + "returned %d with %lu (expected '0' with " "ERROR_INVALID_PARAMETER)\n", len, GetLastError());
HeapFree(GetProcessHeap(), 0, buffer); @@ -102,14 +102,14 @@ static void test_null_source(void) len = WideCharToMultiByte(CP_ACP, 0, NULL, 0, NULL, 0, NULL, NULL); GLE = GetLastError(); ok(!len && GLE == ERROR_INVALID_PARAMETER, - "WideCharToMultiByte returned %d with GLE=%u (expected 0 with ERROR_INVALID_PARAMETER)\n", + "WideCharToMultiByte returned %d with GLE=%lu (expected 0 with ERROR_INVALID_PARAMETER)\n", len, GLE);
SetLastError(0); len = WideCharToMultiByte(CP_ACP, 0, NULL, -1, NULL, 0, NULL, NULL); GLE = GetLastError(); ok(!len && GLE == ERROR_INVALID_PARAMETER, - "WideCharToMultiByte returned %d with GLE=%u (expected 0 with ERROR_INVALID_PARAMETER)\n", + "WideCharToMultiByte returned %d with GLE=%lu (expected 0 with ERROR_INVALID_PARAMETER)\n", len, GLE); }
@@ -124,7 +124,7 @@ static void test_negative_source_length(void) memset(buf,'x',sizeof(buf)); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -2002, buf, 10, NULL, NULL); ok(len == 7 && GetLastError() == 0xdeadbeef, - "WideCharToMultiByte(-2002): len=%d error=%u\n", len, GetLastError()); + "WideCharToMultiByte(-2002): len=%d error=%lu\n", len, GetLastError()); ok(!lstrcmpA(buf, "foobar"), "WideCharToMultiByte(-2002): expected "foobar" got "%s"\n", buf);
@@ -132,13 +132,13 @@ static void test_negative_source_length(void) memset(bufW,'x',sizeof(bufW)); len = MultiByteToWideChar(CP_ACP, 0, "foobar", -2002, bufW, 10); ok(len == 7 && !lstrcmpW(bufW, foobarW) && GetLastError() == 0xdeadbeef, - "MultiByteToWideChar(-2002): len=%d error=%u\n", len, GetLastError()); + "MultiByteToWideChar(-2002): len=%d error=%lu\n", len, GetLastError());
SetLastError(0xdeadbeef); memset(bufW, 'x', sizeof(bufW)); len = MultiByteToWideChar(CP_ACP, 0, "foobar", -1, bufW, 6); ok(len == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "MultiByteToWideChar(-1): len=%d error=%u\n", len, GetLastError()); + "MultiByteToWideChar(-1): len=%d error=%lu\n", len, GetLastError()); }
#define LONGBUFLEN 100000 @@ -156,33 +156,33 @@ static void test_negative_dest_length(void) memset(bufA,'x',sizeof(bufA)); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1, NULL, NULL); ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, - "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError()); + "WideCharToMultiByte(destlen -1): len=%d error=%lx\n", len, GetLastError());
SetLastError( 0xdeadbeef ); memset(bufW,'x',sizeof(bufW)); len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1, bufW, -1); ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, - "MultiByteToWideChar(destlen -1): len=%d error=%x\n", len, GetLastError()); + "MultiByteToWideChar(destlen -1): len=%d error=%lx\n", len, GetLastError());
/* Test return on -1000 dest length */ SetLastError( 0xdeadbeef ); memset(bufA,'x',sizeof(bufA)); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1000, NULL, NULL); ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, - "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError()); + "WideCharToMultiByte(destlen -1000): len=%d error=%lx\n", len, GetLastError());
SetLastError( 0xdeadbeef ); memset(bufW,'x',sizeof(bufW)); len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1000, bufW, -1); ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, - "MultiByteToWideChar(destlen -1000): len=%d error=%x\n", len, GetLastError()); + "MultiByteToWideChar(destlen -1000): len=%d error=%lx\n", len, GetLastError());
/* Test return on INT_MAX dest length */ SetLastError( 0xdeadbeef ); memset(bufA,'x',sizeof(bufA)); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, INT_MAX, NULL, NULL); ok(len == 7 && !lstrcmpA(bufA, "foobar") && GetLastError() == 0xdeadbeef, - "WideCharToMultiByte(destlen INT_MAX): len=%d error=%x\n", len, GetLastError()); + "WideCharToMultiByte(destlen INT_MAX): len=%d error=%lx\n", len, GetLastError());
/* Test return on INT_MAX dest length and very long input */ SetLastError( 0xdeadbeef ); @@ -196,7 +196,7 @@ static void test_negative_dest_length(void) len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, bufA, INT_MAX, NULL, NULL); theError = GetLastError(); ok(len == LONGBUFLEN && !lstrcmpA(bufA, originalA) && theError == 0xdeadbeef, - "WideCharToMultiByte(srclen %d, destlen INT_MAX): len %d error=%x\n", LONGBUFLEN, len, theError); + "WideCharToMultiByte(srclen %d, destlen INT_MAX): len %d error=%lx\n", LONGBUFLEN, len, theError);
}
@@ -212,87 +212,87 @@ static void test_other_invalid_parameters(void) /* Unrecognized flag => ERROR_INVALID_FLAGS */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0x100, w_string, -1, c_string, c_string_len, NULL, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_FLAGS, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_FLAGS, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0x800, w_string, -1, c_string, c_string_len, NULL, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_FLAGS, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_FLAGS, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = MultiByteToWideChar(CP_ACP, 0x10, c_string, -1, w_string, w_string_len); - ok(len == 0 && GetLastError() == ERROR_INVALID_FLAGS, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_FLAGS, "len=%d error=%lx\n", len, GetLastError());
/* Unrecognized flag and invalid codepage => ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(0xdeadbeef, 0x100, w_string, w_string_len, c_string, c_string_len, NULL, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = MultiByteToWideChar(0xdeadbeef, 0x10, c_string, c_string_len, w_string, w_string_len); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* Unrecognized flag and src is NULL => ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0x100, NULL, -1, c_string, c_string_len, NULL, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = MultiByteToWideChar(CP_ACP, 0x10, NULL, -1, w_string, w_string_len); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* srclen=0 => ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, w_string, 0, c_string, c_string_len, NULL, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = MultiByteToWideChar(CP_ACP, 0, c_string, 0, w_string, w_string_len); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* dst=NULL but dstlen not 0 => ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, w_string, w_string_len, NULL, c_string_len, NULL, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = MultiByteToWideChar(CP_ACP, 0, c_string, c_string_len, NULL, w_string_len); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* CP_UTF7, CP_UTF8, or CP_SYMBOL and defchar not NULL => ERROR_INVALID_PARAMETER */ /* CP_SYMBOL's behavior here is undocumented */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_UTF7, 0, w_string, w_string_len, c_string, c_string_len, c_string, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_UTF8, 0, w_string, w_string_len, c_string, c_string_len, c_string, NULL); ok((len == 0 && GetLastError() == ERROR_INVALID_PARAMETER) - || broken(len == 12) /* Win10 1709+ */, "len=%d error=%x\n", len, GetLastError()); + || broken(len == 12) /* Win10 1709+ */, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_SYMBOL, 0, w_string, w_string_len, c_string, c_string_len, c_string, NULL); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* CP_UTF7, CP_UTF8, or CP_SYMBOL and used not NULL => ERROR_INVALID_PARAMETER */ /* CP_SYMBOL's behavior here is undocumented */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_UTF7, 0, w_string, w_string_len, c_string, c_string_len, NULL, &used); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_UTF8, 0, w_string, w_string_len, c_string, c_string_len, NULL, &used); ok((len == 0 && GetLastError() == ERROR_INVALID_PARAMETER) - || broken(len == 12) /* Win10 1709+ */, "len=%d error=%x\n", len, GetLastError()); + || broken(len == 12) /* Win10 1709+ */, "len=%d error=%lx\n", len, GetLastError());
SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_SYMBOL, 0, w_string, w_string_len, c_string, c_string_len, NULL, &used); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* CP_UTF7, flags not 0 and used not NULL => ERROR_INVALID_PARAMETER */ @@ -301,14 +301,14 @@ static void test_other_invalid_parameters(void) instead except on Windows NT4 */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_UTF7, 1, w_string, w_string_len, c_string, c_string_len, NULL, &used); - ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%x\n", len, GetLastError()); + ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "len=%d error=%lx\n", len, GetLastError());
/* CP_UTF8, unrecognized flag and used not NULL => ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_UTF8, 0x100, w_string, w_string_len, c_string, c_string_len, NULL, &used); ok(len == 0, "wrong ret %d\n", len); ok(GetLastError() == ERROR_INVALID_PARAMETER - || GetLastError() == ERROR_INVALID_FLAGS /* Win10 1709+ */, "wrong error %u\n", GetLastError()); + || GetLastError() == ERROR_INVALID_FLAGS /* Win10 1709+ */, "wrong error %lu\n", GetLastError()); }
static void test_overlapped_buffers(void) @@ -326,14 +326,14 @@ static void test_overlapped_buffers(void) ret = WideCharToMultiByte(CP_ACP, 0, (WCHAR *)(buf + 1), -1, buf, sizeof(buf), NULL, NULL); ok(ret == sizeof(strA), "unexpected ret %d\n", ret); ok(!memcmp(buf, strA, sizeof(strA)), "conversion failed: %s\n", buf); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); memcpy(buf + overlap_limit, strA, sizeof(strA)); ret = MultiByteToWideChar(CP_ACP, 0, buf + overlap_limit, -1, (WCHAR *)buf, sizeof(buf) / sizeof(WCHAR)); ok(ret == ARRAY_SIZE(strW), "unexpected ret %d\n", ret); ok(!memcmp(buf, strW, sizeof(strW)), "conversion failed: %s\n", wine_dbgstr_wn((WCHAR *)buf, ARRAY_SIZE(strW))); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError()); }
static void test_string_conversion(LPBOOL bUsedDefaultChar) @@ -353,14 +353,14 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(ret == 1, "ret is %d\n", ret); ok(mbc == '\xe4', "mbc is %d\n", mbc); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1252, 0, &wc2, 1, &mbc, 1, NULL, bUsedDefaultChar); ok(ret == 1, "ret is %d\n", ret); ok(mbc == 63, "mbc is %d\n", mbc); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
if (IsValidCodePage(1251)) { @@ -371,14 +371,14 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == 0), /* win95 */ - "GetLastError() is %u\n", GetLastError()); + "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1251, 0, &wc1, 1, &mbc, 1, NULL, bUsedDefaultChar); ok(ret == 1, "ret is %d\n", ret); ok(mbc == 97, "mbc is %d\n", mbc); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError()); } else skip("Codepage 1251 not available\n"); @@ -389,14 +389,14 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(ret == 0, "ret is %d\n", ret); ok(mbc == 84, "mbc is %d\n", mbc); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1252, 0, wcs, -1, mbs, sizeof(mbs), NULL, bUsedDefaultChar); ok(ret == 5, "ret is %d\n", ret); ok(!strcmp(mbs, "Th?i"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError()); mbs[0] = 0;
/* WideCharToMultiByte mustn't add any null character automatically. @@ -406,7 +406,7 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(ret == 3, "ret is %d\n", ret); ok(!strcmp(mbs, "Th?i"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError()); ZeroMemory(mbs, 5);
/* Now this shouldn't be the case like above as we zeroed the complete string buffer. */ @@ -415,7 +415,7 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(ret == 3, "ret is %d\n", ret); ok(!strcmp(mbs, "Th?"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
/* Double-byte tests */ ret = WideCharToMultiByte(1252, 0, dbwcs, 3, mbs, sizeof(mbs), NULL, bUsedDefaultChar); @@ -433,13 +433,13 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ret = WideCharToMultiByte(1252, 0, &wc2, 1, NULL, 0, NULL, bUsedDefaultChar); ok(ret == 1, "ret is %d\n", ret); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1252, 0, wcs, -1, NULL, 0, NULL, bUsedDefaultChar); ok(ret == 5, "ret is %d\n", ret); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
if (!IsValidCodePage(950)) { @@ -453,13 +453,13 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(ret == 5, "ret is %d\n", ret); ok(!strcmp(mbs, "\xb5H\xa9\xd2"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WideCharToMultiByte(950, 0, dbwcs, 1, &mbc, 1, NULL, bUsedDefaultChar); ok(ret == 0, "ret is %d\n", ret); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() is %lu\n", GetLastError()); ZeroMemory(mbs, 5);
SetLastError(0xdeadbeef); @@ -467,20 +467,20 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(ret == 2, "ret is %d\n", ret); ok(!strcmp(mbs, "\xb5H"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
/* Length-only tests */ SetLastError(0xdeadbeef); ret = WideCharToMultiByte(950, 0, dbwcs, 1, NULL, 0, NULL, bUsedDefaultChar); ok(ret == 2, "ret is %d\n", ret); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WideCharToMultiByte(950, 0, dbwcs, -1, NULL, 0, NULL, bUsedDefaultChar); ok(ret == 5, "ret is %d\n", ret); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); - ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError() is %lu\n", GetLastError()); }
static void test_utf7_encoding(void) @@ -709,7 +709,7 @@ static void test_utf7_encoding(void) if (!tests[i].len) { ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "tests[%i]: expected error=0x%x, got error=0x%x\n", + "tests[%i]: expected error=0x%x, got error=0x%lx\n", i, ERROR_INSUFFICIENT_BUFFER, GetLastError()); } ok(len == tests[i].len, "tests[%i]: expected len=%i, got len=%i\n", i, tests[i].len, len); @@ -983,7 +983,7 @@ static void test_utf7_decoding(void) if (!tests[i].len && tests[i].chars_written) { ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "tests[%i]: expected error=0x%x, got error=0x%x\n", + "tests[%i]: expected error=0x%x, got error=0x%lx\n", i, ERROR_INSUFFICIENT_BUFFER, GetLastError()); } ok(len == tests[i].len, "tests[%i]: expected len=%i, got len=%i\n", i, tests[i].len, len); @@ -1034,11 +1034,11 @@ static void test_undefined_byte_char(void) testset[i].str, -1, NULL, 0); err = GetLastError(); if (testset[i].is_error) { - ok(err == ERROR_NO_UNICODE_TRANSLATION, "Test %u: err is %u\n", i, err); + ok(err == ERROR_NO_UNICODE_TRANSLATION, "Test %u: err is %lu\n", i, err); ok(ret == 0, "Test %u: ret is %d\n", i, ret); } else { - ok(err == 0xdeadbeef, "Test %u: err is %u\n", i, err); + ok(err == 0xdeadbeef, "Test %u: err is %lu\n", i, err); ok(ret == 2, "Test %u: ret is %d\n", i, ret); }
@@ -1046,7 +1046,7 @@ static void test_undefined_byte_char(void) ret = MultiByteToWideChar(testset[i].codepage, 0, testset[i].str, -1, NULL, 0); err = GetLastError(); - ok(err == 0xdeadbeef, "Test %u: err is %u\n", i, err); + ok(err == 0xdeadbeef, "Test %u: err is %lu\n", i, err); ok(ret == 2, "Test %u: ret is %d\n", i, ret); } } @@ -1129,42 +1129,42 @@ static void test_threadcp(void)
cp = 0xdeadbeef; GetLocaleInfoA(lcids[i].lcid, LOCALE_IDEFAULTANSICODEPAGE|LOCALE_RETURN_NUMBER, (LPSTR)&cp, sizeof(cp)); - ok(cp == lcids[i].threadcp, "wrong codepage %u for lcid %04x, should be %u\n", cp, lcids[i].lcid, lcids[i].threadcp); + ok(cp == lcids[i].threadcp, "wrong codepage %u for lcid %04lx, should be %u\n", cp, lcids[i].lcid, lcids[i].threadcp);
/* GetCPInfoEx/GetCPInfo - CP_ACP */ SetLastError(0xdeadbeef); memset(&cpi, 0, sizeof(cpi)); ret = GetCPInfoExA(CP_ACP, 0, &cpi); - ok(ret, "GetCPInfoExA failed for lcid %04x, error %d\n", lcids[i].lcid, GetLastError()); - ok(cpi.CodePage == acp, "wrong codepage %u for lcid %04x, should be %u\n", cpi.CodePage, lcids[i].lcid, acp); + ok(ret, "GetCPInfoExA failed for lcid %04lx, error %ld\n", lcids[i].lcid, GetLastError()); + ok(cpi.CodePage == acp, "wrong codepage %u for lcid %04lx, should be %u\n", cpi.CodePage, lcids[i].lcid, acp);
/* WideCharToMultiByte - CP_ACP */ num = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, NULL, 0, NULL, NULL); - ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid); + ok(num == 7, "ret is %d (%04lx)\n", num, lcids[i].lcid);
/* MultiByteToWideChar - CP_ACP */ num = MultiByteToWideChar(CP_ACP, 0, "foobar", -1, NULL, 0); - ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid); + ok(num == 7, "ret is %d (%04lx)\n", num, lcids[i].lcid);
/* GetCPInfoEx/GetCPInfo - CP_THREAD_ACP */ SetLastError(0xdeadbeef); memset(&cpi, 0, sizeof(cpi)); ret = GetCPInfoExA(CP_THREAD_ACP, 0, &cpi); - ok(ret, "GetCPInfoExA failed for lcid %04x, error %d\n", lcids[i].lcid, GetLastError()); + ok(ret, "GetCPInfoExA failed for lcid %04lx, error %ld\n", lcids[i].lcid, GetLastError()); if (lcids[i].threadcp) - ok(cpi.CodePage == lcids[i].threadcp, "wrong codepage %u for lcid %04x, should be %u\n", + ok(cpi.CodePage == lcids[i].threadcp, "wrong codepage %u for lcid %04lx, should be %u\n", cpi.CodePage, lcids[i].lcid, lcids[i].threadcp); else ok(cpi.CodePage == acp || cpi.CodePage == CP_UTF8 /* Win10 1809+ */, - "wrong codepage %u for lcid %04x, should be %u\n", cpi.CodePage, lcids[i].lcid, acp); + "wrong codepage %u for lcid %04lx, should be %u\n", cpi.CodePage, lcids[i].lcid, acp);
/* WideCharToMultiByte - CP_THREAD_ACP */ num = WideCharToMultiByte(CP_THREAD_ACP, 0, foobarW, -1, NULL, 0, NULL, NULL); - ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid); + ok(num == 7, "ret is %d (%04lx)\n", num, lcids[i].lcid);
/* MultiByteToWideChar - CP_THREAD_ACP */ num = MultiByteToWideChar(CP_THREAD_ACP, 0, "foobar", -1, NULL, 0); - ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid); + ok(num == 7, "ret is %d (%04lx)\n", num, lcids[i].lcid); }
/* IsDBCSLeadByteEx - locales without codepage */ @@ -1176,7 +1176,7 @@ static void test_threadcp(void) islead_default = IsDBCSLeadByteEx(cpi.CodePage, isleads_nocp[i].testchar); islead = IsDBCSLeadByteEx(CP_THREAD_ACP, isleads_nocp[i].testchar);
- ok(islead == islead_default, "wrong islead %i for test char %x in lcid %04x. should be %i\n", + ok(islead == islead_default, "wrong islead %i for test char %x in lcid %04lx. should be %i\n", islead, isleads_nocp[i].testchar, isleads_nocp[i].lcid, islead_default); }
@@ -1186,7 +1186,7 @@ static void test_threadcp(void) SetThreadLocale(isleads[i].lcid);
islead = IsDBCSLeadByteEx(CP_THREAD_ACP, isleads[i].testchar); - ok(islead == isleads[i].islead, "wrong islead %i for test char %x in lcid %04x. should be %i\n", + ok(islead == isleads[i].islead, "wrong islead %i for test char %x in lcid %04lx. should be %i\n", islead, isleads[i].testchar, isleads[i].lcid, isleads[i].islead); }
@@ -1218,10 +1218,10 @@ static void test_dbcs_to_widechar(void) count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 2, NULL, 0); count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 2, wbuf, count);
- ok(count == 1, "%04x: returned %d (expected 1)\n", flags[i], count); - ok(count2 == 1, "%04x: returned %d (expected 1)\n", flags[i], count2); - ok(wbuf[0] == 0x770b, "%04x: returned %04x (expected 770b)\n", flags[i], wbuf[0]); - ok(wbuf[1] == 0xffff, "%04x: returned %04x (expected ffff)\n", flags[i], wbuf[1]); + ok(count == 1, "%04lx: returned %d (expected 1)\n", flags[i], count); + ok(count2 == 1, "%04lx: returned %d (expected 1)\n", flags[i], count2); + ok(wbuf[0] == 0x770b, "%04lx: returned %04x (expected 770b)\n", flags[i], wbuf[0]); + ok(wbuf[1] == 0xffff, "%04lx: returned %04x (expected ffff)\n", flags[i], wbuf[1]); }
for (i = 0; i < ARRAY_SIZE(flags); ++i) @@ -1233,19 +1233,19 @@ static void test_dbcs_to_widechar(void)
if (flags[i] & MB_ERR_INVALID_CHARS) { - ok(count == 0, "%04x: returned %d (expected 0)\n", flags[i], count); - ok(count2 == 0, "%04x: returned %d (expected 0)\n", flags[i], count2); - ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04x: returned %d (expected %d)\n", + ok(count == 0, "%04lx: returned %d (expected 0)\n", flags[i], count); + ok(count2 == 0, "%04lx: returned %d (expected 0)\n", flags[i], count2); + ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04lx: returned %ld (expected %d)\n", flags[i], GetLastError(), ERROR_NO_UNICODE_TRANSLATION); } else { - ok(count == 2, "%04x: returned %d (expected 2)\n", flags[i], count); - ok(count2 == 2, "%04x: returned %d (expected 2)\n", flags[i], count2); - ok(wbuf[0] == 0x770b, "%04x: returned %04x (expected 770b)\n", flags[i], wbuf[0]); + ok(count == 2, "%04lx: returned %d (expected 2)\n", flags[i], count); + ok(count2 == 2, "%04lx: returned %d (expected 2)\n", flags[i], count2); + ok(wbuf[0] == 0x770b, "%04lx: returned %04x (expected 770b)\n", flags[i], wbuf[0]); ok(wbuf[1] == 0x003f || broken(wbuf[1] == 0), /*windows xp*/ - "%04x: wrong wide char: %04x\n", flags[i], wbuf[1]); - ok(wbuf[2] == 0xffff, "%04x: returned %04x (expected ffff)\n", flags[i], wbuf[2]); + "%04lx: wrong wide char: %04x\n", flags[i], wbuf[1]); + ok(wbuf[2] == 0xffff, "%04lx: returned %04x (expected ffff)\n", flags[i], wbuf[2]); } }
@@ -1256,12 +1256,12 @@ static void test_dbcs_to_widechar(void) count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 4, NULL, 0); SetLastError( 0xdeadbeef ); count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 4, wbuf, count); - ok(count == count2, "%04x: returned %d (expected %d)\n", flags[i], count2, count); + ok(count == count2, "%04lx: returned %d (expected %d)\n", flags[i], count2, count);
if (flags[i] & MB_ERR_INVALID_CHARS) { - ok(count == 0, "%04x: returned %d (expected 0)\n", flags[i], count); - ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04x: returned %d (expected %d)\n", + ok(count == 0, "%04lx: returned %d (expected 0)\n", flags[i], count); + ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04lx: returned %ld (expected %d)\n", flags[i], GetLastError(), ERROR_NO_UNICODE_TRANSLATION); } else @@ -1269,10 +1269,10 @@ static void test_dbcs_to_widechar(void) WCHAR wbuf_ok[] = { 0x770b, 0x003f, '\0', 0xffff }; WCHAR wbuf_broken[] = { 0x770b, '\0', 0xffff, 0xffff }; ok(count == 3 || broken(count == 2 /*windows xp*/), - "%04x: returned %d (expected 3)\n", flags[i], count); + "%04lx: returned %d (expected 3)\n", flags[i], count); ok(!memcmp(wbuf, wbuf_ok, sizeof(wbuf_ok)) || broken(!memcmp(wbuf, wbuf_broken, sizeof(wbuf_broken))), - "%04x: returned %04x %04x %04x %04x (expected %04x %04x %04x %04x)\n", + "%04lx: returned %04x %04x %04x %04x (expected %04x %04x %04x %04x)\n", flags[i], wbuf[0], wbuf[1], wbuf[2], wbuf[3], wbuf_ok[0], wbuf_ok[1], wbuf_ok[2], wbuf_ok[3]); } @@ -1285,12 +1285,12 @@ static void test_dbcs_to_widechar(void) count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 5, NULL, 0); SetLastError( 0xdeadbeef ); count2 = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 5, wbuf, count); - ok(count == count2, "%04x: returned %d (expected %d)\n", flags[i], count2, count); + ok(count == count2, "%04lx: returned %d (expected %d)\n", flags[i], count2, count);
if (flags[i] & MB_ERR_INVALID_CHARS) { - ok(count == 0, "%04x: returned %d (expected 0)\n", flags[i], count); - ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04x: returned %d (expected %d)\n", + ok(count == 0, "%04lx: returned %d (expected 0)\n", flags[i], count); + ok(GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%04lx: returned %ld (expected %d)\n", flags[i], GetLastError(), ERROR_NO_UNICODE_TRANSLATION); } else @@ -1298,10 +1298,10 @@ static void test_dbcs_to_widechar(void) WCHAR wbuf_ok[] = { 0x770b, 0x003f, '\0', 'x', 0xffff }; WCHAR wbuf_broken[] = { 0x770b, '\0', 'x', 0xffff, 0xffff }; ok(count == 4 || broken(count == 3), - "%04x: returned %d (expected 4)\n", flags[i], count); + "%04lx: returned %d (expected 4)\n", flags[i], count); ok(!memcmp(wbuf, wbuf_ok, sizeof(wbuf_ok)) || broken(!memcmp(wbuf, wbuf_broken, sizeof(wbuf_broken))), - "%04x: returned %04x %04x %04x %04x %04x (expected %04x %04x %04x %04x %04x)\n", + "%04lx: returned %04x %04x %04x %04x %04x (expected %04x %04x %04x %04x %04x)\n", flags[i], wbuf[0], wbuf[1], wbuf[2], wbuf[3], wbuf[4], wbuf_ok[0], wbuf_ok[1], wbuf_ok[2], wbuf_ok[3], wbuf_ok[4]); } diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c index f82e5e60677..a559a31a205 100644 --- a/dlls/kernel32/tests/comm.c +++ b/dlls/kernel32/tests/comm.c @@ -450,7 +450,7 @@ static void check_result(const char *function, const TEST *ptest, int initial_va DWORD LastError = GetLastError(); DWORD CorrectError = (ptest->result ? 0xdeadbeef : ERROR_INVALID_PARAMETER);
- ok(LastError == CorrectError, "%s("%s"), 0x%02x: GetLastError() returned %d, should be %d\n", function, ptest->string, initial_value, LastError, CorrectError); + ok(LastError == CorrectError, "%s("%s"), 0x%02x: GetLastError() returned %ld, should be %ld\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"); }
@@ -461,7 +461,7 @@ static void check_dcb(const char *function, const TEST *ptest, int initial_value { /* DCBlength is a special case since Win 9x sets it but NT does not. We will accept either as correct. */ - check_dcb_member2(DCBlength, (DWORD)sizeof(DCB), "%u"); + check_dcb_member2(DCBlength, (DWORD)sizeof(DCB), "%lu");
/* For old style control strings Win 9x does not set the next five members, NT does. */ if(ptest->old_style && ptest->result) @@ -505,7 +505,7 @@ static void check_dcb(const char *function, const TEST *ptest, int initial_value }
/* Check the result of the DCB members. */ - check_dcb_member(BaudRate, "%u"); + check_dcb_member(BaudRate, "%lu"); check_dcb_member(fBinary, "%u"); check_dcb_member(fParity, "%u"); check_dcb_member(fTXContinueOnXoff, "%u"); @@ -527,7 +527,7 @@ static void check_dcb(const char *function, const TEST *ptest, int initial_value check_dcb_member(wReserved1, "%u"); }
-#define check_timeouts_member(a) ok(ptimeouts1->a == ptimeouts2->a, "%s("%s"), 0x%02x: "#a" is %u, should be %u\n", function, ptest->string, initial_value, ptimeouts1->a, ptimeouts2->a); +#define check_timeouts_member(a) ok(ptimeouts1->a == ptimeouts2->a, "%s("%s"), 0x%02x: "#a" is %lu, should be %lu\n", function, ptest->string, initial_value, ptimeouts1->a, ptimeouts2->a);
static void check_timeouts(const char *function, const TEST *ptest, int initial_value, const COMMTIMEOUTS *ptimeouts1, const COMMTIMEOUTS *ptimeouts2) { @@ -723,10 +723,10 @@ static HANDLE test_OpenComm(BOOL doOverlap) return INVALID_HANDLE_VALUE; }
- ok(ret, "Unexpected error %u on open\n", GetLastError()); - ok(comstat.cbInQue == 0, "Unexpected %d chars in InQueue\n",comstat.cbInQue); - ok(comstat.cbOutQue == 0, "Still pending %d characters in OutQueue\n", comstat.cbOutQue); - ok(errors == 0, "Unexpected errors 0x%08x\n", errors); + ok(ret, "Unexpected error %lu on open\n", GetLastError()); + ok(comstat.cbInQue == 0, "Unexpected %ld chars in InQueue\n",comstat.cbInQue); + ok(comstat.cbOutQue == 0, "Still pending %ld characters in OutQueue\n", comstat.cbOutQue); + ok(errors == 0, "Unexpected errors 0x%08lx\n", errors); } return hcom; } @@ -736,7 +736,7 @@ static void test_GetModemStatus(HANDLE hcom) DWORD ModemStat = 0;
ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - trace("GetCommModemStatus returned 0x%08x->%s%s%s%s\n", ModemStat, + trace("GetCommModemStatus returned 0x%08lx->%s%s%s%s\n", ModemStat, (ModemStat &MS_RLSD_ON)?"MS_RLSD_ON ":"", (ModemStat &MS_RING_ON)?"MS_RING_ON ":"", (ModemStat &MS_DSR_ON)?"MS_DSR_ON ":"", @@ -777,10 +777,10 @@ static void test_ReadTimeOut(void) LastError = GetLastError(); after = GetTickCount(); ok( res == TRUE, "A timed-out read should return TRUE\n"); - ok( LastError == 0xdeadbeef, "err=%d\n", LastError); + ok( LastError == 0xdeadbeef, "err=%ld\n", LastError); timediff = after - before; ok( timediff > TIMEOUT>>2 && timediff < TIMEOUT *2, - "Unexpected TimeOut %d, expected %d\n", timediff, TIMEOUT); + "Unexpected TimeOut %ld, expected %d\n", timediff, TIMEOUT);
CloseHandle(hcom); } @@ -802,7 +802,7 @@ static void test_waittxempty(void)
/* set a low baud rate to have ample time*/ res = GetCommState(hcom, &dcb); - ok(res, "GetCommState error %d\n", GetLastError()); + ok(res, "GetCommState error %ld\n", GetLastError()); dcb.BaudRate = baud; dcb.ByteSize = 8; dcb.Parity = NOPARITY; @@ -810,26 +810,26 @@ static void test_waittxempty(void) dcb.fDtrControl=DTR_CONTROL_ENABLE; dcb.StopBits = ONESTOPBIT; res = SetCommState(hcom, &dcb); - ok(res, "SetCommState error %d\n", GetLastError()); + ok(res, "SetCommState error %ld\n", GetLastError());
ZeroMemory( &timeouts, sizeof(timeouts)); timeouts.ReadTotalTimeoutConstant = TIMEOUT; res = SetCommTimeouts(hcom, &timeouts); - ok(res,"SetCommTimeouts error %d\n", GetLastError()); + ok(res,"SetCommTimeouts error %ld\n", GetLastError());
res = SetupComm(hcom, 1024, 1024); - ok(res, "SetUpComm error %d\n", GetLastError()); + ok(res, "SetUpComm error %ld\n", GetLastError());
/* calling SetCommMask after WriteFile leads to WaitCommEvent failures * due to timeout (no events) under testbot VMs and VirtualBox */ res = SetCommMask(hcom, EV_TXEMPTY); - ok(res, "SetCommMask error %d\n", GetLastError()); + ok(res, "SetCommMask error %ld\n", GetLastError());
SetLastError(0xdeadbeef); res = WriteFile(hcom, tbuf, sizeof(tbuf), &bytes, NULL); ok(!res, "WriteFile on an overlapped handle without ovl structure should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
S(U(ovl_write)).Offset = 0; S(U(ovl_write)).OffsetHigh = 0; @@ -839,9 +839,9 @@ static void test_waittxempty(void) res = WriteFile(hcom, tbuf, sizeof(tbuf), &bytes, &ovl_write); after = GetTickCount(); ok((!res && GetLastError() == ERROR_IO_PENDING) || (res && bytes == sizeof(tbuf)), - "WriteFile returned %d, written %u bytes, error %d\n", res, bytes, GetLastError()); - if (!res) ok(!bytes, "expected 0, got %u\n", bytes); - ok(after - before < 30, "WriteFile took %d ms to write %d Bytes at %d Baud\n", + "WriteFile returned %d, written %lu bytes, error %ld\n", res, bytes, GetLastError()); + if (!res) ok(!bytes, "expected 0, got %lu\n", bytes); + ok(after - before < 30, "WriteFile took %ld ms to write %ld Bytes at %ld Baud\n", after - before, bytes, baud); /* don't wait for WriteFile completion */
@@ -852,16 +852,16 @@ static void test_waittxempty(void) before = GetTickCount(); SetLastError(0xdeadbeef); res = WaitCommEvent(hcom, &evtmask, &ovl_wait); - ok(res || GetLastError() == ERROR_IO_PENDING, "WaitCommEvent error %d\n", GetLastError()); + ok(res || GetLastError() == ERROR_IO_PENDING, "WaitCommEvent error %ld\n", GetLastError()); after = GetTickCount(); - ok(after - before < 30, "WaitCommEvent should have returned immediately, took %d ms\n", after - before); + ok(after - before < 30, "WaitCommEvent should have returned immediately, took %ld ms\n", after - before); res = WaitForSingleObject(ovl_wait.hEvent, 1500); ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); if (res == WAIT_OBJECT_0) { res = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); - ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); - ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes); + ok(res, "GetOverlappedResult reported error %ld\n", GetLastError()); + ok(bytes == sizeof(evtmask), "expected %u, written %lu\n", (UINT)sizeof(evtmask), bytes); res = TRUE; } else @@ -869,7 +869,7 @@ static void test_waittxempty(void) /* unblock pending wait */ trace("recovering after WAIT_TIMEOUT...\n"); res = SetCommMask(hcom, EV_TXEMPTY); - ok(res, "SetCommMask error %d\n", GetLastError()); + ok(res, "SetCommMask error %ld\n", GetLastError());
res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); @@ -877,19 +877,19 @@ static void test_waittxempty(void) res = FALSE; } after = GetTickCount(); - ok(res, "WaitCommEvent error %d\n", GetLastError()); - ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#x\n", evtmask); + ok(res, "WaitCommEvent error %ld\n", GetLastError()); + ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#lx\n", evtmask); CloseHandle(ovl_wait.hEvent);
timediff = after - before; - trace("WaitCommEvent for EV_TXEMPTY took %d ms (timeout 1500)\n", timediff); - ok(timediff < 1200, "WaitCommEvent used %d ms for waiting\n", timediff); + trace("WaitCommEvent for EV_TXEMPTY took %ld ms (timeout 1500)\n", timediff); + ok(timediff < 1200, "WaitCommEvent used %ld ms for waiting\n", timediff);
res = WaitForSingleObject(ovl_write.hEvent, 0); ok(res == WAIT_OBJECT_0, "WriteFile failed with a timeout\n"); res = GetOverlappedResult(hcom, &ovl_write, &bytes, FALSE); - ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); - ok(bytes == sizeof(tbuf), "expected %u, written %u\n", (UINT)sizeof(tbuf), bytes); + ok(res, "GetOverlappedResult reported error %ld\n", GetLastError()); + ok(bytes == sizeof(tbuf), "expected %u, written %lu\n", (UINT)sizeof(tbuf), bytes); CloseHandle(ovl_write.hEvent);
CloseHandle(hcom); @@ -900,7 +900,7 @@ static void test_waittxempty(void) if (hcom == INVALID_HANDLE_VALUE) return;
res = SetCommMask(hcom, EV_TXEMPTY); - ok(res, "SetCommMask error %d\n", GetLastError()); + ok(res, "SetCommMask error %ld\n", GetLastError());
if (i == 0) { @@ -910,27 +910,27 @@ static void test_waittxempty(void) SetLastError(0xdeadbeef); res = WriteFile(hcom, tbuf, sizeof(tbuf), &bytes, &ovl_write); ok((!res && GetLastError() == ERROR_IO_PENDING) || (res && bytes == sizeof(tbuf)), - "WriteFile returned %d, written %u bytes, error %d\n", res, bytes, GetLastError()); - if (!res) ok(!bytes, "expected 0, got %u\n", bytes); + "WriteFile returned %d, written %lu bytes, error %ld\n", res, bytes, GetLastError()); + if (!res) ok(!bytes, "expected 0, got %lu\n", bytes);
ClearCommError(hcom, &errors, &stat); - ok(stat.cbInQue == 0, "InQueue should be empty, got %d bytes\n", stat.cbInQue); + ok(stat.cbInQue == 0, "InQueue should be empty, got %ld bytes\n", stat.cbInQue); ok(stat.cbOutQue != 0 || broken(stat.cbOutQue == 0) /* VM */, "OutQueue should not be empty\n"); - ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08x\n", errors); + ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08lx\n", errors);
res = GetOverlappedResult(hcom, &ovl_write, &bytes, TRUE); - ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); - ok(bytes == sizeof(tbuf), "expected %u, written %u\n", (UINT)sizeof(tbuf), bytes); + ok(res, "GetOverlappedResult reported error %ld\n", GetLastError()); + ok(bytes == sizeof(tbuf), "expected %u, written %lu\n", (UINT)sizeof(tbuf), bytes); CloseHandle(ovl_write.hEvent);
res = FlushFileBuffers(hcom); - ok(res, "FlushFileBuffers error %d\n", GetLastError()); + ok(res, "FlushFileBuffers error %ld\n", GetLastError()); }
ClearCommError(hcom, &errors, &stat); - ok(stat.cbInQue == 0, "InQueue should be empty, got %d bytes\n", stat.cbInQue); - ok(stat.cbOutQue == 0, "OutQueue should be empty, got %d bytes\n", stat.cbOutQue); - ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08x\n", errors); + ok(stat.cbInQue == 0, "InQueue should be empty, got %ld bytes\n", stat.cbInQue); + ok(stat.cbOutQue == 0, "OutQueue should be empty, got %ld bytes\n", stat.cbOutQue); + ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08lx\n", errors);
S(U(ovl_wait)).Offset = 0; S(U(ovl_wait)).OffsetHigh = 0; @@ -939,7 +939,7 @@ static void test_waittxempty(void) SetLastError(0xdeadbeef); res = WaitCommEvent(hcom, &evtmask, &ovl_wait); ok(res /* busy system */ || GetLastError() == ERROR_IO_PENDING, - "%d: WaitCommEvent error %d\n", i, GetLastError()); + "%ld: WaitCommEvent error %ld\n", i, GetLastError());
res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); if (i == 0) @@ -949,14 +949,14 @@ static void test_waittxempty(void) if (res == WAIT_OBJECT_0) { res = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); - ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); - ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes); - ok(res, "WaitCommEvent error %d\n", GetLastError()); - ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#x\n", evtmask); + ok(res, "GetOverlappedResult reported error %ld\n", GetLastError()); + ok(bytes == sizeof(evtmask), "expected %u, written %lu\n", (UINT)sizeof(evtmask), bytes); + ok(res, "WaitCommEvent error %ld\n", GetLastError()); + ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#lx\n", evtmask); } else { - ok(!evtmask, "WaitCommEvent: expected 0, got %#x\n", evtmask); + ok(!evtmask, "WaitCommEvent: expected 0, got %#lx\n", evtmask);
S(U(ovl_wait2)).Offset = 0; S(U(ovl_wait2)).OffsetHigh = 0; @@ -964,13 +964,13 @@ static void test_waittxempty(void) SetLastError(0xdeadbeef); res = WaitCommEvent(hcom, &evtmask, &ovl_wait2); ok(!res, "WaitCommEvent should fail if there is a pending wait\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); CloseHandle(ovl_wait2.hEvent);
/* unblock pending wait */ trace("recovering after WAIT_TIMEOUT...\n"); res = SetCommMask(hcom, EV_TXEMPTY); - ok(res, "SetCommMask error %d\n", GetLastError()); + ok(res, "SetCommMask error %ld\n", GetLastError());
res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); @@ -992,9 +992,9 @@ static void test_ClearCommError(void) if (hcom == INVALID_HANDLE_VALUE) return;
ok(ClearCommError(hcom, &errors, &lpStat), "ClearCommError failed\n"); - ok(lpStat.cbInQue == 0, "Unexpected %d chars in InQueue\n", lpStat.cbInQue); - ok(lpStat.cbOutQue == 0, "Unexpected %d chars in OutQueue\n", lpStat.cbOutQue); - ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08x\n", errors); + ok(lpStat.cbInQue == 0, "Unexpected %ld chars in InQueue\n", lpStat.cbInQue); + ok(lpStat.cbOutQue == 0, "Unexpected %ld chars in OutQueue\n", lpStat.cbOutQue); + ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08lx\n", errors);
CloseHandle(hcom); } @@ -1012,7 +1012,7 @@ static void test_non_pending_errors(void) dcb.ByteSize = 255; /* likely bogus */ ok(!SetCommState(hcom, &dcb), "SetCommState should have failed\n"); ok(ClearCommError(hcom, &err, NULL), "ClearCommError should succeed\n"); - ok(!(err & CE_MODE), "ClearCommError shouldn't set CE_MODE byte in this case (%x)\n", err); + ok(!(err & CE_MODE), "ClearCommError shouldn't set CE_MODE byte in this case (%lx)\n", err);
CloseHandle(hcom); } @@ -1051,20 +1051,20 @@ static void test_LoopbackRead(void) before = GetTickCount(); ok(WriteFile(hcom,tbuf,sizeof(tbuf),&written, NULL), "WriteFile failed\n"); after = GetTickCount(); - ok(written == sizeof(tbuf),"WriteFile %d bytes written\n", written); + ok(written == sizeof(tbuf),"WriteFile %ld bytes written\n", written); diff = after -before;
/* make sure all bytes are written, so Readfile will succeed in one call*/ ok(WaitCommEvent(hcom, &evtmask, NULL), "WaitCommEvent failed\n"); before = GetTickCount(); ok(evtmask == EV_TXEMPTY, - "WaitCommEvent: Unexpected EvtMask 0x%08x, expected 0x%08x\n", + "WaitCommEvent: Unexpected EvtMask 0x%08lx, expected 0x%08x\n", evtmask, EV_TXEMPTY); - trace("Write %d ms WaitCommEvent EV_TXEMPTY %d ms\n", diff, before- after); + trace("Write %ld ms WaitCommEvent EV_TXEMPTY %ld ms\n", diff, before- after);
read=0; ok(ReadFile(hcom, rbuf, sizeof(rbuf), &read, NULL), "Readfile failed\n"); - ok(read == sizeof(tbuf),"ReadFile read %d bytes, expected "%s"\n", read,rbuf); + ok(read == sizeof(tbuf),"ReadFile read %ld bytes, expected "%s"\n", read,rbuf);
/* Now do the same with a slower Baud rate. As we request more characters than written, we will hit the timeout @@ -1081,22 +1081,22 @@ static void test_LoopbackRead(void)
ok(SetCommMask(hcom, EV_RXCHAR), "SetCommMask failed\n"); ok(WriteFile(hcom,tbuf,sizeof(tbuf),&written, NULL), "WriteFile failed\n"); - ok(written == sizeof(tbuf),"WriteFile %d bytes written\n", written); + ok(written == sizeof(tbuf),"WriteFile %ld bytes written\n", written);
trace("WaitCommEventEV_RXCHAR\n"); ok(WaitCommEvent(hcom, &evtmask, NULL), "WaitCommEvent failed\n"); - ok(evtmask == EV_RXCHAR, "WaitCommEvent: Unexpected EvtMask 0x%08x, expected 0x%08x\n", + ok(evtmask == EV_RXCHAR, "WaitCommEvent: Unexpected EvtMask 0x%08lx, expected 0x%08x\n", evtmask, EV_RXCHAR);
before = GetTickCount(); res = ReadFile(hcom, rbuf, sizeof(rbuf), &read, NULL); after = GetTickCount(); ok(res, "Readfile failed\n"); - ok(read == sizeof(tbuf),"ReadFile read %d bytes\n", read); + ok(read == sizeof(tbuf),"ReadFile read %ld bytes\n", read); diff = after - before; - trace("Readfile for %d chars took %d ms\n", read, diff); + trace("Readfile for %ld chars took %ld ms\n", read, diff); ok( (diff > TIMEOUT - TIMEDELTA) && (diff < TIMEOUT + TIMEDELTA), - "Timedout Wait took %d ms, expected around %d\n", diff, TIMEOUT); + "Timedout Wait took %ld ms, expected around %d\n", diff, TIMEOUT);
/* now do a plain read with slow speed * This will result in several low level reads and a timeout to happen @@ -1117,8 +1117,8 @@ static void test_LoopbackRead(void) } while ((read < sizeof(tbuf)) && (i <10)); after = GetTickCount(); - ok( read == sizeof(tbuf),"ReadFile read %d bytes\n", read); - trace("Plain Read for %d char at %d baud took %d ms\n", read, SLOWBAUD, after-before); + ok( read == sizeof(tbuf),"ReadFile read %ld bytes\n", read); + trace("Plain Read for %ld char at %d baud took %ld ms\n", read, SLOWBAUD, after-before);
CloseHandle(hcom); } @@ -1149,11 +1149,11 @@ static void test_LoopbackCtsRts(void) { ok(EscapeCommFunction(hcom, CLRRTS), "EscapeCommFunction failed to clear RTS\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok ((ModemStat & MS_CTS_ON) == 0, "CTS didn't react: 0x%04x, expected 0x%04x\n", + ok ((ModemStat & MS_CTS_ON) == 0, "CTS didn't react: 0x%04lx, expected 0x%04lx\n", ModemStat, (defaultStat & ~MS_CTS_ON)); ok(EscapeCommFunction(hcom, SETRTS), "EscapeCommFunction failed to clear RTS\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore CTS: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore CTS: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); } else @@ -1161,11 +1161,11 @@ static void test_LoopbackCtsRts(void) ok(EscapeCommFunction(hcom, SETRTS), "EscapeCommFunction failed to set RTS\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); ok ((ModemStat & MS_CTS_ON) == MS_CTS_ON, - "CTS didn't react: 0x%04x, expected 0x%04x\n", + "CTS didn't react: 0x%04lx, expected 0x%04lx\n", ModemStat, (defaultStat | MS_CTS_ON)); ok(EscapeCommFunction(hcom, CLRRTS), "EscapeCommFunction failed to clear RTS\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore CTS: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore CTS: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); }
@@ -1197,11 +1197,11 @@ static void test_LoopbackDtrDcd(void) { ok(EscapeCommFunction(hcom, CLRDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok ((ModemStat & MS_RLSD_ON) == 0, "RLSD didn't react: 0x%04x, expected 0x%04x\n", + ok ((ModemStat & MS_RLSD_ON) == 0, "RLSD didn't react: 0x%04lx, expected 0x%04lx\n", ModemStat, (defaultStat & ~MS_RLSD_ON)); ok(EscapeCommFunction(hcom, SETDTR), "EscapeCommFunction failed to set DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore RLSD: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore RLSD: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); } else @@ -1209,11 +1209,11 @@ static void test_LoopbackDtrDcd(void) ok(EscapeCommFunction(hcom, SETDTR), "EscapeCommFunction failed to set DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); ok ((ModemStat & MS_RLSD_ON) == MS_RLSD_ON, - "RLSD didn't react: 0x%04x, expected 0x%04x\n", + "RLSD didn't react: 0x%04lx, expected 0x%04lx\n", ModemStat, (defaultStat | MS_RLSD_ON)); ok(EscapeCommFunction(hcom, CLRDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore RLSD: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore RLSD: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); }
@@ -1245,11 +1245,11 @@ static void test_LoopbackDtrDsr(void) { ok(EscapeCommFunction(hcom, CLRDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok ((ModemStat & MS_DSR_ON) == 0, "CTS didn't react: 0x%04x, expected 0x%04x\n", + ok ((ModemStat & MS_DSR_ON) == 0, "CTS didn't react: 0x%04lx, expected 0x%04lx\n", ModemStat, (defaultStat & ~MS_DSR_ON)); ok(EscapeCommFunction(hcom, SETDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore DSR: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore DSR: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); } else @@ -1257,11 +1257,11 @@ static void test_LoopbackDtrDsr(void) ok(EscapeCommFunction(hcom, SETDTR), "EscapeCommFunction failed to set DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); ok ((ModemStat & MS_DSR_ON) == MS_DSR_ON, - "CTS didn't react: 0x%04x,expected 0x%04x\n", + "CTS didn't react: 0x%04lx,expected 0x%04lx\n", ModemStat, (defaultStat | MS_DSR_ON)); ok(EscapeCommFunction(hcom, CLRDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore DSR: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore DSR: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); }
@@ -1293,11 +1293,11 @@ static void test_LoopbackDtrRing(void) { ok(EscapeCommFunction(hcom, CLRDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok ((ModemStat & MS_RING_ON) == 0, "RING didn't react: 0x%04x, expected 0x%04x\n", + ok ((ModemStat & MS_RING_ON) == 0, "RING didn't react: 0x%04lx, expected 0x%04lx\n", ModemStat, (defaultStat & ~MS_RING_ON)); ok(EscapeCommFunction(hcom, SETDTR), "EscapeCommFunction failed to set DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore RING: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore RING: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); } else @@ -1305,11 +1305,11 @@ static void test_LoopbackDtrRing(void) ok(EscapeCommFunction(hcom, SETDTR), "EscapeCommFunction failed to set DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); ok ((ModemStat & MS_RING_ON) == MS_RING_ON, - "RING didn't react: 0x%04x,expected 0x%04x\n", + "RING didn't react: 0x%04lx,expected 0x%04lx\n", ModemStat, (defaultStat | MS_RING_ON)); ok(EscapeCommFunction(hcom, CLRDTR), "EscapeCommFunction failed to clear DTR\n"); ok(GetCommModemStatus(hcom, &ModemStat), "GetCommModemStatus failed\n"); - ok (ModemStat == defaultStat, "Failed to restore RING: 0x%04x, expected 0x%04x\n", + ok (ModemStat == defaultStat, "Failed to restore RING: 0x%04lx, expected 0x%04lx\n", ModemStat, defaultStat); }
@@ -1342,7 +1342,7 @@ static void test_WaitRx(void) overlapped.hEvent = hComPortEvent;
hComWriteEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); - ok(hComWriteEvent != NULL, "CreateEvent res %d\n", GetLastError()); + ok(hComWriteEvent != NULL, "CreateEvent res %ld\n", GetLastError()); ZeroMemory( &overlapped_w, sizeof(overlapped_w)); overlapped_w.hEvent = hComWriteEvent;
@@ -1350,47 +1350,47 @@ static void test_WaitRx(void) success_wait = WaitCommEvent(hcom, &evtmask, &overlapped); err_wait = GetLastError(); after = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x\n", success_wait, err_wait, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success_wait, err_wait, evtmask); ok(success_wait || err_wait == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent 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 %d\n", + "overlapped WriteFile failed, err %ld\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 %d, err %d\n", + ok(success_write == WAIT_OBJECT_0, "WaitForSingleObjectEx, res %ld, err %ld\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 %d\n",success_write, err_write); - ok(success_write && written ==1, "Write after Wait res 0x%08x err %d\n", + trace("Write after Wait res 0x%08lx err %ld\n",success_write, err_write); + ok(success_write && written ==1, "Write after Wait res 0x%08lx err %ld\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 %d\n", + ok(success_wait == WAIT_OBJECT_0, "wait hComPortEvent, res 0x%08lx, err %ld\n", success_wait, err_wait); } success_wait = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err_wait = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success_wait, err_wait, evtmask, after-before, after1-before);
- ok(evtmask & EV_RXCHAR, "Detect EV_RXCHAR: 0x%08x, expected 0x%08x\n", + ok(evtmask & EV_RXCHAR, "Detect EV_RXCHAR: 0x%08lx, expected 0x%08x\n", evtmask, EV_RXCHAR); diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
CloseHandle(hcom); } @@ -1407,13 +1407,13 @@ static DWORD CALLBACK toggle_ctlLine(LPVOID arg) HANDLE hComPortEvent = (HANDLE) args[3]; DWORD success, err;
- trace("toggle_ctlLine timeout %d ctl 0x%08x handle %p\n", timeout, ctl, hcom ); + trace("toggle_ctlLine timeout %ld ctl 0x%08lx handle %p\n", timeout, ctl, hcom ); Sleep(timeout); - ok(EscapeCommFunction(hcom, ctl),"EscapeCommFunction 0x%08x failed\n", ctl); + ok(EscapeCommFunction(hcom, ctl),"EscapeCommFunction 0x%08lx failed\n", ctl); trace("toggle_ctline done\n"); success = WaitForSingleObjectEx(hComPortEvent, TIMEOUT, TRUE); err = GetLastError(); - trace("toggle_ctline WaitForSingleObjectEx res 0x%08x err %d\n", + trace("toggle_ctline WaitForSingleObjectEx res 0x%08lx err %ld\n", success, err); return 0; } @@ -1453,7 +1453,7 @@ static void test_WaitCts(void) args[1] = SETRTS; args[2]=(DWORD_PTR)hcom;
- trace("test_WaitCts timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); + trace("test_WaitCts timeout %Id clt 0x%08Ix handle %p\n",args[0], args[1], hcom);
ok(SetCommMask(hcom, EV_CTS), "SetCommMask failed\n"); hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); @@ -1472,7 +1472,7 @@ static void test_WaitCts(void) err = GetLastError(); after = GetTickCount();
- trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success, err, evtmask); ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent returned.\n"); if (!success && (err == ERROR_IO_PENDING)) @@ -1481,10 +1481,10 @@ static void test_WaitCts(void) success = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success, err, evtmask, after-before, after1-before);
- ok(evtmask & EV_CTS, "Failed to detect EV_CTS: 0x%08x, expected 0x%08x\n", + ok(evtmask & EV_CTS, "Failed to detect EV_CTS: 0x%08lx, expected 0x%08x\n", evtmask, EV_CTS); ok(GetCommModemStatus(hcom, &evtmask), "GetCommModemStatus failed\n"); if(defaultStat & MS_CTS_ON) @@ -1494,7 +1494,7 @@ static void test_WaitCts(void)
diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
/*restore RTS Settings*/ if(defaultStat & MS_CTS_ON) @@ -1516,7 +1516,7 @@ static DWORD CALLBACK reset_CommMask(LPVOID arg) DWORD timeout = args[0]; HANDLE hcom = (HANDLE) args[1];
- trace(" Changing CommMask on the fly for handle %p after timeout %d\n", + trace(" Changing CommMask on the fly for handle %p after timeout %ld\n", hcom, timeout); Sleep(timeout); ok(SetCommMask(hcom, 0),"SetCommMask %p failed\n", hcom); @@ -1549,7 +1549,7 @@ static void test_AbortWaitCts(void) args[0]= TIMEOUT >>1; args[1]= (DWORD_PTR)hcom;
- trace("test_AbortWaitCts timeout %ld handle %p\n",args[0], hcom); + trace("test_AbortWaitCts timeout %Id handle %p\n",args[0], hcom);
ok(SetCommMask(hcom, EV_CTS), "SetCommMask failed\n"); hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); @@ -1567,7 +1567,7 @@ static void test_AbortWaitCts(void) err = GetLastError(); after = GetTickCount();
- trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success, err, evtmask); ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent returned.\n"); if (!success && (err == ERROR_IO_PENDING)) @@ -1576,15 +1576,15 @@ static void test_AbortWaitCts(void) success = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success, err, evtmask, after-before, after1-before);
- ok(evtmask == 0, "Incorrect EventMask 0x%08x returned on Wait aborted bu SetCommMask, expected 0x%08x\n", + ok(evtmask == 0, "Incorrect EventMask 0x%08lx returned on Wait aborted bu SetCommMask, expected 0x%08x\n", evtmask, 0); ok(GetCommModemStatus(hcom, &evtmask), "GetCommModemStatus failed\n"); diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
CloseHandle(hcom); ok( !WaitForSingleObject( alarmThread, 10000 ), "thread still running\n" ); @@ -1623,7 +1623,7 @@ static void test_WaitDsr(void) args[1] = SETDTR; args[2]= (DWORD_PTR)hcom;
- trace("test_WaitDsr timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); + trace("test_WaitDsr timeout %Id clt 0x%08Ix handle %p\n",args[0], args[1], hcom);
ok(SetCommMask(hcom, EV_DSR), "SetCommMask failed\n"); hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); @@ -1638,7 +1638,7 @@ static void test_WaitDsr(void) err = GetLastError(); after = GetTickCount();
- trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success, err, evtmask); ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent returned.\n"); if (!success && (err == ERROR_IO_PENDING)) @@ -1647,10 +1647,10 @@ static void test_WaitDsr(void) success = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success, err, evtmask, after-before, after1-before);
- ok(evtmask & EV_DSR, "Failed to detect EV_DSR: 0x%08x, expected 0x%08x\n", + ok(evtmask & EV_DSR, "Failed to detect EV_DSR: 0x%08lx, expected 0x%08x\n", evtmask, EV_DSR); ok(GetCommModemStatus(hcom, &evtmask), "GetCommModemStatus failed\n"); if(defaultStat & MS_DSR_ON) @@ -1660,7 +1660,7 @@ static void test_WaitDsr(void)
diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
/*restore RTS Settings*/ if(defaultStat & MS_DSR_ON) @@ -1711,7 +1711,7 @@ static void test_WaitRing(void) args[1] = SETDTR; args[2]=(DWORD_PTR) hcom;
- trace("test_WaitRing timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); + trace("test_WaitRing timeout %Id clt 0x%08Ix handle %p\n",args[0], args[1], hcom);
ok(SetCommMask(hcom, EV_RING), "SetCommMask failed\n"); hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); @@ -1726,7 +1726,7 @@ static void test_WaitRing(void) err = GetLastError(); after = GetTickCount();
- trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success, err, evtmask); ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent returned.\n"); if (!success && (err == ERROR_IO_PENDING)) @@ -1735,10 +1735,10 @@ static void test_WaitRing(void) success = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success, err, evtmask, after-before, after1-before);
- ok(evtmask & EV_RING, "Failed to detect EV_RING: 0x%08x, expected 0x%08x\n", + ok(evtmask & EV_RING, "Failed to detect EV_RING: 0x%08lx, expected 0x%08x\n", evtmask, EV_RING); ok(GetCommModemStatus(hcom, &evtmask), "GetCommModemStatus failed\n"); if(defaultStat & MS_RING_ON) @@ -1748,7 +1748,7 @@ static void test_WaitRing(void)
diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
/*restore RTS Settings*/ if(defaultStat & MS_RING_ON) @@ -1792,7 +1792,7 @@ static void test_WaitDcd(void) args[1] = SETDTR; args[2]= (DWORD_PTR)hcom;
- trace("test_WaitDcd timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); + trace("test_WaitDcd timeout %Id clt 0x%08Ix handle %p\n",args[0], args[1], hcom);
ok(SetCommMask(hcom, EV_RLSD), "SetCommMask failed\n"); hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); @@ -1807,7 +1807,7 @@ static void test_WaitDcd(void) err = GetLastError(); after = GetTickCount();
- trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success, err, evtmask); ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent returned.\n"); if (!success && (err == ERROR_IO_PENDING)) @@ -1816,10 +1816,10 @@ static void test_WaitDcd(void) success = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success, err, evtmask, after-before, after1-before);
- ok(evtmask & EV_RLSD, "Failed to detect EV_RLSD: 0x%08x, expected 0x%08x\n", + ok(evtmask & EV_RLSD, "Failed to detect EV_RLSD: 0x%08lx, expected 0x%08x\n", evtmask, EV_RLSD); ok(GetCommModemStatus(hcom, &evtmask), "GetCommModemStatus failed\n"); if(defaultStat & MS_RLSD_ON) @@ -1829,7 +1829,7 @@ static void test_WaitDcd(void)
diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
/*restore RTS Settings*/ if(defaultStat & MS_RLSD_ON) @@ -1851,7 +1851,7 @@ static DWORD CALLBACK set_CommBreak(LPVOID arg) DWORD timeout = args[0]; HANDLE hcom = (HANDLE) args[1];
- trace("SetCommBreak for handle %p after timeout %d\n", + trace("SetCommBreak for handle %p after timeout %ld\n", hcom, timeout); Sleep(timeout); ok(SetCommBreak(hcom),"SetCommBreak %p failed\n", hcom); @@ -1895,28 +1895,28 @@ static void test_WaitBreak(void) err = GetLastError(); after = GetTickCount();
- trace("Success 0x%08x err %d evtmask 0x%08x\n", success, err, evtmask); + trace("Success 0x%08lx err %ld evtmask 0x%08lx\n", success, err, evtmask); ok(success || err == ERROR_IO_PENDING, "overlapped WaitCommEvent failed\n"); trace("overlapped WaitCommEvent returned.\n");
if (!success && (err == ERROR_IO_PENDING)) { success = WaitForSingleObjectEx(hComPortEvent, TIMEOUT, TRUE); - ok(!success, "wait hComPortEvent res %d\n", GetLastError()); + ok(!success, "wait hComPortEvent res %ld\n", GetLastError()); } success = GetOverlappedResult(hcom, &overlapped, &written, FALSE); err = GetLastError(); after1 = GetTickCount(); - trace("Success 0x%08x err %d evtmask 0x%08x diff1 %d, diff2 %d\n", + trace("Success 0x%08lx err %ld evtmask 0x%08lx diff1 %ld, diff2 %ld\n", success, err, evtmask, after-before, after1-before);
- ok(evtmask & EV_BREAK, "Failed to detect EV_BREAK: 0x%08x, expected 0x%08x\n", + ok(evtmask & EV_BREAK, "Failed to detect EV_BREAK: 0x%08lx, expected 0x%08x\n", evtmask, EV_BREAK); ok(GetCommModemStatus(hcom, &evtmask), "GetCommModemStatus failed\n");
diff = after1 - before; ok ((diff > (TIMEOUT>>1) -TIMEDELTA) && (diff < (TIMEOUT>>1) + TIMEDELTA), - "Unexpected time %d, expected around %d\n", diff, TIMEOUT>>1); + "Unexpected time %ld, expected around %d\n", diff, TIMEOUT>>1);
ok(ClearCommBreak(hcom), "ClearCommBreak failed\n");
@@ -1932,7 +1932,7 @@ static void test_stdio(void) /* cygwin tries this to determine the stdin handle type */ ok( !GetCommState( GetStdHandle(STD_INPUT_HANDLE), &dcb ), "GetCommState succeeded on stdin\n" ); ok( GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_INVALID_FUNCTION, - "got error %u\n", GetLastError() ); + "got error %lu\n", GetLastError() ); }
static void test_WaitCommEvent(void) @@ -1947,7 +1947,7 @@ static void test_WaitCommEvent(void) test_GetModemStatus(hcom);
ret = SetCommMask(hcom, 0x1fff); - ok(ret, "SetCommMask error %d\n", GetLastError()); + ok(ret, "SetCommMask error %ld\n", GetLastError());
S(U(ovl_wait)).Offset = 0; S(U(ovl_wait)).OffsetHigh = 0; @@ -1961,7 +1961,7 @@ static void test_WaitCommEvent(void) evtmask = 0; SetLastError(0xdeadbeef); ret = WaitCommEvent(hcom, &evtmask, &ovl_wait); - ok(!ret && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent returned %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent returned %ld, error %ld\n", ret, GetLastError()); if (GetLastError() != ERROR_IO_PENDING) goto done; /* no point in further testing */ for (;;) { @@ -1971,9 +1971,9 @@ static void test_WaitCommEvent(void) { last_event_time = after; ret = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); - ok(ret, "GetOverlappedResult reported error %d\n", GetLastError()); - ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes); - trace("WaitCommEvent: got events %#x\n", evtmask); + ok(ret, "GetOverlappedResult reported error %ld\n", GetLastError()); + ok(bytes == sizeof(evtmask), "expected %u, written %lu\n", (UINT)sizeof(evtmask), bytes); + trace("WaitCommEvent: got events %#lx\n", evtmask); test_GetModemStatus(hcom); break; } @@ -1999,17 +1999,17 @@ static void test_FlushFileBuffers(void) if (hcom == INVALID_HANDLE_VALUE) return;
ret = WriteFile(hcom, "\0\0\0\0\0\0\0", 7, &bytes, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); - ok(bytes == 7, "expected 7, got %u\n", bytes); + ok(ret, "WriteFile error %ld\n", GetLastError()); + ok(bytes == 7, "expected 7, got %lu\n", bytes);
ret = FlushFileBuffers(hcom); - ok(ret, "FlushFileBuffers error %d\n", GetLastError()); + ok(ret, "FlushFileBuffers error %ld\n", GetLastError());
ret = ClearCommError(hcom, &errors, &stat); - ok(ret, "ClearCommError error %d\n", GetLastError()); - ok(stat.cbInQue == 0, "expected 0, got %d bytes in InQueue\n", stat.cbInQue); - ok(stat.cbOutQue == 0, "expected 0, got %d bytes in OutQueue\n", stat.cbOutQue); - ok(errors == 0, "expected errors 0, got %#x\n", errors); + ok(ret, "ClearCommError error %ld\n", GetLastError()); + ok(stat.cbInQue == 0, "expected 0, got %ld bytes in InQueue\n", stat.cbInQue); + ok(stat.cbOutQue == 0, "expected 0, got %ld bytes in OutQueue\n", stat.cbOutQue); + ok(errors == 0, "expected errors 0, got %#lx\n", errors);
CloseHandle(hcom); } @@ -2037,7 +2037,7 @@ static void test_read_write(void) if (hcom == INVALID_HANDLE_VALUE) return;
ret = GetCommState(hcom, &dcb); - ok(ret, "GetCommState error %d\n", GetLastError()); + ok(ret, "GetCommState error %ld\n", GetLastError()); dcb.BaudRate = 9600; dcb.ByteSize = 8; dcb.Parity = NOPARITY; @@ -2045,29 +2045,29 @@ static void test_read_write(void) dcb.fDtrControl = DTR_CONTROL_ENABLE; dcb.StopBits = ONESTOPBIT; ret = SetCommState(hcom, &dcb); - ok(ret, "SetCommState error %d\n", GetLastError()); + ok(ret, "SetCommState error %ld\n", GetLastError());
memset(&timeouts, 0, sizeof(timeouts)); timeouts.ReadTotalTimeoutConstant = TIMEOUT; ret = SetCommTimeouts(hcom, &timeouts); - ok(ret,"SetCommTimeouts error %d\n", GetLastError()); + ok(ret,"SetCommTimeouts error %ld\n", GetLastError());
ret = SetupComm(hcom, 1024, 1024); - ok(ret, "SetUpComm error %d\n", GetLastError()); + ok(ret, "SetUpComm error %ld\n", GetLastError());
bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WriteFile(hcom, atz, 0, &bytes, NULL); ok(!ret, "WriteFile should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - ok(bytes == 0, "bytes %u\n", bytes); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); + ok(bytes == 0, "bytes %lu\n", bytes);
U(iob).Status = -1; iob.Information = -1; status = pNtWriteFile(hcom, 0, NULL, NULL, &iob, atz, 0, NULL, NULL); - ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); - ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); - ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#lx\n", status); + ok(U(iob).Status == -1, "expected -1, got %#lx\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %Id\n", iob.Information);
for (i = -20; i < 20; i++) { @@ -2077,15 +2077,15 @@ static void test_read_write(void) status = pNtWriteFile(hcom, 0, NULL, NULL, &iob, atz, 0, &offset, NULL); if (i >= 0 || i == -1) { - ok(status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, status); - ok(U(iob).Status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, U(iob).Status); - ok(iob.Information == 0, "%d: expected 0, got %lu\n", i, iob.Information); + ok(status == STATUS_SUCCESS, "%ld: expected STATUS_SUCCESS, got %#lx\n", i, status); + ok(U(iob).Status == STATUS_SUCCESS, "%ld: expected STATUS_SUCCESS, got %#lx\n", i, U(iob).Status); + ok(iob.Information == 0, "%ld: expected 0, got %Iu\n", i, iob.Information); } else { - ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); - ok(U(iob).Status == -1, "%d: expected -1, got %#x\n", i, U(iob).Status); - ok(iob.Information == -1, "%d: expected -1, got %ld\n", i, iob.Information); + ok(status == STATUS_INVALID_PARAMETER, "%ld: expected STATUS_INVALID_PARAMETER, got %#lx\n", i, status); + ok(U(iob).Status == -1, "%ld: expected -1, got %#lx\n", i, U(iob).Status); + ok(iob.Information == -1, "%ld: expected -1, got %Id\n", i, iob.Information); } }
@@ -2093,7 +2093,7 @@ static void test_read_write(void) iob.Information = -1; offset.QuadPart = 0; status = pNtWriteFile(hcom, 0, NULL, NULL, &iob, atz, sizeof(atz), &offset, NULL); - ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#lx\n", status); /* Under Windows checking IO_STATUS_BLOCK right after the call leads * to races, iob.Status is either -1 or STATUS_SUCCESS, which means * that it's set only when the operation completes. @@ -2105,12 +2105,12 @@ static void test_read_write(void) CloseHandle(hcom); return; } - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); - ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); - ok(iob.Information == sizeof(atz), "expected sizeof(atz), got %lu\n", iob.Information); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %ld\n", ret); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", U(iob).Status); + ok(iob.Information == sizeof(atz), "expected sizeof(atz), got %Iu\n", iob.Information);
ret = SetCommMask(hcom, EV_RXCHAR); - ok(ret, "SetCommMask error %d\n", GetLastError()); + ok(ret, "SetCommMask error %ld\n", GetLastError());
S(U(ovl_wait)).Offset = 0; S(U(ovl_wait)).OffsetHigh = 0; @@ -2124,7 +2124,7 @@ static void test_read_write(void) evtmask = 0; SetLastError(0xdeadbeef); ret = WaitCommEvent(hcom, &evtmask, &ovl_wait); - ok(!ret && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent returned %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent returned %ld, error %ld\n", ret, GetLastError()); if (GetLastError() != ERROR_IO_PENDING) goto done; /* no point in further testing */ for (;;) { @@ -2136,23 +2136,23 @@ static void test_read_write(void)
last_event_time = after; ret = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); - ok(ret, "GetOverlappedResult reported error %d\n", GetLastError()); - ok(bytes == sizeof(evtmask), "expected sizeof(evtmask), got %u\n", bytes); + ok(ret, "GetOverlappedResult reported error %ld\n", GetLastError()); + ok(bytes == sizeof(evtmask), "expected sizeof(evtmask), got %lu\n", bytes); ok(evtmask & EV_RXCHAR, "EV_RXCHAR should be set\n");
bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(hcom, buf, 0, &bytes, NULL); ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - ok(bytes == 0, "bytes %u\n", bytes); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); + ok(bytes == 0, "bytes %lu\n", bytes);
U(iob).Status = -1; iob.Information = -1; status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, NULL, NULL); - ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); - ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); - ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#lx\n", status); + ok(U(iob).Status == -1, "expected -1, got %#lx\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %Id\n", iob.Information);
for (i = -20; i < 20; i++) { @@ -2162,15 +2162,15 @@ static void test_read_write(void) status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); if (i >= 0) { - ok(status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, status); - ok(U(iob).Status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, U(iob).Status); - ok(iob.Information == 0, "%d: expected 0, got %lu\n", i, iob.Information); + ok(status == STATUS_SUCCESS, "%ld: expected STATUS_SUCCESS, got %#lx\n", i, status); + ok(U(iob).Status == STATUS_SUCCESS, "%ld: expected STATUS_SUCCESS, got %#lx\n", i, U(iob).Status); + ok(iob.Information == 0, "%ld: expected 0, got %Iu\n", i, iob.Information); } else { - ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); - ok(U(iob).Status == -1, "%d: expected -1, got %#x\n", i, U(iob).Status); - ok(iob.Information == -1, "%d: expected -1, got %ld\n", i, iob.Information); + ok(status == STATUS_INVALID_PARAMETER, "%ld: expected STATUS_INVALID_PARAMETER, got %#lx\n", i, status); + ok(U(iob).Status == -1, "%ld: expected -1, got %#lx\n", i, U(iob).Status); + ok(iob.Information == -1, "%ld: expected -1, got %Id\n", i, iob.Information); } }
@@ -2178,9 +2178,9 @@ static void test_read_write(void) iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 1, &offset, NULL); - ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", status); - ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); - ok(iob.Information == 1, "expected 1, got %lu\n", iob.Information); + ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", U(iob).Status); + ok(iob.Information == 1, "expected 1, got %Iu\n", iob.Information); goto done; } else diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 5f5f0698040..b31febe0d56 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -100,7 +100,7 @@ static HANDLE create_unbound_handle(BOOL output, BOOL test_status) FILE_WRITE_ATTRIBUTES, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_CREATE, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); - if (test_status) ok(!status, "NtCreateFile failed: %#x\n", status); + if (test_status) ok(!status, "NtCreateFile failed: %#lx\n", status); return status ? NULL : handle; }
@@ -135,7 +135,7 @@ static void testCursor(HANDLE hCon, COORD sbSize)
c.X = c.Y = 0; ok(SetConsoleCursorPosition(0, c) == 0, "No handle\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
c.X = c.Y = 0; @@ -150,25 +150,25 @@ static void testCursor(HANDLE hCon, COORD sbSize) c.X = sbSize.X; c.Y = sbSize.Y - 1; ok(SetConsoleCursorPosition(hCon, c) == 0, "Cursor is outside\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_PARAMETER, GetLastError());
c.X = sbSize.X - 1; c.Y = sbSize.Y; ok(SetConsoleCursorPosition(hCon, c) == 0, "Cursor is outside\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_PARAMETER, GetLastError());
c.X = -1; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) == 0, "Cursor is outside\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_PARAMETER, GetLastError());
c.X = 0; c.Y = -1; ok(SetConsoleCursorPosition(hCon, c) == 0, "Cursor is outside\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_PARAMETER, GetLastError()); }
@@ -181,7 +181,7 @@ static void testCursorInfo(HANDLE hCon) SetLastError(0xdeadbeef); ret = GetConsoleCursorInfo(NULL, NULL); ok(!ret, "Expected failure\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
SetLastError(0xdeadbeef); @@ -189,7 +189,7 @@ static void testCursorInfo(HANDLE hCon) ret = GetConsoleCursorInfo(NULL, &info); ok(!ret, "Expected failure\n"); ok(info.dwSize == -1, "Expected no change for dwSize\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
/* Test the correct call first to distinguish between win9x and the rest */ @@ -198,9 +198,9 @@ static void testCursorInfo(HANDLE hCon) ok(ret, "Expected success\n"); ok(info.dwSize == 25 || info.dwSize == 12 /* win9x */, - "Expected 12 or 25, got %d\n", info.dwSize); + "Expected 12 or 25, got %ld\n", info.dwSize); ok(info.bVisible, "Expected the cursor to be visible\n"); - ok(GetLastError() == 0xdeadbeef, "GetLastError: expecting %u got %u\n", + ok(GetLastError() == 0xdeadbeef, "GetLastError: expecting %u got %lu\n", 0xdeadbeef, GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); @@ -208,7 +208,7 @@ static void testCursorInfo(HANDLE hCon) ret = GetConsoleCursorInfo(pipe1, &info); ok(!ret, "Expected failure\n"); ok(info.dwSize == -1, "Expected no change for dwSize\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: %lu\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
@@ -265,8 +265,8 @@ static void simple_write_console(HANDLE console, const char *text) ok(SetConsoleCursorPosition(console, c) != 0, "Cursor in upper-left\n");
ret = WriteConsoleA(console, text, strlen(text), &len, NULL); - ok(ret, "WriteConsoleA failed: %u\n", GetLastError()); - ok(len == strlen(text), "unexpected len %u\n", len); + ok(ret, "WriteConsoleA failed: %lu\n", GetLastError()); + ok(len == strlen(text), "unexpected len %lu\n", len); }
static void testWriteSimple(HANDLE hCon) @@ -288,8 +288,8 @@ static void testWriteSimple(HANDLE hCon) okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
ret = WriteFile(hCon, mytest, mylen, &len, NULL); - ok(ret, "WriteFile failed: %u\n", GetLastError()); - ok(len == mylen, "unexpected len = %u\n", len); + ok(ret, "WriteFile failed: %lu\n", GetLastError()); + ok(len == mylen, "unexpected len = %lu\n", len);
for (c.X = 0; c.X < 2 * mylen; c.X++) { @@ -317,7 +317,7 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize) ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3\n");
ret = WriteConsoleA(hCon, mytest, mylen, &len, NULL); - ok(ret != 0 && len == mylen, "Couldn't write, ret = %d, len = %d\n", ret, len); + ok(ret != 0 && len == mylen, "Couldn't write, ret = %d, len = %ld\n", ret, len); c.Y = 0; for (p = mylen - 3; p < mylen; p++) { @@ -668,7 +668,7 @@ static void testScroll(HANDLE hCon, COORD sbSize) { /* Win9x will fail, Only accept ERROR_NOT_ENOUGH_MEMORY */ ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY, - "Expected ERROR_NOT_ENOUGH_MEMORY, got %u\n", GetLastError()); + "Expected ERROR_NOT_ENOUGH_MEMORY, got %lu\n", GetLastError()); }
/* clipping, src & dst rect do overlap */ @@ -689,7 +689,7 @@ static void testScroll(HANDLE hCon, COORD sbSize) clip.Bottom = min(H + H / 2, sbSize.Y - 1);
ret = ScrollConsoleScreenBufferA(hCon, &scroll, &clip, dst, &ci); - ok(ret, "ScrollConsoleScreenBufferA failed: %u\n", GetLastError()); + ok(ret, "ScrollConsoleScreenBufferA failed: %lu\n", GetLastError());
for (c.Y = 0; c.Y < sbSize.Y; c.Y++) { @@ -724,7 +724,7 @@ static BOOL WINAPI mch(DWORD event) static void testCtrlHandler(void) { ok(!SetConsoleCtrlHandler(mch, FALSE), "Shouldn't succeed\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Bad error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Bad error %lu\n", GetLastError()); ok(SetConsoleCtrlHandler(mch, TRUE), "Couldn't set handler\n"); /* wine requires the event for the test, as we cannot ensure, so far, that * events are processed synchronously in GenerateConsoleCtrlEvent() @@ -748,7 +748,7 @@ static void testCtrlHandler(void) CloseHandle(mch_event); ok(SetConsoleCtrlHandler(mch, FALSE), "Couldn't remove handler\n"); ok(!SetConsoleCtrlHandler(mch, FALSE), "Shouldn't succeed\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Bad error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Bad error %lu\n", GetLastError()); }
/* @@ -830,26 +830,26 @@ static void testScreenBuffer(HANDLE hConOut) ok(!SetConsoleActiveScreenBuffer(INVALID_HANDLE_VALUE), "Shouldn't succeed\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", + "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
/* Trying to set non-console handles */ SetLastError(0); ok(!SetConsoleActiveScreenBuffer(hFileOutRW), "Shouldn't succeed\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", + "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
SetLastError(0); ok(!SetConsoleActiveScreenBuffer(hFileOutRO), "Shouldn't succeed\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", + "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
SetLastError(0); ok(!SetConsoleActiveScreenBuffer(hFileOutWT), "Shouldn't succeed\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", + "GetLastError: expecting %u got %lu\n", ERROR_INVALID_HANDLE, GetLastError());
/* trying to write non-console handle */ @@ -858,21 +858,21 @@ static void testScreenBuffer(HANDLE hConOut) error = GetLastError(); ok(!ret, "Shouldn't succeed\n"); ok(error == ERROR_INVALID_HANDLE || error == ERROR_INVALID_FUNCTION, - "GetLastError: got %u\n", error); + "GetLastError: got %lu\n", error);
SetLastError(0xdeadbeef); ret = WriteConsoleA(hFileOutRO, test_str1, lstrlenA(test_str1), &len, NULL); error = GetLastError(); ok(!ret, "Shouldn't succeed\n"); ok(error == ERROR_INVALID_HANDLE || error == ERROR_INVALID_FUNCTION, - "GetLastError: got %u\n", error); + "GetLastError: got %lu\n", error);
SetLastError(0xdeadbeef); ret = WriteConsoleA(hFileOutWT, test_str1, lstrlenA(test_str1), &len, NULL); error = GetLastError(); ok(!ret, "Shouldn't succeed\n"); ok(error == ERROR_INVALID_HANDLE || error == ERROR_INVALID_FUNCTION, - "GetLastError: got %u\n", error); + "GetLastError: got %lu\n", error);
CloseHandle(hFileOutRW); CloseHandle(hFileOutRO); @@ -882,7 +882,7 @@ static void testScreenBuffer(HANDLE hConOut) SetLastError(0); ok(!SetConsoleActiveScreenBuffer(hConOutRO), "Shouldn't succeed\n"); ok(GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == ERROR_ACCESS_DENIED) /* win10 1809 */, - "unexpected last error %u\n", GetLastError()); + "unexpected last error %lu\n", GetLastError());
ok(SetConsoleActiveScreenBuffer(hConOutWT), "Couldn't set new WriteOnly SB\n");
@@ -990,18 +990,18 @@ static void test_new_screen_buffer_properties(HANDLE hConOut) cfi.cbSize = cfi2.cbSize = sizeof(CONSOLE_FONT_INFOEX);
ret = GetCurrentConsoleFontEx(hConOut, FALSE, &cfi); - ok(ret, "GetCurrentConsoleFontEx failed: error %u\n", GetLastError()); + ok(ret, "GetCurrentConsoleFontEx failed: error %lu\n", GetLastError());
hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %lu\n", GetLastError());
ret = GetCurrentConsoleFontEx(hConOut2, FALSE, &cfi2); - ok(ret, "GetCurrentConsoleFontEx failed: error %u\n", GetLastError()); + ok(ret, "GetCurrentConsoleFontEx failed: error %lu\n", GetLastError()); CloseHandle(hConOut2);
ok(cfi2.nFont == cfi.nFont, "Font index should match: " - "got %u, expected %u\n", cfi2.nFont, cfi.nFont); + "got %lu, expected %lu\n", cfi2.nFont, cfi.nFont); ok(cfi2.dwFontSize.X == cfi.dwFontSize.X, "Font width should match: " "got %d, expected %d\n", cfi2.dwFontSize.X, cfi.dwFontSize.X); ok(cfi2.dwFontSize.Y == cfi.dwFontSize.Y, "Font height should match: " @@ -1015,14 +1015,14 @@ static void test_new_screen_buffer_properties(HANDLE hConOut)
/* Display window size */ ret = GetConsoleScreenBufferInfo(hConOut, &csbi); - ok(ret, "GetConsoleScreenBufferInfo failed: error %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfo failed: error %lu\n", GetLastError());
hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %lu\n", GetLastError());
ret = GetConsoleScreenBufferInfo(hConOut2, &csbi2); - ok(ret, "GetConsoleScreenBufferInfo failed: error %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfo failed: error %lu\n", GetLastError()); CloseHandle(hConOut2);
ok(csbi2.srWindow.Left == csbi.srWindow.Left, "Left coordinate should match\n"); @@ -1041,16 +1041,16 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut) csbi.cbSize = csbi2.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
ret = GetConsoleScreenBufferInfoEx(hConOut, &csbi); - ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError()); orig_attr = csbi.wAttributes; orig_popup = csbi.wPopupAttributes;
hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %lu\n", GetLastError());
ret = GetConsoleScreenBufferInfoEx(hConOut2, &csbi2); - ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError()); CloseHandle(hConOut2);
ok(csbi2.wAttributes == orig_attr, "Character Attributes should have been copied: " @@ -1061,17 +1061,17 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut) /* Test different Character Attributes */ attr = FOREGROUND_BLUE|BACKGROUND_GREEN; ret = SetConsoleTextAttribute(hConOut, attr); - ok(ret, "SetConsoleTextAttribute failed: error %u\n", GetLastError()); + ok(ret, "SetConsoleTextAttribute failed: error %lu\n", GetLastError());
hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %lu\n", GetLastError());
memset(&csbi2, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFOEX)); csbi2.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
ret = GetConsoleScreenBufferInfoEx(hConOut2, &csbi2); - ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError()); CloseHandle(hConOut2);
ok(csbi2.wAttributes == attr, "Character Attributes should have been copied: " @@ -1080,22 +1080,22 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut) ok(csbi2.wPopupAttributes == attr, "Popup Attributes should match Character Attributes\n");
ret = SetConsoleTextAttribute(hConOut, orig_attr); - ok(ret, "SetConsoleTextAttribute failed: error %u\n", GetLastError()); + ok(ret, "SetConsoleTextAttribute failed: error %lu\n", GetLastError());
/* Test inheritance of different Popup Attributes */ csbi.wPopupAttributes = attr; ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi); - ok(ret, "SetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + ok(ret, "SetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError());
hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %lu\n", GetLastError());
memset(&csbi2, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFOEX)); csbi2.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
ret = GetConsoleScreenBufferInfoEx(hConOut2, &csbi2); - ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError()); CloseHandle(hConOut2);
ok(csbi2.wAttributes == orig_attr, "Character Attributes should have been copied: " @@ -1105,7 +1105,7 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut)
csbi.wPopupAttributes = orig_popup; ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi); - ok(ret, "SetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + ok(ret, "SetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError()); }
static void CALLBACK signaled_function(void *p, BOOLEAN timeout) @@ -1146,7 +1146,7 @@ static void testWaitForConsoleInput(HANDLE input_handle) /* If the callback is still running, this fails with ERROR_IO_PENDING, but that's ok and expected. */ ok(ret != 0 || GetLastError() == ERROR_IO_PENDING, - "UnregisterWait failed with error %d\n", GetLastError()); + "UnregisterWait failed with error %ld\n", GetLastError());
/* Test timeout case */ FlushConsoleInputBuffer(input_handle); @@ -1154,7 +1154,7 @@ static void testWaitForConsoleInput(HANDLE input_handle) wait_ret = WaitForSingleObject(complete_event, 100); ok(wait_ret == WAIT_TIMEOUT, "Expected the wait to time out\n"); ret = UnregisterWait(wait_handle); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
/* Clean up */ CloseHandle(complete_event); @@ -1179,54 +1179,54 @@ static void test_wait(HANDLE input, HANDLE orig_output) output = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(output != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: %u\n", GetLastError()); + ok(output != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: %lu\n", GetLastError());
ret = SetConsoleActiveScreenBuffer(output); - ok(ret, "SetConsoleActiveScreenBuffer failed: %u\n", GetLastError()); + ok(ret, "SetConsoleActiveScreenBuffer failed: %lu\n", GetLastError()); FlushConsoleInputBuffer(input);
unbound_output = create_unbound_handle(TRUE, TRUE); unbound_input = create_unbound_handle(FALSE, TRUE);
res = WaitForSingleObject(input, 0); - ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", res); + ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(output, 0); - ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", res); + ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(orig_output, 0); - ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", res); + ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(unbound_output, 0); - ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", res); + ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(unbound_input, 0); - ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", res); + ok(res == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", res); status = NtWaitForSingleObject(input, FALSE, &zero); ok(status == STATUS_TIMEOUT || broken(status == STATUS_ACCESS_DENIED /* win2k8 */), - "NtWaitForSingleObject returned %x\n", status); + "NtWaitForSingleObject returned %lx\n", status); status = NtWaitForSingleObject(output, FALSE, &zero); ok(status == STATUS_TIMEOUT || broken(status == STATUS_ACCESS_DENIED /* win2k8 */), - "NtWaitForSingleObject returned %x\n", status); + "NtWaitForSingleObject returned %lx\n", status);
ret = WriteConsoleInputW(input, &ir, 1, &count); - ok(ret, "WriteConsoleInputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleInputW failed: %lu\n", GetLastError());
res = WaitForSingleObject(input, 0); - ok(!res, "WaitForSingleObject returned %x\n", res); + ok(!res, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(output, 0); - ok(!res, "WaitForSingleObject returned %x\n", res); + ok(!res, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(orig_output, 0); - ok(!res, "WaitForSingleObject returned %x\n", res); + ok(!res, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(unbound_output, 0); - ok(!res, "WaitForSingleObject returned %x\n", res); + ok(!res, "WaitForSingleObject returned %lx\n", res); res = WaitForSingleObject(unbound_input, 0); - ok(!res, "WaitForSingleObject returned %x\n", res); + ok(!res, "WaitForSingleObject returned %lx\n", res); status = NtWaitForSingleObject(input, FALSE, &zero); ok(!status || broken(status == STATUS_ACCESS_DENIED /* win2k8 */), - "NtWaitForSingleObject returned %x\n", status); + "NtWaitForSingleObject returned %lx\n", status); status = NtWaitForSingleObject(output, FALSE, &zero); ok(!status || broken(status == STATUS_ACCESS_DENIED /* win2k8 */), - "NtWaitForSingleObject returned %x\n", status); + "NtWaitForSingleObject returned %lx\n", status);
ret = SetConsoleActiveScreenBuffer(orig_output); - ok(ret, "SetConsoleActiveScreenBuffer failed: %u\n", GetLastError()); + ok(ret, "SetConsoleActiveScreenBuffer failed: %lu\n", GetLastError());
CloseHandle(unbound_input); CloseHandle(unbound_output); @@ -1244,13 +1244,13 @@ static void test_GetSetConsoleInputExeName(void) ret = pGetConsoleInputExeNameA(0, NULL); error = GetLastError(); ok(ret, "GetConsoleInputExeNameA failed\n"); - ok(error == ERROR_BUFFER_OVERFLOW, "got %u expected ERROR_BUFFER_OVERFLOW\n", error); + ok(error == ERROR_BUFFER_OVERFLOW, "got %lu expected ERROR_BUFFER_OVERFLOW\n", error);
SetLastError(0xdeadbeef); ret = pGetConsoleInputExeNameA(0, buffer); error = GetLastError(); ok(ret, "GetConsoleInputExeNameA failed\n"); - ok(error == ERROR_BUFFER_OVERFLOW, "got %u expected ERROR_BUFFER_OVERFLOW\n", error); + ok(error == ERROR_BUFFER_OVERFLOW, "got %lu expected ERROR_BUFFER_OVERFLOW\n", error);
GetModuleFileNameA(GetModuleHandleA(NULL), module, sizeof(module)); p = strrchr(module, '\') + 1; @@ -1263,13 +1263,13 @@ static void test_GetSetConsoleInputExeName(void) ret = pSetConsoleInputExeNameA(NULL); error = GetLastError(); ok(!ret, "SetConsoleInputExeNameA failed\n"); - ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu expected ERROR_INVALID_PARAMETER\n", error);
SetLastError(0xdeadbeef); ret = pSetConsoleInputExeNameA(""); error = GetLastError(); ok(!ret, "SetConsoleInputExeNameA failed\n"); - ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu expected ERROR_INVALID_PARAMETER\n", error);
ret = pSetConsoleInputExeNameA(input_exe); ok(ret, "SetConsoleInputExeNameA failed\n"); @@ -1293,14 +1293,14 @@ static void test_GetConsoleProcessList(void) ret = pGetConsoleProcessList(NULL, 0); ok(ret == 0, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleProcessList(NULL, 1); ok(ret == 0, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* We should only have 1 process but only for these specific unit tests as @@ -1313,12 +1313,12 @@ static void test_GetConsoleProcessList(void) ret = pGetConsoleProcessList(list, 0); ok(ret == 0, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleProcessList(list, 1); - ok(ret == 1, "Expected 1, got %d\n", ret); + ok(ret == 1, "Expected 1, got %ld\n", ret);
HeapFree(GetProcessHeap(), 0, list);
@@ -1326,12 +1326,12 @@ static void test_GetConsoleProcessList(void)
SetLastError(0xdeadbeef); ret = pGetConsoleProcessList(list, ret); - ok(ret == 1, "Expected 1, got %d\n", ret); + ok(ret == 1, "Expected 1, got %ld\n", ret);
if (ret == 1) { DWORD pid = GetCurrentProcessId(); - ok(list[0] == pid, "Expected %d, got %d\n", pid, list[0]); + ok(list[0] == pid, "Expected %ld, got %ld\n", pid, list[0]); }
HeapFree(GetProcessHeap(), 0, list); @@ -1349,7 +1349,7 @@ static void test_OpenCON(void) { h = CreateFileW(conW, GENERIC_WRITE, 0, NULL, accesses[i], 0, NULL); ok(h != INVALID_HANDLE_VALUE || broken(accesses[i] == TRUNCATE_EXISTING /* Win8 */), - "Expected to open the CON device on write (%x)\n", accesses[i]); + "Expected to open the CON device on write (%lx)\n", accesses[i]); CloseHandle(h);
h = CreateFileW(conW, GENERIC_READ, 0, NULL, accesses[i], 0, NULL); @@ -1359,12 +1359,12 @@ static void test_OpenCON(void) * So don't test when disposition is TRUNCATE_EXISTING */ ok(h != INVALID_HANDLE_VALUE || broken(accesses[i] == TRUNCATE_EXISTING /* Win7+ */), - "Expected to open the CON device on read (%x)\n", accesses[i]); + "Expected to open the CON device on read (%lx)\n", accesses[i]); CloseHandle(h); h = CreateFileW(conW, GENERIC_READ|GENERIC_WRITE, 0, NULL, accesses[i], 0, NULL); - ok(h == INVALID_HANDLE_VALUE, "Expected not to open the CON device on read-write (%x)\n", accesses[i]); + ok(h == INVALID_HANDLE_VALUE, "Expected not to open the CON device on read-write (%lx)\n", accesses[i]); ok(GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER, - "Unexpected error %x\n", GetLastError()); + "Unexpected error %lx\n", GetLastError()); } }
@@ -1460,7 +1460,7 @@ static void test_OpenConsoleW(void) "Expected OpenConsoleW to return INVALID_HANDLE_VALUE for index %d, got %p\n", index, ret); ok(gle == invalid_table[index].gle || (gle != 0 && gle == invalid_table[index].gle2), - "Expected GetLastError() to return %u/%u for index %d, got %u\n", + "Expected GetLastError() to return %lu/%lu for index %d, got %lu\n", invalid_table[index].gle, invalid_table[index].gle2, index, gle); }
@@ -1545,7 +1545,7 @@ static void test_CreateFileW(void) ok(cf_table[index].gle, "Expected CreateFileW not to return INVALID_HANDLE_VALUE for index %d\n", index); ok(GetLastError() == cf_table[index].gle, - "Expected GetLastError() to return %u for index %d, got %u\n", + "Expected GetLastError() to return %lu for index %d, got %lu\n", cf_table[index].gle, index, GetLastError()); } else @@ -1568,10 +1568,10 @@ static void test_CreateFileW(void) cf_table[index].creation, FILE_ATTRIBUTE_NORMAL, NULL); if (cf_table[index].gle) ok(ret == INVALID_HANDLE_VALUE && GetLastError() == cf_table[index].gle, - "CreateFileW to returned %p %u for index %d\n", ret, GetLastError(), index); + "CreateFileW to returned %p %lu for index %d\n", ret, GetLastError(), index); else ok(ret != INVALID_HANDLE_VALUE && (!cf_table[index].gle || broken(cf_table[index].is_broken) /* Win7 */), - "CreateFileW to returned %p %u for index %d\n", ret, GetLastError(), index); + "CreateFileW to returned %p %lu for index %d\n", ret, GetLastError(), index); if (ret != INVALID_HANDLE_VALUE) CloseHandle(ret);
if (cf_table[index].gle) continue; @@ -1582,7 +1582,7 @@ static void test_CreateFileW(void) status = NtCreateFile(&ret, cf_table[index].access | SYNCHRONIZE | FILE_READ_ATTRIBUTES, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, 0, nt_disposition[cf_table[index].creation - CREATE_NEW], FILE_NON_DIRECTORY_FILE, NULL, 0); - ok(!status, "NtCreateFile failed %x for %u\n", status, index); + ok(!status, "NtCreateFile failed %lx for %u\n", status, index); CloseHandle(ret);
RtlInitUnicodeString(&string, cf_table[index].input ? L"\??\CONIN$" : L"\??\CONOUT$"); @@ -1590,7 +1590,7 @@ static void test_CreateFileW(void) status = NtCreateFile(&ret, cf_table[index].access | SYNCHRONIZE | FILE_READ_ATTRIBUTES, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, 0, nt_disposition[cf_table[index].creation - CREATE_NEW], FILE_NON_DIRECTORY_FILE, NULL, 0); - ok(!status, "NtCreateFile failed %x for %u\n", status, index); + ok(!status, "NtCreateFile failed %lx for %u\n", status, index); CloseHandle(ret); } } @@ -1611,28 +1611,28 @@ static void test_VerifyConsoleIoHandle( HANDLE handle ) ret = pVerifyConsoleIoHandle((HANDLE)0xdeadbee0); error = GetLastError(); ok(!ret, "expected VerifyConsoleIoHandle to fail\n"); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error);
/* invalid handle + 1 */ SetLastError(0xdeadbeef); ret = pVerifyConsoleIoHandle((HANDLE)0xdeadbee1); error = GetLastError(); ok(!ret, "expected VerifyConsoleIoHandle to fail\n"); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error);
/* invalid handle + 2 */ SetLastError(0xdeadbeef); ret = pVerifyConsoleIoHandle((HANDLE)0xdeadbee2); error = GetLastError(); ok(!ret, "expected VerifyConsoleIoHandle to fail\n"); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error);
/* invalid handle + 3 */ SetLastError(0xdeadbeef); ret = pVerifyConsoleIoHandle((HANDLE)0xdeadbee3); error = GetLastError(); ok(!ret, "expected VerifyConsoleIoHandle to fail\n"); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error);
/* valid handle */ SetLastError(0xdeadbeef); @@ -1641,7 +1641,7 @@ static void test_VerifyConsoleIoHandle( HANDLE handle ) ok(ret || broken(!ret), /* Windows 8 and 10 */ "expected VerifyConsoleIoHandle to succeed\n"); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error); }
static void test_GetSetStdHandle(void) @@ -1655,14 +1655,14 @@ static void test_GetSetStdHandle(void) handle = GetStdHandle(42); error = GetLastError(); ok(error == ERROR_INVALID_HANDLE || broken(error == ERROR_INVALID_FUNCTION)/* Win9x */, - "wrong GetLastError() %d\n", error); + "wrong GetLastError() %ld\n", error); ok(handle == INVALID_HANDLE_VALUE, "expected INVALID_HANDLE_VALUE\n");
/* get valid */ SetLastError(0xdeadbeef); handle = GetStdHandle(STD_INPUT_HANDLE); error = GetLastError(); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error);
/* set invalid std handle */ SetLastError(0xdeadbeef); @@ -1670,14 +1670,14 @@ static void test_GetSetStdHandle(void) error = GetLastError(); ok(!ret, "expected SetStdHandle to fail\n"); ok(error == ERROR_INVALID_HANDLE || broken(error == ERROR_INVALID_FUNCTION)/* Win9x */, - "wrong GetLastError() %d\n", error); + "wrong GetLastError() %ld\n", error);
/* set valid (restore old value) */ SetLastError(0xdeadbeef); ret = SetStdHandle(STD_INPUT_HANDLE, handle); error = GetLastError(); ok(ret, "expected SetStdHandle to succeed\n"); - ok(error == 0xdeadbeef, "wrong GetLastError() %d\n", error); + ok(error == 0xdeadbeef, "wrong GetLastError() %ld\n", error); }
static void test_DuplicateConsoleHandle(void) @@ -1691,19 +1691,19 @@ static void test_DuplicateConsoleHandle(void)
/* duplicate an event handle with DuplicateConsoleHandle */ handle = DuplicateConsoleHandle(event, 0, FALSE, DUPLICATE_SAME_ACCESS); - ok(handle != NULL, "DuplicateConsoleHandle failed: %u\n", GetLastError()); + ok(handle != NULL, "DuplicateConsoleHandle failed: %lu\n", GetLastError());
ret = SetEvent(handle); - ok(ret, "SetEvent failed: %u\n", GetLastError()); + ok(ret, "SetEvent failed: %lu\n", GetLastError());
ret = CloseConsoleHandle(handle); - ok(ret, "CloseConsoleHandle failed: %u\n", GetLastError()); + ok(ret, "CloseConsoleHandle failed: %lu\n", GetLastError()); ret = CloseConsoleHandle(event); - ok(ret, "CloseConsoleHandle failed: %u\n", GetLastError()); + ok(ret, "CloseConsoleHandle failed: %lu\n", GetLastError());
handle = DuplicateConsoleHandle((HANDLE)0xdeadbeef, 0, FALSE, DUPLICATE_SAME_ACCESS); - ok(handle == INVALID_HANDLE_VALUE, "DuplicateConsoleHandle failed: %u\n", GetLastError()); - ok(GetLastError() == ERROR_INVALID_HANDLE, "last error = %u\n", GetLastError()); + ok(handle == INVALID_HANDLE_VALUE, "DuplicateConsoleHandle failed: %lu\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "last error = %lu\n", GetLastError()); }
static void test_GetNumberOfConsoleInputEvents(HANDLE input_handle) @@ -1735,10 +1735,10 @@ static void test_GetNumberOfConsoleInputEvents(HANDLE input_handle) if (invalid_table[i].nrofevents) { ok(count == 0xdeadbeef, - "[%d] Expected output count to be unmodified, got %u\n", i, count); + "[%d] Expected output count to be unmodified, got %lu\n", i, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
@@ -1749,7 +1749,7 @@ static void test_GetNumberOfConsoleInputEvents(HANDLE input_handle) ret = GetNumberOfConsoleInputEvents(input_handle, NULL); ok(!ret, "Expected GetNumberOfConsoleInputEvents to return FALSE, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_ACCESS, - "Expected last error to be ERROR_INVALID_ACCESS, got %u\n", + "Expected last error to be ERROR_INVALID_ACCESS, got %lu\n", GetLastError()); }
@@ -1807,7 +1807,7 @@ static void test_WriteConsoleInputA(HANDLE input_handle) ok(ret == TRUE, "Expected GetConsoleMode to return TRUE, got %d\n", ret); if (!ret) { - skip("GetConsoleMode failed with last error %u\n", GetLastError()); + skip("GetConsoleMode failed with last error %lu\n", GetLastError()); return; }
@@ -1815,7 +1815,7 @@ static void test_WriteConsoleInputA(HANDLE input_handle) ok(ret == TRUE, "Expected SetConsoleMode to return TRUE, got %d\n", ret); if (!ret) { - skip("SetConsoleMode failed with last error %u\n", GetLastError()); + skip("SetConsoleMode failed with last error %lu\n", GetLastError()); return; }
@@ -1840,24 +1840,24 @@ static void test_WriteConsoleInputA(HANDLE input_handle) ok(!ret, "[%d] Expected WriteConsoleInputA to return FALSE, got %d\n", i, ret); gle = GetLastError(); ok(gle == invalid_table[i].gle || (gle != 0 && gle == invalid_table[i].gle2), - "[%d] Expected last error to be %u or %u, got %u\n", + "[%d] Expected last error to be %lu or %lu, got %lu\n", i, invalid_table[i].gle, invalid_table[i].gle2, gle); }
count = 0xdeadbeef; ret = WriteConsoleInputA(input_handle, NULL, 0, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleInputA(input_handle, &event, 0, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -1868,20 +1868,20 @@ static void test_WriteConsoleInputA(HANDLE input_handle)
ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); todo_wine - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -1896,33 +1896,33 @@ static void test_WriteConsoleInputA(HANDLE input_handle) ret = WriteConsoleInputA(input_handle, event_list, ARRAY_SIZE(event_list), &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); ok(count == ARRAY_SIZE(event_list), - "Expected count to be event list length, got %u\n", count); + "Expected count to be event list length, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); ok(count == ARRAY_SIZE(event_list), - "Expected count to be event list length, got %u\n", count); + "Expected count to be event list length, got %lu\n", count);
ret = WriteConsoleInputA(input_handle, event_list, ARRAY_SIZE(event_list), &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); ok(count == ARRAY_SIZE(event_list), - "Expected count to be event list length, got %u\n", count); + "Expected count to be event list length, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); ok(count == 2*ARRAY_SIZE(event_list), - "Expected count to be twice event list length, got %u\n", count); + "Expected count to be twice event list length, got %lu\n", count);
/* Again, writing a single mouse event with adjacent mouse events queued doesn't appear to affect the count. */ ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); todo_wine ok(count == 2*ARRAY_SIZE(event_list), - "Expected count to be twice event list length, got %u\n", count); + "Expected count to be twice event list length, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -1940,19 +1940,19 @@ static void test_WriteConsoleInputA(HANDLE input_handle) /* Key events don't exhibit the same behavior as mouse events. */ ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 2, "Expected count to be 2, got %u\n", count); + ok(count == 2, "Expected count to be 2, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -1963,33 +1963,33 @@ static void test_WriteConsoleInputA(HANDLE input_handle)
ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
event.EventType = KEY_EVENT; event.Event.KeyEvent = key_event;
ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 2, "Expected count to be 2, got %u\n", count); + ok(count == 2, "Expected count to be 2, got %lu\n", count);
event.EventType = MOUSE_EVENT; event.Event.MouseEvent = mouse_event;
ret = WriteConsoleInputA(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 3, "Expected count to be 3, got %u\n", count); + ok(count == 3, "Expected count to be 3, got %lu\n", count);
/* Restore the old console mode. */ ret = SetConsoleMode(input_handle, console_mode); @@ -2044,7 +2044,7 @@ static void test_WriteConsoleInputW(HANDLE input_handle) ok(ret == TRUE, "Expected GetConsoleMode to return TRUE, got %d\n", ret); if (!ret) { - skip("GetConsoleMode failed with last error %u\n", GetLastError()); + skip("GetConsoleMode failed with last error %lu\n", GetLastError()); return; }
@@ -2052,7 +2052,7 @@ static void test_WriteConsoleInputW(HANDLE input_handle) ok(ret == TRUE, "Expected SetConsoleMode to return TRUE, got %d\n", ret); if (!ret) { - skip("SetConsoleMode failed with last error %u\n", GetLastError()); + skip("SetConsoleMode failed with last error %lu\n", GetLastError()); return; }
@@ -2077,24 +2077,24 @@ static void test_WriteConsoleInputW(HANDLE input_handle) ok(!ret, "[%d] Expected WriteConsoleInputW to return FALSE, got %d\n", i, ret); gle = GetLastError(); ok(gle == invalid_table[i].gle || (gle != 0 && gle == invalid_table[i].gle2), - "[%d] Expected last error to be %u or %u, got %u\n", + "[%d] Expected last error to be %lu or %lu, got %lu\n", i, invalid_table[i].gle, invalid_table[i].gle2, gle); }
count = 0xdeadbeef; ret = WriteConsoleInputW(input_handle, NULL, 0, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleInputW(input_handle, &event, 0, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -2105,20 +2105,20 @@ static void test_WriteConsoleInputW(HANDLE input_handle)
ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); todo_wine - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -2133,33 +2133,33 @@ static void test_WriteConsoleInputW(HANDLE input_handle) ret = WriteConsoleInputW(input_handle, event_list, ARRAY_SIZE(event_list), &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); ok(count == ARRAY_SIZE(event_list), - "Expected count to be event list length, got %u\n", count); + "Expected count to be event list length, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); ok(count == ARRAY_SIZE(event_list), - "Expected count to be event list length, got %u\n", count); + "Expected count to be event list length, got %lu\n", count);
ret = WriteConsoleInputW(input_handle, event_list, ARRAY_SIZE(event_list), &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); ok(count == ARRAY_SIZE(event_list), - "Expected count to be event list length, got %u\n", count); + "Expected count to be event list length, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); ok(count == 2*ARRAY_SIZE(event_list), - "Expected count to be twice event list length, got %u\n", count); + "Expected count to be twice event list length, got %lu\n", count);
/* Again, writing a single mouse event with adjacent mouse events queued doesn't appear to affect the count. */ ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); todo_wine ok(count == 2*ARRAY_SIZE(event_list), - "Expected count to be twice event list length, got %u\n", count); + "Expected count to be twice event list length, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -2177,19 +2177,19 @@ static void test_WriteConsoleInputW(HANDLE input_handle) /* Key events don't exhibit the same behavior as mouse events. */ ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 2, "Expected count to be 2, got %u\n", count); + ok(count == 2, "Expected count to be 2, got %lu\n", count);
ret = FlushConsoleInputBuffer(input_handle); ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret); @@ -2200,33 +2200,33 @@ static void test_WriteConsoleInputW(HANDLE input_handle)
ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
event.EventType = KEY_EVENT; event.Event.KeyEvent = key_event;
ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 2, "Expected count to be 2, got %u\n", count); + ok(count == 2, "Expected count to be 2, got %lu\n", count);
event.EventType = MOUSE_EVENT; event.Event.MouseEvent = mouse_event;
ret = WriteConsoleInputW(input_handle, &event, 1, &count); ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count); ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret); - ok(count == 3, "Expected count to be 3, got %u\n", count); + ok(count == 3, "Expected count to be 3, got %lu\n", count);
/* Restore the old console mode. */ ret = SetConsoleMode(input_handle, console_mode); @@ -2240,11 +2240,11 @@ static void test_FlushConsoleInputBuffer(HANDLE input, HANDLE output) BOOL ret;
ret = FlushConsoleInputBuffer(input); - ok(ret, "FlushConsoleInputBuffer failed: %u\n", GetLastError()); + ok(ret, "FlushConsoleInputBuffer failed: %lu\n", GetLastError());
ret = GetNumberOfConsoleInputEvents(input, &count); - ok(ret, "GetNumberOfConsoleInputEvents failed: %u\n", GetLastError()); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(ret, "GetNumberOfConsoleInputEvents failed: %lu\n", GetLastError()); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
record.EventType = KEY_EVENT; record.Event.KeyEvent.bKeyDown = 1; @@ -2254,39 +2254,39 @@ static void test_FlushConsoleInputBuffer(HANDLE input, HANDLE output) record.Event.KeyEvent.uChar.UnicodeChar = '\r'; record.Event.KeyEvent.dwControlKeyState = 0; ret = WriteConsoleInputW(input, &record, 1, &count); - ok(ret, "WriteConsoleInputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleInputW failed: %lu\n", GetLastError());
ret = GetNumberOfConsoleInputEvents(input, &count); - ok(ret, "GetNumberOfConsoleInputEvents failed: %u\n", GetLastError()); - ok(count == 1, "Expected count to be 0, got %u\n", count); + ok(ret, "GetNumberOfConsoleInputEvents failed: %lu\n", GetLastError()); + ok(count == 1, "Expected count to be 0, got %lu\n", count);
ret = FlushConsoleInputBuffer(input); - ok(ret, "FlushConsoleInputBuffer failed: %u\n", GetLastError()); + ok(ret, "FlushConsoleInputBuffer failed: %lu\n", GetLastError());
ret = GetNumberOfConsoleInputEvents(input, &count); - ok(ret, "GetNumberOfConsoleInputEvents failed: %u\n", GetLastError()); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(ret, "GetNumberOfConsoleInputEvents failed: %lu\n", GetLastError()); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
ret = WriteConsoleInputW(input, &record, 1, &count); - ok(ret, "WriteConsoleInputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleInputW failed: %lu\n", GetLastError());
ret = GetNumberOfConsoleInputEvents(input, &count); - ok(ret, "GetNumberOfConsoleInputEvents failed: %u\n", GetLastError()); - ok(count == 1, "Expected count to be 0, got %u\n", count); + ok(ret, "GetNumberOfConsoleInputEvents failed: %lu\n", GetLastError()); + ok(count == 1, "Expected count to be 0, got %lu\n", count);
ret = FlushFileBuffers(input); - ok(ret, "FlushFileBuffers failed: %u\n", GetLastError()); + ok(ret, "FlushFileBuffers failed: %lu\n", GetLastError());
ret = GetNumberOfConsoleInputEvents(input, &count); - ok(ret, "GetNumberOfConsoleInputEvents failed: %u\n", GetLastError()); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(ret, "GetNumberOfConsoleInputEvents failed: %lu\n", GetLastError()); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
ret = FlushConsoleInputBuffer(output); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FlushConsoleInputBuffer returned: %x(%u)\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FlushConsoleInputBuffer returned: %x(%lu)\n", ret, GetLastError());
ret = FlushFileBuffers(output); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FlushFileBuffers returned: %x(%u)\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "FlushFileBuffers returned: %x(%lu)\n", ret, GetLastError()); }
@@ -2350,34 +2350,34 @@ static void test_WriteConsoleOutputCharacterA(HANDLE output_handle) if (invalid_table[i].lpNumCharsWritten) { ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %u, got %u\n", + "[%d] Expected count to be %lu, got %lu\n", i, invalid_table[i].expected_count, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = WriteConsoleOutputCharacterA(output_handle, NULL, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleOutputCharacterA(output_handle, output, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleOutputCharacterA(output_handle, output, 1, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; origin.X = 200; ret = WriteConsoleOutputCharacterA(output_handle, output, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count); }
static void test_WriteConsoleOutputCharacterW(HANDLE output_handle) @@ -2440,34 +2440,34 @@ static void test_WriteConsoleOutputCharacterW(HANDLE output_handle) if (invalid_table[i].lpNumCharsWritten) { ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %u, got %u\n", + "[%d] Expected count to be %lu, got %lu\n", i, invalid_table[i].expected_count, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = WriteConsoleOutputCharacterW(output_handle, NULL, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleOutputCharacterW(output_handle, outputW, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleOutputCharacterW(output_handle, outputW, 1, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; origin.X = 200; ret = WriteConsoleOutputCharacterW(output_handle, outputW, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
}
@@ -2530,34 +2530,34 @@ static void test_WriteConsoleOutputAttribute(HANDLE output_handle) if (invalid_table[i].lpNumAttrsWritten) { ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %u, got %u\n", + "[%d] Expected count to be %lu, got %lu\n", i, invalid_table[i].expected_count, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = WriteConsoleOutputAttribute(output_handle, NULL, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleOutputAttribute(output_handle, &attr, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = WriteConsoleOutputAttribute(output_handle, &attr, 1, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; origin.X = 200; ret = WriteConsoleOutputAttribute(output_handle, &attr, 0, origin, &count); ok(ret == TRUE, "Expected WriteConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count); }
static void set_region(SMALL_RECT *region, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom) @@ -2602,7 +2602,7 @@ static void test_WriteConsoleOutput(HANDLE console) }
ret = GetConsoleScreenBufferInfo(console, &info); - ok(ret, "GetConsoleScreenBufferInfo failed: %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfo failed: %lu\n", GetLastError());
size.X = 23; size.Y = 17; @@ -2610,7 +2610,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "WriteConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 10, 7, 15, 11);
size.X = 23; @@ -2619,7 +2619,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 200, 7, 15, 211); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 200, 7, 15, 211);
size.X = 23; @@ -2628,7 +2628,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 200, 7, 211, 8); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "WriteConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 200, 7, 211, 8);
size.X = 23; @@ -2637,7 +2637,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 9, 11); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, 9, 11);
size.X = 23; @@ -2646,7 +2646,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 11, 6); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, 11, 6);
size.X = 2; @@ -2655,7 +2655,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, 15, 11);
size.X = 23; @@ -2664,7 +2664,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "WriteConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, 15, 11);
size.X = 6; @@ -2673,7 +2673,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "WriteConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 10, 7, 13, 11);
size.X = 6; @@ -2682,7 +2682,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = WriteConsoleOutputW((HANDLE)0xdeadbeef, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "WriteConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "WriteConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); if (!skip_nt) check_region(®ion, 10, 7, 13, 11);
size.X = 16; @@ -2691,7 +2691,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "WriteConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 10, 7, 15, 10);
size.X = 16; @@ -2700,7 +2700,7 @@ static void test_WriteConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, info.dwSize.X - 2, 7, info.dwSize.X + 2, 7); ret = WriteConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "WriteConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "WriteConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, info.dwSize.X - 2, 7, info.dwSize.X - 1, 7); }
@@ -2748,19 +2748,19 @@ static void test_FillConsoleOutputCharacterA(HANDLE output_handle) invalid_table[i].lpNumCharsWritten); ok(!ret, "[%d] Expected FillConsoleOutputCharacterA to return FALSE, got %d\n", i, ret); ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = FillConsoleOutputCharacterA(output_handle, 'a', 0, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = FillConsoleOutputCharacterA(output_handle, 'a', 1, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count); }
static void test_FillConsoleOutputCharacterW(HANDLE output_handle) @@ -2807,19 +2807,19 @@ static void test_FillConsoleOutputCharacterW(HANDLE output_handle) invalid_table[i].lpNumCharsWritten); ok(!ret, "[%d] Expected FillConsoleOutputCharacterW to return FALSE, got %d\n", i, ret); ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = FillConsoleOutputCharacterW(output_handle, 'a', 0, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = FillConsoleOutputCharacterW(output_handle, 'a', 1, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count); }
static void test_FillConsoleOutputAttribute(HANDLE output_handle) @@ -2866,24 +2866,24 @@ static void test_FillConsoleOutputAttribute(HANDLE output_handle) invalid_table[i].lpNumAttrsWritten); ok(!ret, "[%d] Expected FillConsoleOutputAttribute to return FALSE, got %d\n", i, ret); ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = FillConsoleOutputAttribute(output_handle, FOREGROUND_BLUE, 0, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = FillConsoleOutputAttribute(output_handle, FOREGROUND_BLUE, 1, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; ret = FillConsoleOutputAttribute(output_handle, ~0, 1, origin, &count); ok(ret == TRUE, "Expected FillConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count); }
static void test_ReadConsoleOutputCharacterA(HANDLE output_handle) @@ -2946,34 +2946,34 @@ static void test_ReadConsoleOutputCharacterA(HANDLE output_handle) if (invalid_table[i].read_count) { ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %u, got %u\n", + "[%d] Expected count to be %lu, got %lu\n", i, invalid_table[i].expected_count, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = ReadConsoleOutputCharacterA(output_handle, NULL, 0, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = ReadConsoleOutputCharacterA(output_handle, &read, 0, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = ReadConsoleOutputCharacterA(output_handle, &read, 1, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; origin.X = 200; ret = ReadConsoleOutputCharacterA(output_handle, &read, 1, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterA to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count); }
static void test_ReadConsoleOutputCharacterW(HANDLE output_handle) @@ -3036,34 +3036,34 @@ static void test_ReadConsoleOutputCharacterW(HANDLE output_handle) if (invalid_table[i].read_count) { ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %u, got %u\n", + "[%d] Expected count to be %lu, got %lu\n", i, invalid_table[i].expected_count, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = ReadConsoleOutputCharacterW(output_handle, NULL, 0, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = ReadConsoleOutputCharacterW(output_handle, &read, 0, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = ReadConsoleOutputCharacterW(output_handle, &read, 1, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; origin.X = 200; ret = ReadConsoleOutputCharacterW(output_handle, &read, 1, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputCharacterW to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count); }
static void test_ReadConsoleOutputAttribute(HANDLE output_handle) @@ -3125,34 +3125,34 @@ static void test_ReadConsoleOutputAttribute(HANDLE output_handle) if (invalid_table[i].read_count) { ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %u, got %u\n", + "[%d] Expected count to be %lu, got %lu\n", i, invalid_table[i].expected_count, count); } ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", + "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); }
count = 0xdeadbeef; ret = ReadConsoleOutputAttribute(output_handle, NULL, 0, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = ReadConsoleOutputAttribute(output_handle, &attr, 0, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 0, got %u\n", count); + ok(count == 0, "Expected count to be 0, got %lu\n", count);
count = 0xdeadbeef; ret = ReadConsoleOutputAttribute(output_handle, &attr, 1, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 1, "Expected count to be 1, got %u\n", count); + ok(count == 1, "Expected count to be 1, got %lu\n", count);
count = 0xdeadbeef; origin.X = 200; ret = ReadConsoleOutputAttribute(output_handle, &attr, 1, origin, &count); ok(ret == TRUE, "Expected ReadConsoleOutputAttribute to return TRUE, got %d\n", ret); - ok(count == 0, "Expected count to be 1, got %u\n", count); + ok(count == 0, "Expected count to be 1, got %lu\n", count); }
static void test_ReadConsoleOutput(HANDLE console) @@ -3168,7 +3168,7 @@ static void test_ReadConsoleOutput(HANDLE console) if (skip_nt) return;
ret = GetConsoleScreenBufferInfo(console, &info); - ok(ret, "GetConsoleScreenBufferInfo failed: %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfo failed: %lu\n", GetLastError());
size.X = 23; size.Y = 17; @@ -3176,7 +3176,7 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "ReadConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "ReadConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 10, 7, 15, 11);
size.X = 23; @@ -3185,7 +3185,7 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 200, 7, 15, 211); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(!ret, "ReadConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret, "ReadConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 200, 7, -15, 0);
size.X = 23; @@ -3195,7 +3195,7 @@ static void test_ReadConsoleOutput(HANDLE console) set_region(®ion, 200, 7, 211, 8); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); ok((!ret && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_INVALID_FUNCTION)) || broken(ret /* win8 */), - "ReadConsoleOutputW returned: %x %u\n", ret, GetLastError()); + "ReadConsoleOutputW returned: %x %lu\n", ret, GetLastError()); if (!ret && GetLastError() == ERROR_INVALID_PARAMETER) check_region(®ion, 200, 7, -211, -8);
size.X = 23; @@ -3205,7 +3205,7 @@ static void test_ReadConsoleOutput(HANDLE console) set_region(®ion, 10, 7, 9, 11); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); ok((!ret && (GetLastError() == ERROR_INVALID_FUNCTION || GetLastError() == ERROR_NOT_ENOUGH_MEMORY)) || broken(ret /* win8 */), - "ReadConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + "ReadConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, 9, -11);
size.X = 23; @@ -3215,7 +3215,7 @@ static void test_ReadConsoleOutput(HANDLE console) set_region(®ion, 10, 7, 11, 6); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); ok((!ret && (GetLastError() == ERROR_INVALID_FUNCTION || GetLastError() == ERROR_NOT_ENOUGH_MEMORY)) || broken(ret /* win8 */), - "ReadConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + "ReadConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, -11, 6);
size.X = 2; @@ -3225,7 +3225,7 @@ static void test_ReadConsoleOutput(HANDLE console) set_region(®ion, 10, 7, 15, 11); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); ok((!ret && (GetLastError() == ERROR_INVALID_FUNCTION || GetLastError() == ERROR_NOT_ENOUGH_MEMORY)) || broken(ret /* win8 */), - "ReadConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + "ReadConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, -15, -11);
size.X = 23; @@ -3235,7 +3235,7 @@ static void test_ReadConsoleOutput(HANDLE console) set_region(®ion, 10, 7, 15, 11); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); ok((!ret && (GetLastError() == ERROR_INVALID_FUNCTION || GetLastError() == ERROR_NOT_ENOUGH_MEMORY)) || broken(ret /* win8 */), - "ReadConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + "ReadConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); check_region(®ion, 10, 7, -15, 6);
size.X = 6; @@ -3244,7 +3244,7 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "ReadConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "ReadConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 10, 7, 13, 11);
size.X = 6; @@ -3253,7 +3253,7 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = ReadConsoleOutputW((HANDLE)0xdeadbeef, char_info_buf, size, coord, ®ion); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "ReadConsoleOutputW returned: %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "ReadConsoleOutputW returned: %x(%lu)\n", ret, GetLastError()); if (!skip_nt) check_region(®ion, 10, 7, 13, 11);
size.X = 16; @@ -3262,7 +3262,7 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, 10, 7, 15, 11); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "ReadConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "ReadConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 10, 7, 15, 10);
size.X = 16; @@ -3271,14 +3271,14 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 3; set_region(®ion, info.dwSize.X - 2, 7, info.dwSize.X + 2, 7); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret || GetLastError() == ERROR_INVALID_PARAMETER, "ReadConsoleOutputW failed: %u\n", GetLastError()); + ok(ret || GetLastError() == ERROR_INVALID_PARAMETER, "ReadConsoleOutputW failed: %lu\n", GetLastError()); if (ret) check_region(®ion, info.dwSize.X - 2, 7, info.dwSize.X - 1, 7);
coord.X = 2; coord.Y = 3; ret = WriteConsoleOutputCharacterW(console, L"xyz", 3, coord, &count); - ok(ret, "WriteConsoleOutputCharacterW failed: %u\n", GetLastError()); - ok(count == 3, "count = %u\n", count); + ok(ret, "WriteConsoleOutputCharacterW failed: %lu\n", GetLastError()); + ok(count == 3, "count = %lu\n", count);
memset(char_info_buf, 0xc0, sizeof(char_info_buf)); size.X = 16; @@ -3287,7 +3287,7 @@ static void test_ReadConsoleOutput(HANDLE console) coord.Y = 6; set_region(®ion, 2, 3, 5, 3); ret = ReadConsoleOutputW(console, char_info_buf, size, coord, ®ion); - ok(ret, "ReadConsoleOutputW failed: %u\n", GetLastError()); + ok(ret, "ReadConsoleOutputW failed: %lu\n", GetLastError()); check_region(®ion, 2, 3, 5, 3); ch = char_info_buf[coord.Y * size.X + coord.X].Char.UnicodeChar; ok(ch == 'x', "unexpected char %c/%x\n", ch, ch); @@ -3305,52 +3305,52 @@ static void test_ReadConsole(HANDLE input)
SetLastError(0xdeadbeef); ret = GetFileSize(input, NULL); - ok(ret == INVALID_FILE_SIZE, "expected INVALID_FILE_SIZE, got %#x\n", ret); + ok(ret == INVALID_FILE_SIZE, "expected INVALID_FILE_SIZE, got %#lx\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_INVALID_FUNCTION, /* Win 8, 10 */ - "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(input, buf, -128, &bytes, NULL); - ok(!ret, "expected 0, got %u\n", ret); + ok(!ret, "expected 0, got %lu\n", ret); ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY || GetLastError() == ERROR_NOACCESS, /* Win 8, 10 */ - "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n", GetLastError()); - ok(!bytes, "expected 0, got %u\n", bytes); + "expected ERROR_NOT_ENOUGH_MEMORY, got %ld\n", GetLastError()); + ok(!bytes, "expected 0, got %lu\n", bytes);
bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadConsoleA(input, buf, -128, &bytes, NULL); - ok(!ret, "expected 0, got %u\n", ret); + ok(!ret, "expected 0, got %lu\n", ret); ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY || GetLastError() == ERROR_NOACCESS, /* Win 8, 10 */ - "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n", GetLastError()); - ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#x\n", bytes); + "expected ERROR_NOT_ENOUGH_MEMORY, got %ld\n", GetLastError()); + ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", bytes);
bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadConsoleW(input, buf, -128, &bytes, NULL); - ok(!ret, "expected 0, got %u\n", ret); + ok(!ret, "expected 0, got %lu\n", ret); ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY || GetLastError() == ERROR_NOACCESS, /* Win 8, 10 */ - "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n", GetLastError()); - ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#x\n", bytes); + "expected ERROR_NOT_ENOUGH_MEMORY, got %ld\n", GetLastError()); + ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", bytes);
output = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); ok(output != INVALID_HANDLE_VALUE, "Could not open console\n");
ret = ReadConsoleW(output, buf, sizeof(buf) / sizeof(WCHAR), &bytes, NULL); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "ReadConsoleW returned %x(%u)\n", ret, GetLastError()); + "ReadConsoleW returned %lx(%lu)\n", ret, GetLastError());
ret = ReadConsoleA(output, buf, sizeof(buf), &bytes, NULL); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "ReadConsoleA returned %x(%u)\n", ret, GetLastError()); + "ReadConsoleA returned %lx(%lu)\n", ret, GetLastError());
ret = ReadFile(output, buf, sizeof(buf), &bytes, NULL); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "ReadFile returned %x(%u)\n", ret, GetLastError()); + "ReadFile returned %lx(%lu)\n", ret, GetLastError());
CloseHandle(output); } @@ -3368,7 +3368,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(NULL, FALSE, &cfi); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y);
@@ -3376,7 +3376,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(NULL, TRUE, &cfi); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y);
@@ -3384,7 +3384,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), FALSE, &cfi); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y);
@@ -3392,7 +3392,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), TRUE, &cfi); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y);
@@ -3401,7 +3401,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(pipe1, TRUE, &cfi); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y); CloseHandle(pipe1); @@ -3411,7 +3411,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(std_output, FALSE, &cfi); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); GetConsoleScreenBufferInfo(std_output, &csbi); width = csbi.srWindow.Right - csbi.srWindow.Left + 1; height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; @@ -3425,7 +3425,7 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(std_output, TRUE, &cfi); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); ok(cfi.dwFontSize.X == csbi.dwMaximumWindowSize.X, "got %d, expected %d\n", cfi.dwFontSize.X, csbi.dwMaximumWindowSize.X); ok(cfi.dwFontSize.Y == csbi.dwMaximumWindowSize.Y, @@ -3454,82 +3454,82 @@ static void test_GetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
cfix.cbSize = sizeof(CONSOLE_FONT_INFOEX);
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(pipe1, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(std_output, FALSE, &cfi); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n");
SetLastError(0xdeadbeef); c = GetConsoleFontSize(std_output, cfix.nFont); - ok(c.X && c.Y, "GetConsoleFontSize failed; err = %u\n", GetLastError()); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(c.X && c.Y, "GetConsoleFontSize failed; err = %lu\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
ok(cfix.dwFontSize.X == c.X, "Font width doesn't match; got %u, expected %u\n", cfix.dwFontSize.X, c.X); @@ -3544,13 +3544,13 @@ static void test_GetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); SetLastError(0xdeadbeef); ret = GetCurrentConsoleFont(std_output, TRUE, &cfi); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n"); @@ -3574,18 +3574,18 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
@@ -3593,47 +3593,47 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
cfix = orig_cfix;
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
@@ -3641,35 +3641,35 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix); ok(!ret, "got %d, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
/* Restore original console font parameters */ SetLastError(0xdeadbeef); ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); }
static void test_GetConsoleFontSize(HANDLE std_output) @@ -3687,14 +3687,14 @@ static void test_GetConsoleFontSize(HANDLE std_output) memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetConsoleFontSize(NULL, index); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!c.X, "got %d, expected 0\n", c.X); ok(!c.Y, "got %d, expected 0\n", c.Y);
memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetConsoleFontSize(GetStdHandle(STD_INPUT_HANDLE), index); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!c.X, "got %d, expected 0\n", c.X); ok(!c.Y, "got %d, expected 0\n", c.Y);
@@ -3702,7 +3702,7 @@ static void test_GetConsoleFontSize(HANDLE std_output) memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetConsoleFontSize(pipe1, index); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!c.X, "got %d, expected 0\n", c.X); ok(!c.Y, "got %d, expected 0\n", c.Y); CloseHandle(pipe1); @@ -3712,13 +3712,13 @@ static void test_GetConsoleFontSize(HANDLE std_output) memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetConsoleFontSize(std_output, cfi.nFont); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); GetClientRect(GetConsoleWindow(), &r); GetConsoleScreenBufferInfo(std_output, &csbi); font_width = (r.right - r.left) / (csbi.srWindow.Right - csbi.srWindow.Left + 1); font_height = (r.bottom - r.top) / (csbi.srWindow.Bottom - csbi.srWindow.Top + 1); - ok(c.X == font_width, "got %d, expected %d\n", c.X, font_width); - ok(c.Y == font_height, "got %d, expected %d\n", c.Y, font_height); + ok(c.X == font_width, "got %d, expected %ld\n", c.X, font_width); + ok(c.Y == font_height, "got %d, expected %ld\n", c.Y, font_height);
hmod = GetModuleHandleA("kernel32.dll"); pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); @@ -3733,7 +3733,7 @@ static void test_GetConsoleFontSize(HANDLE std_output) SetLastError(0xdeadbeef); c = GetConsoleFontSize(std_output, index); ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == 0xdeadbeef) /* win10 1809 */, - "unexpected last error %u\n", GetLastError()); + "unexpected last error %lu\n", GetLastError()); if (GetLastError() == ERROR_INVALID_PARAMETER) { ok(!c.X, "got %d, expected 0\n", c.X); @@ -3758,14 +3758,14 @@ static void test_GetLargestConsoleWindowSize(HANDLE std_output) memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetLargestConsoleWindowSize(NULL); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!c.X, "got %d, expected 0\n", c.X); ok(!c.Y, "got %d, expected 0\n", c.Y);
memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetLargestConsoleWindowSize(GetStdHandle(STD_INPUT_HANDLE)); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!c.X, "got %d, expected 0\n", c.X); ok(!c.Y, "got %d, expected 0\n", c.Y);
@@ -3773,7 +3773,7 @@ static void test_GetLargestConsoleWindowSize(HANDLE std_output) memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetLargestConsoleWindowSize(pipe1); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); ok(!c.X, "got %d, expected 0\n", c.X); ok(!c.Y, "got %d, expected 0\n", c.Y); CloseHandle(pipe1); @@ -3806,16 +3806,16 @@ static void test_GetLargestConsoleWindowSize(HANDLE std_output) memset(&c, 10, sizeof(COORD)); SetLastError(0xdeadbeef); c = GetLargestConsoleWindowSize(std_output); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); GetCurrentConsoleFont(std_output, FALSE, &cfi); font = GetConsoleFontSize(std_output, cfi.nFont); maxcon_w = workarea_w / font.X; maxcon_h = workarea_h / font.Y; - ok(c.X == maxcon_w || c.X == maxcon_w - 1 /* Win10 */, "got %d, expected %d\n", c.X, maxcon_w); - ok(c.Y == maxcon_h || c.Y == maxcon_h - 1 /* Win10 */, "got %d, expected %d\n", c.Y, maxcon_h); + ok(c.X == maxcon_w || c.X == maxcon_w - 1 /* Win10 */, "got %d, expected %ld\n", c.X, maxcon_w); + ok(c.Y == maxcon_h || c.Y == maxcon_h - 1 /* Win10 */, "got %d, expected %ld\n", c.Y, maxcon_h);
ret = GetConsoleScreenBufferInfo(std_output, &sbi); - ok(ret, "GetConsoleScreenBufferInfo failed %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfo failed %lu\n", GetLastError()); ok(sbi.dwMaximumWindowSize.X == min(c.X, sbi.dwSize.X), "got %d, expected %d\n", sbi.dwMaximumWindowSize.X, min(c.X, sbi.dwSize.X)); ok(sbi.dwMaximumWindowSize.Y == min(c.Y, sbi.dwSize.Y), "got %d, expected %d\n", @@ -3873,17 +3873,17 @@ static void test_GetConsoleFontInfo(HANDLE std_output) HeapFree(GetProcessHeap(), 0, cfi); return; } - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), FALSE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(std_output, FALSE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
GetConsoleScreenBufferInfo(std_output, &csbi); win_width = csbi.srWindow.Right - csbi.srWindow.Left + 1; @@ -3903,7 +3903,7 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
for (i = 0; i < num_fonts; i++) { - ok(cfi[i].nFont == i, "element out of order, got nFont %d, expected %d\n", cfi[i].nFont, i); + ok(cfi[i].nFont == i, "element out of order, got nFont %ld, expected %ld\n", cfi[i].nFont, i); tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont); tmp_w = (double)orig_font.X / tmp_font.X * win_width; tmp_h = (double)orig_font.Y / tmp_font.Y * win_height; @@ -3914,17 +3914,17 @@ static void test_GetConsoleFontInfo(HANDLE std_output) SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(NULL, TRUE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(GetStdHandle(STD_INPUT_HANDLE), TRUE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleFontInfo(std_output, TRUE, 0, cfi); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
memset(cfi, 0, memsize); ret = pGetConsoleFontInfo(std_output, TRUE, num_fonts, cfi); @@ -3936,7 +3936,7 @@ static void test_GetConsoleFontInfo(HANDLE std_output)
for (i = 0; i < num_fonts; i++) { - ok(cfi[i].nFont == i, "element out of order, got nFont %d, expected %d\n", cfi[i].nFont, i); + ok(cfi[i].nFont == i, "element out of order, got nFont %ld, expected %ld\n", cfi[i].nFont, i); tmp_font = GetConsoleFontSize(std_output, cfi[i].nFont); tmp_w = (double)orig_font.X / tmp_font.X * csbi.dwMaximumWindowSize.X; tmp_h = (double)orig_font.Y / tmp_font.Y * csbi.dwMaximumWindowSize.Y; @@ -3973,12 +3973,12 @@ static void test_SetConsoleFont(HANDLE std_output) skip("SetConsoleFont is not implemented\n"); return; } - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pSetConsoleFont(GetStdHandle(STD_INPUT_HANDLE), 0); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); if (!pGetNumberOfConsoleFonts) @@ -3992,7 +3992,7 @@ static void test_SetConsoleFont(HANDLE std_output) SetLastError(0xdeadbeef); ret = pSetConsoleFont(std_output, num_fonts); ok(!ret, "got %d, expected zero\n", ret); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError()); }
static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output) @@ -4015,42 +4015,42 @@ static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(NULL, &csbix); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
csbix.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(NULL, &csbix); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0); SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(std_input, &csbix); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError()); CloseHandle(pipe1); CloseHandle(pipe2);
SetLastError(0xdeadbeef); ret = pGetConsoleScreenBufferInfoEx(std_output, &csbix); ok(ret, "got %d, expected non-zero\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError()); }
static void test_FreeConsole(void) @@ -4066,7 +4066,7 @@ static void test_FreeConsole(void) ok(RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle != NULL, "ConsoleHandle is NULL\n"); ok(!SetConsoleCtrlHandler(mydummych, FALSE), "dummy ctrl handler shouldn't be set\n"); ret = SetConsoleCtrlHandler(mydummych, TRUE); - ok(ret, "SetConsoleCtrlHandler failed: %u\n", GetLastError()); + ok(ret, "SetConsoleCtrlHandler failed: %lu\n", GetLastError()); if (!skip_nt) { unbound_input = create_unbound_handle(FALSE, TRUE); @@ -4074,7 +4074,7 @@ static void test_FreeConsole(void) }
ret = FreeConsole(); - ok(ret, "FreeConsole failed: %u\n", GetLastError()); + ok(ret, "FreeConsole failed: %lu\n", GetLastError());
ok(RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle == NULL, "ConsoleHandle = %p\n", RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle); @@ -4082,67 +4082,67 @@ static void test_FreeConsole(void) handle = CreateFileA("CONOUT$", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); ok(handle == INVALID_HANDLE_VALUE && (GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == ERROR_ACCESS_DENIED /* winxp */)), - "CreateFileA failed: %u\n", GetLastError()); + "CreateFileA failed: %lu\n", GetLastError());
handle = CreateFileA("CONIN$", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); ok(handle == INVALID_HANDLE_VALUE && (GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == ERROR_ACCESS_DENIED /* winxp */)), - "CreateFileA failed: %u\n", GetLastError()); + "CreateFileA failed: %lu\n", GetLastError());
handle = CreateFileA("CON", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); ok(handle == INVALID_HANDLE_VALUE && (GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == ERROR_ACCESS_DENIED /* winxp */)), - "CreateFileA failed: %u\n", GetLastError()); + "CreateFileA failed: %lu\n", GetLastError());
handle = CreateFileA("CON", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); ok(handle == INVALID_HANDLE_VALUE && (GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == ERROR_FILE_NOT_FOUND /* winxp */)), - "CreateFileA failed: %u\n", GetLastError()); + "CreateFileA failed: %lu\n", GetLastError());
handle = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); ok(handle == INVALID_HANDLE_VALUE && GetLastError() == ERROR_INVALID_HANDLE, - "CreateConsoleScreenBuffer returned: %p (%u)\n", handle, GetLastError()); + "CreateConsoleScreenBuffer returned: %p (%lu)\n", handle, GetLastError());
SetLastError(0xdeadbeef); cp = GetConsoleCP(); ok(!cp, "cp = %x\n", cp); - ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %lu\n", GetLastError());
SetLastError(0xdeadbeef); cp = GetConsoleOutputCP(); ok(!cp, "cp = %x\n", cp); - ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetConsoleCP(GetOEMCP()); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleCP returned %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleCP returned %x(%lu)\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = SetConsoleOutputCP(GetOEMCP()); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleCP returned %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleCP returned %x(%lu)\n", ret, GetLastError());
if (skip_nt) return;
SetLastError(0xdeadbeef); memset( title, 0xc0, sizeof(title) ); size = GetConsoleTitleW( title, ARRAY_SIZE(title) ); - ok(!size, "GetConsoleTitleW returned %u\n", size); + ok(!size, "GetConsoleTitleW returned %lu\n", size); ok(title[0] == 0xc0c0, "title byffer changed\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = SetConsoleTitleW( L"test" ); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleTitleW returned %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleTitleW returned %x(%lu)\n", ret, GetLastError());
SetLastError(0xdeadbeef); hwnd = GetConsoleWindow(); ok(!hwnd, "hwnd = %p\n", hwnd); - ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %lu\n", GetLastError());
ret = GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "GenerateConsoleCtrlEvent returned %x(%u)\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "GenerateConsoleCtrlEvent returned %x(%lu)\n", ret, GetLastError());
SetStdHandle( STD_INPUT_HANDLE, (HANDLE)0xdeadbeef ); @@ -4154,27 +4154,27 @@ static void test_FreeConsole(void)
ret = ReadFile(unbound_input, buf, sizeof(buf), &size, NULL); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "ReadFile returned %x %u\n", ret, GetLastError()); + "ReadFile returned %x %lu\n", ret, GetLastError());
ret = FlushFileBuffers(unbound_input); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "ReadFile returned %x %u\n", ret, GetLastError()); + "ReadFile returned %x %lu\n", ret, GetLastError());
ret = WriteFile(unbound_input, "test", 4, &size, NULL); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "ReadFile returned %x %u\n", ret, GetLastError()); + "ReadFile returned %x %lu\n", ret, GetLastError());
ret = GetConsoleMode(unbound_input, &mode); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "GetConsoleMode returned %x %u\n", ret, GetLastError()); + "GetConsoleMode returned %x %lu\n", ret, GetLastError()); ret = GetConsoleMode(unbound_output, &mode); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, - "GetConsoleMode returned %x %u\n", ret, GetLastError()); + "GetConsoleMode returned %x %lu\n", ret, GetLastError());
type = GetFileType(unbound_input); - ok(type == FILE_TYPE_CHAR, "GetFileType returned %u\n", type); + ok(type == FILE_TYPE_CHAR, "GetFileType returned %lu\n", type); type = GetFileType(unbound_output); - ok(type == FILE_TYPE_CHAR, "GetFileType returned %u\n", type); + ok(type == FILE_TYPE_CHAR, "GetFileType returned %lu\n", type);
todo_wine ok(!SetConsoleCtrlHandler(mydummych, FALSE), "FreeConsole() should have reset ctrl handlers' list\n"); @@ -4208,24 +4208,24 @@ static void test_SetConsoleScreenBufferInfoEx(HANDLE std_output) SetLastError(0xdeadbeef); ret = pSetConsoleScreenBufferInfoEx(NULL, &info); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %lu, expected 6\n", GetLastError());
SetLastError(0xdeadbeef); ret = pSetConsoleScreenBufferInfoEx(std_output, &info); ok(ret, "got %d, expected one\n", ret); - ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got %lu, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef); ret = pSetConsoleScreenBufferInfoEx(std_input, &info); ok(!ret, "got %d, expected zero\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_ACCESS_DENIED, - "got %u, expected 5 or 6\n", GetLastError()); + "got %lu, expected 5 or 6\n", GetLastError());
info.cbSize = 0; SetLastError(0xdeadbeef); ret = pSetConsoleScreenBufferInfoEx(std_output, &info); ok(!ret, "got %d, expected zero\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu, expected 87\n", GetLastError());
CloseHandle(std_input); } @@ -4236,20 +4236,20 @@ static void test_console_title(void) BOOL ret;
ret = SetConsoleTitleW(L"test"); - ok(ret, "SetConsoleTitleW failed: %u\n", GetLastError()); + ok(ret, "SetConsoleTitleW failed: %lu\n", GetLastError());
ret = GetConsoleTitleW(buf, ARRAY_SIZE(buf)); - ok(ret, "GetConsoleTitleW failed: %u\n", GetLastError()); + ok(ret, "GetConsoleTitleW failed: %lu\n", GetLastError()); ok(!wcscmp(buf, L"test"), "title = %s\n", wine_dbgstr_w(buf));
if (!skip_nt) { ret = GetConsoleTitleW(buf, 2); - ok(ret, "GetConsoleTitleW failed: %u\n", GetLastError()); + ok(ret, "GetConsoleTitleW failed: %lu\n", GetLastError()); ok(!wcscmp(buf, L"t"), "title = %s\n", wine_dbgstr_w(buf));
ret = GetConsoleTitleW(buf, 4); - ok(ret, "GetConsoleTitleW failed: %u\n", GetLastError()); + ok(ret, "GetConsoleTitleW failed: %lu\n", GetLastError()); ok(!wcscmp(buf, L"tes"), "title = %s\n", wine_dbgstr_w(buf)); } } @@ -4267,35 +4267,35 @@ static void test_file_info(HANDLE input, HANDLE output) if (skip_nt) return;
status = NtQueryInformationFile(input, &io, &std_info, sizeof(std_info), FileStandardInformation); - ok(status == STATUS_INVALID_DEVICE_REQUEST, "NtQueryInformationFile returned: %#x\n", status); + ok(status == STATUS_INVALID_DEVICE_REQUEST, "NtQueryInformationFile returned: %#lx\n", status);
status = NtQueryInformationFile(output, &io, &std_info, sizeof(std_info), FileStandardInformation); - ok(status == STATUS_INVALID_DEVICE_REQUEST, "NtQueryInformationFile returned: %#x\n", status); + ok(status == STATUS_INVALID_DEVICE_REQUEST, "NtQueryInformationFile returned: %#lx\n", status);
ret = GetFileSizeEx(input, &size); ok(!ret && GetLastError() == ERROR_INVALID_FUNCTION, - "GetFileSizeEx returned %x(%u)\n", ret, GetLastError()); + "GetFileSizeEx returned %x(%lu)\n", ret, GetLastError());
ret = GetFileSizeEx(output, &size); ok(!ret && GetLastError() == ERROR_INVALID_FUNCTION, - "GetFileSizeEx returned %x(%u)\n", ret, GetLastError()); + "GetFileSizeEx returned %x(%lu)\n", ret, GetLastError());
status = NtQueryVolumeInformationFile(input, &io, &fs_info, sizeof(fs_info), FileFsDeviceInformation); - ok(!status, "NtQueryVolumeInformationFile failed: %#x\n", status); - ok(fs_info.DeviceType == FILE_DEVICE_CONSOLE, "DeviceType = %u\n", fs_info.DeviceType); + ok(!status, "NtQueryVolumeInformationFile failed: %#lx\n", status); + ok(fs_info.DeviceType == FILE_DEVICE_CONSOLE, "DeviceType = %lu\n", fs_info.DeviceType); ok(fs_info.Characteristics == FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL, - "Characteristics = %x\n", fs_info.Characteristics); + "Characteristics = %lx\n", fs_info.Characteristics);
status = NtQueryVolumeInformationFile(output, &io, &fs_info, sizeof(fs_info), FileFsDeviceInformation); - ok(!status, "NtQueryVolumeInformationFile failed: %#x\n", status); - ok(fs_info.DeviceType == FILE_DEVICE_CONSOLE, "DeviceType = %u\n", fs_info.DeviceType); + ok(!status, "NtQueryVolumeInformationFile failed: %#lx\n", status); + ok(fs_info.DeviceType == FILE_DEVICE_CONSOLE, "DeviceType = %lu\n", fs_info.DeviceType); ok(fs_info.Characteristics == FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL, - "Characteristics = %x\n", fs_info.Characteristics); + "Characteristics = %lx\n", fs_info.Characteristics);
type = GetFileType(input); - ok(type == FILE_TYPE_CHAR, "GetFileType returned %u\n", type); + ok(type == FILE_TYPE_CHAR, "GetFileType returned %lu\n", type); type = GetFileType(output); - ok(type == FILE_TYPE_CHAR, "GetFileType returned %u\n", type); + ok(type == FILE_TYPE_CHAR, "GetFileType returned %lu\n", type); }
static void test_AttachConsole_child(DWORD console_pid) @@ -4308,15 +4308,15 @@ static void test_AttachConsole_child(DWORD console_pid) BOOL res;
res = CreatePipe(&pipe_in, &pipe_out, NULL, 0); - ok(res, "CreatePipe failed: %u\n", GetLastError()); + ok(res, "CreatePipe failed: %lu\n", GetLastError());
res = AttachConsole(console_pid); ok(!res && GetLastError() == ERROR_ACCESS_DENIED, - "AttachConsole returned: %x(%u)\n", res, GetLastError()); + "AttachConsole returned: %x(%lu)\n", res, GetLastError());
ok(RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle != NULL, "ConsoleHandle is NULL\n"); res = FreeConsole(); - ok(res, "FreeConsole failed: %u\n", GetLastError()); + ok(res, "FreeConsole failed: %lu\n", GetLastError()); ok(RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle == NULL, "ConsoleHandle = %p\n", RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle);
@@ -4324,10 +4324,10 @@ static void test_AttachConsole_child(DWORD console_pid)
ok(!SetConsoleCtrlHandler(mydummych, FALSE), "dummy ctrl handler shouldn't be set\n"); res = SetConsoleCtrlHandler(mydummych, TRUE); - ok(res, "SetConsoleCtrlHandler failed: %u\n", GetLastError()); + ok(res, "SetConsoleCtrlHandler failed: %lu\n", GetLastError());
res = AttachConsole(console_pid); - ok(res, "AttachConsole failed: %u\n", GetLastError()); + ok(res, "AttachConsole failed: %lu\n", GetLastError());
ok(pipe_out != GetStdHandle(STD_ERROR_HANDLE), "std handle not set to console\n"); ok(RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle != NULL, "ConsoleHandle is NULL\n"); @@ -4336,21 +4336,21 @@ static void test_AttachConsole_child(DWORD console_pid) ok(console != INVALID_HANDLE_VALUE, "Could not open console\n");
res = ReadConsoleOutputCharacterA(console, buf, 6, c, &len); - ok(res, "ReadConsoleOutputCharacterA failed: %u\n", GetLastError()); - ok(len == 6, "len = %u\n", len); + ok(res, "ReadConsoleOutputCharacterA failed: %lu\n", GetLastError()); + ok(len == 6, "len = %lu\n", len); ok(!memcmp(buf, "Parent", 6), "Unexpected console output\n");
todo_wine ok(!SetConsoleCtrlHandler(mydummych, FALSE), "AttachConsole() should have reset ctrl handlers' list\n");
res = FreeConsole(); - ok(res, "FreeConsole failed: %u\n", GetLastError()); + ok(res, "FreeConsole failed: %lu\n", GetLastError());
SetStdHandle(STD_INPUT_HANDLE, pipe_in); SetStdHandle(STD_OUTPUT_HANDLE, pipe_out);
res = AttachConsole(ATTACH_PARENT_PROCESS); - ok(res, "AttachConsole failed: %u\n", GetLastError()); + ok(res, "AttachConsole failed: %lu\n", GetLastError());
if (pGetConsoleProcessList) { @@ -4359,14 +4359,14 @@ static void test_AttachConsole_child(DWORD console_pid)
SetLastError(0xdeadbeef); len = pGetConsoleProcessList(list, 1); - ok(len == 2, "Expected 2 processes, got %d\n", len); - ok(list[0] == 0xbabebabe, "Unexpected value in list %u\n", list[0]); + ok(len == 2, "Expected 2 processes, got %ld\n", len); + ok(list[0] == 0xbabebabe, "Unexpected value in list %lu\n", list[0]);
len = pGetConsoleProcessList(list, 2); - ok(len == 2, "Expected 2 processes, got %d\n", len); + ok(len == 2, "Expected 2 processes, got %ld\n", len); ok(list[0] == console_pid || list[1] == console_pid, "Parent PID not in list\n"); ok(list[0] == pid || list[1] == pid, "PID not in list\n"); - ok(GetLastError() == 0xdeadbeef, "Unexpected last error: %u\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Unexpected last error: %lu\n", GetLastError()); }
ok(pipe_in != GetStdHandle(STD_INPUT_HANDLE), "std handle not set to console\n"); @@ -4376,15 +4376,15 @@ static void test_AttachConsole_child(DWORD console_pid) ok(console != INVALID_HANDLE_VALUE, "Could not open console\n");
res = ReadConsoleOutputCharacterA(console, buf, 6, c, &len); - ok(res, "ReadConsoleOutputCharacterA failed: %u\n", GetLastError()); - ok(len == 6, "len = %u\n", len); + ok(res, "ReadConsoleOutputCharacterA failed: %lu\n", GetLastError()); + ok(len == 6, "len = %lu\n", len); ok(!memcmp(buf, "Parent", 6), "Unexpected console output\n");
simple_write_console(console, "Child"); CloseHandle(console);
res = FreeConsole(); - ok(res, "FreeConsole failed: %u\n", GetLastError()); + ok(res, "FreeConsole failed: %lu\n", GetLastError());
res = CloseHandle(pipe_in); ok(res, "pipe_in is no longer valid\n"); @@ -4404,17 +4404,17 @@ static void test_AttachConsole(HANDLE console) simple_write_console(console, "Parent console");
winetest_get_mainargs(&argv); - sprintf(buf, ""%s" console attach_console %x", argv[0], GetCurrentProcessId()); + sprintf(buf, ""%s" console attach_console %lx", argv[0], GetCurrentProcessId()); res = CreateProcessA(NULL, buf, NULL, NULL, TRUE, 0, NULL, NULL, &si, &info); - ok(res, "CreateProcess failed: %u\n", GetLastError()); + ok(res, "CreateProcess failed: %lu\n", GetLastError()); CloseHandle(info.hThread);
wait_child_process(info.hProcess); CloseHandle(info.hProcess);
res = ReadConsoleOutputCharacterA(console, buf, 5, c, &len); - ok(res, "ReadConsoleOutputCharacterA failed: %u\n", GetLastError()); - ok(len == 5, "len = %u\n", len); + ok(res, "ReadConsoleOutputCharacterA failed: %lu\n", GetLastError()); + ok(len == 5, "len = %lu\n", len); ok(!memcmp(buf, "Child", 5), "Unexpected console output\n"); }
@@ -4431,16 +4431,16 @@ static void test_AllocConsole_child(void) prev_output = GetStdHandle(STD_OUTPUT_HANDLE); res = DuplicateHandle(GetCurrentProcess(), prev_output, GetCurrentProcess(), &unbound_output, 0, FALSE, DUPLICATE_SAME_ACCESS); - ok(res, "DuplicateHandle failed: %u\n", GetLastError()); + ok(res, "DuplicateHandle failed: %lu\n", GetLastError());
res = GetConsoleMode(unbound_output, &mode); - ok(res, "GetConsoleMode failed: %u\n", GetLastError()); + ok(res, "GetConsoleMode failed: %lu\n", GetLastError());
prev_error = GetStdHandle(STD_ERROR_HANDLE); if (si.dwFlags & STARTF_USESTDHANDLES) { res = GetConsoleMode(prev_error, &mode); - ok(!res && GetLastError() == ERROR_INVALID_HANDLE, "GetConsoleMode failed: %u\n", GetLastError()); + ok(!res && GetLastError() == ERROR_INVALID_HANDLE, "GetConsoleMode failed: %lu\n", GetLastError()); }
FreeConsole(); @@ -4448,13 +4448,13 @@ static void test_AllocConsole_child(void) ok(GetStdHandle(STD_OUTPUT_HANDLE) == prev_output, "GetStdHandle(STD_OUTPUT_HANDLE) = %p\n", GetStdHandle(STD_OUTPUT_HANDLE)); ok(GetStdHandle(STD_ERROR_HANDLE) == prev_error, "GetStdHandle(STD_ERROR_HANDLE) = %p\n", GetStdHandle(STD_ERROR_HANDLE)); res = GetConsoleMode(unbound_output, &mode); - ok(!res && GetLastError() == ERROR_INVALID_HANDLE, "GetConsoleMode failed: %u\n", GetLastError()); + ok(!res && GetLastError() == ERROR_INVALID_HANDLE, "GetConsoleMode failed: %lu\n", GetLastError());
ok(!SetConsoleCtrlHandler(mydummych, FALSE), "dummy ctrl handler shouldn't be set\n"); res = SetConsoleCtrlHandler(mydummych, TRUE); - ok(res, "SetConsoleCtrlHandler failed: %u\n", GetLastError()); + ok(res, "SetConsoleCtrlHandler failed: %lu\n", GetLastError()); res = AllocConsole(); - ok(res, "AllocConsole failed: %u\n", GetLastError()); + ok(res, "AllocConsole failed: %lu\n", GetLastError());
if (si.dwFlags & STARTF_USESTDHANDLES) { @@ -4463,7 +4463,7 @@ static void test_AllocConsole_child(void) }
res = GetConsoleMode(unbound_output, &mode); - ok(res, "GetConsoleMode failed: %u\n", GetLastError()); + ok(res, "GetConsoleMode failed: %lu\n", GetLastError());
todo_wine ok(!SetConsoleCtrlHandler(mydummych, FALSE), "AllocConsole() should have reset ctrl handlers' list\n"); @@ -4472,20 +4472,20 @@ static void test_AllocConsole_child(void) SetStdHandle(STD_OUTPUT_HANDLE, NULL); SetStdHandle(STD_ERROR_HANDLE, NULL); res = AllocConsole(); - ok(res, "AllocConsole failed: %u\n", GetLastError()); + ok(res, "AllocConsole failed: %lu\n", GetLastError());
ok(GetStdHandle(STD_OUTPUT_HANDLE) != NULL, "GetStdHandle(STD_OUTPUT_HANDLE) = %p\n", GetStdHandle(STD_OUTPUT_HANDLE)); ok(GetStdHandle(STD_ERROR_HANDLE) != NULL, "GetStdHandle(STD_ERROR_HANDLE) = %p\n", GetStdHandle(STD_ERROR_HANDLE));
res = GetConsoleMode(unbound_output, &mode); - ok(res, "GetConsoleMode failed: %u\n", GetLastError()); + ok(res, "GetConsoleMode failed: %lu\n", GetLastError()); res = GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode); - ok(res, "GetConsoleMode failed: %u\n", GetLastError()); + ok(res, "GetConsoleMode failed: %lu\n", GetLastError()); res = GetConsoleMode(GetStdHandle(STD_ERROR_HANDLE), &mode); - ok(res, "GetConsoleMode failed: %u\n", GetLastError()); + ok(res, "GetConsoleMode failed: %lu\n", GetLastError());
res = CloseHandle(unbound_output); - ok(res, "CloseHandle failed: %u\n", GetLastError()); + ok(res, "CloseHandle failed: %lu\n", GetLastError()); }
static void test_AllocConsole(void) @@ -4502,18 +4502,18 @@ static void test_AllocConsole(void) winetest_get_mainargs(&argv); sprintf(buf, ""%s" console alloc_console", argv[0]); res = CreateProcessA(NULL, buf, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &info); - ok(res, "CreateProcess failed: %u\n", GetLastError()); + ok(res, "CreateProcess failed: %lu\n", GetLastError()); CloseHandle(info.hThread); wait_child_process(info.hProcess); CloseHandle(info.hProcess);
res = CreatePipe(&pipe_read, &pipe_write, &inheritable_attr, 0); - ok(res, "CreatePipe failed: %u\n", GetLastError()); + ok(res, "CreatePipe failed: %lu\n", GetLastError());
si.dwFlags = STARTF_USESTDHANDLES; si.hStdError = pipe_write; res = CreateProcessA(NULL, buf, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &info); - ok(res, "CreateProcess failed: %u\n", GetLastError()); + ok(res, "CreateProcess failed: %lu\n", GetLastError()); CloseHandle(info.hThread); wait_child_process(info.hProcess); CloseHandle(info.hProcess); @@ -4531,39 +4531,39 @@ static void test_pseudo_console_child(HANDLE input, HANDLE output) BOOL ret;
ret = GetConsoleMode(input, &mode); - ok(ret, "GetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "GetConsoleMode failed: %lu\n", GetLastError()); ok(mode == (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT | ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS | ENABLE_AUTO_POSITION), - "mode = %x\n", mode); + "mode = %lx\n", mode);
ret = SetConsoleMode(input, mode & ~ENABLE_AUTO_POSITION); - ok(ret, "SetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "SetConsoleMode failed: %lu\n", GetLastError());
ret = GetConsoleMode(input, &mode); - ok(ret, "GetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "GetConsoleMode failed: %lu\n", GetLastError()); ok(mode == (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT | - ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS), "mode = %x\n", mode); + ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS), "mode = %lx\n", mode);
ret = SetConsoleMode(input, mode | ENABLE_AUTO_POSITION); - ok(ret, "SetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "SetConsoleMode failed: %lu\n", GetLastError());
ret = GetConsoleMode(output, &mode); - ok(ret, "GetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "GetConsoleMode failed: %lu\n", GetLastError()); mode &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING; - ok(mode == (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT), "mode = %x\n", mode); + ok(mode == (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT), "mode = %lx\n", mode);
ret = SetConsoleMode(output, mode & ~ENABLE_WRAP_AT_EOL_OUTPUT); - ok(ret, "SetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "SetConsoleMode failed: %lu\n", GetLastError());
ret = GetConsoleMode(output, &mode); - ok(ret, "GetConsoleMode failed: %u\n", GetLastError()); - ok(mode == ENABLE_PROCESSED_OUTPUT, "mode = %x\n", mode); + ok(ret, "GetConsoleMode failed: %lu\n", GetLastError()); + ok(mode == ENABLE_PROCESSED_OUTPUT, "mode = %lx\n", mode);
ret = SetConsoleMode(output, mode | ENABLE_WRAP_AT_EOL_OUTPUT); - ok(ret, "SetConsoleMode failed: %u\n", GetLastError()); + ok(ret, "SetConsoleMode failed: %lu\n", GetLastError());
ret = GetConsoleScreenBufferInfo(output, &sb_info); - ok(ret, "GetConsoleScreenBufferInfo failed: %u\n", GetLastError()); + ok(ret, "GetConsoleScreenBufferInfo failed: %lu\n", GetLastError()); ok(sb_info.dwSize.X == 40, "dwSize.X = %u\n", sb_info.dwSize.X); ok(sb_info.dwSize.Y == 30, "dwSize.Y = %u\n", sb_info.dwSize.Y); ok(sb_info.dwCursorPosition.X == 0, "dwCursorPosition.X = %u\n", sb_info.dwCursorPosition.X); @@ -4577,8 +4577,8 @@ static void test_pseudo_console_child(HANDLE input, HANDLE output) ok(sb_info.dwMaximumWindowSize.Y == 30, "dwMaximumWindowSize.Y = %u\n", sb_info.dwMaximumWindowSize.Y);
ret = GetConsoleCursorInfo(output, &cursor_info); - ok(ret, "GetConsoleCursorInfo failed: %u\n", GetLastError()); - ok(cursor_info.dwSize == 25, "dwSize = %u\n", cursor_info.dwSize); + ok(ret, "GetConsoleCursorInfo failed: %lu\n", GetLastError()); + ok(cursor_info.dwSize == 25, "dwSize = %lu\n", cursor_info.dwSize); ok(cursor_info.bVisible == TRUE, "bVisible = %x\n", cursor_info.bVisible);
hwnd = GetConsoleWindow(); @@ -4593,7 +4593,7 @@ static DWORD WINAPI read_pipe_proc( void *handle ) char buf[64]; DWORD size; while (ReadFile(handle, buf, sizeof(buf), &size, NULL)); - ok(GetLastError() == ERROR_BROKEN_PIPE, "ReadFile returned %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "ReadFile returned %lu\n", GetLastError()); CloseHandle(handle); return 0; } @@ -4618,11 +4618,11 @@ static void test_pseudo_console(void)
console_pipe = CreateNamedPipeW(L"\\.\pipe\pseudoconsoleconn", PIPE_ACCESS_DUPLEX, PIPE_WAIT | PIPE_TYPE_BYTE, 1, 4096, 4096, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(console_pipe != INVALID_HANDLE_VALUE, "CreateNamedPipeW failed: %u\n", GetLastError()); + ok(console_pipe != INVALID_HANDLE_VALUE, "CreateNamedPipeW failed: %lu\n", GetLastError());
console_pipe2 = CreateFileW(L"\\.\pipe\pseudoconsoleconn", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); - ok(console_pipe2 != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(console_pipe2 != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
thread = CreateThread( NULL, 0, read_pipe_proc, console_pipe, 0, NULL ); CloseHandle(thread); @@ -4630,17 +4630,17 @@ static void test_pseudo_console(void) size.X = 0; size.Y = 30; hres = pCreatePseudoConsole(size, console_pipe2, console_pipe2, 0, &pseudo_console); - ok(hres == E_INVALIDARG, "CreatePseudoConsole failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "CreatePseudoConsole failed: %08lx\n", hres);
size.X = 40; size.Y = 0; hres = pCreatePseudoConsole(size, console_pipe2, console_pipe2, 0, &pseudo_console); - ok(hres == E_INVALIDARG, "CreatePseudoConsole failed: %08x\n", hres); + ok(hres == E_INVALIDARG, "CreatePseudoConsole failed: %08lx\n", hres);
size.X = 40; size.Y = 30; hres = pCreatePseudoConsole(size, console_pipe2, console_pipe2, 0, &pseudo_console); - ok(hres == S_OK, "CreatePseudoConsole failed: %08x\n", hres); + ok(hres == S_OK, "CreatePseudoConsole failed: %08lx\n", hres); CloseHandle(console_pipe2);
InitializeProcThreadAttributeList(NULL, 1, 0, &attr_size); @@ -4652,7 +4652,7 @@ static void test_pseudo_console(void) winetest_get_mainargs(&argv); sprintf(cmdline, ""%s" %s --pseudo-console", argv[0], argv[1]); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, &startup.StartupInfo, &info); - ok(ret, "CreateProcessW failed: %u\n", GetLastError()); + ok(ret, "CreateProcessW failed: %lu\n", GetLastError());
CloseHandle(info.hThread); HeapFree(GetProcessHeap(), 0, startup.lpAttributeList); @@ -4679,7 +4679,7 @@ START_TEST(console) if (argc > 3 && !strcmp(argv[2], "attach_console")) { DWORD parent_pid; - sscanf(argv[3], "%x", &parent_pid); + sscanf(argv[3], "%lx", &parent_pid); test_AttachConsole_child(parent_pid); return; } @@ -4721,18 +4721,18 @@ START_TEST(console) err = RegSetValueExA(console_key, "FaceName", 0, REG_SZ, (const BYTE *) font_name, sizeof(font_name)); if (err != ERROR_SUCCESS) - trace("Unable to change default console font, error %d\n", err); + trace("Unable to change default console font, error %ld\n", err); } else { - trace("Unable to query default console font, error %d\n", err); + trace("Unable to query default console font, error %ld\n", err); RegCloseKey(console_key); console_key = NULL; } } else { - trace("Unable to open HKCU\Console, error %d\n", err); + trace("Unable to open HKCU\Console, error %ld\n", err); console_key = NULL; }
@@ -4748,7 +4748,7 @@ START_TEST(console) else err = RegSetValueExA(console_key, "FaceName", 0, REG_SZ, (const BYTE *) old_font, strlen(old_font) + 1); - ok(err == ERROR_SUCCESS, "Unable to restore default console font, error %d\n", err); + ok(err == ERROR_SUCCESS, "Unable to restore default console font, error %ld\n", err); } }
@@ -4765,7 +4765,7 @@ START_TEST(console) revert_output = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); sb = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - ok(sb != INVALID_HANDLE_VALUE, "Could not allocate screen buffer: %u\n", GetLastError()); + ok(sb != INVALID_HANDLE_VALUE, "Could not allocate screen buffer: %lu\n", GetLastError()); SetConsoleActiveScreenBuffer(sb); }
@@ -4795,7 +4795,7 @@ START_TEST(console) ok(ret, "Setting sb info\n"); ret = GetConsoleScreenBufferInfo(hConOut, &sbi); ok(ret, "Getting sb info\n"); - ok(sbi.dwSize.Y == size, "Unexpected buffer size: %d instead of %d\n", sbi.dwSize.Y, size); + ok(sbi.dwSize.Y == size, "Unexpected buffer size: %d instead of %ld\n", sbi.dwSize.Y, size); if (!ret) return;
test_ReadConsole(hConIn); diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index 8b82aaecb9e..2e71c995323 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -157,8 +157,8 @@ static int load_blackbox(const char* logfile, void* blackbox, int size) } SetLastError(0xdeadbeef); ret=ReadFile(hFile, blackbox, size, &read, NULL); - ok(ret, "ReadFile failed: %d\n", GetLastError()); - ok(read == size, "wrong size for '%s': read=%d\n", logfile, read); + ok(ret, "ReadFile failed: %ld\n", GetLastError()); + ok(read == size, "wrong size for '%s': read=%ld\n", logfile, read); ret = ReadFile(hFile, buf, sizeof(buf) - 1, &read, NULL); if (ret && read) { @@ -259,7 +259,7 @@ static void add_thread(struct debugger_context *ctx, DWORD tid) static struct debuggee_thread *get_debuggee_thread(struct debugger_context *ctx, DWORD tid) { struct wine_rb_entry *entry = wine_rb_get(&ctx->threads, &tid); - ok(entry != NULL, "unknown thread %x\n", tid); + ok(entry != NULL, "unknown thread %lx\n", tid); return WINE_RB_ENTRY_VALUE(entry, struct debuggee_thread, entry); }
@@ -301,13 +301,13 @@ static void fetch_thread_context_(unsigned line, struct debuggee_thread *thread) { thread->handle = OpenThread(THREAD_GET_CONTEXT | THREAD_SET_CONTEXT | THREAD_QUERY_INFORMATION, FALSE, thread->tid); - ok_(__FILE__,line)(thread->handle != NULL, "OpenThread failed: %u\n", GetLastError()); + ok_(__FILE__,line)(thread->handle != NULL, "OpenThread failed: %lu\n", GetLastError()); }
memset(&thread->ctx, 0xaa, sizeof(thread->ctx)); thread->ctx.ContextFlags = CONTEXT_FULL; ret = GetThreadContext(thread->handle, &thread->ctx); - ok_(__FILE__,line)(ret, "GetThreadContext failed: %u\n", GetLastError()); + ok_(__FILE__,line)(ret, "GetThreadContext failed: %lu\n", GetLastError()); }
#define set_thread_context(a,b) set_thread_context_(__LINE__,a,b) @@ -315,7 +315,7 @@ static void set_thread_context_(unsigned line, struct debugger_context *ctx, str { BOOL ret; ret = SetThreadContext(thread->handle, &thread->ctx); - ok_(__FILE__,line)(ret, "SetThreadContext failed: %u\n", GetLastError()); + ok_(__FILE__,line)(ret, "SetThreadContext failed: %lu\n", GetLastError()); }
static void fetch_process_context(struct debugger_context *ctx) @@ -343,14 +343,14 @@ static void next_event_(unsigned line, struct debugger_context *ctx, unsigned ti if (ctx->process_cnt && ctx->ev.dwDebugEventCode != -1) { ret = ContinueDebugEvent(ctx->ev.dwProcessId, ctx->ev.dwThreadId, DBG_CONTINUE); - ok_(__FILE__,line)(ret, "ContinueDebugEvent failed, last error %d.\n", GetLastError()); + ok_(__FILE__,line)(ret, "ContinueDebugEvent failed, last error %ld.\n", GetLastError()); }
ret = WaitForDebugEvent(&ctx->ev, timeout); if (!ret) { ok_(__FILE__,line)(GetLastError() == ERROR_SEM_TIMEOUT, - "WaitForDebugEvent failed, last error %d.\n", GetLastError()); + "WaitForDebugEvent failed, last error %ld.\n", GetLastError()); ctx->ev.dwDebugEventCode = -1; return; } @@ -401,8 +401,8 @@ static void wait_for_breakpoint_(unsigned line, struct debugger_context *ctx) while (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT || ctx->ev.dwDebugEventCode == UNLOAD_DLL_DEBUG_EVENT || ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT);
- ok_(__FILE__,line)(ctx->ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); - ok_(__FILE__,line)(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", + ok_(__FILE__,line)(ctx->ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx->ev.dwDebugEventCode); + ok_(__FILE__,line)(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %lx\n", ctx->ev.u.Exception.ExceptionRecord.ExceptionCode); }
@@ -413,12 +413,12 @@ static void process_attach_events(struct debugger_context *ctx, BOOL pass_except
ctx->ev.dwDebugEventCode = -1; next_event(ctx, 0); - ok(ctx->ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); + ok(ctx->ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx->ev.dwDebugEventCode);
next_event(ctx, 0); if (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT) /* Vista+ reports ntdll.dll before reporting threads */ { - ok(ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); + ok(ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx->ev.dwDebugEventCode); ok(ctx->ev.u.LoadDll.lpBaseOfDll == ntdll, "The first reported DLL is not ntdll.dll\n"); next_event(ctx, 0); } @@ -430,7 +430,7 @@ static void process_attach_events(struct debugger_context *ctx, BOOL pass_except { /* even when there are more pending events, they are not reported until current event is continued */ ret = WaitForDebugEvent(&ev, 10); - ok(GetLastError() == ERROR_SEM_TIMEOUT, "WaitForDebugEvent returned %x(%u)\n", ret, GetLastError()); + ok(GetLastError() == ERROR_SEM_TIMEOUT, "WaitForDebugEvent returned %x(%lu)\n", ret, GetLastError());
next_event(ctx, WAIT_EVENT_TIMEOUT); if (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT) @@ -439,7 +439,7 @@ static void process_attach_events(struct debugger_context *ctx, BOOL pass_except ok(ctx->dll_cnt > 2, "dll_cnt = %d\n", ctx->dll_cnt);
/* a new thread is created and it executes DbgBreakPoint, which causes the exception */ - ok(ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); + ok(ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx->ev.dwDebugEventCode); if (ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT) { DWORD last_thread = ctx->ev.dwThreadId; @@ -447,15 +447,15 @@ static void process_attach_events(struct debugger_context *ctx, BOOL pass_except ok(ctx->ev.dwThreadId == last_thread, "unexpected thread\n"); }
- ok(ctx->ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); - ok(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", + ok(ctx->ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx->ev.dwDebugEventCode); + ok(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %lx\n", ctx->ev.u.Exception.ExceptionRecord.ExceptionCode); ok(ctx->ev.u.Exception.ExceptionRecord.ExceptionAddress == pDbgBreakPoint, "ExceptionAddress != DbgBreakPoint\n");
if (pass_exception) { ret = ContinueDebugEvent(ctx->ev.dwProcessId, ctx->ev.dwThreadId, DBG_EXCEPTION_NOT_HANDLED); - ok(ret, "ContinueDebugEvent failed, last error %d.\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error %ld.\n", GetLastError()); ctx->ev.dwDebugEventCode = -1; }
@@ -463,7 +463,7 @@ static void process_attach_events(struct debugger_context *ctx, BOOL pass_except do next_event(ctx, POLL_EVENT_TIMEOUT); while (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT || ctx->ev.dwDebugEventCode == UNLOAD_DLL_DEBUG_EVENT || ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT || ctx->ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT); - ok(ctx->ev.dwDebugEventCode == -1, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode); + ok(ctx->ev.dwDebugEventCode == -1, "dwDebugEventCode = %ld\n", ctx->ev.dwDebugEventCode); }
static void doDebugger(int argc, char** argv) @@ -509,8 +509,8 @@ static void doDebugger(int argc, char** argv) if (strstr(myARGV[2], "process")) { next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); - ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == STATUS_ACCESS_VIOLATION, "ExceptionCode = %x\n", + ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == STATUS_ACCESS_VIOLATION, "ExceptionCode = %lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionCode); }
@@ -594,14 +594,14 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks) return; }
- ok(ret == ERROR_SUCCESS, "unable to set AeDebug/auto: ret=%d\n", ret); + ok(ret == ERROR_SUCCESS, "unable to set AeDebug/auto: ret=%ld\n", ret);
get_file_name(dbglog); get_events(dbglog, &start_event, &done_event); cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+10+strlen(dbgtasks)+1+strlen(dbglog)+2+34+1); sprintf(cmd, "%s debugger %s "%s" %%ld %%ld", argv0, dbgtasks, dbglog); ret=RegSetValueExA(hkey, "debugger", 0, REG_SZ, (BYTE*)cmd, strlen(cmd)+1); - ok(ret == ERROR_SUCCESS, "unable to set AeDebug/debugger: ret=%d\n", ret); + ok(ret == ERROR_SUCCESS, "unable to set AeDebug/debugger: ret=%ld\n", ret); HeapFree(GetProcessHeap(), 0, cmd);
cmd = HeapAlloc(GetProcessHeap(), 0, strlen(argv0) + 16); @@ -613,7 +613,7 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks) startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = SW_SHOWNORMAL; ret=CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info); - ok(ret, "CreateProcess: err=%d\n", GetLastError()); + ok(ret, "CreateProcess: err=%ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, cmd); CloseHandle(info.hThread);
@@ -635,7 +635,7 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks) #endif ok(wait_code == WAIT_OBJECT_0, "Timed out waiting for the child to crash\n"); bRet = GetExitCodeProcess(info.hProcess, &exit_code); - ok(bRet, "GetExitCodeProcess failed: err=%d\n", GetLastError()); + ok(bRet, "GetExitCodeProcess failed: err=%ld\n", GetLastError()); if (strstr(dbgtasks, "code2")) { /* If, after attaching to the debuggee, the debugger exits without @@ -644,12 +644,12 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks) ok(exit_code == STATUS_DEBUGGER_INACTIVE || broken(exit_code == STATUS_ACCESS_VIOLATION) || /* Intermittent Vista+ */ broken(exit_code == WAIT_ABANDONED), /* NT4, W2K */ - "wrong exit code : %08x\n", exit_code); + "wrong exit code : %08lx\n", exit_code); } else ok(exit_code == STATUS_ACCESS_VIOLATION || broken(exit_code == WAIT_ABANDONED), /* NT4, W2K, W2K3 */ - "wrong exit code : %08x\n", exit_code); + "wrong exit code : %08lx\n", exit_code); CloseHandle(info.hProcess);
/* ...before the debugger */ @@ -673,12 +673,12 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks) ok(load_blackbox(dbglog, &dbg_blackbox, sizeof(dbg_blackbox)), "failed to open: %s\n", dbglog);
ok(dbg_blackbox.argc == 6, "wrong debugger argument count: %d\n", dbg_blackbox.argc); - ok(dbg_blackbox.pid == info.dwProcessId, "the child and debugged pids don't match: %d != %d\n", info.dwProcessId, dbg_blackbox.pid); - ok(dbg_blackbox.debug_rc, "debugger: SetEvent(debug_event) failed err=%d\n", dbg_blackbox.debug_err); - ok(dbg_blackbox.attach_rc, "DebugActiveProcess(%d) failed err=%d\n", dbg_blackbox.pid, dbg_blackbox.attach_err); - ok(dbg_blackbox.nokill_rc, "DebugSetProcessKillOnExit(FALSE) failed err=%d\n", dbg_blackbox.nokill_err); - ok(dbg_blackbox.detach_rc, "DebugActiveProcessStop(%d) failed err=%d\n", dbg_blackbox.pid, dbg_blackbox.detach_err); - ok(!dbg_blackbox.failures, "debugger reported %u failures\n", dbg_blackbox.failures); + ok(dbg_blackbox.pid == info.dwProcessId, "the child and debugged pids don't match: %ld != %ld\n", info.dwProcessId, dbg_blackbox.pid); + ok(dbg_blackbox.debug_rc, "debugger: SetEvent(debug_event) failed err=%ld\n", dbg_blackbox.debug_err); + ok(dbg_blackbox.attach_rc, "DebugActiveProcess(%ld) failed err=%ld\n", dbg_blackbox.pid, dbg_blackbox.attach_err); + ok(dbg_blackbox.nokill_rc, "DebugSetProcessKillOnExit(FALSE) failed err=%ld\n", dbg_blackbox.nokill_err); + ok(dbg_blackbox.detach_rc, "DebugActiveProcessStop(%ld) failed err=%ld\n", dbg_blackbox.pid, dbg_blackbox.detach_err); + ok(!dbg_blackbox.failures, "debugger reported %lu failures\n", dbg_blackbox.failures);
DeleteFileA(dbglog); } @@ -693,7 +693,7 @@ static void crash_and_winedbg(HKEY hkey, const char* argv0) DWORD exit_code;
ret=RegSetValueExA(hkey, "auto", 0, REG_SZ, (BYTE*)"1", 2); - ok(ret == ERROR_SUCCESS, "unable to set AeDebug/auto: ret=%d\n", ret); + ok(ret == ERROR_SUCCESS, "unable to set AeDebug/auto: ret=%ld\n", ret);
cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+15+1); sprintf(cmd, "%s debugger crash", argv0); @@ -703,15 +703,15 @@ static void crash_and_winedbg(HKEY hkey, const char* argv0) startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = SW_SHOWNORMAL; ret=CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info); - ok(ret, "CreateProcess: err=%d\n", GetLastError()); + ok(ret, "CreateProcess: err=%ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, cmd); CloseHandle(info.hThread);
trace("waiting for child exit...\n"); ok(WaitForSingleObject(info.hProcess, 60000) == WAIT_OBJECT_0, "Timed out waiting for the child to crash\n"); bRet = GetExitCodeProcess(info.hProcess, &exit_code); - ok(bRet, "GetExitCodeProcess failed: err=%d\n", GetLastError()); - ok(exit_code == STATUS_ACCESS_VIOLATION, "exit code = %08x\n", exit_code); + ok(bRet, "GetExitCodeProcess failed: err=%ld\n", GetLastError()); + ok(exit_code == STATUS_ACCESS_VIOLATION, "exit code = %08lx\n", exit_code); CloseHandle(info.hProcess); }
@@ -749,7 +749,7 @@ static void test_ExitCode(void) } else if (ret != ERROR_FILE_NOT_FOUND) { - ok(0, "could not open the AeDebug key: %d\n", ret); + ok(0, "could not open the AeDebug key: %ld\n", ret); return; } else @@ -776,7 +776,7 @@ static void test_ExitCode(void) RegCloseKey(hkeyWinedbg); } else - ok(0, "Couldn't access WineDbg Key - error %u\n", ret); + ok(0, "Couldn't access WineDbg Key - error %lu\n", ret); }
if (winetest_interactive) @@ -786,7 +786,7 @@ static void test_ExitCode(void) crash_and_debug(hkey, test_exe, "dbg,none"); else skip(""none" debugger test needs user interaction\n"); - ok(disposition == REG_OPENED_EXISTING_KEY, "expected REG_OPENED_EXISTING_KEY, got %d\n", disposition); + ok(disposition == REG_OPENED_EXISTING_KEY, "expected REG_OPENED_EXISTING_KEY, got %ld\n", disposition); crash_and_debug(hkey, test_exe, "dbg,event,order"); crash_and_debug(hkey, test_exe, "dbg,attach,event,code2"); crash_and_debug(hkey, test_exe, "dbg,attach,event,nokill"); @@ -820,7 +820,7 @@ static void test_RemoteDebugger(void) bret = pCheckRemoteDebuggerPresent(GetCurrentProcess(),&present); ok(bret , "expected CheckRemoteDebuggerPresent to succeed\n"); ok(0xdeadbeef == GetLastError(), - "expected error to be unchanged, got %d/%x\n",GetLastError(), GetLastError()); + "expected error to be unchanged, got %ld/%lx\n",GetLastError(), GetLastError());
present = TRUE; SetLastError(0xdeadbeef); @@ -828,13 +828,13 @@ static void test_RemoteDebugger(void) ok(!bret , "expected CheckRemoteDebuggerPresent to fail\n"); ok(present, "expected parameter to be unchanged\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "expected error ERROR_INVALID_PARAMETER, got %d/%x\n",GetLastError(), GetLastError()); + "expected error ERROR_INVALID_PARAMETER, got %ld/%lx\n",GetLastError(), GetLastError());
SetLastError(0xdeadbeef); bret = pCheckRemoteDebuggerPresent(GetCurrentProcess(),NULL); ok(!bret , "expected CheckRemoteDebuggerPresent to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "expected error ERROR_INVALID_PARAMETER, got %d/%x\n",GetLastError(), GetLastError()); + "expected error ERROR_INVALID_PARAMETER, got %ld/%lx\n",GetLastError(), GetLastError()); }
struct child_blackbox @@ -854,36 +854,36 @@ static void doChild(int argc, char **argv) BOOL ret;
blackbox_file = argv[4]; - sscanf(argv[3], "%08x", &ppid); + sscanf(argv[3], "%08lx", &ppid);
parent = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, ppid); - child_ok(!!parent, "OpenProcess failed, last error %#x.\n", GetLastError()); + child_ok(!!parent, "OpenProcess failed, last error %#lx.\n", GetLastError());
ret = pCheckRemoteDebuggerPresent(parent, &debug); - child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#lx.\n", GetLastError()); child_ok(!debug, "Expected debug == 0, got %#x.\n", debug);
ret = DebugActiveProcess(ppid); - child_ok(ret, "DebugActiveProcess failed, last error %#x.\n", GetLastError()); + child_ok(ret, "DebugActiveProcess failed, last error %#lx.\n", GetLastError());
ret = pCheckRemoteDebuggerPresent(parent, &debug); - child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#lx.\n", GetLastError()); child_ok(debug, "Expected debug != 0, got %#x.\n", debug);
ret = DebugActiveProcessStop(ppid); - child_ok(ret, "DebugActiveProcessStop failed, last error %#x.\n", GetLastError()); + child_ok(ret, "DebugActiveProcessStop failed, last error %#lx.\n", GetLastError());
ret = pCheckRemoteDebuggerPresent(parent, &debug); - child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#lx.\n", GetLastError()); child_ok(!debug, "Expected debug == 0, got %#x.\n", debug);
ret = CloseHandle(parent); - child_ok(ret, "CloseHandle failed, last error %#x.\n", GetLastError()); + child_ok(ret, "CloseHandle failed, last error %#lx.\n", GetLastError());
ret = IsDebuggerPresent(); child_ok(ret, "Expected ret != 0, got %#x.\n", ret); ret = pCheckRemoteDebuggerPresent(GetCurrentProcess(), &debug); - child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#lx.\n", GetLastError()); child_ok(debug, "Expected debug != 0, got %#x.\n", debug);
NtCurrentTeb()->Peb->BeingDebugged = FALSE; @@ -891,7 +891,7 @@ static void doChild(int argc, char **argv) ret = IsDebuggerPresent(); child_ok(!ret, "Expected ret != 0, got %#x.\n", ret); ret = pCheckRemoteDebuggerPresent(GetCurrentProcess(), &debug); - child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + child_ok(ret, "CheckRemoteDebuggerPresent failed, last error %#lx.\n", GetLastError()); child_ok(debug, "Expected debug != 0, got %#x.\n", debug);
NtCurrentTeb()->Peb->BeingDebugged = TRUE; @@ -902,11 +902,11 @@ static void doChild(int argc, char **argv) GetSystemDirectoryW( path, MAX_PATH ); wcscat( path, L"\oleaut32.dll" ); file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - child_ok( file != INVALID_HANDLE_VALUE, "failed to open %s: %u\n", debugstr_w(path), GetLastError()); + child_ok( file != INVALID_HANDLE_VALUE, "failed to open %s: %lu\n", debugstr_w(path), GetLastError()); map = CreateFileMappingW( file, NULL, SEC_IMAGE | PAGE_READONLY, 0, 0, NULL ); - child_ok( map != NULL, "failed to create mapping %s: %u\n", debugstr_w(path), GetLastError() ); + child_ok( map != NULL, "failed to create mapping %s: %lu\n", debugstr_w(path), GetLastError() ); mod = MapViewOfFile( map, FILE_MAP_READ, 0, 0, 0 ); - child_ok( mod != NULL, "failed to map %s: %u\n", debugstr_w(path), GetLastError() ); + child_ok( mod != NULL, "failed to map %s: %lu\n", debugstr_w(path), GetLastError() ); CloseHandle( file ); CloseHandle( map ); UnmapViewOfFile( mod ); @@ -923,11 +923,11 @@ static void doChild(int argc, char **argv) else goto done;
file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - child_ok( file != INVALID_HANDLE_VALUE, "failed to open %s: %u\n", debugstr_w(path), GetLastError()); + child_ok( file != INVALID_HANDLE_VALUE, "failed to open %s: %lu\n", debugstr_w(path), GetLastError()); map = CreateFileMappingW( file, NULL, SEC_IMAGE | PAGE_READONLY, 0, 0, NULL ); - child_ok( map != NULL, "failed to create mapping %s: %u\n", debugstr_w(path), GetLastError() ); + child_ok( map != NULL, "failed to create mapping %s: %lu\n", debugstr_w(path), GetLastError() ); mod = MapViewOfFile( map, FILE_MAP_READ, 0, 0, 0 ); - child_ok( mod != NULL, "failed to map %s: %u\n", debugstr_w(path), GetLastError() ); + child_ok( mod != NULL, "failed to map %s: %lu\n", debugstr_w(path), GetLastError() ); CloseHandle( file ); CloseHandle( map ); UnmapViewOfFile( mod ); @@ -987,17 +987,17 @@ static void test_debug_loop(int argc, char **argv)
get_file_name(blackbox_file); cmd = HeapAlloc(GetProcessHeap(), 0, strlen(argv[0]) + strlen(arguments) + strlen(blackbox_file) + 2 + 10); - sprintf(cmd, "%s%s%08x "%s"", argv[0], arguments, pid, blackbox_file); + sprintf(cmd, "%s%s%08lx "%s"", argv[0], arguments, pid, blackbox_file);
memset(&si, 0, sizeof(si)); si.cb = sizeof(si); ret = CreateProcessA(NULL, cmd, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); + ok(ret, "CreateProcess failed, last error %#lx.\n", GetLastError());
HeapFree(GetProcessHeap(), 0, cmd);
ret = pCheckRemoteDebuggerPresent(pi.hProcess, &debug); - ok(ret, "CheckRemoteDebuggerPresent failed, last error %#x.\n", GetLastError()); + ok(ret, "CheckRemoteDebuggerPresent failed, last error %#lx.\n", GetLastError()); ok(debug, "Expected debug != 0, got %#x.\n", debug);
for (;;) @@ -1005,7 +1005,7 @@ static void test_debug_loop(int argc, char **argv) DEBUG_EVENT ev;
ret = WaitForDebugEvent(&ev, INFINITE); - ok(ret, "WaitForDebugEvent failed, last error %#x.\n", GetLastError()); + ok(ret, "WaitForDebugEvent failed, last error %#lx.\n", GetLastError()); if (!ret) break;
if (ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) break; @@ -1020,7 +1020,7 @@ static void test_debug_loop(int argc, char **argv) } #endif ret = ContinueDebugEvent(ev.dwProcessId, ev.dwThreadId, DBG_CONTINUE); - ok(ret, "ContinueDebugEvent failed, last error %#x.\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error %#lx.\n", GetLastError()); if (!ret) break; }
@@ -1033,15 +1033,15 @@ static void test_debug_loop(int argc, char **argv) #endif
ret = CloseHandle(pi.hThread); - ok(ret, "CloseHandle failed, last error %#x.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %#lx.\n", GetLastError()); ret = CloseHandle(pi.hProcess); - ok(ret, "CloseHandle failed, last error %#x.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %#lx.\n", GetLastError());
load_blackbox(blackbox_file, &blackbox, sizeof(blackbox)); - ok(!blackbox.failures, "Got %d failures from child process.\n", blackbox.failures); + ok(!blackbox.failures, "Got %ld failures from child process.\n", blackbox.failures);
ret = DeleteFileA(blackbox_file); - ok(ret, "DeleteFileA failed, last error %#x.\n", GetLastError()); + ok(ret, "DeleteFileA failed, last error %#lx.\n", GetLastError()); }
static void doChildren(int argc, char **argv) @@ -1067,7 +1067,7 @@ static void doChildren(int argc, char **argv) strcpy(event_name, p); strcat(event_name, "_init"); event = OpenEventA(EVENT_ALL_ACCESS, FALSE, event_name); - child_ok(event != NULL, "OpenEvent failed, last error %d.\n", GetLastError()); + child_ok(event != NULL, "OpenEvent failed, last error %ld.\n", GetLastError()); SetEvent(event); CloseHandle(event);
@@ -1076,7 +1076,7 @@ static void doChildren(int argc, char **argv) strcpy(event_name, p); strcat(event_name, "_attach"); event = OpenEventA(EVENT_ALL_ACCESS, FALSE, event_name); - child_ok(event != NULL, "OpenEvent failed, last error %d.\n", GetLastError()); + child_ok(event != NULL, "OpenEvent failed, last error %ld.\n", GetLastError()); WaitForSingleObject(event, INFINITE); CloseHandle(event);
@@ -1086,15 +1086,15 @@ static void doChildren(int argc, char **argv) memset(&si, 0, sizeof(si)); si.cb = sizeof(si); ret = CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - child_ok(ret, "CreateProcess failed, last error %d.\n", GetLastError()); + child_ok(ret, "CreateProcess failed, last error %ld.\n", GetLastError());
child_ok(WaitForSingleObject(pi.hProcess, 10000) == WAIT_OBJECT_0, "Timed out waiting for the child to exit\n");
ret = CloseHandle(pi.hThread); - child_ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + child_ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); ret = CloseHandle(pi.hProcess); - child_ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + child_ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError());
blackbox.failures = child_failures; save_blackbox(blackbox_file, &blackbox, sizeof(blackbox), NULL); @@ -1130,31 +1130,31 @@ static void test_debug_children(const char *name, DWORD flag, BOOL debug_child, strcpy(event_name, p); strcat(event_name, "_init"); event_init = CreateEventA(NULL, FALSE, FALSE, event_name); - ok(event_init != NULL, "OpenEvent failed, last error %d.\n", GetLastError()); + ok(event_init != NULL, "OpenEvent failed, last error %ld.\n", GetLastError());
p = strrchr(blackbox_file, '\'); p = p ? p+1 : blackbox_file; strcpy(event_name, p); strcat(event_name, "_attach"); event_attach = CreateEventA(NULL, FALSE, flag!=0, event_name); - ok(event_attach != NULL, "CreateEvent failed, last error %d.\n", GetLastError()); + ok(event_attach != NULL, "CreateEvent failed, last error %ld.\n", GetLastError());
memset(&si, 0, sizeof(si)); si.cb = sizeof(si);
ret = CreateProcessA(NULL, cmd, NULL, NULL, FALSE, flag, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess failed, last error %d.\n", GetLastError()); + ok(ret, "CreateProcess failed, last error %ld.\n", GetLastError()); HeapFree(GetProcessHeap(), 0, cmd); if (!flag) { WaitForSingleObject(event_init, INFINITE); Sleep(100); ret = DebugActiveProcess(pi.dwProcessId); - ok(ret, "DebugActiveProcess failed, last error %d.\n", GetLastError()); + ok(ret, "DebugActiveProcess failed, last error %ld.\n", GetLastError()); }
ret = pCheckRemoteDebuggerPresent(pi.hProcess, &debug); - ok(ret, "CheckRemoteDebuggerPresent failed, last error %d.\n", GetLastError()); + ok(ret, "CheckRemoteDebuggerPresent failed, last error %ld.\n", GetLastError()); ok(debug, "Expected debug != 0, got %x.\n", debug);
trace("starting debugger loop\n"); @@ -1164,19 +1164,19 @@ static void test_debug_children(const char *name, DWORD flag, BOOL debug_child, DWORD last_thread;
next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); ok(ctx.pid == pi.dwProcessId, "unexpected dwProcessId %x\n", ctx.ev.dwProcessId == ctx.pid);
next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); last_thread = ctx.ev.dwThreadId;
wait_for_breakpoint(&ctx); ok(ctx.dll_cnt > 2, "dll_cnt = %d\n", ctx.dll_cnt);
- ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); ok(ctx.ev.dwThreadId == last_thread, "unexpected thread\n"); - ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", + ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionCode);
/* Except for wxppro and w2008, the initial breakpoint is now somewhere else, possibly within LdrInitShimEngineDynamic, @@ -1195,11 +1195,11 @@ static void test_debug_children(const char *name, DWORD flag, BOOL debug_child, if (pass_exception) { ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_EXCEPTION_NOT_HANDLED); - ok(ret, "ContinueDebugEvent failed, last error %d.\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error %ld.\n", GetLastError()); ctx.ev.dwDebugEventCode = -1;
next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode != EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode != EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); } } else @@ -1207,32 +1207,32 @@ static void test_debug_children(const char *name, DWORD flag, BOOL debug_child, DWORD last_thread;
process_attach_events(&ctx, pass_exception); - ok(ctx.pid == pi.dwProcessId, "unexpected dwProcessId %x\n", ctx.pid); + ok(ctx.pid == pi.dwProcessId, "unexpected dwProcessId %lx\n", ctx.pid);
ret = DebugBreakProcess(pi.hProcess); - ok(ret, "BreakProcess failed: %u\n", GetLastError()); + ok(ret, "BreakProcess failed: %lu\n", GetLastError());
/* a new thread, which executes DbgBreakPoint, is created */ next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); last_thread = ctx.ev.dwThreadId;
if (ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT) next_event(&ctx, WAIT_EVENT_TIMEOUT);
- ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); ok(ctx.ev.dwThreadId == last_thread, "unexpected thread\n"); - ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", + ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionCode); ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress == pDbgBreakPoint, "ExceptionAddress != DbgBreakPoint\n");
ret = SetEvent(event_attach); - ok(ret, "SetEvent failed, last error %d.\n", GetLastError()); + ok(ret, "SetEvent failed, last error %ld.\n", GetLastError());
if (pass_exception) { ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_EXCEPTION_NOT_HANDLED); - ok(ret, "ContinueDebugEvent failed, last error %d.\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error %ld.\n", GetLastError()); ctx.ev.dwDebugEventCode = -1; } } @@ -1241,27 +1241,27 @@ static void test_debug_children(const char *name, DWORD flag, BOOL debug_child, while (ctx.ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT || ctx.ev.dwDebugEventCode == UNLOAD_DLL_DEBUG_EVENT || ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT || ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT);
- ok(ctx.ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_CONTINUE); - ok(ret, "ContinueDebugEvent failed, last error %d.\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error %ld.\n", GetLastError());
if(debug_child) - ok(ctx.process_cnt == 2, "didn't get any child events (flag: %x).\n", flag); + ok(ctx.process_cnt == 2, "didn't get any child events (flag: %lx).\n", flag); else - ok(ctx.process_cnt == 1, "got child event (flag: %x).\n", flag); + ok(ctx.process_cnt == 1, "got child event (flag: %lx).\n", flag); CloseHandle(event_init); CloseHandle(event_attach);
ret = CloseHandle(pi.hThread); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); ret = CloseHandle(pi.hProcess); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError());
load_blackbox(blackbox_file, &blackbox, sizeof(blackbox)); - ok(!blackbox.failures, "Got %d failures from child process.\n", blackbox.failures); + ok(!blackbox.failures, "Got %ld failures from child process.\n", blackbox.failures);
ret = DeleteFileA(blackbox_file); - ok(ret, "DeleteFileA failed, last error %d.\n", GetLastError()); + ok(ret, "DeleteFileA failed, last error %ld.\n", GetLastError()); }
static void wait_debugger(HANDLE event, unsigned int cnt) @@ -1274,7 +1274,7 @@ static void wait_debugger(HANDLE event, unsigned int cnt) static void expect_event_(unsigned line, struct debugger_context *ctx, DWORD event_code) { next_event(ctx, WAIT_EVENT_TIMEOUT); - ok_(__FILE__,line)(ctx->ev.dwDebugEventCode == event_code, "dwDebugEventCode = %d expected %d\n", + ok_(__FILE__,line)(ctx->ev.dwDebugEventCode == event_code, "dwDebugEventCode = %ld expected %ld\n", ctx->ev.dwDebugEventCode, event_code); }
@@ -1282,7 +1282,7 @@ static void expect_event_(unsigned line, struct debugger_context *ctx, DWORD eve static void expect_exception_(unsigned line, struct debugger_context *ctx, DWORD exception_code) { expect_event_(line, ctx, EXCEPTION_DEBUG_EVENT); - ok_(__FILE__,line)(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == exception_code, "ExceptionCode = %x expected %x\n", + ok_(__FILE__,line)(ctx->ev.u.Exception.ExceptionRecord.ExceptionCode == exception_code, "ExceptionCode = %lx expected %lx\n", ctx->ev.u.Exception.ExceptionRecord.ExceptionCode, exception_code); }
@@ -1313,7 +1313,7 @@ static void single_step_(unsigned line, struct debugger_context *ctx, struct deb fetch_thread_context(thread); ok_(__FILE__,line)(get_ip(&thread->ctx) == expect_addr, "unexpected instruction pointer %p expected %p\n", get_ip(&thread->ctx), expect_addr); - ok_(__FILE__,line)(!(thread->ctx.EFlags & 0x100), "EFlags = %x\n", thread->ctx.EFlags); + ok_(__FILE__,line)(!(thread->ctx.EFlags & 0x100), "EFlags = %lx\n", thread->ctx.EFlags); #endif }
@@ -1393,19 +1393,19 @@ static void test_debugger(const char *argv0) BOOL ret;
event = CreateEventW(&sa, FALSE, FALSE, NULL); - ok(event != NULL, "CreateEvent failed: %u\n", GetLastError()); + ok(event != NULL, "CreateEvent failed: %lu\n", GetLastError());
cmd = heap_alloc(strlen(argv0) + strlen(arguments) + 16); - sprintf(cmd, "%s%s%x %u\n", argv0, arguments, (DWORD)(DWORD_PTR)event, OP_BP ? 3 : 1); + sprintf(cmd, "%s%s%lx %u\n", argv0, arguments, (DWORD)(DWORD_PTR)event, OP_BP ? 3 : 1);
memset(&si, 0, sizeof(si)); si.cb = sizeof(si); ret = CreateProcessA(NULL, cmd, NULL, NULL, TRUE, DEBUG_PROCESS, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); + ok(ret, "CreateProcess failed, last error %#lx.\n", GetLastError()); heap_free(cmd);
next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode);
if ((skip_reply_later = !ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_REPLY_LATER))) win_skip("Skipping unsupported DBG_REPLY_LATER tests\n"); @@ -1417,49 +1417,49 @@ static void test_debugger(const char *argv0) ctx.ev.dwDebugEventCode = -1; next_event(&ctx, WAIT_EVENT_TIMEOUT); ok(de.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de.dwDebugEventCode); ok(de.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de.dwProcessId); ok(de.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de.dwThreadId);
/* Suspending the thread should prevent other attach debug events * to be received until it's resumed */ thread = OpenThread(THREAD_SUSPEND_RESUME, FALSE, ctx.ev.dwThreadId); - ok(thread != INVALID_HANDLE_VALUE, "OpenThread failed, last error:%u\n", GetLastError()); + ok(thread != INVALID_HANDLE_VALUE, "OpenThread failed, last error:%lu\n", GetLastError());
status = NtSuspendThread(thread, NULL); - ok(!status, "NtSuspendThread failed, last error:%u\n", GetLastError()); + ok(!status, "NtSuspendThread failed, last error:%lu\n", GetLastError());
ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_REPLY_LATER); - ok(ret, "ContinueDebugEvent failed, last error:%u\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error:%lu\n", GetLastError()); ok(!WaitForDebugEvent(&ctx.ev, POLL_EVENT_TIMEOUT), "WaitForDebugEvent succeeded.\n");
status = NtResumeThread(thread, NULL); - ok(!status, "NtResumeThread failed, last error:%u\n", GetLastError()); + ok(!status, "NtResumeThread failed, last error:%lu\n", GetLastError());
ret = CloseHandle(thread); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError());
ok(WaitForDebugEvent(&ctx.ev, POLL_EVENT_TIMEOUT), "WaitForDebugEvent failed.\n"); ok(de.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de.dwDebugEventCode);
next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); de = ctx.ev;
ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_REPLY_LATER); - ok(ret, "ContinueDebugEvent failed, last error:%u\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error:%lu\n", GetLastError());
ctx.ev.dwDebugEventCode = -1; next_event(&ctx, WAIT_EVENT_TIMEOUT); ok(de.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de.dwDebugEventCode); ok(de.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de.dwProcessId); ok(de.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de.dwThreadId); }
wait_for_breakpoint(&ctx); @@ -1467,7 +1467,7 @@ static void test_debugger(const char *argv0) while(ctx.ev.dwDebugEventCode != -1);
mem = VirtualAllocEx(pi.hProcess, NULL, sizeof(buf), MEM_COMMIT, PAGE_EXECUTE_READWRITE); - ok(mem != NULL, "VirtualAllocEx failed: %u\n", GetLastError()); + ok(mem != NULL, "VirtualAllocEx failed: %lu\n", GetLastError()); proc_code = buf + 1024; thread_proc = mem + 1024;
@@ -1478,10 +1478,10 @@ static void test_debugger(const char *argv0) memcpy(proc_code, &loop_code, sizeof(loop_code)); proc_code[0] = OP_BP; /* set a breakpoint */ ret = WriteProcessMemory(pi.hProcess, mem, buf, sizeof(buf), NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void*)thread_proc, NULL, 0, NULL); - ok(thread != NULL, "CreateRemoteThread failed: %u\n", GetLastError()); + ok(thread != NULL, "CreateRemoteThread failed: %lu\n", GetLastError());
expect_event(&ctx, CREATE_THREAD_DEBUG_EVENT); debuggee_thread = get_debuggee_thread(&ctx, ctx.ev.dwThreadId); @@ -1499,7 +1499,7 @@ static void test_debugger(const char *argv0)
byte = 0xc3; /* ret */ ret = WriteProcessMemory(pi.hProcess, thread_proc, &byte, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
expect_event(&ctx, EXIT_THREAD_DEBUG_EVENT); } @@ -1511,23 +1511,23 @@ static void test_debugger(const char *argv0) memset(buf, OP_BP, sizeof(buf)); memcpy(proc_code, call_debug_service_code, sizeof(call_debug_service_code)); ret = WriteProcessMemory(pi.hProcess, mem, buf, sizeof(buf), NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
/* BREAKPOINT_PRINT */ thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void*)thread_proc, (void*)2, 0, NULL); - ok(thread != NULL, "CreateRemoteThread failed: %u\n", GetLastError()); + ok(thread != NULL, "CreateRemoteThread failed: %lu\n", GetLastError()); expect_event(&ctx, CREATE_THREAD_DEBUG_EVENT); expect_breakpoint_exception(&ctx, NULL); expect_event(&ctx, EXIT_THREAD_DEBUG_EVENT);
/* BREAKPOINT_PROMPT */ thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void*)thread_proc, (void*)1, 0, NULL); - ok(thread != NULL, "CreateRemoteThread failed: %u\n", GetLastError()); + ok(thread != NULL, "CreateRemoteThread failed: %lu\n", GetLastError()); expect_event(&ctx, CREATE_THREAD_DEBUG_EVENT); next_event(&ctx, WAIT_EVENT_TIMEOUT); /* some 32-bit Windows versions report exception to the debugger */ if (sizeof(void *) == 4 && ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT) next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT, "unexpected debug event %u\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT, "unexpected debug event %lu\n", ctx.ev.dwDebugEventCode); } else win_skip("call_debug_service_code not supported on this architecture\n");
@@ -1541,64 +1541,64 @@ static void test_debugger(const char *argv0) memset(buf, OP_BP, sizeof(buf)); memcpy(proc_code, &loop_code, sizeof(loop_code)); ret = WriteProcessMemory(pi.hProcess, mem, buf, sizeof(buf), NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
byte = OP_BP; ret = WriteProcessMemory(pi.hProcess, thread_proc + 1, &byte, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
thread_a = CreateRemoteThread(pi.hProcess, NULL, 0, (void*)thread_proc, NULL, 0, NULL); - ok(thread_a != NULL, "CreateRemoteThread failed: %u\n", GetLastError()); + ok(thread_a != NULL, "CreateRemoteThread failed: %lu\n", GetLastError()); next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); de_a = ctx.ev;
thread_b = CreateRemoteThread(pi.hProcess, NULL, 0, (void*)thread_proc, NULL, 0, NULL); - ok(thread_b != NULL, "CreateRemoteThread failed: %u\n", GetLastError()); + ok(thread_b != NULL, "CreateRemoteThread failed: %lu\n", GetLastError()); do next_event(&ctx, POLL_EVENT_TIMEOUT); while(ctx.ev.dwDebugEventCode != CREATE_THREAD_DEBUG_EVENT); de_b = ctx.ev;
status = NtSuspendThread(thread_b, NULL); - ok(!status, "NtSuspendThread failed, last error:%u\n", GetLastError()); + ok(!status, "NtSuspendThread failed, last error:%lu\n", GetLastError()); ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_REPLY_LATER); - ok(ret, "ContinueDebugEvent failed, last error:%u\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error:%lu\n", GetLastError());
ctx.ev.dwDebugEventCode = -1; next_event(&ctx, WAIT_EVENT_TIMEOUT); ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, - "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); ok(de_a.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_a.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_a.dwProcessId); ok(de_a.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_a.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_a.dwThreadId); de_a = ctx.ev;
byte = 0xc3; /* ret */ ret = WriteProcessMemory(pi.hProcess, thread_proc + 1, &byte, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
ok(pNtSuspendProcess != NULL, "NtSuspendProcess not found\n"); ok(pNtResumeProcess != NULL, "pNtResumeProcess not found\n"); if (pNtSuspendProcess && pNtResumeProcess) { status = pNtSuspendProcess(pi.hProcess); - ok(!status, "NtSuspendProcess failed, last error:%u\n", GetLastError()); + ok(!status, "NtSuspendProcess failed, last error:%lu\n", GetLastError()); ret = ContinueDebugEvent(ctx.ev.dwProcessId, ctx.ev.dwThreadId, DBG_REPLY_LATER); - ok(ret, "ContinueDebugEvent failed, last error:%u\n", GetLastError()); + ok(ret, "ContinueDebugEvent failed, last error:%lu\n", GetLastError()); ok(!WaitForDebugEvent(&ctx.ev, POLL_EVENT_TIMEOUT), "WaitForDebugEvent succeeded.\n");
status = NtResumeThread(thread_b, NULL); - ok(!status, "NtResumeThread failed, last error:%u\n", GetLastError()); + ok(!status, "NtResumeThread failed, last error:%lu\n", GetLastError()); ok(!WaitForDebugEvent(&ctx.ev, POLL_EVENT_TIMEOUT), "WaitForDebugEvent succeeded.\n");
status = pNtResumeProcess(pi.hProcess); - ok(!status, "pNtResumeProcess failed, last error:%u\n", GetLastError()); + ok(!status, "pNtResumeProcess failed, last error:%lu\n", GetLastError()); } else { status = NtResumeThread(thread_b, NULL); - ok(!status, "NtResumeThread failed, last error:%u\n", GetLastError()); + ok(!status, "NtResumeThread failed, last error:%lu\n", GetLastError()); ok(!WaitForDebugEvent(&ctx.ev, POLL_EVENT_TIMEOUT), "WaitForDebugEvent succeeded.\n"); }
@@ -1622,74 +1622,74 @@ static void test_debugger(const char *argv0) if (ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT) { ok(de_a.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de_a.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de_a.dwDebugEventCode); ok(de_a.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_a.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_a.dwProcessId); ok(de_a.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_a.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_a.dwThreadId);
next_event(&ctx, POLL_EVENT_TIMEOUT); if (ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT) { ok(de_a.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_a.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_a.dwProcessId); ok(de_a.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_a.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_a.dwThreadId);
ret = CloseHandle(thread_a); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); thread_a = NULL;
next_event(&ctx, POLL_EVENT_TIMEOUT); }
ok(de_b.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de_b.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de_b.dwDebugEventCode); ok(de_b.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_b.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_b.dwProcessId); ok(de_b.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_b.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_b.dwThreadId); } else { ok(de_b.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de_b.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de_b.dwDebugEventCode); ok(de_b.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_b.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_b.dwProcessId); ok(de_b.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_b.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_b.dwThreadId);
next_event(&ctx, POLL_EVENT_TIMEOUT); if (ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT) { ok(de_b.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_b.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_b.dwProcessId); ok(de_b.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_b.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_b.dwThreadId);
ret = CloseHandle(thread_b); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); thread_b = NULL;
next_event(&ctx, POLL_EVENT_TIMEOUT); }
ok(de_a.dwDebugEventCode == ctx.ev.dwDebugEventCode, - "dwDebugEventCode differs: %x (was %x)\n", ctx.ev.dwDebugEventCode, de_a.dwDebugEventCode); + "dwDebugEventCode differs: %lx (was %lx)\n", ctx.ev.dwDebugEventCode, de_a.dwDebugEventCode); ok(de_a.dwProcessId == ctx.ev.dwProcessId, - "dwProcessId differs: %x (was %x)\n", ctx.ev.dwProcessId, de_a.dwProcessId); + "dwProcessId differs: %lx (was %lx)\n", ctx.ev.dwProcessId, de_a.dwProcessId); ok(de_a.dwThreadId == ctx.ev.dwThreadId, - "dwThreadId differs: %x (was %x)\n", ctx.ev.dwThreadId, de_a.dwThreadId); + "dwThreadId differs: %lx (was %lx)\n", ctx.ev.dwThreadId, de_a.dwThreadId); }
if (thread_a) { next_event(&ctx, POLL_EVENT_TIMEOUT); ok(ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT, - "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode);
ret = CloseHandle(thread_a); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); }
@@ -1697,10 +1697,10 @@ static void test_debugger(const char *argv0) { next_event(&ctx, POLL_EVENT_TIMEOUT); ok(ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT, - "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode);
ret = CloseHandle(thread_b); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); } }
@@ -1711,7 +1711,7 @@ static void test_debugger(const char *argv0) memset(buf, OP_BP, sizeof(buf)); memcpy(proc_code, &loop_code, sizeof(loop_code)); ret = WriteProcessMemory(pi.hProcess, mem, buf, sizeof(buf), NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
ctx.thread_tag = 1;
@@ -1719,18 +1719,18 @@ static void test_debugger(const char *argv0) for (i = 0; i < worker_cnt; i++) { thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void*)thread_proc, NULL, 0, NULL); - ok(thread != NULL, "CreateRemoteThread failed: %u\n", GetLastError()); + ok(thread != NULL, "CreateRemoteThread failed: %lu\n", GetLastError());
next_event(&ctx, WAIT_EVENT_TIMEOUT); - ok(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode);
ret = CloseHandle(thread); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); }
byte = OP_BP; ret = WriteProcessMemory(pi.hProcess, thread_proc + 1, &byte, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
expect_breakpoint_exception(&ctx, thread_proc + 1); exception_cnt = 1; @@ -1740,7 +1740,7 @@ static void test_debugger(const char *argv0)
byte = 0xc3; /* ret */ ret = WriteProcessMemory(pi.hProcess, thread_proc + 1, &byte, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
for (;;) { @@ -1748,12 +1748,12 @@ static void test_debugger(const char *argv0)
/* even when there are more pending events, they are not reported until current event is continued */ ret = WaitForDebugEvent(&ev, 10); - ok(GetLastError() == ERROR_SEM_TIMEOUT, "WaitForDebugEvent returned %x(%u)\n", ret, GetLastError()); + ok(GetLastError() == ERROR_SEM_TIMEOUT, "WaitForDebugEvent returned %x(%lu)\n", ret, GetLastError());
next_event(&ctx, POLL_EVENT_TIMEOUT); if (ctx.ev.dwDebugEventCode != EXCEPTION_DEBUG_EVENT) break; - trace("exception at %p in thread %04x\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress, ctx.ev.dwThreadId); - ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", + trace("exception at %p in thread %04lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress, ctx.ev.dwThreadId); + ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionCode); ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress == thread_proc + 1, "ExceptionAddress = %p\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress); @@ -1775,7 +1775,7 @@ static void test_debugger(const char *argv0) { ok(ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT || broken(ctx.ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT), /* sometimes happens on vista */ - "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); + "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); if (ctx.ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT && !--worker_cnt) break; next_event(&ctx, WAIT_EVENT_TIMEOUT); } @@ -1792,7 +1792,7 @@ static void test_debugger(const char *argv0)
fetch_thread_context(ctx.main_thread); ret = ReadProcessMemory(pi.hProcess, get_ip(&ctx.main_thread->ctx), &instr, 1, NULL); - ok(ret, "ReadProcessMemory failed: %u\n", GetLastError()); + ok(ret, "ReadProcessMemory failed: %lu\n", GetLastError());
orig_context = ctx.main_thread->ctx; ip = get_ip(&ctx.main_thread->ctx); @@ -1825,36 +1825,36 @@ static void test_debugger(const char *argv0) fetch_thread_context(ctx.main_thread); #if defined(__i386__) /* win2k8 do not preserve eax, rcx and edx; newer versions do */ - ok(ctx.main_thread->ctx.Ebx == 102, "Ebx = %x\n", ctx.main_thread->ctx.Ebx); - ok(ctx.main_thread->ctx.Esi == 105, "Esi = %x\n", ctx.main_thread->ctx.Esi); - ok(ctx.main_thread->ctx.Edi == 106, "Edi = %x\n", ctx.main_thread->ctx.Edi); + ok(ctx.main_thread->ctx.Ebx == 102, "Ebx = %lx\n", ctx.main_thread->ctx.Ebx); + ok(ctx.main_thread->ctx.Esi == 105, "Esi = %lx\n", ctx.main_thread->ctx.Esi); + ok(ctx.main_thread->ctx.Edi == 106, "Edi = %lx\n", ctx.main_thread->ctx.Edi); #elif defined(__x86_64__) - ok(ctx.main_thread->ctx.Rax == 101, "Rax = %x\n", ctx.main_thread->ctx.Rax); - ok(ctx.main_thread->ctx.Rbx == 102, "Rbx = %x\n", ctx.main_thread->ctx.Rbx); - ok(ctx.main_thread->ctx.Rcx == 103, "Rcx = %x\n", ctx.main_thread->ctx.Rcx); - ok(ctx.main_thread->ctx.Rdx == 104, "Rdx = %x\n", ctx.main_thread->ctx.Rdx); - ok(ctx.main_thread->ctx.Rsi == 105, "Rsi = %x\n", ctx.main_thread->ctx.Rsi); - ok(ctx.main_thread->ctx.Rdi == 106, "Rdi = %x\n", ctx.main_thread->ctx.Rdi); - ok(ctx.main_thread->ctx.R8 == 107, "R8 = %x\n", ctx.main_thread->ctx.R8); - ok(ctx.main_thread->ctx.R9 == 108, "R9 = %x\n", ctx.main_thread->ctx.R9); - ok(ctx.main_thread->ctx.R10 == 109, "R10 = %x\n", ctx.main_thread->ctx.R10); - ok(ctx.main_thread->ctx.R11 == 110, "R11 = %x\n", ctx.main_thread->ctx.R11); - ok(ctx.main_thread->ctx.R12 == 111, "R12 = %x\n", ctx.main_thread->ctx.R12); - ok(ctx.main_thread->ctx.R13 == 112, "R13 = %x\n", ctx.main_thread->ctx.R13); - ok(ctx.main_thread->ctx.R14 == 113, "R14 = %x\n", ctx.main_thread->ctx.R14); - ok(ctx.main_thread->ctx.R15 == 114, "R15 = %x\n", ctx.main_thread->ctx.R15); + ok(ctx.main_thread->ctx.Rax == 101, "Rax = %llx\n", ctx.main_thread->ctx.Rax); + ok(ctx.main_thread->ctx.Rbx == 102, "Rbx = %llx\n", ctx.main_thread->ctx.Rbx); + ok(ctx.main_thread->ctx.Rcx == 103, "Rcx = %llx\n", ctx.main_thread->ctx.Rcx); + ok(ctx.main_thread->ctx.Rdx == 104, "Rdx = %llx\n", ctx.main_thread->ctx.Rdx); + ok(ctx.main_thread->ctx.Rsi == 105, "Rsi = %llx\n", ctx.main_thread->ctx.Rsi); + ok(ctx.main_thread->ctx.Rdi == 106, "Rdi = %llx\n", ctx.main_thread->ctx.Rdi); + ok(ctx.main_thread->ctx.R8 == 107, "R8 = %llx\n", ctx.main_thread->ctx.R8); + ok(ctx.main_thread->ctx.R9 == 108, "R9 = %llx\n", ctx.main_thread->ctx.R9); + ok(ctx.main_thread->ctx.R10 == 109, "R10 = %llx\n", ctx.main_thread->ctx.R10); + ok(ctx.main_thread->ctx.R11 == 110, "R11 = %llx\n", ctx.main_thread->ctx.R11); + ok(ctx.main_thread->ctx.R12 == 111, "R12 = %llx\n", ctx.main_thread->ctx.R12); + ok(ctx.main_thread->ctx.R13 == 112, "R13 = %llx\n", ctx.main_thread->ctx.R13); + ok(ctx.main_thread->ctx.R14 == 113, "R14 = %llx\n", ctx.main_thread->ctx.R14); + ok(ctx.main_thread->ctx.R15 == 114, "R15 = %llx\n", ctx.main_thread->ctx.R15); #endif
byte = OP_BP; ret = WriteProcessMemory(pi.hProcess, ip, &byte, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
SetEvent(event); ResumeThread(ctx.main_thread->handle);
next_event(&ctx, 2000); - ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); - ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %x\n", + ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT, "ExceptionCode = %lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionCode); ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress == ip, "ExceptionAddress = %p\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress); @@ -1863,27 +1863,27 @@ static void test_debugger(const char *argv0) ok(get_ip(&ctx.main_thread->ctx) == ip + 1, "unexpected instruction pointer %p\n", get_ip(&ctx.main_thread->ctx));
#if defined(__i386__) - ok(ctx.main_thread->ctx.Eax == 0, "Eax = %x\n", ctx.main_thread->ctx.Eax); - ok(ctx.main_thread->ctx.Ebx == 102, "Ebx = %x\n", ctx.main_thread->ctx.Ebx); - ok(ctx.main_thread->ctx.Ecx != 103, "Ecx = %x\n", ctx.main_thread->ctx.Ecx); - ok(ctx.main_thread->ctx.Edx != 104, "Edx = %x\n", ctx.main_thread->ctx.Edx); - ok(ctx.main_thread->ctx.Esi == 105, "Esi = %x\n", ctx.main_thread->ctx.Esi); - ok(ctx.main_thread->ctx.Edi == 106, "Edi = %x\n", ctx.main_thread->ctx.Edi); + ok(ctx.main_thread->ctx.Eax == 0, "Eax = %lx\n", ctx.main_thread->ctx.Eax); + ok(ctx.main_thread->ctx.Ebx == 102, "Ebx = %lx\n", ctx.main_thread->ctx.Ebx); + ok(ctx.main_thread->ctx.Ecx != 103, "Ecx = %lx\n", ctx.main_thread->ctx.Ecx); + ok(ctx.main_thread->ctx.Edx != 104, "Edx = %lx\n", ctx.main_thread->ctx.Edx); + ok(ctx.main_thread->ctx.Esi == 105, "Esi = %lx\n", ctx.main_thread->ctx.Esi); + ok(ctx.main_thread->ctx.Edi == 106, "Edi = %lx\n", ctx.main_thread->ctx.Edi); #elif defined(__x86_64__) - ok(ctx.main_thread->ctx.Rax == 0, "Rax = %x\n", ctx.main_thread->ctx.Rax); - ok(ctx.main_thread->ctx.Rbx == 102, "Rbx = %x\n", ctx.main_thread->ctx.Rbx); - ok(ctx.main_thread->ctx.Rcx != 103, "Rcx = %x\n", ctx.main_thread->ctx.Rcx); - ok(ctx.main_thread->ctx.Rdx != 104, "Rdx = %x\n", ctx.main_thread->ctx.Rdx); - ok(ctx.main_thread->ctx.Rsi == 105, "Rsi = %x\n", ctx.main_thread->ctx.Rsi); - ok(ctx.main_thread->ctx.Rdi == 106, "Rdi = %x\n", ctx.main_thread->ctx.Rdi); - ok(ctx.main_thread->ctx.R8 != 107, "R8 = %x\n", ctx.main_thread->ctx.R8); - ok(ctx.main_thread->ctx.R9 != 108, "R9 = %x\n", ctx.main_thread->ctx.R9); - ok(ctx.main_thread->ctx.R10 != 109, "R10 = %x\n", ctx.main_thread->ctx.R10); - ok(ctx.main_thread->ctx.R11 != 110, "R11 = %x\n", ctx.main_thread->ctx.R11); - ok(ctx.main_thread->ctx.R12 == 111, "R12 = %x\n", ctx.main_thread->ctx.R12); - ok(ctx.main_thread->ctx.R13 == 112, "R13 = %x\n", ctx.main_thread->ctx.R13); - ok(ctx.main_thread->ctx.R14 == 113, "R14 = %x\n", ctx.main_thread->ctx.R14); - ok(ctx.main_thread->ctx.R15 == 114, "R15 = %x\n", ctx.main_thread->ctx.R15); + ok(ctx.main_thread->ctx.Rax == 0, "Rax = %llx\n", ctx.main_thread->ctx.Rax); + ok(ctx.main_thread->ctx.Rbx == 102, "Rbx = %llx\n", ctx.main_thread->ctx.Rbx); + ok(ctx.main_thread->ctx.Rcx != 103, "Rcx = %llx\n", ctx.main_thread->ctx.Rcx); + ok(ctx.main_thread->ctx.Rdx != 104, "Rdx = %llx\n", ctx.main_thread->ctx.Rdx); + ok(ctx.main_thread->ctx.Rsi == 105, "Rsi = %llx\n", ctx.main_thread->ctx.Rsi); + ok(ctx.main_thread->ctx.Rdi == 106, "Rdi = %llx\n", ctx.main_thread->ctx.Rdi); + ok(ctx.main_thread->ctx.R8 != 107, "R8 = %llx\n", ctx.main_thread->ctx.R8); + ok(ctx.main_thread->ctx.R9 != 108, "R9 = %llx\n", ctx.main_thread->ctx.R9); + ok(ctx.main_thread->ctx.R10 != 109, "R10 = %llx\n", ctx.main_thread->ctx.R10); + ok(ctx.main_thread->ctx.R11 != 110, "R11 = %llx\n", ctx.main_thread->ctx.R11); + ok(ctx.main_thread->ctx.R12 == 111, "R12 = %llx\n", ctx.main_thread->ctx.R12); + ok(ctx.main_thread->ctx.R13 == 112, "R13 = %llx\n", ctx.main_thread->ctx.R13); + ok(ctx.main_thread->ctx.R14 == 113, "R14 = %llx\n", ctx.main_thread->ctx.R14); + ok(ctx.main_thread->ctx.R15 == 114, "R15 = %llx\n", ctx.main_thread->ctx.R15); #endif
ctx.main_thread->ctx = orig_context; @@ -1891,11 +1891,11 @@ static void test_debugger(const char *argv0) set_thread_context(&ctx, ctx.main_thread);
ret = WriteProcessMemory(pi.hProcess, ip, &instr, 1, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
memset(buf + 10, 0x90, 10); /* nop */ ret = WriteProcessMemory(pi.hProcess, mem + 10, buf + 10, 10, NULL); - ok(ret, "WriteProcessMemory failed: %u\n", GetLastError()); + ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError());
next_event(&ctx, POLL_EVENT_TIMEOUT);
@@ -1918,8 +1918,8 @@ static void test_debugger(const char *argv0) next_event(&ctx, WAIT_EVENT_TIMEOUT); if (sizeof(void*) != 4 || ctx.ev.u.Exception.ExceptionRecord.ExceptionCode != EXCEPTION_BREAKPOINT) { - ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode); - ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_SINGLE_STEP, "ExceptionCode = %x\n", + ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %ld\n", ctx.ev.dwDebugEventCode); + ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_SINGLE_STEP, "ExceptionCode = %lx\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionCode); ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress == mem + 10 || ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress == mem + 11, @@ -1946,11 +1946,11 @@ static void test_debugger(const char *argv0) while (ctx.ev.dwDebugEventCode != EXIT_PROCESS_DEBUG_EVENT);
ret = CloseHandle(event); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); ret = CloseHandle(pi.hThread); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); ret = CloseHandle(pi.hProcess); - ok(ret, "CloseHandle failed, last error %d.\n", GetLastError()); + ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError()); }
static DWORD run_child_wait( char *cmd, HANDLE event ) @@ -1961,14 +1961,14 @@ static DWORD run_child_wait( char *cmd, HANDLE event ) DWORD exit_code;
ret = CreateProcessA(NULL, cmd, NULL, NULL, TRUE, DEBUG_PROCESS, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); + ok(ret, "CreateProcess failed, last error %#lx.\n", GetLastError()); Sleep(200); CloseHandle( pDbgUiGetThreadDebugObject() ); pDbgUiSetThreadDebugObject( 0 ); SetEvent( event ); WaitForSingleObject( pi.hProcess, 1000 ); ret = GetExitCodeProcess( pi.hProcess, &exit_code ); - ok( ret, "GetExitCodeProcess failed err=%d\n", GetLastError()); + ok( ret, "GetExitCodeProcess failed err=%ld\n", GetLastError()); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); return exit_code; @@ -1986,11 +1986,11 @@ static DWORD WINAPI debug_and_exit(void *arg) BOOL ret;
ret = CreateProcessA(NULL, cmd, NULL, NULL, TRUE, DEBUG_PROCESS, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); + ok(ret, "CreateProcess failed, last error %#lx.\n", GetLastError()); debug = pDbgUiGetThreadDebugObject(); status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( !status, "NtSetInformationDebugObject failed %x\n", status ); + ok( !status, "NtSetInformationDebugObject failed %lx\n", status ); *(HANDLE *)arg = debug; Sleep(200); ExitThread(0); @@ -2006,11 +2006,11 @@ static DWORD WINAPI debug_and_wait(void *arg)
pDbgUiSetThreadDebugObject( debug ); ret = CreateProcessA(NULL, cmd, NULL, NULL, TRUE, DEBUG_PROCESS, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); + ok(ret, "CreateProcess failed, last error %#lx.\n", GetLastError()); debug = pDbgUiGetThreadDebugObject(); status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( !status, "NtSetInformationDebugObject failed %x\n", status ); + ok( !status, "NtSetInformationDebugObject failed %lx\n", status ); Sleep(INFINITE); ExitThread(0); } @@ -2020,7 +2020,7 @@ static DWORD WINAPI create_debug_port(void *arg) STARTUPINFOA si = { sizeof(si) }; NTSTATUS status = pDbgUiConnectToDbg();
- ok( !status, "DbgUiConnectToDbg failed %x\n", status ); + ok( !status, "DbgUiConnectToDbg failed %lx\n", status ); *(HANDLE *)arg = pDbgUiGetThreadDebugObject(); Sleep( INFINITE ); ExitThread(0); @@ -2037,50 +2037,50 @@ static void test_kill_on_exit(const char *argv0) ULONG val;
event = CreateEventW(&sa, FALSE, FALSE, NULL); - ok(event != NULL, "CreateEvent failed: %u\n", GetLastError()); + ok(event != NULL, "CreateEvent failed: %lu\n", GetLastError());
cmd = heap_alloc(strlen(argv0) + strlen(arguments) + 16); - sprintf(cmd, "%s%s%x\n", argv0, arguments, (DWORD)(DWORD_PTR)event); + sprintf(cmd, "%s%s%lx\n", argv0, arguments, (DWORD)(DWORD_PTR)event);
status = pNtCreateDebugObject( &debug, DEBUG_ALL_ACCESS, &attr, 0 ); - ok( !status, "NtCreateDebugObject failed %x\n", status ); + ok( !status, "NtCreateDebugObject failed %lx\n", status ); pDbgUiSetThreadDebugObject( debug ); exit_code = run_child_wait( cmd, event ); - ok( exit_code == 0, "exit code = %08x\n", exit_code); + ok( exit_code == 0, "exit code = %08lx\n", exit_code);
status = pNtCreateDebugObject( &debug, DEBUG_ALL_ACCESS, &attr, DEBUG_KILL_ON_CLOSE ); - ok( !status, "NtCreateDebugObject failed %x\n", status ); + ok( !status, "NtCreateDebugObject failed %lx\n", status ); pDbgUiSetThreadDebugObject( debug ); exit_code = run_child_wait( cmd, event ); - ok( exit_code == STATUS_DEBUGGER_INACTIVE, "exit code = %08x\n", exit_code); + ok( exit_code == STATUS_DEBUGGER_INACTIVE, "exit code = %08lx\n", exit_code);
status = pNtCreateDebugObject( &debug, DEBUG_ALL_ACCESS, &attr, 0xfffe ); - ok( status == STATUS_INVALID_PARAMETER, "NtCreateDebugObject failed %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER, "NtCreateDebugObject failed %lx\n", status );
status = pNtCreateDebugObject( &debug, DEBUG_ALL_ACCESS, &attr, 0 ); - ok( !status, "NtCreateDebugObject failed %x\n", status ); + ok( !status, "NtCreateDebugObject failed %lx\n", status ); pDbgUiSetThreadDebugObject( debug ); val = DEBUG_KILL_ON_CLOSE; status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( !status, "NtSetInformationDebugObject failed %x\n", status ); + ok( !status, "NtSetInformationDebugObject failed %lx\n", status ); exit_code = run_child_wait( cmd, event ); - ok( exit_code == STATUS_DEBUGGER_INACTIVE, "exit code = %08x\n", exit_code); + ok( exit_code == STATUS_DEBUGGER_INACTIVE, "exit code = %08lx\n", exit_code);
status = pNtCreateDebugObject( &debug, DEBUG_ALL_ACCESS, &attr, DEBUG_KILL_ON_CLOSE ); - ok( !status, "NtCreateDebugObject failed %x\n", status ); + ok( !status, "NtCreateDebugObject failed %lx\n", status ); pDbgUiSetThreadDebugObject( debug ); val = 0; status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( !status, "NtSetInformationDebugObject failed %x\n", status ); + ok( !status, "NtSetInformationDebugObject failed %lx\n", status ); exit_code = run_child_wait( cmd, event ); - ok( exit_code == 0, "exit code = %08x\n", exit_code); + ok( exit_code == 0, "exit code = %08lx\n", exit_code);
status = pDbgUiConnectToDbg(); - ok( !status, "DbgUiConnectToDbg failed %x\n", status ); + ok( !status, "DbgUiConnectToDbg failed %lx\n", status ); exit_code = run_child_wait( cmd, event ); - ok( exit_code == STATUS_DEBUGGER_INACTIVE, "exit code = %08x\n", exit_code); + ok( exit_code == STATUS_DEBUGGER_INACTIVE, "exit code = %08lx\n", exit_code);
/* test that threads close the debug port on exit */ thread = CreateThread(NULL, 0, debug_and_exit, &debug, 0, &tid); @@ -2090,41 +2090,41 @@ static void test_kill_on_exit(const char *argv0) status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); ok( status == STATUS_INVALID_HANDLE || broken(status == STATUS_SUCCESS), /* wow64 */ - "NtSetInformationDebugObject failed %x\n", status ); + "NtSetInformationDebugObject failed %lx\n", status ); SetEvent( event ); if (!status) { WaitForSingleObject( pi.hProcess, 100 ); GetExitCodeProcess( pi.hProcess, &exit_code ); - ok( exit_code == STILL_ACTIVE, "exit code = %08x\n", exit_code); + ok( exit_code == STILL_ACTIVE, "exit code = %08lx\n", exit_code); CloseHandle( debug ); } WaitForSingleObject( pi.hProcess, 1000 ); GetExitCodeProcess( pi.hProcess, &exit_code ); - ok( exit_code == 0, "exit code = %08x\n", exit_code); + ok( exit_code == 0, "exit code = %08lx\n", exit_code); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); CloseHandle( thread );
/* but not on forced exit */ status = pNtCreateDebugObject( &debug, DEBUG_ALL_ACCESS, &attr, DEBUG_KILL_ON_CLOSE ); - ok( !status, "NtCreateDebugObject failed %x\n", status ); + ok( !status, "NtCreateDebugObject failed %lx\n", status ); thread = CreateThread(NULL, 0, debug_and_wait, &debug, 0, &tid); Sleep( 100 ); ok( debug != 0, "no debug port\n" ); val = 1; status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %x\n", status ); + ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %lx\n", status ); TerminateThread( thread, 0 ); status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %x\n", status ); + ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %lx\n", status ); WaitForSingleObject( pi.hProcess, 300 ); GetExitCodeProcess( pi.hProcess, &exit_code ); todo_wine ok( exit_code == STATUS_DEBUGGER_INACTIVE || broken(exit_code == STILL_ACTIVE), /* wow64 */ - "exit code = %08x\n", exit_code); + "exit code = %08lx\n", exit_code); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); CloseHandle( thread ); @@ -2137,11 +2137,11 @@ static void test_kill_on_exit(const char *argv0) val = 0; status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %x\n", status ); + ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %lx\n", status ); TerminateThread( thread, 0 ); status = pNtSetInformationDebugObject( debug, DebugObjectKillProcessOnExitInformation, &val, sizeof(val), NULL ); - ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %x\n", status ); + ok( status == STATUS_SUCCESS, "NtSetInformationDebugObject failed %lx\n", status ); CloseHandle( debug ); CloseHandle( thread );
@@ -2191,7 +2191,7 @@ START_TEST(debugger) else if (myARGC >= 4 && !strcmp(myARGV[2], "wait")) { DWORD event, cnt = 1; - sscanf(myARGV[3], "%x", &event); + sscanf(myARGV[3], "%lx", &event); if (myARGC >= 5) cnt = atoi(myARGV[4]); wait_debugger((HANDLE)(DWORD_PTR)event, cnt); } diff --git a/dlls/kernel32/tests/directory.c b/dlls/kernel32/tests/directory.c index de78c616816..d9f6ee4c9a5 100644 --- a/dlls/kernel32/tests/directory.c +++ b/dlls/kernel32/tests/directory.c @@ -42,9 +42,9 @@ static void test_granted_access(HANDLE handle, ACCESS_MASK access, int line)
status = pNtQueryObject(handle, ObjectBasicInformation, &obj_info, sizeof(obj_info), NULL); - ok_(__FILE__, line)(!status, "NtQueryObject with err: %08x\n", status); + ok_(__FILE__, line)(!status, "NtQueryObject with err: %08lx\n", status); ok_(__FILE__, line)(obj_info.GrantedAccess == access, "Granted access should " - "be 0x%08x, instead of 0x%08x\n", access, obj_info.GrantedAccess); + "be 0x%08lx, instead of 0x%08lx\n", access, obj_info.GrantedAccess); }
/* If you change something in these tests, please do the same @@ -185,12 +185,12 @@ static void test_CreateDirectoryA(void) ret = CreateDirectoryA(NULL, NULL); ok(ret == FALSE && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER), - "CreateDirectoryA(NULL): ret=%d err=%d\n", ret, GetLastError()); + "CreateDirectoryA(NULL): ret=%d err=%ld\n", ret, GetLastError());
ret = CreateDirectoryA("", NULL); ok(ret == FALSE && (GetLastError() == ERROR_BAD_PATHNAME || GetLastError() == ERROR_PATH_NOT_FOUND), - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError());
ret = GetSystemDirectoryA(tmpdir, MAX_PATH); ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n"); @@ -201,53 +201,53 @@ static void test_CreateDirectoryA(void)
ret = CreateDirectoryA(".", NULL); ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError());
ret = CreateDirectoryA("..", NULL); ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError());
GetTempPathA(MAX_PATH, tmpdir); tmpdir[3] = 0; /* truncate the path */ ret = CreateDirectoryA(tmpdir, NULL); ok(ret == FALSE && (GetLastError() == ERROR_ALREADY_EXISTS || GetLastError() == ERROR_ACCESS_DENIED), - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError());
GetTempPathA(MAX_PATH, tmpdir); lstrcatA(tmpdir, "Please Remove Me"); ret = CreateDirectoryA(tmpdir, NULL); - ok(ret == TRUE, "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + ok(ret == TRUE, "CreateDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
ret = CreateDirectoryA(tmpdir, NULL); ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError());
ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
lstrcatA(tmpdir, "?"); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME || GetLastError() == ERROR_PATH_NOT_FOUND), - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError()); RemoveDirectoryA(tmpdir);
tmpdir[lstrlenA(tmpdir) - 1] = '*'; ret = CreateDirectoryA(tmpdir, NULL); ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME || GetLastError() == ERROR_PATH_NOT_FOUND), - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError()); RemoveDirectoryA(tmpdir);
GetTempPathA(MAX_PATH, tmpdir); lstrcatA(tmpdir, "Please Remove Me/Please Remove Me"); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError()); RemoveDirectoryA(tmpdir);
/* Test behavior with a trailing dot. @@ -257,21 +257,21 @@ static void test_CreateDirectoryA(void) lstrcatA(tmpdir, "Please Remove Me."); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE, - "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "CreateDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
lstrcatA(tmpdir, "/Please Remove Me"); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE, - "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "CreateDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError()); ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
GetTempPathA(MAX_PATH, tmpdir); lstrcatA(tmpdir, "Please Remove Me"); ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
/* Test behavior with two trailing dots. * The directory should be created without the trailing dots. @@ -280,25 +280,25 @@ static void test_CreateDirectoryA(void) lstrcatA(tmpdir, "Please Remove Me.."); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE, - "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "CreateDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
lstrcatA(tmpdir, "/Please Remove Me"); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE || /* On Win98 */ (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */ - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError()); if (ret == TRUE) { ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError()); }
GetTempPathA(MAX_PATH, tmpdir); lstrcatA(tmpdir, "Please Remove Me"); ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
/* Test behavior with a trailing space. * The directory should be created without the trailing space. @@ -307,25 +307,25 @@ static void test_CreateDirectoryA(void) lstrcatA(tmpdir, "Please Remove Me "); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE, - "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "CreateDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
lstrcatA(tmpdir, "/Please Remove Me"); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE || /* On Win98 */ (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */ - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError()); if (ret == TRUE) { ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError()); }
GetTempPathA(MAX_PATH, tmpdir); lstrcatA(tmpdir, "Please Remove Me"); ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
/* Test behavior with a trailing space. * The directory should be created without the trailing spaces. @@ -334,25 +334,25 @@ static void test_CreateDirectoryA(void) lstrcatA(tmpdir, "Please Remove Me "); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE, - "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "CreateDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError());
lstrcatA(tmpdir, "/Please Remove Me"); ret = CreateDirectoryA(tmpdir, NULL); ok(ret == TRUE || /* On Win98 */ (ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND), /* On NT! */ - "CreateDirectoryA(%s): ret=%d err=%d\n", tmpdir, ret, GetLastError()); + "CreateDirectoryA(%s): ret=%d err=%ld\n", tmpdir, ret, GetLastError()); if (ret == TRUE) { ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError()); }
GetTempPathA(MAX_PATH, tmpdir); lstrcatA(tmpdir, "Please Remove Me"); ret = RemoveDirectoryA(tmpdir); ok(ret == TRUE, - "RemoveDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + "RemoveDirectoryA(%s) failed err=%ld\n", tmpdir, GetLastError()); SetCurrentDirectoryW(curdir); }
@@ -375,32 +375,32 @@ static void test_CreateDirectoryW(void) return; } ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, - "should not create NULL path ret %u err %u\n", ret, GetLastError()); + "should not create NULL path ret %u err %lu\n", ret, GetLastError());
ret = CreateDirectoryW(empty_strW, NULL); ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, - "should not create empty path ret %u err %u\n", ret, GetLastError()); + "should not create empty path ret %u err %lu\n", ret, GetLastError());
ret = GetSystemDirectoryW(tmpdir, MAX_PATH); ok(ret < MAX_PATH, "System directory should fit into MAX_PATH\n");
GetCurrentDirectoryW(MAX_PATH, curdir); ret = SetCurrentDirectoryW(tmpdir); - ok(ret == TRUE, "could not chdir to the System directory ret %u err %u\n", ret, GetLastError()); + ok(ret == TRUE, "could not chdir to the System directory ret %u err %lu\n", ret, GetLastError());
ret = CreateDirectoryW(dotW, NULL); ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, - "should not create existing path ret %u err %u\n", ret, GetLastError()); + "should not create existing path ret %u err %lu\n", ret, GetLastError());
ret = CreateDirectoryW(dotdotW, NULL); ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, - "should not create existing path ret %u err %u\n", ret, GetLastError()); + "should not create existing path ret %u err %lu\n", ret, GetLastError());
GetTempPathW(MAX_PATH, tmpdir); tmpdir[3] = 0; /* truncate the path */ ret = CreateDirectoryW(tmpdir, NULL); ok(ret == FALSE && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_ALREADY_EXISTS), - "should deny access to the drive root ret %u err %u\n", ret, GetLastError()); + "should deny access to the drive root ret %u err %lu\n", ret, GetLastError());
GetTempPathW(MAX_PATH, tmpdir); lstrcatW(tmpdir, tmp_dir_name); @@ -409,7 +409,7 @@ static void test_CreateDirectoryW(void)
ret = CreateDirectoryW(tmpdir, NULL); ok(ret == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, - "should not create existing path ret %u err %u\n", ret, GetLastError()); + "should not create existing path ret %u err %lu\n", ret, GetLastError());
ret = RemoveDirectoryW(tmpdir); ok(ret == TRUE, "RemoveDirectoryW should always succeed\n"); @@ -417,7 +417,7 @@ static void test_CreateDirectoryW(void) lstrcatW(tmpdir, questionW); ret = CreateDirectoryW(tmpdir, NULL); ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME, - "CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%d\n", + "CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%ld\n", ret ? " True" : "False", GetLastError()); ret = RemoveDirectoryW(tmpdir); ok(ret == FALSE, "RemoveDirectoryW should have failed\n"); @@ -425,7 +425,7 @@ static void test_CreateDirectoryW(void) tmpdir[lstrlenW(tmpdir) - 1] = '*'; ret = CreateDirectoryW(tmpdir, NULL); ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME, - "CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n", + "CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n", ret ? " True" : "False", GetLastError()); ret = RemoveDirectoryW(tmpdir); ok(ret == FALSE, "RemoveDirectoryW should have failed\n"); @@ -436,7 +436,7 @@ static void test_CreateDirectoryW(void) lstrcatW(tmpdir, tmp_dir_name); ret = CreateDirectoryW(tmpdir, NULL); ok(ret == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %u\n", + "CreateDirectoryW with multiple nonexistent directories in path should fail ret %u err %lu\n", ret, GetLastError()); ret = RemoveDirectoryW(tmpdir); ok(ret == FALSE, "RemoveDirectoryW should have failed\n"); @@ -461,7 +461,7 @@ static void test_RemoveDirectoryA(void) SetLastError(0xdeadbeef); ok(!RemoveDirectoryA(tmpdir), "RemoveDirectoryA succeeded\n"); ok(GetLastError() == ERROR_SHARING_VIOLATION, - "Expected ERROR_SHARING_VIOLATION, got %u\n", GetLastError()); + "Expected ERROR_SHARING_VIOLATION, got %lu\n", GetLastError());
TEST_GRANTED_ACCESS(NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.Handle, FILE_TRAVERSE | SYNCHRONIZE); @@ -474,14 +474,14 @@ static void test_RemoveDirectoryA(void) ret = RemoveDirectoryA(tmpdir); ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME || GetLastError() == ERROR_PATH_NOT_FOUND), - "RemoveDirectoryA with ? wildcard name should fail, ret=%s error=%d\n", + "RemoveDirectoryA with ? wildcard name should fail, ret=%s error=%ld\n", ret ? " True" : "False", GetLastError());
tmpdir[lstrlenA(tmpdir) - 1] = '*'; ret = RemoveDirectoryA(tmpdir); ok(ret == FALSE && (GetLastError() == ERROR_INVALID_NAME || GetLastError() == ERROR_PATH_NOT_FOUND), - "RemoveDirectoryA with * wildcard name should fail, ret=%s error=%d\n", + "RemoveDirectoryA with * wildcard name should fail, ret=%s error=%ld\n", ret ? " True" : "False", GetLastError()); }
@@ -510,7 +510,7 @@ static void test_RemoveDirectoryW(void) SetLastError(0xdeadbeef); ok(!RemoveDirectoryW(tmpdir), "RemoveDirectoryW succeeded\n"); ok(GetLastError() == ERROR_SHARING_VIOLATION, - "Expected ERROR_SHARING_VIOLATION, got %u\n", GetLastError()); + "Expected ERROR_SHARING_VIOLATION, got %lu\n", GetLastError());
TEST_GRANTED_ACCESS(NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.Handle, FILE_TRAVERSE | SYNCHRONIZE); @@ -522,13 +522,13 @@ static void test_RemoveDirectoryW(void) lstrcatW(tmpdir, questionW); ret = RemoveDirectoryW(tmpdir); ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME, - "RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%d\n", + "RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%ld\n", ret ? " True" : "False", GetLastError());
tmpdir[lstrlenW(tmpdir) - 1] = '*'; ret = RemoveDirectoryW(tmpdir); ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME, - "RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%d\n", + "RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n", ret ? " True" : "False", GetLastError()); }
@@ -536,9 +536,9 @@ static void test_SetCurrentDirectoryA(void) { SetLastError(0); ok( !SetCurrentDirectoryA( "\some_dummy_dir" ), "SetCurrentDirectoryA succeeded\n" ); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %ld\n", GetLastError() ); ok( !SetCurrentDirectoryA( "\some_dummy\subdir" ), "SetCurrentDirectoryA succeeded\n" ); - ok( GetLastError() == ERROR_PATH_NOT_FOUND, "wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_PATH_NOT_FOUND, "wrong error %ld\n", GetLastError() ); }
static void test_CreateDirectory_root(void) @@ -551,7 +551,7 @@ static void test_CreateDirectory_root(void) GetCurrentDirectoryA(sizeof(curdir), curdir);
ret = SetCurrentDirectoryA("C:\"); - ok(ret, "SetCurrentDirectory error %u\n", GetLastError()); + ok(ret, "SetCurrentDirectory error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateDirectoryA("C:\", NULL); @@ -562,22 +562,22 @@ static void test_CreateDirectory_root(void) SetCurrentDirectoryA(curdir); return; } - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateDirectoryA("C:", NULL); ok(!ret, "CreateDirectory should fail\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateDirectoryW(drive_c_root, NULL); ok(!ret, "CreateDirectory should fail\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateDirectoryW(drive_c, NULL); ok(!ret, "CreateDirectory should fail\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got %lu\n", GetLastError());
SetCurrentDirectoryA(curdir); } diff --git a/dlls/kernel32/tests/drive.c b/dlls/kernel32/tests/drive.c index 98dc454f340..e03c44c1947 100644 --- a/dlls/kernel32/tests/drive.c +++ b/dlls/kernel32/tests/drive.c @@ -35,7 +35,7 @@ static void test_GetDriveTypeA(void) UINT type;
logical_drives = GetLogicalDrives(); - ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError()); + ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) { @@ -88,7 +88,7 @@ static void test_GetDriveTypeW(void) UINT type;
logical_drives = GetLogicalDrives(); - ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError()); + ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) { @@ -142,21 +142,21 @@ static void test_GetDiskFreeSpaceA(void) DWORD logical_drives;
ret = GetDiskFreeSpaceA(NULL, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); - ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError()); + ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
ret = GetDiskFreeSpaceA("", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_NAME), - "GetDiskFreeSpaceA(""): ret=%d GetLastError=%d\n", + "GetDiskFreeSpaceA(""): ret=%d GetLastError=%ld\n", ret, GetLastError());
ret = GetDiskFreeSpaceA("\", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); - ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError()); + ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
ret = GetDiskFreeSpaceA("/", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); - ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError()); + ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
logical_drives = GetLogicalDrives(); - ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError()); + ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) { @@ -169,7 +169,7 @@ static void test_GetDiskFreeSpaceA(void) ret = GetDiskFreeSpaceA(drive, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); if (!(logical_drives & 1)) ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_DRIVE), - "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%d\n", + "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%ld\n", drive, ret, GetLastError()); else { @@ -177,12 +177,12 @@ static void test_GetDiskFreeSpaceA(void) if (!ret) /* GetDiskFreeSpaceA() should succeed, but it can fail with too many different GetLastError() results to be usable for an ok() */ - trace("GetDiskFreeSpaceA(%s) failed with %d\n", drive, GetLastError()); + trace("GetDiskFreeSpaceA(%s) failed with %ld\n", drive, GetLastError());
if( GetVersion() & 0x80000000) /* win3.0 through winME */ ok( total_clusters <= 65535, - "total clusters is %d > 65535\n", total_clusters); + "total clusters is %ld > 65535\n", total_clusters); else if (pGetDiskFreeSpaceExA) { /* NT, 2k, XP : GetDiskFreeSpace should be accurate */ ULARGE_INTEGER totEx, tot, d; @@ -194,7 +194,7 @@ static void test_GetDiskFreeSpaceA(void) if (!ret) /* GetDiskFreeSpaceExA() should succeed, but it can fail with too many different GetLastError() results to be usable for an ok() */ - trace("GetDiskFreeSpaceExA(%s) failed with %d\n", drive, GetLastError()); + trace("GetDiskFreeSpaceExA(%s) failed with %ld\n", drive, GetLastError());
ok( bytes_per_sector == 0 || /* empty cd rom drive */ totEx.QuadPart <= tot.QuadPart, @@ -222,21 +222,21 @@ static void test_GetDiskFreeSpaceW(void) win_skip("GetDiskFreeSpaceW is not available\n"); return; } - ok(ret, "GetDiskFreeSpaceW error %d\n", GetLastError()); + ok(ret, "GetDiskFreeSpaceW error %ld\n", GetLastError());
ret = GetDiskFreeSpaceW(empty_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND, - "GetDiskFreeSpaceW(""): ret=%d GetLastError=%d\n", + "GetDiskFreeSpaceW(""): ret=%d GetLastError=%ld\n", ret, GetLastError());
ret = GetDiskFreeSpaceW(root_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); - ok(ret, "GetDiskFreeSpaceW("") error %d\n", GetLastError()); + ok(ret, "GetDiskFreeSpaceW("") error %ld\n", GetLastError());
ret = GetDiskFreeSpaceW(unix_style_root_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); - ok(ret, "GetDiskFreeSpaceW error %d\n", GetLastError()); + ok(ret, "GetDiskFreeSpaceW error %ld\n", GetLastError());
logical_drives = GetLogicalDrives(); - ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError()); + ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) { @@ -247,12 +247,12 @@ static void test_GetDiskFreeSpaceW(void) ret = GetDiskFreeSpaceW(drive, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters); if (!(logical_drives & 1)) ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND, - "GetDiskFreeSpaceW(%c): ret=%d GetLastError=%d\n", + "GetDiskFreeSpaceW(%c): ret=%d GetLastError=%ld\n", drive[0], ret, GetLastError()); else if (!ret) /* GetDiskFreeSpaceW() should succeed, but it can fail with too many different GetLastError() results to be usable for an ok() */ - trace("GetDiskFreeSpaceW(%c) failed with %d\n", drive[0], GetLastError()); + trace("GetDiskFreeSpaceW(%c) failed with %ld\n", drive[0], GetLastError()); } logical_drives >>= 1; } diff --git a/dlls/kernel32/tests/environ.c b/dlls/kernel32/tests/environ.c index d19b8700c5f..c1a49e175be 100644 --- a/dlls/kernel32/tests/environ.c +++ b/dlls/kernel32/tests/environ.c @@ -68,15 +68,15 @@ static void test_Predefined(void) return; } NoErr = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &Token); - ok(NoErr, "Failed to open token, error %u\n", GetLastError()); + ok(NoErr, "Failed to open token, error %lu\n", GetLastError()); DataSize = sizeof(Data); NoErr = pGetUserProfileDirectoryA(Token, Data, &DataSize); - ok(NoErr, "Failed to get user profile dir, error %u\n", GetLastError()); + ok(NoErr, "Failed to get user profile dir, error %lu\n", GetLastError()); if (NoErr) { EnvSize = GetEnvironmentVariableA("USERPROFILE", Env, sizeof(Env)); ok(EnvSize != 0 && EnvSize <= sizeof(Env), - "Failed to retrieve environment variable USERPROFILE, error %u\n", + "Failed to retrieve environment variable USERPROFILE, error %lu\n", GetLastError()); ok(strcmp(Data, Env) == 0, "USERPROFILE env var %s doesn't match GetUserProfileDirectory %s\n", @@ -85,7 +85,7 @@ static void test_Predefined(void) else skip("Skipping USERPROFILE check, can't get user profile dir\n"); NoErr = CloseHandle(Token); - ok(NoErr, "Failed to close token, error %u\n", GetLastError()); + ok(NoErr, "Failed to close token, error %lu\n", GetLastError()); }
static void test_GetSetEnvironmentVariableA(void) @@ -99,34 +99,34 @@ static void test_GetSetEnvironmentVariableA(void)
ret = SetEnvironmentVariableA(name, value); ok(ret == TRUE, - "unexpected error in SetEnvironmentVariableA, GetLastError=%d\n", + "unexpected error in SetEnvironmentVariableA, GetLastError=%ld\n", GetLastError());
/* Try to retrieve the environment variable we just set */ SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(name, NULL, 0); ok(ret_size == strlen(value) + 1, - "should return length with terminating 0 ret_size=%d\n", ret_size); + "should return length with terminating 0 ret_size=%ld\n", ret_size); ok(GetLastError() == 0xdeadbeef, - "should not fail with zero size but GetLastError=%d\n", GetLastError()); + "should not fail with zero size but GetLastError=%ld\n", GetLastError());
lstrcpyA(buf, "foo"); ret_size = GetEnvironmentVariableA(name, buf, lstrlenA(value)); ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n"); ok(ret_size == strlen(value) + 1, - "should return length with terminating 0 ret_size=%d\n", ret_size); + "should return length with terminating 0 ret_size=%ld\n", ret_size);
lstrcpyA(buf, "foo"); ret_size = GetEnvironmentVariableA(name, buf, lstrlenA(value) + 1); ok(lstrcmpA(buf, value) == 0, "should touch the buffer\n"); ok(ret_size == strlen(value), - "should return length without terminating 0 ret_size=%d\n", ret_size); + "should return length without terminating 0 ret_size=%ld\n", ret_size);
lstrcpyA(buf, "foo"); ret_size = GetEnvironmentVariableA(name_cased, buf, lstrlenA(value) + 1); ok(lstrcmpA(buf, value) == 0, "should touch the buffer\n"); ok(ret_size == strlen(value), - "should return length without terminating 0 ret_size=%d\n", ret_size); + "should return length without terminating 0 ret_size=%ld\n", ret_size);
/* Remove that environment variable */ ret = SetEnvironmentVariableA(name_cased, NULL); @@ -137,24 +137,24 @@ static void test_GetSetEnvironmentVariableA(void) ret_size = GetEnvironmentVariableA(name, buf, lstrlenA(value) + 1); ok(lstrcmpA(buf, "foo") == 0, "should not touch the buffer\n"); ok(ret_size == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND, - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError());
/* Check behavior of SetEnvironmentVariableA(name, "") */ ret = SetEnvironmentVariableA(name, value); ok(ret == TRUE, - "unexpected error in SetEnvironmentVariableA, GetLastError=%d\n", + "unexpected error in SetEnvironmentVariableA, GetLastError=%ld\n", GetLastError());
lstrcpyA(buf, "foo"); ret_size = GetEnvironmentVariableA(name_cased, buf, lstrlenA(value) + 1); ok(lstrcmpA(buf, value) == 0, "should touch the buffer\n"); ok(ret_size == strlen(value), - "should return length without terminating 0 ret_size=%d\n", ret_size); + "should return length without terminating 0 ret_size=%ld\n", ret_size);
ret = SetEnvironmentVariableA(name_cased, ""); ok(ret == TRUE, - "should not fail with empty value but GetLastError=%d\n", GetLastError()); + "should not fail with empty value but GetLastError=%ld\n", GetLastError());
lstrcpyA(buf, "foo"); SetLastError(0xdeadbeef); @@ -162,36 +162,36 @@ static void test_GetSetEnvironmentVariableA(void) ok(ret_size == 0 && ((GetLastError() == 0xdeadbeef && lstrcmpA(buf, "") == 0) || (GetLastError() == ERROR_ENVVAR_NOT_FOUND)), - "%s should be set to "" (NT) or removed (Win9x) but ret_size=%d GetLastError=%d and buf=%s\n", + "%s should be set to "" (NT) or removed (Win9x) but ret_size=%ld GetLastError=%ld and buf=%s\n", name, ret_size, GetLastError(), buf);
SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(name, NULL, 0); ok(ret_size == 1 || broken(ret_size == 0), /* XP */ - "should return 1 for empty string but ret_size=%d GetLastError=%d\n", + "should return 1 for empty string but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError()); ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_MORE_DATA), /* XP */ - "should not fail with zero size but GetLastError=%d\n", GetLastError()); + "should not fail with zero size but GetLastError=%ld\n", GetLastError());
/* Test the limits */ SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(NULL, NULL, 0); ok(ret_size == 0 && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ENVVAR_NOT_FOUND), - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError());
SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(NULL, buf, lstrlenA(value) + 1); ok(ret_size == 0 && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ENVVAR_NOT_FOUND), - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError());
SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA("", buf, lstrlenA(value) + 1); ok(ret_size == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND, - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError()); }
@@ -214,17 +214,17 @@ static void test_GetSetEnvironmentVariableW(void) return; } ok(ret == TRUE, - "unexpected error in SetEnvironmentVariableW, GetLastError=%d\n", + "unexpected error in SetEnvironmentVariableW, GetLastError=%ld\n", GetLastError());
/* Try to retrieve the environment variable we just set */ SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableW(name, NULL, 0); ok(ret_size == lstrlenW(value) + 1, - "should return length with terminating 0 ret_size=%d\n", + "should return length with terminating 0 ret_size=%ld\n", ret_size); ok(GetLastError() == 0xdeadbeef, - "should not fail with zero size but GetLastError=%d\n", GetLastError()); + "should not fail with zero size but GetLastError=%ld\n", GetLastError());
lstrcpyW(buf, fooW); ret_size = GetEnvironmentVariableW(name, buf, lstrlenW(value)); @@ -233,19 +233,19 @@ static void test_GetSetEnvironmentVariableW(void) "Expected untouched or empty buffer, got "%s"\n", buf);
ok(ret_size == lstrlenW(value) + 1, - "should return length with terminating 0 ret_size=%d\n", ret_size); + "should return length with terminating 0 ret_size=%ld\n", ret_size);
lstrcpyW(buf, fooW); ret_size = GetEnvironmentVariableW(name, buf, lstrlenW(value) + 1); ok(lstrcmpW(buf, value) == 0, "should touch the buffer\n"); ok(ret_size == lstrlenW(value), - "should return length without terminating 0 ret_size=%d\n", ret_size); + "should return length without terminating 0 ret_size=%ld\n", ret_size);
lstrcpyW(buf, fooW); ret_size = GetEnvironmentVariableW(name_cased, buf, lstrlenW(value) + 1); ok(lstrcmpW(buf, value) == 0, "should touch the buffer\n"); ok(ret_size == lstrlenW(value), - "should return length without terminating 0 ret_size=%d\n", ret_size); + "should return length without terminating 0 ret_size=%ld\n", ret_size);
/* Remove that environment variable */ ret = SetEnvironmentVariableW(name_cased, NULL); @@ -256,23 +256,23 @@ static void test_GetSetEnvironmentVariableW(void) ret_size = GetEnvironmentVariableW(name, buf, lstrlenW(value) + 1); ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n"); ok(ret_size == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND, - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError());
/* Check behavior of SetEnvironmentVariableW(name, "") */ ret = SetEnvironmentVariableW(name, value); ok(ret == TRUE, - "unexpected error in SetEnvironmentVariableW, GetLastError=%d\n", + "unexpected error in SetEnvironmentVariableW, GetLastError=%ld\n", GetLastError());
lstrcpyW(buf, fooW); ret_size = GetEnvironmentVariableW(name, buf, lstrlenW(value) + 1); ok(lstrcmpW(buf, value) == 0, "should touch the buffer\n"); ok(ret_size == lstrlenW(value), - "should return length without terminating 0 ret_size=%d\n", ret_size); + "should return length without terminating 0 ret_size=%ld\n", ret_size);
ret = SetEnvironmentVariableW(name_cased, empty_strW); - ok(ret == TRUE, "should not fail with empty value but GetLastError=%d\n", GetLastError()); + ok(ret == TRUE, "should not fail with empty value but GetLastError=%ld\n", GetLastError());
lstrcpyW(buf, fooW); SetLastError(0xdeadbeef); @@ -280,7 +280,7 @@ static void test_GetSetEnvironmentVariableW(void) ok(ret_size == 0 && ((GetLastError() == 0xdeadbeef && lstrcmpW(buf, empty_strW) == 0) || (GetLastError() == ERROR_ENVVAR_NOT_FOUND)), - "should be set to "" (NT) or removed (Win9x) but ret_size=%d GetLastError=%d\n", + "should be set to "" (NT) or removed (Win9x) but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError()); ok(lstrcmpW(buf, empty_strW) == 0, "should copy an empty string\n");
@@ -288,17 +288,17 @@ static void test_GetSetEnvironmentVariableW(void) ret_size = GetEnvironmentVariableW(name, NULL, 0); ok(ret_size == 1 || broken(ret_size == 0), /* XP */ - "should return 1 for empty string but ret_size=%d GetLastError=%d\n", + "should return 1 for empty string but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError()); ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_MORE_DATA), /* XP */ - "should not fail with zero size but GetLastError=%d\n", GetLastError()); + "should not fail with zero size but GetLastError=%ld\n", GetLastError());
/* Test the limits */ SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableW(NULL, NULL, 0); ok(ret_size == 0 && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ENVVAR_NOT_FOUND), - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError());
if (0) /* Both tests crash on Vista */ @@ -306,13 +306,13 @@ static void test_GetSetEnvironmentVariableW(void) SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableW(NULL, buf, lstrlenW(value) + 1); ok(ret_size == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND, - "should not find variable but ret_size=%d GetLastError=%d\n", + "should not find variable but ret_size=%ld GetLastError=%ld\n", ret_size, GetLastError());
SetLastError(0xdeadbeef); ret = SetEnvironmentVariableW(NULL, NULL); ok(ret == FALSE && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ENVVAR_NOT_FOUND), - "should fail with NULL, NULL but ret=%d and GetLastError=%d\n", + "should fail with NULL, NULL but ret=%d and GetLastError=%ld\n", ret, GetLastError()); } } @@ -336,46 +336,46 @@ static void test_GetSetEnvironmentVariableAW(void)
/* Write W, read A */ ret = SetEnvironmentVariableW(nameW, valueW); - ok(ret == TRUE, "SetEnvironmentVariableW failed, last error %d\n", GetLastError()); + ok(ret == TRUE, "SetEnvironmentVariableW failed, last error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(name, NULL, 0); - todo_wine ok(ret_size == lstrlenA(value) + 1, "expected ret_size %d, got %d\n", lstrlenA(value) + 1, ret_size); - ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %d\n", GetLastError()); + todo_wine ok(ret_size == lstrlenA(value) + 1, "expected ret_size %d, got %ld\n", lstrlenA(value) + 1, ret_size); + ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %ld\n", GetLastError());
lstrcpyA(buf, "foo"); SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(name, buf, lstrlenA(value) + 1); todo_wine ok(lstrcmpA(buf, value) == 0, "expected %s, got %s\n", debugstr_a(value), debugstr_a(buf)); - todo_wine ok(ret_size == lstrlenA(value), "expected ret_size %d, got %d\n", lstrlenA(value), ret_size); - ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %d\n", GetLastError()); + todo_wine ok(ret_size == lstrlenA(value), "expected ret_size %d, got %ld\n", lstrlenA(value), ret_size); + ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %ld\n", GetLastError());
/* Write A, read A/W */ ret = SetEnvironmentVariableA(name, value); - ok(ret == TRUE, "SetEnvironmentVariableW failed, last error %d\n", GetLastError()); + ok(ret == TRUE, "SetEnvironmentVariableW failed, last error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(name, NULL, 0); - todo_wine ok(ret_size == lstrlenA(value) + 1, "expected ret_size %d, got %d\n", lstrlenA(value) + 1, ret_size); - ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %d\n", GetLastError()); + todo_wine ok(ret_size == lstrlenA(value) + 1, "expected ret_size %d, got %ld\n", lstrlenA(value) + 1, ret_size); + ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %ld\n", GetLastError());
lstrcpyA(buf, "foo"); SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableA(name, buf, lstrlenA(value) + 1); todo_wine ok(lstrcmpA(buf, value) == 0, "expected %s, got %s\n", debugstr_a(value), debugstr_a(buf)); - todo_wine ok(ret_size == lstrlenA(value), "expected ret_size %d, got %d\n", lstrlenA(value), ret_size); - ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %d\n", GetLastError()); + todo_wine ok(ret_size == lstrlenA(value), "expected ret_size %d, got %ld\n", lstrlenA(value), ret_size); + ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableW(nameW, NULL, 0); - ok(ret_size == lstrlenW(valueW) + 1, "expected ret_size %d, got %d\n", lstrlenW(valueW) + 1, ret_size); - ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %d\n", GetLastError()); + ok(ret_size == lstrlenW(valueW) + 1, "expected ret_size %d, got %ld\n", lstrlenW(valueW) + 1, ret_size); + ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %ld\n", GetLastError());
lstrcpyW(bufW, L"foo"); SetLastError(0xdeadbeef); ret_size = GetEnvironmentVariableW(nameW, bufW, lstrlenW(valueW) + 1); - ok(ret_size == lstrlenW(valueW), "expected ret_size %d, got %d\n", lstrlenW(valueW), ret_size); - ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %d\n", GetLastError()); + ok(ret_size == lstrlenW(valueW), "expected ret_size %d, got %ld\n", lstrlenW(valueW), ret_size); + ok(GetLastError() == 0xdeadbeef, "expected last error 0xdeadbeef, got %ld\n", GetLastError()); ok(lstrcmpW(bufW, valueW) == 0, "expected %s, got %s\n", debugstr_w(valueW), debugstr_w(bufW)); }
@@ -390,7 +390,7 @@ static void test_ExpandEnvironmentStringsA(void)
ret_size = ExpandEnvironmentStringsA(NULL, buf1, sizeof(buf1)); ok(ret_size == 1 || ret_size == 0 /* Win9x */ || ret_size == 2 /* NT4 */, - "ExpandEnvironmentStrings returned %d\n", ret_size); + "ExpandEnvironmentStrings returned %ld\n", ret_size);
/* Try to get the required buffer size 'the natural way' */ strcpy(buf, "%EnvVar%"); @@ -399,7 +399,7 @@ static void test_ExpandEnvironmentStringsA(void) ret_size == (strlen(value)+1)*2 || /* NT4 */ ret_size == strlen(value)+2 || /* win2k, XP, win2k3 */ ret_size == 0 /* Win95 */, - "ExpandEnvironmentStrings returned %d instead of %d, %d or %d\n", + "ExpandEnvironmentStrings returned %ld instead of %d, %d or %d\n", ret_size, lstrlenA(value)+1, lstrlenA(value)+2, 0);
/* Again, side-stepping the Win95 bug */ @@ -407,7 +407,7 @@ static void test_ExpandEnvironmentStringsA(void) /* v5.1.2600.2945 (XP SP2) returns len + 2 here! */ ok(ret_size == strlen(value)+1 || ret_size == strlen(value)+2 || ret_size == (strlen(value)+1)*2 /* NT4 */, - "ExpandEnvironmentStrings returned %d instead of %d\n", + "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size, lstrlenA(value)+1);
/* Try with a buffer that's too small */ @@ -415,7 +415,7 @@ static void test_ExpandEnvironmentStringsA(void) /* v5.1.2600.2945 (XP SP2) returns len + 2 here! */ ok(ret_size == strlen(value)+1 || ret_size == strlen(value)+2 || ret_size == (strlen(value)+1)*2 /* NT4 */, - "ExpandEnvironmentStrings returned %d instead of %d\n", + "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size, lstrlenA(value)+1);
/* Try with a buffer of just the right size */ @@ -423,7 +423,7 @@ static void test_ExpandEnvironmentStringsA(void) ret_size = ExpandEnvironmentStringsA(buf, buf1, ret_size); ok(ret_size == strlen(value)+1 || ret_size == strlen(value)+2 || ret_size == (strlen(value)+1)*2 /* NT4 */, - "ExpandEnvironmentStrings returned %d instead of %d\n", + "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size, lstrlenA(value)+1); ok(!strcmp(buf1, value), "ExpandEnvironmentStrings returned [%s]\n", buf1);
@@ -432,13 +432,13 @@ static void test_ExpandEnvironmentStringsA(void) ret_size = ExpandEnvironmentStringsA(buf, buf1, sizeof(buf1)); ok(ret_size == strlen(not_an_env_var)+1 || ret_size == (strlen(not_an_env_var)+1)*2 /* NT4 */, - "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, lstrlenA(not_an_env_var)+1); + "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size, lstrlenA(not_an_env_var)+1); ok(!strcmp(buf1, not_an_env_var), "ExpandEnvironmentStrings returned [%s]\n", buf1);
/* test a large destination size */ strcpy(buf, "12345"); ret_size = ExpandEnvironmentStringsA(buf, buf2, sizeof(buf2)); - ok(!strcmp(buf, buf2), "ExpandEnvironmentStrings failed %s vs %s. ret_size = %d\n", buf, buf2, ret_size); + ok(!strcmp(buf, buf2), "ExpandEnvironmentStrings failed %s vs %s. ret_size = %ld\n", buf, buf2, ret_size);
SetLastError(0xdeadbeef); ret_size1 = GetWindowsDirectoryA(buf1,256); @@ -446,7 +446,7 @@ static void test_ExpandEnvironmentStringsA(void) ret_size = ExpandEnvironmentStringsA("%SystemRoot%",buf,sizeof(buf)); if (ERROR_ENVVAR_NOT_FOUND != GetLastError()) { - ok(!strcmp(buf, buf1), "ExpandEnvironmentStrings failed %s vs %s. ret_size = %d\n", buf, buf1, ret_size); + ok(!strcmp(buf, buf1), "ExpandEnvironmentStrings failed %s vs %s. ret_size = %ld\n", buf, buf1, ret_size); }
/* Try with a variable that references another */ @@ -456,7 +456,7 @@ static void test_ExpandEnvironmentStringsA(void) ret_size = ExpandEnvironmentStringsA(buf, buf1, sizeof(buf1)); ok(ret_size == strlen(buf2)+1 || ret_size == (strlen(buf2)+1)*2 /* NT4 */, - "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, lstrlenA(buf2)+1); + "ExpandEnvironmentStrings returned %ld instead of %d\n", ret_size, lstrlenA(buf2)+1); ok(!strcmp(buf1, buf2), "ExpandEnvironmentStrings returned [%s]\n", buf1); SetEnvironmentVariableA("IndirectVar", NULL);
@@ -476,27 +476,27 @@ static void test_GetComputerName(void) SetLastError(0xdeadbeef); ret = GetComputerNameA((LPSTR)0xdeadbeef, &size); error = GetLastError(); - ok(!ret && error == ERROR_BUFFER_OVERFLOW, "GetComputerNameA should have failed with ERROR_BUFFER_OVERFLOW instead of %d\n", error); + ok(!ret && error == ERROR_BUFFER_OVERFLOW, "GetComputerNameA should have failed with ERROR_BUFFER_OVERFLOW instead of %ld\n", error);
/* Only Vista returns the computer name length as documented in the MSDN */ if (size != 0) { size++; /* nul terminating character */ name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0])); - ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(name != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = GetComputerNameA(name, &size); - ok(ret, "GetComputerNameA failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameA failed with error %ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, name); }
size = MAX_COMPUTERNAME_LENGTH + 1; name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0])); - ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(name != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = GetComputerNameA(name, &size); - ok(ret, "GetComputerNameA failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameA failed with error %ld\n", GetLastError()); trace("computer name is "%s"\n", name); name_len = strlen(name); - ok(size == name_len, "size should be same as length, name_len=%d, size=%d\n", name_len, size); + ok(size == name_len, "size should be same as length, name_len=%d, size=%ld\n", name_len, size); HeapFree(GetProcessHeap(), 0, name);
size = 0; @@ -507,12 +507,12 @@ static void test_GetComputerName(void) win_skip("GetComputerNameW is not implemented\n"); else { - ok(!ret && error == ERROR_BUFFER_OVERFLOW, "GetComputerNameW should have failed with ERROR_BUFFER_OVERFLOW instead of %d\n", error); + ok(!ret && error == ERROR_BUFFER_OVERFLOW, "GetComputerNameW should have failed with ERROR_BUFFER_OVERFLOW instead of %ld\n", error); size++; /* nul terminating character */ nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); - ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(nameW != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = GetComputerNameW(nameW, &size); - ok(ret, "GetComputerNameW failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameW failed with error %ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, nameW); } } @@ -537,7 +537,7 @@ static void test_GetComputerNameExA(void) ret = pGetComputerNameExA(ComputerNameDnsDomain, (LPSTR)0xdeadbeef, &size); error = GetLastError(); ok(ret == 0, "Expected 0, got %d\n", ret); - ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error); + ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %ld\n", error);
/* size is not set in win2k */ if (size == 0) @@ -546,9 +546,9 @@ static void test_GetComputerNameExA(void) size = MAX_COMP_NAME; } name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0])); - ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(name != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExA(ComputerNameDnsDomain, name, &size); - ok(ret, "GetComputerNameExA(ComputerNameDnsDomain) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExA(ComputerNameDnsDomain) failed with error %ld\n", GetLastError()); trace("domain name is "%s"\n", name); HeapFree(GetProcessHeap(), 0, name);
@@ -557,15 +557,15 @@ static void test_GetComputerNameExA(void) ret = pGetComputerNameExA(ComputerNameDnsFullyQualified, (LPSTR)0xdeadbeef, &size); error = GetLastError(); ok(ret == 0, "Expected 0, got %d\n", ret); - ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error); + ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %ld\n", error);
/* size is not set in win2k */ if (size == 0) size = MAX_COMP_NAME; name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0])); - ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(name != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExA(ComputerNameDnsFullyQualified, name, &size); - ok(ret, "GetComputerNameExA(ComputerNameDnsFullyQualified) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExA(ComputerNameDnsFullyQualified) failed with error %ld\n", GetLastError()); trace("fully qualified hostname is "%s"\n", name); HeapFree(GetProcessHeap(), 0, name);
@@ -574,15 +574,15 @@ static void test_GetComputerNameExA(void) ret = pGetComputerNameExA(ComputerNameDnsHostname, (LPSTR)0xdeadbeef, &size); error = GetLastError(); ok(ret == 0, "Expected 0, got %d\n", ret); - ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error); + ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %ld\n", error);
/* size is not set in win2k */ if (size == 0) size = MAX_COMP_NAME; name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0])); - ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(name != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExA(ComputerNameDnsHostname, name, &size); - ok(ret, "GetComputerNameExA(ComputerNameDnsHostname) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExA(ComputerNameDnsHostname) failed with error %ld\n", GetLastError()); trace("hostname is "%s"\n", name); HeapFree(GetProcessHeap(), 0, name);
@@ -591,22 +591,22 @@ static void test_GetComputerNameExA(void) ret = pGetComputerNameExA(ComputerNameNetBIOS, (LPSTR)0xdeadbeef, &size); error = GetLastError(); ok(ret == 0, "Expected 0, got %d\n", ret); - ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error); + ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %ld\n", error);
size = 0; SetLastError(0xdeadbeef); ret = pGetComputerNameExA(ComputerNameNetBIOS, NULL, &size); error = GetLastError(); ok(ret == 0, "Expected 0, got %d\n", ret); - ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error); + ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %ld\n", error);
/* size is not set in win2k */ if (size == 0) size = MAX_COMP_NAME; name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0])); - ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(name != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExA(ComputerNameNetBIOS, name, &size); - ok(ret, "GetComputerNameExA(ComputerNameNetBIOS) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExA(ComputerNameNetBIOS) failed with error %ld\n", GetLastError()); trace("NetBIOS name is "%s"\n", name); HeapFree(GetProcessHeap(), 0, name); } @@ -628,51 +628,51 @@ static void test_GetComputerNameExW(void) SetLastError(0xdeadbeef); ret = pGetComputerNameExW(ComputerNameDnsDomain, (LPWSTR)0xdeadbeef, &size); error = GetLastError(); - ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %d\n", error); + ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %ld\n", error); nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); - ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(nameW != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExW(ComputerNameDnsDomain, nameW, &size); - ok(ret, "GetComputerNameExW(ComputerNameDnsDomain) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExW(ComputerNameDnsDomain) failed with error %ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, nameW);
size = 0; SetLastError(0xdeadbeef); ret = pGetComputerNameExW(ComputerNameDnsFullyQualified, (LPWSTR)0xdeadbeef, &size); error = GetLastError(); - ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %d\n", error); + ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %ld\n", error); nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); - ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(nameW != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExW(ComputerNameDnsFullyQualified, nameW, &size); - ok(ret, "GetComputerNameExW(ComputerNameDnsFullyQualified) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExW(ComputerNameDnsFullyQualified) failed with error %ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, nameW);
size = 0; SetLastError(0xdeadbeef); ret = pGetComputerNameExW(ComputerNameDnsHostname, (LPWSTR)0xdeadbeef, &size); error = GetLastError(); - ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %d\n", error); + ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %ld\n", error); nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); - ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(nameW != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExW(ComputerNameDnsHostname, nameW, &size); - ok(ret, "GetComputerNameExW(ComputerNameDnsHostname) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExW(ComputerNameDnsHostname) failed with error %ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, nameW);
size = 0; SetLastError(0xdeadbeef); ret = pGetComputerNameExW(ComputerNameNetBIOS, (LPWSTR)0xdeadbeef, &size); error = GetLastError(); - ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %d\n", error); + ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %ld\n", error); nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); - ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ok(nameW != NULL, "HeapAlloc failed with error %ld\n", GetLastError()); ret = pGetComputerNameExW(ComputerNameNetBIOS, nameW, &size); - ok(ret, "GetComputerNameExW(ComputerNameNetBIOS) failed with error %d\n", GetLastError()); + ok(ret, "GetComputerNameExW(ComputerNameNetBIOS) failed with error %ld\n", GetLastError()); HeapFree(GetProcessHeap(), 0, nameW);
size = 0; SetLastError(0xdeadbeef); ret = pGetComputerNameExW(ComputerNameNetBIOS, NULL, &size); error = GetLastError(); - ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %d\n", error); + ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExW should have failed with ERROR_MORE_DATA instead of %ld\n", error); }
static void test_GetEnvironmentStringsW(void) @@ -697,13 +697,13 @@ static void check_env_var_(int line, const char *var, const char *value) DWORD size = GetEnvironmentVariableA(var, buffer, sizeof(buffer)); if (value) { - ok_(__FILE__, line)(size == strlen(value), "wrong size %u\n", size); + ok_(__FILE__, line)(size == strlen(value), "wrong size %lu\n", size); ok_(__FILE__, line)(!strcmp(buffer, value), "wrong value %s\n", debugstr_a(buffer)); } else { - ok_(__FILE__, line)(!size, "wrong size %u\n", size); - ok_(__FILE__, line)(GetLastError() == ERROR_ENVVAR_NOT_FOUND, "got error %u\n", GetLastError()); + ok_(__FILE__, line)(!size, "wrong size %lu\n", size); + ok_(__FILE__, line)(GetLastError() == ERROR_ENVVAR_NOT_FOUND, "got error %lu\n", GetLastError()); } } #define check_env_var(a, b) check_env_var_(__LINE__, a, b) @@ -722,15 +722,15 @@ static void test_SetEnvironmentStrings(void) }
ret = SetEnvironmentVariableA("testenv1", "heis"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = SetEnvironmentVariableA("testenv2", "dyo"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
old_env = GetEnvironmentStringsW();
memcpy(env, testenv, sizeof(testenv)); ret = pSetEnvironmentStringsW(env); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!memcmp(env, testenv, sizeof(testenv)), "input parameter should not be changed\n");
check_env_var("testenv1", "unus"); @@ -739,7 +739,7 @@ static void test_SetEnvironmentStrings(void) check_env_var("PATH", NULL);
ret = pSetEnvironmentStringsW(old_env); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
check_env_var("testenv1", "heis"); check_env_var("testenv2", "dyo"); @@ -752,24 +752,24 @@ static void test_SetEnvironmentStrings(void) SetLastError(0xdeadbeef); ret = pSetEnvironmentStringsW(env); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError());
copy_string(env, L"=unus\0"); SetLastError(0xdeadbeef); ret = pSetEnvironmentStringsW(env); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError());
copy_string(env, L"one=two=three four=five\0"); ret = pSetEnvironmentStringsW(env); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
check_env_var("one", "two=three four=five");
ret = pSetEnvironmentStringsW(old_env); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = FreeEnvironmentStringsW(old_env); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); }
START_TEST(environ) diff --git a/dlls/kernel32/tests/fiber.c b/dlls/kernel32/tests/fiber.c index 9ae45c2091b..509bbb51dbb 100644 --- a/dlls/kernel32/tests/fiber.c +++ b/dlls/kernel32/tests/fiber.c @@ -109,11 +109,11 @@ static VOID WINAPI FiberMainProc(LPVOID lpFiberParameter) SetLastError( 0xdeadbeef ); ret = pFlsGetValue(fls_index_to_set); ok(ret == NULL, "FlsGetValue returned %p, expected NULL\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error %lu.\n", GetLastError());
/* Set the FLS value */ bret = pFlsSetValue(fls_index_to_set, fls_value_to_set); - ok(bret, "FlsSetValue failed with error %u\n", GetLastError()); + ok(bret, "FlsSetValue failed with error %lu\n", GetLastError());
ok(!!teb->FlsSlots, "Got unexpected FlsSlots %p.\n", teb->FlsSlots);
@@ -121,7 +121,7 @@ static VOID WINAPI FiberMainProc(LPVOID lpFiberParameter) SetLastError( 0xdeadbeef ); ret = pFlsGetValue(fls_index_to_set); ok(ret == fls_value_to_set, "FlsGetValue returned %p, expected %p\n", ret, fls_value_to_set); - ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue error %lu\n", GetLastError()); } pSwitchToFiber(fibers[0]); } @@ -133,12 +133,12 @@ static void test_ConvertThreadToFiber(void) if (pConvertThreadToFiber) { fibers[0] = pConvertThreadToFiber(&testparam); - ok(fibers[0] != NULL, "ConvertThreadToFiber failed with error %u\n", GetLastError()); + ok(fibers[0] != NULL, "ConvertThreadToFiber failed with error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pConvertThreadToFiber(&testparam); ok(!ret, "Got non NULL ret.\n"); - ok(GetLastError() == ERROR_ALREADY_FIBER, "Got unexpected error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_FIBER, "Got unexpected error %lu.\n", GetLastError()); } else { @@ -153,12 +153,12 @@ static void test_ConvertThreadToFiberEx(void) if (pConvertThreadToFiberEx) { fibers[0] = pConvertThreadToFiberEx(&testparam, 0); - ok(fibers[0] != NULL, "ConvertThreadToFiberEx failed with error %u\n", GetLastError()); + ok(fibers[0] != NULL, "ConvertThreadToFiberEx failed with error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pConvertThreadToFiberEx(&testparam, 0); ok(!ret, "Got non NULL ret.\n"); - ok(GetLastError() == ERROR_ALREADY_FIBER, "Got unexpected error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_FIBER, "Got unexpected error %lu.\n", GetLastError()); } else { @@ -171,7 +171,7 @@ static void test_ConvertFiberToThread(void) if (pConvertFiberToThread) { BOOL ret = pConvertFiberToThread(); - ok(ret, "ConvertFiberToThread failed with error %u\n", GetLastError()); + ok(ret, "ConvertFiberToThread failed with error %lu\n", GetLastError()); } else { @@ -183,7 +183,7 @@ static void test_FiberHandling(void) { fiberCount = 0; fibers[0] = pCreateFiber(0,FiberMainProc,&testparam); - ok(fibers[0] != NULL, "CreateFiber failed with error %u\n", GetLastError()); + ok(fibers[0] != NULL, "CreateFiber failed with error %lu\n", GetLastError()); pDeleteFiber(fibers[0]);
test_ConvertThreadToFiber(); @@ -194,7 +194,7 @@ static void test_FiberHandling(void) test_ConvertThreadToFiber();
fibers[1] = pCreateFiber(0,FiberMainProc,&testparam); - ok(fibers[1] != NULL, "CreateFiber failed with error %u\n", GetLastError()); + ok(fibers[1] != NULL, "CreateFiber failed with error %lu\n", GetLastError());
pSwitchToFiber(fibers[1]); ok(fiberCount == 1, "Wrong fiber count: %d\n", fiberCount); @@ -203,7 +203,7 @@ static void test_FiberHandling(void) if (pCreateFiberEx) { fibers[1] = pCreateFiberEx(0,0,0,FiberMainProc,&testparam); - ok(fibers[1] != NULL, "CreateFiberEx failed with error %u\n", GetLastError()); + ok(fibers[1] != NULL, "CreateFiberEx failed with error %lu\n", GetLastError());
pSwitchToFiber(fibers[1]); ok(fiberCount == 2, "Wrong fiber count: %d\n", fiberCount); @@ -285,6 +285,7 @@ static void test_FiberLocalStorage(void) PEB *peb = teb->Peb; NTSTATUS status; HANDLE hthread; + ULONG index2; SIZE_T size; void* val; BOOL ret; @@ -300,7 +301,7 @@ static void test_FiberLocalStorage(void) if (pRtlFlsGetValue) { status = pRtlFlsGetValue(0, NULL); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status); } else { @@ -311,16 +312,16 @@ static void test_FiberLocalStorage(void) { fls_indices[i] = 0xdeadbeef; status = pRtlFlsAlloc(test_fls_callback, &fls_indices[i]); - ok(!status || status == STATUS_NO_MEMORY, "Got unexpected status %#x.\n", status); + ok(!status || status == STATUS_NO_MEMORY, "Got unexpected status %#lx.\n", status); if (status) { - ok(fls_indices[i] == 0xdeadbeef, "Got unexpected index %#x.\n", fls_indices[i]); + ok(fls_indices[i] == 0xdeadbeef, "Got unexpected index %#lx.\n", fls_indices[i]); break; } if (pRtlFlsSetValue) { status = pRtlFlsSetValue(fls_indices[i], (void *)(ULONG_PTR)(i + 1)); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); } } count = i; @@ -335,7 +336,7 @@ static void test_FiberLocalStorage(void) ok(pRtlFlsSetValue && pRtlFlsGetValue, "Missing RtlFlsGetValue / RtlFlsSetValue.\n"); ok(!peb->FlsBitmap, "Got unexpected FlsBitmap %p.\n", peb->FlsBitmap); ok(!peb->FlsListHead.Flink && !peb->FlsListHead.Blink, "Got nonzero FlsListHead.\n"); - ok(!peb->FlsHighIndex, "Got unexpected FlsHighIndex %u.\n", peb->FlsHighIndex); + ok(!peb->FlsHighIndex, "Got unexpected FlsHighIndex %lu.\n", peb->FlsHighIndex);
fls_list_head = fls_data->fls_list_entry.Flink;
@@ -345,13 +346,13 @@ static void test_FiberLocalStorage(void)
g_fls_data = CONTAINING_RECORD(fls_list_head, GLOBAL_FLS_DATA, fls_list_head);
- ok(g_fls_data->fls_high_index == 0xfef, "Got unexpected fls_high_index %#x.\n", g_fls_data->fls_high_index); + ok(g_fls_data->fls_high_index == 0xfef, "Got unexpected fls_high_index %#lx.\n", g_fls_data->fls_high_index);
for (i = 0; i < 8; ++i) { ok(!!g_fls_data->fls_callback_chunks[i], "Got zero fls_callback_chunks[%u].\n", i); ok(g_fls_data->fls_callback_chunks[i]->count == test_fls_chunk_size(i), - "Got unexpected g_fls_data->fls_callback_chunks[%u]->count %u.\n", + "Got unexpected g_fls_data->fls_callback_chunks[%u]->count %lu.\n", i, g_fls_data->fls_callback_chunks[i]->count);
size = HeapSize(GetProcessHeap(), 0, g_fls_data->fls_callback_chunks[i]); @@ -391,12 +392,12 @@ static void test_FiberLocalStorage(void) j = test_fls_chunk_index_from_index(fls_indices[0x10], &index); g_fls_data->fls_callback_chunks[j]->callbacks[index].callback = NULL; status = pRtlFlsFree(fls_indices[0x10]); - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status);
g_fls_data->fls_callback_chunks[j]->callbacks[index].callback = test_fls_callback; test_fls_callback_call_count = 0; status = pRtlFlsFree(fls_indices[0x10]); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); ok(test_fls_callback_call_count == 1, "Got unexpected callback call count %u.\n", test_fls_callback_call_count);
@@ -407,27 +408,27 @@ static void test_FiberLocalStorage(void) g_fls_data->fls_callback_chunks[j]->callbacks[index].callback);
fls_data->fls_data_chunks[j][index + 1] = (void *)(ULONG_PTR)0x28; - status = pRtlFlsAlloc(test_fls_callback, &i); - ok(!status, "Got unexpected status %#x.\n", status); - ok(i == fls_indices[0x10], "Got unexpected index %u.\n", i); + status = pRtlFlsAlloc(test_fls_callback, &index2); + ok(!status, "Got unexpected status %#lx.\n", status); + ok(index2 == fls_indices[0x10], "Got unexpected index %lu.\n", index2); ok(fls_data->fls_data_chunks[j][index + 1] == (void *)(ULONG_PTR)0x28, "Got unexpected data %p.\n", fls_data->fls_data_chunks[j][index + 1]);
status = pRtlFlsSetValue(i, (void *)(ULONG_PTR)0x11); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status);
teb->FlsSlots = NULL;
val = (void *)0xdeadbeef; status = pRtlFlsGetValue(fls_indices[1], &val); new_fls_data = teb->FlsSlots; - ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status); ok(val == (void *)0xdeadbeef, "Got unexpected val %p.\n", val); ok(!new_fls_data, "Got unexpected teb->FlsSlots %p.\n", new_fls_data);
status = pRtlFlsSetValue(fls_indices[1], (void *)(ULONG_PTR)0x28); new_fls_data = teb->FlsSlots; - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); ok(!!new_fls_data, "Got unexpected teb->FlsSlots %p.\n", new_fls_data);
entry_count = check_linked_list(fls_list_head, &fls_data->fls_list_entry, &index); @@ -438,7 +439,7 @@ static void test_FiberLocalStorage(void)
val = (void *)0xdeadbeef; status = pRtlFlsGetValue(fls_indices[2], &val); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); ok(!val, "Got unexpected val %p.\n", val);
@@ -467,7 +468,7 @@ static void test_FiberLocalStorage(void) hthread = CreateThread(NULL, 0, test_FiberLocalStorage_thread, NULL, 0, NULL); ok(!!hthread, "CreateThread failed.\n"); result = WaitForSingleObject(test_fiberlocalstorage_peb_locked_event, INFINITE); - ok(result == WAIT_OBJECT_0, "Got unexpected result %u.\n", result); + ok(result == WAIT_OBJECT_0, "Got unexpected result %lu.\n", result); teb->FlsSlots = NULL;
test_fls_callback_call_count = 0; @@ -525,17 +526,17 @@ static void test_FiberLocalStorage(void) if (pRtlFlsGetValue) { status = pRtlFlsGetValue(fls_indices[i], &val); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); ok(val == (void *)(ULONG_PTR)(i + 1), "Got unexpected val %p, i %u.\n", val, i); }
status = pRtlFlsFree(fls_indices[i]); - ok(!status, "Got unexpected status %#x, i %u.\n", status, i); + ok(!status, "Got unexpected status %#lx, i %u.\n", status, i); }
if (!peb->FlsCallback) { - ok(g_fls_data->fls_high_index == 0xfef, "Got unexpected fls_high_index %#x.\n", + ok(g_fls_data->fls_high_index == 0xfef, "Got unexpected fls_high_index %#lx.\n", g_fls_data->fls_high_index);
for (i = 0; i < 8; ++i) @@ -558,34 +559,34 @@ static void test_FiberLocalStorage(void) ret = pFlsFree( 127 ); ok( !ret, "freeing fls index 127 (unallocated) succeeded\n" ); ok( GetLastError() == ERROR_INVALID_PARAMETER, - "freeing fls index 127 (unallocated) wrong error %u\n", GetLastError() ); + "freeing fls index 127 (unallocated) wrong error %lu\n", GetLastError() );
val = pFlsGetValue( 127 ); ok( val == NULL, - "getting fls index 127 (unallocated) failed with error %u\n", GetLastError() ); + "getting fls index 127 (unallocated) failed with error %lu\n", GetLastError() );
if (pRtlFlsGetValue) { val = (void *)0xdeadbeef; status = pRtlFlsGetValue(127, &val); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( !val, "Got unexpected val %p.\n", val ); }
ret = pFlsSetValue( 127, (void*) 0x217 ); - ok( ret, "setting fls index 127 (unallocated) failed with error %u\n", GetLastError() ); + ok( ret, "setting fls index 127 (unallocated) failed with error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); val = pFlsGetValue( 127 ); ok( val == (void*) 0x217, "fls index 127 (unallocated) wrong value %p\n", val ); ok( GetLastError() == ERROR_SUCCESS, - "getting fls index 127 (unallocated) failed with error %u\n", GetLastError() ); + "getting fls index 127 (unallocated) failed with error %lu\n", GetLastError() );
if (pRtlFlsGetValue) { val = (void *)0xdeadbeef; status = pRtlFlsGetValue(127, &val); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( val == (void*)0x217, "Got unexpected val %p.\n", val ); }
@@ -596,86 +597,86 @@ static void test_FiberLocalStorage(void) ret = pFlsFree( 128 ); ok( !ret, "freeing fls index 128 (out of bounds) succeeded\n" ); ok( GetLastError() == ERROR_INVALID_PARAMETER, - "freeing fls index 128 (out of bounds) wrong error %u\n", GetLastError() ); + "freeing fls index 128 (out of bounds) wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pFlsSetValue( 128, (void*) 0x217 ); ok( ret || GetLastError() == ERROR_INVALID_PARAMETER, - "setting fls index 128 (out of bounds) wrong error %u\n", GetLastError() ); + "setting fls index 128 (out of bounds) wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); val = pFlsGetValue( 128 ); ok( GetLastError() == ERROR_INVALID_PARAMETER || val == (void *)0x217, - "getting fls index 128 (out of bounds) wrong error %u\n", GetLastError() ); + "getting fls index 128 (out of bounds) wrong error %lu\n", GetLastError() );
/* Test index 0 */ SetLastError( 0xdeadbeef ); val = pFlsGetValue( 0 ); ok( !val, "fls index 0 set to %p\n", val ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %lu\n", GetLastError() ); if (pRtlFlsGetValue) { val = (void *)0xdeadbeef; status = pRtlFlsGetValue(0, &val); - ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status ); ok( val == (void*)0xdeadbeef, "Got unexpected val %p.\n", val ); }
SetLastError( 0xdeadbeef ); ret = pFlsSetValue( 0, (void *)0xdeadbeef ); ok( !ret, "setting fls index 0 succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %lu\n", GetLastError() ); if (pRtlFlsSetValue) { status = pRtlFlsSetValue( 0, (void *)0xdeadbeef ); - ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status ); } SetLastError( 0xdeadbeef ); val = pFlsGetValue( 0 ); ok( !val, "fls index 0 wrong value %p\n", val ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %lu\n", GetLastError() );
/* Test creating an FLS index */ fls = pFlsAlloc( NULL ); ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed\n" ); ok( fls != 0, "fls index 0 allocated\n" ); val = pFlsGetValue( fls ); - ok( !val, "fls index %u wrong value %p\n", fls, val ); + ok( !val, "fls index %lu wrong value %p\n", fls, val ); SetLastError( 0xdeadbeef ); ret = pFlsSetValue( fls, (void *)0xdeadbeef ); - ok( ret, "setting fls index %u failed\n", fls ); - ok( GetLastError() == 0xdeadbeef, "setting fls index wrong error %u\n", GetLastError() ); + ok( ret, "setting fls index %lu failed\n", fls ); + ok( GetLastError() == 0xdeadbeef, "setting fls index wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); val = pFlsGetValue( fls ); - ok( val == (void *)0xdeadbeef, "fls index %u wrong value %p\n", fls, val ); + ok( val == (void *)0xdeadbeef, "fls index %lu wrong value %p\n", fls, val ); ok( GetLastError() == ERROR_SUCCESS, - "getting fls index %u failed with error %u\n", fls, GetLastError() ); + "getting fls index %lu failed with error %lu\n", fls, GetLastError() ); pFlsFree( fls );
/* Undefined behavior: verify the value is NULL after it the slot is freed */ SetLastError( 0xdeadbeef ); val = pFlsGetValue( fls ); - ok( val == NULL, "fls index %u wrong value %p\n", fls, val ); + ok( val == NULL, "fls index %lu wrong value %p\n", fls, val ); ok( GetLastError() == ERROR_SUCCESS, - "getting fls index %u failed with error %u\n", fls, GetLastError() ); + "getting fls index %lu failed with error %lu\n", fls, GetLastError() );
/* Undefined behavior: verify the value is settable after the slot is freed */ ret = pFlsSetValue( fls, (void *)0xdeadbabe ); - ok( ret, "setting fls index %u failed\n", fls ); + ok( ret, "setting fls index %lu failed\n", fls ); val = pFlsGetValue( fls ); - ok( val == (void *)0xdeadbabe, "fls index %u wrong value %p\n", fls, val ); + ok( val == (void *)0xdeadbabe, "fls index %lu wrong value %p\n", fls, val );
/* Try to create the same FLS index again, and verify that is initialized to NULL */ fls_2 = pFlsAlloc( NULL ); - ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %u\n", GetLastError() ); + ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %lu\n", GetLastError() ); /* If this fails it is not an API error, but the test will be inconclusive */ - ok( fls_2 == fls, "different FLS index allocated, was %u, now %u\n", fls, fls_2 ); + ok( fls_2 == fls, "different FLS index allocated, was %lu, now %lu\n", fls, fls_2 );
SetLastError( 0xdeadbeef ); val = pFlsGetValue( fls_2 ); - ok( val == NULL || val == (void *)0xdeadbabe, "fls index %u wrong value %p\n", fls, val ); + ok( val == NULL || val == (void *)0xdeadbabe, "fls index %lu wrong value %p\n", fls, val ); ok( GetLastError() == ERROR_SUCCESS, - "getting fls index %u failed with error %u\n", fls_2, GetLastError() ); + "getting fls index %lu failed with error %lu\n", fls_2, GetLastError() ); pFlsFree( fls_2 ); }
@@ -694,30 +695,30 @@ static void test_FiberLocalStorageCallback(PFLS_CALLBACK_FUNCTION cbfunc) /* Test that the callback is executed */ cbCount = 0; fls = pFlsAlloc( cbfunc ); - ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %u\n", GetLastError() ); + ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %lu\n", GetLastError() );
val = (void*) 0x1587; fls_value_to_set = val; ret = pFlsSetValue( fls, val ); - ok(ret, "FlsSetValue failed with error %u\n", GetLastError() ); + ok(ret, "FlsSetValue failed with error %lu\n", GetLastError() );
val2 = pFlsGetValue( fls ); ok(val == val2, "FlsGetValue returned %p, expected %p\n", val2, val);
ret = pFlsFree( fls ); - ok(ret, "FlsFree failed with error %u\n", GetLastError() ); + ok(ret, "FlsFree failed with error %lu\n", GetLastError() ); ok( cbCount == 1, "Wrong callback count: %d\n", cbCount );
/* Test that callback is not executed if value is NULL */ cbCount = 0; fls = pFlsAlloc( cbfunc ); - ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %u\n", GetLastError() ); + ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %lu\n", GetLastError() );
ret = pFlsSetValue( fls, NULL ); - ok( ret, "FlsSetValue failed with error %u\n", GetLastError() ); + ok( ret, "FlsSetValue failed with error %lu\n", GetLastError() );
pFlsFree( fls ); - ok( ret, "FlsFree failed with error %u\n", GetLastError() ); + ok( ret, "FlsFree failed with error %lu\n", GetLastError() ); ok( cbCount == 0, "Wrong callback count: %d\n", cbCount ); }
@@ -734,7 +735,7 @@ static void test_FiberLocalStorageWithFibers(PFLS_CALLBACK_FUNCTION cbfunc) }
fls_index_to_set = pFlsAlloc(cbfunc); - ok(fls_index_to_set != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %u\n", GetLastError()); + ok(fls_index_to_set != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %lu\n", GetLastError());
test_ConvertThreadToFiber();
@@ -742,8 +743,8 @@ static void test_FiberLocalStorageWithFibers(PFLS_CALLBACK_FUNCTION cbfunc) cbCount = 0; fibers[1] = pCreateFiber(0,FiberMainProc,&testparam); fibers[2] = pCreateFiber(0,FiberMainProc,&testparam); - ok(fibers[1] != NULL, "CreateFiber failed with error %u\n", GetLastError()); - ok(fibers[2] != NULL, "CreateFiber failed with error %u\n", GetLastError()); + ok(fibers[1] != NULL, "CreateFiber failed with error %lu\n", GetLastError()); + ok(fibers[2] != NULL, "CreateFiber failed with error %lu\n", GetLastError()); ok(fiberCount == 0, "Wrong fiber count: %d\n", fiberCount); ok(cbCount == 0, "Wrong callback count: %d\n", cbCount);
@@ -840,7 +841,7 @@ static void test_fls_exit_deadlock(void) winetest_get_mainargs(&argv); sprintf(cmdline, "%s %s fls_exit_deadlock", argv[0], argv[1]); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "failed to create child, error %u\n", GetLastError()); + ok(ret, "failed to create child, error %lu\n", GetLastError()); ret = WaitForSingleObject(pi.hProcess, 1000); ok(!ret, "wait failed\n"); CloseHandle(pi.hProcess); diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index f16a092a4df..1c4cdfea1b4 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -131,7 +131,7 @@ static void test__hread( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -141,7 +141,7 @@ static void test__hread( void )
filehandle = _lopen( filename, OF_READ );
- ok( HFILE_ERROR != filehandle, "couldn't open file "%s" again (err=%d)\n", filename, GetLastError( ) ); + ok( HFILE_ERROR != filehandle, "couldn't open file "%s" again (err=%ld)\n", filename, GetLastError( ) );
bytes_read = _hread( filehandle, buffer, 2 * strlen( sillytext ) );
@@ -160,7 +160,7 @@ static void test__hread( void ) ok( HFILE_ERROR != _lclose( filehandle ), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret != 0, "DeleteFile failed (%ld)\n", GetLastError( ) ); }
@@ -180,7 +180,7 @@ static void test__hwrite( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -245,7 +245,7 @@ static void test__hwrite( void ) ok( HFILE_ERROR != _lclose( filehandle ), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret != 0, "DeleteFile failed (%ld)\n", GetLastError( ) );
LocalFree( contents ); } @@ -259,7 +259,7 @@ static void test__lclose( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -268,7 +268,7 @@ static void test__lclose( void ) ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret != 0, "DeleteFile failed (%ld)\n", GetLastError( ) ); }
/* helper function for test__lcreat */ @@ -282,7 +282,7 @@ static void get_nt_pathW( const char *name, UNICODE_STRING *nameW ) pRtlInitAnsiString( &str, name );
status = pRtlAnsiStringToUnicodeString( &strW, &str, TRUE ); - ok( !status, "RtlAnsiStringToUnicodeString failed with %08x\n", status ); + ok( !status, "RtlAnsiStringToUnicodeString failed with %08lx\n", status );
ret = pRtlDosPathNameToNtPathName_U( strW.Buffer, nameW, NULL, NULL ); ok( ret, "RtlDosPathNameToNtPathName_U failed\n" ); @@ -307,7 +307,7 @@ static void test__lcreat( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -324,10 +324,10 @@ static void test__lcreat( void ) FindClose( find );
ret = DeleteFileA(filename); - ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError()); + ok( ret != 0, "DeleteFile failed (%ld)\n", GetLastError());
filehandle = _lcreat( filename, 1 ); /* readonly */ - ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%d)\n", filename, GetLastError( ) ); + ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%ld)\n", filename, GetLastError( ) );
ok( HFILE_ERROR != _hwrite( filehandle, sillytext, strlen( sillytext ) ), "_hwrite shouldn't be able to write never the less\n" );
@@ -339,14 +339,14 @@ static void test__lcreat( void )
SetLastError( 0xdeadbeef ); ok( 0 == DeleteFileA( filename ), "shouldn't be able to delete a readonly file\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError() );
ok( SetFileAttributesA(filename, FILE_ATTRIBUTE_NORMAL ) != 0, "couldn't change attributes on file\n" );
ok( DeleteFileA( filename ) != 0, "now it should be possible to delete the file!\n" );
filehandle = _lcreat( filename, 1 ); /* readonly */ - ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%d)\n", filename, GetLastError() ); + ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%ld)\n", filename, GetLastError() ); ok( HFILE_ERROR != _hwrite( filehandle, sillytext, strlen(sillytext) ), "_hwrite shouldn't be able to write never the less\n" ); ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" ); @@ -366,24 +366,24 @@ static void test__lcreat( void ) status = pNtCreateFile( &file, GENERIC_READ | GENERIC_WRITE | DELETE, &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 ); - ok( status == STATUS_ACCESS_DENIED, "expected STATUS_ACCESS_DENIED, got %08x\n", status ); + ok( status == STATUS_ACCESS_DENIED, "expected STATUS_ACCESS_DENIED, got %08lx\n", status ); ok( GetFileAttributesA( filename ) != INVALID_FILE_ATTRIBUTES, "file was deleted\n" );
status = pNtCreateFile( &file, DELETE, &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 ); - ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08x\n", status ); + ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08lx\n", status );
status = pNtCreateFile( &file, DELETE, &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_DIRECTORY_FILE, NULL, 0 ); - ok( status == STATUS_NOT_A_DIRECTORY, "expected STATUS_NOT_A_DIRECTORY, got %08x\n", status ); + ok( status == STATUS_NOT_A_DIRECTORY, "expected STATUS_NOT_A_DIRECTORY, got %08lx\n", status );
status = pNtCreateFile( &file, DELETE, &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN_IF, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 ); todo_wine - ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08x\n", status ); + ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08lx\n", status ); if (!status) CloseHandle( file );
pRtlFreeUnicodeString( &filenameW ); @@ -396,7 +396,7 @@ static void test__lcreat( void ) ok( DeleteFileA( filename ) != 0, "now it should be possible to delete the file\n" );
filehandle = _lcreat( filename, 2 ); - ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%d)\n", filename, GetLastError( ) ); + ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%ld)\n", filename, GetLastError( ) );
ok( HFILE_ERROR != _hwrite( filehandle, sillytext, strlen( sillytext ) ), "_hwrite complains\n" );
@@ -411,10 +411,10 @@ static void test__lcreat( void ) FindClose( find );
ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) );
filehandle = _lcreat( filename, 4 ); /* SYSTEM file */ - ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%d)\n", filename, GetLastError( ) ); + ok( HFILE_ERROR != filehandle, "couldn't create file "%s" (err=%ld)\n", filename, GetLastError( ) );
ok( HFILE_ERROR != _hwrite( filehandle, sillytext, strlen( sillytext ) ), "_hwrite complains\n" );
@@ -429,7 +429,7 @@ static void test__lcreat( void ) FindClose( find );
ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) );
filehandle=_lcreat (slashname, 0); /* illegal name */ if (HFILE_ERROR==filehandle) { @@ -442,16 +442,16 @@ static void test__lcreat( void ) if (INVALID_HANDLE_VALUE!=find) { ret = FindClose (find); - ok (0 != ret, "FindClose complains (%d)\n", GetLastError ()); + ok (0 != ret, "FindClose complains (%ld)\n", GetLastError ()); slashname[strlen(slashname)-1]=0; ok (!strcmp (slashname, search_results.cFileName), "found unexpected name "%s"\n", search_results.cFileName); ok (FILE_ATTRIBUTE_ARCHIVE==search_results.dwFileAttributes, - "attributes of file "%s" are 0x%04x\n", search_results.cFileName, + "attributes of file "%s" are 0x%04lx\n", search_results.cFileName, search_results.dwFileAttributes); } ret = DeleteFileA( slashname ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) ); }
filehandle=_lcreat (filename, 8); /* illegal attribute */ @@ -469,17 +469,17 @@ static void test__lcreat( void ) else name = filename;
ret = FindClose(find); - ok ( 0 != ret, "FindClose complains (%d)\n", GetLastError ()); + ok ( 0 != ret, "FindClose complains (%ld)\n", GetLastError ()); ok (!strcmp (name, search_results.cFileName), "expected "%s", got "%s"\n", name, search_results.cFileName); search_results.dwFileAttributes &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; search_results.dwFileAttributes &= ~FILE_ATTRIBUTE_COMPRESSED; ok (FILE_ATTRIBUTE_ARCHIVE==search_results.dwFileAttributes, - "attributes of file "%s" are 0x%04x\n", search_results.cFileName, + "attributes of file "%s" are 0x%04lx\n", search_results.cFileName, search_results.dwFileAttributes); } ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) ); } }
@@ -495,7 +495,7 @@ static void test__llseek( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -518,7 +518,7 @@ static void test__llseek( void ) ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) ); }
@@ -532,7 +532,7 @@ static void test__llopen( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -557,7 +557,7 @@ static void test__llopen( void ) ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) ); /* TODO - add tests for the SHARE modes - use two processes to pull this one off */ }
@@ -574,7 +574,7 @@ static void test__lread( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -584,7 +584,7 @@ static void test__lread( void )
filehandle = _lopen( filename, OF_READ );
- ok( HFILE_ERROR != filehandle, "couldn't open file "%s" again (err=%d)\n", filename, GetLastError()); + ok( HFILE_ERROR != filehandle, "couldn't open file "%s" again (err=%ld)\n", filename, GetLastError());
bytes_read = _lread( filehandle, buffer, 2 * strlen( sillytext ) );
@@ -603,7 +603,7 @@ static void test__lread( void ) ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) ); }
@@ -623,7 +623,7 @@ static void test__lwrite( void ) filehandle = _lcreat( filename, 0 ); if (filehandle == HFILE_ERROR) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; }
@@ -688,7 +688,7 @@ static void test__lwrite( void ) ok( HFILE_ERROR != _lclose( filehandle ), "_lclose complains\n" );
ret = DeleteFileA( filename ); - ok( ret, "DeleteFile failed (%d)\n", GetLastError( ) ); + ok( ret, "DeleteFile failed (%ld)\n", GetLastError( ) );
LocalFree( contents ); } @@ -706,147 +706,147 @@ static void test_CopyFileA(void) BOOL retok;
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, source); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
/* copying a file to itself must fail */ retok = CopyFileA(source, source, FALSE); ok( !retok && (GetLastError() == ERROR_SHARING_VIOLATION || broken(GetLastError() == ERROR_FILE_EXISTS) /* Win 9x */), - "copying a file to itself didn't fail (ret=%d, err=%d)\n", retok, GetLastError()); + "copying a file to itself didn't fail (ret=%d, err=%ld)\n", retok, GetLastError());
/* make the source have not zero size */ hfile = CreateFileA(source, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); retok = WriteFile(hfile, prefix, sizeof(prefix), &ret, NULL ); ok( retok && ret == sizeof(prefix), - "WriteFile error %d\n", GetLastError()); + "WriteFile error %ld\n", GetLastError()); ok(GetFileSize(hfile, NULL) == sizeof(prefix), "source file has wrong size\n"); /* get the file time and change it to prove the difference */ ret = GetFileTime(hfile, NULL, NULL, &ft1); - ok( ret, "GetFileTime error %d\n", GetLastError()); + ok( ret, "GetFileTime error %ld\n", GetLastError()); ft1.dwLowDateTime -= 600000000; /* 60 second */ ret = SetFileTime(hfile, NULL, NULL, &ft1); - ok( ret, "SetFileTime error %d\n", GetLastError()); + ok( ret, "SetFileTime error %ld\n", GetLastError()); GetFileTime(hfile, NULL, NULL, &ft1); /* get the actual time back */ CloseHandle(hfile);
ret = GetTempFileNameA(temp_path, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CopyFileA(source, dest, TRUE); ok(!ret && GetLastError() == ERROR_FILE_EXISTS, - "CopyFileA: unexpected error %d\n", GetLastError()); + "CopyFileA: unexpected error %ld\n", GetLastError());
ret = CopyFileA(source, dest, FALSE); - ok(ret, "CopyFileA: error %d\n", GetLastError()); + ok(ret, "CopyFileA: error %ld\n", GetLastError());
/* NULL checks */ retok = CopyFileA(NULL, dest, TRUE); ok(!retok && GetLastError() == ERROR_PATH_NOT_FOUND, - "CopyFileA: ret = %d, unexpected error %d\n", retok, GetLastError()); + "CopyFileA: ret = %d, unexpected error %ld\n", retok, GetLastError()); retok = CopyFileA(source, NULL, TRUE); ok(!retok && GetLastError() == ERROR_PATH_NOT_FOUND, - "CopyFileA: ret = %d, unexpected error %d\n", retok, GetLastError()); + "CopyFileA: ret = %d, unexpected error %ld\n", retok, GetLastError());
/* copying from a read-locked source fails */ hfile = CreateFileA(source, GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %ld\n", GetLastError()); retok = CopyFileA(source, dest, FALSE); ok(!retok && GetLastError() == ERROR_SHARING_VIOLATION, "copying from a read-locked file succeeded when it shouldn't have\n"); /* in addition, the source is opened before the destination */ retok = CopyFileA("25f99d3b-4ba4-4f66-88f5-2906886993cc", dest, FALSE); ok(!retok && GetLastError() == ERROR_FILE_NOT_FOUND, - "copying from a file that doesn't exist failed in an unexpected way (ret=%d, err=%d)\n", retok, GetLastError()); + "copying from a file that doesn't exist failed in an unexpected way (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile);
/* copying from a r+w opened, r shared source succeeds */ hfile = CreateFileA(source, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %ld\n", GetLastError()); retok = CopyFileA(source, dest, FALSE); ok(retok, - "copying from an r+w opened and r shared file failed (ret=%d, err=%d)\n", retok, GetLastError()); + "copying from an r+w opened and r shared file failed (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile);
/* copying from a delete-locked source mostly succeeds */ hfile = CreateFileA(source, DELETE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %ld\n", GetLastError()); retok = CopyFileA(source, dest, FALSE); ok(retok || broken(!retok && GetLastError() == ERROR_SHARING_VIOLATION) /* NT, 2000, XP */, - "copying from a delete-locked file failed (ret=%d, err=%d)\n", retok, GetLastError()); + "copying from a delete-locked file failed (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile);
/* copying to a write-locked destination fails */ hfile = CreateFileA(dest, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError()); retok = CopyFileA(source, dest, FALSE); ok(!retok && GetLastError() == ERROR_SHARING_VIOLATION, - "copying to a write-locked file didn't fail (ret=%d, err=%d)\n", retok, GetLastError()); + "copying to a write-locked file didn't fail (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile);
/* copying to a r+w opened, w shared destination mostly succeeds */ hfile = CreateFileA(dest, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError()); retok = CopyFileA(source, dest, FALSE); ok(retok || broken(!retok && GetLastError() == ERROR_SHARING_VIOLATION) /* Win 9x */, - "copying to a r+w opened and w shared file failed (ret=%d, err=%d)\n", retok, GetLastError()); + "copying to a r+w opened and w shared file failed (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile);
/* copying to a delete-locked destination fails, even when the destination is delete-shared */ hfile = CreateFileA(dest, DELETE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_INVALID_PARAMETER) /* Win 9x */, - "failed to open destination file, error %d\n", GetLastError()); + "failed to open destination file, error %ld\n", GetLastError()); if (hfile != INVALID_HANDLE_VALUE) { retok = CopyFileA(source, dest, FALSE); ok(!retok && GetLastError() == ERROR_SHARING_VIOLATION, - "copying to a delete-locked shared file didn't fail (ret=%d, err=%d)\n", retok, GetLastError()); + "copying to a delete-locked shared file didn't fail (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile); }
/* copy to a file that's opened the way Wine opens the source */ hfile = CreateFileA(dest, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError()); retok = CopyFileA(source, dest, FALSE); ok(retok || broken(GetLastError() == ERROR_SHARING_VIOLATION) /* Win 9x */, - "copying to a file opened the way Wine opens the source failed (ret=%d, err=%d)\n", retok, GetLastError()); + "copying to a file opened the way Wine opens the source failed (ret=%d, err=%ld)\n", retok, GetLastError()); CloseHandle(hfile);
/* make sure that destination has correct size */ hfile = CreateFileA(dest, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file\n"); ret = GetFileSize(hfile, NULL); - ok(ret == sizeof(prefix), "destination file has wrong size %d\n", ret); + ok(ret == sizeof(prefix), "destination file has wrong size %ld\n", ret);
/* make sure that destination has the same filetime */ ret = GetFileTime(hfile, NULL, NULL, &ft2); - ok( ret, "GetFileTime error %d\n", GetLastError()); + ok( ret, "GetFileTime error %ld\n", GetLastError()); ok(CompareFileTime(&ft1, &ft2) == 0, "destination file has wrong filetime\n");
SetLastError(0xdeadbeef); ret = CopyFileA(source, dest, FALSE); ok(!ret && GetLastError() == ERROR_SHARING_VIOLATION, - "CopyFileA: ret = %d, unexpected error %d\n", ret, GetLastError()); + "CopyFileA: ret = %ld, unexpected error %ld\n", ret, GetLastError());
/* make sure that destination still has correct size */ ret = GetFileSize(hfile, NULL); - ok(ret == sizeof(prefix), "destination file has wrong size %d\n", ret); + ok(ret == sizeof(prefix), "destination file has wrong size %ld\n", ret); retok = ReadFile(hfile, buf, sizeof(buf), &ret, NULL); ok( retok && ret == sizeof(prefix), - "ReadFile: error %d\n", GetLastError()); + "ReadFile: error %ld\n", GetLastError()); ok(!memcmp(prefix, buf, sizeof(prefix)), "buffer contents mismatch\n");
/* check error on copying over a mapped file that was opened with FILE_SHARE_READ */ hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); - ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + ok(hmapfile != NULL, "CreateFileMapping: error %ld\n", GetLastError());
ret = CopyFileA(source, dest, FALSE); ok(!ret && GetLastError() == ERROR_SHARING_VIOLATION, - "CopyFileA with mapped dest file: expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + "CopyFileA with mapped dest file: expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
CloseHandle(hmapfile); CloseHandle(hfile); @@ -856,21 +856,21 @@ static void test_CopyFileA(void)
/* check error on copying over a mapped file that was opened with FILE_SHARE_WRITE */ hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); - ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + ok(hmapfile != NULL, "CreateFileMapping: error %ld\n", GetLastError());
ret = CopyFileA(source, dest, FALSE); ok(!ret, "CopyFileA: expected failure\n"); ok(GetLastError() == ERROR_USER_MAPPED_FILE || broken(GetLastError() == ERROR_SHARING_VIOLATION), /* Win9x */ - "CopyFileA with mapped dest file: expected ERROR_USER_MAPPED_FILE, got %d\n", GetLastError()); + "CopyFileA with mapped dest file: expected ERROR_USER_MAPPED_FILE, got %ld\n", GetLastError());
CloseHandle(hmapfile); CloseHandle(hfile);
ret = DeleteFileA(source); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); ret = DeleteFileA(dest); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); }
static void test_CopyFileW(void) @@ -886,26 +886,26 @@ static void test_CopyFileW(void) win_skip("GetTempPathW is not available\n"); return; } - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, source); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
ret = CopyFileW(source, dest, TRUE); ok(!ret && GetLastError() == ERROR_FILE_EXISTS, - "CopyFileW: unexpected error %d\n", GetLastError()); + "CopyFileW: unexpected error %ld\n", GetLastError());
ret = CopyFileW(source, dest, FALSE); - ok(ret, "CopyFileW: error %d\n", GetLastError()); + ok(ret, "CopyFileW: error %ld\n", GetLastError());
ret = DeleteFileW(source); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError()); ret = DeleteFileW(dest); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError()); }
static void test_CopyFile2(void) @@ -927,14 +927,14 @@ static void test_CopyFile2(void) }
ret = GetTempPathW(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, source); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
/* fail if exists */ memset(¶ms, 0, sizeof(params)); @@ -943,15 +943,15 @@ static void test_CopyFile2(void)
SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_FILE_EXISTS, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_FILE_EXISTS, "CopyFile2: last error %ld\n", GetLastError());
/* don't fail if exists */ params.dwSize = sizeof(params); params.dwCopyFlags = 0;
hr = pCopyFile2(source, dest, ¶ms); - ok(hr == S_OK, "CopyFile2: error 0x%08x\n", hr); + ok(hr == S_OK, "CopyFile2: error 0x%08lx\n", hr);
/* copying a file to itself must fail */ params.dwSize = sizeof(params); @@ -959,160 +959,160 @@ static void test_CopyFile2(void)
SetLastError(0xdeadbeef); hr = pCopyFile2(source, source, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: copying a file to itself didn't fail, 0x%08x\n", hr); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: copying a file to itself didn't fail, 0x%08lx\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %ld\n", GetLastError());
/* make the source have not zero size */ hfile = CreateFileW(source, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); ret = WriteFile(hfile, prefix, sizeof(prefix), &len, NULL ); - ok(ret && len == sizeof(prefix), "WriteFile error %d\n", GetLastError()); + ok(ret && len == sizeof(prefix), "WriteFile error %ld\n", GetLastError()); ok(GetFileSize(hfile, NULL) == sizeof(prefix), "source file has wrong size\n");
/* get the file time and change it to prove the difference */ ret = GetFileTime(hfile, NULL, NULL, &ft1); - ok(ret, "GetFileTime error %d\n", GetLastError()); + ok(ret, "GetFileTime error %ld\n", GetLastError()); ft1.dwLowDateTime -= 600000000; /* 60 second */ ret = SetFileTime(hfile, NULL, NULL, &ft1); - ok(ret, "SetFileTime error %d\n", GetLastError()); + ok(ret, "SetFileTime error %ld\n", GetLastError()); GetFileTime(hfile, NULL, NULL, &ft1); /* get the actual time back */ CloseHandle(hfile);
ret = GetTempFileNameW(temp_path, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = COPY_FILE_FAIL_IF_EXISTS;
SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_FILE_EXISTS, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_FILE_EXISTS, "CopyFile2: last error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; hr = pCopyFile2(source, dest, ¶ms); - ok(ret, "CopyFile2: error 0x%08x\n", hr); + ok(ret, "CopyFile2: error 0x%08lx\n", hr);
/* copying from a read-locked source fails */ hfile = CreateFileW(source, GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %ld\n", GetLastError());
/* in addition, the source is opened before the destination */ params.dwSize = sizeof(params); params.dwCopyFlags = 0; SetLastError(0xdeadbeef); hr = pCopyFile2(doesntexistW, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "CopyFile2: last error %ld\n", GetLastError()); CloseHandle(hfile);
/* copying from a r+w opened, r shared source succeeds */ hfile = CreateFileW(source, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; hr = pCopyFile2(source, dest, ¶ms); - ok(hr == S_OK, "failed 0x%08x\n", hr); + ok(hr == S_OK, "failed 0x%08lx\n", hr); CloseHandle(hfile);
/* copying from a delete-locked source mostly succeeds */ hfile = CreateFileW(source, DELETE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; hr = pCopyFile2(source, dest, ¶ms); - ok(hr == S_OK, "failed 0x%08x\n", hr); + ok(hr == S_OK, "failed 0x%08lx\n", hr); CloseHandle(hfile);
/* copying to a write-locked destination fails */ hfile = CreateFileW(dest, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, FALSE); - ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %ld\n", GetLastError()); CloseHandle(hfile);
/* copying to a r+w opened, w shared destination mostly succeeds */ hfile = CreateFileW(dest, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; hr = pCopyFile2(source, dest, FALSE); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); CloseHandle(hfile);
/* copying to a delete-locked destination fails, even when the destination is delete-shared */ hfile = CreateFileW(dest, DELETE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %ld\n", GetLastError()); CloseHandle(hfile);
/* copy to a file that's opened the way Wine opens the source */ hfile = CreateFileW(dest, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; hr = pCopyFile2(source, dest, ¶ms); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08lx\n", hr); CloseHandle(hfile);
/* make sure that destination has correct size */ hfile = CreateFileW(dest, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file\n"); ret = GetFileSize(hfile, NULL); - ok(ret == sizeof(prefix), "destination file has wrong size %d\n", ret); + ok(ret == sizeof(prefix), "destination file has wrong size %ld\n", ret);
/* make sure that destination has the same filetime */ ret = GetFileTime(hfile, NULL, NULL, &ft2); - ok(ret, "GetFileTime error %d\n", GetLastError()); + ok(ret, "GetFileTime error %ld\n", GetLastError()); ok(CompareFileTime(&ft1, &ft2) == 0, "destination file has wrong filetime\n");
params.dwSize = sizeof(params); params.dwCopyFlags = 0; SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %ld\n", GetLastError());
/* make sure that destination still has correct size */ ret = GetFileSize(hfile, NULL); - ok(ret == sizeof(prefix), "destination file has wrong size %d\n", ret); + ok(ret == sizeof(prefix), "destination file has wrong size %ld\n", ret); ret = ReadFile(hfile, buf, sizeof(buf), &len, NULL); - ok(ret && len == sizeof(prefix), "ReadFile: error %d\n", GetLastError()); + ok(ret && len == sizeof(prefix), "ReadFile: error %ld\n", GetLastError()); ok(!memcmp(prefix, buf, sizeof(prefix)), "buffer contents mismatch\n");
/* check error on copying over a mapped file that was opened with FILE_SHARE_READ */ hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); - ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + ok(hmapfile != NULL, "CreateFileMapping: error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; SetLastError(0xdeadbeef); hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %ld\n", GetLastError());
CloseHandle(hmapfile); CloseHandle(hfile); @@ -1122,13 +1122,13 @@ static void test_CopyFile2(void)
/* check error on copying over a mapped file that was opened with FILE_SHARE_WRITE */ hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); - ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + ok(hmapfile != NULL, "CreateFileMapping: error %ld\n", GetLastError());
params.dwSize = sizeof(params); params.dwCopyFlags = 0; hr = pCopyFile2(source, dest, ¶ms); - ok(hr == HRESULT_FROM_WIN32(ERROR_USER_MAPPED_FILE), "CopyFile2: unexpected error 0x%08x\n", hr); - ok(GetLastError() == ERROR_USER_MAPPED_FILE, "CopyFile2: last error %d\n", GetLastError()); + ok(hr == HRESULT_FROM_WIN32(ERROR_USER_MAPPED_FILE), "CopyFile2: unexpected error 0x%08lx\n", hr); + ok(GetLastError() == ERROR_USER_MAPPED_FILE, "CopyFile2: last error %ld\n", GetLastError());
CloseHandle(hmapfile); CloseHandle(hfile); @@ -1141,7 +1141,7 @@ static DWORD WINAPI copy_progress_cb(LARGE_INTEGER total_size, LARGE_INTEGER tot LARGE_INTEGER stream_size, LARGE_INTEGER stream_transferred, DWORD stream, DWORD reason, HANDLE source, HANDLE dest, LPVOID userdata) { - ok(reason == CALLBACK_STREAM_SWITCH, "expected CALLBACK_STREAM_SWITCH, got %u\n", reason); + ok(reason == CALLBACK_STREAM_SWITCH, "expected CALLBACK_STREAM_SWITCH, got %lu\n", reason); CloseHandle(userdata); return PROGRESS_CANCEL; } @@ -1156,47 +1156,47 @@ static void test_CopyFileEx(void) BOOL retok;
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, source); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
ret = GetTempFileNameA(temp_path, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
hfile = CreateFileA(dest, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError()); SetLastError(0xdeadbeef); retok = CopyFileExA(source, dest, copy_progress_cb, hfile, NULL, 0); todo_wine ok(!retok, "CopyFileExA unexpectedly succeeded\n"); todo_wine - ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %ld\n", GetLastError()); ok(GetFileAttributesA(dest) != INVALID_FILE_ATTRIBUTES, "file was deleted\n");
hfile = CreateFileA(dest, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); todo_wine - ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError()); SetLastError(0xdeadbeef); retok = CopyFileExA(source, dest, copy_progress_cb, hfile, NULL, 0); todo_wine ok(!retok, "CopyFileExA unexpectedly succeeded\n"); todo_wine - ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %ld\n", GetLastError()); todo_wine ok(GetFileAttributesA(dest) == INVALID_FILE_ATTRIBUTES, "file was not deleted\n");
retok = CopyFileExA(source, NULL, copy_progress_cb, hfile, NULL, 0); ok(!retok, "CopyFileExA unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_PATH_NOT_FOUND, "expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PATH_NOT_FOUND, "expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError()); retok = CopyFileExA(NULL, dest, copy_progress_cb, hfile, NULL, 0); ok(!retok, "CopyFileExA unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_PATH_NOT_FOUND, "expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PATH_NOT_FOUND, "expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError());
ret = DeleteFileA(source); - ok(ret, "DeleteFileA failed with error %d\n", GetLastError()); + ok(ret, "DeleteFileA failed with error %ld\n", GetLastError()); ret = DeleteFileA(dest); ok(!ret, "DeleteFileA unexpectedly succeeded\n"); } @@ -1256,11 +1256,11 @@ static void test_CreateFileA(void) WCHAR curdir[MAX_PATH];
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, filename); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hFile = CreateFileA(filename, GENERIC_READ, 0, NULL, @@ -1272,7 +1272,7 @@ static void test_CreateFileA(void) hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError());
CloseHandle(hFile);
@@ -1280,43 +1280,43 @@ static void test_CreateFileA(void) hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError());
CloseHandle(hFile);
ret = DeleteFileA(filename); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == 0, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError());
CloseHandle(hFile);
ret = DeleteFileA(filename); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hFile = CreateFileA("c:\*.*", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); ok(hFile == INVALID_HANDLE_VALUE, "hFile should have been INVALID_HANDLE_VALUE\n"); ok(GetLastError() == ERROR_INVALID_NAME || broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* Win98 */ - "LastError should have been ERROR_INVALID_NAME or ERROR_FILE_NOT_FOUND but got %u\n", GetLastError()); + "LastError should have been ERROR_INVALID_NAME or ERROR_FILE_NOT_FOUND but got %lu\n", GetLastError());
/* get windows drive letter */ ret = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); ok(ret < sizeof(windowsdir), "windowsdir is abnormally long!\n"); - ok(ret != 0, "GetWindowsDirectory: error %d\n", GetLastError()); + ok(ret != 0, "GetWindowsDirectory: error %ld\n", GetLastError());
/* test error return codes from CreateFile for some cases */ ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); strcpy(dirname, temp_path); strcat(dirname, directory); ret = CreateDirectoryA(dirname, NULL); - ok( ret, "Createdirectory failed, gle=%d\n", GetLastError() ); + ok( ret, "Createdirectory failed, gle=%ld\n", GetLastError() ); /* set current drive & directory to known location */ GetCurrentDirectoryW( MAX_PATH, curdir); SetCurrentDirectoryA( temp_path ); @@ -1353,7 +1353,7 @@ static void test_CreateFileA(void) p[i].err != ERROR_ACCESS_DENIED) { if (p[i].todo_flag) - skip("Either no authority to volume, or is todo_wine for %s err=%d should be %d\n", filename, GetLastError(), p[i].err); + skip("Either no authority to volume, or is todo_wine for %s err=%ld should be %ld\n", filename, GetLastError(), p[i].err); else skip("Do not have authority to access volumes. Test for %s skipped\n", filename); } @@ -1364,7 +1364,7 @@ static void test_CreateFileA(void) ok((hFile == INVALID_HANDLE_VALUE && (p[i].err == GetLastError() || p[i].err2 == GetLastError())) || (hFile != INVALID_HANDLE_VALUE && p[i].err == ERROR_SUCCESS), - "CreateFileA failed on %s, hFile %p, err=%u, should be %u\n", + "CreateFileA failed on %s, hFile %p, err=%lu, should be %lu\n", filename, hFile, GetLastError(), p[i].err); } if (hFile != INVALID_HANDLE_VALUE) @@ -1372,7 +1372,7 @@ static void test_CreateFileA(void) i++; } ret = RemoveDirectoryA(dirname); - ok(ret, "RemoveDirectoryA: error %d\n", GetLastError()); + ok(ret, "RemoveDirectoryA: error %ld\n", GetLastError()); SetCurrentDirectoryW(curdir);
/* test opening directory as a directory */ @@ -1384,7 +1384,7 @@ static void test_CreateFileA(void) if (hFile != INVALID_HANDLE_VALUE && GetLastError() != ERROR_PATH_NOT_FOUND) { ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_SUCCESS, - "CreateFileA did not work, last error %u on volume <%s>\n", + "CreateFileA did not work, last error %lu on volume <%s>\n", GetLastError(), temp_path );
if (hFile != INVALID_HANDLE_VALUE) @@ -1393,7 +1393,7 @@ static void test_CreateFileA(void) if (ret) { ok(Finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY, - "CreateFileA probably did not open temp directory %s correctly\n file information does not include FILE_ATTRIBUTE_DIRECTORY, actual=0x%08x\n", + "CreateFileA probably did not open temp directory %s correctly\n file information does not include FILE_ATTRIBUTE_DIRECTORY, actual=0x%08lx\n", temp_path, Finfo.dwFileAttributes); } CloseHandle( hFile ); @@ -1417,7 +1417,7 @@ static void test_CreateFileA(void) (GetLastError() != ERROR_ACCESS_DENIED && GetLastError() != ERROR_BAD_NETPATH)) { /* if we have adm rights to volume, then try rest of tests */ - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA did not open %s, last error=%u\n", + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA did not open %s, last error=%lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) { @@ -1426,7 +1426,7 @@ static void test_CreateFileA(void) /* what the data is at this time. */ len = 512; ret = ReadFile( hFile, buffer, len, &len, NULL ); - todo_wine ok(ret, "Failed to read volume, last error %u, %u, for %s\n", + todo_wine ok(ret, "Failed to read volume, last error %lu, %lu, for %s\n", GetLastError(), ret, filename); if (ret) { @@ -1447,7 +1447,7 @@ static void test_CreateFileA(void) FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING, NULL ); todo_wine ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateFileA should have returned ERROR_PATH_NOT_FOUND on %s, but got %u\n", + "CreateFileA should have returned ERROR_PATH_NOT_FOUND on %s, but got %lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) CloseHandle( hFile ); @@ -1462,7 +1462,7 @@ static void test_CreateFileA(void) NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); ok(hFile != INVALID_HANDLE_VALUE, - "CreateFileA should have worked on %s, but got %u\n", + "CreateFileA should have worked on %s, but got %lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) CloseHandle( hFile ); @@ -1476,7 +1476,7 @@ static void test_CreateFileA(void) FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING, NULL ); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA did not open %s, last error=%u\n", + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA did not open %s, last error=%lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) CloseHandle( hFile ); @@ -1495,7 +1495,7 @@ static void test_CreateFileA(void) strcpy(filename, "c:\"); filename[0] = windowsdir[0]; ret = pGetVolumeNameForVolumeMountPointA( filename, Volume_1, MAX_PATH ); - ok(ret, "GetVolumeNameForVolumeMountPointA failed, for %s, last error=%d\n", filename, GetLastError()); + ok(ret, "GetVolumeNameForVolumeMountPointA failed, for %s, last error=%ld\n", filename, GetLastError()); if (ret) { ok(strlen(Volume_1) == 49, "GetVolumeNameForVolumeMountPointA returned wrong length name <%s>\n", Volume_1); @@ -1515,7 +1515,7 @@ static void test_CreateFileA(void) filename, hFile); todo_wine ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateFileA should have returned ERROR_PATH_NOT_FOUND on %s, but got %u\n", + "CreateFileA should have returned ERROR_PATH_NOT_FOUND on %s, but got %lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) CloseHandle( hFile ); @@ -1532,7 +1532,7 @@ static void test_CreateFileA(void) FILE_FLAG_BACKUP_SEMANTICS, NULL ); todo_wine ok(hFile != INVALID_HANDLE_VALUE, - "CreateFileA should have opened %s, but got %u\n", + "CreateFileA should have opened %s, but got %lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) CloseHandle( hFile ); @@ -1551,7 +1551,7 @@ static void test_CreateFileA(void) if (hFile != INVALID_HANDLE_VALUE || GetLastError() != ERROR_ACCESS_DENIED) { /* if we have adm rights to volume, then try rest of tests */ - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA did not open %s, last error=%u\n", + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA did not open %s, last error=%lu\n", filename, GetLastError()); if (hFile != INVALID_HANDLE_VALUE) { @@ -1560,7 +1560,7 @@ static void test_CreateFileA(void) /* what the data is at this time. */ len = 512; ret = ReadFile( hFile, buffer, len, &len, NULL ); - todo_wine ok(ret, "Failed to read volume, last error %u, %u, for %s\n", + todo_wine ok(ret, "Failed to read volume, last error %lu, %lu, for %s\n", GetLastError(), ret, filename); if (ret) { @@ -1596,11 +1596,11 @@ static void test_CreateFileW(void) win_skip("GetTempPathW is not available\n"); return; } - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, filename); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hFile = CreateFileW(filename, GENERIC_READ, 0, NULL, @@ -1612,7 +1612,7 @@ static void test_CreateFileW(void) hFile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError());
CloseHandle(hFile);
@@ -1620,23 +1620,23 @@ static void test_CreateFileW(void) hFile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError());
CloseHandle(hFile);
ret = DeleteFileW(filename); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hFile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == 0, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError());
CloseHandle(hFile);
ret = DeleteFileW(filename); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError());
if (0) { @@ -1644,29 +1644,29 @@ static void test_CreateFileW(void) hFile = CreateFileW(NULL, GENERIC_READ, 0, NULL, CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateFileW(NULL) returned ret=%p error=%u\n",hFile,GetLastError()); + "CreateFileW(NULL) returned ret=%p error=%lu\n",hFile,GetLastError()); }
hFile = CreateFileW(emptyW, GENERIC_READ, 0, NULL, CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateFileW("") returned ret=%p error=%d\n",hFile,GetLastError()); + "CreateFileW("") returned ret=%p error=%ld\n",hFile,GetLastError());
/* test the result of opening a nonexistent driver name */ hFile = CreateFileW(bogus, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_NOT_FOUND, - "CreateFileW on invalid VxD name returned ret=%p error=%d\n",hFile,GetLastError()); + "CreateFileW on invalid VxD name returned ret=%p error=%ld\n",hFile,GetLastError());
ret = CreateDirectoryW(filename, NULL); ok(ret == TRUE, "couldn't create temporary directory\n"); hFile = CreateFileW(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); ok(hFile != INVALID_HANDLE_VALUE, - "expected CreateFile to succeed on existing directory, error: %d\n", GetLastError()); + "expected CreateFile to succeed on existing directory, error: %ld\n", GetLastError()); CloseHandle(hFile); ret = RemoveDirectoryW(filename); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError()); }
static void test_CreateFile2(void) @@ -1687,11 +1687,11 @@ static void test_CreateFile2(void) }
ret = GetTempPathW(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, filename); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
SetLastError(0xdeadbeef); exparams.dwSize = sizeof(exparams); @@ -1707,36 +1707,36 @@ static void test_CreateFile2(void) SetLastError(0xdeadbeef); hFile = pCreateFile2(filename, GENERIC_READ, FILE_SHARE_READ, CREATE_ALWAYS, &exparams); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError()); CloseHandle(hFile);
SetLastError(0xdeadbeef); hFile = pCreateFile2(filename, GENERIC_READ, FILE_SHARE_READ, OPEN_ALWAYS, &exparams); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError()); CloseHandle(hFile);
ret = DeleteFileW(filename); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hFile = pCreateFile2(filename, GENERIC_READ, FILE_SHARE_READ, OPEN_ALWAYS, &exparams); ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == 0, - "hFile %p, last error %u\n", hFile, GetLastError()); + "hFile %p, last error %lu\n", hFile, GetLastError()); CloseHandle(hFile);
ret = DeleteFileW(filename); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError());
hFile = pCreateFile2(emptyW, GENERIC_READ, 0, CREATE_NEW, &exparams); ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateFile2("") returned ret=%p error=%d\n",hFile,GetLastError()); + "CreateFile2("") returned ret=%p error=%ld\n",hFile,GetLastError());
/* test the result of opening a nonexistent driver name */ exparams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; hFile = pCreateFile2(bogus, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING, &exparams); ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_NOT_FOUND, - "CreateFile2 on invalid VxD name returned ret=%p error=%d\n",hFile,GetLastError()); + "CreateFile2 on invalid VxD name returned ret=%p error=%ld\n",hFile,GetLastError());
ret = CreateDirectoryW(filename, NULL); ok(ret == TRUE, "couldn't create temporary directory\n"); @@ -1745,10 +1745,10 @@ static void test_CreateFile2(void) SetLastError(0xdeadbeef); hFile = pCreateFile2(filename, GENERIC_READ | GENERIC_WRITE, 0, OPEN_ALWAYS, &exparams); ok(hFile != INVALID_HANDLE_VALUE, - "CreateFile2 failed with FILE_FLAG_BACKUP_SEMANTICS on existing directory, error: %d\n", GetLastError()); + "CreateFile2 failed with FILE_FLAG_BACKUP_SEMANTICS on existing directory, error: %ld\n", GetLastError()); CloseHandle(hFile); ret = RemoveDirectoryW(filename); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError());
for (i = 0; i < 2; ++i) { @@ -1767,18 +1767,18 @@ static void test_CreateFile2(void)
SetLastError(0xdeadbeef); hFile = pCreateFile2(filename, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, &exparams); - ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == 0, "%d: hFile %p, last error %u\n", i, hFile, GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == 0, "%ld: hFile %p, last error %lu\n", i, hFile, GetLastError());
iocp = CreateIoCompletionPort(hFile, NULL, 0, 2); - if (i == 1) ok(iocp == NULL && GetLastError() == ERROR_INVALID_PARAMETER, "%d: CreateIoCompletionPort returned %p, error %u\n", i, iocp, GetLastError()); - else ok(iocp != INVALID_HANDLE_VALUE && GetLastError() == 0, "%d: CreateIoCompletionPort returned %p, error %u\n", i, iocp, GetLastError()); + if (i == 1) ok(iocp == NULL && GetLastError() == ERROR_INVALID_PARAMETER, "%ld: CreateIoCompletionPort returned %p, error %lu\n", i, iocp, GetLastError()); + else ok(iocp != INVALID_HANDLE_VALUE && GetLastError() == 0, "%ld: CreateIoCompletionPort returned %p, error %lu\n", i, iocp, GetLastError());
CloseHandle(iocp); CloseHandle(hFile);
ret = DeleteFileW(filename); - if (i == 1) ok(ret, "%d: unexpected DeleteFileW failure, error %u\n", i, GetLastError()); - else ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "%d: unexpected DeleteFileW result, ret %d error %u\n", i, ret, GetLastError()); + if (i == 1) ok(ret, "%ld: unexpected DeleteFileW failure, error %lu\n", i, GetLastError()); + else ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "%ld: unexpected DeleteFileW result, ret %ld error %lu\n", i, ret, GetLastError()); } }
@@ -1792,7 +1792,7 @@ static void test_GetTempFileNameA(void)
result = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); ok(result < sizeof(windowsdir), "windowsdir is abnormally long!\n"); - ok(result != 0, "GetWindowsDirectory: error %d\n", GetLastError()); + ok(result != 0, "GetWindowsDirectory: error %ld\n", GetLastError());
/* If the Windows directory is the root directory, it ends in backslash, not else. */ if (strlen(windowsdir) != 3) /* As in "C:" or "F:" */ @@ -1805,13 +1805,13 @@ static void test_GetTempFileNameA(void) windowsdrive[2] = '\0';
result = GetTempFileNameA(windowsdrive, "abc", 1, out); - ok(result != 0, "GetTempFileNameA: error %d\n", GetLastError()); + ok(result != 0, "GetTempFileNameA: error %ld\n", GetLastError()); ok(((out[0] == windowsdrive[0]) && (out[1] == ':')) && (out[2] == '\'), "GetTempFileNameA: first three characters should be %c:\, string was actually %s\n", windowsdrive[0], out);
result = GetTempFileNameA(windowsdir, "abc", 2, out); - ok(result != 0, "GetTempFileNameA: error %d\n", GetLastError()); + ok(result != 0, "GetTempFileNameA: error %ld\n", GetLastError()); expected[0] = '\0'; strcat(expected, windowsdir); strcat(expected, "abc2.tmp"); @@ -1829,68 +1829,68 @@ static void test_DeleteFileA( void ) ret = DeleteFileA(NULL); ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_PATH_NOT_FOUND), - "DeleteFileA(NULL) returned ret=%d error=%d\n",ret,GetLastError()); + "DeleteFileA(NULL) returned ret=%d error=%ld\n",ret,GetLastError());
ret = DeleteFileA(""); ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_BAD_PATHNAME), - "DeleteFileA("") returned ret=%d error=%d\n",ret,GetLastError()); + "DeleteFileA("") returned ret=%d error=%ld\n",ret,GetLastError());
ret = DeleteFileA("nul"); ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_INVALID_FUNCTION), - "DeleteFileA("nul") returned ret=%d error=%d\n",ret,GetLastError()); + "DeleteFileA("nul") returned ret=%d error=%ld\n",ret,GetLastError());
ret = DeleteFileA("nonexist.txt"); - ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "DeleteFileA("nonexist.txt") returned ret=%d error=%d\n",ret,GetLastError()); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "DeleteFileA("nonexist.txt") returned ret=%d error=%ld\n",ret,GetLastError());
GetTempPathA(MAX_PATH, temp_path); GetTempFileNameA(temp_path, "tst", 0, temp_file);
SetLastError(0xdeadbeef); hfile = CreateFileA(temp_file, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteFileA(temp_file); - ok(ret, "DeleteFile error %d\n", GetLastError()); + ok(ret, "DeleteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CloseHandle(hfile); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError()); ret = DeleteFileA(temp_file); ok(!ret, "DeleteFile should fail\n");
SetLastError(0xdeadbeef); ret = CreateDirectoryA("testdir", NULL); - ok(ret, "CreateDirectory failed, got err %d\n", GetLastError()); + ok(ret, "CreateDirectory failed, got err %ld\n", GetLastError()); ret = DeleteFileA("testdir"); ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, - "Expected ERROR_ACCESS_DENIED, got error %d\n", GetLastError()); + "Expected ERROR_ACCESS_DENIED, got error %ld\n", GetLastError()); ret = RemoveDirectoryA("testdir"); - ok(ret, "Remove a directory failed, got error %d\n", GetLastError()); + ok(ret, "Remove a directory failed, got error %ld\n", GetLastError());
winetest_get_mainargs(&argv);
ret = CopyFileA(argv[0], temp_file, FALSE); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); hfile = CreateFileA(temp_file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
mapping = CreateFileMappingA(hfile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL); - ok(!!mapping, "got error %u\n", GetLastError()); + ok(!!mapping, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteFileA(temp_file); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError());
CloseHandle(mapping);
ret = DeleteFileA(temp_file); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
CloseHandle(hfile); } @@ -1911,11 +1911,11 @@ static void test_DeleteFileW( void ) return; } ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND, - "DeleteFileW(NULL) returned ret=%d error=%d\n",ret,GetLastError()); + "DeleteFileW(NULL) returned ret=%d error=%ld\n",ret,GetLastError());
ret = DeleteFileW(emptyW); ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND, - "DeleteFileW("") returned ret=%d error=%d\n",ret,GetLastError()); + "DeleteFileW("") returned ret=%d error=%ld\n",ret,GetLastError());
/* test DeleteFile on empty directory */ ret = GetTempPathW(MAX_PATH, pathW); @@ -1961,40 +1961,40 @@ static void test_MoveFileA(void) BOOL retok;
ret = GetTempPathA(MAX_PATH, tempdir); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(tempdir, prefix, 0, source); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
ret = GetTempFileNameA(tempdir, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
ret = MoveFileA(source, source); - ok(ret, "MoveFileA: failed, error %d\n", GetLastError()); + ok(ret, "MoveFileA: failed, error %ld\n", GetLastError());
ret = MoveFileA(source, dest); ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS, - "MoveFileA: unexpected error %d\n", GetLastError()); + "MoveFileA: unexpected error %ld\n", GetLastError());
ret = DeleteFileA(dest); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError());
hfile = CreateFileA(source, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n");
retok = WriteFile(hfile, prefix, sizeof(prefix), &ret, NULL ); ok( retok && ret == sizeof(prefix), - "WriteFile error %d\n", GetLastError()); + "WriteFile error %ld\n", GetLastError());
hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); - ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + ok(hmapfile != NULL, "CreateFileMapping: error %ld\n", GetLastError());
ret = MoveFileA(source, dest); ok(!ret, "MoveFileA: expected failure\n"); ok(GetLastError() == ERROR_SHARING_VIOLATION || broken(GetLastError() == ERROR_ACCESS_DENIED), /* Win9x and WinMe */ - "MoveFileA: expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + "MoveFileA: expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
CloseHandle(hmapfile); CloseHandle(hfile); @@ -2006,13 +2006,13 @@ static void test_MoveFileA(void) ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n");
hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); - ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + ok(hmapfile != NULL, "CreateFileMapping: error %ld\n", GetLastError());
ret = MoveFileA(source, dest); ok(!ret, "MoveFileA: expected failure\n"); ok(GetLastError() == ERROR_SHARING_VIOLATION || broken(GetLastError() == ERROR_ACCESS_DENIED), /* Win9x and WinMe */ - "MoveFileA: expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + "MoveFileA: expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
CloseHandle(hmapfile); CloseHandle(hfile); @@ -2021,7 +2021,7 @@ static void test_MoveFileA(void) if (ret) MoveFileA(dest, source);
ret = MoveFileA(source, dest); - ok(ret, "MoveFileA: failed, error %d\n", GetLastError()); + ok(ret, "MoveFileA: failed, error %ld\n", GetLastError());
lstrcatA(tempdir, "Remove Me");
@@ -2034,10 +2034,10 @@ static void test_MoveFileA(void) CloseHandle(hfile);
ret = MoveFileA(source, tempdir); - ok(ret, "MoveFileA: failed, error %d\n", GetLastError()); + ok(ret, "MoveFileA: failed, error %ld\n", GetLastError());
hfile = FindFirstFileA(tempdir, &find_data); - ok(hfile != INVALID_HANDLE_VALUE, "FindFirstFileA: failed, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "FindFirstFileA: failed, error %ld\n", GetLastError()); if (hfile != INVALID_HANDLE_VALUE) { todo_wine ok(!lstrcmpA(strrchr(tempdir, '\') + 1, find_data.cFileName), @@ -2054,14 +2054,14 @@ static void test_MoveFileA(void)
ret = MoveFileA(tempdir, source); ok(!ret, "MoveFileA: expected failure\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "MoveFileA: expected ERROR_ALREADY_EXISTS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "MoveFileA: expected ERROR_ALREADY_EXISTS, got %ld\n", GetLastError()); ret = MoveFileExA(tempdir, source, MOVEFILE_REPLACE_EXISTING); - ok(ret, "MoveFileExA: failed, error %d\n", GetLastError()); + ok(ret, "MoveFileExA: failed, error %ld\n", GetLastError());
tempdir[lstrlenA(tempdir) - 2] = 'm';
hfile = FindFirstFileA(tempdir, &find_data); - ok(hfile != INVALID_HANDLE_VALUE, "FindFirstFileA: failed, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "FindFirstFileA: failed, error %ld\n", GetLastError()); if (hfile != INVALID_HANDLE_VALUE) { ok(!lstrcmpA(strrchr(source, '\') + 1, find_data.cFileName), @@ -2070,7 +2070,7 @@ static void test_MoveFileA(void) CloseHandle(hfile);
ret = DeleteFileA(tempdir); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError());
/* now test a directory from "Remove me" to uppercase "Me" */ ret = CreateDirectoryA(tempdir, NULL); @@ -2079,10 +2079,10 @@ static void test_MoveFileA(void) lstrcpyA(source, tempdir); tempdir[lstrlenA(tempdir) - 2] = 'M'; ret = MoveFileA(source, tempdir); - ok(ret, "MoveFileA: failed, error %d\n", GetLastError()); + ok(ret, "MoveFileA: failed, error %ld\n", GetLastError());
hfile = FindFirstFileA(tempdir, &find_data); - ok(hfile != INVALID_HANDLE_VALUE, "FindFirstFileA: failed, error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "FindFirstFileA: failed, error %ld\n", GetLastError()); if (hfile != INVALID_HANDLE_VALUE) { todo_wine ok(!lstrcmpA(strrchr(tempdir, '\') + 1, find_data.cFileName), @@ -2098,7 +2098,7 @@ static void test_MoveFileA(void) ok(!ret, "MoveFileA: shouldn't move to wildcard file\n"); ok(GetLastError() == ERROR_INVALID_NAME || /* NT */ GetLastError() == ERROR_FILE_NOT_FOUND, /* Win9x */ - "MoveFileA: with wildcards, unexpected error %d\n", GetLastError()); + "MoveFileA: with wildcards, unexpected error %ld\n", GetLastError()); if (ret || (GetLastError() != ERROR_INVALID_NAME)) { WIN32_FIND_DATAA fd; @@ -2123,11 +2123,11 @@ static void test_MoveFileA(void) } } ret = DeleteFileA(source); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); ret = DeleteFileA(dest); - ok(!ret, "DeleteFileA: error %d\n", GetLastError()); + ok(!ret, "DeleteFileA: error %ld\n", GetLastError()); ret = RemoveDirectoryA(tempdir); - ok(ret, "DeleteDirectoryA: error %d\n", GetLastError()); + ok(ret, "DeleteDirectoryA: error %ld\n", GetLastError()); }
static void test_MoveFileW(void) @@ -2143,23 +2143,23 @@ static void test_MoveFileW(void) win_skip("GetTempPathW is not available\n"); return; } - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, source); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, dest); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
ret = MoveFileW(source, dest); ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS, - "CopyFileW: unexpected error %d\n", GetLastError()); + "CopyFileW: unexpected error %ld\n", GetLastError());
ret = DeleteFileW(source); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError()); ret = DeleteFileW(dest); - ok(ret, "DeleteFileW: error %d\n", GetLastError()); + ok(ret, "DeleteFileW: error %ld\n", GetLastError()); }
#define PATTERN_OFFSET 0x10 @@ -2176,19 +2176,19 @@ static void test_offset_in_overlapped_structure(void) BOOL ret;
ret =GetTempPathA(MAX_PATH, temp_path); - ok( ret, "GetTempPathA error %d\n", GetLastError()); + ok( ret, "GetTempPathA error %ld\n", GetLastError()); ret =GetTempFileNameA(temp_path, "pfx", 0, temp_fname); - ok( ret, "GetTempFileNameA error %d\n", GetLastError()); + ok( ret, "GetTempFileNameA error %ld\n", GetLastError());
/*** Write File *****************************************************/
hFile = CreateFileA(temp_fname, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA error %d\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA error %ld\n", GetLastError());
for(i = 0; i < sizeof(buf); i++) buf[i] = i; ret = WriteFile(hFile, buf, sizeof(buf), &done, NULL); - ok( ret, "WriteFile error %d\n", GetLastError()); - ok(done == sizeof(buf), "expected number of bytes written %u\n", done); + ok( ret, "WriteFile error %ld\n", GetLastError()); + ok(done == sizeof(buf), "expected number of bytes written %lu\n", done);
memset(&ov, 0, sizeof(ov)); S(U(ov)).Offset = PATTERN_OFFSET; @@ -2196,18 +2196,18 @@ static void test_offset_in_overlapped_structure(void) rc=WriteFile(hFile, pattern, sizeof(pattern), &done, &ov); /* Win 9x does not support the overlapped I/O on files */ if (rc || GetLastError()!=ERROR_INVALID_PARAMETER) { - ok(rc, "WriteFile error %d\n", GetLastError()); - ok(done == sizeof(pattern), "expected number of bytes written %u\n", done); + ok(rc, "WriteFile error %ld\n", GetLastError()); + ok(done == sizeof(pattern), "expected number of bytes written %lu\n", done); offset = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); - ok(offset == PATTERN_OFFSET + sizeof(pattern), "wrong file offset %d\n", offset); + ok(offset == PATTERN_OFFSET + sizeof(pattern), "wrong file offset %ld\n", offset);
S(U(ov)).Offset = sizeof(buf) * 2; S(U(ov)).OffsetHigh = 0; ret = WriteFile(hFile, pattern, sizeof(pattern), &done, &ov); - ok( ret, "WriteFile error %d\n", GetLastError()); - ok(done == sizeof(pattern), "expected number of bytes written %u\n", done); + ok( ret, "WriteFile error %ld\n", GetLastError()); + ok(done == sizeof(pattern), "expected number of bytes written %lu\n", done); offset = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); - ok(offset == sizeof(buf) * 2 + sizeof(pattern), "wrong file offset %d\n", offset); + ok(offset == sizeof(buf) * 2 + sizeof(pattern), "wrong file offset %ld\n", offset); }
CloseHandle(hFile); @@ -2215,7 +2215,7 @@ static void test_offset_in_overlapped_structure(void) /*** Read File *****************************************************/
hFile = CreateFileA(temp_fname, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA error %d\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA error %ld\n", GetLastError());
memset(buf, 0, sizeof(buf)); memset(&ov, 0, sizeof(ov)); @@ -2224,17 +2224,17 @@ static void test_offset_in_overlapped_structure(void) rc=ReadFile(hFile, buf, sizeof(pattern), &done, &ov); /* Win 9x does not support the overlapped I/O on files */ if (rc || GetLastError()!=ERROR_INVALID_PARAMETER) { - ok(rc, "ReadFile error %d\n", GetLastError()); - ok(done == sizeof(pattern), "expected number of bytes read %u\n", done); + ok(rc, "ReadFile error %ld\n", GetLastError()); + ok(done == sizeof(pattern), "expected number of bytes read %lu\n", done); offset = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); - ok(offset == PATTERN_OFFSET + sizeof(pattern), "wrong file offset %d\n", offset); + ok(offset == PATTERN_OFFSET + sizeof(pattern), "wrong file offset %ld\n", offset); ok(!memcmp(buf, pattern, sizeof(pattern)), "pattern match failed\n"); }
CloseHandle(hFile);
ret = DeleteFileA(temp_fname); - ok( ret, "DeleteFileA error %d\n", GetLastError()); + ok( ret, "DeleteFileA error %ld\n", GetLastError()); }
static void test_LockFile(void) @@ -2251,7 +2251,7 @@ static void test_LockFile(void) CREATE_ALWAYS, 0, 0 ); if (handle == INVALID_HANDLE_VALUE) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; } handle2 = CreateFileA( filename, GENERIC_READ | GENERIC_WRITE, @@ -2259,7 +2259,7 @@ static void test_LockFile(void) OPEN_EXISTING, 0, 0 ); if (handle2 == INVALID_HANDLE_VALUE) { - ok( 0, "couldn't open file "%s" (err=%d)\n", filename, GetLastError() ); + ok( 0, "couldn't open file "%s" (err=%ld)\n", filename, GetLastError() ); goto cleanup; } ok( WriteFile( handle, sillytext, strlen(sillytext), &written, NULL ), "write failed\n" ); @@ -2336,7 +2336,7 @@ static void test_LockFile(void) ok( UnlockFile( handle, 0, 0x10000000, 0, 0xf0000000 ), "UnlockFile failed\n" ); } else /* win9x */ - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong LockFile error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong LockFile error %lu\n", GetLastError() );
/* wrap-around lock should not do anything */ /* (but still succeeds on NT4 so we don't check result) */ @@ -2506,7 +2506,7 @@ static void test_file_sharing(void) /* make sure the file exists */ if (!create_fake_dll( filename )) { - ok(0, "couldn't create file "%s" (err=%d)\n", filename, GetLastError()); + ok(0, "couldn't create file "%s" (err=%ld)\n", filename, GetLastError()); return; }
@@ -2519,7 +2519,7 @@ static void test_file_sharing(void) NULL, OPEN_EXISTING, 0, 0 ); if (h == INVALID_HANDLE_VALUE) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; } for (a2 = 0; a2 < ARRAY_SIZE(access_modes); a2++) @@ -2564,11 +2564,11 @@ static void test_file_sharing(void) h = CreateFileA( filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); if (h == INVALID_HANDLE_VALUE) { - ok(0,"couldn't create file "%s" (err=%d)\n",filename,GetLastError()); + ok(0,"couldn't create file "%s" (err=%ld)\n",filename,GetLastError()); return; } m = CreateFileMappingA( h, NULL, mapping_modes[a1].dw, 0, 0, NULL ); - ok( m != 0, "failed to create mapping %s err %u\n", mapping_modes[a1].str, GetLastError() ); + ok( m != 0, "failed to create mapping %s err %lu\n", mapping_modes[a1].str, GetLastError() ); CloseHandle( h ); if (!m) continue;
@@ -2641,15 +2641,15 @@ static void test_file_sharing(void)
SetLastError(0xdeadbeef); h = CreateFileA( filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, 0, 0 ); - ok( h != INVALID_HANDLE_VALUE, "CreateFileA error %d\n", GetLastError() ); + ok( h != INVALID_HANDLE_VALUE, "CreateFileA error %ld\n", GetLastError() );
SetLastError(0xdeadbeef); h2 = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); ok( h2 == INVALID_HANDLE_VALUE, "CreateFileA should fail\n"); - ok( GetLastError() == ERROR_SHARING_VIOLATION, "wrong error code %d\n", GetLastError() ); + ok( GetLastError() == ERROR_SHARING_VIOLATION, "wrong error code %ld\n", GetLastError() );
h2 = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); - ok( h2 != INVALID_HANDLE_VALUE, "CreateFileA error %d\n", GetLastError() ); + ok( h2 != INVALID_HANDLE_VALUE, "CreateFileA error %ld\n", GetLastError() );
CloseHandle(h); CloseHandle(h2); @@ -2770,15 +2770,15 @@ static void test_FindFirstFileA(void) ok( 0 == lstrcmpiA(data.cFileName, "nul"), "wrong name %s\n", data.cFileName ); ok( FILE_ATTRIBUTE_ARCHIVE == data.dwFileAttributes || FILE_ATTRIBUTE_DEVICE == data.dwFileAttributes /* Win9x */, - "wrong attributes %x\n", data.dwFileAttributes ); + "wrong attributes %lx\n", data.dwFileAttributes ); if (data.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE) { - ok( 0 == data.nFileSizeHigh, "wrong size %d\n", data.nFileSizeHigh ); - ok( 0 == data.nFileSizeLow, "wrong size %d\n", data.nFileSizeLow ); + ok( 0 == data.nFileSizeHigh, "wrong size %ld\n", data.nFileSizeHigh ); + ok( 0 == data.nFileSizeLow, "wrong size %ld\n", data.nFileSizeLow ); } SetLastError( 0xdeadbeaf ); ok( !FindNextFileA( handle, &data ), "FindNextFileA succeeded\n" ); - ok( GetLastError() == ERROR_NO_MORE_FILES, "bad error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_NO_MORE_FILES, "bad error %ld\n", GetLastError() ); ok( FindClose( handle ), "failed to close handle\n" );
/* try FindFirstFileA on "lpt1" */ @@ -2790,15 +2790,15 @@ static void test_FindFirstFileA(void) ok( 0 == lstrcmpiA(data.cFileName, "lpt1"), "wrong name %s\n", data.cFileName ); ok( FILE_ATTRIBUTE_ARCHIVE == data.dwFileAttributes || FILE_ATTRIBUTE_DEVICE == data.dwFileAttributes /* Win9x */, - "wrong attributes %x\n", data.dwFileAttributes ); + "wrong attributes %lx\n", data.dwFileAttributes ); if (data.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE) { - ok( 0 == data.nFileSizeHigh, "wrong size %d\n", data.nFileSizeHigh ); - ok( 0 == data.nFileSizeLow, "wrong size %d\n", data.nFileSizeLow ); + ok( 0 == data.nFileSizeHigh, "wrong size %ld\n", data.nFileSizeHigh ); + ok( 0 == data.nFileSizeLow, "wrong size %ld\n", data.nFileSizeLow ); } SetLastError( 0xdeadbeaf ); ok( !FindNextFileA( handle, &data ), "FindNextFileA succeeded\n" ); - ok( GetLastError() == ERROR_NO_MORE_FILES, "bad error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_NO_MORE_FILES, "bad error %ld\n", GetLastError() ); ok( FindClose( handle ), "failed to close handle\n" );
/* try FindFirstFileA on "c:\nul*" */ @@ -2873,7 +2873,7 @@ static void test_FindFirstFileExA(FINDEX_INFO_LEVELS level, FINDEX_SEARCH_OPS se return; }
- trace("Running FindFirstFileExA tests with level=%d, search_ops=%d, flags=%u\n", + trace("Running FindFirstFileExA tests with level=%d, search_ops=%d, flags=%lu\n", level, search_ops, flags);
CreateDirectoryA("test-dir", NULL); @@ -2901,7 +2901,7 @@ static void test_FindFirstFileExA(FINDEX_INFO_LEVELS level, FINDEX_SEARCH_OPS se #define CHECK_NAME(fn) (strcmp((fn), "file1") == 0 || strcmp((fn), "file2") == 0 || strcmp((fn), "dir1") == 0) #define CHECK_LEVEL(fn) (level != FindExInfoBasic || !(fn)[0])
- ok(handle != INVALID_HANDLE_VALUE, "FindFirstFile failed (err=%u)\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "FindFirstFile failed (err=%lu)\n", GetLastError()); ok(strcmp(search_results.cFileName, ".") == 0, "First entry should be '.', is %s\n", search_results.cFileName); ok(CHECK_LEVEL(search_results.cAlternateFileName), "FindFirstFile unexpectedly returned an alternate filename\n");
@@ -2948,12 +2948,12 @@ static void test_FindFirstFileExA(FINDEX_INFO_LEVELS level, FINDEX_SEARCH_OPS se if (flags & FIND_FIRST_EX_CASE_SENSITIVE) { ok(handle != INVALID_HANDLE_VALUE || GetLastError() == ERROR_PATH_NOT_FOUND, - "Unexpected error %x, expected valid handle or ERROR_PATH_NOT_FOUND\n", GetLastError()); + "Unexpected error %lx, expected valid handle or ERROR_PATH_NOT_FOUND\n", GetLastError()); trace("FindFirstFileExA flag FIND_FIRST_EX_CASE_SENSITIVE is %signored\n", (handle == INVALID_HANDLE_VALUE) ? "not " : ""); } else - ok(handle != INVALID_HANDLE_VALUE, "Unexpected error %x, expected valid handle\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "Unexpected error %lx, expected valid handle\n", GetLastError()); if (handle != INVALID_HANDLE_VALUE) FindClose( handle );
@@ -3153,19 +3153,19 @@ static void test_GetFileType(void) HANDLE h = CreateFileA( filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); ok( h != INVALID_HANDLE_VALUE, "open %s failed\n", filename ); type = GetFileType(h); - ok( type == FILE_TYPE_DISK, "expected type disk got %d\n", type ); + ok( type == FILE_TYPE_DISK, "expected type disk got %ld\n", type ); CloseHandle( h ); h = CreateFileA( "nul", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); ok( h != INVALID_HANDLE_VALUE, "open nul failed\n" ); type = GetFileType(h); - ok( type == FILE_TYPE_CHAR, "expected type char for nul got %d\n", type ); + ok( type == FILE_TYPE_CHAR, "expected type char for nul got %ld\n", type ); CloseHandle( h ); DeleteFileA( filename ); h = GetStdHandle( STD_OUTPUT_HANDLE ); ok( h != INVALID_HANDLE_VALUE, "GetStdHandle failed\n" ); type = GetFileType( (HANDLE)STD_OUTPUT_HANDLE ); type2 = GetFileType( h ); - ok(type == type2, "expected type %d for STD_OUTPUT_HANDLE got %d\n", type2, type); + ok(type == type2, "expected type %ld for STD_OUTPUT_HANDLE got %ld\n", type2, type); }
static int completion_count; @@ -3236,36 +3236,36 @@ static void test_read_write(void) static const char prefix[] = "pfx";
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, filename); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
hFile = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %d\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %ld\n", GetLastError());
user_apc_ran = FALSE; ret = QueueUserAPC(&user_apc, GetCurrentThread(), 0); - ok(ret, "QueueUserAPC failed: %d\n", GetLastError()); + ok(ret, "QueueUserAPC failed: %ld\n", GetLastError());
SetLastError(12345678); bytes = 12345678; ret = WriteFile(hFile, NULL, 0, &bytes, NULL); ok(ret && GetLastError() == 12345678, - "ret = %d, error %d\n", ret, GetLastError()); - ok(!bytes, "bytes = %d\n", bytes); + "ret = %ld, error %ld\n", ret, GetLastError()); + ok(!bytes, "bytes = %ld\n", bytes);
SetLastError(12345678); bytes = 12345678; ret = WriteFile(hFile, NULL, 10, &bytes, NULL); ok((!ret && GetLastError() == ERROR_INVALID_USER_BUFFER) || /* Win2k */ (ret && GetLastError() == 12345678), /* Win9x */ - "ret = %d, error %d\n", ret, GetLastError()); + "ret = %ld, error %ld\n", ret, GetLastError()); ok(!bytes || /* Win2k */ bytes == 10, /* Win9x */ - "bytes = %d\n", bytes); + "bytes = %ld\n", bytes);
/* make sure the file contains data */ WriteFile(hFile, "this is the test data", 21, &bytes, NULL); @@ -3275,16 +3275,16 @@ static void test_read_write(void) bytes = 12345678; ret = ReadFile(hFile, NULL, 0, &bytes, NULL); ok(ret && GetLastError() == 12345678, - "ret = %d, error %d\n", ret, GetLastError()); - ok(!bytes, "bytes = %d\n", bytes); + "ret = %ld, error %ld\n", ret, GetLastError()); + ok(!bytes, "bytes = %ld\n", bytes);
SetLastError(12345678); bytes = 12345678; ret = ReadFile(hFile, NULL, 10, &bytes, NULL); ok(!ret && (GetLastError() == ERROR_NOACCESS || /* Win2k */ GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */ - "ret = %d, error %d\n", ret, GetLastError()); - ok(!bytes, "bytes = %d\n", bytes); + "ret = %ld, error %ld\n", ret, GetLastError()); + ok(!bytes, "bytes = %ld\n", bytes);
ok(user_apc_ran == FALSE, "UserAPC ran, file using alertable io mode\n"); SleepEx(0, TRUE); /* get rid of apc */ @@ -3292,38 +3292,38 @@ static void test_read_write(void) /* test passing protected memory as buffer */
mem = VirtualAlloc( NULL, 0x4000, MEM_COMMIT, PAGE_READWRITE ); - ok( mem != NULL, "failed to allocate virtual mem error %u\n", GetLastError() ); + ok( mem != NULL, "failed to allocate virtual mem error %lu\n", GetLastError() );
ret = WriteFile( hFile, mem, 0x4000, &bytes, NULL ); - ok( ret, "WriteFile failed error %u\n", GetLastError() ); - ok( bytes == 0x4000, "only wrote %x bytes\n", bytes ); + ok( ret, "WriteFile failed error %lu\n", GetLastError() ); + ok( bytes == 0x4000, "only wrote %lx bytes\n", bytes );
ret = VirtualProtect( mem + 0x2000, 0x2000, PAGE_NOACCESS, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() );
ret = WriteFile( hFile, mem, 0x4000, &bytes, NULL ); ok( !ret, "WriteFile succeeded\n" ); ok( GetLastError() == ERROR_INVALID_USER_BUFFER || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "wrote %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "wrote %lx bytes\n", bytes );
ret = WriteFile( (HANDLE)0xdead, mem, 0x4000, &bytes, NULL ); ok( !ret, "WriteFile succeeded\n" ); ok( GetLastError() == ERROR_INVALID_HANDLE || /* handle is checked before buffer on NT */ GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "wrote %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "wrote %lx bytes\n", bytes );
ret = VirtualProtect( mem, 0x2000, PAGE_NOACCESS, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() );
ret = WriteFile( hFile, mem, 0x4000, &bytes, NULL ); ok( !ret, "WriteFile succeeded\n" ); ok( GetLastError() == ERROR_INVALID_USER_BUFFER || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "wrote %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "wrote %lx bytes\n", bytes );
SetFilePointer( hFile, 0, NULL, FILE_BEGIN );
@@ -3331,28 +3331,28 @@ static void test_read_write(void) ok( !ret, "ReadFile succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "read %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "read %lx bytes\n", bytes );
ret = VirtualProtect( mem, 0x2000, PAGE_READONLY, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() );
ret = ReadFile( hFile, mem, 0x4000, &bytes, NULL ); ok( !ret, "ReadFile succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "read %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "read %lx bytes\n", bytes );
ret = VirtualProtect( mem, 0x2000, PAGE_READWRITE, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() );
ret = ReadFile( hFile, mem, 0x4000, &bytes, NULL ); ok( !ret, "ReadFile succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "read %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "read %lx bytes\n", bytes );
SetFilePointer( hFile, 0x1234, NULL, FILE_BEGIN ); SetEndOfFile( hFile ); @@ -3362,26 +3362,26 @@ static void test_read_write(void) ok( !ret, "ReadFile succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "read %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "read %lx bytes\n", bytes );
ret = ReadFile( hFile, mem, 0x2000, &bytes, NULL ); - ok( ret, "ReadFile failed error %u\n", GetLastError() ); - ok( bytes == 0x1234, "read %x bytes\n", bytes ); + ok( ret, "ReadFile failed error %lu\n", GetLastError() ); + ok( bytes == 0x1234, "read %lx bytes\n", bytes );
ret = ReadFile( hFile, NULL, 1, &bytes, NULL ); ok( !ret, "ReadFile succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "wrong error %u\n", GetLastError() ); - ok( bytes == 0, "read %x bytes\n", bytes ); + "wrong error %lu\n", GetLastError() ); + ok( bytes == 0, "read %lx bytes\n", bytes );
VirtualFree( mem, 0, MEM_RELEASE );
ret = CloseHandle(hFile); - ok( ret, "CloseHandle: error %d\n", GetLastError()); + ok( ret, "CloseHandle: error %ld\n", GetLastError()); ret = DeleteFileA(filename); - ok( ret, "DeleteFileA: error %d\n", GetLastError()); + ok( ret, "DeleteFileA: error %ld\n", GetLastError()); }
static void test_OpenFile(void) @@ -3420,9 +3420,9 @@ static void test_OpenFile(void) SetLastError(0xfaceabee);
hFile = OpenFile(buff, &ofs, OF_EXIST); - ok( hFile == TRUE, "%s not found : %d\n", buff, GetLastError() ); + ok( hFile == TRUE, "%s not found : %ld\n", buff, GetLastError() ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(ofs), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); ok( lstrcmpiA(ofs.szPathName, buff) == 0, @@ -3443,8 +3443,8 @@ static void test_OpenFile(void) SetLastError(0xfaceabee);
hFile = OpenFile(foo, &ofs, OF_EXIST); - ok( hFile == HFILE_ERROR, "hFile != HFILE_ERROR : %d\n", GetLastError()); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() returns %d\n", GetLastError() ); + ok( hFile == HFILE_ERROR, "hFile != HFILE_ERROR : %ld\n", GetLastError()); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() returns %ld\n", GetLastError() ); todo_wine ok( ofs.cBytes == 0xA5, "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_FILE_NOT_FOUND, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); @@ -3464,9 +3464,9 @@ static void test_OpenFile(void) SetLastError(0xfaceabee);
hFile = OpenFile(foo_too_long, &ofs, OF_EXIST); - ok( hFile == HFILE_ERROR, "hFile != HFILE_ERROR : %d\n", GetLastError()); + ok( hFile == HFILE_ERROR, "hFile != HFILE_ERROR : %ld\n", GetLastError()); ok( GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_FILENAME_EXCED_RANGE, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); todo_wine ok( ofs.cBytes == 0xA5, "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_INVALID_DATA || ofs.nErrCode == ERROR_FILENAME_EXCED_RANGE, @@ -3482,14 +3482,14 @@ static void test_OpenFile(void) hFile = OpenFile(filename, &ofs, OF_CREATE); ok( hFile != HFILE_ERROR, "OpenFile failed to create nonexistent file\n" ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); ret = _lclose(hFile); ok( !ret, "_lclose() returns %d\n", ret ); retval = GetFileAttributesA(filename); - ok( retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA: error %d\n", GetLastError() ); + ok( retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA: error %ld\n", GetLastError() );
memset(&ofs, 0xA5, sizeof(ofs)); SetLastError(0xfaceabee); @@ -3498,7 +3498,7 @@ static void test_OpenFile(void) hFile = OpenFile(filename, &ofs, OF_READ); ok( hFile != HFILE_ERROR, "OpenFile failed on read\n" ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); @@ -3513,7 +3513,7 @@ static void test_OpenFile(void) hFile = OpenFile(filename, &ofs, OF_WRITE); ok( hFile != HFILE_ERROR, "OpenFile failed on write\n" ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); @@ -3528,7 +3528,7 @@ static void test_OpenFile(void) hFile = OpenFile(filename, &ofs, OF_READWRITE); ok( hFile != HFILE_ERROR, "OpenFile failed on read/write\n" ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); @@ -3543,7 +3543,7 @@ static void test_OpenFile(void) hFile = OpenFile(filename, &ofs, OF_EXIST); ok( hFile == 1, "OpenFile failed on finding our created file\n" ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); @@ -3556,7 +3556,7 @@ static void test_OpenFile(void) hFile = OpenFile(filename, &ofs, OF_DELETE); ok( hFile == 1, "OpenFile failed on delete (%d)\n", hFile ); ok( GetLastError() == 0xfaceabee || GetLastError() == ERROR_SUCCESS, - "GetLastError() returns %d\n", GetLastError() ); + "GetLastError() returns %ld\n", GetLastError() ); ok( ofs.cBytes == sizeof(OFSTRUCT), "OpenFile set ofs.cBytes to %d\n", ofs.cBytes ); ok( ofs.nErrCode == ERROR_SUCCESS || broken(ofs.nErrCode != ERROR_SUCCESS) /* win9x */, "OpenFile set ofs.nErrCode to %d\n", ofs.nErrCode ); @@ -3584,27 +3584,27 @@ static void test_overlapped(void) result = 1; r = GetOverlappedResult(0, &ov, &result, 0); if (r) - ok( result == 0, "wrong result %u\n", result ); + ok( result == 0, "wrong result %lu\n", result ); else /* win9x */ - ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError() );
result = 0; ov.Internal = 0; ov.InternalHigh = 0xabcd; r = GetOverlappedResult(0, &ov, &result, 0); if (r) - ok( result == 0xabcd, "wrong result %u\n", result ); + ok( result == 0xabcd, "wrong result %lu\n", result ); else /* win9x */ - ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError() );
SetLastError( 0xb00 ); result = 0; ov.Internal = STATUS_INVALID_HANDLE; ov.InternalHigh = 0xabcd; r = GetOverlappedResult(0, &ov, &result, 0); - ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError() ); ok( r == FALSE, "should return false\n"); - ok( result == 0xabcd || result == 0 /* win9x */, "wrong result %u\n", result ); + ok( result == 0xabcd || result == 0 /* win9x */, "wrong result %lu\n", result );
SetLastError( 0xb00 ); result = 0; @@ -3612,9 +3612,9 @@ static void test_overlapped(void) ov.InternalHigh = 0xabcd; r = GetOverlappedResult(0, &ov, &result, 0); ok( GetLastError() == ERROR_IO_INCOMPLETE || GetLastError() == ERROR_INVALID_HANDLE /* win9x */, - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); ok( r == FALSE, "should return false\n"); - ok( result == 0, "wrong result %u\n", result ); + ok( result == 0, "wrong result %lu\n", result );
SetLastError( 0xb00 ); ov.hEvent = CreateEventW( NULL, 1, 1, NULL ); @@ -3622,13 +3622,13 @@ static void test_overlapped(void) ov.InternalHigh = 0xabcd; r = GetOverlappedResult(0, &ov, &result, 0); ok( GetLastError() == ERROR_IO_INCOMPLETE || GetLastError() == ERROR_INVALID_HANDLE /* win9x */, - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); ok( r == FALSE, "should return false\n");
r = GetOverlappedResult( 0, &ov, &result, TRUE ); ok( r == TRUE, "should return TRUE\n" ); - ok( result == 0xabcd, "wrong result %u\n", result ); - ok( ov.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", ov.Internal ); + ok( result == 0xabcd, "wrong result %lu\n", result ); + ok( ov.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08Ix\n", ov.Internal );
ResetEvent( ov.hEvent );
@@ -3637,7 +3637,7 @@ static void test_overlapped(void) ov.InternalHigh = 0; r = GetOverlappedResult(0, &ov, &result, 0); ok( GetLastError() == ERROR_IO_INCOMPLETE || GetLastError() == ERROR_INVALID_HANDLE /* win9x */, - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); ok( r == FALSE, "should return false\n");
r = CloseHandle( ov.hEvent ); @@ -3650,19 +3650,19 @@ static void test_RemoveDirectory(void) char directory[] = "removeme";
rc = CreateDirectoryA(directory, NULL); - ok( rc, "Createdirectory failed, gle=%d\n", GetLastError() ); + ok( rc, "Createdirectory failed, gle=%ld\n", GetLastError() );
rc = SetCurrentDirectoryA(directory); - ok( rc, "SetCurrentDirectory failed, gle=%d\n", GetLastError() ); + ok( rc, "SetCurrentDirectory failed, gle=%ld\n", GetLastError() );
rc = RemoveDirectoryA("."); if (!rc) { rc = SetCurrentDirectoryA(".."); - ok( rc, "SetCurrentDirectory failed, gle=%d\n", GetLastError() ); + ok( rc, "SetCurrentDirectory failed, gle=%ld\n", GetLastError() );
rc = RemoveDirectoryA(directory); - ok( rc, "RemoveDirectory failed, gle=%d\n", GetLastError() ); + ok( rc, "RemoveDirectory failed, gle=%ld\n", GetLastError() ); } }
@@ -3688,17 +3688,17 @@ static void test_ReplaceFileA(void) char **argv;
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, replaced); - ok(ret != 0, "GetTempFileNameA error (replaced) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replaced) %ld\n", GetLastError());
ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %ld\n", GetLastError());
ret = GetTempFileNameA(temp_path, prefix, 0, backup); - ok(ret != 0, "GetTempFileNameA error (backup) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (backup) %ld\n", GetLastError());
/* place predictable data in the file to be replaced */ hReplacedFile = CreateFileA(replaced, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); @@ -3706,7 +3706,7 @@ static void test_ReplaceFileA(void) "failed to open replaced file\n"); retok = WriteFile(hReplacedFile, replacedData, sizeof(replacedData), &ret, NULL ); ok( retok && ret == sizeof(replacedData), - "WriteFile error (replaced) %d\n", GetLastError()); + "WriteFile error (replaced) %ld\n", GetLastError()); ok(GetFileSize(hReplacedFile, NULL) == sizeof(replacedData), "replaced file has wrong size\n"); /* place predictable data in the file to be the replacement */ @@ -3715,7 +3715,7 @@ static void test_ReplaceFileA(void) "failed to open replacement file\n"); retok = WriteFile(hReplacementFile, replacementData, sizeof(replacementData), &ret, NULL ); ok( retok && ret == sizeof(replacementData), - "WriteFile error (replacement) %d\n", GetLastError()); + "WriteFile error (replacement) %ld\n", GetLastError()); ok(GetFileSize(hReplacementFile, NULL) == sizeof(replacementData), "replacement file has wrong size\n"); /* place predictable data in the backup file (to be over-written) */ @@ -3724,28 +3724,28 @@ static void test_ReplaceFileA(void) "failed to open backup file\n"); retok = WriteFile(hBackupFile, backupData, sizeof(backupData), &ret, NULL ); ok( retok && ret == sizeof(backupData), - "WriteFile error (replacement) %d\n", GetLastError()); + "WriteFile error (replacement) %ld\n", GetLastError()); ok(GetFileSize(hBackupFile, NULL) == sizeof(backupData), "backup file has wrong size\n"); /* change the filetime on the "replaced" file to ensure that it changes */ ret = GetFileTime(hReplacedFile, NULL, NULL, &ftReplaced); - ok( ret, "GetFileTime error (replaced) %d\n", GetLastError()); + ok( ret, "GetFileTime error (replaced) %ld\n", GetLastError()); ftReplaced.dwLowDateTime -= 600000000; /* 60 second */ ret = SetFileTime(hReplacedFile, NULL, NULL, &ftReplaced); - ok( ret, "SetFileTime error (replaced) %d\n", GetLastError()); + ok( ret, "SetFileTime error (replaced) %ld\n", GetLastError()); GetFileTime(hReplacedFile, NULL, NULL, &ftReplaced); /* get the actual time back */ CloseHandle(hReplacedFile); /* change the filetime on the backup to ensure that it changes */ ret = GetFileTime(hBackupFile, NULL, NULL, &ftBackup); - ok( ret, "GetFileTime error (backup) %d\n", GetLastError()); + ok( ret, "GetFileTime error (backup) %ld\n", GetLastError()); ftBackup.dwLowDateTime -= 1200000000; /* 120 second */ ret = SetFileTime(hBackupFile, NULL, NULL, &ftBackup); - ok( ret, "SetFileTime error (backup) %d\n", GetLastError()); + ok( ret, "SetFileTime error (backup) %ld\n", GetLastError()); GetFileTime(hBackupFile, NULL, NULL, &ftBackup); /* get the actual time back */ CloseHandle(hBackupFile); /* get the filetime on the replacement file to perform checks */ ret = GetFileTime(hReplacementFile, NULL, NULL, &ftReplacement); - ok( ret, "GetFileTime error (replacement) %d\n", GetLastError()); + ok( ret, "GetFileTime error (replacement) %ld\n", GetLastError()); CloseHandle(hReplacementFile);
/* perform replacement w/ backup @@ -3753,37 +3753,37 @@ static void test_ReplaceFileA(void) */ SetLastError(0xdeadbeef); ret = ReplaceFileA(replaced, replacement, backup, 0, 0, 0); - ok(ret, "ReplaceFileA: unexpected error %d\n", GetLastError()); + ok(ret, "ReplaceFileA: unexpected error %ld\n", GetLastError()); /* make sure that the backup has the size of the old "replaced" file */ hBackupFile = CreateFileA(backup, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hBackupFile != INVALID_HANDLE_VALUE, "failed to open backup file\n"); ret = GetFileSize(hBackupFile, NULL); ok(ret == sizeof(replacedData), - "backup file has wrong size %d\n", ret); + "backup file has wrong size %ld\n", ret); /* make sure that the "replaced" file has the size of the replacement file */ hReplacedFile = CreateFileA(replaced, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hReplacedFile != INVALID_HANDLE_VALUE, - "failed to open replaced file: %d\n", GetLastError()); + "failed to open replaced file: %ld\n", GetLastError()); if (hReplacedFile != INVALID_HANDLE_VALUE) { ret = GetFileSize(hReplacedFile, NULL); ok(ret == sizeof(replacementData), - "replaced file has wrong size %d\n", ret); + "replaced file has wrong size %ld\n", ret); /* make sure that the replacement file no-longer exists */ hReplacementFile = CreateFileA(replacement, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hReplacementFile == INVALID_HANDLE_VALUE, - "unexpected error, replacement file should not exist %d\n", GetLastError()); + "unexpected error, replacement file should not exist %ld\n", GetLastError()); /* make sure that the backup has the old "replaced" filetime */ ret = GetFileTime(hBackupFile, NULL, NULL, &ftBackup); - ok( ret, "GetFileTime error (backup %d\n", GetLastError()); + ok( ret, "GetFileTime error (backup %ld\n", GetLastError()); ok(check_file_time(&ftBackup, &ftReplaced, 20000000), "backup file has wrong filetime\n"); CloseHandle(hBackupFile); /* make sure that the "replaced" has the old replacement filetime */ ret = GetFileTime(hReplacedFile, NULL, NULL, &ftReplaced); - ok( ret, "GetFileTime error (backup %d\n", GetLastError()); + ok( ret, "GetFileTime error (backup %ld\n", GetLastError()); ok(check_file_time(&ftReplaced, &ftReplacement, 20000000), - "replaced file has wrong filetime %x%08x / %x%08x\n", + "replaced file has wrong filetime %lx%08lx / %lx%08lx\n", ftReplaced.dwHighDateTime, ftReplaced.dwLowDateTime, ftReplacement.dwHighDateTime, ftReplacement.dwLowDateTime ); CloseHandle(hReplacedFile); @@ -3793,64 +3793,64 @@ static void test_ReplaceFileA(void)
/* re-create replacement file for pass w/o backup (blank) */ ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %ld\n", GetLastError()); /* perform replacement w/o backup * TODO: flags are not implemented */ SetLastError(0xdeadbeef); ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "ReplaceFileA: unexpected error %d\n", GetLastError()); + "ReplaceFileA: unexpected error %ld\n", GetLastError());
/* re-create replacement file for pass w/ backup (backup-file not existing) */ DeleteFileA(replacement); ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %ld\n", GetLastError()); ret = DeleteFileA(backup); - ok(ret, "DeleteFileA: error (backup) %d\n", GetLastError()); + ok(ret, "DeleteFileA: error (backup) %ld\n", GetLastError()); /* perform replacement w/ backup (no pre-existing backup) * TODO: flags are not implemented */ SetLastError(0xdeadbeef); ret = ReplaceFileA(replaced, replacement, backup, 0, 0, 0); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "ReplaceFileA: unexpected error %d\n", GetLastError()); + "ReplaceFileA: unexpected error %ld\n", GetLastError()); if (ret) removeBackup = TRUE;
/* re-create replacement file for pass w/ no permissions to "replaced" */ DeleteFileA(replacement); ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %ld\n", GetLastError()); ret = SetFileAttributesA(replaced, FILE_ATTRIBUTE_READONLY); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "SetFileAttributesA: error setting to read only %d\n", GetLastError()); + "SetFileAttributesA: error setting to read only %ld\n", GetLastError()); /* perform replacement w/ backup (no permission to "replaced") * TODO: flags are not implemented */ SetLastError(0xdeadbeef); ret = ReplaceFileA(replaced, replacement, backup, 0, 0, 0); - ok(ret == 0 && GetLastError() == ERROR_ACCESS_DENIED, "ReplaceFileA: unexpected error %d\n", GetLastError()); + ok(ret == 0 && GetLastError() == ERROR_ACCESS_DENIED, "ReplaceFileA: unexpected error %ld\n", GetLastError()); /* make sure that the replacement file still exists */ hReplacementFile = CreateFileA(replacement, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hReplacementFile != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* win2k */ - "unexpected error, replacement file should still exist %d\n", GetLastError()); + "unexpected error, replacement file should still exist %ld\n", GetLastError()); CloseHandle(hReplacementFile); ret = SetFileAttributesA(replaced, FILE_ATTRIBUTE_NORMAL); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "SetFileAttributesA: error setting to normal %d\n", GetLastError()); + "SetFileAttributesA: error setting to normal %ld\n", GetLastError());
/* replacement readonly */ DeleteFileA(replacement); ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %#x\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %#lx\n", GetLastError()); ret = SetFileAttributesA(replacement, FILE_ATTRIBUTE_READONLY); - ok(ret, "SetFileAttributesA: error setting to readonly %#x\n", GetLastError()); + ok(ret, "SetFileAttributesA: error setting to readonly %#lx\n", GetLastError()); ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); - ok(GetLastError() == ERROR_ACCESS_DENIED, "ReplaceFileA: unexpected error %#x\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "ReplaceFileA: unexpected error %#lx\n", GetLastError()); ret = SetFileAttributesA(replacement, FILE_ATTRIBUTE_NORMAL); - ok(ret, "SetFileAttributesA: error setting to normal %#x\n", GetLastError()); + ok(ret, "SetFileAttributesA: error setting to normal %#lx\n", GetLastError());
/* re-create replacement file for pass w/ replaced opened with * the same permissions as an exe (Replicating an exe trying to @@ -3858,32 +3858,32 @@ static void test_ReplaceFileA(void) */ DeleteFileA(replacement); ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %ld\n", GetLastError());
/* make sure that the replaced file is opened like an exe*/ hReplacedFile = CreateFileA(replaced, GENERIC_READ | SYNCHRONIZE, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); ok(hReplacedFile != INVALID_HANDLE_VALUE, - "unexpected error, replaced file should be able to be opened %d\n", GetLastError()); + "unexpected error, replaced file should be able to be opened %ld\n", GetLastError()); /*Calling ReplaceFileA on an exe should succeed*/ ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); - ok(ret, "ReplaceFileA: unexpected error %d\n", GetLastError()); + ok(ret, "ReplaceFileA: unexpected error %ld\n", GetLastError()); CloseHandle(hReplacedFile);
/* replace file while replacement is opened */ ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameA error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error (replacement) %ld\n", GetLastError()); hReplacementFile = CreateFileA(replacement, GENERIC_READ | SYNCHRONIZE, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); - ok(hReplacementFile != INVALID_HANDLE_VALUE, "unexpected error, replacement file should be able to be opened %d\n", + ok(hReplacementFile != INVALID_HANDLE_VALUE, "unexpected error, replacement file should be able to be opened %ld\n", GetLastError()); ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); ok(!ret, "expect failure\n"); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "expect ERROR_SHARING_VIOLATION, got %#x.\n", GetLastError()); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "expect ERROR_SHARING_VIOLATION, got %#lx.\n", GetLastError()); CloseHandle(hReplacementFile);
/* replacement file still exists, make pass w/o "replaced" */ ret = DeleteFileA(replaced); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "DeleteFileA: error (replaced) %d\n", GetLastError()); + "DeleteFileA: error (replaced) %ld\n", GetLastError()); /* perform replacement w/ backup (no pre-existing backup or "replaced") * TODO: flags are not implemented */ @@ -3891,7 +3891,7 @@ static void test_ReplaceFileA(void) ret = ReplaceFileA(replaced, replacement, backup, 0, 0, 0); ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_ACCESS_DENIED), - "ReplaceFileA: unexpected error %d\n", GetLastError()); + "ReplaceFileA: unexpected error %ld\n", GetLastError());
/* perform replacement w/o existing "replacement" file * TODO: flags are not implemented @@ -3900,7 +3900,7 @@ static void test_ReplaceFileA(void) ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_ACCESS_DENIED), - "ReplaceFileA: unexpected error %d\n", GetLastError()); + "ReplaceFileA: unexpected error %ld\n", GetLastError()); DeleteFileA( replacement );
/* @@ -3915,45 +3915,45 @@ static void test_ReplaceFileA(void) ret = DeleteFileA(backup); ok(ret || broken(GetLastError() == ERROR_ACCESS_DENIED), /* win2k */ - "DeleteFileA: error (backup) %d\n", GetLastError()); + "DeleteFileA: error (backup) %ld\n", GetLastError()); }
ret = GetTempFileNameA(temp_path, prefix, 0, replaced); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); hReplacedFile = CreateFileA(replaced, 0, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hReplacedFile != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(hReplacedFile != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
CloseHandle(hReplacedFile); ret = DeleteFileA(replaced); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
winetest_get_mainargs(&argv);
ret = CopyFileA(argv[0], replaced, FALSE); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); hReplacedFile = CreateFileA(replaced, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); - ok(hReplacedFile != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(hReplacedFile != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
mapping = CreateFileMappingA(hReplacedFile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL); - ok(!!mapping, "got error %u\n", GetLastError()); + ok(!!mapping, "got error %lu\n", GetLastError());
ret = GetTempFileNameA(temp_path, prefix, 0, replacement); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
CloseHandle(mapping); CloseHandle(hReplacedFile); ret = DeleteFileA(replaced); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); }
/* @@ -3980,60 +3980,60 @@ static void test_ReplaceFileW(void) win_skip("GetTempPathW is not available\n"); return; } - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, replaced); - ok(ret != 0, "GetTempFileNameW error (replaced) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error (replaced) %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameW error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error (replacement) %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, backup); - ok(ret != 0, "GetTempFileNameW error (backup) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error (backup) %ld\n", GetLastError());
ret = pReplaceFileW(replaced, replacement, backup, 0, 0, 0); - ok(ret, "ReplaceFileW: error %d\n", GetLastError()); + ok(ret, "ReplaceFileW: error %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameW error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error (replacement) %ld\n", GetLastError()); ret = pReplaceFileW(replaced, replacement, NULL, 0, 0, 0); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "ReplaceFileW: error %d\n", GetLastError()); + "ReplaceFileW: error %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameW error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error (replacement) %ld\n", GetLastError()); ret = DeleteFileW(backup); - ok(ret, "DeleteFileW: error (backup) %d\n", GetLastError()); + ok(ret, "DeleteFileW: error (backup) %ld\n", GetLastError()); ret = pReplaceFileW(replaced, replacement, backup, 0, 0, 0); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "ReplaceFileW: error %d\n", GetLastError()); + "ReplaceFileW: error %ld\n", GetLastError());
ret = GetTempFileNameW(temp_path, prefix, 0, replacement); - ok(ret != 0, "GetTempFileNameW error (replacement) %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error (replacement) %ld\n", GetLastError()); ret = SetFileAttributesW(replaced, FILE_ATTRIBUTE_READONLY); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "SetFileAttributesW: error setting to read only %d\n", GetLastError()); + "SetFileAttributesW: error setting to read only %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = pReplaceFileW(replaced, replacement, backup, 0, 0, 0); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError()); ret = SetFileAttributesW(replaced, FILE_ATTRIBUTE_NORMAL); ok(ret || GetLastError() == ERROR_ACCESS_DENIED, - "SetFileAttributesW: error setting to normal %d\n", GetLastError()); + "SetFileAttributesW: error setting to normal %ld\n", GetLastError()); if (ret) removeBackup = TRUE;
ret = DeleteFileW(replaced); - ok(ret, "DeleteFileW: error (replaced) %d\n", GetLastError()); + ok(ret, "DeleteFileW: error (replaced) %ld\n", GetLastError()); ret = pReplaceFileW(replaced, replacement, backup, 0, 0, 0); - ok(!ret, "ReplaceFileW: error %d\n", GetLastError()); + ok(!ret, "ReplaceFileW: error %ld\n", GetLastError());
ret = pReplaceFileW(replaced, replacement, NULL, 0, 0, 0); ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_ACCESS_DENIED), - "ReplaceFileW: unexpected error %d\n", GetLastError()); + "ReplaceFileW: unexpected error %ld\n", GetLastError()); DeleteFileW( replacement );
if (removeBackup) @@ -4041,7 +4041,7 @@ static void test_ReplaceFileW(void) ret = DeleteFileW(backup); ok(ret || broken(GetLastError() == ERROR_ACCESS_DENIED), /* win2k */ - "DeleteFileW: error (backup) %d\n", GetLastError()); + "DeleteFileW: error (backup) %ld\n", GetLastError()); } }
@@ -4100,25 +4100,25 @@ static void test_CreateFile(void) { /* FIXME: remove once Wine is fixed */ todo_wine_if (i == 5) - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); } else { /* FIXME: remove once Wine is fixed */ todo_wine_if (i == 1) - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "%ld: expected ERROR_ACCESS_DENIED, got %ld\n", i, GetLastError()); }
SetLastError(0xdeadbeef); hfile = CreateFileA(temp_path, GENERIC_WRITE, 0, NULL, i, 0, 0); ok(hfile == INVALID_HANDLE_VALUE, "CreateFile should fail\n"); if (i == 0) - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); else { /* FIXME: remove once Wine is fixed */ todo_wine_if (i == 1) - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "%ld: expected ERROR_ACCESS_DENIED, got %ld\n", i, GetLastError()); } }
@@ -4128,27 +4128,27 @@ static void test_CreateFile(void) hfile = CreateFileA(file_name, td[i].access, 0, NULL, td[i].disposition, 0, 0); if (!td[i].error) { - ok(hfile != INVALID_HANDLE_VALUE, "%d: CreateFile error %d\n", i, GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "%ld: CreateFile error %ld\n", i, GetLastError()); written = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WriteFile(hfile, &td[i].error, sizeof(td[i].error), &written, NULL); if (td[i].access & GENERIC_WRITE) - ok(ret, "%d: WriteFile error %d\n", i, GetLastError()); + ok(ret, "%ld: WriteFile error %ld\n", i, GetLastError()); else { - ok(!ret, "%d: WriteFile should fail\n", i); - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + ok(!ret, "%ld: WriteFile should fail\n", i); + ok(GetLastError() == ERROR_ACCESS_DENIED, "%ld: expected ERROR_ACCESS_DENIED, got %ld\n", i, GetLastError()); } SetLastError(0xdeadbeef); ret = SetFileTime(hfile, NULL, NULL, NULL); if (td[i].access & GENERIC_WRITE) /* actually FILE_WRITE_ATTRIBUTES */ - ok(ret, "%d: SetFileTime error %d\n", i, GetLastError()); + ok(ret, "%ld: SetFileTime error %ld\n", i, GetLastError()); else { todo_wine { - ok(!ret, "%d: SetFileTime should fail\n", i); - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + ok(!ret, "%ld: SetFileTime should fail\n", i); + ok(GetLastError() == ERROR_ACCESS_DENIED, "%ld: expected ERROR_ACCESS_DENIED, got %ld\n", i, GetLastError()); } } CloseHandle(hfile); @@ -4160,15 +4160,15 @@ static void test_CreateFile(void) { todo_wine { - ok(hfile == INVALID_HANDLE_VALUE, "%d: CreateFile should fail\n", i); - ok(GetLastError() == td[i].error, "%d: expected %d, got %d\n", i, td[i].error, GetLastError()); + ok(hfile == INVALID_HANDLE_VALUE, "%ld: CreateFile should fail\n", i); + ok(GetLastError() == td[i].error, "%ld: expected %ld, got %ld\n", i, td[i].error, GetLastError()); } CloseHandle(hfile); } else { - ok(hfile == INVALID_HANDLE_VALUE, "%d: CreateFile should fail\n", i); - ok(GetLastError() == td[i].error, "%d: expected %d, got %d\n", i, td[i].error, GetLastError()); + ok(hfile == INVALID_HANDLE_VALUE, "%ld: CreateFile should fail\n", i); + ok(GetLastError() == td[i].error, "%ld: expected %ld, got %ld\n", i, td[i].error, GetLastError()); } }
@@ -4214,26 +4214,26 @@ static void test_GetFileInformationByHandleEx(void) }
ret2 = GetTempPathA(sizeof(tempPath), tempPath); - ok(ret2, "GetFileInformationByHandleEx: GetTempPathA failed, got error %u.\n", GetLastError()); + ok(ret2, "GetFileInformationByHandleEx: GetTempPathA failed, got error %lu.\n", GetLastError());
/* ensure the existence of a file in the temp folder */ ret2 = GetTempFileNameA(tempPath, "abc", 0, tempFileName); - ok(ret2, "GetFileInformationByHandleEx: GetTempFileNameA failed, got error %u.\n", GetLastError()); + ok(ret2, "GetFileInformationByHandleEx: GetTempFileNameA failed, got error %lu.\n", GetLastError()); ret2 = GetFileAttributesA(tempFileName); ok(ret2 != INVALID_FILE_ATTRIBUTES, "GetFileInformationByHandleEx: " - "GetFileAttributesA failed to find the temp file, got error %u.\n", GetLastError()); + "GetFileAttributesA failed to find the temp file, got error %lu.\n", GetLastError());
directory = CreateFileA(tempPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); ok(directory != INVALID_HANDLE_VALUE, "GetFileInformationByHandleEx: failed to open the temp folder, " - "got error %u.\n", GetLastError()); + "got error %lu.\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(checks); i += 1) { SetLastError(0xdeadbeef); ret = pGetFileInformationByHandleEx(directory, checks[i].handleClass, checks[i].ptr, checks[i].size); - ok(!ret && GetLastError() == checks[i].errorCode, "GetFileInformationByHandleEx: expected error %u, " - "got %u.\n", checks[i].errorCode, GetLastError()); + ok(!ret && GetLastError() == checks[i].errorCode, "GetFileInformationByHandleEx: expected error %lu, " + "got %lu.\n", checks[i].errorCode, GetLastError()); }
while (TRUE) @@ -4242,7 +4242,7 @@ static void test_GetFileInformationByHandleEx(void) ret = pGetFileInformationByHandleEx(directory, FileIdBothDirectoryInfo, buffer, sizeof(buffer)); if (!ret && GetLastError() == ERROR_NO_MORE_FILES) break; - ok(ret, "GetFileInformationByHandleEx: failed to query for FileIdBothDirectoryInfo, got error %u.\n", GetLastError()); + ok(ret, "GetFileInformationByHandleEx: failed to query for FileIdBothDirectoryInfo, got error %lu.\n", GetLastError()); if (!ret) break; bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer; @@ -4262,12 +4262,12 @@ static void test_GetFileInformationByHandleEx(void) file = CreateFileA(tempFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL); ok(file != INVALID_HANDLE_VALUE, "GetFileInformationByHandleEx: failed to open the temp file, " - "got error %u.\n", GetLastError()); + "got error %lu.\n", GetLastError());
/* Test FileBasicInfo; make sure the write time changes when a file is updated */ memset(buffer, 0xff, sizeof(buffer)); ret = pGetFileInformationByHandleEx(file, FileBasicInfo, buffer, sizeof(buffer)); - ok(ret, "GetFileInformationByHandleEx: failed to get FileBasicInfo, %u\n", GetLastError()); + ok(ret, "GetFileInformationByHandleEx: failed to get FileBasicInfo, %lu\n", GetLastError()); basicInfo = (FILE_BASIC_INFO *)buffer; prevWrite = basicInfo->LastWriteTime; CloseHandle(file); @@ -4278,7 +4278,7 @@ static void test_GetFileInformationByHandleEx(void) file = CreateFileA(tempFileName, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL); ok(file != INVALID_HANDLE_VALUE, "GetFileInformationByHandleEx: failed to open the temp file, " - "got error %u.\n", GetLastError()); + "got error %lu.\n", GetLastError()); ret = WriteFile(file, tempFileName, strlen(tempFileName), &written, NULL); ok(ret, "GetFileInformationByHandleEx: Write failed\n"); CloseHandle(file); @@ -4286,11 +4286,11 @@ static void test_GetFileInformationByHandleEx(void) file = CreateFileA(tempFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL); ok(file != INVALID_HANDLE_VALUE, "GetFileInformationByHandleEx: failed to open the temp file, " - "got error %u.\n", GetLastError()); + "got error %lu.\n", GetLastError());
memset(buffer, 0xff, sizeof(buffer)); ret = pGetFileInformationByHandleEx(file, FileBasicInfo, buffer, sizeof(buffer)); - ok(ret, "GetFileInformationByHandleEx: failed to get FileBasicInfo, %u\n", GetLastError()); + ok(ret, "GetFileInformationByHandleEx: failed to get FileBasicInfo, %lu\n", GetLastError()); basicInfo = (FILE_BASIC_INFO *)buffer; /* Could also check that the creation time didn't change - on windows * it doesn't, but on wine, it does change even if it shouldn't. */ @@ -4300,7 +4300,7 @@ static void test_GetFileInformationByHandleEx(void) /* Test FileStandardInfo, check some basic parameters */ memset(buffer, 0xff, sizeof(buffer)); ret = pGetFileInformationByHandleEx(file, FileStandardInfo, buffer, sizeof(buffer)); - ok(ret, "GetFileInformationByHandleEx: failed to get FileStandardInfo, %u\n", GetLastError()); + ok(ret, "GetFileInformationByHandleEx: failed to get FileStandardInfo, %lu\n", GetLastError()); standardInfo = (FILE_STANDARD_INFO *)buffer; ok(standardInfo->NumberOfLinks == 1, "GetFileInformationByHandleEx: Unexpected number of links\n"); ok(standardInfo->DeletePending == FALSE, "GetFileInformationByHandleEx: Unexpected pending delete\n"); @@ -4309,7 +4309,7 @@ static void test_GetFileInformationByHandleEx(void) /* Test FileNameInfo */ memset(buffer, 0xff, sizeof(buffer)); ret = pGetFileInformationByHandleEx(file, FileNameInfo, buffer, sizeof(buffer)); - ok(ret, "GetFileInformationByHandleEx: failed to get FileNameInfo, %u\n", GetLastError()); + ok(ret, "GetFileInformationByHandleEx: failed to get FileNameInfo, %lu\n", GetLastError()); nameInfo = (FILE_NAME_INFO *)buffer; strPtr = strchr(tempFileName, '\'); ok(strPtr != NULL, "GetFileInformationByHandleEx: Temp filename didn't contain backslash\n"); @@ -4322,23 +4322,23 @@ static void test_GetFileInformationByHandleEx(void) /* invalid classes */ SetLastError(0xdeadbeef); ret = pGetFileInformationByHandleEx(file, FileEndOfFileInfo, &eofinfo, sizeof(eofinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetFileInformationByHandleEx(file, FileIoPriorityHintInfo, &priohintinfo, sizeof(priohintinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetFileInformationByHandleEx(file, FileAllocationInfo, &allocinfo, sizeof(allocinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetFileInformationByHandleEx(file, FileDispositionInfo, &dispinfo, sizeof(dispinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetFileInformationByHandleEx(file, FileRenameInfo, &renameinfo, sizeof(renameinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
CloseHandle(file); DeleteFileA(tempFileName); @@ -4361,38 +4361,38 @@ static void test_OpenFileById(void) }
ret2 = GetTempPathA(sizeof(tempPath), tempPath); - ok(ret2, "OpenFileById: GetTempPath failed, got error %u.\n", GetLastError()); + ok(ret2, "OpenFileById: GetTempPath failed, got error %lu.\n", GetLastError());
/* ensure the existence of a file in the temp folder */ ret2 = GetTempFileNameA(tempPath, "abc", 0, tempFileName); - ok(ret2, "OpenFileById: GetTempFileNameA failed, got error %u.\n", GetLastError()); + ok(ret2, "OpenFileById: GetTempFileNameA failed, got error %lu.\n", GetLastError()); ret2 = GetFileAttributesA(tempFileName); ok(ret2 != INVALID_FILE_ATTRIBUTES, - "OpenFileById: GetFileAttributesA failed to find the temp file, got error %u\n", GetLastError()); + "OpenFileById: GetFileAttributesA failed to find the temp file, got error %lu\n", GetLastError());
ret2 = MultiByteToWideChar(CP_ACP, 0, tempFileName + strlen(tempPath), -1, tempFileNameW, ARRAY_SIZE(tempFileNameW)); - ok(ret2, "OpenFileById: MultiByteToWideChar failed to convert tempFileName, got error %u.\n", GetLastError()); + ok(ret2, "OpenFileById: MultiByteToWideChar failed to convert tempFileName, got error %lu.\n", GetLastError()); tempFileNameLen = ret2 - 1;
tempFile = CreateFileA(tempFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); ok(tempFile != INVALID_HANDLE_VALUE, "OpenFileById: failed to create a temp file, " - "got error %u.\n", GetLastError()); - ret2 = sprintf(tickCount, "%u", GetTickCount()); + "got error %lu.\n", GetLastError()); + ret2 = sprintf(tickCount, "%lu", GetTickCount()); ret = WriteFile(tempFile, tickCount, ret2, &count, NULL); - ok(ret, "OpenFileById: WriteFile failed, got error %u.\n", GetLastError()); + ok(ret, "OpenFileById: WriteFile failed, got error %lu.\n", GetLastError()); CloseHandle(tempFile);
directory = CreateFileA(tempPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); ok(directory != INVALID_HANDLE_VALUE, "OpenFileById: failed to open the temp folder, " - "got error %u.\n", GetLastError()); + "got error %lu.\n", GetLastError());
/* get info about the temp folder itself */ bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer; ret = pGetFileInformationByHandleEx(directory, FileIdBothDirectoryInfo, buffer, sizeof(buffer)); - ok(ret, "OpenFileById: failed to query for FileIdBothDirectoryInfo, got error %u.\n", GetLastError()); + ok(ret, "OpenFileById: failed to query for FileIdBothDirectoryInfo, got error %lu.\n", GetLastError()); ok(bothDirInfo->FileNameLength == sizeof(WCHAR) && bothDirInfo->FileName[0] == '.', - "OpenFileById: failed to return the temp folder at the first entry, got error %u.\n", GetLastError()); + "OpenFileById: failed to return the temp folder at the first entry, got error %lu.\n", GetLastError());
/* open the temp folder itself */ fileIdDescr.dwSize = sizeof(fileIdDescr); @@ -4400,7 +4400,7 @@ static void test_OpenFileById(void) U(fileIdDescr).FileId = bothDirInfo->FileId; handle = pOpenFileById(directory, &fileIdDescr, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, 0); todo_wine - ok(handle != INVALID_HANDLE_VALUE, "OpenFileById: failed to open the temp folder itself, got error %u.\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "OpenFileById: failed to open the temp folder itself, got error %lu.\n", GetLastError()); CloseHandle(handle);
/* find the temp file in the temp folder */ @@ -4408,7 +4408,7 @@ static void test_OpenFileById(void) while (!found) { ret = pGetFileInformationByHandleEx(directory, FileIdBothDirectoryInfo, buffer, sizeof(buffer)); - ok(ret, "OpenFileById: failed to query for FileIdBothDirectoryInfo, got error %u.\n", GetLastError()); + ok(ret, "OpenFileById: failed to query for FileIdBothDirectoryInfo, got error %lu.\n", GetLastError()); if (!ret) break; bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer; @@ -4430,17 +4430,17 @@ static void test_OpenFileById(void) SetLastError(0xdeadbeef); handle = pOpenFileById(directory, NULL, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, 0); ok(handle == INVALID_HANDLE_VALUE && GetLastError() == ERROR_INVALID_PARAMETER, - "OpenFileById: expected ERROR_INVALID_PARAMETER, got error %u.\n", GetLastError()); + "OpenFileById: expected ERROR_INVALID_PARAMETER, got error %lu.\n", GetLastError());
fileIdDescr.dwSize = sizeof(fileIdDescr); fileIdDescr.Type = FileIdType; U(fileIdDescr).FileId = bothDirInfo->FileId; handle = pOpenFileById(directory, &fileIdDescr, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, 0); - ok(handle != INVALID_HANDLE_VALUE, "OpenFileById: failed to open the file, got error %u.\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "OpenFileById: failed to open the file, got error %lu.\n", GetLastError());
ret = ReadFile(handle, buffer, sizeof(buffer), &count, NULL); buffer[count] = 0; - ok(ret, "OpenFileById: ReadFile failed, got error %u.\n", GetLastError()); + ok(ret, "OpenFileById: ReadFile failed, got error %lu.\n", GetLastError()); ok(strcmp(tickCount, buffer) == 0, "OpenFileById: invalid contents of the temp file.\n");
CloseHandle(handle); @@ -4472,13 +4472,13 @@ static void test_SetFileValidData(void) ret = pSetFileValidData(INVALID_HANDLE_VALUE, 0); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_INVALID_HANDLE, "got %u\n", error); + ok(error == ERROR_INVALID_HANDLE, "got %lu\n", error);
SetLastError(0xdeadbeef); ret = pSetFileValidData(INVALID_HANDLE_VALUE, -1); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_INVALID_HANDLE, "got %u\n", error); + ok(error == ERROR_INVALID_HANDLE, "got %lu\n", error);
/* file opened for reading */ handle = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -4487,13 +4487,13 @@ static void test_SetFileValidData(void) ret = pSetFileValidData(handle, 0); ok(!ret, "SetFileValidData succeeded\n"); error = GetLastError(); - ok(error == ERROR_ACCESS_DENIED, "got %u\n", error); + ok(error == ERROR_ACCESS_DENIED, "got %lu\n", error);
SetLastError(0xdeadbeef); ret = pSetFileValidData(handle, -1); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_ACCESS_DENIED, "got %u\n", error); + ok(error == ERROR_ACCESS_DENIED, "got %lu\n", error); CloseHandle(handle);
handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -4502,7 +4502,7 @@ static void test_SetFileValidData(void) ret = pSetFileValidData(handle, 0); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - todo_wine ok(error == ERROR_PRIVILEGE_NOT_HELD, "got %u\n", error); + todo_wine ok(error == ERROR_PRIVILEGE_NOT_HELD, "got %lu\n", error); CloseHandle(handle);
privs.PrivilegeCount = 1; @@ -4524,58 +4524,58 @@ static void test_SetFileValidData(void) ret = pSetFileValidData(handle, 0); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
SetLastError(0xdeadbeef); ret = pSetFileValidData(handle, -1); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
SetLastError(0xdeadbeef); ret = pSetFileValidData(handle, 2); error = GetLastError(); todo_wine ok(!ret, "SetFileValidData succeeded\n"); - todo_wine ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + todo_wine ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
ret = pSetFileValidData(handle, 4); - ok(ret, "SetFileValidData failed %u\n", GetLastError()); + ok(ret, "SetFileValidData failed %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pSetFileValidData(handle, 8); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
count = SetFilePointer(handle, 1024, NULL, FILE_END); - ok(count != INVALID_SET_FILE_POINTER, "SetFilePointer failed %u\n", GetLastError()); + ok(count != INVALID_SET_FILE_POINTER, "SetFilePointer failed %lu\n", GetLastError()); ret = SetEndOfFile(handle); - ok(ret, "SetEndOfFile failed %u\n", GetLastError()); + ok(ret, "SetEndOfFile failed %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pSetFileValidData(handle, 2); error = GetLastError(); todo_wine ok(!ret, "SetFileValidData succeeded\n"); - todo_wine ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + todo_wine ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
ret = pSetFileValidData(handle, 4); - ok(ret, "SetFileValidData failed %u\n", GetLastError()); + ok(ret, "SetFileValidData failed %lu\n", GetLastError());
ret = pSetFileValidData(handle, 8); - ok(ret, "SetFileValidData failed %u\n", GetLastError()); + ok(ret, "SetFileValidData failed %lu\n", GetLastError());
ret = pSetFileValidData(handle, 4); error = GetLastError(); todo_wine ok(!ret, "SetFileValidData succeeded\n"); - todo_wine ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + todo_wine ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
ret = pSetFileValidData(handle, 1024); - ok(ret, "SetFileValidData failed %u\n", GetLastError()); + ok(ret, "SetFileValidData failed %lu\n", GetLastError());
ret = pSetFileValidData(handle, 2048); error = GetLastError(); ok(!ret, "SetFileValidData succeeded\n"); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
privs.Privileges[0].Attributes = 0; AdjustTokenPrivileges(token, FALSE, &privs, sizeof(privs), NULL, NULL); @@ -4626,54 +4626,54 @@ static void test_ReOpenFile(void)
file = CreateFileA(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(file != INVALID_HANDLE_VALUE, "failed to create file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to create file, error %lu\n", GetLastError()); ret = WriteFile(file, "foo", 4, &size, NULL); - ok(ret, "failed to write file, error %u\n", GetLastError()); + ok(ret, "failed to write file, error %lu\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(invalid_attributes); ++i) { SetLastError(0xdeadbeef); new = pReOpenFile(file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, invalid_attributes[i]); ok(new == INVALID_HANDLE_VALUE, "got %p\n", new); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError()); }
new = pReOpenFile(file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0); - ok(new != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(new != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
ret = ReadFile(new, buffer, sizeof(buffer), &size, NULL); - ok(ret, "failed to read file, error %u\n", GetLastError()); - ok(size == 4, "got size %u\n", size); + ok(ret, "failed to read file, error %lu\n", GetLastError()); + ok(size == 4, "got size %lu\n", size); ok(!strcmp(buffer, "foo"), "got wrong data\n"); CloseHandle(new);
for (i = 0; i < ARRAY_SIZE(valid_attributes); ++i) { new = pReOpenFile(file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, valid_attributes[i]); - ok(new != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(new != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError()); CloseHandle(new); }
SetLastError(0xdeadbeef); new = pReOpenFile(file, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0); ok(new == INVALID_HANDLE_VALUE, "got %p\n", new); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "got error %lu\n", GetLastError());
CloseHandle(file); ret = DeleteFileA(filename); - ok(ret, "failed to delete file, error %u\n", GetLastError()); + ok(ret, "failed to delete file, error %lu\n", GetLastError());
file = CreateNamedPipeA("\\.\pipe\test_pipe", PIPE_ACCESS_DUPLEX, 0, 1, 1000, 1000, 1000, NULL); - ok(file != INVALID_HANDLE_VALUE, "failed to create pipe, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to create pipe, error %lu\n", GetLastError());
new = pReOpenFile(file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0); - ok(new != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(new != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
ret = WriteFile(file, "foo", 4, &size, NULL); - ok(ret, "failed to write file, error %u\n", GetLastError()); + ok(ret, "failed to write file, error %lu\n", GetLastError()); ret = ReadFile(new, buffer, sizeof(buffer), &size, NULL); - ok(ret, "failed to read file, error %u\n", GetLastError()); - ok(size == 4, "got size %u\n", size); + ok(ret, "failed to read file, error %lu\n", GetLastError()); + ok(size == 4, "got size %lu\n", size); ok(!strcmp(buffer, "foo"), "got wrong data\n");
CloseHandle(new); @@ -4695,29 +4695,29 @@ static void test_WriteFileGather(void) evt = CreateEventW( NULL, TRUE, FALSE, NULL );
ret = GetTempPathA( MAX_PATH, temp_path ); - ok( ret != 0, "GetTempPathA error %d\n", GetLastError() ); + ok( ret != 0, "GetTempPathA error %ld\n", GetLastError() ); ok( ret < MAX_PATH, "temp path should fit into MAX_PATH\n" ); ret = GetTempFileNameA( temp_path, "wfg", 0, filename ); - ok( ret != 0, "GetTempFileNameA error %d\n", GetLastError() ); + ok( ret != 0, "GetTempFileNameA error %ld\n", GetLastError() );
hfile = CreateFileA( filename, GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED | FILE_ATTRIBUTE_NORMAL, 0 ); - ok( hfile != INVALID_HANDLE_VALUE, "CreateFile failed err %u\n", GetLastError() ); + ok( hfile != INVALID_HANDLE_VALUE, "CreateFile failed err %lu\n", GetLastError() ); if (hfile == INVALID_HANDLE_VALUE) return;
hiocp1 = CreateIoCompletionPort( INVALID_HANDLE_VALUE, NULL, 999, 0 ); hiocp2 = CreateIoCompletionPort( hfile, hiocp1, 999, 0 ); - ok( hiocp2 != 0, "CreateIoCompletionPort failed err %u\n", GetLastError() ); + ok( hiocp2 != 0, "CreateIoCompletionPort failed err %lu\n", GetLastError() );
GetSystemInfo( &si ); wbuf = VirtualAlloc( NULL, si.dwPageSize, MEM_COMMIT, PAGE_READWRITE ); - ok( wbuf != NULL, "VirtualAlloc failed err %u\n", GetLastError() ); + ok( wbuf != NULL, "VirtualAlloc failed err %lu\n", GetLastError() );
rbuf1 = VirtualAlloc( NULL, si.dwPageSize, MEM_COMMIT, PAGE_READWRITE ); - ok( rbuf1 != NULL, "VirtualAlloc failed err %u\n", GetLastError() ); + ok( rbuf1 != NULL, "VirtualAlloc failed err %lu\n", GetLastError() );
rbuf2 = VirtualAlloc( NULL, si.dwPageSize, MEM_COMMIT, PAGE_READWRITE ); - ok( rbuf2 != NULL, "VirtualAlloc failed err %u\n", GetLastError() ); + ok( rbuf2 != NULL, "VirtualAlloc failed err %lu\n", GetLastError() );
memset( &ovl, 0, sizeof(ovl) ); ovl.hEvent = evt; @@ -4726,16 +4726,16 @@ static void test_WriteFileGather(void) memset( wbuf, 0x42, si.dwPageSize ); SetLastError( 0xdeadbeef ); if (!WriteFileGather( hfile, fse, si.dwPageSize, NULL, &ovl )) - ok( GetLastError() == ERROR_IO_PENDING, "WriteFileGather failed err %u\n", GetLastError() ); + ok( GetLastError() == ERROR_IO_PENDING, "WriteFileGather failed err %lu\n", GetLastError() );
ret = GetQueuedCompletionStatus( hiocp2, &size, &key, &povl, 1000 ); - ok( ret, "GetQueuedCompletionStatus failed err %u\n", GetLastError()); + ok( ret, "GetQueuedCompletionStatus failed err %lu\n", GetLastError()); ok( povl == &ovl, "wrong ovl %p\n", povl );
tx = 0; br = GetOverlappedResult( hfile, &ovl, &tx, TRUE ); - ok( br == TRUE, "GetOverlappedResult failed: %u\n", GetLastError() ); - ok( tx == si.dwPageSize, "got unexpected bytes transferred: %u\n", tx ); + ok( br == TRUE, "GetOverlappedResult failed: %lu\n", GetLastError() ); + ok( tx == si.dwPageSize, "got unexpected bytes transferred: %lu\n", tx );
ResetEvent( evt );
@@ -4748,16 +4748,16 @@ static void test_WriteFileGather(void) SetLastError( 0xdeadbeef ); br = ReadFileScatter( hfile, fse, si.dwPageSize, NULL, &ovl ); ok( br == FALSE, "ReadFileScatter should be asynchronous\n" ); - ok( GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed err %u\n", GetLastError() ); + ok( GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed err %lu\n", GetLastError() );
ret = GetQueuedCompletionStatus( hiocp2, &size, &key, &povl, 1000 ); - ok( ret, "GetQueuedCompletionStatus failed err %u\n", GetLastError()); + ok( ret, "GetQueuedCompletionStatus failed err %lu\n", GetLastError()); ok( povl == &ovl, "wrong ovl %p\n", povl );
tx = 0; br = GetOverlappedResult( hfile, &ovl, &tx, TRUE ); - ok( br == TRUE, "GetOverlappedResult failed: %u\n", GetLastError() ); - ok( tx == si.dwPageSize, "got unexpected bytes transferred: %u\n", tx ); + ok( br == TRUE, "GetOverlappedResult failed: %lu\n", GetLastError() ); + ok( tx == si.dwPageSize, "got unexpected bytes transferred: %lu\n", tx );
ok( memcmp( rbuf1, wbuf, si.dwPageSize ) == 0, "data was not read into buffer\n" ); @@ -4775,26 +4775,26 @@ static void test_WriteFileGather(void) br = ReadFileScatter( hfile, fse, si.dwPageSize, NULL, &ovl ); ok( br == FALSE, "ReadFileScatter should have failed\n" ); ok( GetLastError() == ERROR_HANDLE_EOF || - GetLastError() == ERROR_IO_PENDING, "ReadFileScatter gave wrong error %u\n", GetLastError() ); + GetLastError() == ERROR_IO_PENDING, "ReadFileScatter gave wrong error %lu\n", GetLastError() ); if (GetLastError() == ERROR_IO_PENDING) { SetLastError( 0xdeadbeef ); ret = GetQueuedCompletionStatus( hiocp2, &size, &key, &povl, 1000 ); ok( !ret, "GetQueuedCompletionStatus should have returned failure\n" ); - ok( GetLastError() == ERROR_HANDLE_EOF, "Got wrong error: %u\n", GetLastError() ); + ok( GetLastError() == ERROR_HANDLE_EOF, "Got wrong error: %lu\n", GetLastError() ); ok( povl == &ovl, "wrong ovl %p\n", povl );
SetLastError( 0xdeadbeef ); br = GetOverlappedResult( hfile, &ovl, &tx, TRUE ); ok( br == FALSE, "GetOverlappedResult should have failed\n" ); - ok( GetLastError() == ERROR_HANDLE_EOF, "Got wrong error: %u\n", GetLastError() ); + ok( GetLastError() == ERROR_HANDLE_EOF, "Got wrong error: %lu\n", GetLastError() ); } else { SetLastError( 0xdeadbeef ); ret = GetQueuedCompletionStatus( hiocp2, &size, &key, &povl, 100 ); - ok( !ret, "GetQueuedCompletionStatus failed err %u\n", GetLastError() ); - ok( GetLastError() == WAIT_TIMEOUT, "GetQueuedCompletionStatus gave wrong error %u\n", GetLastError() ); + ok( !ret, "GetQueuedCompletionStatus failed err %lu\n", GetLastError() ); + ok( GetLastError() == WAIT_TIMEOUT, "GetQueuedCompletionStatus gave wrong error %lu\n", GetLastError() ); ok( povl == NULL, "wrong ovl %p\n", povl ); }
@@ -4811,16 +4811,16 @@ static void test_WriteFileGather(void) SetLastError( 0xdeadbeef ); br = ReadFileScatter( hfile, fse, si.dwPageSize * 2, NULL, &ovl ); ok( br == FALSE, "ReadFileScatter should be asynchronous\n" ); - ok( GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed err %u\n", GetLastError() ); + ok( GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed err %lu\n", GetLastError() );
ret = GetQueuedCompletionStatus( hiocp2, &size, &key, &povl, 1000 ); - ok( ret, "GetQueuedCompletionStatus failed err %u\n", GetLastError() ); + ok( ret, "GetQueuedCompletionStatus failed err %lu\n", GetLastError() ); ok( povl == &ovl, "wrong ovl %p\n", povl );
tx = 0; br = GetOverlappedResult( hfile, &ovl, &tx, TRUE ); - ok( br == TRUE, "GetOverlappedResult failed: %u\n", GetLastError() ); - ok( tx == si.dwPageSize, "got unexpected bytes transferred: %u\n", tx ); + ok( br == TRUE, "GetOverlappedResult failed: %lu\n", GetLastError() ); + ok( tx == si.dwPageSize, "got unexpected bytes transferred: %lu\n", tx );
ok( memcmp( rbuf1, wbuf, si.dwPageSize ) == 0, "data was not read into buffer\n" ); @@ -4839,16 +4839,16 @@ static void test_WriteFileGather(void) SetLastError( 0xdeadbeef ); br = ReadFileScatter( hfile, fse, si.dwPageSize / 2, NULL, &ovl ); ok( br == FALSE, "ReadFileScatter should be asynchronous\n" ); - ok( GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed err %u\n", GetLastError() ); + ok( GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed err %lu\n", GetLastError() );
ret = GetQueuedCompletionStatus( hiocp2, &size, &key, &povl, 1000 ); - ok( ret, "GetQueuedCompletionStatus failed err %u\n", GetLastError() ); + ok( ret, "GetQueuedCompletionStatus failed err %lu\n", GetLastError() ); ok( povl == &ovl, "wrong ovl %p\n", povl );
tx = 0; br = GetOverlappedResult( hfile, &ovl, &tx, TRUE ); - ok( br == TRUE, "GetOverlappedResult failed: %u\n", GetLastError() ); - ok( tx == si.dwPageSize / 2, "got unexpected bytes transferred: %u\n", tx ); + ok( br == TRUE, "GetOverlappedResult failed: %lu\n", GetLastError() ); + ok( tx == si.dwPageSize / 2, "got unexpected bytes transferred: %lu\n", tx );
ok( memcmp( rbuf1, wbuf, si.dwPageSize / 2 ) == 0, "invalid data was read into buffer\n" ); @@ -4859,19 +4859,19 @@ static void test_WriteFileGather(void) if (pSetFileCompletionNotificationModes) { br = pSetFileCompletionNotificationModes(hfile, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS); - ok(br, "SetFileCompletionNotificationModes failed, error %u.\n", GetLastError()); + ok(br, "SetFileCompletionNotificationModes failed, error %lu.\n", GetLastError());
br = ReadFileScatter(hfile, fse, si.dwPageSize, NULL, &ovl); ok(br == FALSE, "ReadFileScatter should be asynchronous.\n"); - ok(GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed, error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed, error %lu.\n", GetLastError());
br = GetQueuedCompletionStatus(hiocp2, &size, &key, &povl, 1000); - ok(br, "GetQueuedCompletionStatus failed, err %u.\n", GetLastError()); + ok(br, "GetQueuedCompletionStatus failed, err %lu.\n", GetLastError()); ok(povl == &ovl, "Wrong ovl %p.\n", povl);
br = GetOverlappedResult(hfile, &ovl, &tx, TRUE); - ok(br, "GetOverlappedResult failed, err %u.\n", GetLastError()); - ok(tx == si.dwPageSize, "Got unexpected size %u.\n", tx); + ok(br, "GetOverlappedResult failed, err %lu.\n", GetLastError()); + ok(tx == si.dwPageSize, "Got unexpected size %lu.\n", tx);
ResetEvent(evt); } @@ -4885,7 +4885,7 @@ static void test_WriteFileGather(void) /* file handle must be overlapped */ hfile = CreateFileA( filename, GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING | FILE_ATTRIBUTE_NORMAL, 0 ); - ok( hfile != INVALID_HANDLE_VALUE, "CreateFile failed err %u\n", GetLastError() ); + ok( hfile != INVALID_HANDLE_VALUE, "CreateFile failed err %lu\n", GetLastError() );
memset( &ovl, 0, sizeof(ovl) ); memset( fse, 0, sizeof(fse) ); @@ -4894,7 +4894,7 @@ static void test_WriteFileGather(void) SetLastError( 0xdeadbeef ); br = ReadFileScatter( hfile, fse, si.dwPageSize, NULL, &ovl ); ok( br == FALSE, "ReadFileScatter should fail\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "ReadFileScatter failed err %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "ReadFileScatter failed err %lu\n", GetLastError() );
VirtualFree( wbuf, 0, MEM_RELEASE ); VirtualFree( rbuf1, 0, MEM_RELEASE ); @@ -4952,12 +4952,12 @@ static void test_file_access(void) FILE_FLAG_DELETE_ON_CLOSE, 0); if (td[i].create_error) { - ok(hfile == INVALID_HANDLE_VALUE, "%d: CreateFile should fail\n", i); - ok(td[i].create_error == GetLastError(), "%d: expected %d, got %d\n", i, td[i].create_error, GetLastError()); + ok(hfile == INVALID_HANDLE_VALUE, "%ld: CreateFile should fail\n", i); + ok(td[i].create_error == GetLastError(), "%ld: expected %d, got %ld\n", i, td[i].create_error, GetLastError()); continue; } else - ok(hfile != INVALID_HANDLE_VALUE, "%d: CreateFile error %d\n", i, GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "%ld: CreateFile error %ld\n", i, GetLastError());
for (j = 0; j < ARRAY_SIZE(td); j++) { @@ -4965,7 +4965,7 @@ static void test_file_access(void) ret = DuplicateHandle(GetCurrentProcess(), hfile, GetCurrentProcess(), &hdup, td[j].access, 0, 0); if (is_access_compatible(td[i].access, td[j].access)) - ok(ret, "DuplicateHandle(%#x => %#x) error %d\n", td[i].access, td[j].access, GetLastError()); + ok(ret, "DuplicateHandle(%#x => %#x) error %ld\n", td[i].access, td[j].access, GetLastError()); else { /* FIXME: Remove once Wine is fixed */ @@ -4975,7 +4975,7 @@ static void test_file_access(void) (!(td[i].access & (GENERIC_WRITE)) && (td[j].access & FILE_APPEND_DATA)))) { ok(!ret, "DuplicateHandle(%#x => %#x) should fail\n", td[i].access, td[j].access); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); } } if (ret) CloseHandle(hdup); @@ -4986,38 +4986,38 @@ static void test_file_access(void) ret = WriteFile(hfile, "\x5e\xa7", 2, &bytes, NULL); if (td[i].write_error) { - ok(!ret, "%d: WriteFile should fail\n", i); - ok(td[i].write_error == GetLastError(), "%d: expected %d, got %d\n", i, td[i].write_error, GetLastError()); - ok(bytes == 0, "%d: expected 0, got %u\n", i, bytes); + ok(!ret, "%ld: WriteFile should fail\n", i); + ok(td[i].write_error == GetLastError(), "%ld: expected %d, got %ld\n", i, td[i].write_error, GetLastError()); + ok(bytes == 0, "%ld: expected 0, got %lu\n", i, bytes); } else { - ok(ret, "%d: WriteFile error %d\n", i, GetLastError()); - ok(bytes == 2, "%d: expected 2, got %u\n", i, bytes); + ok(ret, "%ld: WriteFile error %ld\n", i, GetLastError()); + ok(bytes == 2, "%ld: expected 2, got %lu\n", i, bytes); }
SetLastError(0xdeadbeef); ret = SetFilePointer(hfile, 0, NULL, FILE_BEGIN); - ok(ret != INVALID_SET_FILE_POINTER, "SetFilePointer error %d\n", GetLastError()); + ok(ret != INVALID_SET_FILE_POINTER, "SetFilePointer error %ld\n", GetLastError());
SetLastError(0xdeadbeef); bytes = 0xdeadbeef; ret = ReadFile(hfile, buf, sizeof(buf), &bytes, NULL); if (td[i].read_error) { - ok(!ret, "%d: ReadFile should fail\n", i); - ok(td[i].read_error == GetLastError(), "%d: expected %d, got %d\n", i, td[i].read_error, GetLastError()); - ok(bytes == 0, "%d: expected 0, got %u\n", i, bytes); + ok(!ret, "%ld: ReadFile should fail\n", i); + ok(td[i].read_error == GetLastError(), "%ld: expected %d, got %ld\n", i, td[i].read_error, GetLastError()); + ok(bytes == 0, "%ld: expected 0, got %lu\n", i, bytes); } else { - ok(ret, "%d: ReadFile error %d\n", i, GetLastError()); + ok(ret, "%ld: ReadFile error %ld\n", i, GetLastError()); if (td[i].write_error) - ok(bytes == 0, "%d: expected 0, got %u\n", i, bytes); + ok(bytes == 0, "%ld: expected 0, got %lu\n", i, bytes); else { - ok(bytes == 2, "%d: expected 2, got %u\n", i, bytes); - ok(buf[0] == 0x5e && buf[1] == 0xa7, "%d: expected 5ea7, got %02x%02x\n", i, buf[0], buf[1]); + ok(bytes == 2, "%ld: expected 2, got %lu\n", i, bytes); + ok(buf[0] == 0x5e && buf[1] == 0xa7, "%ld: expected 5ea7, got %02x%02x\n", i, buf[0], buf[1]); } }
@@ -5045,66 +5045,66 @@ static void test_GetFinalPathNameByHandleA(void) /* Test calling with INVALID_HANDLE_VALUE */ SetLastError(0xdeadbeaf); count = pGetFinalPathNameByHandleA(INVALID_HANDLE_VALUE, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == 0, "Expected length 0, got %u\n", count); - ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + ok(count == 0, "Expected length 0, got %lu\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
count = GetTempPathA(MAX_PATH, temp_path); - ok(count, "Failed to get temp path, error %u\n", GetLastError()); + ok(count, "Failed to get temp path, error %lu\n", GetLastError()); ret = GetTempFileNameA(temp_path, prefix, 0, test_path); - ok(ret != 0, "GetTempFileNameA error %u\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %lu\n", GetLastError()); ret = GetLongPathNameA(test_path, long_path, MAX_PATH); - ok(ret != 0, "GetLongPathNameA error %u\n", GetLastError()); + ok(ret != 0, "GetLongPathNameA error %lu\n", GetLastError()); strcpy(dos_path, dos_prefix); strcat(dos_path, long_path);
count = pGetFinalPathNameByHandleA(INVALID_HANDLE_VALUE, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == 0, "Expected length 0, got %u\n", count); - ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + ok(count == 0, "Expected length 0, got %lu\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
file = CreateFileA(test_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFileA error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA error %lu\n", GetLastError());
if (0) { /* Windows crashes on NULL path */ count = pGetFinalPathNameByHandleA(file, NULL, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == 0, "Expected length 0, got %u\n", count); - ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + ok(count == 0, "Expected length 0, got %lu\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError()); }
/* Test 0-length path */ count = pGetFinalPathNameByHandleA(file, result_path, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", lstrlenA(dos_path), count); + ok(count == strlen(dos_path), "Expected length %u, got %lu\n", lstrlenA(dos_path), count);
/* Test 0 and NULL path */ count = pGetFinalPathNameByHandleA(file, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", lstrlenA(dos_path), count); + ok(count == strlen(dos_path), "Expected length %u, got %lu\n", lstrlenA(dos_path), count);
/* Test VOLUME_NAME_DOS with sufficient buffer size */ memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleA(file, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); + ok(count == strlen(dos_path), "Expected length %lu, got %lu\n", (DWORD)strlen(dos_path), count); ok(lstrcmpiA(dos_path, result_path) == 0, "Expected %s, got %s\n", dos_path, result_path);
/* Test VOLUME_NAME_DOS with insufficient buffer size */ memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleA(file, result_path, strlen(dos_path)-2, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); + ok(count == strlen(dos_path), "Expected length %lu, got %lu\n", (DWORD)strlen(dos_path), count); ok(result_path[0] == 0x11, "Result path was modified\n");
memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleA(file, result_path, strlen(dos_path)-1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); + ok(count == strlen(dos_path), "Expected length %lu, got %lu\n", (DWORD)strlen(dos_path), count); ok(result_path[0] == 0x11, "Result path was modified\n");
memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleA(file, result_path, strlen(dos_path), FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); + ok(count == strlen(dos_path), "Expected length %lu, got %lu\n", (DWORD)strlen(dos_path), count); ok(result_path[0] == 0x11, "Result path was modified\n");
memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleA(file, result_path, strlen(dos_path)+1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); + ok(count == strlen(dos_path), "Expected length %lu, got %lu\n", (DWORD)strlen(dos_path), count); ok(result_path[0] != 0x11, "Result path was not modified\n"); ok(!result_path[strlen(dos_path)], "Expected nullterminated string\n"); ok(result_path[strlen(dos_path)+1] == 0x11, "Buffer overflow\n"); @@ -5138,77 +5138,77 @@ static void test_GetFinalPathNameByHandleW(void) /* Test calling with INVALID_HANDLE_VALUE */ SetLastError(0xdeadbeaf); count = pGetFinalPathNameByHandleW(INVALID_HANDLE_VALUE, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == 0, "Expected length 0, got %u\n", count); - ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + ok(count == 0, "Expected length 0, got %lu\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
count = pGetFinalPathNameByHandleW(INVALID_HANDLE_VALUE, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == 0, "Expected length 0, got %u\n", count); - ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + ok(count == 0, "Expected length 0, got %lu\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
count = GetTempPathW(MAX_PATH, temp_path); - ok(count, "Failed to get temp path, error %u\n", GetLastError()); + ok(count, "Failed to get temp path, error %lu\n", GetLastError()); ret = GetTempFileNameW(temp_path, prefix, 0, test_path); - ok(ret != 0, "GetTempFileNameW error %u\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %lu\n", GetLastError()); ret = GetLongPathNameW(test_path, long_path, MAX_PATH); - ok(ret != 0, "GetLongPathNameW error %u\n", GetLastError()); + ok(ret != 0, "GetLongPathNameW error %lu\n", GetLastError()); lstrcpyW(dos_path, dos_prefix); lstrcatW(dos_path, long_path);
file = CreateFileW(test_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFileW error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFileW error %lu\n", GetLastError());
if (0) { /* Windows crashes on NULL path */ count = pGetFinalPathNameByHandleW(file, NULL, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == 0, "Expected length 0, got %u\n", count); - ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + ok(count == 0, "Expected length 0, got %lu\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError()); }
/* Test 0-length path */ count = pGetFinalPathNameByHandleW(file, result_path, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); ok(count == lstrlenW(dos_path) + 1 || - broken(count == lstrlenW(dos_path) + 2), "Expected length %u, got %u\n", lstrlenW(dos_path) + 1, count); + broken(count == lstrlenW(dos_path) + 2), "Expected length %u, got %lu\n", lstrlenW(dos_path) + 1, count);
/* Test 0 and NULL path */ count = pGetFinalPathNameByHandleW(file, NULL, 0, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); ok(count == lstrlenW(dos_path) + 1 || - broken(count == lstrlenW(dos_path) + 2), "Expected length %u, got %u\n", lstrlenW(dos_path) + 1, count); + broken(count == lstrlenW(dos_path) + 2), "Expected length %u, got %lu\n", lstrlenW(dos_path) + 1, count);
/* Test VOLUME_NAME_DOS with sufficient buffer size */ memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == lstrlenW(dos_path), "Expected length %u, got %u\n", lstrlenW(dos_path), count); + ok(count == lstrlenW(dos_path), "Expected length %u, got %lu\n", lstrlenW(dos_path), count); ok(lstrcmpiW(dos_path, result_path) == 0, "Expected %s, got %s\n", wine_dbgstr_w(dos_path), wine_dbgstr_w(result_path));
/* Test VOLUME_NAME_DOS with insufficient buffer size */ memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, lstrlenW(dos_path)-1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == lstrlenW(dos_path) + 1, "Expected length %u, got %u\n", lstrlenW(dos_path) + 1, count); + ok(count == lstrlenW(dos_path) + 1, "Expected length %u, got %lu\n", lstrlenW(dos_path) + 1, count); ok(result_path[0] == 0x1111, "Result path was modified\n");
memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, lstrlenW(dos_path), FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == lstrlenW(dos_path) + 1, "Expected length %u, got %u\n", lstrlenW(dos_path) + 1, count); + ok(count == lstrlenW(dos_path) + 1, "Expected length %u, got %lu\n", lstrlenW(dos_path) + 1, count); ok(result_path[0] == 0x1111, "Result path was modified\n");
memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, lstrlenW(dos_path)+1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); - ok(count == lstrlenW(dos_path), "Expected length %u, got %u\n", lstrlenW(dos_path), count); + ok(count == lstrlenW(dos_path), "Expected length %u, got %lu\n", lstrlenW(dos_path), count); ok(result_path[0] != 0x1111, "Result path was not modified\n"); ok(!result_path[lstrlenW(dos_path)], "Expected nullterminated string\n"); ok(result_path[lstrlenW(dos_path)+1] == 0x1111, "Buffer overflow\n");
success = GetVolumePathNameW(long_path, drive_part, MAX_PATH); - ok(success, "GetVolumePathNameW error %u\n", GetLastError()); + ok(success, "GetVolumePathNameW error %lu\n", GetLastError()); success = GetVolumeNameForVolumeMountPointW(drive_part, volume_path, ARRAY_SIZE(volume_path)); - ok(success, "GetVolumeNameForVolumeMountPointW error %u\n", GetLastError()); + ok(success, "GetVolumeNameForVolumeMountPointW error %lu\n", GetLastError());
/* Test for VOLUME_NAME_GUID */ lstrcatW(volume_path, long_path + lstrlenW(drive_part)); memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_GUID); - ok(count == lstrlenW(volume_path), "Expected length %u, got %u\n", lstrlenW(volume_path), count); + ok(count == lstrlenW(volume_path), "Expected length %u, got %lu\n", lstrlenW(volume_path), count); ok(lstrcmpiW(volume_path, result_path) == 0, "Expected %s, got %s\n", wine_dbgstr_w(volume_path), wine_dbgstr_w(result_path));
@@ -5216,19 +5216,19 @@ static void test_GetFinalPathNameByHandleW(void) file_part = long_path + lstrlenW(drive_part) - 1; memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_NONE); - ok(count == lstrlenW(file_part), "Expected length %u, got %u\n", lstrlenW(file_part), count); + ok(count == lstrlenW(file_part), "Expected length %u, got %lu\n", lstrlenW(file_part), count); ok(lstrcmpiW(file_part, result_path) == 0, "Expected %s, got %s\n", wine_dbgstr_w(file_part), wine_dbgstr_w(result_path));
drive_part[lstrlenW(drive_part)-1] = 0; success = QueryDosDeviceW(drive_part, nt_path, ARRAY_SIZE(nt_path)); - ok(success, "QueryDosDeviceW error %u\n", GetLastError()); + ok(success, "QueryDosDeviceW error %lu\n", GetLastError());
/* Test for VOLUME_NAME_NT */ lstrcatW(nt_path, file_part); memset(result_path, 0x11, sizeof(result_path)); count = pGetFinalPathNameByHandleW(file, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_NT); - ok(count == lstrlenW(nt_path), "Expected length %u, got %u\n", lstrlenW(nt_path), count); + ok(count == lstrlenW(nt_path), "Expected length %u, got %lu\n", lstrlenW(nt_path), count); ok(lstrcmpiW(nt_path, result_path) == 0, "Expected %s, got %s\n", wine_dbgstr_w(nt_path), wine_dbgstr_w(result_path));
@@ -5257,97 +5257,97 @@ static void test_SetFileInformationByHandle(void) }
ret = GetTempPathA(sizeof(tempPath), tempPath); - ok(ret, "GetTempPathA failed, got error %u.\n", GetLastError()); + ok(ret, "GetTempPathA failed, got error %lu.\n", GetLastError());
/* ensure the existence of a file in the temp folder */ ret = GetTempFileNameA(tempPath, "abc", 0, tempFileName); - ok(ret, "GetTempFileNameA failed, got error %u.\n", GetLastError()); + ok(ret, "GetTempFileNameA failed, got error %lu.\n", GetLastError());
file = CreateFileA(tempFileName, GENERIC_READ | FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL); - ok(file != INVALID_HANDLE_VALUE, "failed to open the temp file, error %u.\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open the temp file, error %lu.\n", GetLastError());
/* invalid classes */ SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileStandardInfo, &stdinfo, sizeof(stdinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
memset(&compressinfo, 0, sizeof(compressinfo)); SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileCompressionInfo, &compressinfo, sizeof(compressinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileAttributeTagInfo, &fileattrinfo, sizeof(fileattrinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); hintinfo.PriorityHint = MaximumIoPriorityHintType; ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
hintinfo.PriorityHint = IoPriorityHintNormal; ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); - ok(ret, "setting FileIoPriorityHintInfo got %d, error %d\n", ret, GetLastError()); + ok(ret, "setting FileIoPriorityHintInfo got %d, error %ld\n", ret, GetLastError());
hintinfo.PriorityHint = IoPriorityHintVeryLow; ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); - ok(ret, "setting FileIoPriorityHintInfo got %d, error %d\n", ret, GetLastError()); + ok(ret, "setting FileIoPriorityHintInfo got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo) - 1); - ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); hintinfo.PriorityHint = IoPriorityHintVeryLow - 1; ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
memset(&protinfo, 0, sizeof(protinfo)); protinfo.StructureVersion = 1; protinfo.StructureSize = sizeof(protinfo); SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileRemoteProtocolInfo, &protinfo, sizeof(protinfo)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
/* test FileDispositionInfo, additional details already covered by ntdll tests */ SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileDispositionInfo, &dispinfo, 0); todo_wine - ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pSetFileInformationByHandle(file, FileBasicInfo, &basicinfo, 0); todo_wine - ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %ld\n", ret, GetLastError());
memset(&basicinfo, 0, sizeof(basicinfo)); ret = pGetFileInformationByHandleEx(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); - ok(ret, "Failed to get basic info, error %d.\n", GetLastError()); + ok(ret, "Failed to get basic info, error %ld.\n", GetLastError()); atime = basicinfo.LastAccessTime;
basicinfo.LastAccessTime.QuadPart++; ret = pSetFileInformationByHandle(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); - ok(ret, "Failed to set basic info, error %d.\n", GetLastError()); + ok(ret, "Failed to set basic info, error %ld.\n", GetLastError());
memset(&basicinfo, 0, sizeof(basicinfo)); ret = pGetFileInformationByHandleEx(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); - ok(ret, "Failed to get basic info, error %d.\n", GetLastError()); + ok(ret, "Failed to get basic info, error %ld.\n", GetLastError()); ok(atime.QuadPart + 1 == basicinfo.LastAccessTime.QuadPart, "Unexpected access time.\n");
memset(&basicinfo, 0, sizeof(basicinfo)); basicinfo.LastAccessTime.QuadPart = -1; ret = pSetFileInformationByHandle(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); - ok(ret, "Failed to set basic info, error %d.\n", GetLastError()); + ok(ret, "Failed to set basic info, error %ld.\n", GetLastError());
memset(&basicinfo, 0, sizeof(basicinfo)); ret = pGetFileInformationByHandleEx(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); - ok(ret, "Failed to get basic info, error %d.\n", GetLastError()); + ok(ret, "Failed to get basic info, error %ld.\n", GetLastError()); ok(atime.QuadPart + 1 == basicinfo.LastAccessTime.QuadPart, "Unexpected access time.\n");
dispinfo.DeleteFile = TRUE; ret = pSetFileInformationByHandle(file, FileDispositionInfo, &dispinfo, sizeof(dispinfo)); - ok(ret, "setting FileDispositionInfo failed, error %d\n", GetLastError()); + ok(ret, "setting FileDispositionInfo failed, error %ld\n", GetLastError());
CloseHandle(file); } @@ -5368,19 +5368,19 @@ static void test_SetFileRenameInfo(void) }
ret = GetTempPathW(MAX_PATH, tempPath); - ok(ret, "GetTempPathW failed, got error %u.\n", GetLastError()); + ok(ret, "GetTempPathW failed, got error %lu.\n", GetLastError());
ret = GetTempFileNameW(tempPath, L"abc", 0, tempFileFrom); - ok(ret, "GetTempFileNameW failed, got error %u.\n", GetLastError()); + ok(ret, "GetTempFileNameW failed, got error %lu.\n", GetLastError());
ret = GetTempFileNameW(tempPath, L"abc", 0, tempFileTo1); - ok(ret, "GetTempFileNameW failed, got error %u.\n", GetLastError()); + ok(ret, "GetTempFileNameW failed, got error %lu.\n", GetLastError());
ret = GetTempFileNameW(tempPath, L"abc", 1, tempFileTo2); - ok(ret, "GetTempFileNameW failed, got error %u.\n", GetLastError()); + ok(ret, "GetTempFileNameW failed, got error %lu.\n", GetLastError());
file = CreateFileW(tempFileFrom, GENERIC_READ | GENERIC_WRITE | DELETE, 0, 0, OPEN_EXISTING, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "failed to create temp file, error %u.\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to create temp file, error %lu.\n", GetLastError());
size = sizeof(FILE_RENAME_INFORMATION) + MAX_PATH; fri = HeapAlloc(GetProcessHeap(), 0, size); @@ -5390,27 +5390,27 @@ static void test_SetFileRenameInfo(void) fri->FileNameLength = wcslen(tempFileTo1) * sizeof(WCHAR); memcpy(fri->FileName, tempFileTo1, fri->FileNameLength + sizeof(WCHAR)); ret = pSetFileInformationByHandle(file, FileRenameInfo, fri, size); - ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS, "FileRenameInfo unexpected result %d\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS, "FileRenameInfo unexpected result %ld\n", GetLastError());
fri->ReplaceIfExists = TRUE; ret = pSetFileInformationByHandle(file, FileRenameInfo, fri, size); - ok(ret, "FileRenameInfo failed, error %d\n", GetLastError()); + ok(ret, "FileRenameInfo failed, error %ld\n", GetLastError());
fri->ReplaceIfExists = FALSE; fri->FileNameLength = wcslen(tempFileTo2) * sizeof(WCHAR); memcpy(fri->FileName, tempFileTo2, fri->FileNameLength + sizeof(WCHAR)); ret = pSetFileInformationByHandle(file, FileRenameInfo, fri, size); - ok(ret, "FileRenameInfo failed, error %d\n", GetLastError()); + ok(ret, "FileRenameInfo failed, error %ld\n", GetLastError()); CloseHandle(file);
file = CreateFileW(tempFileTo2, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "file not renamed, error %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "file not renamed, error %ld\n", GetLastError());
fri->FileNameLength = wcslen(tempFileTo1) * sizeof(WCHAR); memcpy(fri->FileName, tempFileTo1, fri->FileNameLength + sizeof(WCHAR)); ret = pSetFileInformationByHandle(file, FileRenameInfo, fri, size); todo_wine - ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, "FileRenameInfo unexpected result %d\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, "FileRenameInfo unexpected result %ld\n", GetLastError()); CloseHandle(file);
HeapFree(GetProcessHeap(), 0, fri); @@ -5439,13 +5439,13 @@ static void test_GetFileAttributesExW(void)
for (test_idx = 0; test_idx < ARRAY_SIZE(tests); ++test_idx) { - winetest_push_context("Test %u", test_idx); + winetest_push_context("Test %lu", test_idx);
SetLastError(0xdeadbeef); ret = GetFileAttributesExW(tests[test_idx].path, GetFileExInfoStandard, &info); error = GetLastError(); ok(!ret, "GetFileAttributesExW succeeded\n"); - ok(error == tests[test_idx].expected_error, "Expected error %u, got %u\n", + ok(error == tests[test_idx].expected_error, "Expected error %lu, got %lu\n", tests[test_idx].expected_error, error);
winetest_pop_context(); @@ -5463,24 +5463,24 @@ static void test_post_completion(void) BOOL ret;
port = CreateIoCompletionPort( INVALID_HANDLE_VALUE, NULL, 999, 0 ); - ok(port != NULL, "CreateIoCompletionPort failed: %u\n", GetLastError()); + ok(port != NULL, "CreateIoCompletionPort failed: %lu\n", GetLastError());
ret = GetQueuedCompletionStatus( port, &size, &key, &povl, 0 ); ok(!ret, "GetQueuedCompletionStatus succeeded\n"); - ok(GetLastError() == WAIT_TIMEOUT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError());
ret = PostQueuedCompletionStatus( port, 123, 456, &ovl ); - ok(ret, "PostQueuedCompletionStatus failed: %u\n", GetLastError()); + ok(ret, "PostQueuedCompletionStatus failed: %lu\n", GetLastError());
ret = GetQueuedCompletionStatus( port, &size, &key, &povl, 0 ); - ok(ret, "GetQueuedCompletionStatus failed: %u\n", GetLastError()); - ok(size == 123, "wrong size %u\n", size); - ok(key == 456, "wrong key %lu\n", key); + ok(ret, "GetQueuedCompletionStatus failed: %lu\n", GetLastError()); + ok(size == 123, "wrong size %lu\n", size); + ok(key == 456, "wrong key %Iu\n", key); ok(povl == &ovl, "wrong ovl %p\n", povl);
ret = GetQueuedCompletionStatus( port, &size, &key, &povl, 0 ); ok(!ret, "GetQueuedCompletionStatus succeeded\n"); - ok(GetLastError() == WAIT_TIMEOUT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError());
if (!pGetQueuedCompletionStatusEx) { @@ -5492,67 +5492,67 @@ static void test_post_completion(void) count = 0xdeadbeef; ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, FALSE ); ok(!ret, "GetQueuedCompletionStatusEx succeeded\n"); - ok(GetLastError() == WAIT_TIMEOUT, "wrong error %u\n", GetLastError()); - ok(count == 1, "wrong count %u\n", count); + ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError()); + ok(count == 1, "wrong count %lu\n", count);
ret = PostQueuedCompletionStatus( port, 123, 456, &ovl ); - ok(ret, "PostQueuedCompletionStatus failed: %u\n", GetLastError()); + ok(ret, "PostQueuedCompletionStatus failed: %lu\n", GetLastError());
count = 0xdeadbeef; memset( entries, 0xcc, sizeof(entries) ); ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, FALSE ); ok(ret, "GetQueuedCompletionStatusEx failed\n"); - ok(count == 1, "wrong count %u\n", count); - ok(entries[0].lpCompletionKey == 456, "wrong key %lu\n", entries[0].lpCompletionKey); + ok(count == 1, "wrong count %lu\n", count); + ok(entries[0].lpCompletionKey == 456, "wrong key %Iu\n", entries[0].lpCompletionKey); ok(entries[0].lpOverlapped == &ovl, "wrong ovl %p\n", entries[0].lpOverlapped); - ok(!(ULONG)entries[0].Internal, "wrong internal %#x\n", (ULONG)entries[0].Internal); - ok(entries[0].dwNumberOfBytesTransferred == 123, "wrong size %u\n", entries[0].dwNumberOfBytesTransferred); + ok(!(ULONG)entries[0].Internal, "wrong internal %#lx\n", (ULONG)entries[0].Internal); + ok(entries[0].dwNumberOfBytesTransferred == 123, "wrong size %lu\n", entries[0].dwNumberOfBytesTransferred);
ret = PostQueuedCompletionStatus( port, 123, 456, &ovl ); - ok(ret, "PostQueuedCompletionStatus failed: %u\n", GetLastError()); + ok(ret, "PostQueuedCompletionStatus failed: %lu\n", GetLastError());
ret = PostQueuedCompletionStatus( port, 654, 321, &ovl2 ); - ok(ret, "PostQueuedCompletionStatus failed: %u\n", GetLastError()); + ok(ret, "PostQueuedCompletionStatus failed: %lu\n", GetLastError());
count = 0xdeadbeef; memset( entries, 0xcc, sizeof(entries) ); ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, FALSE ); ok(ret, "GetQueuedCompletionStatusEx failed\n"); - ok(count == 2, "wrong count %u\n", count); - ok(entries[0].lpCompletionKey == 456, "wrong key %lu\n", entries[0].lpCompletionKey); + ok(count == 2, "wrong count %lu\n", count); + ok(entries[0].lpCompletionKey == 456, "wrong key %Iu\n", entries[0].lpCompletionKey); ok(entries[0].lpOverlapped == &ovl, "wrong ovl %p\n", entries[0].lpOverlapped); - ok(!(ULONG)entries[0].Internal, "wrong internal %#x\n", (ULONG)entries[0].Internal); - ok(entries[0].dwNumberOfBytesTransferred == 123, "wrong size %u\n", entries[0].dwNumberOfBytesTransferred); - ok(entries[1].lpCompletionKey == 321, "wrong key %lu\n", entries[1].lpCompletionKey); + ok(!(ULONG)entries[0].Internal, "wrong internal %#lx\n", (ULONG)entries[0].Internal); + ok(entries[0].dwNumberOfBytesTransferred == 123, "wrong size %lu\n", entries[0].dwNumberOfBytesTransferred); + ok(entries[1].lpCompletionKey == 321, "wrong key %Iu\n", entries[1].lpCompletionKey); ok(entries[1].lpOverlapped == &ovl2, "wrong ovl %p\n", entries[1].lpOverlapped); - ok(!(ULONG)entries[1].Internal, "wrong internal %#x\n", (ULONG)entries[1].Internal); - ok(entries[1].dwNumberOfBytesTransferred == 654, "wrong size %u\n", entries[1].dwNumberOfBytesTransferred); + ok(!(ULONG)entries[1].Internal, "wrong internal %#lx\n", (ULONG)entries[1].Internal); + ok(entries[1].dwNumberOfBytesTransferred == 654, "wrong size %lu\n", entries[1].dwNumberOfBytesTransferred);
user_apc_ran = FALSE; QueueUserAPC( user_apc, GetCurrentThread(), 0 );
ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, FALSE ); ok(!ret, "GetQueuedCompletionStatusEx succeeded\n"); - ok(GetLastError() == WAIT_TIMEOUT, "wrong error %u\n", GetLastError()); - ok(count == 1, "wrong count %u\n", count); + ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError()); + ok(count == 1, "wrong count %lu\n", count); ok(!user_apc_ran, "user APC should not have run\n");
ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, TRUE ); ok(!ret || broken(ret) /* Vista */, "GetQueuedCompletionStatusEx succeeded\n"); if (!ret) - ok(GetLastError() == WAIT_IO_COMPLETION, "wrong error %u\n", GetLastError()); - ok(count == 1, "wrong count %u\n", count); + ok(GetLastError() == WAIT_IO_COMPLETION, "wrong error %lu\n", GetLastError()); + ok(count == 1, "wrong count %lu\n", count); ok(user_apc_ran, "user APC should have run\n");
user_apc_ran = FALSE; QueueUserAPC( user_apc, GetCurrentThread(), 0 );
ret = PostQueuedCompletionStatus( port, 123, 456, &ovl ); - ok(ret, "PostQueuedCompletionStatus failed: %u\n", GetLastError()); + ok(ret, "PostQueuedCompletionStatus failed: %lu\n", GetLastError());
ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, TRUE ); ok(ret, "GetQueuedCompletionStatusEx failed\n"); - ok(count == 1, "wrong count %u\n", count); + ok(count == 1, "wrong count %lu\n", count); ok(!user_apc_ran, "user APC should not have run\n");
SleepEx(0, TRUE); @@ -5575,34 +5575,34 @@ static void test_overlapped_read(void) DWORD ret;
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret, "Unexpected error %u.\n", GetLastError()); + ok(ret, "Unexpected error %lu.\n", GetLastError()); ret = GetTempFileNameA(temp_path, prefix, 0, file_name); - ok(ret, "Unexpected error %u.\n", GetLastError()); + ok(ret, "Unexpected error %lu.\n", GetLastError());
hfile = CreateFileA(file_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING, NULL); - ok(hfile != INVALID_HANDLE_VALUE, "Failed to create file, GetLastError() %u.\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "Failed to create file, GetLastError() %lu.\n", GetLastError()); memset(buffer, 0x55, sizeof(buffer)); ret = WriteFile(hfile, buffer, TEST_OVERLAPPED_READ_SIZE, &bytes_count, NULL); ok(ret && bytes_count == TEST_OVERLAPPED_READ_SIZE, - "Unexpected WriteFile result, ret %#x, bytes_count %u, GetLastError() %u.\n", + "Unexpected WriteFile result, ret %#lx, bytes_count %lu, GetLastError() %lu.\n", ret, bytes_count, GetLastError()); CloseHandle(hfile);
hfile = CreateFileA(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); - ok(hfile != INVALID_HANDLE_VALUE, "Failed to create file, GetLastError() %u.\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "Failed to create file, GetLastError() %lu.\n", GetLastError());
memset(&ov, 0, sizeof(ov));
bytes_count = 0xffffffff; ret = ReadFile(hfile, buffer, TEST_OVERLAPPED_READ_SIZE, &bytes_count, &ov); ok(!ret && GetLastError() == ERROR_IO_PENDING, - "Unexpected ReadFile result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); - ok(!bytes_count, "Unexpected read size %u.\n", bytes_count); + "Unexpected ReadFile result, ret %#lx, GetLastError() %lu.\n", ret, GetLastError()); + ok(!bytes_count, "Unexpected read size %lu.\n", bytes_count); ret = GetOverlappedResult(hfile, &ov, &bytes_count, TRUE); - ok(ret, "Unexpected error %u.\n", GetLastError()); - ok(bytes_count == TEST_OVERLAPPED_READ_SIZE, "Unexpected read size %u.\n", bytes_count); + ok(ret, "Unexpected error %lu.\n", GetLastError()); + ok(bytes_count == TEST_OVERLAPPED_READ_SIZE, "Unexpected read size %lu.\n", bytes_count);
S(U(ov)).Offset = bytes_count; ret = ReadFile(hfile, buffer, TEST_OVERLAPPED_READ_SIZE, &bytes_count, &ov); @@ -5610,18 +5610,18 @@ static void test_overlapped_read(void) /* Win8+ return ERROR_IO_PENDING like stated in MSDN, while older ones * return ERROR_HANDLE_EOF right away. */ ok(!ret && (err == ERROR_IO_PENDING || broken(err == ERROR_HANDLE_EOF)), - "Unexpected ReadFile result, ret %#x, GetLastError() %u.\n", ret, GetLastError()); + "Unexpected ReadFile result, ret %#lx, GetLastError() %lu.\n", ret, GetLastError()); if (err == ERROR_IO_PENDING) { ret = GetOverlappedResult(hfile, &ov, &bytes_count, TRUE); - ok(!ret && GetLastError() == ERROR_HANDLE_EOF, "Unexpected result %#x, GetLasttError() %u.\n", + ok(!ret && GetLastError() == ERROR_HANDLE_EOF, "Unexpected result %#lx, GetLasttError() %lu.\n", ret, GetLastError()); } - ok(!bytes_count, "Unexpected read size %u.\n", bytes_count); + ok(!bytes_count, "Unexpected read size %lu.\n", bytes_count);
CloseHandle(hfile); ret = DeleteFileA(file_name); - ok(ret, "Unexpected error %u.\n", GetLastError()); + ok(ret, "Unexpected error %lu.\n", GetLastError()); }
static void test_file_readonly_access(void) @@ -5636,21 +5636,21 @@ static void test_file_readonly_access(void)
/* Set up */ ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, file_name); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError()); ret = DeleteFileA(file_name); ok(ret, "expect success\n");
ret = GetTempFileNameA(temp_path, prefix, 0, file_name2); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError()); ret = DeleteFileA(file_name2); ok(ret, "expect success\n");
handle = CreateFileA(file_name, 0, default_sharing, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); - ok(handle != INVALID_HANDLE_VALUE, "CreateFileA: error %d\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "CreateFileA: error %ld\n", GetLastError()); CloseHandle(handle);
/* CreateFile GENERIC_WRITE */ @@ -5658,7 +5658,7 @@ static void test_file_readonly_access(void) handle = CreateFileA(file_name, GENERIC_WRITE, default_sharing, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); error = GetLastError(); ok(handle == INVALID_HANDLE_VALUE, "expect failure\n"); - ok(error == ERROR_ACCESS_DENIED, "wrong error code: %#x\n", error); + ok(error == ERROR_ACCESS_DENIED, "wrong error code: %#lx\n", error);
/* CreateFile DELETE without FILE_FLAG_DELETE_ON_CLOSE */ handle = CreateFileA(file_name, DELETE, default_sharing, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); @@ -5671,7 +5671,7 @@ static void test_file_readonly_access(void) FILE_FLAG_DELETE_ON_CLOSE | FILE_ATTRIBUTE_NORMAL, 0); error = GetLastError(); ok(handle == INVALID_HANDLE_VALUE, "expect failure\n"); - ok(error == ERROR_ACCESS_DENIED, "wrong error code: %#x\n", error); + ok(error == ERROR_ACCESS_DENIED, "wrong error code: %#lx\n", error);
ret = MoveFileA(file_name, file_name2); ok(ret, "expect success\n"); @@ -5682,15 +5682,15 @@ static void test_file_readonly_access(void) ret = DeleteFileA(file_name); error = GetLastError(); ok(!ret, "expect failure\n"); - ok(error == ERROR_ACCESS_DENIED, "wrong error code: %#x\n", error); + ok(error == ERROR_ACCESS_DENIED, "wrong error code: %#lx\n", error);
ret = GetFileAttributesA(file_name); - ok(ret & FILE_ATTRIBUTE_READONLY, "got wrong attribute: %#x.\n", ret); + ok(ret & FILE_ATTRIBUTE_READONLY, "got wrong attribute: %#lx.\n", ret);
/* Clean up */ SetFileAttributesA(file_name, FILE_ATTRIBUTE_NORMAL); ret = DeleteFileA(file_name); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); }
static void test_find_file_stream(void) @@ -5722,35 +5722,35 @@ static void test_SetFileTime(void) HANDLE hfile;
ret = GetTempPathW(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathW error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameW(temp_path, prefix, 0, path); - ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameW error %ld\n", GetLastError());
hfile = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); ret = WriteFile(hfile, prefix, sizeof(prefix), &len, NULL ); - ok(ret && len == sizeof(prefix), "WriteFile error %d\n", GetLastError()); + ok(ret && len == sizeof(prefix), "WriteFile error %ld\n", GetLastError()); ok(GetFileSize(hfile, NULL) == sizeof(prefix), "source file has wrong size\n");
ret = GetFileTime(hfile, NULL, NULL, &ft1); - ok(ret, "GetFileTime error %d\n", GetLastError()); + ok(ret, "GetFileTime error %ld\n", GetLastError()); ft2 = ft1; ft2.dwLowDateTime -= 600000000; /* 60 second */ ret = SetFileTime(hfile, NULL, NULL, &ft2); - ok(ret, "SetFileTime error %d\n", GetLastError()); + ok(ret, "SetFileTime error %ld\n", GetLastError()); memset(&ft2, 0, sizeof(ft2)); ret = GetFileTime(hfile, NULL, NULL, &ft2); /* get the actual time back */ - ok(ret, "GetFileTime error %d\n", GetLastError()); + ok(ret, "GetFileTime error %ld\n", GetLastError()); ok(memcmp(&ft1, &ft2, sizeof(ft1)), "Unexpected write time.\n");
memset(&ft1, 0xff, sizeof(ft1)); ret = SetFileTime(hfile, NULL, NULL, &ft1); - ok(ret, "SetFileTime error %d\n", GetLastError()); + ok(ret, "SetFileTime error %ld\n", GetLastError()); memset(&ft1, 0, sizeof(ft1)); ret = GetFileTime(hfile, NULL, NULL, &ft1); /* get the actual time back */ - ok(ret, "GetFileTime error %d\n", GetLastError()); + ok(ret, "GetFileTime error %ld\n", GetLastError()); ok(!memcmp(&ft1, &ft2, sizeof(ft1)), "Unexpected write time.\n");
CloseHandle(hfile); @@ -5771,67 +5771,67 @@ static void test_hard_link(void) SetCurrentDirectoryA( temp_dir );
ret = CreateDirectoryA( "winetest_dir1", NULL ); - ok(ret, "failed to create directory, error %u\n", GetLastError()); + ok(ret, "failed to create directory, error %lu\n", GetLastError()); ret = CreateDirectoryA( "winetest_dir2", NULL ); - ok(ret, "failed to create directory, error %u\n", GetLastError()); + ok(ret, "failed to create directory, error %lu\n", GetLastError()); create_file( "winetest_file1" ); create_file( "winetest_file2" );
ret = CreateHardLinkA( "winetest_file3", "winetest_file1", NULL ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
file = CreateFileA( "winetest_file3", FILE_READ_DATA, 0, NULL, OPEN_EXISTING, 0, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, name_buffer, sizeof(name_buffer), FileNameInformation ); - ok(!status, "got status %#x\n", status); + ok(!status, "got status %#lx\n", status); ok(!wcsncmp(name_info->FileName + (name_info->FileNameLength / sizeof(WCHAR)) - wcslen(L"\winetest_file3"), L"\winetest_file3", wcslen(L"\winetest_file3")), "got name %s\n", debugstr_wn(name_info->FileName, name_info->FileNameLength / sizeof(WCHAR)));
ret = ReadFile( file, buffer, sizeof(buffer), &size, NULL ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!memcmp( buffer, "winetest_file1", size ), "got file contents %s\n", debugstr_an( buffer, size ));
CloseHandle( file );
ret = DeleteFileA( "winetest_file3" ); - ok(ret, "failed to delete file, error %u\n", GetLastError()); + ok(ret, "failed to delete file, error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateHardLinkA( "winetest_file2", "winetest_file1", NULL ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateHardLinkA( "WineTest_File1", "winetest_file1", NULL ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateHardLinkA( "winetest_file3", "winetest_dir1", NULL ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateHardLinkA( "winetest_dir2", "winetest_dir1", NULL ); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_ACCESS_DENIED - || GetLastError() == ERROR_ALREADY_EXISTS /* XP */, "got error %u\n", GetLastError()); + || GetLastError() == ERROR_ALREADY_EXISTS /* XP */, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateHardLinkA( "winetest_dir1", "winetest_file1", NULL ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %lu\n", GetLastError());
ret = RemoveDirectoryA( "winetest_dir1" ); - ok(ret, "failed to remove directory, error %u\n", GetLastError()); + ok(ret, "failed to remove directory, error %lu\n", GetLastError()); ret = RemoveDirectoryA( "winetest_dir2" ); - ok(ret, "failed to remove directory, error %u\n", GetLastError()); + ok(ret, "failed to remove directory, error %lu\n", GetLastError()); ret = DeleteFileA( "winetest_file1" ); - ok(ret, "failed to delete file, error %u\n", GetLastError()); + ok(ret, "failed to delete file, error %lu\n", GetLastError()); ret = DeleteFileA( "winetest_file2" ); - ok(ret, "failed to delete file, error %u\n", GetLastError()); + ok(ret, "failed to delete file, error %lu\n", GetLastError()); SetCurrentDirectoryA( cwd ); }
@@ -5846,14 +5846,14 @@ static void test_move_file(void) SetCurrentDirectoryA( temp_dir );
ret = CreateDirectoryA( "winetest_dir1", NULL ); - ok(ret, "failed to create directory, error %u\n", GetLastError()); + ok(ret, "failed to create directory, error %lu\n", GetLastError()); ret = CreateDirectoryA( "winetest_dir2", NULL ); - ok(ret, "failed to create directory, error %u\n", GetLastError()); + ok(ret, "failed to create directory, error %lu\n", GetLastError()); create_file( "winetest_file1" ); create_file( "winetest_file2" );
ret = MoveFileA( "winetest_file1", "winetest_file3" ); - ok(ret, "failed to move file, error %u\n", GetLastError()); + ok(ret, "failed to move file, error %lu\n", GetLastError()); ret = GetFileAttributesA( "winetest_file1" ); ok(ret == INVALID_FILE_ATTRIBUTES, "got %#x\n", ret); ret = GetFileAttributesA( "winetest_file3" ); @@ -5862,32 +5862,32 @@ static void test_move_file(void) SetLastError(0xdeadbeef); ret = MoveFileA( "winetest_file3", "winetest_file2" ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = MoveFileA( "winetest_file1", "winetest_file4" ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %lu\n", GetLastError());
ret = MoveFileA( "winetest_dir1", "winetest_dir3" ); - ok(ret, "failed to move file, error %u\n", GetLastError()); + ok(ret, "failed to move file, error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = MoveFileA( "winetest_dir3", "winetest_dir2" ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "got error %lu\n", GetLastError());
file = CreateFileA( "winetest_file3", DELETE, 0, NULL, OPEN_EXISTING, 0, 0 ); - ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %lu\n", GetLastError()); ret = MoveFileA( "winetest_file3", "winetest_file1" ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_SHARING_VIOLATION, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "got error %lu\n", GetLastError()); CloseHandle( file );
file = CreateFileA( "winetest_file3", 0, 0, NULL, OPEN_EXISTING, 0, 0 ); - ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %lu\n", GetLastError()); ret = MoveFileA( "winetest_file3", "winetest_file1" ); - ok(ret, "failed to move file, error %u\n", GetLastError()); + ok(ret, "failed to move file, error %lu\n", GetLastError()); ret = GetFileAttributesA( "winetest_file1" ); ok(ret != INVALID_FILE_ATTRIBUTES, "got %#x\n", ret); ret = GetFileAttributesA( "winetest_file3" ); @@ -5895,36 +5895,36 @@ static void test_move_file(void) CloseHandle( file );
ret = MoveFileExA( "winetest_file1", "winetest_file2", MOVEFILE_REPLACE_EXISTING ); - ok(ret, "failed to move file, error %u\n", GetLastError()); + ok(ret, "failed to move file, error %lu\n", GetLastError());
file = CreateFileA( "winetest_file1", GENERIC_ALL, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, CREATE_NEW, 0, 0 ); - ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ret = MoveFileExA( "winetest_file2", "winetest_file1", MOVEFILE_REPLACE_EXISTING ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError()); CloseHandle( file );
SetLastError(0xdeadbeef); ret = MoveFileExA( "winetest_file2", "winetest_dir2", MOVEFILE_REPLACE_EXISTING ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = MoveFileExA( "winetest_dir3", "winetest_dir2", MOVEFILE_REPLACE_EXISTING ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError());
ret = MoveFileExA( "winetest_dir2", "winetest_file2", MOVEFILE_REPLACE_EXISTING ); - ok(ret, "failed to move file, error %u\n", GetLastError()); + ok(ret, "failed to move file, error %lu\n", GetLastError());
ret = RemoveDirectoryA( "winetest_dir3" ); - ok(ret, "failed to remove directory, error %u\n", GetLastError()); + ok(ret, "failed to remove directory, error %lu\n", GetLastError()); ret = RemoveDirectoryA( "winetest_file2" ); - ok(ret, "failed to remove directory, error %u\n", GetLastError()); + ok(ret, "failed to remove directory, error %lu\n", GetLastError()); ret = DeleteFileA( "winetest_file1" ); - ok(ret, "failed to delete file, error %u\n", GetLastError()); + ok(ret, "failed to delete file, error %lu\n", GetLastError()); SetCurrentDirectoryA( cwd ); }
@@ -5954,23 +5954,23 @@ static void test_eof(void) GetTempFileNameA(temp_path, "eof", 0, filename);
file = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "failed to create file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to create file, error %lu\n", GetLastError());
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(!file_size.QuadPart, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 2, NULL, SEEK_SET);
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(!file_size.QuadPart, "got size %I64d\n", file_size.QuadPart);
SetLastError(0xdeadbeef); ret = ReadFile(file, buffer, sizeof(buffer), &size, NULL); - ok(ret, "failed to read, error %u\n", GetLastError()); - ok(!size, "got size %u\n", size); - ok(GetLastError() == 0xdeadbeef, "got error %u\n", GetLastError()); + ok(ret, "failed to read, error %lu\n", GetLastError()); + ok(!size, "got size %lu\n", size); + ok(GetLastError() == 0xdeadbeef, "got error %lu\n", GetLastError());
SetFilePointer(file, 2, NULL, SEEK_SET);
@@ -5979,155 +5979,155 @@ static void test_eof(void) overlapped.Offset = 2; ret = ReadFile(file, buffer, sizeof(buffer), &size, &overlapped); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_HANDLE_EOF, "got error %u\n", GetLastError()); - ok(!size, "got size %u\n", size); - todo_wine ok((NTSTATUS)overlapped.Internal == STATUS_PENDING, "got status %#x\n", (NTSTATUS)overlapped.Internal); + ok(GetLastError() == ERROR_HANDLE_EOF, "got error %lu\n", GetLastError()); + ok(!size, "got size %lu\n", size); + todo_wine ok((NTSTATUS)overlapped.Internal == STATUS_PENDING, "got status %#lx\n", (NTSTATUS)overlapped.Internal); ok(!overlapped.InternalHigh, "got size %Iu\n", overlapped.InternalHigh);
SetFilePointer(file, 2, NULL, SEEK_SET);
ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError());
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 2, "got size %I64d\n", file_size.QuadPart);
ret = WriteFile(file, "data", 4, &size, NULL); - ok(ret, "failed to write, error %u\n", GetLastError()); - ok(size == 4, "got size %u\n", size); + ok(ret, "failed to write, error %lu\n", GetLastError()); + ok(size == 4, "got size %lu\n", size);
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 6, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 4, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError());
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 4, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 0, NULL, SEEK_SET); ret = ReadFile(file, buffer, sizeof(buffer), &size, NULL); - ok(ret, "failed to read, error %u\n", GetLastError()); - ok(size == 4, "got size %u\n", size); + ok(ret, "failed to read, error %lu\n", GetLastError()); + ok(size == 4, "got size %lu\n", size); ok(!memcmp(buffer, "\0\0da", 4), "wrong data\n");
SetFilePointer(file, 6, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError());
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 6, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 0, NULL, SEEK_SET); ret = ReadFile(file, buffer, sizeof(buffer), &size, NULL); - ok(ret, "failed to read, error %u\n", GetLastError()); - ok(size == 6, "got size %u\n", size); + ok(ret, "failed to read, error %lu\n", GetLastError()); + ok(size == 6, "got size %lu\n", size); ok(!memcmp(buffer, "\0\0da\0\0", 6), "wrong data\n");
ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError());
SetFilePointer(file, 2, NULL, SEEK_SET); ret = WriteFile(file, "data", 4, &size, NULL); - ok(ret, "failed to write, error %u\n", GetLastError()); - ok(size == 4, "got size %u\n", size); + ok(ret, "failed to write, error %lu\n", GetLastError()); + ok(size == 4, "got size %lu\n", size);
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 6, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 0, NULL, SEEK_SET); ret = ReadFile(file, buffer, sizeof(buffer), &size, NULL); - ok(ret, "failed to read, error %u\n", GetLastError()); - ok(size == 6, "got size %u\n", size); + ok(ret, "failed to read, error %lu\n", GetLastError()); + ok(size == 6, "got size %lu\n", size); ok(!memcmp(buffer, "\0\0data", 6), "wrong data\n");
for (i = 0; i < ARRAY_SIZE(map_tests); ++i) { mapping = CreateFileMappingA(file, NULL, map_tests[i].protection, 0, 4, NULL); - ok(!!mapping, "failed to create mapping, error %u\n", GetLastError()); + ok(!!mapping, "failed to create mapping, error %lu\n", GetLastError());
ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 6, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 6, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 6, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 8, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 8, "got size %I64d\n", file_size.QuadPart);
SetLastError(0xdeadbeef); SetFilePointer(file, 6, NULL, SEEK_SET); ret = SetEndOfFile(file); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_USER_MAPPED_FILE, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_USER_MAPPED_FILE, "got error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 8, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 8192, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 8192, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 8191, NULL, SEEK_SET); ret = SetEndOfFile(file); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_USER_MAPPED_FILE, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_USER_MAPPED_FILE, "got error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 8192, "got size %I64d\n", file_size.QuadPart);
view = MapViewOfFile(mapping, map_tests[i].view_access, 0, 0, 4); - ok(!!view, "failed to map view, error %u\n", GetLastError()); + ok(!!view, "failed to map view, error %lu\n", GetLastError());
CloseHandle(mapping);
SetFilePointer(file, 16384, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 16384, "got size %I64d\n", file_size.QuadPart);
SetFilePointer(file, 16383, NULL, SEEK_SET); ret = SetEndOfFile(file); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_USER_MAPPED_FILE, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_USER_MAPPED_FILE, "got error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 16384, "got size %I64d\n", file_size.QuadPart);
ret = UnmapViewOfFile(view); - ok(ret, "failed to unmap view, error %u\n", GetLastError()); + ok(ret, "failed to unmap view, error %lu\n", GetLastError());
SetFilePointer(file, 6, NULL, SEEK_SET); ret = SetEndOfFile(file); - ok(ret, "failed to set EOF, error %u\n", GetLastError()); + ok(ret, "failed to set EOF, error %lu\n", GetLastError()); ret = GetFileSizeEx(file, &file_size); - ok(ret, "failed to get size, error %u\n", GetLastError()); + ok(ret, "failed to get size, error %lu\n", GetLastError()); ok(file_size.QuadPart == 6, "got size %I64d\n", file_size.QuadPart); }
CloseHandle(file); ret = DeleteFileA(filename); - ok(ret, "failed to delete %s, error %u\n", debugstr_a(filename), GetLastError()); + ok(ret, "failed to delete %s, error %lu\n", debugstr_a(filename), GetLastError()); }
START_TEST(file) @@ -6138,11 +6138,11 @@ START_TEST(file) InitFunctionPointers();
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPath error %u\n", GetLastError()); + ok(ret != 0, "GetTempPath error %lu\n", GetLastError()); ret = GetTempFileNameA(temp_path, "tmp", 0, filename); - ok(ret != 0, "GetTempFileName error %u\n", GetLastError()); + ok(ret != 0, "GetTempFileName error %lu\n", GetLastError()); ret = DeleteFileA(filename); - ok(ret != 0, "DeleteFile error %u\n", GetLastError()); + ok(ret != 0, "DeleteFile error %lu\n", GetLastError());
test__hread( ); test__hwrite( ); diff --git a/dlls/kernel32/tests/format_msg.c b/dlls/kernel32/tests/format_msg.c index 0e09ba904d0..2d317d1bb9e 100644 --- a/dlls/kernel32/tests/format_msg.c +++ b/dlls/kernel32/tests/format_msg.c @@ -60,7 +60,7 @@ static void test_message_from_string_wide(void) /* the basics */ r = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4, "failed: r=%d\n", r); + ok(r==4, "failed: r=%ld\n", r);
/* null string, crashes on Windows */ if (0) @@ -76,8 +76,8 @@ static void test_message_from_string_wide(void) r = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, L"", 0, 0, out, ARRAY_SIZE(out), NULL); error = GetLastError(); ok(!lstrcmpW(L"", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==0, "succeeded: r=%d\n", r); - ok(error == ERROR_NO_WORK_DONE || broken(error == 0xdeadbeef), "last error %u\n", error); + ok(r==0, "succeeded: r=%ld\n", r); + ok(error == ERROR_NO_WORK_DONE || broken(error == 0xdeadbeef), "last error %lu\n", error);
/* format placeholder with no specifier */ SetLastError(0xdeadbeef); @@ -86,8 +86,8 @@ static void test_message_from_string_wide(void) error = GetLastError(); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the buffer to be unchanged\n"); - ok(r==0, "succeeded: r=%d\n", r); - ok(error==ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(r==0, "succeeded: r=%ld\n", r); + ok(error==ERROR_INVALID_PARAMETER, "last error %lu\n", error);
/* test string with format placeholder with no specifier */ SetLastError(0xdeadbeef); @@ -96,8 +96,8 @@ static void test_message_from_string_wide(void) error = GetLastError(); ok(!lstrcmpW(out, L"testxx") || broken(!lstrcmpW( out, L"xxxxxx" )), /* winxp */ "Expected the buffer to be unchanged\n"); - ok(r==0, "succeeded: r=%d\n", r); - ok(error==ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(r==0, "succeeded: r=%ld\n", r); + ok(error==ERROR_INVALID_PARAMETER, "last error %lu\n", error);
/* insertion with no variadic arguments */ SetLastError(0xdeadbeef); @@ -106,8 +106,8 @@ static void test_message_from_string_wide(void) error = GetLastError(); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the buffer to be unchanged\n"); - ok(r==0, "succeeded: r=%d\n", r); - ok(error==ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(r==0, "succeeded: r=%ld\n", r); + ok(error==ERROR_INVALID_PARAMETER, "last error %lu\n", error);
SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); @@ -116,194 +116,194 @@ static void test_message_from_string_wide(void) error = GetLastError(); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the buffer to be unchanged\n"); - ok(r==0, "succeeded: r=%d\n", r); - ok(error==ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(r==0, "succeeded: r=%ld\n", r); + ok(error==ERROR_INVALID_PARAMETER, "last error %lu\n", error);
/* using the format feature */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!s!", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* no format */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* two pieces */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1%2", 0, 0, out, ARRAY_SIZE(out), L"te", L"st"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* three pieces */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1%3%2%1", 0, 0, out, ARRAY_SIZE(out), L"t", L"s", L"e"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* ls is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!ls!", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4, "failed: r=%d\n", r); + ok(r==4, "failed: r=%ld\n", r);
/* S is ansi */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!S!", 0, 0, out, ARRAY_SIZE(out), "test"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4, "failed: r=%d\n", r); + ok(r==4, "failed: r=%ld\n", r);
/* ws is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!ws!", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4, "failed: r=%d\n", r); + ok(r==4, "failed: r=%ld\n", r);
/* as characters */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!c!%2!c!%3!c!%1!c!", 0, 0, out, ARRAY_SIZE(out), 't', 'e', 's'); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* lc is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!lc!%2!lc!%3!lc!%1!lc!", 0, 0, out, ARRAY_SIZE(out), 't', 'e', 's'); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* wc is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!wc!%2!wc!%3!wc!%1!wc!", 0, 0, out, ARRAY_SIZE(out), 't', 'e', 's'); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* C is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!C!%2!C!%3!C!%1!C!", 0, 0, out, ARRAY_SIZE(out), 't', 'e', 's'); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* some numbers */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!d!%2!d!%3!d!", 0, 0, out, ARRAY_SIZE(out), 1, 2, 3); ok(!lstrcmpW(L"123", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==3,"failed: r=%d\n", r); + ok(r==3,"failed: r=%ld\n", r);
/* a single digit with some spacing */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!4d!", 0, 0, out, ARRAY_SIZE(out), 1); ok(!lstrcmpW(L" 1", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* a single digit, left justified */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!-4d!", 0, 0, out, ARRAY_SIZE(out), 1); ok(!lstrcmpW(L"1 ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* two digit decimal number */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!4d!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!lstrcmpW(L" 11", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* a hex number */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!4x!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!lstrcmpW(L" b", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* a hex number, upper case */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!4X!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!lstrcmpW(L" B", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* a hex number, upper case, left justified */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!-4X!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!lstrcmpW(L"B ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* a long hex number, upper case */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!4X!", 0, 0, out, ARRAY_SIZE(out), 0x1ab); ok(!lstrcmpW(L" 1AB", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* two percent... */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L" %%%% ", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L" %% ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* periods are special cases */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L" %.%. %1!d!", 0, 0, out, ARRAY_SIZE(out), 0x1ab); ok(!lstrcmpW(L" .. 427", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==8,"failed: r=%d\n", r); + ok(r==8,"failed: r=%ld\n", r);
/* %0 ends the line */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"test%0test", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"test", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* %! prints an exclamation */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"yah%!%0 ", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"yah!", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* %space */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"% % ", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L" ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* %n yields \r\n, %r yields \r, %t yields \t */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%n%r%t", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"\r\n\r\t", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"hi\n", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"hi\r\n", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"hi\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"hi\r\n", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* carriage return */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"\r", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"\r\n", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==2,"failed: r=%d\n", r); + ok(r==2,"failed: r=%ld\n", r);
/* double carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"\r\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"\r\n\r\n", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n", r); + ok(r==4,"failed: r=%ld\n", r);
/* null string as argument */ r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!lstrcmpW(L"(null)", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==6,"failed: r=%d\n",r); + ok(r==6,"failed: r=%ld\n",r);
/* precision and width */
r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!3s!", 0, 0, out, ARRAY_SIZE(out), L"t" ); ok(!lstrcmpW(L" t", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==3, "failed: r=%d\n",r); + ok(r==3, "failed: r=%ld\n",r); r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!*s!", 0, 0, out, ARRAY_SIZE(out), 4, L"t" ); ok(!lstrcmpW( L" t", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r); r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!4.2u!", 0, 0, out, ARRAY_SIZE(out), 3 ); ok(!lstrcmpW( L" 03", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r); r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!*.*u!", 0, 0, out, ARRAY_SIZE(out), 5, 3, 1 ); ok(!lstrcmpW( L" 001", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==5,"failed: r=%d\n",r); + ok(r==5,"failed: r=%ld\n",r); r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!*.*u!,%1!*.*u!", 0, 0, out, ARRAY_SIZE(out), 5, 3, 1, 4, 2 ); ok(!lstrcmpW( L" 001, 0002", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==11,"failed: r=%d\n",r); + ok(r==11,"failed: r=%ld\n",r); r = doitW(FORMAT_MESSAGE_FROM_STRING, L"%1!*.*u!,%3!*.*u!", 0, 0, out, ARRAY_SIZE(out), 5, 3, 1, 6, 4, 2 ); ok(!lstrcmpW( L" 001, 0002", out) || broken(!lstrcmpW(L" 001,000004", out)), /* NT4/Win2k */ "failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==12,"failed: r=%d\n",r); + ok(r==12,"failed: r=%ld\n",r); /* args are not counted the same way with an argument array */ { ULONG_PTR args[] = { 6, 4, 2, 5, 3, 1 }; r = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, L"%1!*.*u!,%1!*.*u!", 0, 0, out, ARRAY_SIZE(out), (va_list *)args ); ok(!lstrcmpW(L" 0002, 00003", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==13,"failed: r=%d\n",r); + ok(r==13,"failed: r=%ld\n",r); r = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, L"%1!*.*u!,%4!*.*u!", 0, 0, out, ARRAY_SIZE(out), (va_list *)args ); ok(!lstrcmpW(L" 0002, 001", out),"failed out=[%s]\n", wine_dbgstr_w(out)); - ok(r==12,"failed: r=%d\n",r); + ok(r==12,"failed: r=%ld\n",r); }
/* change of pace... test the low byte of dwflags */ @@ -312,25 +312,25 @@ static void test_message_from_string_wide(void) r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"hi\n", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"hi ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==3,"failed: r=%d\n", r); + ok(r==3,"failed: r=%ld\n", r);
/* carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"hi\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L"hi ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==3,"failed: r=%d\n", r); + ok(r==3,"failed: r=%ld\n", r);
/* carriage return */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"\r", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L" ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==1,"failed: r=%d\n", r); + ok(r==1,"failed: r=%ld\n", r);
/* double carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"\r\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!lstrcmpW(L" ", out), "failed out=%s\n", wine_dbgstr_w(out)); - ok(r==2,"failed: r=%d\n", r); + ok(r==2,"failed: r=%ld\n", r); }
static void test_message_from_string(void) @@ -342,7 +342,7 @@ static void test_message_from_string(void) /* the basics */ r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, ARRAY_SIZE(out),NULL); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* null string, crashes on Windows */ if (0) @@ -357,9 +357,9 @@ static void test_message_from_string(void) memcpy(out, init_buf, sizeof(init_buf)); r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n"); - ok(r==0, "succeeded: r=%d\n", r); + ok(r==0, "succeeded: r=%ld\n", r); ok(GetLastError() == ERROR_NO_WORK_DONE || broken(GetLastError() == 0xdeadbeef), - "last error %u\n", GetLastError()); + "last error %lu\n", GetLastError());
/* format placeholder with no specifier */ SetLastError(0xdeadbeef); @@ -367,9 +367,9 @@ static void test_message_from_string(void) r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "%", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n"); - ok(r==0, "succeeded: r=%d\n", r); + ok(r==0, "succeeded: r=%ld\n", r); ok(GetLastError()==ERROR_INVALID_PARAMETER, - "last error %u\n", GetLastError()); + "last error %lu\n", GetLastError());
/* test string with format placeholder with no specifier */ SetLastError(0xdeadbeef); @@ -377,210 +377,210 @@ static void test_message_from_string(void) r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test%", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n"); - ok(r==0, "succeeded: r=%d\n", r); + ok(r==0, "succeeded: r=%ld\n", r); ok(GetLastError()==ERROR_INVALID_PARAMETER, - "last error %u\n", GetLastError()); + "last error %lu\n", GetLastError());
/* insertion with no variadic arguments */ SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "%1", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n"); - ok(r==0, "succeeded: r=%d\n", r); - ok(GetLastError()==ERROR_INVALID_PARAMETER, "last error %u\n", GetLastError()); + ok(r==0, "succeeded: r=%ld\n", r); + ok(GetLastError()==ERROR_INVALID_PARAMETER, "last error %lu\n", GetLastError());
SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, "%1", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n"); - ok(r==0, "succeeded: r=%d\n", r); - ok(GetLastError()==ERROR_INVALID_PARAMETER, "last error %u\n", GetLastError()); + ok(r==0, "succeeded: r=%ld\n", r); + ok(GetLastError()==ERROR_INVALID_PARAMETER, "last error %lu\n", GetLastError());
/* using the format feature */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!s!", 0, 0, out, ARRAY_SIZE(out), "test"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* no format */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1", 0, 0, out, ARRAY_SIZE(out), "test"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* two pieces */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1%2", 0, 0, out, ARRAY_SIZE(out), "te","st"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* three pieces */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1%3%2%1", 0, 0, out, ARRAY_SIZE(out), "t","s","e"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* s is ansi */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!s!", 0, 0, out, ARRAY_SIZE(out), "test"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* ls is unicode */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!ls!", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* S is unicode */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!S!", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* ws is unicode */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!ws!", 0, 0, out, ARRAY_SIZE(out), L"test"); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* as characters */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!c!%2!c!%3!c!%1!c!", 0, 0, out, ARRAY_SIZE(out), 't','e','s'); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* lc is unicode */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!lc!%2!lc!%3!lc!%1!lc!", 0, 0, out, ARRAY_SIZE(out), 't','e','s'); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* wc is unicode */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!wc!%2!wc!%3!wc!%1!wc!", 0, 0, out, ARRAY_SIZE(out), 't','e','s'); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* C is unicode */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!C!%2!C!%3!C!%1!C!", 0, 0, out, ARRAY_SIZE(out), 't','e','s'); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* some numbers */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!d!%2!d!%3!d!", 0, 0, out, ARRAY_SIZE(out), 1,2,3); ok(!strcmp("123", out),"failed out=[%s]\n",out); - ok(r==3,"failed: r=%d\n",r); + ok(r==3,"failed: r=%ld\n",r);
/* a single digit with some spacing */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4d!", 0, 0, out, ARRAY_SIZE(out), 1); ok(!strcmp(" 1", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* a single digit, left justified */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!-4d!", 0, 0, out, ARRAY_SIZE(out), 1); ok(!strcmp("1 ", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* two digit decimal number */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4d!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!strcmp(" 11", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* a hex number */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4x!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!strcmp(" b", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* a hex number, upper case */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4X!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!strcmp(" B", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* a hex number, upper case, left justified */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!-4X!", 0, 0, out, ARRAY_SIZE(out), 11); ok(!strcmp("B ", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* a long hex number, upper case */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4X!", 0, 0, out, ARRAY_SIZE(out), 0x1ab); ok(!strcmp(" 1AB", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* two percent... */ r = doit(FORMAT_MESSAGE_FROM_STRING, " %%%% ", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp(" %% ", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* periods are special cases */ r = doit(FORMAT_MESSAGE_FROM_STRING, " %.%. %1!d!", 0, 0, out, ARRAY_SIZE(out), 0x1ab); ok(!strcmp(" .. 427", out),"failed out=[%s]\n",out); - ok(r==7,"failed: r=%d\n",r); + ok(r==7,"failed: r=%ld\n",r);
/* %0 ends the line */ r = doit(FORMAT_MESSAGE_FROM_STRING, "test%0test", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("test", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* %! prints an exclamation */ r = doit(FORMAT_MESSAGE_FROM_STRING, "yah%!%0 ", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("yah!", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* %space */ r = doit(FORMAT_MESSAGE_FROM_STRING, "% % ", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp(" ", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* %n yields \r\n, %r yields \r, %t yields \t */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%n%r%t", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("\r\n\r\t", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* line feed */ r = doit(FORMAT_MESSAGE_FROM_STRING, "hi\n", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("hi\r\n", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* carriage return line feed */ r = doit(FORMAT_MESSAGE_FROM_STRING, "hi\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("hi\r\n", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* carriage return */ r = doit(FORMAT_MESSAGE_FROM_STRING, "\r", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("\r\n", out),"failed out=[%s]\n",out); - ok(r==2,"failed: r=%d\n",r); + ok(r==2,"failed: r=%ld\n",r);
/* double carriage return line feed */ r = doit(FORMAT_MESSAGE_FROM_STRING, "\r\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("\r\n\r\n", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r);
/* null string as argument */ r = doit(FORMAT_MESSAGE_FROM_STRING, "%1", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!strcmp("(null)", out),"failed out=[%s]\n",out); - ok(r==6,"failed: r=%d\n",r); + ok(r==6,"failed: r=%ld\n",r);
/* precision and width */
r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!3s!", 0, 0, out, sizeof(out), "t" ); ok(!strcmp(" t", out),"failed out=[%s]\n",out); - ok(r==3, "failed: r=%d\n",r); + ok(r==3, "failed: r=%ld\n",r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!*s!", 0, 0, out, sizeof(out), 4, "t"); if (!strcmp("*s",out)) win_skip( "width/precision not supported\n" ); else { ok(!strcmp( " t", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4.2u!", 0, 0, out, sizeof(out), 3 ); ok(!strcmp( " 03", out),"failed out=[%s]\n",out); - ok(r==4,"failed: r=%d\n",r); + ok(r==4,"failed: r=%ld\n",r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!*.*u!", 0, 0, out, sizeof(out), 5, 3, 1 ); ok(!strcmp( " 001", out),"failed out=[%s]\n",out); - ok(r==5,"failed: r=%d\n",r); + ok(r==5,"failed: r=%ld\n",r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!*.*u!,%1!*.*u!", 0, 0, out, sizeof(out), 5, 3, 1, 4, 2 ); ok(!strcmp( " 001, 0002", out),"failed out=[%s]\n",out); - ok(r==11,"failed: r=%d\n",r); + ok(r==11,"failed: r=%ld\n",r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!*.*u!,%3!*.*u!", 0, 0, out, sizeof(out), 5, 3, 1, 6, 4, 2 ); /* older Win versions marked as broken even though this is arguably the correct behavior */ @@ -588,18 +588,18 @@ static void test_message_from_string(void) ok(!strcmp( " 001, 0002", out) || broken(!strcmp(" 001,000004", out)), /* NT4/Win2k */ "failed out=[%s]\n",out); - ok(r==12,"failed: r=%d\n",r); + ok(r==12,"failed: r=%ld\n",r); /* args are not counted the same way with an argument array */ { ULONG_PTR args[] = { 6, 4, 2, 5, 3, 1 }; r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, "%1!*.*u!,%1!*.*u!", 0, 0, out, sizeof(out), (va_list *)args ); ok(!strcmp(" 0002, 00003", out),"failed out=[%s]\n",out); - ok(r==13,"failed: r=%d\n",r); + ok(r==13,"failed: r=%ld\n",r); r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, "%1!*.*u!,%4!*.*u!", 0, 0, out, sizeof(out), (va_list *)args ); ok(!strcmp(" 0002, 001", out),"failed out=[%s]\n",out); - ok(r==12,"failed: r=%d\n",r); + ok(r==12,"failed: r=%ld\n",r); } }
@@ -609,25 +609,25 @@ static void test_message_from_string(void) r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("hi ", out), "failed out=[%s]\n",out); - ok(r==3, "failed: r=%d\n",r); + ok(r==3, "failed: r=%ld\n",r);
/* carriage return line feed */ r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp("hi ", out),"failed out=[%s]\n",out); - ok(r==3,"failed: r=%d\n",r); + ok(r==3,"failed: r=%ld\n",r);
/* carriage return */ r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "\r", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp(" ", out),"failed out=[%s]\n",out); - ok(r==1,"failed: r=%d\n",r); + ok(r==1,"failed: r=%ld\n",r);
/* double carriage return line feed */ r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "\r\r\n", 0, 0, out, ARRAY_SIZE(out)); ok(!strcmp(" ", out),"failed out=[%s]\n",out); - ok(r==2,"failed: r=%d\n",r); + ok(r==2,"failed: r=%ld\n",r); }
static void test_message_ignore_inserts(void) @@ -639,18 +639,18 @@ static void test_message_ignore_inserts(void)
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("test", out), "Expected output string "test", got %s\n", out);
/* The %0 escape sequence is handled. */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "test%0", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("test", out), "Expected output string "test", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "test%0test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("test", out), "Expected output string "test", got %s\n", out);
/* While FormatMessageA returns 0 in this case, no last error code is set. */ @@ -658,68 +658,68 @@ static void test_message_ignore_inserts(void) memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%0test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %d\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %ld\n", ret); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_NO_WORK_DONE || broken(GetLastError() == 0xdeadbeef), - "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %u\n", GetLastError()); + "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n", GetLastError());
/* Insert sequences are ignored. */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "test%1%2!*.*s!%99", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 17, "Expected FormatMessageA to return 17, got %d\n", ret); + ok(ret == 17, "Expected FormatMessageA to return 17, got %ld\n", ret); ok(!strcmp("test%1%2!*.*s!%99", out), "Expected output string "test%%1%%2!*.*s!%%99", got %s\n", out);
/* Only the "%n", "%r", and "%t" escape sequences are processed. */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%%% %.%!", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 8, "Expected FormatMessageA to return 8, got %d\n", ret); + ok(ret == 8, "Expected FormatMessageA to return 8, got %ld\n", ret); ok(!strcmp("%%% %.%!", out), "Expected output string "%%%%%% %%.%%!", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%n%r%t", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("\r\n\r\t", out), "Expected output string "\r\n\r\t", got %s\n", out);
/* CRLF characters are processed normally. */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "hi\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("hi\r\n", out), "Expected output string "hi\r\n", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "hi\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("hi\r\n", out), "Expected output string "hi\r\n", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "\r", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 2, "Expected FormatMessageA to return 2, got %d\n", ret); + ok(ret == 2, "Expected FormatMessageA to return 2, got %ld\n", ret); ok(!strcmp("\r\n", out), "Expected output string "\r\n", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "\r\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %ld\n", ret); ok(!strcmp("\r\n\r\n", out), "Expected output string "\r\n\r\n", got %s\n", out);
/* The width parameter is handled the same also. */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0, 0, out, ARRAY_SIZE(out), NULL); ok(!strcmp("hi ", out), "Expected output string "hi ", got %s\n", out); - ok(ret == 3, "Expected FormatMessageA to return 3, got %d\n", ret); + ok(ret == 3, "Expected FormatMessageA to return 3, got %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 3, "Expected FormatMessageA to return 3, got %d\n", ret); + ok(ret == 3, "Expected FormatMessageA to return 3, got %ld\n", ret); ok(!strcmp("hi ", out), "Expected output string "hi ", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, "\r", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 1, "Expected FormatMessageA to return 1, got %d\n", ret); + ok(ret == 1, "Expected FormatMessageA to return 1, got %ld\n", ret); ok(!strcmp(" ", out), "Expected output string " ", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, "\r\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 2, "Expected FormatMessageA to return 2, got %d\n", ret); + ok(ret == 2, "Expected FormatMessageA to return 2, got %ld\n", ret); ok(!strcmp(" ", out), "Expected output string " ", got %s\n", out); }
@@ -730,89 +730,89 @@ static void test_message_ignore_inserts_wide(void)
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"test", out), "Expected output string "test", got %s\n", wine_dbgstr_w(out));
/* The %0 escape sequence is handled. */ ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"test%0", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"test", out), "Expected output string "test", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"test%0test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"test", out), "Expected output string "test", got %s\n", wine_dbgstr_w(out));
/* While FormatMessageA returns 0 in this case, no last error code is set. */ SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"%0test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %d\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %ld\n", ret); ok(!lstrcmpW(L"", out), "Expected the output buffer to be the empty string, got %s\n", wine_dbgstr_w(out)); ok(GetLastError() == ERROR_NO_WORK_DONE || broken(GetLastError() == 0xdeadbeef), - "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %u\n", GetLastError()); + "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n", GetLastError());
/* Insert sequences are ignored. */ ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"test%1%2!*.*s!%99", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 17, "Expected FormatMessageW to return 17, got %d\n", ret); + ok(ret == 17, "Expected FormatMessageW to return 17, got %ld\n", ret); ok(!lstrcmpW(L"test%1%2!*.*s!%99", out), "Expected output string "test%%1%%2!*.*s!%%99", got %s\n", wine_dbgstr_w(out));
/* Only the "%n", "%r", and "%t" escape sequences are processed. */ ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"%%% %.%!", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 8, "Expected FormatMessageW to return 8, got %d\n", ret); + ok(ret == 8, "Expected FormatMessageW to return 8, got %ld\n", ret); ok(!lstrcmpW(L"%%% %.%!", out), "Expected output string "%%%%%% %%.%%!", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"%n%r%t", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"\r\n\r\t", out), "Expected output string "\r\n\r\t", got %s\n", wine_dbgstr_w(out));
/* CRLF characters are processed normally. */ ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"hi\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"hi\r\n", out), "Expected output string "hi\r\n", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"hi\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"hi\r\n", out), "Expected output string "hi\r\n", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"\r", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 2, "Expected FormatMessageW to return 2, got %d\n", ret); + ok(ret == 2, "Expected FormatMessageW to return 2, got %ld\n", ret); ok(!lstrcmpW(L"\r\n", out), "Expected output string "\r\n", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, L"\r\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %d\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %ld\n", ret); ok(!lstrcmpW(L"\r\n\r\n", out), "Expected output string "\r\n\r\n", got %s\n", wine_dbgstr_w(out));
/* The width parameter is handled the same also. */ ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"hi\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 3, "Expected FormatMessageW to return 3, got %d\n", ret); + ok(ret == 3, "Expected FormatMessageW to return 3, got %ld\n", ret); ok(!lstrcmpW(L"hi ", out), "Expected output string "hi ", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"hi\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 3, "Expected FormatMessageW to return 3, got %d\n", ret); + ok(ret == 3, "Expected FormatMessageW to return 3, got %ld\n", ret); ok(!lstrcmpW(L"hi ", out), "Expected output string "hi ", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"\r", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 1, "Expected FormatMessageW to return 1, got %d\n", ret); + ok(ret == 1, "Expected FormatMessageW to return 1, got %ld\n", ret); ok(!lstrcmpW(L" ", out), "Expected output string " ", got %s\n", wine_dbgstr_w(out));
ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, L"\r\r\n", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 2, "Expected FormatMessageW to return 2, got %d\n", ret); + ok(ret == 2, "Expected FormatMessageW to return 2, got %ld\n", ret); ok(!lstrcmpW(L" ", out), "Expected output string " ", got %s\n", wine_dbgstr_w(out)); }
@@ -825,134 +825,134 @@ static void test_message_wrap(void) /* No need for wrapping */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 20, "short long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 15, "Expected FormatMessageW to return 15, got %d\n", ret); + ok(ret == 15, "Expected FormatMessageW to return 15, got %ld\n", ret); ok(!strcmp("short long line", out),"failed out=[%s]\n",out);
/* Wrap the last word */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short long\r\nline", out),"failed out=[%s]\n",out);
/* Wrap the very last word */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 20, "short long long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 21, "Expected FormatMessageW to return 21, got %d\n", ret); + ok(ret == 21, "Expected FormatMessageW to return 21, got %ld\n", ret); ok(!strcmp("short long long\r\nline", out),"failed out=[%s]\n",out);
/* Strictly less than 10 characters per line! */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 10, "short long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong line", out),"failed out=[%s]\n",out);
/* Handling of duplicate spaces */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 16, "short long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short long\r\nline", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 16, "short long wordlongerthanaline", 0, 0, out, sizeof(out), NULL); - ok(ret == 33, "Expected FormatMessageW to return 33, got %d\n", ret); + ok(ret == 33, "Expected FormatMessageW to return 33, got %ld\n", ret); ok(!strcmp("short long\r\nwordlongerthanal\r\nine", out),"failed out=[%s]\n",out);
/* Breaking in the middle of spaces */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 12, "short long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 18, "Expected FormatMessageW to return 18, got %d\n", ret); + ok(ret == 18, "Expected FormatMessageW to return 18, got %ld\n", ret); ok(!strcmp("short long\r\n line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 12, "short long wordlongerthanaline", 0, 0, out, sizeof(out), NULL); - ok(ret == 35, "Expected FormatMessageW to return 35, got %d\n", ret); + ok(ret == 35, "Expected FormatMessageW to return 35, got %ld\n", ret); ok(!strcmp("short long\r\n\r\nwordlongerth\r\nanaline", out),"failed out=[%s]\n",out);
/* Handling of start-of-string spaces */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 15, " short line", 0, 0, out, sizeof(out), NULL); - ok(ret == 13, "Expected FormatMessageW to return 13, got %d\n", ret); + ok(ret == 13, "Expected FormatMessageW to return 13, got %ld\n", ret); ok(!strcmp(" short line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, " shortlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 17, "Expected FormatMessageW to return 17, got %d\n", ret); + ok(ret == 17, "Expected FormatMessageW to return 17, got %ld\n", ret); ok(!strcmp("\r\nshortlong\r\nline", out),"failed out=[%s]\n",out);
/* Handling of start-of-line spaces */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "l1%n shortlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 21, "Expected FormatMessageW to return 21, got %d\n", ret); + ok(ret == 21, "Expected FormatMessageW to return 21, got %ld\n", ret); ok(!strcmp("l1\r\n\r\nshortlong\r\nline", out),"failed out=[%s]\n",out);
/* Pure space wrapping */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 5, " ", 0, 0, out, sizeof(out), NULL); - ok(ret == 7, "Expected FormatMessageW to return 7, got %d\n", ret); + ok(ret == 7, "Expected FormatMessageW to return 7, got %ld\n", ret); ok(!strcmp("\r\n\r\n\r\n ", out),"failed out=[%s]\n",out);
/* Handling of trailing spaces */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 5, "l1 ", 0, 0, out, sizeof(out), NULL); - ok(ret == 10, "Expected FormatMessageW to return 10, got %d\n", ret); + ok(ret == 10, "Expected FormatMessageW to return 10, got %ld\n", ret); ok(!strcmp("l1\r\n\r\n\r\n ", out),"failed out=[%s]\n",out);
/* Word that just fills the line */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 8, "shortlon", 0, 0, out, sizeof(out), NULL); - ok(ret == 10, "Expected FormatMessageW to return 10, got %d\n", ret); + ok(ret == 10, "Expected FormatMessageW to return 10, got %ld\n", ret); ok(!strcmp("shortlon\r\n", out),"failed out=[%s]\n",out);
/* Word longer than the line */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 8, "shortlongline", 0, 0, out, sizeof(out), NULL); - ok(ret == 15, "Expected FormatMessageW to return 15, got %d\n", ret); + ok(ret == 15, "Expected FormatMessageW to return 15, got %ld\n", ret); ok(!strcmp("shortlon\r\ngline", out),"failed out=[%s]\n",out);
/* Wrap the line multiple times */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 7, "short long line", 0, 0, out, sizeof(out), NULL); - ok(ret == 17, "Expected FormatMessageW to return 17, got %d\n", ret); + ok(ret == 17, "Expected FormatMessageW to return 17, got %ld\n", ret); ok(!strcmp("short\r\nlong\r\nline", out),"failed out=[%s]\n",out);
/* '\n's in the source are ignored */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short\nlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short long\r\nline", out),"failed out=[%s]\n",out);
/* Wrap even before a '%n' */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 8, "shortlon%n", 0, 0, out, sizeof(out), NULL); - ok(ret == 12, "Expected FormatMessageW to return 12, got %d\n", ret); + ok(ret == 12, "Expected FormatMessageW to return 12, got %ld\n", ret); ok(!strcmp("shortlon\r\n\r\n", out),"failed out=[%s]\n",out);
/* '%n's count as starting a new line and combine with line wrapping */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 10, "short%nlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 8, "short%nlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 17, "Expected FormatMessageW to return 17, got %d\n", ret); + ok(ret == 17, "Expected FormatMessageW to return 17, got %ld\n", ret); ok(!strcmp("short\r\nlong\r\nline", out),"failed out=[%s]\n",out);
/* '%r's also count as starting a new line and all */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 10, "short%rlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 15, "Expected FormatMessageW to return 15, got %d\n", ret); + ok(ret == 15, "Expected FormatMessageW to return 15, got %ld\n", ret); ok(!strcmp("short\rlong line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 8, "short%rlong line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\rlong\r\nline", out),"failed out=[%s]\n",out);
/* IGNORE_INSERTS does not prevent line wrapping or disable '%n' */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | 8, "short%nlong line%1", 0, 0, out, sizeof(out), NULL); - ok(ret == 19, "Expected FormatMessageW to return 19, got %d\n", ret); + ok(ret == 19, "Expected FormatMessageW to return 19, got %ld\n", ret); ok(!strcmp("short\r\nlong\r\nline%1", out),"failed out=[%s]\n",out);
/* MAX_WIDTH_MASK is the same as specifying an infinite line width */ @@ -965,43 +965,43 @@ static void test_message_wrap(void) } ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, in, 0, 0, out, sizeof(out), NULL); - ok(ret == 272, "Expected FormatMessageW to return 272, got %d\n", ret); + ok(ret == 272, "Expected FormatMessageW to return 272, got %ld\n", ret); ok(!strcmp(ref, out),"failed out=[%s]\n",out);
/* Wrapping and non-space characters */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long\tline", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong\tline", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long-line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong-line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long_line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong_line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long.line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong.line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long,line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong,line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long!line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong!line", out),"failed out=[%s]\n",out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | 11, "short long?line", 0, 0, out, sizeof(out), NULL); - ok(ret == 16, "Expected FormatMessageW to return 16, got %d\n", ret); + ok(ret == 16, "Expected FormatMessageW to return 16, got %ld\n", ret); ok(!strcmp("short\r\nlong?line", out),"failed out=[%s]\n",out); }
@@ -1015,9 +1015,9 @@ static void test_message_insufficient_buffer(void) SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, 0, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); ok(!memcmp(expected_buf, out, sizeof(expected_buf)), "Expected the buffer to be untouched\n"); @@ -1025,9 +1025,9 @@ static void test_message_insufficient_buffer(void) SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, 1, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); ok(!memcmp(expected_buf, out, sizeof(expected_buf)), "Expected the buffer to be untouched\n"); @@ -1035,9 +1035,9 @@ static void test_message_insufficient_buffer(void) SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, ARRAY_SIZE(out) - 1, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); ok(!memcmp(expected_buf, out, sizeof(expected_buf)), "Expected the buffer to be untouched\n"); @@ -1053,27 +1053,27 @@ static void test_message_insufficient_buffer(void) ret = FormatMessageA( FORMAT_MESSAGE_FROM_STRING, tmp, 0, 0, buf, size, NULL ); if (size < 32768) { - ok( ret == size - 1, "%u: got %u\n", size, ret ); + ok( ret == size - 1, "%lu: got %lu\n", size, ret ); ok( !strcmp( tmp, buf ), "wrong buffer\n" ); } else { - ok( ret == 0, "%u: got %u\n", size, ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == 0, "%lu: got %lu\n", size, ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); }
SetLastError( 0xdeadbeef ); ret = doit( FORMAT_MESSAGE_FROM_STRING, "%1", 0, 0, buf, size, tmp ); if (size < 32768) { - ok( ret == size - 1, "%u: got %u\n", size, ret ); + ok( ret == size - 1, "%lu: got %lu\n", size, ret ); ok( !strcmp( tmp, buf ), "wrong buffer\n" ); } else { - ok( ret == 0, "%u: got %u\n", size, ret ); + ok( ret == 0, "%lu: got %lu\n", size, ret ); ok( GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_MORE_DATA), /* winxp */ - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); } HeapFree( GetProcessHeap(), 0, buf );
@@ -1082,14 +1082,14 @@ static void test_message_insufficient_buffer(void) tmp, 0, 0, (char *)&buf, size, NULL ); if (size < 32768) { - ok( ret == size - 1, "%u: got %u\n", size, ret ); + ok( ret == size - 1, "%lu: got %lu\n", size, ret ); ok( !strcmp( tmp, buf ), "wrong buffer\n" ); HeapFree( GetProcessHeap(), 0, buf ); } else { - ok( ret == 0, "%u: got %u\n", size, ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == 0, "%lu: got %lu\n", size, ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } HeapFree( GetProcessHeap(), 0, tmp ); } @@ -1103,9 +1103,9 @@ static void test_message_insufficient_buffer_wide(void) SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, L"test", 0, 0, out, 0, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the buffer to be untouched\n"); @@ -1113,9 +1113,9 @@ static void test_message_insufficient_buffer_wide(void) SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, L"test", 0, 0, out, 1, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); ok(!memcmp(out, L"\0xxxxx", 6 * sizeof(WCHAR)) || broken(!lstrcmpW( out, L"xxxxxx" )), /* winxp */ @@ -1124,9 +1124,9 @@ static void test_message_insufficient_buffer_wide(void) SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, L"test", 0, 0, out, 4, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); ok(!memcmp(out, L"tes\0xx", 6 * sizeof(WCHAR)) || broken(!lstrcmpW( out, L"xxxxxx" )), /* winxp */ @@ -1139,16 +1139,16 @@ static void test_message_insufficient_buffer_wide(void) for (i = 0; i < size; i++) tmp[i] = 'A' + i % 26; tmp[size - 1] = 0; ret = FormatMessageW( FORMAT_MESSAGE_FROM_STRING, tmp, 0, 0, buf, size, NULL ); - ok(ret == size - 1 || broken(!ret), /* winxp */ "got %u\n", ret); + ok(ret == size - 1 || broken(!ret), /* winxp */ "got %lu\n", ret); if (!ret) break; ok( !lstrcmpW( tmp, buf ), "wrong buffer\n" ); ret = doitW( FORMAT_MESSAGE_FROM_STRING, L"%1", 0, 0, buf, size, tmp ); - ok(ret == size - 1, "got %u\n", ret); + ok(ret == size - 1, "got %lu\n", ret); ok( !lstrcmpW( tmp, buf ), "wrong buffer\n" ); HeapFree( GetProcessHeap(), 0, buf ); ret = FormatMessageW( FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, tmp, 0, 0, (WCHAR *)&buf, size, NULL ); - ok(ret == size - 1, "got %u\n", ret); + ok(ret == size - 1, "got %lu\n", ret); ok( !lstrcmpW( tmp, buf ), "wrong buffer\n" ); HeapFree( GetProcessHeap(), 0, tmp ); HeapFree( GetProcessHeap(), 0, buf ); @@ -1163,14 +1163,14 @@ static void test_message_null_buffer(void) SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL); error = GetLastError(); - ok(!ret, "FormatMessageA returned %u\n", ret); - ok(error == ERROR_INSUFFICIENT_BUFFER, "last error %u\n", error); + ok(!ret, "FormatMessageA returned %lu\n", ret); + ok(error == ERROR_INSUFFICIENT_BUFFER, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 1, NULL); error = GetLastError(); - ok(!ret, "FormatMessageA returned %u\n", ret); - ok(error == ERROR_INSUFFICIENT_BUFFER, "last error %u\n", error); + ok(!ret, "FormatMessageA returned %lu\n", ret); + ok(error == ERROR_INSUFFICIENT_BUFFER, "last error %lu\n", error);
if (0) /* crashes on Windows */ { @@ -1181,20 +1181,20 @@ static void test_message_null_buffer(void) SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL); error = GetLastError(); - ok(!ret, "FormatMessageA returned %u\n", ret); - ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %u\n", error); + ok(!ret, "FormatMessageA returned %lu\n", ret); + ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 1, NULL); error = GetLastError(); - ok(!ret, "FormatMessageA returned %u\n", ret); - ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %u\n", error); + ok(!ret, "FormatMessageA returned %lu\n", ret); + ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 256, NULL); error = GetLastError(); - ok(!ret, "FormatMessageA returned %u\n", ret); - ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %u\n", error); + ok(!ret, "FormatMessageA returned %lu\n", ret); + ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %lu\n", error); }
static void test_message_null_buffer_wide(void) @@ -1204,38 +1204,38 @@ static void test_message_null_buffer_wide(void) SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL); error = GetLastError(); - ok(!ret, "FormatMessageW returned %u\n", ret); - ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(!ret, "FormatMessageW returned %lu\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 1, NULL); error = GetLastError(); - ok(!ret, "FormatMessageW returned %u\n", ret); - ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(!ret, "FormatMessageW returned %lu\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 256, NULL); error = GetLastError(); - ok(!ret, "FormatMessageW returned %u\n", ret); - ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(!ret, "FormatMessageW returned %lu\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL); error = GetLastError(); - ok(!ret, "FormatMessageW returned %u\n", ret); - ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(!ret, "FormatMessageW returned %lu\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 1, NULL); error = GetLastError(); - ok(!ret, "FormatMessageW returned %u\n", ret); - ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(!ret, "FormatMessageW returned %lu\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 256, NULL); error = GetLastError(); - ok(!ret, "FormatMessageW returned %u\n", ret); - ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + ok(!ret, "FormatMessageW returned %lu\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %lu\n", error); }
static void test_message_allocate_buffer(void) @@ -1254,15 +1254,15 @@ static void test_message_allocate_buffer(void) buf = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, "", 0, 0, (char *)&buf, 0, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(buf == NULL, "Expected output buffer pointer to be NULL\n"); ok(GetLastError() == ERROR_NO_WORK_DONE || broken(GetLastError() == 0xdeadbeef), - "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %u\n", GetLastError()); + "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n", GetLastError());
buf = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&buf, 0, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (char *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (char *)0xdeadbeef) @@ -1275,7 +1275,7 @@ static void test_message_allocate_buffer(void) buf = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&buf, strlen("test"), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (char *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (char *)0xdeadbeef) @@ -1288,7 +1288,7 @@ static void test_message_allocate_buffer(void) buf = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&buf, strlen("test") + 1, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (char *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (char *)0xdeadbeef) @@ -1301,7 +1301,7 @@ static void test_message_allocate_buffer(void) buf = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&buf, strlen("test") + 2, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (char *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (char *)0xdeadbeef) @@ -1314,7 +1314,7 @@ static void test_message_allocate_buffer(void) buf = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&buf, 1024, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (char *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (char *)0xdeadbeef) @@ -1348,24 +1348,24 @@ static void test_message_allocate_buffer_wide(void) buf = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"", 0, 0, (WCHAR *)&buf, 0, NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(buf == NULL, "Expected output buffer pointer to be NULL\n"); ok(GetLastError() == ERROR_NO_WORK_DONE || broken(GetLastError() == 0xdeadbeef), - "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %u\n", GetLastError()); + "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); buf = (WCHAR *)0xdeadbeef; ret = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"%1", 0, 0, (WCHAR *)&buf, 0, L"" ); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(buf == NULL, "Expected output buffer pointer to be NULL\n"); ok(GetLastError() == ERROR_NO_WORK_DONE || broken(GetLastError() == 0xdeadbeef), - "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %u\n", GetLastError()); + "Expected GetLastError() to return ERROR_NO_WORK_DONE, got %lu\n", GetLastError());
buf = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"test", 0, 0, (WCHAR *)&buf, 0, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (WCHAR *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (WCHAR *)0xdeadbeef) @@ -1378,7 +1378,7 @@ static void test_message_allocate_buffer_wide(void) buf = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"test", 0, 0, (WCHAR *)&buf, 4, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (WCHAR *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (WCHAR *)0xdeadbeef) @@ -1391,7 +1391,7 @@ static void test_message_allocate_buffer_wide(void) buf = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"test", 0, 0, (WCHAR *)&buf, 5, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (WCHAR *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (WCHAR *)0xdeadbeef) @@ -1404,7 +1404,7 @@ static void test_message_allocate_buffer_wide(void) buf = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"test", 0, 0, (WCHAR *)&buf, 6, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (WCHAR *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (WCHAR *)0xdeadbeef) @@ -1417,7 +1417,7 @@ static void test_message_allocate_buffer_wide(void) buf = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER, L"test", 0, 0, (WCHAR *)&buf, 1024, NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(buf != NULL && buf != (WCHAR *)0xdeadbeef, "Expected output buffer pointer to be valid\n"); if (buf != NULL && buf != (WCHAR *)0xdeadbeef) @@ -1467,52 +1467,52 @@ static void test_message_from_hmodule(void) ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 3044, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, ARRAY_SIZE(out), NULL); error = GetLastError(); - ok(ret == 0, "FormatMessageA returned %u instead of 0\n", ret); + ok(ret == 0, "FormatMessageA returned %lu instead of 0\n", ret); ok(error == ERROR_MR_MID_NOT_FOUND || error == ERROR_MUI_FILE_NOT_FOUND || - error == ERROR_RESOURCE_TYPE_NOT_FOUND, "Unexpected last error %u.\n", error); + error == ERROR_RESOURCE_TYPE_NOT_FOUND, "Unexpected last error %lu.\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 3044, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), out, ARRAY_SIZE(out), NULL); error = GetLastError(); - ok(ret == 0, "FormatMessageA returned %u instead of 0\n", ret); + ok(ret == 0, "FormatMessageA returned %lu instead of 0\n", ret); ok(error == ERROR_MR_MID_NOT_FOUND || error == ERROR_MUI_FILE_NOT_LOADED || - error == ERROR_RESOURCE_TYPE_NOT_FOUND, "Unexpected last error %u.\n", error); + error == ERROR_RESOURCE_TYPE_NOT_FOUND, "Unexpected last error %lu.\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 3044, MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT), out, ARRAY_SIZE(out), NULL); error = GetLastError(); - ok(ret == 0, "FormatMessageA returned %u instead of 0\n", ret); + ok(ret == 0, "FormatMessageA returned %lu instead of 0\n", ret); ok(error == ERROR_MR_MID_NOT_FOUND || error == ERROR_MUI_FILE_NOT_LOADED || - error == ERROR_RESOURCE_TYPE_NOT_FOUND, "Unexpected last error %u.\n", error); + error == ERROR_RESOURCE_TYPE_NOT_FOUND, "Unexpected last error %lu.\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 3044, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), out, ARRAY_SIZE(out), NULL); error = GetLastError(); - ok(ret == 0, "FormatMessageA returned %u instead of 0\n", ret); + ok(ret == 0, "FormatMessageA returned %lu instead of 0\n", ret); ok(error == ERROR_RESOURCE_LANG_NOT_FOUND || error == ERROR_RESOURCE_TYPE_NOT_FOUND || error == ERROR_MR_MID_NOT_FOUND || error == ERROR_MUI_FILE_NOT_FOUND || error == ERROR_MUI_FILE_NOT_LOADED, - "last error %u\n", error); + "last error %lu\n", error);
SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 3044, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK), out, ARRAY_SIZE(out), NULL); error = GetLastError(); - ok(ret == 0, "FormatMessageA returned %u instead of 0\n", ret); + ok(ret == 0, "FormatMessageA returned %lu instead of 0\n", ret); ok(error == ERROR_RESOURCE_LANG_NOT_FOUND || error == ERROR_RESOURCE_TYPE_NOT_FOUND || error == ERROR_MR_MID_NOT_FOUND || error == ERROR_MUI_FILE_NOT_FOUND || error == ERROR_MUI_FILE_NOT_LOADED, - "last error %u\n", error); + "last error %lu\n", error); }
static void test_message_invalid_flags(void) @@ -1526,50 +1526,50 @@ static void test_message_invalid_flags(void) SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(0, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ptr = (char *)0xdeadbeef; ret = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&ptr, 0, NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(ptr == NULL, "Expected output pointer to be initialized to NULL, got %p\n", ptr); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_ARGUMENT_ARRAY, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_MAX_WIDTH_MASK, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageA to return 0, got %lu\n", ret); ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
/* Simultaneously setting FORMAT_MESSAGE_FROM_STRING with other source @@ -1579,21 +1579,21 @@ static void test_message_invalid_flags(void) memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_FROM_SYSTEM, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(!strcmp("test", out), "Expected the output buffer to be untouched\n");
memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_FROM_HMODULE, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(!strcmp("test", out), "Expected the output buffer to be untouched\n");
memcpy(out, init_buf, sizeof(init_buf)); ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM, "test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageA to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageA to return 4, got %lu\n", ret); ok(!strcmp("test", out), "Expected the output buffer to be untouched\n"); } @@ -1607,50 +1607,50 @@ static void test_message_invalid_flags_wide(void) SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(0, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ptr = (WCHAR *)0xdeadbeef; ret = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER, L"test", 0, 0, (WCHAR *)&ptr, 0, NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(ptr == NULL, "Expected output pointer to be initialized to NULL, got %p\n", ptr); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_IGNORE_INSERTS, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_ARGUMENT_ARRAY, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_MAX_WIDTH_MASK, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 0, "Expected FormatMessageW to return 0, got %u\n", ret); + ok(ret == 0, "Expected FormatMessageW to return 0, got %lu\n", ret); ok(!lstrcmpW( out, L"xxxxxx" ), "Expected the output buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
/* Simultaneously setting FORMAT_MESSAGE_FROM_STRING with other source @@ -1660,21 +1660,21 @@ static void test_message_invalid_flags_wide(void) lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_FROM_SYSTEM, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %lu\n", ret); ok(!lstrcmpW(L"test", out), "Expected the output buffer to be untouched\n");
lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_FROM_HMODULE, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %lu\n", ret); ok(!lstrcmpW(L"test", out), "Expected the output buffer to be untouched\n");
lstrcpyW( out, L"xxxxxx" ); ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM, L"test", 0, 0, out, ARRAY_SIZE(out), NULL); - ok(ret == 4, "Expected FormatMessageW to return 4, got %u\n", ret); + ok(ret == 4, "Expected FormatMessageW to return 4, got %lu\n", ret); ok(!lstrcmpW(L"test", out), "Expected the output buffer to be untouched\n"); } @@ -1719,12 +1719,12 @@ static void test_message_from_64bit_number(void) MultiByteToWideChar(CP_ACP, 0, unsigned_tests[i].expected, -1, expW, ARRAY_SIZE(expW)); ok(!lstrcmpW(outW, expW),"[%d] failed, expected %s, got %s\n", i, unsigned_tests[i].expected, wine_dbgstr_w(outW)); - ok(r == unsigned_tests[i].len,"[%d] failed: r=%d\n", i, r); + ok(r == unsigned_tests[i].len,"[%d] failed: r=%ld\n", i, r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!I64u!", 0, 0, outA, sizeof(outA), unsigned_tests[i].number); ok(!strcmp(outA, unsigned_tests[i].expected),"[%d] failed, expected %s, got %s\n", i, unsigned_tests[i].expected, outA); - ok(r == unsigned_tests[i].len,"[%d] failed: r=%d\n", i, r); + ok(r == unsigned_tests[i].len,"[%d] failed: r=%ld\n", i, r); }
for (i = 0; i < ARRAY_SIZE(signed_tests); i++) @@ -1734,12 +1734,12 @@ static void test_message_from_64bit_number(void) MultiByteToWideChar(CP_ACP, 0, signed_tests[i].expected, -1, expW, ARRAY_SIZE(expW)); ok(!lstrcmpW(outW, expW),"[%d] failed, expected %s, got %s\n", i, signed_tests[i].expected, wine_dbgstr_w(outW)); - ok(r == signed_tests[i].len,"[%d] failed: r=%d\n", i, r); + ok(r == signed_tests[i].len,"[%d] failed: r=%ld\n", i, r); r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!I64d!", 0, 0, outA, sizeof(outA), signed_tests[i].number); ok(!strcmp(outA, signed_tests[i].expected),"[%d] failed, expected %s, got %s\n", i, signed_tests[i].expected, outA); - ok(r == signed_tests[i].len,"[%d] failed: r=%d\n", i, r); + ok(r == signed_tests[i].len,"[%d] failed: r=%ld\n", i, r); } }
@@ -1766,7 +1766,7 @@ static void test_message_system_errors(void) { len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, tests[i].error_code, LANG_USER_DEFAULT, buffer, ARRAY_SIZE(buffer), NULL); - ok(len || broken(tests[i].broken), "Got zero len, code %#x.\n", tests[i].error_code); + ok(len || broken(tests[i].broken), "Got zero len, code %#lx.\n", tests[i].error_code); } }
diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index 8558bd7f1b3..bc573050d16 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -107,7 +107,7 @@ static void test_heap(void) mem = HeapAlloc(GetProcessHeap(), 0, size); heap_size = HeapSize(GetProcessHeap(), 0, mem); ok(heap_size == size || heap_size == resize_9x(size), - "HeapSize returned %lu instead of %lu or %lu\n", heap_size, size, resize_9x(size)); + "HeapSize returned %Iu instead of %Iu or %Iu\n", heap_size, size, resize_9x(size)); HeapFree(GetProcessHeap(), 0, mem); }
@@ -126,7 +126,7 @@ static void test_heap(void) ok(msecond != NULL, "HeapReAlloc(0) should have succeeded\n"); size = HeapSize(GetProcessHeap(), 0, msecond); ok(size == 0 || broken(size == 1) /* some vista and win7 */, - "HeapSize should have returned 0 instead of %lu\n", size); + "HeapSize should have returned 0 instead of %Iu\n", size); HeapFree(GetProcessHeap(), 0, msecond);
/* large blocks must be 16-byte aligned */ @@ -143,16 +143,16 @@ static void test_heap(void) gbl = GlobalReAlloc(gbl, 10, GMEM_MOVEABLE); ok(gbl != NULL, "Can't realloc global memory\n"); size = GlobalSize(gbl); - ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%ld\n", size); + ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%Id\n", size);
gbl = GlobalReAlloc(gbl, 0, GMEM_MOVEABLE); ok(gbl != NULL, "GlobalReAlloc should not fail on size 0\n");
size = GlobalSize(gbl); - ok(size == 0, "Memory not resized to size 0, instead size=%ld\n", size); + ok(size == 0, "Memory not resized to size 0, instead size=%Id\n", size); ok(GlobalFree(gbl) == NULL, "Memory not freed\n"); size = GlobalSize(gbl); - ok(size == 0, "Memory should have been freed, size=%ld\n", size); + ok(size == 0, "Memory should have been freed, size=%Id\n", size);
gbl = GlobalReAlloc(0, 10, GMEM_MOVEABLE); ok(gbl == NULL, "global realloc allocated memory\n"); @@ -162,39 +162,39 @@ static void test_heap(void)
SetLastError(MAGIC_DEAD); mem = GlobalLock(gbl); /* #1 */ - ok(mem != NULL, "returned %p with %d (expected '!= NULL')\n", mem, GetLastError()); + ok(mem != NULL, "returned %p with %ld (expected '!= NULL')\n", mem, GetLastError()); SetLastError(MAGIC_DEAD); flags = GlobalFlags(gbl); - ok( flags == 1, "returned 0x%04x with %d (expected '0x0001')\n", + ok( flags == 1, "returned 0x%04x with %ld (expected '0x0001')\n", flags, GetLastError());
SetLastError(MAGIC_DEAD); msecond = GlobalLock(gbl); /* #2 */ - ok( msecond == mem, "returned %p with %d (expected '%p')\n", + ok( msecond == mem, "returned %p with %ld (expected '%p')\n", msecond, GetLastError(), mem); SetLastError(MAGIC_DEAD); flags = GlobalFlags(gbl); - ok( flags == 2, "returned 0x%04x with %d (expected '0x0002')\n", + ok( flags == 2, "returned 0x%04x with %ld (expected '0x0002')\n", flags, GetLastError()); SetLastError(MAGIC_DEAD);
SetLastError(MAGIC_DEAD); res = GlobalUnlock(gbl); /* #1 */ - ok(res, "returned %d with %d (expected '!= 0')\n", res, GetLastError()); + ok(res, "returned %ld with %ld (expected '!= 0')\n", res, GetLastError()); SetLastError(MAGIC_DEAD); flags = GlobalFlags(gbl); - ok( flags , "returned 0x%04x with %d (expected '!= 0')\n", + ok( flags , "returned 0x%04x with %ld (expected '!= 0')\n", flags, GetLastError());
SetLastError(MAGIC_DEAD); res = GlobalUnlock(gbl); /* #0 */ /* NT: ERROR_SUCCESS (documented on MSDN), 9x: untouched */ ok(!res && ((GetLastError() == ERROR_SUCCESS) || (GetLastError() == MAGIC_DEAD)), - "returned %d with %d (expected '0' with: ERROR_SUCCESS or " + "returned %ld with %ld (expected '0' with: ERROR_SUCCESS or " "MAGIC_DEAD)\n", res, GetLastError()); SetLastError(MAGIC_DEAD); flags = GlobalFlags(gbl); - ok( !flags , "returned 0x%04x with %d (expected '0')\n", + ok( !flags , "returned 0x%04x with %ld (expected '0')\n", flags, GetLastError());
/* Unlock an already unlocked Handle */ @@ -203,7 +203,7 @@ static void test_heap(void) /* NT: ERROR_NOT_LOCKED, 9x: untouched */ ok( !res && ((GetLastError() == ERROR_NOT_LOCKED) || (GetLastError() == MAGIC_DEAD)), - "returned %d with %d (expected '0' with: ERROR_NOT_LOCKED or " + "returned %ld with %ld (expected '0' with: ERROR_NOT_LOCKED or " "MAGIC_DEAD)\n", res, GetLastError());
GlobalFree(gbl); @@ -211,35 +211,35 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); hsecond = GlobalFree(gbl); /* invalid handle: free memory twice */ ok( (hsecond == gbl) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %p with 0x%08x (expected %p with ERROR_INVALID_HANDLE)\n", + "returned %p with 0x%08lx (expected %p with ERROR_INVALID_HANDLE)\n", hsecond, GetLastError(), gbl); SetLastError(MAGIC_DEAD); hsecond = GlobalFree(LongToHandle(0xdeadbeef)); /* bogus handle */ ok( (hsecond == LongToHandle(0xdeadbeef)) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %p with 0x%08x (expected %p with ERROR_INVALID_HANDLE)\n", + "returned %p with 0x%08lx (expected %p with ERROR_INVALID_HANDLE)\n", hsecond, GetLastError(), LongToHandle(0xdeadbeef)); SetLastError(MAGIC_DEAD); hsecond = GlobalFree(LongToHandle(0xdeadbee0)); /* bogus pointer */ ok( (hsecond == LongToHandle(0xdeadbee0)) && ((GetLastError() == ERROR_INVALID_HANDLE) || broken(GetLastError() == ERROR_NOACCESS) /* wvista+ */), - "returned %p with 0x%08x (expected %p with ERROR_NOACCESS)\n", + "returned %p with 0x%08lx (expected %p with ERROR_NOACCESS)\n", hsecond, GetLastError(), LongToHandle(0xdeadbee0));
SetLastError(MAGIC_DEAD); flags = GlobalFlags(gbl); ok( (flags == GMEM_INVALID_HANDLE) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned 0x%04x with 0x%08x (expected GMEM_INVALID_HANDLE with " + "returned 0x%04x with 0x%08lx (expected GMEM_INVALID_HANDLE with " "ERROR_INVALID_HANDLE)\n", flags, GetLastError()); SetLastError(MAGIC_DEAD); size = GlobalSize(gbl); ok( (size == 0) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %ld with 0x%08x (expected '0' with ERROR_INVALID_HANDLE)\n", + "returned %Id with 0x%08lx (expected '0' with ERROR_INVALID_HANDLE)\n", size, GetLastError());
SetLastError(MAGIC_DEAD); mem = GlobalLock(gbl); ok( (mem == NULL) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %p with 0x%08x (expected NULL with ERROR_INVALID_HANDLE)\n", + "returned %p with 0x%08lx (expected NULL with ERROR_INVALID_HANDLE)\n", mem, GetLastError());
/* documented on MSDN: GlobalUnlock() return FALSE on failure. @@ -249,7 +249,7 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); res = GlobalUnlock(gbl); ok(GetLastError() == ERROR_INVALID_HANDLE, - "returned %d with %d (expected ERROR_INVALID_HANDLE)\n", + "returned %ld with %ld (expected ERROR_INVALID_HANDLE)\n", res, GetLastError());
gbl = GlobalAlloc(GMEM_DDESHARE, 100); @@ -267,7 +267,7 @@ static void test_heap(void) if (mem == gbl) ok(GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "Expected ERROR_INVALID_HANDLE or ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_HANDLE or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
/* GMEM_FIXED block expands in place only without flags */ @@ -276,7 +276,7 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); hsecond = GlobalReAlloc(gbl, size + init_size, 0); ok(hsecond == gbl || (hsecond == NULL && GetLastError() == ERROR_NOT_ENOUGH_MEMORY), - "got %p with %x (expected %p or NULL) @%ld\n", hsecond, GetLastError(), gbl, size); + "got %p with %lx (expected %p or NULL) @%Id\n", hsecond, GetLastError(), gbl, size); GlobalFree(gbl); }
@@ -286,9 +286,9 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); hsecond = GlobalReAlloc(gbl, size + init_size, GMEM_MOVEABLE); ok(hsecond != NULL, - "got %p with %x (expected non-NULL) @%ld\n", hsecond, GetLastError(), size); + "got %p with %lx (expected non-NULL) @%Id\n", hsecond, GetLastError(), size); mem = GlobalLock(hsecond); - ok(mem == hsecond, "got %p (expected %p) @%ld\n", mem, hsecond, size); + ok(mem == hsecond, "got %p (expected %p) @%Id\n", mem, hsecond, size); GlobalFree(hsecond); }
@@ -297,12 +297,12 @@ static void test_heap(void) res = GlobalUnlock(gbl); ok(res == 1 || broken(res == 0), /* win9x */ - "Expected 1 or 0, got %d\n", res); + "Expected 1 or 0, got %ld\n", res);
res = GlobalUnlock(gbl); ok(res == 1 || broken(res == 0), /* win9x */ - "Expected 1 or 0, got %d\n", res); + "Expected 1 or 0, got %ld\n", res);
GlobalFree(gbl);
@@ -312,8 +312,8 @@ static void test_heap(void) res = GlobalUnlock(gbl); ok(res == 1 || broken(res == 0), /* win9x */ - "Expected 1 or 0, got %d\n", res); - ok(GetLastError() == 0xdeadbeef, "got %d\n", GetLastError()); + "Expected 1 or 0, got %ld\n", res); + ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError());
GlobalFree(gbl);
@@ -322,16 +322,16 @@ static void test_heap(void) { SetLastError(MAGIC_DEAD); size = GlobalSize((HGLOBAL)0xc042); - ok(size == 0, "Expected 0, got %ld\n", size); + ok(size == 0, "Expected 0, got %Id\n", size); ok(GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */ - "Expected ERROR_INVALID_HANDLE or ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_HANDLE or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
gbl = GlobalAlloc( GMEM_FIXED, 0 ); SetLastError(0xdeadbeef); size = GlobalSize( gbl ); - ok( size == 1, "wrong size %lu\n", size ); + ok( size == 1, "wrong size %Iu\n", size ); GlobalFree( gbl );
/* ####################################### */ @@ -342,16 +342,16 @@ static void test_heap(void) gbl = LocalReAlloc(gbl, 10, LMEM_MOVEABLE); ok(gbl != NULL, "Can't realloc local memory\n"); size = LocalSize(gbl); - ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%ld\n", size); + ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%Id\n", size);
gbl = LocalReAlloc(gbl, 0, LMEM_MOVEABLE); ok(gbl != NULL, "LocalReAlloc should not fail on size 0\n");
size = LocalSize(gbl); - ok(size == 0, "Memory not resized to size 0, instead size=%ld\n", size); + ok(size == 0, "Memory not resized to size 0, instead size=%Id\n", size); ok(LocalFree(gbl) == NULL, "Memory not freed\n"); size = LocalSize(gbl); - ok(size == 0, "Memory should have been freed, size=%ld\n", size); + ok(size == 0, "Memory should have been freed, size=%Id\n", size);
gbl = LocalReAlloc(0, 10, LMEM_MOVEABLE); ok(gbl == NULL, "local realloc allocated memory\n"); @@ -360,39 +360,39 @@ static void test_heap(void) gbl = LocalAlloc(LMEM_MOVEABLE, 256); SetLastError(MAGIC_DEAD); mem = LocalLock(gbl); /* #1 */ - ok(mem != NULL, "returned %p with %d (expected '!= NULL')\n", mem, GetLastError()); + ok(mem != NULL, "returned %p with %ld (expected '!= NULL')\n", mem, GetLastError()); SetLastError(MAGIC_DEAD); flags = LocalFlags(gbl); - ok( flags == 1, "returned 0x%04x with %d (expected '0x0001')\n", + ok( flags == 1, "returned 0x%04x with %ld (expected '0x0001')\n", flags, GetLastError());
SetLastError(MAGIC_DEAD); msecond = LocalLock(gbl); /* #2 */ - ok( msecond == mem, "returned %p with %d (expected '%p')\n", + ok( msecond == mem, "returned %p with %ld (expected '%p')\n", msecond, GetLastError(), mem); SetLastError(MAGIC_DEAD); flags = LocalFlags(gbl); - ok( flags == 2, "returned 0x%04x with %d (expected '0x0002')\n", + ok( flags == 2, "returned 0x%04x with %ld (expected '0x0002')\n", flags, GetLastError()); SetLastError(MAGIC_DEAD);
SetLastError(MAGIC_DEAD); res = LocalUnlock(gbl); /* #1 */ - ok(res, "returned %d with %d (expected '!= 0')\n", res, GetLastError()); + ok(res, "returned %ld with %ld (expected '!= 0')\n", res, GetLastError()); SetLastError(MAGIC_DEAD); flags = LocalFlags(gbl); - ok( flags , "returned 0x%04x with %d (expected '!= 0')\n", + ok( flags , "returned 0x%04x with %ld (expected '!= 0')\n", flags, GetLastError());
SetLastError(MAGIC_DEAD); res = LocalUnlock(gbl); /* #0 */ /* NT: ERROR_SUCCESS (documented on MSDN), 9x: untouched */ ok(!res && ((GetLastError() == ERROR_SUCCESS) || (GetLastError() == MAGIC_DEAD)), - "returned %d with %d (expected '0' with: ERROR_SUCCESS or " + "returned %ld with %ld (expected '0' with: ERROR_SUCCESS or " "MAGIC_DEAD)\n", res, GetLastError()); SetLastError(MAGIC_DEAD); flags = LocalFlags(gbl); - ok( !flags , "returned 0x%04x with %d (expected '0')\n", + ok( !flags , "returned 0x%04x with %ld (expected '0')\n", flags, GetLastError());
/* Unlock an already unlocked Handle */ @@ -401,7 +401,7 @@ static void test_heap(void) /* NT: ERROR_NOT_LOCKED, 9x: untouched */ ok( !res && ((GetLastError() == ERROR_NOT_LOCKED) || (GetLastError() == MAGIC_DEAD)), - "returned %d with %d (expected '0' with: ERROR_NOT_LOCKED or " + "returned %ld with %ld (expected '0' with: ERROR_NOT_LOCKED or " "MAGIC_DEAD)\n", res, GetLastError());
LocalFree(gbl); @@ -409,30 +409,30 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); hsecond = LocalFree(gbl); /* invalid handle: free memory twice */ ok( (hsecond == gbl) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %p with 0x%08x (expected %p with ERROR_INVALID_HANDLE)\n", + "returned %p with 0x%08lx (expected %p with ERROR_INVALID_HANDLE)\n", hsecond, GetLastError(), gbl); SetLastError(MAGIC_DEAD); flags = LocalFlags(gbl); ok( (flags == LMEM_INVALID_HANDLE) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned 0x%04x with 0x%08x (expected LMEM_INVALID_HANDLE with " + "returned 0x%04x with 0x%08lx (expected LMEM_INVALID_HANDLE with " "ERROR_INVALID_HANDLE)\n", flags, GetLastError()); SetLastError(MAGIC_DEAD); size = LocalSize(gbl); ok( (size == 0) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %ld with 0x%08x (expected '0' with ERROR_INVALID_HANDLE)\n", + "returned %Id with 0x%08lx (expected '0' with ERROR_INVALID_HANDLE)\n", size, GetLastError());
SetLastError(MAGIC_DEAD); mem = LocalLock(gbl); ok( (mem == NULL) && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %p with 0x%08x (expected NULL with ERROR_INVALID_HANDLE)\n", + "returned %p with 0x%08lx (expected NULL with ERROR_INVALID_HANDLE)\n", mem, GetLastError());
/* This Test works the same on all Systems (GlobalUnlock() is different) */ SetLastError(MAGIC_DEAD); res = LocalUnlock(gbl); ok(!res && (GetLastError() == ERROR_INVALID_HANDLE), - "returned %d with %d (expected '0' with ERROR_INVALID_HANDLE)\n", + "returned %ld with %ld (expected '0' with ERROR_INVALID_HANDLE)\n", res, GetLastError());
/* LMEM_FIXED block expands in place only without flags */ @@ -441,7 +441,7 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); hsecond = LocalReAlloc(gbl, size + init_size, 0); ok(hsecond == gbl || (hsecond == NULL && GetLastError() == ERROR_NOT_ENOUGH_MEMORY), - "got %p with %x (expected %p or NULL) @%ld\n", hsecond, GetLastError(), gbl, size); + "got %p with %lx (expected %p or NULL) @%Id\n", hsecond, GetLastError(), gbl, size); LocalFree(gbl); }
@@ -451,9 +451,9 @@ static void test_heap(void) SetLastError(MAGIC_DEAD); hsecond = LocalReAlloc(gbl, size + init_size, LMEM_MOVEABLE); ok(hsecond != NULL, - "got %p with %x (expected non-NULL) @%ld\n", hsecond, GetLastError(), size); + "got %p with %lx (expected non-NULL) @%Id\n", hsecond, GetLastError(), size); mem = LocalLock(hsecond); - ok(mem == hsecond, "got %p (expected %p) @%ld\n", mem, hsecond, size); + ok(mem == hsecond, "got %p (expected %p) @%Id\n", mem, hsecond, size); LocalFree(hsecond); }
@@ -461,16 +461,16 @@ static void test_heap(void) gbl = LocalAlloc(LMEM_FIXED, 100); SetLastError(0xdeadbeef); res = LocalUnlock(gbl); - ok(res == 0, "Expected 0, got %d\n", res); + ok(res == 0, "Expected 0, got %ld\n", res); ok(GetLastError() == ERROR_NOT_LOCKED || - broken(GetLastError() == 0xdeadbeef) /* win9x */, "got %d\n", GetLastError()); + broken(GetLastError() == 0xdeadbeef) /* win9x */, "got %ld\n", GetLastError()); LocalFree(gbl);
gbl = LocalAlloc( LMEM_FIXED, 0 ); SetLastError(0xdeadbeef); size = LocalSize( gbl ); ok( !size || broken(size == 1), /* vistau64 */ - "wrong size %lu\n", size ); + "wrong size %Iu\n", size ); LocalFree( gbl );
/* trying to lock empty memory should give an error */ @@ -481,7 +481,7 @@ static void test_heap(void) /* NT: ERROR_DISCARDED, 9x: untouched */ ok( (mem == NULL) && ((GetLastError() == ERROR_DISCARDED) || (GetLastError() == MAGIC_DEAD)), - "returned %p with 0x%x/%d (expected 'NULL' with: ERROR_DISCARDED or " + "returned %p with 0x%lx/%ld (expected 'NULL' with: ERROR_DISCARDED or " "MAGIC_DEAD)\n", mem, GetLastError(), GetLastError());
GlobalFree(gbl); @@ -495,8 +495,8 @@ static void test_heap(void)
size = GlobalSize(gbl); size2 = GlobalSize(mem); - ok(size == 0x123, "got %lu\n", size); - ok(size2 == 0x123, "got %lu\n", size2); + ok(size == 0x123, "got %Iu\n", size); + ok(size2 == 0x123, "got %Iu\n", size2);
GlobalFree(gbl);
@@ -508,12 +508,12 @@ static void test_heap(void) ok(gbl == mem, "got %p, %p.\n", gbl, mem);
size = GlobalSize(gbl); - ok(size == 0x123, "got %lu\n", size); + ok(size == 0x123, "got %Iu\n", size);
GlobalFree(gbl);
size = GlobalSize((void *)0xdeadbee0); - ok(size == 0, "got %lu\n", size); + ok(size == 0, "got %Iu\n", size);
}
@@ -646,7 +646,7 @@ static void test_GlobalAlloc(void)
/* Check that a 'zeroing' alloc works */ mem2=GlobalAlloc(GMEM_ZEROINIT,memchunk); - ok(mem2!=NULL,"GlobalAlloc failed: error=%d\n",GetLastError()); + ok(mem2!=NULL,"GlobalAlloc failed: error=%ld\n",GetLastError()); if(mem2) { ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block\n"); mem2ptr=GlobalLock(mem2); @@ -720,18 +720,18 @@ static void test_LocalAlloc(void)
/* Check that a normal alloc works */ mem1=LocalAlloc(0,memchunk); - ok(mem1!=NULL,"LocalAlloc failed: error=%d\n",GetLastError()); + ok(mem1!=NULL,"LocalAlloc failed: error=%ld\n",GetLastError()); if(mem1) { ok(LocalSize(mem1)>=memchunk, "LocalAlloc should return a big enough memory block\n"); }
/* Check that a 'zeroing' and lock alloc works */ mem2=LocalAlloc(LMEM_ZEROINIT|LMEM_MOVEABLE,memchunk); - ok(mem2!=NULL,"LocalAlloc failed: error=%d\n",GetLastError()); + ok(mem2!=NULL,"LocalAlloc failed: error=%ld\n",GetLastError()); if(mem2) { ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block\n"); mem2ptr=LocalLock(mem2); - ok(mem2ptr!=NULL,"LocalLock: error=%d\n",GetLastError()); + ok(mem2ptr!=NULL,"LocalLock: error=%ld\n",GetLastError()); if(mem2ptr) { error=FALSE; for(i=0;i<memchunk;i++) { @@ -743,7 +743,7 @@ static void test_LocalAlloc(void) SetLastError(0); error=LocalUnlock(mem2); ok(!error && GetLastError()==NO_ERROR, - "LocalUnlock Failed: rc=%d err=%d\n",error,GetLastError()); + "LocalUnlock Failed: rc=%d err=%ld\n",error,GetLastError()); } } mem2a=LocalFree(mem2); @@ -751,11 +751,11 @@ static void test_LocalAlloc(void)
/* Reallocate mem2 as moveable memory */ mem2=LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT,memchunk); - ok(mem2!=NULL, "LocalAlloc failed to create moveable memory, error=%d\n",GetLastError()); + ok(mem2!=NULL, "LocalAlloc failed to create moveable memory, error=%ld\n",GetLastError());
/* Check that ReAllocing memory works as expected */ mem2a=LocalReAlloc(mem2,2*memchunk,LMEM_MOVEABLE | LMEM_ZEROINIT); - ok(mem2a!=NULL,"LocalReAlloc failed, error=%d\n",GetLastError()); + ok(mem2a!=NULL,"LocalReAlloc failed, error=%ld\n",GetLastError()); if(mem2a) { ok(LocalSize(mem2a)>=2*memchunk,"LocalReAlloc failed\n"); mem2ptr=LocalLock(mem2a); @@ -830,7 +830,7 @@ static void test_obsolete_flags(void)
ok( resultflags == test_global_flags[i].globalflags || broken(resultflags == (test_global_flags[i].globalflags & ~GMEM_DDESHARE)), /* win9x */ - "%u: expected 0x%08x, but returned 0x%08x with %d\n", + "%u: expected 0x%08x, but returned 0x%08x with %ld\n", i, test_global_flags[i].globalflags, resultflags, GetLastError() );
GlobalFree(gbl); @@ -869,8 +869,8 @@ static void test_HeapQueryInformation(void) NULL, 0, &size); ok(!ret, "HeapQueryInformation should fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError()); - ok(size == sizeof(ULONG), "expected 4, got %lu\n", size); + "expected ERROR_INSUFFICIENT_BUFFER got %lu\n", GetLastError()); + ok(size == sizeof(ULONG), "expected 4, got %Iu\n", size);
SetLastError(0xdeadbeef); ret = pHeapQueryInformation(GetProcessHeap(), @@ -878,15 +878,15 @@ static void test_HeapQueryInformation(void) NULL, 0, NULL); ok(!ret, "HeapQueryInformation should fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError()); + "expected ERROR_INSUFFICIENT_BUFFER got %lu\n", GetLastError());
info = 0xdeadbeaf; SetLastError(0xdeadbeef); ret = pHeapQueryInformation(GetProcessHeap(), HeapCompatibilityInformation, &info, sizeof(info) + 1, NULL); - ok(ret, "HeapQueryInformation error %u\n", GetLastError()); - ok(info == 0 || info == 1 || info == 2, "expected 0, 1 or 2, got %u\n", info); + ok(ret, "HeapQueryInformation error %lu\n", GetLastError()); + ok(info == 0 || info == 1 || info == 2, "expected 0, 1 or 2, got %lu\n", info); }
static void test_heap_checks( DWORD flags ) @@ -896,7 +896,7 @@ static void test_heap_checks( DWORD flags ) SIZE_T i, size, large_size = 3000 * 1024 + 37;
if (flags & HEAP_PAGE_ALLOCS) return; /* no tests for that case yet */ - trace( "testing heap flags %08x\n", flags ); + trace( "testing heap flags %08lx\n", flags );
p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 17 ); ok( p != NULL, "HeapAlloc failed\n" ); @@ -905,7 +905,7 @@ static void test_heap_checks( DWORD flags ) ok( ret, "HeapValidate failed\n" );
size = HeapSize( GetProcessHeap(), 0, p ); - ok( size == 17, "Wrong size %lu\n", size ); + ok( size == 17, "Wrong size %Iu\n", size );
ok( p[14] == 0, "wrong data %x\n", p[14] ); ok( p[15] == 0, "wrong data %x\n", p[15] ); @@ -952,7 +952,7 @@ static void test_heap_checks( DWORD flags ) if (flags & HEAP_VALIDATE) { size = HeapSize( GetProcessHeap(), 0, p ); - ok( size == ~(SIZE_T)0 || broken(size == ~0u), "Wrong size %lu\n", size ); + ok( size == ~(SIZE_T)0 || broken(size == ~0u), "Wrong size %Iu\n", size );
p2 = HeapReAlloc( GetProcessHeap(), 0, p, 14 ); ok( p2 == NULL, "HeapReAlloc succeeded\n" ); @@ -964,7 +964,7 @@ static void test_heap_checks( DWORD flags )
p[17] = old; size = HeapSize( GetProcessHeap(), 0, p ); - ok( size == 17, "Wrong size %lu\n", size ); + ok( size == 17, "Wrong size %Iu\n", size );
p2 = HeapReAlloc( GetProcessHeap(), 0, p, 14 ); ok( p2 != NULL, "HeapReAlloc failed\n" ); @@ -1010,7 +1010,7 @@ static void test_heap_checks( DWORD flags ) ok( ret, "HeapValidate failed\n" );
size = HeapSize( GetProcessHeap(), 0, p ); - ok( size == large_size, "Wrong size %lu\n", size ); + ok( size == large_size, "Wrong size %Iu\n", size );
ok( p[large_size - 2] == 0, "wrong data %x\n", p[large_size - 2] ); ok( p[large_size - 1] == 0, "wrong data %x\n", p[large_size - 1] ); @@ -1031,7 +1031,7 @@ static void test_heap_checks( DWORD flags ) if (flags & HEAP_VALIDATE) { size = HeapSize( GetProcessHeap(), 0, p ); - ok( size == ~(SIZE_T)0, "Wrong size %lu\n", size ); + ok( size == ~(SIZE_T)0, "Wrong size %Iu\n", size );
p2 = HeapReAlloc( GetProcessHeap(), 0, p, large_size - 3 ); ok( p2 == NULL, "HeapReAlloc succeeded\n" ); @@ -1053,7 +1053,7 @@ static void test_heap_checks( DWORD flags ) { p = HeapAlloc( GetProcessHeap(), 0, size ); for (i = 0; i < 32; i++) if (p[size + i] != 0xab) break; - ok( i >= 8, "only %lu tail bytes for size %lu\n", i, size ); + ok( i >= 8, "only %Iu tail bytes for size %Iu\n", i, size ); HeapFree( GetProcessHeap(), 0, p ); } } @@ -1083,7 +1083,7 @@ static void test_debug_heap( const char *argv0, DWORD flags ) skip("Not authorized to change the image file execution options\n"); return; } - ok( !err, "failed to create '%s' error %u\n", keyname, err ); + ok( !err, "failed to create '%s' error %lu\n", keyname, err ); if (err) return;
if (flags == 0xdeadbeef) /* magic value for unsetting it */ @@ -1094,9 +1094,9 @@ static void test_debug_heap( const char *argv0, DWORD flags ) memset( &startup, 0, sizeof(startup) ); startup.cb = sizeof(startup);
- sprintf( buffer, "%s heap.c 0x%x", argv0, flags ); + sprintf( buffer, "%s heap.c 0x%lx", argv0, flags ); ret = CreateProcessA( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ); - ok( ret, "failed to create child process error %u\n", GetLastError() ); + ok( ret, "failed to create child process error %lu\n", GetLastError() ); if (ret) { wait_child_process( info.hProcess ); @@ -1157,13 +1157,13 @@ static void test_child_heap( const char *arg ) }
ok( pRtlGetNtGlobalFlags() == expected, - "%s: got global flags %08x expected %08x\n", arg, pRtlGetNtGlobalFlags(), expected ); + "%s: got global flags %08lx expected %08lx\n", arg, pRtlGetNtGlobalFlags(), expected );
expect_heap = heap_flags_from_global_flag( expected );
if (!(heap->flags & HEAP_GROWABLE) || heap->pattern == 0xffeeffee) /* vista layout */ { - ok( (heap->flags & ~HEAP_GROWABLE) == 0, "%s: got heap flags %08x\n", arg, heap->flags ); + ok( (heap->flags & ~HEAP_GROWABLE) == 0, "%s: got heap flags %08lx\n", arg, heap->flags ); } else if (heap->pattern == 0xeeeeeeee && heap->flags == 0xeeeeeeee) { @@ -1172,9 +1172,9 @@ static void test_child_heap( const char *arg ) else { ok( heap->flags == (expect_heap | HEAP_GROWABLE), - "%s: got heap flags %08x expected %08x\n", arg, heap->flags, expect_heap ); + "%s: got heap flags %08lx expected %08lx\n", arg, heap->flags, expect_heap ); ok( heap->force_flags == (expect_heap & ~0x18000080), - "%s: got heap force flags %08x expected %08x\n", arg, heap->force_flags, expect_heap ); + "%s: got heap force flags %08lx expected %08lx\n", arg, heap->force_flags, expect_heap ); expect_heap = heap->flags; }
@@ -1199,11 +1199,11 @@ static void test_GetPhysicallyInstalledSystemMemory(void) ret = pGetPhysicallyInstalledSystemMemory(NULL); ok(!ret, "GetPhysicallyInstalledSystemMemory should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
total_memory = 0; ret = pGetPhysicallyInstalledSystemMemory(&total_memory); - ok(ret, "GetPhysicallyInstalledSystemMemory unexpectedly failed (%u)\n", GetLastError()); + ok(ret, "GetPhysicallyInstalledSystemMemory unexpectedly failed (%lu)\n", GetLastError()); ok(total_memory != 0, "expected total_memory != 0\n");
memstatus.dwLength = sizeof(memstatus); diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 6b5099ea612..365f4465fc7 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -211,16 +211,16 @@ static DWORD create_test_dll( const IMAGE_DOS_HEADER *dos_header, UINT dos_size, GetTempFileNameA(temp_path, "ldr", 0, dll_name);
hfile = CreateFileA(dll_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, 0); - ok( hfile != INVALID_HANDLE_VALUE, "failed to create %s err %u\n", dll_name, GetLastError() ); + ok( hfile != INVALID_HANDLE_VALUE, "failed to create %s err %lu\n", dll_name, GetLastError() ); if (hfile == INVALID_HANDLE_VALUE) return 0;
SetLastError(0xdeadbeef); ret = WriteFile(hfile, dos_header, dos_size, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
if (nt_header->FileHeader.SizeOfOptionalHeader) { @@ -228,14 +228,14 @@ static DWORD create_test_dll( const IMAGE_DOS_HEADER *dos_header, UINT dos_size, ret = WriteFile(hfile, &nt_header->OptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); if (nt_header->FileHeader.SizeOfOptionalHeader > sizeof(IMAGE_OPTIONAL_HEADER)) { file_align = nt_header->FileHeader.SizeOfOptionalHeader - sizeof(IMAGE_OPTIONAL_HEADER); assert(file_align < sizeof(filler)); SetLastError(0xdeadbeef); ret = WriteFile(hfile, filler, file_align, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); } }
@@ -261,12 +261,12 @@ static DWORD create_test_dll( const IMAGE_DOS_HEADER *dos_header, UINT dos_size,
SetLastError(0xdeadbeef); ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
/* section data */ SetLastError(0xdeadbeef); ret = WriteFile(hfile, section_data, sizeof(section_data), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); }
/* Minimal PE image that Windows7+ is able to load: 268 bytes */ @@ -276,7 +276,7 @@ static DWORD create_test_dll( const IMAGE_DOS_HEADER *dos_header, UINT dos_size, file_align = 268 - size; SetLastError(0xdeadbeef); ret = WriteFile(hfile, filler, file_align, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); }
size = GetFileSize(hfile, NULL); @@ -297,28 +297,28 @@ static DWORD create_test_dll_sections( const IMAGE_DOS_HEADER *dos_header, const GetTempFileNameA(temp_path, "ldr", 0, dll_name);
hfile = CreateFileA(dll_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, 0); - ok( hfile != INVALID_HANDLE_VALUE, "failed to create %s err %u\n", dll_name, GetLastError() ); + ok( hfile != INVALID_HANDLE_VALUE, "failed to create %s err %lu\n", dll_name, GetLastError() ); if (hfile == INVALID_HANDLE_VALUE) return 0;
SetLastError(0xdeadbeef); ret = WriteFile(hfile, dos_header, sizeof(*dos_header), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, nt_header, offsetof(IMAGE_NT_HEADERS, OptionalHeader) + nt_header->FileHeader.SizeOfOptionalHeader, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, sections, sizeof(*sections) * nt_header->FileHeader.NumberOfSections, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) { SetFilePointer(hfile, sections[i].PointerToRawData, NULL, FILE_BEGIN); SetLastError(0xdeadbeef); ret = WriteFile(hfile, section_data, sections[i].SizeOfRawData, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); } size = GetFileSize(hfile, NULL); CloseHandle(hfile); @@ -345,20 +345,20 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
file = CreateFileA( dll_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "%u: CreateFile error %d\n", id, GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "%u: CreateFile error %ld\n", id, GetLastError() ); file_size = GetFileSize( file, NULL );
status = pNtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ | SECTION_QUERY, NULL, NULL, PAGE_READONLY, SEC_IMAGE, file ); - ok( !status, "%u: NtCreateSection failed err %x\n", id, status ); + ok( !status, "%u: NtCreateSection failed err %lx\n", id, status ); if (status) { CloseHandle( file ); return FALSE; } status = pNtQuerySection( mapping, SectionImageInformation, &image, sizeof(image), &info_size ); - ok( !status, "%u: NtQuerySection failed err %x\n", id, status ); - ok( info_size == sizeof(image), "%u: NtQuerySection wrong size %lu\n", id, info_size ); + ok( !status, "%u: NtQuerySection failed err %lx\n", id, status ); + ok( info_size == sizeof(image), "%u: NtQuerySection wrong size %Iu\n", id, info_size ); if (nt_header->OptionalHeader.Magic == (is_win64 ? IMAGE_NT_OPTIONAL_HDR64_MAGIC : IMAGE_NT_OPTIONAL_HDR32_MAGIC)) { @@ -397,19 +397,19 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE } ok( (char *)image.TransferAddress == (char *)entry_point || (S(U(image)).ImageDynamicallyRelocated && LOWORD(image.TransferAddress) == LOWORD(entry_point)), - "%u: TransferAddress wrong %p / %p (%08x)\n", id, + "%u: TransferAddress wrong %p / %p (%08lx)\n", id, image.TransferAddress, entry_point, nt_header->OptionalHeader.AddressOfEntryPoint ); - ok( image.ZeroBits == 0, "%u: ZeroBits wrong %08x\n", id, image.ZeroBits ); + ok( image.ZeroBits == 0, "%u: ZeroBits wrong %08lx\n", id, image.ZeroBits ); ok( image.MaximumStackSize == max_stack || broken(truncated), - "%u: MaximumStackSize wrong %lx / %lx\n", id, image.MaximumStackSize, max_stack ); + "%u: MaximumStackSize wrong %Ix / %Ix\n", id, image.MaximumStackSize, max_stack ); ok( image.CommittedStackSize == commit_stack || broken(truncated), - "%u: CommittedStackSize wrong %lx / %lx\n", id, image.CommittedStackSize, commit_stack ); + "%u: CommittedStackSize wrong %Ix / %Ix\n", id, image.CommittedStackSize, commit_stack ); if (truncated) ok( !image.SubSystemType || broken(truncated), - "%u: SubSystemType wrong %08x / 00000000\n", id, image.SubSystemType ); + "%u: SubSystemType wrong %08lx / 00000000\n", id, image.SubSystemType ); else ok( image.SubSystemType == nt_header->OptionalHeader.Subsystem, - "%u: SubSystemType wrong %08x / %08x\n", id, + "%u: SubSystemType wrong %08lx / %08x\n", id, image.SubSystemType, nt_header->OptionalHeader.Subsystem ); ok( image.MinorSubsystemVersion == nt_header->OptionalHeader.MinorSubsystemVersion, "%u: MinorSubsystemVersion wrong %04x / %04x\n", id, @@ -432,11 +432,11 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE image.DllCharacteristics, nt_header->OptionalHeader.DllCharacteristics ); ok( image.Machine == nt_header->FileHeader.Machine, "%u: Machine wrong %04x / %04x\n", id, image.Machine, nt_header->FileHeader.Machine ); - ok( image.LoaderFlags == (cor_header != NULL), "%u: LoaderFlags wrong %08x\n", id, image.LoaderFlags ); + ok( image.LoaderFlags == (cor_header != NULL), "%u: LoaderFlags wrong %08lx\n", id, image.LoaderFlags ); ok( image.ImageFileSize == file_size || broken(!image.ImageFileSize), /* winxpsp1 */ - "%u: ImageFileSize wrong %08x / %08x\n", id, image.ImageFileSize, file_size ); + "%u: ImageFileSize wrong %08lx / %08lx\n", id, image.ImageFileSize, file_size ); ok( image.CheckSum == nt_header->OptionalHeader.CheckSum || broken(truncated), - "%u: CheckSum wrong %08x / %08x\n", id, + "%u: CheckSum wrong %08lx / %08lx\n", id, image.CheckSum, nt_header->OptionalHeader.CheckSum );
if (nt_header->OptionalHeader.SizeOfCode || nt_header->OptionalHeader.AddressOfEntryPoint) @@ -500,39 +500,39 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
map_size.QuadPart = (nt_header->OptionalHeader.SizeOfImage + page_size - 1) & ~(page_size - 1); status = pNtQuerySection( mapping, SectionBasicInformation, &info, sizeof(info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info.Size.QuadPart == map_size.QuadPart, "NtQuerySection wrong size %x%08x / %x%08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info.Size.QuadPart == map_size.QuadPart, "NtQuerySection wrong size %lx%08lx / %lx%08lx\n", info.Size.u.HighPart, info.Size.u.LowPart, map_size.u.HighPart, map_size.u.LowPart ); CloseHandle( mapping );
map_size.QuadPart = (nt_header->OptionalHeader.SizeOfImage + page_size - 1) & ~(page_size - 1); status = pNtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ | SECTION_QUERY, NULL, &map_size, PAGE_READONLY, SEC_IMAGE, file ); - ok( !status, "%u: NtCreateSection failed err %x\n", id, status ); + ok( !status, "%u: NtCreateSection failed err %lx\n", id, status ); status = pNtQuerySection( mapping, SectionBasicInformation, &info, sizeof(info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info.Size.QuadPart == map_size.QuadPart, "NtQuerySection wrong size %x%08x / %x%08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info.Size.QuadPart == map_size.QuadPart, "NtQuerySection wrong size %lx%08lx / %lx%08lx\n", info.Size.u.HighPart, info.Size.u.LowPart, map_size.u.HighPart, map_size.u.LowPart ); CloseHandle( mapping );
map_size.QuadPart++; status = pNtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ | SECTION_QUERY, NULL, &map_size, PAGE_READONLY, SEC_IMAGE, file ); - ok( status == STATUS_SECTION_TOO_BIG, "%u: NtCreateSection failed err %x\n", id, status ); + ok( status == STATUS_SECTION_TOO_BIG, "%u: NtCreateSection failed err %lx\n", id, status );
SetFilePointerEx( file, map_size, NULL, FILE_BEGIN ); SetEndOfFile( file ); status = pNtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ | SECTION_QUERY, NULL, &map_size, PAGE_READONLY, SEC_IMAGE, file ); - ok( status == STATUS_SECTION_TOO_BIG, "%u: NtCreateSection failed err %x\n", id, status ); + ok( status == STATUS_SECTION_TOO_BIG, "%u: NtCreateSection failed err %lx\n", id, status );
map_size.QuadPart = 1; status = pNtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ | SECTION_QUERY, NULL, &map_size, PAGE_READONLY, SEC_IMAGE, file ); - ok( !status, "%u: NtCreateSection failed err %x\n", id, status ); + ok( !status, "%u: NtCreateSection failed err %lx\n", id, status ); status = pNtQuerySection( mapping, SectionBasicInformation, &info, sizeof(info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info.Size.QuadPart == map_size.QuadPart, "NtQuerySection wrong size %x%08x / %x%08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info.Size.QuadPart == map_size.QuadPart, "NtQuerySection wrong size %lx%08lx / %lx%08lx\n", info.Size.u.HighPart, info.Size.u.LowPart, map_size.u.HighPart, map_size.u.LowPart ); CloseHandle( mapping );
@@ -612,7 +612,7 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG file_size = create_test_dll_sections( &dos_header, nt_header, sections, section_data, dll_name );
file = CreateFileA(dll_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %ld\n", GetLastError());
size.QuadPart = file_size; status = pNtCreateSection(&map, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ | SECTION_QUERY, @@ -631,11 +631,11 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG SECTION_BASIC_INFORMATION info; SIZE_T info_size = 0xdeadbeef; NTSTATUS ret = pNtQuerySection( map, SectionBasicInformation, &info, sizeof(info), &info_size ); - ok( !ret, "NtQuerySection failed err %x\n", ret ); - ok( info_size == sizeof(info), "NtQuerySection wrong size %lu\n", info_size ); - ok( info.Attributes == (SEC_IMAGE | SEC_FILE), "NtQuerySection wrong attr %x\n", info.Attributes ); + ok( !ret, "NtQuerySection failed err %lx\n", ret ); + ok( info_size == sizeof(info), "NtQuerySection wrong size %Iu\n", info_size ); + ok( info.Attributes == (SEC_IMAGE | SEC_FILE), "NtQuerySection wrong attr %lx\n", info.Attributes ); ok( info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", info.BaseAddress ); - ok( info.Size.QuadPart == file_size, "NtQuerySection wrong size %x%08x / %08x\n", + ok( info.Size.QuadPart == file_size, "NtQuerySection wrong size %lx%08lx / %08lx\n", info.Size.u.HighPart, info.Size.u.LowPart, file_size ); has_code = query_image_section( line, dll_name, nt_header, section_data );
@@ -655,12 +655,12 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG if (!has_code && is_win64) { ok_(__FILE__,line)( mod != NULL || want_32bit || broken(il_only), /* <= win7 */ - "loading failed err %u\n", GetLastError() ); + "loading failed err %lu\n", GetLastError() ); } else { ok_(__FILE__, line)( !mod, "loading succeeded\n" ); - ok_(__FILE__, line)( GetLastError() == ERROR_BAD_EXE_FORMAT, "wrong error %u\n", GetLastError() ); + ok_(__FILE__, line)( GetLastError() == ERROR_BAD_EXE_FORMAT, "wrong error %lu\n", GetLastError() ); } } else @@ -669,7 +669,7 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG
ok( mod != NULL || broken(il_only) || /* <= win7 */ broken( wrong_machine ), /* win8 */ - "%u: loading failed err %u\n", line, GetLastError() ); + "%u: loading failed err %lu\n", line, GetLastError() ); if (!mod && wrong_machine) expect_status = STATUS_INVALID_IMAGE_FORMAT; } if (mod) FreeLibrary( mod ); @@ -690,7 +690,7 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG if (!expect_status) ok( !expect_fallback, "%u: got test dll but expected fallback\n", line ); else - ok( !expect_fallback, "%u: got test dll but expected failure %x\n", line, expect_status ); + ok( !expect_fallback, "%u: got test dll but expected failure %lx\n", line, expect_status ); } else if (!lstrcmpiW( path, load_fallback_name )) { @@ -703,7 +703,7 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG "%u: got fallback but expected test dll\n", line ); else ok( broken(expect_status == STATUS_INVALID_IMAGE_FORMAT), /* <= vista */ - "%u: got fallback but expected failure %x\n", line, expect_status ); + "%u: got fallback but expected failure %lx\n", line, expect_status ); } else ok( 0, "%u: got unexpected path %s instead of %s\n", line, wine_dbgstr_w(path), wine_dbgstr_w(load_test_name)); pLdrUnloadDll( ldr_mod ); @@ -720,9 +720,9 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, const IMAG ok( ldr_status == expect_status || broken(il_only && !expect_status && ldr_status == STATUS_INVALID_IMAGE_FORMAT) || broken(nt_header->Signature == IMAGE_OS2_SIGNATURE && ldr_status == STATUS_INVALID_IMAGE_NE_FORMAT), - "%u: wrong status %x/%x\n", line, ldr_status, expect_status ); + "%u: wrong status %lx/%lx\n", line, ldr_status, expect_status ); ok( !expect_fallback || broken(il_only) || broken(wrong_machine), - "%u: failed with %x expected fallback\n", line, ldr_status ); + "%u: failed with %lx expected fallback\n", line, ldr_status ); }
done: @@ -925,50 +925,50 @@ static void test_Loader(void) SetLastError(0xdeadbeef); size = VirtualQuery(hlib, &info, sizeof(info)); ok(size == sizeof(info), - "%d: VirtualQuery error %d\n", i, GetLastError()); + "%d: VirtualQuery error %ld\n", i, GetLastError()); ok(info.BaseAddress == hlib, "%p != %p\n", info.BaseAddress, hlib); ok(info.AllocationBase == hlib, "%p != %p\n", info.AllocationBase, hlib); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); - ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "got %lx != expected %x\n", + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%lx != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); + ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "got %Ix != expected %lx\n", info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size)); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); if (nt_header.OptionalHeader.SectionAlignment < page_size) - ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%x != PAGE_EXECUTE_WRITECOPY\n", info.Protect); + ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%lx != PAGE_EXECUTE_WRITECOPY\n", info.Protect); else - ok(info.Protect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.Protect); - ok(info.Type == SEC_IMAGE, "%x != SEC_IMAGE\n", info.Type); + ok(info.Protect == PAGE_READONLY, "%lx != PAGE_READONLY\n", info.Protect); + ok(info.Type == SEC_IMAGE, "%lx != SEC_IMAGE\n", info.Type);
SetLastError(0xdeadbeef); ptr = VirtualAlloc(hlib, page_size, MEM_COMMIT, info.Protect); ok(!ptr, "VirtualAlloc should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); size = VirtualQuery((char *)hlib + info.RegionSize, &info, sizeof(info)); - ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); + ok(size == sizeof(info), "VirtualQuery error %ld\n", GetLastError()); if (nt_header.OptionalHeader.SectionAlignment == page_size || nt_header.OptionalHeader.SectionAlignment == nt_header.OptionalHeader.FileAlignment) { ok(info.BaseAddress == (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "got %p != expected %p\n", info.BaseAddress, (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size)); ok(info.AllocationBase == 0, "%p != 0\n", info.AllocationBase); - ok(info.AllocationProtect == 0, "%x != 0\n", info.AllocationProtect); + ok(info.AllocationProtect == 0, "%lx != 0\n", info.AllocationProtect); /*ok(info.RegionSize == not_practical_value, "%d: %lx != not_practical_value\n", i, info.RegionSize);*/ - ok(info.State == MEM_FREE, "%x != MEM_FREE\n", info.State); - ok(info.Type == 0, "%x != 0\n", info.Type); - ok(info.Protect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.Protect); + ok(info.State == MEM_FREE, "%lx != MEM_FREE\n", info.State); + ok(info.Type == 0, "%lx != 0\n", info.Type); + ok(info.Protect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.Protect); } else { - ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%x != PAGE_EXECUTE_WRITECOPY\n", info.Protect); + ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%lx != PAGE_EXECUTE_WRITECOPY\n", info.Protect); ok(info.BaseAddress == hlib, "got %p != expected %p\n", info.BaseAddress, hlib); ok(info.AllocationBase == hlib, "%p != %p\n", info.AllocationBase, hlib); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); - ok(info.RegionSize == ALIGN_SIZE(file_size, page_size), "got %lx != expected %x\n", + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%lx != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); + ok(info.RegionSize == ALIGN_SIZE(file_size, page_size), "got %Ix != expected %lx\n", info.RegionSize, ALIGN_SIZE(file_size, page_size)); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Protect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.Protect); - ok(info.Type == SEC_IMAGE, "%x != SEC_IMAGE\n", info.Type); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READONLY, "%lx != PAGE_READONLY\n", info.Protect); + ok(info.Type == SEC_IMAGE, "%lx != SEC_IMAGE\n", info.Type); }
/* header: check the zeroing of alignment */ @@ -986,25 +986,25 @@ static void test_Loader(void) SetLastError(0xdeadbeef); size = VirtualQuery((char *)hlib + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), - "VirtualQuery error %d\n", GetLastError()); + "VirtualQuery error %ld\n", GetLastError()); if (nt_header.OptionalHeader.SectionAlignment < page_size) { ok(info.BaseAddress == hlib, "got %p != expected %p\n", info.BaseAddress, hlib); - ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "got %lx != expected %x\n", + ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "got %Ix != expected %lx\n", info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size)); - ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%x != PAGE_EXECUTE_WRITECOPY\n", info.Protect); + ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%lx != PAGE_EXECUTE_WRITECOPY\n", info.Protect); } else { ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)hlib + section.VirtualAddress); - ok(info.RegionSize == ALIGN_SIZE(section.Misc.VirtualSize, page_size), "got %lx != expected %x\n", + ok(info.RegionSize == ALIGN_SIZE(section.Misc.VirtualSize, page_size), "got %Ix != expected %lx\n", info.RegionSize, ALIGN_SIZE(section.Misc.VirtualSize, page_size)); - ok(info.Protect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.Protect); + ok(info.Protect == PAGE_READONLY, "%lx != PAGE_READONLY\n", info.Protect); } ok(info.AllocationBase == hlib, "%p != %p\n", info.AllocationBase, hlib); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Type == SEC_IMAGE, "%x != SEC_IMAGE\n", info.Type); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%lx != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Type == SEC_IMAGE, "%lx != SEC_IMAGE\n", info.Type);
if (nt_header.OptionalHeader.SectionAlignment >= page_size) ok(!memcmp((const char *)hlib + section.VirtualAddress + section.PointerToRawData, &nt_header, section.SizeOfRawData), "wrong section data\n"); @@ -1025,32 +1025,32 @@ static void test_Loader(void) ptr = VirtualAlloc((char *)hlib + section.VirtualAddress, page_size, MEM_COMMIT, info.Protect); ok(!ptr, "VirtualAlloc should fail\n"); ok(GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_INVALID_ADDRESS, - "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); }
SetLastError(0xdeadbeef); hlib_as_data_file = LoadLibraryExA(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); - ok(hlib_as_data_file != 0, "LoadLibraryEx error %u\n", GetLastError()); + ok(hlib_as_data_file != 0, "LoadLibraryEx error %lu\n", GetLastError()); ok(hlib_as_data_file == hlib, "hlib_as_file and hlib are different\n");
SetLastError(0xdeadbeef); ret = FreeLibrary(hlib); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hlib = GetModuleHandleA(dll_name); - ok(hlib != 0, "GetModuleHandle error %u\n", GetLastError()); + ok(hlib != 0, "GetModuleHandle error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = FreeLibrary(hlib_as_data_file); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError());
hlib = GetModuleHandleA(dll_name); ok(!hlib, "GetModuleHandle should fail\n");
SetLastError(0xdeadbeef); hlib_as_data_file = LoadLibraryExA(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); - ok(hlib_as_data_file != 0, "LoadLibraryEx error %u\n", GetLastError()); + ok(hlib_as_data_file != 0, "LoadLibraryEx error %lu\n", GetLastError()); ok(((ULONG_PTR)hlib_as_data_file & 3) == 1, "hlib_as_data_file got %p\n", hlib_as_data_file);
hlib = GetModuleHandleA(dll_name); @@ -1058,12 +1058,12 @@ static void test_Loader(void)
SetLastError(0xdeadbeef); h = CreateFileA( dll_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - ok( h != INVALID_HANDLE_VALUE, "open failed err %u\n", GetLastError() ); + ok( h != INVALID_HANDLE_VALUE, "open failed err %lu\n", GetLastError() ); CloseHandle( h );
SetLastError(0xdeadbeef); ret = FreeLibrary(hlib_as_data_file); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hlib_as_data_file = LoadLibraryExA(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE); @@ -1075,22 +1075,22 @@ static void test_Loader(void) } else { - ok(hlib_as_data_file != 0, "LoadLibraryEx error %u\n", GetLastError()); + ok(hlib_as_data_file != 0, "LoadLibraryEx error %lu\n", GetLastError());
SetLastError(0xdeadbeef); h = CreateFileA( dll_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); ok( h == INVALID_HANDLE_VALUE, "open succeeded\n" ); - ok( GetLastError() == ERROR_SHARING_VIOLATION, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SHARING_VIOLATION, "wrong error %lu\n", GetLastError() ); CloseHandle( h );
SetLastError(0xdeadbeef); h = CreateFileA( dll_name, GENERIC_READ | DELETE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - ok( h != INVALID_HANDLE_VALUE, "open failed err %u\n", GetLastError() ); + ok( h != INVALID_HANDLE_VALUE, "open failed err %lu\n", GetLastError() ); CloseHandle( h );
SetLastError(0xdeadbeef); ret = FreeLibrary(hlib_as_data_file); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError()); }
SetLastError(0xdeadbeef); @@ -1103,7 +1103,7 @@ static void test_Loader(void) } else { - ok(hlib_as_data_file != 0, "LoadLibraryEx error %u\n", GetLastError()); + ok(hlib_as_data_file != 0, "LoadLibraryEx error %lu\n", GetLastError()); ok(((ULONG_PTR)hlib_as_data_file & 3) == 2, "hlib_as_data_file got %p\n", hlib_as_data_file);
@@ -1112,12 +1112,12 @@ static void test_Loader(void)
SetLastError(0xdeadbeef); ret = FreeLibrary(hlib_as_data_file); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError()); }
SetLastError(0xdeadbeef); ret = DeleteFileA(dll_name); - ok(ret, "DeleteFile error %d\n", GetLastError()); + ok(ret, "DeleteFile error %ld\n", GetLastError());
nt_header.OptionalHeader.AddressOfEntryPoint = 0x12345678; file_size = create_test_dll( &dos_header, td[i].size_of_dos_header, &nt_header, dll_name ); @@ -1142,12 +1142,12 @@ static void test_Loader(void) { error_match = td[i].errors[error_index] == GetLastError(); } - ok(error_match, "unexpected error %d\n", GetLastError()); + ok(error_match, "unexpected error %ld\n", GetLastError()); }
SetLastError(0xdeadbeef); ret = DeleteFileA(dll_name); - ok(ret, "DeleteFile error %d\n", GetLastError()); + ok(ret, "DeleteFile error %ld\n", GetLastError()); winetest_pop_context(); }
@@ -1171,26 +1171,26 @@ static void test_Loader(void)
nt_header.OptionalHeader.AddressOfEntryPoint = 0x1234; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt_header.OptionalHeader.DllCharacteristics = IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt_header.OptionalHeader.SizeOfCode = 0x1000; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status ); nt_header.OptionalHeader.SizeOfCode = 0; nt_header.OptionalHeader.DllCharacteristics = IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
dos_header.e_magic = 0; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_INVALID_IMAGE_NOT_MZ, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_INVALID_IMAGE_NOT_MZ, "NtCreateSection error %08lx\n", status );
dos_header.e_magic = IMAGE_DOS_SIGNATURE; nt_header.Signature = IMAGE_OS2_SIGNATURE; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_INVALID_IMAGE_NE_FORMAT, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_INVALID_IMAGE_NE_FORMAT, "NtCreateSection error %08lx\n", status ); for (i = 0; i < 16; i++) { ((IMAGE_OS2_HEADER *)&nt_header)->ne_exetyp = i; @@ -1198,13 +1198,13 @@ static void test_Loader(void) switch (i) { case 2: - ok( status == STATUS_INVALID_IMAGE_WIN_16, "NtCreateSection %u error %08x\n", i, status ); + ok( status == STATUS_INVALID_IMAGE_WIN_16, "NtCreateSection %u error %08lx\n", i, status ); break; case 5: - ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection %u error %08x\n", i, status ); + ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection %u error %08lx\n", i, status ); break; default: - ok( status == STATUS_INVALID_IMAGE_NE_FORMAT, "NtCreateSection %u error %08x\n", i, status ); + ok( status == STATUS_INVALID_IMAGE_NE_FORMAT, "NtCreateSection %u error %08lx\n", i, status ); break; } } @@ -1212,38 +1212,38 @@ static void test_Loader(void)
dos_header.e_lfanew = 0x98760000; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection error %08lx\n", status );
dos_header.e_lfanew = sizeof(dos_header); nt_header.Signature = 0xdeadbeef; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection error %08lx\n", status );
nt_header.Signature = IMAGE_NT_SIGNATURE; nt_header.OptionalHeader.Magic = 0xdead; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); - ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08lx\n", status );
nt_header.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR_MAGIC; nt_header.FileHeader.Machine = 0xdead; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt_header.FileHeader.Machine = IMAGE_FILE_MACHINE_UNKNOWN; status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt_header.FileHeader.Machine = get_alt_machine( orig_machine ); status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt_header.FileHeader.Machine = get_alt_bitness_machine( orig_machine ); status = map_image_section( &nt_header, §ion, section_data, __LINE__ ); ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt_header.FileHeader.Machine = orig_machine; nt_header.OptionalHeader.NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; @@ -1258,33 +1258,33 @@ static void test_Loader(void) cor_header.Flags = COMIMAGE_FLAGS_ILONLY; U(cor_header).EntryPointToken = 0xbeef; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.MinorRuntimeVersion = 5; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.MajorRuntimeVersion = 3; cor_header.MinorRuntimeVersion = 0; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITREQUIRED; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITPREFERRED; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.Flags = 0; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = 1; nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size = 1; status = map_image_section( &nt_header, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
if (nt_header.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) { @@ -1315,7 +1315,7 @@ static void test_Loader(void)
status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_INVALID_IMAGE_FORMAT : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
switch (orig_machine) { @@ -1324,26 +1324,26 @@ static void test_Loader(void) } status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_INVALID_IMAGE_FORMAT : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.FileHeader.Machine = get_alt_bitness_machine( orig_machine ); status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.OptionalHeader.SizeOfCode = 0; nt64.OptionalHeader.AddressOfEntryPoint = 0x1000; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.OptionalHeader.SizeOfCode = 0; nt64.OptionalHeader.AddressOfEntryPoint = 0; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.OptionalHeader.SizeOfCode = 0x1000; nt64.OptionalHeader.AddressOfEntryPoint = 0; @@ -1351,14 +1351,14 @@ static void test_Loader(void) section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.OptionalHeader.SizeOfCode = 0; nt64.OptionalHeader.AddressOfEntryPoint = 0; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, section_data, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.OptionalHeader.NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; nt64.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = page_size; @@ -1368,38 +1368,38 @@ static void test_Loader(void) cor_header.Flags = COMIMAGE_FLAGS_ILONLY; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt64.OptionalHeader.SizeOfCode = 0x1000; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
cor_header.MinorRuntimeVersion = 5; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITREQUIRED; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITPREFERRED; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
cor_header.Flags = 0; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = 1; nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size = 1; status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, §ion, &cor_header, __LINE__ ); ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64), - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status ); } else { @@ -1429,7 +1429,7 @@ static void test_Loader(void) section.Characteristics = IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); - ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08lx\n", status );
switch (orig_machine) { @@ -1438,36 +1438,36 @@ static void test_Loader(void) } status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(!status) /* win8 */, - "NtCreateSection error %08x\n", status ); + "NtCreateSection error %08lx\n", status );
nt32.FileHeader.Machine = get_alt_bitness_machine( orig_machine ); status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt32.OptionalHeader.SizeOfCode = 0; nt32.OptionalHeader.AddressOfEntryPoint = 0x1000; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt32.OptionalHeader.SizeOfCode = 0; nt32.OptionalHeader.AddressOfEntryPoint = 0; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt32.OptionalHeader.SizeOfCode = 0x1000; nt32.OptionalHeader.AddressOfEntryPoint = 0; nt32.OptionalHeader.DllCharacteristics = IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt32.OptionalHeader.SizeOfCode = 0; nt32.OptionalHeader.AddressOfEntryPoint = 0; section.Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, section_data, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt32.OptionalHeader.NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; nt32.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = page_size; @@ -1476,32 +1476,32 @@ static void test_Loader(void) cor_header.MinorRuntimeVersion = 4; cor_header.Flags = COMIMAGE_FLAGS_ILONLY; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt32.OptionalHeader.SizeOfCode = 0x1000; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.MinorRuntimeVersion = 5; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITREQUIRED; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITPREFERRED; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
cor_header.Flags = 0; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status );
nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = 1; nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size = 1; status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, §ion, &cor_header, __LINE__ ); - ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08lx\n", status ); }
section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ; @@ -1528,11 +1528,11 @@ static void test_filenames(void) strcpy( long_path, dll_name ); strcpy( strrchr( long_path, '\' ), "\this-is-a-long-name.dll" ); ret = MoveFileA( dll_name, long_path ); - ok( ret, "MoveFileA failed err %u\n", GetLastError() ); + ok( ret, "MoveFileA failed err %lu\n", GetLastError() ); GetShortPathNameA( long_path, short_path, MAX_PATH );
mod = LoadLibraryA( short_path ); - ok( mod != NULL, "loading failed err %u\n", GetLastError() ); + ok( mod != NULL, "loading failed err %lu\n", GetLastError() ); GetModuleFileNameA( mod, buffer, MAX_PATH ); ok( !lstrcmpiA( buffer, short_path ), "got wrong path %s / %s\n", buffer, short_path ); mod2 = GetModuleHandleA( short_path ); @@ -1540,7 +1540,7 @@ static void test_filenames(void) mod2 = GetModuleHandleA( long_path ); ok( mod == mod2, "wrong module %p for %s\n", mod2, long_path ); mod2 = LoadLibraryA( long_path ); - ok( mod2 != NULL, "loading failed err %u\n", GetLastError() ); + ok( mod2 != NULL, "loading failed err %lu\n", GetLastError() ); ok( mod == mod2, "library loaded twice\n" ); GetModuleFileNameA( mod2, buffer, MAX_PATH ); ok( !lstrcmpiA( buffer, short_path ), "got wrong path %s / %s\n", buffer, short_path ); @@ -1548,7 +1548,7 @@ static void test_filenames(void) FreeLibrary( mod );
mod = LoadLibraryA( long_path ); - ok( mod != NULL, "loading failed err %u\n", GetLastError() ); + ok( mod != NULL, "loading failed err %lu\n", GetLastError() ); GetModuleFileNameA( mod, buffer, MAX_PATH ); ok( !lstrcmpiA( buffer, long_path ), "got wrong path %s / %s\n", buffer, long_path ); mod2 = GetModuleHandleA( short_path ); @@ -1556,7 +1556,7 @@ static void test_filenames(void) mod2 = GetModuleHandleA( long_path ); ok( mod == mod2, "wrong module %p for %s\n", mod2, long_path ); mod2 = LoadLibraryA( short_path ); - ok( mod2 != NULL, "loading failed err %u\n", GetLastError() ); + ok( mod2 != NULL, "loading failed err %lu\n", GetLastError() ); ok( mod == mod2, "library loaded twice\n" ); GetModuleFileNameA( mod2, buffer, MAX_PATH ); ok( !lstrcmpiA( buffer, long_path ), "got wrong path %s / %s\n", buffer, long_path ); @@ -1566,17 +1566,17 @@ static void test_filenames(void) strcpy( dll_name, long_path ); strcpy( strrchr( dll_name, '\' ), "\this-is-another-name.dll" ); ret = CreateHardLinkA( dll_name, long_path, NULL ); - ok( ret, "CreateHardLinkA failed err %u\n", GetLastError() ); + ok( ret, "CreateHardLinkA failed err %lu\n", GetLastError() ); if (ret) { mod = LoadLibraryA( dll_name ); - ok( mod != NULL, "loading failed err %u\n", GetLastError() ); + ok( mod != NULL, "loading failed err %lu\n", GetLastError() ); GetModuleFileNameA( mod, buffer, MAX_PATH ); ok( !lstrcmpiA( buffer, dll_name ), "got wrong path %s / %s\n", buffer, dll_name ); mod2 = GetModuleHandleA( long_path ); ok( mod == mod2, "wrong module %p for %s\n", mod2, long_path ); mod2 = LoadLibraryA( long_path ); - ok( mod2 != NULL, "loading failed err %u\n", GetLastError() ); + ok( mod2 != NULL, "loading failed err %lu\n", GetLastError() ); ok( mod == mod2, "library loaded twice\n" ); GetModuleFileNameA( mod2, buffer, MAX_PATH ); ok( !lstrcmpiA( buffer, dll_name ), "got wrong path %s / %s\n", buffer, short_path ); @@ -1655,11 +1655,11 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL
SetLastError(0xdeadbeef); hfile = CreateFileA(dll_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hmap = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, 0); - ok(hmap != 0, "CreateFileMapping error %d\n", GetLastError()); + ok(hmap != 0, "CreateFileMapping error %ld\n", GetLastError());
offset.u.LowPart = 0; offset.u.HighPart = 0; @@ -1668,41 +1668,41 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL size = 0; status = pNtMapViewOfSection(hmap, GetCurrentProcess(), &addr1, 0, 0, &offset, &size, 1 /* ViewShare */, 0, PAGE_READONLY); - ok(status == STATUS_SUCCESS, "NtMapViewOfSection error %x\n", status); + ok(status == STATUS_SUCCESS, "NtMapViewOfSection error %lx\n", status); ok(addr1 != 0, "mapped address should be valid\n");
SetLastError(0xdeadbeef); size = VirtualQuery((char *)addr1 + section.VirtualAddress, &info, sizeof(info)); - ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); + ok(size == sizeof(info), "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == (char *)addr1 + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)addr1 + section.VirtualAddress); - ok(info.RegionSize == page_size, "got %#lx != expected %#x\n", info.RegionSize, page_size); - ok(info.Protect == scn_page_access, "got %#x != expected %#x\n", info.Protect, scn_page_access); + ok(info.RegionSize == page_size, "got %#Ix != expected %#lx\n", info.RegionSize, page_size); + ok(info.Protect == scn_page_access, "got %#lx != expected %#lx\n", info.Protect, scn_page_access); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == SEC_IMAGE, "%#x != SEC_IMAGE\n", info.Type); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#lx != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == SEC_IMAGE, "%#lx != SEC_IMAGE\n", info.Type);
addr2 = NULL; size = 0; status = pNtMapViewOfSection(hmap, GetCurrentProcess(), &addr2, 0, 0, &offset, &size, 1 /* ViewShare */, 0, PAGE_READONLY); - ok(status == STATUS_IMAGE_NOT_AT_BASE, "expected STATUS_IMAGE_NOT_AT_BASE, got %x\n", status); + ok(status == STATUS_IMAGE_NOT_AT_BASE, "expected STATUS_IMAGE_NOT_AT_BASE, got %lx\n", status); ok(addr2 != 0, "mapped address should be valid\n"); ok(addr2 != addr1, "mapped addresses should be different\n");
SetLastError(0xdeadbeef); size = VirtualQuery((char *)addr2 + section.VirtualAddress, &info, sizeof(info)); - ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); + ok(size == sizeof(info), "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == (char *)addr2 + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)addr2 + section.VirtualAddress); - ok(info.RegionSize == page_size, "got %#lx != expected %#x\n", info.RegionSize, page_size); - ok(info.Protect == scn_page_access, "got %#x != expected %#x\n", info.Protect, scn_page_access); + ok(info.RegionSize == page_size, "got %#Ix != expected %#lx\n", info.RegionSize, page_size); + ok(info.Protect == scn_page_access, "got %#lx != expected %#lx\n", info.Protect, scn_page_access); ok(info.AllocationBase == addr2, "%p != %p\n", info.AllocationBase, addr2); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == SEC_IMAGE, "%#x != SEC_IMAGE\n", info.Type); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#lx != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == SEC_IMAGE, "%#lx != SEC_IMAGE\n", info.Type);
status = pNtUnmapViewOfSection(GetCurrentProcess(), addr2); - ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection error %x\n", status); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection error %lx\n", status);
addr2 = MapViewOfFile(hmap, 0, 0, 0, 0); ok(addr2 != 0, "mapped address should be valid\n"); @@ -1710,14 +1710,14 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL
SetLastError(0xdeadbeef); size = VirtualQuery((char *)addr2 + section.VirtualAddress, &info, sizeof(info)); - ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); + ok(size == sizeof(info), "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == (char *)addr2 + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)addr2 + section.VirtualAddress); - ok(info.RegionSize == page_size, "got %#lx != expected %#x\n", info.RegionSize, page_size); - ok(info.Protect == scn_page_access, "got %#x != expected %#x\n", info.Protect, scn_page_access); + ok(info.RegionSize == page_size, "got %#Ix != expected %#lx\n", info.RegionSize, page_size); + ok(info.Protect == scn_page_access, "got %#lx != expected %#lx\n", info.Protect, scn_page_access); ok(info.AllocationBase == addr2, "%p != %p\n", info.AllocationBase, addr2); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == SEC_IMAGE, "%#x != SEC_IMAGE\n", info.Type); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#lx != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == SEC_IMAGE, "%#lx != SEC_IMAGE\n", info.Type);
UnmapViewOfFile(addr2);
@@ -1726,21 +1726,21 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL if (is_dll) { ok(!addr2, "LoadLibrary should fail, is_dll %d\n", is_dll); - ok(GetLastError() == ERROR_INVALID_ADDRESS, "expected ERROR_INVALID_ADDRESS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_ADDRESS, "expected ERROR_INVALID_ADDRESS, got %ld\n", GetLastError()); } else { BOOL ret; - ok(addr2 != 0, "LoadLibrary error %d, is_dll %d\n", GetLastError(), is_dll); + ok(addr2 != 0, "LoadLibrary error %ld, is_dll %d\n", GetLastError(), is_dll); ok(addr2 != addr1, "mapped addresses should be different\n");
SetLastError(0xdeadbeef); ret = FreeLibrary(addr2); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError()); }
status = pNtUnmapViewOfSection(GetCurrentProcess(), addr1); - ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection error %x\n", status); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection error %lx\n", status);
CloseHandle(hmap); CloseHandle(hfile); @@ -1806,7 +1806,7 @@ static void test_VirtualProtect(void *base, void *section)
SetLastError(0xdeadbeef); ret = VirtualProtect(section, page_size, PAGE_NOACCESS, &old_prot); - ok(ret, "VirtualProtect error %d\n", GetLastError()); + ok(ret, "VirtualProtect error %ld\n", GetLastError());
orig_prot = old_prot;
@@ -1814,48 +1814,48 @@ static void test_VirtualProtect(void *base, void *section) { SetLastError(0xdeadbeef); ret = VirtualQuery(section, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == section, "%d: got %p != expected %p\n", i, info.BaseAddress, section); - ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); - ok(info.Protect == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, info.Protect); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == SEC_IMAGE, "%d: %#x != SEC_IMAGE\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == section, "%ld: got %p != expected %p\n", i, info.BaseAddress, section); + ok(info.RegionSize == page_size, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, page_size); + ok(info.Protect == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, info.Protect); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%ld: %#lx != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == SEC_IMAGE, "%ld: %#lx != SEC_IMAGE\n", i, info.Type);
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); ret = VirtualProtect(section, page_size, td[i].prot_set, &old_prot); if (td[i].prot_get) { - ok(ret, "%d: VirtualProtect error %d, requested prot %#x\n", i, GetLastError(), td[i].prot_set); - ok(old_prot == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, old_prot); + ok(ret, "%ld: VirtualProtect error %ld, requested prot %#lx\n", i, GetLastError(), td[i].prot_set); + ok(old_prot == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, old_prot);
SetLastError(0xdeadbeef); ret = VirtualQuery(section, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == section, "%d: got %p != expected %p\n", i, info.BaseAddress, section); - ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); - ok(info.Protect == td[i].prot_get, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot_get); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == SEC_IMAGE, "%d: %#x != SEC_IMAGE\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == section, "%ld: got %p != expected %p\n", i, info.BaseAddress, section); + ok(info.RegionSize == page_size, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, page_size); + ok(info.Protect == td[i].prot_get, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot_get); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%ld: %#lx != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == SEC_IMAGE, "%ld: %#lx != SEC_IMAGE\n", i, info.Type); } else { - ok(!ret, "%d: VirtualProtect should fail\n", i); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(!ret, "%ld: VirtualProtect should fail\n", i); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); }
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); ret = VirtualProtect(section, page_size, PAGE_NOACCESS, &old_prot); - ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); + ok(ret, "%ld: VirtualProtect error %ld\n", i, GetLastError()); if (td[i].prot_get) - ok(old_prot == td[i].prot_get, "%d: got %#x != expected %#x\n", i, old_prot, td[i].prot_get); + ok(old_prot == td[i].prot_get, "%ld: got %#lx != expected %#lx\n", i, old_prot, td[i].prot_get); else - ok(old_prot == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, old_prot); + ok(old_prot == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, old_prot); }
exec_prot = 0; @@ -1872,11 +1872,11 @@ static void test_VirtualProtect(void *base, void *section) ret = VirtualProtect(section, page_size, prot, &old_prot); if ((rw_prot && exec_prot) || (!rw_prot && !exec_prot)) { - ok(!ret, "VirtualProtect(%02x) should fail\n", prot); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ret, "VirtualProtect(%02lx) should fail\n", prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } else - ok(ret, "VirtualProtect(%02x) error %d\n", prot, GetLastError()); + ok(ret, "VirtualProtect(%02lx) error %ld\n", prot, GetLastError());
rw_prot = 1 << j; } @@ -1886,7 +1886,7 @@ static void test_VirtualProtect(void *base, void *section)
SetLastError(0xdeadbeef); ret = VirtualProtect(section, page_size, orig_prot, &old_prot); - ok(ret, "VirtualProtect error %d\n", GetLastError()); + ok(ret, "VirtualProtect error %ld\n", GetLastError()); }
static void test_section_access(void) @@ -1959,7 +1959,7 @@ static void test_section_access(void)
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &dos_header, sizeof(dos_header), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
nt_header = nt_header_template; nt_header.FileHeader.NumberOfSections = 1; @@ -1982,42 +1982,42 @@ static void test_section_access(void)
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = WriteFile(hfile, &nt_header.OptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
file_align = nt_header.OptionalHeader.FileAlignment - nt_header.OptionalHeader.SizeOfHeaders; assert(file_align < sizeof(filler)); SetLastError(0xdeadbeef); ret = WriteFile(hfile, filler, file_align, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
/* section data */ SetLastError(0xdeadbeef); ret = WriteFile(hfile, section_data, sizeof(section_data), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
CloseHandle(hfile);
SetLastError(0xdeadbeef); hlib = LoadLibraryExA(dll_name, NULL, DONT_RESOLVE_DLL_REFERENCES); - ok(hlib != 0, "LoadLibrary error %d\n", GetLastError()); + ok(hlib != 0, "LoadLibrary error %ld\n", GetLastError());
SetLastError(0xdeadbeef); size = VirtualQuery((char *)hlib + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), - "%d: VirtualQuery error %d\n", i, GetLastError()); + "%d: VirtualQuery error %ld\n", i, GetLastError()); ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress); - ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); - ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access); + ok(info.RegionSize == page_size, "%d: got %#Ix != expected %#lx\n", i, info.RegionSize, page_size); + ok(info.Protect == td[i].scn_page_access, "%d: got %#lx != expected %#lx\n", i, info.Protect, td[i].scn_page_access); ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == SEC_IMAGE, "%d: %#x != SEC_IMAGE\n", i, info.Type); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#lx != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%d: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == SEC_IMAGE, "%d: %#lx != SEC_IMAGE\n", i, info.Type); if (info.Protect != PAGE_NOACCESS) ok(!memcmp((const char *)info.BaseAddress, section_data, section.SizeOfRawData), "wrong section data\n");
@@ -2030,15 +2030,15 @@ static void test_section_access(void) *p = 0xfe; SetLastError(0xdeadbeef); size = VirtualQuery((char *)hlib + section.VirtualAddress, &info, sizeof(info)); - ok(size == sizeof(info), "%d: VirtualQuery error %d\n", i, GetLastError()); + ok(size == sizeof(info), "%d: VirtualQuery error %ld\n", i, GetLastError()); /* FIXME: remove the condition below once Wine is fixed */ todo_wine_if (info.Protect == PAGE_WRITECOPY || info.Protect == PAGE_EXECUTE_WRITECOPY) - ok(info.Protect == td[i].scn_page_access_after_write, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access_after_write); + ok(info.Protect == td[i].scn_page_access_after_write, "%d: got %#lx != expected %#lx\n", i, info.Protect, td[i].scn_page_access_after_write); }
SetLastError(0xdeadbeef); ret = FreeLibrary(hlib); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError());
test_image_mapping(dll_name, td[i].scn_page_access, TRUE);
@@ -2053,57 +2053,57 @@ static void test_section_access(void) * but leave a not deletable temporary file. */ ok(hfile != INVALID_HANDLE_VALUE || broken(hfile == INVALID_HANDLE_VALUE) /* nt4 */, - "CreateFile error %d\n", GetLastError()); + "CreateFile error %ld\n", GetLastError()); if (hfile == INVALID_HANDLE_VALUE) goto nt4_is_broken; SetFilePointer(hfile, sizeof(dos_header), NULL, FILE_BEGIN); SetLastError(0xdeadbeef); ret = WriteFile(hfile, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); CloseHandle(hfile);
memset(&sti, 0, sizeof(sti)); sti.cb = sizeof(sti); SetLastError(0xdeadbeef); ret = CreateProcessA(dll_name, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &sti, &pi); - ok(ret, "CreateProcess() error %d\n", GetLastError()); + ok(ret, "CreateProcess() error %ld\n", GetLastError());
SetLastError(0xdeadbeef); size = VirtualQueryEx(pi.hProcess, (char *)hlib + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), - "%d: VirtualQuery error %d\n", i, GetLastError()); + "%d: VirtualQuery error %ld\n", i, GetLastError()); ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress); - ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); - ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access); + ok(info.RegionSize == page_size, "%d: got %#Ix != expected %#lx\n", i, info.RegionSize, page_size); + ok(info.Protect == td[i].scn_page_access, "%d: got %#lx != expected %#lx\n", i, info.Protect, td[i].scn_page_access); ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == SEC_IMAGE, "%d: %#x != SEC_IMAGE\n", i, info.Type); + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#lx != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%d: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == SEC_IMAGE, "%d: %#lx != SEC_IMAGE\n", i, info.Type); if (info.Protect != PAGE_NOACCESS) { SetLastError(0xdeadbeef); ret = ReadProcessMemory(pi.hProcess, info.BaseAddress, buf, section.SizeOfRawData, NULL); - ok(ret, "ReadProcessMemory() error %d\n", GetLastError()); + ok(ret, "ReadProcessMemory() error %ld\n", GetLastError()); ok(!memcmp(buf, section_data, section.SizeOfRawData), "wrong section data\n"); }
status = NtQueryInformationProcess(pi.hProcess, ProcessImageInformation, &image_info, sizeof(image_info), NULL ); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); ok(!(image_info.ImageCharacteristics & IMAGE_FILE_DLL), "Got unexpected characteristics %#x.\n", nt_header.FileHeader.Characteristics); status = NtUnmapViewOfSection(pi.hProcess, info.BaseAddress); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); status = NtQueryInformationProcess(pi.hProcess, ProcessImageInformation, &image_info, sizeof(image_info), NULL ); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status); ok(!(image_info.ImageCharacteristics & IMAGE_FILE_DLL), "Got unexpected characteristics %#x.\n", nt_header.FileHeader.Characteristics);
SetLastError(0xdeadbeef); ret = TerminateProcess(pi.hProcess, 0); - ok(ret, "TerminateProcess() error %d\n", GetLastError()); + ok(ret, "TerminateProcess() error %ld\n", GetLastError()); ret = WaitForSingleObject(pi.hProcess, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %x\n", ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %lx\n", ret);
CloseHandle(pi.hThread); CloseHandle(pi.hProcess); @@ -2113,7 +2113,7 @@ static void test_section_access(void) nt4_is_broken: SetLastError(0xdeadbeef); ret = DeleteFileA(dll_name); - ok(ret || broken(!ret) /* nt4 */, "DeleteFile error %d\n", GetLastError()); + ok(ret || broken(!ret) /* nt4 */, "DeleteFile error %ld\n", GetLastError()); } }
@@ -2203,7 +2203,7 @@ static void test_import_resolution(void) { case 0: /* normal load */ mod = LoadLibraryA( dll_name ); - ok( mod != NULL, "failed to load err %u\n", GetLastError() ); + ok( mod != NULL, "failed to load err %lu\n", GetLastError() ); if (!mod) break; ptr = (struct imports *)((char *)mod + page_size); expect = GetProcAddress( GetModuleHandleA( data.module ), data.function.name ); @@ -2220,7 +2220,7 @@ static void test_import_resolution(void) break; case 1: /* load with DONT_RESOLVE_DLL_REFERENCES doesn't resolve imports */ mod = LoadLibraryExA( dll_name, 0, DONT_RESOLVE_DLL_REFERENCES ); - ok( mod != NULL, "failed to load err %u\n", GetLastError() ); + ok( mod != NULL, "failed to load err %lu\n", GetLastError() ); if (!mod) break; ptr = (struct imports *)((char *)mod + page_size); ok( ptr->thunks[0].u1.Function == 0xdeadbeef, "thunk resolved to %p for %s.%s\n", @@ -2237,7 +2237,7 @@ static void test_import_resolution(void) break; case 2: /* load without IMAGE_FILE_DLL doesn't resolve imports */ mod = LoadLibraryA( dll_name ); - ok( mod != NULL, "failed to load err %u\n", GetLastError() ); + ok( mod != NULL, "failed to load err %lu\n", GetLastError() ); if (!mod) break; ptr = (struct imports *)((char *)mod + page_size); ok( ptr->thunks[0].u1.Function == 0xdeadbeef, "thunk resolved to %p for %s.%s\n", @@ -2266,7 +2266,7 @@ static DWORD WINAPI mutex_thread_proc(void *param) DWORD ret;
ret = WaitForSingleObject(mutex, 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret);
SetEvent(param);
@@ -2276,7 +2276,7 @@ static DWORD WINAPI mutex_thread_proc(void *param) wait_list[3] = heap_lock_event; wait_list[4] = cs_lock_event;
- trace("%04x: mutex_thread_proc: starting\n", GetCurrentThreadId()); + trace("%04lx: mutex_thread_proc: starting\n", GetCurrentThreadId()); while (1) { ret = WaitForMultipleObjects(ARRAY_SIZE(wait_list), wait_list, FALSE, 50); @@ -2284,36 +2284,36 @@ static DWORD WINAPI mutex_thread_proc(void *param) else if (ret == WAIT_OBJECT_0 + 1) { ULONG_PTR loader_lock_magic; - trace("%04x: mutex_thread_proc: Entering loader lock\n", GetCurrentThreadId()); + trace("%04lx: mutex_thread_proc: Entering loader lock\n", GetCurrentThreadId()); ret = pLdrLockLoaderLock(0, NULL, &loader_lock_magic); - ok(!ret, "LdrLockLoaderLock error %#x\n", ret); + ok(!ret, "LdrLockLoaderLock error %#lx\n", ret); inside_loader_lock++; SetEvent(ack_event); } else if (ret == WAIT_OBJECT_0 + 2) { - trace("%04x: mutex_thread_proc: Entering PEB lock\n", GetCurrentThreadId()); + trace("%04lx: mutex_thread_proc: Entering PEB lock\n", GetCurrentThreadId()); pRtlAcquirePebLock(); inside_peb_lock++; SetEvent(ack_event); } else if (ret == WAIT_OBJECT_0 + 3) { - trace("%04x: mutex_thread_proc: Entering heap lock\n", GetCurrentThreadId()); + trace("%04lx: mutex_thread_proc: Entering heap lock\n", GetCurrentThreadId()); HeapLock(GetProcessHeap()); inside_heap_lock++; SetEvent(ack_event); } else if (ret == WAIT_OBJECT_0 + 4) { - trace("%04x: mutex_thread_proc: Entering CS lock\n", GetCurrentThreadId()); + trace("%04lx: mutex_thread_proc: Entering CS lock\n", GetCurrentThreadId()); EnterCriticalSection(&cs_lock); inside_cs_lock++; SetEvent(ack_event); } }
- trace("%04x: mutex_thread_proc: exiting\n", GetCurrentThreadId()); + trace("%04lx: mutex_thread_proc: exiting\n", GetCurrentThreadId()); return 196; }
@@ -2322,18 +2322,18 @@ static DWORD WINAPI semaphore_thread_proc(void *param) DWORD ret;
ret = WaitForSingleObject(semaphore, 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret);
SetEvent(param);
while (1) { if (winetest_debug > 1) - trace("%04x: semaphore_thread_proc: still alive\n", GetCurrentThreadId()); + trace("%04lx: semaphore_thread_proc: still alive\n", GetCurrentThreadId()); if (WaitForSingleObject(stop_event, 50) != WAIT_TIMEOUT) break; }
- trace("%04x: semaphore_thread_proc: exiting\n", GetCurrentThreadId()); + trace("%04lx: semaphore_thread_proc: exiting\n", GetCurrentThreadId()); return 196; }
@@ -2345,7 +2345,7 @@ static DWORD WINAPI noop_thread_proc(void *param) InterlockedIncrement(noop_thread_started); }
- trace("%04x: noop_thread_proc: exiting\n", GetCurrentThreadId()); + trace("%04lx: noop_thread_proc: exiting\n", GetCurrentThreadId()); return 195; }
@@ -2394,7 +2394,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) trace("dll: %p, DLL_PROCESS_ATTACH, %p\n", hinst, param);
ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
/* Set up the FLS slot, if FLS is available */ if (pFlsGetValue) @@ -2402,18 +2402,18 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) void* value; BOOL bret; ret = pFlsAlloc(&fls_callback); - ok(ret != FLS_OUT_OF_INDEXES, "FlsAlloc returned %d\n", ret); + ok(ret != FLS_OUT_OF_INDEXES, "FlsAlloc returned %ld\n", ret); fls_index = ret; SetLastError(0xdeadbeef); value = pFlsGetValue(fls_index); ok(!value, "FlsGetValue returned %p, expected NULL\n", value); - ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %lu\n", GetLastError()); bret = pFlsSetValue(fls_index, (void*) 0x31415); ok(bret, "FlsSetValue failed\n"); fls_count++;
fls_index2 = pFlsAlloc(&fls_callback); - ok(fls_index2 != FLS_OUT_OF_INDEXES, "FlsAlloc returned %d\n", ret); + ok(fls_index2 != FLS_OUT_OF_INDEXES, "FlsAlloc returned %ld\n", ret); } ++thread_count; break; @@ -2464,7 +2464,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) if (test_dll_phase == 3) { ret = pRtlDllShutdownInProgress(); - ok(ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(ret, "RtlDllShutdownInProgress returned %ld\n", ret); } else { @@ -2472,7 +2472,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
/* FIXME: remove once Wine is fixed */ todo_wine_if (!(expected_code == STILL_ACTIVE || expected_code == 196)) - ok(!ret || broken(ret) /* before Vista */, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret || broken(ret) /* before Vista */, "RtlDllShutdownInProgress returned %ld\n", ret); }
/* In the case that the process is terminating, FLS slots should still be accessible, but @@ -2487,20 +2487,20 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) value = pFlsGetValue(fls_index); ok(broken(value == (void*) 0x31415) || /* Win2k3 */ value == NULL, "FlsGetValue returned %p, expected NULL\n", value); - ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %lu\n", GetLastError()); ok(broken(fls_callback_count == thread_detach_count) || /* Win2k3 */ fls_callback_count == thread_detach_count + 1, - "wrong FLS callback count %d, expected %d\n", fls_callback_count, thread_detach_count + 1); + "wrong FLS callback count %ld, expected %d\n", fls_callback_count, thread_detach_count + 1); } if (pFlsFree) { BOOL ret; /* Call FlsFree now and run the remaining callbacks from uncleanly terminated threads */ ret = pFlsFree(fls_index); - ok(ret, "FlsFree failed with error %u\n", GetLastError()); + ok(ret, "FlsFree failed with error %lu\n", GetLastError()); fls_index = FLS_OUT_OF_INDEXES; ok(fls_callback_count == fls_count, - "wrong FLS callback count %d, expected %d\n", fls_callback_count, fls_count); + "wrong FLS callback count %ld, expected %d\n", fls_callback_count, fls_count); }
ok(attached_thread_count >= 2, "attached thread count should be >= 2\n"); @@ -2513,40 +2513,40 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) if (expected_code != STILL_ACTIVE) { ret = WaitForSingleObject(attached_thread[i], 1000); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret); } ret = GetExitCodeThread(attached_thread[i], &code); - trace("dll: GetExitCodeThread(%u) => %d,%u\n", i, ret, code); - ok(ret == 1, "GetExitCodeThread returned %d, expected 1\n", ret); - ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code); + trace("dll: GetExitCodeThread(%lu) => %ld,%lu\n", i, ret, code); + ok(ret == 1, "GetExitCodeThread returned %ld, expected 1\n", ret); + ok(code == expected_code, "expected thread exit code %lu, got %lu\n", expected_code, code); }
ret = WaitForSingleObject(event, 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret);
ret = WaitForSingleObject(mutex, 0); if (expected_code == STILL_ACTIVE) - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); else - ok(ret == WAIT_ABANDONED, "expected WAIT_ABANDONED, got %#x\n", ret); + ok(ret == WAIT_ABANDONED, "expected WAIT_ABANDONED, got %#lx\n", ret);
/* semaphore is not abandoned on thread termination */ ret = WaitForSingleObject(semaphore, 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret);
if (expected_code == STILL_ACTIVE) { ret = WaitForSingleObject(attached_thread[0], 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ret = WaitForSingleObject(attached_thread[1], 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); } else { ret = WaitForSingleObject(attached_thread[0], 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret); ret = WaitForSingleObject(attached_thread[1], 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret); }
/* win7 doesn't allow creating a thread during process shutdown but @@ -2559,26 +2559,26 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) { ok(!handle || broken(handle != 0) /* before win7 */, "CreateThread should fail\n"); if (!handle) - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); else { ret = WaitForSingleObject(handle, 1000); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); CloseHandle(handle); } } else { - ok(handle != 0, "CreateThread error %d\n", GetLastError()); + ok(handle != 0, "CreateThread error %ld\n", GetLastError()); ret = WaitForSingleObject(handle, 1000); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ok(!noop_thread_started || broken(noop_thread_started) /* XP64 */, "thread shouldn't start yet\n"); CloseHandle(handle); }
SetLastError(0xdeadbeef); process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, GetCurrentProcessId()); - ok(process != NULL, "OpenProcess error %d\n", GetLastError()); + ok(process != NULL, "OpenProcess error %ld\n", GetLastError());
noop_thread_started = 0; SetLastError(0xdeadbeef); @@ -2587,26 +2587,26 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) { ok(!handle || broken(handle != 0) /* before win7 */, "CreateRemoteThread should fail\n"); if (!handle) - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); else { ret = WaitForSingleObject(handle, 1000); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); CloseHandle(handle); } } else { - ok(handle != 0, "CreateRemoteThread error %d\n", GetLastError()); + ok(handle != 0, "CreateRemoteThread error %ld\n", GetLastError()); ret = WaitForSingleObject(handle, 1000); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ok(!noop_thread_started || broken(noop_thread_started) /* XP64 */, "thread shouldn't start yet\n"); CloseHandle(handle); }
SetLastError(0xdeadbeef); handle = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, NULL); - ok(handle != 0, "CreateFileMapping error %d\n", GetLastError()); + ok(handle != 0, "CreateFileMapping error %ld\n", GetLastError());
offset.u.LowPart = 0; offset.u.HighPart = 0; @@ -2614,9 +2614,9 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) size = 0; ret = pNtMapViewOfSection(handle, process, &addr, 0, 0, &offset, &size, 1 /* ViewShare */, 0, PAGE_READONLY); - ok(ret == STATUS_SUCCESS, "NtMapViewOfSection error %#x\n", ret); + ok(ret == STATUS_SUCCESS, "NtMapViewOfSection error %#lx\n", ret); ret = pNtUnmapViewOfSection(process, addr); - ok(ret == STATUS_SUCCESS, "NtUnmapViewOfSection error %#x\n", ret); + ok(ret == STATUS_SUCCESS, "NtUnmapViewOfSection error %#lx\n", ret);
CloseHandle(handle); CloseHandle(process); @@ -2625,10 +2625,10 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) ok(!handle, "winver.exe shouldn't be loaded yet\n"); SetLastError(0xdeadbeef); handle = LoadLibraryA("winver.exe"); - ok(handle != 0, "LoadLibrary error %d\n", GetLastError()); + ok(handle != 0, "LoadLibrary error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = FreeLibrary(handle); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError()); handle = GetModuleHandleA("winver.exe"); if (param) ok(handle != 0, "winver.exe should not be unloaded\n"); @@ -2639,17 +2639,17 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) SetLastError(0xdeadbeef); ret = WaitForDebugEvent(&de, 0); ok(!ret, "WaitForDebugEvent should fail\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DebugActiveProcess(GetCurrentProcessId()); ok(!ret, "DebugActiveProcess should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForDebugEvent(&de, 0); ok(!ret, "WaitForDebugEvent should fail\n"); - ok(GetLastError() == ERROR_SEM_TIMEOUT, "expected ERROR_SEM_TIMEOUT, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_SEM_TIMEOUT, "expected ERROR_SEM_TIMEOUT, got %ld\n", GetLastError());
if (test_dll_phase == 2) { @@ -2666,7 +2666,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) ++thread_count;
ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
if (attached_thread_count < MAX_COUNT) { @@ -2683,7 +2683,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) SetLastError(0xdeadbeef); value = pFlsGetValue(fls_index); ok(!value, "FlsGetValue returned %p, expected NULL\n", value); - ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %lu\n", GetLastError()); ret = pFlsSetValue(fls_index, (void*) 0x31415); ok(ret, "FlsSetValue failed\n"); fls_count++; @@ -2701,9 +2701,9 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) * sent on thread exit, but DLL_THREAD_ATTACH is never received. */ if (noop_thread_started) - ok(ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(ret, "RtlDllShutdownInProgress returned %ld\n", ret); else - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
/* FLS data should already be destroyed, if FLS is available. * Note that this is broken for Win2k3, which runs the callbacks *after* the DLL entry @@ -2719,7 +2719,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) value = pFlsGetValue(fls_index); ok(broken(value == (void*) 0x31415) || /* Win2k3 */ !value, "FlsGetValue returned %p, expected NULL\n", value); - ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "FlsGetValue failed with error %lu\n", GetLastError());
bret = pFlsSetValue(fls_index2, (void*) 0x31415); ok(bret, "FlsSetValue failed\n"); @@ -2734,7 +2734,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
break; default: - trace("dll: %p, %d, %p\n", hinst, reason, param); + trace("dll: %p, %ld, %p\n", hinst, reason, param); break; }
@@ -2752,7 +2752,7 @@ static void child_process(const char *dll_name, DWORD target_offset) struct PROCESS_BASIC_INFORMATION_PRIVATE pbi; DWORD_PTR affinity;
- trace("phase %d: writing %p at %#x\n", test_dll_phase, dll_entry_point, target_offset); + trace("phase %d: writing %p at %#lx\n", test_dll_phase, dll_entry_point, target_offset);
if (pFlsAlloc) { @@ -2762,36 +2762,36 @@ static void child_process(const char *dll_name, DWORD target_offset)
SetLastError(0xdeadbeef); mutex = CreateMutexW(NULL, FALSE, NULL); - ok(mutex != 0, "CreateMutex error %d\n", GetLastError()); + ok(mutex != 0, "CreateMutex error %ld\n", GetLastError());
SetLastError(0xdeadbeef); semaphore = CreateSemaphoreW(NULL, 1, 1, NULL); - ok(semaphore != 0, "CreateSemaphore error %d\n", GetLastError()); + ok(semaphore != 0, "CreateSemaphore error %ld\n", GetLastError());
SetLastError(0xdeadbeef); event = CreateEventW(NULL, TRUE, FALSE, NULL); - ok(event != 0, "CreateEvent error %d\n", GetLastError()); + ok(event != 0, "CreateEvent error %ld\n", GetLastError());
SetLastError(0xdeadbeef); loader_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(loader_lock_event != 0, "CreateEvent error %d\n", GetLastError()); + ok(loader_lock_event != 0, "CreateEvent error %ld\n", GetLastError());
SetLastError(0xdeadbeef); peb_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(peb_lock_event != 0, "CreateEvent error %d\n", GetLastError()); + ok(peb_lock_event != 0, "CreateEvent error %ld\n", GetLastError());
SetLastError(0xdeadbeef); heap_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(heap_lock_event != 0, "CreateEvent error %d\n", GetLastError()); + ok(heap_lock_event != 0, "CreateEvent error %ld\n", GetLastError());
InitializeCriticalSection(&cs_lock); SetLastError(0xdeadbeef); cs_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(cs_lock_event != 0, "CreateEvent error %d\n", GetLastError()); + ok(cs_lock_event != 0, "CreateEvent error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ack_event = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(ack_event != 0, "CreateEvent error %d\n", GetLastError()); + ok(ack_event != 0, "CreateEvent error %ld\n", GetLastError());
file = CreateFileA(dll_name, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); if (file == INVALID_HANDLE_VALUE) @@ -2803,20 +2803,20 @@ static void child_process(const char *dll_name, DWORD target_offset) SetLastError(0xdeadbeef); target = dll_entry_point; ret = WriteFile(file, &target, sizeof(target), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); CloseHandle(file);
SetLastError(0xdeadbeef); hmod = LoadLibraryA(dll_name); - ok(hmod != 0, "LoadLibrary error %d\n", GetLastError()); + ok(hmod != 0, "LoadLibrary error %ld\n", GetLastError());
SetLastError(0xdeadbeef); stop_event = CreateEventW(NULL, TRUE, FALSE, NULL); - ok(stop_event != 0, "CreateEvent error %d\n", GetLastError()); + ok(stop_event != 0, "CreateEvent error %ld\n", GetLastError());
SetLastError(0xdeadbeef); thread = CreateThread(NULL, 0, mutex_thread_proc, event, 0, &dummy); - ok(thread != 0, "CreateThread error %d\n", GetLastError()); + ok(thread != 0, "CreateThread error %ld\n", GetLastError()); WaitForSingleObject(event, 3000); CloseHandle(thread);
@@ -2824,7 +2824,7 @@ static void child_process(const char *dll_name, DWORD target_offset)
SetLastError(0xdeadbeef); thread = CreateThread(NULL, 0, semaphore_thread_proc, event, 0, &dummy); - ok(thread != 0, "CreateThread error %d\n", GetLastError()); + ok(thread != 0, "CreateThread error %ld\n", GetLastError()); WaitForSingleObject(event, 3000); CloseHandle(thread);
@@ -2835,62 +2835,62 @@ static void child_process(const char *dll_name, DWORD target_offset) for (i = 0; i < attached_thread_count; i++) { ret = GetExitCodeThread(attached_thread[i], &code); - trace("child: GetExitCodeThread(%u) => %d,%u\n", i, ret, code); - ok(ret == 1, "GetExitCodeThread returned %d, expected 1\n", ret); - ok(code == STILL_ACTIVE, "expected thread exit code STILL_ACTIVE, got %u\n", code); + trace("child: GetExitCodeThread(%lu) => %ld,%lu\n", i, ret, code); + ok(ret == 1, "GetExitCodeThread returned %ld, expected 1\n", ret); + ok(code == STILL_ACTIVE, "expected thread exit code STILL_ACTIVE, got %lu\n", code); }
ret = WaitForSingleObject(attached_thread[0], 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ret = WaitForSingleObject(attached_thread[1], 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret);
ret = WaitForSingleObject(event, 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ret = WaitForSingleObject(mutex, 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ret = WaitForSingleObject(semaphore, 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret);
ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
SetLastError(0xdeadbeef); process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, GetCurrentProcessId()); - ok(process != NULL, "OpenProcess error %d\n", GetLastError()); + ok(process != NULL, "OpenProcess error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = TerminateProcess(0, 195); ok(!ret, "TerminateProcess(0) should fail\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
Sleep(100);
affinity = 1; ret = pNtSetInformationProcess(process, ProcessAffinityMask, &affinity, sizeof(affinity)); - ok(!ret, "NtSetInformationProcess error %#x\n", ret); + ok(!ret, "NtSetInformationProcess error %#lx\n", ret);
switch (test_dll_phase) { case 0: ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
trace("call NtTerminateProcess(0, 195)\n"); ret = pNtTerminateProcess(0, 195); - ok(!ret, "NtTerminateProcess error %#x\n", ret); + ok(!ret, "NtTerminateProcess error %#lx\n", ret);
memset(&pbi, 0, sizeof(pbi)); ret = pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); - ok(!ret, "NtQueryInformationProcess error %#x\n", ret); + ok(!ret, "NtQueryInformationProcess error %#lx\n", ret); ok(pbi.ExitStatus == STILL_ACTIVE || pbi.ExitStatus == 195, - "expected STILL_ACTIVE, got %lu\n", pbi.ExitStatus); + "expected STILL_ACTIVE, got %Iu\n", pbi.ExitStatus); affinity = 1; ret = pNtSetInformationProcess(process, ProcessAffinityMask, &affinity, sizeof(affinity)); - ok(!ret, "NtSetInformationProcess error %#x\n", ret); + ok(!ret, "NtSetInformationProcess error %#lx\n", ret);
ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
hmod = GetModuleHandleA(dll_name); ok(hmod != 0, "DLL should not be unloaded\n"); @@ -2899,11 +2899,11 @@ static void child_process(const char *dll_name, DWORD target_offset) thread = CreateThread(NULL, 0, noop_thread_proc, &dummy, 0, &ret); ok(!thread || broken(thread != 0) /* before win7 */, "CreateThread should fail\n"); if (!thread) - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); else { ret = WaitForSingleObject(thread, 1000); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret); CloseHandle(thread); }
@@ -2911,34 +2911,34 @@ static void child_process(const char *dll_name, DWORD target_offset) pLdrShutdownProcess();
ret = pRtlDllShutdownInProgress(); - ok(ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(ret, "RtlDllShutdownInProgress returned %ld\n", ret);
hmod = GetModuleHandleA(dll_name); ok(hmod != 0, "DLL should not be unloaded\n");
memset(&pbi, 0, sizeof(pbi)); ret = pNtQueryInformationProcess(process, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); - ok(!ret, "NtQueryInformationProcess error %#x\n", ret); + ok(!ret, "NtQueryInformationProcess error %#lx\n", ret); ok(pbi.ExitStatus == STILL_ACTIVE || pbi.ExitStatus == 195, - "expected STILL_ACTIVE, got %lu\n", pbi.ExitStatus); + "expected STILL_ACTIVE, got %Iu\n", pbi.ExitStatus); affinity = 1; ret = pNtSetInformationProcess(process, ProcessAffinityMask, &affinity, sizeof(affinity)); - ok(!ret, "NtSetInformationProcess error %#x\n", ret); + ok(!ret, "NtSetInformationProcess error %#lx\n", ret); break;
case 1: /* normal ExitProcess */ ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret); break;
case 2: /* ExitProcess will be called by the PROCESS_DETACH handler */ ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
trace("call FreeLibrary(%p)\n", hmod); SetLastError(0xdeadbeef); ret = FreeLibrary(hmod); - ok(ret, "FreeLibrary error %d\n", GetLastError()); + ok(ret, "FreeLibrary error %ld\n", GetLastError()); hmod = GetModuleHandleA(dll_name); ok(!hmod, "DLL should be unloaded\n");
@@ -2946,7 +2946,7 @@ static void child_process(const char *dll_name, DWORD target_offset) ok(0, "FreeLibrary+ExitProcess should never return\n");
ret = pRtlDllShutdownInProgress(); - ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); + ok(!ret, "RtlDllShutdownInProgress returned %ld\n", ret);
break;
@@ -2964,7 +2964,7 @@ static void child_process(const char *dll_name, DWORD target_offset) /* calling NtTerminateProcess should not cause a deadlock */ trace("call NtTerminateProcess(0, 198)\n"); ret = pNtTerminateProcess(0, 198); - ok(!ret, "NtTerminateProcess error %#x\n", ret); + ok(!ret, "NtTerminateProcess error %#lx\n", ret);
*child_failures = winetest_get_failures();
@@ -3032,24 +3032,24 @@ static void child_process(const char *dll_name, DWORD target_offset) if (expected_code == STILL_ACTIVE) { ret = WaitForSingleObject(attached_thread[0], 100); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); ret = WaitForSingleObject(attached_thread[1], 100); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#x\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %#lx\n", ret); } else { ret = WaitForSingleObject(attached_thread[0], 2000); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret); ret = WaitForSingleObject(attached_thread[1], 2000); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#x\n", ret); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %#lx\n", ret); }
for (i = 0; i < attached_thread_count; i++) { ret = GetExitCodeThread(attached_thread[i], &code); - trace("child: GetExitCodeThread(%u) => %d,%u\n", i, ret, code); - ok(ret == 1, "GetExitCodeThread returned %d, expected 1\n", ret); - ok(code == expected_code, "expected thread exit code %u, got %u\n", expected_code, code); + trace("child: GetExitCodeThread(%lu) => %ld,%lu\n", i, ret, code); + ok(ret == 1, "GetExitCodeThread returned %ld, expected 1\n", ret); + ok(code == expected_code, "expected thread exit code %lu, got %lu\n", expected_code, code); }
*child_failures = winetest_get_failures(); @@ -3133,7 +3133,7 @@ static void test_ExitProcess(void)
SetLastError(0xdeadbeef); ret = WriteFile(file, &dos_header, sizeof(dos_header), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
nt_header = nt_header_template; nt_header.FileHeader.NumberOfSections = 1; @@ -3147,10 +3147,10 @@ static void test_ExitProcess(void) nt_header.OptionalHeader.SizeOfHeaders = sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER); SetLastError(0xdeadbeef); ret = WriteFile(file, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = WriteFile(file, &nt_header.OptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
section.SizeOfRawData = sizeof(section_data); section.PointerToRawData = nt_header.OptionalHeader.FileAlignment; @@ -3159,20 +3159,20 @@ static void test_ExitProcess(void) section.Characteristics = IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE; SetLastError(0xdeadbeef); ret = WriteFile(file, §ion, sizeof(section), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
file_align = nt_header.OptionalHeader.FileAlignment - nt_header.OptionalHeader.SizeOfHeaders; assert(file_align < sizeof(filler)); SetLastError(0xdeadbeef); ret = WriteFile(file, filler, file_align, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
target_offset = SetFilePointer(file, 0, NULL, FILE_CURRENT) + FIELD_OFFSET(struct section_data, target);
/* section data */ SetLastError(0xdeadbeef); ret = WriteFile(file, §ion_data, sizeof(section_data), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
CloseHandle(file);
@@ -3180,17 +3180,17 @@ static void test_ExitProcess(void)
/* phase 0 */ *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 0", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 0", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); if (ret != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 0); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 195, "expected exit code 195, got %u\n", ret); + ok(ret == 195, "expected exit code 195, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3198,17 +3198,17 @@ static void test_ExitProcess(void)
/* phase 1 */ *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 1", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 1", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); if (ret != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 0); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 195, "expected exit code 195, got %u\n", ret); + ok(ret == 195, "expected exit code 195, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3216,17 +3216,17 @@ static void test_ExitProcess(void)
/* phase 2 */ *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 2", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 2", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); if (ret != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 0); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 197, "expected exit code 197, got %u\n", ret); + ok(ret == 197, "expected exit code 197, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3234,17 +3234,17 @@ static void test_ExitProcess(void)
/* phase 3 */ *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 3", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 3", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); if (ret != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 0); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 195, "expected exit code 195, got %u\n", ret); + ok(ret == 195, "expected exit code 195, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3254,17 +3254,17 @@ static void test_ExitProcess(void) if (pLdrLockLoaderLock && pLdrUnlockLoaderLock) { *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 4", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 4", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); if (ret != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 0); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 198, "expected exit code 198, got %u\n", ret); + ok(ret == 198, "expected exit code 198, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3277,9 +3277,9 @@ static void test_ExitProcess(void) if (pRtlAcquirePebLock && pRtlReleasePebLock) { *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 5", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 5", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 5000); ok(ret == WAIT_TIMEOUT, "child process should fail to terminate\n"); if (ret != WAIT_OBJECT_0) @@ -3290,10 +3290,10 @@ static void test_ExitProcess(void) ret = WaitForSingleObject(pi.hProcess, 1000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 199, "expected exit code 199, got %u\n", ret); + ok(ret == 199, "expected exit code 199, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3304,9 +3304,9 @@ static void test_ExitProcess(void)
/* phase 6 */ *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 6", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 6", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 5000); todo_wine ok(ret == WAIT_TIMEOUT || broken(ret == WAIT_OBJECT_0) /* XP */, "child process should fail to terminate\n"); @@ -3319,10 +3319,10 @@ static void test_ExitProcess(void) ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &ret); todo_wine - ok(ret == 201 || broken(ret == 1) /* XP */, "expected exit code 201, got %u\n", ret); + ok(ret == 201 || broken(ret == 1) /* XP */, "expected exit code 201, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3330,9 +3330,9 @@ static void test_ExitProcess(void)
/* phase 7 */ *child_failures = -1; - sprintf(cmdline, ""%s" loader %s %u 7", argv[0], dll_name, target_offset); + sprintf(cmdline, ""%s" loader %s %lu 7", argv[0], dll_name, target_offset); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 5000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); if (ret != WAIT_OBJECT_0) @@ -3343,10 +3343,10 @@ static void test_ExitProcess(void) ret = WaitForSingleObject(pi.hProcess, 1000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &ret); - ok(ret == 199, "expected exit code 199, got %u\n", ret); + ok(ret == 199, "expected exit code 199, got %lu\n", ret); if (*child_failures) { - trace("%d failures in child process\n", *child_failures); + trace("%ld failures in child process\n", *child_failures); winetest_add_failures(*child_failures); } CloseHandle(pi.hThread); @@ -3355,32 +3355,32 @@ static void test_ExitProcess(void) /* test remote process termination */ SetLastError(0xdeadbeef); ret = CreateProcessA(argv[0], NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", argv[0], GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", argv[0], GetLastError());
SetLastError(0xdeadbeef); addr = VirtualAllocEx(pi.hProcess, NULL, 4096, MEM_COMMIT, PAGE_READWRITE); - ok(addr != NULL, "VirtualAllocEx error %d\n", GetLastError()); + ok(addr != NULL, "VirtualAllocEx error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = VirtualProtectEx(pi.hProcess, addr, 4096, PAGE_READONLY, &old_prot); - ok(ret, "VirtualProtectEx error %d\n", GetLastError()); - ok(old_prot == PAGE_READWRITE, "expected PAGE_READWRITE, got %#x\n", old_prot); + ok(ret, "VirtualProtectEx error %ld\n", GetLastError()); + ok(old_prot == PAGE_READWRITE, "expected PAGE_READWRITE, got %#lx\n", old_prot); SetLastError(0xdeadbeef); size = VirtualQueryEx(pi.hProcess, NULL, &mbi, sizeof(mbi)); - ok(size == sizeof(mbi), "VirtualQueryEx error %d\n", GetLastError()); + ok(size == sizeof(mbi), "VirtualQueryEx error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = ReadProcessMemory(pi.hProcess, addr, buf, 4, &size); - ok(ret, "ReadProcessMemory error %d\n", GetLastError()); - ok(size == 4, "expected 4, got %lu\n", size); + ok(ret, "ReadProcessMemory error %ld\n", GetLastError()); + ok(size == 4, "expected 4, got %Iu\n", size);
SetLastError(0xdeadbeef); hmap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, NULL); - ok(hmap != 0, "CreateFileMapping error %d\n", GetLastError()); + ok(hmap != 0, "CreateFileMapping error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DuplicateHandle(GetCurrentProcess(), hmap, pi.hProcess, &hmap_dup, 0, FALSE, DUPLICATE_SAME_ACCESS); - ok(ret, "DuplicateHandle error %d\n", GetLastError()); + ok(ret, "DuplicateHandle error %ld\n", GetLastError());
offset.u.LowPart = 0; offset.u.HighPart = 0; @@ -3388,57 +3388,57 @@ static void test_ExitProcess(void) size = 0; ret = pNtMapViewOfSection(hmap, pi.hProcess, &addr, 0, 0, &offset, &size, 1 /* ViewShare */, 0, PAGE_READONLY); - ok(!ret, "NtMapViewOfSection error %#x\n", ret); + ok(!ret, "NtMapViewOfSection error %#lx\n", ret); ret = pNtUnmapViewOfSection(pi.hProcess, addr); - ok(!ret, "NtUnmapViewOfSection error %#x\n", ret); + ok(!ret, "NtUnmapViewOfSection error %#lx\n", ret);
SetLastError(0xdeadbeef); thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void *)0xdeadbeef, NULL, CREATE_SUSPENDED, &ret); - ok(thread != 0, "CreateRemoteThread error %d\n", GetLastError()); + ok(thread != 0, "CreateRemoteThread error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ctx.ContextFlags = CONTEXT_INTEGER; ret = GetThreadContext(thread, &ctx); - ok(ret, "GetThreadContext error %d\n", GetLastError()); + ok(ret, "GetThreadContext error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ctx.ContextFlags = CONTEXT_INTEGER; ret = SetThreadContext(thread, &ctx); - ok(ret, "SetThreadContext error %d\n", GetLastError()); + ok(ret, "SetThreadContext error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = SetThreadPriority(thread, 0); - ok(ret, "SetThreadPriority error %d\n", GetLastError()); + ok(ret, "SetThreadPriority error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = TerminateThread(thread, 199); - ok(ret, "TerminateThread error %d\n", GetLastError()); + ok(ret, "TerminateThread error %ld\n", GetLastError()); /* Calling GetExitCodeThread() without waiting for thread termination * leads to different results due to a race condition. */ ret = WaitForSingleObject(thread, 1000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %x\n", ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %lx\n", ret); GetExitCodeThread(thread, &ret); - ok(ret == 199, "expected exit code 199, got %u\n", ret); + ok(ret == 199, "expected exit code 199, got %lu\n", ret);
SetLastError(0xdeadbeef); ret = TerminateProcess(pi.hProcess, 198); - ok(ret, "TerminateProcess error %d\n", GetLastError()); + ok(ret, "TerminateProcess error %ld\n", GetLastError()); /* Checking process state without waiting for process termination * leads to different results due to a race condition. */ ret = WaitForSingleObject(pi.hProcess, 1000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %x\n", ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %lx\n", ret);
SetLastError(0xdeadbeef); process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, pi.dwProcessId); - ok(process != NULL, "OpenProcess error %d\n", GetLastError()); + ok(process != NULL, "OpenProcess error %ld\n", GetLastError()); CloseHandle(process);
memset(&pbi, 0, sizeof(pbi)); ret = pNtQueryInformationProcess(pi.hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); - ok(!ret, "NtQueryInformationProcess error %#x\n", ret); - ok(pbi.ExitStatus == 198, "expected 198, got %lu\n", pbi.ExitStatus); + ok(!ret, "NtQueryInformationProcess error %#lx\n", ret); + ok(pbi.ExitStatus == 198, "expected 198, got %Iu\n", pbi.ExitStatus); affinity = 1; ret = pNtSetInformationProcess(pi.hProcess, ProcessAffinityMask, &affinity, sizeof(affinity)); - ok(ret == STATUS_PROCESS_IS_TERMINATING, "expected STATUS_PROCESS_IS_TERMINATING, got %#x\n", ret); + ok(ret == STATUS_PROCESS_IS_TERMINATING, "expected STATUS_PROCESS_IS_TERMINATING, got %#lx\n", ret);
SetLastError(0xdeadbeef); ctx.ContextFlags = CONTEXT_INTEGER; @@ -3449,7 +3449,7 @@ static void test_ExitProcess(void) GetLastError() == ERROR_GEN_FAILURE /* win7 64-bit */ || GetLastError() == ERROR_INVALID_FUNCTION /* vista 64-bit */ || GetLastError() == ERROR_ACCESS_DENIED /* Win10 32-bit */, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); ctx.ContextFlags = CONTEXT_INTEGER; ret = SetThreadContext(thread, &ctx); @@ -3458,10 +3458,10 @@ static void test_ExitProcess(void) ok(GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_GEN_FAILURE /* win7 64-bit */ || GetLastError() == ERROR_INVALID_FUNCTION /* vista 64-bit */, - "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = SetThreadPriority(thread, 0); - ok(ret, "SetThreadPriority error %d\n", GetLastError()); + ok(ret, "SetThreadPriority error %ld\n", GetLastError()); CloseHandle(thread);
SetLastError(0xdeadbeef); @@ -3473,7 +3473,7 @@ static void test_ExitProcess(void) GetLastError() == ERROR_GEN_FAILURE /* win7 64-bit */ || GetLastError() == ERROR_INVALID_FUNCTION /* vista 64-bit */ || GetLastError() == ERROR_ACCESS_DENIED /* Win10 32-bit */, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); ctx.ContextFlags = CONTEXT_INTEGER; ret = SetThreadContext(pi.hThread, &ctx); @@ -3482,30 +3482,30 @@ static void test_ExitProcess(void) ok(GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_GEN_FAILURE /* win7 64-bit */ || GetLastError() == ERROR_INVALID_FUNCTION /* vista 64-bit */, - "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = VirtualProtectEx(pi.hProcess, addr, 4096, PAGE_READWRITE, &old_prot); ok(!ret, "VirtualProtectEx should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); size = 0; ret = ReadProcessMemory(pi.hProcess, addr, buf, 4, &size); ok(!ret, "ReadProcessMemory should fail\n"); ok(GetLastError() == ERROR_PARTIAL_COPY || GetLastError() == ERROR_ACCESS_DENIED, - "expected ERROR_PARTIAL_COPY, got %d\n", GetLastError()); - ok(!size, "expected 0, got %lu\n", size); + "expected ERROR_PARTIAL_COPY, got %ld\n", GetLastError()); + ok(!size, "expected 0, got %Iu\n", size); SetLastError(0xdeadbeef); ret = VirtualFreeEx(pi.hProcess, addr, 0, MEM_RELEASE); ok(!ret, "VirtualFreeEx should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); addr = VirtualAllocEx(pi.hProcess, NULL, 4096, MEM_COMMIT, PAGE_READWRITE); ok(!addr, "VirtualAllocEx should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); SetLastError(0xdeadbeef); size = VirtualQueryEx(pi.hProcess, NULL, &mbi, sizeof(mbi)); ok(!size, "VirtualQueryEx should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
/* CloseHandle() call below leads to premature process termination * under some Windows versions. @@ -3521,7 +3521,7 @@ if (0) ret = DuplicateHandle(GetCurrentProcess(), hmap, pi.hProcess, &hmap_dup, 0, FALSE, DUPLICATE_SAME_ACCESS); ok(!ret, "DuplicateHandle should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
offset.u.LowPart = 0; offset.u.HighPart = 0; @@ -3529,27 +3529,27 @@ if (0) size = 0; ret = pNtMapViewOfSection(hmap, pi.hProcess, &addr, 0, 0, &offset, &size, 1 /* ViewShare */, 0, PAGE_READONLY); - ok(ret == STATUS_PROCESS_IS_TERMINATING, "expected STATUS_PROCESS_IS_TERMINATING, got %#x\n", ret); + ok(ret == STATUS_PROCESS_IS_TERMINATING, "expected STATUS_PROCESS_IS_TERMINATING, got %#lx\n", ret);
SetLastError(0xdeadbeef); thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void *)0xdeadbeef, NULL, CREATE_SUSPENDED, &ret); ok(!thread, "CreateRemoteThread should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DebugActiveProcess(pi.dwProcessId); ok(!ret, "DebugActiveProcess should fail\n"); ok(GetLastError() == ERROR_ACCESS_DENIED /* 64-bit */ || GetLastError() == ERROR_NOT_SUPPORTED /* 32-bit */, - "ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + "ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
GetExitCodeProcess(pi.hProcess, &ret); ok(ret == 198 || broken(ret != 198) /* some 32-bit XP version in a VM returns random exit code */, - "expected exit code 198, got %u\n", ret); + "expected exit code 198, got %lu\n", ret); CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
ret = DeleteFileA(dll_name); - ok(ret, "DeleteFile error %d\n", GetLastError()); + ok(ret, "DeleteFile error %ld\n", GetLastError()); #else skip("x86 specific ExitProcess test\n"); #endif @@ -3557,32 +3557,32 @@ if (0)
static PVOID WINAPI failuredllhook(ULONG ul, DELAYLOAD_INFO* pd) { - ok(ul == 4, "expected 4, got %u\n", ul); + ok(ul == 4, "expected 4, got %lu\n", ul); ok(!!pd, "no delayload info supplied\n"); if (pd) { - ok(pd->Size == sizeof(*pd), "got %u\n", pd->Size); + ok(pd->Size == sizeof(*pd), "got %lu\n", pd->Size); ok(!!pd->DelayloadDescriptor, "no DelayloadDescriptor supplied\n"); if (pd->DelayloadDescriptor) { ok(pd->DelayloadDescriptor->Attributes.AllAttributes == 1, - "expected 1, got %u\n", pd->DelayloadDescriptor->Attributes.AllAttributes); + "expected 1, got %lu\n", pd->DelayloadDescriptor->Attributes.AllAttributes); ok(pd->DelayloadDescriptor->DllNameRVA == 0x2000, - "expected 0x2000, got %x\n", pd->DelayloadDescriptor->DllNameRVA); + "expected 0x2000, got %lx\n", pd->DelayloadDescriptor->DllNameRVA); ok(pd->DelayloadDescriptor->ModuleHandleRVA == 0x201a, - "expected 0x201a, got %x\n", pd->DelayloadDescriptor->ModuleHandleRVA); + "expected 0x201a, got %lx\n", pd->DelayloadDescriptor->ModuleHandleRVA); ok(pd->DelayloadDescriptor->ImportAddressTableRVA > pd->DelayloadDescriptor->ModuleHandleRVA, - "expected %x > %x\n", pd->DelayloadDescriptor->ImportAddressTableRVA, + "expected %lx > %lx\n", pd->DelayloadDescriptor->ImportAddressTableRVA, pd->DelayloadDescriptor->ModuleHandleRVA); ok(pd->DelayloadDescriptor->ImportNameTableRVA > pd->DelayloadDescriptor->ImportAddressTableRVA, - "expected %x > %x\n", pd->DelayloadDescriptor->ImportNameTableRVA, + "expected %lx > %lx\n", pd->DelayloadDescriptor->ImportNameTableRVA, pd->DelayloadDescriptor->ImportAddressTableRVA); ok(pd->DelayloadDescriptor->BoundImportAddressTableRVA == 0, - "expected 0, got %x\n", pd->DelayloadDescriptor->BoundImportAddressTableRVA); + "expected 0, got %lx\n", pd->DelayloadDescriptor->BoundImportAddressTableRVA); ok(pd->DelayloadDescriptor->UnloadInformationTableRVA == 0, - "expected 0, got %x\n", pd->DelayloadDescriptor->UnloadInformationTableRVA); + "expected 0, got %lx\n", pd->DelayloadDescriptor->UnloadInformationTableRVA); ok(pd->DelayloadDescriptor->TimeDateStamp == 0, - "expected 0, got %x\n", pd->DelayloadDescriptor->TimeDateStamp); + "expected 0, got %lx\n", pd->DelayloadDescriptor->TimeDateStamp); }
ok(!!pd->ThunkAddress, "no ThunkAddress supplied\n"); @@ -3595,10 +3595,10 @@ static PVOID WINAPI failuredllhook(ULONG ul, DELAYLOAD_INFO* pd) "expected "secur32.dll", got "%s"\n", pd->TargetDllName);
ok(pd->TargetApiDescriptor.ImportDescribedByName == 0, - "expected 0, got %x\n", pd->TargetApiDescriptor.ImportDescribedByName); + "expected 0, got %lx\n", pd->TargetApiDescriptor.ImportDescribedByName); ok(pd->TargetApiDescriptor.Description.Ordinal == 0 || pd->TargetApiDescriptor.Description.Ordinal == 999, - "expected 0, got %x\n", pd->TargetApiDescriptor.Description.Ordinal); + "expected 0, got %lx\n", pd->TargetApiDescriptor.Description.Ordinal);
ok(!!pd->TargetModuleBase, "no TargetModuleBase supplied\n"); ok(pd->Unused == NULL, "expected NULL, got %p\n", pd->Unused); @@ -3666,13 +3666,13 @@ static void test_ResolveDelayLoadedAPI(void) SetLastError(0xdeadbeef); ok(!pResolveDelayLoadedAPI(NULL, NULL, NULL, NULL, NULL, 0), "ResolveDelayLoadedAPI succeeded\n"); - ok(GetLastError() == 0xdeadbeef, "GetLastError changed to %x\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError changed to %lx\n", GetLastError());
cb_count = 0; SetLastError(0xdeadbeef); ok(!pResolveDelayLoadedAPI(NULL, NULL, failuredllhook, NULL, NULL, 0), "ResolveDelayLoadedAPI succeeded\n"); - ok(GetLastError() == 0xdeadbeef, "GetLastError changed to %x\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "GetLastError changed to %lx\n", GetLastError()); ok(cb_count == 1, "Wrong callback count: %d\n", cb_count); }
@@ -3688,7 +3688,7 @@ static void test_ResolveDelayLoadedAPI(void)
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &dos_header, sizeof(dos_header), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
nt_header = nt_header_template; nt_header.FileHeader.NumberOfSections = 2; @@ -3704,11 +3704,11 @@ static void test_ResolveDelayLoadedAPI(void)
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &nt_header.OptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
/* sections */ section.PointerToRawData = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress; @@ -3718,7 +3718,7 @@ static void test_ResolveDelayLoadedAPI(void) section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ; SetLastError(0xdeadbeef); ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
section.PointerToRawData = 0x2000; section.VirtualAddress = 0x2000; @@ -3730,7 +3730,7 @@ static void test_ResolveDelayLoadedAPI(void) section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE; SetLastError(0xdeadbeef); ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
/* fill up to delay data */ SetFilePointer( hfile, nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress, NULL, SEEK_SET ); @@ -3747,11 +3747,11 @@ static void test_ResolveDelayLoadedAPI(void)
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &idd, sizeof(idd), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, filler, sizeof(idd), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
/* fill up to extended delay data */ SetFilePointer( hfile, idd.DllNameRVA, NULL, SEEK_SET ); @@ -3759,15 +3759,15 @@ static void test_ResolveDelayLoadedAPI(void) /* extended delay data */ SetLastError(0xdeadbeef); ret = WriteFile(hfile, test_dll, sizeof(test_dll), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, &hint, sizeof(hint), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, test_func, sizeof(test_func), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
SetFilePointer( hfile, idd.ImportAddressTableRVA, NULL, SEEK_SET );
@@ -3777,13 +3777,13 @@ static void test_ResolveDelayLoadedAPI(void) itd32.u1.Function = nt_header.OptionalHeader.ImageBase + 0x1a00 + i * 0x20; SetLastError(0xdeadbeef); ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); }
itd32.u1.Function = 0; SetLastError(0xdeadbeef); ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(td); i++) { @@ -3793,13 +3793,13 @@ static void test_ResolveDelayLoadedAPI(void) itd32.u1.Ordinal = td[i].ordinal; SetLastError(0xdeadbeef); ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError()); }
itd32.u1.Ordinal = 0; SetLastError(0xdeadbeef); ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + ok(ret, "WriteFile error %ld\n", GetLastError());
/* fill up to eof */ SetFilePointer( hfile, section.VirtualAddress + section.Misc.VirtualSize, NULL, SEEK_SET ); @@ -3808,7 +3808,7 @@ static void test_ResolveDelayLoadedAPI(void)
SetLastError(0xdeadbeef); hlib = LoadLibraryA(dll_name); - ok(hlib != NULL, "LoadLibrary error %u\n", GetLastError()); + ok(hlib != NULL, "LoadLibrary error %lu\n", GetLastError()); if (!hlib) { skip("couldn't load %s.\n", dll_name); @@ -3855,18 +3855,18 @@ static void test_ResolveDelayLoadedAPI(void) ret = pResolveDelayLoadedAPI(hlib, delaydir, NULL, failuresyshook, &itda[i], 0); if (td[i].succeeds) { - ok(ret != NULL, "Test %u: ResolveDelayLoadedAPI failed\n", i); - ok(ret == load, "Test %u: expected %p, got %p\n", i, load, ret); - ok(ret == (void*)itda[i].u1.AddressOfData, "Test %u: expected %p, got %p\n", + ok(ret != NULL, "Test %lu: ResolveDelayLoadedAPI failed\n", i); + ok(ret == load, "Test %lu: expected %p, got %p\n", i, load, ret); + ok(ret == (void*)itda[i].u1.AddressOfData, "Test %lu: expected %p, got %p\n", i, ret, (void*)itda[i].u1.AddressOfData); - ok(!cb_count, "Test %u: Wrong callback count: %d\n", i, cb_count); - ok(!cb_count_sys, "Test %u: Wrong sys callback count: %d\n", i, cb_count_sys); + ok(!cb_count, "Test %lu: Wrong callback count: %d\n", i, cb_count); + ok(!cb_count_sys, "Test %lu: Wrong sys callback count: %d\n", i, cb_count_sys); } else { - ok(ret == (void*)0x12345678, "Test %u: ResolveDelayLoadedAPI succeeded with %p\n", i, ret); - ok(!cb_count, "Test %u: Wrong callback count: %d\n", i, cb_count); - ok(cb_count_sys == 1, "Test %u: Wrong sys callback count: %d\n", i, cb_count_sys); + ok(ret == (void*)0x12345678, "Test %lu: ResolveDelayLoadedAPI succeeded with %p\n", i, ret); + ok(!cb_count, "Test %lu: Wrong callback count: %d\n", i, cb_count); + ok(cb_count_sys == 1, "Test %lu: Wrong sys callback count: %d\n", i, cb_count_sys); }
/* test with failure dll callback */ @@ -3874,28 +3874,28 @@ static void test_ResolveDelayLoadedAPI(void) ret = pResolveDelayLoadedAPI(hlib, delaydir, failuredllhook, failuresyshook, &itda[i], 0); if (td[i].succeeds) { - ok(ret != NULL, "Test %u: ResolveDelayLoadedAPI failed\n", i); - ok(ret == load, "Test %u: expected %p, got %p\n", i, load, ret); - ok(ret == (void*)itda[i].u1.AddressOfData, "Test %u: expected %p, got %p\n", + ok(ret != NULL, "Test %lu: ResolveDelayLoadedAPI failed\n", i); + ok(ret == load, "Test %lu: expected %p, got %p\n", i, load, ret); + ok(ret == (void*)itda[i].u1.AddressOfData, "Test %lu: expected %p, got %p\n", i, ret, (void*)itda[i].u1.AddressOfData); - ok(!cb_count, "Test %u: Wrong callback count: %d\n", i, cb_count); - ok(!cb_count_sys, "Test %u: Wrong sys callback count: %d\n", i, cb_count_sys); + ok(!cb_count, "Test %lu: Wrong callback count: %d\n", i, cb_count); + ok(!cb_count_sys, "Test %lu: Wrong sys callback count: %d\n", i, cb_count_sys); } else { if (ret == (void*)0x12345678) { /* Win10+ sometimes buffers the address of the stub function */ - ok(!cb_count, "Test %u: Wrong callback count: %d\n", i, cb_count); - ok(!cb_count_sys, "Test %u: Wrong sys callback count: %d\n", i, cb_count_sys); + ok(!cb_count, "Test %lu: Wrong callback count: %d\n", i, cb_count); + ok(!cb_count_sys, "Test %lu: Wrong sys callback count: %d\n", i, cb_count_sys); } else if (ret == (void*)0xdeadbeef) { - ok(cb_count == 1, "Test %u: Wrong callback count: %d\n", i, cb_count); - ok(!cb_count_sys, "Test %u: Wrong sys callback count: %d\n", i, cb_count_sys); + ok(cb_count == 1, "Test %lu: Wrong callback count: %d\n", i, cb_count); + ok(!cb_count_sys, "Test %lu: Wrong sys callback count: %d\n", i, cb_count_sys); } else - ok(0, "Test %u: ResolveDelayLoadedAPI succeeded with %p\n", i, ret); + ok(0, "Test %lu: ResolveDelayLoadedAPI succeeded with %p\n", i, ret); } } delaydir++; @@ -3983,26 +3983,26 @@ static void test_dll_file( const char *name )
GetModuleFileNameA( module, path, MAX_PATH ); file = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "can't open '%s': %u\n", path, GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "can't open '%s': %lu\n", path, GetLastError() );
mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 0, NULL ); - ok( mapping != NULL, "%s: CreateFileMappingW failed err %u\n", name, GetLastError() ); + ok( mapping != NULL, "%s: CreateFileMappingW failed err %lu\n", name, GetLastError() ); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); - ok( ptr != NULL, "%s: MapViewOfFile failed err %u\n", name, GetLastError() ); + ok( ptr != NULL, "%s: MapViewOfFile failed err %lu\n", name, GetLastError() ); CloseHandle( mapping ); CloseHandle( file );
nt = pRtlImageNtHeader( module ); nt_file = pRtlImageNtHeader( ptr ); ok( nt_file != NULL, "%s: invalid header\n", path ); -#define OK_FIELD(x) ok( nt->x == nt_file->x, "%s:%u: wrong " #x " %x / %x\n", name, i, nt->x, nt_file->x ) - OK_FIELD( FileHeader.NumberOfSections ); - OK_FIELD( OptionalHeader.AddressOfEntryPoint ); - OK_FIELD( OptionalHeader.NumberOfRvaAndSizes ); +#define OK_FIELD(x, f) ok( nt->x == nt_file->x, "%s:%u: wrong " #x " " f " / " f "\n", name, i, nt->x, nt_file->x ) + OK_FIELD( FileHeader.NumberOfSections, "%x" ); + OK_FIELD( OptionalHeader.AddressOfEntryPoint, "%lx" ); + OK_FIELD( OptionalHeader.NumberOfRvaAndSizes, "%lx" ); for (i = 0; i < nt->OptionalHeader.NumberOfRvaAndSizes; i++) { - OK_FIELD( OptionalHeader.DataDirectory[i].VirtualAddress ); - OK_FIELD( OptionalHeader.DataDirectory[i].Size ); + OK_FIELD( OptionalHeader.DataDirectory[i].VirtualAddress, "%lx" ); + OK_FIELD( OptionalHeader.DataDirectory[i].Size, "%lx" ); } sec = (IMAGE_SECTION_HEADER *)((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader); sec_file = (IMAGE_SECTION_HEADER *)((char *)&nt_file->OptionalHeader + nt_file->FileHeader.SizeOfOptionalHeader); @@ -4024,7 +4024,7 @@ static void test_LoadPackagedLibrary(void)
SetLastError( 0xdeadbeef ); h = pLoadPackagedLibrary(L"kernel32.dll", 0); - ok(!h && GetLastError() == APPMODEL_ERROR_NO_PACKAGE, "Got unexpected handle %p, GetLastError() %u.\n", + ok(!h && GetLastError() == APPMODEL_ERROR_NO_PACKAGE, "Got unexpected handle %p, GetLastError() %lu.\n", h, GetLastError()); }
@@ -4049,7 +4049,7 @@ static void test_Wow64Transition(void)
status = NtQueryVirtualMemory(GetCurrentProcess(), *pWow64Transition, MemoryMappedFilenameInformation, name, sizeof(buffer), NULL); - ok(!status, "got %#x\n", status); + ok(!status, "got %#lx\n", status); filepart = name->SectionFileName.Buffer + name->SectionFileName.Length / sizeof(WCHAR); while (*filepart != '\') --filepart; ok(!wcsnicmp(filepart, L"\wow64cpu.dll", wcslen(L"\wow64cpu.dll")), "got file name %s\n", diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 8f48b89334c..ee9aad33312 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -165,20 +165,20 @@ static void expect_str_(int line, int ret, const char *str, const char *expected { if (ret) { - ok_(__FILE__, line)(GetLastError() == 0xdeadbeef, "unexpected gle %u\n", GetLastError()); - ok_(__FILE__, line)(ret == strlen(expected) + 1, "Expected ret %d, got %d\n", strlen(expected) + 1, ret); + ok_(__FILE__, line)(GetLastError() == 0xdeadbeef, "unexpected gle %lu\n", GetLastError()); + ok_(__FILE__, line)(ret == strlen(expected) + 1, "Expected ret %Id, got %d\n", strlen(expected) + 1, ret); if (str) ok_(__FILE__, line)(strcmp(str, expected) == 0, "Expected '%s', got '%s'\n", expected, str); } else - ok_(__FILE__, line)(0, "expected success, got error %d\n", GetLastError()); + ok_(__FILE__, line)(0, "expected success, got error %ld\n", GetLastError()); }
#define expect_err(r,s,e) expect_err_(__LINE__, r, s, e, #e) static void expect_err_(int line, int ret, const char *str, DWORD err, const char* err_name) { ok_(__FILE__, line)(!ret && GetLastError() == err, - "Expected %s, got %d and ret=%d\n", err_name, GetLastError(), ret); + "Expected %s, got %ld and ret=%d\n", err_name, GetLastError(), ret); if (str) ok_(__FILE__, line)(strcmp(str, "pristine") == 0, "Expected a pristine buffer, got '%s'\n", str); } @@ -188,20 +188,20 @@ static void expect_wstr_(int line, int ret, const WCHAR *str, const WCHAR *expec { if (ret) { - ok_(__FILE__, line)(GetLastError() == 0xdeadbeef, "unexpected gle %u\n", GetLastError()); - ok_(__FILE__, line)(ret == wcslen(expected) + 1, "Expected ret %d, got %d\n", wcslen(expected) + 1, ret); + ok_(__FILE__, line)(GetLastError() == 0xdeadbeef, "unexpected gle %lu\n", GetLastError()); + ok_(__FILE__, line)(ret == wcslen(expected) + 1, "Expected ret %Id, got %d\n", wcslen(expected) + 1, ret); if (str) ok_(__FILE__, line)(wcscmp(str, expected) == 0, "Expected %s, got %s\n", wine_dbgstr_w(expected), wine_dbgstr_w(str)); } else - ok_(__FILE__, line)(0, "expected success, got error %d\n", GetLastError()); + ok_(__FILE__, line)(0, "expected success, got error %ld\n", GetLastError()); }
#define expect_werr(r,s,e) expect_werr_(__LINE__, r, s, e, #e) static void expect_werr_(int line, int ret, const WCHAR *str, DWORD err, const char* err_name) { ok_(__FILE__, line)(!ret && GetLastError() == err, - "Expected %s, got %d and ret=%d\n", err_name, GetLastError(), ret); + "Expected %s, got %ld and ret=%d\n", err_name, GetLastError(), ret); if (str) ok_(__FILE__, line)(wcscmp(str, L"pristine") == 0, "Expected a pristine buffer, got %s\n", wine_dbgstr_w(str)); } @@ -217,11 +217,11 @@ static void test_GetLocaleInfoA(void) char expected[BUFFER_SIZE]; DWORD val;
- ok(lcid == 0x409, "wrong LCID calculated - %d\n", lcid); + ok(lcid == 0x409, "wrong LCID calculated - %ld\n", lcid);
ret = GetLocaleInfoA(lcid, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (char*)&val, sizeof(val)); ok(ret, "got %d\n", ret); - ok(val == lcid, "got 0x%08x\n", val); + ok(val == lcid, "got 0x%08lx\n", val);
/* en and ar use SUBLANG_NEUTRAL, but GetLocaleInfo assume SUBLANG_DEFAULT Same is true for zh on pre-Vista, but on Vista and higher GetLocaleInfo @@ -271,13 +271,13 @@ static void test_GetLocaleInfoA(void) memset(buffer, 0, ARRAY_SIZE(buffer)); ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 3); ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + "Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); ok(!strcmp(buffer, "Mon"), "Expected 'Mon', got '%s'\n", buffer);
SetLastError(0xdeadbeef); memset(buffer, 0, ARRAY_SIZE(buffer)); ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 10); - ok(ret == 7, "Expected ret == 7, got %d, error %d\n", ret, GetLastError()); + ok(ret == 7, "Expected ret == 7, got %d, error %ld\n", ret, GetLastError()); ok(!strcmp(buffer, "Monday"), "Expected 'Monday', got '%s'\n", buffer); }
@@ -341,8 +341,8 @@ static void test_GetLocaleInfoW(void) }
ret = GetLocaleInfoW(lcid_en, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); - ok(ret, "got %d\n", ret); - ok(val == lcid_en, "got 0x%08x\n", val); + ok(ret, "got %ld\n", ret); + ok(val == lcid_en, "got 0x%08lx\n", val);
ret = GetLocaleInfoW(lcid_en_neut, LOCALE_SNAME, bufferW, ARRAY_SIZE(bufferW)); if (ret) @@ -356,7 +356,7 @@ static void test_GetLocaleInfoW(void) ok(!lstrcmpW(bufferW, enW), "got wrong name %s\n", wine_dbgstr_w(bufferW));
ret = GetLocaleInfoW(lcid_en_neut, LOCALE_SCOUNTRY, bufferW, ARRAY_SIZE(bufferW)); - ok(ret, "got %d\n", ret); + ok(ret, "got %ld\n", ret); if ((PRIMARYLANGID(LANGIDFROMLCID(GetSystemDefaultLCID())) != LANG_ENGLISH) || (PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())) != LANG_ENGLISH)) { @@ -366,7 +366,7 @@ static void test_GetLocaleInfoW(void) ok(!lstrcmpW(statesW, bufferW), "got wrong name %s\n", wine_dbgstr_w(bufferW));
ret = GetLocaleInfoW(lcid_en_neut, LOCALE_SLANGUAGE, bufferW, ARRAY_SIZE(bufferW)); - ok(ret, "got %d\n", ret); + ok(ret, "got %ld\n", ret); if ((PRIMARYLANGID(LANGIDFROMLCID(GetSystemDefaultLCID())) != LANG_ENGLISH) || (PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())) != LANG_ENGLISH)) { @@ -386,7 +386,7 @@ static void test_GetLocaleInfoW(void)
val = 0; GetLocaleInfoW(lcid, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); - ok(val == ptr->lcid || (val && broken(val == ptr->lcid_broken)), "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + ok(val == ptr->lcid || (val && broken(val == ptr->lcid_broken)), "%s: got wrong lcid 0x%04lx, expected 0x%04lx\n", wine_dbgstr_w(ptr->name), val, ptr->lcid);
/* now check LOCALE_SNAME */ @@ -420,16 +420,16 @@ static void test_GetLocaleInfoW(void) ok(ret == 0, "LOCALE_RETURN_GENITIVE_NAMES should fail with GetLocaleInfoA\n"); ok(bufferA[0] == 'a', "Expected buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_FLAGS, - "Expected ERROR_INVALID_FLAGS, got %x\n", GetLastError()); + "Expected ERROR_INVALID_FLAGS, got %lx\n", GetLastError());
bufferW[0] = 'a'; SetLastError(0xdeadbeef); ret = GetLocaleInfoW(lcid_ru, LOCALE_RETURN_GENITIVE_NAMES, bufferW, ARRAY_SIZE(bufferW)); ok(ret == 0, - "LOCALE_RETURN_GENITIVE_NAMES itself doesn't return anything, got %d\n", ret); + "LOCALE_RETURN_GENITIVE_NAMES itself doesn't return anything, got %ld\n", ret); ok(bufferW[0] == 'a', "Expected buffer to be untouched\n"); ok(GetLastError() == ERROR_INVALID_FLAGS, - "Expected ERROR_INVALID_FLAGS, got %x\n", GetLastError()); + "Expected ERROR_INVALID_FLAGS, got %lx\n", GetLastError());
/* yes, test empty 13 month entry too */ for (i = 0; i < 12; i++) { @@ -437,12 +437,12 @@ static void test_GetLocaleInfoW(void) ret = GetLocaleInfoW(lcid_ru, (LOCALE_SMONTHNAME1+i)|LOCALE_RETURN_GENITIVE_NAMES, bufferW, ARRAY_SIZE(bufferW)); ok(ret, "Expected non zero result\n"); - ok(ret == lstrlenW(bufferW)+1, "Expected actual length, got %d, length %d\n", + ok(ret == lstrlenW(bufferW)+1, "Expected actual length, got %ld, length %d\n", ret, lstrlenW(bufferW)); buffer2W[0] = 0; ret = GetLocaleInfoW(lcid_ru, LOCALE_SMONTHNAME1+i, buffer2W, ARRAY_SIZE(buffer2W)); ok(ret, "Expected non zero result\n"); - ok(ret == lstrlenW(buffer2W)+1, "Expected actual length, got %d, length %d\n", + ok(ret == lstrlenW(buffer2W)+1, "Expected actual length, got %ld, length %d\n", ret, lstrlenW(buffer2W));
ok(lstrcmpW(bufferW, buffer2W) != 0, @@ -453,12 +453,12 @@ static void test_GetLocaleInfoW(void) ret = GetLocaleInfoW(lcid_en, (LOCALE_SMONTHNAME1+i)|LOCALE_RETURN_GENITIVE_NAMES, bufferW, ARRAY_SIZE(bufferW)); ok(ret, "Expected non zero result\n"); - ok(ret == lstrlenW(bufferW)+1, "Expected actual length, got %d, length %d\n", + ok(ret == lstrlenW(bufferW)+1, "Expected actual length, got %ld, length %d\n", ret, lstrlenW(bufferW)); buffer2W[0] = 0; ret = GetLocaleInfoW(lcid_en, LOCALE_SMONTHNAME1+i, buffer2W, ARRAY_SIZE(buffer2W)); ok(ret, "Expected non zero result\n"); - ok(ret == lstrlenW(buffer2W)+1, "Expected actual length, got %d, length %d\n", + ok(ret == lstrlenW(buffer2W)+1, "Expected actual length, got %ld, length %d\n", ret, lstrlenW(buffer2W));
ok(lstrcmpW(bufferW, buffer2W) == 0, @@ -885,7 +885,7 @@ static void test_GetDateFormatA(void)
/* DATE_LONGDATE */ ret = GetDateFormatA(lcid, NUO|DATE_LONGDATE, &curtime, NULL, buffer, ARRAY_SIZE(buffer)); - ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok(ret, "Expected ret != 0, got %d, error %ld\n", ret, GetLastError()); ok(strcmp(buffer, "Saturday, May 04, 2002") == 0 || strcmp(buffer, "Saturday, May 4, 2002") == 0 /* Win 8 */, "got an unexpected date string '%s'\n", buffer); @@ -913,12 +913,12 @@ static void test_GetDateFormatA(void) /* month part should be in genitive form */ strcpy(genitive_month, buffer + 2); ret = GetDateFormatA(lcid_ru, 0, &curtime, "MMMM", buffer, ARRAY_SIZE(buffer)); - ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok(ret, "Expected ret != 0, got %d, error %ld\n", ret, GetLastError()); strcpy(month, buffer); ok(strcmp(genitive_month, month) != 0, "Expected different month forms\n");
ret = GetDateFormatA(lcid_ru, 0, &curtime, "ddd", buffer, ARRAY_SIZE(buffer)); - ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok(ret, "Expected ret != 0, got %d, error %ld\n", ret, GetLastError()); strcpy(short_day, buffer);
ret = GetDateFormatA(lcid_ru, 0, &curtime, "dd MMMMddd dd", buffer, ARRAY_SIZE(buffer)); @@ -1724,7 +1724,7 @@ static void test_CompareStringA(void) ret = CompareStringA(entry->lcid, entry->flags, entry->first, entry->first_len, entry->second, entry->second_len); ok(ret == entry->ret, "%d: got %d, expected %d\n", i, ret, entry->ret); - ok(GetLastError() == (ret ? 0xdeadbeef : entry->le), "%d: got last error %d, expected %d\n", + ok(GetLastError() == (ret ? 0xdeadbeef : entry->le), "%d: got last error %ld, expected %ld\n", i, GetLastError(), (ret ? 0xdeadbeef : entry->le)); }
@@ -1846,7 +1846,7 @@ static void test_CompareStringA(void) SetLastError(0xdeadbeef); ret = CompareStringA(lcid, 0, a, sizeof(a), a, sizeof(a)); ok (GetLastError() == 0xdeadbeef && ret == CSTR_EQUAL, - "ret %d, error %d, expected value %d\n", ret, GetLastError(), CSTR_EQUAL); + "ret %d, error %ld, expected value %d\n", ret, GetLastError(), CSTR_EQUAL);
ret = CompareStringA(CP_ACP, 0, ABC_EE, 3, ABC_FF, 3); ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); @@ -1876,11 +1876,11 @@ static void test_CompareStringW(void)
GetSystemInfo(&si); buf = VirtualAlloc(NULL, si.dwPageSize * 4, MEM_COMMIT, PAGE_READWRITE); - ok(buf != NULL, "VirtualAlloc failed with %u\n", GetLastError()); + ok(buf != NULL, "VirtualAlloc failed with %lu\n", GetLastError()); success = VirtualProtect(buf + si.dwPageSize, si.dwPageSize, PAGE_NOACCESS, &old_prot); - ok(success, "VirtualProtect failed with %u\n", GetLastError()); + ok(success, "VirtualProtect failed with %lu\n", GetLastError()); success = VirtualProtect(buf + 3 * si.dwPageSize, si.dwPageSize, PAGE_NOACCESS, &old_prot); - ok(success, "VirtualProtect failed with %u\n", GetLastError()); + ok(success, "VirtualProtect failed with %lu\n", GetLastError());
str1 = (WCHAR *)(buf + si.dwPageSize - sizeof(WCHAR)); str2 = (WCHAR *)(buf + 3 * si.dwPageSize - sizeof(WCHAR)); @@ -1892,12 +1892,12 @@ static void test_CompareStringW(void) ok(ret == CSTR_LESS_THAN, "expected CSTR_LESS_THAN, got %d\n", ret);
success = VirtualFree(buf, 0, MEM_RELEASE); - ok(success, "VirtualFree failed with %u\n", GetLastError()); + ok(success, "VirtualFree failed with %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = CompareStringW(CP_ACP, SORT_DIGITSASNUMBERS, L"NULL", -1, L"NULL", -1); ok(ret == CSTR_EQUAL || broken(!ret && GetLastError() == ERROR_INVALID_FLAGS) /* <Win7 */, - "expected CSTR_EQUAL, got %d, last error %d\n", ret, GetLastError()); + "expected CSTR_EQUAL, got %d, last error %ld\n", ret, GetLastError());
ret = CompareStringW(CP_ACP, 0, ABC_EE, 3, ABC_FF, 3); ok(ret == CSTR_EQUAL, "expected CSTR_EQUAL, got %d\n", ret); @@ -2169,7 +2169,7 @@ static void test_LCMapStringA(void) ret = LCMapStringA(LOCALE_USER_DEFAULT, LOCALE_USE_CP_ACP | LCMAP_LOWERCASE, lower_case, -1, buf, sizeof(buf)); ok(ret == lstrlenA(lower_case) + 1, - "ret %d, error %d, expected value %d\n", + "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenA(lower_case) + 1); ok(!memcmp(buf, lower_case, ret), "LCMapStringA should return %s, but not %s\n", lower_case, buf);
@@ -2177,7 +2177,7 @@ static void test_LCMapStringA(void) upper_case, -1, buf, sizeof(buf)); ok(!ret, "LCMAP_LOWERCASE and LCMAP_UPPERCASE are mutually exclusive\n"); ok(GetLastError() == ERROR_INVALID_FLAGS, - "unexpected error code %d\n", GetLastError()); + "unexpected error code %ld\n", GetLastError());
/* test invalid flag combinations */ for (i = 0; i < ARRAY_SIZE(lcmap_invalid_flags); i++) { @@ -2186,9 +2186,9 @@ static void test_LCMapStringA(void) ret = LCMapStringA(LOCALE_USER_DEFAULT, lcmap_invalid_flags[i], lower_case, -1, buf, sizeof(buf)); ok(GetLastError() == ERROR_INVALID_FLAGS, - "LCMapStringA (flag %08x) unexpected error code %d\n", + "LCMapStringA (flag %08lx) unexpected error code %ld\n", lcmap_invalid_flags[i], GetLastError()); - ok(!ret, "LCMapStringA (flag %08x) should return 0, got %d\n", + ok(!ret, "LCMapStringA (flag %08lx) should return 0, got %d\n", lcmap_invalid_flags[i], ret); }
@@ -2196,7 +2196,7 @@ static void test_LCMapStringA(void) ret = LCMapStringA(LOCALE_USER_DEFAULT, LCMAP_LOWERCASE, upper_case, -1, buf, sizeof(buf)); ok(ret == lstrlenA(upper_case) + 1, - "ret %d, error %d, expected value %d\n", + "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenA(upper_case) + 1); ok(!lstrcmpA(buf, lower_case), "LCMapStringA should return %s, but not %s\n", lower_case, buf);
@@ -2204,7 +2204,7 @@ static void test_LCMapStringA(void) ret = LCMapStringA(LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, lower_case, -1, buf, sizeof(buf)); ok(ret == lstrlenA(lower_case) + 1, - "ret %d, error %d, expected value %d\n", + "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenA(lower_case) + 1); ok(!lstrcmpA(buf, upper_case), "LCMapStringA should return %s, but not %s\n", upper_case, buf);
@@ -2224,7 +2224,7 @@ static void test_LCMapStringA(void) else { ok(ret == lstrlenA(lower_case) + 1, - "ret %d, error %d, expected value %d\n", + "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenA(lower_case) + 1); ok(!lstrcmpA(buf, upper_case), "LCMapStringA should return %s, but not %s\n", upper_case, buf); } @@ -2236,7 +2236,7 @@ static void test_LCMapStringA(void) else { ok(ret == lstrlenA(upper_case) + 1, - "ret %d, error %d, expected value %d\n", + "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenA(lower_case) + 1); ok(!lstrcmpA(buf, lower_case), "LCMapStringA should return %s, but not %s\n", lower_case, buf); } @@ -2247,7 +2247,7 @@ static void test_LCMapStringA(void) buf, 10, buf, sizeof(buf)); ok(GetLastError() == ERROR_INVALID_FLAGS /* NT */ || GetLastError() == ERROR_INVALID_PARAMETER /* Win9x */, - "unexpected error code %d\n", GetLastError()); + "unexpected error code %ld\n", GetLastError()); ok(!ret, "src == dst without LCMAP_UPPERCASE or LCMAP_LOWERCASE must fail\n");
/* test whether '\0' is always appended */ @@ -2321,7 +2321,7 @@ static void test_LCMapStringA(void) ret = LCMapStringA(LOCALE_USER_DEFAULT, 0, upper_case, 0, buf, sizeof(buf)); ok(!ret, "LCMapStringA should fail with srclen = 0\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "unexpected error code %d\n", GetLastError()); + "unexpected error code %ld\n", GetLastError()); }
typedef INT (*lcmapstring_wrapper)(DWORD, LPCWSTR, INT, LPWSTR, INT); @@ -2360,7 +2360,7 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f /* LCMAP_LOWERCASE | LCMAP_UPPERCASE makes LCMAP_TITLECASE, so it's valid now. */ ret = func_ptr(LCMAP_LOWERCASE | LCMAP_UPPERCASE, lower_case, -1, buf, ARRAY_SIZE(buf)); todo_wine ok(ret == lstrlenW(title_case) + 1 || broken(!ret), - "%s ret %d, error %d, expected value %d\n", func_name, + "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(title_case) + 1); todo_wine ok(lstrcmpW(buf, title_case) == 0 || broken(!ret), "Expected title case string\n"); @@ -2372,33 +2372,33 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f ret = func_ptr(lcmap_invalid_flags[i], lower_case, -1, buf, sizeof(buf)); ok(GetLastError() == ERROR_INVALID_FLAGS, - "%s (flag %08x) unexpected error code %d\n", + "%s (flag %08lx) unexpected error code %ld\n", func_name, lcmap_invalid_flags[i], GetLastError()); - ok(!ret, "%s (flag %08x) should return 0, got %d\n", + ok(!ret, "%s (flag %08lx) should return 0, got %d\n", func_name, lcmap_invalid_flags[i], ret); }
/* test LCMAP_LOWERCASE */ ret = func_ptr(LCMAP_LOWERCASE, upper_case, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(upper_case) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(upper_case) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(upper_case) + 1); ok(!lstrcmpW(buf, lower_case), "%s string compare mismatch\n", func_name);
/* test LCMAP_UPPERCASE */ ret = func_ptr(LCMAP_UPPERCASE, lower_case, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(lower_case) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(lower_case) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(lower_case) + 1); ok(!lstrcmpW(buf, upper_case), "%s string compare mismatch\n", func_name);
/* test LCMAP_HIRAGANA */ ret = func_ptr(LCMAP_HIRAGANA, japanese_text, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(hiragana_text) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(hiragana_text) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(hiragana_text) + 1); ok(!lstrcmpW(buf, hiragana_text), "%s string compare mismatch\n", func_name);
buf[0] = 0x30f5; /* KATAKANA LETTER SMALL KA */ ret = func_ptr(LCMAP_HIRAGANA, buf, 1, buf2, 1); - ok(ret == 1, "%s ret %d, error %d, expected value 1\n", func_name, + ok(ret == 1, "%s ret %d, error %ld, expected value 1\n", func_name, ret, GetLastError()); /* U+3095: HIRAGANA LETTER SMALL KA was added in Unicode 3.2 */ ok(buf2[0] == 0x3095 || broken(buf2[0] == 0x30f5 /* Vista and earlier versions */), @@ -2406,13 +2406,13 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f
/* test LCMAP_KATAKANA | LCMAP_LOWERCASE */ ret = func_ptr(LCMAP_KATAKANA | LCMAP_LOWERCASE, japanese_text, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(katakana_text) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(katakana_text) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(katakana_text) + 1); ok(!lstrcmpW(buf, katakana_text), "%s string compare mismatch\n", func_name);
/* test LCMAP_FULLWIDTH */ ret = func_ptr(LCMAP_FULLWIDTH, halfwidth_text, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(japanese_text) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(japanese_text) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(japanese_text) + 1); ok(!lstrcmpW(buf, japanese_text), "%s string compare mismatch\n", func_name);
@@ -2422,7 +2422,7 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f /* test LCMAP_FULLWIDTH | LCMAP_HIRAGANA (half-width katakana is converted into full-width hiragana) */ ret = func_ptr(LCMAP_FULLWIDTH | LCMAP_HIRAGANA, halfwidth_text, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(hiragana_text) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(hiragana_text) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(hiragana_text) + 1); ok(!lstrcmpW(buf, hiragana_text), "%s string compare mismatch\n", func_name);
@@ -2431,7 +2431,7 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f
/* test LCMAP_HALFWIDTH */ ret = func_ptr(LCMAP_HALFWIDTH, japanese_text, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(halfwidth_text) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(halfwidth_text) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(halfwidth_text) + 1); ok(!lstrcmpW(buf, halfwidth_text), "%s string compare mismatch\n", func_name);
@@ -2441,7 +2441,7 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f /* test LCMAP_HALFWIDTH | LCMAP_KATAKANA (hiragana character is converted into half-width katakana) */ ret = func_ptr(LCMAP_HALFWIDTH | LCMAP_KATAKANA, japanese_text, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(halfwidth_text2) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(halfwidth_text2) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(halfwidth_text2) + 1); ok(!lstrcmpW(buf, halfwidth_text2), "%s string compare mismatch\n", func_name);
@@ -2487,13 +2487,13 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f /* LCMAP_UPPERCASE or LCMAP_LOWERCASE should accept src == dst */ lstrcpyW(buf, lower_case); ret = func_ptr(LCMAP_UPPERCASE, buf, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(lower_case) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(lower_case) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(lower_case) + 1); ok(!lstrcmpW(buf, upper_case), "%s string compare mismatch\n", func_name);
lstrcpyW(buf, upper_case); ret = func_ptr(LCMAP_LOWERCASE, buf, -1, buf, ARRAY_SIZE(buf)); - ok(ret == lstrlenW(upper_case) + 1, "%s ret %d, error %d, expected value %d\n", func_name, + ok(ret == lstrlenW(upper_case) + 1, "%s ret %d, error %ld, expected value %d\n", func_name, ret, GetLastError(), lstrlenW(lower_case) + 1); ok(!lstrcmpW(buf, lower_case), "%s string compare mismatch\n", func_name);
@@ -2503,7 +2503,7 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f buf, 10, buf, sizeof(buf)); ok(GetLastError() == ERROR_INVALID_FLAGS /* NT */ || GetLastError() == ERROR_INVALID_PARAMETER /* Win7+ */, - "%s unexpected error code %d\n", func_name, GetLastError()); + "%s unexpected error code %ld\n", func_name, GetLastError()); ok(!ret, "%s src == dst without LCMAP_UPPERCASE or LCMAP_LOWERCASE must fail\n", func_name);
/* test whether '\0' is always appended */ @@ -2565,7 +2565,7 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f ret = func_ptr(0, upper_case, 0, buf, ARRAY_SIZE(buf)); ok(!ret, "%s func_ptr should fail with srclen = 0\n", func_name); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "%s unexpected error code %d\n", func_name, GetLastError()); + "%s unexpected error code %ld\n", func_name, GetLastError()); }
static INT LCMapStringW_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen) @@ -2584,7 +2584,7 @@ static void test_LCMapStringW(void) ret = LCMapStringW((LCID)-1, LCMAP_LOWERCASE, upper_case, -1, buf, ARRAY_SIZE(buf)); todo_wine { ok(!ret, "LCMapStringW should fail with bad lcid\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "unexpected error code %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "unexpected error code %ld\n", GetLastError()); }
test_lcmapstring_unicode(LCMapStringW_wrapper, "LCMapStringW:"); @@ -2613,19 +2613,19 @@ static void test_LCMapStringEx(void) upper_case, -1, buf, ARRAY_SIZE(buf), NULL, NULL, 0); todo_wine { ok(!ret, "LCMapStringEx should fail with bad locale name\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "unexpected error code %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "unexpected error code %ld\n", GetLastError()); }
/* test reserved parameters */ ret = pLCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_LOWERCASE, upper_case, -1, buf, ARRAY_SIZE(buf), NULL, NULL, 1); - ok(ret == lstrlenW(upper_case) + 1, "ret %d, error %d, expected value %d\n", + ok(ret == lstrlenW(upper_case) + 1, "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenW(upper_case) + 1); ok(!lstrcmpW(buf, lower_case), "string compare mismatch\n");
ret = pLCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_LOWERCASE, upper_case, -1, buf, ARRAY_SIZE(buf), NULL, (void*)1, 0); - ok(ret == lstrlenW(upper_case) + 1, "ret %d, error %d, expected value %d\n", + ok(ret == lstrlenW(upper_case) + 1, "ret %d, error %ld, expected value %d\n", ret, GetLastError(), lstrlenW(upper_case) + 1); ok(!lstrcmpW(buf, lower_case), "string compare mismatch\n");
@@ -2689,51 +2689,51 @@ static void test_LocaleNameToLCID(void) SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(LOCALE_NAME_USER_DEFAULT, 0); ok(lcid == GetUserDefaultLCID() || broken(GetLastError() == ERROR_INVALID_PARAMETER /* Vista */), - "Expected lcid == %08x, got %08x, error %d\n", GetUserDefaultLCID(), lcid, GetLastError()); + "Expected lcid == %08lx, got %08lx, error %ld\n", GetUserDefaultLCID(), lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); - ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); - trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); + ok(ret > 0, "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); + trace("%08lx, %s\n", lcid, wine_dbgstr_w(buffer));
buffer[0] = 0; SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(LOCALE_NAME_SYSTEM_DEFAULT, 0); ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError()); + "Expected lcid == 0, got %08lx, error %ld\n", lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); - ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); - trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); + ok(ret > 0, "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); + trace("%08lx, %s\n", lcid, wine_dbgstr_w(buffer));
buffer[0] = 0; SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(LOCALE_NAME_INVARIANT, 0); - ok(lcid == 0x7F, "Expected lcid = 0x7F, got %08x, error %d\n", lcid, GetLastError()); + ok(lcid == 0x7F, "Expected lcid = 0x7F, got %08lx, error %ld\n", lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); - ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); - trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); + ok(ret > 0, "Expected ret > 0, got %d, error %ld\n", ret, GetLastError()); + trace("%08lx, %s\n", lcid, wine_dbgstr_w(buffer));
/* bad name */ SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(invalidW, 0); ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError()); + "Expected lcid == 0, got %08lx, error %ld\n", lcid, GetLastError());
/* lower-case */ lcid = pLocaleNameToLCID(esesW, 0); - ok(lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT), "Got wrong lcid for es-es: 0x%x\n", lcid); + ok(lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT), "Got wrong lcid for es-es: 0x%lx\n", lcid);
/* english neutral name */ lcid = pLocaleNameToLCID(enW, LOCALE_ALLOW_NEUTRAL_NAMES); ok(lcid == MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL), SORT_DEFAULT) || - broken(lcid == 0) /* Vista */, "got 0x%04x\n", lcid); + broken(lcid == 0) /* Vista */, "got 0x%04lx\n", lcid); lcid = pLocaleNameToLCID(enW, 0); ok(lcid == MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) || - broken(lcid == 0) /* Vista */, "got 0x%04x\n", lcid); + broken(lcid == 0) /* Vista */, "got 0x%04lx\n", lcid); if (lcid) { for (ptr = neutralsublang_names; *ptr->name; ptr++) { lcid = pLocaleNameToLCID(ptr->name, 0); - ok(lcid == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + ok(lcid == ptr->lcid, "%s: got wrong lcid 0x%04lx, expected 0x%04lx\n", wine_dbgstr_w(ptr->name), lcid, ptr->lcid);
*buffer = 0; @@ -2747,7 +2747,7 @@ static void test_LocaleNameToLCID(void) /* zh-Hant has LCID 0x7c04, but LocaleNameToLCID actually returns 0x0c04, which is the LCID of zh-HK */ lcid = pLocaleNameToLCID(zhHantW, 0); ok(lcid == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_HONGKONG), SORT_DEFAULT), - "%s: got wrong lcid 0x%04x\n", wine_dbgstr_w(zhHantW), lcid); + "%s: got wrong lcid 0x%04lx\n", wine_dbgstr_w(zhHantW), lcid); ret = pLCIDToLocaleName(lcid, buffer, ARRAY_SIZE(buffer), 0); ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhHantW), ret); ok(!lstrcmpW(zhhkW, buffer), "%s: got wrong locale name %s\n", @@ -2762,7 +2762,7 @@ static void test_LocaleNameToLCID(void) /* zh-hant */ lcid = pLocaleNameToLCID(zhhantW, 0); ok(lcid == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_HONGKONG), SORT_DEFAULT), - "%s: got wrong lcid 0x%04x\n", wine_dbgstr_w(zhhantW), lcid); + "%s: got wrong lcid 0x%04lx\n", wine_dbgstr_w(zhhantW), lcid); ret = pLCIDToLocaleName(lcid, buffer, ARRAY_SIZE(buffer), 0); ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhhantW), ret); ok(!lstrcmpW(zhhkW, buffer), "%s: got wrong locale name %s\n", @@ -2772,7 +2772,7 @@ static void test_LocaleNameToLCID(void) lcid = pLocaleNameToLCID(zhHansW, 0); /* check that LocaleNameToLCID actually returns 0x0804 */ ok(lcid == MAKELCID(MAKELANGID(LANG_CHINESE_SIMPLIFIED, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT), - "%s: got wrong lcid 0x%04x\n", wine_dbgstr_w(zhHansW), lcid); + "%s: got wrong lcid 0x%04lx\n", wine_dbgstr_w(zhHansW), lcid); ret = pLCIDToLocaleName(lcid, buffer, ARRAY_SIZE(buffer), 0); ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhHansW), ret); ok(!lstrcmpW(zhcnW, buffer), "%s: got wrong locale name %s\n", @@ -2786,7 +2786,7 @@ static void test_LocaleNameToLCID(void) /* zh-hans */ lcid = pLocaleNameToLCID(zhhansW, 0); ok(lcid == MAKELCID(MAKELANGID(LANG_CHINESE_SIMPLIFIED, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT), - "%s: got wrong lcid 0x%04x\n", wine_dbgstr_w(zhhansW), lcid); + "%s: got wrong lcid 0x%04lx\n", wine_dbgstr_w(zhhansW), lcid); ret = pLCIDToLocaleName(lcid, buffer, ARRAY_SIZE(buffer), 0); ok(ret > 0, "%s: got %d\n", wine_dbgstr_w(zhhansW), ret); ok(!lstrcmpW(zhcnW, buffer), "%s: got wrong locale name %s\n", @@ -2796,39 +2796,39 @@ static void test_LocaleNameToLCID(void) if (pRtlLocaleNameToLcid) { status = pRtlLocaleNameToLcid( LOCALE_NAME_USER_DEFAULT, &lcid, 0 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status ); status = pRtlLocaleNameToLcid( LOCALE_NAME_SYSTEM_DEFAULT, &lcid, 0 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status ); status = pRtlLocaleNameToLcid( invalidW, &lcid, 0 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status );
lcid = 0; status = pRtlLocaleNameToLcid( LOCALE_NAME_INVARIANT, &lcid, 0 ); - ok( !status, "failed error %x\n", status ); - ok( lcid == LANG_INVARIANT, "got %08x\n", lcid ); + ok( !status, "failed error %lx\n", status ); + ok( lcid == LANG_INVARIANT, "got %08lx\n", lcid );
lcid = 0; status = pRtlLocaleNameToLcid( localeW, &lcid, 0 ); - ok( !status, "failed error %x\n", status ); - ok( lcid == MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), "got %08x\n", lcid ); + ok( !status, "failed error %lx\n", status ); + ok( lcid == MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), "got %08lx\n", lcid );
lcid = 0; status = pRtlLocaleNameToLcid( esesW, &lcid, 0 ); - ok( !status, "failed error %x\n", status ); - ok( lcid == MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), "got %08x\n", lcid ); + ok( !status, "failed error %lx\n", status ); + ok( lcid == MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), "got %08lx\n", lcid );
lcid = 0; status = pRtlLocaleNameToLcid( enW, &lcid, 0 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status ); status = pRtlLocaleNameToLcid( enW, &lcid, 1 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status ); status = pRtlLocaleNameToLcid( enW, &lcid, 2 ); - ok( !status, "failed error %x\n", status ); - ok( lcid == MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL), "got %08x\n", lcid ); + ok( !status, "failed error %lx\n", status ); + ok( lcid == MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL), "got %08lx\n", lcid ); status = pRtlLocaleNameToLcid( L"en-RR", &lcid, 2 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status ); status = pRtlLocaleNameToLcid( L"en-Latn-RR", &lcid, 2 ); - ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %x\n", status ); + ok( status == STATUS_INVALID_PARAMETER_1, "wrong error %lx\n", status );
for (ptr = neutralsublang_names; *ptr->name; ptr++) { @@ -2843,13 +2843,13 @@ static void test_LocaleNameToLCID(void)
status = pRtlLocaleNameToLcid( ptr->name, &lcid, 2 ); ok( !status || broken(ptr->lcid == MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)), /* vista */ - "%s failed error %x\n", wine_dbgstr_w(ptr->name), status ); - if (!status) ok( lcid == expect, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + "%s failed error %lx\n", wine_dbgstr_w(ptr->name), status ); + if (!status) ok( lcid == expect, "%s: got wrong lcid 0x%04lx, expected 0x%04lx\n", wine_dbgstr_w(ptr->name), lcid, expect ); status = pRtlLocaleNameToLcid( ptr->sname, &lcid, 0 ); ok( !status || broken(ptr->lcid == MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_SERBIA_LATIN)), /* vista */ - "%s failed error %x\n", wine_dbgstr_w(ptr->name), status ); - if (!status) ok( lcid == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", + "%s failed error %lx\n", wine_dbgstr_w(ptr->name), status ); + if (!status) ok( lcid == ptr->lcid, "%s: got wrong lcid 0x%04lx, expected 0x%04lx\n", wine_dbgstr_w(ptr->name), lcid, ptr->lcid ); } } @@ -3087,7 +3087,7 @@ static void test_FoldStringA(void) /* MAP_FOLDDIGITS */ SetLastError(0xdeadbeef); ret = FoldStringA(MAP_FOLDDIGITS, digits_src, -1, dst, 256); - ok(ret == 4, "Expected ret == 4, got %d, error %d\n", ret, GetLastError()); + ok(ret == 4, "Expected ret == 4, got %d, error %ld\n", ret, GetLastError()); ok(strcmp(dst, digits_dst) == 0, "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", digits_dst, dst); for (i = 1; i < 256; i++) @@ -3097,7 +3097,7 @@ static void test_FoldStringA(void) src[0] = i; src[1] = '\0'; ret = FoldStringA(MAP_FOLDDIGITS, src, -1, dst, 256); - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError()); ok(dst[0] == src[0], "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", src, dst); } @@ -3106,7 +3106,7 @@ static void test_FoldStringA(void) /* MAP_EXPAND_LIGATURES */ SetLastError(0xdeadbeef); ret = FoldStringA(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); - ok(ret == sizeof(ligatures_dst), "Got %d, error %d\n", ret, GetLastError()); + ok(ret == sizeof(ligatures_dst), "Got %d, error %ld\n", ret, GetLastError()); ok(strcmp(dst, ligatures_dst) == 0, "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", ligatures_dst, dst); for (i = 1; i < 256; i++) @@ -3125,7 +3125,7 @@ static void test_FoldStringA(void) } else { - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError()); ok(dst[0] == src[0], "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", src, dst); } @@ -3135,9 +3135,9 @@ static void test_FoldStringA(void) /* MAP_COMPOSITE */ SetLastError(0xdeadbeef); ret = FoldStringA(MAP_COMPOSITE, composite_src, -1, dst, 256); - ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok(ret, "Expected ret != 0, got %d, error %ld\n", ret, GetLastError()); ok( GetLastError() == 0xdeadbeef || broken(!GetLastError()), /* vista */ - "wrong error %u\n", GetLastError()); + "wrong error %lu\n", GetLastError()); ok(ret == 121 || ret == 119, "Expected 121 or 119, got %d\n", ret); ok(strcmp(dst, composite_dst) == 0 || strcmp(dst, composite_dst_alt) == 0, "MAP_COMPOSITE: Mismatch, got '%s'\n", dst); @@ -3149,7 +3149,7 @@ static void test_FoldStringA(void) src[0] = i; src[1] = '\0'; ret = FoldStringA(MAP_COMPOSITE, src, -1, dst, 256); - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError()); ok(dst[0] == src[0], "0x%02x, 0x%02x,0x%02x,0x%02x,\n", (unsigned char)src[0], (unsigned char)dst[0],(unsigned char)dst[1],(unsigned char)dst[2]); @@ -3169,7 +3169,7 @@ static void test_FoldStringA(void) if (foldczone_special[j].src == src[0]) { ok(ret == 2 || ret == lstrlenA(foldczone_special[j].dst) + 1, - "Expected ret == 2 or %d, got %d, error %d\n", + "Expected ret == 2 or %d, got %d, error %ld\n", lstrlenA(foldczone_special[j].dst) + 1, ret, GetLastError()); ok(src[0] == dst[0] || lstrcmpA(foldczone_special[j].dst, dst) == 0, "MAP_FOLDCZONE: string mismatch for 0x%02x\n", @@ -3179,7 +3179,7 @@ static void test_FoldStringA(void) } if (! is_special) { - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError()); ok(src[0] == dst[0], "MAP_FOLDCZONE: Expected 0x%02x, got 0x%02x\n", (unsigned char)src[0], (unsigned char)dst[0]); @@ -3192,7 +3192,7 @@ static void test_FoldStringA(void) src[0] = i; src[1] = '\0'; ret = FoldStringA(MAP_PRECOMPOSED, src, -1, dst, 256); - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError()); ok(src[0] == dst[0], "MAP_PRECOMPOSED: Expected 0x%02x, got 0x%02x\n", (unsigned char)src[0], (unsigned char)dst[0]); @@ -3340,32 +3340,32 @@ static void test_FoldStringW(void) SetLastError(0xdeadbeef); ret = FoldStringW(badFlags[i], src, 256, dst, 256); ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + "Expected ERROR_INVALID_FLAGS, got %ld\n", GetLastError()); }
/* src & dst cannot be the same */ SetLastError(0xdeadbeef); ret = FoldStringW(MAP_FOLDCZONE, src, -1, src, 256); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* src can't be NULL */ SetLastError(0xdeadbeef); ret = FoldStringW(MAP_FOLDCZONE, NULL, -1, dst, 256); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* srclen can't be 0 */ SetLastError(0xdeadbeef); ret = FoldStringW(MAP_FOLDCZONE, src, 0, dst, 256); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* dstlen can't be < 0 */ SetLastError(0xdeadbeef); ret = FoldStringW(MAP_FOLDCZONE, src, -1, dst, -1); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Ret includes terminating NUL which is appended if srclen = -1 */ SetLastError(0xdeadbeef); @@ -3373,9 +3373,9 @@ static void test_FoldStringW(void) src[1] = '\0'; dst[0] = '\0'; ret = FoldStringW(MAP_FOLDCZONE, src, -1, dst, 256); - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError()); ok(dst[0] == 'A' && dst[1] == '\0', - "srclen=-1: Expected ret=2 [%d,%d], got ret=%d [%d,%d], err=%d\n", + "srclen=-1: Expected ret=2 [%d,%d], got ret=%d [%d,%d], err=%ld\n", 'A', '\0', ret, dst[0], dst[1], GetLastError());
/* If size is given, result is not NUL terminated */ @@ -3385,9 +3385,9 @@ static void test_FoldStringW(void) dst[0] = 'X'; dst[1] = 'X'; ret = FoldStringW(MAP_FOLDCZONE, src, 1, dst, 256); - ok(ret == 1, "Expected ret == 1, got %d, error %d\n", ret, GetLastError()); + ok(ret == 1, "Expected ret == 1, got %d, error %ld\n", ret, GetLastError()); ok(dst[0] == 'A' && dst[1] == 'X', - "srclen=1: Expected ret=1, [%d,%d], got ret=%d,[%d,%d], err=%d\n", + "srclen=1: Expected ret=1, [%d,%d], got ret=%d,[%d,%d], err=%ld\n", 'A','X', ret, dst[0], dst[1], GetLastError());
/* MAP_FOLDDIGITS */ @@ -3400,7 +3400,7 @@ static void test_FoldStringW(void) src[0] = ch; src[1] = dst[0] = '\0'; ret = FoldStringW(MAP_FOLDDIGITS, src, -1, dst, 256); - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError());
ok(dst[0] == ch || wcschr(outOfSequenceDigits, ch) || (ch >= 0xa8e0 && ch <= 0xa8e9), /* combining Devanagari on Win8 */ @@ -3428,7 +3428,7 @@ static void test_FoldStringW(void) src[0] = c; src[1] = dst[0] = '\0'; ret = FoldStringW(MAP_FOLDDIGITS, src, -1, dst, 256); - ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + ok(ret == 2, "Expected ret == 2, got %d, error %ld\n", ret, GetLastError());
ok((dst[0] == '0' + ch - digitRanges[j] && dst[1] == '\0') || broken( dst[0] == ch ) || /* old Windows versions don't have all mappings */ @@ -3446,7 +3446,7 @@ static void test_FoldStringW(void) ret = FoldStringW(MAP_FOLDCZONE, foldczone_src, -1, dst, 256); ok(ret == ARRAY_SIZE(foldczone_dst) || broken(ret == ARRAY_SIZE(foldczone_broken_dst)), /* winxp, win2003 */ - "Got %d, error %d.\n", ret, GetLastError()); + "Got %d, error %ld.\n", ret, GetLastError()); ok(!memcmp(dst, foldczone_dst, sizeof(foldczone_dst)) || broken(!memcmp(dst, foldczone_broken_dst, sizeof(foldczone_broken_dst))), /* winxp, win2003 */ "Got unexpected string %s.\n", wine_dbgstr_w(dst)); @@ -3454,7 +3454,7 @@ static void test_FoldStringW(void) /* MAP_EXPAND_LIGATURES */ SetLastError(0xdeadbeef); ret = FoldStringW(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); - ok(ret == ARRAY_SIZE(ligatures_dst), "Got %d, error %d\n", ret, GetLastError()); + ok(ret == ARRAY_SIZE(ligatures_dst), "Got %d, error %ld\n", ret, GetLastError()); ok(!memcmp(dst, ligatures_dst, sizeof(ligatures_dst)), "Got unexpected string %s.\n", wine_dbgstr_w(dst));
@@ -3464,7 +3464,7 @@ static void test_FoldStringW(void)
#define LCID_OK(l) \ - ok(lcid == l, "Expected lcid = %08x, got %08x\n", l, lcid) + ok(lcid == l, "Expected lcid = %08lx, got %08lx\n", l, lcid) #define MKLCID(x,y,z) MAKELCID(MAKELANGID(x, y), z) #define LCID_RES(src, res) do { lcid = ConvertDefaultLocale(src); LCID_OK(res); } while (0) #define TEST_LCIDLANG(a,b) LCID_RES(MAKELCID(a,b), MAKELCID(a,b)) @@ -3496,12 +3496,12 @@ static void test_ConvertDefaultLocale(void) lcid = ConvertDefaultLocale( MKLCID( LANG_JAPANESE, SUBLANG_NEUTRAL, SORT_JAPANESE_UNICODE )); ok( lcid == MKLCID( LANG_JAPANESE, SUBLANG_NEUTRAL, SORT_JAPANESE_UNICODE ) || broken( lcid == MKLCID( LANG_JAPANESE, SUBLANG_DEFAULT, SORT_JAPANESE_UNICODE )), /* <= vista */ - "Expected lcid = %08x got %08x\n", + "Expected lcid = %08lx got %08lx\n", MKLCID( LANG_JAPANESE, SUBLANG_NEUTRAL, SORT_JAPANESE_UNICODE ), lcid ); lcid = ConvertDefaultLocale( MKLCID( LANG_IRISH, SUBLANG_NEUTRAL, SORT_JAPANESE_UNICODE )); ok( lcid == MKLCID( LANG_IRISH, SUBLANG_NEUTRAL, SORT_JAPANESE_UNICODE ) || broken( lcid == MKLCID( LANG_IRISH, SUBLANG_DEFAULT, SORT_JAPANESE_UNICODE )), /* <= vista */ - "Expected lcid = %08x got %08x\n", + "Expected lcid = %08lx got %08lx\n", MKLCID( LANG_IRISH, SUBLANG_NEUTRAL, SORT_JAPANESE_UNICODE ), lcid );
/* SUBLANG_NEUTRAL -> SUBLANG_DEFAULT */ @@ -3515,22 +3515,22 @@ static void test_ConvertDefaultLocale(void) ok( lcid == MAKELANGID( nondefault_langs[i].lang, nondefault_langs[i].sublang ) || broken( lcid == MAKELANGID( nondefault_langs[i].lang, SUBLANG_DEFAULT )) || /* <= vista */ broken( lcid == MAKELANGID( nondefault_langs[i].lang, SUBLANG_NEUTRAL )), /* w7 */ - "Expected lcid = %08x got %08x\n", + "Expected lcid = %08x got %08lx\n", MAKELANGID( nondefault_langs[i].lang, nondefault_langs[i].sublang ), lcid ); } lcid = ConvertDefaultLocale( 0x7804 ); ok( lcid == MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED ) || broken( lcid == 0x7804 ), /* <= vista */ - "Expected lcid = %08x got %08x\n", MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED ), lcid ); + "Expected lcid = %08x got %08lx\n", MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED ), lcid ); lcid = ConvertDefaultLocale( 0x7c04 ); ok( lcid == MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_HONGKONG ) || broken( lcid == 0x7c04 ) || /* winxp */ broken( lcid == 0x0404 ), /* vista */ - "Expected lcid = %08x got %08x\n", MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_HONGKONG ), lcid ); + "Expected lcid = %08x got %08lx\n", MAKELANGID( LANG_CHINESE, SUBLANG_CHINESE_HONGKONG ), lcid ); lcid = ConvertDefaultLocale( LANG_SERBIAN_NEUTRAL ); ok( lcid == MAKELANGID( LANG_SERBIAN, SUBLANG_SERBIAN_SERBIA_LATIN ) || broken( lcid == MAKELANGID( LANG_SERBIAN, SUBLANG_SERBIAN_LATIN ) ), /* <= vista */ - "Expected lcid = %08x got %08x\n", MAKELANGID( LANG_SERBIAN, SUBLANG_SERBIAN_SERBIA_LATIN ), lcid ); + "Expected lcid = %08x got %08lx\n", MAKELANGID( LANG_SERBIAN, SUBLANG_SERBIAN_SERBIA_LATIN ), lcid );
/* Invariant language is not treated specially */ TEST_LCID(LANG_INVARIANT, SUBLANG_DEFAULT, SORT_DEFAULT); @@ -3545,22 +3545,22 @@ static void test_ConvertDefaultLocale(void) LCID_RES(LOCALE_NEUTRAL, GetUserDefaultLCID()); lcid = ConvertDefaultLocale(LOCALE_INVARIANT); ok(lcid == LOCALE_INVARIANT || broken(lcid == 0x47f) /* win2k[3]/winxp */, - "Expected lcid = %08x, got %08x\n", LOCALE_INVARIANT, lcid); + "Expected lcid = %08lx, got %08lx\n", LOCALE_INVARIANT, lcid); }
static BOOL CALLBACK langgrp_procA(LGRPID lgrpid, LPSTR lpszNum, LPSTR lpszName, DWORD dwFlags, LONG_PTR lParam) { if (winetest_debug > 1) - trace("%08x, %s, %s, %08x, %08lx\n", + trace("%08lx, %s, %s, %08lx, %08Ix\n", lgrpid, lpszNum, lpszName, dwFlags, lParam);
ok(pIsValidLanguageGroup(lgrpid, dwFlags) == TRUE, - "Enumerated grp %d not valid (flags %d)\n", lgrpid, dwFlags); + "Enumerated grp %ld not valid (flags %ld)\n", lgrpid, dwFlags);
/* If lParam is one, we are calling with flags defaulted from 0 */ ok(!lParam || (dwFlags == LGRPID_INSTALLED || dwFlags == LGRPID_SUPPORTED), - "Expected dwFlags == LGRPID_INSTALLED || dwFlags == LGRPID_SUPPORTED, got %d\n", dwFlags); + "Expected dwFlags == LGRPID_INSTALLED || dwFlags == LGRPID_SUPPORTED, got %ld\n", dwFlags);
return TRUE; } @@ -3584,17 +3584,17 @@ static void test_EnumSystemLanguageGroupsA(void) return; } ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Invalid flags */ SetLastError(0); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_INSTALLED|LGRPID_SUPPORTED, 0); - ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %ld\n", GetLastError());
/* No flags - defaults to LGRPID_INSTALLED */ SetLastError(0xdeadbeef); pEnumSystemLanguageGroupsA(langgrp_procA, 0, 1); - ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "got error %ld\n", GetLastError());
pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_INSTALLED, 0); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_SUPPORTED, 0); @@ -3603,7 +3603,7 @@ static void test_EnumSystemLanguageGroupsA(void) static BOOL CALLBACK enum_func( LPWSTR name, DWORD flags, LPARAM lparam ) { if (winetest_debug > 1) - trace( "%s %x\n", wine_dbgstr_w(name), flags ); + trace( "%s %lx\n", wine_dbgstr_w(name), flags ); return TRUE; }
@@ -3619,26 +3619,26 @@ static void test_EnumSystemLocalesEx(void) SetLastError( 0xdeadbeef ); ret = pEnumSystemLocalesEx( enum_func, LOCALE_ALL, 0, (void *)1 ); ok( !ret, "should have failed\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pEnumSystemLocalesEx( enum_func, 0, 0, NULL ); - ok( ret, "failed err %u\n", GetLastError() ); + ok( ret, "failed err %lu\n", GetLastError() ); }
static BOOL CALLBACK lgrplocale_procA(LGRPID lgrpid, LCID lcid, LPSTR lpszNum, LONG_PTR lParam) { if (winetest_debug > 1) - trace("%08x, %08x, %s, %08lx\n", lgrpid, lcid, lpszNum, lParam); + trace("%08lx, %08lx, %s, %08Ix\n", lgrpid, lcid, lpszNum, lParam);
/* invalid locale enumerated on some platforms */ if (lcid == 0) return TRUE;
ok(pIsValidLanguageGroup(lgrpid, LGRPID_SUPPORTED) == TRUE, - "Enumerated grp %d not valid\n", lgrpid); + "Enumerated grp %ld not valid\n", lgrpid); ok(IsValidLocale(lcid, LCID_SUPPORTED) == TRUE, - "Enumerated grp locale %04x not valid\n", lcid); + "Enumerated grp locale %04lx not valid\n", lcid); return TRUE; }
@@ -3661,25 +3661,25 @@ static void test_EnumLanguageGroupLocalesA(void) return; } ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* lgrpid too small */ SetLastError(0); ret = pEnumLanguageGroupLocalesA(lgrplocale_procA, 0, 0, 0); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* lgrpid too big */ SetLastError(0); ret = pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_ARMENIAN + 1, 0, 0); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* dwFlags is reserved */ SetLastError(0); ret = pEnumLanguageGroupLocalesA(0, LGRPID_WESTERN_EUROPE, 0x1, 0); ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_WESTERN_EUROPE, 0, 0); } @@ -3693,25 +3693,25 @@ static void test_SetLocaleInfoA(void) SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_SDATE, 0); ok( !bRet && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* IDATE */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_IDATE, "test_SetLocaleInfoA"); ok(!bRet && GetLastError() == ERROR_INVALID_FLAGS, - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + "Expected ERROR_INVALID_FLAGS, got %ld\n", GetLastError());
/* ILDATE */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_ILDATE, "test_SetLocaleInfoA"); ok(!bRet && GetLastError() == ERROR_INVALID_FLAGS, - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + "Expected ERROR_INVALID_FLAGS, got %ld\n", GetLastError()); }
static BOOL CALLBACK luilocale_proc1A(LPSTR value, LONG_PTR lParam) { if (winetest_debug > 1) - trace("%s %08lx\n", value, lParam); + trace("%s %08Ix\n", value, lParam); return(TRUE); }
@@ -3743,37 +3743,37 @@ static void test_EnumUILanguageA(void) win_skip("EnumUILanguagesA is not implemented\n"); return; } - ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok(ret, "Expected ret != 0, got %d, error %ld\n", ret, GetLastError());
enumCount = 0; SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc2A, 0, 0); - ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok(ret, "Expected ret != 0, got %d, error %ld\n", ret, GetLastError()); ok(enumCount == 1, "enumCount = %u\n", enumCount);
enumCount = 0; SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc2A, MUI_LANGUAGE_ID, 0); ok(ret || broken(!ret && GetLastError() == ERROR_INVALID_FLAGS), /* winxp */ - "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + "Expected ret != 0, got %d, error %ld\n", ret, GetLastError()); if (ret) ok(enumCount == 1, "enumCount = %u\n", enumCount);
SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(NULL, 0, 0); ok(!ret, "Expected return value FALSE, got %u\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc3A, 0x5a5a5a5a, 0); ok(!ret, "Expected return value FALSE, got %u\n", ret); - ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %ld\n", GetLastError());
SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(NULL, 0x5a5a5a5a, 0); ok(!ret, "Expected return value FALSE, got %u\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
static char date_fmt_buf[1024]; @@ -3807,12 +3807,12 @@ static void test_EnumDateFormatsA(void) } else { - ok(ret, "EnumDateFormatsA(0) error %d\n", GetLastError()); + ok(ret, "EnumDateFormatsA(0) error %ld\n", GetLastError()); trace("EnumDateFormatsA(0): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SSHORTDATE, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_SSHORTDATE) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_SSHORTDATE) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf), "expected "%s" got "%s"\n", date_fmt_buf, buf); }
@@ -3825,33 +3825,33 @@ static void test_EnumDateFormatsA(void) } else { - ok(ret, "EnumDateFormatsA(LOCALE_USE_CP_ACP) error %d\n", GetLastError()); + ok(ret, "EnumDateFormatsA(LOCALE_USE_CP_ACP) error %ld\n", GetLastError()); trace("EnumDateFormatsA(LOCALE_USE_CP_ACP): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SSHORTDATE, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_SSHORTDATE) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_SSHORTDATE) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf), "expected "%s" got "%s"\n", date_fmt_buf, buf); }
date_fmt_buf[0] = 0; ret = EnumDateFormatsA(enum_datetime_procA, lcid, DATE_SHORTDATE); - ok(ret, "EnumDateFormatsA(DATE_SHORTDATE) error %d\n", GetLastError()); + ok(ret, "EnumDateFormatsA(DATE_SHORTDATE) error %ld\n", GetLastError()); trace("EnumDateFormatsA(DATE_SHORTDATE): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SSHORTDATE, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_SSHORTDATE) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_SSHORTDATE) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf), "expected "%s" got "%s"\n", date_fmt_buf, buf);
date_fmt_buf[0] = 0; ret = EnumDateFormatsA(enum_datetime_procA, lcid, DATE_LONGDATE); - ok(ret, "EnumDateFormatsA(DATE_LONGDATE) error %d\n", GetLastError()); + ok(ret, "EnumDateFormatsA(DATE_LONGDATE) error %ld\n", GetLastError()); trace("EnumDateFormatsA(DATE_LONGDATE): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SLONGDATE, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_SLONGDATE) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_SLONGDATE) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf), "expected "%s" got "%s"\n", date_fmt_buf, buf);
date_fmt_buf[0] = 0; @@ -3862,12 +3862,12 @@ static void test_EnumDateFormatsA(void) win_skip("DATE_YEARMONTH is only present on W2K and later\n"); return; } - ok(ret, "EnumDateFormatsA(DATE_YEARMONTH) error %d\n", GetLastError()); + ok(ret, "EnumDateFormatsA(DATE_YEARMONTH) error %ld\n", GetLastError()); trace("EnumDateFormatsA(DATE_YEARMONTH): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SYEARMONTH, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_SYEARMONTH) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_SYEARMONTH) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf) || broken(!buf[0]) /* win9x */, "expected "%s" got "%s"\n", date_fmt_buf, buf); } @@ -3880,22 +3880,22 @@ static void test_EnumTimeFormatsA(void)
date_fmt_buf[0] = 0; ret = EnumTimeFormatsA(enum_datetime_procA, lcid, 0); - ok(ret, "EnumTimeFormatsA(0) error %d\n", GetLastError()); + ok(ret, "EnumTimeFormatsA(0) error %ld\n", GetLastError()); trace("EnumTimeFormatsA(0): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_STIMEFORMAT, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_STIMEFORMAT) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_STIMEFORMAT) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf), "expected "%s" got "%s"\n", date_fmt_buf, buf);
date_fmt_buf[0] = 0; ret = EnumTimeFormatsA(enum_datetime_procA, lcid, LOCALE_USE_CP_ACP); - ok(ret, "EnumTimeFormatsA(LOCALE_USE_CP_ACP) error %d\n", GetLastError()); + ok(ret, "EnumTimeFormatsA(LOCALE_USE_CP_ACP) error %ld\n", GetLastError()); trace("EnumTimeFormatsA(LOCALE_USE_CP_ACP): %s\n", date_fmt_buf); /* test the 1st enumerated format */ if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_STIMEFORMAT, buf, sizeof(buf)); - ok(ret, "GetLocaleInfoA(LOCALE_STIMEFORMAT) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoA(LOCALE_STIMEFORMAT) error %ld\n", GetLastError()); ok(!lstrcmpA(date_fmt_buf, buf), "expected "%s" got "%s"\n", date_fmt_buf, buf); }
@@ -3907,17 +3907,17 @@ static void test_EnumTimeFormatsW(void)
date_fmt_bufW[0] = 0; ret = EnumTimeFormatsW(enum_datetime_procW, lcid, 0); - ok(ret, "EnumTimeFormatsW(0) error %d\n", GetLastError()); + ok(ret, "EnumTimeFormatsW(0) error %ld\n", GetLastError()); ret = GetLocaleInfoW(lcid, LOCALE_STIMEFORMAT, bufW, ARRAY_SIZE(bufW)); - ok(ret, "GetLocaleInfoW(LOCALE_STIMEFORMAT) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoW(LOCALE_STIMEFORMAT) error %ld\n", GetLastError()); ok(!lstrcmpW(date_fmt_bufW, bufW), "expected "%s" got "%s"\n", wine_dbgstr_w(date_fmt_bufW), wine_dbgstr_w(bufW));
date_fmt_bufW[0] = 0; ret = EnumTimeFormatsW(enum_datetime_procW, lcid, LOCALE_USE_CP_ACP); - ok(ret, "EnumTimeFormatsW(LOCALE_USE_CP_ACP) error %d\n", GetLastError()); + ok(ret, "EnumTimeFormatsW(LOCALE_USE_CP_ACP) error %ld\n", GetLastError()); ret = GetLocaleInfoW(lcid, LOCALE_STIMEFORMAT, bufW, ARRAY_SIZE(bufW)); - ok(ret, "GetLocaleInfoW(LOCALE_STIMEFORMAT) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoW(LOCALE_STIMEFORMAT) error %ld\n", GetLastError()); ok(!lstrcmpW(date_fmt_bufW, bufW), "expected "%s" got "%s"\n", wine_dbgstr_w(date_fmt_bufW), wine_dbgstr_w(bufW));
@@ -3929,24 +3929,24 @@ static void test_EnumTimeFormatsW(void) else { char buf[256];
- ok(ret, "EnumTimeFormatsW(TIME_NOSECONDS) error %d\n", GetLastError()); + ok(ret, "EnumTimeFormatsW(TIME_NOSECONDS) error %ld\n", GetLastError()); ret = GetLocaleInfoW(lcid, LOCALE_SSHORTTIME, bufW, ARRAY_SIZE(bufW)); - ok(ret, "GetLocaleInfoW(LOCALE_SSHORTTIME) error %d\n", GetLastError()); + ok(ret, "GetLocaleInfoW(LOCALE_SSHORTTIME) error %ld\n", GetLastError()); ok(!lstrcmpW(date_fmt_bufW, bufW), "expected "%s" got "%s"\n", wine_dbgstr_w(date_fmt_bufW), wine_dbgstr_w(bufW));
/* EnumTimeFormatsA doesn't support this flag */ ret = EnumTimeFormatsA(enum_datetime_procA, lcid, TIME_NOSECONDS); - ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d\n", ret, + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %ld\n", ret, GetLastError());
ret = EnumTimeFormatsA(NULL, lcid, TIME_NOSECONDS); - ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d\n", ret, + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %ld\n", ret, GetLastError());
/* And it's not supported by GetLocaleInfoA either */ ret = GetLocaleInfoA(lcid, LOCALE_SSHORTTIME, buf, ARRAY_SIZE(buf)); - ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "GetLocaleInfoA(LOCALE_SSHORTTIME) ret %d, error %d\n", ret, + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "GetLocaleInfoA(LOCALE_SSHORTTIME) ret %d, error %ld\n", ret, GetLastError()); } } @@ -3960,7 +3960,7 @@ static void test_GetCPInfo(void) ret = GetCPInfo(CP_SYMBOL, &cpinfo); ok(!ret, "GetCPInfo(CP_SYMBOL) should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
memset(cpinfo.LeadByte, '-', ARRAY_SIZE(cpinfo.LeadByte)); SetLastError(0xdeadbeef); @@ -3973,7 +3973,7 @@ static void test_GetCPInfo(void) { unsigned int i;
- ok(ret, "GetCPInfo(CP_UTF7) error %u\n", GetLastError()); + ok(ret, "GetCPInfo(CP_UTF7) error %lu\n", GetLastError()); ok(cpinfo.DefaultChar[0] == 0x3f, "expected 0x3f, got 0x%x\n", cpinfo.DefaultChar[0]); ok(cpinfo.DefaultChar[1] == 0, "expected 0, got 0x%x\n", cpinfo.DefaultChar[1]); for (i = 0; i < sizeof(cpinfo.LeadByte); i++) @@ -3992,7 +3992,7 @@ static void test_GetCPInfo(void) { unsigned int i;
- ok(ret, "GetCPInfo(CP_UTF8) error %u\n", GetLastError()); + ok(ret, "GetCPInfo(CP_UTF8) error %lu\n", GetLastError()); ok(cpinfo.DefaultChar[0] == 0x3f, "expected 0x3f, got 0x%x\n", cpinfo.DefaultChar[0]); ok(cpinfo.DefaultChar[1] == 0, "expected 0, got 0x%x\n", cpinfo.DefaultChar[1]); for (i = 0; i < sizeof(cpinfo.LeadByte); i++) @@ -4019,18 +4019,18 @@ static void test_GetCPInfo(void) case 9: /* sortkeys */ case 13: /* unknown */ ok( status == STATUS_INVALID_PARAMETER_1 || status == STATUS_INVALID_PARAMETER_3, /* vista */ - "%u: failed %x\n", i, status ); + "%u: failed %lx\n", i, status ); break; case 10: /* casemap */ ok( status == STATUS_INVALID_PARAMETER_1 || status == STATUS_UNSUCCESSFUL, - "%u: failed %x\n", i, status ); + "%u: failed %lx\n", i, status ); break; case 11: /* codepage */ case 12: /* normalization */ - ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%u: failed %x\n", i, status ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%u: failed %lx\n", i, status ); break; default: - ok( status == STATUS_INVALID_PARAMETER_1, "%u: failed %x\n", i, status ); + ok( status == STATUS_INVALID_PARAMETER_1, "%u: failed %lx\n", i, status ); break; } } @@ -4040,15 +4040,15 @@ static void test_GetCPInfo(void) status = pNtGetNlsSectionPtr( 10, 0, NULL, &ptr, &size ); if (status != STATUS_INVALID_PARAMETER_1) { - ok( !status, "failed %x\n", status ); - ok( size > 0x1000 && size <= 0x8000 , "wrong size %lx\n", size ); + ok( !status, "failed %lx\n", status ); + ok( size > 0x1000 && size <= 0x8000 , "wrong size %Ix\n", size ); status = pNtGetNlsSectionPtr( 10, 0, NULL, &ptr2, &size ); - ok( !status, "failed %x\n", status ); + ok( !status, "failed %lx\n", status ); ok( ptr != ptr2, "got same pointer\n" ); ret = UnmapViewOfFile( ptr ); - ok( ret, "UnmapViewOfFile failed err %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed err %lu\n", GetLastError() ); ret = UnmapViewOfFile( ptr2 ); - ok( ret, "UnmapViewOfFile failed err %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed err %lu\n", GetLastError() ); }
/* codepage tables */ @@ -4056,8 +4056,8 @@ static void test_GetCPInfo(void) ptr = (void *)0xdeadbeef; size = 0xdeadbeef; status = pNtGetNlsSectionPtr( 11, 437, NULL, &ptr, &size ); - ok( !status, "failed %x\n", status ); - ok( size > 0x10000 && size <= 0x20000, "wrong size %lx\n", size ); + ok( !status, "failed %lx\n", status ); + ok( size > 0x10000 && size <= 0x20000, "wrong size %Ix\n", size ); memset( &table, 0xcc, sizeof(table) ); if (pRtlInitCodePageTable) { @@ -4068,11 +4068,11 @@ static void test_GetCPInfo(void) ok( !table.DBCSCodePage, "wrong dbcs %u\n", table.DBCSCodePage ); } ret = UnmapViewOfFile( ptr ); - ok( ret, "UnmapViewOfFile failed err %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed err %lu\n", GetLastError() );
status = pNtGetNlsSectionPtr( 11, 936, NULL, &ptr, &size ); - ok( !status, "failed %x\n", status ); - ok( size > 0x30000 && size <= 0x40000, "wrong size %lx\n", size ); + ok( !status, "failed %lx\n", status ); + ok( size > 0x30000 && size <= 0x40000, "wrong size %Ix\n", size ); memset( &table, 0xcc, sizeof(table) ); if (pRtlInitCodePageTable) { @@ -4099,14 +4099,14 @@ static void test_GetCPInfo(void) memset( wbuf, 0xcc, sizeof(wbuf) ); pRtlCustomCPToUnicodeN( &table, wbuf, sizeof(wbuf), &reslen, (char *)buf, i ); for (j = 0; j < 4; j++) if (expect[i][j] == 0xcccc) break; - ok( reslen == j * sizeof(WCHAR), "%u: wrong len %u\n", i, reslen ); + ok( reslen == j * sizeof(WCHAR), "%lu: wrong len %lu\n", i, reslen ); for (j = 0; j < 4; j++) - ok( wbuf[j] == expect[i][j], "%u: char %u got %04x\n", i, j, wbuf[j] ); + ok( wbuf[j] == expect[i][j], "%lu: char %lu got %04x\n", i, j, wbuf[j] ); } } } ret = UnmapViewOfFile( ptr ); - ok( ret, "UnmapViewOfFile failed err %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed err %lu\n", GetLastError() );
/* normalization tables */
@@ -4120,14 +4120,14 @@ static void test_GetCPInfo(void) case NormalizationKC: case NormalizationKD: case 13: /* IDN */ - ok( !status, "%u: failed %x\n", i, status ); + ok( !status, "%u: failed %lx\n", i, status ); if (status) break; - ok( size > 0x8000 && size <= 0x30000 , "wrong size %lx\n", size ); + ok( size > 0x8000 && size <= 0x30000 , "wrong size %Ix\n", size ); ret = UnmapViewOfFile( ptr ); - ok( ret, "UnmapViewOfFile failed err %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed err %lu\n", GetLastError() ); break; default: - ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%u: failed %x\n", i, status ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%u: failed %lx\n", i, status ); break; } } @@ -4210,17 +4210,17 @@ static void test_GetStringTypeW(void) SetLastError(0xdeadbeef); ret = GetStringTypeW(CT_CTYPE1, NULL, 0, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetStringTypeW(CT_CTYPE1, NULL, 0, types); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetStringTypeW(CT_CTYPE1, NULL, 5, types); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %ld\n", GetLastError());
memset(types,0,sizeof(types)); GetStringTypeW(CT_CTYPE1, blanks, 5, types); @@ -4359,49 +4359,49 @@ static void test_IdnToNameprepUnicode(void)
ret = pIdnToNameprepUnicode(0, test_data[0].in, test_data[0].in_len, NULL, 0); - ok(ret == test_data[0].ret, "ret = %d\n", ret); + ok(ret == test_data[0].ret, "ret = %ld\n", ret);
SetLastError(0xdeadbeef); ret = pIdnToNameprepUnicode(0, test_data[1].in, test_data[1].in_len, NULL, 0); err = GetLastError(); - ok(ret == test_data[1].ret, "ret = %d\n", ret); - ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "err = %d\n", err); + ok(ret == test_data[1].ret, "ret = %ld\n", ret); + ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "err = %ld\n", err);
SetLastError(0xdeadbeef); ret = pIdnToNameprepUnicode(0, test_data[0].in, -1, buf, ARRAY_SIZE(buf)); err = GetLastError(); - ok(ret == test_data[0].ret, "ret = %d\n", ret); - ok(err == 0xdeadbeef, "err = %d\n", err); + ok(ret == test_data[0].ret, "ret = %ld\n", ret); + ok(err == 0xdeadbeef, "err = %ld\n", err);
SetLastError(0xdeadbeef); ret = pIdnToNameprepUnicode(0, test_data[0].in, -2, buf, ARRAY_SIZE(buf)); err = GetLastError(); - ok(ret == 0, "ret = %d\n", ret); - ok(err == ERROR_INVALID_PARAMETER, "err = %d\n", err); + ok(ret == 0, "ret = %ld\n", ret); + ok(err == ERROR_INVALID_PARAMETER, "err = %ld\n", err);
SetLastError(0xdeadbeef); ret = pIdnToNameprepUnicode(0, test_data[0].in, 0, buf, ARRAY_SIZE(buf)); err = GetLastError(); - ok(ret == 0, "ret = %d\n", ret); - ok(err == ERROR_INVALID_NAME, "err = %d\n", err); + ok(ret == 0, "ret = %ld\n", ret); + ok(err == ERROR_INVALID_NAME, "err = %ld\n", err);
ret = pIdnToNameprepUnicode(IDN_ALLOW_UNASSIGNED|IDN_USE_STD3_ASCII_RULES, test_data[0].in, -1, buf, ARRAY_SIZE(buf)); - ok(ret == test_data[0].ret, "ret = %d\n", ret); + ok(ret == test_data[0].ret, "ret = %ld\n", ret);
SetLastError(0xdeadbeef); ret = pIdnToNameprepUnicode(0, NULL, 0, NULL, 0); err = GetLastError(); - ok(ret == 0, "ret = %d\n", ret); - ok(err == ERROR_INVALID_PARAMETER, "err = %d\n", err); + ok(ret == 0, "ret = %ld\n", ret); + ok(err == ERROR_INVALID_PARAMETER, "err = %ld\n", err);
SetLastError(0xdeadbeef); ret = pIdnToNameprepUnicode(4, NULL, 0, NULL, 0); err = GetLastError(); - ok(ret == 0, "ret = %d\n", ret); + ok(ret == 0, "ret = %ld\n", ret); ok(err == ERROR_INVALID_FLAGS || err == ERROR_INVALID_PARAMETER /* Win8 */, - "err = %d\n", err); + "err = %ld\n", err);
for (i=0; i<ARRAY_SIZE(test_data); i++) { @@ -4411,12 +4411,12 @@ static void test_IdnToNameprepUnicode(void) buf, ARRAY_SIZE(buf)); err = GetLastError();
- ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%d: ret = %d\n", i, ret); + ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%ld: ret = %ld\n", i, ret);
if (ret == test_data[i].ret) { - ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "%d: err = %d\n", i, err); - ok(!wcsncmp(test_data[i].out, buf, ret), "%d: buf = %s\n", i, wine_dbgstr_wn(buf, ret)); + ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "%ld: err = %ld\n", i, err); + ok(!wcsncmp(test_data[i].out, buf, ret), "%ld: buf = %s\n", i, wine_dbgstr_wn(buf, ret)); } if (pRtlNormalizeString) { @@ -4425,8 +4425,8 @@ static void test_IdnToNameprepUnicode(void) memset( buf, 0xcc, sizeof(buf) ); status = pRtlNormalizeString( 13, test_data[i].in, test_data[i].in_len, buf, &len ); ok( status == test_data[i].status || broken(status == test_data[i].broken_status), - "%d: failed %x\n", i, status ); - if (!status) ok( !wcsnicmp(test_data[i].out, buf, len), "%d: buf = %s\n", i, wine_dbgstr_wn(buf, len)); + "%ld: failed %lx\n", i, status ); + if (!status) ok( !wcsnicmp(test_data[i].out, buf, len), "%ld: buf = %s\n", i, wine_dbgstr_wn(buf, len)); } } } @@ -4470,9 +4470,9 @@ static void test_IdnToAscii(void) SetLastError(0xdeadbeef); ret = pIdnToAscii(test_data[i].flags, test_data[i].in, test_data[i].in_len, buf, ARRAY_SIZE(buf)); err = GetLastError(); - ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%d: ret = %d\n", i, ret); - ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "%d: err = %d\n", i, err); - ok(!wcsnicmp(test_data[i].out, buf, ret), "%d: buf = %s\n", i, wine_dbgstr_wn(buf, ret)); + ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%ld: ret = %ld\n", i, ret); + ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "%ld: err = %ld\n", i, err); + ok(!wcsnicmp(test_data[i].out, buf, ret), "%ld: buf = %s\n", i, wine_dbgstr_wn(buf, ret)); } }
@@ -4513,14 +4513,14 @@ static void test_IdnToUnicode(void) for (i=0; i<ARRAY_SIZE(test_data); i++) { ret = pIdnToUnicode(test_data[i].flags, test_data[i].in, test_data[i].in_len, NULL, 0); - ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%d: ret = %d\n", i, ret); + ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%ld: ret = %ld\n", i, ret);
SetLastError(0xdeadbeef); ret = pIdnToUnicode(test_data[i].flags, test_data[i].in, test_data[i].in_len, buf, ARRAY_SIZE(buf)); err = GetLastError(); - ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%d: ret = %d\n", i, ret); - ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "%d: err = %d\n", i, err); - ok(!wcsncmp(test_data[i].out, buf, ret), "%d: buf = %s\n", i, wine_dbgstr_wn(buf, ret)); + ok(ret == test_data[i].ret || broken(ret == test_data[i].broken_ret), "%ld: ret = %ld\n", i, ret); + ok(err == ret ? 0xdeadbeef : ERROR_INVALID_NAME, "%ld: err = %ld\n", i, err); + ok(!wcsncmp(test_data[i].out, buf, ret), "%ld: buf = %s\n", i, wine_dbgstr_wn(buf, ret)); } }
@@ -4657,11 +4657,11 @@ static void test_GetLocaleInfoEx(void)
SetLastError(0xdeadbeef); ret = pGetLocaleInfoEx(enW, LOCALE_SNAME, bufferW, 2); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, %ld\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetLocaleInfoEx(enW, LOCALE_SNAME, NULL, 0); - ok(ret == 3 && GetLastError() == 0xdeadbeef, "got %d, %d\n", ret, GetLastError()); + ok(ret == 3 && GetLastError() == 0xdeadbeef, "got %d, %ld\n", ret, GetLastError());
ret = pGetLocaleInfoEx(enusW, LOCALE_SNAME, bufferW, ARRAY_SIZE(bufferW)); ok(ret == lstrlenW(bufferW)+1, "got %d\n", ret); @@ -4700,13 +4700,13 @@ static void test_GetLocaleInfoEx(void) bufferW[0] = 0; SetLastError(0xdeadbeef); ret = pGetLocaleInfoEx(dummyW, LOCALE_SNAME, bufferW, ARRAY_SIZE(bufferW)); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
while (*ptr->name) { val = 0; pGetLocaleInfoEx(ptr->name, LOCALE_ILANGUAGE|LOCALE_RETURN_NUMBER, (WCHAR*)&val, sizeof(val)/sizeof(WCHAR)); - ok(val == ptr->lcid, "%s: got wrong lcid 0x%04x, expected 0x%04x\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); + ok(val == ptr->lcid, "%s: got wrong lcid 0x%04lx, expected 0x%04lx\n", wine_dbgstr_w(ptr->name), val, ptr->lcid); bufferW[0] = 0; ret = pGetLocaleInfoEx(ptr->name, LOCALE_SNAME, bufferW, ARRAY_SIZE(bufferW)); ok(ret == lstrlenW(bufferW)+1, "%s: got ret value %d\n", wine_dbgstr_w(ptr->name), ret); @@ -4779,15 +4779,15 @@ static void test_CompareStringOrdinal(void) SetLastError(0xdeadbeef); ret = pCompareStringOrdinal(NULL, 0, NULL, 0, FALSE); ok(!ret, "Got %u, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got %x, expected %x\n", GetLastError(), ERROR_INVALID_PARAMETER); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got %lx, expected %x\n", GetLastError(), ERROR_INVALID_PARAMETER); SetLastError(0xdeadbeef); ret = pCompareStringOrdinal(test1, -1, NULL, 0, FALSE); ok(!ret, "Got %u, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got %x, expected %x\n", GetLastError(), ERROR_INVALID_PARAMETER); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got %lx, expected %x\n", GetLastError(), ERROR_INVALID_PARAMETER); SetLastError(0xdeadbeef); ret = pCompareStringOrdinal(NULL, 0, test1, -1, FALSE); ok(!ret, "Got %u, expected 0\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got %x, expected %x\n", GetLastError(), ERROR_INVALID_PARAMETER); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got %lx, expected %x\n", GetLastError(), ERROR_INVALID_PARAMETER);
/* Check case */ ret = pCompareStringOrdinal(test1, -1, test1, -1, FALSE); @@ -4857,7 +4857,7 @@ static void test_GetGeoInfo(void) ret = pGetGeoInfoA(344, GEO_ISO2, NULL, 0, 0); ok(ret == 0, "got %d\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER || - broken(GetLastError() == 0xdeadbeef /* Win10 */), "got %d\n", GetLastError()); + broken(GetLastError() == 0xdeadbeef /* Win10 */), "got %ld\n", GetLastError());
ret = pGetGeoInfoA(203, GEO_ISO2, NULL, 0, 0); ok(ret == 3, "got %d\n", ret); @@ -4886,7 +4886,7 @@ static void test_GetGeoInfo(void) ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 2, 0); ok(ret == 0, "got %d\n", ret); ok(!strcmp(buffA, "RU"), "got %s\n", buffA); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %ld\n", GetLastError());
/* GEO_NATION returns GEOID in a string form, but only for GEOCLASS_NATION-type IDs */ ret = pGetGeoInfoA(203, GEO_NATION, buffA, 20, 0); /* GEOCLASS_NATION */ @@ -4951,16 +4951,16 @@ static void test_GetGeoInfo(void) SetLastError(0xdeadbeef); ret = pGetGeoInfoA(203, GEO_ID + 1, NULL, 0, 0); ok(ret == 0, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_FLAGS, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_FLAGS, "got %ld\n", GetLastError()); }
static int geoidenum_count; static BOOL CALLBACK test_geoid_enumproc(GEOID geoid) { INT ret = pGetGeoInfoA(geoid, GEO_ISO2, NULL, 0, 0); - ok(ret == 3, "got %d for %d\n", ret, geoid); + ok(ret == 3, "got %d for %ld\n", ret, geoid); /* valid geoid starts at 2 */ - ok(geoid >= 2, "got geoid %d\n", geoid); + ok(geoid >= 2, "got geoid %ld\n", geoid);
return geoidenum_count++ < 5; } @@ -4984,17 +4984,17 @@ static void test_EnumSystemGeoID(void) SetLastError(0xdeadbeef); ret = pEnumSystemGeoID(GEOCLASS_NATION, 0, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = pEnumSystemGeoID(GEOCLASS_NATION+1, 0, test_geoid_enumproc); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_FLAGS, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_FLAGS, "got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = pEnumSystemGeoID(GEOCLASS_NATION+1, 0, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
ret = pEnumSystemGeoID(GEOCLASS_NATION, 0, test_geoid_enumproc); ok(ret, "got %d\n", ret); @@ -5176,7 +5176,7 @@ static void test_invariant(void) { len = strlen(ptr->expect)+1; /* include \0 */ ok(ret == len || (ptr->expect2 && ret == strlen(ptr->expect2)+1), - "For id %d, expected ret == %d, got %d, error %d\n", + "For id %d, expected ret == %d, got %d, error %ld\n", ptr->id, len, ret, GetLastError()); ok(!strcmp(buffer, ptr->expect) || (ptr->expect2 && !strcmp(buffer, ptr->expect2)), "For id %d, Expected %s, got '%s'\n", @@ -5202,16 +5202,16 @@ static void test_invariant(void)
ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SLANGUAGE, buffer, sizeof(buffer)); len = lstrlenA(lang) + 1; - ok(ret == len, "Expected ret == %d, got %d, error %d\n", len, ret, GetLastError()); + ok(ret == len, "Expected ret == %d, got %d, error %ld\n", len, ret, GetLastError()); ok(!strcmp(buffer, lang), "Expected %s, got '%s'\n", lang, buffer);
ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SCOUNTRY, buffer, sizeof(buffer)); len = lstrlenA(cntry) + 1; - ok(ret == len, "Expected ret == %d, got %d, error %d\n", len, ret, GetLastError()); + ok(ret == len, "Expected ret == %d, got %d, error %ld\n", len, ret, GetLastError()); ok(!strcmp(buffer, cntry), "Expected %s, got '%s'\n", cntry, buffer);
ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SSORTNAME, buffer, sizeof(buffer)); - ok(ret, "Failed err %d\n", GetLastError()); + ok(ret, "Failed err %ld\n", GetLastError()); ok(!strcmp(buffer, sortm) || !strcmp(buffer, sortd) || !strcmp(buffer, sortms), "Got '%s'\n", buffer); } } @@ -5236,28 +5236,28 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(0, &count, NULL, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size);
size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_LANGUAGE_NAME, &count, NULL, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
count = 0; size = 0; @@ -5265,7 +5265,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size); + ok(size % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size);
count = 0; size = 0; @@ -5273,7 +5273,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size);
/* second parameter * ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, NULL, NULL, &size); @@ -5286,7 +5286,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* fourth parameter * ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, NULL); @@ -5299,7 +5299,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id); + ok(size_id % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size_id);
count = 0; size_name = 0; @@ -5307,7 +5307,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size_name % 6 == 1, "Expected size (%d) %% 6 == 1\n", size_name); + ok(size_name % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size_name);
size_buffer = max(size_id, size_name); if(!size_buffer) @@ -5319,7 +5319,7 @@ static void test_GetSystemPreferredUILanguages(void) buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR)); if (!buffer) { - skip("Failed to allocate memory for %d chars\n", size_buffer); + skip("Failed to allocate memory for %ld chars\n", size_buffer); return; }
@@ -5330,7 +5330,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(0, &count, buffer, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 6 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5343,7 +5343,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size); + ok(size % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size); if (ret && size % 5 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5351,7 +5351,7 @@ static void test_GetSystemPreferredUILanguages(void) for (i = 0; buffer[i]; i++) ok(('0' <= buffer[i] && buffer[i] <= '9') || ('A' <= buffer[i] && buffer[i] <= 'F'), - "MUI_LANGUAGE_ID [%d] is bad in %s\n", i, wine_dbgstr_w(buffer)); + "MUI_LANGUAGE_ID [%ld] is bad in %s\n", i, wine_dbgstr_w(buffer));
count = 0; size = size_buffer; @@ -5359,7 +5359,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 5 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5371,7 +5371,7 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ok(ret, "Expected GetSystemPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 6 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5382,9 +5382,9 @@ static void test_GetSystemPreferredUILanguages(void) size = size_buffer; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); status = pRtlGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, 0, &count, buffer, &size); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(count, "Expected count > 0\n"); - ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size); + ok(size % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size); if (ret && size % 5 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5393,9 +5393,9 @@ static void test_GetSystemPreferredUILanguages(void) count = 0; size = size_buffer; status = pRtlGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, 0, &count, buffer, &size); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 5 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5404,9 +5404,9 @@ static void test_GetSystemPreferredUILanguages(void) count = 0; size = 0; status = pRtlGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, 0, &count, NULL, &size); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 6 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5417,16 +5417,16 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id, "expected %u, got %u\n", size_id, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id, "expected %lu, got %lu\n", size_id, size);
size = 1; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id, "expected %u, got %u\n", size_id, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id, "expected %lu, got %lu\n", size_id, size);
size = size_id -1; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); @@ -5434,8 +5434,8 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id, "expected %u, got %u\n", size_id, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id, "expected %lu, got %lu\n", size_id, size);
size = size_id -2; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); @@ -5443,8 +5443,8 @@ static void test_GetSystemPreferredUILanguages(void) ret = pGetSystemPreferredUILanguages(0, &count, buffer, &size); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id + 2 || size == size_id + 1 /* before win10 1809 */, "expected %u, got %u\n", size_id + 2, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id + 2 || size == size_id + 1 /* before win10 1809 */, "expected %lu, got %lu\n", size_id + 2, size);
HeapFree(GetProcessHeap(), 0, buffer); } @@ -5464,19 +5464,19 @@ static void test_GetThreadPreferredUILanguages(void)
size = count = 0; ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID|MUI_UI_FALLBACK, &count, NULL, &size); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(count, "expected count > 0\n"); ok(size, "expected size > 0\n");
count = 0; buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size * sizeof(WCHAR)); ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID|MUI_UI_FALLBACK, &count, buf, &size); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(count, "expected count > 0\n");
size_id = count = 0; ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(count, "expected count > 0\n"); ok(size_id, "expected size > 0\n"); ok(size_id <= size, "expected size > 0\n"); @@ -5484,7 +5484,7 @@ static void test_GetThreadPreferredUILanguages(void) /* ntdll function is the same */ size_id = count = 0; status = pRtlGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(count, "expected count > 0\n"); ok(size_id, "expected size > 0\n"); ok(size_id <= size, "expected size > 0\n"); @@ -5494,33 +5494,33 @@ static void test_GetThreadPreferredUILanguages(void) ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id, "expected %u, got %u\n", size_id, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id, "expected %lu, got %lu\n", size_id, size);
size = 1; SetLastError(0xdeadbeef); ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id, "expected %u, got %u\n", size_id, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id, "expected %lu, got %lu\n", size_id, size);
size = size_id - 1; SetLastError(0xdeadbeef); ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(size == size_id, "expected %u, got %u\n", size_id, size); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(size == size_id, "expected %lu, got %lu\n", size_id, size);
size = size_id - 2; SetLastError(0xdeadbeef); ret = pGetThreadPreferredUILanguages(0, &count, buf, &size); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); todo_wine - ok(size == size_id || size == size_id - 1 /* before win10 1809 */, "expected %u, got %u\n", size_id, size); + ok(size == size_id || size == size_id - 1 /* before win10 1809 */, "expected %lu, got %lu\n", size_id, size);
HeapFree(GetProcessHeap(), 0, buf); } @@ -5543,28 +5543,28 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
size = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
size = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
size = 1; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected error ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
count = 0; size_id = 0; @@ -5572,7 +5572,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); ok(ret, "Expected GetUserPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id); + ok(size_id % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size_id);
count = 0; size_name = 0; @@ -5580,7 +5580,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name); ok(ret, "Expected GetUserPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size_name % 6 == 1, "Expected size (%d) %% 6 == 1\n", size_name); + ok(size_name % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size_name);
size_buffer = max(size_id, size_name); if(!size_buffer) @@ -5594,9 +5594,9 @@ static void test_GetUserPreferredUILanguages(void) size_id = 0; SetLastError(0xdeadbeef); status = pRtlGetUserPreferredUILanguages(MUI_LANGUAGE_ID, 0, &count, NULL, &size_id); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(count, "Expected count > 0\n"); - ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id); + ok(size_id % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size_id);
buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR));
@@ -5607,7 +5607,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(0, &count, buffer, &size); ok(ret, "Expected GetUserPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 6 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5620,7 +5620,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(ret, "Expected GetUserPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size); + ok(size % 5 == 1, "Expected size (%ld) %% 5 == 1\n", size); if (ret && size % 5 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5632,7 +5632,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size); ok(ret, "Expected GetUserPreferredUILanguages to succeed\n"); ok(count, "Expected count > 0\n"); - ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); + ok(size % 6 == 1, "Expected size (%ld) %% 6 == 1\n", size); if (ret && size % 5 == 1) ok(!buffer[size -2] && !buffer[size -1], "Expected last two WCHARs being empty, got 0x%x 0x%x\n", @@ -5643,7 +5643,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
size = size_id -1; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); @@ -5651,7 +5651,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
count = 0; size = size_id -2; @@ -5660,7 +5660,7 @@ static void test_GetUserPreferredUILanguages(void) ret = pGetUserPreferredUILanguages(0, &count, buffer, &size); ok(!ret, "Expected GetUserPreferredUILanguages to fail\n"); ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + "Expected error ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, buffer); } @@ -5717,35 +5717,35 @@ static void test_FindNLSStringEx(void) 3, NULL, NULL, NULL, 0); ok(res, "Expected failure of FindNLSStringEx. Return value was %d\n", res); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected ERROR_INVALID_PARAMETER as last error; got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER as last error; got %ld\n", GetLastError());
SetLastError( 0xdeadbeef ); res = pFindNLSStringEx(localeW, FIND_FROMSTART, NULL, 3, fooW, 3, NULL, NULL, NULL, 0); ok(res, "Expected failure of FindNLSStringEx. Return value was %d\n", res); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected ERROR_INVALID_PARAMETER as last error; got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER as last error; got %ld\n", GetLastError());
SetLastError( 0xdeadbeef ); res = pFindNLSStringEx(localeW, FIND_FROMSTART, fooW, -5, fooW, 3, NULL, NULL, NULL, 0); ok(res, "Expected failure of FindNLSStringEx. Return value was %d\n", res); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected ERROR_INVALID_PARAMETER as last error; got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER as last error; got %ld\n", GetLastError());
SetLastError( 0xdeadbeef ); res = pFindNLSStringEx(localeW, FIND_FROMSTART, fooW, 3, NULL, 3, NULL, NULL, NULL, 0); ok(res, "Expected failure of FindNLSStringEx. Return value was %d\n", res); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected ERROR_INVALID_PARAMETER as last error; got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER as last error; got %ld\n", GetLastError());
SetLastError( 0xdeadbeef ); res = pFindNLSStringEx(localeW, FIND_FROMSTART, fooW, 3, fooW, -5, NULL, NULL, NULL, 0); ok(res, "Expected failure of FindNLSStringEx. Return value was %d\n", res); ok(ERROR_INVALID_PARAMETER == GetLastError(), - "Expected ERROR_INVALID_PARAMETER as last error; got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER as last error; got %ld\n", GetLastError());
for (ptest = test_arr; ptest->src != NULL; ptest++) { @@ -5840,7 +5840,7 @@ static void test_FindStringOrdinal(void) tests[i].ignore_case); err = GetLastError(); ok(ret == tests[i].ret, "Item %d expected %d, got %d\n", i, tests[i].ret, ret); - ok(err == tests[i].err, "Item %d expected %#x, got %#x\n", i, tests[i].err, err); + ok(err == tests[i].err, "Item %d expected %#lx, got %#lx\n", i, tests[i].err, err); } }
@@ -6070,11 +6070,11 @@ static void test_NormalizeString(void) dstlen = pNormalizeString( norm_forms[i], ptest->str, -1, NULL, 0 ); ok( dstlen > lstrlenW(ptest->str), "%s:%d: wrong len %d / %d\n", wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW(ptest->str) ); - ok(GetLastError() == ERROR_SUCCESS, "%s:%d: got error %u\n", + ok(GetLastError() == ERROR_SUCCESS, "%s:%d: got error %lu\n", wine_dbgstr_w(ptest->str), i, GetLastError()); SetLastError(0xdeadbeef); dstlen = pNormalizeString( norm_forms[i], ptest->str, -1, dst, dstlen ); - ok(GetLastError() == ERROR_SUCCESS, "%s:%d: got error %u\n", + ok(GetLastError() == ERROR_SUCCESS, "%s:%d: got error %lu\n", wine_dbgstr_w(ptest->str), i, GetLastError()); ok(dstlen == lstrlenW( dst )+1, "%s:%d: Copied length differed: was %d, should be %d\n", wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW( dst )+1); @@ -6095,12 +6095,12 @@ static void test_NormalizeString(void) { dstlen = 0; status = pRtlNormalizeString( norm_forms[i], ptest->str, lstrlenW(ptest->str), NULL, &dstlen ); - ok( !status, "%s:%d: failed %x\n", wine_dbgstr_w(ptest->str), i, status ); + ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status ); ok( dstlen > lstrlenW(ptest->str), "%s:%d: wrong len %d / %d\n", wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW(ptest->str) ); memset(dst, 0, sizeof(dst)); status = pRtlNormalizeString( norm_forms[i], ptest->str, lstrlenW(ptest->str), dst, &dstlen ); - ok( !status, "%s:%d: failed %x\n", wine_dbgstr_w(ptest->str), i, status ); + ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status ); ok(dstlen == lstrlenW( dst ), "%s:%d: Copied length differed: was %d, should be %d\n", wine_dbgstr_w(ptest->str), i, dstlen, lstrlenW( dst )); str_cmp = wcsncmp( ptest->expected[i], dst, dstlen ); @@ -6108,14 +6108,14 @@ static void test_NormalizeString(void) wine_dbgstr_w(dst), wine_dbgstr_w(ptest->expected[i]) ); ret = FALSE; status = pRtlIsNormalizedString( norm_forms[i], ptest->str, -1, &ret ); - ok( !status, "%s:%d: failed %x\n", wine_dbgstr_w(ptest->str), i, status ); + ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status ); if (!wcscmp( ptest->str, dst )) ok( ret, "%s:%d: not normalized\n", wine_dbgstr_w(ptest->str), i ); else ok( !ret, "%s:%d: normalized (dst %s)\n", wine_dbgstr_w(ptest->str), i, wine_dbgstr_w(dst) ); ret = FALSE; status = pRtlIsNormalizedString( norm_forms[i], dst, dstlen, &ret ); - ok( !status, "%s:%d: failed %x\n", wine_dbgstr_w(ptest->str), i, status ); + ok( !status, "%s:%d: failed %lx\n", wine_dbgstr_w(ptest->str), i, status ); ok( ret, "%s:%d: not normalized\n", wine_dbgstr_w(ptest->str), i ); } } @@ -6127,32 +6127,32 @@ static void test_NormalizeString(void) SetLastError(0xdeadbeef); dstlen = pNormalizeString( NormalizationD, part0_str1, -1, dst, 1 ); ok( dstlen <= 0, "wrong len %d\n", dstlen ); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); dstlen = pNormalizeString( NormalizationC, part0_str2, -1, dst, 1 ); ok( dstlen <= 0, "wrong len %d\n", dstlen ); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); dstlen = pNormalizeString( NormalizationC, part0_str2, -1, NULL, 0 ); ok( dstlen == 12, "wrong len %d\n", dstlen ); - ok(GetLastError() == ERROR_SUCCESS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); dstlen = pNormalizeString( NormalizationC, part0_str2, -1, dst, 3 ); ok( dstlen == 3, "wrong len %d\n", dstlen ); - ok(GetLastError() == ERROR_SUCCESS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); dstlen = pNormalizeString( NormalizationC, part0_str2, 0, NULL, 0 ); ok( dstlen == 0, "wrong len %d\n", dstlen ); - ok(GetLastError() == ERROR_SUCCESS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); dstlen = pNormalizeString( NormalizationC, part0_str2, 0, dst, 3 ); ok( dstlen == 0, "wrong len %d\n", dstlen ); - ok(GetLastError() == ERROR_SUCCESS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError());
/* size estimations */
@@ -6169,7 +6169,7 @@ static void test_NormalizeString(void) { dstlen = 0; status = pRtlNormalizeString( norm_forms[i], dst, j, NULL, &dstlen ); - ok( !status, "%d: failed %x\n", i, status ); + ok( !status, "%d: failed %lx\n", i, status ); ok( dstlen == expect, "%d: %d -> wrong len %d\n", i, j, dstlen ); } } @@ -6184,28 +6184,28 @@ static void test_NormalizeString(void) if (i == 0 || i == 2) { ok( dstlen == srclen, "%d: wrong len %d\n", i, dstlen ); - ok(GetLastError() == ERROR_SUCCESS, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "got error %lu\n", GetLastError()); } else { ok( dstlen < -expect, "%d: wrong len %d\n", i, dstlen ); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError()); } if (pRtlNormalizeString) { dstlen = 0; status = pRtlNormalizeString( norm_forms[i], composite_src, srclen, NULL, &dstlen ); - ok( !status, "%d: failed %x\n", i, status ); + ok( !status, "%d: failed %lx\n", i, status ); ok( dstlen == expect, "%d: wrong len %d\n", i, dstlen ); status = pRtlNormalizeString( norm_forms[i], composite_src, srclen, dst, &dstlen ); if (i == 0 || i == 2) { - ok( !status, "%d: failed %x\n", i, status ); + ok( !status, "%d: failed %lx\n", i, status ); ok( dstlen == srclen, "%d: wrong len %d\n", i, dstlen ); } else { - ok( status == STATUS_BUFFER_TOO_SMALL, "%d: failed %x\n", i, status ); + ok( status == STATUS_BUFFER_TOO_SMALL, "%d: failed %lx\n", i, status ); ok( dstlen > expect, "%d: wrong len %d\n", i, dstlen ); } } @@ -6225,11 +6225,11 @@ static void test_NormalizeString(void) case NormalizationKD: case 13: /* Idn */ ok( dstlen > 0, "%d: wrong len %d\n", i, dstlen ); - ok( GetLastError() == ERROR_SUCCESS, "%d: got error %u\n", i, GetLastError()); + ok( GetLastError() == ERROR_SUCCESS, "%d: got error %lu\n", i, GetLastError()); break; default: ok( dstlen <= 0, "%d: wrong len %d\n", i, dstlen ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "%d: got error %u\n", i, GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "%d: got error %lu\n", i, GetLastError()); break; } if (pRtlNormalizeString) @@ -6239,17 +6239,17 @@ static void test_NormalizeString(void) switch (i) { case 0: - ok( status == STATUS_INVALID_PARAMETER, "%d: failed %x\n", i, status ); + ok( status == STATUS_INVALID_PARAMETER, "%d: failed %lx\n", i, status ); break; case NormalizationC: case NormalizationD: case NormalizationKC: case NormalizationKD: case 13: /* Idn */ - ok( status == STATUS_SUCCESS, "%d: failed %x\n", i, status ); + ok( status == STATUS_SUCCESS, "%d: failed %lx\n", i, status ); break; default: - ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%d: failed %x\n", i, status ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "%d: failed %lx\n", i, status ); break; } } @@ -6264,38 +6264,38 @@ static void test_NormalizeString(void) SetLastError( 0xdeadbeef ); dstlen = pNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, ARRAY_SIZE(dst) ); ok( dstlen == -3, "%d: wrong len %d\n", i, dstlen ); - ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%d: wrong error %d\n", i, GetLastError() ); + ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%d: wrong error %ld\n", i, GetLastError() ); dstlen = pNormalizeString( norm_forms[i], L"ABCD\xdc12Z", -1, NULL, 0 ); ok( dstlen == (i < 2 ? 21 : 64), "%d: wrong len %d\n", i, dstlen ); SetLastError( 0xdeadbeef ); dstlen = pNormalizeString( norm_forms[i], L"ABCD\xdc12Z", -1, dst, ARRAY_SIZE(dst) ); ok( dstlen == -4, "%d: wrong len %d\n", i, dstlen ); - ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%d: wrong error %d\n", i, GetLastError() ); + ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "%d: wrong error %ld\n", i, GetLastError() ); SetLastError( 0xdeadbeef ); dstlen = pNormalizeString( norm_forms[i], L"ABCD\xdc12Z", -1, dst, 2 ); todo_wine ok( dstlen == (i < 2 ? -18 : -74), "%d: wrong len %d\n", i, dstlen ); todo_wine_if (i == 0 || i == 2) - ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "%d: wrong error %d\n", i, GetLastError() ); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "%d: wrong error %ld\n", i, GetLastError() ); if (pRtlNormalizeString) { dstlen = 0; status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, NULL, &dstlen ); - ok( !status, "%d: failed %x\n", i, status ); + ok( !status, "%d: failed %lx\n", i, status ); ok( dstlen == (i < 2 ? 15 : 64), "%d: wrong len %d\n", i, dstlen ); dstlen = ARRAY_SIZE(dst); status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, &dstlen ); - ok( status == STATUS_NO_UNICODE_TRANSLATION, "%d: failed %x\n", i, status ); + ok( status == STATUS_NO_UNICODE_TRANSLATION, "%d: failed %lx\n", i, status ); ok( dstlen == 3, "%d: wrong len %d\n", i, dstlen ); dstlen = 1; status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, &dstlen ); todo_wine_if( i == 0 || i == 2) - ok( status == STATUS_BUFFER_TOO_SMALL, "%d: failed %x\n", i, status ); + ok( status == STATUS_BUFFER_TOO_SMALL, "%d: failed %lx\n", i, status ); todo_wine_if( i != 3) ok( dstlen == (i < 2 ? 14 : 73), "%d: wrong len %d\n", i, dstlen ); dstlen = 2; status = pRtlNormalizeString( norm_forms[i], L"AB\xd800Z", -1, dst, &dstlen ); - ok( status == STATUS_NO_UNICODE_TRANSLATION, "%d: failed %x\n", i, status ); + ok( status == STATUS_NO_UNICODE_TRANSLATION, "%d: failed %lx\n", i, status ); ok( dstlen == 3, "%d: wrong len %d\n", i, dstlen ); } } @@ -6343,14 +6343,14 @@ static void test_NormalizeString(void)
ret = FALSE; status = pRtlIsNormalizedString( norm_forms[i], srcW, -1, &ret ); - ok( !status, "line %u form %u: RtlIsNormalizedString failed %x\n", line, i, status ); + ok( !status, "line %u form %u: RtlIsNormalizedString failed %lx\n", line, i, status ); if (!wcscmp( srcW, dstW )) ok( ret, "line %u form %u: source not normalized %s\n", line, i, wine_dbgstr_w(srcW) ); else ok( !ret, "line %u form %u: source normalized %s\n", line, i, wine_dbgstr_w(srcW) ); ret = FALSE; status = pRtlIsNormalizedString( norm_forms[i], dstW, -1, &ret ); - ok( !status, "line %u form %u: RtlIsNormalizedString failed %x\n", line, i, status ); + ok( !status, "line %u form %u: RtlIsNormalizedString failed %lx\n", line, i, status ); ok( ret, "line %u form %u: dest not normalized %s\n", line, i, wine_dbgstr_w(dstW) );
for (j = 0; j < 4; j++) @@ -6383,10 +6383,10 @@ static void test_NormalizeString(void) ok( dstlen <= 0, "char %04x form %u: wrong result %d %s expected error\n", ch, i, dstlen, wine_dbgstr_w( dstW )); ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, - "char %04x form %u: error %u\n", str[0], i, GetLastError() ); + "char %04x form %u: error %lu\n", str[0], i, GetLastError() ); status = pRtlIsNormalizedString( norm_forms[i], str, -1, &ret ); ok( status == STATUS_NO_UNICODE_TRANSLATION, - "char %04x form %u: failed %x\n", ch, i, status ); + "char %04x form %u: failed %lx\n", ch, i, status ); } else { @@ -6395,7 +6395,7 @@ static void test_NormalizeString(void) ch, i, wine_dbgstr_w( dstW )); ret = FALSE; status = pRtlIsNormalizedString( norm_forms[i], str, -1, &ret ); - ok( !status, "char %04x form %u: failed %x\n", ch, i, status ); + ok( !status, "char %04x form %u: failed %lx\n", ch, i, status ); ok( ret, "char %04x form %u: not normalized\n", ch, i ); } } @@ -6604,7 +6604,7 @@ static void test_NLSVersion(void) info.dwNLSVersionInfoSize = offsetof( NLSVERSIONINFO, dwEffectiveId ); ret = pGetNLSVersion( COMPARE_STRING, MAKELANGID( LANG_FRENCH, SUBLANG_FRENCH_CANADIAN ), (NLSVERSIONINFO *)&info ); - ok( ret, "GetNLSVersion failed err %u\n", GetLastError() ); + ok( ret, "GetNLSVersion failed err %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); memset( &info, 0xcc, sizeof(info) ); @@ -6612,11 +6612,11 @@ static void test_NLSVersion(void) ret = pGetNLSVersion( COMPARE_STRING, MAKELANGID( LANG_FRENCH, SUBLANG_FRENCH_CANADIAN ), (NLSVERSIONINFO *)&info ); ok( ret || GetLastError() == ERROR_INSUFFICIENT_BUFFER /* < Vista */, - "GetNLSVersion failed err %u\n", GetLastError() ); + "GetNLSVersion failed err %lu\n", GetLastError() ); if (ret) { ok( info.dwEffectiveId == MAKELANGID( LANG_FRENCH, SUBLANG_FRENCH_CANADIAN ), - "wrong id %x\n", info.dwEffectiveId ); + "wrong id %lx\n", info.dwEffectiveId ); ok( IsEqualIID( &info.guidCustomVersion, &guid_fr ) || broken( IsEqualIID( &info.guidCustomVersion, &guid_null )), /* <= win7 */ "wrong guid %s\n", debugstr_guid(&info.guidCustomVersion) ); @@ -6626,7 +6626,7 @@ static void test_NLSVersion(void) info.dwNLSVersionInfoSize = 8; ret = pGetNLSVersion( COMPARE_STRING, LOCALE_USER_DEFAULT, (NLSVERSIONINFO *)&info ); ok( !ret, "GetNLSVersion succeeded\n" ); - ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); @@ -6634,13 +6634,13 @@ static void test_NLSVersion(void) ok( !ret, "GetNLSVersion succeeded\n" ); ok( GetLastError() == ERROR_INVALID_FLAGS || broken( GetLastError() == ERROR_INSUFFICIENT_BUFFER ), /* win2003 */ - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); ret = pGetNLSVersion( COMPARE_STRING, 0xdeadbeef, (NLSVERSIONINFO *)&info ); ok( !ret, "GetNLSVersion succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
if (pGetNLSVersionEx) { @@ -6648,13 +6648,13 @@ static void test_NLSVersion(void) memset( &info, 0xcc, sizeof(info) ); info.dwNLSVersionInfoSize = sizeof(info); ret = pGetNLSVersionEx( COMPARE_STRING, L"ja-JP", &info ); - ok( ret, "GetNLSVersionEx failed err %u\n", GetLastError() ); + ok( ret, "GetNLSVersionEx failed err %lu\n", GetLastError() ); ok( info.dwEffectiveId == MAKELANGID( LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN ), - "wrong id %x\n", info.dwEffectiveId ); + "wrong id %lx\n", info.dwEffectiveId ); ok( IsEqualIID( &info.guidCustomVersion, &guid_ja ) || broken( IsEqualIID( &info.guidCustomVersion, &guid_null )), /* <= win7 */ "wrong guid %s\n", debugstr_guid(&info.guidCustomVersion) ); - trace( "version %08x %08x %08x %s\n", info.dwNLSVersion, info.dwDefinedVersion, info.dwEffectiveId, + trace( "version %08lx %08lx %08lx %s\n", info.dwNLSVersion, info.dwDefinedVersion, info.dwEffectiveId, debugstr_guid(&info.guidCustomVersion) );
SetLastError( 0xdeadbeef ); @@ -6665,7 +6665,7 @@ static void test_NLSVersion(void) if (ret) { ok( info.dwEffectiveId == MAKELANGID( LANG_FRENCH, SUBLANG_DEFAULT ), - "wrong id %x\n", info.dwEffectiveId ); + "wrong id %lx\n", info.dwEffectiveId ); ok( IsEqualIID( &info.guidCustomVersion, &guid_fr ) || broken( IsEqualIID( &info.guidCustomVersion, &guid_null )), /* <= win7 */ "wrong guid %s\n", debugstr_guid(&info.guidCustomVersion) ); @@ -6675,36 +6675,36 @@ static void test_NLSVersion(void) info.dwNLSVersionInfoSize = sizeof(info) - 1; ret = pGetNLSVersionEx( COMPARE_STRING, L"en-US", &info ); ok( !ret, "GetNLSVersionEx succeeded\n" ); - ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); memset( &info, 0xcc, sizeof(info) ); info.dwNLSVersionInfoSize = offsetof( NLSVERSIONINFO, dwEffectiveId ); ret = pGetNLSVersionEx( COMPARE_STRING, L"en-US", &info ); - ok( ret, "GetNLSVersionEx failed err %u\n", GetLastError() ); - ok( info.dwEffectiveId == 0xcccccccc, "wrong id %x\n", info.dwEffectiveId ); + ok( ret, "GetNLSVersionEx failed err %lu\n", GetLastError() ); + ok( info.dwEffectiveId == 0xcccccccc, "wrong id %lx\n", info.dwEffectiveId );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); ret = pGetNLSVersionEx( 2, L"en-US", &info ); ok( !ret, "GetNLSVersionEx succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_FLAGS, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_FLAGS, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); ret = pGetNLSVersionEx( COMPARE_STRING, L"foobar", &info ); ok( !ret, "GetNLSVersionEx succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); memset( &info, 0xcc, sizeof(info) ); info.dwNLSVersionInfoSize = sizeof(info); ret = pGetNLSVersionEx( COMPARE_STRING, L"zz-XX", &info ); - if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); ok( !ret == !pIsValidLocaleName(L"zz-XX"), "GetNLSVersionEx doesn't match IsValidLocaleName\n" ); if (ret) { - ok( info.dwEffectiveId == LOCALE_CUSTOM_UNSPECIFIED, "wrong id %x\n", info.dwEffectiveId ); + ok( info.dwEffectiveId == LOCALE_CUSTOM_UNSPECIFIED, "wrong id %lx\n", info.dwEffectiveId ); ok( IsEqualIID( &info.guidCustomVersion, &guid_def ), "wrong guid %s\n", debugstr_guid(&info.guidCustomVersion) ); } @@ -6713,15 +6713,15 @@ static void test_NLSVersion(void) memset( &info, 0xcc, sizeof(info) ); info.dwNLSVersionInfoSize = sizeof(info); ret = pGetNLSVersionEx( COMPARE_STRING, LOCALE_NAME_INVARIANT, &info ); - ok( ret, "GetNLSVersionEx failed err %u\n", GetLastError() ); + ok( ret, "GetNLSVersionEx failed err %lu\n", GetLastError() ); if (ret) { - ok( info.dwEffectiveId == LOCALE_INVARIANT, "wrong id %x\n", info.dwEffectiveId ); + ok( info.dwEffectiveId == LOCALE_INVARIANT, "wrong id %lx\n", info.dwEffectiveId ); ok( IsEqualIID( &info.guidCustomVersion, &guid_def ) || broken( IsEqualIID( &info.guidCustomVersion, &guid_null )), /* <= win7 */ "wrong guid %s\n", debugstr_guid(&info.guidCustomVersion) ); } - else ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + else ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } else win_skip( "GetNLSVersionEx not available\n" );
@@ -6733,73 +6733,73 @@ static void test_NLSVersion(void) SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); ret = pIsValidNLSVersion( COMPARE_STRING, L"ja-JP", &info ); - ok( ret, "IsValidNLSVersion failed err %u\n", GetLastError() ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( ret, "IsValidNLSVersion failed err %lu\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = offsetof( NLSVERSIONINFO, dwEffectiveId ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); - ok( ret, "IsValidNLSVersion failed err %u\n", GetLastError() ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( ret, "IsValidNLSVersion failed err %lu\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); ret = pIsValidNLSVersion( 2, L"en-US", &info ); ok( !ret, "IsValidNLSVersion succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); info.dwNLSVersionInfoSize = sizeof(info); ret = pIsValidNLSVersion( COMPARE_STRING, L"foobar", &info ); ok( !ret, "IsValidNLSVersion succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); memset( &info, 0xcc, sizeof(info) ); info.dwNLSVersionInfoSize = sizeof(info); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); ok( !ret, "IsValidNLSVersion succeeded\n" ); - ok( GetLastError() == ERROR_SUCCESS, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SUCCESS, "wrong error %lu\n", GetLastError() );
info.dwNLSVersionInfoSize = sizeof(info); pGetNLSVersion( COMPARE_STRING, LOCALE_USER_DEFAULT, (NLSVERSIONINFO *)&info ); info.dwNLSVersion++; SetLastError( 0xdeadbeef ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); - ok( ret, "IsValidNLSVersion failed err %u\n", GetLastError() ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( ret, "IsValidNLSVersion failed err %lu\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
info.dwNLSVersion += 0x100; SetLastError( 0xdeadbeef ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); ok( !ret, "IsValidNLSVersion succeeded\n" ); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError() );
info.dwNLSVersion -= 0x800; SetLastError( 0xdeadbeef ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); ok( !ret, "IsValidNLSVersion succeeded\n" ); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError() );
info.dwNLSVersion += 0x700; info.dwDefinedVersion += 0x100; SetLastError( 0xdeadbeef ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); - ok( ret, "IsValidNLSVersion failed err %u\n", GetLastError() ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( ret, "IsValidNLSVersion failed err %lu\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
info.dwDefinedVersion -= 0x100; info.guidCustomVersion.Data1 = 0x123; SetLastError( 0xdeadbeef ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); ok( !ret, "IsValidNLSVersion succeeded\n" ); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError() );
info.guidCustomVersion = guid_null; SetLastError( 0xdeadbeef ); ret = pIsValidNLSVersion( COMPARE_STRING, L"en-US", &info ); - ok( ret, "IsValidNLSVersion failed err %u\n", GetLastError() ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( ret, "IsValidNLSVersion failed err %lu\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() ); } else win_skip( "IsValidNLSVersion not available\n" ); } @@ -6822,7 +6822,7 @@ static void test_geo_name(void) }
status = RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\International\Geo", 0, KEY_READ | KEY_WRITE, &key); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status);
size = sizeof(reg_name); if (!RegQueryValueExW(key, L"Name", NULL, &type, (BYTE *)reg_name, &size)) @@ -6837,7 +6837,7 @@ static void test_geo_name(void) if (have_name) { status = RegSetValueExW(key, L"Name", 0, REG_SZ, (BYTE *)reg_name, (lstrlenW(reg_name) + 1) * sizeof(*reg_name)); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); } else { @@ -6856,136 +6856,136 @@ static void test_geo_name(void)
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(NULL, 0); - ok((ret == 3 || ret == 4) && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok((ret == 3 || ret == 4) && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); name_size = ret;
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, 0); - ok(ret >= 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret >= 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, 2); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(NULL, 1); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(NULL, name_size); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, name_size); - ok(ret == name_size && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == name_size && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"QQ"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
SetLastError(0xdeadbeef); bret = pSetUserGeoName(NULL); - ok(!bret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + ok(!bret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError());
lstrcpyW(set_name, L"QQ"); SetLastError(0xdeadbeef); bret = pSetUserGeoName(set_name); - ok(!bret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + ok(!bret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError());
lstrcpyW(set_name, L"Xx"); SetLastError(0xdeadbeef); bret = pSetUserGeoName(set_name); ok((bret && GetLastError() == 0xdeadbeef) || broken(bret && GetLastError() == 0), - "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError());
SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 4 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 4 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"001"), "Got unexpected name %s.\n", wine_dbgstr_w(buf)); geoid = GetUserGeoID(GEOCLASS_REGION); - ok(geoid == 39070, "Got unexpected geoid %u.\n", geoid); + ok(geoid == 39070, "Got unexpected geoid %lu.\n", geoid); size = sizeof(buf); status = RegQueryValueExW(key, L"Name", NULL, &type, (BYTE *)buf, &size); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); - ok(type == REG_SZ, "Got unexpected type %#x.\n", type); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); + ok(type == REG_SZ, "Got unexpected type %#lx.\n", type); ok(!lstrcmpW(buf, L"001"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
lstrcpyW(set_name, L"ar"); SetLastError(0xdeadbeef); bret = pSetUserGeoName(set_name); ok((bret && GetLastError() == 0xdeadbeef) || broken(bret && GetLastError() == 0), - "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); ok((ret == 3 && GetLastError() == 0xdeadbeef) || broken(ret == 3 && GetLastError() == 0), - "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"AR"), "Got unexpected name %s.\n", wine_dbgstr_w(buf)); geoid = GetUserGeoID(GEOCLASS_NATION); - ok(geoid == 11, "Got unexpected geoid %u.\n", geoid); + ok(geoid == 11, "Got unexpected geoid %lu.\n", geoid);
lstrcpyW(set_name, L"150"); SetLastError(0xdeadbeef); bret = pSetUserGeoName(set_name); ok((bret && GetLastError() == 0xdeadbeef) || broken(bret && GetLastError() == 0), - "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); ok((ret == 4 && GetLastError() == 0xdeadbeef) || broken(ret == 4 && GetLastError() == 0), - "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"150"), "Got unexpected name %s.\n", wine_dbgstr_w(buf)); geoid = GetUserGeoID(GEOCLASS_NATION); - ok(geoid == 11, "Got unexpected geoid %u.\n", geoid); + ok(geoid == 11, "Got unexpected geoid %lu.\n", geoid);
lstrcpyW(set_name, L"150a"); SetLastError(0xdeadbeef); bret = pSetUserGeoName(set_name); - ok(!bret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + ok(!bret && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError());
bret = SetUserGeoID(21242); - ok(bret, "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"XX"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
bret = SetUserGeoID(42483); - ok(bret, "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 4 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 4 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"011"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
bret = SetUserGeoID(333); - ok(bret, "Got unexpected bret %#x, GetLastError() %u.\n", bret, GetLastError()); + ok(bret, "Got unexpected bret %#x, GetLastError() %lu.\n", bret, GetLastError()); SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"AN"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
RegDeleteValueW(key, L"Name"); RegDeleteValueW(key, L"Region"); lstrcpyW(buf, L"124"); status = RegSetValueExW(key, L"Nation", 0, REG_SZ, (BYTE *)buf, (lstrlenW(buf) + 1) * sizeof(*buf)); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"JM"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
lstrcpyW(buf, L"333"); status = RegSetValueExW(key, L"Region", 0, REG_SZ, (BYTE *)buf, (lstrlenW(buf) + 1) * sizeof(*buf)); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 3 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"JM"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
RegDeleteValueW(key, L"Nation"); SetLastError(0xdeadbeef); ret = pGetUserDefaultGeoName(buf, ARRAY_SIZE(buf)); - ok(ret == 4 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %u.\n", ret, GetLastError()); + ok(ret == 4 && GetLastError() == 0xdeadbeef, "Got unexpected ret %u, GetLastError() %lu.\n", ret, GetLastError()); ok(!lstrcmpW(buf, L"001"), "Got unexpected name %s.\n", wine_dbgstr_w(buf));
/* Restore user geo data. */ if (have_name) { status = RegSetValueExW(key, L"Name", 0, REG_SZ, (BYTE *)reg_name, (lstrlenW(reg_name) + 1) * sizeof(*reg_name)); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); } else { @@ -6994,7 +6994,7 @@ static void test_geo_name(void) if (have_nation) { status = RegSetValueExW(key, L"Nation", 0, REG_SZ, (BYTE *)nation, (lstrlenW(nation) + 1) * sizeof(*nation)); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); } else { @@ -7003,7 +7003,7 @@ static void test_geo_name(void) if (have_region) { status = RegSetValueExW(key, L"Region", 0, REG_SZ, (BYTE *)region, (lstrlenW(region) + 1) * sizeof(*region)); - ok(status == ERROR_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == ERROR_SUCCESS, "Got unexpected status %#lx.\n", status); } else { @@ -7053,7 +7053,7 @@ static void test_EnumCalendarInfoA(void)
ret = EnumCalendarInfoA( calinfo_procA, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); - ok( ret, "EnumCalendarInfoA for user default locale failed: %u\n", GetLastError() ); + ok( ret, "EnumCalendarInfoA for user default locale failed: %lu\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { @@ -7061,7 +7061,7 @@ static void test_EnumCalendarInfoA(void) ret = EnumCalendarInfoA( calinfo_procA, lcid, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, - "EnumCalendarInfoA for LCID %#06x failed: %u\n", lcid, GetLastError() ); + "EnumCalendarInfoA for LCID %#06lx failed: %lu\n", lcid, GetLastError() ); } }
@@ -7078,7 +7078,7 @@ static void test_EnumCalendarInfoW(void)
ret = EnumCalendarInfoW( calinfo_procW, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); - ok( ret, "EnumCalendarInfoW for user default locale failed: %u\n", GetLastError() ); + ok( ret, "EnumCalendarInfoW for user default locale failed: %lu\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { @@ -7086,7 +7086,7 @@ static void test_EnumCalendarInfoW(void) ret = EnumCalendarInfoW( calinfo_procW, lcid, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, - "EnumCalendarInfoW for LCID %#06x failed: %u\n", lcid, GetLastError() ); + "EnumCalendarInfoW for LCID %#06lx failed: %lu\n", lcid, GetLastError() ); } }
@@ -7104,7 +7104,7 @@ static void test_EnumCalendarInfoExA(void)
ret = EnumCalendarInfoExA( calinfoex_procA, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); - ok( ret, "EnumCalendarInfoExA for user default locale failed: %u\n", GetLastError() ); + ok( ret, "EnumCalendarInfoExA for user default locale failed: %lu\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { @@ -7112,7 +7112,7 @@ static void test_EnumCalendarInfoExA(void) ret = EnumCalendarInfoExA( calinfoex_procA, lcid, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, - "EnumCalendarInfoExA for LCID %#06x failed: %u\n", lcid, GetLastError() ); + "EnumCalendarInfoExA for LCID %#06lx failed: %lu\n", lcid, GetLastError() ); } }
@@ -7130,7 +7130,7 @@ static void test_EnumCalendarInfoExW(void)
ret = EnumCalendarInfoExW( calinfoex_procW, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); - ok( ret, "EnumCalendarInfoExW for user default locale failed: %u\n", GetLastError() ); + ok( ret, "EnumCalendarInfoExW for user default locale failed: %lu\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { @@ -7138,7 +7138,7 @@ static void test_EnumCalendarInfoExW(void) ret = EnumCalendarInfoExW( calinfoex_procW, lcid, ENUM_ALL_CALENDARS, CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, - "EnumCalendarInfoExW for LCID %#06x failed: %u\n", lcid, GetLastError() ); + "EnumCalendarInfoExW for LCID %#06lx failed: %lu\n", lcid, GetLastError() ); } }
diff --git a/dlls/kernel32/tests/mailslot.c b/dlls/kernel32/tests/mailslot.c index 7e488566dbb..a23aad96995 100644 --- a/dlls/kernel32/tests/mailslot.c +++ b/dlls/kernel32/tests/mailslot.c @@ -81,38 +81,38 @@ static int mailslot_test(void) SetLastError(0xdeadbeef); ret = ReadFile(INVALID_HANDLE_VALUE, buffer, 0, &count, NULL); ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError()); - ok(count == 0, "expected 0, got %u\n", count); + ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError()); + ok(count == 0, "expected 0, got %lu\n", count);
count = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(hSlot, buffer, 0, &count, NULL); ok(!ret, "ReadFile should fail\n"); todo_wine - ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError()); - ok(count == 0, "expected 0, got %u\n", count); + ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError()); + ok(count == 0, "expected 0, got %lu\n", count);
count = 0; memset(buffer, 0, sizeof buffer); ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ok( !ret, "slot read\n"); - if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); - else ok( count == 0, "wrong count %u\n", count ); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() ); + else ok( count == 0, "wrong count %lu\n", count ); ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot write\n"); - ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
/* now try and open the client, but with the wrong sharing mode */ hWriter = CreateFileA(szmspath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); ok( hWriter != INVALID_HANDLE_VALUE /* vista */ || GetLastError() == ERROR_SHARING_VIOLATION, - "error should be ERROR_SHARING_VIOLATION got %p / %u\n", hWriter, GetLastError()); + "error should be ERROR_SHARING_VIOLATION got %p / %lu\n", hWriter, GetLastError()); if (hWriter != INVALID_HANDLE_VALUE) CloseHandle( hWriter );
/* now open the client with the correct sharing mode */ hWriter = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError()); + ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %lu\n", GetLastError());
/* * opening a client should make no difference to @@ -120,11 +120,11 @@ static int mailslot_test(void) */ ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL); ok( !ret, "slot read\n"); - if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); - else ok( count == 0, "wrong count %u\n", count ); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() ); + else ok( count == 0, "wrong count %lu\n", count ); ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL), "slot write\n"); - ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
/* * we can't read from this client, @@ -133,13 +133,13 @@ static int mailslot_test(void) ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL), "can read client\n"); ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED, - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); ok( WriteFile( hWriter, buffer, sizeof buffer/2, &count, NULL), "can't write client\n"); ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL), "can read client\n"); ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED, - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
/* * seeing as there's something in the slot, @@ -152,8 +152,8 @@ static int mailslot_test(void) /* but not again */ ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ok( !ret, "slot read\n"); - if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); - else ok( count == 0, "wrong count %u\n", count ); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() ); + else ok( count == 0, "wrong count %lu\n", count );
/* now try open another writer... should fail */ hWriter2 = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE, @@ -214,8 +214,8 @@ static int mailslot_test(void) /* check there's still no data */ ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ok( !ret, "slot read\n"); - if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); - else ok( count == 0, "wrong count %u\n", count ); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() ); + else ok( count == 0, "wrong count %lu\n", count );
/* write two messages */ buffer[0] = 'a'; @@ -250,7 +250,7 @@ static int mailslot_test(void) "getmailslotinfo failed\n"); ok( dwNext == 1, "dwNext incorrect\n"); todo_wine - ok( dwMsgCount == 3, "dwMsgCount incorrect %u\n", dwMsgCount); + ok( dwMsgCount == 3, "dwMsgCount incorrect %lu\n", dwMsgCount);
buffer[0]=buffer[1]=0;
@@ -269,7 +269,7 @@ static int mailslot_test(void) "getmailslotinfo failed\n"); ok( dwNext == 2, "dwNext incorrect\n"); todo_wine { - ok( dwMsgCount == 2, "dwMsgCount incorrect %u\n", dwMsgCount); + ok( dwMsgCount == 2, "dwMsgCount incorrect %lu\n", dwMsgCount); }
/* read the second message */ @@ -282,9 +282,9 @@ static int mailslot_test(void) dwNext = dwMsgCount = 0; ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ), "getmailslotinfo failed\n"); - ok( dwNext == 0, "dwNext incorrect %u\n", dwNext); + ok( dwNext == 0, "dwNext incorrect %lu\n", dwNext); todo_wine { - ok( dwMsgCount == 1, "dwMsgCount incorrect %u\n", dwMsgCount); + ok( dwMsgCount == 1, "dwMsgCount incorrect %lu\n", dwMsgCount); }
/* read the 3rd (zero length) message */ @@ -307,8 +307,8 @@ static int mailslot_test(void) /* check that reads fail */ ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ok( !ret, "3rd slot read succeeded\n"); - if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); - else ok( count == 0, "wrong count %u\n", count ); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() ); + else ok( count == 0, "wrong count %lu\n", count );
/* finally close the mailslot and its client */ ok( CloseHandle( hWriter2 ), "closing 2nd client\n"); @@ -322,9 +322,9 @@ static int mailslot_test(void) memset(buffer, 0, sizeof buffer); dwTimeout = GetTickCount(); ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() ); dwTimeout = GetTickCount() - dwTimeout; - ok( dwTimeout >= 900, "timeout too short %u\n", dwTimeout ); + ok( dwTimeout >= 900, "timeout too short %lu\n", dwTimeout ); ok( CloseHandle( hSlot ), "closing the mailslot\n");
return 0; diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 6d44b50e122..9efbdba336d 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -134,7 +134,7 @@ static void create_test_dll( const char *name ) DWORD dummy; HANDLE handle = CreateFileA( name, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, 0 );
- ok( handle != INVALID_HANDLE_VALUE, "failed to create file err %u\n", GetLastError() ); + ok( handle != INVALID_HANDLE_VALUE, "failed to create file err %lu\n", GetLastError() ); WriteFile( handle, &dll_image, sizeof(dll_image), &dummy, NULL ); SetFilePointer( handle, dll_image.nt.OptionalHeader.SizeOfImage, NULL, FILE_BEGIN ); SetEndOfFile( handle ); @@ -156,7 +156,7 @@ static void testGetModuleFileName(const char* name) len1A = GetModuleFileNameA(hMod, bufA, sizeof(bufA)); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */ - "LastError was not reset: %u\n", GetLastError()); + "LastError was not reset: %lu\n", GetLastError()); ok(len1A > 0, "Getting module filename for handle %p\n", hMod);
if (is_unicode_enabled) @@ -166,15 +166,15 @@ static void testGetModuleFileName(const char* name) len1W = GetModuleFileNameW(hMod, bufW, ARRAY_SIZE(bufW)); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */ - "LastError was not reset: %u\n", GetLastError()); + "LastError was not reset: %lu\n", GetLastError()); ok(len1W > 0, "Getting module filename for handle %p\n", hMod); }
- ok(len1A == strlen(bufA), "Unexpected length of GetModuleFilenameA (%d/%d)\n", len1A, lstrlenA(bufA)); + ok(len1A == strlen(bufA), "Unexpected length of GetModuleFilenameA (%ld/%d)\n", len1A, lstrlenA(bufA));
if (is_unicode_enabled) { - ok(len1W == lstrlenW(bufW), "Unexpected length of GetModuleFilenameW (%d/%d)\n", len1W, lstrlenW(bufW)); + ok(len1W == lstrlenW(bufW), "Unexpected length of GetModuleFilenameW (%ld/%d)\n", len1W, lstrlenW(bufW)); ok(cmpStrAW(bufA, bufW, len1A, len1W), "Comparing GetModuleFilenameAW results\n"); }
@@ -189,11 +189,11 @@ static void testGetModuleFileName(const char* name) len2W = GetModuleFileNameW(hMod, bufW, len1W / 2); ok(len2W > 0, "Getting module filename for handle %p\n", hMod); ok(cmpStrAW(bufA, bufW, len2A, len2W), "Comparing GetModuleFilenameAW results with buffer too small\n" ); - ok(len1W / 2 == len2W, "Correct length in GetModuleFilenameW with buffer too small (%d/%d)\n", len1W / 2, len2W); + ok(len1W / 2 == len2W, "Correct length in GetModuleFilenameW with buffer too small (%ld/%ld)\n", len1W / 2, len2W); }
ok(len1A / 2 == len2A, - "Correct length in GetModuleFilenameA with buffer too small (%d/%d)\n", len1A / 2, len2A); + "Correct length in GetModuleFilenameA with buffer too small (%ld/%ld)\n", len1A / 2, len2A);
len1A = GetModuleFileNameA(hMod, bufA, 0x10000); ok(len1A > 0, "Getting module filename for handle %p\n", hMod); @@ -228,16 +228,16 @@ 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 %d\n", GetLastError()); + ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %ld\n", GetLastError());
fp = GetProcAddress(hModule, "CreateFileA"); ok( fp != NULL, "CreateFileA should be there\n"); - ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError()); + ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %ld\n", GetLastError());
SetLastError(0xdeadbeef); hModule1 = LoadLibraryA("kernel32 "); ok( hModule1 != NULL, ""kernel32 " should be loadable\n" ); - ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %d\n", GetLastError() ); + ok( GetLastError() == 0xdeadbeef, "GetLastError should be 0xdeadbeef but is %ld\n", GetLastError() ); ok( hModule == hModule1, "Loaded wrong module\n" ); FreeLibrary(hModule1); FreeLibrary(hModule); @@ -302,7 +302,7 @@ static void testLoadLibraryA_Wrong(void) SetLastError(0xdeadbeef); hModule = LoadLibraryA("non_ex_pv.dll"); ok( !hModule, "non_ex_pv.dll should be not loadable\n"); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "Expected ERROR_MOD_NOT_FOUND, got %d\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "Expected ERROR_MOD_NOT_FOUND, got %ld\n", GetLastError() );
/* Just in case */ FreeLibrary(hModule); @@ -315,12 +315,12 @@ static void testGetProcAddress_Wrong(void) SetLastError(0xdeadbeef); fp = GetProcAddress(NULL, "non_ex_call"); ok( !fp, "non_ex_call should not be found\n"); - ok( GetLastError() == ERROR_PROC_NOT_FOUND, "Expected ERROR_PROC_NOT_FOUND, got %d\n", GetLastError() ); + ok( GetLastError() == ERROR_PROC_NOT_FOUND, "Expected ERROR_PROC_NOT_FOUND, got %ld\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, "Expected ERROR_MOD_NOT_FOUND, got %d\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "Expected ERROR_MOD_NOT_FOUND, got %ld\n", GetLastError() ); }
static void testLoadLibraryEx(void) @@ -341,7 +341,7 @@ static void testLoadLibraryEx(void) ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_MOD_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* empty lpFileName */ SetLastError(0xdeadbeef); @@ -349,7 +349,7 @@ static void testLoadLibraryEx(void) ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_MOD_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER /* win8 */, - "Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND, got %ld\n", GetLastError());
/* hFile is non-NULL */ SetLastError(0xdeadbeef); @@ -357,21 +357,21 @@ static void testLoadLibraryEx(void) ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_SHARING_VIOLATION || GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ - "Unexpected last error, got %d\n", GetLastError()); + "Unexpected last error, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("testfile.dll", (HANDLE)0xdeadbeef, 0); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_SHARING_VIOLATION || GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ - "Unexpected last error, got %d\n", GetLastError()); + "Unexpected last error, got %ld\n", GetLastError());
/* try to open a file that is locked */ SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("testfile.dll", NULL, 0); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_SHARING_VIOLATION, - "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + "Expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
/* lpFileName does not matter */ if (is_unicode_enabled) @@ -381,7 +381,7 @@ static void testLoadLibraryEx(void) ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_MOD_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ - "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
CloseHandle(hfile); @@ -390,7 +390,7 @@ static void testLoadLibraryEx(void) SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("testfile.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); - ok(GetLastError() == ERROR_FILE_INVALID, "Expected ERROR_FILE_INVALID, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_INVALID, "Expected ERROR_FILE_INVALID, got %ld\n", GetLastError());
DeleteFileA("testfile.dll");
@@ -405,13 +405,13 @@ static void testLoadLibraryEx(void) ok(hmodule != 0, "Expected valid module handle\n"); ok(GetLastError() == 0xdeadbeef || GetLastError() == ERROR_SUCCESS, - "Expected 0xdeadbeef or ERROR_SUCCESS, got %d\n", GetLastError()); + "Expected 0xdeadbeef or ERROR_SUCCESS, got %ld\n", GetLastError());
/* try invalid file handle */ SetLastError(0xdeadbeef); hmodule = LoadLibraryExA(path, (HANDLE)0xdeadbeef, 0); if (!hmodule) /* succeeds on xp and older */ - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
FreeLibrary(hmodule);
@@ -419,7 +419,7 @@ static void testLoadLibraryEx(void) SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("kernel32.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); ok(hmodule != 0, "Expected valid module handle\n"); - ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
FreeLibrary(hmodule);
@@ -433,7 +433,7 @@ static void testLoadLibraryEx(void) hmodule = LoadLibraryExA(path, NULL, LOAD_LIBRARY_AS_DATAFILE); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
/* Free the loaded dll when it's the first time this dll is loaded in process - First time should pass, second fail */ @@ -444,14 +444,14 @@ static void testLoadLibraryEx(void) SetLastError(0xdeadbeef); ret = FreeLibrary( (HMODULE)((ULONG_PTR)hmodule + 0x1230)); ok(!ret, "Free succeeded on wrong handle\n"); - ok(GetLastError() == ERROR_BAD_EXE_FORMAT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_BAD_EXE_FORMAT, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = FreeLibrary(hmodule); - ok(ret, "Expected to be able to free the module, failed with %d\n", GetLastError()); + ok(ret, "Expected to be able to free the module, failed with %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = FreeLibrary(hmodule); - ok(!ret, "Unexpected ability to free the module, failed with %d\n", GetLastError()); + ok(!ret, "Unexpected ability to free the module, failed with %ld\n", GetLastError());
/* load with full path, name without extension */ GetSystemDirectoryA(path, MAX_PATH); @@ -499,13 +499,13 @@ static void test_LoadLibraryEx_search_flags(void) GetTempFileNameA( path, "tmp", 0, buf ); DeleteFileA( buf ); ret = CreateDirectoryA( buf, NULL ); - ok( ret, "CreateDirectory failed err %u\n", GetLastError() ); + ok( ret, "CreateDirectory failed err %lu\n", GetLastError() ); p = buf + strlen( buf ); for (i = 1; i <= 6; i++) { sprintf( p, "\%u", i ); ret = CreateDirectoryA( buf, NULL ); - ok( ret, "CreateDirectory failed err %u\n", GetLastError() ); + ok( ret, "CreateDirectory failed err %lu\n", GetLastError() ); if (i >= 5) continue; /* dirs 5 and 6 are left empty */ sprintf( p, "\%u\winetestdll.dll", i ); create_test_dll( buf ); @@ -517,13 +517,13 @@ static void test_LoadLibraryEx_search_flags(void)
SetLastError( 0xdeadbeef ); mod = LoadLibraryA( "1\winetestdll.dll" ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod );
SetLastError( 0xdeadbeef ); sprintf( path, "%c:1\winetestdll.dll", buf[0] ); mod = LoadLibraryA( path ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod );
if (pAddDllDirectory) @@ -531,11 +531,11 @@ static void test_LoadLibraryEx_search_flags(void) SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "1\winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod ); }
@@ -544,21 +544,21 @@ static void test_LoadLibraryEx_search_flags(void)
SetLastError( 0xdeadbeef ); mod = LoadLibraryA( "winetestdll.dll" ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod );
SetLastError( 0xdeadbeef ); sprintf( path, "%c:winetestdll.dll", buf[0] ); mod = LoadLibraryA( path ); ok( mod != NULL || broken(!mod), /* win10 disallows this but allows c:1\winetestdll.dll */ - "LoadLibrary failed err %u\n", GetLastError() ); - if (!mod) ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + "LoadLibrary failed err %lu\n", GetLastError() ); + if (!mod) ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() ); else FreeLibrary( mod );
SetLastError( 0xdeadbeef ); sprintf( path, "%s\winetestdll.dll", buf + 2 ); mod = LoadLibraryA( path ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod );
if (pAddDllDirectory) @@ -566,43 +566,43 @@ static void test_LoadLibraryEx_search_flags(void) SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod );
SetLastError( 0xdeadbeef ); sprintf( path, "%s\winetestdll.dll", buf + 2 ); mod = LoadLibraryExA( path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); - ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + ok( mod != NULL, "LoadLibrary failed err %lu\n", GetLastError() ); FreeLibrary( mod );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_WITH_ALTERED_SEARCH_PATH ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_WITH_ALTERED_SEARCH_PATH ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 | LOAD_WITH_ALTERED_SEARCH_PATH ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_WITH_ALTERED_SEARCH_PATH ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS | LOAD_WITH_ALTERED_SEARCH_PATH ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); }
SetCurrentDirectoryA( curdir ); @@ -612,7 +612,7 @@ static void test_LoadLibraryEx_search_flags(void) SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() );
if (0) /* crashes on win10 */ { @@ -620,38 +620,38 @@ static void test_LoadLibraryEx_search_flags(void) mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS ); ok( !mod, "LoadLibrary succeeded\n" ); ok( GetLastError() == ERROR_MOD_NOT_FOUND || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY), - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); }
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "foo\winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "\windows\winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); mod = LoadLibraryA( "1\winetestdll.dll" ); ok( !mod, "LoadLibrary succeeded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() );
for (j = 0; j < ARRAY_SIZE(tests); j++) { @@ -673,7 +673,7 @@ static void test_LoadLibraryEx_search_flags(void) mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_USER_DIRS ); if (tests[j].expect) { - ok( mod != NULL, "%u: LoadLibrary failed err %u\n", j, GetLastError() ); + ok( mod != NULL, "%u: LoadLibrary failed err %lu\n", j, GetLastError() ); GetModuleFileNameA( mod, path, MAX_PATH ); sprintf( p, "\%u\winetestdll.dll", tests[j].expect ); ok( !lstrcmpiA( path, buf ), "%u: wrong module %s expected %s\n", j, path, buf ); @@ -682,7 +682,7 @@ static void test_LoadLibraryEx_search_flags(void) { ok( !mod, "%u: LoadLibrary succeeded\n", j ); ok( GetLastError() == ERROR_MOD_NOT_FOUND || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY), - "%u: wrong error %u\n", j, GetLastError() ); + "%u: wrong error %lu\n", j, GetLastError() ); } FreeLibrary( mod );
@@ -705,12 +705,12 @@ static void test_LoadLibraryEx_search_flags(void)
FreeLibrary(mod); mod = LoadLibraryExA( apiset_dll, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); - ok( !!mod, "Got NULL module, error %u.\n", GetLastError() ); + ok( !!mod, "Got NULL module, error %lu.\n", GetLastError() ); ok( !!GetModuleHandleA( apiset_dll ), "Got NULL handle.\n" ); shcore = GetModuleHandleA( "shcore.dll" ); ok( mod == shcore, "wrong module %p/%p\n", mod, shcore ); ret = FreeLibrary( mod ); - ok( ret, "FreeLibrary failed, error %u.\n", GetLastError() ); + ok( ret, "FreeLibrary failed, error %lu.\n", GetLastError() ); shcore = GetModuleHandleA( "shcore.dll" ); ok( !shcore, "shcore not unloaded\n" );
@@ -718,12 +718,12 @@ static void test_LoadLibraryEx_search_flags(void) strcpy( buffer, apiset_dll ); buffer[strlen(buffer) - 4] = 0; mod = LoadLibraryExA( buffer, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); - ok( !!mod, "Got NULL module, error %u.\n", GetLastError() ); + ok( !!mod, "Got NULL module, error %lu.\n", GetLastError() ); ok( !!GetModuleHandleA( apiset_dll ), "Got NULL handle.\n" ); shcore = GetModuleHandleA( "shcore.dll" ); ok( mod == shcore, "wrong module %p/%p\n", mod, shcore ); ret = FreeLibrary( mod ); - ok( ret, "FreeLibrary failed, error %u.\n", GetLastError() ); + ok( ret, "FreeLibrary failed, error %lu.\n", GetLastError() ); shcore = GetModuleHandleA( "shcore.dll" ); ok( !shcore, "shcore not unloaded\n" );
@@ -731,14 +731,14 @@ static void test_LoadLibraryEx_search_flags(void) strcpy( buffer, apiset_dll ); buffer[strlen(buffer) - 5] = '9'; mod = LoadLibraryExA( buffer, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); - ok( !!mod || broken(!mod) /* win8 */, "Got NULL module, error %u.\n", GetLastError() ); + ok( !!mod || broken(!mod) /* win8 */, "Got NULL module, error %lu.\n", GetLastError() ); if (mod) { ok( !!GetModuleHandleA( apiset_dll ), "Got NULL handle.\n" ); shcore = GetModuleHandleA( "shcore.dll" ); ok( mod == shcore, "wrong module %p/%p\n", mod, shcore ); ret = FreeLibrary( mod ); - ok( ret, "FreeLibrary failed, error %u.\n", GetLastError() ); + ok( ret, "FreeLibrary failed, error %lu.\n", GetLastError() ); } shcore = GetModuleHandleA( "shcore.dll" ); ok( !shcore, "shcore not unloaded\n" ); @@ -750,11 +750,11 @@ static void test_LoadLibraryEx_search_flags(void) SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( buffer, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); ok( !mod, "Loaded %s\n", debugstr_a(buffer) ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); mod = LoadLibraryA( buffer ); ok( !mod, "Loaded %s\n", debugstr_a(buffer) ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() ); } else { @@ -765,20 +765,20 @@ static void test_LoadLibraryEx_search_flags(void) mod = GetModuleHandleA( "rasapi32.dll" ); ok( !mod, "rasapi32 already loaded\n" ); mod = LoadLibraryA( "rasapi32.dll" ); - ok( !!mod, "rasapi32 not found %u\n", GetLastError() ); + ok( !!mod, "rasapi32 not found %lu\n", GetLastError() ); FreeLibrary( mod ); SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "rasapi32.dll", NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); ok( !mod, "rasapi32 loaded\n" ); - ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "ext-ms-win-ras-rasapi32-l1-1-0.dll", NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); todo_wine /* rasapi32 doesn't have interesting dependencies on wine */ ok( !mod, "rasapi32 loaded\n" ); if (mod) FreeLibrary( mod ); - else ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + else ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %lu\n", GetLastError() ); mod = LoadLibraryA( "ext-ms-win-ras-rasapi32-l1-1-0.dll" ); - ok( !!mod || broken(!mod) /* win7 */, "rasapi32 not found %u\n", GetLastError() ); + ok( !!mod || broken(!mod) /* win7 */, "rasapi32 not found %lu\n", GetLastError() ); if (mod) FreeLibrary( mod ); mod = GetModuleHandleA( "rasapi32.dll" ); ok( !mod, "rasapi32 still loaded\n" ); @@ -832,24 +832,24 @@ static void testGetDllDirectory(void)
/* no buffer, determine length */ ret = pGetDllDirectoryA(0, NULL); - ok(ret == length + 1, "Expected %u, got %u\n", length + 1, ret); + ok(ret == length + 1, "Expected %lu, got %lu\n", length + 1, ret);
ret = pGetDllDirectoryW(0, NULL); - ok(ret == length + 1, "Expected %u, got %u\n", length + 1, ret); + ok(ret == length + 1, "Expected %lu, got %lu\n", length + 1, ret);
/* buffer of exactly the right size */ bufferA[length] = 'A'; bufferA[length + 1] = 'A'; ret = pGetDllDirectoryA(length + 1, bufferA); ok(ret == length || broken(ret + 1 == length) /* win8 */, - "i=%d, Expected %u(+1), got %u\n", i, length, ret); + "i=%d, Expected %lu(+1), got %lu\n", i, length, ret); ok(bufferA[length + 1] == 'A', "i=%d, Buffer overflow\n", i); ok(strcmp(bufferA, dll_directories[i]) == 0, "i=%d, Wrong path returned: '%s'\n", i, bufferA);
bufferW[length] = 'A'; bufferW[length + 1] = 'A'; ret = pGetDllDirectoryW(length + 1, bufferW); - ok(ret == length, "i=%d, Expected %u, got %u\n", i, length, ret); + ok(ret == length, "i=%d, Expected %lu, got %lu\n", i, length, ret); ok(bufferW[length + 1] == 'A', "i=%d, Buffer overflow\n", i); ok(cmpStrAW(dll_directories[i], bufferW, length, length), "i=%d, Wrong path returned: %s\n", i, wine_dbgstr_w(bufferW)); @@ -858,24 +858,24 @@ static void testGetDllDirectory(void) * on the Windows version and whether the A or W API is called. */ bufferA[0] = 'A'; ret = pGetDllDirectoryA(0, bufferA); - ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); + ok(ret == length + 1, "i=%d, Expected %lu, got %lu\n", i, length + 1, ret);
bufferW[0] = 'A'; ret = pGetDllDirectoryW(0, bufferW); - ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); + ok(ret == length + 1, "i=%d, Expected %lu, got %lu\n", i, length + 1, ret); ok(bufferW[0] == 'A' || broken(bufferW[0] == 0), /* XP, 2003 */ "i=%d, Buffer overflow\n", i);
/* buffer just one too short */ bufferA[0] = 'A'; ret = pGetDllDirectoryA(length, bufferA); - ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); + ok(ret == length + 1, "i=%d, Expected %lu, got %lu\n", i, length + 1, ret); if (length != 0) ok(bufferA[0] == 0, "i=%d, Buffer not null terminated\n", i);
bufferW[0] = 'A'; ret = pGetDllDirectoryW(length, bufferW); - ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); + ok(ret == length + 1, "i=%d, Expected %lu, got %lu\n", i, length + 1, ret); if (length != 0) ok(bufferW[0] == 0, "i=%d, Buffer overflow\n", i);
@@ -884,10 +884,10 @@ static void testGetDllDirectory(void) /* crashes on win8 */ /* no buffer, but too short length */ ret = pGetDllDirectoryA(length, NULL); - ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); + ok(ret == length + 1, "i=%d, Expected %lu, got %lu\n", i, length + 1, ret);
ret = pGetDllDirectoryW(length, NULL); - ok(ret == length + 1, "i=%d, Expected %u, got %u\n", i, length + 1, ret); + ok(ret == length + 1, "i=%d, Expected %lu, got %lu\n", i, length + 1, ret); }
if (pLdrGetDllDirectory) @@ -897,7 +897,7 @@ static void testGetDllDirectory(void) str.Buffer = bufferW; str.MaximumLength = sizeof(bufferW); status = pLdrGetDllDirectory( &str ); - ok( !status, "LdrGetDllDirectory failed %x\n", status ); + ok( !status, "LdrGetDllDirectory failed %lx\n", status ); ok( cmpStrAW( dll_directories[i], bufferW, strlen(dll_directories[i]), str.Length / sizeof(WCHAR) ), "%u: got %s instead of %s\n", i, wine_dbgstr_w(bufferW), dll_directories[i] ); @@ -906,11 +906,11 @@ static void testGetDllDirectory(void) memset( bufferW, 0xcc, sizeof(bufferW) ); str.MaximumLength = (strlen( dll_directories[i] ) - 1) * sizeof(WCHAR); status = pLdrGetDllDirectory( &str ); - ok( status == STATUS_BUFFER_TOO_SMALL, "%u: LdrGetDllDirectory failed %x\n", i, status ); + ok( status == STATUS_BUFFER_TOO_SMALL, "%u: LdrGetDllDirectory failed %lx\n", i, status ); ok( bufferW[0] == 0 && bufferW[1] == 0xcccc, "%u: buffer %x %x\n", i, bufferW[0], bufferW[1] ); length = (strlen( dll_directories[i] ) + 1) * sizeof(WCHAR); - ok( str.Length == length, "%u: wrong len %u / %u\n", i, str.Length, length ); + ok( str.Length == length, "%u: wrong len %u / %lu\n", i, str.Length, length ); } } } @@ -963,18 +963,18 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExA( 0, NULL, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExA( 0, "kernel32", NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); mod = (HMODULE)0xdeadbeef; ret = GetModuleHandleExA( 0, "kernel32", &mod ); - ok( ret, "unexpected failure %u\n", GetLastError() ); + ok( ret, "unexpected failure %lu\n", GetLastError() ); ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod ); FreeLibrary( mod );
@@ -983,25 +983,25 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExA( 0, "nosuchmod", &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error ); + ok( error == ERROR_MOD_NOT_FOUND, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExW( 0, NULL, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExW( 0, kernel32W, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); mod = (HMODULE)0xdeadbeef; ret = GetModuleHandleExW( 0, kernel32W, &mod ); - ok( ret, "unexpected failure %u\n", GetLastError() ); + ok( ret, "unexpected failure %lu\n", GetLastError() ); ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod ); FreeLibrary( mod );
@@ -1010,25 +1010,25 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExW( 0, nosuchmodW, &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error ); + ok( error == ERROR_MOD_NOT_FOUND, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "kernel32", NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); mod = (HMODULE)0xdeadbeef; ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "kernel32", &mod ); - ok( ret, "unexpected failure %u\n", GetLastError() ); + ok( ret, "unexpected failure %lu\n", GetLastError() ); ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod );
SetLastError( 0xdeadbeef ); @@ -1036,25 +1036,25 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "nosuchmod", &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error ); + ok( error == ERROR_MOD_NOT_FOUND, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, kernel32W, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); mod = (HMODULE)0xdeadbeef; ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, kernel32W, &mod ); - ok( ret, "unexpected failure %u\n", GetLastError() ); + ok( ret, "unexpected failure %lu\n", GetLastError() ); ok( mod != (HMODULE)0xdeadbeef, "got %p\n", mod );
SetLastError( 0xdeadbeef ); @@ -1062,7 +1062,7 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, nosuchmodW, &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error ); + ok( error == ERROR_MOD_NOT_FOUND, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
mod_kernel32 = LoadLibraryA( "kernel32" ); @@ -1071,18 +1071,18 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, NULL, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)mod_kernel32, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); mod = (HMODULE)0xdeadbeef; ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)mod_kernel32, &mod ); - ok( ret, "unexpected failure %u\n", GetLastError() ); + ok( ret, "unexpected failure %lu\n", GetLastError() ); ok( mod == mod_kernel32, "got %p\n", mod ); FreeLibrary( mod );
@@ -1091,25 +1091,25 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExA( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)0xbeefdead, &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error ); + ok( error == ERROR_MOD_NOT_FOUND, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, NULL, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCWSTR)mod_kernel32, NULL ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); mod = (HMODULE)0xdeadbeef; ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCWSTR)mod_kernel32, &mod ); - ok( ret, "unexpected failure %u\n", GetLastError() ); + ok( ret, "unexpected failure %lu\n", GetLastError() ); ok( mod == mod_kernel32, "got %p\n", mod ); FreeLibrary( mod );
@@ -1118,7 +1118,7 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCWSTR)0xbeefdead, &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_MOD_NOT_FOUND, "got %u\n", error ); + ok( error == ERROR_MOD_NOT_FOUND, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
SetLastError( 0xdeadbeef ); @@ -1127,7 +1127,7 @@ static void testGetModuleHandleEx(void) | GET_MODULE_HANDLE_EX_FLAG_PIN, (LPCWSTR)mod_kernel32, &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
SetLastError( 0xdeadbeef ); @@ -1135,7 +1135,7 @@ static void testGetModuleHandleEx(void) ret = GetModuleHandleExW( 8, kernel32W, &mod ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error ); ok( mod == NULL, "got %p\n", mod );
FreeLibrary( mod_kernel32 ); @@ -1180,32 +1180,32 @@ static void test_AddDllDirectory(void) buf[0] = '\0'; GetTempPathW(ARRAY_SIZE(path), path ); ret = GetTempFileNameW( path, tmpW, 0, buf ); - ok( ret, "GetTempFileName failed err %u\n", GetLastError() ); + ok( ret, "GetTempFileName failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); cookie = pAddDllDirectory( buf ); - ok( cookie != NULL, "AddDllDirectory failed err %u\n", GetLastError() ); + ok( cookie != NULL, "AddDllDirectory failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pRemoveDllDirectory( cookie ); - ok( ret, "RemoveDllDirectory failed err %u\n", GetLastError() ); + ok( ret, "RemoveDllDirectory failed err %lu\n", GetLastError() );
DeleteFileW( buf ); SetLastError( 0xdeadbeef ); cookie = pAddDllDirectory( buf ); ok( !cookie, "AddDllDirectory succeeded\n" ); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError() ); cookie = pAddDllDirectory( dotW ); ok( !cookie, "AddDllDirectory succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); cookie = pAddDllDirectory( rootW ); - ok( cookie != NULL, "AddDllDirectory failed err %u\n", GetLastError() ); + ok( cookie != NULL, "AddDllDirectory failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pRemoveDllDirectory( cookie ); - ok( ret, "RemoveDllDirectory failed err %u\n", GetLastError() ); + ok( ret, "RemoveDllDirectory failed err %lu\n", GetLastError() ); GetWindowsDirectoryW( buf, MAX_PATH ); lstrcpyW( buf + 2, tmpW ); cookie = pAddDllDirectory( buf ); ok( !cookie, "AddDllDirectory succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); }
static void test_SetDefaultDllDirectories(void) @@ -1223,12 +1223,12 @@ static void test_SetDefaultDllDirectories(void) ok( mod != NULL, "loading authz failed\n" ); FreeLibrary( mod ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_USER_DIRS ); - ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); mod = LoadLibraryA( "authz.dll" ); ok( !mod, "loading authz succeeded\n" ); FreeLibrary( mod ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_SYSTEM32 ); - ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); mod = LoadLibraryA( "authz.dll" ); ok( mod != NULL, "loading authz failed\n" ); FreeLibrary( mod ); @@ -1236,12 +1236,12 @@ static void test_SetDefaultDllDirectories(void) ok( !mod, "loading authz succeeded\n" ); FreeLibrary( mod ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); - ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); mod = LoadLibraryA( "authz.dll" ); ok( !mod, "loading authz succeeded\n" ); FreeLibrary( mod ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS ); - ok( ret, "SetDefaultDllDirectories failed err %u\n", GetLastError() ); + ok( ret, "SetDefaultDllDirectories failed err %lu\n", GetLastError() ); mod = LoadLibraryA( "authz.dll" ); ok( mod != NULL, "loading authz failed\n" ); FreeLibrary( mod ); @@ -1249,27 +1249,27 @@ static void test_SetDefaultDllDirectories(void) SetLastError( 0xdeadbeef ); ret = pSetDefaultDllDirectories( 0 ); ok( !ret, "SetDefaultDllDirectories succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetDefaultDllDirectories( 3 ); ok( !ret, "SetDefaultDllDirectories succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_APPLICATION_DIR | 0x8000 ); ok( !ret, "SetDefaultDllDirectories succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR ); ok( !ret || broken(ret) /* win7 */, "SetDefaultDllDirectories succeeded\n" ); - if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_USER_DIRS ); ok( !ret || broken(ret) /* win7 */, "SetDefaultDllDirectories succeeded\n" ); - if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + if (!ret) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
/* restore some sane defaults */ pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_DEFAULT_DIRS ); @@ -1284,13 +1284,13 @@ static void check_refcount( HMODULE mod, unsigned int refcount ) { ret = FreeLibrary( mod ); ok( ret || broken( refcount == ~0u && GetLastError() == ERROR_MOD_NOT_FOUND && i == 2 ) /* Win8 */, - "Refcount test failed, i %u, error %u.\n", i, GetLastError() ); + "Refcount test failed, i %u, error %lu.\n", i, GetLastError() ); if (!ret) return; } if (refcount != ~0u) { ret = FreeLibrary( mod ); - ok( !ret && GetLastError() == ERROR_MOD_NOT_FOUND, "Refcount test failed, ret %d, error %u.\n", + ok( !ret && GetLastError() == ERROR_MOD_NOT_FOUND, "Refcount test failed, ret %d, error %lu.\n", ret, GetLastError() ); } } @@ -1310,13 +1310,13 @@ static void test_LdrGetDllHandleEx(void)
RtlInitUnicodeString( &name, L"unknown.dll" ); status = pLdrGetDllHandleEx( 0, NULL, NULL, &name, &mod ); - ok( status == STATUS_DLL_NOT_FOUND, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_DLL_NOT_FOUND, "Got unexpected status %#lx.\n", status );
RtlInitUnicodeString( &name, L"authz.dll" ); loaded_mod = LoadLibraryW( name.Buffer ); ok( !!loaded_mod, "Failed to load module.\n" ); status = pLdrGetDllHandleEx( 0, NULL, NULL, &name, &mod ); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( mod == loaded_mod, "got %p\n", mod ); winetest_push_context( "Flags 0" ); check_refcount( loaded_mod, 2 ); @@ -1326,7 +1326,7 @@ static void test_LdrGetDllHandleEx(void) ok( !!loaded_mod, "Failed to load module.\n" ); status = pLdrGetDllHandleEx( LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL, &name, &mod ); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( mod == loaded_mod, "got %p\n", mod ); winetest_push_context( "LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT" ); check_refcount( loaded_mod, 1 ); @@ -1335,7 +1335,7 @@ static void test_LdrGetDllHandleEx(void) loaded_mod = LoadLibraryW( name.Buffer ); ok( !!loaded_mod, "Failed to load module.\n" ); status = pLdrGetDllHandle( NULL, ~0u, &name, &mod ); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( mod == loaded_mod, "got %p\n", mod ); winetest_push_context( "LdrGetDllHandle" ); check_refcount( loaded_mod, 1 ); @@ -1344,7 +1344,7 @@ static void test_LdrGetDllHandleEx(void) loaded_mod = LoadLibraryW( name.Buffer ); ok( !!loaded_mod, "Failed to load module.\n" ); status = pLdrGetDllHandleEx( 4, NULL, NULL, (void *)&name, &mod ); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( mod == loaded_mod, "got %p\n", mod ); winetest_push_context( "Flag 4" ); check_refcount( loaded_mod, 2 ); @@ -1355,7 +1355,7 @@ static void test_LdrGetDllHandleEx(void) loaded_mod = LoadLibraryW( name.Buffer ); ok( !!loaded_mod, "Failed to load module.\n" ); status = pLdrGetDllHandleEx( 1 << i, NULL, NULL, &name, &mod ); - ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status ); winetest_push_context( "Invalid flags, i %u", i ); check_refcount( loaded_mod, 1 ); winetest_pop_context(); @@ -1363,13 +1363,13 @@ static void test_LdrGetDllHandleEx(void)
status = pLdrGetDllHandleEx( LDR_GET_DLL_HANDLE_EX_FLAG_PIN | LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL, &name, &mod ); - ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status );
loaded_mod = LoadLibraryW( name.Buffer ); ok( !!loaded_mod, "Failed to load module.\n" ); status = pLdrGetDllHandleEx( LDR_GET_DLL_HANDLE_EX_FLAG_PIN, NULL, NULL, &name, &mod ); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status ); ok( mod == loaded_mod, "got %p\n", mod ); winetest_push_context( "LDR_GET_DLL_HANDLE_EX_FLAG_PIN" ); check_refcount( loaded_mod, ~0u ); @@ -1398,7 +1398,7 @@ static void test_LdrGetDllFullName(void) memset( path_buffer, 0x23, sizeof(path_buffer) );
status = pLdrGetDllFullName( ntdll, &path ); - ok( status == STATUS_BUFFER_TOO_SMALL, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_BUFFER_TOO_SMALL, "Got unexpected status %#lx.\n", status ); ok( path.Length == 0, "Expected length 0, got %d.\n", path.Length ); ok( path_buffer[0] == 0x2323, "Expected 0x2323, got 0x%x.\n", path_buffer[0] );
@@ -1406,7 +1406,7 @@ static void test_LdrGetDllFullName(void) path.MaximumLength = 5; /* odd numbers produce partially copied characters */
status = pLdrGetDllFullName( ntdll, &path ); - ok( status == STATUS_BUFFER_TOO_SMALL, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_BUFFER_TOO_SMALL, "Got unexpected status %#lx.\n", status ); ok( path.Length == path.MaximumLength, "Expected length %u, got %u.\n", path.MaximumLength, path.Length ); expected_terminator = 0x2300 | (expected_path[path.MaximumLength / sizeof(WCHAR)] & 0xFF); ok( path_buffer[path.MaximumLength / sizeof(WCHAR)] == expected_terminator, @@ -1421,12 +1421,12 @@ static void test_LdrGetDllFullName(void) path.MaximumLength = sizeof(path_buffer);
status = pLdrGetDllFullName( ntdll, &path ); - ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); ok( !lstrcmpiW(path_buffer, expected_path), "Expected %s, got %s\n", wine_dbgstr_w(expected_path), wine_dbgstr_w(path_buffer) );
status = pLdrGetDllFullName( NULL, &path ); - ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status ); + ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); GetModuleFileNameW( NULL, expected_path, ARRAY_SIZE(expected_path) ); ok( !lstrcmpiW(path_buffer, expected_path), "Expected %s, got %s.\n", wine_dbgstr_w(expected_path), wine_dbgstr_w(path_buffer) ); @@ -1478,14 +1478,14 @@ static void test_apisets(void) winetest_push_context( "%u:%s", i, tests[i].name ); present = 0xff; status = pApiSetQueryApiSetPresence( &name, &present ); - ok( status == STATUS_SUCCESS, "wrong ret %x\n", status ); + ok( status == STATUS_SUCCESS, "wrong ret %lx\n", status ); ok( present == tests[i].present || broken(!present && tests[i].broken) /* win8 */, "wrong present %u\n", present ); if (pApiSetQueryApiSetPresenceEx) { present = in_schema = 0xff; status = pApiSetQueryApiSetPresenceEx( &name, &in_schema, &present ); - ok( status == tests[i].status, "wrong ret %x\n", status ); + ok( status == tests[i].status, "wrong ret %lx\n", status ); if (!status) { ok( in_schema == tests[i].in_schema, "wrong in_schema %u\n", in_schema ); @@ -1532,7 +1532,7 @@ static void test_ddag_node(void) ok( !!hexe, "Got NULL exe handle.\n" );
status = LdrFindEntryForAddress( hexe, &mod ); - ok( !status, "Got unexpected status %#x.\n", status ); + ok( !status, "Got unexpected status %#lx.\n", status );
if (!(node = mod->DdagNode)) { @@ -1561,7 +1561,7 @@ static void test_ddag_node(void) win_skip( "Empty dependencies list.\n" ); return; } - todo_wine ok( node->LoadCount == -1, "Got unexpected LoadCount %d.\n", node->LoadCount ); + todo_wine ok( node->LoadCount == -1, "Got unexpected LoadCount %ld.\n", node->LoadCount );
prev_node = NULL; se = node->Dependencies.Tail; @@ -1601,7 +1601,7 @@ static void test_ddag_node(void) ok( dep2 == dep, "Dependency not found in incoming deps list.\n" );
todo_wine ok( dep_node->LoadCount > 0 || broken(!dep_node->LoadCount) /* Win8 */, - "Got unexpected LoadCount %d.\n", dep_node->LoadCount ); + "Got unexpected LoadCount %ld.\n", dep_node->LoadCount );
winetest_pop_context(); prev_node = dep_node; diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c index db376eef24a..3c57e81f4c6 100644 --- a/dlls/kernel32/tests/path.c +++ b/dlls/kernel32/tests/path.c @@ -265,25 +265,25 @@ static void test_FunnyChars(CHAR *curdir,CHAR *curdir_short,CHAR *filename, INT ok((passfail.shortlen==0 && (passfail.shorterror==ERROR_FILE_NOT_FOUND || passfail.shorterror==ERROR_PATH_NOT_FOUND || !passfail.shorterror)) || (passfail.shortlen==strlen(tmpstr1) && lstrcmpiA(tmpstr,tmpstr1)==0), - "%s: GetShortPathNameA error: len=%d error=%d tmpstr=[%s]\n", + "%s: GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n", errstr,passfail.shortlen,passfail.shorterror,tmpstr); } else { ok(passfail.shortlen==0 && (passfail.shorterror==ERROR_INVALID_NAME || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror), - "%s: GetShortPathA should have failed len=%d, error=%d\n", + "%s: GetShortPathA should have failed len=%ld, error=%ld\n", errstr,passfail.shortlen,passfail.shorterror); }
ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); if (valid) { - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "%s: GetLongPathA unexpected error %d.\n", errstr, + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "%s: GetLongPathA unexpected error %ld.\n", errstr, passfail.longerror); } else { ok(passfail.longerror == ERROR_INVALID_NAME || passfail.longerror == ERROR_FILE_NOT_FOUND, - "%s: GetLongPathA unexpected error %d.\n", errstr, passfail.longerror); + "%s: GetLongPathA unexpected error %ld.\n", errstr, passfail.longerror); } }
@@ -350,7 +350,7 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive) "GetTempPathA returned a path that did not end in '\'\n"); lstrcpyA(tmpstr,"aaaaaaaa"); len1=GetTempPathA(len,tmpstr); - ok(len1==len+1,"GetTempPathA should return string length %d instead of %d\n",len+1,len1); + ok(len1==len+1,"GetTempPathA should return string length %ld instead of %ld\n",len+1,len1);
/* Test GetTmpFileNameA */ ok((id=GetTempFileNameA(tmppath,"path",0,newdir)),"GetTempFileNameA failed\n"); @@ -376,7 +376,7 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive) sprintf(invalid_dir, "%s\%s",tmppath,"non_existent_dir_1jwj3y32nb3"); SetLastError(0xdeadbeef); ok(!GetTempFileNameA(invalid_dir,"tfn",unique,newdir),"GetTempFileNameA should have failed\n"); - ok(GetLastError()==ERROR_DIRECTORY,"got %u, expected ERROR_DIRECTORY\n", GetLastError()); + ok(GetLastError()==ERROR_DIRECTORY,"got %lu, expected ERROR_DIRECTORY\n", GetLastError());
/* Check return value for unique !=0 */ if(unique) { @@ -416,12 +416,12 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive) bRes = CreateDirectoryA(tmpstr,NULL); ok(!bRes && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_ALREADY_EXISTS), - "CreateDirectoryA("%s" should have failed (%d)\n", tmpstr, GetLastError()); + "CreateDirectoryA("%s" should have failed (%ld)\n", tmpstr, GetLastError()); sprintf(tmpstr,"%c:\", *curDrive); bRes = CreateDirectoryA(tmpstr,NULL); ok(!bRes && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_ALREADY_EXISTS), - "CreateDirectoryA("%s" should have failed (%d)\n", tmpstr, GetLastError()); + "CreateDirectoryA("%s" should have failed (%ld)\n", tmpstr, GetLastError()); sprintf(tmpstr,"%s\%s\%s",newdir,SHORTDIR,SHORTFILE); hndl=CreateFileA(tmpstr,GENERIC_WRITE,0,NULL, CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL); @@ -460,7 +460,7 @@ static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir) */ lstrcpyA(tmpstr,"aaaaaaa"); len1=GetCurrentDirectoryA(len,tmpstr); - ok(len1==len+1, "GetCurrentDirectoryA returned %d instead of %d\n",len1,len+1); + ok(len1==len+1, "GetCurrentDirectoryA returned %ld instead of %ld\n",len1,len+1); ok(lstrcmpiA(tmpstr,"aaaaaaa")==0, "GetCurrentDirectoryA should not have modified the buffer\n");
@@ -468,27 +468,27 @@ static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir) SetLastError( 0xdeadbeef ); strcpy( buffer, "foo" ); len = GetCurrentDirectoryA( 32767, buffer ); - ok( len != 0 && len < MAX_PATH, "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() ); + ok( len != 0 && len < MAX_PATH, "GetCurrentDirectoryA failed %lu err %lu\n", len, GetLastError() ); if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer ); SetLastError( 0xdeadbeef ); strcpy( buffer, "foo" ); len = GetCurrentDirectoryA( 32768, buffer ); - ok( len != 0 && len < MAX_PATH, "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() ); + ok( len != 0 && len < MAX_PATH, "GetCurrentDirectoryA failed %lu err %lu\n", len, GetLastError() ); if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer ); SetLastError( 0xdeadbeef ); strcpy( buffer, "foo" ); len = GetCurrentDirectoryA( 65535, buffer ); - ok( (len != 0 && len < MAX_PATH) || broken(!len), /* nt4, win2k, xp */ "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() ); + ok( (len != 0 && len < MAX_PATH) || broken(!len), /* nt4, win2k, xp */ "GetCurrentDirectoryA failed %lu err %lu\n", len, GetLastError() ); if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer ); SetLastError( 0xdeadbeef ); strcpy( buffer, "foo" ); len = GetCurrentDirectoryA( 65536, buffer ); - ok( (len != 0 && len < MAX_PATH), "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() ); + ok( (len != 0 && len < MAX_PATH), "GetCurrentDirectoryA failed %lu err %lu\n", len, GetLastError() ); if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer ); SetLastError( 0xdeadbeef ); strcpy( buffer, "foo" ); len = GetCurrentDirectoryA( 2 * 65536, buffer ); - ok( (len != 0 && len < MAX_PATH), "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() ); + ok( (len != 0 && len < MAX_PATH), "GetCurrentDirectoryA failed %lu err %lu\n", len, GetLastError() ); if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer ); HeapFree( GetProcessHeap(), 0, buffer );
@@ -574,14 +574,14 @@ static void test_ShortPathCase(const char *tmpdir, const char *dirname, sprintf(buf,"%s\%s\%s",tmpdir,dirname,filename); GetShortPathNameA(buf,shortbuf,sizeof(shortbuf)); hndl = CreateFileA(shortbuf,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); - ok(hndl!=INVALID_HANDLE_VALUE,"CreateFileA failed (%d)\n",GetLastError()); + ok(hndl!=INVALID_HANDLE_VALUE,"CreateFileA failed (%ld)\n",GetLastError()); CloseHandle(hndl); /* Now for the real test */ for(i=0;i<strlen(shortbuf);i++) if (i % 2) shortbuf[i] = tolower(shortbuf[i]); hndl = CreateFileA(shortbuf,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); - ok(hndl!=INVALID_HANDLE_VALUE,"CreateFileA failed (%d)\n",GetLastError()); + ok(hndl!=INVALID_HANDLE_VALUE,"CreateFileA failed (%ld)\n",GetLastError()); CloseHandle(hndl); }
@@ -614,12 +614,12 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) rc1 = GetLongPathNameA(tmpstr, NULL, 0); rc2 = GetLongPathNameA(curdir, NULL, 0); ok((rc1-strlen(tmpstr))==(rc2-strlen(curdir)), - "GetLongPathNameA: wrong return code, %d instead of %d\n", + "GetLongPathNameA: wrong return code, %ld instead of %d\n", rc1, lstrlenA(tmpstr)+1);
sprintf(dir,"%c:",curDrive); rc1= GetLongPathNameA(dir, tmpstr, sizeof(tmpstr)); - ok(!strcmp(dir,tmpstr), "GetLongPathNameA: returned '%s' instead of '%s' (rc=%d)\n", + ok(!strcmp(dir,tmpstr), "GetLongPathNameA: returned '%s' instead of '%s' (rc=%ld)\n", tmpstr, dir, rc1);
/* Check the cases where both file and directory exist first */ @@ -649,11 +649,11 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) (passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND)) || (passfail.shortlen==strlen(tmpstr1) && lstrcmpiA(tmpstr,tmpstr1)==0), - "GetShortPathNameA error: len=%d error=%d tmpstr=[%s]\n", + "GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n", passfail.shortlen,passfail.shorterror,tmpstr);
ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %d.\n", passfail.longerror); + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %ld.\n", passfail.longerror);
/* Now try a 8.3 directory, long file name */ test_ValidPathA(curdir,SHORTDIR,NONFILE_LONG,tmpstr,&passfail,"test6"); @@ -663,7 +663,7 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) !passfail.shorterror, "GetShortPathA should have returned 'ERROR_FILE_NOT_FOUND'\n"); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %d.\n", passfail.longerror); + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %ld.\n", passfail.longerror);
/* Next is a long directory, 8.3 file */ test_ValidPathA(curdir,LONGDIR,NONFILE_SHORT,tmpstr,&passfail,"test7"); @@ -674,10 +674,10 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) (passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND)) || (passfail.shortlen==strlen(tmpstr1) && lstrcmpiA(tmpstr,tmpstr1)==0), - "GetShortPathNameA error: len=%d error=%d tmpstr=[%s]\n", + "GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n", passfail.shortlen,passfail.shorterror,tmpstr); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %d.\n", passfail.longerror); + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %ld.\n", passfail.longerror);
/*Lastly a long directory, long file */ test_ValidPathA(curdir,LONGDIR,NONFILE_LONG,tmpstr,&passfail,"test8"); @@ -687,7 +687,7 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) !passfail.shorterror, "GetShortPathA should have returned 'ERROR_FILE_NOT_FOUND'\n"); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %d.\n", passfail.longerror); + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %ld.\n", passfail.longerror);
/* Now try again with directories that don't exist */ /* 8.3 directory, 8.3 filename */ @@ -697,11 +697,11 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) (passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND)) || (passfail.shortlen==strlen(tmpstr1) && lstrcmpiA(tmpstr,tmpstr1)==0), - "GetShortPathNameA error: len=%d error=%d tmpstr=[%s]\n", + "GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n", passfail.shortlen,passfail.shorterror,tmpstr); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); ok(passfail.longerror == ERROR_PATH_NOT_FOUND || passfail.longerror == ERROR_FILE_NOT_FOUND, - "Unexpected error %d.\n", passfail.longerror); + "Unexpected error %ld.\n", passfail.longerror);
/* Now try a 8.3 directory, long file name */ test_ValidPathA(curdir,NONDIR_SHORT,LONGFILE,tmpstr,&passfail,"test10"); @@ -709,11 +709,11 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror, - "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'\n", + "GetShortPathA returned %ld and not 'ERROR_PATH_NOT_FOUND'\n", passfail.shorterror); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); ok(passfail.longerror == ERROR_PATH_NOT_FOUND || passfail.longerror == ERROR_FILE_NOT_FOUND, - "Unexpected error %d.\n", passfail.longerror); + "Unexpected error %ld.\n", passfail.longerror);
/* Next is a long directory, 8.3 file */ test_ValidPathA(curdir,NONDIR_LONG,SHORTFILE,tmpstr,&passfail,"test11"); @@ -721,11 +721,11 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror, - "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'\n", + "GetShortPathA returned %ld and not 'ERROR_PATH_NOT_FOUND'\n", passfail.shorterror); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); ok(passfail.longerror == ERROR_PATH_NOT_FOUND || passfail.longerror == ERROR_FILE_NOT_FOUND, - "Unexpected error %d.\n", passfail.longerror); + "Unexpected error %ld.\n", passfail.longerror);
/*Lastly a long directory, long file */ test_ValidPathA(curdir,NONDIR_LONG,LONGFILE,tmpstr,&passfail,"test12"); @@ -733,11 +733,11 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror, - "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'\n", + "GetShortPathA returned %ld and not 'ERROR_PATH_NOT_FOUND'\n", passfail.shorterror); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); ok(passfail.longerror == ERROR_PATH_NOT_FOUND || passfail.longerror == ERROR_FILE_NOT_FOUND, - "Unexpected error %d.\n", passfail.longerror); + "Unexpected error %ld.\n", passfail.longerror);
/* Next try directories ending with '\' */ /* Existing Directories */ @@ -753,10 +753,10 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) (passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND)) || (passfail.shortlen==strlen(tmpstr2) && lstrcmpiA(tmpstr1,tmpstr2)==0), - "GetShortPathNameA error: len=%d error=%d tmpstr=[%s]\n", + "GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n", passfail.shortlen,passfail.shorterror,tmpstr); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %d.\n", passfail.longerror); + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %ld.\n", passfail.longerror);
sprintf(tmpstr,"%s\",NONDIR_LONG); test_ValidPathA(curdir,"",tmpstr,tmpstr1,&passfail,"test16"); @@ -764,10 +764,10 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive) ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror, - "GetShortPathA returned %d and not 'ERROR_FILE_NOT_FOUND'\n", + "GetShortPathA returned %ld and not 'ERROR_FILE_NOT_FOUND'\n", passfail.shorterror); ok(!passfail.longlen, "GetLongPathNameA passed when it shouldn't have\n"); - ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %d.\n", passfail.longerror); + ok(passfail.longerror == ERROR_FILE_NOT_FOUND, "Unexpected error %ld.\n", passfail.longerror);
/* Test GetFullPathNameA with drive letters */ if( curDrive != NOT_A_VALID_DRIVE) { @@ -946,10 +946,10 @@ static void test_GetTempPathA(char* tmp_dir) * of len_with_null. */ len = GetTempPathA(1, buf); - ok(len >= len_with_null, "Expected >= %u, got %u\n", len_with_null, len); + ok(len >= len_with_null, "Expected >= %lu, got %lu\n", len_with_null, len);
len = GetTempPathA(0, NULL); - ok(len >= len_with_null, "Expected >= %u, got %u\n", len_with_null, len); + ok(len >= len_with_null, "Expected >= %lu, got %lu\n", len_with_null, len);
/* The call above gave us the buffer size that Windows thinks is needed * so the next call should work @@ -966,15 +966,15 @@ static void test_GetTempPathA(char* tmp_dir) /* The rest of the buffer remains untouched */ slen = len + 1; for(len++; len < sizeof(buf); len++) - ok(buf[len] == 'a', "expected 'a' at [%d], got 0x%x\n", len, buf[len]); + ok(buf[len] == 'a', "expected 'a' at [%ld], got 0x%x\n", len, buf[len]);
/* When the buffer is not long enough it remains untouched */ memset(buf, 'a', sizeof(buf)); len = GetTempPathA(slen / 2, buf); ok(len == slen || broken(len == slen + 1) /* read the big comment above */ , - "expected %d, got %d\n", slen, len); + "expected %ld, got %ld\n", slen, len); for(len = 0; len < ARRAY_SIZE(buf); len++) - ok(buf[len] == 'a', "expected 'a' at [%d], got 0x%x\n", len, buf[len]); + ok(buf[len] == 'a', "expected 'a' at [%ld], got 0x%x\n", len, buf[len]); }
static void test_GetTempPathW(char* tmp_dir) @@ -1004,10 +1004,10 @@ static void test_GetTempPathW(char* tmp_dir) lstrcpyW(buf, fooW); len = GetTempPathW(1, buf); ok(buf[0] == 0, "unicode version should truncate the buffer to zero size\n"); - ok(len >= len_with_null, "Expected >= %u, got %u\n", len_with_null, len); + ok(len >= len_with_null, "Expected >= %lu, got %lu\n", len_with_null, len);
len = GetTempPathW(0, NULL); - ok(len >= len_with_null, "Expected >= %u, got %u\n", len_with_null, len); + ok(len >= len_with_null, "Expected >= %lu, got %lu\n", len_with_null, len);
lstrcpyW(buf, fooW); len = GetTempPathW(len, buf); @@ -1022,14 +1022,14 @@ static void test_GetTempPathW(char* tmp_dir) /* The rest of the buffer must be zeroed */ slen = len + 1; for(len++; len < ARRAY_SIZE(buf); len++) - ok(buf[len] == '\0', "expected NULL at [%d], got 0x%x\n", len, buf[len]); + ok(buf[len] == '\0', "expected NULL at [%ld], got 0x%x\n", len, buf[len]);
/* When the buffer is not long enough the length passed is zeroed */ for(len = 0; len < ARRAY_SIZE(buf); len++) buf[len] = 'a'; len = GetTempPathW(slen / 2, buf); ok(len == slen || broken(len == slen + 1) /* read the big comment above */ , - "expected %d, got %d\n", slen, len); + "expected %ld, got %ld\n", slen, len);
{ /* In Windows 8 when TMP var points to a drive only (like C:) instead of a @@ -1045,9 +1045,9 @@ static void test_GetTempPathW(char* tmp_dir) }
for(len = 0; len < slen / 2; len++) - ok(buf[len] == '\0', "expected NULL at [%d], got 0x%x\n", len, buf[len]); + ok(buf[len] == '\0', "expected NULL at [%ld], got 0x%x\n", len, buf[len]); for(; len < ARRAY_SIZE(buf); len++) - ok(buf[len] == 'a', "expected 'a' at [%d], got 0x%x\n", len, buf[len]); + ok(buf[len] == 'a', "expected 'a' at [%ld], got 0x%x\n", len, buf[len]);
/* bogus application from bug 38220 passes the count value in sizeof(buffer) * instead the correct count of WCHAR, this test catches this case. */ @@ -1069,11 +1069,11 @@ static void test_GetTempPathW(char* tmp_dir) * to simplify testing we will test only until XP. */ for(; len < 32767; len++) - ok(long_buf[len] == '\0', "expected NULL at [%d], got 0x%x\n", len, long_buf[len]); + ok(long_buf[len] == '\0', "expected NULL at [%ld], got 0x%x\n", len, long_buf[len]); /* we will know skip the test that is in the middle of the OS difference by * incrementing len and then resume the test for the untouched part. */ for(len++; len < slen; len++) - ok(long_buf[len] == 0xcc, "expected 0xcc at [%d], got 0x%x\n", len, long_buf[len]); + ok(long_buf[len] == 0xcc, "expected 0xcc at [%ld], got 0x%x\n", len, long_buf[len]);
HeapFree(GetProcessHeap(), 0, long_buf); } @@ -1150,7 +1150,7 @@ static void test_GetLongPathNameA(void) SetLastError(0xdeadbeef); length = GetLongPathNameA(tempfile, temppath, MAX_PATH); ok(!length, "GetLongPathNameA should fail\n"); - ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %ld\n", GetLastError());
strcpy(name, "longfilename.longext");
@@ -1174,13 +1174,13 @@ static void test_GetLongPathNameA(void)
SetLastError(0xdeadbeef); length = GetLongPathNameA(temppath2, NULL, 0); - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength);
length = GetLongPathNameA(temppath2, NULL, MAX_PATH); - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength);
length = GetLongPathNameA(temppath2, temppath, 4); - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength); ok(temppath[0] == 0, "Buffer should not have been touched\n");
/* Now an UNC path with the computername */ @@ -1217,17 +1217,17 @@ static void test_GetLongPathNameA(void) } explength = lstrlenA(longpath) + 1; todo_wine - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength);
length = GetLongPathNameA(unc_short, NULL, MAX_PATH); todo_wine - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength);
memset(unc_long, 0, MAX_PATH); length = GetLongPathNameA(unc_short, unc_long, lstrlenA(unc_short)); /* length will include terminating '0' on failure */ todo_wine - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength); ok(unc_long[0] == 0, "Buffer should not have been touched\n");
memset(unc_long, 0, MAX_PATH); @@ -1236,7 +1236,7 @@ static void test_GetLongPathNameA(void) explength--; todo_wine { - ok(length == explength, "Wrong length %d, expected %d\n", length, explength); + ok(length == explength, "Wrong length %ld, expected %ld\n", length, explength); ok(!lstrcmpiA(unc_long, longpath), "Expected (%s), got (%s)\n", longpath, unc_long); }
@@ -1258,14 +1258,14 @@ static void test_GetLongPathNameW(void)
SetLastError(0xdeadbeef); length = GetLongPathNameW(NULL,NULL,0); - ok(0==length,"GetLongPathNameW returned %d but expected 0\n",length); - ok(GetLastError()==ERROR_INVALID_PARAMETER,"GetLastError returned %d but expected ERROR_INVALID_PARAMETER\n",GetLastError()); + ok(0==length,"GetLongPathNameW returned %ld but expected 0\n",length); + ok(GetLastError()==ERROR_INVALID_PARAMETER,"GetLastError returned %ld but expected ERROR_INVALID_PARAMETER\n",GetLastError());
SetLastError(0xdeadbeef); empty[0]=0; length = GetLongPathNameW(empty,NULL,0); - ok(0==length,"GetLongPathNameW returned %d but expected 0\n",length); - ok(GetLastError()==ERROR_PATH_NOT_FOUND,"GetLastError returned %d but expected ERROR_PATH_NOT_FOUND\n",GetLastError()); + ok(0==length,"GetLongPathNameW returned %ld but expected 0\n",length); + ok(GetLastError()==ERROR_PATH_NOT_FOUND,"GetLastError returned %ld but expected ERROR_PATH_NOT_FOUND\n",GetLastError());
/* Create a long path name. The path needs to exist for these tests to * succeed so we need the "\?" prefix when creating directories and @@ -1282,7 +1282,7 @@ static void test_GetLongPathNameW(void) lstrcatW(shortpath, name); lstrcpyW(dirpath, shortpath); ret = CreateDirectoryW(shortpath, NULL); - ok(ret, "Could not create the temporary directory : %d\n", GetLastError()); + ok(ret, "Could not create the temporary directory : %ld\n", GetLastError()); lstrcatW(shortpath, backslash); lstrcatW(shortpath, name);
@@ -1291,24 +1291,24 @@ static void test_GetLongPathNameW(void) /* No prefix */ SetLastError(0xdeadbeef); length = GetLongPathNameW(shortpath + 4, NULL, 0); - ok(length == 0, "Expected 0, got %d\n", length); + ok(length == 0, "Expected 0, got %ld\n", length); todo_wine ok(GetLastError() == ERROR_PATH_NOT_FOUND, - "Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError()); /* With prefix */ SetLastError(0xdeadbeef); length = GetLongPathNameW(shortpath, NULL, 0); todo_wine { - ok(length == 0, "Expected 0, got %d\n", length); + ok(length == 0, "Expected 0, got %ld\n", length); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError()); }
file = CreateFileW(shortpath, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ok(file != INVALID_HANDLE_VALUE, - "Could not create the temporary file : %d.\n", GetLastError()); + "Could not create the temporary file : %ld.\n", GetLastError()); CloseHandle(file);
/* Path exists */ @@ -1318,14 +1318,14 @@ static void test_GetLongPathNameW(void) length = GetLongPathNameW(shortpath + 4, NULL, 0); todo_wine { - ok(length == 0, "Expected 0, got %d\n", length); - ok(GetLastError() == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + ok(length == 0, "Expected 0, got %ld\n", length); + ok(GetLastError() == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError()); } /* With prefix */ expanded = 4 + (GetLongPathNameW(tempdir, NULL, 0) - 1) + lstrlenW(name) + 1 + lstrlenW(name) + 1; SetLastError(0xdeadbeef); length = GetLongPathNameW(shortpath, NULL, 0); - ok(length == expanded, "Expected %d, got %d\n", expanded, length); + ok(length == expanded, "Expected %ld, got %ld\n", expanded, length);
/* NULL buffer with length crashes on Windows */ if (0) @@ -1355,7 +1355,7 @@ static void test_GetShortPathNameW(void) lstrcatW( path, test_path ); lstrcatW( path, backSlash ); ret = CreateDirectoryW( path, NULL ); - ok( ret, "Directory was not created. LastError = %d\n", GetLastError() ); + ok( ret, "Directory was not created. LastError = %ld\n", GetLastError() );
/* Starting a main part of test */
@@ -1382,7 +1382,7 @@ static void test_GetShortPathNameW(void) SetLastError(0xdeadbeef); length = GetShortPathNameW( short_path, path, 0 ); ok(!length, "GetShortPathNameW should fail\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
file = CreateFileW( short_path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); ok( file != INVALID_HANDLE_VALUE, "File was not created.\n" ); @@ -1397,13 +1397,13 @@ static void test_GetShortPathNameW(void) CloseHandle( file );
length = GetShortPathNameW( path, short_path, ARRAY_SIZE( short_path )); - ok( length, "GetShortPathNameW failed: %u.\n", GetLastError() ); + ok( length, "GetShortPathNameW failed: %lu.\n", GetLastError() );
lstrcpyW(ptr, wildW); SetLastError(0xdeadbeef); length = GetShortPathNameW( path, short_path, ARRAY_SIZE( short_path ) ); ok(!length, "GetShortPathNameW should fail\n"); - ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %ld\n", GetLastError());
lstrcpyW(ptr, a_bcdeW); ret = DeleteFileW( path ); @@ -1424,7 +1424,7 @@ static void test_GetSystemDirectory(void) SetLastError(0xdeadbeef); res = GetSystemDirectoryA(NULL, 0); /* res includes the terminating Zero */ - ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError()); + ok(res > 0, "returned %ld with %ld (expected '>0')\n", res, GetLastError());
total = res;
@@ -1434,7 +1434,7 @@ static void test_GetSystemDirectory(void)
SetLastError(0xdeadbeef); res = GetSystemDirectoryA(NULL, total-1); - ok( res == total, "returned %u with %u (expected '%u')\n", + ok( res == total, "returned %lu with %lu (expected '%lu')\n", res, GetLastError(), total );
if (total > MAX_PATH) return; @@ -1444,7 +1444,7 @@ static void test_GetSystemDirectory(void) res = GetSystemDirectoryA(buffer, total); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), - "returned %d with %d and '%s' (expected '%d' and a string)\n", + "returned %ld with %ld and '%s' (expected '%ld' and a string)\n", res, GetLastError(), buffer, total-1);
buffer[0] = '\0'; @@ -1452,7 +1452,7 @@ static void test_GetSystemDirectory(void) res = GetSystemDirectoryA(buffer, total + 1); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), - "returned %d with %d and '%s' (expected '%d' and a string)\n", + "returned %ld with %ld and '%s' (expected '%ld' and a string)\n", res, GetLastError(), buffer, total-1);
memset(buffer, '#', total + 1); @@ -1460,7 +1460,7 @@ static void test_GetSystemDirectory(void) SetLastError(0xdeadbeef); res = GetSystemDirectoryA(buffer, total-1); /* res includes the terminating Zero) */ - ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", + ok( res == total, "returned %ld with %ld and '%s' (expected '%ld')\n", res, GetLastError(), buffer, total);
memset(buffer, '#', total + 1); @@ -1468,7 +1468,7 @@ static void test_GetSystemDirectory(void) SetLastError(0xdeadbeef); res = GetSystemDirectoryA(buffer, total-2); /* res includes the terminating Zero) */ - ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", + ok( res == total, "returned %ld with %ld and '%s' (expected '%ld')\n", res, GetLastError(), buffer, total); }
@@ -1481,7 +1481,7 @@ static void test_GetWindowsDirectory(void) SetLastError(0xdeadbeef); res = GetWindowsDirectoryA(NULL, 0); /* res includes the terminating Zero */ - ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError()); + ok(res > 0, "returned %ld with %ld (expected '>0')\n", res, GetLastError());
total = res; /* this crashes on XP */ @@ -1490,7 +1490,7 @@ static void test_GetWindowsDirectory(void)
SetLastError(0xdeadbeef); res = GetWindowsDirectoryA(NULL, total-1); - ok( res == total, "returned %u with %u (expected '%u')\n", + ok( res == total, "returned %lu with %lu (expected '%lu')\n", res, GetLastError(), total );
if (total > MAX_PATH) return; @@ -1500,7 +1500,7 @@ static void test_GetWindowsDirectory(void) res = GetWindowsDirectoryA(buffer, total); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), - "returned %d with %d and '%s' (expected '%d' and a string)\n", + "returned %ld with %ld and '%s' (expected '%ld' and a string)\n", res, GetLastError(), buffer, total-1);
buffer[0] = '\0'; @@ -1508,7 +1508,7 @@ static void test_GetWindowsDirectory(void) res = GetWindowsDirectoryA(buffer, total + 1); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), - "returned %d with %d and '%s' (expected '%d' and a string)\n", + "returned %ld with %ld and '%s' (expected '%ld' and a string)\n", res, GetLastError(), buffer, total-1);
memset(buffer, '#', total + 1); @@ -1516,7 +1516,7 @@ static void test_GetWindowsDirectory(void) SetLastError(0xdeadbeef); res = GetWindowsDirectoryA(buffer, total-1); /* res includes the terminating Zero) */ - ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", + ok( res == total, "returned %ld with %ld and '%s' (expected '%ld')\n", res, GetLastError(), buffer, total);
memset(buffer, '#', total + 1); @@ -1524,7 +1524,7 @@ static void test_GetWindowsDirectory(void) SetLastError(0xdeadbeef); res = GetWindowsDirectoryA(buffer, total-2); /* res includes the terminating Zero) */ - ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", + ok( res == total, "returned %ld with %ld and '%s' (expected '%ld')\n", res, GetLastError(), buffer, total); }
@@ -1592,7 +1592,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); ret = GetWindowsDirectoryA(buf, sizeof(buf)); - ok(ret, "GetWindowsDirectory error %u\n", GetLastError()); + ok(ret, "GetWindowsDirectory error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1601,7 +1601,7 @@ static void test_drive_letter_case(void) buf[2] = '/'; SetLastError(0xdeadbeef); ret = GetFullPathNameA(buf + 2, sizeof(buf), buf, NULL); - ok(ret, "GetFullPathName error %u\n", GetLastError()); + ok(ret, "GetFullPathName error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1609,7 +1609,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); ret = GetSystemDirectoryA(buf, sizeof(buf)); - ok(ret, "GetSystemDirectory error %u\n", GetLastError()); + ok(ret, "GetSystemDirectory error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1617,7 +1617,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); ret = GetCurrentDirectoryA(sizeof(buf), buf); - ok(ret, "GetCurrentDirectory error %u\n", GetLastError()); + ok(ret, "GetCurrentDirectory error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1626,7 +1626,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); ret = GetTempPathA(sizeof(buf), buf); - ok(ret, "GetTempPath error %u\n", GetLastError()); + ok(ret, "GetTempPath error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); if (buf[0]) { @@ -1637,7 +1637,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); ret = GetFullPathNameA(".", sizeof(buf), buf, NULL); - ok(ret, "GetFullPathName error %u\n", GetLastError()); + ok(ret, "GetFullPathName error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1645,7 +1645,7 @@ static void test_drive_letter_case(void) /* re-use the buffer returned by GetFullPathName */ SetLastError(0xdeadbeef); ret = GetShortPathNameA(buf, buf, sizeof(buf)); - ok(ret, "GetShortPathName error %u\n", GetLastError()); + ok(ret, "GetShortPathName error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1653,7 +1653,7 @@ static void test_drive_letter_case(void) /* re-use the buffer returned by GetShortPathName */ SetLastError(0xdeadbeef); ret = GetLongPathNameA(buf, buf, sizeof(buf)); - ok(ret, "GetLongPathNameA error %u\n", GetLastError()); + ok(ret, "GetLongPathNameA error %lu\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); ok(is_upper_case_letter(buf[0]), "expected buf[0] upper case letter got %c\n", buf[0]); @@ -1690,7 +1690,7 @@ static void create_manifest_file(const char *filename, const char *manifest) lstrcatW(manifest_path, path);
file = CreateFileW(manifest_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); WriteFile(file, manifest, strlen(manifest), &size, NULL); CloseHandle(file); } @@ -1719,10 +1719,10 @@ static HANDLE test_create(const char *file) actctx.lpSource = manifest_path;
handle = CreateActCtxW(&actctx); - ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %lu\n", GetLastError());
- ok(actctx.cbSize == sizeof(actctx), "cbSize=%d\n", actctx.cbSize); - ok(actctx.dwFlags == 0, "dwFlags=%d\n", actctx.dwFlags); + ok(actctx.cbSize == sizeof(actctx), "cbSize=%ld\n", actctx.cbSize); + ok(actctx.dwFlags == 0, "dwFlags=%ld\n", actctx.dwFlags); ok(actctx.lpSource == manifest_path, "lpSource=%p\n", actctx.lpSource); ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture); ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId); @@ -1752,16 +1752,16 @@ static void test_SearchPathA(void) /* NULL filename */ SetLastError(0xdeadbeef); ret = SearchPathA(pathA, NULL, NULL, ARRAY_SIZE(buffA), buffA, &ptrA); - ok(ret == 0, "Expected failure, got %d\n", ret); + ok(ret == 0, "Expected failure, got %ld\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %lx\n", GetLastError());
/* empty filename */ SetLastError(0xdeadbeef); ret = SearchPathA(pathA, fileA, NULL, ARRAY_SIZE(buffA), buffA, &ptrA); - ok(ret == 0, "Expected failure, got %d\n", ret); + ok(ret == 0, "Expected failure, got %ld\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %lx\n", GetLastError());
GetTempPathA(ARRAY_SIZE(pathA), pathA); strcpy(path2A, pathA); @@ -1773,15 +1773,15 @@ static void test_SearchPathA(void)
buffA[0] = 0; ret = SearchPathA(pathA, "testfile.ext", NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
buffA[0] = 0; ret = SearchPathA(pathA, "testfile.ext", ".ext2", ARRAY_SIZE(buffA), buffA, NULL); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
buffA[0] = 0; ret = SearchPathA(pathA, "testfile.ext.ext2", NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(ret && ret == strlen(path2A), "got %d\n", ret); + ok(ret && ret == strlen(path2A), "got %ld\n", ret);
DeleteFileA(path2A);
@@ -1796,42 +1796,42 @@ static void test_SearchPathA(void)
/* search fails without active context */ ret = SearchPathA(NULL, testdepA, NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret);
ret = SearchPathA(NULL, kernel32A, NULL, ARRAY_SIZE(path2A), path2A, NULL); - ok(ret && ret == strlen(path2A), "got %d\n", ret); + ok(ret && ret == strlen(path2A), "got %ld\n", ret);
ret = ActivateActCtx(handle, &cookie); - ok(ret, "failed to activate context, %u\n", GetLastError()); + ok(ret, "failed to activate context, %lu\n", GetLastError());
/* works when activated */ ret = SearchPathA(NULL, testdepA, NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(ret && ret == strlen(buffA), "got %d\n", ret); + ok(ret && ret == strlen(buffA), "got %ld\n", ret);
ret = SearchPathA(NULL, "testdep.dll", ".ext", ARRAY_SIZE(buffA), buffA, NULL); - ok(ret && ret == strlen(buffA), "got %d\n", ret); + ok(ret && ret == strlen(buffA), "got %ld\n", ret);
ret = SearchPathA(NULL, "testdep", ".dll", ARRAY_SIZE(buffA), buffA, NULL); - ok(ret && ret == strlen(buffA), "got %d\n", ret); + ok(ret && ret == strlen(buffA), "got %ld\n", ret);
ret = SearchPathA(NULL, "testdep", ".ext", ARRAY_SIZE(buffA), buffA, NULL); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
/* name contains path */ ret = SearchPathA(NULL, testdeprelA, NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
/* fails with specified path that doesn't contain this file */ ret = SearchPathA(pathA, testdepA, NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
/* path is redirected for wellknown names too */ ret = SearchPathA(NULL, kernel32A, NULL, ARRAY_SIZE(buffA), buffA, NULL); - ok(ret && ret == strlen(buffA), "got %d\n", ret); + ok(ret && ret == strlen(buffA), "got %ld\n", ret); ok(strcmp(buffA, path2A), "got wrong path %s, %s\n", buffA, path2A);
ret = DeactivateActCtx(0, cookie); - ok(ret, "failed to deactivate context, %u\n", GetLastError()); + ok(ret, "failed to deactivate context, %lu\n", GetLastError()); ReleaseActCtx(handle);
/* test the search path priority of the working directory */ @@ -1840,17 +1840,17 @@ static void test_SearchPathA(void) ok(ret, "failed to obtain working directory.\n"); sprintf(pathA, "%s\%s", tmpdirA, kernel32A); ret = SearchPathA(NULL, kernel32A, NULL, ARRAY_SIZE(path2A), path2A, NULL); - ok(ret && ret == strlen(path2A), "got %d\n", ret); + ok(ret && ret == strlen(path2A), "got %ld\n", ret); bret = CopyFileA(path2A, pathA, FALSE); - ok(bret != 0, "failed to copy test executable to temp directory, %u\n", GetLastError()); + ok(bret != 0, "failed to copy test executable to temp directory, %lu\n", GetLastError()); GetModuleFileNameA( GetModuleHandleA(0), path3A, sizeof(path3A) ); strcpy( strrchr( path3A, '\' ) + 1, kernel32A ); bret = CopyFileA(path2A, path3A, FALSE); - ok(bret != 0, "failed to copy test executable to launch directory, %u\n", GetLastError()); + ok(bret != 0, "failed to copy test executable to launch directory, %lu\n", GetLastError()); bret = SetCurrentDirectoryA(tmpdirA); ok(bret, "failed to change working directory\n"); ret = SearchPathA(NULL, kernel32A, ".exe", sizeof(buffA), buffA, NULL); - ok(ret && ret == strlen(buffA), "got %d\n", ret); + ok(ret && ret == strlen(buffA), "got %ld\n", ret); ok(strcmp(buffA, path3A) == 0, "expected %s, got %s\n", path3A, buffA); bret = SetCurrentDirectoryA(curdirA); ok(bret, "failed to reset working directory\n"); @@ -1880,18 +1880,18 @@ static void test_SearchPathW(void)
/* NULL filename */ ret = SearchPathW(pathW, NULL, NULL, ARRAY_SIZE(buffW), buffW, &ptrW); - ok(ret == 0, "Expected failure, got %d\n", ret); + ok(ret == 0, "Expected failure, got %ld\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %#x\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %#lx\n", GetLastError());
GetWindowsDirectoryW(pathW, ARRAY_SIZE(pathW));
/* empty filename */ SetLastError(0xdeadbeef); ret = SearchPathW(pathW, fileW, NULL, ARRAY_SIZE(buffW), buffW, &ptrW); - ok(ret == 0, "Expected failure, got %d\n", ret); + ok(ret == 0, "Expected failure, got %ld\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %lx\n", GetLastError());
GetTempPathW(ARRAY_SIZE(pathW), pathW); lstrcpyW(path2W, pathW); @@ -1903,15 +1903,15 @@ static void test_SearchPathW(void)
buffW[0] = 0; ret = SearchPathW(pathW, fileextW, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
buffW[0] = 0; ret = SearchPathW(pathW, fileextW, ext2W, ARRAY_SIZE(buffW), buffW, NULL); - ok(!ret, "Unexpected return value %u.\n", ret); + ok(!ret, "Unexpected return value %lu.\n", ret);
buffW[0] = 0; ret = SearchPathW(pathW, fileext2W, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret && ret == lstrlenW(path2W), "got %d\n", ret); + ok(ret && ret == lstrlenW(path2W), "got %ld\n", ret);
DeleteFileW(path2W);
@@ -1926,53 +1926,53 @@ static void test_SearchPathW(void)
/* search fails without active context */ ret = SearchPathW(NULL, testdepW, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret);
ret = SearchPathW(NULL, kernel32dllW, NULL, ARRAY_SIZE(path2W), path2W, NULL); - ok(ret && ret == lstrlenW(path2W), "got %d\n", ret); + ok(ret && ret == lstrlenW(path2W), "got %ld\n", ret);
/* full path, name without 'dll' extension */ GetSystemDirectoryW(pathW, ARRAY_SIZE(pathW)); ret = SearchPathW(pathW, kernel32W, NULL, ARRAY_SIZE(path2W), path2W, NULL); - ok(ret == 0, "got %d\n", ret); + ok(ret == 0, "got %ld\n", ret);
GetWindowsDirectoryW(pathW, ARRAY_SIZE(pathW));
ret = ActivateActCtx(handle, &cookie); - ok(ret, "failed to activate context, %u\n", GetLastError()); + ok(ret, "failed to activate context, %lu\n", GetLastError());
/* works when activated */ ret = SearchPathW(NULL, testdepW, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + ok(ret && ret == lstrlenW(buffW), "got %ld\n", ret);
ret = SearchPathW(NULL, testdepW, extW, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + ok(ret && ret == lstrlenW(buffW), "got %ld\n", ret);
ret = SearchPathW(NULL, testdep1W, dllW, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + ok(ret && ret == lstrlenW(buffW), "got %ld\n", ret);
ret = SearchPathW(NULL, testdep1W, extW, ARRAY_SIZE(buffW), buffW, NULL); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
/* name contains path */ ret = SearchPathW(NULL, testdeprelW, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
/* fails with specified path that doesn't contain this file */ ret = SearchPathW(pathW, testdepW, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(!ret, "got %d\n", ret); + ok(!ret, "got %ld\n", ret);
/* path is redirected for wellknown names too, meaning it takes precedence over normal search order */ ret = SearchPathW(NULL, kernel32dllW, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + ok(ret && ret == lstrlenW(buffW), "got %ld\n", ret); ok(lstrcmpW(buffW, path2W), "got wrong path %s, %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(path2W));
/* path is built using on manifest file name */ ret = SearchPathW(NULL, ole32W, NULL, ARRAY_SIZE(buffW), buffW, NULL); - ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + ok(ret && ret == lstrlenW(buffW), "got %ld\n", ret);
ret = DeactivateActCtx(0, cookie); - ok(ret, "failed to deactivate context, %u\n", GetLastError()); + ok(ret, "failed to deactivate context, %lu\n", GetLastError()); ReleaseActCtx(handle); }
@@ -2010,12 +2010,12 @@ static void test_GetFullPathNameA(void) invalid_parameters[i].len, invalid_parameters[i].buffer, invalid_parameters[i].lastpart); - ok(!ret, "[%d] Expected GetFullPathNameA to return 0, got %u\n", i, ret); + ok(!ret, "[%d] Expected GetFullPathNameA to return 0, got %lu\n", i, ret); ok(!strcmp(output, "deadbeef"), "[%d] Expected the output buffer to be unchanged, got "%s"\n", i, output); ok(filepart == (char *)0xdeadbeef, "[%d] Expected output file part pointer to be untouched, got %p\n", i, filepart); ok(GetLastError() == 0xdeadbeef || GetLastError() == ERROR_INVALID_NAME, /* Win7 */ - "[%d] Expected GetLastError() to return 0xdeadbeef, got %u\n", + "[%d] Expected GetLastError() to return 0xdeadbeef, got %lu\n", i, GetLastError()); }
@@ -2034,7 +2034,7 @@ static void test_GetFullPathNameA(void) for (i = 0; i < ARRAY_SIZE(testset); i++) { ret = GetFullPathNameA(testset[i].input, sizeof(output), output, &filepart); - ok(ret, "[%d] GetFullPathName error %u\n", i, GetLastError()); + ok(ret, "[%d] GetFullPathName error %lu\n", i, GetLastError()); ok(!lstrcmpA(filepart, testset[i].expected), "[%d] expected %s got %s\n", i, testset[i].expected, filepart); } @@ -2080,14 +2080,14 @@ static void test_GetFullPathNameW(void) invalid_parameters[i].len, invalid_parameters[i].buffer, invalid_parameters[i].lastpart); - ok(!ret, "[%d] Expected GetFullPathNameW to return 0, got %u\n", i, ret); + ok(!ret, "[%d] Expected GetFullPathNameW to return 0, got %lu\n", i, ret); ok(!lstrcmpW(output, deadbeefW), "[%d] Expected the output buffer to be unchanged, got %s\n", i, wine_dbgstr_w(output)); ok(filepart == (WCHAR *)0xdeadbeef || (invalid_parameters[i].win7_expect && filepart == NULL), "[%d] Expected output file part pointer to be untouched, got %p\n", i, filepart); ok(GetLastError() == 0xdeadbeef || GetLastError() == ERROR_INVALID_NAME, /* Win7 */ - "[%d] Expected GetLastError() to return 0xdeadbeef, got %u\n", + "[%d] Expected GetLastError() to return 0xdeadbeef, got %lu\n", i, GetLastError()); } } @@ -2124,65 +2124,65 @@ static void test_relative_path(void) GetCurrentDirectoryW(MAX_PATH, curdir); GetTempPathA(MAX_PATH, path); ret = SetCurrentDirectoryA(path); - ok(ret, "SetCurrentDirectory error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory error %ld\n", GetLastError());
ret = CreateDirectoryA("foo", NULL); - ok(ret, "CreateDirectory error %d\n", GetLastError()); + ok(ret, "CreateDirectory error %ld\n", GetLastError()); file = CreateFileA("foo\file", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok(file != INVALID_HANDLE_VALUE, "failed to create temp file\n"); CloseHandle(file); ret = CreateDirectoryA("bar", NULL); - ok(ret, "CreateDirectory error %d\n", GetLastError()); + ok(ret, "CreateDirectory error %ld\n", GetLastError()); ret = SetCurrentDirectoryA("bar"); - ok(ret, "SetCurrentDirectory error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory error %ld\n", GetLastError());
ret = GetFileAttributesA("..\foo\file"); - ok(ret != INVALID_FILE_ATTRIBUTES, "GetFileAttributes error %d\n", GetLastError()); + ok(ret != INVALID_FILE_ATTRIBUTES, "GetFileAttributes error %ld\n", GetLastError());
strcpy(buf, "deadbeef"); ret = GetLongPathNameA(".", buf, MAX_PATH); - ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(ret, "GetLongPathName error %ld\n", GetLastError()); ok(!strcmp(buf, "."), "expected ., got %s\n", buf); strcpy(buf, "deadbeef"); ret = GetShortPathNameA(".", buf, MAX_PATH); - ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(ret, "GetShortPathName error %ld\n", GetLastError()); ok(!strcmp(buf, "."), "expected ., got %s\n", buf);
strcpy(buf, "deadbeef"); ret = GetLongPathNameA("..", buf, MAX_PATH); - ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(ret, "GetLongPathName error %ld\n", GetLastError()); ok(!strcmp(buf, ".."), "expected .., got %s\n", buf); strcpy(buf, "deadbeef"); ret = GetShortPathNameA("..", buf, MAX_PATH); - ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(ret, "GetShortPathName error %ld\n", GetLastError()); ok(!strcmp(buf, ".."), "expected .., got %s\n", buf);
strcpy(buf, "deadbeef"); ret = GetLongPathNameA("..\foo\file", buf, MAX_PATH); - ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(ret, "GetLongPathName error %ld\n", GetLastError()); ok(!strcmp(buf, "..\foo\file"), "expected ..\foo\file, got %s\n", buf); strcpy(buf, "deadbeef"); ret = GetShortPathNameA("..\foo\file", buf, MAX_PATH); - ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(ret, "GetShortPathName error %ld\n", GetLastError()); ok(!strcmp(buf, "..\foo\file"), "expected ..\foo\file, got %s\n", buf);
strcpy(buf, "deadbeef"); ret = GetLongPathNameA(".\..\foo\file", buf, MAX_PATH); - ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(ret, "GetLongPathName error %ld\n", GetLastError()); ok(!strcmp(buf, ".\..\foo\file"), "expected .\..\foo\file, got %s\n", buf); strcpy(buf, "deadbeef"); ret = GetShortPathNameA(".\..\foo\file", buf, MAX_PATH); - ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(ret, "GetShortPathName error %ld\n", GetLastError()); ok(!strcmp(buf, ".\..\foo\file"), "expected .\..\foo\file, got %s\n", buf);
/* test double delimiters */ strcpy(buf, "deadbeef"); ret = GetLongPathNameA("..\\foo\file", buf, MAX_PATH); - ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(ret, "GetLongPathName error %ld\n", GetLastError()); ok(!strcmp(buf, "..\\foo\file"), "expected ..\\foo\file, got %s\n", buf); strcpy(buf, "deadbeef"); ret = GetShortPathNameA("..\\foo\file", buf, MAX_PATH); - ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(ret, "GetShortPathName error %ld\n", GetLastError()); ok(!strcmp(buf, "..\\foo\file"), "expected ..\\foo\file, got %s\n", buf);
SetCurrentDirectoryA(".."); @@ -2289,43 +2289,43 @@ static void test_SetSearchPathMode(void) SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( 0 ); ok( !ret, "SetSearchPathMode succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( 0x80 ); ok( !ret, "SetSearchPathMode succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_PERMANENT ); ok( !ret, "SetSearchPathMode succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = SearchPathA( NULL, "kernel32.dll", NULL, MAX_PATH, buf, NULL ); - ok( ret, "SearchPathA failed err %u\n", GetLastError() ); + ok( ret, "SearchPathA failed err %lu\n", GetLastError() ); GetCurrentDirectoryA( MAX_PATH, expect ); strcat( expect, "\kernel32.dll" ); ok( !lstrcmpiA( buf, expect ), "found %s expected %s\n", buf, expect );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE ); - ok( ret, "SetSearchPathMode failed err %u\n", GetLastError() ); + ok( ret, "SetSearchPathMode failed err %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = SearchPathA( NULL, "kernel32.dll", NULL, MAX_PATH, buf, NULL ); - ok( ret, "SearchPathA failed err %u\n", GetLastError() ); + ok( ret, "SearchPathA failed err %lu\n", GetLastError() ); GetSystemDirectoryA( expect, MAX_PATH ); strcat( expect, "\kernel32.dll" ); ok( !lstrcmpiA( buf, expect ), "found %s expected %s\n", buf, expect );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE ); - ok( ret, "SetSearchPathMode failed err %u\n", GetLastError() ); + ok( ret, "SetSearchPathMode failed err %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = SearchPathA( NULL, "kernel32.dll", NULL, MAX_PATH, buf, NULL ); - ok( ret, "SearchPathA failed err %u\n", GetLastError() ); + ok( ret, "SearchPathA failed err %lu\n", GetLastError() ); GetCurrentDirectoryA( MAX_PATH, expect ); strcat( expect, "\kernel32.dll" ); ok( !lstrcmpiA( buf, expect ), "found %s expected %s\n", buf, expect ); @@ -2333,29 +2333,29 @@ static void test_SetSearchPathMode(void) SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); ok( !ret, "SetSearchPathMode succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); - ok( ret, "SetSearchPathMode failed err %u\n", GetLastError() ); + ok( ret, "SetSearchPathMode failed err %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE ); ok( !ret, "SetSearchPathMode succeeded\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE ); ok( !ret, "SetSearchPathMode succeeded\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pSetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT ); - ok( ret, "SetSearchPathMode failed err %u\n", GetLastError() ); + ok( ret, "SetSearchPathMode failed err %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = SearchPathA( NULL, "kernel32.dll", NULL, MAX_PATH, buf, NULL ); - ok( ret, "SearchPathA failed err %u\n", GetLastError() ); + ok( ret, "SearchPathA failed err %lu\n", GetLastError() ); GetSystemDirectoryA( expect, MAX_PATH ); strcat( expect, "\kernel32.dll" ); ok( !lstrcmpiA( buf, expect ), "found %s expected %s\n", buf, expect ); @@ -2434,7 +2434,7 @@ static void test_RtlGetSearchPath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetSearchPath( &path ); - ok( !ret, "RtlGetSearchPath failed %x\n", ret ); + ok( !ret, "RtlGetSearchPath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
@@ -2442,7 +2442,7 @@ static void test_RtlGetSearchPath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetSearchPath( &path ); - ok( !ret, "RtlGetSearchPath failed %x\n", ret ); + ok( !ret, "RtlGetSearchPath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
@@ -2452,7 +2452,7 @@ static void test_RtlGetSearchPath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetSearchPath( &path ); - ok( !ret, "RtlGetSearchPath failed %x\n", ret ); + ok( !ret, "RtlGetSearchPath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path ); pSetDllDirectoryW( NULL ); @@ -2483,14 +2483,14 @@ static void test_RtlGetExePath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, FALSE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetExePath( fooW, &path ); - ok( !ret, "RtlGetExePath failed %x\n", ret ); + ok( !ret, "RtlGetExePath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, FALSE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetExePath( fooW + 1, &path ); - ok( !ret, "RtlGetExePath failed %x\n", ret ); + ok( !ret, "RtlGetExePath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
@@ -2499,14 +2499,14 @@ static void test_RtlGetExePath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, FALSE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetExePath( fooW, &path ); - ok( !ret, "RtlGetExePath failed %x\n", ret ); + ok( !ret, "RtlGetExePath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
build_search_path( buffer, ARRAY_SIZE(buffer), NULL, emptyW, TRUE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetExePath( fooW + 1, &path ); - ok( !ret, "RtlGetExePath failed %x\n", ret ); + ok( !ret, "RtlGetExePath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
@@ -2514,7 +2514,7 @@ static void test_RtlGetExePath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, FALSE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetExePath( fooW, &path ); - ok( !ret, "RtlGetExePath failed %x\n", ret ); + ok( !ret, "RtlGetExePath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
@@ -2524,7 +2524,7 @@ static void test_RtlGetExePath(void) build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, FALSE ); path = (WCHAR *)0xdeadbeef; ret = pRtlGetExePath( fooW, &path ); - ok( !ret, "RtlGetExePath failed %x\n", ret ); + ok( !ret, "RtlGetExePath failed %lx\n", ret ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path ); pSetDllDirectoryW( NULL ); @@ -2553,7 +2553,7 @@ static void test_LdrGetDllPath(void)
path = unknown_ptr = (WCHAR *)0xdeadbeef; ret = pLdrGetDllPath( 0, 0, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path ); @@ -2561,7 +2561,7 @@ static void test_LdrGetDllPath(void) SetEnvironmentVariableA( "PATH", "foo" ); build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE ); ret = pLdrGetDllPath( 0, 0, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path ); @@ -2571,7 +2571,7 @@ static void test_LdrGetDllPath(void) ok( pSetDllDirectoryW( dlldir ), "SetDllDirectoryW failed\n" ); build_search_path( buffer, ARRAY_SIZE(buffer), NULL, dlldir, TRUE ); ret = pLdrGetDllPath( 0, 0, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path ); @@ -2579,14 +2579,14 @@ static void test_LdrGetDllPath(void) }
ret = pLdrGetDllPath( 0, LOAD_LIBRARY_SEARCH_SYSTEM32, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); GetSystemDirectoryW( buffer, ARRAY_SIZE(buffer) ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
ret = pLdrGetDllPath( 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); GetModuleFileNameW( NULL, buffer, ARRAY_SIZE(buffer) ); if ((p = wcsrchr( buffer, '\' ))) *p = 0; @@ -2594,7 +2594,7 @@ static void test_LdrGetDllPath(void) pRtlReleasePath( path );
ret = pLdrGetDllPath( fooW, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, &path, &unknown_ptr ); - ok( ret == STATUS_INVALID_PARAMETER, "LdrGetDllPath failed %x\n", ret ); + ok( ret == STATUS_INVALID_PARAMETER, "LdrGetDllPath failed %lx\n", ret );
lstrcpyW( buffer, L"\\?\" ); lstrcatW( buffer, dlldir ); @@ -2602,48 +2602,48 @@ static void test_LdrGetDllPath(void) *p++ = '\'; lstrcpyW( p, fooW ); ret = pLdrGetDllPath( buffer, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( !memcmp( path, L"\\?\", 4 * sizeof(WCHAR) ) && path_equal( path + 4, dlldir ), "got %s expected \\?\%s\n", wine_dbgstr_w(path), wine_dbgstr_w(dlldir)); pRtlReleasePath( path );
ret = pLdrGetDllPath( L"\\?\c:\test.dll", LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( !lstrcmpW( path, L"\\?\c:" ), "got %s expected \\?\c:\n", wine_dbgstr_w(path)); pRtlReleasePath( path );
ret = pLdrGetDllPath( fooW, LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
ret = pLdrGetDllPath( L"temp/foo", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
ret = pLdrGetDllPath( L".\foo\foobar", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); build_search_path( buffer, ARRAY_SIZE(buffer), L".\foo\foobar", NULL, TRUE ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
ret = pLdrGetDllPath( L"temp\foo", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); build_search_path( buffer, ARRAY_SIZE(buffer), L"temp\foo", NULL, TRUE ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); pRtlReleasePath( path );
ret = pLdrGetDllPath( L"c:\temp\foo", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); build_search_path( buffer, ARRAY_SIZE(buffer), L"c:\temp\foo", NULL, TRUE ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); @@ -2651,7 +2651,7 @@ static void test_LdrGetDllPath(void)
lstrcpyW( buffer, fooW ); ret = pLdrGetDllPath( buffer, LOAD_WITH_ALTERED_SEARCH_PATH | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, &path, &unknown_ptr ); - ok( ret == STATUS_INVALID_PARAMETER, "got %x expected %x\n", ret, STATUS_INVALID_PARAMETER ); + ok( ret == STATUS_INVALID_PARAMETER, "got %lx expected %lx\n", ret, STATUS_INVALID_PARAMETER ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); pRtlReleasePath( path );
@@ -2660,7 +2660,7 @@ static void test_LdrGetDllPath(void) *p++ = '\'; lstrcpyW( p, fooW ); ret = pLdrGetDllPath( buffer, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( path_equal( path, dlldir ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(dlldir)); pRtlReleasePath( path ); @@ -2670,7 +2670,7 @@ static void test_LdrGetDllPath(void) DLL_DIRECTORY_COOKIE cookie = pAddDllDirectory( dlldir ); ok( !!cookie, "AddDllDirectory failed\n" ); ret = pLdrGetDllPath( 0, LOAD_LIBRARY_SEARCH_USER_DIRS, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); ok( path_equal( path, dlldir ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(dlldir)); pRtlReleasePath( path ); @@ -2681,7 +2681,7 @@ static void test_LdrGetDllPath(void) { pSetDefaultDllDirectories( LOAD_LIBRARY_SEARCH_SYSTEM32 ); ret = pLdrGetDllPath( 0, 0, &path, &unknown_ptr ); - ok( !ret, "LdrGetDllPath failed %x\n", ret ); + ok( !ret, "LdrGetDllPath failed %lx\n", ret ); ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr ); GetSystemDirectoryW( buffer, ARRAY_SIZE(buffer) ); ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 053e103bf14..7fa3c313d47 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -107,9 +107,9 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD rpcargs.args[4] = (ULONG_PTR)overlapped;
thread = CreateThread(NULL, 0, rpcThreadMain, (void *)&rpcargs, 0, &threadId); - ok(thread != NULL, "CreateThread failed. %d\n", GetLastError()); + ok(thread != NULL, "CreateThread failed. %ld\n", GetLastError()); ret = WaitForSingleObject(thread, INFINITE); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with %d.\n", GetLastError()); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with %ld.\n", GetLastError()); CloseHandle(thread);
SetLastError(rpcargs.lastError); @@ -120,14 +120,14 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD static void _test_not_signaled(unsigned line, HANDLE handle) { DWORD res = WaitForSingleObject(handle, 0); - ok_(__FILE__,line)(res == WAIT_TIMEOUT, "WaitForSingleObject returned %u (%u)\n", res, GetLastError()); + ok_(__FILE__,line)(res == WAIT_TIMEOUT, "WaitForSingleObject returned %lu (%lu)\n", res, GetLastError()); }
#define test_signaled(h) _test_signaled(__LINE__,h) static void _test_signaled(unsigned line, HANDLE handle) { DWORD res = WaitForSingleObject(handle, 0); - ok_(__FILE__,line)(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + ok_(__FILE__,line)(res == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", res); }
#define test_pipe_info(a,b,c,d,e) _test_pipe_info(__LINE__,a,b,c,d,e) @@ -138,10 +138,10 @@ static void _test_pipe_info(unsigned line, HANDLE pipe, DWORD ex_flags, DWORD ex
res = GetNamedPipeInfo(pipe, &flags, &out_buf_size, &in_buf_size, &max_instances); ok_(__FILE__,line)(res, "GetNamedPipeInfo failed: %x\n", res); - ok_(__FILE__,line)(flags == ex_flags, "flags = %x, expected %x\n", flags, ex_flags); - ok_(__FILE__,line)(out_buf_size == ex_out_buf_size, "out_buf_size = %x, expected %u\n", out_buf_size, ex_out_buf_size); - ok_(__FILE__,line)(in_buf_size == ex_in_buf_size, "in_buf_size = %x, expected %u\n", in_buf_size, ex_in_buf_size); - ok_(__FILE__,line)(max_instances == ex_max_instances, "max_instances = %x, expected %u\n", max_instances, ex_max_instances); + ok_(__FILE__,line)(flags == ex_flags, "flags = %lx, expected %lx\n", flags, ex_flags); + ok_(__FILE__,line)(out_buf_size == ex_out_buf_size, "out_buf_size = %lx, expected %lu\n", out_buf_size, ex_out_buf_size); + ok_(__FILE__,line)(in_buf_size == ex_in_buf_size, "in_buf_size = %lx, expected %lu\n", in_buf_size, ex_in_buf_size); + ok_(__FILE__,line)(max_instances == ex_max_instances, "max_instances = %lx, expected %lu\n", max_instances, ex_max_instances); }
#define test_file_access(a,b) _test_file_access(__LINE__,a,b) @@ -153,8 +153,8 @@ static void _test_file_access(unsigned line, HANDLE handle, DWORD expected_acces
memset(&info, 0x11, sizeof(info)); status = NtQueryInformationFile(handle, &io, &info, sizeof(info), FileAccessInformation); - ok_(__FILE__,line)(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); - ok_(__FILE__,line)(info.AccessFlags == expected_access, "got access %08x expected %08x\n", + ok_(__FILE__,line)(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08lx\n", status); + ok_(__FILE__,line)(info.AccessFlags == expected_access, "got access %08lx expected %08lx\n", info.AccessFlags, expected_access); }
@@ -180,7 +180,7 @@ static void test_CreateNamedPipe(int pipemode) /* Wait for nonexistent pipe */ ret = WaitNamedPipeA(PIPENAME, 2000); ok(ret == 0, "WaitNamedPipe returned %d for nonexistent pipe\n", ret); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
/* Bad parameter checks */ hnp = CreateNamedPipeA("not a named pipe", PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT, @@ -232,24 +232,24 @@ static void test_CreateNamedPipe(int pipemode) | FILE_APPEND_DATA | FILE_WRITE_DATA | FILE_READ_DATA);
ret = PeekNamedPipe(hnp, NULL, 0, NULL, &readden, NULL); - ok(!ret && GetLastError() == ERROR_BAD_PIPE, "PeekNamedPipe returned %x (%u)\n", + ok(!ret && GetLastError() == ERROR_BAD_PIPE, "PeekNamedPipe returned %x (%lu)\n", ret, GetLastError());
ret = WaitNamedPipeA(PIPENAME, 2000); - ok(ret, "WaitNamedPipe failed (%d)\n", GetLastError()); + ok(ret, "WaitNamedPipe failed (%ld)\n", GetLastError());
hFile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed (%ld)\n", GetLastError());
ok(!WaitNamedPipeA(PIPENAME, 100), "WaitNamedPipe succeeded\n");
- ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError());
/* Test ConnectNamedPipe() in both directions */ ok(!ConnectNamedPipe(hnp, NULL), "ConnectNamedPipe(server) succeeded\n"); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "expected ERROR_PIPE_CONNECTED, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "expected ERROR_PIPE_CONNECTED, got %lu\n", GetLastError()); ok(!ConnectNamedPipe(hFile, NULL), "ConnectNamedPipe(client) succeeded\n"); - ok(GetLastError() == ERROR_INVALID_FUNCTION, "expected ERROR_INVALID_FUNCTION, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_FUNCTION, "expected ERROR_INVALID_FUNCTION, got %lu\n", GetLastError());
/* don't try to do i/o if one side couldn't be opened, as it hangs */ if (hFile != INVALID_HANDLE_VALUE) { @@ -260,14 +260,14 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hnp, obuf, sizeof(obuf), &written, NULL), "WriteFile\n"); ok(written == sizeof(obuf), "write file len\n"); ok(ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf), "read got %d bytes\n", readden); + ok(readden == sizeof(obuf), "read got %ld bytes\n", readden); ok(memcmp(obuf, ibuf, written) == 0, "content check\n");
memset(ibuf, 0, sizeof(ibuf)); ok(WriteFile(hFile, obuf2, sizeof(obuf2), &written, NULL), "WriteFile\n"); ok(written == sizeof(obuf2), "write file len\n"); ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf2), "read got %d bytes\n", readden); + ok(readden == sizeof(obuf2), "read got %ld bytes\n", readden); ok(memcmp(obuf2, ibuf, written) == 0, "content check\n");
/* Now the same again, but with an additional call to PeekNamedPipe */ @@ -275,32 +275,32 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hnp, obuf, sizeof(obuf), &written, NULL), "WriteFile\n"); ok(written == sizeof(obuf), "write file len 1\n"); ok(PeekNamedPipe(hFile, NULL, 0, NULL, &avail, &left), "Peek\n"); - ok(avail == sizeof(obuf), "peek 1 got %d bytes\n", avail); + ok(avail == sizeof(obuf), "peek 1 got %ld bytes\n", avail); if (pipemode == PIPE_TYPE_BYTE) - ok(left == 0, "peek 1 got %d bytes left\n", left); + ok(left == 0, "peek 1 got %ld bytes left\n", left); else - ok(left == sizeof(obuf), "peek 1 got %d bytes left\n", left); + ok(left == sizeof(obuf), "peek 1 got %ld bytes left\n", left); ok(ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf), "read 1 got %d bytes\n", readden); + ok(readden == sizeof(obuf), "read 1 got %ld bytes\n", readden); ok(memcmp(obuf, ibuf, written) == 0, "content 1 check\n");
memset(ibuf, 0, sizeof(ibuf)); ok(WriteFile(hFile, obuf2, sizeof(obuf2), &written, NULL), "WriteFile\n"); ok(written == sizeof(obuf2), "write file len 2\n"); ok(PeekNamedPipe(hnp, NULL, 0, NULL, &avail, &left), "Peek\n"); - ok(avail == sizeof(obuf2), "peek 2 got %d bytes\n", avail); + ok(avail == sizeof(obuf2), "peek 2 got %ld bytes\n", avail); if (pipemode == PIPE_TYPE_BYTE) - ok(left == 0, "peek 2 got %d bytes left\n", left); + ok(left == 0, "peek 2 got %ld bytes left\n", left); else - ok(left == sizeof(obuf2), "peek 2 got %d bytes left\n", left); + ok(left == sizeof(obuf2), "peek 2 got %ld bytes left\n", left); ok(PeekNamedPipe(hnp, (LPVOID)1, 0, NULL, &avail, &left), "Peek\n"); - ok(avail == sizeof(obuf2), "peek 2 got %d bytes\n", avail); + ok(avail == sizeof(obuf2), "peek 2 got %ld bytes\n", avail); if (pipemode == PIPE_TYPE_BYTE) - ok(left == 0, "peek 2 got %d bytes left\n", left); + ok(left == 0, "peek 2 got %ld bytes left\n", left); else - ok(left == sizeof(obuf2), "peek 2 got %d bytes left\n", left); + ok(left == sizeof(obuf2), "peek 2 got %ld bytes left\n", left); ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf2), "read 2 got %d bytes\n", readden); + ok(readden == sizeof(obuf2), "read 2 got %ld bytes\n", readden); ok(memcmp(obuf2, ibuf, written) == 0, "content 2 check\n");
/* Test how ReadFile behaves when the buffer is not big enough for the whole message */ @@ -308,39 +308,39 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hnp, obuf2, sizeof(obuf2), &written, NULL), "WriteFile\n"); ok(written == sizeof(obuf2), "write file len\n"); ok(PeekNamedPipe(hFile, ibuf, 4, &readden, &avail, &left), "Peek\n"); - ok(readden == 4, "peek got %d bytes\n", readden); - ok(avail == sizeof(obuf2), "peek got %d bytes available\n", avail); + ok(readden == 4, "peek got %ld bytes\n", readden); + ok(avail == sizeof(obuf2), "peek got %ld bytes available\n", avail); if (pipemode == PIPE_TYPE_BYTE) - ok(left == -4, "peek got %d bytes left\n", left); + ok(left == -4, "peek got %ld bytes left\n", left); else - ok(left == sizeof(obuf2)-4, "peek got %d bytes left\n", left); + ok(left == sizeof(obuf2)-4, "peek got %ld bytes left\n", left); ok(ReadFile(hFile, ibuf, 4, &readden, NULL), "ReadFile\n"); - ok(readden == 4, "read got %d bytes\n", readden); + ok(readden == 4, "read got %ld bytes\n", readden); ok(ReadFile(hFile, ibuf + 4, sizeof(ibuf) - 4, &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf2) - 4, "read got %d bytes\n", readden); + ok(readden == sizeof(obuf2) - 4, "read got %ld bytes\n", readden); ok(memcmp(obuf2, ibuf, written) == 0, "content check\n");
memset(ibuf, 0, sizeof(ibuf)); ok(WriteFile(hFile, obuf, sizeof(obuf), &written, NULL), "WriteFile\n"); ok(written == sizeof(obuf), "write file len\n"); ok(PeekNamedPipe(hnp, ibuf, 4, &readden, &avail, &left), "Peek\n"); - ok(readden == 4, "peek got %d bytes\n", readden); - ok(avail == sizeof(obuf), "peek got %d bytes available\n", avail); + ok(readden == 4, "peek got %ld bytes\n", readden); + ok(avail == sizeof(obuf), "peek got %ld bytes available\n", avail); if (pipemode == PIPE_TYPE_BYTE) { - ok(left == -4, "peek got %d bytes left\n", left); + ok(left == -4, "peek got %ld bytes left\n", left); ok(ReadFile(hnp, ibuf, 4, &readden, NULL), "ReadFile\n"); } else { - ok(left == sizeof(obuf)-4, "peek got %d bytes left\n", left); + ok(left == sizeof(obuf)-4, "peek got %ld bytes left\n", left); SetLastError(0xdeadbeef); ok(!ReadFile(hnp, ibuf, 4, &readden, NULL), "ReadFile\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error\n"); } - ok(readden == 4, "read got %d bytes\n", readden); + ok(readden == 4, "read got %ld bytes\n", readden); ok(ReadFile(hnp, ibuf + 4, sizeof(ibuf) - 4, &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf) - 4, "read got %d bytes\n", readden); + ok(readden == sizeof(obuf) - 4, "read got %ld bytes\n", readden); ok(memcmp(obuf, ibuf, written) == 0, "content check\n");
/* Similar to above, but use a read buffer size small enough to read in three parts */ @@ -350,7 +350,7 @@ static void test_CreateNamedPipe(int pipemode) if (pipemode == PIPE_TYPE_BYTE) { ok(ReadFile(hnp, ibuf, 4, &readden, NULL), "ReadFile\n"); - ok(readden == 4, "read got %d bytes\n", readden); + ok(readden == 4, "read got %ld bytes\n", readden); ok(ReadFile(hnp, ibuf + 4, 4, &readden, NULL), "ReadFile\n"); } else @@ -358,14 +358,14 @@ static void test_CreateNamedPipe(int pipemode) SetLastError(0xdeadbeef); ok(!ReadFile(hnp, ibuf, 4, &readden, NULL), "ReadFile\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error\n"); - ok(readden == 4, "read got %d bytes\n", readden); + ok(readden == 4, "read got %ld bytes\n", readden); SetLastError(0xdeadbeef); ok(!ReadFile(hnp, ibuf + 4, 4, &readden, NULL), "ReadFile\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error\n"); } - ok(readden == 4, "read got %d bytes\n", readden); + ok(readden == 4, "read got %ld bytes\n", readden); ok(ReadFile(hnp, ibuf + 8, sizeof(ibuf) - 8, &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf2) - 8, "read got %d bytes\n", readden); + ok(readden == sizeof(obuf2) - 8, "read got %ld bytes\n", readden); ok(memcmp(obuf2, ibuf, written) == 0, "content check\n");
/* Test reading of multiple writes */ @@ -375,23 +375,23 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hnp, obuf2, sizeof(obuf2), &written, NULL), " WriteFile3b\n"); ok(written == sizeof(obuf2), "write file len 3b\n"); ok(PeekNamedPipe(hFile, ibuf, 4, &readden, &avail, &left), "Peek3\n"); - ok(readden == 4, "peek3 got %d bytes\n", readden); + ok(readden == 4, "peek3 got %ld bytes\n", readden); if (pipemode == PIPE_TYPE_BYTE) - ok(left == -4, "peek3 got %d bytes left\n", left); + ok(left == -4, "peek3 got %ld bytes left\n", left); else - ok(left == sizeof(obuf)-4, "peek3 got %d bytes left\n", left); - ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes available\n", avail); + ok(left == sizeof(obuf)-4, "peek3 got %ld bytes left\n", left); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %ld bytes available\n", avail); ok(PeekNamedPipe(hFile, ibuf, sizeof(ibuf), &readden, &avail, &left), "Peek3\n"); if (pipemode == PIPE_TYPE_BYTE) { - ok(readden == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes\n", readden); - ok(left == (DWORD) -(sizeof(obuf) + sizeof(obuf2)), "peek3 got %d bytes left\n", left); + ok(readden == sizeof(obuf) + sizeof(obuf2), "peek3 got %ld bytes\n", readden); + ok(left == (DWORD) -(sizeof(obuf) + sizeof(obuf2)), "peek3 got %ld bytes left\n", left); } else { - ok(readden == sizeof(obuf), "peek3 got %d bytes\n", readden); - ok(left == 0, "peek3 got %d bytes left\n", left); + ok(readden == sizeof(obuf), "peek3 got %ld bytes\n", readden); + ok(left == 0, "peek3 got %ld bytes left\n", left); } - ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes available\n", avail); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %ld bytes available\n", avail); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "pipe content 3a check\n"); if (pipemode == PIPE_TYPE_BYTE && readden >= sizeof(obuf)+sizeof(obuf2)) { @@ -399,7 +399,7 @@ static void test_CreateNamedPipe(int pipemode) ok(memcmp(obuf2, pbuf, sizeof(obuf2)) == 0, "pipe content 3b check\n"); } ok(ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf) + sizeof(obuf2), "read 3 got %d bytes\n", readden); + ok(readden == sizeof(obuf) + sizeof(obuf2), "read 3 got %ld bytes\n", readden); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 3a check\n"); pbuf += sizeof(obuf); @@ -412,23 +412,23 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hFile, obuf2, sizeof(obuf2), &written, NULL), " WriteFile4b\n"); ok(written == sizeof(obuf2), "write file len 4b\n"); ok(PeekNamedPipe(hnp, ibuf, 4, &readden, &avail, &left), "Peek3\n"); - ok(readden == 4, "peek3 got %d bytes\n", readden); + ok(readden == 4, "peek3 got %ld bytes\n", readden); if (pipemode == PIPE_TYPE_BYTE) - ok(left == -4, "peek3 got %d bytes left\n", left); + ok(left == -4, "peek3 got %ld bytes left\n", left); else - ok(left == sizeof(obuf)-4, "peek3 got %d bytes left\n", left); - ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes available\n", avail); + ok(left == sizeof(obuf)-4, "peek3 got %ld bytes left\n", left); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %ld bytes available\n", avail); ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, &left), "Peek4\n"); if (pipemode == PIPE_TYPE_BYTE) { - ok(readden == sizeof(obuf) + sizeof(obuf2), "peek4 got %d bytes\n", readden); - ok(left == (DWORD) -(sizeof(obuf) + sizeof(obuf2)), "peek4 got %d bytes left\n", left); + ok(readden == sizeof(obuf) + sizeof(obuf2), "peek4 got %ld bytes\n", readden); + ok(left == (DWORD) -(sizeof(obuf) + sizeof(obuf2)), "peek4 got %ld bytes left\n", left); } else { - ok(readden == sizeof(obuf), "peek4 got %d bytes\n", readden); - ok(left == 0, "peek4 got %d bytes left\n", left); + ok(readden == sizeof(obuf), "peek4 got %ld bytes\n", readden); + ok(left == 0, "peek4 got %ld bytes left\n", left); } - ok(avail == sizeof(obuf) + sizeof(obuf2), "peek4 got %d bytes available\n", avail); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek4 got %ld bytes available\n", avail); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "pipe content 4a check\n"); if (pipemode == PIPE_TYPE_BYTE && readden >= sizeof(obuf)+sizeof(obuf2)) { @@ -437,10 +437,10 @@ static void test_CreateNamedPipe(int pipemode) } ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); if (pipemode == PIPE_TYPE_BYTE) { - ok(readden == sizeof(obuf) + sizeof(obuf2), "read 4 got %d bytes\n", readden); + ok(readden == sizeof(obuf) + sizeof(obuf2), "read 4 got %ld bytes\n", readden); } else { - ok(readden == sizeof(obuf), "read 4 got %d bytes\n", readden); + ok(readden == sizeof(obuf), "read 4 got %ld bytes\n", readden); } pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 4a check\n"); @@ -465,13 +465,13 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hnp, obuf2, sizeof(obuf2), &written, NULL), " WriteFile5b\n"); ok(written == sizeof(obuf2), "write file len 3b\n"); ok(PeekNamedPipe(hFile, ibuf, sizeof(ibuf), &readden, &avail, &left), "Peek5\n"); - ok(readden == sizeof(obuf), "peek5 got %d bytes\n", readden); - ok(avail == sizeof(obuf) + sizeof(obuf2), "peek5 got %d bytes available\n", avail); - ok(left == 0, "peek5 got %d bytes left\n", left); + ok(readden == sizeof(obuf), "peek5 got %ld bytes\n", readden); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek5 got %ld bytes available\n", avail); + ok(left == 0, "peek5 got %ld bytes left\n", left); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 5a check\n"); ok(ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf), "read 5 got %d bytes\n", readden); + ok(readden == sizeof(obuf), "read 5 got %ld bytes\n", readden); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 5a check\n"); if (readden <= sizeof(obuf)) @@ -480,11 +480,11 @@ static void test_CreateNamedPipe(int pipemode) /* Multiple writes in the reverse direction */ /* the write of obuf2 from write4 should still be in the buffer */ ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek6a\n"); - ok(readden == sizeof(obuf2), "peek6a got %d bytes\n", readden); - ok(avail == sizeof(obuf2), "peek6a got %d bytes available\n", avail); + ok(readden == sizeof(obuf2), "peek6a got %ld bytes\n", readden); + ok(avail == sizeof(obuf2), "peek6a got %ld bytes available\n", avail); if (avail > 0) { ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf2), "read 6a got %d bytes\n", readden); + ok(readden == sizeof(obuf2), "read 6a got %ld bytes\n", readden); pbuf = ibuf; ok(memcmp(obuf2, pbuf, sizeof(obuf2)) == 0, "content 6a check\n"); } @@ -494,13 +494,13 @@ static void test_CreateNamedPipe(int pipemode) ok(WriteFile(hFile, obuf2, sizeof(obuf2), &written, NULL), " WriteFile6b\n"); ok(written == sizeof(obuf2), "write file len 6b\n"); ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek6\n"); - ok(readden == sizeof(obuf), "peek6 got %d bytes\n", readden); + ok(readden == sizeof(obuf), "peek6 got %ld bytes\n", readden);
- ok(avail == sizeof(obuf) + sizeof(obuf2), "peek6b got %d bytes available\n", avail); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek6b got %ld bytes available\n", avail); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 6a check\n"); ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); - ok(readden == sizeof(obuf), "read 6b got %d bytes\n", readden); + ok(readden == sizeof(obuf), "read 6b got %ld bytes\n", readden); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 6a check\n"); if (readden <= sizeof(obuf)) @@ -513,9 +513,9 @@ static void test_CreateNamedPipe(int pipemode) SetLastError(0xdeadbeef); ok(!ReadFile(hFile, ibuf, 4, &readden, NULL), "ReadFile 7\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 7\n"); - ok(readden == 4, "read got %d bytes 7\n", readden); + ok(readden == 4, "read got %ld bytes 7\n", readden); ok(ReadFile(hFile, ibuf + 4, sizeof(ibuf) - 4, &readden, NULL), "ReadFile 7\n"); - ok(readden == sizeof(obuf2) - 4, "read got %d bytes 7\n", readden); + ok(readden == sizeof(obuf2) - 4, "read got %ld bytes 7\n", readden); ok(memcmp(obuf2, ibuf, written) == 0, "content check 7\n");
memset(ibuf, 0, sizeof(ibuf)); @@ -524,9 +524,9 @@ static void test_CreateNamedPipe(int pipemode) SetLastError(0xdeadbeef); ok(!ReadFile(hnp, ibuf, 4, &readden, NULL), "ReadFile 8\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 8\n"); - ok(readden == 4, "read got %d bytes 8\n", readden); + ok(readden == 4, "read got %ld bytes 8\n", readden); ok(ReadFile(hnp, ibuf + 4, sizeof(ibuf) - 4, &readden, NULL), "ReadFile 8\n"); - ok(readden == sizeof(obuf) - 4, "read got %d bytes 8\n", readden); + ok(readden == sizeof(obuf) - 4, "read got %ld bytes 8\n", readden); ok(memcmp(obuf, ibuf, written) == 0, "content check 8\n");
/* The following test shows that when doing a partial read of a message, the rest @@ -541,15 +541,15 @@ static void test_CreateNamedPipe(int pipemode) SetLastError(0xdeadbeef); ok(!ReadFile(hFile, ibuf, 4, &readden, NULL), "ReadFile 9\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 9\n"); - ok(readden == 4, "read got %d bytes 9\n", readden); + ok(readden == 4, "read got %ld bytes 9\n", readden); SetLastError(0xdeadbeef); ret = RpcReadFile(hFile, ibuf + 4, 4, &readden, NULL); ok(!ret, "RpcReadFile 9\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 9\n"); - ok(readden == 4, "read got %d bytes 9\n", readden); + ok(readden == 4, "read got %ld bytes 9\n", readden); ret = RpcReadFile(hFile, ibuf + 8, sizeof(ibuf), &readden, NULL); ok(ret, "RpcReadFile 9\n"); - ok(readden == sizeof(obuf) - 8, "read got %d bytes 9\n", readden); + ok(readden == sizeof(obuf) - 8, "read got %ld bytes 9\n", readden); ok(memcmp(obuf, ibuf, sizeof(obuf)) == 0, "content check 9\n"); if (readden <= sizeof(obuf) - 8) /* blocks forever if second part was already received */ { @@ -558,14 +558,14 @@ static void test_CreateNamedPipe(int pipemode) ret = RpcReadFile(hFile, ibuf, 4, &readden, NULL); ok(!ret, "RpcReadFile 9\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 9\n"); - ok(readden == 4, "read got %d bytes 9\n", readden); + ok(readden == 4, "read got %ld bytes 9\n", readden); SetLastError(0xdeadbeef); ok(!ReadFile(hFile, ibuf + 4, 4, &readden, NULL), "ReadFile 9\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 9\n"); - ok(readden == 4, "read got %d bytes 9\n", readden); + ok(readden == 4, "read got %ld bytes 9\n", readden); ret = RpcReadFile(hFile, ibuf + 8, sizeof(ibuf), &readden, NULL); ok(ret, "RpcReadFile 9\n"); - ok(readden == sizeof(obuf2) - 8, "read got %d bytes 9\n", readden); + ok(readden == sizeof(obuf2) - 8, "read got %ld bytes 9\n", readden); ok(memcmp(obuf2, ibuf, sizeof(obuf2)) == 0, "content check 9\n"); }
@@ -578,15 +578,15 @@ static void test_CreateNamedPipe(int pipemode) SetLastError(0xdeadbeef); ok(!ReadFile(hnp, ibuf, 4, &readden, NULL), "ReadFile 10\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 10\n"); - ok(readden == 4, "read got %d bytes 10\n", readden); + ok(readden == 4, "read got %ld bytes 10\n", readden); SetLastError(0xdeadbeef); ret = RpcReadFile(hnp, ibuf + 4, 4, &readden, NULL); ok(!ret, "RpcReadFile 10\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 10\n"); - ok(readden == 4, "read got %d bytes 10\n", readden); + ok(readden == 4, "read got %ld bytes 10\n", readden); ret = RpcReadFile(hnp, ibuf + 8, sizeof(ibuf), &readden, NULL); ok(ret, "RpcReadFile 10\n"); - ok(readden == sizeof(obuf2) - 8, "read got %d bytes 10\n", readden); + ok(readden == sizeof(obuf2) - 8, "read got %ld bytes 10\n", readden); ok(memcmp(obuf2, ibuf, sizeof(obuf2)) == 0, "content check 10\n"); if (readden <= sizeof(obuf2) - 8) /* blocks forever if second part was already received */ { @@ -595,14 +595,14 @@ static void test_CreateNamedPipe(int pipemode) ret = RpcReadFile(hnp, ibuf, 4, &readden, NULL); ok(!ret, "RpcReadFile 10\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 10\n"); - ok(readden == 4, "read got %d bytes 10\n", readden); + ok(readden == 4, "read got %ld bytes 10\n", readden); SetLastError(0xdeadbeef); ok(!ReadFile(hnp, ibuf + 4, 4, &readden, NULL), "ReadFile 10\n"); ok(GetLastError() == ERROR_MORE_DATA, "wrong error 10\n"); - ok(readden == 4, "read got %d bytes 10\n", readden); + ok(readden == 4, "read got %ld bytes 10\n", readden); ret = RpcReadFile(hnp, ibuf + 8, sizeof(ibuf), &readden, NULL); ok(ret, "RpcReadFile 10\n"); - ok(readden == sizeof(obuf) - 8, "read got %d bytes 10\n", readden); + ok(readden == sizeof(obuf) - 8, "read got %ld bytes 10\n", readden); ok(memcmp(obuf, ibuf, sizeof(obuf)) == 0, "content check 10\n"); }
@@ -667,7 +667,7 @@ static void test_CreateNamedPipe(int pipemode) | FILE_WRITE_PROPERTIES | FILE_APPEND_DATA | FILE_WRITE_DATA);
hFile = CreateFileA(PIPENAME, 0, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); test_file_access(hFile, SYNCHRONIZE | FILE_READ_ATTRIBUTES); CloseHandle(hFile);
@@ -675,9 +675,9 @@ static void test_CreateNamedPipe(int pipemode)
hnp = CreateNamedPipeA("\\.\pipe\a<>*?|"/b", PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(hnp != INVALID_HANDLE_VALUE, "failed to create pipe, error %u\n", GetLastError()); + ok(hnp != INVALID_HANDLE_VALUE, "failed to create pipe, error %lu\n", GetLastError()); hFile = CreateFileA("\\.\pipe\a<>*?|"/b", 0, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hFile != INVALID_HANDLE_VALUE, "failed to open pipe, error %u\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "failed to open pipe, error %lu\n", GetLastError()); CloseHandle(hFile); CloseHandle(hnp);
@@ -781,43 +781,43 @@ static void test_ReadFile(void) server = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_WAIT_FOREVER, NULL); - ok(server != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(server != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
client = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(client != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(client != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
ok(WriteFile(client, buf, sizeof(buf), &size, NULL), "WriteFile\n");
res = ReadFile(server, buf, 1, &size, NULL); - ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned %x(%u)\n", res, GetLastError()); - ok(size == 1, "size = %u\n", size); + ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned %x(%lu)\n", res, GetLastError()); + ok(size == 1, "size = %lu\n", size);
/* pass both overlapped and ret read */ memset(&overlapped, 0, sizeof(overlapped)); res = ReadFile(server, buf, 1, &size, &overlapped); - ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned %x(%u)\n", res, GetLastError()); - ok(size == 0, "size = %u\n", size); - ok((NTSTATUS)overlapped.Internal == STATUS_BUFFER_OVERFLOW, "Internal = %lx\n", overlapped.Internal); - ok(overlapped.InternalHigh == 1, "InternalHigh = %lx\n", overlapped.InternalHigh); + ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned %x(%lu)\n", res, GetLastError()); + ok(size == 0, "size = %lu\n", size); + ok((NTSTATUS)overlapped.Internal == STATUS_BUFFER_OVERFLOW, "Internal = %Ix\n", overlapped.Internal); + ok(overlapped.InternalHigh == 1, "InternalHigh = %Ix\n", overlapped.InternalHigh);
DisconnectNamedPipe(server);
memset(&overlapped, 0, sizeof(overlapped)); overlapped.InternalHigh = 0xdeadbeef; res = ReadFile(server, buf, 1, &size, &overlapped); - ok(!res && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "ReadFile returned %x(%u)\n", res, GetLastError()); - ok(size == 0, "size = %u\n", size); - ok(overlapped.Internal == STATUS_PENDING, "Internal = %lx\n", overlapped.Internal); - ok(overlapped.InternalHigh == 0xdeadbeef, "InternalHigh = %lx\n", overlapped.InternalHigh); + ok(!res && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "ReadFile returned %x(%lu)\n", res, GetLastError()); + ok(size == 0, "size = %lu\n", size); + ok(overlapped.Internal == STATUS_PENDING, "Internal = %Ix\n", overlapped.Internal); + ok(overlapped.InternalHigh == 0xdeadbeef, "InternalHigh = %Ix\n", overlapped.InternalHigh);
memset(&overlapped, 0, sizeof(overlapped)); overlapped.InternalHigh = 0xdeadbeef; res = WriteFile(server, buf, 1, &size, &overlapped); - ok(!res && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "ReadFile returned %x(%u)\n", res, GetLastError()); - ok(size == 0, "size = %u\n", size); - ok(overlapped.Internal == STATUS_PENDING, "Internal = %lx\n", overlapped.Internal); - ok(overlapped.InternalHigh == 0xdeadbeef, "InternalHigh = %lx\n", overlapped.InternalHigh); + ok(!res && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "ReadFile returned %x(%lu)\n", res, GetLastError()); + ok(size == 0, "size = %lu\n", size); + ok(overlapped.Internal == STATUS_PENDING, "Internal = %Ix\n", overlapped.Internal); + ok(overlapped.InternalHigh == 0xdeadbeef, "InternalHigh = %Ix\n", overlapped.InternalHigh);
CloseHandle(server); CloseHandle(client); @@ -919,7 +919,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg) { if (winetest_debug > 1) trace("Queueing an user APC\n"); /* verify the pipe is non alerable */ ret = QueueUserAPC(&user_apc, GetCurrentThread(), 0); - ok(ret, "QueueUserAPC failed: %d\n", GetLastError()); + ok(ret, "QueueUserAPC failed: %ld\n", GetLastError()); }
/* Wait for client to connect */ @@ -1010,7 +1010,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) if (winetest_debug > 1) trace("Server calling non-overlapped ConnectNamedPipe on overlapped pipe...\n"); success = ConnectNamedPipe(hnp, NULL); err = GetLastError(); - ok(success || (err == ERROR_PIPE_CONNECTED), "ConnectNamedPipe failed: %d\n", err); + ok(success || (err == ERROR_PIPE_CONNECTED), "ConnectNamedPipe failed: %ld\n", err); if (winetest_debug > 1) trace("ConnectNamedPipe operation complete.\n"); } else { if (winetest_debug > 1) trace("Server calling overlapped ConnectNamedPipe...\n"); @@ -1025,7 +1025,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) do { ret = WaitForSingleObjectEx(hEvent, INFINITE, TRUE); } while (ret == WAIT_IO_COMPLETION); - ok(ret == 0, "wait ConnectNamedPipe returned %x\n", ret); + ok(ret == 0, "wait ConnectNamedPipe returned %lx\n", ret); } success = GetOverlappedResult(hnp, &oOverlap, &dummy, letGORwait); if (!letGORwait && !letWFSOEwait && !success) { @@ -1053,7 +1053,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) do { ret = WaitForSingleObjectEx(hEvent, INFINITE, TRUE); } while (ret == WAIT_IO_COMPLETION); - ok(ret == 0, "wait ReadFile returned %x\n", ret); + ok(ret == 0, "wait ReadFile returned %lx\n", ret); } success = GetOverlappedResult(hnp, &oOverlap, &readden, letGORwait); if (!letGORwait && !letWFSOEwait && !success) { @@ -1077,7 +1077,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) do { ret = WaitForSingleObjectEx(hEvent, INFINITE, TRUE); } while (ret == WAIT_IO_COMPLETION); - ok(ret == 0, "wait WriteFile returned %x\n", ret); + ok(ret == 0, "wait WriteFile returned %lx\n", ret); } success = GetOverlappedResult(hnp, &oOverlap, &written, letGORwait); if (!letGORwait && !letWFSOEwait && !success) { @@ -1115,7 +1115,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
hcompletion = CreateIoCompletionPort(hnp, NULL, 12345, 1); - ok(hcompletion != NULL, "CreateIoCompletionPort failed, error=%i\n", GetLastError()); + ok(hcompletion != NULL, "CreateIoCompletionPort failed, error=%li\n", GetLastError());
for (i = 0; i < NB_SERVER_LOOPS; i++) { char buf[512]; @@ -1139,17 +1139,17 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) success = ConnectNamedPipe(hnp, &oConnect); err = GetLastError(); ok(!success && (err == ERROR_IO_PENDING || err == ERROR_PIPE_CONNECTED), - "overlapped ConnectNamedPipe got %u err %u\n", success, err ); + "overlapped ConnectNamedPipe got %u err %lu\n", success, err ); if (!success && err == ERROR_IO_PENDING) { if (winetest_debug > 1) trace("ConnectNamedPipe GetQueuedCompletionStatus\n"); success = GetQueuedCompletionStatus(hcompletion, &dummy, &compkey, &oResult, 0); if (!success) { ok( GetLastError() == WAIT_TIMEOUT, - "ConnectNamedPipe GetQueuedCompletionStatus wrong error %u\n", GetLastError()); + "ConnectNamedPipe GetQueuedCompletionStatus wrong error %lu\n", GetLastError()); success = GetQueuedCompletionStatus(hcompletion, &dummy, &compkey, &oResult, 10000); } - ok(success, "ConnectNamedPipe GetQueuedCompletionStatus failed, errno=%i\n", GetLastError()); + ok(success, "ConnectNamedPipe GetQueuedCompletionStatus failed, errno=%li\n", GetLastError()); if (success) { ok(compkey == 12345, "got completion key %i instead of 12345\n", (int)compkey); @@ -1165,10 +1165,10 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) success = ReadFile(hnp, buf, sizeof(buf), &readden, &oRead); if (winetest_debug > 1) trace("Server ReadFile returned...\n"); err = GetLastError(); - ok(success || err == ERROR_IO_PENDING, "overlapped ReadFile, err=%i\n", err); + ok(success || err == ERROR_IO_PENDING, "overlapped ReadFile, err=%li\n", err); success = GetQueuedCompletionStatus(hcompletion, &readden, &compkey, &oResult, 10000); - ok(success, "ReadFile GetQueuedCompletionStatus failed, errno=%i\n", GetLastError()); + ok(success, "ReadFile GetQueuedCompletionStatus failed, errno=%li\n", GetLastError()); if (success) { ok(compkey == 12345, "got completion key %i instead of 12345\n", (int)compkey); @@ -1180,10 +1180,10 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) success = WriteFile(hnp, buf, readden, &written, &oWrite); if (winetest_debug > 1) trace("Server WriteFile returned...\n"); err = GetLastError(); - ok(success || err == ERROR_IO_PENDING, "overlapped WriteFile failed, err=%u\n", err); + ok(success || err == ERROR_IO_PENDING, "overlapped WriteFile failed, err=%lu\n", err); success = GetQueuedCompletionStatus(hcompletion, &written, &compkey, &oResult, 10000); - ok(success, "WriteFile GetQueuedCompletionStatus failed, errno=%i\n", GetLastError()); + ok(success, "WriteFile GetQueuedCompletionStatus failed, errno=%li\n", GetLastError()); if (success) { ok(compkey == 12345, "got completion key %i instead of 12345\n", (int)compkey); @@ -1202,7 +1202,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) success = WriteFile(hnp, buf, readden, &written, &oWrite); err = GetLastError(); ok(!success && err == ERROR_NO_DATA, - "overlapped WriteFile on disconnected pipe returned %u, err=%i\n", success, err); + "overlapped WriteFile on disconnected pipe returned %u, err=%li\n", success, err);
/* No completion status is queued on immediate error. */ SetLastError(ERROR_SUCCESS); @@ -1211,7 +1211,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) &oResult, 0); err = GetLastError(); ok(!success && err == WAIT_TIMEOUT && !oResult, - "WriteFile GetQueuedCompletionStatus returned %u, err=%i, oResult %p\n", + "WriteFile GetQueuedCompletionStatus returned %u, err=%li, oResult %p\n", success, err, oResult);
if (winetest_debug > 1) trace("Server reading from disconnected pipe...\n"); @@ -1220,7 +1220,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) if (winetest_debug > 1) trace("Server ReadFile from disconnected pipe returned...\n"); err = GetLastError(); ok(!success && err == ERROR_BROKEN_PIPE, - "overlapped ReadFile on disconnected pipe returned %u, err=%i\n", success, err); + "overlapped ReadFile on disconnected pipe returned %u, err=%li\n", success, err);
SetLastError(ERROR_SUCCESS); oResult = (OVERLAPPED *)0xdeadbeef; @@ -1228,19 +1228,19 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) &oResult, 0); err = GetLastError(); ok(!success && err == WAIT_TIMEOUT && !oResult, - "ReadFile GetQueuedCompletionStatus returned %u, err=%i, oResult %p\n", + "ReadFile GetQueuedCompletionStatus returned %u, err=%li, oResult %p\n", success, err, oResult);
/* finish this connection, wait for next one */ ok(FlushFileBuffers(hnp), "FlushFileBuffers\n"); success = DisconnectNamedPipe(hnp); - ok(success, "DisconnectNamedPipe failed, err %u\n", GetLastError()); + ok(success, "DisconnectNamedPipe failed, err %lu\n", GetLastError()); }
ret = CloseHandle(hnp); - ok(ret, "CloseHandle named pipe failed, err=%i\n", GetLastError()); + ok(ret, "CloseHandle named pipe failed, err=%li\n", GetLastError()); ret = CloseHandle(hcompletion); - ok(ret, "CloseHandle completion failed, err=%i\n", GetLastError()); + ok(ret, "CloseHandle completion failed, err=%li\n", GetLastError());
return 0; } @@ -1296,7 +1296,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) if (winetest_debug > 1) trace("Server calling ConnectNamedPipe...\n"); success = ConnectNamedPipe(hnp, NULL); err = GetLastError(); - ok(success || (err == ERROR_PIPE_CONNECTED), "ConnectNamedPipe failed: %d\n", err); + ok(success || (err == ERROR_PIPE_CONNECTED), "ConnectNamedPipe failed: %ld\n", err); if (winetest_debug > 1) trace("ConnectNamedPipe operation complete.\n");
/* Echo bytes once */ @@ -1307,7 +1307,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) ResetEvent(hEvent); success = ReadFileEx(hnp, buf, sizeof(buf), &oOverlap, completion_routine); if (winetest_debug > 1) trace("Server ReadFileEx returned...\n"); - ok(success, "ReadFileEx failed, err=%i\n", GetLastError()); + ok(success, "ReadFileEx failed, err=%li\n", GetLastError()); ok(completion_called == 0, "completion routine called before ReadFileEx return\n"); if (winetest_debug > 1) trace("ReadFileEx returned.\n"); if (success) { @@ -1315,10 +1315,10 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) do { ret = WaitForSingleObjectEx(hEvent, INFINITE, TRUE); } while (ret == WAIT_IO_COMPLETION); - ok(ret == 0, "wait ReadFileEx returned %x\n", ret); + ok(ret == 0, "wait ReadFileEx returned %lx\n", ret); } ok(completion_called == 1, "completion routine called %i times\n", completion_called); - ok(completion_errorcode == ERROR_SUCCESS, "completion routine got error %d\n", completion_errorcode); + ok(completion_errorcode == ERROR_SUCCESS, "completion routine got error %ld\n", completion_errorcode); ok(completion_num_bytes != 0, "read 0 bytes\n"); ok(completion_lpoverlapped == &oOverlap, "got wrong overlapped pointer %p\n", completion_lpoverlapped); readden = completion_num_bytes; @@ -1329,7 +1329,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) ResetEvent(hEvent); success = WriteFileEx(hnp, buf, readden, &oOverlap, completion_routine); if (winetest_debug > 1) trace("Server WriteFileEx returned...\n"); - ok(success, "WriteFileEx failed, err=%i\n", GetLastError()); + ok(success, "WriteFileEx failed, err=%li\n", GetLastError()); ok(completion_called == 0, "completion routine called before ReadFileEx return\n"); if (winetest_debug > 1) trace("overlapped WriteFile returned.\n"); if (success) { @@ -1337,12 +1337,12 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) do { ret = WaitForSingleObjectEx(hEvent, INFINITE, TRUE); } while (ret == WAIT_IO_COMPLETION); - ok(ret == 0, "wait WriteFileEx returned %x\n", ret); + ok(ret == 0, "wait WriteFileEx returned %lx\n", ret); } if (winetest_debug > 1) trace("Server done writing.\n"); ok(completion_called == 1, "completion routine called %i times\n", completion_called); - ok(completion_errorcode == ERROR_SUCCESS, "completion routine got error %d\n", completion_errorcode); - ok(completion_num_bytes == readden, "read %i bytes wrote %i\n", readden, completion_num_bytes); + ok(completion_errorcode == ERROR_SUCCESS, "completion routine got error %ld\n", completion_errorcode); + ok(completion_num_bytes == readden, "read %li bytes wrote %li\n", readden, completion_num_bytes); ok(completion_lpoverlapped == &oOverlap, "got wrong overlapped pointer %p\n", completion_lpoverlapped);
/* finish this connection, wait for next one */ @@ -1414,7 +1414,7 @@ static void test_NamedPipe_2(void) alarm_event = CreateEventW( NULL, TRUE, FALSE, NULL ); SetLastError(0xdeadbeef); alarmThread = CreateThread(NULL, 0, alarmThreadMain, (void *) 20000, 0, &alarmThreadId); - ok(alarmThread != NULL, "CreateThread failed: %d\n", GetLastError()); + ok(alarmThread != NULL, "CreateThread failed: %ld\n", GetLastError());
/* The servers we're about to exercise do try to clean up carefully, * but to reduce the chance of a test failure due to a pipe handle @@ -1424,31 +1424,31 @@ static void test_NamedPipe_2(void) /* Try server #1 */ SetLastError(0xdeadbeef); serverThread = CreateThread(NULL, 0, serverThreadMain1, (void *)8, 0, &serverThreadId); - ok(serverThread != NULL, "CreateThread failed: %d\n", GetLastError()); + ok(serverThread != NULL, "CreateThread failed: %ld\n", GetLastError()); exerciseServer(PIPENAME "serverThreadMain1", serverThread);
/* Try server #2 */ SetLastError(0xdeadbeef); serverThread = CreateThread(NULL, 0, serverThreadMain2, 0, 0, &serverThreadId); - ok(serverThread != NULL, "CreateThread failed: %d\n", GetLastError()); + ok(serverThread != NULL, "CreateThread failed: %ld\n", GetLastError()); exerciseServer(PIPENAME "serverThreadMain2", serverThread);
/* Try server #3 */ SetLastError(0xdeadbeef); serverThread = CreateThread(NULL, 0, serverThreadMain3, 0, 0, &serverThreadId); - ok(serverThread != NULL, "CreateThread failed: %d\n", GetLastError()); + ok(serverThread != NULL, "CreateThread failed: %ld\n", GetLastError()); exerciseServer(PIPENAME "serverThreadMain3", serverThread);
/* Try server #4 */ SetLastError(0xdeadbeef); serverThread = CreateThread(NULL, 0, serverThreadMain4, 0, 0, &serverThreadId); - ok(serverThread != NULL, "CreateThread failed: %d\n", GetLastError()); + ok(serverThread != NULL, "CreateThread failed: %ld\n", GetLastError()); exerciseServer(PIPENAME "serverThreadMain4", serverThread);
/* Try server #5 */ SetLastError(0xdeadbeef); serverThread = CreateThread(NULL, 0, serverThreadMain5, 0, 0, &serverThreadId); - ok(serverThread != NULL, "CreateThread failed: %d\n", GetLastError()); + ok(serverThread != NULL, "CreateThread failed: %ld\n", GetLastError()); exerciseServer(PIPENAME "serverThreadMain5", serverThread);
ok(SetEvent( alarm_event ), "SetEvent\n"); @@ -1512,13 +1512,13 @@ static int test_DisconnectNamedPipe(void) ok(!DisconnectNamedPipe(hnp) && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "DisconnectNamedPipe worked twice\n"); ret = WaitForSingleObject(hFile, 0); - ok(ret == WAIT_TIMEOUT, "WaitForSingleObject returned %X\n", ret); + ok(ret == WAIT_TIMEOUT, "WaitForSingleObject returned %lX\n", ret);
ret = PeekNamedPipe(hFile, NULL, 0, NULL, &readden, NULL); - ok(!ret && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "PeekNamedPipe returned %x (%u)\n", + ok(!ret && GetLastError() == ERROR_PIPE_NOT_CONNECTED, "PeekNamedPipe returned %lx (%lu)\n", ret, GetLastError()); ret = PeekNamedPipe(hnp, NULL, 0, NULL, &readden, NULL); - ok(!ret && GetLastError() == ERROR_BAD_PIPE, "PeekNamedPipe returned %x (%u)\n", + ok(!ret && GetLastError() == ERROR_BAD_PIPE, "PeekNamedPipe returned %lx (%lu)\n", ret, GetLastError()); ok(CloseHandle(hFile), "CloseHandle\n"); } @@ -1553,20 +1553,20 @@ static void test_CreatePipe(void) | FILE_WRITE_DATA);
ok(WriteFile(pipewrite,PIPENAME,sizeof(PIPENAME), &written, NULL), "Write to anonymous pipe failed\n"); - ok(written == sizeof(PIPENAME), "Write to anonymous pipe wrote %d bytes\n", written); + ok(written == sizeof(PIPENAME), "Write to anonymous pipe wrote %ld bytes\n", written); ok(ReadFile(piperead,readbuf,sizeof(readbuf),&read, NULL), "Read from non empty pipe failed\n"); - ok(read == sizeof(PIPENAME), "Read from anonymous pipe got %d bytes\n", read); + ok(read == sizeof(PIPENAME), "Read from anonymous pipe got %ld bytes\n", read); ok(CloseHandle(pipewrite), "CloseHandle for the write pipe failed\n"); ok(CloseHandle(piperead), "CloseHandle for the read pipe failed\n");
/* Now write another chunk*/ ok(CreatePipe(&piperead, &pipewrite, &pipe_attr, 0) != 0, "CreatePipe failed\n"); ok(WriteFile(pipewrite,PIPENAME,sizeof(PIPENAME), &written, NULL), "Write to anonymous pipe failed\n"); - ok(written == sizeof(PIPENAME), "Write to anonymous pipe wrote %d bytes\n", written); + ok(written == sizeof(PIPENAME), "Write to anonymous pipe wrote %ld bytes\n", written); /* and close the write end, read should still succeed*/ ok(CloseHandle(pipewrite), "CloseHandle for the Write Pipe failed\n"); ok(ReadFile(piperead,readbuf,sizeof(readbuf),&read, NULL), "Read from broken pipe with pending data failed\n"); - ok(read == sizeof(PIPENAME), "Read from anonymous pipe got %d bytes\n", read); + ok(read == sizeof(PIPENAME), "Read from anonymous pipe got %ld bytes\n", read); /* But now we need to get informed that the pipe is closed */ ok(ReadFile(piperead,readbuf,sizeof(readbuf),&read, NULL) == 0, "Broken pipe not detected\n"); ok(CloseHandle(piperead), "CloseHandle for the read pipe failed\n"); @@ -1577,13 +1577,13 @@ static void test_CreatePipe(void) for (i = 0; i < size; i++) buffer[i] = i; ok(CreatePipe(&piperead, &pipewrite, &pipe_attr, (size + 24)) != 0, "CreatePipe failed\n"); ok(WriteFile(pipewrite, buffer, size, &written, NULL), "Write to anonymous pipe failed\n"); - ok(written == size, "Write to anonymous pipe wrote %d bytes\n", written); + ok(written == size, "Write to anonymous pipe wrote %ld bytes\n", written); /* and close the write end, read should still succeed*/ ok(CloseHandle(pipewrite), "CloseHandle for the Write Pipe failed\n"); memset( buffer, 0, size ); ok(ReadFile(piperead, buffer, size, &read, NULL), "Read from broken pipe with pending data failed\n"); - ok(read == size, "Read from anonymous pipe got %d bytes\n", read); - for (i = 0; i < size; i++) ok( buffer[i] == (BYTE)i, "invalid data %x at %x\n", buffer[i], i ); + ok(read == size, "Read from anonymous pipe got %ld bytes\n", read); + for (i = 0; i < size; i++) ok( buffer[i] == (BYTE)i, "invalid data %x at %lx\n", buffer[i], i ); /* But now we need to get informed that the pipe is closed */ ok(ReadFile(piperead,readbuf,sizeof(readbuf),&read, NULL) == 0, "Broken pipe not detected\n"); ok(CloseHandle(piperead), "CloseHandle for the read pipe failed\n"); @@ -1610,107 +1610,107 @@ static void test_CloseHandle(void) hpipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
hfile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = WriteFile(hpipe, testdata, sizeof(testdata), &numbytes, NULL); - ok(ret, "WriteFile failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "WriteFile failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
numbytes = 0xdeadbeef; ret = PeekNamedPipe(hfile, NULL, 0, NULL, &numbytes, NULL); - ok(ret, "PeekNamedPipe failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "PeekNamedPipe failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
ret = CloseHandle(hpipe); - ok(ret, "CloseHandle failed with %u\n", GetLastError()); + ok(ret, "CloseHandle failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; memset(buffer, 0, sizeof(buffer)); ret = ReadFile(hfile, buffer, 0, &numbytes, NULL); - ok(ret, "ReadFile failed with %u\n", GetLastError()); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); + ok(ret, "ReadFile failed with %lu\n", GetLastError()); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes);
numbytes = 0xdeadbeef; ret = PeekNamedPipe(hfile, NULL, 0, NULL, &numbytes, NULL); - ok(ret, "PeekNamedPipe failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "PeekNamedPipe failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
numbytes = 0xdeadbeef; memset(buffer, 0, sizeof(buffer)); ret = ReadFile(hfile, buffer, sizeof(buffer), &numbytes, NULL); - ok(ret, "ReadFile failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "ReadFile failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
ret = GetNamedPipeHandleStateA(hfile, &state, NULL, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed with %lu\n", GetLastError()); state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ret = SetNamedPipeHandleState(hfile, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed with %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = ReadFile(hfile, buffer, 0, &numbytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = PeekNamedPipe(hfile, NULL, 0, NULL, &numbytes, NULL); - ok(!ret && GetLastError() == ERROR_BROKEN_PIPE, "PeekNamedPipe returned %x (%u)\n", + ok(!ret && GetLastError() == ERROR_BROKEN_PIPE, "PeekNamedPipe returned %x (%lu)\n", ret, GetLastError()); - ok(numbytes == 0xdeadbeef, "numbytes = %u\n", numbytes); + ok(numbytes == 0xdeadbeef, "numbytes = %lu\n", numbytes);
SetLastError(0xdeadbeef); ret = WriteFile(hfile, testdata, sizeof(testdata), &numbytes, NULL); ok(!ret, "WriteFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %lu\n", GetLastError());
CloseHandle(hfile);
hpipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
hfile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = WriteFile(hpipe, testdata, 0, &numbytes, NULL); - ok(ret, "WriteFile failed with %u\n", GetLastError()); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); + ok(ret, "WriteFile failed with %lu\n", GetLastError()); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes);
ret = CloseHandle(hpipe); - ok(ret, "CloseHandle failed with %u\n", GetLastError()); + ok(ret, "CloseHandle failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; memset(buffer, 0, sizeof(buffer)); ret = ReadFile(hfile, buffer, sizeof(buffer), &numbytes, NULL); - ok(ret, "ReadFile failed with %u\n", GetLastError()); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); + ok(ret, "ReadFile failed with %lu\n", GetLastError()); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes);
SetLastError(0xdeadbeef); ret = ReadFile(hfile, buffer, 0, &numbytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %lu\n", GetLastError());
ret = GetNamedPipeHandleStateA(hfile, &state, NULL, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed with %lu\n", GetLastError()); state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ret = SetNamedPipeHandleState(hfile, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed with %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = ReadFile(hfile, buffer, 0, &numbytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hfile, testdata, sizeof(testdata), &numbytes, NULL); ok(!ret, "WriteFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %lu\n", GetLastError());
CloseHandle(hfile);
@@ -1719,108 +1719,108 @@ static void test_CloseHandle(void) hpipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
hfile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = WriteFile(hfile, testdata, sizeof(testdata), &numbytes, NULL); - ok(ret, "WriteFile failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "WriteFile failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
numbytes = 0xdeadbeef; ret = PeekNamedPipe(hpipe, NULL, 0, NULL, &numbytes, NULL); - ok(ret, "PeekNamedPipe failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "PeekNamedPipe failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
ret = CloseHandle(hfile); - ok(ret, "CloseHandle failed with %u\n", GetLastError()); + ok(ret, "CloseHandle failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; memset(buffer, 0, sizeof(buffer)); ret = ReadFile(hpipe, buffer, 0, &numbytes, NULL); ok(ret || GetLastError() == ERROR_MORE_DATA /* >= Win 8 */, - "ReadFile failed with %u\n", GetLastError()); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); + "ReadFile failed with %lu\n", GetLastError()); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes);
numbytes = 0xdeadbeef; ret = PeekNamedPipe(hpipe, NULL, 0, NULL, &numbytes, NULL); - ok(ret, "PeekNamedPipe failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "PeekNamedPipe failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
numbytes = 0xdeadbeef; memset(buffer, 0, sizeof(buffer)); ret = ReadFile(hpipe, buffer, sizeof(buffer), &numbytes, NULL); - ok(ret, "ReadFile failed with %u\n", GetLastError()); - ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %u\n", numbytes); + ok(ret, "ReadFile failed with %lu\n", GetLastError()); + ok(numbytes == sizeof(testdata), "expected sizeof(testdata), got %lu\n", numbytes);
ret = GetNamedPipeHandleStateA(hpipe, &state, NULL, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed with %lu\n", GetLastError()); state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ret = SetNamedPipeHandleState(hpipe, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed with %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = ReadFile(hpipe, buffer, 0, &numbytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = PeekNamedPipe(hpipe, NULL, 0, NULL, &numbytes, NULL); - ok(!ret && GetLastError() == ERROR_BROKEN_PIPE, "PeekNamedPipe returned %x (%u)\n", + ok(!ret && GetLastError() == ERROR_BROKEN_PIPE, "PeekNamedPipe returned %x (%lu)\n", ret, GetLastError()); - ok(numbytes == 0xdeadbeef, "numbytes = %u\n", numbytes); + ok(numbytes == 0xdeadbeef, "numbytes = %lu\n", numbytes);
SetLastError(0xdeadbeef); ret = WriteFile(hpipe, testdata, sizeof(testdata), &numbytes, NULL); ok(!ret, "WriteFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %lu\n", GetLastError());
CloseHandle(hpipe);
hpipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(hpipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
hfile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = WriteFile(hfile, testdata, 0, &numbytes, NULL); - ok(ret, "WriteFile failed with %u\n", GetLastError()); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); + ok(ret, "WriteFile failed with %lu\n", GetLastError()); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes);
ret = CloseHandle(hfile); - ok(ret, "CloseHandle failed with %u\n", GetLastError()); + ok(ret, "CloseHandle failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; memset(buffer, 0, sizeof(buffer)); ret = ReadFile(hpipe, buffer, sizeof(buffer), &numbytes, NULL); - ok(ret, "ReadFile failed with %u\n", GetLastError()); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); + ok(ret, "ReadFile failed with %lu\n", GetLastError()); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes);
SetLastError(0xdeadbeef); ret = ReadFile(hpipe, buffer, 0, &numbytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %lu\n", GetLastError());
ret = GetNamedPipeHandleStateA(hpipe, &state, NULL, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed with %lu\n", GetLastError()); state = PIPE_READMODE_MESSAGE | PIPE_WAIT; ret = SetNamedPipeHandleState(hpipe, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed with %u\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed with %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = ReadFile(hpipe, buffer, 0, &numbytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WriteFile(hpipe, testdata, sizeof(testdata), &numbytes, NULL); ok(!ret, "WriteFile unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %lu\n", GetLastError());
CloseHandle(hpipe); } @@ -1851,10 +1851,10 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p) /* modify the token so we can tell if the pipe impersonation * token reverts to the process token */ ret = AdjustTokenPrivileges(params->token, TRUE, NULL, 0, NULL, NULL); - ok(ret, "AdjustTokenPrivileges failed with error %d\n", GetLastError()); + ok(ret, "AdjustTokenPrivileges failed with error %ld\n", GetLastError()); } ret = SetThreadToken(NULL, params->token); - ok(ret, "SetThreadToken failed with error %d\n", GetLastError()); + ok(ret, "SetThreadToken failed with error %ld\n", GetLastError()); } else { @@ -1862,40 +1862,40 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p) HANDLE process_token;
ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_ADJUST_PRIVILEGES, &process_token); - ok(ret, "OpenProcessToken failed with error %d\n", GetLastError()); + ok(ret, "OpenProcessToken failed with error %ld\n", GetLastError());
ret = GetTokenInformation(process_token, TokenPrivileges, NULL, 0, &Size); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetTokenInformation(TokenPrivileges) failed with %d\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetTokenInformation(TokenPrivileges) failed with %ld\n", GetLastError()); Privileges = HeapAlloc(GetProcessHeap(), 0, Size); ret = GetTokenInformation(process_token, TokenPrivileges, Privileges, Size, &Size); - ok(ret, "GetTokenInformation(TokenPrivileges) failed with %d\n", GetLastError()); + ok(ret, "GetTokenInformation(TokenPrivileges) failed with %ld\n", GetLastError());
ret = AdjustTokenPrivileges(process_token, TRUE, NULL, 0, NULL, NULL); - ok(ret, "AdjustTokenPrivileges failed with error %d\n", GetLastError()); + ok(ret, "AdjustTokenPrivileges failed with error %ld\n", GetLastError());
CloseHandle(process_token); }
pipe = CreateFileA(PIPE_NAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, params->security_flags, NULL); - ok(pipe != INVALID_HANDLE_VALUE, "CreateFile for pipe failed with error %d\n", GetLastError()); + ok(pipe != INVALID_HANDLE_VALUE, "CreateFile for pipe failed with error %ld\n", GetLastError());
ret = WriteFile(pipe, message, sizeof(message), &bytes_written, NULL); - ok(ret, "WriteFile failed with error %d\n", GetLastError()); + ok(ret, "WriteFile failed with error %ld\n", GetLastError());
ret = ReadFile(pipe, &dummy, sizeof(dummy), &bytes_read, NULL); - ok(ret, "ReadFile failed with error %d\n", GetLastError()); + ok(ret, "ReadFile failed with error %ld\n", GetLastError());
if (params->token) { if (params->revert) { ret = RevertToSelf(); - ok(ret, "RevertToSelf failed with error %d\n", GetLastError()); + ok(ret, "RevertToSelf failed with error %ld\n", GetLastError()); } else { ret = AdjustTokenPrivileges(params->token, TRUE, NULL, 0, NULL, NULL); - ok(ret, "AdjustTokenPrivileges failed with error %d\n", GetLastError()); + ok(ret, "AdjustTokenPrivileges failed with error %ld\n", GetLastError()); } } else @@ -1903,10 +1903,10 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p) HANDLE process_token;
ret = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &process_token); - ok(ret, "OpenProcessToken failed with error %d\n", GetLastError()); + ok(ret, "OpenProcessToken failed with error %ld\n", GetLastError());
ret = AdjustTokenPrivileges(process_token, FALSE, Privileges, 0, NULL, NULL); - ok(ret, "AdjustTokenPrivileges failed with error %d\n", GetLastError()); + ok(ret, "AdjustTokenPrivileges failed with error %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, Privileges);
@@ -1914,10 +1914,10 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p) }
ret = WriteFile(pipe, message, sizeof(message), &bytes_written, NULL); - ok(ret, "WriteFile failed with error %d\n", GetLastError()); + ok(ret, "WriteFile failed with error %ld\n", GetLastError());
ret = ReadFile(pipe, &dummy, sizeof(dummy), &bytes_read, NULL); - ok(ret, "ReadFile failed with error %d\n", GetLastError()); + ok(ret, "ReadFile failed with error %ld\n", GetLastError());
CloseHandle(pipe);
@@ -1931,10 +1931,10 @@ static HANDLE make_impersonation_token(DWORD Access, SECURITY_IMPERSONATION_LEVE BOOL ret;
ret = OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE, &ProcessToken); - ok(ret, "OpenProcessToken failed with error %d\n", GetLastError()); + ok(ret, "OpenProcessToken failed with error %ld\n", GetLastError());
ret = pDuplicateTokenEx(ProcessToken, Access, NULL, ImpersonationLevel, TokenImpersonation, &Token); - ok(ret, "DuplicateToken failed with error %d\n", GetLastError()); + ok(ret, "DuplicateToken failed with error %ld\n", GetLastError());
CloseHandle(ProcessToken);
@@ -1958,37 +1958,37 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_ DWORD size;
hPipeServer = CreateNamedPipeA(PIPE_NAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 100, 100, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(hPipeServer != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with error %d\n", GetLastError()); + ok(hPipeServer != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with error %ld\n", GetLastError());
params.security_flags = security_flags; params.token = hClientToken; params.revert = revert; hThread = CreateThread(NULL, 0, named_pipe_client_func, ¶ms, 0, &dwTid); - ok(hThread != NULL, "CreateThread failed with error %d\n", GetLastError()); + ok(hThread != NULL, "CreateThread failed with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = ImpersonateNamedPipeClient(hPipeServer); error = GetLastError(); ok(ret /* win2k3 */ || (error == ERROR_CANNOT_IMPERSONATE), - "ImpersonateNamedPipeClient should have failed with ERROR_CANNOT_IMPERSONATE instead of %d\n", GetLastError()); + "ImpersonateNamedPipeClient should have failed with ERROR_CANNOT_IMPERSONATE instead of %ld\n", GetLastError());
ret = ConnectNamedPipe(hPipeServer, NULL); - ok(ret || (GetLastError() == ERROR_PIPE_CONNECTED), "ConnectNamedPipe failed with error %d\n", GetLastError()); + ok(ret || (GetLastError() == ERROR_PIPE_CONNECTED), "ConnectNamedPipe failed with error %ld\n", GetLastError());
ret = ReadFile(hPipeServer, buffer, sizeof(buffer), &dwBytesRead, NULL); - ok(ret, "ReadFile failed with error %d\n", GetLastError()); + ok(ret, "ReadFile failed with error %ld\n", GetLastError());
ret = ImpersonateNamedPipeClient(hPipeServer); - ok(ret, "ImpersonateNamedPipeClient failed with error %d\n", GetLastError()); + ok(ret, "ImpersonateNamedPipeClient failed with error %ld\n", GetLastError());
ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &hToken); - ok(ret, "OpenThreadToken failed with error %d\n", GetLastError()); + ok(ret, "OpenThreadToken failed with error %ld\n", GetLastError());
(*test_func)(0, hToken);
ImpersonationLevel = 0xdeadbeef; /* to avoid false positives */ ret = GetTokenInformation(hToken, TokenImpersonationLevel, &ImpersonationLevel, sizeof(ImpersonationLevel), &size); - ok(ret, "GetTokenInformation(TokenImpersonationLevel) failed with error %d\n", GetLastError()); + ok(ret, "GetTokenInformation(TokenImpersonationLevel) failed with error %ld\n", GetLastError()); ok(ImpersonationLevel == SecurityImpersonation, "ImpersonationLevel should have been SecurityImpersonation(%d) instead of %d\n", SecurityImpersonation, ImpersonationLevel);
CloseHandle(hToken); @@ -1996,16 +1996,16 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_ RevertToSelf();
ret = WriteFile(hPipeServer, &dummy, sizeof(dummy), &dwBytesWritten, NULL); - ok(ret, "WriteFile failed with error %d\n", GetLastError()); + ok(ret, "WriteFile failed with error %ld\n", GetLastError());
ret = ReadFile(hPipeServer, buffer, sizeof(buffer), &dwBytesRead, NULL); - ok(ret, "ReadFile failed with error %d\n", GetLastError()); + ok(ret, "ReadFile failed with error %ld\n", GetLastError());
ret = ImpersonateNamedPipeClient(hPipeServer); - ok(ret, "ImpersonateNamedPipeClient failed with error %d\n", GetLastError()); + ok(ret, "ImpersonateNamedPipeClient failed with error %ld\n", GetLastError());
ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &hToken); - ok(ret, "OpenThreadToken failed with error %d\n", GetLastError()); + ok(ret, "OpenThreadToken failed with error %ld\n", GetLastError());
(*test_func)(1, hToken);
@@ -2014,12 +2014,12 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_ RevertToSelf();
ret = WriteFile(hPipeServer, &dummy, sizeof(dummy), &dwBytesWritten, NULL); - ok(ret, "WriteFile failed with error %d\n", GetLastError()); + ok(ret, "WriteFile failed with error %ld\n", GetLastError());
WaitForSingleObject(hThread, INFINITE);
ret = ImpersonateNamedPipeClient(hPipeServer); - ok(ret, "ImpersonateNamedPipeClient failed with error %d\n", GetLastError()); + ok(ret, "ImpersonateNamedPipeClient failed with error %ld\n", GetLastError());
RevertToSelf();
@@ -2085,7 +2085,7 @@ static void test_no_sqos_no_token(int call_index, HANDLE hToken) case 0: priv_count = get_privilege_count(hToken); todo_wine - ok(priv_count == 0, "privilege count should have been 0 instead of %d\n", priv_count); + ok(priv_count == 0, "privilege count should have been 0 instead of %ld\n", priv_count); break; case 1: priv_count = get_privilege_count(hToken); @@ -2167,7 +2167,7 @@ static void test_no_sqos_revert(int call_index, HANDLE hToken) case 0: priv_count = get_privilege_count(hToken); todo_wine - ok(priv_count == 0, "privilege count should have been 0 instead of %d\n", priv_count); + ok(priv_count == 0, "privilege count should have been 0 instead of %ld\n", priv_count); break; case 1: priv_count = get_privilege_count(hToken); @@ -2344,7 +2344,7 @@ static void test_overlapped(void) Sleep(1);
ret = WriteFile(pipe, "x", 1, &num, NULL); - ok(ret, "WriteFile failed with error %d\n", GetLastError()); + ok(ret, "WriteFile failed with error %ld\n", GetLastError());
WaitForSingleObject(thread, INFINITE); CloseHandle(pipe); @@ -2360,29 +2360,29 @@ static void test_overlapped_error(void) BOOL ret;
event = CreateEventA(NULL, TRUE, FALSE, NULL); - ok(event != NULL, "CreateEventA failed with %u\n", GetLastError()); + ok(event != NULL, "CreateEventA failed with %lu\n", GetLastError());
pipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_WAIT_FOREVER, NULL); - ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
memset(&overlapped, 0, sizeof(overlapped)); overlapped.hEvent = event; ret = ConnectNamedPipe(pipe, &overlapped); err = GetLastError(); ok(ret == FALSE, "ConnectNamedPipe succeeded\n"); - ok(err == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", err); + ok(err == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %lu\n", err);
file = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
numbytes = 0xdeadbeef; ret = GetOverlappedResult(pipe, &overlapped, &numbytes, TRUE); ok(ret == TRUE, "GetOverlappedResult failed\n"); - ok(numbytes == 0, "expected 0, got %u\n", numbytes); - ok(overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08lx\n", overlapped.Internal); + ok(numbytes == 0, "expected 0, got %lu\n", numbytes); + ok(overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08Ix\n", overlapped.Internal);
CloseHandle(file); CloseHandle(pipe); @@ -2390,19 +2390,19 @@ static void test_overlapped_error(void) pipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_WAIT_FOREVER, NULL); - ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %u\n", GetLastError()); + ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with %lu\n", GetLastError());
file = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed with %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed with %lu\n", GetLastError());
memset(&overlapped, 0, sizeof(overlapped)); overlapped.hEvent = event; ret = ConnectNamedPipe(pipe, &overlapped); err = GetLastError(); ok(ret == FALSE, "ConnectNamedPipe succeeded\n"); - ok(err == ERROR_PIPE_CONNECTED, "expected ERROR_PIPE_CONNECTED, got %u\n", err); - ok(overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", overlapped.Internal); + ok(err == ERROR_PIPE_CONNECTED, "expected ERROR_PIPE_CONNECTED, got %lu\n", err); + ok(overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08Ix\n", overlapped.Internal);
CloseHandle(file); CloseHandle(pipe); @@ -2426,14 +2426,14 @@ static void test_NamedPipeHandleState(void) /* lpSecurityAttrib */ NULL); ok(server != INVALID_HANDLE_VALUE, "cf failed\n"); ret = GetNamedPipeHandleStateA(server, NULL, NULL, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed: %ld\n", GetLastError()); ret = GetNamedPipeHandleStateA(server, &state, &instances, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed: %ld\n", GetLastError()); if (ret) { - ok(state == 0, "unexpected state %08x\n", state); - ok(instances == 1, "expected 1 instances, got %d\n", instances); + ok(state == 0, "unexpected state %08lx\n", state); + ok(instances == 1, "expected 1 instances, got %ld\n", instances); } /* Some parameters have no meaning, and therefore can't be retrieved, * on a local pipe. @@ -2443,13 +2443,13 @@ static void test_NamedPipeHandleState(void) &collectDataTimeout, userName, ARRAY_SIZE(userName)); todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); /* A byte-mode pipe server can't be changed to message mode. */ state = PIPE_READMODE_MESSAGE; SetLastError(0xdeadbeef); ret = SetNamedPipeHandleState(server, &state, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
client = CreateFileA(PIPENAME, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -2457,13 +2457,13 @@ static void test_NamedPipeHandleState(void)
state = PIPE_READMODE_BYTE; ret = SetNamedPipeHandleState(client, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed: %ld\n", GetLastError()); /* A byte-mode pipe client can't be changed to message mode, either. */ state = PIPE_READMODE_MESSAGE; SetLastError(0xdeadbeef); ret = SetNamedPipeHandleState(server, &state, NULL, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
CloseHandle(client); CloseHandle(server); @@ -2477,21 +2477,21 @@ static void test_NamedPipeHandleState(void) /* lpSecurityAttrib */ NULL); ok(server != INVALID_HANDLE_VALUE, "cf failed\n"); ret = GetNamedPipeHandleStateA(server, NULL, NULL, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed: %ld\n", GetLastError()); ret = GetNamedPipeHandleStateA(server, &state, &instances, NULL, NULL, NULL, 0); - ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "GetNamedPipeHandleState failed: %ld\n", GetLastError()); if (ret) { - ok(state == 0, "unexpected state %08x\n", state); - ok(instances == 1, "expected 1 instances, got %d\n", instances); + ok(state == 0, "unexpected state %08lx\n", state); + ok(instances == 1, "expected 1 instances, got %ld\n", instances); } /* In contrast to byte-mode pipes, a message-mode pipe server can be * changed to byte mode. */ state = PIPE_READMODE_BYTE; ret = SetNamedPipeHandleState(server, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed: %ld\n", GetLastError());
client = CreateFileA(PIPENAME, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -2499,12 +2499,12 @@ static void test_NamedPipeHandleState(void)
state = PIPE_READMODE_MESSAGE; ret = SetNamedPipeHandleState(client, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed: %ld\n", GetLastError()); /* A message-mode pipe client can also be changed to byte mode. */ state = PIPE_READMODE_BYTE; ret = SetNamedPipeHandleState(client, &state, NULL, NULL); - ok(ret, "SetNamedPipeHandleState failed: %d\n", GetLastError()); + ok(ret, "SetNamedPipeHandleState failed: %ld\n", GetLastError());
CloseHandle(client); CloseHandle(server); @@ -2596,37 +2596,37 @@ static void test_readfileex_pending(void) ret = ConnectNamedPipe(server, &overlapped); err = GetLastError(); ok(ret == FALSE, "ConnectNamedPipe succeeded\n"); - ok(err == ERROR_IO_PENDING, "ConnectNamedPipe set error %i\n", err); + ok(err == ERROR_IO_PENDING, "ConnectNamedPipe set error %li\n", err);
wait = WaitForSingleObject(event, 0); - ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", wait); + ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", wait);
client = CreateFileA(PIPENAME, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); ok(client != INVALID_HANDLE_VALUE, "cf failed\n");
wait = WaitForSingleObject(event, 0); - ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait); + ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", wait);
/* Start a read that can't complete immediately. */ completion_called = 0; ResetEvent(event); ret = ReadFileEx(server, read_buf, sizeof(read_buf), &overlapped, completion_routine); - ok(ret == TRUE, "ReadFileEx failed, err=%i\n", GetLastError()); + ok(ret == TRUE, "ReadFileEx failed, err=%li\n", GetLastError()); ok(completion_called == 0, "completion routine called before ReadFileEx returned\n");
ret = WriteFile(client, test_string, strlen(test_string), &num_bytes, NULL); ok(ret == TRUE, "WriteFile failed\n"); - ok(num_bytes == strlen(test_string), "only %i bytes written\n", num_bytes); + ok(num_bytes == strlen(test_string), "only %li bytes written\n", num_bytes);
ok(completion_called == 0, "completion routine called during WriteFile\n");
wait = WaitForSingleObjectEx(event, 0, TRUE); - ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0, "WaitForSingleObjectEx returned %x\n", wait); + ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0, "WaitForSingleObjectEx returned %lx\n", wait);
ok(completion_called == 1, "completion not called after writing pipe\n"); - ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode); - ok(completion_num_bytes == strlen(test_string), "ReadFileEx returned only %d bytes\n", completion_num_bytes); + ok(completion_errorcode == 0, "completion called with error %lx\n", completion_errorcode); + ok(completion_num_bytes == strlen(test_string), "ReadFileEx returned only %ld bytes\n", completion_num_bytes); ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n"); ok(!memcmp(test_string, read_buf, strlen(test_string)), "ReadFileEx read wrong bytes\n");
@@ -2647,16 +2647,16 @@ static void test_readfileex_pending(void) /* write couldn't complete immediately, presumably the pipe is full */ break;
- ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait); + ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", wait);
- ok(ret == TRUE, "WriteFileEx failed, err=%i\n", err); - ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode); + ok(ret == TRUE, "WriteFileEx failed, err=%li\n", err); + ok(completion_errorcode == 0, "completion called with error %lx\n", completion_errorcode); ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n"); }
- ok(ret == TRUE, "WriteFileEx failed, err=%i\n", err); + ok(ret == TRUE, "WriteFileEx failed, err=%li\n", err); ok(completion_called == 0, "completion routine called but wait timed out\n"); - ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode); + ok(completion_errorcode == 0, "completion called with error %lx\n", completion_errorcode); ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
/* free up some space in the pipe */ @@ -2669,20 +2669,20 @@ static void test_readfileex_pending(void)
wait = WaitForSingleObjectEx(event, 0, TRUE); ok(wait == WAIT_IO_COMPLETION || wait == WAIT_OBJECT_0 || wait == WAIT_TIMEOUT, - "WaitForSingleObject returned %x\n", wait); + "WaitForSingleObject returned %lx\n", wait); if (wait != WAIT_TIMEOUT) break; }
ok(completion_called == 1, "completion routine not called\n"); - ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode); + ok(completion_errorcode == 0, "completion called with error %lx\n", completion_errorcode); ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
num_bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadFile(INVALID_HANDLE_VALUE, read_buf, 0, &num_bytes, NULL); ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError()); - ok(num_bytes == 0, "expected 0, got %u\n", num_bytes); + ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError()); + ok(num_bytes == 0, "expected 0, got %lu\n", num_bytes);
S(U(overlapped)).Offset = 0; S(U(overlapped)).OffsetHigh = 0; @@ -2693,31 +2693,31 @@ static void test_readfileex_pending(void) SetLastError(0xdeadbeef); ret = ReadFile(server, read_buf, 0, &num_bytes, &overlapped); ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); - ok(num_bytes == 0, "bytes %u\n", num_bytes); - ok((NTSTATUS)overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %#lx\n", overlapped.Internal); - ok(overlapped.InternalHigh == -1, "expected -1, got %lu\n", overlapped.InternalHigh); + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %ld\n", GetLastError()); + ok(num_bytes == 0, "bytes %lu\n", num_bytes); + ok((NTSTATUS)overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %#Ix\n", overlapped.Internal); + ok(overlapped.InternalHigh == -1, "expected -1, got %Iu\n", overlapped.InternalHigh);
wait = WaitForSingleObject(event, 100); - ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", wait); + ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %lx\n", wait);
num_bytes = 0xdeadbeef; ret = WriteFile(client, test_string, 1, &num_bytes, NULL); ok(ret, "WriteFile failed\n"); - ok(num_bytes == 1, "bytes %u\n", num_bytes); + ok(num_bytes == 1, "bytes %lu\n", num_bytes);
wait = WaitForSingleObject(event, 100); - ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait); + ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", wait);
- ok(num_bytes == 1, "bytes %u\n", num_bytes); - ok((NTSTATUS)overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", overlapped.Internal); - ok(overlapped.InternalHigh == 0, "expected 0, got %lu\n", overlapped.InternalHigh); + ok(num_bytes == 1, "bytes %lu\n", num_bytes); + ok((NTSTATUS)overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#Ix\n", overlapped.Internal); + ok(overlapped.InternalHigh == 0, "expected 0, got %Iu\n", overlapped.InternalHigh);
/* read the pending byte and clear the pipe */ num_bytes = 0xdeadbeef; ret = ReadFile(server, read_buf, 1, &num_bytes, &overlapped); ok(ret, "ReadFile failed\n"); - ok(num_bytes == 1, "bytes %u\n", num_bytes); + ok(num_bytes == 1, "bytes %lu\n", num_bytes);
CloseHandle(client); CloseHandle(server); @@ -2735,28 +2735,28 @@ static void _test_peek_pipe(unsigned line, HANDLE pipe, DWORD expected_read, DWO BOOL r;
r = PeekNamedPipe(pipe, buf, sizeof(buf), &bytes_read, &avail, &left); - ok_(__FILE__,line)(r, "PeekNamedPipe failed: %u\n", GetLastError()); - ok_(__FILE__,line)(bytes_read == expected_read, "bytes_read = %u, expected %u\n", bytes_read, expected_read); - ok_(__FILE__,line)(avail == expected_avail, "avail = %u, expected %u\n", avail, expected_avail); - ok_(__FILE__,line)(left == expected_message_length - expected_read, "left = %d, expected %d\n", + ok_(__FILE__,line)(r, "PeekNamedPipe failed: %lu\n", GetLastError()); + ok_(__FILE__,line)(bytes_read == expected_read, "bytes_read = %lu, expected %lu\n", bytes_read, expected_read); + ok_(__FILE__,line)(avail == expected_avail, "avail = %lu, expected %lu\n", avail, expected_avail); + ok_(__FILE__,line)(left == expected_message_length - expected_read, "left = %ld, expected %ld\n", left, expected_message_length - expected_read);
status = NtFsControlFile(pipe, 0, NULL, NULL, &io, FSCTL_PIPE_PEEK, NULL, 0, buf, sizeof(buf)); - ok_(__FILE__,line)(!status || status == STATUS_PENDING, "NtFsControlFile(FSCTL_PIPE_PEEK) failed: %x\n", status); + ok_(__FILE__,line)(!status || status == STATUS_PENDING, "NtFsControlFile(FSCTL_PIPE_PEEK) failed: %lx\n", status); ok_(__FILE__,line)(io.Information == FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[expected_read]), - "io.Information = %lu\n", io.Information); - ok_(__FILE__,line)(peek_buf->ReadDataAvailable == expected_avail, "ReadDataAvailable = %u, expected %u\n", + "io.Information = %Iu\n", io.Information); + ok_(__FILE__,line)(peek_buf->ReadDataAvailable == expected_avail, "ReadDataAvailable = %lu, expected %lu\n", peek_buf->ReadDataAvailable, expected_avail); - ok_(__FILE__,line)(peek_buf->MessageLength == expected_message_length, "MessageLength = %u, expected %u\n", + ok_(__FILE__,line)(peek_buf->MessageLength == expected_message_length, "MessageLength = %lu, expected %lu\n", peek_buf->MessageLength, expected_message_length);
if (expected_read) { r = PeekNamedPipe(pipe, buf, 1, &bytes_read, &avail, &left); - ok_(__FILE__,line)(r, "PeekNamedPipe failed: %u\n", GetLastError()); - ok_(__FILE__,line)(bytes_read == 1, "bytes_read = %u, expected %u\n", bytes_read, expected_read); - ok_(__FILE__,line)(avail == expected_avail, "avail = %u, expected %u\n", avail, expected_avail); - ok_(__FILE__,line)(left == expected_message_length-1, "left = %d, expected %d\n", left, expected_message_length-1); + ok_(__FILE__,line)(r, "PeekNamedPipe failed: %lu\n", GetLastError()); + ok_(__FILE__,line)(bytes_read == 1, "bytes_read = %lu, expected %lu\n", bytes_read, expected_read); + ok_(__FILE__,line)(avail == expected_avail, "avail = %lu, expected %lu\n", avail, expected_avail); + ok_(__FILE__,line)(left == expected_message_length-1, "left = %ld, expected %ld\n", left, expected_message_length-1); } }
@@ -2771,22 +2771,22 @@ static void _overlapped_read_sync(unsigned line, HANDLE reader, void *buf, DWORD overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = ReadFile(reader, buf, buf_size, &read_bytes, &overlapped); if (partial_read) - ok_(__FILE__,line)(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned: %x (%u)\n", res, GetLastError()); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned: %x (%lu)\n", res, GetLastError()); else - ok_(__FILE__,line)(res, "ReadFile failed: %u\n", GetLastError()); + ok_(__FILE__,line)(res, "ReadFile failed: %lu\n", GetLastError()); if(partial_read) - ok_(__FILE__,line)(!read_bytes, "read_bytes %u expected 0\n", read_bytes); + ok_(__FILE__,line)(!read_bytes, "read_bytes %lu expected 0\n", read_bytes); else - ok_(__FILE__,line)(read_bytes == expected_result, "read_bytes %u expected %u\n", read_bytes, expected_result); + ok_(__FILE__,line)(read_bytes == expected_result, "read_bytes %lu expected %lu\n", read_bytes, expected_result);
read_bytes = 0xdeadbeef; res = GetOverlappedResult(reader, &overlapped, &read_bytes, FALSE); if (partial_read) ok_(__FILE__,line)(!res && GetLastError() == ERROR_MORE_DATA, - "GetOverlappedResult returned: %x (%u)\n", res, GetLastError()); + "GetOverlappedResult returned: %x (%lu)\n", res, GetLastError()); else - ok_(__FILE__,line)(res, "GetOverlappedResult failed: %u\n", GetLastError()); - ok_(__FILE__,line)(read_bytes == expected_result, "read_bytes %u expected %u\n", read_bytes, expected_result); + ok_(__FILE__,line)(res, "GetOverlappedResult failed: %lu\n", GetLastError()); + ok_(__FILE__,line)(read_bytes == expected_result, "read_bytes %lu expected %lu\n", read_bytes, expected_result); CloseHandle(overlapped.hEvent); }
@@ -2799,8 +2799,8 @@ static void _overlapped_read_async(unsigned line, HANDLE reader, void *buf, DWOR memset(overlapped, 0, sizeof(*overlapped)); overlapped->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = ReadFile(reader, buf, buf_size, &read_bytes, overlapped); - ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "ReadFile returned %x(%u)\n", res, GetLastError()); - ok_(__FILE__,line)(!read_bytes, "read_bytes %u expected 0\n", read_bytes); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "ReadFile returned %x(%lu)\n", res, GetLastError()); + ok_(__FILE__,line)(!read_bytes, "read_bytes %lu expected 0\n", read_bytes);
_test_not_signaled(line, overlapped->hEvent); } @@ -2815,13 +2815,13 @@ static void _overlapped_write_sync(unsigned line, HANDLE writer, void *buf, DWOR memset(&overlapped, 0, sizeof(overlapped)); overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = WriteFile(writer, buf, size, &written_bytes, &overlapped); - ok_(__FILE__,line)(res, "WriteFile returned %x(%u)\n", res, GetLastError()); - ok_(__FILE__,line)(written_bytes == size, "WriteFile returned written_bytes = %u\n", written_bytes); + ok_(__FILE__,line)(res, "WriteFile returned %x(%lu)\n", res, GetLastError()); + ok_(__FILE__,line)(written_bytes == size, "WriteFile returned written_bytes = %lu\n", written_bytes);
written_bytes = 0xdeadbeef; res = GetOverlappedResult(writer, &overlapped, &written_bytes, FALSE); - ok_(__FILE__,line)(res, "GetOverlappedResult failed: %u\n", GetLastError()); - ok_(__FILE__,line)(written_bytes == size, "GetOverlappedResult returned written_bytes %u expected %u\n", written_bytes, size); + ok_(__FILE__,line)(res, "GetOverlappedResult failed: %lu\n", GetLastError()); + ok_(__FILE__,line)(written_bytes == size, "GetOverlappedResult returned written_bytes %lu expected %lu\n", written_bytes, size);
CloseHandle(overlapped.hEvent); } @@ -2835,8 +2835,8 @@ static void _overlapped_write_async(unsigned line, HANDLE writer, void *buf, DWO memset(overlapped, 0, sizeof(*overlapped)); overlapped->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = WriteFile(writer, buf, size, &written_bytes, overlapped); - ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%u)\n", res, GetLastError()); - ok_(__FILE__,line)(!written_bytes, "written_bytes = %u\n", written_bytes); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%lu)\n", res, GetLastError()); + ok_(__FILE__,line)(!written_bytes, "written_bytes = %lu\n", written_bytes);
_test_not_signaled(line, overlapped->hEvent); } @@ -2847,7 +2847,7 @@ static void _test_flush_sync(unsigned line, HANDLE pipe) BOOL res;
res = FlushFileBuffers(pipe); - ok_(__FILE__,line)(res, "FlushFileBuffers failed: %u\n", GetLastError()); + ok_(__FILE__,line)(res, "FlushFileBuffers failed: %lu\n", GetLastError()); }
static DWORD expected_flush_error; @@ -2859,13 +2859,13 @@ static DWORD CALLBACK flush_proc(HANDLE pipe) res = FlushFileBuffers(pipe); if (expected_flush_error == ERROR_SUCCESS) { - ok(res, "FlushFileBuffers failed: %u\n", GetLastError()); + ok(res, "FlushFileBuffers failed: %lu\n", GetLastError()); } else { ok(!res, "FlushFileBuffers should have failed\n"); ok(GetLastError() == expected_flush_error, - "FlushFileBuffers set error %u, expected %u\n", GetLastError(), expected_flush_error); + "FlushFileBuffers set error %lu, expected %lu\n", GetLastError(), expected_flush_error); } return 0; } @@ -2878,7 +2878,7 @@ static HANDLE _test_flush_async(unsigned line, HANDLE pipe, DWORD error)
expected_flush_error = error; thread = CreateThread(NULL, 0, flush_proc, pipe, 0, &tid); - ok_(__FILE__,line)(thread != NULL, "CreateThread failed: %u\n", GetLastError()); + ok_(__FILE__,line)(thread != NULL, "CreateThread failed: %lu\n", GetLastError());
Sleep(50); _test_not_signaled(line, thread); @@ -2889,7 +2889,7 @@ static HANDLE _test_flush_async(unsigned line, HANDLE pipe, DWORD error) static void _test_flush_done(unsigned line, HANDLE thread) { DWORD res = WaitForSingleObject(thread, 1000); - ok_(__FILE__,line)(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u (%u)\n", res, GetLastError()); + ok_(__FILE__,line)(res == WAIT_OBJECT_0, "WaitForSingleObject returned %lu (%lu)\n", res, GetLastError()); CloseHandle(thread); }
@@ -2903,10 +2903,10 @@ static void _test_overlapped_result(unsigned line, HANDLE handle, OVERLAPPED *ov
res = GetOverlappedResult(handle, overlapped, &result, FALSE); if (partial_read) - ok_(__FILE__,line)(!res && GetLastError() == ERROR_MORE_DATA, "GetOverlappedResult returned: %x (%u)\n", res, GetLastError()); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_MORE_DATA, "GetOverlappedResult returned: %x (%lu)\n", res, GetLastError()); else - ok_(__FILE__,line)(res, "GetOverlappedResult failed: %u\n", GetLastError()); - ok_(__FILE__,line)(result == expected_result, "read_bytes = %u, expected %u\n", result, expected_result); + ok_(__FILE__,line)(res, "GetOverlappedResult failed: %lu\n", GetLastError()); + ok_(__FILE__,line)(result == expected_result, "read_bytes = %lu, expected %lu\n", result, expected_result); CloseHandle(overlapped->hEvent); }
@@ -2919,9 +2919,9 @@ static void _test_overlapped_failure(unsigned line, HANDLE handle, OVERLAPPED *o _test_signaled(line, overlapped->hEvent);
res = GetOverlappedResult(handle, overlapped, &result, FALSE); - ok_(__FILE__,line)(!res && GetLastError() == error, "GetOverlappedResult returned: %x (%u), expected error %u\n", + ok_(__FILE__,line)(!res && GetLastError() == error, "GetOverlappedResult returned: %x (%lu), expected error %lu\n", res, GetLastError(), error); - ok_(__FILE__,line)(!result, "result = %u\n", result); + ok_(__FILE__,line)(!result, "result = %lu\n", result); CloseHandle(overlapped->hEvent); }
@@ -2931,7 +2931,7 @@ static void _cancel_overlapped(unsigned line, HANDLE handle, OVERLAPPED *overlap BOOL res;
res = pCancelIoEx(handle, overlapped); - ok_(__FILE__,line)(res, "CancelIoEx failed: %u\n", GetLastError()); + ok_(__FILE__,line)(res, "CancelIoEx failed: %lu\n", GetLastError());
_test_overlapped_failure(line, handle, overlapped, ERROR_OPERATION_ABORTED); } @@ -3079,11 +3079,11 @@ static void test_blocking_rw(HANDLE writer, HANDLE reader, DWORD buf_size, BOOL SetLastError(0xdeadbeef); overlapped_read_async(reader, read_buf, 1, &read_overlapped2); res = pCancelIoEx(reader, &read_overlapped2); - ok(res, "CancelIoEx failed with error %d\n", GetLastError()); + ok(res, "CancelIoEx failed with error %ld\n", GetLastError()); res = pCancelIoEx(reader, &read_overlapped2); ok(!res, "CancelIOEx succeeded unexpectedly\n"); ok(GetLastError() == ERROR_NOT_FOUND, - "In CancelIoEx failure, expected ERROR_NOT_FOUND, got %d\n", GetLastError()); + "In CancelIoEx failure, expected ERROR_NOT_FOUND, got %ld\n", GetLastError()); test_overlapped_failure(reader, &read_overlapped2, ERROR_OPERATION_ABORTED);
/* make two async writes, cancel the first one and make sure that we read from the second one */ @@ -3129,7 +3129,7 @@ static void _overlapped_transact(unsigned line, HANDLE caller, void *write_buf, overlapped->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = TransactNamedPipe(caller, write_buf, write_size, read_buf, read_size, NULL, overlapped); ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, - "TransactNamedPipe returned: %x(%u)\n", res, GetLastError()); + "TransactNamedPipe returned: %x(%lu)\n", res, GetLastError()); }
#define overlapped_transact_failure(a,b,c,d,e,f) _overlapped_transact_failure(__LINE__,a,b,c,d,e,f) @@ -3151,7 +3151,7 @@ static void _overlapped_transact_failure(unsigned line, HANDLE caller, void *wri else { ok_(__FILE__,line)(GetLastError() == expected_error, - "TransactNamedPipe returned error %u, expected %u\n", + "TransactNamedPipe returned error %lu, expected %lu\n", GetLastError(), expected_error); CloseHandle(overlapped.hEvent); } @@ -3177,9 +3177,9 @@ static HANDLE create_writepipe_process(HANDLE pipe) BOOL res;
winetest_get_mainargs(&argv); - sprintf(buf, ""%s" pipe writepipe %lx", argv[0], (UINT_PTR)pipe); + sprintf(buf, ""%s" pipe writepipe %Ix", argv[0], (UINT_PTR)pipe); res = CreateProcessA(NULL, buf, NULL, NULL, TRUE, 0L, NULL, NULL, &si, &info); - ok(res, "CreateProcess failed: %u\n", GetLastError()); + ok(res, "CreateProcess failed: %lu\n", GetLastError()); CloseHandle(info.hThread);
return info.hProcess; @@ -3194,21 +3194,21 @@ static void create_overlapped_pipe(DWORD mode, HANDLE *client, HANDLE *server)
*server = CreateNamedPipeA(PIPENAME, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_DUPLEX, PIPE_WAIT | mode, 1, 5000, 6000, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(*server != INVALID_HANDLE_VALUE, "CreateNamedPipe failed: %u\n", GetLastError()); + ok(*server != INVALID_HANDLE_VALUE, "CreateNamedPipe failed: %lu\n", GetLastError()); test_signaled(*server);
memset(&overlapped, 0, sizeof(overlapped)); overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); res = ConnectNamedPipe(*server, &overlapped); - ok(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%u)\n", res, GetLastError()); + ok(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%lu)\n", res, GetLastError()); test_not_signaled(*server); test_not_signaled(overlapped.hEvent);
*client = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, &sec_attr, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); - ok(*client != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(*client != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
res = SetNamedPipeHandleState(*client, &read_mode, NULL, NULL); - ok(res, "SetNamedPipeHandleState failed: %u\n", GetLastError()); + ok(res, "SetNamedPipeHandleState failed: %lu\n", GetLastError());
test_signaled(*client); test_not_signaled(*server); @@ -3265,7 +3265,7 @@ static void test_overlapped_transport(BOOL msg_mode, BOOL msg_read_mode) overlapped_write_async(server, buf, 7000, &overlapped2); flush = test_flush_async(client, ERROR_PIPE_NOT_CONNECTED); res = DisconnectNamedPipe(server); - ok(res, "DisconnectNamedPipe failed: %u\n", GetLastError()); + ok(res, "DisconnectNamedPipe failed: %lu\n", GetLastError()); test_overlapped_failure(client, &overlapped, ERROR_PIPE_NOT_CONNECTED); test_overlapped_failure(client, &overlapped2, ERROR_PIPE_NOT_CONNECTED); test_flush_done(flush); @@ -3278,10 +3278,10 @@ static void test_overlapped_transport(BOOL msg_mode, BOOL msg_read_mode) /* successfully read part of write that is pending in child process */ res = ReadFile(server, buf, 10, &read_bytes, NULL); if(!msg_read_mode) - ok(res, "ReadFile failed: %u\n", GetLastError()); + ok(res, "ReadFile failed: %lu\n", GetLastError()); else - ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned: %x %u\n", res, GetLastError()); - ok(read_bytes == 10, "read_bytes = %u\n", read_bytes); + ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned: %x %lu\n", res, GetLastError()); + ok(read_bytes == 10, "read_bytes = %lu\n", read_bytes); TerminateProcess(process, 0); wait_child_process(process); /* after terminating process, there is no pending write and pipe buffer is empty */ @@ -3399,9 +3399,9 @@ static HANDLE create_overlapped_server( OVERLAPPED *overlapped )
pipe = CreateNamedPipeA(PIPENAME, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE | PIPE_WAIT, 1, 5000, 6000, NMPWAIT_USE_DEFAULT_WAIT, NULL); - ok(pipe != INVALID_HANDLE_VALUE, "got %u\n", GetLastError()); + ok(pipe != INVALID_HANDLE_VALUE, "got %lu\n", GetLastError()); ret = ConnectNamedPipe(pipe, overlapped); - ok(!ret && GetLastError() == ERROR_IO_PENDING, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_IO_PENDING, "got %lu\n", GetLastError()); return pipe; }
@@ -3413,17 +3413,17 @@ static void child_process_check_pid(DWORD server_pid) BOOL ret;
pipe = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - ok(pipe != INVALID_HANDLE_VALUE, "got %u\n", GetLastError()); + ok(pipe != INVALID_HANDLE_VALUE, "got %lu\n", GetLastError());
pid = 0; ret = pGetNamedPipeClientProcessId(pipe, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x\n", pid); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx\n", pid);
pid = 0; ret = pGetNamedPipeServerProcessId(pipe, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == server_pid, "got %04x expected %04x\n", pid, server_pid); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == server_pid, "got %04lx expected %04lx\n", pid, server_pid); CloseHandle(pipe); }
@@ -3435,9 +3435,9 @@ static HANDLE create_check_id_process(const char *verb, DWORD id) BOOL ret;
winetest_get_mainargs(&argv); - sprintf(buf, ""%s" pipe %s %x", argv[0], verb, id); + sprintf(buf, ""%s" pipe %s %lx", argv[0], verb, id); ret = CreateProcessA(NULL, buf, NULL, NULL, TRUE, 0, NULL, NULL, &si, &info); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); CloseHandle(info.hThread); return info.hProcess; } @@ -3461,44 +3461,44 @@ static void test_namedpipe_process_id(void) SetLastError(0xdeadbeef); ret = pGetNamedPipeClientProcessId(server, NULL); ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", GetLastError());
pid = 0; ret = pGetNamedPipeClientProcessId(server, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
pid = 0; ret = pGetNamedPipeClientProcessId(client, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
SetLastError(0xdeadbeef); ret = pGetNamedPipeServerProcessId(server, NULL); ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", GetLastError());
pid = 0; ret = pGetNamedPipeServerProcessId(client, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
pid = 0; ret = pGetNamedPipeServerProcessId(server, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
/* closed client handle */ CloseHandle(client); pid = 0; ret = pGetNamedPipeClientProcessId(server, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
pid = 0; ret = pGetNamedPipeServerProcessId(server, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current); CloseHandle(server);
/* disconnected server */ @@ -3508,22 +3508,22 @@ static void test_namedpipe_process_id(void) SetLastError(0xdeadbeef); ret = pGetNamedPipeClientProcessId(server, &pid); todo_wine ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_NOT_FOUND, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_NOT_FOUND, "got %lu\n", GetLastError());
pid = 0; ret = pGetNamedPipeServerProcessId(server, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
SetLastError(0xdeadbeef); ret = pGetNamedPipeClientProcessId(client, &pid); todo_wine ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetNamedPipeServerProcessId(client, &pid); todo_wine ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %lu\n", GetLastError()); CloseHandle(client); CloseHandle(server);
@@ -3533,20 +3533,20 @@ static void test_namedpipe_process_id(void)
pid = 0; ret = pGetNamedPipeClientProcessId(client, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current);
pid = 0; ret = pGetNamedPipeServerProcessId(client, &pid); - ok(ret, "got %u\n", GetLastError()); - ok(pid == current, "got %04x expected %04x\n", pid, current); + ok(ret, "got %lu\n", GetLastError()); + ok(pid == current, "got %04lx expected %04lx\n", pid, current); CloseHandle(client);
/* different process */ memset(&overlapped, 0, sizeof(overlapped)); overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); server = create_overlapped_server( &overlapped ); - ok(server != INVALID_HANDLE_VALUE, "got %u\n", GetLastError()); + ok(server != INVALID_HANDLE_VALUE, "got %lu\n", GetLastError());
process = create_check_id_process("checkpid", GetProcessId(GetCurrentProcess())); wait_child_process(process); @@ -3566,17 +3566,17 @@ static void child_process_check_session_id(DWORD server_id) ProcessIdToSessionId(GetProcessId(GetCurrentProcess()), ¤t);
pipe = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - ok(pipe != INVALID_HANDLE_VALUE, "got %u\n", GetLastError()); + ok(pipe != INVALID_HANDLE_VALUE, "got %lu\n", GetLastError());
id = 0; ret = pGetNamedPipeClientSessionId(pipe, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %04x\n", id); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %04lx\n", id);
id = 0; ret = pGetNamedPipeServerSessionId(pipe, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == server_id, "got %04x expected %04x\n", id, server_id); + ok(ret, "got %lu\n", GetLastError()); + ok(id == server_id, "got %04lx expected %04lx\n", id, server_id); CloseHandle(pipe); }
@@ -3607,41 +3607,41 @@ static void test_namedpipe_session_id(void)
id = 0; ret = pGetNamedPipeClientSessionId(server, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %u expected %u\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %lu expected %lu\n", id, current);
id = 0; ret = pGetNamedPipeClientSessionId(client, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %u expected %u\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %lu expected %lu\n", id, current);
SetLastError(0xdeadbeef); ret = pGetNamedPipeServerSessionId(server, NULL); ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", GetLastError());
id = 0; ret = pGetNamedPipeServerSessionId(client, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %u expected %u\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %lu expected %lu\n", id, current);
id = 0; ret = pGetNamedPipeServerSessionId(server, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %u expected %u\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %lu expected %lu\n", id, current);
/* closed client handle */ CloseHandle(client);
id = 0; ret = pGetNamedPipeClientSessionId(server, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %04x expected %04x\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %04lx expected %04lx\n", id, current);
id = 0; ret = pGetNamedPipeServerSessionId(server, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %04x expected %04x\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %04lx expected %04lx\n", id, current); CloseHandle(server);
/* disconnected server */ @@ -3651,22 +3651,22 @@ static void test_namedpipe_session_id(void) SetLastError(0xdeadbeef); ret = pGetNamedPipeClientSessionId(server, &id); todo_wine ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_NOT_FOUND, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_NOT_FOUND, "got %lu\n", GetLastError());
id = 0; ret = pGetNamedPipeServerSessionId(server, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %04x expected %04x\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %04lx expected %04lx\n", id, current);
SetLastError(0xdeadbeef); ret = pGetNamedPipeClientSessionId(client, &id); todo_wine ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetNamedPipeServerSessionId(client, &id); todo_wine ok(!ret, "success\n"); - todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_PIPE_NOT_CONNECTED, "got %lu\n", GetLastError()); CloseHandle(client); CloseHandle(server);
@@ -3676,20 +3676,20 @@ static void test_namedpipe_session_id(void)
id = 0; ret = pGetNamedPipeClientSessionId(client, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %04x expected %04x\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %04lx expected %04lx\n", id, current);
id = 0; ret = pGetNamedPipeServerSessionId(client, &id); - ok(ret, "got %u\n", GetLastError()); - ok(id == current, "got %04x expected %04x\n", id, current); + ok(ret, "got %lu\n", GetLastError()); + ok(id == current, "got %04lx expected %04lx\n", id, current); CloseHandle(client);
/* different process */ memset(&overlapped, 0, sizeof(overlapped)); overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); server = create_overlapped_server( &overlapped ); - ok(server != INVALID_HANDLE_VALUE, "got %u\n", GetLastError()); + ok(server != INVALID_HANDLE_VALUE, "got %lu\n", GetLastError());
process = create_check_id_process("checksessionid", current); wait_child_process(process); @@ -3728,12 +3728,12 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[2], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld\n", GetLastError());
memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[0], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %ld\n", GetLastError());
CloseHandle(client);
@@ -3745,12 +3745,12 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[2], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld\n", GetLastError());
memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[1], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %ld\n", GetLastError());
CloseHandle(client);
@@ -3762,7 +3762,7 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[2], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %ld\n", GetLastError());
CloseHandle(client);
@@ -3776,12 +3776,12 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[2], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld\n", GetLastError());
memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[0], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld\n", GetLastError());
/* server[3] is connected next */
@@ -3791,7 +3791,7 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[3], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %ld\n", GetLastError());
CloseHandle(client);
@@ -3803,12 +3803,12 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[2], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %ld\n", GetLastError());
memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[0], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld\n", GetLastError());
CloseHandle(client);
@@ -3820,14 +3820,14 @@ static void test_multiple_instances(void) memset(&ov, 0, sizeof(ov)); ret = ConnectNamedPipe(server[0], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_CONNECTED, "got %ld\n", GetLastError());
CloseHandle(client);
/* No more listening pipes available */ DisconnectNamedPipe(server[0]); client = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); - ok(client == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PIPE_BUSY, "got %p(%u)\n", client, GetLastError()); + ok(client == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PIPE_BUSY, "got %p(%lu)\n", client, GetLastError());
for (i = 0; i < ARRAY_SIZE(server); i++) { @@ -3840,7 +3840,7 @@ static DWORD WINAPI wait_pipe_proc(void *arg) { BOOL ret; ret = WaitNamedPipeA(PIPENAME, 1000); - ok(ret, "WaitNamedPipe failed (%u)\n", GetLastError()); + ok(ret, "WaitNamedPipe failed (%lu)\n", GetLastError()); return 0; }
@@ -3850,10 +3850,10 @@ static HANDLE async_wait_pipe(void) BOOL ret;
thread = CreateThread(NULL, 0, wait_pipe_proc, NULL, 0, NULL); - ok(thread != NULL, "CreateThread failed: %u\n", GetLastError()); + ok(thread != NULL, "CreateThread failed: %lu\n", GetLastError());
ret = WaitNamedPipeA(PIPENAME, 1); - ok(!ret && GetLastError() == ERROR_SEM_TIMEOUT, "WaitNamedPipe failed %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_SEM_TIMEOUT, "WaitNamedPipe failed %x(%lu)\n", ret, GetLastError());
return thread; } @@ -3866,7 +3866,7 @@ static void test_wait_pipe(void) BOOL ret;
ret = WaitNamedPipeA(PIPENAME, 0); - ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "WaitNamedPipe failed %x(%u)\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "WaitNamedPipe failed %x(%lu)\n", ret, GetLastError());
server[0] = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_READMODE_BYTE | PIPE_WAIT, ARRAY_SIZE(server), 1024, 1024, @@ -3874,7 +3874,7 @@ static void test_wait_pipe(void) ok(server[0] != INVALID_HANDLE_VALUE, "got invalid handle\n");
ret = WaitNamedPipeA(PIPENAME, 1); - ok(ret, "WaitNamedPipe failed (%u)\n", GetLastError()); + ok(ret, "WaitNamedPipe failed (%lu)\n", GetLastError());
client = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); ok(client != INVALID_HANDLE_VALUE, "got invalid handle\n"); @@ -3887,14 +3887,14 @@ static void test_wait_pipe(void) ok(server[1] != INVALID_HANDLE_VALUE, "got invalid handle\n");
res = WaitForSingleObject(wait, 100); - ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", res);
CloseHandle(wait); CloseHandle(server[1]);
CloseHandle(client); ret = DisconnectNamedPipe(server[0]); - ok(ret, "DisconnectNamedPipe failed (%u)\n", GetLastError()); + ok(ret, "DisconnectNamedPipe failed (%lu)\n", GetLastError());
/* Putting pipe server into waiting listening state wakes waiters */ wait = async_wait_pipe(); @@ -3902,14 +3902,14 @@ static void test_wait_pipe(void) ov.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); ret = ConnectNamedPipe(server[0], &ov); ok(ret == FALSE, "got %d\n", ret); - ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld\n", GetLastError());
res = WaitForSingleObject(wait, 100); - ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", res); CloseHandle(server[0]);
res = WaitForSingleObject(ov.hEvent, 0); - ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", res); CloseHandle(ov.hEvent); }
@@ -3936,7 +3936,7 @@ static void test_nowait(DWORD pipe_type) ol.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); SetLastError(0xdeadbeef); ok(ReadFile(piperead, readbuf, sizeof(readbuf), &read, &ol) == FALSE, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_NO_DATA, "got %d should be ERROR_NO_DATA\n", GetLastError()); + ok(GetLastError() == ERROR_NO_DATA, "got %ld should be ERROR_NO_DATA\n", GetLastError()); if (GetLastError() == ERROR_IO_PENDING) CancelIo(piperead);
@@ -3979,63 +3979,63 @@ static void test_nowait(DWORD pipe_type) /* overlapped read of 32768, non-blocking write of 512 */ SetLastError(0xdeadbeef); ok(ReadFile(piperead, readbuf, sizeof(readbuf), &read, &ol2) == FALSE, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "got %d should be ERROR_IO_PENDING\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld should be ERROR_IO_PENDING\n", GetLastError()); ok(WriteFile(pipewrite, teststring, sizeof(teststring), &write, &ol), "WriteFile should succeed\n"); - ok(write == sizeof(teststring), "got %d\n", write); + ok(write == sizeof(teststring), "got %ld\n", write); ok(GetOverlappedResult(piperead, &ol2, &read, FALSE), "GetOverlappedResult should succeed\n"); - ok(read == sizeof(teststring), "got %d\n", read); + ok(read == sizeof(teststring), "got %ld\n", read); if (GetOverlappedResult(piperead, &ol2, &read, FALSE) == FALSE) CancelIo(piperead);
/* overlapped read of 32768, non-blocking write of 513 */ SetLastError(0xdeadbeef); ok(ReadFile(piperead, readbuf, sizeof(readbuf), &read, &ol2) == FALSE, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "got %d should be ERROR_IO_PENDING\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld should be ERROR_IO_PENDING\n", GetLastError()); ok(WriteFile(pipewrite, readbuf, 513, &write, &ol), "WriteFile should succeed\n"); - ok(write == 513, "got %d, write should be %d\n", write, 513); + ok(write == 513, "got %ld, write should be %d\n", write, 513); ok(GetOverlappedResult(piperead, &ol2, &read, FALSE), "GetOverlappedResult should succeed\n"); - ok(read == 513, "got %d, read should be %d\n", read, 513); + ok(read == 513, "got %ld, read should be %d\n", read, 513); if (GetOverlappedResult(piperead, &ol2, &read, FALSE) == FALSE) CancelIo(piperead);
/* overlapped read of 1 byte, non-blocking write of 513 bytes */ SetLastError(0xdeadbeef); ok(ReadFile(piperead, readbuf, 1, &read, &ol2) == FALSE, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "got %d should be ERROR_IO_PENDING\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld should be ERROR_IO_PENDING\n", GetLastError()); ok(WriteFile(pipewrite, readbuf, 513, &write, &ol), "WriteFile should succeed\n"); - ok(write == 513, "got %d, write should be %d\n", write, 513); + ok(write == 513, "got %ld, write should be %d\n", write, 513); ok(GetOverlappedResult(piperead, &ol2, &read, FALSE), "GetOverlappedResult should succeed\n"); - ok(read == 1, "got %d, read should be %d\n", read, 1); + ok(read == 1, "got %ld, read should be %d\n", read, 1); if (GetOverlappedResult(piperead, &ol2, &read, FALSE) == FALSE) CancelIo(piperead); /* read the remaining 512 bytes */ SetLastError(0xdeadbeef); ok(ReadFile(piperead, readbuf, sizeof(readbuf), &read, &ol2), "ReadFile should succeed\n"); - ok(read == 512, "got %d, write should be %d\n", write, 512); + ok(read == 512, "got %ld, write should be %d\n", write, 512); if (GetOverlappedResult(piperead, &ol2, &read, FALSE) == FALSE) CancelIo(piperead);
/* overlapped read of 1 byte, non-blocking write of 514 bytes */ SetLastError(0xdeadbeef); ok(ReadFile(piperead, readbuf, 1, &read, &ol2) == FALSE, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "got %d should be ERROR_IO_PENDING\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got %ld should be ERROR_IO_PENDING\n", GetLastError()); ok(WriteFile(pipewrite, readbuf, 514, &write, &ol), "WriteFile should succeed\n"); if (pipe_type == PIPE_TYPE_MESSAGE) { todo_wine - ok(write == 0, "got %d\n", write); + ok(write == 0, "got %ld\n", write); todo_wine ok(!GetOverlappedResult(piperead, &ol2, &read, FALSE), "GetOverlappedResult should fail\n"); todo_wine - ok(GetLastError() == ERROR_IO_INCOMPLETE, "got %d should be ERROR_IO_PENDING\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "got %ld should be ERROR_IO_PENDING\n", GetLastError()); todo_wine - ok(read == 0, "got %d, read should be %d\n", read, 1); + ok(read == 0, "got %ld, read should be %d\n", read, 1); } else { - ok(write == 1, "got %d\n", write); + ok(write == 1, "got %ld\n", write); ok(GetOverlappedResult(piperead, &ol2, &read, FALSE), "GetOverlappedResult should fail\n"); - ok(read == 1, "got %d, read should be %d\n", read, 1); + ok(read == 1, "got %ld, read should be %d\n", read, 1); } if (GetOverlappedResult(piperead, &ol2, &read, FALSE) == FALSE) CancelIo(piperead); @@ -4066,7 +4066,7 @@ static void test_nowait(DWORD pipe_type) ol.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); SetLastError(0xdeadbeef); ok(ConnectNamedPipe(pipewrite, &ol) == FALSE, "ConnectNamedPipe should fail\n"); - ok(GetLastError() == ERROR_PIPE_LISTENING, "got %d should be ERROR_PIPE_LISTENING\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_LISTENING, "got %ld should be ERROR_PIPE_LISTENING\n", GetLastError()); if (GetLastError() == ERROR_IO_PENDING) CancelIo(pipewrite);
@@ -4076,7 +4076,7 @@ static void test_nowait(DWORD pipe_type) ok(CloseHandle(file), "CloseHandle failed\n"); SetLastError(0xdeadbeef); ok(ConnectNamedPipe(pipewrite,&ol) == FALSE, "ConnectNamedPipe should fail\n"); - ok(GetLastError() == ERROR_NO_DATA, "got %d should be ERROR_NO_DATA\n", GetLastError()); + ok(GetLastError() == ERROR_NO_DATA, "got %ld should be ERROR_NO_DATA\n", GetLastError()); if (GetLastError() == ERROR_IO_PENDING) CancelIo(pipewrite);
@@ -4084,7 +4084,7 @@ static void test_nowait(DWORD pipe_type) ok(DisconnectNamedPipe(pipewrite) == TRUE, "DisconnectNamedPipe should succeed\n"); SetLastError(0xdeadbeef); ok(ConnectNamedPipe(pipewrite,&ol) == FALSE, "ConnectNamedPipe should fail\n"); - ok(GetLastError() == ERROR_PIPE_LISTENING, "got %d should be ERROR_PIPE_LISTENING\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_LISTENING, "got %ld should be ERROR_PIPE_LISTENING\n", GetLastError()); if (GetLastError() == ERROR_IO_PENDING) CancelIo(pipewrite); ok(CloseHandle(ol.hEvent), "CloseHandle for the event failed\n"); @@ -4115,25 +4115,25 @@ static void test_GetOverlappedResultEx(void) SetLastError(0xdeadbeef); ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 0, FALSE); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "wrong error %lu\n", GetLastError()); ok(!user_apc_ran, "APC should not have run\n");
SetLastError(0xdeadbeef); ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 0, TRUE); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_IO_INCOMPLETE, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_IO_INCOMPLETE, "wrong error %lu\n", GetLastError()); ok(!user_apc_ran, "APC should not have run\n");
SetLastError(0xdeadbeef); ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 10, FALSE); ok(!ret, "expected failure\n"); - ok(GetLastError() == WAIT_TIMEOUT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError()); ok(!user_apc_ran, "APC should not have run\n");
SetLastError(0xdeadbeef); ret = pGetOverlappedResultEx(client, &ovl, &ret_size, 10, TRUE); ok(!ret, "expected failure\n"); - ok(GetLastError() == WAIT_IO_COMPLETION, "wrong error %u\n", GetLastError()); + ok(GetLastError() == WAIT_IO_COMPLETION, "wrong error %lu\n", GetLastError()); ok(user_apc_ran, "APC should have run\n");
CloseHandle(ovl.hEvent); @@ -4154,13 +4154,13 @@ static void child_process_exit_process_async(DWORD parent_pid, HANDLE parent_pip
ret = DuplicateHandle(parent, parent_pipe, GetCurrentProcess(), &pipe, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
ret = ReadFile(pipe, buffer, sizeof(buffer), NULL, &overlapped); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_IO_PENDING, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "got error %lu\n", GetLastError());
/* exit without closing the pipe handle */ } @@ -4182,9 +4182,9 @@ static void test_exit_process_async(void) create_overlapped_pipe(PIPE_TYPE_BYTE, &client, &server); port = CreateIoCompletionPort(client, NULL, 123, 0);
- sprintf(cmdline, "%s pipe exit_process_async %x %p", argv[0], GetCurrentProcessId(), client); + sprintf(cmdline, "%s pipe exit_process_async %lx %p", argv[0], GetCurrentProcessId(), client); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = WaitForSingleObject(pi.hProcess, 1000); ok(!ret, "wait timed out\n"); CloseHandle(pi.hThread); @@ -4194,8 +4194,8 @@ static void test_exit_process_async(void) size = 0xdeadbeef; ret = GetQueuedCompletionStatus(port, &size, &key, &overlapped, 1000); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_OPERATION_ABORTED, "got error %u\n", GetLastError()); - ok(!size, "got size %u\n", size); + ok(GetLastError() == ERROR_OPERATION_ABORTED, "got error %lu\n", GetLastError()); + ok(!size, "got size %lu\n", size); ok(key == 123, "got key %Iu\n", key);
CloseHandle(port); @@ -4225,14 +4225,14 @@ START_TEST(pipe) if (!strcmp(argv[2], "writepipe")) { ULONG handle; - sscanf(argv[3], "%x", &handle); + sscanf(argv[3], "%lx", &handle); child_process_write_pipe(ULongToHandle(handle)); return; } if (!strcmp(argv[2], "checkpid")) { DWORD pid = GetProcessId(GetCurrentProcess()); - sscanf(argv[3], "%x", &pid); + sscanf(argv[3], "%lx", &pid); child_process_check_pid(pid); return; } @@ -4240,7 +4240,7 @@ START_TEST(pipe) { DWORD id; ProcessIdToSessionId(GetProcessId(GetCurrentProcess()), &id); - sscanf(argv[3], "%x", &id); + sscanf(argv[3], "%lx", &id); child_process_check_session_id(id); return; } @@ -4248,7 +4248,7 @@ START_TEST(pipe) { HANDLE handle; DWORD pid; - sscanf(argv[3], "%x", &pid); + sscanf(argv[3], "%lx", &pid); sscanf(argv[4], "%p", &handle); child_process_exit_process_async(pid, handle); return; diff --git a/dlls/kernel32/tests/power.c b/dlls/kernel32/tests/power.c index af488849e21..900362a4a45 100644 --- a/dlls/kernel32/tests/power.c +++ b/dlls/kernel32/tests/power.c @@ -53,14 +53,14 @@ void test_GetSystemPowerStatus(void) "expected %u%%-charged battery to have capacity flags 0x%02x, got 0x%02x\n", ps.BatteryLifePercent, expected_capacity_flags, capacity_flags); ok(ps.BatteryLifeTime <= ps.BatteryFullLifeTime, - "expected BatteryLifeTime %u to be less than or equal to BatteryFullLifeTime %u\n", + "expected BatteryLifeTime %lu to be less than or equal to BatteryFullLifeTime %lu\n", ps.BatteryLifeTime, ps.BatteryFullLifeTime); if (ps.BatteryFlag & BATTERY_FLAG_CHARGING) { ok(ps.BatteryLifeTime == BATTERY_LIFE_UNKNOWN, - "expected BatteryLifeTime to be -1 when charging, got %u\n", ps.BatteryLifeTime); + "expected BatteryLifeTime to be -1 when charging, got %lu\n", ps.BatteryLifeTime); ok(ps.BatteryFullLifeTime == BATTERY_LIFE_UNKNOWN, - "expected BatteryFullLifeTime to be -1 when charging, got %u\n", ps.BatteryFullLifeTime); + "expected BatteryFullLifeTime to be -1 when charging, got %lu\n", ps.BatteryFullLifeTime); } } else @@ -71,9 +71,9 @@ void test_GetSystemPowerStatus(void) ok(ps.BatteryLifePercent == BATTERY_PERCENTAGE_UNKNOWN, "expected BatteryLifePercent to be -1, got %u\n", ps.BatteryLifePercent); ok(ps.BatteryLifeTime == BATTERY_LIFE_UNKNOWN, - "expected BatteryLifeTime to be -1, got %u\n", ps.BatteryLifeTime); + "expected BatteryLifeTime to be -1, got %lu\n", ps.BatteryLifeTime); ok(ps.BatteryFullLifeTime == BATTERY_LIFE_UNKNOWN, - "expected BatteryFullLifeTime to be -1, got %u\n", ps.BatteryFullLifeTime); + "expected BatteryFullLifeTime to be -1, got %lu\n", ps.BatteryFullLifeTime); } }
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index a4af5bb57ff..46f5cc41532 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -47,7 +47,7 @@ do { \ int value = (actual); \ ok((expected) == value, "Expected " #actual " to be %d (" #expected ") is %d\n", \ - (expected), value); \ + (int)(expected), value); \ } while (0) #define expect_eq_s(expected, actual) \ do { \ @@ -343,11 +343,11 @@ static void doChild(const char* file, const char* option) /* output of startup info (Ansi) */ GetStartupInfoA(&siA); childPrintf(hFile, - "[StartupInfoA]\ncb=%08u\nlpDesktop=%s\nlpTitle=%s\n" - "dwX=%u\ndwY=%u\ndwXSize=%u\ndwYSize=%u\n" - "dwXCountChars=%u\ndwYCountChars=%u\ndwFillAttribute=%u\n" - "dwFlags=%u\nwShowWindow=%u\n" - "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n", + "[StartupInfoA]\ncb=%08lu\nlpDesktop=%s\nlpTitle=%s\n" + "dwX=%lu\ndwY=%lu\ndwXSize=%lu\ndwYSize=%lu\n" + "dwXCountChars=%lu\ndwYCountChars=%lu\ndwFillAttribute=%lu\n" + "dwFlags=%lu\nwShowWindow=%u\n" + "hStdInput=%Iu\nhStdOutput=%Iu\nhStdError=%Iu\n\n", siA.cb, encodeA(siA.lpDesktop), encodeA(siA.lpTitle), siA.dwX, siA.dwY, siA.dwXSize, siA.dwYSize, siA.dwXCountChars, siA.dwYCountChars, siA.dwFillAttribute, @@ -355,7 +355,7 @@ static void doChild(const char* file, const char* option) (DWORD_PTR)siA.hStdInput, (DWORD_PTR)siA.hStdOutput, (DWORD_PTR)siA.hStdError);
/* check the console handles in the TEB */ - childPrintf(hFile, "[TEB]\nhStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n", + childPrintf(hFile, "[TEB]\nhStdInput=%Iu\nhStdOutput=%Iu\nhStdError=%Iu\n\n", (DWORD_PTR)params->hStdInput, (DWORD_PTR)params->hStdOutput, (DWORD_PTR)params->hStdError);
@@ -365,11 +365,11 @@ static void doChild(const char* file, const char* option) memset(&siW, 0, sizeof(siW)); GetStartupInfoW(&siW); childPrintf(hFile, - "[StartupInfoW]\ncb=%08u\nlpDesktop=%s\nlpTitle=%s\n" - "dwX=%u\ndwY=%u\ndwXSize=%u\ndwYSize=%u\n" - "dwXCountChars=%u\ndwYCountChars=%u\ndwFillAttribute=%u\n" - "dwFlags=%u\nwShowWindow=%u\n" - "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n", + "[StartupInfoW]\ncb=%08lu\nlpDesktop=%s\nlpTitle=%s\n" + "dwX=%lu\ndwY=%lu\ndwXSize=%lu\ndwYSize=%lu\n" + "dwXCountChars=%lu\ndwYCountChars=%lu\ndwFillAttribute=%lu\n" + "dwFlags=%lu\nwShowWindow=%u\n" + "hStdInput=%Iu\nhStdOutput=%Iu\nhStdError=%Iu\n\n", siW.cb, encodeW(siW.lpDesktop), encodeW(siW.lpTitle), siW.dwX, siW.dwY, siW.dwXSize, siW.dwYSize, siW.dwXCountChars, siW.dwYCountChars, siW.dwFillAttribute, @@ -387,7 +387,7 @@ static void doChild(const char* file, const char* option)
/* output toolhelp information */ snapshot = pCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - ok(snapshot != INVALID_HANDLE_VALUE, "CreateToolhelp32Snapshot failed %u\n", GetLastError()); + ok(snapshot != INVALID_HANDLE_VALUE, "CreateToolhelp32Snapshot failed %lu\n", GetLastError()); memset(&pe, 0, sizeof(pe)); pe.dwSize = sizeof(pe); if (pProcess32First(snapshot, &pe)) @@ -398,9 +398,9 @@ static void doChild(const char* file, const char* option) CloseHandle(snapshot); ok(pe.th32ProcessID == GetCurrentProcessId(), "failed to find current process in snapshot\n"); childPrintf(hFile, - "[Toolhelp]\ncntUsage=%u\nth32DefaultHeapID=%lu\n" - "th32ModuleID=%u\ncntThreads=%u\nth32ParentProcessID=%u\n" - "pcPriClassBase=%u\ndwFlags=%u\nszExeFile=%s\n\n", + "[Toolhelp]\ncntUsage=%lu\nth32DefaultHeapID=%Iu\n" + "th32ModuleID=%lu\ncntThreads=%lu\nth32ParentProcessID=%lu\n" + "pcPriClassBase=%lu\ndwFlags=%lu\nszExeFile=%s\n\n", pe.cntUsage, pe.th32DefaultHeapID, pe.th32ModuleID, pe.cntThreads, pe.th32ParentProcessID, pe.pcPriClassBase, pe.dwFlags, encodeA(pe.szExeFile)); @@ -471,9 +471,9 @@ static void doChild(const char* file, const char* option) childPrintf(hFile, "InputCP=%d\nOutputCP=%d\n", GetConsoleCP(), GetConsoleOutputCP()); if (GetConsoleMode(hConIn, &modeIn)) - childPrintf(hFile, "InputMode=%u\n", modeIn); + childPrintf(hFile, "InputMode=%lu\n", modeIn); if (GetConsoleMode(hConOut, &modeOut)) - childPrintf(hFile, "OutputMode=%u\n", modeOut); + childPrintf(hFile, "OutputMode=%lu\n", modeOut);
/* now that we have written all relevant information, let's change it */ SetLastError(0xdeadbeef); @@ -489,13 +489,13 @@ static void doChild(const char* file, const char* option) }
ret = SetConsoleMode(hConIn, modeIn ^ 1); - ok( ret, "Setting mode (%d)\n", GetLastError()); + ok( ret, "Setting mode (%ld)\n", GetLastError()); ret = SetConsoleMode(hConOut, modeOut ^ 1); - ok( ret, "Setting mode (%d)\n", GetLastError()); + ok( ret, "Setting mode (%ld)\n", GetLastError()); sbi.dwCursorPosition.X ^= 1; sbi.dwCursorPosition.Y ^= 1; ret = SetConsoleCursorPosition(hConOut, sbi.dwCursorPosition); - ok( ret, "Setting cursor position (%d)\n", GetLastError()); + ok( ret, "Setting cursor position (%ld)\n", GetLastError()); } if (option && strcmp(option, "stdhandle") == 0) { @@ -896,25 +896,25 @@ static void test_CommandLine(void) memset(&info, 0xa, sizeof(info)); ok(!CreateProcessA(buffer, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess unexpectedly succeeded\n"); /* Check that the effective STARTUPINFOA parameters are not modified */ - ok(startup.cb == sizeof(startup), "unexpected cb %d\n", startup.cb); + ok(startup.cb == sizeof(startup), "unexpected cb %ld\n", startup.cb); ok(startup.lpDesktop == NULL, "lpDesktop is not NULL\n"); ok(startup.lpTitle == NULL, "lpTitle is not NULL\n"); - ok(startup.dwFlags == STARTF_USESHOWWINDOW, "unexpected dwFlags %04x\n", startup.dwFlags); + ok(startup.dwFlags == STARTF_USESHOWWINDOW, "unexpected dwFlags %04lx\n", startup.dwFlags); ok(startup.wShowWindow == SW_SHOWNORMAL, "unexpected wShowWindow %d\n", startup.wShowWindow); ok(!info.hProcess, "unexpected hProcess %p\n", info.hProcess); ok(!info.hThread, "unexpected hThread %p\n", info.hThread); - ok(!info.dwProcessId, "unexpected dwProcessId %04x\n", info.dwProcessId); - ok(!info.dwThreadId, "unexpected dwThreadId %04x\n", info.dwThreadId); + ok(!info.dwProcessId, "unexpected dwProcessId %04lx\n", info.dwProcessId); + ok(!info.dwThreadId, "unexpected dwThreadId %04lx\n", info.dwThreadId);
/* the basics; not getting confused by the leading and trailing " */ get_file_name(resfile); sprintf(buffer, ""%s" process dump "%s" "C:\Program Files\my nice app.exe"", selfname, resfile); ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n"); /* Check that the effective STARTUPINFOA parameters are not modified */ - ok(startup.cb == sizeof(startup), "unexpected cb %d\n", startup.cb); + ok(startup.cb == sizeof(startup), "unexpected cb %ld\n", startup.cb); ok(startup.lpDesktop == NULL, "lpDesktop is not NULL\n"); ok(startup.lpTitle == NULL, "lpTitle is not NULL\n"); - ok(startup.dwFlags == STARTF_USESHOWWINDOW, "unexpected dwFlags %04x\n", startup.dwFlags); + ok(startup.dwFlags == STARTF_USESHOWWINDOW, "unexpected dwFlags %04lx\n", startup.dwFlags); ok(startup.wShowWindow == SW_SHOWNORMAL, "unexpected wShowWindow %d\n", startup.wShowWindow); wait_and_close_child_process(&info);
@@ -955,7 +955,7 @@ static void test_CommandLine(void) sprintf(buffer, "./%s process dump "%s" """"", exename, resfile); SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); - ok(ret, "CreateProcess (%s) failed : %d\n", buffer, GetLastError()); + ok(ret, "CreateProcess (%s) failed : %ld\n", buffer, GetLastError()); wait_and_close_child_process(&info);
reload_child_info(resfile); @@ -972,7 +972,7 @@ static void test_CommandLine(void) sprintf(buffer, ".\%s process dump "%s"", exename, resfile); SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); - ok(ret, "CreateProcess (%s) failed : %d\n", buffer, GetLastError()); + ok(ret, "CreateProcess (%s) failed : %ld\n", buffer, GetLastError()); wait_and_close_child_process(&info);
reload_child_info(resfile); @@ -988,7 +988,7 @@ static void test_CommandLine(void) else sprintf(buffer, "./%s process dump "%s"", exename, resfile); SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); - ok(ret, "CreateProcess (%s) failed : %d\n", buffer, GetLastError()); + ok(ret, "CreateProcess (%s) failed : %ld\n", buffer, GetLastError()); wait_and_close_child_process(&info);
reload_child_info(resfile); @@ -1010,7 +1010,7 @@ static void test_CommandLine(void) sprintf(buffer2, "dummy process dump "%s"", resfile); SetLastError(0xdeadbeef); ret = CreateProcessA(buffer, buffer2, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); - ok(ret, "CreateProcess (%s) failed : %d\n", buffer, GetLastError()); + ok(ret, "CreateProcess (%s) failed : %ld\n", buffer, GetLastError()); wait_and_close_child_process(&info);
reload_child_info(resfile); @@ -1028,7 +1028,7 @@ static void test_CommandLine(void) ret = CreateProcessA(NULL, NULL, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); ok(!ret, "CreateProcessA unexpectedly succeeded\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
buffer[0] = '\0'; @@ -1040,7 +1040,7 @@ static void test_CommandLine(void) ok(GetLastError() == ERROR_PATH_NOT_FOUND || broken(GetLastError() == ERROR_FILE_NOT_FOUND) /* Win9x/WinME */ || broken(GetLastError() == ERROR_ACCESS_DENIED) /* Win98 */, - "Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError());
buffer2[0] = '\0';
@@ -1051,7 +1051,7 @@ static void test_CommandLine(void) ok(GetLastError() == ERROR_PATH_NOT_FOUND || broken(GetLastError() == ERROR_FILE_NOT_FOUND) /* Win9x/WinME */ || broken(GetLastError() == ERROR_ACCESS_DENIED) /* Win98 */, - "Expected ERROR_PATH_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError());
/* Test empty command line parameter. */ SetLastError(0xdeadbeef); @@ -1061,7 +1061,7 @@ static void test_CommandLine(void) GetLastError() == ERROR_PATH_NOT_FOUND /* NT4 */ || GetLastError() == ERROR_BAD_PATHNAME /* Win98 */ || GetLastError() == ERROR_INVALID_PARAMETER /* Win7 */, - "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
strcpy(buffer, "doesnotexist.exe"); strcpy(buffer2, "does not exist.exe"); @@ -1070,23 +1070,23 @@ static void test_CommandLine(void) SetLastError(0xdeadbeef); ret = CreateProcessA(buffer, NULL, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); ok(!ret, "CreateProcessA unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateProcessA(buffer2, NULL, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); ok(!ret, "CreateProcessA unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
/* Test nonexistent command line parameter. */ SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); ok(!ret, "CreateProcessA unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, buffer2, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); ok(!ret, "CreateProcessA unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
/* Test whether GetCommandLineW reads directly from TEB or from a cached address */ cmdline = GetCommandLineW(); @@ -1135,7 +1135,7 @@ static void test_Directory(void) memset(&info, 0, sizeof(info)); ok(!CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, "non\existent\directory", &startup, &info), "CreateProcess\n"); - ok(GetLastError() == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_DIRECTORY, "Expected ERROR_DIRECTORY, got %ld\n", GetLastError()); ok(!TerminateProcess(info.hProcess, 0), "Child process should not exist\n"); }
@@ -1178,7 +1178,7 @@ static void test_Toolhelp(void) wait_child_process(info.hProcess);
process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, info.dwProcessId); - ok(process != NULL, "OpenProcess failed %u\n", GetLastError()); + ok(process != NULL, "OpenProcess failed %lu\n", GetLastError()); CloseHandle(process);
CloseHandle(info.hProcess); @@ -1188,7 +1188,7 @@ static void test_Toolhelp(void) { SetLastError(0xdeadbeef); process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, info.dwProcessId); - ok(process || GetLastError() == ERROR_INVALID_PARAMETER, "OpenProcess failed %u\n", GetLastError()); + ok(process || GetLastError() == ERROR_INVALID_PARAMETER, "OpenProcess failed %lu\n", GetLastError()); if (!process) break; CloseHandle(process); Sleep(100); @@ -1202,7 +1202,7 @@ static void test_Toolhelp(void) DeleteFileA(resfile);
snapshot = pCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - ok(snapshot != INVALID_HANDLE_VALUE, "CreateToolhelp32Snapshot failed %u\n", GetLastError()); + ok(snapshot != INVALID_HANDLE_VALUE, "CreateToolhelp32Snapshot failed %lu\n", GetLastError()); memset(&pe, 0, sizeof(pe)); pe.dwSize = sizeof(pe); if (pProcess32First(snapshot, &pe)) @@ -1212,14 +1212,14 @@ static void test_Toolhelp(void) } CloseHandle(snapshot); ok(pe.th32ProcessID == nested_pid, "failed to find nested child process\n"); - ok(pe.th32ParentProcessID == info.dwProcessId, "nested child process has parent %u instead of %u\n", pe.th32ParentProcessID, info.dwProcessId); + ok(pe.th32ParentProcessID == info.dwProcessId, "nested child process has parent %lu instead of %lu\n", pe.th32ParentProcessID, info.dwProcessId); ok(stricmp(pe.szExeFile, exename) == 0, "nested executable is %s instead of %s\n", pe.szExeFile, exename);
process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, pe.th32ProcessID); - ok(process != NULL, "OpenProcess failed %u\n", GetLastError()); + ok(process != NULL, "OpenProcess failed %lu\n", GetLastError());
snapshot = pCreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); - ok(snapshot != INVALID_HANDLE_VALUE, "CreateToolhelp32Snapshot failed %u\n", GetLastError()); + ok(snapshot != INVALID_HANDLE_VALUE, "CreateToolhelp32Snapshot failed %lu\n", GetLastError()); memset(&te, 0, sizeof(te)); te.dwSize = sizeof(te); if (pThread32First(snapshot, &te)) @@ -1231,9 +1231,9 @@ static void test_Toolhelp(void) ok(te.th32OwnerProcessID == pe.th32ProcessID, "failed to find suspended thread\n");
thread = OpenThread(THREAD_ALL_ACCESS_NT4, FALSE, te.th32ThreadID); - ok(thread != NULL, "OpenThread failed %u\n", GetLastError()); + ok(thread != NULL, "OpenThread failed %lu\n", GetLastError()); ret = ResumeThread(thread); - ok(ret == 1, "expected 1, got %u\n", ret); + ok(ret == 1, "expected 1, got %lu\n", ret); CloseHandle(thread);
wait_child_process(process); @@ -1475,7 +1475,7 @@ static void test_DebuggingFlag(void) if (!dbg) { ok(de.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, - "first event: %d\n", de.dwDebugEventCode); + "first event: %ld\n", de.dwDebugEventCode); processbase = de.u.CreateProcessInfo.lpBaseOfImage; } if (de.dwDebugEventCode != EXCEPTION_DEBUG_EVENT) dbg++; @@ -1581,7 +1581,7 @@ static void test_Console(void) ok(!SetConsoleCP(0), "Shouldn't succeed\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED), /* win9x */ - "GetLastError: expecting %u got %u\n", + "GetLastError: expecting %u got %lu\n", ERROR_INVALID_PARAMETER, GetLastError()); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) run_tests = FALSE; @@ -1591,7 +1591,7 @@ static void test_Console(void) ok(!SetConsoleOutputCP(0), "Shouldn't succeed\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED), /* win9x */ - "GetLastError: expecting %u got %u\n", + "GetLastError: expecting %u got %lu\n", ERROR_INVALID_PARAMETER, GetLastError());
SetConsoleCP(cpIn); @@ -1636,8 +1636,8 @@ static void test_Console(void)
if (run_tests) { - ok(cpInC == 1252, "Wrong console CP (expected 1252 got %d/%d)\n", cpInC, cpIn); - ok(cpOutC == 1252, "Wrong console-SB CP (expected 1252 got %d/%d)\n", cpOutC, cpOut); + ok(cpInC == 1252, "Wrong console CP (expected 1252 got %ld/%ld)\n", cpInC, cpIn); + ok(cpOutC == 1252, "Wrong console-SB CP (expected 1252 got %ld/%ld)\n", cpOutC, cpOut); } else win_skip("Setting the codepage is not implemented\n"); @@ -1676,7 +1676,7 @@ static void test_Console(void)
msg_len = strlen(msg) + 1; ok(WriteFile(hParentOut, msg, msg_len, &w, NULL), "Writing to child\n"); - ok(w == msg_len, "Should have written %u bytes, actually wrote %u\n", msg_len, w); + ok(w == msg_len, "Should have written %u bytes, actually wrote %lu\n", msg_len, w); memset(buffer, 0, sizeof(buffer)); ok(ReadFile(hParentIn, buffer, sizeof(buffer), &w, NULL), "Reading from child\n"); ok(strcmp(buffer, msg) == 0, "Should have received '%s'\n", msg); @@ -1731,7 +1731,7 @@ static void test_OpenProcess(void)
/* without PROCESS_VM_OPERATION */ hproc = OpenProcess(PROCESS_ALL_ACCESS_NT4 & ~PROCESS_VM_OPERATION, FALSE, GetCurrentProcessId()); - ok(hproc != NULL, "OpenProcess error %d\n", GetLastError()); + ok(hproc != NULL, "OpenProcess error %ld\n", GetLastError());
SetLastError(0xdeadbeef); addr1 = VirtualAllocEx(hproc, 0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); @@ -1742,35 +1742,35 @@ static void test_OpenProcess(void) win_skip("VirtualAllocEx not implemented\n"); return; } - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError());
read_bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ret = ReadProcessMemory(hproc, test_OpenProcess, &dummy, sizeof(dummy), &read_bytes); - ok(ret, "ReadProcessMemory error %d\n", GetLastError()); - ok(read_bytes == sizeof(dummy), "wrong read bytes %ld\n", read_bytes); + ok(ret, "ReadProcessMemory error %ld\n", GetLastError()); + ok(read_bytes == sizeof(dummy), "wrong read bytes %Id\n", read_bytes);
CloseHandle(hproc);
hproc = OpenProcess(PROCESS_VM_OPERATION, FALSE, GetCurrentProcessId()); - ok(hproc != NULL, "OpenProcess error %d\n", GetLastError()); + ok(hproc != NULL, "OpenProcess error %ld\n", GetLastError());
addr1 = VirtualAllocEx(hproc, 0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); - ok(addr1 != NULL, "VirtualAllocEx error %d\n", GetLastError()); + ok(addr1 != NULL, "VirtualAllocEx error %ld\n", GetLastError());
/* without PROCESS_QUERY_INFORMATION */ SetLastError(0xdeadbeef); ok(!VirtualQueryEx(hproc, addr1, &info, sizeof(info)), "VirtualQueryEx without PROCESS_QUERY_INFORMATION rights should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError());
/* without PROCESS_VM_READ */ read_bytes = 0xdeadbeef; SetLastError(0xdeadbeef); ok(!ReadProcessMemory(hproc, addr1, &dummy, sizeof(dummy), &read_bytes), "ReadProcessMemory without PROCESS_VM_READ rights should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); - ok(read_bytes == 0, "wrong read bytes %ld\n", read_bytes); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError()); + ok(read_bytes == 0, "wrong read bytes %Id\n", read_bytes);
CloseHandle(hproc);
@@ -1778,23 +1778,23 @@ static void test_OpenProcess(void)
memset(&info, 0xcc, sizeof(info)); read_bytes = VirtualQueryEx(hproc, addr1, &info, sizeof(info)); - ok(read_bytes == sizeof(info), "VirtualQueryEx error %d\n", GetLastError()); + ok(read_bytes == sizeof(info), "VirtualQueryEx error %ld\n", GetLastError());
ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); - ok(info.RegionSize == 0x10000, "%lx != 0x10000\n", info.RegionSize); - ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); + ok(info.AllocationProtect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x10000, "%Ix != 0x10000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%lx != MEM_RESERVE\n", info.State); /* NT reports Protect == 0 for a not committed memory block */ ok(info.Protect == 0 /* NT */ || info.Protect == PAGE_NOACCESS, /* Win9x */ - "%x != PAGE_NOACCESS\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + "%lx != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
SetLastError(0xdeadbeef); ok(!VirtualFreeEx(hproc, addr1, 0, MEM_RELEASE), "VirtualFreeEx without PROCESS_VM_OPERATION rights should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError());
CloseHandle(hproc);
@@ -1806,22 +1806,22 @@ static void test_OpenProcess(void) read_bytes = VirtualQueryEx(hproc, addr1, &info, sizeof(info)); if (read_bytes) /* win8 */ { - ok(read_bytes == sizeof(info), "VirtualQueryEx error %d\n", GetLastError()); + ok(read_bytes == sizeof(info), "VirtualQueryEx error %ld\n", GetLastError()); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); - ok(info.RegionSize == 0x10000, "%lx != 0x10000\n", info.RegionSize); - ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); - ok(info.Protect == 0, "%x != PAGE_NOACCESS\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.AllocationProtect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x10000, "%Ix != 0x10000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%lx != MEM_RESERVE\n", info.State); + ok(info.Protect == 0, "%lx != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type); } else /* before win8 */ - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ok(!VirtualFreeEx(hproc, addr1, 0, MEM_RELEASE), "VirtualFreeEx without PROCESS_VM_OPERATION rights should fail\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError());
CloseHandle(hproc); } @@ -1838,11 +1838,11 @@ static void test_GetProcessVersion(void)
SetLastError(0xdeadbeef); ret = GetProcessVersion(0); - ok(ret, "GetProcessVersion error %u\n", GetLastError()); + ok(ret, "GetProcessVersion error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetProcessVersion(GetCurrentProcessId()); - ok(ret, "GetProcessVersion error %u\n", GetLastError()); + ok(ret, "GetProcessVersion error %lu\n", GetLastError());
memset(&si, 0, sizeof(si)); si.cb = sizeof(si); @@ -1850,15 +1850,15 @@ static void test_GetProcessVersion(void) si.wShowWindow = SW_HIDE; SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess error %u\n", GetLastError()); + ok(ret, "CreateProcess error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetProcessVersion(pi.dwProcessId); - ok(ret, "GetProcessVersion error %u\n", GetLastError()); + ok(ret, "GetProcessVersion error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = TerminateProcess(pi.hProcess, 0); - ok(ret, "TerminateProcess error %u\n", GetLastError()); + ok(ret, "TerminateProcess error %lu\n", GetLastError());
CloseHandle(pi.hProcess); CloseHandle(pi.hThread); @@ -1880,7 +1880,7 @@ static void test_GetProcessImageFileNameA(void) SetLastError(0xdeadbeef); rc = pK32GetProcessImageFileNameA(GetCurrentProcess(), NULL, 0); ok(!rc && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "K32GetProcessImageFileNameA(no buffer): returned %u, le=%u\n", rc, GetLastError()); + "K32GetProcessImageFileNameA(no buffer): returned %lu, le=%lu\n", rc, GetLastError());
*process = '\0'; rc = pK32GetProcessImageFileNameA(GetCurrentProcess(), process, sizeof(process)); @@ -1920,7 +1920,7 @@ static void test_QueryFullProcessImageNameA(void) *module = '\0'; SetLastError(0); /* old Windows don't reset it on success */ size = GetModuleFileNameA(NULL, module, sizeof(module)); - ok(size && GetLastError() != ERROR_INSUFFICIENT_BUFFER, "GetModuleFileName failed: %u le=%u\n", size, GetLastError()); + ok(size && GetLastError() != ERROR_INSUFFICIENT_BUFFER, "GetModuleFileName failed: %lu le=%lu\n", size, GetLastError());
/* get the buffer length without \0 terminator */ length = sizeof(buf); @@ -2059,9 +2059,9 @@ static void test_QueryFullProcessImageNameW(void) module_name[2] = '\0'; *device = '\0'; size = QueryDosDeviceW(module_name, device, ARRAY_SIZE(device)); - ok(size, "QueryDosDeviceW failed: le=%u\n", GetLastError()); + ok(size, "QueryDosDeviceW failed: le=%lu\n", GetLastError()); len = lstrlenW(device); - ok(size >= len+2, "expected %d to be greater than %d+2 = strlen(%s)\n", size, len, wine_dbgstr_w(device)); + ok(size >= len+2, "expected %ld to be greater than %ld+2 = strlen(%s)\n", size, len, wine_dbgstr_w(device));
if (size >= lstrlenW(buf)) { @@ -2089,25 +2089,25 @@ static void test_Handles(void) handle == (HANDLE)(ULONG_PTR)0x7fffffff /* win9x */, "invalid current process handle %p\n", handle ); ret = GetExitCodeProcess( handle, &code ); - ok( ret, "GetExitCodeProcess failed err %u\n", GetLastError() ); + ok( ret, "GetExitCodeProcess failed err %lu\n", GetLastError() ); #ifdef _WIN64 /* truncated handle */ SetLastError( 0xdeadbeef ); handle = (HANDLE)((ULONG_PTR)handle & ~0u); ret = GetExitCodeProcess( handle, &code ); ok( !ret, "GetExitCodeProcess succeeded for %p\n", handle ); - ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError() ); /* sign-extended handle */ SetLastError( 0xdeadbeef ); handle = (HANDLE)((LONG_PTR)(int)(ULONG_PTR)handle); ret = GetExitCodeProcess( handle, &code ); - ok( ret, "GetExitCodeProcess failed err %u\n", GetLastError() ); + ok( ret, "GetExitCodeProcess failed err %lu\n", GetLastError() ); /* invalid high-word */ SetLastError( 0xdeadbeef ); handle = (HANDLE)(((ULONG_PTR)handle & ~0u) + ((ULONG_PTR)1 << 32)); ret = GetExitCodeProcess( handle, &code ); ok( !ret, "GetExitCodeProcess succeeded for %p\n", handle ); - ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError() ); #endif
handle = GetStdHandle( STD_ERROR_HANDLE ); @@ -2215,7 +2215,7 @@ static void test_IsWow64Process2(void) SetLastError(0xdeadbeef); machine = native_machine = 0xdead; ret = pIsWow64Process2(pi.hProcess, &machine, &native_machine); - ok(ret, "IsWow64Process2 error %u\n", GetLastError()); + ok(ret, "IsWow64Process2 error %lu\n", GetLastError());
#if defined(__i386__) || defined(__x86_64__) ok(machine == IMAGE_FILE_MACHINE_I386, "got %#x\n", machine); @@ -2236,16 +2236,16 @@ static void test_IsWow64Process2(void) si.cb = sizeof(si); SetLastError(0xdeadbeef); ret = CreateProcessA(cmdline, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess error %u\n", GetLastError()); + ok(ret, "CreateProcess error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pIsWow64Process(pi.hProcess, &is_wow64); - ok(ret, "IsWow64Process error %u\n", GetLastError()); + ok(ret, "IsWow64Process error %lu\n", GetLastError());
SetLastError(0xdeadbeef); machine = native_machine = 0xdead; ret = pIsWow64Process2(pi.hProcess, &machine, &native_machine); - ok(ret, "IsWow64Process2 error %u\n", GetLastError()); + ok(ret, "IsWow64Process2 error %lu\n", GetLastError());
ok(machine == IMAGE_FILE_MACHINE_UNKNOWN, "got %#x\n", machine); ok(native_machine == expect_native, "got %#x\n", native_machine); @@ -2253,7 +2253,7 @@ static void test_IsWow64Process2(void) SetLastError(0xdeadbeef); machine = 0xdead; ret = pIsWow64Process2(pi.hProcess, &machine, NULL); - ok(ret, "IsWow64Process2 error %u\n", GetLastError()); + ok(ret, "IsWow64Process2 error %lu\n", GetLastError()); ok(machine == IMAGE_FILE_MACHINE_UNKNOWN, "got %#x\n", machine);
ret = TerminateProcess(pi.hProcess, 0); @@ -2264,12 +2264,12 @@ static void test_IsWow64Process2(void)
SetLastError(0xdeadbeef); ret = pIsWow64Process(GetCurrentProcess(), &is_wow64); - ok(ret, "IsWow64Process error %u\n", GetLastError()); + ok(ret, "IsWow64Process error %lu\n", GetLastError());
SetLastError(0xdeadbeef); machine = native_machine = 0xdead; ret = pIsWow64Process2(GetCurrentProcess(), &machine, &native_machine); - ok(ret, "IsWow64Process2 error %u\n", GetLastError()); + ok(ret, "IsWow64Process2 error %lu\n", GetLastError());
if (is_wow64) { @@ -2285,7 +2285,7 @@ static void test_IsWow64Process2(void) SetLastError(0xdeadbeef); machine = 0xdead; ret = pIsWow64Process2(GetCurrentProcess(), &machine, NULL); - ok(ret, "IsWow64Process2 error %u\n", GetLastError()); + ok(ret, "IsWow64Process2 error %lu\n", GetLastError()); if (is_wow64) ok(machine == IMAGE_FILE_MACHINE_I386, "got %#x\n", machine); else @@ -2315,7 +2315,7 @@ static void test_SystemInfo(void) "Expected PROCESSOR_ARCHITECTURE_AMD64, got %d\n", S(U(nsi)).wProcessorArchitecture); ok(nsi.dwProcessorType == PROCESSOR_AMD_X8664, - "Expected PROCESSOR_AMD_X8664, got %d\n", + "Expected PROCESSOR_AMD_X8664, got %ld\n", nsi.dwProcessorType); } } @@ -2325,7 +2325,7 @@ static void test_SystemInfo(void) "Expected no difference for wProcessorArchitecture, got %d and %d\n", S(U(si)).wProcessorArchitecture, S(U(nsi)).wProcessorArchitecture); ok(si.dwProcessorType == nsi.dwProcessorType, - "Expected no difference for dwProcessorType, got %d and %d\n", + "Expected no difference for dwProcessorType, got %ld and %ld\n", si.dwProcessorType, nsi.dwProcessorType); } } @@ -2343,7 +2343,7 @@ static void test_ProcessorCount(void) active = pGetActiveProcessorCount(ALL_PROCESSOR_GROUPS); maximum = pGetMaximumProcessorCount(ALL_PROCESSOR_GROUPS); ok(active <= maximum, - "Number of active processors %i is greater than maximum number of processors %i\n", + "Number of active processors %li is greater than maximum number of processors %li\n", active, maximum); }
@@ -2387,26 +2387,26 @@ static void test_TerminateProcess(void) si.cb = sizeof(si); SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess error %u\n", GetLastError()); + ok(ret, "CreateProcess error %lu\n", GetLastError());
SetLastError(0xdeadbeef); thread = CreateRemoteThread(pi.hProcess, NULL, 0, (void *)0xdeadbeef, NULL, CREATE_SUSPENDED, &ret); - ok(thread != 0, "CreateRemoteThread error %d\n", GetLastError()); + ok(thread != 0, "CreateRemoteThread error %ld\n", GetLastError());
/* create a not closed thread handle duplicate in the target process */ SetLastError(0xdeadbeef); ret = DuplicateHandle(GetCurrentProcess(), thread, pi.hProcess, &dummy, 0, FALSE, DUPLICATE_SAME_ACCESS); - ok(ret, "DuplicateHandle error %u\n", GetLastError()); + ok(ret, "DuplicateHandle error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = TerminateThread(thread, 0); - ok(ret, "TerminateThread error %u\n", GetLastError()); + ok(ret, "TerminateThread error %lu\n", GetLastError()); CloseHandle(thread);
SetLastError(0xdeadbeef); ret = TerminateProcess(pi.hProcess, 0); - ok(ret, "TerminateProcess error %u\n", GetLastError()); + ok(ret, "TerminateProcess error %lu\n", GetLastError());
CloseHandle(pi.hProcess); CloseHandle(pi.hThread); @@ -2422,20 +2422,20 @@ static void test_DuplicateHandle(void) r = DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &out, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); r = GetHandleInformation(out, &info); - ok(r, "GetHandleInformation error %u\n", GetLastError()); - ok(info == 0, "info = %x\n", info); + ok(r, "GetHandleInformation error %lu\n", GetLastError()); + ok(info == 0, "info = %lx\n", info); ok(out != GetCurrentProcess(), "out = GetCurrentProcess()\n"); CloseHandle(out);
r = DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &out, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); r = GetHandleInformation(out, &info); - ok(r, "GetHandleInformation error %u\n", GetLastError()); - ok(info == HANDLE_FLAG_INHERIT, "info = %x\n", info); + ok(r, "GetHandleInformation error %lu\n", GetLastError()); + ok(info == HANDLE_FLAG_INHERIT, "info = %lx\n", info); ok(out != GetCurrentProcess(), "out = GetCurrentProcess()\n"); CloseHandle(out);
@@ -2450,31 +2450,31 @@ static void test_DuplicateHandle(void)
r = DuplicateHandle(GetCurrentProcess(), f, GetCurrentProcess(), &out, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); ok(f == out, "f != out\n"); r = GetHandleInformation(out, &info); - ok(r, "GetHandleInformation error %u\n", GetLastError()); - ok(info == 0, "info = %x\n", info); + ok(r, "GetHandleInformation error %lu\n", GetLastError()); + ok(info == 0, "info = %lx\n", info);
r = DuplicateHandle(GetCurrentProcess(), f, GetCurrentProcess(), &out, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); ok(f == out, "f != out\n"); r = GetHandleInformation(out, &info); - ok(r, "GetHandleInformation error %u\n", GetLastError()); - ok(info == HANDLE_FLAG_INHERIT, "info = %x\n", info); + ok(r, "GetHandleInformation error %lu\n", GetLastError()); + ok(info == HANDLE_FLAG_INHERIT, "info = %lx\n", info);
r = SetHandleInformation(f, HANDLE_FLAG_PROTECT_FROM_CLOSE, HANDLE_FLAG_PROTECT_FROM_CLOSE); - ok(r, "SetHandleInformation error %u\n", GetLastError()); + ok(r, "SetHandleInformation error %lu\n", GetLastError()); r = DuplicateHandle(GetCurrentProcess(), f, GetCurrentProcess(), &out, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); ok(f != out, "f == out\n"); r = GetHandleInformation(out, &info); - ok(r, "GetHandleInformation error %u\n", GetLastError()); - ok(info == HANDLE_FLAG_INHERIT, "info = %x\n", info); + ok(r, "GetHandleInformation error %lu\n", GetLastError()); + ok(info == HANDLE_FLAG_INHERIT, "info = %lx\n", info); r = SetHandleInformation(f, HANDLE_FLAG_PROTECT_FROM_CLOSE, 0); - ok(r, "SetHandleInformation error %u\n", GetLastError()); + ok(r, "SetHandleInformation error %lu\n", GetLastError());
/* Test if DuplicateHandle allocates first free handle */ if (f > out) @@ -2489,7 +2489,7 @@ static void test_DuplicateHandle(void) CloseHandle(fmin); r = DuplicateHandle(GetCurrentProcess(), f, GetCurrentProcess(), &out, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); ok(f == out, "f != out\n"); CloseHandle(out); DeleteFileA(file_name); @@ -2504,7 +2504,7 @@ static void test_DuplicateHandle(void)
r = DuplicateHandle(GetCurrentProcess(), f, GetCurrentProcess(), &out, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); - ok(r, "DuplicateHandle error %u\n", GetLastError()); + ok(r, "DuplicateHandle error %lu\n", GetLastError()); todo_wine ok(f != out, "f == out\n"); CloseHandle(out); } @@ -2519,10 +2519,10 @@ static void _test_completion(int line, HANDLE port, DWORD ekey, ULONG_PTR evalue
ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, wait);
- ok_(__FILE__, line)(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); + ok_(__FILE__, line)(ret, "GetQueuedCompletionStatus: %lx\n", GetLastError()); if (ret) { - ok_(__FILE__, line)(key == ekey, "unexpected key %x\n", key); + ok_(__FILE__, line)(key == ekey, "unexpected key %lx\n", key); ok_(__FILE__, line)(value == evalue, "unexpected value %p\n", (void *)value); ok_(__FILE__, line)(overlapped == (LPOVERLAPPED)eoverlapped, "unexpected overlapped %p\n", overlapped); } @@ -2538,7 +2538,7 @@ static void _create_process(int line, const char *command, LPPROCESS_INFORMATION sprintf(buffer, ""%s" process %s", selfname, command);
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, pi); - ok_(__FILE__, line)(ret, "CreateProcess error %u\n", GetLastError()); + ok_(__FILE__, line)(ret, "CreateProcess error %lu\n", GetLastError()); }
@@ -2555,39 +2555,39 @@ static void test_IsProcessInJob(void) }
job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
job2 = pCreateJobObjectW(NULL, NULL); - ok(job2 != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job2 != NULL, "CreateJobObject error %lu\n", GetLastError());
create_process("wait", &pi);
out = TRUE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
out = TRUE; ret = pIsProcessInJob(pi.hProcess, job2, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
out = TRUE; ret = pIsProcessInJob(pi.hProcess, job2, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
out = FALSE; ret = pIsProcessInJob(pi.hProcess, NULL, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); @@ -2595,7 +2595,7 @@ static void test_IsProcessInJob(void)
out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
CloseHandle(pi.hProcess); @@ -2612,25 +2612,25 @@ static void test_TerminateJobObject(void) DWORD dwret;
job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
ret = pTerminateJobObject(job, 123); - ok(ret, "TerminateJobObject error %u\n", GetLastError()); + ok(ret, "TerminateJobObject error %lu\n", GetLastError());
/* not wait_child_process() because of the exit code */ dwret = WaitForSingleObject(pi.hProcess, 1000); - ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", dwret); if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0);
ret = GetExitCodeProcess(pi.hProcess, &dwret); - ok(ret, "GetExitCodeProcess error %u\n", GetLastError()); + ok(ret, "GetExitCodeProcess error %lu\n", GetLastError()); ok(dwret == 123 || broken(dwret == 0) /* randomly fails on Win 2000 / XP */, - "wrong exitcode %u\n", dwret); + "wrong exitcode %lu\n", dwret);
CloseHandle(pi.hProcess); CloseHandle(pi.hThread); @@ -2664,27 +2664,27 @@ static void test_QueryInformationJobObject(void) BOOL ret;
job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
/* Only active processes are returned */ - sprintf(buffer, "sync kernel32-process-%x", GetCurrentProcessId()); + sprintf(buffer, "sync kernel32-process-%lx", GetCurrentProcessId()); sem = CreateSemaphoreA(NULL, 0, 1, buffer + 5); - ok(sem != NULL, "CreateSemaphoreA failed le=%u\n", GetLastError()); + ok(sem != NULL, "CreateSemaphoreA failed le=%lu\n", GetLastError()); create_process(buffer, &pi[0]);
ret = pAssignProcessToJobObject(job, pi[0].hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
ReleaseSemaphore(sem, 1, NULL); wait_and_close_child_process(&pi[0]);
create_process("wait", &pi[0]); ret = pAssignProcessToJobObject(job, pi[0].hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
create_process("wait", &pi[1]); ret = pAssignProcessToJobObject(job, pi[1].hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = QueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list, @@ -2708,7 +2708,7 @@ static void test_QueryInformationJobObject(void)
memset(buf, 0, sizeof(buf)); ret = pQueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list, sizeof(buf), &ret_len); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); if(ret) { if (pid_list->NumberOfAssignedProcesses == 3) /* Win 8 */ @@ -2718,7 +2718,7 @@ static void test_QueryInformationJobObject(void) ULONG_PTR *list = pid_list->ProcessIdList;
ok(ret_len == FIELD_OFFSET(JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList[2]), - "QueryInformationJobObject returned ret_len=%u\n", ret_len); + "QueryInformationJobObject returned ret_len=%lu\n", ret_len);
expect_eq_d(2, pid_list->NumberOfAssignedProcesses); expect_eq_d(2, pid_list->NumberOfProcessIdsInList); @@ -2737,8 +2737,8 @@ static void test_QueryInformationJobObject(void) memset(basic_limit_info, 0x11, sizeof(*basic_limit_info)); ret = pQueryInformationJobObject(job, JobObjectBasicLimitInformation, basic_limit_info, sizeof(*basic_limit_info), &ret_len); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(ret_len == sizeof(*basic_limit_info), "QueryInformationJobObject returned ret_len=%u\n", ret_len); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(ret_len == sizeof(*basic_limit_info), "QueryInformationJobObject returned ret_len=%lu\n", ret_len); expect_eq_d(0, basic_limit_info->LimitFlags);
/* test JobObjectExtendedLimitInformation */ @@ -2751,15 +2751,15 @@ static void test_QueryInformationJobObject(void) memset(&ext_limit_info, 0x11, sizeof(ext_limit_info)); ret = pQueryInformationJobObject(job, JobObjectExtendedLimitInformation, &ext_limit_info, sizeof(ext_limit_info), &ret_len); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(ret_len == sizeof(ext_limit_info), "QueryInformationJobObject returned ret_len=%u\n", ret_len); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(ret_len == sizeof(ext_limit_info), "QueryInformationJobObject returned ret_len=%lu\n", ret_len); expect_eq_d(0, basic_limit_info->LimitFlags);
/* test JobObjectBasicAccountingInformation */ ret = pQueryInformationJobObject(job, JobObjectBasicAccountingInformation, &basic_accounting_info, sizeof(basic_accounting_info), &ret_len); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(ret_len == sizeof(basic_accounting_info), "QueryInformationJobObject returned ret_len=%u\n", ret_len); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(ret_len == sizeof(basic_accounting_info), "QueryInformationJobObject returned ret_len=%lu\n", ret_len); expect_eq_d(3, basic_accounting_info.TotalProcesses); expect_eq_d(2, basic_accounting_info.ActiveProcesses);
@@ -2782,24 +2782,24 @@ static void test_CompletionPort(void) BOOL ret;
job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
create_process("wait", &pi2); ret = pAssignProcessToJobObject(job, pi2.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
port = pCreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1); - ok(port != NULL, "CreateIoCompletionPort error %u\n", GetLastError()); + ok(port != NULL, "CreateIoCompletionPort error %lu\n", GetLastError());
port_info.CompletionKey = job; port_info.CompletionPort = port; ret = pSetInformationJobObject(job, JobObjectAssociateCompletionPortInformation, &port_info, sizeof(port_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job, pi2.dwProcessId, 0); test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job, pi.dwProcessId, 0); @@ -2831,7 +2831,7 @@ static void test_KillOnJobClose(void) BOOL ret;
job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
limit_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; ret = pSetInformationJobObject(job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); @@ -2840,18 +2840,18 @@ static void test_KillOnJobClose(void) win_skip("Kill on job close limit not available\n"); return; } - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
CloseHandle(job);
/* not wait_child_process() for the kill */ dwret = WaitForSingleObject(pi.hProcess, 1000); - ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", dwret); if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0);
CloseHandle(pi.hProcess); @@ -2868,25 +2868,25 @@ static void test_WaitForJobObject(void)
/* test waiting for a job object when the process is killed */ job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
dwret = WaitForSingleObject(job, 100); - ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %lu\n", dwret);
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
dwret = WaitForSingleObject(job, 100); - ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %lu\n", dwret);
ret = pTerminateJobObject(job, 123); - ok(ret, "TerminateJobObject error %u\n", GetLastError()); + ok(ret, "TerminateJobObject error %lu\n", GetLastError());
dwret = WaitForSingleObject(job, 500); ok(dwret == WAIT_OBJECT_0 || broken(dwret == WAIT_TIMEOUT), - "WaitForSingleObject returned %u\n", dwret); + "WaitForSingleObject returned %lu\n", dwret);
if (dwret == WAIT_TIMEOUT) /* Win 2000/XP */ { @@ -2899,7 +2899,7 @@ static void test_WaitForJobObject(void)
/* the object is not reset immediately */ dwret = WaitForSingleObject(job, 100); - ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", dwret);
CloseHandle(pi.hProcess); CloseHandle(pi.hThread); @@ -2908,13 +2908,13 @@ static void test_WaitForJobObject(void) create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
dwret = WaitForSingleObject(job, 100); - ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", dwret);
ret = pTerminateJobObject(job, 123); - ok(ret, "TerminateJobObject error %u\n", GetLastError()); + ok(ret, "TerminateJobObject error %lu\n", GetLastError());
CloseHandle(pi.hProcess); CloseHandle(pi.hThread); @@ -2923,22 +2923,22 @@ static void test_WaitForJobObject(void)
/* repeat the test, but this time the process terminates properly */ job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
dwret = WaitForSingleObject(job, 100); - ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %lu\n", dwret);
- sprintf(buffer, "sync kernel32-process-%x", GetCurrentProcessId()); + sprintf(buffer, "sync kernel32-process-%lx", GetCurrentProcessId()); sem = CreateSemaphoreA(NULL, 0, 1, buffer + 5); - ok(sem != NULL, "CreateSemaphoreA failed le=%u\n", GetLastError()); + ok(sem != NULL, "CreateSemaphoreA failed le=%lu\n", GetLastError()); create_process(buffer, &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError()); ReleaseSemaphore(sem, 1, NULL);
dwret = WaitForSingleObject(job, 100); - ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %lu\n", dwret);
wait_and_close_child_process(&pi); CloseHandle(job); @@ -2951,10 +2951,10 @@ static HANDLE test_AddSelfToJob(void) BOOL ret;
job = pCreateJobObjectW(NULL, NULL); - ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
ret = pAssignProcessToJobObject(job, GetCurrentProcess()); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
return job; } @@ -2974,7 +2974,7 @@ static void test_jobInheritance(HANDLE job)
out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
wait_and_close_child_process(&pi); @@ -2996,11 +2996,11 @@ static void test_BreakawayOk(HANDLE parent_job) }
job = pCreateJobObjectW(NULL, NULL); - ok(!!job, "CreateJobObjectW error %u\n", GetLastError()); + ok(!!job, "CreateJobObjectW error %lu\n", GetLastError());
ret = pAssignProcessToJobObject(job, GetCurrentProcess()); ok(ret || broken(!ret && GetLastError() == ERROR_ACCESS_DENIED) /* before Win 8. */, - "AssignProcessToJobObject error %u\n", GetLastError()); + "AssignProcessToJobObject error %lu\n", GetLastError()); nested_jobs = ret; if (!ret) win_skip("Nested jobs are not supported.\n"); @@ -3020,18 +3020,18 @@ static void test_BreakawayOk(HANDLE parent_job) { limit_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_BREAKAWAY_OK; ret = pSetInformationJobObject(job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
sprintf(buffer, ""%s" process exit", selfname); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, &si, &pi); - ok(ret, "CreateProcessA error %u\n", GetLastError()); + ok(ret, "CreateProcessA error %lu\n", GetLastError());
ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); @@ -3040,30 +3040,30 @@ static void test_BreakawayOk(HANDLE parent_job)
limit_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_BREAKAWAY_OK; ret = pSetInformationJobObject(parent_job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, &si, &pi); - ok(ret, "CreateProcessA error %u\n", GetLastError()); + ok(ret, "CreateProcessA error %lu\n", GetLastError());
ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
wait_and_close_child_process(&pi);
limit_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK; ret = pSetInformationJobObject(job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess error %u\n", GetLastError()); + ok(ret, "CreateProcess error %lu\n", GetLastError());
ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
wait_and_close_child_process(&pi); @@ -3071,7 +3071,7 @@ static void test_BreakawayOk(HANDLE parent_job) /* unset breakaway ok */ limit_info.BasicLimitInformation.LimitFlags = 0; ret = pSetInformationJobObject(job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError()); }
static void test_StartupNoConsole(void) @@ -3202,7 +3202,7 @@ static BOOL are_imports_resolved(HANDLE process_handle, PVOID module_base, IMAGE ret = ReadProcessMemory(process_handle, (char *)module_base + nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress, &iid, sizeof(iid), NULL); - ok(ret, "Failed to read remote module IID (%d)\n", GetLastError()); + ok(ret, "Failed to read remote module IID (%ld)\n", GetLastError());
/* Validate the IID is present and not a bound import, and that we have an OriginalFirstThunk to compare with */ @@ -3214,13 +3214,13 @@ static BOOL are_imports_resolved(HANDLE process_handle, PVOID module_base, IMAGE /* Read a single IAT entry from the FirstThunk */ ret = ReadProcessMemory(process_handle, (char *)module_base + iid.FirstThunk, &iat_entry_value, sizeof(iat_entry_value), NULL); - ok(ret, "Failed to read IAT entry from FirstThunk (%d)\n", GetLastError()); + ok(ret, "Failed to read IAT entry from FirstThunk (%ld)\n", GetLastError()); ok(iat_entry_value, "IAT entry in FirstThunk is NULL\n");
/* Read a single IAT entry from the OriginalFirstThunk */ ret = ReadProcessMemory(process_handle, (char *)module_base + iid.OriginalFirstThunk, &orig_iat_entry_value, sizeof(orig_iat_entry_value), NULL); - ok(ret, "Failed to read IAT entry from OriginalFirstThunk (%d)\n", GetLastError()); + ok(ret, "Failed to read IAT entry from OriginalFirstThunk (%ld)\n", GetLastError()); ok(orig_iat_entry_value, "IAT entry in OriginalFirstThunk is NULL\n");
return iat_entry_value != orig_iat_entry_value; @@ -3242,7 +3242,7 @@ static void test_SuspendProcessNewThread(void)
si.cb = sizeof(si); ret = CreateProcessA(NULL, selfname, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - ok(ret, "Failed to create process (%d)\n", GetLastError()); + ok(ret, "Failed to create process (%ld)\n", GetLastError());
exe_base = get_process_exe(pi.hProcess, &nt_header); ok(exe_base != NULL, "Could not find EXE in remote process\n"); @@ -3253,58 +3253,58 @@ static void test_SuspendProcessNewThread(void) thread_handle = CreateRemoteThread(pi.hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)exit_thread_ptr, (PVOID)(ULONG_PTR)0x1234, CREATE_SUSPENDED, NULL); - ok(thread_handle != NULL, "Could not create remote thread (%d)\n", GetLastError()); + ok(thread_handle != NULL, "Could not create remote thread (%ld)\n", GetLastError());
ret = are_imports_resolved(pi.hProcess, exe_base, &nt_header); ok(!ret, "IAT entry resolved prematurely\n");
ctx.ContextFlags = CONTEXT_ALL; ret = GetThreadContext( thread_handle, &ctx ); - ok( ret, "Failed retrieving remote thread context (%d)\n", GetLastError() ); - ok( ctx.ContextFlags == CONTEXT_ALL, "wrong flags %x\n", ctx.ContextFlags ); + ok( ret, "Failed retrieving remote thread context (%ld)\n", GetLastError() ); + ok( ctx.ContextFlags == CONTEXT_ALL, "wrong flags %lx\n", ctx.ContextFlags ); #ifdef __x86_64__ - ok( !ctx.Rax, "rax is not zero %lx\n", ctx.Rax ); - ok( !ctx.Rbx, "rbx is not zero %lx\n", ctx.Rbx ); - ok( ctx.Rcx == (ULONG_PTR)exit_thread_ptr, "wrong rcx %lx/%p\n", ctx.Rcx, exit_thread_ptr ); - ok( ctx.Rdx == 0x1234, "wrong rdx %lx\n", ctx.Rdx ); - ok( !ctx.Rsi, "rsi is not zero %lx\n", ctx.Rsi ); - ok( !ctx.Rdi, "rdi is not zero %lx\n", ctx.Rdi ); - ok( !ctx.Rbp, "rbp is not zero %lx\n", ctx.Rbp ); - ok( !ctx.R8, "r8 is not zero %lx\n", ctx.R8 ); - ok( !ctx.R9, "r9 is not zero %lx\n", ctx.R9 ); - ok( !ctx.R10, "r10 is not zero %lx\n", ctx.R10 ); - ok( !ctx.R11, "r11 is not zero %lx\n", ctx.R11 ); - ok( !ctx.R12, "r12 is not zero %lx\n", ctx.R12 ); - ok( !ctx.R13, "r13 is not zero %lx\n", ctx.R13 ); - ok( !ctx.R14, "r14 is not zero %lx\n", ctx.R14 ); - ok( !ctx.R15, "r15 is not zero %lx\n", ctx.R15 ); - ok( !((ctx.Rsp + 0x28) & 0xfff), "rsp is not at top of stack page %lx\n", ctx.Rsp ); - ok( ctx.EFlags == 0x200, "wrong flags %08x\n", ctx.EFlags ); - ok( ctx.MxCsr == 0x1f80, "wrong mxcsr %08x\n", ctx.MxCsr ); + ok( !ctx.Rax, "rax is not zero %Ix\n", ctx.Rax ); + ok( !ctx.Rbx, "rbx is not zero %Ix\n", ctx.Rbx ); + ok( ctx.Rcx == (ULONG_PTR)exit_thread_ptr, "wrong rcx %Ix/%p\n", ctx.Rcx, exit_thread_ptr ); + ok( ctx.Rdx == 0x1234, "wrong rdx %Ix\n", ctx.Rdx ); + ok( !ctx.Rsi, "rsi is not zero %Ix\n", ctx.Rsi ); + ok( !ctx.Rdi, "rdi is not zero %Ix\n", ctx.Rdi ); + ok( !ctx.Rbp, "rbp is not zero %Ix\n", ctx.Rbp ); + ok( !ctx.R8, "r8 is not zero %Ix\n", ctx.R8 ); + ok( !ctx.R9, "r9 is not zero %Ix\n", ctx.R9 ); + ok( !ctx.R10, "r10 is not zero %Ix\n", ctx.R10 ); + ok( !ctx.R11, "r11 is not zero %Ix\n", ctx.R11 ); + ok( !ctx.R12, "r12 is not zero %Ix\n", ctx.R12 ); + ok( !ctx.R13, "r13 is not zero %Ix\n", ctx.R13 ); + ok( !ctx.R14, "r14 is not zero %Ix\n", ctx.R14 ); + ok( !ctx.R15, "r15 is not zero %Ix\n", ctx.R15 ); + ok( !((ctx.Rsp + 0x28) & 0xfff), "rsp is not at top of stack page %Ix\n", ctx.Rsp ); + ok( ctx.EFlags == 0x200, "wrong flags %08lx\n", ctx.EFlags ); + ok( ctx.MxCsr == 0x1f80, "wrong mxcsr %08lx\n", ctx.MxCsr ); ok( ctx.FltSave.ControlWord == 0x27f, "wrong control %08x\n", ctx.FltSave.ControlWord ); #else - ok( !ctx.Ebp || broken(ctx.Ebp), /* winxp */ "ebp is not zero %08x\n", ctx.Ebp ); + ok( !ctx.Ebp || broken(ctx.Ebp), /* winxp */ "ebp is not zero %08lx\n", ctx.Ebp ); if (!ctx.Ebp) /* winxp is completely different */ { - ok( !ctx.Ecx, "ecx is not zero %08x\n", ctx.Ecx ); - ok( !ctx.Edx, "edx is not zero %08x\n", ctx.Edx ); - ok( !ctx.Esi, "esi is not zero %08x\n", ctx.Esi ); - ok( !ctx.Edi, "edi is not zero %08x\n", ctx.Edi ); + ok( !ctx.Ecx, "ecx is not zero %08lx\n", ctx.Ecx ); + ok( !ctx.Edx, "edx is not zero %08lx\n", ctx.Edx ); + ok( !ctx.Esi, "esi is not zero %08lx\n", ctx.Esi ); + ok( !ctx.Edi, "edi is not zero %08lx\n", ctx.Edi ); } - ok( ctx.Eax == (ULONG_PTR)exit_thread_ptr, "wrong eax %08x/%p\n", ctx.Eax, exit_thread_ptr ); - ok( ctx.Ebx == 0x1234, "wrong ebx %08x\n", ctx.Ebx ); + ok( ctx.Eax == (ULONG_PTR)exit_thread_ptr, "wrong eax %08lx/%p\n", ctx.Eax, exit_thread_ptr ); + ok( ctx.Ebx == 0x1234, "wrong ebx %08lx\n", ctx.Ebx ); ok( !((ctx.Esp + 0x10) & 0xfff) || broken( !((ctx.Esp + 4) & 0xfff) ), /* winxp, w2k3 */ - "esp is not at top of stack page or properly aligned: %08x\n", ctx.Esp ); - ok( (ctx.EFlags & ~2) == 0x200, "wrong flags %08x\n", ctx.EFlags ); - ok( (WORD)ctx.FloatSave.ControlWord == 0x27f, "wrong control %08x\n", ctx.FloatSave.ControlWord ); + "esp is not at top of stack page or properly aligned: %08lx\n", ctx.Esp ); + ok( (ctx.EFlags & ~2) == 0x200, "wrong flags %08lx\n", ctx.EFlags ); + ok( (WORD)ctx.FloatSave.ControlWord == 0x27f, "wrong control %08lx\n", ctx.FloatSave.ControlWord ); ok( *(WORD *)ctx.ExtendedRegisters == 0x27f, "wrong control %08x\n", *(WORD *)ctx.ExtendedRegisters ); #endif
ResumeThread( thread_handle ); dret = WaitForSingleObject(thread_handle, 60000); - ok(dret == WAIT_OBJECT_0, "Waiting for remote thread failed (%d)\n", GetLastError()); + ok(dret == WAIT_OBJECT_0, "Waiting for remote thread failed (%ld)\n", GetLastError()); ret = GetExitCodeThread(thread_handle, &exit_code); - ok(ret, "Failed to retrieve remote thread exit code (%d)\n", GetLastError()); + ok(ret, "Failed to retrieve remote thread exit code (%ld)\n", GetLastError()); ok(exit_code == 0x1234, "Invalid remote thread exit code\n");
ret = are_imports_resolved(pi.hProcess, exe_base, &nt_header); @@ -3383,7 +3383,7 @@ static void test_SuspendProcessState(void)
si.cb = sizeof(si); ret = CreateProcessA(NULL, selfname, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - ok(ret, "Failed to create process (%d)\n", GetLastError()); + ok(ret, "Failed to create process (%ld)\n", GetLastError());
exe_base = get_process_exe(pi.hProcess, &nt_header); /* Make sure we found the EXE in the new process */ @@ -3395,16 +3395,16 @@ static void test_SuspendProcessState(void) server_pipe_handle = CreateNamedPipeA(pipe_name, PIPE_ACCESS_DUPLEX | FILE_FLAG_WRITE_THROUGH, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, 1, 0x20000, 0x20000, 0, NULL); - ok(server_pipe_handle != INVALID_HANDLE_VALUE, "Failed to create communication pipe (%d)\n", GetLastError()); + ok(server_pipe_handle != INVALID_HANDLE_VALUE, "Failed to create communication pipe (%ld)\n", GetLastError());
/* Set up the remote process environment */ ctx.ContextFlags = CONTEXT_ALL; ret = GetThreadContext(pi.hThread, &ctx); - ok(ret, "Failed retrieving remote thread context (%d)\n", GetLastError()); - ok( ctx.ContextFlags == CONTEXT_ALL, "wrong flags %x\n", ctx.ContextFlags ); + ok(ret, "Failed retrieving remote thread context (%ld)\n", GetLastError()); + ok( ctx.ContextFlags == CONTEXT_ALL, "wrong flags %lx\n", ctx.ContextFlags );
remote_pipe_params = VirtualAllocEx(pi.hProcess, NULL, sizeof(pipe_params), MEM_COMMIT, PAGE_READWRITE); - ok(remote_pipe_params != NULL, "Failed allocating memory in remote process (%d)\n", GetLastError()); + ok(remote_pipe_params != NULL, "Failed allocating memory in remote process (%ld)\n", GetLastError());
pipe_params.pipe_write_buf = pipe_write_magic; pipe_params.pipe_read_buf = 0; @@ -3413,25 +3413,25 @@ static void test_SuspendProcessState(void)
ret = WriteProcessMemory(pi.hProcess, remote_pipe_params, &pipe_params, sizeof(pipe_params), NULL); - ok(ret, "Failed to write to remote process memory (%d)\n", GetLastError()); + ok(ret, "Failed to write to remote process memory (%ld)\n", GetLastError());
#ifdef __x86_64__ - ok( !ctx.Rax, "rax is not zero %lx\n", ctx.Rax ); - ok( !ctx.Rbx, "rbx is not zero %lx\n", ctx.Rbx ); - ok( !ctx.Rsi, "rsi is not zero %lx\n", ctx.Rsi ); - ok( !ctx.Rdi, "rdi is not zero %lx\n", ctx.Rdi ); - ok( !ctx.Rbp, "rbp is not zero %lx\n", ctx.Rbp ); - ok( !ctx.R8, "r8 is not zero %lx\n", ctx.R8 ); - ok( !ctx.R9, "r9 is not zero %lx\n", ctx.R9 ); - ok( !ctx.R10, "r10 is not zero %lx\n", ctx.R10 ); - ok( !ctx.R11, "r11 is not zero %lx\n", ctx.R11 ); - ok( !ctx.R12, "r12 is not zero %lx\n", ctx.R12 ); - ok( !ctx.R13, "r13 is not zero %lx\n", ctx.R13 ); - ok( !ctx.R14, "r14 is not zero %lx\n", ctx.R14 ); - ok( !ctx.R15, "r15 is not zero %lx\n", ctx.R15 ); - ok( !((ctx.Rsp + 0x28) & 0xfff), "rsp is not at top of stack page %lx\n", ctx.Rsp ); - ok( ctx.EFlags == 0x200, "wrong flags %08x\n", ctx.EFlags ); - ok( ctx.MxCsr == 0x1f80, "wrong mxcsr %08x\n", ctx.MxCsr ); + ok( !ctx.Rax, "rax is not zero %Ix\n", ctx.Rax ); + ok( !ctx.Rbx, "rbx is not zero %Ix\n", ctx.Rbx ); + ok( !ctx.Rsi, "rsi is not zero %Ix\n", ctx.Rsi ); + ok( !ctx.Rdi, "rdi is not zero %Ix\n", ctx.Rdi ); + ok( !ctx.Rbp, "rbp is not zero %Ix\n", ctx.Rbp ); + ok( !ctx.R8, "r8 is not zero %Ix\n", ctx.R8 ); + ok( !ctx.R9, "r9 is not zero %Ix\n", ctx.R9 ); + ok( !ctx.R10, "r10 is not zero %Ix\n", ctx.R10 ); + ok( !ctx.R11, "r11 is not zero %Ix\n", ctx.R11 ); + ok( !ctx.R12, "r12 is not zero %Ix\n", ctx.R12 ); + ok( !ctx.R13, "r13 is not zero %Ix\n", ctx.R13 ); + ok( !ctx.R14, "r14 is not zero %Ix\n", ctx.R14 ); + ok( !ctx.R15, "r15 is not zero %Ix\n", ctx.R15 ); + ok( !((ctx.Rsp + 0x28) & 0xfff), "rsp is not at top of stack page %Ix\n", ctx.Rsp ); + ok( ctx.EFlags == 0x200, "wrong flags %08lx\n", ctx.EFlags ); + ok( ctx.MxCsr == 0x1f80, "wrong mxcsr %08lx\n", ctx.MxCsr ); ok( ctx.FltSave.ControlWord == 0x27f, "wrong control %08x\n", ctx.FltSave.ControlWord ); start_ptr = (void *)ctx.Rip; entry_ptr = (void *)ctx.Rcx; @@ -3449,20 +3449,20 @@ static void test_SuspendProcessState(void) ctx.Rip = (ULONG_PTR)call_named_pipe_a; ctx.Rsp -= sizeof(rop_chain); ret = WriteProcessMemory(pi.hProcess, (void *)ctx.Rsp, &rop_chain, sizeof(rop_chain), NULL); - ok(ret, "Failed to write to remote process thread stack (%d)\n", GetLastError()); + ok(ret, "Failed to write to remote process thread stack (%ld)\n", GetLastError()); #else - ok( !ctx.Ebp || broken(ctx.Ebp), /* winxp */ "ebp is not zero %08x\n", ctx.Ebp ); + ok( !ctx.Ebp || broken(ctx.Ebp), /* winxp */ "ebp is not zero %08lx\n", ctx.Ebp ); if (!ctx.Ebp) /* winxp is completely different */ { - ok( !ctx.Ecx, "ecx is not zero %08x\n", ctx.Ecx ); - ok( !ctx.Edx, "edx is not zero %08x\n", ctx.Edx ); - ok( !ctx.Esi, "esi is not zero %08x\n", ctx.Esi ); - ok( !ctx.Edi, "edi is not zero %08x\n", ctx.Edi ); + ok( !ctx.Ecx, "ecx is not zero %08lx\n", ctx.Ecx ); + ok( !ctx.Edx, "edx is not zero %08lx\n", ctx.Edx ); + ok( !ctx.Esi, "esi is not zero %08lx\n", ctx.Esi ); + ok( !ctx.Edi, "edi is not zero %08lx\n", ctx.Edi ); } ok( !((ctx.Esp + 0x10) & 0xfff) || broken( !((ctx.Esp + 4) & 0xfff) ), /* winxp, w2k3 */ - "esp is not at top of stack page or properly aligned: %08x\n", ctx.Esp ); - ok( (ctx.EFlags & ~2) == 0x200, "wrong flags %08x\n", ctx.EFlags ); - ok( (WORD)ctx.FloatSave.ControlWord == 0x27f, "wrong control %08x\n", ctx.FloatSave.ControlWord ); + "esp is not at top of stack page or properly aligned: %08lx\n", ctx.Esp ); + ok( (ctx.EFlags & ~2) == 0x200, "wrong flags %08lx\n", ctx.EFlags ); + ok( (WORD)ctx.FloatSave.ControlWord == 0x27f, "wrong control %08lx\n", ctx.FloatSave.ControlWord ); ok( *(WORD *)ctx.ExtendedRegisters == 0x27f, "wrong control %08x\n", *(WORD *)ctx.ExtendedRegisters ); start_ptr = (void *)ctx.Eip; entry_ptr = (void *)ctx.Eax; @@ -3481,11 +3481,11 @@ static void test_SuspendProcessState(void) ctx.Eip = (ULONG_PTR)call_named_pipe_a; ctx.Esp -= sizeof(rop_chain); ret = WriteProcessMemory(pi.hProcess, (void *)ctx.Esp, &rop_chain, sizeof(rop_chain), NULL); - ok(ret, "Failed to write to remote process thread stack (%d)\n", GetLastError()); + ok(ret, "Failed to write to remote process thread stack (%ld)\n", GetLastError()); #endif
ret = ReadProcessMemory( pi.hProcess, peb_ptr, &child_peb, sizeof(child_peb), NULL ); - ok( ret, "Failed to read PEB (%u)\n", GetLastError() ); + ok( ret, "Failed to read PEB (%lu)\n", GetLastError() ); ok( child_peb.ImageBaseAddress == exe_base, "wrong base %p/%p\n", child_peb.ImageBaseAddress, exe_base ); user_thread_start = GetProcAddress( GetModuleHandleA("ntdll.dll"), "RtlUserThreadStart" ); @@ -3504,19 +3504,19 @@ static void test_SuspendProcessState(void) ok( !child_peb.ProcessHeap, "ProcessHeap set %p\n", child_peb.ProcessHeap ); ok( !child_peb.CSDVersion.Buffer, "CSDVersion set %s\n", debugstr_w(child_peb.CSDVersion.Buffer) );
- ok( child_peb.OSMajorVersion == peb->OSMajorVersion, "OSMajorVersion not set %u\n", child_peb.OSMajorVersion ); - ok( child_peb.OSPlatformId == peb->OSPlatformId, "OSPlatformId not set %u\n", child_peb.OSPlatformId ); - ok( child_peb.SessionId == peb->SessionId, "SessionId not set %u\n", child_peb.SessionId ); + ok( child_peb.OSMajorVersion == peb->OSMajorVersion, "OSMajorVersion not set %lu\n", child_peb.OSMajorVersion ); + ok( child_peb.OSPlatformId == peb->OSPlatformId, "OSPlatformId not set %lu\n", child_peb.OSPlatformId ); + ok( child_peb.SessionId == peb->SessionId, "SessionId not set %lu\n", child_peb.SessionId ); ok( child_peb.CriticalSectionTimeout.QuadPart, "CriticalSectionTimeout not set %s\n", wine_dbgstr_longlong(child_peb.CriticalSectionTimeout.QuadPart) ); ok( child_peb.HeapSegmentReserve == peb->HeapSegmentReserve, - "HeapSegmentReserve not set %lu\n", child_peb.HeapSegmentReserve ); + "HeapSegmentReserve not set %Iu\n", child_peb.HeapSegmentReserve ); ok( child_peb.HeapSegmentCommit == peb->HeapSegmentCommit, - "HeapSegmentCommit not set %lu\n", child_peb.HeapSegmentCommit ); + "HeapSegmentCommit not set %Iu\n", child_peb.HeapSegmentCommit ); ok( child_peb.HeapDeCommitTotalFreeThreshold == peb->HeapDeCommitTotalFreeThreshold, - "HeapDeCommitTotalFreeThreshold not set %lu\n", child_peb.HeapDeCommitTotalFreeThreshold ); + "HeapDeCommitTotalFreeThreshold not set %Iu\n", child_peb.HeapDeCommitTotalFreeThreshold ); ok( child_peb.HeapDeCommitFreeBlockThreshold == peb->HeapDeCommitFreeBlockThreshold, - "HeapDeCommitFreeBlockThreshold not set %lu\n", child_peb.HeapDeCommitFreeBlockThreshold ); + "HeapDeCommitFreeBlockThreshold not set %Iu\n", child_peb.HeapDeCommitFreeBlockThreshold );
if (pNtQueryInformationThread) { @@ -3524,25 +3524,25 @@ static void test_SuspendProcessState(void) THREAD_BASIC_INFORMATION info; NTSTATUS status = pNtQueryInformationThread( pi.hThread, ThreadBasicInformation, &info, sizeof(info), NULL ); - ok( !status, "NtQueryInformationProcess failed %x\n", status ); + ok( !status, "NtQueryInformationProcess failed %lx\n", status ); ret = ReadProcessMemory( pi.hProcess, info.TebBaseAddress, &child_teb, sizeof(child_teb), NULL ); - ok( ret, "Failed to read TEB (%u)\n", GetLastError() ); + ok( ret, "Failed to read TEB (%lu)\n", GetLastError() );
ok( child_teb.Peb == peb_ptr, "wrong Peb %p / %p\n", child_teb.Peb, peb_ptr ); - ok( PtrToUlong(child_teb.ClientId.UniqueProcess) == pi.dwProcessId, "wrong pid %x / %x\n", + ok( PtrToUlong(child_teb.ClientId.UniqueProcess) == pi.dwProcessId, "wrong pid %lx / %lx\n", PtrToUlong(child_teb.ClientId.UniqueProcess), pi.dwProcessId ); - ok( PtrToUlong(child_teb.ClientId.UniqueThread) == pi.dwThreadId, "wrong tid %x / %x\n", + ok( PtrToUlong(child_teb.ClientId.UniqueThread) == pi.dwThreadId, "wrong tid %lx / %lx\n", PtrToUlong(child_teb.ClientId.UniqueThread), pi.dwThreadId ); - ok( PtrToUlong(child_teb.RealClientId.UniqueProcess) == pi.dwProcessId, "wrong real pid %x / %x\n", + ok( PtrToUlong(child_teb.RealClientId.UniqueProcess) == pi.dwProcessId, "wrong real pid %lx / %lx\n", PtrToUlong(child_teb.RealClientId.UniqueProcess), pi.dwProcessId ); - ok( PtrToUlong(child_teb.RealClientId.UniqueThread) == pi.dwThreadId, "wrong real tid %x / %x\n", + ok( PtrToUlong(child_teb.RealClientId.UniqueThread) == pi.dwThreadId, "wrong real tid %lx / %lx\n", PtrToUlong(child_teb.RealClientId.UniqueThread), pi.dwThreadId ); ok( child_teb.StaticUnicodeString.MaximumLength == sizeof(child_teb.StaticUnicodeBuffer), "StaticUnicodeString.MaximumLength wrong %x\n", child_teb.StaticUnicodeString.MaximumLength ); ok( (char *)child_teb.StaticUnicodeString.Buffer == (char *)info.TebBaseAddress + offsetof(TEB, StaticUnicodeBuffer), "StaticUnicodeString.Buffer wrong %p\n", child_teb.StaticUnicodeString.Buffer );
- ok( !child_teb.CurrentLocale, "CurrentLocale set %x\n", child_teb.CurrentLocale ); + ok( !child_teb.CurrentLocale, "CurrentLocale set %lx\n", child_teb.CurrentLocale ); ok( !child_teb.TlsLinks.Flink, "TlsLinks.Flink set %p\n", child_teb.TlsLinks.Flink ); ok( !child_teb.TlsLinks.Blink, "TlsLinks.Blink set %p\n", child_teb.TlsLinks.Blink ); ok( !child_teb.TlsExpansionSlots, "TlsExpansionSlots set %p\n", child_teb.TlsExpansionSlots ); @@ -3550,7 +3550,7 @@ static void test_SuspendProcessState(void) }
ret = SetThreadContext(pi.hThread, &ctx); - ok(ret, "Failed to set remote thread context (%d)\n", GetLastError()); + ok(ret, "Failed to set remote thread context (%ld)\n", GetLastError());
ResumeThread(pi.hThread);
@@ -3558,7 +3558,7 @@ static void test_SuspendProcessState(void) ok(pipe_connected, "Pipe did not connect\n");
ret = ReadFile(server_pipe_handle, &pipe_magic, sizeof(pipe_magic), &numb, NULL); - ok(ret, "Failed to read buffer from pipe (%d)\n", GetLastError()); + ok(ret, "Failed to read buffer from pipe (%ld)\n", GetLastError());
ok(pipe_magic == pipe_write_magic, "Did not get the correct magic from the remote process\n");
@@ -3570,7 +3570,7 @@ static void test_SuspendProcessState(void) ok(ret, "EXE IAT is not resolved\n");
ret = WriteFile(server_pipe_handle, &pipe_magic, sizeof(pipe_magic), &numb, NULL); - ok(ret, "Failed to write the magic back to the pipe (%d)\n", GetLastError()); + ok(ret, "Failed to write the magic back to the pipe (%ld)\n", GetLastError()); CloseHandle(server_pipe_handle);
/* Avoid wait_child_process() because the exit code results from a race @@ -3672,7 +3672,7 @@ static void test_GetNumaProcessorNode(void) { ok(!ret, "GetNumaProcessorNode returned TRUE for processor %d\n", i); ok(node == 0xFF || broken(node == 0xAA) /* WinXP */, "expected node 0xFF, got %x\n", node); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } } } @@ -3683,11 +3683,11 @@ static void test_session_info(void) BOOL r;
r = ProcessIdToSessionId(GetCurrentProcessId(), &session_id); - ok(r, "ProcessIdToSessionId failed: %u\n", GetLastError()); - trace("session_id = %x\n", session_id); + ok(r, "ProcessIdToSessionId failed: %lu\n", GetLastError()); + trace("session_id = %lx\n", session_id);
active_session = pWTSGetActiveConsoleSessionId(); - trace("active_session = %x\n", active_session); + trace("active_session = %lx\n", active_session); }
static void test_process_info(HANDLE hproc) @@ -3805,46 +3805,46 @@ static void test_process_info(HANDLE hproc) case ProcessImageInformation: case ProcessPagePriority: case ProcessImageFileNameWin32: - ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); + ok(status == STATUS_SUCCESS, "for info %lu expected STATUS_SUCCESS, got %08lx (ret_len %lu)\n", i, status, ret_len); break;
case ProcessAffinityMask: case ProcessBreakOnTermination: ok(status == STATUS_ACCESS_DENIED /* before win8 */ || status == STATUS_SUCCESS /* win8 is less strict */, - "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu expected STATUS_SUCCESS, got %08lx (ret_len %lu)\n", i, status, ret_len); break;
case ProcessDebugObjectHandle: ok(status == STATUS_ACCESS_DENIED || status == STATUS_PORT_NOT_SET, - "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu expected STATUS_ACCESS_DENIED, got %08lx (ret_len %lu)\n", i, status, ret_len); break; case ProcessCookie: if (is_current) ok(status == STATUS_SUCCESS || status == STATUS_INVALID_PARAMETER /* before win8 */, - "for info %u got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu got %08lx (ret_len %lu)\n", i, status, ret_len); else ok(status == STATUS_INVALID_PARAMETER /* before win8 */ || status == STATUS_ACCESS_DENIED, - "for info %u got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu got %08lx (ret_len %lu)\n", i, status, ret_len); break; case ProcessExecuteFlags: case ProcessDebugPort: case ProcessDebugFlags: if (is_current) ok(status == STATUS_SUCCESS || status == STATUS_INVALID_PARAMETER, - "for info %u, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu, got %08lx (ret_len %lu)\n", i, status, ret_len); else todo_wine ok(status == STATUS_ACCESS_DENIED, - "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu expected STATUS_ACCESS_DENIED, got %08lx (ret_len %lu)\n", i, status, ret_len); break;
default: if (is_current) ok(status == STATUS_SUCCESS || status == STATUS_UNSUCCESSFUL || status == STATUS_INVALID_PARAMETER, - "for info %u, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu, got %08lx (ret_len %lu)\n", i, status, ret_len); else ok(status == STATUS_ACCESS_DENIED, - "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu expected STATUS_ACCESS_DENIED, got %08lx (ret_len %lu)\n", i, status, ret_len); break; } } @@ -3863,22 +3863,22 @@ static void test_GetLogicalProcessorInformationEx(void) }
ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
len = 0; ret = pGetLogicalProcessorInformationEx(RelationProcessorCore, NULL, &len); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError()); - ok(len > 0, "got %u\n", len); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %ld\n", ret, GetLastError()); + ok(len > 0, "got %lu\n", len);
len = 0; ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, &len); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError()); - ok(len > 0, "got %u\n", len); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %ld\n", ret, GetLastError()); + ok(len > 0, "got %lu\n", len);
info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pGetLogicalProcessorInformationEx(RelationAll, info, &len); - ok(ret, "got %d, error %d\n", ret, GetLastError()); - ok(info->Size > 0, "got %u\n", info->Size); + ok(ret, "got %d, error %ld\n", ret, GetLastError()); + ok(info->Size > 0, "got %lu\n", info->Size); HeapFree(GetProcessHeap(), 0, info); }
@@ -3910,32 +3910,32 @@ static void test_GetSystemCpuSetInformation(void) size = 0xdeadbeef; SetLastError(0xdeadbeef); ret = pGetSystemCpuSetInformation(NULL, size, &size, process, 0); - ok(!ret && GetLastError() == ERROR_NOACCESS, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); - ok(!size, "Got unexpected size %u.\n", size); + ok(!ret && GetLastError() == ERROR_NOACCESS, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); + ok(!size, "Got unexpected size %lu.\n", size);
size = 0xdeadbeef; SetLastError(0xdeadbeef); ret = pGetSystemCpuSetInformation(NULL, 0, &size, (HANDLE)0xdeadbeef, 0); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); - ok(!size, "Got unexpected size %u.\n", size); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); + ok(!size, "Got unexpected size %lu.\n", size);
size = 0xdeadbeef; SetLastError(0xdeadbeef); ret = pGetSystemCpuSetInformation(NULL, 0, &size, process, 0); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); - ok(size == expected_size, "Got unexpected size %u.\n", size); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); + ok(size == expected_size, "Got unexpected size %lu.\n", size);
info = heap_alloc(size); info_nt = heap_alloc(size);
status = pNtQuerySystemInformationEx(SystemCpuSetInformation, &process, sizeof(process), info_nt, expected_size, NULL); - ok(!status, "Got unexpected status %#x.\n", status); + ok(!status, "Got unexpected status %#lx.\n", status);
size = 0xdeadbeef; SetLastError(0xdeadbeef); ret = pGetSystemCpuSetInformation(info, expected_size, &size, process, 0); - ok(ret && GetLastError() == 0xdeadbeef, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); - ok(size == expected_size, "Got unexpected size %u.\n", size); + ok(ret && GetLastError() == 0xdeadbeef, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); + ok(size == expected_size, "Got unexpected size %lu.\n", size);
ok(!memcmp(info, info_nt, expected_size), "Info does not match NtQuerySystemInformationEx().\n");
@@ -3953,7 +3953,7 @@ static void test_largepages(void) } size = pGetLargePageMinimum();
- ok((size == 0) || (size == 2*1024*1024) || (size == 4*1024*1024), "GetLargePageMinimum reports %ld size\n", size); + ok((size == 0) || (size == 2*1024*1024) || (size == 4*1024*1024), "GetLargePageMinimum reports %Id size\n", size); }
struct proc_thread_attr @@ -3994,16 +3994,16 @@ static void test_ProcThreadAttributeList(void) ok(!ret, "got %d\n", ret); if(i >= 4 && GetLastError() == ERROR_INVALID_PARAMETER) /* Vista only allows a maximium of 3 slots */ break; - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d\n", GetLastError()); - ok(size == needed, "%d: got %ld expect %ld\n", i, size, needed); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %ld\n", GetLastError()); + ok(size == needed, "%d: got %Id expect %Id\n", i, size, needed);
memset(&list, 0xcc, sizeof(list)); ret = pInitializeProcThreadAttributeList(&list, i, 0, &size); ok(ret, "got %d\n", ret); - ok(list.mask == 0, "%d: got %08x\n", i, list.mask); - ok(list.size == i, "%d: got %08x\n", i, list.size); - ok(list.count == 0, "%d: got %08x\n", i, list.count); - ok(list.unk == 0, "%d: got %08lx\n", i, list.unk); + ok(list.mask == 0, "%d: got %08lx\n", i, list.mask); + ok(list.size == i, "%d: got %08lx\n", i, list.size); + ok(list.count == 0, "%d: got %08lx\n", i, list.count); + ok(list.unk == 0, "%d: got %08Ix\n", i, list.unk); }
memset(handles, 0, sizeof(handles)); @@ -4015,15 +4015,15 @@ static void test_ProcThreadAttributeList(void)
ret = pUpdateProcThreadAttribute(&list, 0, 0xcafe, handles, sizeof(PROCESSOR_NUMBER), NULL, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_NOT_SUPPORTED, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_NOT_SUPPORTED, "got %ld\n", GetLastError());
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, handles, sizeof(handles[0]) / 2, NULL, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_BAD_LENGTH, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_BAD_LENGTH, "got %ld\n", GetLastError());
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, handles, sizeof(handles[0]) * 2, NULL, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_BAD_LENGTH, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_BAD_LENGTH, "got %ld\n", GetLastError());
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, handles, sizeof(handles[0]), NULL, NULL); ok(ret, "got %d\n", ret); @@ -4036,11 +4036,11 @@ static void test_ProcThreadAttributeList(void)
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, handles, sizeof(handles[0]), NULL, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_OBJECT_NAME_EXISTS, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_OBJECT_NAME_EXISTS, "got %ld\n", GetLastError());
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, handles, sizeof(handles) - 1, NULL, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_BAD_LENGTH, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_BAD_LENGTH, "got %ld\n", GetLastError());
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, handles, sizeof(handles), NULL, NULL); ok(ret, "got %d\n", ret); @@ -4053,10 +4053,10 @@ static void test_ProcThreadAttributeList(void)
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, handles, sizeof(handles), NULL, NULL); ok(!ret, "got %d\n", ret); - ok(GetLastError() == ERROR_OBJECT_NAME_EXISTS, "got %d\n", GetLastError()); + ok(GetLastError() == ERROR_OBJECT_NAME_EXISTS, "got %ld\n", GetLastError());
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR, handles, sizeof(PROCESSOR_NUMBER), NULL, NULL); - ok(ret || GetLastError() == ERROR_NOT_SUPPORTED, "got %d gle %d\n", ret, GetLastError()); + ok(ret || GetLastError() == ERROR_NOT_SUPPORTED, "got %d gle %ld\n", ret, GetLastError());
if (ret) { @@ -4068,7 +4068,7 @@ static void test_ProcThreadAttributeList(void) }
ret = pUpdateProcThreadAttribute(&list, 0, PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, handles, sizeof(handles[0]), NULL, NULL); - ok(ret || broken(GetLastError() == ERROR_NOT_SUPPORTED), "got %d gle %d\n", ret, GetLastError()); + ok(ret || broken(GetLastError() == ERROR_NOT_SUPPORTED), "got %d gle %ld\n", ret, GetLastError());
if (ret) { @@ -4127,7 +4127,7 @@ static void test_parent_process_attribute(unsigned int level, HANDLE read_pipe) if (!level) { ret = CreatePipe(&read_pipe, &write_pipe, &sa, 0); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
parent_data.parent = OpenProcess(PROCESS_CREATE_PROCESS | PROCESS_QUERY_INFORMATION, TRUE, GetCurrentProcessId()); parent_data.parent_id = GetCurrentProcessId(); @@ -4135,19 +4135,19 @@ static void test_parent_process_attribute(unsigned int level, HANDLE read_pipe) else { status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), &pbi_size); - ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status); parent_id = pbi.InheritedFromUniqueProcessId;
memset(&parent_data, 0, sizeof(parent_data)); ret = ReadFile(read_pipe, &parent_data, sizeof(parent_data), &size, NULL); ok((level == 2 && ret) || (level == 1 && !ret && GetLastError() == ERROR_INVALID_HANDLE), - "Got unexpected ret %#x, level %u, GetLastError() %u.\n", + "Got unexpected ret %#x, level %u, GetLastError() %lu.\n", ret, level, GetLastError()); }
if (level == 2) { - ok(parent_id == parent_data.parent_id, "Got parent id %u, parent_data.parent_id %u.\n", + ok(parent_id == parent_data.parent_id, "Got parent id %lu, parent_data.parent_id %lu.\n", parent_id, parent_data.parent_id); return; } @@ -4162,7 +4162,7 @@ static void test_parent_process_attribute(unsigned int level, HANDLE read_pipe)
ret = pInitializeProcThreadAttributeList(NULL, 1, 0, &size); ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
sprintf(buffer, ""%s" process parent %u %p", selfname, 255, read_pipe);
@@ -4175,14 +4175,14 @@ static void test_parent_process_attribute(unsigned int level, HANDLE read_pipe) #endif si.lpAttributeList = heap_alloc(size); ret = pInitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); handle = OpenProcess(PROCESS_CREATE_PROCESS, TRUE, GetCurrentProcessId()); ret = pUpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &handle, sizeof(handle), NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = CreateProcessA(NULL, buffer, NULL, NULL, TRUE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &info); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); wait_and_close_child_process(&info); CloseHandle(handle); pDeleteProcThreadAttributeList(si.lpAttributeList); @@ -4190,44 +4190,44 @@ static void test_parent_process_attribute(unsigned int level, HANDLE read_pipe)
si.lpAttributeList = heap_alloc(size); ret = pInitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); handle = (HANDLE)0xdeadbeef; ret = pUpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &handle, sizeof(handle), NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = CreateProcessA(NULL, buffer, NULL, NULL, TRUE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &info); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); pDeleteProcThreadAttributeList(si.lpAttributeList); heap_free(si.lpAttributeList);
si.lpAttributeList = heap_alloc(size); ret = pInitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); handle = NULL; ret = pUpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &handle, sizeof(handle), NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = CreateProcessA(NULL, buffer, NULL, NULL, TRUE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &info); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); pDeleteProcThreadAttributeList(si.lpAttributeList); heap_free(si.lpAttributeList);
si.lpAttributeList = heap_alloc(size); ret = pInitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); handle = GetCurrentProcess(); ret = pUpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &handle, sizeof(handle), NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = CreateProcessA(NULL, buffer, NULL, NULL, TRUE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &info); /* Broken on Vista / w7 / w10. */ ok(ret || broken(!ret && GetLastError() == ERROR_INVALID_HANDLE), - "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); if (ret) wait_and_close_child_process(&info); pDeleteProcThreadAttributeList(si.lpAttributeList); @@ -4235,19 +4235,19 @@ static void test_parent_process_attribute(unsigned int level, HANDLE read_pipe)
si.lpAttributeList = heap_alloc(size); ret = pInitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
parent = OpenProcess(PROCESS_CREATE_PROCESS, FALSE, parent_id);
ret = pUpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &parent, sizeof(parent), NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); }
sprintf(buffer, ""%s" process parent %u %p", selfname, level + 1, read_pipe); ret = CreateProcessA(NULL, buffer, NULL, NULL, level == 1, level == 1 ? EXTENDED_STARTUPINFO_PRESENT : 0, NULL, NULL, (STARTUPINFOA *)&si, &info); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
if (level) { @@ -4286,25 +4286,25 @@ static void test_handle_list_attribute(BOOL child, HANDLE handle1, HANDLE handle
flags = 0; ret = GetHandleInformation(handle1, &flags); - ok(ret, "Failed to get handle info, error %d.\n", GetLastError()); - ok(flags == HANDLE_FLAG_INHERIT, "Unexpected flags %#x.\n", flags); + ok(ret, "Failed to get handle info, error %ld.\n", GetLastError()); + ok(flags == HANDLE_FLAG_INHERIT, "Unexpected flags %#lx.\n", flags); CloseHandle(handle1);
ret = GetHandleInformation(handle2, &flags); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Unexpected return value, error %d.\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Unexpected return value, error %ld.\n", GetLastError());
return; }
ret = pInitializeProcThreadAttributeList(NULL, 1, 0, &size); ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
memset(&si, 0, sizeof(si)); si.StartupInfo.cb = sizeof(si); si.lpAttributeList = heap_alloc(size); ret = pInitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
memset(&sa, 0, sizeof(sa)); sa.nLength = sizeof(sa); @@ -4315,12 +4315,12 @@ static void test_handle_list_attribute(BOOL child, HANDLE handle1, HANDLE handle
ret = pUpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_HANDLE_LIST, &pipe[0], sizeof(pipe[0]), NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
sprintf(buffer, ""%s" process handlelist %p %p", selfname, pipe[0], pipe[1]); ret = CreateProcessA(NULL, buffer, NULL, NULL, TRUE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &info); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
wait_and_close_child_process(&info);
@@ -4348,23 +4348,23 @@ static void test_dead_process(void)
memset( data, 0, sizeof(data) ); status = NtQueryInformationProcess( pi.hProcess, ProcessImageFileName, data, sizeof(data), NULL); - ok( !status, "ProcessImageFileName failed %x\n", status ); + ok( !status, "ProcessImageFileName failed %lx\n", status ); ok( ((UNICODE_STRING *)data)->Length, "ProcessImageFileName not set\n" ); ok( ((UNICODE_STRING *)data)->Buffer[0] == '\', "ProcessImageFileName not set\n" );
memset( prio, 0xcc, sizeof(*prio) ); status = NtQueryInformationProcess( pi.hProcess, ProcessPriorityClass, prio, sizeof(*prio), NULL); - ok( !status, "ProcessPriorityClass failed %x\n", status ); + ok( !status, "ProcessPriorityClass failed %lx\n", status ); ok( prio->PriorityClass != 0xcc, "ProcessPriorityClass not set\n" );
memset( &basic, 0xcc, sizeof(basic) ); status = NtQueryInformationProcess( pi.hProcess, ProcessBasicInformation, &basic, sizeof(basic), NULL); - ok( !status, "ProcessBasicInformation failed %x\n", status ); + ok( !status, "ProcessBasicInformation failed %lx\n", status ); ok( basic.ExitStatus == 0, "ProcessBasicInformation info modified\n" );
memset( &image, 0xcc, sizeof(image) ); status = NtQueryInformationProcess( pi.hProcess, ProcessImageInformation, &image, sizeof(image), NULL); - ok( status == STATUS_PROCESS_IS_TERMINATING, "ProcessImageInformation wrong error %x\n", status ); + ok( status == STATUS_PROCESS_IS_TERMINATING, "ProcessImageInformation wrong error %lx\n", status ); ok( image.Machine == 0xcccc, "ProcessImageInformation info modified\n" );
while ((status = NtQuerySystemInformation(SystemProcessInformation, buffer, size, &size)) == STATUS_INFO_LENGTH_MISMATCH) @@ -4372,7 +4372,7 @@ static void test_dead_process(void) free(buffer); buffer = malloc(size); } - ok(status == STATUS_SUCCESS, "got %#x\n", status); + ok(status == STATUS_SUCCESS, "got %#lx\n", status); found = FALSE; do { @@ -4404,54 +4404,54 @@ static void test_nested_jobs_child(unsigned int index) sprintf(job_name, "test_nested_jobs_%u", index); job = pOpenJobObjectA(JOB_OBJECT_ASSIGN_PROCESS | JOB_OBJECT_SET_ATTRIBUTES | JOB_OBJECT_QUERY | JOB_OBJECT_TERMINATE, FALSE, job_name); - ok(!!job, "OpenJobObjectA error %u\n", GetLastError()); + ok(!!job, "OpenJobObjectA error %lu\n", GetLastError());
sprintf(job_name, "test_nested_jobs_%u", !index); job_other = pOpenJobObjectA(JOB_OBJECT_ASSIGN_PROCESS | JOB_OBJECT_SET_ATTRIBUTES | JOB_OBJECT_QUERY | JOB_OBJECT_TERMINATE, FALSE, job_name); - ok(!!job_other, "OpenJobObjectA error %u\n", GetLastError()); + ok(!!job_other, "OpenJobObjectA error %lu\n", GetLastError());
job_parent = pCreateJobObjectW(NULL, NULL); - ok(!!job_parent, "CreateJobObjectA error %u\n", GetLastError()); + ok(!!job_parent, "CreateJobObjectA error %lu\n", GetLastError());
ret = pAssignProcessToJobObject(job_parent, GetCurrentProcess()); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job_parent, pi.hProcess); ok(ret || broken(!ret && GetLastError() == ERROR_ACCESS_DENIED) /* Supported since Windows 8. */, - "AssignProcessToJobObject error %u\n", GetLastError()); + "AssignProcessToJobObject error %lu\n", GetLastError()); if (!ret) { win_skip("Nested jobs are not supported.\n"); goto done; } ret = pAssignProcessToJobObject(job, pi.hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
out = FALSE; ret = pIsProcessInJob(pi.hProcess, NULL, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
out = TRUE; ret = pIsProcessInJob(GetCurrentProcess(), job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pAssignProcessToJobObject(job, GetCurrentProcess()); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
TerminateProcess(pi.hProcess, 0); wait_child_process(pi.hProcess); @@ -4461,26 +4461,26 @@ static void test_nested_jobs_child(unsigned int index) dead_pid = pi.dwProcessId;
port = pCreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1); - ok(!!port, "CreateIoCompletionPort error %u\n", GetLastError()); + ok(!!port, "CreateIoCompletionPort error %lu\n", GetLastError());
port_info.CompletionPort = port; port_info.CompletionKey = job; ret = pSetInformationJobObject(job, JobObjectAssociateCompletionPortInformation, &port_info, sizeof(port_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError()); port_info.CompletionKey = job_parent; ret = pSetInformationJobObject(job_parent, JobObjectAssociateCompletionPortInformation, &port_info, sizeof(port_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
create_process("wait", &pi); out = FALSE; ret = pIsProcessInJob(pi.hProcess, job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
out = FALSE; ret = pIsProcessInJob(pi.hProcess, job_parent, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
/* The first already dead child process still shows up randomly. */ @@ -4489,20 +4489,20 @@ static void test_nested_jobs_child(unsigned int index) ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 0); } while (ret && (ULONG_PTR)overlapped == dead_pid);
- ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); - ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %x\n", key); + ok(ret, "GetQueuedCompletionStatus: %lx\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %lx\n", key); ok((HANDLE)value == job, "unexpected value %p\n", (void *)value); - ok((ULONG_PTR)overlapped == GetCurrentProcessId(), "unexpected pid %#x\n", (DWORD)(DWORD_PTR)overlapped); + ok((ULONG_PTR)overlapped == GetCurrentProcessId(), "unexpected pid %#lx\n", (DWORD)(DWORD_PTR)overlapped);
do { ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 0); } while (ret && (ULONG_PTR)overlapped == dead_pid);
- ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); - ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %x\n", key); + ok(ret, "GetQueuedCompletionStatus: %lx\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %lx\n", key); ok((HANDLE)value == job_parent, "unexpected value %p\n", (void *)value); - ok((ULONG_PTR)overlapped == GetCurrentProcessId(), "unexpected pid %#x\n", (DWORD)(DWORD_PTR)overlapped); + ok((ULONG_PTR)overlapped == GetCurrentProcessId(), "unexpected pid %#lx\n", (DWORD)(DWORD_PTR)overlapped);
test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job, pi.dwProcessId, 0); test_completion(port, JOB_OBJECT_MSG_NEW_PROCESS, (DWORD_PTR)job_parent, pi.dwProcessId, 0); @@ -4514,7 +4514,7 @@ static void test_nested_jobs_child(unsigned int index) { ret = pAssignProcessToJobObject(job_other, GetCurrentProcess()); ok(!ret, "AssignProcessToJobObject succeeded\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %lu.\n", GetLastError()); }
CloseHandle(port); @@ -4546,9 +4546,9 @@ static void test_nested_jobs(void) }
job1 = pCreateJobObjectW(NULL, NULL); - ok(!!job1, "CreateJobObjectW failed, error %u.\n", GetLastError()); + ok(!!job1, "CreateJobObjectW failed, error %lu.\n", GetLastError()); job2 = pCreateJobObjectW(NULL, NULL); - ok(!!job2, "CreateJobObjectW failed, error %u.\n", GetLastError()); + ok(!!job2, "CreateJobObjectW failed, error %lu.\n", GetLastError());
create_succeeded = TRUE; sprintf(buffer, ""%s" process wait", selfname); @@ -4560,25 +4560,25 @@ static void test_nested_jobs(void) create_succeeded = FALSE; break; } - ok(ret, "CreateProcessA error %u\n", GetLastError()); + ok(ret, "CreateProcessA error %lu\n", GetLastError()); }
if (create_succeeded) { ret = pIsProcessInJob(info[0].hProcess, NULL, &already_in_job); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError());
if (!already_in_job) { ret = pAssignProcessToJobObject(job2, info[1].hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
ret = pAssignProcessToJobObject(job1, info[0].hProcess); - ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
ret = pAssignProcessToJobObject(job2, info[0].hProcess); ok(!ret, "AssignProcessToJobObject succeeded\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %lu.\n", GetLastError());
TerminateProcess(info[1].hProcess, 0); wait_child_process(info[1].hProcess); @@ -4587,7 +4587,7 @@ static void test_nested_jobs(void)
ret = pAssignProcessToJobObject(job2, info[0].hProcess); ok(!ret, "AssignProcessToJobObject succeeded\n"); - ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected error %lu.\n", GetLastError()); }
TerminateProcess(info[0].hProcess, 0); @@ -4605,9 +4605,9 @@ static void test_nested_jobs(void) CloseHandle(job2);
job1 = pCreateJobObjectW(NULL, L"test_nested_jobs_0"); - ok(!!job1, "CreateJobObjectW failed, error %u.\n", GetLastError()); + ok(!!job1, "CreateJobObjectW failed, error %lu.\n", GetLastError()); job2 = pCreateJobObjectW(NULL, L"test_nested_jobs_1"); - ok(!!job2, "CreateJobObjectW failed, error %u.\n", GetLastError()); + ok(!!job2, "CreateJobObjectW failed, error %lu.\n", GetLastError());
sprintf(buffer, ""%s" process nested_jobs 0", selfname); ok(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &info[0]), @@ -4652,7 +4652,7 @@ static void test_job_list_attribute(HANDLE parent_job)
ret = pInitializeProcThreadAttributeList(NULL, 1, 0, &size); ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); attrs = heap_alloc(size);
@@ -4660,7 +4660,7 @@ static void test_job_list_attribute(HANDLE parent_job) jobs[1] = NULL;
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, sizeof(*jobs), NULL, NULL); if (!ret && GetLastError() == ERROR_NOT_SUPPORTED) @@ -4671,23 +4671,23 @@ static void test_job_list_attribute(HANDLE parent_job) heap_free(attrs); return; } - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, 3, NULL, NULL); - ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, sizeof(*jobs) * 2, NULL, NULL); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, sizeof(*jobs), NULL, NULL);
@@ -4698,65 +4698,65 @@ static void test_job_list_attribute(HANDLE parent_job)
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs + 1, sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, &parent_job, sizeof(parent_job), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); wait_and_close_child_process(&pi);
jobs[0] = pCreateJobObjectW(NULL, NULL); - ok(!!jobs[0], "CreateJobObjectA error %u\n", GetLastError()); + ok(!!jobs[0], "CreateJobObjectA error %lu\n", GetLastError()); jobs[1] = pCreateJobObjectW(NULL, NULL); - ok(!!jobs[1], "CreateJobObjectA error %u\n", GetLastError()); + ok(!!jobs[1], "CreateJobObjectA error %lu\n", GetLastError());
/* Breakaway works for the inherited job only. */ limit_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_BREAKAWAY_OK; ret = pSetInformationJobObject(parent_job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError()); limit_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_BREAKAWAY_OK | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK; ret = pSetInformationJobObject(jobs[1], JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs + 1, sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT | CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[1], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[0], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); @@ -4764,26 +4764,26 @@ static void test_job_list_attribute(HANDLE parent_job)
CloseHandle(jobs[1]); jobs[1] = pCreateJobObjectW(NULL, NULL); - ok(!!jobs[1], "CreateJobObjectA error %u\n", GetLastError()); + ok(!!jobs[1], "CreateJobObjectA error %lu\n", GetLastError());
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs + 1, sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[1], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[0], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(!out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); @@ -4791,54 +4791,54 @@ static void test_job_list_attribute(HANDLE parent_job)
ret = pQueryInformationJobObject(jobs[0], JobObjectBasicAccountingInformation, &job_info, sizeof(job_info), NULL); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(!job_info.TotalProcesses, "Got unexpected TotalProcesses %u.\n", job_info.TotalProcesses); - ok(!job_info.ActiveProcesses, "Got unexpected ActiveProcesses %u.\n", job_info.ActiveProcesses); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(!job_info.TotalProcesses, "Got unexpected TotalProcesses %lu.\n", job_info.TotalProcesses); + ok(!job_info.ActiveProcesses, "Got unexpected ActiveProcesses %lu.\n", job_info.ActiveProcesses);
ret = pQueryInformationJobObject(jobs[1], JobObjectBasicAccountingInformation, &job_info, sizeof(job_info), NULL); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(job_info.TotalProcesses == 1, "Got unexpected TotalProcesses %u.\n", job_info.TotalProcesses); - ok(!job_info.ActiveProcesses || job_info.ActiveProcesses == 1, "Got unexpected ActiveProcesses %u.\n", + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(job_info.TotalProcesses == 1, "Got unexpected TotalProcesses %lu.\n", job_info.TotalProcesses); + ok(!job_info.ActiveProcesses || job_info.ActiveProcesses == 1, "Got unexpected ActiveProcesses %lu.\n", job_info.ActiveProcesses);
/* Fails due to the second job already has the parent other than the first job in the list. */ ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, 2 * sizeof(*jobs), NULL, NULL);
port = pCreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1); - ok(!!port, "CreateIoCompletionPort error %u\n", GetLastError()); + ok(!!port, "CreateIoCompletionPort error %lu\n", GetLastError());
port_info.CompletionPort = port; port_info.CompletionKey = jobs[0]; ret = pSetInformationJobObject(jobs[0], JobObjectAssociateCompletionPortInformation, &port_info, sizeof(port_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 0); ok(!ret, "GetQueuedCompletionStatus succeeded.\n");
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 100); - ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); - ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %x\n", key); + ok(ret, "GetQueuedCompletionStatus: %lx\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_NEW_PROCESS, "unexpected key %lx\n", key); ok((HANDLE)value == jobs[0], "unexpected value %p\n", (void *)value); ok(!!overlapped, "Got zero pid.\n");
ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 100); - ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); - ok(key == JOB_OBJECT_MSG_EXIT_PROCESS, "unexpected key %x\n", key); + ok(ret, "GetQueuedCompletionStatus: %lx\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_EXIT_PROCESS, "unexpected key %lx\n", key); ok((HANDLE)value == jobs[0], "unexpected value %p\n", (void *)value); ok(!!overlapped, "Got zero pid.\n");
ret = GetQueuedCompletionStatus(port, &key, &value, &overlapped, 100); - ok(ret, "GetQueuedCompletionStatus: %x\n", GetLastError()); - ok(key == JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO, "unexpected key %x\n", key); + ok(ret, "GetQueuedCompletionStatus: %lx\n", GetLastError()); + ok(key == JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO, "unexpected key %lx\n", key); ok((HANDLE)value == jobs[0], "unexpected value %p\n", (void *)value); ok(!overlapped, "Got unexpected overlapped %p.\n", overlapped);
@@ -4850,31 +4850,31 @@ static void test_job_list_attribute(HANDLE parent_job) /* The first job got updated even though the process creation failed. */ ret = pQueryInformationJobObject(jobs[0], JobObjectBasicAccountingInformation, &job_info, sizeof(job_info), NULL); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(job_info.TotalProcesses == 1, "Got unexpected TotalProcesses %u.\n", job_info.TotalProcesses); - ok(!job_info.ActiveProcesses, "Got unexpected ActiveProcesses %u.\n", job_info.ActiveProcesses); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(job_info.TotalProcesses == 1, "Got unexpected TotalProcesses %lu.\n", job_info.TotalProcesses); + ok(!job_info.ActiveProcesses, "Got unexpected ActiveProcesses %lu.\n", job_info.ActiveProcesses);
ret = pQueryInformationJobObject(jobs[1], JobObjectBasicAccountingInformation, &job_info, sizeof(job_info), NULL); - ok(ret, "QueryInformationJobObject error %u\n", GetLastError()); - ok(job_info.TotalProcesses == 1, "Got unexpected TotalProcesses %u.\n", job_info.TotalProcesses); - ok(!job_info.ActiveProcesses, "Got unexpected ActiveProcesses %u.\n", job_info.ActiveProcesses); + ok(ret, "QueryInformationJobObject error %lu\n", GetLastError()); + ok(job_info.TotalProcesses == 1, "Got unexpected TotalProcesses %lu.\n", job_info.TotalProcesses); + ok(!job_info.ActiveProcesses, "Got unexpected ActiveProcesses %lu.\n", job_info.ActiveProcesses);
/* Check that the first job actually got the job_parent as parent. */ ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT | CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[0], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); @@ -4885,64 +4885,64 @@ static void test_job_list_attribute(HANDLE parent_job) jobs[1] = tmp;
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, 2 * sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected ret %#x, GetLastError() %u.\n", + ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
CloseHandle(jobs[0]); CloseHandle(jobs[1]);
jobs[0] = pCreateJobObjectW(NULL, NULL); - ok(!!jobs[0], "CreateJobObjectA error %u\n", GetLastError()); + ok(!!jobs[0], "CreateJobObjectA error %lu\n", GetLastError()); jobs[1] = pCreateJobObjectW(NULL, NULL); - ok(!!jobs[1], "CreateJobObjectA error %u\n", GetLastError()); + ok(!!jobs[1], "CreateJobObjectA error %lu\n", GetLastError());
/* Create the job chain successfully and check the job chain. */ ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs, 2 * sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[0], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[1], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); wait_and_close_child_process(&pi);
ret = pInitializeProcThreadAttributeList(attrs, 1, 0, &size); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ret = pUpdateProcThreadAttribute(attrs, 0, PROC_THREAD_ATTRIBUTE_JOB_LIST, jobs + 1, sizeof(*jobs), NULL, NULL); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, EXTENDED_STARTUPINFO_PRESENT | CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, (STARTUPINFOA *)&si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
ret = pIsProcessInJob(pi.hProcess, parent_job, &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[0], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
ret = pIsProcessInJob(pi.hProcess, jobs[1], &out); - ok(ret, "IsProcessInJob error %u\n", GetLastError()); + ok(ret, "IsProcessInJob error %lu\n", GetLastError()); ok(out, "IsProcessInJob returned out=%u\n", out);
TerminateProcess(pi.hProcess, 0); @@ -4956,7 +4956,7 @@ static void test_job_list_attribute(HANDLE parent_job)
limit_info.BasicLimitInformation.LimitFlags = 0; ret = pSetInformationJobObject(parent_job, JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info)); - ok(ret, "SetInformationJobObject error %u\n", GetLastError()); + ok(ret, "SetInformationJobObject error %lu\n", GetLastError()); }
START_TEST(process) @@ -4982,11 +4982,11 @@ START_TEST(process) else if (!strcmp(myARGV[2], "sync") && myARGC >= 4) { HANDLE sem = OpenSemaphoreA(SYNCHRONIZE, FALSE, myARGV[3]); - ok(sem != 0, "OpenSemaphoreA(%s) failed le=%u\n", myARGV[3], GetLastError()); + ok(sem != 0, "OpenSemaphoreA(%s) failed le=%lu\n", myARGV[3], GetLastError()); if (sem) { DWORD ret = WaitForSingleObject(sem, 30000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject(%s) returned %u\n", myARGV[3], ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject(%s) returned %lu\n", myARGV[3], ret); CloseHandle(sem); } return; @@ -5017,7 +5017,7 @@ START_TEST(process) * nested process. */ hFile = CreateFileA(myARGV[3], GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - childPrintf(hFile, "[Nested]\nPid=%08u\n", info.dwProcessId); + childPrintf(hFile, "[Nested]\nPid=%08lu\n", info.dwProcessId); CloseHandle(hFile); return; } diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index 94ef0a85467..71d945f81df 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -36,7 +36,7 @@ static void check_profile_string_(int line, const char *section, const char *nam { char value[200] = {0}; DWORD ret = GetPrivateProfileStringA(section, name, "default", value, sizeof(value), file); - ok_(__FILE__, line)(ret == strlen(expect), "expected len %u, got %u\n", strlen(expect), ret); + ok_(__FILE__, line)(ret == strlen(expect), "expected len %Iu, got %lu\n", strlen(expect), ret); ok_(__FILE__, line)(!strcmp(value, expect), "expected %s, got %s\n", debugstr_a(expect), debugstr_a(value)); } #define check_profile_string(a, b, c, d) check_profile_string_(__LINE__, a, b, c, d); @@ -191,7 +191,7 @@ static void test_profile_sections(void) ok( ret == 0, "expected return size 0, got %d\n", ret ); ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == 0xdeadbeef /* Win98 */, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); if (GetLastError() == 0xdeadbeef) on_win98 = TRUE;
SetLastError(0xdeadbeef); @@ -199,35 +199,35 @@ static void test_profile_sections(void) ok( ret == 0, "expected return size 0, got %d\n", ret ); ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == 0xdeadbeef /* Win98 */, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
if (!on_win98) { SetLastError(0xdeadbeef); ret = GetPrivateProfileSectionA( "section1", NULL, 0, testfile4 ); ok( ret == 0, "expected return size 0, got %d\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
SetLastError(0xdeadbeef); ret = GetPrivateProfileSectionA( NULL, buf, sizeof(buf), testfile4 ); ok( ret == 0, "expected return size 0, got %d\n", ret ); ok( GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetPrivateProfileSectionA( "section1", buf, sizeof(buf), NULL ); ok( ret == 0, "expected return size 0, got %d\n", ret ); todo_wine ok( GetLastError() == ERROR_FILE_NOT_FOUND, - "expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + "expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
/* Existing empty section with no keys */ SetLastError(0xdeadbeef); ret=GetPrivateProfileSectionA("section2", buf, sizeof(buf), testfile4); ok( ret == 0, "expected return size 0, got %d\n", ret ); ok( GetLastError() == ERROR_SUCCESS, - "expected ERROR_SUCCESS, got %d\n", GetLastError()); + "expected ERROR_SUCCESS, got %ld\n", GetLastError());
/* Existing section with keys and values*/ SetLastError(0xdeadbeef); @@ -238,7 +238,7 @@ static void test_profile_sections(void) ret, buf); ok( buf[ret-1] == 0 && buf[ret] == 0, "returned buffer not terminated with double-null\n" ); ok( GetLastError() == ERROR_SUCCESS, - "expected ERROR_SUCCESS, got %d\n", GetLastError()); + "expected ERROR_SUCCESS, got %ld\n", GetLastError());
/* Existing section with no keys but has values */ SetLastError(0xdeadbeef); @@ -250,7 +250,7 @@ static void test_profile_sections(void) ret, buf); ok( buf[ret-1] == 0 && buf[ret] == 0, "returned buffer not terminated with double-null\n" ); ok( GetLastError() == ERROR_SUCCESS, - "expected ERROR_SUCCESS, got %d\n", GetLastError()); + "expected ERROR_SUCCESS, got %ld\n", GetLastError());
/* Overflow*/ ret=GetPrivateProfileSectionA("section1", buf, 24, testfile4); @@ -394,24 +394,24 @@ static void test_profile_existing(void) { if (!ret) ok( broken(GetLastError() == pe[i].broken_error), - "%d: WritePrivateProfileString failed with error %u\n", i, GetLastError() ); + "%d: WritePrivateProfileString failed with error %lu\n", i, GetLastError() ); CloseHandle(h); size = GetPrivateProfileStringA(SECTION, KEY, 0, buffer, MAX_PATH, testfile1); if (ret) - ok( size == 5, "%d: test failed, number of characters copied: %d instead of 5\n", i, size ); + ok( size == 5, "%d: test failed, number of characters copied: %ld instead of 5\n", i, size ); else - ok( !size, "%d: test failed, number of characters copied: %d instead of 0\n", i, size ); + ok( !size, "%d: test failed, number of characters copied: %ld instead of 0\n", i, size ); } else { DWORD err = GetLastError(); ok( !ret, "%d: WritePrivateProfileString succeeded\n", i ); if (!ret) - ok( err == pe[i].write_error, "%d: WritePrivateProfileString failed with error %u/%u\n", + ok( err == pe[i].write_error, "%d: WritePrivateProfileString failed with error %lu/%lu\n", i, err, pe[i].write_error ); CloseHandle(h); size = GetPrivateProfileStringA(SECTION, KEY, 0, buffer, MAX_PATH, testfile1); - ok( !size, "%d: test failed, number of characters copied: %d instead of 0\n", i, size ); + ok( !size, "%d: test failed, number of characters copied: %ld instead of 0\n", i, size ); }
ok( DeleteFileA(testfile1), "delete failed\n" ); @@ -430,7 +430,7 @@ static void test_profile_existing(void) SetLastError(0xdeadbeef); ret = GetPrivateProfileStringA(SECTION, KEY, NULL, buffer, MAX_PATH, testfile2); if (!pe[i].read_error) - ok( ret, "%d: GetPrivateProfileString failed with error %u\n", i, GetLastError() ); + ok( ret, "%d: GetPrivateProfileString failed with error %lu\n", i, GetLastError() ); else ok( !ret, "%d: GetPrivateProfileString succeeded\n", i ); CloseHandle(h); @@ -448,12 +448,12 @@ static void test_profile_delete_on_close(void) h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); res = WriteFile( h, contents, sizeof contents - 1, &size, NULL ); - ok( res, "Cannot write test file: %x\n", GetLastError() ); + ok( res, "Cannot write test file: %lx\n", GetLastError() ); ok( size == sizeof contents - 1, "Test file: partial write\n");
SetLastError(0xdeadbeef); res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile); - ok( res == 123, "Got %d instead of 123\n", res); + ok( res == 123, "Got %ld instead of 123\n", res);
/* This also deletes the file */ CloseHandle(h); @@ -470,12 +470,12 @@ static void test_profile_refresh(void) h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); res = WriteFile( h, contents1, sizeof contents1 - 1, &size, NULL ); - ok( res, "Cannot write test file: %x\n", GetLastError() ); + ok( res, "Cannot write test file: %lx\n", GetLastError() ); ok( size == sizeof contents1 - 1, "Test file: partial write\n");
SetLastError(0xdeadbeef); res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile); - ok( res == 123, "Got %d instead of 123\n", res); + ok( res == 123, "Got %ld instead of 123\n", res);
CloseHandle(h);
@@ -484,12 +484,12 @@ static void test_profile_refresh(void) h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); res = WriteFile( h, contents2, sizeof contents2 - 1, &size, NULL ); - ok( res, "Cannot write test file: %x\n", GetLastError() ); + ok( res, "Cannot write test file: %lx\n", GetLastError() ); ok( size == sizeof contents2 - 1, "Test file: partial write\n");
SetLastError(0xdeadbeef); res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile); - ok( res == 124, "Got %d instead of 124\n", res); + ok( res == 124, "Got %ld instead of 124\n", res);
/* This also deletes the file */ CloseHandle(h); @@ -497,7 +497,7 @@ static void test_profile_refresh(void) /* Cache must be invalidated if file no longer exists and default must be returned */ SetLastError(0xdeadbeef); res = GetPrivateProfileIntA(SECTION, KEY, 421, testfile); - ok( res == 421, "Got %d instead of 421\n", res); + ok( res == 421, "Got %ld instead of 421\n", res); }
static void create_test_file(LPCSTR name, LPCSTR data, DWORD size) @@ -536,7 +536,7 @@ static void test_profile_directory_readonly(void)
attributes.nLength = sizeof(attributes); ret = ConvertStringSecurityDescriptorToSecurityDescriptorA(sddl_string_everyone_readonly, SDDL_REVISION_1, &attributes.lpSecurityDescriptor, NULL); - ok(ret == TRUE, "ConvertStringSecurityDescriptorToSecurityDescriptor failed: %d\n", GetLastError()); + ok(ret == TRUE, "ConvertStringSecurityDescriptorToSecurityDescriptor failed: %ld\n", GetLastError());
GetTempPathA(MAX_PATH, path_folder); lstrcatA(path_folder, "wine-test"); @@ -545,7 +545,7 @@ static void test_profile_directory_readonly(void) lstrcatA(path_file, "\tmp.ini");
ret = CreateDirectoryA(path_folder, &attributes); - ok(ret == TRUE, "CreateDirectoryA failed: %d\n", GetLastError()); + ok(ret == TRUE, "CreateDirectoryA failed: %ld\n", GetLastError());
ret = WritePrivateProfileStringA("App", "key", "string", path_file); ok(ret == FALSE, "Expected FALSE, got %d\n", ret); @@ -557,7 +557,7 @@ static void test_profile_directory_readonly(void) ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
ret = RemoveDirectoryA(path_folder); - ok(ret == TRUE, "RemoveDirectoryA failed: %d\n", GetLastError()); + ok(ret == TRUE, "RemoveDirectoryA failed: %ld\n", GetLastError());
LocalFree(attributes.lpSecurityDescriptor); } @@ -589,7 +589,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA(NULL, "name1", "default", buf, MAX_PATH, filename); - ok(ret == 18, "Expected 18, got %d\n", ret); + ok(ret == 18, "Expected 18, got %ld\n", ret); len = lstrlenA("section1") + sizeof(CHAR) + lstrlenA("section2") + 2 * sizeof(CHAR);
ok(!memcmp(buf, "section1\0section2\0", len), @@ -601,7 +601,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA(emptystr, "name1", "default", buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf); ok(emptystr_ok(emptystr), "AppName modified\n");
@@ -610,7 +610,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("notasection", "name1", "default", buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf);
/* lpAppName is empty, lpDefault is NULL */ @@ -618,7 +618,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA(emptystr, "name1", NULL, buf, MAX_PATH, filename); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ok(!lstrcmpA(buf, ""), "Expected "", got "%s"\n", buf); ok(emptystr_ok(emptystr), "AppName modified\n");
@@ -627,7 +627,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA(emptystr, "name1", "", buf, MAX_PATH, filename); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ok(!lstrcmpA(buf, ""), "Expected "", got "%s"\n", buf); ok(emptystr_ok(emptystr), "AppName modified\n");
@@ -638,7 +638,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(def_val, "default "); ret = GetPrivateProfileStringA(emptystr, "name1", def_val, buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf); ok(emptystr_ok(emptystr), "AppName modified\n");
@@ -649,7 +649,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(def_val, "one two "); ret = GetPrivateProfileStringA(emptystr, "name1", def_val, buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "one two"), "Expected "one two", got "%s"\n", buf); ok(emptystr_ok(emptystr), "AppName modified\n");
@@ -658,7 +658,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA(emptystr, "name1", "one two", buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "one two"), "Expected "one two", got "%s"\n", buf); ok(emptystr_ok(emptystr), "AppName modified\n");
@@ -667,7 +667,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", NULL, "default", buf, MAX_PATH, filename); - ok(ret == 18, "Expected 18, got %d\n", ret); + ok(ret == 18, "Expected 18, got %ld\n", ret); ok(!memcmp(buf, "name1\0name2\0name4\0", ret + 1), "Expected "name1\x00name2\x00name4\x00\x00", got %s\n", debugstr_an(buf, (ret + 2 >= MAX_PATH ? MAX_PATH : ret + 1))); @@ -677,7 +677,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", emptystr, "default", buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf); ok(emptystr_ok(emptystr), "KeyName modified\n");
@@ -686,7 +686,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "notakey", "default", buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf);
/* lpKeyName is empty, lpDefault is NULL */ @@ -694,7 +694,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", emptystr, NULL, buf, MAX_PATH, filename); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ok(!lstrcmpA(buf, ""), "Expected "", got "%s"\n", buf); ok(emptystr_ok(emptystr), "KeyName modified\n");
@@ -703,7 +703,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", emptystr, "", buf, MAX_PATH, filename); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ok(!lstrcmpA(buf, ""), "Expected "", got "%s"\n", buf); ok(emptystr_ok(emptystr), "KeyName modified\n");
@@ -714,7 +714,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(def_val, "default "); ret = GetPrivateProfileStringA("section1", emptystr, def_val, buf, MAX_PATH, filename); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf); ok(emptystr_ok(emptystr), "KeyName modified\n");
@@ -730,7 +730,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, MAX_PATH, NULL); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf);
/* lpFileName is empty */ @@ -738,7 +738,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, MAX_PATH, ""); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf);
/* lpFileName is nonexistent */ @@ -746,7 +746,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, MAX_PATH, "nonexistent"); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf);
/* nSize is 0 */ @@ -754,7 +754,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, 0, filename); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ok(!lstrcmpA(buf, "kumquat"), "Expected buf to be unchanged, got "%s"\n", buf);
/* nSize is exact size of output */ @@ -762,7 +762,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, 4, filename); - ok(ret == 3, "Expected 3, got %d\n", ret); + ok(ret == 3, "Expected 3, got %ld\n", ret); ok(!lstrcmpA(buf, "val"), "Expected "val", got "%s"\n", buf);
/* nSize has room for NULL terminator */ @@ -770,7 +770,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, 5, filename); - ok(ret == 4, "Expected 4, got %d\n", ret); + ok(ret == 4, "Expected 4, got %ld\n", ret); ok(!lstrcmpA(buf, "val1"), "Expected "val1", got "%s"\n", buf);
/* output is 1 character */ @@ -778,7 +778,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name4", "default", buf, MAX_PATH, filename); - ok(ret == 1, "Expected 1, got %d\n", ret); + ok(ret == 1, "Expected 1, got %ld\n", ret); ok(!lstrcmpA(buf, "a"), "Expected "a", got "%s"\n", buf);
/* output is 1 character, no room for NULL terminator */ @@ -786,7 +786,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name4", "default", buf, 1, filename); - ok(ret == 0, "Expected 0, got %d\n", ret); + ok(ret == 0, "Expected 0, got %ld\n", ret); ok(!lstrcmpA(buf, ""), "Expected "", got "%s"\n", buf);
/* lpAppName is NULL, not enough room for final section name */ @@ -794,7 +794,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA(NULL, "name1", "default", buf, 16, filename); - ok(ret == 14, "Expected 14, got %d\n", ret); + ok(ret == 14, "Expected 14, got %ld\n", ret); len = lstrlenA("section1") + 2 * sizeof(CHAR); todo_wine ok(!memcmp(buf, "section1\0secti\0", ret + 2), @@ -806,7 +806,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", NULL, "default", buf, 16, filename); - ok(ret == 14, "Expected 14, got %d\n", ret); + ok(ret == 14, "Expected 14, got %ld\n", ret); todo_wine ok(!memcmp(buf, "name1\0name2\0na\0", ret + 2), "Expected "name1\x00name2\x00na\x00\x00", got %s\n", @@ -817,7 +817,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name2", "default", buf, MAX_PATH, filename); - ok(ret == 4, "Expected 4, got %d\n", ret); + ok(ret == 4, "Expected 4, got %ld\n", ret); ok(!lstrcmpA(buf, "val2"), "Expected "val2", got "%s"\n", buf);
/* case does not match */ @@ -825,7 +825,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "NaMe1", "default", buf, MAX_PATH, filename); - ok(ret == 4, "Expected 4, got %d\n", ret); + ok(ret == 4, "Expected 4, got %ld\n", ret); ok(!lstrcmpA(buf, "val1"), "Expected "val1", got "%s"\n", buf);
/* only filename is used */ @@ -833,7 +833,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "NaMe1", "default", buf, MAX_PATH, "winetest.ini"); - ok(ret == 7, "Expected 7, got %d\n", ret); + ok(ret == 7, "Expected 7, got %ld\n", ret); ok(!lstrcmpA(buf, "default"), "Expected "default", got "%s"\n", buf);
GetWindowsDirectoryA(windir, MAX_PATH); @@ -853,7 +853,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "NaMe1", "default", buf, MAX_PATH, tempfile); - ok(ret == 4, "Expected 4, got %d\n", ret); + ok(ret == 4, "Expected 4, got %ld\n", ret); ok(!lstrcmpA(buf, "val1"), "Expected "val1", got "%s"\n", buf);
/* successful case */ @@ -861,7 +861,7 @@ static void test_GetPrivateProfileString(const char *content, const char *descri lstrcpyA(buf, "kumquat"); ret = GetPrivateProfileStringA("section1", "name1", "default", buf, MAX_PATH, filename); - ok(ret == 4, "Expected 4, got %d\n", ret); + ok(ret == 4, "Expected 4, got %ld\n", ret); ok(!lstrcmpA(buf, "val1"), "Expected "val1", got "%s"\n", buf);
/* Existing section with no keys in an existing file */ @@ -869,12 +869,12 @@ static void test_GetPrivateProfileString(const char *content, const char *descri SetLastError(0xdeadbeef); ret=GetPrivateProfileStringA("section2", "DoesntExist", "", buf, MAX_PATH, filename); - ok( ret == 0, "expected return size 0, got %d\n", ret ); + ok( ret == 0, "expected return size 0, got %ld\n", ret ); ok(!lstrcmpA(buf, ""), "Expected "", got "%s"\n", buf); todo_wine ok( GetLastError() == 0xdeadbeef || GetLastError() == ERROR_FILE_NOT_FOUND /* Win 7 */, - "expected 0xdeadbeef or ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + "expected 0xdeadbeef or ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
DeleteFileA(path); @@ -929,7 +929,7 @@ static void test_WritePrivateProfileString(void) ret = WritePrivateProfileStringA(NULL, "key", "string", path); ok(ret == FALSE, "Expected FALSE, got %d\n", ret); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError()); ok(GetFileAttributesA(path) == INVALID_FILE_ATTRIBUTES, "Expected path to not exist\n");
@@ -941,7 +941,7 @@ static void test_WritePrivateProfileString(void) ret = WritePrivateProfileStringA(NULL, "key", "string", path); ok(ret == FALSE, "Expected FALSE, got %d\n", ret); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError()); ok(check_file_data(path, data), "File doesn't match\n"); DeleteFileA(path);
@@ -1003,7 +1003,7 @@ static void test_WritePrivateProfileString(void) ret = WritePrivateProfileStringA("App", "key", "string", ""); ok(ret == FALSE, "Expected FALSE, got %d\n", ret); ok(GetLastError() == ERROR_ACCESS_DENIED, - "Expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + "Expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
/* Relative paths are relative to X:\%WINDIR% */ GetWindowsDirectoryA(path, MAX_PATH); @@ -1019,7 +1019,7 @@ static void test_WritePrivateProfileString(void) data = "[App]\r\n" "key=string\r\n"; ret = WritePrivateProfileStringA("App", "key", "string", "win1.tmp"); - ok(ret == TRUE, "Expected TRUE, got %d, le=%u\n", ret, GetLastError()); + ok(ret == TRUE, "Expected TRUE, got %d, le=%lu\n", ret, GetLastError()); ok(check_file_data(path, data), "File doesn't match\n"); DeleteFileA(path); } @@ -1115,25 +1115,25 @@ static void test_profile_struct(void) SetLastError(0xdeadbeef); ret = GetPrivateProfileStructA("s", "key", buffer, sizeof(buffer), "./winetest.ini"); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStructA("s", "key", (void *)"abacus", sizeof("abacus"), "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(check_file_data("./winetest.ini", expect_data), "file doesn't match\n");
SetLastError(0xdeadbeef); ret = GetPrivateProfileStructA("s", "key", buffer, 6, "./winetest.ini"); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetPrivateProfileStructA("s", "key", buffer, 8, "./winetest.ini"); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %lu\n", GetLastError());
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileStructA("s", "key", buffer, 7, "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(buffer, "abacus"), "data didn't match\n");
memset(buffer, 0xcc, sizeof(buffer)); @@ -1142,39 +1142,39 @@ static void test_profile_struct(void) ok(!strcmp(buffer, "616261637573006F"), "got %s\n", debugstr_a(buffer));
ret = WritePrivateProfileStringA("s", "key", "636163747573006F", "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetPrivateProfileStructA("s", "key", buffer, 7, "./winetest.ini"); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INVALID_DATA, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStringA("s", "key", "6361637475730083", "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileStructA("s", "key", buffer, 7, "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(buffer, "cactus"), "data didn't match\n");
ret = WritePrivateProfileStringA("s", "key", "636163747573008Q", "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetPrivateProfileStructA("s", "key", buffer, 7, "./winetest.ini"); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INVALID_DATA, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStringA("s", "key", "16361637475730083", "./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = GetPrivateProfileStructA("s", "key", buffer, 7, "./winetest.ini"); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_BAD_LENGTH, "got error %lu\n", GetLastError());
ret = DeleteFileA("./winetest.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); }
static void check_registry_value_(int line, HKEY key, const char *value, const char *expect) @@ -1185,9 +1185,9 @@ static void check_registry_value_(int line, HKEY key, const char *value, const c
memset(buffer, 0xcc, sizeof(buffer)); ret = RegQueryValueExA(key, value, 0, &type, (BYTE *)buffer, &size); - ok_(__FILE__, line)(!ret, "got error %u\n", ret); + ok_(__FILE__, line)(!ret, "got error %lu\n", ret); ok_(__FILE__, line)(!strcmp(buffer, expect), "expected %s, got %s\n", debugstr_a(expect), debugstr_a(buffer)); - ok_(__FILE__, line)(type == REG_SZ, "got type %u\n", type); + ok_(__FILE__, line)(type == REG_SZ, "got type %lu\n", type); } #define check_registry_value(a, b, c) check_registry_value_(__LINE__, a, b, c)
@@ -1200,7 +1200,7 @@ static void test_registry_mapping(void)
/* impersonate ourselves to prevent registry virtualization */ ret = ImpersonateSelf(SecurityImpersonation); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\winetest_map.ini", @@ -1210,27 +1210,27 @@ static void test_registry_mapping(void) skip("Not enough permissions to write to the IniFileMapping key.\n"); return; } - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret);
ret = RegSetValueExA(mapping_key, "section1", 0, REG_SZ, (BYTE *)"USR:winetest_map", sizeof("USR:winetest_map")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section1", "name1", "winetest_map.ini", "default");
ret = WritePrivateProfileStringA("section1", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section1", "name1", "winetest_map.ini", "value1"); check_profile_string("section1", "name1", "C:/fake/path/winetest_map.ini", "value1");
ret = RegOpenKeyExA(HKEY_CURRENT_USER, "winetest_map", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_registry_value(mapped_key, "name1", "value1");
ret = RegSetValueExA(mapped_key, "name2", 0, REG_SZ, (BYTE *)"value2", sizeof("value2")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret);
check_profile_string("section1", "name2", "winetest_map.ini", "value2");
@@ -1238,40 +1238,40 @@ static void test_registry_mapping(void) ok(ret == INVALID_FILE_ATTRIBUTES, "winetest_map.ini should not exist.\n");
ret = WritePrivateProfileStringA("section1", "name2", NULL, "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = RegQueryValueExA(mapped_key, "name2", 0, NULL, NULL, NULL); - ok(ret == ERROR_FILE_NOT_FOUND, "got error %u\n", ret); + ok(ret == ERROR_FILE_NOT_FOUND, "got error %lu\n", ret);
/* Test non-string types. */
ret = RegSetValueExA(mapped_key, "name3", 0, REG_DWORD, (BYTE *)&ivalue, sizeof(ivalue)); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section1", "name3", "winetest_map.ini", "default");
ret = GetPrivateProfileIntA("section1", "name3", 0, "winetest_map.ini"); - ok(ret == 0, "got %#x\n", ret); + ok(ret == 0, "got %#lx\n", ret);
ret = RegSetValueExA(mapped_key, "name3", 0, REG_BINARY, (BYTE *)"value3", sizeof("value3")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section1", "name3", "winetest_map.ini", "default");
ret = RegSetValueExA(mapped_key, "name3", 0, REG_MULTI_SZ, (BYTE *)"one\0two\0", sizeof("one\0two\0")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section1", "name3", "winetest_map.ini", "default");
ret = RegSetValueExA(mapped_key, "name3", 0, REG_EXPAND_SZ, (BYTE *)"x%SystemRoot%", sizeof("x%SystemRoot%")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section1", "name3", "winetest_map.ini", "default");
/* Test WritePrivateProfileSection(). Unlike with .ini files, it doesn't * remove existing entries. */
ret = WritePrivateProfileStringA("section1", "name4", "value4", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = WritePrivateProfileStringA("section1", "name5", "value5", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = WritePrivateProfileSectionA("section1", "name4=four\0name6=six\0", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section1", "name4", "winetest_map.ini", "four"); check_profile_string("section1", "name5", "winetest_map.ini", "value5"); check_profile_string("section1", "name6", "winetest_map.ini", "six"); @@ -1281,74 +1281,74 @@ static void test_registry_mapping(void) RegCloseKey(mapped_key);
ret = RegCreateKeyExA(HKEY_CURRENT_USER, "winetest_map\subkey", 0, NULL, 0, 0, NULL, &mapped_key, NULL); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
ret = WritePrivateProfileStringA("section1", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = WritePrivateProfileStringA("section1", NULL, NULL, "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section1", "name1", "winetest_map.ini", "default");
ret = WritePrivateProfileStringA("section1", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = WritePrivateProfileSectionA("section1", NULL, "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section1", "name1", "winetest_map.ini", "default");
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "winetest_map\subkey"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegDeleteKeyA(HKEY_CURRENT_USER, "winetest_map"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret);
/* Test GetPrivateProfileSectionNames(). */
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionNamesA(buffer, 5, "winetest_map.ini"); - ok(ret == 3, "got %u\n", ret); + ok(ret == 3, "got %lu\n", ret); ok(!memcmp(buffer, "sec\0", 5), "got %s\n", debugstr_an(buffer, ret));
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionNamesA(buffer, sizeof(buffer), "winetest_map.ini"); - ok(ret == 9, "got %u\n", ret); + ok(ret == 9, "got %lu\n", ret); ok(!memcmp(buffer, "section1\0", 10), "got %s\n", debugstr_an(buffer, ret));
ret = WritePrivateProfileStringA("file_section", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionNamesA(buffer, 5, "winetest_map.ini"); - ok(ret == 3, "got %u\n", ret); + ok(ret == 3, "got %lu\n", ret); ok(!memcmp(buffer, "sec\0", 5), "got %s\n", debugstr_an(buffer, ret));
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionNamesA(buffer, sizeof(buffer), "winetest_map.ini"); - ok(ret == 22, "got %u\n", ret); + ok(ret == 22, "got %lu\n", ret); ok(!memcmp(buffer, "section1\0file_section\0", 23), "got %s\n", debugstr_an(buffer, ret));
ret = DeleteFileA("C:/windows/winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
/* Test the SYS: prefix. */
ret = RegSetValueExA(mapping_key, "section2", 0, REG_SZ, (BYTE *)"SYS:winetest_map", sizeof("SYS:winetest_map")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section2", "name1", "winetest_map.ini", "default");
ret = WritePrivateProfileStringA("section2", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section2", "name1", "winetest_map.ini", "value1");
ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\winetest_map", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_registry_value(mapped_key, "name1", "value1");
ret = RegSetValueExA(mapped_key, "name2", 0, REG_SZ, (BYTE *)"value2", sizeof("value2")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret);
check_profile_string("section2", "name2", "winetest_map.ini", "value2");
@@ -1356,75 +1356,75 @@ static void test_registry_mapping(void) ok(ret == INVALID_FILE_ATTRIBUTES, "winetest_map.ini should not exist.\n");
ret = RegDeleteKeyA(mapped_key, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
/* Try writing directly to the .ini file on disk instead. */
ret = WritePrivateProfileStringA("section3", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section3", "name1", "winetest_map.ini", "value1");
ret = RegSetValueExA(mapping_key, "section3", 0, REG_SZ, (BYTE *)"USR:winetest_map", sizeof("USR:winetest_map")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section3", "name1", "winetest_map.ini", "default");
ret = RegOpenKeyExA(HKEY_CURRENT_USER, "winetest_section3", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(ret == ERROR_FILE_NOT_FOUND, "got error %u\n", ret); + ok(ret == ERROR_FILE_NOT_FOUND, "got error %lu\n", ret);
ret = WritePrivateProfileStringA("section3", "name1", "value2", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section3", "name1", "winetest_map.ini", "value2");
ret = RegOpenKeyExA(HKEY_CURRENT_USER, "winetest_map", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret);
ret = RegDeleteKeyA(mapped_key, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
ret = RegDeleteValueA(mapping_key, "section3"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section3", "name1", "winetest_map.ini", "value1");
ret = DeleteFileA("C:/windows/winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
/* Test default keys. */
ret = WritePrivateProfileStringA("section4", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
check_profile_string("section4", "name1", "winetest_map.ini", "value1");
ret = DeleteFileA("C:/windows/winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = RegSetValueExA(mapping_key, NULL, 0, REG_SZ, (BYTE *)"SYS:winetest_default", sizeof("SYS:winetest_default")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStringA("section4", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\winetest_default\section4", 0, KEY_READ, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_registry_value(mapped_key, "name1", "value1"); RegCloseKey(mapped_key);
ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\winetest_default\section5", 0, NULL, 0, KEY_WRITE, NULL, &mapped_key, NULL); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegSetValueExA(mapped_key, "name2", 0, REG_SZ, (BYTE *)"value2", sizeof("value2")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
check_profile_string("section5", "name2", "winetest_map.ini", "value2"); @@ -1435,157 +1435,157 @@ static void test_registry_mapping(void) ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\winetest_default\Section4"); ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\winetest_default\Section5"); ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\winetest_default"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegDeleteValueA(mapping_key, NULL); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret);
/* Test name-specific mapping. */
ret = RegCreateKeyExA(mapping_key, "section6", 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &mapping_subkey, NULL); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegSetValueExA(mapping_subkey, "name1", 0, REG_SZ, (BYTE *)"USR:winetest_name1", sizeof("USR:winetest_name1")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegSetValueExA(mapping_subkey, "name2", 0, REG_SZ, (BYTE *)"SYS:winetest_name2", sizeof("SYS:winetest_name2")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStringA("section6", "name1", "value1", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section6", "name1", "winetest_map.ini", "value1");
ret = RegOpenKeyExA(HKEY_CURRENT_USER, "winetest_name1", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_registry_value(mapped_key, "name1", "value1");
ret = RegSetValueExA(mapped_key, "name1", 0, REG_SZ, (BYTE *)"one", sizeof("one")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section6", "name1", "winetest_map.ini", "one");
ret = RegDeleteKeyA(mapped_key, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
ret = WritePrivateProfileStringA("section6", "name2", "value2", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\winetest_name2", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_registry_value(mapped_key, "name2", "value2");
ret = RegSetValueExA(mapped_key, "name2", 0, REG_SZ, (BYTE *)"two", sizeof("two")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section6", "name2", "winetest_map.ini", "two");
ret = RegDeleteKeyA(mapped_key, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
ret = WritePrivateProfileStringA("section6", "name3", "value3", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section6", "name3", "winetest_map.ini", "value3"); ret = DeleteFileA("C:/windows/winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
/* Test name-specific mapping with Get/WritePrivateProfileSection(). */
ret = WritePrivateProfileStringA("section6", "name2", "value2", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStringA("section6", "name3", "value3", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = WritePrivateProfileSectionA("section6", "name1=one\0name3=three\0", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section6", "name1", "winetest_map.ini", "one"); check_profile_string("section6", "name2", "winetest_map.ini", "value2"); check_profile_string("section6", "name3", "winetest_map.ini", "value3");
ret = RegOpenKeyExA(HKEY_CURRENT_USER, "winetest_name1", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegDeleteValueA(mapped_key, "name1"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionA("section6", buffer, 5, "winetest_map.ini"); - ok(ret == 3, "got %u\n", ret); + ok(ret == 3, "got %lu\n", ret); ok(!memcmp(buffer, "nam\0", 5), "got %s\n", debugstr_an(buffer, ret));
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionA("section6", buffer, sizeof(buffer), "winetest_map.ini"); - ok(ret == 26, "got %u\n", ret); + ok(ret == 26, "got %lu\n", ret); ok(!memcmp(buffer, "name2=value2\0name3=value3\0", 27), "got %s\n", debugstr_an(buffer, ret));
ret = WritePrivateProfileStringA("section6", NULL, NULL, "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section6", "name1", "winetest_map.ini", "default"); check_profile_string("section6", "name2", "winetest_map.ini", "default"); check_profile_string("section6", "name3", "winetest_map.ini", "default");
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "winetest_name1"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\winetest_name2"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = DeleteFileA("C:/windows/winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
/* Test name-specific mapping with a default value. */
ret = RegSetValueExA(mapping_subkey, NULL, 0, REG_SZ, (BYTE *)"USR:winetest_default", sizeof("USR:winetest_default")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = WritePrivateProfileStringA(NULL, NULL, NULL, "winetest_map.ini"); - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
ret = WritePrivateProfileStringA("section6", "name2", "value2", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = WritePrivateProfileStringA("section6", "name3", "value3", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = RegOpenKeyExA(HKEY_CURRENT_USER, "winetest_default", 0, KEY_READ | KEY_WRITE, &mapped_key); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_registry_value(mapped_key, "name3", "value3");
ret = RegSetValueExA(mapped_key, "name3", 0, REG_SZ, (BYTE *)"three", sizeof("three")); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); check_profile_string("section6", "name3", "winetest_map.ini", "three");
memset(buffer, 0xcc, sizeof(buffer)); ret = GetPrivateProfileSectionA("section6", buffer, sizeof(buffer), "winetest_map.ini"); - ok(ret == 25, "got %u\n", ret); + ok(ret == 25, "got %lu\n", ret); todo_wine ok(!memcmp(buffer, "name2=value2\0name3=three\0", 26), "got %s\n", debugstr_an(buffer, ret));
ret = WritePrivateProfileSectionA("section6", "name2=duo\0name3=treis\0", "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section6", "name2", "winetest_map.ini", "duo"); check_profile_string("section6", "name3", "winetest_map.ini", "treis");
ret = WritePrivateProfileStringA("section6", NULL, NULL, "winetest_map.ini"); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); check_profile_string("section6", "name2", "winetest_map.ini", "default"); check_profile_string("section6", "name3", "winetest_map.ini", "default");
ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\winetest_name2"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegDeleteKeyA(HKEY_CURRENT_USER, "winetest_name1"); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); ret = RegDeleteKeyA(mapped_key, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapped_key);
ret = RegDeleteKeyA(mapping_subkey, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapping_subkey);
ret = RegDeleteKeyA(mapping_key, ""); - ok(!ret, "got error %u\n", ret); + ok(!ret, "got error %lu\n", ret); RegCloseKey(mapping_key);
ret = DeleteFileA("C:/windows/winetest_map.ini"); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %lu\n", GetLastError()); ret = RevertToSelf(); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); }
START_TEST(profile) diff --git a/dlls/kernel32/tests/resource.c b/dlls/kernel32/tests/resource.c index bca0298044f..6c5bc99c0c5 100644 --- a/dlls/kernel32/tests/resource.c +++ b/dlls/kernel32/tests/resource.c @@ -332,10 +332,10 @@ static void update_resources_version( void ) MAKEINTRESOURCEA(0x4567), 0xabcd, foo, sizeof foo ); - ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError()); + ok( r == TRUE, "UpdateResource failed: %ld\n", GetLastError());
r = EndUpdateResourceA( res, FALSE ); - ok( r, "EndUpdateResource failed: %d\n", GetLastError()); + ok( r, "EndUpdateResource failed: %ld\n", GetLastError()); }
static void update_resources_bigdata( void ) @@ -352,7 +352,7 @@ static void update_resources_bigdata( void ) MAKEINTRESOURCEA(0x5647), 0xcdba, foo, sizeof foo ); - ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError()); + ok( r == TRUE, "UpdateResource failed: %ld\n", GetLastError());
r = EndUpdateResourceA( res, FALSE ); ok( r, "EndUpdateResource failed\n"); @@ -367,27 +367,27 @@ static void update_resources_name( void ) BOOL ret;
res = BeginUpdateResourceA( filename, TRUE ); - ok( res != NULL, "BeginUpdateResource failed: %u\n", GetLastError() ); + ok( res != NULL, "BeginUpdateResource failed: %lu\n", GetLastError() ); if ( !res ) return;
ret = UpdateResourceA( res, res_type, res_name, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), foo, sizeof(foo) ); - ok( ret == TRUE, "UpdateResource failed: %u\n", GetLastError() ); + ok( ret == TRUE, "UpdateResource failed: %lu\n", GetLastError() );
ret = EndUpdateResourceA( res, FALSE ); - ok( ret, "EndUpdateResource failed: %u\n", GetLastError() ); + ok( ret, "EndUpdateResource failed: %lu\n", GetLastError() ); if ( !ret ) return;
module = LoadLibraryExA( filename, NULL, LOAD_LIBRARY_AS_DATAFILE ); - ok( module != NULL, "LoadLibraryEx failed: %u\n", GetLastError() ); + ok( module != NULL, "LoadLibraryEx failed: %lu\n", GetLastError() ); if ( !module ) return;
rsrc = FindResourceA( module, res_name, res_type ); ok( rsrc != NULL || broken( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND ) /* win2008 */, - "FindResource failed: %u\n", GetLastError() ); + "FindResource failed: %lu\n", GetLastError() );
ret = FreeLibrary(module); - ok( ret, "FreeLibrary failed: %u\n", GetLastError() ); + ok( ret, "FreeLibrary failed: %lu\n", GetLastError() ); }
static void check_exe( const sec_verify *verify ) @@ -402,7 +402,7 @@ static void check_exe( const sec_verify *verify ) DWORD length, sec_count = 0;
file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); - ok (file != INVALID_HANDLE_VALUE, "failed to create file (%d)\n", GetLastError()); + ok (file != INVALID_HANDLE_VALUE, "failed to create file (%ld)\n", GetLastError());
length = GetFileSize( file, NULL ); ok( length >= verify->length, "file size wrong\n"); @@ -423,11 +423,11 @@ static void check_exe( const sec_verify *verify ) for(i = 0; i < max_sections; i++) if (verify->sect_out[i]) { - ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %d name wrong\n", sec_count); - ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %d vaddr wrong\n", sec_count); - ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %d SizeOfRawData wrong (%d vs %d)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData); - ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %d PointerToRawData wrong\n", sec_count); - ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %d characteristics wrong\n", sec_count); + ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %ld name wrong\n", sec_count); + ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %ld vaddr wrong\n", sec_count); + ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %ld SizeOfRawData wrong (%ld vs %ld)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData); + ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %ld PointerToRawData wrong\n", sec_count); + ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %ld characteristics wrong\n", sec_count); sec_count++; }
@@ -438,17 +438,17 @@ static void check_exe( const sec_verify *verify ) dir = (void*) ((BYTE*) dos + sec[verify->rsrc_section].VirtualAddress);
ok( dir->Characteristics == 0, "Characteristics wrong\n"); - ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong %u\n", dir->TimeDateStamp); + ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong %lu\n", dir->TimeDateStamp); ok( dir->MajorVersion == 4, "MajorVersion wrong\n"); ok( dir->MinorVersion == 0, "MinorVersion wrong\n");
- ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %d instead of %d\n", + ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %ld instead of %d\n", verify->NumberOfNamedEntries, dir->NumberOfNamedEntries); - ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %d instead of %d\n", + ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %ld instead of %d\n", verify->NumberOfIdEntries, dir->NumberOfIdEntries);
ok(opt->DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY].VirtualAddress == sec[verify->rsrc_section].VirtualAddress, - "VirtualAddress in optional header should be %d instead of %d\n", + "VirtualAddress in optional header should be %ld instead of %ld\n", sec[verify->rsrc_section].VirtualAddress, opt->DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY].VirtualAddress); }
@@ -476,24 +476,24 @@ static void test_find_resource(void) SetLastError( 0xdeadbeef ); rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(1), (LPCWSTR)RT_DIALOG ); ok( !rsrc, "resource found\n" ); - ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(2), (LPCWSTR)RT_MENU ); ok( !rsrc, "resource found\n" ); - ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1), MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ) ); ok( !rsrc, "resource found\n" ); - ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1), MAKELANGID( LANG_FRENCH, SUBLANG_DEFAULT ) ); ok( !rsrc, "resource found\n" ); - ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %lu\n", GetLastError() ); }
typedef struct diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index a6ee90b81f3..93cae1c84d5 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -194,35 +194,35 @@ static void test_mutex(void) SetLastError(0xdeadbeef); hOpened = OpenMutexA(0, FALSE, "WineTestMutex"); ok(hOpened == NULL, "OpenMutex succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); hCreated = CreateMutexA(NULL, FALSE, "WineTestMutex"); - ok(hCreated != NULL, "CreateMutex failed with error %d\n", GetLastError()); + ok(hCreated != NULL, "CreateMutex failed with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); hOpened = OpenMutexA(0, FALSE, "WineTestMutex"); todo_wine ok(hOpened == NULL, "OpenMutex succeeded\n"); todo_wine - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); hOpened = OpenMutexA(GENERIC_EXECUTE, FALSE, "WineTestMutex"); - ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError()); + ok(hOpened != NULL, "OpenMutex failed with error %ld\n", GetLastError()); wait_ret = WaitForSingleObject(hOpened, INFINITE); - ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error %d\n", GetLastError()); + ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error %ld\n", GetLastError()); CloseHandle(hOpened);
for(i=0; i < 31; i++) { wait_ret = WaitForSingleObject(hCreated, INFINITE); - ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error 0x%08x\n", wait_ret); + ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error 0x%08lx\n", wait_ret); }
SetLastError(0xdeadbeef); hOpened = OpenMutexA(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex"); - ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError()); + ok(hOpened != NULL, "OpenMutex failed with error %ld\n", GetLastError()); wait_ret = WaitForSingleObject(hOpened, INFINITE); ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n"); CloseHandle(hOpened); @@ -235,60 +235,60 @@ static void test_mutex(void) { SetLastError(0xdeadbeef); ret = ReleaseMutex(hOpened); - ok(ret, "ReleaseMutex failed with error %d, access %x\n", GetLastError(), 1 << i); + ok(ret, "ReleaseMutex failed with error %ld, access %x\n", GetLastError(), 1 << i); CloseHandle(hOpened); } else { if ((1 << i) == ACCESS_SYSTEM_SECURITY) - todo_wine ok(GetLastError() == ERROR_PRIVILEGE_NOT_HELD, "wrong error %u, access %x\n", GetLastError(), 1 << i); + todo_wine ok(GetLastError() == ERROR_PRIVILEGE_NOT_HELD, "wrong error %lu, access %x\n", GetLastError(), 1 << i); else - todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u, , access %x\n", GetLastError(), 1 << i); + todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu, , access %x\n", GetLastError(), 1 << i); ReleaseMutex(hCreated); failed |=0x1 << i; } }
todo_wine - ok( failed == 0x0de0fffe, "open succeeded when it shouldn't: %x\n", failed); + ok( failed == 0x0de0fffe, "open succeeded when it shouldn't: %lx\n", failed);
SetLastError(0xdeadbeef); ret = ReleaseMutex(hCreated); ok(!ret && (GetLastError() == ERROR_NOT_OWNER), - "ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %d\n", GetLastError()); + "ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %ld\n", GetLastError());
/* test case sensitivity */
SetLastError(0xdeadbeef); hOpened = OpenMutexA(READ_CONTROL, FALSE, "WINETESTMUTEX"); ok(!hOpened, "OpenMutex succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); hOpened = OpenMutexA(READ_CONTROL, FALSE, "winetestmutex"); ok(!hOpened, "OpenMutex succeeded\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); hOpened = OpenMutexA(READ_CONTROL, FALSE, NULL); ok(!hOpened, "OpenMutex succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); hOpened = OpenMutexW(READ_CONTROL, FALSE, NULL); ok(!hOpened, "OpenMutex succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); hOpened = CreateMutexA(NULL, FALSE, "WineTestMutex"); - ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError()); - ok(GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); + ok(hOpened != NULL, "CreateMutex failed with error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %lu\n", GetLastError()); CloseHandle(hOpened);
SetLastError(0xdeadbeef); hOpened = CreateMutexA(NULL, FALSE, "WINETESTMUTEX"); - ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError()); - ok(GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok(hOpened != NULL, "CreateMutex failed with error %ld\n", GetLastError()); + ok(GetLastError() == 0, "wrong error %lu\n", GetLastError()); CloseHandle(hOpened);
CloseHandle(hCreated); @@ -476,7 +476,7 @@ static void test_event(void)
/* no sd */ handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); - ok(handle != NULL, "CreateEventW with blank sd failed with error %d\n", GetLastError()); + ok(handle != NULL, "CreateEventW with blank sd failed with error %ld\n", GetLastError()); CloseHandle(handle);
sa.nLength = sizeof(sa); @@ -487,60 +487,60 @@ static void test_event(void)
/* blank sd */ handle = CreateEventA(&sa, FALSE, FALSE, __FILE__ ": Test Event"); - ok(handle != NULL, "CreateEventW with blank sd failed with error %d\n", GetLastError()); + ok(handle != NULL, "CreateEventW with blank sd failed with error %ld\n", GetLastError()); CloseHandle(handle);
/* sd with NULL dacl */ SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE); handle = CreateEventA(&sa, FALSE, FALSE, __FILE__ ": Test Event"); - ok(handle != NULL, "CreateEventW with blank sd failed with error %d\n", GetLastError()); + ok(handle != NULL, "CreateEventW with blank sd failed with error %ld\n", GetLastError()); CloseHandle(handle);
/* sd with empty dacl */ InitializeAcl(&acl, sizeof(acl), ACL_REVISION); SetSecurityDescriptorDacl(&sd, TRUE, &acl, FALSE); handle = CreateEventA(&sa, FALSE, FALSE, __FILE__ ": Test Event"); - ok(handle != NULL, "CreateEventW with blank sd failed with error %d\n", GetLastError()); + ok(handle != NULL, "CreateEventW with blank sd failed with error %ld\n", GetLastError()); CloseHandle(handle);
/* test case sensitivity */
SetLastError(0xdeadbeef); handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); - ok( handle != NULL, "CreateEvent failed with error %u\n", GetLastError()); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok( handle != NULL, "CreateEvent failed with error %lu\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); - ok( handle2 != NULL, "CreateEvent failed with error %d\n", GetLastError()); - ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateEvent failed with error %ld\n", GetLastError()); + ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": TEST EVENT"); - ok( handle2 != NULL, "CreateEvent failed with error %d\n", GetLastError()); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateEvent failed with error %ld\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenEventA( EVENT_ALL_ACCESS, FALSE, __FILE__ ": Test Event"); - ok( handle2 != NULL, "OpenEvent failed with error %d\n", GetLastError()); + ok( handle2 != NULL, "OpenEvent failed with error %ld\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenEventA( EVENT_ALL_ACCESS, FALSE, __FILE__ ": TEST EVENT"); ok( !handle2, "OpenEvent succeeded\n"); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = OpenEventA( EVENT_ALL_ACCESS, FALSE, NULL ); ok( !handle2, "OpenEvent succeeded\n"); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = OpenEventW( EVENT_ALL_ACCESS, FALSE, NULL ); ok( !handle2, "OpenEvent succeeded\n"); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
CloseHandle( handle );
@@ -553,27 +553,27 @@ static void test_event(void) } handle = pCreateMemoryResourceNotification( HighMemoryResourceNotification + 1 ); ok( !handle, "CreateMemoryResourceNotification succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); ret = pQueryMemoryResourceNotification( handle, &val ); ok( !ret, "QueryMemoryResourceNotification succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
handle = pCreateMemoryResourceNotification( LowMemoryResourceNotification ); - ok( handle != 0, "CreateMemoryResourceNotification failed err %u\n", GetLastError() ); + ok( handle != 0, "CreateMemoryResourceNotification failed err %lu\n", GetLastError() ); ret = WaitForSingleObject( handle, 10 ); - ok( ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT, "WaitForSingleObject wrong ret %u\n", ret ); + ok( ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT, "WaitForSingleObject wrong ret %lu\n", ret );
val = ~0; ret = pQueryMemoryResourceNotification( handle, &val ); - ok( ret, "QueryMemoryResourceNotification failed err %u\n", GetLastError() ); + ok( ret, "QueryMemoryResourceNotification failed err %lu\n", GetLastError() ); ok( val == FALSE || val == TRUE, "wrong value %u\n", val ); ret = CloseHandle( handle ); - ok( ret, "CloseHandle failed err %u\n", GetLastError() ); + ok( ret, "CloseHandle failed err %lu\n", GetLastError() );
handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); val = ~0; ret = pQueryMemoryResourceNotification( handle, &val ); - ok( ret, "QueryMemoryResourceNotification failed err %u\n", GetLastError() ); + ok( ret, "QueryMemoryResourceNotification failed err %lu\n", GetLastError() ); ok( val == FALSE || val == TRUE, "wrong value %u\n", val ); CloseHandle( handle ); } @@ -586,40 +586,40 @@ static void test_semaphore(void)
SetLastError(0xdeadbeef); handle = CreateSemaphoreA(NULL, 0, 1, __FILE__ ": Test Semaphore"); - ok(handle != NULL, "CreateSemaphore failed with error %u\n", GetLastError()); - ok(GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok(handle != NULL, "CreateSemaphore failed with error %lu\n", GetLastError()); + ok(GetLastError() == 0, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = CreateSemaphoreA(NULL, 0, 1, __FILE__ ": Test Semaphore"); - ok( handle2 != NULL, "CreateSemaphore failed with error %d\n", GetLastError()); - ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateSemaphore failed with error %ld\n", GetLastError()); + ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = CreateSemaphoreA(NULL, 0, 1, __FILE__ ": TEST SEMAPHORE"); - ok( handle2 != NULL, "CreateSemaphore failed with error %d\n", GetLastError()); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateSemaphore failed with error %ld\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenSemaphoreA( SEMAPHORE_ALL_ACCESS, FALSE, __FILE__ ": Test Semaphore"); - ok( handle2 != NULL, "OpenSemaphore failed with error %d\n", GetLastError()); + ok( handle2 != NULL, "OpenSemaphore failed with error %ld\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenSemaphoreA( SEMAPHORE_ALL_ACCESS, FALSE, __FILE__ ": TEST SEMAPHORE"); ok( !handle2, "OpenSemaphore succeeded\n"); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = OpenSemaphoreA( SEMAPHORE_ALL_ACCESS, FALSE, NULL ); ok( !handle2, "OpenSemaphore succeeded\n"); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = OpenSemaphoreW( SEMAPHORE_ALL_ACCESS, FALSE, NULL ); ok( !handle2, "OpenSemaphore succeeded\n"); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
CloseHandle( handle ); } @@ -632,40 +632,40 @@ static void test_waitable_timer(void)
SetLastError(0xdeadbeef); handle = CreateWaitableTimerA(NULL, FALSE, __FILE__ ": Test WaitableTimer"); - ok(handle != NULL, "CreateWaitableTimer failed with error %u\n", GetLastError()); - ok(GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok(handle != NULL, "CreateWaitableTimer failed with error %lu\n", GetLastError()); + ok(GetLastError() == 0, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = CreateWaitableTimerA(NULL, FALSE, __FILE__ ": Test WaitableTimer"); - ok( handle2 != NULL, "CreateWaitableTimer failed with error %d\n", GetLastError()); - ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateWaitableTimer failed with error %ld\n", GetLastError()); + ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = CreateWaitableTimerA(NULL, FALSE, __FILE__ ": TEST WAITABLETIMER"); - ok( handle2 != NULL, "CreateWaitableTimer failed with error %d\n", GetLastError()); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateWaitableTimer failed with error %ld\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenWaitableTimerA( TIMER_ALL_ACCESS, FALSE, __FILE__ ": Test WaitableTimer"); - ok( handle2 != NULL, "OpenWaitableTimer failed with error %d\n", GetLastError()); + ok( handle2 != NULL, "OpenWaitableTimer failed with error %ld\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenWaitableTimerA( TIMER_ALL_ACCESS, FALSE, __FILE__ ": TEST WAITABLETIMER"); ok( !handle2, "OpenWaitableTimer succeeded\n"); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = OpenWaitableTimerA( TIMER_ALL_ACCESS, FALSE, NULL ); - ok( !handle2, "OpenWaitableTimer failed with error %d\n", GetLastError()); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok( !handle2, "OpenWaitableTimer failed with error %ld\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = OpenWaitableTimerW( TIMER_ALL_ACCESS, FALSE, NULL ); - ok( !handle2, "OpenWaitableTimer failed with error %d\n", GetLastError()); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok( !handle2, "OpenWaitableTimer failed with error %ld\n", GetLastError()); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
CloseHandle( handle ); } @@ -702,35 +702,35 @@ static void test_iocp_callback(void) ok(sem != INVALID_HANDLE_VALUE, "Creating a semaphore failed\n");
ret = GetTempPathA(MAX_PATH, temp_path); - ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); + ok(ret != 0, "GetTempPathA error %ld\n", GetLastError()); ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetTempFileNameA(temp_path, prefix, 0, filename); - ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + ok(ret != 0, "GetTempFileNameA error %ld\n", GetLastError());
hFile = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %d\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %ld\n", GetLastError());
retb = p_BindIoCompletionCallback(hFile, iocp_callback, 0); ok(retb == FALSE, "BindIoCompletionCallback succeeded on a file that wasn't created with FILE_FLAG_OVERLAPPED\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error is %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error is %ld\n", GetLastError());
ret = CloseHandle(hFile); - ok( ret, "CloseHandle: error %d\n", GetLastError()); + ok( ret, "CloseHandle: error %ld\n", GetLastError()); ret = DeleteFileA(filename); - ok( ret, "DeleteFileA: error %d\n", GetLastError()); + ok( ret, "DeleteFileA: error %ld\n", GetLastError());
hFile = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_OVERLAPPED, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %d\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %ld\n", GetLastError());
retb = p_BindIoCompletionCallback(hFile, iocp_callback, 0); ok(retb == TRUE, "BindIoCompletionCallback failed\n");
memset(&overlapped, 0, sizeof(overlapped)); retb = WriteFile(hFile, buffer, 4, &bytesWritten, &overlapped); - ok(retb == TRUE || GetLastError() == ERROR_IO_PENDING, "WriteFile failed, lastError = %d\n", GetLastError()); + ok(retb == TRUE || GetLastError() == ERROR_IO_PENDING, "WriteFile failed, lastError = %ld\n", GetLastError());
ret = WaitForSingleObject(sem, 5000); ok(ret == WAIT_OBJECT_0, "Wait for the IO completion callback failed\n"); @@ -738,37 +738,37 @@ static void test_iocp_callback(void)
retb = p_BindIoCompletionCallback(hFile, iocp_callback, 0); ok(retb == FALSE, "BindIoCompletionCallback succeeded when setting the same callback on the file again\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error is %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error is %ld\n", GetLastError()); retb = p_BindIoCompletionCallback(hFile, NULL, 0); ok(retb == FALSE, "BindIoCompletionCallback succeeded when setting the callback to NULL\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error is %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error is %ld\n", GetLastError());
ret = CloseHandle(hFile); - ok( ret, "CloseHandle: error %d\n", GetLastError()); + ok( ret, "CloseHandle: error %ld\n", GetLastError()); ret = DeleteFileA(filename); - ok( ret, "DeleteFileA: error %d\n", GetLastError()); + ok( ret, "DeleteFileA: error %ld\n", GetLastError());
/* win2k3 requires the Flags parameter to be zero */ SetLastError(0xdeadbeef); hFile = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_OVERLAPPED, 0); - ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %d\n", GetLastError()); + ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %ld\n", GetLastError()); retb = p_BindIoCompletionCallback(hFile, iocp_callback, 12345); if (!retb) ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); else ok(retb == TRUE, "BindIoCompletionCallback failed with Flags != 0\n"); ret = CloseHandle(hFile); - ok( ret, "CloseHandle: error %d\n", GetLastError()); + ok( ret, "CloseHandle: error %ld\n", GetLastError()); ret = DeleteFileA(filename); - ok( ret, "DeleteFileA: error %d\n", GetLastError()); + ok( ret, "DeleteFileA: error %ld\n", GetLastError());
retb = p_BindIoCompletionCallback(NULL, iocp_callback, 0); ok(retb == FALSE, "BindIoCompletionCallback succeeded on a NULL file\n"); ok(GetLastError() == ERROR_INVALID_HANDLE || GetLastError() == ERROR_INVALID_PARAMETER, /* vista */ - "Last error is %d\n", GetLastError()); + "Last error is %ld\n", GetLastError()); }
static void CALLBACK timer_queue_cb1(PVOID p, BOOLEAN timedOut) @@ -888,7 +888,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = DeleteTimerQueueEx(q, NULL); ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError());
/* Test synchronous deletion of the queue and running timers. */ @@ -904,7 +904,7 @@ static void test_timer_queue(void) ret0 = DeleteTimerQueueTimer(q, t0, NULL); ok((!ret0 && GetLastError() == ERROR_IO_PENDING) || broken(ret0), /* Win 2000 & XP & 2003 */ - "DeleteTimerQueueTimer ret=%d le=%u\n", ret0, GetLastError()); + "DeleteTimerQueueTimer ret=%d le=%lu\n", ret0, GetLastError());
/* Called once. */ t1 = NULL; @@ -1006,21 +1006,21 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = DeleteTimerQueueTimer(q, t1, NULL); ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteTimerQueueTimer(q, t2, NULL); ok(!ret, "DeleteTimerQueueTimer call was expected to fail\n"); ok(GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteTimerQueueTimer(q, t3, et1); ok(ret, "DeleteTimerQueueTimer call was expected to fail\n"); ok(GetLastError() == 0xdeadbeef, - "DeleteTimerQueueTimer, GetLastError: expected 0xdeadbeef, got %d\n", + "DeleteTimerQueueTimer, GetLastError: expected 0xdeadbeef, got %ld\n", GetLastError()); ok(WaitForSingleObject(et1, 250) == WAIT_OBJECT_0, "Timer destruction event not triggered\n"); @@ -1029,7 +1029,7 @@ static void test_timer_queue(void) ret = DeleteTimerQueueTimer(q, t4, et2); ok(!ret, "DeleteTimerQueueTimer call was expected to fail\n"); ok(GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError()); ok(WaitForSingleObject(et2, 1000) == WAIT_OBJECT_0, "Timer destruction event not triggered\n"); @@ -1037,7 +1037,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = DeleteTimerQueueEx(q, e); ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError()); ok(WaitForSingleObject(e, 250) == WAIT_OBJECT_0, "Queue destruction event not triggered\n"); @@ -1109,7 +1109,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = DeleteTimerQueueEx(q, NULL); ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError()); ok(d1.num_calls == 1, "DeleteTimerQueueTimer\n");
@@ -1159,13 +1159,13 @@ static void test_timer_queue(void) ret = DeleteTimerQueueEx(NULL, NULL); ok(!ret, "DeleteTimerQueueEx call was expected to fail\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, - "DeleteTimerQueueEx, GetLastError: expected ERROR_INVALID_HANDLE, got %d\n", + "DeleteTimerQueueEx, GetLastError: expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = DeleteTimerQueueEx(q, NULL); ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, - "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", + "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %ld\n", GetLastError()); }
@@ -1190,80 +1190,80 @@ static void test_WaitForSingleObject(void) /* invalid handle with different values for lower 2 bits */ SetLastError(0xdeadbeef); ret = WaitForSingleObject(invalid, 0); - ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %ld\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(invalid, 1), 0); - ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %ld\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(invalid, 2), 0); - ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %ld\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(invalid, 3), 0); - ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %d\n", ret); - ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(ret == WAIT_FAILED, "expected WAIT_FAILED, got %ld\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* valid handle with different values for lower 2 bits */ SetLastError(0xdeadbeef); ret = WaitForSingleObject(nonsignaled, 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(nonsignaled, 1), 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(nonsignaled, 2), 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(nonsignaled, 3), 0); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
/* valid handle with different values for lower 2 bits */ SetLastError(0xdeadbeef); ret = WaitForSingleObject(signaled, 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(signaled, 1), 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(signaled, 2), 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = WaitForSingleObject(modify_handle(signaled, 3), 0); - ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %d\n", ret); - ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %ld\n", ret); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
/* pseudo handles are allowed in WaitForSingleObject and NtWaitForSingleObject */ ret = WaitForSingleObject(GetCurrentProcess(), 100); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %u\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %lu\n", ret);
ret = WaitForSingleObject(GetCurrentThread(), 100); - ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %u\n", ret); + ok(ret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %lu\n", ret);
timeout.QuadPart = -1000000; status = pNtWaitForSingleObject(GetCurrentProcess(), FALSE, &timeout); - ok(status == STATUS_TIMEOUT, "expected STATUS_TIMEOUT, got %08x\n", status); + ok(status == STATUS_TIMEOUT, "expected STATUS_TIMEOUT, got %08lx\n", status);
timeout.QuadPart = -1000000; status = pNtWaitForSingleObject(GetCurrentThread(), FALSE, &timeout); - ok(status == STATUS_TIMEOUT, "expected STATUS_TIMEOUT, got %08x\n", status); + ok(status == STATUS_TIMEOUT, "expected STATUS_TIMEOUT, got %08lx\n", status);
CloseHandle(signaled); CloseHandle(nonsignaled); @@ -1287,15 +1287,15 @@ static void test_WaitForMultipleObjects(void)
/* a manual-reset event remains signaled, an auto-reset event is cleared */ r = WaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, maxevents, FALSE, 0); - ok( r == WAIT_OBJECT_0, "should signal lowest handle first, got %d\n", r); + ok( r == WAIT_OBJECT_0, "should signal lowest handle first, got %ld\n", r); r = WaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, maxevents, FALSE, 0); - ok( r == WAIT_OBJECT_0, "should signal handle #0 first, got %d\n", r); + ok( r == WAIT_OBJECT_0, "should signal handle #0 first, got %ld\n", r); ok(ResetEvent(maxevents[0]), "ResetEvent\n"); for (i=1; i<MAXIMUM_WAIT_OBJECTS; i++) { /* the lowest index is checked first and remaining events are untouched */ r = WaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, maxevents, FALSE, 0); - ok( r == WAIT_OBJECT_0+i, "should signal handle #%d first, got %d\n", i, r); + ok( r == WAIT_OBJECT_0+i, "should signal handle #%d first, got %ld\n", i, r); }
/* run same test with Nt* call */ @@ -1304,15 +1304,15 @@ static void test_WaitForMultipleObjects(void)
/* a manual-reset event remains signaled, an auto-reset event is cleared */ status = pNtWaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, maxevents, TRUE, FALSE, NULL); - ok(status == STATUS_WAIT_0, "should signal lowest handle first, got %08x\n", status); + ok(status == STATUS_WAIT_0, "should signal lowest handle first, got %08lx\n", status); status = pNtWaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, maxevents, TRUE, FALSE, NULL); - ok(status == STATUS_WAIT_0, "should signal handle #0 first, got %08x\n", status); + ok(status == STATUS_WAIT_0, "should signal handle #0 first, got %08lx\n", status); ok(ResetEvent(maxevents[0]), "ResetEvent\n"); for (i=1; i<MAXIMUM_WAIT_OBJECTS; i++) { /* the lowest index is checked first and remaining events are untouched */ status = pNtWaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, maxevents, TRUE, FALSE, NULL); - ok(status == STATUS_WAIT_0 + i, "should signal handle #%d first, got %08x\n", i, status); + ok(status == STATUS_WAIT_0 + i, "should signal handle #%d first, got %08lx\n", i, status); }
for (i=0; i<MAXIMUM_WAIT_OBJECTS; i++) @@ -1323,26 +1323,26 @@ static void test_WaitForMultipleObjects(void) maxevents[0] = GetCurrentProcess(); SetLastError(0xdeadbeef); r = WaitForMultipleObjects(1, maxevents, FALSE, 100); - todo_wine ok(r == WAIT_FAILED, "expected WAIT_FAILED, got %u\n", r); + todo_wine ok(r == WAIT_FAILED, "expected WAIT_FAILED, got %lu\n", r); todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, - "expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + "expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
maxevents[0] = GetCurrentThread(); SetLastError(0xdeadbeef); r = WaitForMultipleObjects(1, maxevents, FALSE, 100); - todo_wine ok(r == WAIT_FAILED, "expected WAIT_FAILED, got %u\n", r); + todo_wine ok(r == WAIT_FAILED, "expected WAIT_FAILED, got %lu\n", r); todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, - "expected ERROR_INVALID_HANDLE, got %u\n", GetLastError()); + "expected ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
timeout.QuadPart = -1000000; maxevents[0] = GetCurrentProcess(); status = pNtWaitForMultipleObjects(1, maxevents, TRUE, FALSE, &timeout); - todo_wine ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %08x\n", status); + todo_wine ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %08lx\n", status);
timeout.QuadPart = -1000000; maxevents[0] = GetCurrentThread(); status = pNtWaitForMultipleObjects(1, maxevents, TRUE, FALSE, &timeout); - todo_wine ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %08x\n", status); + todo_wine ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %08lx\n", status); }
static BOOL g_initcallback_ret, g_initcallback_called; @@ -1378,7 +1378,7 @@ static void test_initonce(void) g_initcallback_ret = TRUE; g_initctxt = NULL; ret = pInitOnceExecuteOnce(&initonce, initonce_callback, (void*)0xdeadbeef, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0x2, "got %p\n", initonce.Ptr); ok(g_initctxt == NULL, "got %p\n", g_initctxt); ok(g_initcallback_called, "got %d\n", g_initcallback_called); @@ -1387,7 +1387,7 @@ static void test_initonce(void) g_initctxt = NULL; g_initcallback_called = FALSE; ret = pInitOnceExecuteOnce(&initonce, initonce_callback, (void*)0xdeadbeef, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0x2, "got %p\n", initonce.Ptr); ok(g_initctxt == NULL, "got %p\n", g_initctxt); ok(!g_initcallback_called, "got %d\n", g_initcallback_called); @@ -1397,7 +1397,7 @@ static void test_initonce(void) /* 2 lower order bits should never be used, you'll get a crash in result */ g_initctxt = (void*)0xFFFFFFF0; ret = pInitOnceExecuteOnce(&initonce, initonce_callback, (void*)0xdeadbeef, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0xFFFFFFF2, "got %p\n", initonce.Ptr); ok(g_initctxt == (void*)0xFFFFFFF0, "got %p\n", g_initctxt); ok(g_initcallback_called, "got %d\n", g_initcallback_called); @@ -1409,7 +1409,7 @@ static void test_initonce(void) pInitOnceInitialize(&initonce); SetLastError( 0xdeadbeef ); ret = pInitOnceExecuteOnce(&initonce, initonce_callback, (void*)0xdeadbeef, &g_initctxt); - ok(!ret && GetLastError() == 0xdeadbeef, "got wrong ret value %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == 0xdeadbeef, "got wrong ret value %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == NULL, "got %p\n", initonce.Ptr); ok(g_initctxt == NULL, "got %p\n", g_initctxt); ok(g_initcallback_called, "got %d\n", g_initcallback_called); @@ -1419,7 +1419,7 @@ static void test_initonce(void) g_initctxt = NULL; pending = FALSE; ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr); ok(g_initctxt == NULL, "got %p\n", g_initctxt); @@ -1429,7 +1429,7 @@ static void test_initonce(void) pending = 0xf; SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending == 0xf, "got %d\n", pending); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr); ok(g_initctxt == NULL, "got %p\n", g_initctxt); @@ -1437,91 +1437,91 @@ static void test_initonce(void) g_initctxt = (void*)0xdeadbee0; SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED, g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr);
/* once failed already */ g_initctxt = (void*)0xdeadbee0; ret = pInitOnceComplete(&initonce, 0, g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr);
pInitOnceInitialize(&initonce); SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED, NULL); - ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == NULL, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED | INIT_ONCE_ASYNC, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == NULL, "got %p\n", initonce.Ptr);
ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError());
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED | INIT_ONCE_ASYNC, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, 0, (void *)0xdeadbeef); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr);
ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED, NULL); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == NULL, "got %p\n", initonce.Ptr);
pInitOnceInitialize(&initonce); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)3, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError());
ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)3, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)3, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED | INIT_ONCE_ASYNC, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)3, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_ASYNC, (void *)0xdeadbeef); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)3, "got %p\n", initonce.Ptr);
ret = pInitOnceComplete(&initonce, INIT_ONCE_ASYNC, (void *)0xdeadbee0); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceComplete(&initonce, INIT_ONCE_INIT_FAILED | INIT_ONCE_ASYNC, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr);
pInitOnceInitialize(&initonce); ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr);
@@ -1530,63 +1530,63 @@ static void test_initonce(void) pInitOnceInitialize(&initonce); SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %lu\n", ret, GetLastError()); SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY|INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError());
ret = pInitOnceBeginInitialize(&initonce, 0, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)1, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %lu\n", ret, GetLastError()); SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY|INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError());
ret = pInitOnceComplete(&initonce, 0, (void *)0xdeadbee0); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr);
ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY, &pending, &g_initctxt); - ok(ret, "got wrong ret value %d err %u\n", ret, GetLastError()); + ok(ret, "got wrong ret value %d err %lu\n", ret, GetLastError()); ok(!pending, "got %d\n", pending); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr); ok(g_initctxt == (void*)0xdeadbee0, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY|INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError());
pInitOnceInitialize(&initonce); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(pending, "got %d\n", pending); ok(initonce.Ptr == (void*)3, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_GEN_FAILURE, "wrong ret %d err %lu\n", ret, GetLastError()); SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY|INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError());
ret = pInitOnceComplete(&initonce, INIT_ONCE_ASYNC, (void *)0xdeadbee0); - ok(ret, "wrong ret %d err %u\n", ret, GetLastError()); + ok(ret, "wrong ret %d err %lu\n", ret, GetLastError()); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr);
ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY, &pending, &g_initctxt); - ok(ret, "got wrong ret value %d err %u\n", ret, GetLastError()); + ok(ret, "got wrong ret value %d err %lu\n", ret, GetLastError()); ok(!pending, "got %d\n", pending); ok(initonce.Ptr == (void*)0xdeadbee2, "got %p\n", initonce.Ptr); ok(g_initctxt == (void*)0xdeadbee0, "got %p\n", initonce.Ptr);
SetLastError( 0xdeadbeef ); ret = pInitOnceBeginInitialize(&initonce, INIT_ONCE_CHECK_ONLY|INIT_ONCE_ASYNC, &pending, &g_initctxt); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "wrong ret %d err %lu\n", ret, GetLastError()); }
static CONDITION_VARIABLE buffernotempty = CONDITION_VARIABLE_INIT; @@ -1708,16 +1708,16 @@ static void test_condvars_consumer_producer(void) WaitForSingleObject(hc3, 1000);
ok(totalconsumed == totalproduced, - "consumed %d != produced %d\n", totalconsumed, totalproduced); + "consumed %ld != produced %ld\n", totalconsumed, totalproduced); ok (!condvar_sleeperr, "error occurred during SleepConditionVariableCS\n");
/* Checking cnt1 - cnt2 for non-0 would be not good, the case where * one consumer does not get anything to do is possible. */ - trace("produced %d, c1 %d, c2 %d, c3 %d\n", totalproduced, cnt1, cnt2, cnt3); + trace("produced %ld, c1 %ld, c2 %ld, c3 %ld\n", totalproduced, cnt1, cnt2, cnt3); /* The sleeps of the producer or consumer should not go above 100* produced count, * otherwise the implementation does not sleep correctly. But yet again, this is * not hard defined. */ - trace("producer sleep %d, consumer sleep %d\n", condvar_producer_sleepcnt, condvar_consumer_sleepcnt); + trace("producer sleep %ld, consumer sleep %ld\n", condvar_producer_sleepcnt, condvar_consumer_sleepcnt); }
/* Sample test for some sequence of events happening, sequenced using "condvar_seq" */ @@ -1821,7 +1821,7 @@ static DWORD WINAPI condvar_base_consumer(void *arg) ret = pSleepConditionVariableCS(cv, &condvar_crit, 10); LeaveCriticalSection (&condvar_crit); ok (!ret, "SleepConditionVariableCS should return FALSE on out of band wake\n"); - ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on out of band wake, not %d\n", GetLastError()); + ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on out of band wake, not %ld\n", GetLastError());
condvar_seq = 3; while (condvar_seq < 4) Sleep(1); @@ -1831,7 +1831,7 @@ static DWORD WINAPI condvar_base_consumer(void *arg) ret = pSleepConditionVariableCS(cv, &condvar_crit, 10); LeaveCriticalSection (&condvar_crit); ok (!ret, "SleepConditionVariableCS should return FALSE on out of band wake\n"); - ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on out of band wake, not %d\n", GetLastError()); + ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on out of band wake, not %ld\n", GetLastError());
EnterCriticalSection (&condvar_crit); condvar_seq = 5; @@ -1850,7 +1850,7 @@ static DWORD WINAPI condvar_base_consumer(void *arg) ret = pSleepConditionVariableCS(cv, &condvar_crit, 10); LeaveCriticalSection (&condvar_crit); ok (!ret, "SleepConditionVariableCS should return FALSE on out of band wake\n"); - ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on out of band wake, not %d\n", GetLastError()); + ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on out of band wake, not %ld\n", GetLastError());
EnterCriticalSection (&condvar_crit); condvar_seq = 8; @@ -1916,7 +1916,7 @@ static void test_condvars_base(RTL_CONDITION_VARIABLE *cv) LeaveCriticalSection (&condvar_crit);
ok (!ret, "SleepConditionVariableCS should return FALSE on untriggered condvar\n"); - ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on untriggered condvar, not %d\n", GetLastError()); + ok (GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableCS should return ERROR_TIMEOUT on untriggered condvar, not %ld\n", GetLastError());
if (pInitializeSRWLock) { @@ -1925,14 +1925,14 @@ static void test_condvars_base(RTL_CONDITION_VARIABLE *cv) pReleaseSRWLockExclusive(&condvar_srwlock);
ok(!ret, "SleepConditionVariableSRW should return FALSE on untriggered condvar\n"); - ok(GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableSRW should return ERROR_TIMEOUT on untriggered condvar, not %d\n", GetLastError()); + ok(GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableSRW should return ERROR_TIMEOUT on untriggered condvar, not %ld\n", GetLastError());
pAcquireSRWLockShared(&condvar_srwlock); ret = pSleepConditionVariableSRW(cv, &condvar_srwlock, 10, CONDITION_VARIABLE_LOCKMODE_SHARED); pReleaseSRWLockShared(&condvar_srwlock);
ok(!ret, "SleepConditionVariableSRW should return FALSE on untriggered condvar\n"); - ok(GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableSRW should return ERROR_TIMEOUT on untriggered condvar, not %d\n", GetLastError()); + ok(GetLastError() == ERROR_TIMEOUT, "SleepConditionVariableSRW should return ERROR_TIMEOUT on untriggered condvar, not %ld\n", GetLastError()); }
condvar_seq = 0; @@ -2373,35 +2373,35 @@ static void test_srwlock_base(SRWLOCK *lock) WaitForSingleObject(h3, 100);
ok(!srwlock_base_errors.wrong_execution_order, - "thread commands were executed in the wrong order (occurred %d times).\n", + "thread commands were executed in the wrong order (occurred %ld times).\n", srwlock_base_errors.wrong_execution_order);
ok(!srwlock_base_errors.samethread_excl_excl, - "AcquireSRWLockExclusive didn't block when called multiple times from the same thread (occurred %d times).\n", + "AcquireSRWLockExclusive didn't block when called multiple times from the same thread (occurred %ld times).\n", srwlock_base_errors.samethread_excl_excl);
ok(!srwlock_base_errors.samethread_excl_shared, - "AcquireSRWLockShared didn't block when the same thread holds an exclusive lock (occurred %d times).\n", + "AcquireSRWLockShared didn't block when the same thread holds an exclusive lock (occurred %ld times).\n", srwlock_base_errors.samethread_excl_shared);
ok(!srwlock_base_errors.samethread_shared_excl, - "AcquireSRWLockExclusive didn't block when the same thread holds a shared lock (occurred %d times).\n", + "AcquireSRWLockExclusive didn't block when the same thread holds a shared lock (occurred %ld times).\n", srwlock_base_errors.samethread_shared_excl);
ok(!srwlock_base_errors.multithread_excl_excl, - "AcquireSRWLockExclusive didn't block when a second thread holds the exclusive lock (occurred %d times).\n", + "AcquireSRWLockExclusive didn't block when a second thread holds the exclusive lock (occurred %ld times).\n", srwlock_base_errors.multithread_excl_excl);
ok(!srwlock_base_errors.excl_not_preferred, - "thread waiting for exclusive access to the SHMLock was not preferred (occurred %d times).\n", + "thread waiting for exclusive access to the SHMLock was not preferred (occurred %ld times).\n", srwlock_base_errors.excl_not_preferred);
ok(!srwlock_base_errors.trylock_excl, - "TryAcquireSRWLockExclusive didn't behave as expected (occurred %d times).\n", + "TryAcquireSRWLockExclusive didn't behave as expected (occurred %ld times).\n", srwlock_base_errors.trylock_excl);
ok(!srwlock_base_errors.trylock_shared, - "TryAcquireSRWLockShared didn't behave as expected (occurred %d times).\n", + "TryAcquireSRWLockShared didn't behave as expected (occurred %ld times).\n", srwlock_base_errors.trylock_shared);
} @@ -2480,12 +2480,12 @@ static void test_srwlock_example(void) WaitForSingleObject(h2, 1000); WaitForSingleObject(h3, 1000);
- ok(!srwlock_inside, "threads didn't terminate properly, srwlock_inside is %d.\n", srwlock_inside); - ok(!srwlock_example_errors, "errors occurred while running SRWLock example test (number of errors: %d)\n", + ok(!srwlock_inside, "threads didn't terminate properly, srwlock_inside is %ld.\n", srwlock_inside); + ok(!srwlock_example_errors, "errors occurred while running SRWLock example test (number of errors: %ld)\n", srwlock_example_errors);
- trace("number of shared accesses per thread are c1 %d, c2 %d, c3 %d\n", cnt1, cnt2, cnt3); - trace("number of total exclusive accesses is %d\n", srwlock_protected_value); + trace("number of shared accesses per thread are c1 %ld, c2 %ld, c3 %ld\n", cnt1, cnt2, cnt3); + trace("number of total exclusive accesses is %ld\n", srwlock_protected_value); }
static DWORD WINAPI alertable_wait_thread(void *param) @@ -2497,24 +2497,24 @@ static DWORD WINAPI alertable_wait_thread(void *param)
ReleaseSemaphore(semaphores[0], 1, NULL); result = WaitForMultipleObjectsEx(1, &semaphores[1], TRUE, 1000, TRUE); - ok(result == WAIT_IO_COMPLETION, "expected WAIT_IO_COMPLETION, got %u\n", result); + ok(result == WAIT_IO_COMPLETION, "expected WAIT_IO_COMPLETION, got %lu\n", result); result = WaitForMultipleObjectsEx(1, &semaphores[1], TRUE, 200, TRUE); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result);
ReleaseSemaphore(semaphores[0], 1, NULL); timeout.QuadPart = -10000000; status = pNtWaitForMultipleObjects(1, &semaphores[1], FALSE, TRUE, &timeout); - ok(status == STATUS_USER_APC, "expected STATUS_USER_APC, got %08x\n", status); + ok(status == STATUS_USER_APC, "expected STATUS_USER_APC, got %08lx\n", status); timeout.QuadPart = -2000000; status = pNtWaitForMultipleObjects(1, &semaphores[1], FALSE, TRUE, &timeout); - ok(status == STATUS_WAIT_0, "expected STATUS_WAIT_0, got %08x\n", status); + ok(status == STATUS_WAIT_0, "expected STATUS_WAIT_0, got %08lx\n", status);
ReleaseSemaphore(semaphores[0], 1, NULL); timeout.QuadPart = -10000000; status = pNtWaitForMultipleObjects(1, &semaphores[1], FALSE, TRUE, &timeout); - ok(status == STATUS_USER_APC, "expected STATUS_USER_APC, got %08x\n", status); + ok(status == STATUS_USER_APC, "expected STATUS_USER_APC, got %08lx\n", status); result = WaitForSingleObject(semaphores[0], 0); - ok(result == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %u\n", result); + ok(result == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %lu\n", result);
return 0; } @@ -2531,7 +2531,7 @@ static void CALLBACK alertable_wait_apc2(ULONG_PTR userdata) DWORD result;
result = WaitForSingleObject(semaphores[0], 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); }
static void test_alertable_wait(void) @@ -2540,35 +2540,35 @@ static void test_alertable_wait(void) DWORD result;
semaphores[0] = CreateSemaphoreW(NULL, 0, 2, NULL); - ok(semaphores[0] != NULL, "CreateSemaphore failed with %u\n", GetLastError()); + ok(semaphores[0] != NULL, "CreateSemaphore failed with %lu\n", GetLastError()); semaphores[1] = CreateSemaphoreW(NULL, 0, 1, NULL); - ok(semaphores[1] != NULL, "CreateSemaphore failed with %u\n", GetLastError()); + ok(semaphores[1] != NULL, "CreateSemaphore failed with %lu\n", GetLastError()); thread = CreateThread(NULL, 0, alertable_wait_thread, semaphores, 0, NULL); - ok(thread != NULL, "CreateThread failed with %u\n", GetLastError()); + ok(thread != NULL, "CreateThread failed with %lu\n", GetLastError());
result = WaitForSingleObject(semaphores[0], 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); Sleep(100); /* ensure the thread is blocking in WaitForMultipleObjectsEx */ result = QueueUserAPC(alertable_wait_apc, thread, (ULONG_PTR)semaphores); - ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + ok(result != 0, "QueueUserAPC failed with %lu\n", GetLastError());
result = WaitForSingleObject(semaphores[0], 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); Sleep(100); /* ensure the thread is blocking in NtWaitForMultipleObjects */ result = QueueUserAPC(alertable_wait_apc, thread, (ULONG_PTR)semaphores); - ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + ok(result != 0, "QueueUserAPC failed with %lu\n", GetLastError());
result = WaitForSingleObject(semaphores[0], 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); Sleep(100); /* ensure the thread is blocking in NtWaitForMultipleObjects */ result = QueueUserAPC(alertable_wait_apc2, thread, (ULONG_PTR)semaphores); - ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + ok(result != 0, "QueueUserAPC failed with %lu\n", GetLastError()); result = QueueUserAPC(alertable_wait_apc2, thread, (ULONG_PTR)semaphores); - ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + ok(result != 0, "QueueUserAPC failed with %lu\n", GetLastError()); ReleaseSemaphore(semaphores[0], 2, NULL);
result = WaitForSingleObject(thread, 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); CloseHandle(thread); CloseHandle(semaphores[0]); CloseHandle(semaphores[1]); @@ -2595,13 +2595,13 @@ static DWORD WINAPI apc_deadlock_thread(void *param) size = 0x1000; status = pNtAllocateVirtualMemory(pi->hProcess, &base, 0, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - ok(!status, "expected STATUS_SUCCESS, got %08x\n", status); + ok(!status, "expected STATUS_SUCCESS, got %08lx\n", status); ok(base != NULL, "expected base != NULL, got %p\n", base); SetEvent(info->event);
size = 0; status = pNtFreeVirtualMemory(pi->hProcess, &base, &size, MEM_RELEASE); - ok(!status, "expected STATUS_SUCCESS, got %08x\n", status); + ok(!status, "expected STATUS_SUCCESS, got %08lx\n", status); SetEvent(info->event); }
@@ -2623,44 +2623,44 @@ static void test_apc_deadlock(void) winetest_get_mainargs(&argv); sprintf(cmdline, ""%s" sync apc_deadlock", argv[0]); success = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(success, "CreateProcess failed with %u\n", GetLastError()); + ok(success, "CreateProcess failed with %lu\n", GetLastError());
event = CreateEventA(NULL, FALSE, FALSE, NULL); - ok(event != NULL, "CreateEvent failed with %u\n", GetLastError()); + ok(event != NULL, "CreateEvent failed with %lu\n", GetLastError());
info.pi = π info.event = event; info.running = TRUE;
thread = CreateThread(NULL, 0, apc_deadlock_thread, &info, 0, NULL); - ok(thread != NULL, "CreateThread failed with %u\n", GetLastError()); + ok(thread != NULL, "CreateThread failed with %lu\n", GetLastError()); result = WaitForSingleObject(event, 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result);
for (i = 0; i < 1000 && info.running; i++) { result = SuspendThread(pi.hThread); - ok(result == 0, "expected 0, got %u\n", result); + ok(result == 0, "expected 0, got %lu\n", result);
WaitForSingleObject(event, 0); /* reset event */ result = WaitForSingleObject(event, 1000); if (result == WAIT_TIMEOUT) { todo_wine - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); info.running = FALSE; } else - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result);
result = ResumeThread(pi.hThread); - ok(result == 1, "expected 1, got %u\n", result); + ok(result == 1, "expected 1, got %lu\n", result); Sleep(1); }
info.running = FALSE; result = WaitForSingleObject(thread, 1000); - ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", result); CloseHandle(thread); CloseHandle(event);
@@ -2733,48 +2733,48 @@ static void test_QueueUserAPC(void) NTSTATUS status;
thread = CreateThread(NULL, 0, thread_proc, NULL, CREATE_SUSPENDED, &tid); - ok(thread != NULL, "CreateThread error %u\n", GetLastError()); + ok(thread != NULL, "CreateThread error %lu\n", GetLastError());
ret = TerminateThread(thread, 0xdeadbeef); - ok(ret, "TerminateThread error %u\n", GetLastError()); + ok(ret, "TerminateThread error %lu\n", GetLastError());
ret = WaitForSingleObject(thread, 1000); - ok(ret == WAIT_OBJECT_0, "got %u\n", ret); + ok(ret == WAIT_OBJECT_0, "got %lu\n", ret);
ret = pNtQueueApcThread(thread, call_user_apc, (ULONG_PTR)user_apc, 0, 0); - ok(ret == STATUS_UNSUCCESSFUL, "got %#x\n", ret); + ok(ret == STATUS_UNSUCCESSFUL, "got %#lx\n", ret); ret = pNtQueueApcThread(thread, NULL, 0, 0, 0); - ok(ret == STATUS_UNSUCCESSFUL, "got %#x\n", ret); + ok(ret == STATUS_UNSUCCESSFUL, "got %#lx\n", ret);
SetLastError(0xdeadbeef); ret = QueueUserAPC(user_apc, thread, 0); ok(!ret, "QueueUserAPC should fail\n"); - ok(GetLastError() == ERROR_GEN_FAILURE, "got %u\n", GetLastError()); + ok(GetLastError() == ERROR_GEN_FAILURE, "got %lu\n", GetLastError());
CloseHandle(thread);
apc_count = 0; ret = QueueUserAPC(user_apc, GetCurrentThread(), 0); - ok(ret, "QueueUserAPC failed err %u\n", GetLastError()); + ok(ret, "QueueUserAPC failed err %lu\n", GetLastError()); ok(!apc_count, "APC count %u\n", apc_count); ret = SleepEx( 100, TRUE ); - ok( ret == WAIT_IO_COMPLETION, "SleepEx returned %u\n", ret); + ok( ret == WAIT_IO_COMPLETION, "SleepEx returned %lu\n", ret); ok(apc_count == 1, "APC count %u\n", apc_count);
ret = pNtQueueApcThread( GetCurrentThread(), NULL, 0, 0, 0 ); - ok( !ret, "got %#x\n", ret); + ok( !ret, "got %#lx\n", ret); ret = SleepEx( 100, TRUE ); - ok( ret == WAIT_OBJECT_0, "SleepEx returned %u\n", ret); + ok( ret == WAIT_OBJECT_0, "SleepEx returned %lu\n", ret);
apc_count = 0; ret = QueueUserAPC(user_apc, GetCurrentThread(), 0); - ok(ret, "QueueUserAPC failed err %u\n", GetLastError()); + ok(ret, "QueueUserAPC failed err %lu\n", GetLastError()); ok(!apc_count, "APC count %u\n", apc_count); status = pNtTestAlert(); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(apc_count == 1, "APC count %u\n", apc_count); status = pNtTestAlert(); - ok(!status, "got %x\n", status); + ok(!status, "got %lx\n", status); ok(apc_count == 1, "APC count %u\n", apc_count); }
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index 6ccf7af85f8..aa62ba17e77 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -113,9 +113,9 @@ static HANDLE create_target_process(const char *arg) winetest_get_mainargs( &argv ); sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "error: %u\n", GetLastError()); + ok(ret, "error: %lu\n", GetLastError()); ret = CloseHandle(pi.hThread); - ok(ret, "error %u\n", GetLastError()); + ok(ret, "error %lu\n", GetLastError()); return pi.hProcess; }
@@ -156,7 +156,7 @@ static BOOL sync_threads_and_run_one(DWORD sync_id, DWORD my_id) else { DWORD ret = WaitForSingleObject(start_event, 10000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed %x\n",ret); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed %lx\n",ret); } return sync_id == my_id; } @@ -306,7 +306,7 @@ static DWORD WINAPI thread_actctx_func(void *p)
cur = (void*)0xdeadbeef; ret = GetCurrentActCtx(&cur); - ok(ret, "thread GetCurrentActCtx failed, %u\n", GetLastError()); + ok(ret, "thread GetCurrentActCtx failed, %lu\n", GetLastError()); ok(cur == param->handle, "got %p, expected %p\n", cur, param->handle); param->thread_context = cur;
@@ -343,13 +343,13 @@ static VOID test_CreateRemoteThread(void) skip("child process wasn't mapped at same address, so can't do CreateRemoteThread tests.\n"); return; } - ok(ret == WAIT_OBJECT_0 || broken(ret == WAIT_OBJECT_0+1 /* nt4,w2k */), "WaitForAllObjects 2 events %d\n", ret); + ok(ret == WAIT_OBJECT_0 || broken(ret == WAIT_OBJECT_0+1 /* nt4,w2k */), "WaitForAllObjects 2 events %ld\n", ret);
hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(hEvent != NULL, "Can't create event, err=%u\n", GetLastError()); + ok(hEvent != NULL, "Can't create event, err=%lu\n", GetLastError()); ret = DuplicateHandle(GetCurrentProcess(), hEvent, hProcess, &hRemoteEvent, 0, FALSE, DUPLICATE_SAME_ACCESS); - ok(ret != 0, "DuplicateHandle failed, err=%u\n", GetLastError()); + ok(ret != 0, "DuplicateHandle failed, err=%lu\n", GetLastError());
/* create suspended remote thread with entry point SetEvent() */ SetLastError(0xdeadbeef); @@ -360,51 +360,51 @@ static VOID test_CreateRemoteThread(void) win_skip("CreateRemoteThread is not implemented\n"); goto cleanup; } - ok(hThread != NULL, "CreateRemoteThread failed, err=%u\n", GetLastError()); + ok(hThread != NULL, "CreateRemoteThread failed, err=%lu\n", GetLastError()); ok(tid != 0, "null tid\n"); ret = SuspendThread(hThread); - ok(ret == 1, "ret=%u, err=%u\n", ret, GetLastError()); + ok(ret == 1, "ret=%lu, err=%lu\n", ret, GetLastError()); ret = ResumeThread(hThread); - ok(ret == 2, "ret=%u, err=%u\n", ret, GetLastError()); + ok(ret == 2, "ret=%lu, err=%lu\n", ret, GetLastError());
/* thread still suspended, so wait times out */ ret = WaitForSingleObject(hEvent, 1000); - ok(ret == WAIT_TIMEOUT, "wait did not time out, ret=%u\n", ret); + ok(ret == WAIT_TIMEOUT, "wait did not time out, ret=%lu\n", ret);
ret = ResumeThread(hThread); - ok(ret == 1, "ret=%u, err=%u\n", ret, GetLastError()); + ok(ret == 1, "ret=%lu, err=%lu\n", ret, GetLastError());
/* wait that doesn't time out */ ret = WaitForSingleObject(hEvent, 1000); - ok(ret == WAIT_OBJECT_0, "object not signaled, ret=%u\n", ret); + ok(ret == WAIT_OBJECT_0, "object not signaled, ret=%lu\n", ret);
/* wait for thread end */ ret = WaitForSingleObject(hThread, 1000); - ok(ret == WAIT_OBJECT_0, "waiting for thread failed, ret=%u\n", ret); + ok(ret == WAIT_OBJECT_0, "waiting for thread failed, ret=%lu\n", ret); CloseHandle(hThread);
/* create and wait for remote thread with entry point CloseHandle() */ hThread = CreateRemoteThread(hProcess, NULL, 0, threadFunc_CloseHandle, hRemoteEvent, 0, &tid); - ok(hThread != NULL, "CreateRemoteThread failed, err=%u\n", GetLastError()); + ok(hThread != NULL, "CreateRemoteThread failed, err=%lu\n", GetLastError()); ret = WaitForSingleObject(hThread, 1000); - ok(ret == WAIT_OBJECT_0, "waiting for thread failed, ret=%u\n", ret); + ok(ret == WAIT_OBJECT_0, "waiting for thread failed, ret=%lu\n", ret); CloseHandle(hThread);
/* create remote thread with entry point SetEvent() */ hThread = CreateRemoteThread(hProcess, NULL, 0, threadFunc_SetEvent, hRemoteEvent, 0, &tid); - ok(hThread != NULL, "CreateRemoteThread failed, err=%u\n", GetLastError()); + ok(hThread != NULL, "CreateRemoteThread failed, err=%lu\n", GetLastError());
/* closed handle, so wait times out */ ret = WaitForSingleObject(hEvent, 1000); - ok(ret == WAIT_TIMEOUT, "wait did not time out, ret=%u\n", ret); + ok(ret == WAIT_TIMEOUT, "wait did not time out, ret=%lu\n", ret);
/* check that remote SetEvent() failed */ ret = GetExitCodeThread(hThread, &exitcode); - ok(ret != 0, "GetExitCodeThread failed, err=%u\n", GetLastError()); + ok(ret != 0, "GetExitCodeThread failed, err=%lu\n", GetLastError()); if (ret) ok(exitcode == 0, "SetEvent succeeded, expected to fail\n"); CloseHandle(hThread);
@@ -483,31 +483,31 @@ static VOID test_CreateThread_basic(void)
SetLastError(0xCAFEF00D); bRet = TlsFree(tlsIndex); - ok(bRet, "TlsFree failed: %08x\n", GetLastError()); + ok(bRet, "TlsFree failed: %08lx\n", GetLastError()); ok(GetLastError()==0xCAFEF00D, - "GetLastError: expected 0xCAFEF00D, got %08x\n", GetLastError()); + "GetLastError: expected 0xCAFEF00D, got %08lx\n", GetLastError());
/* Test freeing an already freed TLS index */ SetLastError(0xCAFEF00D); ok(TlsFree(tlsIndex)==0,"TlsFree succeeded\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER, - "GetLastError: expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); + "GetLastError: expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError());
/* Test how passing NULL as a pointer to threadid works */ SetLastError(0xFACEaBAD); thread[0] = CreateThread(NULL,0,threadFunc2,NULL,0,&tid); GLE = GetLastError(); if (thread[0]) { /* NT */ - ok(GLE==0xFACEaBAD, "CreateThread set last error to %d, expected 4207848365\n", GLE); + ok(GLE==0xFACEaBAD, "CreateThread set last error to %ld, expected 4207848365\n", GLE); ret = WaitForSingleObject(thread[0],100); ok(ret==WAIT_OBJECT_0, "threadFunc2 did not exit during 100 ms\n"); ret = GetExitCodeThread(thread[0],&exitCode); - ok(ret!=0, "GetExitCodeThread returned %d (expected nonzero)\n", ret); - ok(exitCode==99, "threadFunc2 exited with code: %d (expected 99)\n", exitCode); + ok(ret!=0, "GetExitCodeThread returned %ld (expected nonzero)\n", ret); + ok(exitCode==99, "threadFunc2 exited with code: %ld (expected 99)\n", exitCode); ok(CloseHandle(thread[0])!=0,"Error closing thread handle\n"); } else { /* 9x */ - ok(GLE==ERROR_INVALID_PARAMETER, "CreateThread set last error to %d, expected 87\n", GLE); + ok(GLE==ERROR_INVALID_PARAMETER, "CreateThread set last error to %ld, expected 87\n", GLE); } }
@@ -540,12 +540,12 @@ static VOID test_CreateThread_suspended(void) }
suspend_count = SuspendThread(thread); - ok(suspend_count == -1, "SuspendThread returned %d, expected -1\n", suspend_count); + ok(suspend_count == -1, "SuspendThread returned %ld, expected -1\n", suspend_count);
suspend_count = ResumeThread(thread); ok(suspend_count == 0 || broken(suspend_count == -1), /* win9x */ - "ResumeThread returned %d, expected 0\n", suspend_count); + "ResumeThread returned %ld, expected 0\n", suspend_count);
ok(CloseHandle(thread)!=0,"CloseHandle failed\n"); } @@ -598,8 +598,8 @@ static VOID test_SuspendThread(void) } /* Trying to suspend a terminated thread should fail */ error=SuspendThread(thread); - ok(error==~0U, "wrong return code: %d\n", error); - ok(GetLastError()==ERROR_ACCESS_DENIED || GetLastError()==ERROR_NO_MORE_ITEMS, "unexpected error code: %d\n", GetLastError()); + ok(error==~0U, "wrong return code: %ld\n", error); + ok(GetLastError()==ERROR_ACCESS_DENIED || GetLastError()==ERROR_NO_MORE_ITEMS, "unexpected error code: %ld\n", GetLastError());
ok(CloseHandle(thread)!=0,"CloseHandle Failed\n"); } @@ -730,7 +730,7 @@ static VOID test_thread_priority(void) ok(rc == FALSE, "SetThreadPriority passed with a bad argument\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_INVALID_PRIORITY /* Win9x */, - "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n", + "SetThreadPriority error %ld, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n", GetLastError()); ok(GetThreadPriority(curthread)==min_priority, "GetThreadPriority didn't return min_priority\n"); @@ -742,7 +742,7 @@ static VOID test_thread_priority(void) ok(rc == FALSE, "SetThreadPriority passed with a bad argument\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_INVALID_PRIORITY /* Win9x */, - "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n", + "SetThreadPriority error %ld, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n", GetLastError()); ok(GetThreadPriority(curthread)==max_priority, "GetThreadPriority didn't return max_priority\n"); @@ -759,7 +759,7 @@ static VOID test_thread_priority(void) return; }
- ok(rc!=0,"error=%d\n",GetLastError()); + ok(rc!=0,"error=%ld\n",GetLastError());
if (pOpenThread) { /* check that access control is obeyed */ @@ -775,18 +775,18 @@ static VOID test_thread_priority(void) }
rc = pSetThreadPriorityBoost(curthread,1); - ok( rc != 0, "error=%d\n",GetLastError()); + ok( rc != 0, "error=%ld\n",GetLastError()); todo_wine { rc=pGetThreadPriorityBoost(curthread,&disabled); ok(rc!=0 && disabled==1, - "rc=%d error=%d disabled=%d\n",rc,GetLastError(),disabled); + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); }
rc = pSetThreadPriorityBoost(curthread,0); - ok( rc != 0, "error=%d\n",GetLastError()); + ok( rc != 0, "error=%ld\n",GetLastError()); rc=pGetThreadPriorityBoost(curthread,&disabled); ok(rc!=0 && disabled==0, - "rc=%d error=%d disabled=%d\n",rc,GetLastError(),disabled); + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); }
/* check the GetThreadTimes function */ @@ -883,7 +883,7 @@ static VOID test_thread_processor(void) /* Show that the "all processors" flag is handled in ntdll */ DWORD_PTR mask = ~0u; NTSTATUS status = pNtSetInformationThread(curthread, ThreadAffinityMask, &mask, sizeof(mask)); - ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS in NtSetInformationThread, got %x\n", status); + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS in NtSetInformationThread, got %lx\n", status); }
if (retMask == processMask && sizeof(ULONG_PTR) > sizeof(ULONG)) @@ -914,7 +914,7 @@ static VOID test_thread_processor(void) error=pSetThreadIdealProcessor(curthread,65); ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } else { @@ -922,7 +922,7 @@ static VOID test_thread_processor(void) error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS); @@ -943,14 +943,14 @@ static VOID test_thread_processor(void) SetLastError(0xdeadbeef); ok(!pGetThreadGroupAffinity(curthread, NULL), "GetThreadGroupAffinity succeeded\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_NOACCESS), /* Win 7 and 8 */ - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); ok(affinity.Group == 0, "Expected group 0 got %u\n", affinity.Group);
memset(&affinity_new, 0, sizeof(affinity_new)); affinity_new.Group = 0; affinity_new.Mask = affinity.Mask; ok(pSetThreadGroupAffinity(curthread, &affinity_new, &affinity), "SetThreadGroupAffinity failed\n"); - ok(affinity_new.Mask == affinity.Mask, "Expected old affinity mask %lx, got %lx\n", + ok(affinity_new.Mask == affinity.Mask, "Expected old affinity mask %Ix, got %Ix\n", affinity_new.Mask, affinity.Mask);
/* show that the "all processors" flag is not supported for SetThreadGroupAffinity */ @@ -959,31 +959,31 @@ static VOID test_thread_processor(void) SetLastError(0xdeadbeef); ok(!pSetThreadGroupAffinity(curthread, &affinity_new, NULL), "SetThreadGroupAffinity succeeded\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
affinity_new.Group = 1; /* assumes that you have less than 64 logical processors */ affinity_new.Mask = 0x1; SetLastError(0xdeadbeef); ok(!pSetThreadGroupAffinity(curthread, &affinity_new, NULL), "SetThreadGroupAffinity succeeded\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ok(!pSetThreadGroupAffinity(curthread, NULL, NULL), "SetThreadGroupAffinity succeeded\n"); ok(GetLastError() == ERROR_NOACCESS, - "Expected ERROR_NOACCESS, got %d\n", GetLastError()); + "Expected ERROR_NOACCESS, got %ld\n", GetLastError());
/* show that the access violation was detected in ntdll */ status = pNtSetInformationThread(curthread, ThreadGroupInformation, NULL, sizeof(affinity_new)); ok(status == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", status); + "Expected STATUS_ACCESS_VIOLATION, got %08lx\n", status);
/* restore original mask */ affinity_new.Group = 0; affinity_new.Mask = affinity.Mask; SetLastError(0xdeadbeef); ok(pSetThreadGroupAffinity(curthread, &affinity_new, &affinity), "SetThreadGroupAffinity failed\n"); - ok(affinity_new.Mask == affinity.Mask, "Expected old affinity mask %lx, got %lx\n", + ok(affinity_new.Mask == affinity.Mask, "Expected old affinity mask %Ix, got %Ix\n", affinity_new.Mask, affinity.Mask); } else @@ -1009,8 +1009,8 @@ static VOID test_GetCurrentThreadStackLimits(void) }
pGetCurrentThreadStackLimits(&low, &high); - ok(low == (ULONG_PTR)NtCurrentTeb()->DeallocationStack, "expected %p, got %lx\n", NtCurrentTeb()->DeallocationStack, low); - ok(high == (ULONG_PTR)NtCurrentTeb()->Tib.StackBase, "expected %p, got %lx\n", NtCurrentTeb()->Tib.StackBase, high); + ok(low == (ULONG_PTR)NtCurrentTeb()->DeallocationStack, "expected %p, got %Ix\n", NtCurrentTeb()->DeallocationStack, low); + ok(high == (ULONG_PTR)NtCurrentTeb()->Tib.StackBase, "expected %p, got %Ix\n", NtCurrentTeb()->Tib.StackBase, high); }
static void test_SetThreadStackGuarantee(void) @@ -1025,46 +1025,46 @@ static void test_SetThreadStackGuarantee(void) } size = 0; ret = pSetThreadStackGuarantee( &size ); - ok( ret, "failed err %u\n", GetLastError() ); - ok( size == 0, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 0, "wrong teb %u\n", + ok( ret, "failed err %lu\n", GetLastError() ); + ok( size == 0, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 0, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); size = 0xdeadbef; ret = pSetThreadStackGuarantee( &size ); ok( !ret, "succeeded\n" ); ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_INVALID_ADDRESS, - "wrong error %u\n", GetLastError()); - ok( size == 0, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 0, "wrong teb %u\n", + "wrong error %lu\n", GetLastError()); + ok( size == 0, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 0, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); size = 200; ret = pSetThreadStackGuarantee( &size ); - ok( ret, "failed err %u\n", GetLastError() ); - ok( size == 0, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 4096 * sizeof(void *) / 4, "wrong teb %u\n", + ok( ret, "failed err %lu\n", GetLastError() ); + ok( size == 0, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 4096 * sizeof(void *) / 4, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); size = 5000; ret = pSetThreadStackGuarantee( &size ); - ok( ret, "failed err %u\n", GetLastError() ); - ok( size == 4096 * sizeof(void *) / 4, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 8192, "wrong teb %u\n", + ok( ret, "failed err %lu\n", GetLastError() ); + ok( size == 4096 * sizeof(void *) / 4, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 8192, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); size = 2000; ret = pSetThreadStackGuarantee( &size ); - ok( ret, "failed err %u\n", GetLastError() ); - ok( size == 8192, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 8192, "wrong teb %u\n", + ok( ret, "failed err %lu\n", GetLastError() ); + ok( size == 8192, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 8192, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); size = 10000; ret = pSetThreadStackGuarantee( &size ); - ok( ret, "failed err %u\n", GetLastError() ); - ok( size == 8192, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 12288, "wrong teb %u\n", + ok( ret, "failed err %lu\n", GetLastError() ); + ok( size == 8192, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 12288, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); ret = pSetThreadStackGuarantee( &size ); - ok( ret, "failed err %u\n", GetLastError() ); - ok( size == 12288, "wrong size %u\n", size ); - ok( NtCurrentTeb()->GuaranteedStackBytes == 12288, "wrong teb %u\n", + ok( ret, "failed err %lu\n", GetLastError() ); + ok( size == 12288, "wrong size %lu\n", size ); + ok( NtCurrentTeb()->GuaranteedStackBytes == 12288, "wrong teb %lu\n", NtCurrentTeb()->GuaranteedStackBytes ); }
@@ -1075,17 +1075,17 @@ static VOID test_GetThreadExitCode(void) HANDLE thread;
ret = GetExitCodeThread((HANDLE)0x2bad2bad,&exitCode); - ok(ret==0, "GetExitCodeThread returned non zero value: %d\n", ret); + ok(ret==0, "GetExitCodeThread returned non zero value: %ld\n", ret); GLE = GetLastError(); - ok(GLE==ERROR_INVALID_HANDLE, "GetLastError returned %d (expected 6)\n", GLE); + ok(GLE==ERROR_INVALID_HANDLE, "GetLastError returned %ld (expected 6)\n", GLE);
thread = CreateThread(NULL,0,threadFunc2,NULL,0,&threadid); ret = WaitForSingleObject(thread,100); ok(ret==WAIT_OBJECT_0, "threadFunc2 did not exit during 100 ms\n"); ret = GetExitCodeThread(thread,&exitCode); ok(ret==exitCode || ret==1, - "GetExitCodeThread returned %d (expected 1 or %d)\n", ret, exitCode); - ok(exitCode==99, "threadFunc2 exited with code %d (expected 99)\n", exitCode); + "GetExitCodeThread returned %ld (expected 1 or %ld)\n", ret, exitCode); + ok(exitCode==99, "threadFunc2 exited with code %ld (expected 99)\n", exitCode); ok(CloseHandle(thread)!=0,"Error closing thread handle\n"); }
@@ -1120,7 +1120,7 @@ static void test_SetThreadContext(void) SetLastError(0xdeadbeef); event = CreateEventW( NULL, TRUE, FALSE, NULL ); thread = CreateThread( NULL, 0, threadFunc6, (void *)2, 0, &threadid ); - ok( thread != NULL, "CreateThread failed : (%d)\n", GetLastError() ); + ok( thread != NULL, "CreateThread failed : (%ld)\n", GetLastError() ); if (!thread) { trace("Thread creation failed, skipping rest of test\n"); @@ -1133,7 +1133,7 @@ static void test_SetThreadContext(void) ctx.ContextFlags = CONTEXT_FULL; SetLastError(0xdeadbeef); ret = GetThreadContext( thread, &ctx ); - ok( ret, "GetThreadContext failed : (%u)\n", GetLastError() ); + ok( ret, "GetThreadContext failed : (%lu)\n", GetLastError() );
if (ret) { @@ -1145,12 +1145,12 @@ static void test_SetThreadContext(void) ctx.Eip = (DWORD)set_test_val; SetLastError(0xdeadbeef); ret = SetThreadContext( thread, &ctx ); - ok( ret, "SetThreadContext failed : (%d)\n", GetLastError() ); + ok( ret, "SetThreadContext failed : (%ld)\n", GetLastError() ); }
SetLastError(0xdeadbeef); prevcount = ResumeThread( thread ); - ok ( prevcount == 1, "Previous suspend count (%d) instead of 1, last error : (%d)\n", + ok ( prevcount == 1, "Previous suspend count (%ld) instead of 1, last error : (%ld)\n", prevcount, GetLastError() );
WaitForSingleObject( thread, INFINITE ); @@ -1162,7 +1162,7 @@ static void test_SetThreadContext(void) ok( (!ret && ((GetLastError() == ERROR_GEN_FAILURE) || (GetLastError() == ERROR_ACCESS_DENIED))) || (!ret && broken(GetLastError() == ERROR_INVALID_HANDLE)) || /* win2k */ broken(ret), /* 32bit application on NT 5.x 64bit */ - "got %d with %u (expected FALSE with ERROR_GEN_FAILURE or ERROR_ACCESS_DENIED)\n", + "got %d with %lu (expected FALSE with ERROR_GEN_FAILURE or ERROR_ACCESS_DENIED)\n", ret, GetLastError() );
SetLastError(0xdeadbeef); @@ -1170,7 +1170,7 @@ static void test_SetThreadContext(void) ok( (!ret && ((GetLastError() == ERROR_GEN_FAILURE) || (GetLastError() == ERROR_ACCESS_DENIED))) || (!ret && broken(GetLastError() == ERROR_INVALID_HANDLE)) || /* win2k */ broken(ret), /* 32bit application on NT 5.x 64bit */ - "got %d with %u (expected FALSE with ERROR_GEN_FAILURE or ERROR_ACCESS_DENIED)\n", + "got %d with %lu (expected FALSE with ERROR_GEN_FAILURE or ERROR_ACCESS_DENIED)\n", ret, GetLastError() );
CloseHandle( thread ); @@ -1182,10 +1182,10 @@ static DWORD WINAPI test_stack( void *arg )
ok( stack == NtCurrentTeb()->Tib.StackBase, "wrong stack %p/%p\n", stack, NtCurrentTeb()->Tib.StackBase ); - ok( !stack[-1], "wrong data %p = %08x\n", stack - 1, stack[-1] ); - ok( stack[-2] == (DWORD)arg, "wrong data %p = %08x\n", stack - 2, stack[-2] ); - ok( stack[-3] == (DWORD)test_stack, "wrong data %p = %08x\n", stack - 3, stack[-3] ); - ok( !stack[-4], "wrong data %p = %08x\n", stack - 4, stack[-4] ); + ok( !stack[-1], "wrong data %p = %08lx\n", stack - 1, stack[-1] ); + ok( stack[-2] == (DWORD)arg, "wrong data %p = %08lx\n", stack - 2, stack[-2] ); + ok( stack[-3] == (DWORD)test_stack, "wrong data %p = %08lx\n", stack - 3, stack[-3] ); + ok( !stack[-4], "wrong data %p = %08lx\n", stack - 4, stack[-4] ); return 0; }
@@ -1198,10 +1198,10 @@ static void test_GetThreadContext(void) memset(&ctx, 0xcc, sizeof(ctx)); ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS; ret = GetThreadContext(GetCurrentThread(), &ctx); - ok(ret, "GetThreadContext failed: %u\n", GetLastError()); - ok(ctx.ContextFlags == CONTEXT_DEBUG_REGISTERS, "ContextFlags = %x\n", ctx.ContextFlags); - ok(!ctx.Dr0, "Dr0 = %x\n", ctx.Dr0); - ok(!ctx.Dr1, "Dr0 = %x\n", ctx.Dr0); + ok(ret, "GetThreadContext failed: %lu\n", GetLastError()); + ok(ctx.ContextFlags == CONTEXT_DEBUG_REGISTERS, "ContextFlags = %lx\n", ctx.ContextFlags); + ok(!ctx.Dr0, "Dr0 = %lx\n", ctx.Dr0); + ok(!ctx.Dr1, "Dr0 = %lx\n", ctx.Dr0);
thread = CreateThread( NULL, 0, test_stack, (void *)0x1234, 0, NULL ); WaitForSingleObject( thread, 1000 ); @@ -1219,41 +1219,41 @@ static void test_GetThreadSelectorEntry(void) memset(&ctx, 0x11, sizeof(ctx)); ctx.ContextFlags = CONTEXT_SEGMENTS | CONTEXT_CONTROL; ret = GetThreadContext(GetCurrentThread(), &ctx); - ok(ret, "GetThreadContext error %u\n", GetLastError()); - ok(!HIWORD(ctx.SegCs), "expected HIWORD(SegCs) == 0, got %u\n", ctx.SegCs); - ok(!HIWORD(ctx.SegDs), "expected HIWORD(SegDs) == 0, got %u\n", ctx.SegDs); - ok(!HIWORD(ctx.SegFs), "expected HIWORD(SegFs) == 0, got %u\n", ctx.SegFs); + ok(ret, "GetThreadContext error %lu\n", GetLastError()); + ok(!HIWORD(ctx.SegCs), "expected HIWORD(SegCs) == 0, got %lu\n", ctx.SegCs); + ok(!HIWORD(ctx.SegDs), "expected HIWORD(SegDs) == 0, got %lu\n", ctx.SegDs); + ok(!HIWORD(ctx.SegFs), "expected HIWORD(SegFs) == 0, got %lu\n", ctx.SegFs);
ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegCs, &entry); - ok(ret, "GetThreadSelectorEntry(SegCs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegCs) error %lu\n", GetLastError()); ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegDs, &entry); - ok(ret, "GetThreadSelectorEntry(SegDs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegDs) error %lu\n", GetLastError()); ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegDs & ~3, &entry); - ok(ret, "GetThreadSelectorEntry(SegDs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegDs) error %lu\n", GetLastError()); ret = GetThreadSelectorEntry(GetCurrentThread(), 0, &entry); - ok(ret, "GetThreadSelectorEntry(SegDs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegDs) error %lu\n", GetLastError()); ret = GetThreadSelectorEntry(GetCurrentThread(), 3, &entry); - ok(ret, "GetThreadSelectorEntry(SegDs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegDs) error %lu\n", GetLastError()); SetLastError( 0xdeadbeef ); ret = GetThreadSelectorEntry(GetCurrentThread(), 0xdeadbeef, &entry); ok(!ret, "GetThreadSelectorEntry(invalid) succeeded\n"); ok( GetLastError() == ERROR_GEN_FAILURE - || GetLastError() == ERROR_INVALID_THREAD_ID /* 32-bit */, "wrong error %u\n", GetLastError() ); + || GetLastError() == ERROR_INVALID_THREAD_ID /* 32-bit */, "wrong error %lu\n", GetLastError() ); ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegDs + 0x100, &entry); ok(!ret, "GetThreadSelectorEntry(invalid) succeeded\n"); ok( GetLastError() == ERROR_GEN_FAILURE - || GetLastError() == ERROR_NOACCESS /* 32-bit */, "wrong error %u\n", GetLastError() ); + || GetLastError() == ERROR_NOACCESS /* 32-bit */, "wrong error %lu\n", GetLastError() );
memset(&entry, 0x11, sizeof(entry)); ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegFs, &entry); - ok(ret, "GetThreadSelectorEntry(SegFs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegFs) error %lu\n", GetLastError()); entry.HighWord.Bits.Type &= ~1; /* ignore accessed bit */
base = (void *)((entry.HighWord.Bits.BaseHi << 24) | (entry.HighWord.Bits.BaseMid << 16) | entry.BaseLow); limit = (entry.HighWord.Bits.LimitHi << 16) | entry.LimitLow;
ok(base == NtCurrentTeb(), "expected %p, got %p\n", NtCurrentTeb(), base); - ok(limit == 0x0fff || limit == 0x4000, "expected 0x0fff or 0x4000, got %#x\n", limit); + ok(limit == 0x0fff || limit == 0x4000, "expected 0x0fff or 0x4000, got %#lx\n", limit); ok(entry.HighWord.Bits.Type == 0x12, "expected 0x12, got %#x\n", entry.HighWord.Bits.Type); ok(entry.HighWord.Bits.Dpl == 3, "expected 3, got %u\n", entry.HighWord.Bits.Dpl); ok(entry.HighWord.Bits.Pres == 1, "expected 1, got %u\n", entry.HighWord.Bits.Pres); @@ -1264,13 +1264,13 @@ static void test_GetThreadSelectorEntry(void)
memset(&entry, 0x11, sizeof(entry)); ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegCs, &entry); - ok(ret, "GetThreadSelectorEntry(SegDs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegDs) error %lu\n", GetLastError()); entry.HighWord.Bits.Type &= ~1; /* ignore accessed bit */ base = (void *)((entry.HighWord.Bits.BaseHi << 24) | (entry.HighWord.Bits.BaseMid << 16) | entry.BaseLow); limit = (entry.HighWord.Bits.LimitHi << 16) | entry.LimitLow;
ok(base == 0, "got base %p\n", base); - ok(limit == ~0u >> 12, "got limit %#x\n", limit); + ok(limit == ~0u >> 12, "got limit %#lx\n", limit); ok(entry.HighWord.Bits.Type == 0x1a, "expected 0x12, got %#x\n", entry.HighWord.Bits.Type); ok(entry.HighWord.Bits.Dpl == 3, "expected 3, got %u\n", entry.HighWord.Bits.Dpl); ok(entry.HighWord.Bits.Pres == 1, "expected 1, got %u\n", entry.HighWord.Bits.Pres); @@ -1281,13 +1281,13 @@ static void test_GetThreadSelectorEntry(void)
memset(&entry, 0x11, sizeof(entry)); ret = GetThreadSelectorEntry(GetCurrentThread(), ctx.SegDs, &entry); - ok(ret, "GetThreadSelectorEntry(SegDs) error %u\n", GetLastError()); + ok(ret, "GetThreadSelectorEntry(SegDs) error %lu\n", GetLastError()); entry.HighWord.Bits.Type &= ~1; /* ignore accessed bit */ base = (void *)((entry.HighWord.Bits.BaseHi << 24) | (entry.HighWord.Bits.BaseMid << 16) | entry.BaseLow); limit = (entry.HighWord.Bits.LimitHi << 16) | entry.LimitLow;
ok(base == 0, "got base %p\n", base); - ok(limit == ~0u >> 12, "got limit %#x\n", limit); + ok(limit == ~0u >> 12, "got limit %#lx\n", limit); ok(entry.HighWord.Bits.Type == 0x12, "expected 0x12, got %#x\n", entry.HighWord.Bits.Type); ok(entry.HighWord.Bits.Dpl == 3, "expected 3, got %u\n", entry.HighWord.Bits.Dpl); ok(entry.HighWord.Bits.Pres == 1, "expected 1, got %u\n", entry.HighWord.Bits.Pres); @@ -1327,14 +1327,14 @@ static void test_QueueUserWorkItem(void) for (i = 0; i < 100; i++) { BOOL ret = pQueueUserWorkItem(work_function, (void *)i, WT_EXECUTEDEFAULT); - ok(ret, "QueueUserWorkItem failed with error %d\n", GetLastError()); + ok(ret, "QueueUserWorkItem failed with error %ld\n", GetLastError()); }
wait_result = WaitForSingleObject(finish_event, 10000);
after = GetTickCount(); - trace("100 QueueUserWorkItem calls took %dms\n", after - before); - ok(wait_result == WAIT_OBJECT_0, "wait failed with error 0x%x\n", wait_result); + trace("100 QueueUserWorkItem calls took %ldms\n", after - before); + ok(wait_result == WAIT_OBJECT_0, "wait failed with error 0x%lx\n", wait_result);
ok(times_executed == 100, "didn't execute all of the work items\n"); } @@ -1352,7 +1352,7 @@ static void CALLBACK wait_complete_function(PVOID p, BOOLEAN TimerOrWaitFired) DWORD res; ok(!TimerOrWaitFired, "wait shouldn't have timed out\n"); res = WaitForSingleObject(event, INFINITE); - ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", res); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", res); }
static void CALLBACK timeout_function(PVOID p, BOOLEAN TimerOrWaitFired) @@ -1393,7 +1393,7 @@ static void CALLBACK unregister_function(PVOID p, BOOLEAN TimerOrWaitFired) BOOL ret; ok(wait_handle != INVALID_HANDLE_VALUE, "invalid wait handle\n"); ret = pUnregisterWait(param->wait_handle); - todo_wine ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + todo_wine ok(ret, "UnregisterWait failed with error %ld\n", GetLastError()); SetEvent(param->complete_event); }
@@ -1420,36 +1420,36 @@ static void test_RegisterWaitForSingleObject(void) complete_event = CreateEventW(NULL, FALSE, FALSE, NULL);
ret = pRegisterWaitForSingleObject(&wait_handle, handle, signaled_function, complete_event, INFINITE, WT_EXECUTEONLYONCE); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
WaitForSingleObject(complete_event, INFINITE); /* give worker thread chance to complete */ Sleep(100);
ret = pUnregisterWait(wait_handle); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
/* test cancel case */
ResetEvent(handle);
ret = pRegisterWaitForSingleObject(&wait_handle, handle, signaled_function, complete_event, INFINITE, WT_EXECUTEONLYONCE); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
ret = pUnregisterWait(wait_handle); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
/* test unregister while running */
SetEvent(handle); ret = pRegisterWaitForSingleObject(&wait_handle, handle, wait_complete_function, complete_event, INFINITE, WT_EXECUTEONLYONCE); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
/* give worker thread chance to start */ Sleep(50); ret = pUnregisterWait(wait_handle); ok(!ret, "UnregisterWait succeeded\n"); - ok(GetLastError() == ERROR_IO_PENDING, "UnregisterWait failed with error %d\n", GetLastError()); + ok(GetLastError() == ERROR_IO_PENDING, "UnregisterWait failed with error %ld\n", GetLastError());
/* give worker thread chance to complete */ SetEvent(complete_event); @@ -1460,33 +1460,33 @@ static void test_RegisterWaitForSingleObject(void) ResetEvent(handle);
ret = pRegisterWaitForSingleObject(&wait_handle, handle, timeout_function, complete_event, 0, WT_EXECUTEONLYONCE); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
WaitForSingleObject(complete_event, INFINITE); /* give worker thread chance to complete */ Sleep(100);
ret = pUnregisterWait(wait_handle); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = pUnregisterWait(NULL); ok(!ret, "Expected UnregisterWait to fail\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, - "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + "Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* test WT_EXECUTEINWAITTHREAD */
SetEvent(handle); ret = pRegisterWaitForSingleObject(&wait_handle, handle, signaled_function, complete_event, INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
WaitForSingleObject(complete_event, INFINITE); /* give worker thread chance to complete */ Sleep(100);
ret = pUnregisterWait(wait_handle); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
/* the callback execution should be sequentially consistent with the wait handle return, even if the event is already set */ @@ -1498,7 +1498,7 @@ static void test_RegisterWaitForSingleObject(void) unregister_param.wait_handle = INVALID_HANDLE_VALUE;
ret = pRegisterWaitForSingleObject(&unregister_param.wait_handle, handle, unregister_function, &unregister_param, INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
WaitForSingleObject(complete_event, INFINITE); } @@ -1517,20 +1517,20 @@ static void test_RegisterWaitForSingleObject(void)
ret = pRegisterWaitForSingleObject(&wait_handle2, waitthread_trigger_event, signaled_function, waitthread_wait_event, INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
ret = pRegisterWaitForSingleObject(&wait_handle, handle, waitthread_test_function, ¶m, INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTEINWAITTHREAD); - ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); + ok(ret, "RegisterWaitForSingleObject failed with error %ld\n", GetLastError());
WaitForSingleObject(complete_event, INFINITE); /* give worker thread chance to complete */ Sleep(100);
ret = pUnregisterWait(wait_handle); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
ret = pUnregisterWait(wait_handle2); - ok(ret, "UnregisterWait failed with error %d\n", GetLastError()); + ok(ret, "UnregisterWait failed with error %ld\n", GetLastError());
CloseHandle(waitthread_wait_event); CloseHandle(waitthread_trigger_event); @@ -1736,7 +1736,7 @@ static void run_LS_tests(void) }
ret = WaitForMultipleObjects(2, threads, TRUE, 60000); - ok(ret == WAIT_OBJECT_0 || broken(ret == WAIT_OBJECT_0+1 /* nt4,w2k */), "WaitForAllObjects 2 threads %d\n",ret); + ok(ret == WAIT_OBJECT_0 || broken(ret == WAIT_OBJECT_0+1 /* nt4,w2k */), "WaitForAllObjects 2 threads %ld\n",ret);
for (i = 0; i < 2; ++i) CloseHandle(threads[i]); @@ -1809,48 +1809,48 @@ static void test_ThreadErrorMode(void) ret = pSetThreadErrorMode(0, &mode); ok(ret, "SetThreadErrorMode failed\n"); ok(mode == oldmode, - "SetThreadErrorMode returned old mode 0x%x, expected 0x%x\n", + "SetThreadErrorMode returned old mode 0x%lx, expected 0x%lx\n", mode, oldmode); mode = pGetThreadErrorMode(); - ok(mode == 0, "GetThreadErrorMode returned mode 0x%x, expected 0\n", mode); + ok(mode == 0, "GetThreadErrorMode returned mode 0x%lx, expected 0\n", mode); rtlmode = pRtlGetThreadErrorMode(); ok(rtlmode == 0, - "RtlGetThreadErrorMode returned mode 0x%x, expected 0\n", mode); + "RtlGetThreadErrorMode returned mode 0x%lx, expected 0\n", mode);
ret = pSetThreadErrorMode(SEM_FAILCRITICALERRORS, &mode); ok(ret, "SetThreadErrorMode failed\n"); ok(mode == 0, - "SetThreadErrorMode returned old mode 0x%x, expected 0\n", mode); + "SetThreadErrorMode returned old mode 0x%lx, expected 0\n", mode); mode = pGetThreadErrorMode(); ok(mode == SEM_FAILCRITICALERRORS, - "GetThreadErrorMode returned mode 0x%x, expected SEM_FAILCRITICALERRORS\n", + "GetThreadErrorMode returned mode 0x%lx, expected SEM_FAILCRITICALERRORS\n", mode); rtlmode = pRtlGetThreadErrorMode(); ok(rtlmode == 0x10, - "RtlGetThreadErrorMode returned mode 0x%x, expected 0x10\n", mode); + "RtlGetThreadErrorMode returned mode 0x%lx, expected 0x10\n", mode);
ret = pSetThreadErrorMode(SEM_NOGPFAULTERRORBOX, &mode); ok(ret, "SetThreadErrorMode failed\n"); ok(mode == SEM_FAILCRITICALERRORS, - "SetThreadErrorMode returned old mode 0x%x, expected SEM_FAILCRITICALERRORS\n", + "SetThreadErrorMode returned old mode 0x%lx, expected SEM_FAILCRITICALERRORS\n", mode); mode = pGetThreadErrorMode(); ok(mode == SEM_NOGPFAULTERRORBOX, - "GetThreadErrorMode returned mode 0x%x, expected SEM_NOGPFAULTERRORBOX\n", + "GetThreadErrorMode returned mode 0x%lx, expected SEM_NOGPFAULTERRORBOX\n", mode); rtlmode = pRtlGetThreadErrorMode(); ok(rtlmode == 0x20, - "RtlGetThreadErrorMode returned mode 0x%x, expected 0x20\n", mode); + "RtlGetThreadErrorMode returned mode 0x%lx, expected 0x20\n", mode);
ret = pSetThreadErrorMode(SEM_NOOPENFILEERRORBOX, NULL); ok(ret, "SetThreadErrorMode failed\n"); mode = pGetThreadErrorMode(); ok(mode == SEM_NOOPENFILEERRORBOX, - "GetThreadErrorMode returned mode 0x%x, expected SEM_NOOPENFILEERRORBOX\n", + "GetThreadErrorMode returned mode 0x%lx, expected SEM_NOOPENFILEERRORBOX\n", mode); rtlmode = pRtlGetThreadErrorMode(); ok(rtlmode == 0x40, - "RtlGetThreadErrorMode returned mode 0x%x, expected 0x40\n", rtlmode); + "RtlGetThreadErrorMode returned mode 0x%lx, expected 0x40\n", rtlmode);
for (mode = 1; mode; mode <<= 1) { @@ -1860,17 +1860,17 @@ static void test_ThreadErrorMode(void) SEM_NOOPENFILEERRORBOX)) { ok(ret, - "SetThreadErrorMode(0x%x,NULL) failed with error %d\n", + "SetThreadErrorMode(0x%lx,NULL) failed with error %ld\n", mode, GetLastError()); } else { DWORD GLE = GetLastError(); ok(!ret, - "SetThreadErrorMode(0x%x,NULL) succeeded, expected failure\n", + "SetThreadErrorMode(0x%lx,NULL) succeeded, expected failure\n", mode); ok(GLE == ERROR_INVALID_PARAMETER, - "SetThreadErrorMode(0x%x,NULL) failed with %d, " + "SetThreadErrorMode(0x%lx,NULL) failed with %ld, " "expected ERROR_INVALID_PARAMETER\n", mode, GLE); } @@ -1939,7 +1939,7 @@ static DWORD WINAPI fpu_thread(void *param) ctx->fpu_cw = get_fpu_cw();
ret = SetEvent(ctx->finished); - ok(ret, "SetEvent failed, last error %#x.\n", GetLastError()); + ok(ret, "SetEvent failed, last error %#lx.\n", GetLastError());
return 0; } @@ -1951,16 +1951,16 @@ static unsigned int get_thread_fpu_cw( unsigned long *fpu_cw ) HANDLE thread;
ctx.finished = CreateEventW(NULL, FALSE, FALSE, NULL); - ok(!!ctx.finished, "Failed to create event, last error %#x.\n", GetLastError()); + ok(!!ctx.finished, "Failed to create event, last error %#lx.\n", GetLastError());
thread = CreateThread(NULL, 0, fpu_thread, &ctx, 0, &tid); - ok(!!thread, "Failed to create thread, last error %#x.\n", GetLastError()); + ok(!!thread, "Failed to create thread, last error %#lx.\n", GetLastError());
res = WaitForSingleObject(ctx.finished, INFINITE); - ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError()); + ok(res == WAIT_OBJECT_0, "Wait failed (%#lx), last error %#lx.\n", res, GetLastError());
res = CloseHandle(ctx.finished); - ok(!!res, "Failed to close event handle, last error %#x.\n", GetLastError()); + ok(!!res, "Failed to close event handle, last error %#lx.\n", GetLastError());
CloseHandle(thread); *fpu_cw = ctx.fpu_cw; @@ -2078,7 +2078,7 @@ static void create_manifest_file(const char *filename, const char *manifest)
MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH ); file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError()); WriteFile(file, manifest, strlen(manifest), &size, NULL); CloseHandle(file); } @@ -2095,10 +2095,10 @@ static HANDLE test_create(const char *file) actctx.lpSource = path;
handle = CreateActCtxW(&actctx); - ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %lu\n", GetLastError());
- ok(actctx.cbSize == sizeof(actctx), "cbSize=%d\n", actctx.cbSize); - ok(actctx.dwFlags == 0, "dwFlags=%d\n", actctx.dwFlags); + ok(actctx.cbSize == sizeof(actctx), "cbSize=%ld\n", actctx.cbSize); + ok(actctx.dwFlags == 0, "dwFlags=%ld\n", actctx.dwFlags); ok(actctx.lpSource == path, "lpSource=%p\n", actctx.lpSource); ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture); ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId); @@ -2127,14 +2127,14 @@ static void test_thread_actctx(void)
handle = (void*)0xdeadbeef; b = GetCurrentActCtx(&handle); - ok(b, "GetCurrentActCtx failed: %u\n", GetLastError()); + ok(b, "GetCurrentActCtx failed: %lu\n", GetLastError()); ok(handle == 0, "active context %p\n", handle);
/* without active context */ param.thread_context = (void*)0xdeadbeef; param.handle = NULL; thread = CreateThread(NULL, 0, thread_actctx_func, ¶m, 0, &tid); - ok(thread != NULL, "failed, got %u\n", GetLastError()); + ok(thread != NULL, "failed, got %lu\n", GetLastError());
ret = WaitForSingleObject(thread, 1000); ok(ret == WAIT_OBJECT_0, "wait timeout\n"); @@ -2142,21 +2142,21 @@ static void test_thread_actctx(void) CloseHandle(thread);
b = ActivateActCtx(context, &cookie); - ok(b, "activation failed: %u\n", GetLastError()); + ok(b, "activation failed: %lu\n", GetLastError());
handle = 0; b = GetCurrentActCtx(&handle); - ok(b, "GetCurrentActCtx failed: %u\n", GetLastError()); + ok(b, "GetCurrentActCtx failed: %lu\n", GetLastError()); ok(handle != 0, "no active context\n"); ReleaseActCtx(handle);
param.handle = NULL; b = GetCurrentActCtx(¶m.handle); - ok(b && param.handle != NULL, "failed to get context, %u\n", GetLastError()); + ok(b && param.handle != NULL, "failed to get context, %lu\n", GetLastError());
param.thread_context = (void*)0xdeadbeef; thread = CreateThread(NULL, 0, thread_actctx_func, ¶m, 0, &tid); - ok(thread != NULL, "failed, got %u\n", GetLastError()); + ok(thread != NULL, "failed, got %lu\n", GetLastError());
ret = WaitForSingleObject(thread, 1000); ok(ret == WAIT_OBJECT_0, "wait timeout\n"); @@ -2167,7 +2167,7 @@ static void test_thread_actctx(void) /* similar test for CreateRemoteThread() */ param.thread_context = (void*)0xdeadbeef; thread = CreateRemoteThread(GetCurrentProcess(), NULL, 0, thread_actctx_func, ¶m, 0, &tid); - ok(thread != NULL, "failed, got %u\n", GetLastError()); + ok(thread != NULL, "failed, got %lu\n", GetLastError());
ret = WaitForSingleObject(thread, 1000); ok(ret == WAIT_OBJECT_0, "wait timeout\n"); @@ -2178,7 +2178,7 @@ static void test_thread_actctx(void) ReleaseActCtx(param.handle);
b = DeactivateActCtx(0, cookie); - ok(b, "DeactivateActCtx failed: %u\n", GetLastError()); + ok(b, "DeactivateActCtx failed: %lu\n", GetLastError()); ReleaseActCtx(context); }
@@ -2201,7 +2201,7 @@ static void test_threadpool(void) }
work = pCreateThreadpoolWork(threadpool_workcallback, &workcalled, NULL); - ok (work != NULL, "Error %d in CreateThreadpoolWork\n", GetLastError()); + ok (work != NULL, "Error %ld in CreateThreadpoolWork\n", GetLastError()); pSubmitThreadpoolWork(work); pWaitForThreadpoolWorkCallbacks(work, FALSE); pCloseThreadpoolWork(work); @@ -2230,7 +2230,7 @@ static void test_reserved_tls(void)
/* Also make sure that there is a TLS allocated. */ tls = TlsAlloc(); - ok(tls && tls != TLS_OUT_OF_INDEXES, "tls = %x\n", tls); + ok(tls && tls != TLS_OUT_OF_INDEXES, "tls = %lx\n", tls); TlsSetValue(tls, (void*)1);
val = TlsGetValue(0); @@ -2243,7 +2243,7 @@ static void test_reserved_tls(void) /* Set TLS index 0 value and see that this works and doesn't cause problems * for remaining tests. */ ret = TlsSetValue(0, (void*)1); - ok(ret, "TlsSetValue(0, 1) failed: %u\n", GetLastError()); + ok(ret, "TlsSetValue(0, 1) failed: %lu\n", GetLastError());
val = TlsGetValue(0); ok(val == (void*)1, "TlsGetValue(0) = %p\n", val); @@ -2323,27 +2323,27 @@ static void test_thread_info(void) case ThreadBasicInformation: case ThreadAmILastThread: case ThreadPriorityBoost: - ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); + ok(status == STATUS_SUCCESS, "for info %lu expected STATUS_SUCCESS, got %08lx (ret_len %lu)\n", i, status, ret_len); break;
#ifdef __i386__ case ThreadDescriptorTableEntry: ok(status == STATUS_SUCCESS || broken(status == STATUS_ACCESS_DENIED) /* testbot VM is broken */, - "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); + "for info %lu expected STATUS_SUCCESS, got %08lx (ret_len %lu)\n", i, status, ret_len); break; #endif
case ThreadTimes: - ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); + ok(status == STATUS_SUCCESS, "for info %lu expected STATUS_SUCCESS, got %08lx (ret_len %lu)\n", i, status, ret_len); break;
case ThreadIsIoPending: todo_wine - ok(status == STATUS_ACCESS_DENIED, "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n", i, status, ret_len); + ok(status == STATUS_ACCESS_DENIED, "for info %lu expected STATUS_ACCESS_DENIED, got %08lx (ret_len %lu)\n", i, status, ret_len); break;
default: - ok(status == STATUS_ACCESS_DENIED, "for info %u expected STATUS_ACCESS_DENIED, got %08x (ret_len %u)\n", i, status, ret_len); + ok(status == STATUS_ACCESS_DENIED, "for info %lu expected STATUS_ACCESS_DENIED, got %08lx (ret_len %lu)\n", i, status, ret_len); break; } } @@ -2373,47 +2373,47 @@ static void test_thread_description(void) /* Initial description. */ ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#lx.\n", hr); ok(!lstrcmpW(ptr, L""), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr);
len = 0; status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, 0, &len); - ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status); - ok(len == sizeof(*thread_desc), "Unexpected structure length %u.\n", len); + ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#lx.\n", status); + ok(len == sizeof(*thread_desc), "Unexpected structure length %lu.\n", len);
len2 = 0; thread_desc->ThreadName.Length = 1; thread_desc->ThreadName.MaximumLength = 0; thread_desc->ThreadName.Buffer = (WCHAR *)thread_desc; status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, len, &len2); - ok(!status, "Failed to get thread info, status %#x.\n", status); - ok(len2 == sizeof(*thread_desc), "Unexpected structure length %u.\n", len); + ok(!status, "Failed to get thread info, status %#lx.\n", status); + ok(len2 == sizeof(*thread_desc), "Unexpected structure length %lu.\n", len); ok(!thread_desc->ThreadName.Length, "Unexpected description length %#x.\n", thread_desc->ThreadName.Length); ok(thread_desc->ThreadName.Buffer == (WCHAR *)(thread_desc + 1), "Unexpected description string pointer %p, %p.\n", thread_desc->ThreadName.Buffer, thread_desc);
hr = pSetThreadDescription(GetCurrentThread(), NULL); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#lx.\n", hr);
hr = pSetThreadDescription(GetCurrentThread(), desc); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#lx.\n", hr);
ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#lx.\n", hr); ok(!lstrcmpW(ptr, desc), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr);
len = 0; status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, 0, &len); - ok(status == STATUS_BUFFER_TOO_SMALL, "Failed to get thread info, status %#x.\n", status); - ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len); + ok(status == STATUS_BUFFER_TOO_SMALL, "Failed to get thread info, status %#lx.\n", status); + ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %lu.\n", len);
len = 0; status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, buff, sizeof(buff), &len); ok(!status, "Failed to get thread info.\n"); - ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len); + ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %lu.\n", len);
ok(thread_desc->ThreadName.Length == desc_len && thread_desc->ThreadName.MaximumLength == desc_len, "Unexpected description length %u.\n", thread_desc->ThreadName.Length); @@ -2424,56 +2424,56 @@ static void test_thread_description(void) /* Partial results. */ len = 0; status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, 0, &len); - ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status); - ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len); + ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#lx.\n", status); + ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %lu.\n", len);
status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, buff, len - sizeof(WCHAR), &len); - ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status); - ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len); + ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#lx.\n", status); + ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %lu.\n", len);
/* Change description. */ thread_desc->ThreadName.Length = thread_desc->ThreadName.MaximumLength = 8; lstrcpyW((WCHAR *)(thread_desc + 1), L"desc");
status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc)); - ok(status == STATUS_SUCCESS, "Failed to set thread description, status %#x.\n", status); + ok(status == STATUS_SUCCESS, "Failed to set thread description, status %#lx.\n", status);
ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#lx.\n", hr); ok(!lstrcmpW(ptr, L"desc"), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr);
status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc) - 1); - ok(status == STATUS_INFO_LENGTH_MISMATCH, "Unexpected status %#x.\n", status); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "Unexpected status %#lx.\n", status);
status = NtSetInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, sizeof(*thread_desc)); - ok(status == STATUS_ACCESS_VIOLATION, "Unexpected status %#x.\n", status); + ok(status == STATUS_ACCESS_VIOLATION, "Unexpected status %#lx.\n", status);
thread_desc->ThreadName.Buffer = NULL; status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc)); - ok(status == STATUS_ACCESS_VIOLATION, "Unexpected status %#x.\n", status); + ok(status == STATUS_ACCESS_VIOLATION, "Unexpected status %#lx.\n", status);
hr = pSetThreadDescription(GetCurrentThread(), NULL); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#lx.\n", hr);
ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#lx.\n", hr); ok(!lstrcmpW(ptr, L""), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr);
/* Set with 0 length/NULL pointer. */ hr = pSetThreadDescription(GetCurrentThread(), L"123"); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#lx.\n", hr);
memset(thread_desc, 0, sizeof(*thread_desc)); status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc)); - ok(!status, "Failed to set thread description, status %#x.\n", status); + ok(!status, "Failed to set thread description, status %#lx.\n", status);
ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); - ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); + ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#lx.\n", hr); ok(!lstrcmpW(ptr, L""), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr); } @@ -2552,7 +2552,7 @@ START_TEST(thread) HANDLE hThread; DWORD tid; hThread = CreateThread(NULL, 0, threadFunc2, NULL, 0, &tid); - ok(hThread != NULL, "CreateThread failed, error %u\n", + ok(hThread != NULL, "CreateThread failed, error %lu\n", GetLastError()); ok(WaitForSingleObject(hThread, 200) == WAIT_OBJECT_0, "Thread did not exit in time\n"); diff --git a/dlls/kernel32/tests/time.c b/dlls/kernel32/tests/time.c index 0ae272311bb..b1e14b1b8c4 100644 --- a/dlls/kernel32/tests/time.c +++ b/dlls/kernel32/tests/time.c @@ -122,14 +122,14 @@ static void test_conversions(void) SETUP_ZEROTIME(st) ok (SystemTimeToFileTime(&st, &ft), "Conversion failed ZERO_TIME\n"); ok( (!((ft.dwHighDateTime != 0) || (ft.dwLowDateTime != 0))), - "Wrong time for ATIME: %08x %08x (correct %08x %08x)\n", + "Wrong time for ATIME: %08lx %08lx (correct %08x %08x)\n", ft.dwLowDateTime, ft.dwHighDateTime, 0, 0);
SETUP_ATIME(st) ok (SystemTimeToFileTime(&st,&ft), "Conversion Failed ATIME\n"); ok( (!((ft.dwHighDateTime != ATIME_HI) || (ft.dwLowDateTime!=ATIME_LOW))), - "Wrong time for ATIME: %08x %08x (correct %08x %08x)\n", + "Wrong time for ATIME: %08lx %08lx (correct %08x %08x)\n", ft.dwLowDateTime, ft.dwHighDateTime, ATIME_LOW, ATIME_HI);
@@ -138,7 +138,7 @@ static void test_conversions(void)
ok( (!((ft.dwHighDateTime != MAYDAY_2002_HI) || (ft.dwLowDateTime!=MAYDAY_2002_LO))), - "Wrong time for 2002 %08x %08x (correct %08x %08x)\n", ft.dwLowDateTime, + "Wrong time for 2002 %08lx %08lx (correct %08x %08x)\n", ft.dwLowDateTime, ft.dwHighDateTime, MAYDAY_2002_LO, MAYDAY_2002_HI);
@@ -147,7 +147,7 @@ static void test_conversions(void)
ok( (!((ft.dwHighDateTime!=NEWYEAR_1980_HI) || (ft.dwLowDateTime!=NEWYEAR_1980_LO))) , - "Wrong time for 1980 %08x %08x (correct %08x %08x)\n", ft.dwLowDateTime, + "Wrong time for 1980 %08lx %08lx (correct %08x %08x)\n", ft.dwLowDateTime, ft.dwHighDateTime, NEWYEAR_1980_LO,NEWYEAR_1980_HI );
ok(DosDateTimeToFileTime(DOS_DATE(1980,1,1),DOS_TIME(0,0,0),&ft), @@ -155,7 +155,7 @@ static void test_conversions(void)
ok( (!((ft.dwHighDateTime!=NEWYEAR_1980_HI) || (ft.dwLowDateTime!=NEWYEAR_1980_LO))), - "Wrong time DosDateTimeToFileTime %08x %08x (correct %08x %08x)\n", + "Wrong time DosDateTimeToFileTime %08lx %08lx (correct %08x %08x)\n", ft.dwHighDateTime, ft.dwLowDateTime, NEWYEAR_1980_HI, NEWYEAR_1980_LO);
} @@ -173,7 +173,7 @@ static void test_invalid_arg(void) "DosDateTimeToFileTime() failed\n");
ok( (ft.dwHighDateTime==NEWYEAR_1980_HI) && (ft.dwLowDateTime==NEWYEAR_1980_LO), - "filetime for 1/1/80 00:00:00 was %08x %08x\n", ft.dwHighDateTime, ft.dwLowDateTime); + "filetime for 1/1/80 00:00:00 was %08lx %08lx\n", ft.dwHighDateTime, ft.dwLowDateTime);
/* now check SystemTimeToFileTime */ memset(&ft,0,sizeof ft); @@ -206,7 +206,7 @@ static LONGLONG system_time_to_minutes(const SYSTEMTIME *st)
SetLastError(0xdeadbeef); ret = SystemTimeToFileTime(st, &ft); - ok(ret, "SystemTimeToFileTime error %u\n", GetLastError()); + ok(ret, "SystemTimeToFileTime error %lu\n", GetLastError());
minutes = ((LONGLONG)ft.dwHighDateTime << 32) + ft.dwLowDateTime; minutes /= (LONGLONG)600000000; /* convert to minutes */ @@ -226,7 +226,7 @@ static LONG get_tz_bias(const TIME_ZONE_INFORMATION *tzinfo, DWORD tz_id) return tzinfo->StandardBias;
default: - trace("unknown time zone id %d\n", tz_id); + trace("unknown time zone id %ld\n", tz_id); /* fall through */ case TIME_ZONE_ID_UNKNOWN: return 0; @@ -249,19 +249,19 @@ static void test_GetTimeZoneInformation(void)
SetLastError(0xdeadbeef); res = SystemTimeToFileTime(&st, &s_ft); - ok(res, "SystemTimeToFileTime error %u\n", GetLastError()); + ok(res, "SystemTimeToFileTime error %lu\n", GetLastError()); SetLastError(0xdeadbeef); res = FileTimeToLocalFileTime(&s_ft, &l_ft); - ok(res, "FileTimeToLocalFileTime error %u\n", GetLastError()); + ok(res, "FileTimeToLocalFileTime error %lu\n", GetLastError()); SetLastError(0xdeadbeef); res = FileTimeToSystemTime(&l_ft, &local); - ok(res, "FileTimeToSystemTime error %u\n", GetLastError()); + ok(res, "FileTimeToSystemTime error %lu\n", GetLastError()); l_time = system_time_to_minutes(&local);
tz_id = GetTimeZoneInformation(&tzinfo); ok(tz_id != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
- trace("tz_id %u (%s)\n", tz_id, + trace("tz_id %lu (%s)\n", tz_id, tz_id == TIME_ZONE_ID_DAYLIGHT ? "TIME_ZONE_ID_DAYLIGHT" : (tz_id == TIME_ZONE_ID_STANDARD ? "TIME_ZONE_ID_STANDARD" : (tz_id == TIME_ZONE_ID_UNKNOWN ? "TIME_ZONE_ID_UNKNOWN" : @@ -269,14 +269,14 @@ static void test_GetTimeZoneInformation(void)
WideCharToMultiByte(CP_ACP, 0, tzinfo.StandardName, -1, std_name, sizeof(std_name), NULL, NULL); WideCharToMultiByte(CP_ACP, 0, tzinfo.DaylightName, -1, dlt_name, sizeof(dlt_name), NULL, NULL); - trace("bias %d, %s - %s\n", tzinfo.Bias, std_name, dlt_name); - trace("standard (d/m/y): %u/%02u/%04u day of week %u %u:%02u:%02u.%03u bias %d\n", + trace("bias %ld, %s - %s\n", tzinfo.Bias, std_name, dlt_name); + trace("standard (d/m/y): %u/%02u/%04u day of week %u %u:%02u:%02u.%03u bias %ld\n", tzinfo.StandardDate.wDay, tzinfo.StandardDate.wMonth, tzinfo.StandardDate.wYear, tzinfo.StandardDate.wDayOfWeek, tzinfo.StandardDate.wHour, tzinfo.StandardDate.wMinute, tzinfo.StandardDate.wSecond, tzinfo.StandardDate.wMilliseconds, tzinfo.StandardBias); - trace("daylight (d/m/y): %u/%02u/%04u day of week %u %u:%02u:%02u.%03u bias %d\n", + trace("daylight (d/m/y): %u/%02u/%04u day of week %u %u:%02u:%02u.%03u bias %ld\n", tzinfo.DaylightDate.wDay, tzinfo.DaylightDate.wMonth, tzinfo.DaylightDate.wYear, tzinfo.DaylightDate.wDayOfWeek, tzinfo.DaylightDate.wHour, tzinfo.DaylightDate.wMinute, @@ -285,7 +285,7 @@ static void test_GetTimeZoneInformation(void)
diff = (LONG)(s_time - l_time); ok(diff == tzinfo.Bias + get_tz_bias(&tzinfo, tz_id), - "system/local diff %d != tz bias %d\n", + "system/local diff %ld != tz bias %ld\n", diff, tzinfo.Bias + get_tz_bias(&tzinfo, tz_id));
ok(SetEnvironmentVariableA("TZ","GMT0") != 0, @@ -317,16 +317,16 @@ static void test_GetTimeZoneInformation(void) return; }
- ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError()); + ok(res, "SystemTimeToTzSpecificLocalTime error %lu\n", GetLastError()); s_time = system_time_to_minutes(¤t);
tzinfo.StandardBias -= 123; tzinfo.DaylightBias += 456;
res = pSystemTimeToTzSpecificLocalTime(&tzinfo, &utc, &local); - ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError()); + ok(res, "SystemTimeToTzSpecificLocalTime error %lu\n", GetLastError()); l_time = system_time_to_minutes(&local); - ok(l_time - s_time == diff - get_tz_bias(&tzinfo, tz_id), "got %d, expected %d\n", + ok(l_time - s_time == diff - get_tz_bias(&tzinfo, tz_id), "got %ld, expected %ld\n", (LONG)(l_time - s_time), diff - get_tz_bias(&tzinfo, tz_id));
/* pretend that there is no transition dates */ @@ -338,9 +338,9 @@ static void test_GetTimeZoneInformation(void) tzinfo.StandardDate.wYear = 0;
res = pSystemTimeToTzSpecificLocalTime(&tzinfo, &utc, &local); - ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError()); + ok(res, "SystemTimeToTzSpecificLocalTime error %lu\n", GetLastError()); l_time = system_time_to_minutes(&local); - ok(l_time - s_time == diff, "got %d, expected %d\n", + ok(l_time - s_time == diff, "got %ld, expected %ld\n", (LONG)(l_time - s_time), diff);
/* test 23:01, 31st of December date */ @@ -361,7 +361,7 @@ static void test_GetTimeZoneInformation(void) utc.wHour = 23; utc.wMinute = 1; res = pSystemTimeToTzSpecificLocalTime(&tzinfo, &utc, &local); - ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError()); + ok(res, "SystemTimeToTzSpecificLocalTime error %lu\n", GetLastError()); ok(local.wYear==2012 && local.wMonth==12 && local.wDay==31 && local.wHour==23 && local.wMinute==1, "got (%d-%d-%d %02d:%02d), expected (2012-12-31 23:01)\n", local.wYear, local.wMonth, local.wDay, local.wHour, local.wMinute); @@ -378,7 +378,7 @@ static void test_FileTimeToSystemTime(void) ft.dwLowDateTime = 0; ret = FileTimeToSystemTime(&ft, &st); ok( ret, - "FileTimeToSystemTime() failed with Error %d\n",GetLastError()); + "FileTimeToSystemTime() failed with Error %ld\n",GetLastError()); ok(((st.wYear == 1601) && (st.wMonth == 1) && (st.wDay == 1) && (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 0) && (st.wMilliseconds == 0)), @@ -388,7 +388,7 @@ static void test_FileTimeToSystemTime(void) ft.dwLowDateTime = (UINT)time; ret = FileTimeToSystemTime(&ft, &st); ok( ret, - "FileTimeToSystemTime() failed with Error %d\n",GetLastError()); + "FileTimeToSystemTime() failed with Error %ld\n",GetLastError()); ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) && (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) && (st.wMilliseconds == 0)), @@ -415,7 +415,7 @@ static void test_FileTimeToLocalFileTime(void) ft.dwLowDateTime = (UINT)time; ret = FileTimeToLocalFileTime(&ft, &lft); ok( ret, - "FileTimeToLocalFileTime() failed with Error %d\n",GetLastError()); + "FileTimeToLocalFileTime() failed with Error %ld\n",GetLastError()); FileTimeToSystemTime(&lft, &st); ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) && (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) && @@ -429,7 +429,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 %d\n",GetLastError()); + "FileTimeToLocalFileTime() failed with Error %ld\n",GetLastError()); FileTimeToSystemTime(&lft, &st); ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) && (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) && @@ -647,25 +647,25 @@ static void test_FileTimeToDosDateTime(void) ret = FileTimeToDosDateTime(&ft, NULL, NULL); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = FileTimeToDosDateTime(&ft, &fatdate, NULL); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = FileTimeToDosDateTime(&ft, NULL, &fattime); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = FileTimeToDosDateTime(&ft, &fatdate, &fattime); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); }
static void test_GetCalendarInfo(void) @@ -683,57 +683,57 @@ static void test_GetCalendarInfo(void)
ret = pGetCalendarInfoA( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX | CAL_RETURN_NUMBER, NULL, 0, &val1 ); - ok( ret, "GetCalendarInfoA failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoA failed err %lu\n", GetLastError() ); ok( ret == sizeof(val1), "wrong size %u\n", ret ); - ok( val1 >= 2000 && val1 < 2100, "wrong value %u\n", val1 ); + ok( val1 >= 2000 && val1 < 2100, "wrong value %lu\n", val1 );
ret = pGetCalendarInfoW( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX | CAL_RETURN_NUMBER, NULL, 0, &val2 ); - ok( ret, "GetCalendarInfoW failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoW failed err %lu\n", GetLastError() ); ok( ret == sizeof(val2)/sizeof(WCHAR), "wrong size %u\n", ret ); - ok( val1 == val2, "A/W mismatch %u/%u\n", val1, val2 ); + ok( val1 == val2, "A/W mismatch %lu/%lu\n", val1, val2 );
ret = pGetCalendarInfoA( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX, bufferA, sizeof(bufferA), NULL ); - ok( ret, "GetCalendarInfoA failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoA failed err %lu\n", GetLastError() ); ok( ret == 5, "wrong size %u\n", ret ); - ok( atoi( bufferA ) == val1, "wrong value %s/%u\n", bufferA, val1 ); + ok( atoi( bufferA ) == val1, "wrong value %s/%lu\n", bufferA, val1 );
ret = pGetCalendarInfoW( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX, bufferW, ARRAY_SIZE(bufferW), NULL ); - ok( ret, "GetCalendarInfoW failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoW failed err %lu\n", GetLastError() ); ok( ret == 5, "wrong size %u\n", ret ); memset( bufferA, 0x55, sizeof(bufferA) ); WideCharToMultiByte( CP_ACP, 0, bufferW, -1, bufferA, sizeof(bufferA), NULL, NULL ); - ok( atoi( bufferA ) == val1, "wrong value %s/%u\n", bufferA, val1 ); + ok( atoi( bufferA ) == val1, "wrong value %s/%lu\n", bufferA, val1 );
ret = pGetCalendarInfoA( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX | CAL_RETURN_NUMBER, NULL, 0, NULL ); ok( !ret, "GetCalendarInfoA succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
ret = pGetCalendarInfoA( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX, NULL, 0, NULL ); - ok( ret, "GetCalendarInfoA failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoA failed err %lu\n", GetLastError() ); ok( ret == 5, "wrong size %u\n", ret );
ret = pGetCalendarInfoW( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX | CAL_RETURN_NUMBER, NULL, 0, NULL ); ok( !ret, "GetCalendarInfoW succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
ret = pGetCalendarInfoW( 0x0409, CAL_GREGORIAN, CAL_ITWODIGITYEARMAX, NULL, 0, NULL ); - ok( ret, "GetCalendarInfoW failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoW failed err %lu\n", GetLastError() ); ok( ret == 5, "wrong size %u\n", ret );
ret = pGetCalendarInfoA( LANG_SYSTEM_DEFAULT, CAL_GREGORIAN, CAL_SDAYNAME1, bufferA, sizeof(bufferA), NULL); - ok( ret, "GetCalendarInfoA failed err %u\n", GetLastError() ); + ok( ret, "GetCalendarInfoA failed err %lu\n", GetLastError() ); ret2 = pGetCalendarInfoA( LANG_SYSTEM_DEFAULT, CAL_GREGORIAN, CAL_SDAYNAME1, bufferA, 0, NULL); - ok( ret2, "GetCalendarInfoA failed err %u\n", GetLastError() ); + ok( ret2, "GetCalendarInfoA failed err %lu\n", GetLastError() ); ok( ret == ret2, "got %d, expected %d\n", ret2, ret );
ret2 = pGetCalendarInfoW( LANG_SYSTEM_DEFAULT, CAL_GREGORIAN, CAL_SDAYNAME1, bufferW, ARRAY_SIZE(bufferW), NULL); - ok( ret2, "GetCalendarInfoW failed err %u\n", GetLastError() ); + ok( ret2, "GetCalendarInfoW failed err %lu\n", GetLastError() ); ret2 = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL ); ok( ret == ret2, "got %d, expected %d\n", ret, ret2 ); } @@ -752,13 +752,13 @@ static void test_GetDynamicTimeZoneInformation(void)
ret = pGetDynamicTimeZoneInformation(&dyninfo); ret2 = GetTimeZoneInformation(&tzinfo); - ok(ret == ret2, "got %d, %d\n", ret, ret2); + ok(ret == ret2, "got %ld, %ld\n", ret, ret2);
- ok(dyninfo.Bias == tzinfo.Bias, "got %d, %d\n", dyninfo.Bias, tzinfo.Bias); + ok(dyninfo.Bias == tzinfo.Bias, "got %ld, %ld\n", dyninfo.Bias, tzinfo.Bias); ok(!lstrcmpW(dyninfo.StandardName, tzinfo.StandardName), "got std name %s, %s\n", wine_dbgstr_w(dyninfo.StandardName), wine_dbgstr_w(tzinfo.StandardName)); ok(!memcmp(&dyninfo.StandardDate, &tzinfo.StandardDate, sizeof(dyninfo.StandardDate)), "got different StandardDate\n"); - ok(dyninfo.StandardBias == tzinfo.StandardBias, "got %d, %d\n", dyninfo.StandardBias, tzinfo.StandardBias); + ok(dyninfo.StandardBias == tzinfo.StandardBias, "got %ld, %ld\n", dyninfo.StandardBias, tzinfo.StandardBias); ok(!lstrcmpW(dyninfo.DaylightName, tzinfo.DaylightName), "got daylight name %s, %s\n", wine_dbgstr_w(dyninfo.DaylightName), wine_dbgstr_w(tzinfo.DaylightName)); ok(!memcmp(&dyninfo.DaylightDate, &tzinfo.DaylightDate, sizeof(dyninfo.DaylightDate)), "got different DaylightDate\n"); @@ -856,7 +856,7 @@ static void test_GetSystemTimes(void)
ok( !NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), &ReturnLength), "NtQuerySystemInformation failed\n" ); - ok( sizeof(sbi) == ReturnLength, "Inconsistent length %d\n", ReturnLength ); + ok( sizeof(sbi) == ReturnLength, "Inconsistent length %ld\n", ReturnLength );
/* Check if we have some return values */ trace( "Number of Processors : %d\n", sbi.NumberOfProcessors ); @@ -972,30 +972,30 @@ static void test_GetTimeZoneInformationForYear(void) GetTimeZoneInformation(&local_tzinfo);
ret = pGetTimeZoneInformationForYear(systemtime.wYear, NULL, &tzinfo); - ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %u\n", GetLastError()); - ok(tzinfo.Bias == local_tzinfo.Bias, "Expected Bias %d, got %d\n", local_tzinfo.Bias, tzinfo.Bias); + ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %lu\n", GetLastError()); + ok(tzinfo.Bias == local_tzinfo.Bias, "Expected Bias %ld, got %ld\n", local_tzinfo.Bias, tzinfo.Bias); ok(!lstrcmpW(tzinfo.StandardName, local_tzinfo.StandardName), "Expected StandardName %s, got %s\n", wine_dbgstr_w(local_tzinfo.StandardName), wine_dbgstr_w(tzinfo.StandardName)); ok(!memcmp(&tzinfo.StandardDate, &local_tzinfo.StandardDate, sizeof(SYSTEMTIME)), "StandardDate does not match\n"); - ok(tzinfo.StandardBias == local_tzinfo.StandardBias, "Expected StandardBias %d, got %d\n", local_tzinfo.StandardBias, tzinfo.StandardBias); + ok(tzinfo.StandardBias == local_tzinfo.StandardBias, "Expected StandardBias %ld, got %ld\n", local_tzinfo.StandardBias, tzinfo.StandardBias); ok(!lstrcmpW(tzinfo.DaylightName, local_tzinfo.DaylightName), "Expected DaylightName %s, got %s\n", wine_dbgstr_w(local_tzinfo.DaylightName), wine_dbgstr_w(tzinfo.DaylightName)); ok(!memcmp(&tzinfo.DaylightDate, &local_tzinfo.DaylightDate, sizeof(SYSTEMTIME)), "DaylightDate does not match\n"); - ok(tzinfo.DaylightBias == local_tzinfo.DaylightBias, "Expected DaylightBias %d, got %d\n", local_tzinfo.DaylightBias, tzinfo.DaylightBias); + ok(tzinfo.DaylightBias == local_tzinfo.DaylightBias, "Expected DaylightBias %ld, got %ld\n", local_tzinfo.DaylightBias, tzinfo.DaylightBias);
pGetDynamicTimeZoneInformation(&dyn_tzinfo);
ret = pGetTimeZoneInformationForYear(systemtime.wYear, &dyn_tzinfo, &tzinfo); - ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %u\n", GetLastError()); - ok(tzinfo.Bias == local_tzinfo.Bias, "Expected Bias %d, got %d\n", local_tzinfo.Bias, tzinfo.Bias); + ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %lu\n", GetLastError()); + ok(tzinfo.Bias == local_tzinfo.Bias, "Expected Bias %ld, got %ld\n", local_tzinfo.Bias, tzinfo.Bias); ok(!lstrcmpW(tzinfo.StandardName, local_tzinfo.StandardName), "Expected StandardName %s, got %s\n", wine_dbgstr_w(local_tzinfo.StandardName), wine_dbgstr_w(tzinfo.StandardName)); ok(!memcmp(&tzinfo.StandardDate, &local_tzinfo.StandardDate, sizeof(SYSTEMTIME)), "StandardDate does not match\n"); - ok(tzinfo.StandardBias == local_tzinfo.StandardBias, "Expected StandardBias %d, got %d\n", local_tzinfo.StandardBias, tzinfo.StandardBias); + ok(tzinfo.StandardBias == local_tzinfo.StandardBias, "Expected StandardBias %ld, got %ld\n", local_tzinfo.StandardBias, tzinfo.StandardBias); ok(!lstrcmpW(tzinfo.DaylightName, local_tzinfo.DaylightName), "Expected DaylightName %s, got %s\n", wine_dbgstr_w(local_tzinfo.DaylightName), wine_dbgstr_w(tzinfo.DaylightName)); ok(!memcmp(&tzinfo.DaylightDate, &local_tzinfo.DaylightDate, sizeof(SYSTEMTIME)), "DaylightDate does not match\n"); - ok(tzinfo.DaylightBias == local_tzinfo.DaylightBias, "Expected DaylightBias %d, got %d\n", local_tzinfo.DaylightBias, tzinfo.DaylightBias); + ok(tzinfo.DaylightBias == local_tzinfo.DaylightBias, "Expected DaylightBias %ld, got %ld\n", local_tzinfo.DaylightBias, tzinfo.DaylightBias);
memset(&dyn_tzinfo, 0xaa, sizeof(dyn_tzinfo)); lstrcpyW(dyn_tzinfo.TimeZoneKeyName, L"Greenland Daylight Time"); @@ -1005,7 +1005,7 @@ static void test_GetTimeZoneInformationForYear(void) broken_test = TRUE; ok((ret == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND) || broken(broken_test) /* vista,7 */, - "GetTimeZoneInformationForYear err %u\n", GetLastError()); + "GetTimeZoneInformationForYear err %lu\n", GetLastError());
memset(&dyn_tzinfo, 0xaa, sizeof(dyn_tzinfo)); lstrcpyW(dyn_tzinfo.TimeZoneKeyName, L"Altai Standard Time"); @@ -1014,7 +1014,7 @@ static void test_GetTimeZoneInformationForYear(void) if (!ret && GetLastError() == ERROR_FILE_NOT_FOUND) broken_test = TRUE; ok(ret == TRUE || broken(broken_test) /* before 10 1809 */, - "GetTimeZoneInformationForYear err %u\n", GetLastError()); + "GetTimeZoneInformationForYear err %lu\n", GetLastError());
if (broken(broken_test)) { @@ -1031,11 +1031,11 @@ static void test_GetTimeZoneInformationForYear(void)
ret = pGetTimeZoneInformationForYear(test_data[i].year, &dyn_tzinfo, &tzinfo); todo_wine_if(test_data[i].tzinfo_todo) - ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %u, for %s\n", GetLastError(), wine_dbgstr_w(test_data[i].tzname)); + ok(ret == TRUE, "GetTimeZoneInformationForYear failed, err %lu, for %s\n", GetLastError(), wine_dbgstr_w(test_data[i].tzname)); if (!ret) continue; todo_wine_if(test_data[i].bias_todo) - ok(tzinfo.Bias == test_data[i].bias, "Expected bias %d, got %d, for %s\n", + ok(tzinfo.Bias == test_data[i].bias, "Expected bias %ld, got %ld, for %s\n", test_data[i].bias, tzinfo.Bias, wine_dbgstr_w(test_data[i].tzname)); todo_wine_if(test_data[i].std_month_todo) ok(tzinfo.StandardDate.wMonth == test_data[i].std_month, "Expected standard month %d, got %d, for %s\n", @@ -1045,7 +1045,7 @@ static void test_GetTimeZoneInformationForYear(void) ok(std_day == test_data[i].std_day, "Expected standard day %d, got %d, for %s\n", test_data[i].std_day, std_day, wine_dbgstr_w(test_data[i].tzname)); todo_wine_if(test_data[i].std_bias_todo) - ok(tzinfo.StandardBias == test_data[i].std_bias, "Expected standard bias %d, got %d, for %s\n", + ok(tzinfo.StandardBias == test_data[i].std_bias, "Expected standard bias %ld, got %ld, for %s\n", test_data[i].std_bias, tzinfo.StandardBias, wine_dbgstr_w(test_data[i].tzname)); todo_wine_if(test_data[i].dlt_month_todo) ok(tzinfo.DaylightDate.wMonth == test_data[i].dlt_month, "Expected daylight month %d, got %d, for %s\n", @@ -1055,7 +1055,7 @@ static void test_GetTimeZoneInformationForYear(void) ok(dlt_day == test_data[i].dlt_day, "Expected daylight day %d, got %d, for %s\n", test_data[i].dlt_day, dlt_day, wine_dbgstr_w(test_data[i].tzname)); todo_wine_if(test_data[i].dlt_bias_todo) - ok(tzinfo.DaylightBias == test_data[i].dlt_bias, "Expected daylight bias %d, got %d, for %s\n", + ok(tzinfo.DaylightBias == test_data[i].dlt_bias, "Expected daylight bias %ld, got %ld, for %s\n", test_data[i].dlt_bias, tzinfo.DaylightBias, wine_dbgstr_w(test_data[i].tzname));
if (i > 0 && test_data[i-1].tzname == test_data[i].tzname) @@ -1090,8 +1090,8 @@ static void test_GetTickCount(void) t3 = pNtGetTickCount(); } while(t3 < t1 && i++ < 1); /* allow for wrap, but only once */
- ok(t1 <= t2, "out of order %d %d\n", t1, t2); - ok(t2 <= t3, "out of order %d %d\n", t2, t3); + ok(t1 <= t2, "out of order %ld %ld\n", t1, t2); + ok(t2 <= t3, "out of order %ld %ld\n", t2, t3); }
BOOL (WINAPI *pQueryUnbiasedInterruptTime)(ULONGLONG *time); @@ -1106,22 +1106,22 @@ static void test_QueryUnbiasedInterruptTime(void) { SetLastError( 0xdeadbeef ); ret = pQueryUnbiasedInterruptTime( &time ); - ok( ret, "QueryUnbiasedInterruptTime failed err %u\n", GetLastError() ); + ok( ret, "QueryUnbiasedInterruptTime failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pQueryUnbiasedInterruptTime( NULL ); ok( !ret, "QueryUnbiasedInterruptTime succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } else win_skip( "QueryUnbiasedInterruptTime not supported\n" ); if (pRtlQueryUnbiasedInterruptTime) { SetLastError( 0xdeadbeef ); ret = pRtlQueryUnbiasedInterruptTime( &time ); - ok( ret, "RtlQueryUnbiasedInterruptTime failed err %u\n", GetLastError() ); + ok( ret, "RtlQueryUnbiasedInterruptTime failed err %lu\n", GetLastError() ); SetLastError( 0xdeadbeef ); ret = pRtlQueryUnbiasedInterruptTime( NULL ); ok( !ret, "RtlQueryUnbiasedInterruptTime succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } else win_skip( "RtlQueryUnbiasedInterruptTime not supported\n" ); } diff --git a/dlls/kernel32/tests/timer.c b/dlls/kernel32/tests/timer.c index 156f1acd7f1..47cfd11062e 100644 --- a/dlls/kernel32/tests/timer.c +++ b/dlls/kernel32/tests/timer.c @@ -79,10 +79,10 @@ static DWORD WINAPI thread_WaitForSingleObject(void *arg) ok(event != NULL, "CreateEvent failed\n"); t = GetTickCount(); r = WaitForSingleObject(event, 3000); - ok(r == WAIT_TIMEOUT, "WiatForSingleObject returned %x\n", r); + ok(r == WAIT_TIMEOUT, "WiatForSingleObject returned %lx\n", r); CloseHandle(event); t = GetTickCount() - t; - ok(t > 2000, "t = %d\n", t); + ok(t > 2000, "t = %ld\n", t); return 0; }
@@ -92,7 +92,7 @@ static DWORD WINAPI thread_Sleep(void *arg)
Sleep(3000); t = GetTickCount() - t; - ok(t > 2000, "t = %d\n", t); + ok(t > 2000, "t = %ld\n", t); return 0; }
@@ -102,7 +102,7 @@ static DWORD WINAPI thread_SleepEx(void *arg)
SleepEx(3000, TRUE); t = GetTickCount() - t; - ok(t > 2000, "t = %d\n", t); + ok(t > 2000, "t = %ld\n", t); return 0; }
@@ -122,10 +122,10 @@ static DWORD WINAPI thread_WaitableTimer_rel(void *arg) ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE); - ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r); + ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r); CloseHandle(timer); t = GetTickCount() - t; - ok(t > 2000, "t = %d\n", t); + ok(t > 2000, "t = %ld\n", t); return 0; }
@@ -149,10 +149,10 @@ static DWORD WINAPI thread_WaitableTimer_abs(void *arg) ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE); - ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r); + ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r); CloseHandle(timer); t = GetTickCount() - t; - ok(t < 2000, "t = %d\n", t); + ok(t < 2000, "t = %ld\n", t); return 0; }
@@ -172,13 +172,13 @@ static DWORD WINAPI thread_WaitableTimer_period(void *arg) ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE); - ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r); + ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
r = WaitForSingleObject(timer, INFINITE); - ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r); + ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r); CloseHandle(timer); t = GetTickCount() - t; - ok(t > 2000, "t = %d\n", t); + ok(t > 2000, "t = %ld\n", t); return 0; }
@@ -189,7 +189,7 @@ static DWORD WINAPI thread_SetTimer(void *arg) MSG msg;
timer = SetTimer(NULL, 0, 3000, NULL); - ok(timer, "SetTimer failed (%d)\n", GetLastError()); + ok(timer, "SetTimer failed (%ld)\n", GetLastError());
while (GetMessageW(&msg, NULL, 0, 0)) { @@ -198,7 +198,7 @@ static DWORD WINAPI thread_SetTimer(void *arg) }
t = GetTickCount() - t; - ok(t > 2000, "t = %d\n", t); + ok(t > 2000, "t = %ld\n", t); KillTimer(NULL, timer); return 0; } @@ -210,7 +210,7 @@ static void test_timeouts(void)
if (!adjust_system_time(1)) { - skip("can't adjust system clock (%d)\n", GetLastError()); + skip("can't adjust system clock (%ld)\n", GetLastError()); return; }
diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c index 3bc07ec84f3..70ca23c4b20 100644 --- a/dlls/kernel32/tests/toolhelp.c +++ b/dlls/kernel32/tests/toolhelp.c @@ -124,7 +124,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid) { if (pe.th32ProcessID == curr_pid) found++; if (pe.th32ProcessID == sub_pcs_pid) { childpos = num; found++; } - trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile); + trace("PID=%lx %s\n", pe.th32ProcessID, pe.szExeFile); num++; } while (pProcess32Next( hSnapshot, &pe )); } @@ -138,7 +138,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid) { if (pe.th32ProcessID == curr_pid) found++; if (pe.th32ProcessID == sub_pcs_pid) found++; - trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile); + trace("PID=%lx %s\n", pe.th32ProcessID, pe.szExeFile); num--; } while (pProcess32Next( hSnapshot, &pe )); } @@ -237,7 +237,7 @@ static DWORD WINAPI get_id_thread(void* curr_pid) free(pcs_buffer); pcs_buffer = malloc(buf_size); } - ok(status == STATUS_SUCCESS, "got %#x\n", status); + ok(status == STATUS_SUCCESS, "got %#lx\n", status); found = FALSE; matched_idx = -1;
@@ -332,7 +332,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid) if (te.th32OwnerProcessID == curr_pid) curr_found++; if (te.th32OwnerProcessID == sub_pcs_pid) sub_found++; if (winetest_debug > 1) - trace("PID=%x TID=%x %d\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri); + trace("PID=%lx TID=%lx %ld\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri); num++; } while (pThread32Next( hSnapshot, &te )); } @@ -349,7 +349,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid) if (te.th32OwnerProcessID == curr_pid) curr_found++; if (te.th32OwnerProcessID == sub_pcs_pid) sub_found++; if (winetest_debug > 1) - trace("PID=%x TID=%x %d\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri); + trace("PID=%lx TID=%lx %ld\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri); num--; } while (pThread32Next( hSnapshot, &te )); } @@ -399,7 +399,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected { do { - trace("PID=%x base=%p size=%x %s %s\n", + trace("PID=%lx base=%p size=%lx %s %s\n", me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule); ok(me.th32ProcessID == pid, "wrong returned process id\n"); for (i = 0; i < num_expected; i++) @@ -418,7 +418,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected { do { - trace("PID=%x base=%p size=%x %s %s\n", + trace("PID=%lx base=%p size=%lx %s %s\n", me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule); for (i = 0; i < num_expected; i++) if (!lstrcmpiA(expected[i], me.szModule)) found[i]++; @@ -489,7 +489,7 @@ START_TEST(toolhelp) startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = SW_SHOWNORMAL;
- sprintf(buffer, "%s toolhelp %lu %lu", selfname, (DWORD_PTR)ev1, (DWORD_PTR)ev2); + sprintf(buffer, "%s toolhelp %Iu %Iu", selfname, (DWORD_PTR)ev1, (DWORD_PTR)ev2); ok(CreateProcessA(NULL, buffer, NULL, NULL, TRUE, 0, NULL, NULL, &startup, &info), "CreateProcess\n"); /* wait for child to be initialized */ w = WaitForSingleObject(ev1, WAIT_TIME); diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index ec74c920960..1c280d2b2eb 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -93,10 +93,10 @@ static void test_GetProductInfo(void)
if (entry[0] >= 6) ok(res && (product > PRODUCT_UNDEFINED) && (product <= PRODUCT_ENTERPRISE_S_N_EVALUATION), - "got %d and 0x%x (expected TRUE and a valid PRODUCT_* value)\n", res, product); + "got %ld and 0x%lx (expected TRUE and a valid PRODUCT_* value)\n", res, product); else ok(!res && !product && (GetLastError() == 0xdeadbeef), - "got %d and 0x%x with 0x%x (expected FALSE and PRODUCT_UNDEFINED with LastError untouched)\n", + "got %ld and 0x%lx with 0x%lx (expected FALSE and PRODUCT_UNDEFINED with LastError untouched)\n", res, product, GetLastError());
entry+= 4; @@ -106,7 +106,7 @@ static void test_GetProductInfo(void) SetLastError(0xdeadbeef); res = pGetProductInfo(6, 1, 0, 0, NULL); ok( (!res) && (GetLastError() == 0xdeadbeef), - "got %d with 0x%x (expected FALSE with LastError untouched\n", res, GetLastError()); + "got %ld with 0x%lx (expected FALSE with LastError untouched\n", res, GetLastError()); }
static void test_GetVersionEx(void) @@ -127,7 +127,7 @@ static void test_GetVersionEx(void) ok(!ret, "Expected GetVersionExA to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER || GetLastError() == 0xdeadbeef /* Win9x */, - "Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n", + "Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %ld\n", GetLastError());
SetLastError(0xdeadbeef); @@ -136,7 +136,7 @@ static void test_GetVersionEx(void) ok(!ret, "Expected GetVersionExA to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER || GetLastError() == 0xdeadbeef /* Win9x */, - "Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n", + "Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %ld\n", GetLastError());
SetLastError(0xdeadbeef); @@ -145,7 +145,7 @@ static void test_GetVersionEx(void) ok(!ret, "Expected GetVersionExA to fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER || GetLastError() == 0xdeadbeef /* Win9x */, - "Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n", + "Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %ld\n", GetLastError());
SetLastError(0xdeadbeef); @@ -153,7 +153,7 @@ static void test_GetVersionEx(void) ret = GetVersionExA(&infoA); ok(ret, "Expected GetVersionExA to succeed\n"); ok(GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got %d\n", GetLastError()); + "Expected 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); infoExA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); @@ -665,7 +665,7 @@ static void test_VerifyVersionInfo(void) ret = VerifyVersionInfoA(&info, test->verifymask, mask); ok(test->err ? !ret : ret, "%u: unexpected return value %d.\n", i, ret); if (!ret) - ok(GetLastError() == test->err, "%u: unexpected error code %d, expected %d.\n", i, GetLastError(), test->err); + ok(GetLastError() == test->err, "%u: unexpected error code %ld, expected %ld.\n", i, GetLastError(), test->err); }
/* test handling of version numbers */ @@ -676,21 +676,21 @@ static void test_VerifyVersionInfo(void) ret = VerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, VerSetConditionMask(VerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL), VER_MAJORVERSION, VER_GREATER_EQUAL)); - ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError());
info.dwMinorVersion = 0; info.wServicePackMajor = 10; ret = VerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, VerSetConditionMask(VerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL), VER_MAJORVERSION, VER_GREATER_EQUAL)); - ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError());
info.wServicePackMajor = 0; info.wServicePackMinor = 10; ret = VerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, VerSetConditionMask(VerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL), VER_MAJORVERSION, VER_GREATER_EQUAL)); - ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError());
/* test bad dwOSVersionInfoSize */ info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); @@ -698,7 +698,7 @@ static void test_VerifyVersionInfo(void) info.dwOSVersionInfoSize = 0; ret = VerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL)); - ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); }
static void test_GetSystemFirmwareTable(void) @@ -733,11 +733,11 @@ static void test_GetSystemFirmwareTable(void)
expected_len -= min_sfti_len; len = pGetSystemFirmwareTable(RSMB, 0, NULL, 0); - ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len); + ok(len == expected_len, "Expected length %lu, got %u\n", expected_len, len);
smbios_table = HeapAlloc(GetProcessHeap(), 0, expected_len); len = pGetSystemFirmwareTable(RSMB, 0, smbios_table, expected_len); - ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len); + ok(len == expected_len, "Expected length %lu, got %u\n", expected_len, len); ok(len == 0 || !memcmp(smbios_table, sfti->TableBuffer, 6), "Expected prologue %02x %02x %02x %02x %02x %02x, got %02x %02x %02x %02x %02x %02x\n", sfti->TableBuffer[0], sfti->TableBuffer[1], sfti->TableBuffer[2], @@ -826,7 +826,7 @@ static void test_PackageIdFromFullName(void) expected_size = get_package_id_size(&test_package_id); size = sizeof(id_buffer); ret = pPackageIdFromFullName(fullname, 0, &size, id_buffer); - ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret); ok(size == expected_size, "Got unexpected length %u, expected %u.\n", size, expected_size); ok(!lstrcmpW(id->name, test_package_id.name), "Got unexpected name %s.\n", debugstr_w(id->name)); ok(!lstrcmpW(id->resourceId, test_package_id.resourceId), "Got unexpected resourceId %s.\n", @@ -845,31 +845,31 @@ static void test_PackageIdFromFullName(void) "Got unexpected publisherId %p, buffer %p.\n", id->resourceId, id_buffer);
ret = pPackageIdFromFullName(fullname, 0, NULL, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %d.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(NULL, 0, &size, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %d.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret); ok(size == sizeof(id_buffer), "Got unexpected size %u.\n", size);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(fullname, 0, &size, NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %d.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret); ok(size == sizeof(id_buffer), "Got unexpected size %u.\n", size);
size = expected_size - 1; ret = pPackageIdFromFullName(fullname, 0, &size, NULL); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %d.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret); ok(size == expected_size - 1, "Got unexpected size %u.\n", size);
size = expected_size - 1; ret = pPackageIdFromFullName(fullname, 0, &size, id_buffer); - ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %d.\n", ret); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %ld.\n", ret); ok(size == expected_size, "Got unexpected size %u.\n", size);
size = 0; ret = pPackageIdFromFullName(fullname, 0, &size, NULL); - ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %d.\n", ret); + ok(ret == ERROR_INSUFFICIENT_BUFFER, "Got unexpected ret %ld.\n", ret); ok(size == expected_size, "Got unexpected size %u.\n", size);
for (i = 0; i < ARRAY_SIZE(arch_data); ++i) @@ -880,7 +880,7 @@ static void test_PackageIdFromFullName(void) size = expected_size; ret = pPackageIdFromFullName(fullname, 0, &size, id_buffer); ok(ret == ERROR_SUCCESS || broken(arch_data[i].broken && ret == ERROR_INVALID_PARAMETER), - "Got unexpected ret %u.\n", ret); + "Got unexpected ret %lu.\n", ret); if (ret != ERROR_SUCCESS) continue; ok(size == expected_size, "Got unexpected length %u, expected %u.\n", size, expected_size); @@ -890,32 +890,32 @@ static void test_PackageIdFromFullName(void)
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_TestResourceId_0abcdefghjkme", 0, &size, id_buffer); - ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_TestResourceId_abcdefghjkme", 0, &size, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_TestResourceId_0abcdefghjkmee", 0, &size, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3_X86_TestResourceId_0abcdefghjkme", 0, &size, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_TestResourceId_0abcdefghjkme_", 0, &size, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret);
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86__0abcdefghjkme", 0, &size, id_buffer); - ok(ret == ERROR_SUCCESS, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret); ok(!lstrcmpW(id->resourceId, L""), "Got unexpected resourceId %s.\n", debugstr_w(id->resourceId));
size = sizeof(id_buffer); ret = pPackageIdFromFullName(L"TestPackage_1.2.3.4_X86_0abcdefghjkme", 0, &size, id_buffer); - ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %u.\n", ret); + ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %lu.\n", ret); }
#define TEST_VERSION_WIN7 1 @@ -951,12 +951,12 @@ static void test_pe_os_version_child(unsigned int test)
info.dwOSVersionInfoSize = sizeof(info); ret = GetVersionExA((OSVERSIONINFOA *)&info); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ok(info.dwMajorVersion == test_pe_os_version_tests[test].expected_major, - "Test %u, expected major version %u, got %u.\n", test, test_pe_os_version_tests[test].expected_major, + "Test %u, expected major version %u, got %lu.\n", test, test_pe_os_version_tests[test].expected_major, info.dwMajorVersion); ok(info.dwMinorVersion == test_pe_os_version_tests[test].expected_minor, - "Test %u, expected minor version %u, got %u.\n", test, test_pe_os_version_tests[test].expected_minor, + "Test %u, expected minor version %u, got %lu.\n", test, test_pe_os_version_tests[test].expected_minor, info.dwMinorVersion); }
@@ -1003,12 +1003,12 @@ static void test_pe_os_version(void) ok(!pRtlGetVersion(&rtlinfo), "RtlGetVersion failed.\n"); if (rtlinfo.dwMajorVersion < 10) { - skip("Too old Windows version %u.%u, skipping tests.\n", rtlinfo.dwMajorVersion, rtlinfo.dwMinorVersion); + skip("Too old Windows version %lu.%lu, skipping tests.\n", rtlinfo.dwMajorVersion, rtlinfo.dwMinorVersion); return; }
file = CreateFileA(argv[0], GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, GetLastError() %u.\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, GetLastError() %lu.\n", GetLastError()); SetFilePointer(file, 0x3c, NULL, FILE_BEGIN); ReadFile(file, &hdr_offset, sizeof(hdr_offset), &size, NULL); CloseHandle(file); @@ -1024,10 +1024,10 @@ static void test_pe_os_version(void) { sprintf(tmp_exe_name, "tmp%u.exe", i); ret = CopyFileA(argv[0], tmp_exe_name, FALSE); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
file = CreateFileA(tmp_exe_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, GetLastError() %u.\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, GetLastError() %lu.\n", GetLastError());
SetFilePointer(file, offset_major, NULL, FILE_BEGIN); WriteFile(file, &test_pe_os_version_tests[i].pe_version_major, @@ -1040,7 +1040,7 @@ static void test_pe_os_version(void)
sprintf(str, "%s.manifest", tmp_exe_name); file = CreateFileA(str, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, GetLastError() %u.\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed, GetLastError() %lu.\n", GetLastError());
WriteFile(file, manifest_header, strlen(manifest_header), &size, NULL); for (j = 0; j < ARRAY_SIZE(version_guids); ++j) @@ -1058,13 +1058,13 @@ static void test_pe_os_version(void) sprintf(str, "%s version pe_os_version %u", tmp_exe_name, i);
ret = CreateProcessA(NULL, str, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); CloseHandle(pi.hThread); result = WaitForSingleObject(pi.hProcess, 10000); - ok(result == WAIT_OBJECT_0, "Got unexpected result %#x.\n", result); + ok(result == WAIT_OBJECT_0, "Got unexpected result %#lx.\n", result);
ret = GetExitCodeProcess(pi.hProcess, &code); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError()); ok(!code, "Test %u failed.\n", i);
CloseHandle(pi.hProcess); diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index a3b2d365c33..365194b9065 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -66,9 +66,9 @@ static HANDLE create_target_process(const char *arg) winetest_get_mainargs( &argv ); sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg); ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "error: %u\n", GetLastError()); + ok(ret, "error: %lu\n", GetLastError()); ret = CloseHandle(pi.hThread); - ok(ret, "error %u\n", GetLastError()); + ok(ret, "error %lu\n", GetLastError()); return pi.hProcess; }
@@ -89,7 +89,7 @@ static void test_VirtualAllocEx(void) SetLastError(0xdeadbeef); addr1 = VirtualAllocEx(hProcess, NULL, alloc_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); - ok(addr1 != NULL, "VirtualAllocEx error %u\n", GetLastError()); + ok(addr1 != NULL, "VirtualAllocEx error %lu\n", GetLastError());
src = VirtualAlloc( NULL, alloc_size, MEM_COMMIT, PAGE_READWRITE ); dst = VirtualAlloc( NULL, alloc_size, MEM_COMMIT, PAGE_READWRITE ); @@ -97,48 +97,48 @@ static void test_VirtualAllocEx(void) src[i] = i & 0xff;
b = WriteProcessMemory(hProcess, addr1, src, alloc_size, &bytes_written); - ok(b && (bytes_written == alloc_size), "%lu bytes written\n", + ok(b && (bytes_written == alloc_size), "%Iu bytes written\n", bytes_written); b = ReadProcessMemory(hProcess, addr1, dst, alloc_size, &bytes_read); - ok(b && (bytes_read == alloc_size), "%lu bytes read\n", bytes_read); + ok(b && (bytes_read == alloc_size), "%Iu bytes read\n", bytes_read); ok(!memcmp(src, dst, alloc_size), "Data from remote process differs\n");
/* test invalid source buffers */
b = VirtualProtect( src + 0x2000, 0x2000, PAGE_NOACCESS, &old_prot ); - ok( b, "VirtualProtect failed error %u\n", GetLastError() ); + ok( b, "VirtualProtect failed error %lu\n", GetLastError() ); b = WriteProcessMemory(hProcess, addr1, src, alloc_size, &bytes_written); ok( !b, "WriteProcessMemory succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_PARTIAL_COPY, /* vista */ - "wrong error %u\n", GetLastError() ); - ok( bytes_written == 0, "%lu bytes written\n", bytes_written ); + "wrong error %lu\n", GetLastError() ); + ok( bytes_written == 0, "%Iu bytes written\n", bytes_written ); b = ReadProcessMemory(hProcess, addr1, src, alloc_size, &bytes_read); ok( !b, "ReadProcessMemory succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_PARTIAL_COPY, /* win10 v1607+ */ - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); if (GetLastError() == ERROR_NOACCESS) - ok( bytes_read == 0, "%lu bytes written\n", bytes_read ); + ok( bytes_read == 0, "%Iu bytes written\n", bytes_read );
b = VirtualProtect( src, 0x2000, PAGE_NOACCESS, &old_prot ); - ok( b, "VirtualProtect failed error %u\n", GetLastError() ); + ok( b, "VirtualProtect failed error %lu\n", GetLastError() ); b = WriteProcessMemory(hProcess, addr1, src, alloc_size, &bytes_written); ok( !b, "WriteProcessMemory succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_PARTIAL_COPY, /* vista */ - "wrong error %u\n", GetLastError() ); - ok( bytes_written == 0, "%lu bytes written\n", bytes_written ); + "wrong error %lu\n", GetLastError() ); + ok( bytes_written == 0, "%Iu bytes written\n", bytes_written ); b = ReadProcessMemory(hProcess, addr1, src, alloc_size, &bytes_read); ok( !b, "ReadProcessMemory succeeded\n" ); ok( GetLastError() == ERROR_NOACCESS || GetLastError() == ERROR_PARTIAL_COPY, /* win10 v1607+ */ - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); if (GetLastError() == ERROR_NOACCESS) - ok( bytes_read == 0, "%lu bytes written\n", bytes_read ); + ok( bytes_read == 0, "%Iu bytes written\n", bytes_read );
b = VirtualFreeEx(hProcess, addr1, 0, MEM_RELEASE); - ok(b != 0, "VirtualFreeEx, error %u\n", GetLastError()); + ok(b != 0, "VirtualFreeEx, error %lu\n", GetLastError());
VirtualFree( src, 0, MEM_RELEASE ); VirtualFree( dst, 0, MEM_RELEASE ); @@ -151,7 +151,7 @@ static void test_VirtualAllocEx(void) addr1 = VirtualAllocEx(hProcess, 0, 0, MEM_RESERVE, PAGE_NOACCESS); ok(addr1 == NULL, "VirtualAllocEx should fail on zero-sized allocation\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %u, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
addr1 = VirtualAllocEx(hProcess, 0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); ok(addr1 != NULL, "VirtualAllocEx failed\n"); @@ -161,17 +161,17 @@ static void test_VirtualAllocEx(void) ok(VirtualQueryEx(hProcess, addr1, &info, sizeof(info)) == sizeof(info), "VirtualQueryEx failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); - ok(info.RegionSize == 0x10000, "%lx != 0x10000\n", info.RegionSize); - ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); - ok(info.Protect == 0, "%x != PAGE_NOACCESS\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.AllocationProtect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x10000, "%Ix != 0x10000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%lx != MEM_RESERVE\n", info.State); + ok(info.Protect == 0, "%lx != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
SetLastError(0xdeadbeef); ok(!VirtualProtectEx(hProcess, addr1, 0xFFFC, PAGE_READONLY, &old_prot), "VirtualProtectEx should fail on a not committed memory\n"); ok(GetLastError() == ERROR_INVALID_ADDRESS, - "got %u, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %lu, expected ERROR_INVALID_ADDRESS\n", GetLastError());
addr2 = VirtualAllocEx(hProcess, addr1, 0x1000, MEM_COMMIT, PAGE_NOACCESS); ok(addr1 == addr2, "VirtualAllocEx failed\n"); @@ -181,32 +181,32 @@ static void test_VirtualAllocEx(void) "VirtualQueryEx failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); - ok(info.RegionSize == 0x1000, "%lx != 0x1000\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); + ok(info.AllocationProtect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x1000, "%Ix != 0x1000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); /* this time NT reports PAGE_NOACCESS as well */ - ok(info.Protect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.Protect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
/* this should fail, since not the whole range is committed yet */ SetLastError(0xdeadbeef); ok(!VirtualProtectEx(hProcess, addr1, 0xFFFC, PAGE_READONLY, &old_prot), "VirtualProtectEx should fail on a not committed memory\n"); ok(GetLastError() == ERROR_INVALID_ADDRESS, - "got %u, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %lu, expected ERROR_INVALID_ADDRESS\n", GetLastError());
old_prot = 0; ok(VirtualProtectEx(hProcess, addr1, 0x1000, PAGE_READONLY, &old_prot), "VirtualProtectEx failed\n"); - ok(old_prot == PAGE_NOACCESS, "wrong old protection: got %04x instead of PAGE_NOACCESS\n", old_prot); + ok(old_prot == PAGE_NOACCESS, "wrong old protection: got %04lx instead of PAGE_NOACCESS\n", old_prot);
old_prot = 0; ok(VirtualProtectEx(hProcess, addr1, 0x1000, PAGE_READWRITE, &old_prot), "VirtualProtectEx failed\n"); - ok(old_prot == PAGE_READONLY, "wrong old protection: got %04x instead of PAGE_READONLY\n", old_prot); + ok(old_prot == PAGE_READONLY, "wrong old protection: got %04lx instead of PAGE_READONLY\n", old_prot);
ok(!VirtualFreeEx(hProcess, addr1, 0x10000, 0), "VirtualFreeEx should fail with type 0\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %u, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
ok(VirtualFreeEx(hProcess, addr1, 0x10000, MEM_DECOMMIT), "VirtualFreeEx failed\n");
@@ -214,7 +214,7 @@ static void test_VirtualAllocEx(void) ok(!VirtualFreeEx(hProcess, addr1, 1, MEM_RELEASE), "VirtualFreeEx should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %u, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
ok(VirtualFreeEx(hProcess, addr1, 0, MEM_RELEASE), "VirtualFreeEx failed\n");
@@ -232,7 +232,7 @@ static void test_VirtualAlloc(void) addr1 = VirtualAlloc(0, 0, MEM_RESERVE, PAGE_NOACCESS); ok(addr1 == NULL, "VirtualAlloc should fail on zero-sized allocation\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %ld, expected ERROR_INVALID_PARAMETER\n", GetLastError());
addr1 = VirtualAlloc(0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); ok(addr1 != NULL, "VirtualAlloc failed\n"); @@ -242,17 +242,17 @@ static void test_VirtualAlloc(void) "VirtualQuery failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); - ok(info.RegionSize == 0x10000, "%lx != 0x10000\n", info.RegionSize); - ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); - ok(info.Protect == 0, "%x != PAGE_NOACCESS\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.AllocationProtect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x10000, "%Ix != 0x10000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%lx != MEM_RESERVE\n", info.State); + ok(info.Protect == 0, "%lx != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
SetLastError(0xdeadbeef); ok(!VirtualProtect(addr1, 0xFFFC, PAGE_READONLY, &old_prot), "VirtualProtect should fail on a not committed memory\n"); ok( GetLastError() == ERROR_INVALID_ADDRESS, - "got %d, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %ld, expected ERROR_INVALID_ADDRESS\n", GetLastError());
addr2 = VirtualAlloc(addr1, 0x1000, MEM_COMMIT, PAGE_NOACCESS); ok(addr1 == addr2, "VirtualAlloc failed\n"); @@ -262,99 +262,99 @@ static void test_VirtualAlloc(void) "VirtualQuery failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); - ok(info.RegionSize == 0x1000, "%lx != 0x1000\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); + ok(info.AllocationProtect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x1000, "%Ix != 0x1000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); /* this time NT reports PAGE_NOACCESS as well */ - ok(info.Protect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + ok(info.Protect == PAGE_NOACCESS, "%lx != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%lx != MEM_PRIVATE\n", info.Type);
/* this should fail, since not the whole range is committed yet */ SetLastError(0xdeadbeef); ok(!VirtualProtect(addr1, 0xFFFC, PAGE_READONLY, &old_prot), "VirtualProtect should fail on a not committed memory\n"); ok( GetLastError() == ERROR_INVALID_ADDRESS, - "got %d, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %ld, expected ERROR_INVALID_ADDRESS\n", GetLastError());
ok(VirtualProtect(addr1, 0x1000, PAGE_READONLY, &old_prot), "VirtualProtect failed\n"); ok(old_prot == PAGE_NOACCESS, - "wrong old protection: got %04x instead of PAGE_NOACCESS\n", old_prot); + "wrong old protection: got %04lx instead of PAGE_NOACCESS\n", old_prot);
ok(VirtualProtect(addr1, 0x1000, PAGE_READWRITE, &old_prot), "VirtualProtect failed\n"); ok(old_prot == PAGE_READONLY, - "wrong old protection: got %04x instead of PAGE_READONLY\n", old_prot); + "wrong old protection: got %04lx instead of PAGE_READONLY\n", old_prot);
ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); - ok(info.RegionSize == 0x1000, "%lx != 0x1000\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); + ok(info.RegionSize == 0x1000, "%Ix != 0x1000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect); memset( addr1, 0x55, 20 ); - ok( *(DWORD *)addr1 == 0x55555555, "wrong data %x\n", *(DWORD *)addr1 ); + ok( *(DWORD *)addr1 == 0x55555555, "wrong data %lx\n", *(DWORD *)addr1 );
addr2 = VirtualAlloc( addr1, 0x1000, MEM_RESET, PAGE_NOACCESS ); - ok( addr2 == addr1, "VirtualAlloc failed err %u\n", GetLastError() ); - ok( *(DWORD *)addr1 == 0x55555555 || *(DWORD *)addr1 == 0, "wrong data %x\n", *(DWORD *)addr1 ); + ok( addr2 == addr1, "VirtualAlloc failed err %lu\n", GetLastError() ); + ok( *(DWORD *)addr1 == 0x55555555 || *(DWORD *)addr1 == 0, "wrong data %lx\n", *(DWORD *)addr1 ); ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); - ok(info.RegionSize == 0x1000, "%lx != 0x1000\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); - ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); + ok(info.RegionSize == 0x1000, "%Ix != 0x1000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect);
addr2 = VirtualAlloc( (char *)addr1 + 0x1000, 0x1000, MEM_RESET, PAGE_NOACCESS ); ok( (char *)addr2 == (char *)addr1 + 0x1000, "VirtualAlloc failed\n" );
ok(VirtualQuery(addr2, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); - ok(info.RegionSize == 0xf000, "%lx != 0xf000\n", info.RegionSize); - ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); - ok(info.Protect == 0, "%x != 0\n", info.Protect); + ok(info.RegionSize == 0xf000, "%Ix != 0xf000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%lx != MEM_RESERVE\n", info.State); + ok(info.Protect == 0, "%lx != 0\n", info.Protect);
addr2 = VirtualAlloc( (char *)addr1 + 0xf000, 0x2000, MEM_RESET, PAGE_NOACCESS ); ok( !addr2, "VirtualAlloc failed\n" ); - ok( GetLastError() == ERROR_INVALID_ADDRESS, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_ADDRESS, "wrong error %lu\n", GetLastError() );
/* invalid protection values */ SetLastError(0xdeadbeef); addr2 = VirtualAlloc(NULL, 0x1000, MEM_RESERVE, 0); ok(!addr2, "VirtualAlloc succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); addr2 = VirtualAlloc(NULL, 0x1000, MEM_COMMIT, 0); ok(!addr2, "VirtualAlloc succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); addr2 = VirtualAlloc(addr1, 0x1000, MEM_COMMIT, PAGE_READONLY | PAGE_EXECUTE); ok(!addr2, "VirtualAlloc succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ok(!VirtualProtect(addr1, 0x1000, PAGE_READWRITE | PAGE_EXECUTE_WRITECOPY, &old_prot), "VirtualProtect succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ok(!VirtualProtect(addr1, 0x1000, 0, &old_prot), "VirtualProtect succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ok(!VirtualFree(addr1, 0x10000, 0), "VirtualFree should fail with type 0\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %ld, expected ERROR_INVALID_PARAMETER\n", GetLastError());
SetLastError(0xdeadbeef); ok(!VirtualFree(addr1, 0, MEM_FREE), "VirtualFree should fail with type MEM_FREE\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %ld, expected ERROR_INVALID_PARAMETER\n", GetLastError());
ok(VirtualFree(addr1, 0x10000, MEM_DECOMMIT), "VirtualFree failed\n");
/* if the type is MEM_RELEASE, size must be 0 */ ok(!VirtualFree(addr1, 1, MEM_RELEASE), "VirtualFree should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + "got %ld, expected ERROR_INVALID_PARAMETER\n", GetLastError());
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n");
@@ -365,39 +365,39 @@ static void test_VirtualAlloc(void) ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); ok(info.AllocationProtect == (PAGE_READWRITE | PAGE_NOCACHE), - "wrong protect %x\n", info.AllocationProtect); - ok(info.RegionSize == 0x2000, "wrong size %lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong state %x\n", info.State); - ok(info.Protect == (PAGE_READWRITE | PAGE_NOCACHE), "wrong protect %x\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "wrong type %x\n", info.Type); + "wrong protect %lx\n", info.AllocationProtect); + ok(info.RegionSize == 0x2000, "wrong size %Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong state %lx\n", info.State); + ok(info.Protect == (PAGE_READWRITE | PAGE_NOCACHE), "wrong protect %lx\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "wrong type %lx\n", info.Type);
ok(VirtualProtect(addr1, 0x1000, PAGE_READWRITE, &old_prot), "VirtualProtect failed\n"); - ok( old_prot == (PAGE_READWRITE | PAGE_NOCACHE), "wrong protect %x\n", old_prot ); + ok( old_prot == (PAGE_READWRITE | PAGE_NOCACHE), "wrong protect %lx\n", old_prot ); ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); ok(info.AllocationProtect == (PAGE_READWRITE | PAGE_NOCACHE), - "wrong protect %x\n", info.AllocationProtect); + "wrong protect %lx\n", info.AllocationProtect); ok(info.RegionSize == 0x2000 || broken(info.RegionSize == 0x1000), - "wrong size %lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong state %x\n", info.State); + "wrong size %Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong state %lx\n", info.State); ok(info.Protect == (PAGE_READWRITE | PAGE_NOCACHE) || broken(info.Protect == PAGE_READWRITE), - "wrong protect %x\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "wrong type %x\n", info.Type); + "wrong protect %lx\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "wrong type %lx\n", info.Type);
ok(VirtualProtect(addr1, 0x1000, PAGE_READONLY, &old_prot), "VirtualProtect failed\n"); ok( old_prot == (PAGE_READWRITE | PAGE_NOCACHE) || broken(old_prot == PAGE_READWRITE), - "wrong protect %x\n", old_prot ); + "wrong protect %lx\n", old_prot ); ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); ok(info.AllocationProtect == (PAGE_READWRITE | PAGE_NOCACHE), - "wrong protect %x\n", info.AllocationProtect); - ok(info.RegionSize == 0x1000, "wrong size %lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong state %x\n", info.State); + "wrong protect %lx\n", info.AllocationProtect); + ok(info.RegionSize == 0x1000, "wrong size %Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong state %lx\n", info.State); ok(info.Protect == (PAGE_READONLY | PAGE_NOCACHE) || broken(info.Protect == PAGE_READONLY), - "wrong protect %x\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "wrong type %x\n", info.Type); + "wrong protect %lx\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "wrong type %lx\n", info.Type);
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n");
@@ -407,23 +407,23 @@ static void test_VirtualAlloc(void) ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); ok(info.AllocationProtect == PAGE_READWRITE, - "wrong protect %x\n", info.AllocationProtect); - ok(info.RegionSize == 0x2000, "wrong size %lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong state %x\n", info.State); - ok(info.Protect == PAGE_READWRITE, "wrong protect %x\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "wrong type %x\n", info.Type); + "wrong protect %lx\n", info.AllocationProtect); + ok(info.RegionSize == 0x2000, "wrong size %Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong state %lx\n", info.State); + ok(info.Protect == PAGE_READWRITE, "wrong protect %lx\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "wrong type %lx\n", info.Type);
ok(VirtualProtect(addr1, 0x1000, PAGE_READONLY | PAGE_NOCACHE, &old_prot), "VirtualProtect failed\n"); - ok( old_prot == PAGE_READWRITE, "wrong protect %x\n", old_prot ); + ok( old_prot == PAGE_READWRITE, "wrong protect %lx\n", old_prot ); ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), "VirtualQuery failed\n"); ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); - ok(info.AllocationProtect == PAGE_READWRITE, "wrong protect %x\n", info.AllocationProtect); - ok(info.RegionSize == 0x1000, "wrong size %lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong state %x\n", info.State); + ok(info.AllocationProtect == PAGE_READWRITE, "wrong protect %lx\n", info.AllocationProtect); + ok(info.RegionSize == 0x1000, "wrong size %Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong state %lx\n", info.State); ok(info.Protect == PAGE_READONLY || broken(info.Protect == (PAGE_READONLY | PAGE_NOCACHE)), - "wrong protect %x\n", info.Protect); - ok(info.Type == MEM_PRIVATE, "wrong type %x\n", info.Type); + "wrong protect %lx\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "wrong type %lx\n", info.Type);
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n");
@@ -439,7 +439,7 @@ static void test_VirtualAlloc(void) SetLastError(0xdeadbeef); addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE); ok(!addr2, "VirtualAlloc unexpectedly succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld, expected ERROR_INVALID_PARAMETER\n", GetLastError());
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n"); } @@ -459,21 +459,21 @@ static void test_VirtualAllocFromApp(void)
SetLastError(0xdeadbeef); p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_READWRITE); - ok(p && GetLastError() == 0xdeadbeef, "Got unexpected mem %p, GetLastError() %u.\n", p, GetLastError()); + ok(p && GetLastError() == 0xdeadbeef, "Got unexpected mem %p, GetLastError() %lu.\n", p, GetLastError()); ret = VirtualFree(p, 0, MEM_RELEASE); - ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ok(ret, "Got unexpected ret %#x, GetLastError() %lu.\n", ret, GetLastError());
SetLastError(0xdeadbeef); p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_EXECUTE); - ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %u.\n", + ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %lu.\n", p, GetLastError()); SetLastError(0xdeadbeef); p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_EXECUTE_READ); - ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %u.\n", + ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %lu.\n", p, GetLastError()); SetLastError(0xdeadbeef); p = pVirtualAllocFromApp(NULL, 0x1000, MEM_RESERVE, PAGE_EXECUTE_READWRITE); - ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %u.\n", + ok(!p && GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected mem %p, GetLastError() %lu.\n", p, GetLastError()); }
@@ -494,7 +494,7 @@ static void test_MapViewOfFile(void)
SetLastError(0xdeadbeef); file = CreateFileA( testfile, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); SetFilePointer( file, 12288, NULL, FILE_BEGIN ); SetEndOfFile( file );
@@ -502,56 +502,56 @@ static void test_MapViewOfFile(void)
SetLastError(0xdeadbeef); mapping = CreateFileMappingA( file, NULL, PAGE_READWRITE, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_COPY, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_COPY error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_COPY error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, 0, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile 0 error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile 0 error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
ret = DuplicateHandle( GetCurrentProcess(), mapping, GetCurrentProcess(), &map2, FILE_MAP_READ|FILE_MAP_WRITE, FALSE, 0 ); - ok( ret, "DuplicateHandle failed error %u\n", GetLastError()); + ok( ret, "DuplicateHandle failed error %lu\n", GetLastError()); ptr = MapViewOfFile( map2, FILE_MAP_WRITE, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %lu\n", GetLastError() ); UnmapViewOfFile( ptr ); CloseHandle( map2 );
ret = DuplicateHandle( GetCurrentProcess(), mapping, GetCurrentProcess(), &map2, FILE_MAP_READ, FALSE, 0 ); - ok( ret, "DuplicateHandle failed error %u\n", GetLastError()); + ok( ret, "DuplicateHandle failed error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ptr = MapViewOfFile( map2, FILE_MAP_WRITE, 0, 0, 4096 ); ok( !ptr, "MapViewOfFile succeeded\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() ); CloseHandle( map2 ); ret = DuplicateHandle( GetCurrentProcess(), mapping, GetCurrentProcess(), &map2, 0, FALSE, 0 ); - ok( ret, "DuplicateHandle failed error %u\n", GetLastError()); + ok( ret, "DuplicateHandle failed error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ptr = MapViewOfFile( map2, 0, 0, 0, 4096 ); ok( !ptr, "MapViewOfFile succeeded\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() ); CloseHandle( map2 ); ret = DuplicateHandle( GetCurrentProcess(), mapping, GetCurrentProcess(), &map2, FILE_MAP_READ, FALSE, 0 ); - ok( ret, "DuplicateHandle failed error %u\n", GetLastError()); + ok( ret, "DuplicateHandle failed error %lu\n", GetLastError()); ptr = MapViewOfFile( map2, 0, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile NO_ACCESS error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile NO_ACCESS error %lu\n", GetLastError() );
UnmapViewOfFile( ptr ); CloseHandle( map2 ); @@ -561,56 +561,56 @@ static void test_MapViewOfFile(void)
SetLastError(0xdeadbeef); mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_COPY, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_COPY error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_COPY error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, 0, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile 0 error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile 0 error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); 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 %d\n", GetLastError() ); + GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() ); CloseHandle( mapping );
/* copy-on-write mapping */
SetLastError(0xdeadbeef); mapping = CreateFileMappingA( file, NULL, PAGE_WRITECOPY, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_COPY, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_COPY error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_COPY error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, 0, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile 0 error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile 0 error %lu\n", GetLastError() ); UnmapViewOfFile( ptr );
SetLastError(0xdeadbeef); 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 %d\n", GetLastError() ); + GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() ); CloseHandle( mapping );
/* no access mapping */ @@ -618,29 +618,29 @@ static void test_MapViewOfFile(void) SetLastError(0xdeadbeef); mapping = CreateFileMappingA( file, NULL, PAGE_NOACCESS, 0, 4096, NULL ); ok( !mapping, "CreateFileMappingA succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error %ld\n", GetLastError() ); CloseHandle( file );
/* now try read-only file */
SetLastError(0xdeadbeef); file = CreateFileA( testfile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); 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 %d\n", GetLastError() ); + GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() );
SetLastError(0xdeadbeef); mapping = CreateFileMappingA( file, NULL, PAGE_WRITECOPY, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping PAGE_WRITECOPY error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping PAGE_WRITECOPY error %lu\n", GetLastError() ); CloseHandle( mapping );
SetLastError(0xdeadbeef); mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping PAGE_READONLY error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping PAGE_READONLY error %lu\n", GetLastError() ); CloseHandle( mapping ); CloseHandle( file );
@@ -648,25 +648,25 @@ static void test_MapViewOfFile(void)
SetLastError(0xdeadbeef); file = CreateFileA( testfile, 0, 0, NULL, OPEN_EXISTING, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); 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 %d\n", GetLastError() ); + GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() );
SetLastError(0xdeadbeef); 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 %d\n", GetLastError() ); + GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() );
SetLastError(0xdeadbeef); 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 %d\n", GetLastError() ); + GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() );
CloseHandle( file ); DeleteFileA( testfile ); @@ -680,83 +680,83 @@ static void test_MapViewOfFile(void) name = "Foo"; file = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4090, name ); } - ok( file != 0, "CreateFileMapping PAGE_READWRITE error %u\n", GetLastError() ); + ok( file != 0, "CreateFileMapping PAGE_READWRITE error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); mapping = OpenFileMappingA( FILE_MAP_READ, FALSE, name ); - ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %u\n", GetLastError() ); + ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); ok( !ptr, "MapViewOfFile FILE_MAP_WRITE succeeded\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); size = VirtualQuery( ptr, &info, sizeof(info) ); ok( size == sizeof(info), - "VirtualQuery error %u\n", GetLastError() ); + "VirtualQuery error %lu\n", GetLastError() ); ok( info.BaseAddress == ptr, "%p != %p\n", info.BaseAddress, ptr ); ok( info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr ); - ok( info.AllocationProtect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.AllocationProtect ); - ok( info.RegionSize == 4096, "%lx != 4096\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State ); - ok( info.Protect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.Protect ); + ok( info.AllocationProtect == PAGE_READONLY, "%lx != PAGE_READONLY\n", info.AllocationProtect ); + ok( info.RegionSize == 4096, "%Ix != 4096\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State ); + ok( info.Protect == PAGE_READONLY, "%lx != PAGE_READONLY\n", info.Protect ); UnmapViewOfFile( ptr ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( status == STATUS_ACCESS_DENIED, "NtQuerySection failed err %x\n", status ); + ok( status == STATUS_ACCESS_DENIED, "NtQuerySection failed err %lx\n", status ); CloseHandle( mapping ); mapping = OpenFileMappingA( FILE_MAP_READ | SECTION_QUERY, FALSE, name ); - ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %u\n", GetLastError() ); + ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %lu\n", GetLastError() ); info_size = (SIZE_T)0xdeadbeef << 16; status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info_size == sizeof(section_info), "NtQuerySection wrong size %lu\n", info_size ); - ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info_size == sizeof(section_info), "NtQuerySection wrong size %Iu\n", info_size ); + ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == info.RegionSize, "NtQuerySection wrong size %x%08x / %08lx\n", + ok( section_info.Size.QuadPart == info.RegionSize, "NtQuerySection wrong size %lx%08lx / %08Ix\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart, info.RegionSize ); CloseHandle( mapping );
SetLastError(0xdeadbeef); mapping = OpenFileMappingA( FILE_MAP_WRITE, FALSE, name ); - ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %u\n", GetLastError() ); + ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); ok( !ptr, "MapViewOfFile succeeded\n" ); - ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_ACCESS_DENIED, "Wrong error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_WRITE error %lu\n", GetLastError() ); SetLastError(0xdeadbeef); size = VirtualQuery( ptr, &info, sizeof(info) ); ok( size == sizeof(info), - "VirtualQuery error %u\n", GetLastError() ); + "VirtualQuery error %lu\n", GetLastError() ); ok( info.BaseAddress == ptr, "%p != %p\n", info.BaseAddress, ptr ); ok( info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr ); - ok( info.AllocationProtect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.AllocationProtect ); - ok( info.RegionSize == 4096, "%lx != 4096\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State ); - ok( info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect ); + ok( info.AllocationProtect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.AllocationProtect ); + ok( info.RegionSize == 4096, "%Ix != 4096\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "%lx != MEM_COMMIT\n", info.State ); + ok( info.Protect == PAGE_READWRITE, "%lx != PAGE_READWRITE\n", info.Protect ); UnmapViewOfFile( ptr ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( status == STATUS_ACCESS_DENIED, "NtQuerySection failed err %x\n", status ); + ok( status == STATUS_ACCESS_DENIED, "NtQuerySection failed err %lx\n", status ); CloseHandle( mapping );
mapping = OpenFileMappingA( FILE_MAP_WRITE | SECTION_QUERY, FALSE, name ); - ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %u\n", GetLastError() ); + ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %lu\n", GetLastError() ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info_size == sizeof(section_info), "NtQuerySection wrong size %lu\n", info_size ); - ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info_size == sizeof(section_info), "NtQuerySection wrong size %Iu\n", info_size ); + ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == info.RegionSize, "NtQuerySection wrong size %x%08x / %08lx\n", + ok( section_info.Size.QuadPart == info.RegionSize, "NtQuerySection wrong size %lx%08lx / %08Ix\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart, info.RegionSize ); CloseHandle( mapping );
@@ -764,203 +764,203 @@ static void test_MapViewOfFile(void)
/* read/write mapping with SEC_RESERVE */ mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE | SEC_RESERVE, 0, MAPPING_SIZE, NULL); - ok(mapping != 0, "CreateFileMappingA failed with error %d\n", GetLastError()); + ok(mapping != 0, "CreateFileMappingA failed with error %ld\n", GetLastError()); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( section_info.Attributes == SEC_RESERVE, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( section_info.Attributes == SEC_RESERVE, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == MAPPING_SIZE, "NtQuerySection wrong size %x%08x / %08x\n", + ok( section_info.Size.QuadPart == MAPPING_SIZE, "NtQuerySection wrong size %lx%08lx / %08x\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart, MAPPING_SIZE );
ptr = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); - ok(ptr != NULL, "MapViewOfFile failed with error %d\n", GetLastError()); + ok(ptr != NULL, "MapViewOfFile failed with error %ld\n", GetLastError());
ptr2 = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); - ok( ptr2 != NULL, "MapViewOfFile failed with error %d\n", GetLastError()); + ok( ptr2 != NULL, "MapViewOfFile failed with error %ld\n", GetLastError()); ok( ptr != ptr2, "MapViewOfFile returned same pointer\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "BaseAddress should have been %p but was %p instead\n", ptr, info.BaseAddress); ok(info.AllocationBase == ptr, "AllocationBase should have been %p but was %p instead\n", ptr, info.AllocationBase); - ok(info.RegionSize == MAPPING_SIZE, "RegionSize should have been 0x%x but was 0x%lx\n", MAPPING_SIZE, info.RegionSize); - ok(info.State == MEM_RESERVE, "State should have been MEM_RESERVE instead of 0x%x\n", info.State); + ok(info.RegionSize == MAPPING_SIZE, "RegionSize should have been 0x%x but was 0x%Ix\n", MAPPING_SIZE, info.RegionSize); + ok(info.State == MEM_RESERVE, "State should have been MEM_RESERVE instead of 0x%lx\n", info.State); ok(info.AllocationProtect == PAGE_READWRITE, - "AllocationProtect should have been PAGE_READWRITE but was 0x%x\n", info.AllocationProtect); - ok(info.Protect == 0, "Protect should have been 0 instead of 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%x\n", info.Type); + "AllocationProtect should have been PAGE_READWRITE but was 0x%lx\n", info.AllocationProtect); + ok(info.Protect == 0, "Protect should have been 0 instead of 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%lx\n", info.Type);
ret = VirtualQuery(ptr2, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr2, "BaseAddress should have been %p but was %p instead\n", ptr2, info.BaseAddress); ok(info.AllocationBase == ptr2, "AllocationBase should have been %p but was %p instead\n", ptr2, info.AllocationBase); ok(info.AllocationProtect == PAGE_READWRITE, - "AllocationProtect should have been PAGE_READWRITE but was 0x%x\n", info.AllocationProtect); + "AllocationProtect should have been PAGE_READWRITE but was 0x%lx\n", info.AllocationProtect); ok(info.RegionSize == MAPPING_SIZE, - "RegionSize should have been 0x%x but was 0x%lx\n", MAPPING_SIZE, info.RegionSize); - ok(info.State == MEM_RESERVE, "State should have been MEM_RESERVE instead of 0x%x\n", info.State); - ok(info.Protect == 0, "Protect should have been 0 instead of 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%x\n", info.Type); + "RegionSize should have been 0x%x but was 0x%Ix\n", MAPPING_SIZE, info.RegionSize); + ok(info.State == MEM_RESERVE, "State should have been MEM_RESERVE instead of 0x%lx\n", info.State); + ok(info.Protect == 0, "Protect should have been 0 instead of 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%lx\n", info.Type);
ptr = VirtualAlloc(ptr, 0x10000, MEM_COMMIT, PAGE_READONLY); - ok(ptr != NULL, "VirtualAlloc failed with error %d\n", GetLastError()); + ok(ptr != NULL, "VirtualAlloc failed with error %ld\n", GetLastError());
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "BaseAddress should have been %p but was %p instead\n", ptr, info.BaseAddress); ok(info.AllocationBase == ptr, "AllocationBase should have been %p but was %p instead\n", ptr, info.AllocationBase); - ok(info.RegionSize == 0x10000, "RegionSize should have been 0x10000 but was 0x%lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "State should have been MEM_COMMIT instead of 0x%x\n", info.State); - ok(info.Protect == PAGE_READONLY, "Protect should have been PAGE_READONLY instead of 0x%x\n", info.Protect); + ok(info.RegionSize == 0x10000, "RegionSize should have been 0x10000 but was 0x%Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "State should have been MEM_COMMIT instead of 0x%lx\n", info.State); + ok(info.Protect == PAGE_READONLY, "Protect should have been PAGE_READONLY instead of 0x%lx\n", info.Protect); ok(info.AllocationProtect == PAGE_READWRITE, - "AllocationProtect should have been PAGE_READWRITE but was 0x%x\n", info.AllocationProtect); - ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%x\n", info.Type); + "AllocationProtect should have been PAGE_READWRITE but was 0x%lx\n", info.AllocationProtect); + ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%lx\n", info.Type);
/* shows that the VirtualAlloc above affects the mapping, not just the * virtual memory in this process - it also affects all other processes * with a view of the mapping, but that isn't tested here */ ret = VirtualQuery(ptr2, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr2, "BaseAddress should have been %p but was %p instead\n", ptr2, info.BaseAddress); ok(info.AllocationBase == ptr2, "AllocationBase should have been %p but was %p instead\n", ptr2, info.AllocationBase); ok(info.AllocationProtect == PAGE_READWRITE, - "AllocationProtect should have been PAGE_READWRITE but was 0x%x\n", info.AllocationProtect); + "AllocationProtect should have been PAGE_READWRITE but was 0x%lx\n", info.AllocationProtect); ok(info.RegionSize == 0x10000, - "RegionSize should have been 0x10000 but was 0x%lx\n", info.RegionSize); + "RegionSize should have been 0x10000 but was 0x%Ix\n", info.RegionSize); ok(info.State == MEM_COMMIT, - "State should have been MEM_COMMIT instead of 0x%x\n", info.State); + "State should have been MEM_COMMIT instead of 0x%lx\n", info.State); ok(info.Protect == PAGE_READWRITE, - "Protect should have been PAGE_READWRITE instead of 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%x\n", info.Type); + "Protect should have been PAGE_READWRITE instead of 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%lx\n", info.Type);
addr = VirtualAlloc( ptr, MAPPING_SIZE, MEM_RESET, PAGE_READONLY ); - ok( addr == ptr, "VirtualAlloc failed with error %u\n", GetLastError() ); + ok( addr == ptr, "VirtualAlloc failed with error %lu\n", GetLastError() );
ret = VirtualFree( ptr, 0x10000, MEM_DECOMMIT ); ok( !ret, "VirtualFree succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "VirtualFree failed with %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "VirtualFree failed with %lu\n", GetLastError() );
ret = UnmapViewOfFile(ptr2); - ok(ret, "UnmapViewOfFile failed with error %d\n", GetLastError()); + ok(ret, "UnmapViewOfFile failed with error %ld\n", GetLastError()); ret = UnmapViewOfFile(ptr); - ok(ret, "UnmapViewOfFile failed with error %d\n", GetLastError()); + ok(ret, "UnmapViewOfFile failed with error %ld\n", GetLastError()); CloseHandle(mapping);
/* same thing with SEC_COMMIT */ mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE | SEC_COMMIT, 0, MAPPING_SIZE, NULL); - ok(mapping != 0, "CreateFileMappingA failed with error %d\n", GetLastError()); + ok(mapping != 0, "CreateFileMappingA failed with error %ld\n", GetLastError()); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == MAPPING_SIZE, "NtQuerySection wrong size %x%08x / %08x\n", + ok( section_info.Size.QuadPart == MAPPING_SIZE, "NtQuerySection wrong size %lx%08lx / %08x\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart, MAPPING_SIZE );
ptr = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); - ok(ptr != NULL, "MapViewOfFile failed with error %d\n", GetLastError()); + ok(ptr != NULL, "MapViewOfFile failed with error %ld\n", GetLastError());
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "wrong BaseAddress %p/%p\n", ptr, info.BaseAddress); ok(info.AllocationBase == ptr, "wrong AllocationBase %p/%p\n", ptr, info.AllocationBase); - ok(info.RegionSize == MAPPING_SIZE, "wrong RegionSize 0x%lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State); - ok(info.AllocationProtect == PAGE_READWRITE, "wrong AllocationProtect 0x%x\n", info.AllocationProtect); - ok(info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "wrong Type 0x%x\n", info.Type); + ok(info.RegionSize == MAPPING_SIZE, "wrong RegionSize 0x%Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State); + ok(info.AllocationProtect == PAGE_READWRITE, "wrong AllocationProtect 0x%lx\n", info.AllocationProtect); + ok(info.Protect == PAGE_READWRITE, "wrong Protect 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "wrong Type 0x%lx\n", info.Type);
ptr = VirtualAlloc(ptr, 0x10000, MEM_COMMIT, PAGE_READONLY); - ok(ptr != NULL, "VirtualAlloc failed with error %d\n", GetLastError()); + ok(ptr != NULL, "VirtualAlloc failed with error %ld\n", GetLastError());
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "wrong BaseAddress %p/%p\n", ptr, info.BaseAddress); ok(info.AllocationBase == ptr, "wrong AllocationBase %p/%p\n", ptr, info.AllocationBase); - ok(info.RegionSize == 0x10000, "wrong RegionSize 0x%lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State); - ok(info.AllocationProtect == PAGE_READWRITE, "wrong AllocationProtect 0x%x\n", info.AllocationProtect); - ok(info.Protect == PAGE_READONLY, "wrong Protect 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "wrong Type 0x%x\n", info.Type); + ok(info.RegionSize == 0x10000, "wrong RegionSize 0x%Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State); + ok(info.AllocationProtect == PAGE_READWRITE, "wrong AllocationProtect 0x%lx\n", info.AllocationProtect); + ok(info.Protect == PAGE_READONLY, "wrong Protect 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "wrong Type 0x%lx\n", info.Type);
addr = VirtualAlloc( ptr, MAPPING_SIZE, MEM_RESET, PAGE_READONLY ); - ok( addr == ptr, "VirtualAlloc failed with error %u\n", GetLastError() ); + ok( addr == ptr, "VirtualAlloc failed with error %lu\n", GetLastError() );
ret = VirtualFree( ptr, 0x10000, MEM_DECOMMIT ); ok( !ret, "VirtualFree succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "VirtualFree failed with %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "VirtualFree failed with %lu\n", GetLastError() );
ret = UnmapViewOfFile(ptr); - ok(ret, "UnmapViewOfFile failed with error %d\n", GetLastError()); + ok(ret, "UnmapViewOfFile failed with error %ld\n", GetLastError()); CloseHandle(mapping);
/* same thing with SEC_NOCACHE (only supported on recent Windows versions) */ mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE | SEC_COMMIT | SEC_NOCACHE, 0, MAPPING_SIZE, NULL); - ok(mapping != 0, "CreateFileMappingA failed with error %d\n", GetLastError()); + ok(mapping != 0, "CreateFileMappingA failed with error %ld\n", GetLastError()); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); + ok( !status, "NtQuerySection failed err %lx\n", status ); ok( section_info.Attributes == (SEC_COMMIT | SEC_NOCACHE) || broken(section_info.Attributes == SEC_COMMIT), - "NtQuerySection wrong attr %08x\n", section_info.Attributes ); + "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); if (section_info.Attributes & SEC_NOCACHE) { ptr = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); - ok(ptr != NULL, "MapViewOfFile failed with error %d\n", GetLastError()); + ok(ptr != NULL, "MapViewOfFile failed with error %ld\n", GetLastError());
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "wrong BaseAddress %p/%p\n", ptr, info.BaseAddress); ok(info.AllocationBase == ptr, "wrong AllocationBase %p/%p\n", ptr, info.AllocationBase); - ok(info.RegionSize == MAPPING_SIZE, "wrong RegionSize 0x%lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State); + ok(info.RegionSize == MAPPING_SIZE, "wrong RegionSize 0x%Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State); ok(info.AllocationProtect == (PAGE_READWRITE | PAGE_NOCACHE), - "wrong AllocationProtect 0x%x\n", info.AllocationProtect); - ok(info.Protect == (PAGE_READWRITE | PAGE_NOCACHE), "wrong Protect 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "wrong Type 0x%x\n", info.Type); + "wrong AllocationProtect 0x%lx\n", info.AllocationProtect); + ok(info.Protect == (PAGE_READWRITE | PAGE_NOCACHE), "wrong Protect 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "wrong Type 0x%lx\n", info.Type);
ptr = VirtualAlloc(ptr, 0x10000, MEM_COMMIT, PAGE_READONLY); - ok(ptr != NULL, "VirtualAlloc failed with error %d\n", GetLastError()); + ok(ptr != NULL, "VirtualAlloc failed with error %ld\n", GetLastError());
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery failed with error %d\n", GetLastError()); + ok(ret, "VirtualQuery failed with error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "wrong BaseAddress %p/%p\n", ptr, info.BaseAddress); ok(info.AllocationBase == ptr, "wrong AllocationBase %p/%p\n", ptr, info.AllocationBase); - ok(info.RegionSize == 0x10000, "wrong RegionSize 0x%lx\n", info.RegionSize); - ok(info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State); + ok(info.RegionSize == 0x10000, "wrong RegionSize 0x%Ix\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State); ok(info.AllocationProtect == (PAGE_READWRITE | PAGE_NOCACHE), - "wrong AllocationProtect 0x%x\n", info.AllocationProtect); - ok(info.Protect == (PAGE_READONLY | PAGE_NOCACHE), "wrong Protect 0x%x\n", info.Protect); - ok(info.Type == MEM_MAPPED, "wrong Type 0x%x\n", info.Type); + "wrong AllocationProtect 0x%lx\n", info.AllocationProtect); + ok(info.Protect == (PAGE_READONLY | PAGE_NOCACHE), "wrong Protect 0x%lx\n", info.Protect); + ok(info.Type == MEM_MAPPED, "wrong Type 0x%lx\n", info.Type);
ret = UnmapViewOfFile(ptr); - ok(ret, "UnmapViewOfFile failed with error %d\n", GetLastError()); + ok(ret, "UnmapViewOfFile failed with error %ld\n", GetLastError()); } CloseHandle(mapping);
addr = VirtualAlloc(NULL, 0x10000, MEM_COMMIT, PAGE_READONLY ); - ok( addr != NULL, "VirtualAlloc failed with error %u\n", GetLastError() ); + ok( addr != NULL, "VirtualAlloc failed with error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ok( !UnmapViewOfFile(addr), "UnmapViewOfFile should fail on VirtualAlloc mem\n" ); ok( GetLastError() == ERROR_INVALID_ADDRESS, - "got %u, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %lu, expected ERROR_INVALID_ADDRESS\n", GetLastError()); SetLastError(0xdeadbeef); ok( !UnmapViewOfFile((char *)addr + 0x3000), "UnmapViewOfFile should fail on VirtualAlloc mem\n" ); ok( GetLastError() == ERROR_INVALID_ADDRESS, - "got %u, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %lu, expected ERROR_INVALID_ADDRESS\n", GetLastError()); SetLastError(0xdeadbeef); ok( !UnmapViewOfFile((void *)0xdeadbeef), "UnmapViewOfFile should fail on VirtualAlloc mem\n" ); ok( GetLastError() == ERROR_INVALID_ADDRESS, - "got %u, expected ERROR_INVALID_ADDRESS\n", GetLastError()); + "got %lu, expected ERROR_INVALID_ADDRESS\n", GetLastError());
ok( VirtualFree(addr, 0, MEM_RELEASE), "VirtualFree failed\n" );
@@ -968,268 +968,268 @@ static void test_MapViewOfFile(void) name = "Foo"; SetLastError(0xdeadbeef); mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, MAPPING_SIZE, name); - ok( mapping != 0, "CreateFileMappingA failed with error %d\n", GetLastError() ); + ok( mapping != 0, "CreateFileMappingA failed with error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); - ok( ptr != NULL, "MapViewOfFile failed with error %d\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile failed with error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); map2 = OpenFileMappingA(FILE_MAP_READ, FALSE, name); - ok( map2 != 0, "OpenFileMappingA failed with error %d\n", GetLastError() ); + ok( map2 != 0, "OpenFileMappingA failed with error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ret = CloseHandle(map2); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = CloseHandle(mapping); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError());
ret = IsBadReadPtr(ptr, MAPPING_SIZE); ok( !ret, "memory is not accessible\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery error %d\n", GetLastError()); + ok(ret, "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "got %p != expected %p\n", info.BaseAddress, ptr); - ok(info.RegionSize == MAPPING_SIZE, "got %#lx != expected %#x\n", info.RegionSize, MAPPING_SIZE); - ok(info.Protect == PAGE_READWRITE, "got %#x != expected PAGE_READWRITE\n", info.Protect); + ok(info.RegionSize == MAPPING_SIZE, "got %#Ix != expected %#x\n", info.RegionSize, MAPPING_SIZE); + ok(info.Protect == PAGE_READWRITE, "got %#lx != expected PAGE_READWRITE\n", info.Protect); ok(info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr); - ok(info.AllocationProtect == PAGE_READWRITE, "%#x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == MEM_MAPPED, "%#x != MEM_MAPPED\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%#lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == MEM_MAPPED, "%#lx != MEM_MAPPED\n", info.Type);
SetLastError(0xdeadbeef); map2 = OpenFileMappingA(FILE_MAP_READ, FALSE, name); ok( map2 == 0, "OpenFileMappingA succeeded\n" ); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "OpenFileMappingA set error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "OpenFileMappingA set error %ld\n", GetLastError() ); if (map2) CloseHandle(map2); /* FIXME: remove once Wine is fixed */ SetLastError(0xdeadbeef); mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, MAPPING_SIZE, name); ok( mapping != 0, "CreateFileMappingA failed\n" ); - ok( GetLastError() == ERROR_SUCCESS, "CreateFileMappingA set error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_SUCCESS, "CreateFileMappingA set error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ret = CloseHandle(mapping); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError());
ret = IsBadReadPtr(ptr, MAPPING_SIZE); ok( !ret, "memory is not accessible\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery error %d\n", GetLastError()); + ok(ret, "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "got %p != expected %p\n", info.BaseAddress, ptr); - ok(info.RegionSize == MAPPING_SIZE, "got %#lx != expected %#x\n", info.RegionSize, MAPPING_SIZE); - ok(info.Protect == PAGE_READWRITE, "got %#x != expected PAGE_READWRITE\n", info.Protect); + ok(info.RegionSize == MAPPING_SIZE, "got %#Ix != expected %#x\n", info.RegionSize, MAPPING_SIZE); + ok(info.Protect == PAGE_READWRITE, "got %#lx != expected PAGE_READWRITE\n", info.Protect); ok(info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr); - ok(info.AllocationProtect == PAGE_READWRITE, "%#x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == MEM_MAPPED, "%#x != MEM_MAPPED\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%#lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == MEM_MAPPED, "%#lx != MEM_MAPPED\n", info.Type);
SetLastError(0xdeadbeef); ret = UnmapViewOfFile(ptr); - ok( ret, "UnmapViewOfFile failed with error %d\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed with error %ld\n", GetLastError() );
ret = IsBadReadPtr(ptr, MAPPING_SIZE); ok( ret, "memory is accessible\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery error %d\n", GetLastError()); + ok(ret, "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "got %p != expected %p\n", info.BaseAddress, ptr); - ok(info.Protect == PAGE_NOACCESS, "got %#x != expected PAGE_NOACCESS\n", info.Protect); + ok(info.Protect == PAGE_NOACCESS, "got %#lx != expected PAGE_NOACCESS\n", info.Protect); ok(info.AllocationBase == NULL, "%p != NULL\n", info.AllocationBase); - ok(info.AllocationProtect == 0, "%#x != 0\n", info.AllocationProtect); - ok(info.State == MEM_FREE, "%#x != MEM_FREE\n", info.State); - ok(info.Type == 0, "%#x != 0\n", info.Type); + ok(info.AllocationProtect == 0, "%#lx != 0\n", info.AllocationProtect); + ok(info.State == MEM_FREE, "%#lx != MEM_FREE\n", info.State); + ok(info.Type == 0, "%#lx != 0\n", info.Type);
SetLastError(0xdeadbeef); file = CreateFileA(testfile, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); SetFilePointer(file, 4096, NULL, FILE_BEGIN); SetEndOfFile(file);
SetLastError(0xdeadbeef); mapping = CreateFileMappingA(file, NULL, PAGE_READWRITE, 0, MAPPING_SIZE, name); - ok( mapping != 0, "CreateFileMappingA failed with error %d\n", GetLastError() ); + ok( mapping != 0, "CreateFileMappingA failed with error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); - ok( ptr != NULL, "MapViewOfFile failed with error %d\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile failed with error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); map2 = OpenFileMappingA(FILE_MAP_READ, FALSE, name); - ok( map2 != 0, "OpenFileMappingA failed with error %d\n", GetLastError() ); + ok( map2 != 0, "OpenFileMappingA failed with error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ret = CloseHandle(map2); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError()); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info_size == sizeof(section_info), "NtQuerySection wrong size %lu\n", info_size ); - ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info_size == sizeof(section_info), "NtQuerySection wrong size %Iu\n", info_size ); + ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == MAPPING_SIZE, "NtQuerySection wrong size %x%08x\n", + ok( section_info.Size.QuadPart == MAPPING_SIZE, "NtQuerySection wrong size %lx%08lx\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart ); SetLastError(0xdeadbeef); ret = CloseHandle(mapping); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError());
ret = IsBadReadPtr(ptr, MAPPING_SIZE); ok( !ret, "memory is not accessible\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery error %d\n", GetLastError()); + ok(ret, "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "got %p != expected %p\n", info.BaseAddress, ptr); - ok(info.RegionSize == MAPPING_SIZE, "got %#lx != expected %#x\n", info.RegionSize, MAPPING_SIZE); - ok(info.Protect == PAGE_READWRITE, "got %#x != expected PAGE_READWRITE\n", info.Protect); + ok(info.RegionSize == MAPPING_SIZE, "got %#Ix != expected %#x\n", info.RegionSize, MAPPING_SIZE); + ok(info.Protect == PAGE_READWRITE, "got %#lx != expected PAGE_READWRITE\n", info.Protect); ok(info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr); - ok(info.AllocationProtect == PAGE_READWRITE, "%#x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == MEM_MAPPED, "%#x != MEM_MAPPED\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%#lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == MEM_MAPPED, "%#lx != MEM_MAPPED\n", info.Type);
SetLastError(0xdeadbeef); map2 = OpenFileMappingA(FILE_MAP_READ, FALSE, name); ok( map2 == 0, "OpenFileMappingA succeeded\n" ); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "OpenFileMappingA set error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "OpenFileMappingA set error %ld\n", GetLastError() ); CloseHandle(map2); SetLastError(0xdeadbeef); mapping = CreateFileMappingA(file, NULL, PAGE_READWRITE, 0, MAPPING_SIZE, name); ok( mapping != 0, "CreateFileMappingA failed\n" ); - ok( GetLastError() == ERROR_SUCCESS, "CreateFileMappingA set error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_SUCCESS, "CreateFileMappingA set error %ld\n", GetLastError() ); SetLastError(0xdeadbeef); ret = CloseHandle(mapping); - ok(ret, "CloseHandle error %d\n", GetLastError()); + ok(ret, "CloseHandle error %ld\n", GetLastError());
ret = IsBadReadPtr(ptr, MAPPING_SIZE); ok( !ret, "memory is not accessible\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery error %d\n", GetLastError()); + ok(ret, "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "got %p != expected %p\n", info.BaseAddress, ptr); - ok(info.RegionSize == MAPPING_SIZE, "got %#lx != expected %#x\n", info.RegionSize, MAPPING_SIZE); - ok(info.Protect == PAGE_READWRITE, "got %#x != expected PAGE_READWRITE\n", info.Protect); + ok(info.RegionSize == MAPPING_SIZE, "got %#Ix != expected %#x\n", info.RegionSize, MAPPING_SIZE); + ok(info.Protect == PAGE_READWRITE, "got %#lx != expected PAGE_READWRITE\n", info.Protect); ok(info.AllocationBase == ptr, "%p != %p\n", info.AllocationBase, ptr); - ok(info.AllocationProtect == PAGE_READWRITE, "%#x != PAGE_READWRITE\n", info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%#x != MEM_COMMIT\n", info.State); - ok(info.Type == MEM_MAPPED, "%#x != MEM_MAPPED\n", info.Type); + ok(info.AllocationProtect == PAGE_READWRITE, "%#lx != PAGE_READWRITE\n", info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%#lx != MEM_COMMIT\n", info.State); + ok(info.Type == MEM_MAPPED, "%#lx != MEM_MAPPED\n", info.Type);
SetLastError(0xdeadbeef); ret = UnmapViewOfFile(ptr); - ok( ret, "UnmapViewOfFile failed with error %d\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed with error %ld\n", GetLastError() );
ret = IsBadReadPtr(ptr, MAPPING_SIZE); ok( ret, "memory is accessible\n" );
ret = VirtualQuery(ptr, &info, sizeof(info)); - ok(ret, "VirtualQuery error %d\n", GetLastError()); + ok(ret, "VirtualQuery error %ld\n", GetLastError()); ok(info.BaseAddress == ptr, "got %p != expected %p\n", info.BaseAddress, ptr); - ok(info.Protect == PAGE_NOACCESS, "got %#x != expected PAGE_NOACCESS\n", info.Protect); + ok(info.Protect == PAGE_NOACCESS, "got %#lx != expected PAGE_NOACCESS\n", info.Protect); ok(info.AllocationBase == NULL, "%p != NULL\n", info.AllocationBase); - ok(info.AllocationProtect == 0, "%#x != 0\n", info.AllocationProtect); - ok(info.State == MEM_FREE, "%#x != MEM_FREE\n", info.State); - ok(info.Type == 0, "%#x != 0\n", info.Type); + ok(info.AllocationProtect == 0, "%#lx != 0\n", info.AllocationProtect); + ok(info.State == MEM_FREE, "%#lx != MEM_FREE\n", info.State); + ok(info.Type == 0, "%#lx != 0\n", info.Type);
mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 12288, NULL ); - ok( mapping != NULL, "CreateFileMappingA failed with error %u\n", GetLastError() ); + ok( mapping != NULL, "CreateFileMappingA failed with error %lu\n", GetLastError() );
ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 12288 ); - ok( ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile failed with error %lu\n", GetLastError() );
ret = UnmapViewOfFile( (char *)ptr + 100 ); - ok( ret, "UnmapViewOfFile failed with error %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed with error %lu\n", GetLastError() );
ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 12288 ); - ok( ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile failed with error %lu\n", GetLastError() );
ret = UnmapViewOfFile( (char *)ptr + 4096 ); - ok( ret, "UnmapViewOfFile failed with error %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed with error %lu\n", GetLastError() );
ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 12288 ); - ok( ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile failed with error %lu\n", GetLastError() );
ret = UnmapViewOfFile( (char *)ptr + 4096 + 100 ); - ok( ret, "UnmapViewOfFile failed with error %u\n", GetLastError() ); + ok( ret, "UnmapViewOfFile failed with error %lu\n", GetLastError() );
CloseHandle(mapping);
mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 36, NULL ); - ok( mapping != NULL, "CreateFileMappingA failed with error %u\n", GetLastError() ); + ok( mapping != NULL, "CreateFileMappingA failed with error %lu\n", GetLastError() ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info_size == sizeof(section_info), "NtQuerySection wrong size %lu\n", info_size ); - ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info_size == sizeof(section_info), "NtQuerySection wrong size %Iu\n", info_size ); + ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == 36, "NtQuerySection wrong size %x%08x\n", + ok( section_info.Size.QuadPart == 36, "NtQuerySection wrong size %lx%08lx\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart ); CloseHandle(mapping);
SetFilePointer(file, 0x3456, NULL, FILE_BEGIN); SetEndOfFile(file); mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 0, NULL ); - ok( mapping != NULL, "CreateFileMappingA failed with error %u\n", GetLastError() ); + ok( mapping != NULL, "CreateFileMappingA failed with error %lu\n", GetLastError() ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), &info_size ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( info_size == sizeof(section_info), "NtQuerySection wrong size %lu\n", info_size ); - ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( info_size == sizeof(section_info), "NtQuerySection wrong size %Iu\n", info_size ); + ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == 0x3456, "NtQuerySection wrong size %x%08x\n", + ok( section_info.Size.QuadPart == 0x3456, "NtQuerySection wrong size %lx%08lx\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart ); CloseHandle(mapping);
map_size.QuadPart = 0x3457; status = pNtCreateSection( &mapping, SECTION_QUERY | SECTION_MAP_READ, NULL, &map_size, PAGE_READONLY, SEC_COMMIT, file ); - ok( status == STATUS_SECTION_TOO_BIG, "NtCreateSection failed %x\n", status ); + ok( status == STATUS_SECTION_TOO_BIG, "NtCreateSection failed %lx\n", status ); status = pNtCreateSection( &mapping, SECTION_QUERY | SECTION_MAP_READ, NULL, &map_size, PAGE_READONLY, SEC_IMAGE, file ); - ok( status == STATUS_INVALID_IMAGE_NOT_MZ, "NtCreateSection failed %x\n", status ); + ok( status == STATUS_INVALID_IMAGE_NOT_MZ, "NtCreateSection failed %lx\n", status ); if (!status) CloseHandle( mapping ); map_size.QuadPart = 0x3452; status = pNtCreateSection( &mapping, SECTION_QUERY | SECTION_MAP_READ, NULL, &map_size, PAGE_READONLY, SEC_COMMIT, file ); - ok( !status, "NtCreateSection failed %x\n", status ); + ok( !status, "NtCreateSection failed %lx\n", status ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( section_info.Attributes == SEC_FILE, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == 0x3452, "NtQuerySection wrong size %x%08x\n", + ok( section_info.Size.QuadPart == 0x3452, "NtQuerySection wrong size %lx%08lx\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart ); size = map_size.QuadPart; status = pNtMapViewOfSection( mapping, GetCurrentProcess(), &ptr, 0, 0, NULL, &size, ViewShare, 0, PAGE_READONLY ); - ok( !status, "NtMapViewOfSection failed err %x\n", status ); + ok( !status, "NtMapViewOfSection failed err %lx\n", status ); pNtUnmapViewOfSection( GetCurrentProcess(), ptr ); size = map_size.QuadPart + 1; status = pNtMapViewOfSection( mapping, GetCurrentProcess(), &ptr, 0, 0, NULL, &size, ViewShare, 0, PAGE_READONLY ); - ok( status == STATUS_INVALID_VIEW_SIZE, "NtMapViewOfSection failed err %x\n", status ); + ok( status == STATUS_INVALID_VIEW_SIZE, "NtMapViewOfSection failed err %lx\n", status ); CloseHandle(mapping);
status = pNtCreateSection( &mapping, SECTION_QUERY | SECTION_MAP_READ, NULL, &map_size, PAGE_READONLY, SEC_COMMIT, 0 ); - ok( !status, "NtCreateSection failed %x\n", status ); + ok( !status, "NtCreateSection failed %lx\n", status ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info), NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); - ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08x\n", + ok( !status, "NtQuerySection failed err %lx\n", status ); + ok( section_info.Attributes == SEC_COMMIT, "NtQuerySection wrong attr %08lx\n", section_info.Attributes ); ok( section_info.BaseAddress == NULL, "NtQuerySection wrong base %p\n", section_info.BaseAddress ); - ok( section_info.Size.QuadPart == 0x4000, "NtQuerySection wrong size %x%08x\n", + ok( section_info.Size.QuadPart == 0x4000, "NtQuerySection wrong size %lx%08lx\n", section_info.Size.u.HighPart, section_info.Size.u.LowPart ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info)-1, NULL ); - ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySection failed err %x\n", status ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySection failed err %lx\n", status ); status = pNtQuerySection( mapping, SectionBasicInformation, §ion_info, sizeof(section_info)+1, NULL ); - ok( !status, "NtQuerySection failed err %x\n", status ); + ok( !status, "NtQuerySection failed err %lx\n", status ); status = pNtQuerySection( mapping, SectionImageInformation, &image_info, sizeof(image_info)-1, NULL ); - ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySection failed err %x\n", status ); + ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySection failed err %lx\n", status ); status = pNtQuerySection( mapping, SectionImageInformation, &image_info, sizeof(image_info), NULL ); - ok( status == STATUS_SECTION_NOT_IMAGE, "NtQuerySection failed err %x\n", status ); + ok( status == STATUS_SECTION_NOT_IMAGE, "NtQuerySection failed err %lx\n", status ); status = pNtQuerySection( mapping, SectionImageInformation, &image_info, sizeof(image_info)+1, NULL ); - ok( status == STATUS_SECTION_NOT_IMAGE, "NtQuerySection failed err %x\n", status ); + ok( status == STATUS_SECTION_NOT_IMAGE, "NtQuerySection failed err %lx\n", status ); if (sizeof(SIZE_T) > sizeof(int)) { status = pNtQuerySection( mapping, SectionImageInformation, &image_info, sizeof(image_info) + ((SIZE_T)0x10000000 << 8), NULL ); todo_wine - ok( status == STATUS_ACCESS_VIOLATION, "NtQuerySection wrong err %x\n", status ); + ok( status == STATUS_ACCESS_VIOLATION, "NtQuerySection wrong err %lx\n", status ); } CloseHandle(mapping);
@@ -1237,10 +1237,10 @@ static void test_MapViewOfFile(void) SetEndOfFile(file); status = pNtCreateSection( &mapping, SECTION_QUERY | SECTION_MAP_READ, NULL, NULL, PAGE_READONLY, SEC_COMMIT, file ); - ok( status == STATUS_MAPPED_FILE_SIZE_ZERO, "NtCreateSection failed %x\n", status ); + ok( status == STATUS_MAPPED_FILE_SIZE_ZERO, "NtCreateSection failed %lx\n", status ); status = pNtCreateSection( &mapping, SECTION_QUERY | SECTION_MAP_READ, NULL, NULL, PAGE_READONLY, SEC_IMAGE, file ); - ok( status == STATUS_INVALID_FILE_FOR_SECTION, "NtCreateSection failed %x\n", status ); + ok( status == STATUS_INVALID_FILE_FOR_SECTION, "NtCreateSection failed %lx\n", status );
CloseHandle(file); DeleteFileA(testfile); @@ -1263,73 +1263,73 @@ static void test_NtAreMappedFilesTheSame(void)
file = CreateFileA( testfile, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); SetFilePointer( file, 4096, NULL, FILE_BEGIN ); SetEndOfFile( file );
mapping = CreateFileMappingA( file, NULL, PAGE_READWRITE, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping error %lu\n", GetLastError() );
ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() );
file2 = CreateFileA( testfile, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); - ok( file2 != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file2 != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() );
map2 = CreateFileMappingA( file2, NULL, PAGE_READONLY, 0, 4096, NULL ); - ok( map2 != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( map2 != 0, "CreateFileMapping error %lu\n", GetLastError() ); ptr2 = MapViewOfFile( map2, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, ptr2 ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %lx\n", status ); UnmapViewOfFile( ptr2 );
ptr2 = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, ptr2 ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %lx\n", status ); UnmapViewOfFile( ptr2 ); CloseHandle( map2 );
map2 = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 4096, NULL ); - ok( map2 != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( map2 != 0, "CreateFileMapping error %lu\n", GetLastError() ); ptr2 = MapViewOfFile( map2, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, ptr2 ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %lx\n", status ); UnmapViewOfFile( ptr2 ); CloseHandle( map2 ); CloseHandle( file2 );
status = pNtAreMappedFilesTheSame( ptr, ptr ); ok( status == STATUS_SUCCESS || broken(status == STATUS_NOT_SAME_DEVICE), - "NtAreMappedFilesTheSame returned %x\n", status ); + "NtAreMappedFilesTheSame returned %lx\n", status );
status = pNtAreMappedFilesTheSame( ptr, (char *)ptr + 30 ); ok( status == STATUS_SUCCESS || broken(status == STATUS_NOT_SAME_DEVICE), - "NtAreMappedFilesTheSame returned %x\n", status ); + "NtAreMappedFilesTheSame returned %lx\n", status );
status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %lx\n", status );
status = pNtAreMappedFilesTheSame( ptr, (void *)0xdeadbeef ); ok( status == STATUS_CONFLICTING_ADDRESSES || status == STATUS_INVALID_ADDRESS, - "NtAreMappedFilesTheSame returned %x\n", status ); + "NtAreMappedFilesTheSame returned %lx\n", status );
status = pNtAreMappedFilesTheSame( ptr, NULL ); - ok( status == STATUS_INVALID_ADDRESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_INVALID_ADDRESS, "NtAreMappedFilesTheSame returned %lx\n", status );
status = pNtAreMappedFilesTheSame( ptr, (void *)GetProcessHeap() ); - ok( status == STATUS_CONFLICTING_ADDRESSES, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_CONFLICTING_ADDRESSES, "NtAreMappedFilesTheSame returned %lx\n", status );
status = pNtAreMappedFilesTheSame( NULL, NULL ); - ok( status == STATUS_INVALID_ADDRESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_INVALID_ADDRESS, "NtAreMappedFilesTheSame returned %lx\n", status );
ptr2 = VirtualAlloc( NULL, 0x10000, MEM_COMMIT, PAGE_READWRITE ); - ok( ptr2 != NULL, "VirtualAlloc error %u\n", GetLastError() ); + ok( ptr2 != NULL, "VirtualAlloc error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, ptr2 ); - ok( status == STATUS_CONFLICTING_ADDRESSES, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_CONFLICTING_ADDRESSES, "NtAreMappedFilesTheSame returned %lx\n", status ); VirtualFree( ptr2, 0, MEM_RELEASE );
UnmapViewOfFile( ptr ); @@ -1338,50 +1338,50 @@ static void test_NtAreMappedFilesTheSame(void)
status = pNtAreMappedFilesTheSame( GetModuleHandleA("ntdll.dll"), GetModuleHandleA("kernel32.dll") ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %lx\n", status ); status = pNtAreMappedFilesTheSame( GetModuleHandleA("kernel32.dll"), GetModuleHandleA("kernel32.dll") ); - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status ); status = pNtAreMappedFilesTheSame( GetModuleHandleA("kernel32.dll"), (char *)GetModuleHandleA("kernel32.dll") + 4096 ); - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status );
GetSystemDirectoryA( path, MAX_PATH ); strcat( path, "\kernel32.dll" ); file = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() );
mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 4096, NULL ); - ok( mapping != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping error %lu\n", GetLastError() ); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 4096 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %lx\n", status ); status = pNtAreMappedFilesTheSame( GetModuleHandleA("kernel32.dll"), ptr ); todo_wine - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status ); UnmapViewOfFile( ptr ); CloseHandle( mapping );
mapping = CreateFileMappingA( file, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL ); - ok( mapping != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( mapping != 0, "CreateFileMapping error %lu\n", GetLastError() ); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); - ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") ); - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status ); status = pNtAreMappedFilesTheSame( GetModuleHandleA("kernel32.dll"), ptr ); - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status );
file2 = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); - ok( file2 != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file2 != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); map2 = CreateFileMappingA( file2, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL ); - ok( map2 != 0, "CreateFileMapping error %u\n", GetLastError() ); + ok( map2 != 0, "CreateFileMapping error %lu\n", GetLastError() ); ptr2 = MapViewOfFile( map2, FILE_MAP_READ, 0, 0, 0 ); - ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() ); + ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %lu\n", GetLastError() ); status = pNtAreMappedFilesTheSame( ptr, ptr2 ); - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status ); status = pNtAreMappedFilesTheSame( ptr2, ptr ); - ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %lx\n", status ); UnmapViewOfFile( ptr2 ); CloseHandle( map2 ); CloseHandle( file2 ); @@ -1456,32 +1456,32 @@ static void test_CreateFileMapping(void) SetLastError(0xdeadbeef); handle = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, 0, 0x1000, "Wine Test Mapping"); - ok( handle != NULL, "CreateFileMapping failed with error %u\n", GetLastError()); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok( handle != NULL, "CreateFileMapping failed with error %lu\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError());
SetLastError(0xdeadbeef); handle2 = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, 0, 0x1000, "Wine Test Mapping"); - ok( handle2 != NULL, "CreateFileMapping failed with error %d\n", GetLastError()); - ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateFileMapping failed with error %ld\n", GetLastError()); + ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, 0, 0x1000, "WINE TEST MAPPING"); - ok( handle2 != NULL, "CreateFileMapping failed with error %d\n", GetLastError()); - ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + ok( handle2 != NULL, "CreateFileMapping failed with error %ld\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %lu\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenFileMappingA( FILE_MAP_ALL_ACCESS, FALSE, "Wine Test Mapping"); - ok( handle2 != NULL, "OpenFileMapping failed with error %d\n", GetLastError()); + ok( handle2 != NULL, "OpenFileMapping failed with error %ld\n", GetLastError()); CloseHandle( handle2 );
SetLastError(0xdeadbeef); handle2 = OpenFileMappingA( FILE_MAP_ALL_ACCESS, FALSE, "WINE TEST MAPPING"); ok( !handle2, "OpenFileMapping succeeded\n"); - ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
CloseHandle( handle );
@@ -1492,14 +1492,14 @@ static void test_CreateFileMapping(void) GetTempFileNameA( path, "map", 0, filename );
file[1] = CreateFileA( filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); - ok( file[1] != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file[1] != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); SetFilePointer( file[1], 0x2000, NULL, FILE_BEGIN ); SetEndOfFile( file[1] );
GetSystemDirectoryA( path, MAX_PATH ); strcat( path, "\kernel32.dll" ); file[2] = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); - ok( file[2] != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file[2] != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE(sec_flag_tests); i++) { @@ -1511,7 +1511,7 @@ static void test_CreateFileMapping(void) if (sec_flag_tests[i].error) { ok( !handle, "%u: CreateFileMapping succeeded\n", i ); - ok( GetLastError() == sec_flag_tests[i].error, "%u: wrong error %u\n", i, GetLastError()); + ok( GetLastError() == sec_flag_tests[i].error, "%u: wrong error %lu\n", i, GetLastError()); } else { @@ -1519,9 +1519,9 @@ static void test_CreateFileMapping(void) BOOL new_flags = ((flags & SEC_WRITECOMBINE) || ((flags & SEC_IMAGE_NO_EXECUTE) == SEC_IMAGE_NO_EXECUTE)); ok( handle != NULL || broken(new_flags), - "%u: CreateFileMapping failed with error %u\n", i, GetLastError()); + "%u: CreateFileMapping failed with error %lu\n", i, GetLastError()); ok( GetLastError() == 0 || broken(new_flags && GetLastError() == ERROR_INVALID_PARAMETER), - "%u: wrong error %u\n", i, GetLastError()); + "%u: wrong error %lu\n", i, GetLastError()); }
if (handle) @@ -1530,10 +1530,10 @@ static void test_CreateFileMapping(void) DWORD expect = sec_flag_tests[i].attrs ? sec_flag_tests[i].attrs : sec_flag_tests[i].flags;
status = pNtQuerySection( handle, SectionBasicInformation, &info, sizeof(info), NULL ); - ok( !status, "%u: NtQuerySection failed err %x\n", i, status ); + ok( !status, "%u: NtQuerySection failed err %lx\n", i, status ); /* SEC_NOCACHE not supported on older Windows */ ok( info.Attributes == expect || broken( info.Attributes == (expect & ~SEC_NOCACHE) ), - "%u: NtQuerySection wrong attr %08x\n", i, info.Attributes ); + "%u: NtQuerySection wrong attr %08lx\n", i, info.Attributes ); CloseHandle( handle ); } } @@ -1636,11 +1636,11 @@ static DWORD CALLBACK read_pipe( void *arg ) DWORD num_bytes; BOOL success = ConnectNamedPipe( args->pipe, NULL ); ok( success || GetLastError() == ERROR_PIPE_CONNECTED, - "%u: ConnectNamedPipe failed %u\n", args->index, GetLastError() ); + "%u: ConnectNamedPipe failed %lu\n", args->index, GetLastError() );
success = ReadFile( args->pipe, args->base, args->size, &num_bytes, NULL ); - ok( success, "%u: ReadFile failed %u\n", args->index, GetLastError() ); - ok( num_bytes == sizeof(testdata), "%u: wrong number of bytes read %u\n", args->index, num_bytes ); + ok( success, "%u: ReadFile failed %lu\n", args->index, GetLastError() ); + ok( num_bytes == sizeof(testdata), "%u: wrong number of bytes read %lu\n", args->index, num_bytes ); ok( !memcmp( args->base, testdata, sizeof(testdata)), "%u: didn't receive expected data\n", args->index ); return 0; @@ -1673,137 +1673,137 @@ static void test_write_watch(void) win_skip( "MEM_WRITE_WATCH not supported\n" ); return; } - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); ret = VirtualQuery( base, &info, sizeof(info) ); - ok(ret, "VirtualQuery failed %u\n", GetLastError()); + ok(ret, "VirtualQuery failed %lu\n", GetLastError()); ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == PAGE_READWRITE, "wrong AllocationProtect %x\n", info.AllocationProtect ); - ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + ok( info.AllocationProtect == PAGE_READWRITE, "wrong AllocationProtect %lx\n", info.AllocationProtect ); + ok( info.RegionSize == size, "wrong RegionSize 0x%Ix\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State ); + ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%lx\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%lx\n", info.Type );
count = 64; SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, NULL, size, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); ok( GetLastError() == ERROR_INVALID_PARAMETER || broken( GetLastError() == 0xdeadbeef ), /* win98 */ - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, GetModuleHandleW(NULL), size, results, &count, &pagesize ); if (ret) { - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } else /* win98 */ { - ok( count == 0, "wrong count %lu\n", count ); + ok( count == 0, "wrong count %Iu\n", count ); }
ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 0, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count );
base[pagesize + 1] = 0x44;
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + pagesize, "wrong result %p\n", results[0] );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + pagesize, "wrong result %p\n", results[0] );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 0, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count );
base[2*pagesize + 3] = 0x11; base[4*pagesize + 8] = 0x11;
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 2, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong count %Iu\n", count ); ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); ok( results[1] == base + 4*pagesize, "wrong result %p\n", results[1] );
count = 64; ret = pGetWriteWatch( 0, base + 3*pagesize, 2*pagesize, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + 4*pagesize, "wrong result %p\n", results[0] );
ret = pResetWriteWatch( base, 3*pagesize ); - ok( !ret, "pResetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "pResetWriteWatch failed %lu\n", GetLastError() );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + 4*pagesize, "wrong result %p\n", results[0] );
*(DWORD *)(base + 2*pagesize - 2) = 0xdeadbeef;
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 3, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 3, "wrong count %Iu\n", count ); ok( results[0] == base + pagesize, "wrong result %p\n", results[0] ); ok( results[1] == base + 2*pagesize, "wrong result %p\n", results[1] ); ok( results[2] == base + 4*pagesize, "wrong result %p\n", results[2] );
count = 1; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + pagesize, "wrong result %p\n", results[0] );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 2, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong count %Iu\n", count ); ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); ok( results[1] == base + 4*pagesize, "wrong result %p\n", results[1] );
/* changing protections doesn't affect watches */
ret = VirtualProtect( base, 3*pagesize, PAGE_READONLY, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot );
ret = VirtualQuery( base, &info, sizeof(info) ); - ok(ret, "VirtualQuery failed %u\n", GetLastError()); + ok(ret, "VirtualQuery failed %lu\n", GetLastError()); ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.RegionSize == 3*pagesize, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == PAGE_READONLY, "wrong Protect 0x%x\n", info.Protect ); + ok( info.RegionSize == 3*pagesize, "wrong RegionSize 0x%Ix\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State ); + ok( info.Protect == PAGE_READONLY, "wrong Protect 0x%lx\n", info.Protect );
ret = VirtualProtect( base, 3*pagesize, PAGE_READWRITE, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); - ok( old_prot == PAGE_READONLY, "wrong old prot %x\n", old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_READONLY, "wrong old prot %lx\n", old_prot );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 2, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong count %Iu\n", count ); ok( results[0] == base + 2*pagesize, "wrong result %p\n", results[0] ); ok( results[1] == base + 4*pagesize, "wrong result %p\n", results[1] );
ret = VirtualQuery( base, &info, sizeof(info) ); - ok(ret, "VirtualQuery failed %u\n", GetLastError()); + ok(ret, "VirtualQuery failed %lu\n", GetLastError()); ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); + ok( info.RegionSize == size, "wrong RegionSize 0x%Ix\n", info.RegionSize ); + ok( info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State ); + ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%lx\n", info.Protect );
/* ReadFile should trigger write watches */
@@ -1815,53 +1815,53 @@ static void test_write_watch(void) readpipe = CreateNamedPipeA( pipename, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_INBOUND, (i ? PIPE_TYPE_MESSAGE : PIPE_TYPE_BYTE) | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL ); - ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %u\n", GetLastError() ); + ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %lu\n", GetLastError() );
success = ConnectNamedPipe( readpipe, &overlapped ); - ok( !success, "%u: ConnectNamedPipe unexpectedly succeeded\n", i ); - ok( GetLastError() == ERROR_IO_PENDING, "%u: expected ERROR_IO_PENDING, got %u\n", + ok( !success, "%lu: ConnectNamedPipe unexpectedly succeeded\n", i ); + ok( GetLastError() == ERROR_IO_PENDING, "%lu: expected ERROR_IO_PENDING, got %lu\n", i, GetLastError() );
writepipe = CreateFileA( pipename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); - ok( writepipe != INVALID_HANDLE_VALUE, "%u: CreateFileA failed %u\n", i, GetLastError() ); + ok( writepipe != INVALID_HANDLE_VALUE, "%lu: CreateFileA failed %lu\n", i, GetLastError() );
ret = WaitForSingleObject( overlapped.hEvent, 1000 ); - ok( ret == WAIT_OBJECT_0, "%u: expected WAIT_OBJECT_0, got %u\n", i, ret ); + ok( ret == WAIT_OBJECT_0, "%lu: expected WAIT_OBJECT_0, got %lu\n", i, ret );
memset( base, 0, size );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "%u: GetWriteWatch failed %u\n", i, GetLastError() ); - ok( count == 16, "%u: wrong count %lu\n", i, count ); + ok( !ret, "%lu: GetWriteWatch failed %lu\n", i, GetLastError() ); + ok( count == 16, "%lu: wrong count %Iu\n", i, count );
success = ReadFile( readpipe, base, size, NULL, &overlapped ); - ok( !success, "%u: ReadFile unexpectedly succeeded\n", i ); - ok( GetLastError() == ERROR_IO_PENDING, "%u: expected ERROR_IO_PENDING, got %u\n", + ok( !success, "%lu: ReadFile unexpectedly succeeded\n", i ); + ok( GetLastError() == ERROR_IO_PENDING, "%lu: expected ERROR_IO_PENDING, got %lu\n", i, GetLastError() );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "%u: GetWriteWatch failed %u\n", i, GetLastError() ); - ok( count == 16, "%u: wrong count %lu\n", i, count ); + ok( !ret, "%lu: GetWriteWatch failed %lu\n", i, GetLastError() ); + ok( count == 16, "%lu: wrong count %Iu\n", i, count );
num_bytes = 0; success = WriteFile( writepipe, testdata, sizeof(testdata), &num_bytes, NULL ); - ok( success, "%u: WriteFile failed %u\n", i, GetLastError() ); - ok( num_bytes == sizeof(testdata), "%u: wrong number of bytes written %u\n", i, num_bytes ); + ok( success, "%lu: WriteFile failed %lu\n", i, GetLastError() ); + ok( num_bytes == sizeof(testdata), "%lu: wrong number of bytes written %lu\n", i, num_bytes );
num_bytes = 0; success = GetOverlappedResult( readpipe, &overlapped, &num_bytes, TRUE ); - ok( success, "%u: GetOverlappedResult failed %u\n", i, GetLastError() ); - ok( num_bytes == sizeof(testdata), "%u: wrong number of bytes read %u\n", i, num_bytes ); - ok( !memcmp( base, testdata, sizeof(testdata)), "%u: didn't receive expected data\n", i ); + ok( success, "%lu: GetOverlappedResult failed %lu\n", i, GetLastError() ); + ok( num_bytes == sizeof(testdata), "%lu: wrong number of bytes read %lu\n", i, num_bytes ); + ok( !memcmp( base, testdata, sizeof(testdata)), "%lu: didn't receive expected data\n", i );
count = 64; memset( results, 0, sizeof(results) ); ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "%u: GetWriteWatch failed %u\n", i, GetLastError() ); - ok( count == 1, "%u: wrong count %lu\n", i, count ); - ok( results[0] == base, "%u: wrong result %p\n", i, results[0] ); + ok( !ret, "%lu: GetWriteWatch failed %lu\n", i, GetLastError() ); + ok( count == 1, "%lu: wrong count %Iu\n", i, count ); + ok( results[0] == base, "%lu: wrong result %p\n", i, results[0] );
CloseHandle( readpipe ); CloseHandle( writepipe ); @@ -1876,14 +1876,14 @@ static void test_write_watch(void) readpipe = CreateNamedPipeA( pipename, PIPE_ACCESS_INBOUND, (i ? PIPE_TYPE_MESSAGE : PIPE_TYPE_BYTE) | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL ); - ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %u\n", GetLastError() ); + ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %lu\n", GetLastError() );
memset( base, 0, size );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "%u: GetWriteWatch failed %u\n", i, GetLastError() ); - ok( count == 16, "%u: wrong count %lu\n", i, count ); + ok( !ret, "%lu: GetWriteWatch failed %lu\n", i, GetLastError() ); + ok( count == 16, "%lu: wrong count %Iu\n", i, count );
args.pipe = readpipe; args.index = i; @@ -1892,26 +1892,26 @@ static void test_write_watch(void) thread = CreateThread( NULL, 0, read_pipe, &args, 0, NULL );
writepipe = CreateFileA( pipename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); - ok( writepipe != INVALID_HANDLE_VALUE, "%u: CreateFileA failed %u\n", i, GetLastError() ); + ok( writepipe != INVALID_HANDLE_VALUE, "%lu: CreateFileA failed %lu\n", i, GetLastError() ); Sleep( 200 );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "%u: GetWriteWatch failed %u\n", i, GetLastError() ); - ok( count == 16, "%u: wrong count %lu\n", i, count ); + ok( !ret, "%lu: GetWriteWatch failed %lu\n", i, GetLastError() ); + ok( count == 16, "%lu: wrong count %Iu\n", i, count );
num_bytes = 0; success = WriteFile( writepipe, testdata, sizeof(testdata), &num_bytes, NULL ); - ok( success, "%u: WriteFile failed %u\n", i, GetLastError() ); - ok( num_bytes == sizeof(testdata), "%u: wrong number of bytes written %u\n", i, num_bytes ); + ok( success, "%lu: WriteFile failed %lu\n", i, GetLastError() ); + ok( num_bytes == sizeof(testdata), "%lu: wrong number of bytes written %lu\n", i, num_bytes ); WaitForSingleObject( thread, 10000 );
count = 64; memset( results, 0, sizeof(results) ); ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "%u: GetWriteWatch failed %u\n", i, GetLastError() ); - ok( count == 1, "%u: wrong count %lu\n", i, count ); - ok( results[0] == base, "%u: wrong result %p\n", i, results[0] ); + ok( !ret, "%lu: GetWriteWatch failed %lu\n", i, GetLastError() ); + ok( count == 1, "%lu: wrong count %Iu\n", i, count ); + ok( results[0] == base, "%lu: wrong result %p\n", i, results[0] );
CloseHandle( readpipe ); CloseHandle( writepipe ); @@ -1921,40 +1921,40 @@ static void test_write_watch(void) GetTempPathA( MAX_PATH, path ); GetTempFileNameA( path, "map", 0, filename ); file = CreateFileA( filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() ); + ok( file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError() ); SetFilePointer( file, 2 * pagesize + 3, NULL, FILE_BEGIN ); SetEndOfFile( file ); SetFilePointer( file, 0, NULL, FILE_BEGIN );
success = ReadFile( file, base, size, &num_bytes, NULL ); - ok( success, "ReadFile failed %u\n", GetLastError() ); - ok( num_bytes == 2 * pagesize + 3, "wrong bytes %u\n", num_bytes ); + ok( success, "ReadFile failed %lu\n", GetLastError() ); + ok( num_bytes == 2 * pagesize + 3, "wrong bytes %lu\n", num_bytes );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 16, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 16, "wrong count %Iu\n", count );
success = ReadFile( file, base, size, &num_bytes, NULL ); - ok( success, "ReadFile failed %u\n", GetLastError() ); - ok( num_bytes == 0, "wrong bytes %u\n", num_bytes ); + ok( success, "ReadFile failed %lu\n", GetLastError() ); + ok( num_bytes == 0, "wrong bytes %lu\n", num_bytes );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 16, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 16, "wrong count %Iu\n", count );
CloseHandle( file ); DeleteFileA( filename );
success = ReadFile( (HANDLE)0xdead, base, size, &num_bytes, NULL ); ok( !success, "ReadFile succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError() );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 0, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count );
/* OVERLAPPED structure write watch */ memset( &overlapped, 0, sizeof(overlapped) ); @@ -1963,17 +1963,17 @@ static void test_write_watch(void) readpipe = CreateNamedPipeA( pipename, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_INBOUND, PIPE_TYPE_MESSAGE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL ); - ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %u\n", GetLastError() ); + ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %lu\n", GetLastError() );
success = ConnectNamedPipe( readpipe, &overlapped ); ok( !success, "ConnectNamedPipe unexpectedly succeeded\n" ); - ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", GetLastError() ); + ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %lu\n", GetLastError() );
writepipe = CreateFileA( pipename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); - ok( writepipe != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError() ); + ok( writepipe != INVALID_HANDLE_VALUE, "CreateFileA failed %lu\n", GetLastError() );
ret = WaitForSingleObject( overlapped.hEvent, 1000 ); - ok( ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret ); + ok( ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", ret );
memset( base, 0, size ); overlapped2 = (OVERLAPPED*)(base + size - sizeof(*overlapped2)); @@ -1981,35 +1981,35 @@ static void test_write_watch(void)
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 16, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 16, "wrong count %Iu\n", count );
success = ReadFile( readpipe, base, sizeof(testdata), NULL, overlapped2 ); ok( !success, "ReadFile unexpectedly succeeded\n" ); - ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", GetLastError() ); + ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %lu\n", GetLastError() ); overlapped2->Internal = 0xdeadbeef;
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 2, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong count %Iu\n", count );
num_bytes = 0; success = WriteFile( writepipe, testdata, sizeof(testdata), &num_bytes, NULL ); - ok( success, "WriteFile failed %u\n", GetLastError() ); - ok( num_bytes == sizeof(testdata), "wrong number of bytes written %u\n", num_bytes ); + ok( success, "WriteFile failed %lu\n", GetLastError() ); + ok( num_bytes == sizeof(testdata), "wrong number of bytes written %lu\n", num_bytes );
num_bytes = 0; success = GetOverlappedResult( readpipe, overlapped2, &num_bytes, TRUE ); - ok( success, "GetOverlappedResult failed %u\n", GetLastError() ); - ok( num_bytes == sizeof(testdata), "wrong number of bytes read %u\n", num_bytes ); + ok( success, "GetOverlappedResult failed %lu\n", GetLastError() ); + ok( num_bytes == sizeof(testdata), "wrong number of bytes read %lu\n", num_bytes ); ok( !memcmp( base, testdata, sizeof(testdata)), "didn't receive expected data\n" );
count = 64; memset( results, 0, sizeof(results) ); ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 2, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 2, "wrong count %Iu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] );
CloseHandle( readpipe ); @@ -2024,139 +2024,139 @@ static void test_write_watch(void) ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); if (ret) { - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, base, size, results, NULL, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, NULL ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 0; ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0xdeadbeef, base, size, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0, base, 0, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0, base, size * 2, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0, base + size - pagesize, pagesize + 1, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pResetWriteWatch( base, 0 ); - ok( ret == ~0u, "ResetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "ResetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = pResetWriteWatch( GetModuleHandleW(NULL), size ); - ok( ret == ~0u, "ResetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( ret == ~0u, "ResetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() ); } else /* win98 is completely different */ { SetLastError( 0xdeadbeef ); count = 64; ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); - ok( ret == ERROR_INVALID_PARAMETER, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + ok( ret == ERROR_INVALID_PARAMETER, "GetWriteWatch succeeded %lu\n", ret ); + ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
count = 0; ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", ret ); + ok( !ret, "GetWriteWatch failed %lu\n", ret );
count = 64; ret = pGetWriteWatch( 0xdeadbeef, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", ret ); + ok( !ret, "GetWriteWatch failed %lu\n", ret );
count = 64; ret = pGetWriteWatch( 0, base, 0, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", ret ); + ok( !ret, "GetWriteWatch failed %lu\n", ret );
ret = pResetWriteWatch( base, 0 ); - ok( !ret, "ResetWriteWatch failed %u\n", ret ); + ok( !ret, "ResetWriteWatch failed %lu\n", ret );
ret = pResetWriteWatch( GetModuleHandleW(NULL), size ); - ok( !ret, "ResetWriteWatch failed %u\n", ret ); + ok( !ret, "ResetWriteWatch failed %lu\n", ret ); }
VirtualFree( base, 0, MEM_RELEASE );
base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_READWRITE ); - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); VirtualFree( base, 0, MEM_RELEASE );
base = VirtualAlloc( 0, size, MEM_WRITE_WATCH, PAGE_READWRITE ); ok( !base, "VirtualAlloc succeeded\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
/* initial protect doesn't matter */
base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_NOACCESS ); - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); base = VirtualAlloc( base, size, MEM_COMMIT, PAGE_NOACCESS ); - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 0, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 0, "wrong count %Iu\n", count );
ret = VirtualProtect( base, 6*pagesize, PAGE_READWRITE, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); - ok( old_prot == PAGE_NOACCESS, "wrong old prot %x\n", old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %lx\n", old_prot );
base[5*pagesize + 200] = 3;
ret = VirtualProtect( base, 6*pagesize, PAGE_NOACCESS, &old_prot ); - ok( ret, "VirtualProtect failed error %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + ok( ret, "VirtualProtect failed error %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); + ok( count == 1, "wrong count %Iu\n", count ); ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] );
ret = VirtualFree( base, size, MEM_DECOMMIT ); - ok( ret, "VirtualFree failed %u\n", GetLastError() ); + ok( ret, "VirtualFree failed %lu\n", GetLastError() );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1 || broken(count == 0), /* win98 */ - "wrong count %lu\n", count ); + "wrong count %Iu\n", count ); if (count) ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] );
VirtualFree( base, 0, MEM_RELEASE ); @@ -2219,12 +2219,12 @@ static void test_stack_commit(void) DWORD result;
call_on_stack = VirtualAlloc( 0, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); - ok( call_on_stack != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( call_on_stack != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); memcpy( call_on_stack, code_call_on_stack, sizeof(code_call_on_stack) );
/* allocate a new stack, only the first guard page is committed */ new_stack = VirtualAlloc( 0, 0x400000, MEM_RESERVE, PAGE_READWRITE ); - ok( new_stack != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( new_stack != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); new_stack_base = (char *)new_stack + 0x400000; VirtualAlloc( (char *)new_stack_base - 0x1000, 0x1000, MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD );
@@ -2242,7 +2242,7 @@ static void test_stack_commit(void) NtCurrentTeb()->Tib.StackBase = old_stack_base; NtCurrentTeb()->Tib.StackLimit = old_stack_limit;
- ok( result == 42, "expected 42, got %u\n", result ); + ok( result == 42, "expected 42, got %lu\n", result );
VirtualFree( new_stack, 0, MEM_RELEASE ); VirtualFree( call_on_stack, 0, MEM_RELEASE ); @@ -2256,11 +2256,11 @@ static LONG num_guard_page_calls; static DWORD guard_page_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) { - trace( "exception: %08x flags:%x addr:%p\n", + trace( "exception: %08lx flags:%lx addr:%p\n", rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress );
- ok( rec->NumberParameters == 2, "NumberParameters is %d instead of 2\n", rec->NumberParameters ); - ok( rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION, "ExceptionCode is %08x instead of %08x\n", + ok( rec->NumberParameters == 2, "NumberParameters is %ld instead of 2\n", rec->NumberParameters ); + ok( rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION, "ExceptionCode is %08lx instead of %08lx\n", rec->ExceptionCode, STATUS_GUARD_PAGE_VIOLATION );
InterlockedIncrement( &num_guard_page_calls ); @@ -2274,7 +2274,7 @@ static void test_guard_page(void) EXCEPTION_REGISTRATION_RECORD frame; MEMORY_BASIC_INFORMATION info; DWORD ret, size, old_prot; - int *value, old_value; + LONG *value, old_value; void *results[64]; ULONG_PTR count; ULONG pagesize; @@ -2283,63 +2283,63 @@ static void test_guard_page(void)
size = 0x1000; base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE | PAGE_GUARD ); - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); - value = (int *)base; + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); + value = (LONG *)base;
/* verify info structure */ ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError()); + ok( ret, "VirtualQuery failed %lu\n", GetLastError()); ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); + ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %lx\n", info.AllocationProtect ); ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + ok( info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State ); + ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%lx\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%lx\n", info.Type );
/* put some initial value into the memory */ success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == (PAGE_READWRITE | PAGE_GUARD), "wrong old prot %x\n", old_prot ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() ); + ok( old_prot == (PAGE_READWRITE | PAGE_GUARD), "wrong old prot %lx\n", old_prot );
*value = 1; *(value + 1) = 2;
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot );
/* test behaviour of VirtualLock - first attempt should fail */ SetLastError( 0xdeadbeef ); success = VirtualLock( base, size ); ok( !success, "VirtualLock unexpectedly succeeded\n" ); todo_wine - ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %lu\n", GetLastError() );
success = VirtualLock( base, size ); todo_wine - ok( success, "VirtualLock failed %u\n", GetLastError() ); + ok( success, "VirtualLock failed %lu\n", GetLastError() ); if (success) { - ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); + ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%lx\n", *value ); success = VirtualUnlock( base, size ); - ok( success, "VirtualUnlock failed %u\n", GetLastError() ); + ok( success, "VirtualUnlock failed %lu\n", GetLastError() ); }
/* check info structure again, PAGE_GUARD should be removed now */ ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError()); + ok( ret, "VirtualQuery failed %lu\n", GetLastError()); ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); + ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %lx\n", info.AllocationProtect ); ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); + ok( info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State ); todo_wine - ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%lx\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%lx\n", info.Type );
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() ); todo_wine - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot );
/* test directly accessing the memory - we need to setup an exception handler first */ frame.Handler = guard_page_handler; @@ -2349,19 +2349,19 @@ static void test_guard_page(void) InterlockedExchange( &num_guard_page_calls, 0 ); InterlockedExchange( &old_value, *value ); /* exception handler increments value by 0x100 */ *value = 2; - ok( old_value == 0x101, "memory block contains wrong value, expected 0x101, got 0x%x\n", old_value ); - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + ok( old_value == 0x101, "memory block contains wrong value, expected 0x101, got 0x%lx\n", old_value ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %ld calls\n", num_guard_page_calls );
NtCurrentTeb()->Tib.ExceptionList = frame.Prev;
/* check info structure again, PAGE_GUARD should be removed now */ ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError()); - ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); + ok( ret, "VirtualQuery failed %lu\n", GetLastError()); + ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%lx\n", info.Protect );
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot );
/* test accessing second integer in memory */ frame.Handler = guard_page_handler; @@ -2370,19 +2370,19 @@ static void test_guard_page(void)
InterlockedExchange( &num_guard_page_calls, 0 ); old_value = *(value + 1); - ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); - ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%lx\n", old_value ); + ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%lx\n", *value ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %ld calls\n", num_guard_page_calls );
NtCurrentTeb()->Tib.ExceptionList = frame.Prev;
success = VirtualLock( base, size ); - ok( success, "VirtualLock failed %u\n", GetLastError() ); + ok( success, "VirtualLock failed %lu\n", GetLastError() ); if (success) { - ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); + ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%lx\n", *value ); success = VirtualUnlock( base, size ); - ok( success, "VirtualUnlock failed %u\n", GetLastError() ); + ok( success, "VirtualUnlock failed %lu\n", GetLastError() ); }
VirtualFree( base, 0, MEM_RELEASE ); @@ -2400,21 +2400,21 @@ static void test_guard_page(void) win_skip( "MEM_WRITE_WATCH not supported\n" ); return; } - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); - value = (int *)base; + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() ); + value = (LONG *)base;
ret = VirtualQuery( base, &info, sizeof(info) ); - ok( ret, "VirtualQuery failed %u\n", GetLastError() ); + ok( ret, "VirtualQuery failed %lu\n", GetLastError() ); ok( info.BaseAddress == base, "BaseAddress %p instead of %p\n", info.BaseAddress, base ); - ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %x\n", info.AllocationProtect ); + ok( info.AllocationProtect == (PAGE_READWRITE | PAGE_GUARD), "wrong AllocationProtect %lx\n", info.AllocationProtect ); ok( info.RegionSize == size, "wrong RegionSize 0x%lx\n", info.RegionSize ); - ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); - ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%x\n", info.Protect ); - ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); + ok( info.State == MEM_COMMIT, "wrong State 0x%lx\n", info.State ); + ok( info.Protect == (PAGE_READWRITE | PAGE_GUARD), "wrong Protect 0x%lx\n", info.Protect ); + ok( info.Type == MEM_PRIVATE, "wrong Type 0x%lx\n", info.Type );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0, "wrong count %lu\n", count );
/* writing to a page should trigger should trigger guard page, even if write watch is set */ @@ -2425,18 +2425,18 @@ static void test_guard_page(void) InterlockedExchange( &num_guard_page_calls, 0 ); *value = 1; *(value + 1) = 2; - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %ld calls\n", num_guard_page_calls );
NtCurrentTeb()->Tib.ExceptionList = frame.Prev;
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %lu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] );
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
/* write watch is triggered from inside of the guard page handler */ frame.Handler = guard_page_handler; @@ -2445,47 +2445,47 @@ static void test_guard_page(void)
InterlockedExchange( &num_guard_page_calls, 0 ); old_value = *(value + 1); /* doesn't trigger write watch */ - ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); - ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); - ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); + ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%lx\n", old_value ); + ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%lx\n", *value ); + ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %ld calls\n", num_guard_page_calls );
NtCurrentTeb()->Tib.ExceptionList = frame.Prev;
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %lu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] );
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
/* test behaviour of VirtualLock - first attempt should fail without triggering write watches */ SetLastError( 0xdeadbeef ); success = VirtualLock( base, size ); ok( !success, "VirtualLock unexpectedly succeeded\n" ); todo_wine - ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == STATUS_GUARD_PAGE_VIOLATION, "wrong error %lu\n", GetLastError() );
count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0, "wrong count %lu\n", count );
success = VirtualLock( base, size ); todo_wine - ok( success, "VirtualLock failed %u\n", GetLastError() ); + ok( success, "VirtualLock failed %lu\n", GetLastError() ); if (success) { - ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); + ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%lx\n", *value ); success = VirtualUnlock( base, size ); - ok( success, "VirtualUnlock failed %u\n", GetLastError() ); + ok( success, "VirtualUnlock failed %lu\n", GetLastError() ); }
count = 64; results[0] = (void *)0xdeadbeef; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); todo_wine ok( count == 1 || broken(count == 0) /* Windows 8 */, "wrong count %lu\n", count ); todo_wine @@ -2502,13 +2502,13 @@ static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR ULONG flags = MEM_EXECUTE_OPTION_ENABLE; DWORD err;
- trace( "exception: %08x flags:%x addr:%p info[0]:%ld info[1]:%p\n", + trace( "exception: %08lx flags:%lx addr:%p info[0]:%ld info[1]:%p\n", rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, rec->ExceptionInformation[0], (void *)rec->ExceptionInformation[1] );
- ok( rec->NumberParameters == 2, "NumberParameters is %d instead of 2\n", rec->NumberParameters ); + ok( rec->NumberParameters == 2, "NumberParameters is %ld instead of 2\n", rec->NumberParameters ); ok( rec->ExceptionCode == STATUS_ACCESS_VIOLATION || rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION, - "ExceptionCode is %08x instead of STATUS_ACCESS_VIOLATION or STATUS_GUARD_PAGE_VIOLATION\n", rec->ExceptionCode ); + "ExceptionCode is %08lx instead of STATUS_ACCESS_VIOLATION or STATUS_GUARD_PAGE_VIOLATION\n", rec->ExceptionCode );
NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags, &flags, sizeof(flags), NULL );
@@ -2516,7 +2516,7 @@ static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR {
err = IsProcessorFeaturePresent( PF_NX_ENABLED ) ? EXCEPTION_EXECUTE_FAULT : EXCEPTION_READ_FAULT; - ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %d instead of %d\n", + ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %ld instead of %ld\n", (DWORD)rec->ExceptionInformation[0], err );
InterlockedIncrement( &num_guard_page_calls ); @@ -2527,12 +2527,12 @@ static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR BOOL success;
err = (flags & MEM_EXECUTE_OPTION_DISABLE) ? EXCEPTION_EXECUTE_FAULT : EXCEPTION_READ_FAULT; - ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %d instead of %d\n", + ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %ld instead of %ld\n", (DWORD)rec->ExceptionInformation[0], err );
success = VirtualProtect( (void *)rec->ExceptionInformation[1], 16, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() ); + ok( old_prot == PAGE_READWRITE, "wrong old prot %lx\n", old_prot );
InterlockedIncrement( &num_execute_fault_calls ); } @@ -2546,13 +2546,13 @@ static LONG CALLBACK execute_fault_vec_handler( EXCEPTION_POINTERS *ExceptionInf DWORD old_prot; BOOL success;
- trace( "exception: %08x flags:%x addr:%p info[0]:%ld info[1]:%p\n", + trace( "exception: %08lx flags:%lx addr:%p info[0]:%ld info[1]:%p\n", rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, rec->ExceptionInformation[0], (void *)rec->ExceptionInformation[1] );
- ok( rec->NumberParameters == 2, "NumberParameters is %d instead of 2\n", rec->NumberParameters ); + ok( rec->NumberParameters == 2, "NumberParameters is %ld instead of 2\n", rec->NumberParameters ); ok( rec->ExceptionCode == STATUS_ACCESS_VIOLATION, - "ExceptionCode is %08x instead of STATUS_ACCESS_VIOLATION\n", rec->ExceptionCode ); + "ExceptionCode is %08lx instead of STATUS_ACCESS_VIOLATION\n", rec->ExceptionCode );
if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) InterlockedIncrement( &num_execute_fault_calls ); @@ -2561,8 +2561,8 @@ static LONG CALLBACK execute_fault_vec_handler( EXCEPTION_POINTERS *ExceptionInf return EXCEPTION_CONTINUE_SEARCH;
success = VirtualProtect( (void *)rec->ExceptionInformation[1], 16, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); - ok( old_prot == PAGE_NOACCESS, "wrong old prot %x\n", old_prot ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %lx\n", old_prot );
return EXCEPTION_CONTINUE_EXECUTION; } @@ -2615,7 +2615,7 @@ static LRESULT CALLBACK atl_test_func( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR { DWORD arg = (DWORD)hWnd; if (uMsg == WM_USER) - ok( arg == 0x11223344, "arg is 0x%08x instead of 0x11223344\n", arg ); + ok( arg == 0x11223344, "arg is 0x%08lx instead of 0x11223344\n", arg ); else ok( arg != 0x11223344, "arg is unexpectedly 0x11223344\n" ); return 43; @@ -2645,7 +2645,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) char *base; HWND hWnd;
- trace( "Running DEP tests with ProcessExecuteFlags = %d\n", dep_flags ); + trace( "Running DEP tests with ProcessExecuteFlags = %ld\n", dep_flags );
NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags, &old_flags, sizeof(old_flags), NULL ); if (old_flags != dep_flags) @@ -2654,16 +2654,16 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) if (ret == STATUS_INVALID_INFO_CLASS /* Windows 2000 */ || ret == STATUS_ACCESS_DENIED) { - win_skip( "Skipping DEP tests with ProcessExecuteFlags = %d\n", dep_flags ); + win_skip( "Skipping DEP tests with ProcessExecuteFlags = %ld\n", dep_flags ); return; } - ok( !ret, "NtSetInformationProcess failed with status %08x\n", ret ); + ok( !ret, "NtSetInformationProcess failed with status %08lx\n", ret ); restore_flags = TRUE; }
size = 0x1000; base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ); - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() );
/* Check result of GetProcessDEPPolicy */ if (!pGetProcessDEPPolicy) @@ -2684,10 +2684,10 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) *(DWORD *)(base + 6) = (DWORD_PTR)pGetProcessDEPPolicy - (DWORD_PTR)(base + 10);
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
success = get_dep_policy( GetCurrentProcess(), &policy_flags, &policy_permanent ); - ok( success, "GetProcessDEPPolicy failed %u\n", GetLastError() ); + ok( success, "GetProcessDEPPolicy failed %lu\n", GetLastError() );
ret = 0; if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) @@ -2695,7 +2695,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION) ret |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
- ok( policy_flags == ret, "expected policy flags %d, got %d\n", ret, policy_flags ); + ok( policy_flags == ret, "expected policy flags %ld, got %ld\n", ret, policy_flags ); ok( !policy_permanent || broken(policy_permanent == 0x44), "expected policy permanent FALSE, got %d\n", policy_permanent ); } @@ -2710,7 +2710,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) * prevent crashes while creating the window. */
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
memset( &wc, 0, sizeof(wc) ); wc.cbSize = sizeof(wc); @@ -2721,56 +2721,56 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) wc.lpszClassName = cls_name; wc.lpfnWndProc = (WNDPROC)base; success = RegisterClassExA(&wc) != 0; - ok( success, "RegisterClassExA failed %u\n", GetLastError() ); + ok( success, "RegisterClassExA failed %lu\n", GetLastError() );
hWnd = CreateWindowExA(0, cls_name, "Test", WS_TILEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); - ok( hWnd != 0, "CreateWindowExA failed %u\n", GetLastError() ); + ok( hWnd != 0, "CreateWindowExA failed %lu\n", GetLastError() );
ret = SendMessageA(hWnd, WM_USER, 0, 0); - ok( ret == 42, "SendMessage returned unexpected result %d\n", ret ); + ok( ret == 42, "SendMessage returned unexpected result %ld\n", ret );
/* At first try with an instruction which is not recognized as proper ATL thunk * by the Windows ATL Thunk Emulator. Removing execute permissions will lead to * STATUS_ACCESS_VIOLATION exceptions when DEP is enabled. */
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && !IsProcessorFeaturePresent( PF_NX_ENABLED )) { trace( "DEP hardware support is not available\n" ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); dep_flags = MEM_EXECUTE_OPTION_ENABLE; } else if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) { trace( "DEP hardware support is available\n" ); - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); } else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* Now a bit more complicated, the page containing the code is protected with * PAGE_GUARD memory protection. */
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* Now test with a proper ATL thunk instruction. */
@@ -2778,43 +2778,43 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) *(DWORD *)(base + 9) = (DWORD_PTR)atl_test_func - (DWORD_PTR)(base + 13);
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = SendMessageA(hWnd, WM_USER, 0, 0); - ok( ret == 43, "SendMessage returned unexpected result %d\n", ret ); + ok( ret == 43, "SendMessage returned unexpected result %ld\n", ret );
/* Try executing with PAGE_READWRITE protection. */
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* Now a bit more complicated, the page containing the code is protected with * PAGE_GUARD memory protection. */
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
/* the same, but with PAGE_GUARD set */ ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* The following test shows that on Windows, even a vectored exception handler * cannot intercept internal exceptions thrown by the ATL thunk emulation layer. */ @@ -2826,7 +2826,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) PVOID vectored_handler;
success = VirtualProtect( base, size, PAGE_NOACCESS, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
vectored_handler = pRtlAddVectoredExceptionHandler( TRUE, &execute_fault_vec_handler ); ok( vectored_handler != 0, "RtlAddVectoredExceptionHandler failed\n" ); @@ -2835,8 +2835,8 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
pRtlRemoveVectoredExceptionHandler( vectored_handler );
- ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); } else win_skip( "RtlAddVectoredExceptionHandler or RtlRemoveVectoredExceptionHandler not found\n" ); @@ -2848,67 +2848,67 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) *(DWORD *)(base + 6) = (DWORD_PTR)atl_test_func - (DWORD_PTR)(base + 10);
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER + 1, 0, 0 ); /* FIXME: we don't check the content of the register ECX yet */ - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
memcpy( base, code_atl3, sizeof(code_atl3) ); *(DWORD *)(base + 6) = (DWORD_PTR)atl_test_func;
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER + 1, 0, 0 ); /* FIXME: we don't check the content of the registers ECX/EDX yet */ - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
memcpy( base, code_atl4, sizeof(code_atl4) ); *(DWORD *)(base + 6) = (DWORD_PTR)atl_test_func;
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER + 1, 0, 0 ); /* FIXME: We don't check the content of the registers EAX/ECX yet */ - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) ok( num_execute_fault_calls == 0 || broken(num_execute_fault_calls == 1) /* Windows XP */, - "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
memcpy( base, code_atl5, sizeof(code_atl5) );
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
results[1] = atl5_test_func; ret = call_proc_excpt( (void *)base, results ); /* FIXME: We don't check the content of the registers EAX/ECX yet */ - ok( ret == 44, "call returned wrong result, expected 44, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 44, "call returned wrong result, expected 44, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) ok( num_execute_fault_calls == 0 || broken(num_execute_fault_calls == 1) /* Windows XP */, - "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* Restore the JMP instruction, set to executable, and then destroy the Window */
@@ -2916,12 +2916,12 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) *(DWORD *)(base + 1) = (DWORD_PTR)jmp_test_func - (DWORD_PTR)(base + 5);
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
DestroyWindow( hWnd );
success = UnregisterClassA( cls_name, GetModuleHandleA(0) ); - ok( success, "UnregisterClass failed %u\n", GetLastError() ); + ok( success, "UnregisterClass failed %lu\n", GetLastError() );
VirtualFree( base, 0, MEM_RELEASE );
@@ -2933,11 +2933,11 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) win_skip( "MEM_WRITE_WATCH not supported\n" ); goto out; } - ok( base != NULL, "VirtualAlloc failed %u\n", GetLastError() ); + ok( base != NULL, "VirtualAlloc failed %lu\n", GetLastError() );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0, "wrong count %lu\n", count );
memcpy( base, code_jmp, sizeof(code_jmp) ); @@ -2945,14 +2945,14 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %lu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] );
/* Create a new window class and associated Window (see above) */
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
memset( &wc, 0, sizeof(wc) ); wc.cbSize = sizeof(wc); @@ -2963,17 +2963,17 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) wc.lpszClassName = cls_name; wc.lpfnWndProc = (WNDPROC)base; success = RegisterClassExA(&wc) != 0; - ok( success, "RegisterClassExA failed %u\n", GetLastError() ); + ok( success, "RegisterClassExA failed %lu\n", GetLastError() );
hWnd = CreateWindowExA(0, cls_name, "Test", WS_TILEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); - ok( hWnd != 0, "CreateWindowExA failed %u\n", GetLastError() ); + ok( hWnd != 0, "CreateWindowExA failed %lu\n", GetLastError() );
ret = SendMessageA(hWnd, WM_USER, 0, 0); - ok( ret == 42, "SendMessage returned unexpected result %d\n", ret ); + ok( ret == 42, "SendMessage returned unexpected result %ld\n", ret );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0, "wrong count %lu\n", count );
/* At first try with an instruction which is not recognized as proper ATL thunk @@ -2981,48 +2981,48 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) * STATUS_ACCESS_VIOLATION exceptions when DEP is enabled. */
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0, "wrong count %lu\n", count );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* Now a bit more complicated, the page containing the code is protected with * PAGE_GUARD memory protection. */
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 42, "call returned wrong result, expected 42, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0 || broken(count == 1) /* Windows 8 */, "wrong count %lu\n", count );
/* Now test with a proper ATL thunk instruction. */ @@ -3032,62 +3032,62 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %lu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] );
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = SendMessageA(hWnd, WM_USER, 0, 0); - ok( ret == 43, "SendMessage returned unexpected result %d\n", ret ); + ok( ret == 43, "SendMessage returned unexpected result %ld\n", ret );
/* Try executing with PAGE_READWRITE protection. */
success = VirtualProtect( base, size, PAGE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0, "wrong count %lu\n", count );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
/* Now a bit more complicated, the page containing the code is protected with * PAGE_GUARD memory protection. */
success = VirtualProtect( base, size, PAGE_READWRITE | PAGE_GUARD, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
/* the same, but with PAGE_GUARD set */ ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 1, "expected one STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) - ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls ); else - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); - ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + ok( ret == 43, "call returned wrong result, expected 43, got %ld\n", ret ); + ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %ld exceptions\n", num_guard_page_calls ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %ld exceptions\n", num_execute_fault_calls );
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 0 || broken(count == 1) /* Windows 8 */, "wrong count %lu\n", count );
/* Restore the JMP instruction, set to executable, and then destroy the Window */ @@ -3097,17 +3097,17 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
count = 64; ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); - ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( !ret, "GetWriteWatch failed %lu\n", GetLastError() ); ok( count == 1, "wrong count %lu\n", count ); ok( results[0] == base, "wrong result %p\n", results[0] );
success = VirtualProtect( base, size, PAGE_EXECUTE_READWRITE, &old_prot ); - ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( success, "VirtualProtect failed %lu\n", GetLastError() );
DestroyWindow( hWnd );
success = UnregisterClassA( cls_name, GetModuleHandleA(0) ); - ok( success, "UnregisterClass failed %u\n", GetLastError() ); + ok( success, "UnregisterClass failed %lu\n", GetLastError() );
VirtualFree( base, 0, MEM_RELEASE );
@@ -3115,7 +3115,7 @@ out: if (restore_flags) { ret = NtSetInformationProcess( GetCurrentProcess(), ProcessExecuteFlags, &old_flags, sizeof(old_flags) ); - ok( !ret, "NtSetInformationProcess failed with status %08x\n", ret ); + ok( !ret, "NtSetInformationProcess failed with status %08lx\n", ret ); } }
@@ -3170,74 +3170,74 @@ static void test_VirtualProtect(void)
SetLastError(0xdeadbeef); base = VirtualAlloc(0, si.dwPageSize, MEM_RESERVE | MEM_COMMIT, PAGE_NOACCESS); - ok(base != NULL, "VirtualAlloc failed %d\n", GetLastError()); + ok(base != NULL, "VirtualAlloc failed %ld\n", GetLastError());
SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, PAGE_READONLY, NULL); ok(!ret, "VirtualProtect should fail\n"); - ok(GetLastError() == ERROR_NOACCESS, "expected ERROR_NOACCESS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_NOACCESS, "expected ERROR_NOACCESS, got %ld\n", GetLastError()); old_prot = 0xdeadbeef; ret = VirtualProtect(base, si.dwPageSize, PAGE_NOACCESS, &old_prot); - ok(ret, "VirtualProtect failed %d\n", GetLastError()); - ok(old_prot == PAGE_NOACCESS, "got %#x != expected PAGE_NOACCESS\n", old_prot); + ok(ret, "VirtualProtect failed %ld\n", GetLastError()); + ok(old_prot == PAGE_NOACCESS, "got %#lx != expected PAGE_NOACCESS\n", old_prot);
addr = base; size = si.dwPageSize; status = pNtProtectVirtualMemory(GetCurrentProcess(), &addr, &size, PAGE_READONLY, NULL); - ok(status == STATUS_ACCESS_VIOLATION, "NtProtectVirtualMemory should fail, got %08x\n", status); + ok(status == STATUS_ACCESS_VIOLATION, "NtProtectVirtualMemory should fail, got %08lx\n", status); addr = base; size = si.dwPageSize; old_prot = 0xdeadbeef; status = pNtProtectVirtualMemory(GetCurrentProcess(), &addr, &size, PAGE_NOACCESS, &old_prot); - ok(status == STATUS_SUCCESS, "NtProtectVirtualMemory should succeed, got %08x\n", status); - ok(old_prot == PAGE_NOACCESS, "got %#x != expected PAGE_NOACCESS\n", old_prot); + ok(status == STATUS_SUCCESS, "NtProtectVirtualMemory should succeed, got %08lx\n", status); + ok(old_prot == PAGE_NOACCESS, "got %#lx != expected PAGE_NOACCESS\n", old_prot);
for (i = 0; i < ARRAY_SIZE(td); i++) { SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == base, "%d: got %p != expected %p\n", i, info.BaseAddress, base); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); - ok(info.Protect == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, info.Protect); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == PAGE_NOACCESS, "%d: %#x != PAGE_NOACCESS\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == MEM_PRIVATE, "%d: %#x != MEM_PRIVATE\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == base, "%ld: got %p != expected %p\n", i, info.BaseAddress, base); + ok(info.RegionSize == si.dwPageSize, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, si.dwPageSize); + ok(info.Protect == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, info.Protect); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == PAGE_NOACCESS, "%ld: %#lx != PAGE_NOACCESS\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == MEM_PRIVATE, "%ld: %#lx != MEM_PRIVATE\n", i, info.Type);
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, td[i].prot_set, &old_prot); if (td[i].prot_get) { - ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); - ok(old_prot == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, old_prot); + ok(ret, "%ld: VirtualProtect error %ld\n", i, GetLastError()); + ok(old_prot == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, old_prot);
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == base, "%d: got %p != expected %p\n", i, info.BaseAddress, base); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); - ok(info.Protect == td[i].prot_get, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot_get); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == PAGE_NOACCESS, "%d: %#x != PAGE_NOACCESS\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == MEM_PRIVATE, "%d: %#x != MEM_PRIVATE\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == base, "%ld: got %p != expected %p\n", i, info.BaseAddress, base); + ok(info.RegionSize == si.dwPageSize, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, si.dwPageSize); + ok(info.Protect == td[i].prot_get, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot_get); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == PAGE_NOACCESS, "%ld: %#lx != PAGE_NOACCESS\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == MEM_PRIVATE, "%ld: %#lx != MEM_PRIVATE\n", i, info.Type); } else { - ok(!ret, "%d: VirtualProtect should fail\n", i); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(!ret, "%ld: VirtualProtect should fail\n", i); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); }
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, PAGE_NOACCESS, &old_prot); - ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); + ok(ret, "%ld: VirtualProtect error %ld\n", i, GetLastError()); if (td[i].prot_get) - ok(old_prot == td[i].prot_get, "%d: got %#x != expected %#x\n", i, old_prot, td[i].prot_get); + ok(old_prot == td[i].prot_get, "%ld: got %#lx != expected %#lx\n", i, old_prot, td[i].prot_get); else - ok(old_prot == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, old_prot); + ok(old_prot == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, old_prot); }
exec_prot = 0; @@ -3254,19 +3254,19 @@ static void test_VirtualProtect(void) ptr = VirtualAlloc(base, si.dwPageSize, MEM_COMMIT, prot); if ((rw_prot && exec_prot) || (!rw_prot && !exec_prot)) { - ok(!ptr, "VirtualAlloc(%02x) should fail\n", prot); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ptr, "VirtualAlloc(%02lx) should fail\n", prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } else { if (prot & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)) { - ok(!ptr, "VirtualAlloc(%02x) should fail\n", prot); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ptr, "VirtualAlloc(%02lx) should fail\n", prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } else { - ok(ptr != NULL, "VirtualAlloc(%02x) error %d\n", prot, GetLastError()); + ok(ptr != NULL, "VirtualAlloc(%02lx) error %ld\n", prot, GetLastError()); ok(ptr == base, "expected %p, got %p\n", base, ptr); } } @@ -3275,18 +3275,18 @@ static void test_VirtualProtect(void) ret = VirtualProtect(base, si.dwPageSize, prot, &old_prot); if ((rw_prot && exec_prot) || (!rw_prot && !exec_prot)) { - ok(!ret, "VirtualProtect(%02x) should fail\n", prot); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ret, "VirtualProtect(%02lx) should fail\n", prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } else { if (prot & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)) { - ok(!ret, "VirtualProtect(%02x) should fail\n", prot); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ret, "VirtualProtect(%02lx) should fail\n", prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } else - ok(ret, "VirtualProtect(%02x) error %d\n", prot, GetLastError()); + ok(ret, "VirtualProtect(%02lx) error %ld\n", prot, GetLastError()); }
rw_prot = 1 << j; @@ -3365,18 +3365,18 @@ static void test_VirtualAlloc_protection(void)
if (td[i].success) { - ok(base != NULL, "%d: VirtualAlloc failed %d\n", i, GetLastError()); + ok(base != NULL, "%ld: VirtualAlloc failed %ld\n", i, GetLastError());
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == base, "%d: got %p != expected %p\n", i, info.BaseAddress, base); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); - ok(info.Protect == td[i].prot, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == td[i].prot, "%d: %#x != %#x\n", i, info.AllocationProtect, td[i].prot); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == MEM_PRIVATE, "%d: %#x != MEM_PRIVATE\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == base, "%ld: got %p != expected %p\n", i, info.BaseAddress, base); + ok(info.RegionSize == si.dwPageSize, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, si.dwPageSize); + ok(info.Protect == td[i].prot, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == td[i].prot, "%ld: %#lx != %#lx\n", i, info.AllocationProtect, td[i].prot); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == MEM_PRIVATE, "%ld: %#lx != MEM_PRIVATE\n", i, info.Type);
if (is_mem_writable(info.Protect)) { @@ -3384,20 +3384,20 @@ static void test_VirtualAlloc_protection(void)
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.Protect == td[i].prot, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.Protect == td[i].prot, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot); }
SetLastError(0xdeadbeef); ptr = VirtualAlloc(base, si.dwPageSize, MEM_COMMIT, td[i].prot); - ok(ptr == base, "%d: VirtualAlloc failed %d\n", i, GetLastError()); + ok(ptr == base, "%ld: VirtualAlloc failed %ld\n", i, GetLastError());
VirtualFree(base, 0, MEM_RELEASE); } else { - ok(!base, "%d: VirtualAlloc should fail\n", i); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(!base, "%ld: VirtualAlloc should fail\n", i); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); } } } @@ -3457,7 +3457,7 @@ static void test_CreateFileMapping_protection(void)
SetLastError(0xdeadbeef); hfile = CreateFileA(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %d\n", file_name, GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %ld\n", file_name, GetLastError()); SetFilePointer(hfile, si.dwPageSize, NULL, FILE_BEGIN); SetEndOfFile(hfile);
@@ -3470,51 +3470,51 @@ static void test_CreateFileMapping_protection(void) { if (!hmap) { - trace("%d: CreateFileMapping(%04x) failed: %d\n", i, td[i].prot, GetLastError()); + trace("%ld: CreateFileMapping(%04lx) failed: %ld\n", i, td[i].prot, GetLastError()); /* NT4 and win2k don't support EXEC on file mappings */ if (td[i].prot == PAGE_EXECUTE_READ || td[i].prot == PAGE_EXECUTE_READWRITE) { page_exec_supported = FALSE; - ok(broken(!hmap), "%d: CreateFileMapping doesn't support PAGE_EXECUTE\n", i); + ok(broken(!hmap), "%ld: CreateFileMapping doesn't support PAGE_EXECUTE\n", i); continue; } /* Vista+ supports PAGE_EXECUTE_WRITECOPY, earlier versions don't */ if (td[i].prot == PAGE_EXECUTE_WRITECOPY) { page_exec_supported = FALSE; - ok(broken(!hmap), "%d: CreateFileMapping doesn't support PAGE_EXECUTE_WRITECOPY\n", i); + ok(broken(!hmap), "%ld: CreateFileMapping doesn't support PAGE_EXECUTE_WRITECOPY\n", i); continue; } } - ok(hmap != 0, "%d: CreateFileMapping(%04x) error %d\n", i, td[i].prot, GetLastError()); + ok(hmap != 0, "%ld: CreateFileMapping(%04lx) error %ld\n", i, td[i].prot, GetLastError());
base = MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0); - ok(base != NULL, "%d: MapViewOfFile failed %d\n", i, GetLastError()); + ok(base != NULL, "%ld: MapViewOfFile failed %ld\n", i, GetLastError());
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == base, "%d: got %p != expected %p\n", i, info.BaseAddress, base); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); - ok(info.Protect == PAGE_READONLY, "%d: got %#x != expected PAGE_READONLY\n", i, info.Protect); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == PAGE_READONLY, "%d: %#x != PAGE_READONLY\n", i, info.AllocationProtect); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == MEM_MAPPED, "%d: %#x != MEM_MAPPED\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == base, "%ld: got %p != expected %p\n", i, info.BaseAddress, base); + ok(info.RegionSize == si.dwPageSize, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, si.dwPageSize); + ok(info.Protect == PAGE_READONLY, "%ld: got %#lx != expected PAGE_READONLY\n", i, info.Protect); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == PAGE_READONLY, "%ld: %#lx != PAGE_READONLY\n", i, info.AllocationProtect); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == MEM_MAPPED, "%ld: %#lx != MEM_MAPPED\n", i, info.Type);
SetLastError(0xdeadbeef); ptr = VirtualAlloc(base, si.dwPageSize, MEM_COMMIT, td[i].prot); - ok(!ptr, "%d: VirtualAlloc(%02x) should fail\n", i, td[i].prot); - ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + ok(!ptr, "%ld: VirtualAlloc(%02lx) should fail\n", i, td[i].prot); + ok(GetLastError() == ERROR_ACCESS_DENIED, "%ld: expected ERROR_ACCESS_DENIED, got %ld\n", i, GetLastError());
SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, td[i].prot, &old_prot); if (td[i].prot == PAGE_READONLY || td[i].prot == PAGE_WRITECOPY) - ok(ret, "%d: VirtualProtect(%02x) error %d\n", i, td[i].prot, GetLastError()); + ok(ret, "%ld: VirtualProtect(%02lx) error %ld\n", i, td[i].prot, GetLastError()); else { - ok(!ret, "%d: VirtualProtect(%02x) should fail\n", i, td[i].prot); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(!ret, "%ld: VirtualProtect(%02lx) should fail\n", i, td[i].prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); }
UnmapViewOfFile(base); @@ -3522,8 +3522,8 @@ static void test_CreateFileMapping_protection(void) } else { - ok(!hmap, "%d: CreateFileMapping should fail\n", i); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(!hmap, "%ld: CreateFileMapping should fail\n", i); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); } }
@@ -3531,30 +3531,30 @@ static void test_CreateFileMapping_protection(void) else alloc_prot = PAGE_READWRITE; SetLastError(0xdeadbeef); hmap = CreateFileMappingW(hfile, NULL, alloc_prot, 0, si.dwPageSize, NULL); - ok(hmap != 0, "%d: CreateFileMapping error %d\n", i, GetLastError()); + ok(hmap != 0, "%ld: CreateFileMapping error %ld\n", i, GetLastError());
for (i = 0; i < ARRAY_SIZE(td); i++) { SetLastError(0xdeadbeef); base = MapViewOfFile(hmap, FILE_MAP_READ | FILE_MAP_WRITE | (page_exec_supported ? FILE_MAP_EXECUTE : 0), 0, 0, 0); - ok(base != NULL, "MapViewOfFile failed %d\n", GetLastError()); + ok(base != NULL, "MapViewOfFile failed %ld\n", GetLastError());
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, PAGE_NOACCESS, &old_prot); - ok(ret, "VirtualProtect error %d\n", GetLastError()); - ok(old_prot == alloc_prot, "got %#x != expected %#x\n", old_prot, alloc_prot); + ok(ret, "VirtualProtect error %ld\n", GetLastError()); + ok(old_prot == alloc_prot, "got %#lx != expected %#lx\n", old_prot, alloc_prot);
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == base, "%d: got %p != expected %p\n", i, info.BaseAddress, base); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); - ok(info.Protect == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, info.Protect); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == alloc_prot, "%d: %#x != %#x\n", i, info.AllocationProtect, alloc_prot); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == MEM_MAPPED, "%d: %#x != MEM_MAPPED\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == base, "%ld: got %p != expected %p\n", i, info.BaseAddress, base); + ok(info.RegionSize == si.dwPageSize, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, si.dwPageSize); + ok(info.Protect == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, info.Protect); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == alloc_prot, "%ld: %#lx != %#lx\n", i, info.AllocationProtect, alloc_prot); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == MEM_MAPPED, "%ld: %#lx != MEM_MAPPED\n", i, info.Type);
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -3566,36 +3566,36 @@ static void test_CreateFileMapping_protection(void) /* win2k and XP don't support EXEC on file mappings */ if (td[i].prot == PAGE_EXECUTE) { - ok(broken(!ret), "%d: VirtualProtect doesn't support PAGE_EXECUTE\n", i); + ok(broken(!ret), "%ld: VirtualProtect doesn't support PAGE_EXECUTE\n", i); continue; } /* NT4 and win2k don't support EXEC on file mappings */ if (td[i].prot == PAGE_EXECUTE_READ || td[i].prot == PAGE_EXECUTE_READWRITE) { - ok(broken(!ret), "%d: VirtualProtect doesn't support PAGE_EXECUTE\n", i); + ok(broken(!ret), "%ld: VirtualProtect doesn't support PAGE_EXECUTE\n", i); continue; } /* Vista+ supports PAGE_EXECUTE_WRITECOPY, earlier versions don't */ if (td[i].prot == PAGE_EXECUTE_WRITECOPY) { - ok(broken(!ret), "%d: VirtualProtect doesn't support PAGE_EXECUTE_WRITECOPY\n", i); + ok(broken(!ret), "%ld: VirtualProtect doesn't support PAGE_EXECUTE_WRITECOPY\n", i); continue; } }
- ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); - ok(old_prot == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, old_prot); + ok(ret, "%ld: VirtualProtect error %ld\n", i, GetLastError()); + ok(old_prot == PAGE_NOACCESS, "%ld: got %#lx != expected PAGE_NOACCESS\n", i, old_prot);
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); - ok(info.BaseAddress == base, "%d: got %p != expected %p\n", i, info.BaseAddress, base); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); - ok(info.Protect == td[i].prot, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot); - ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); - ok(info.AllocationProtect == alloc_prot, "%d: %#x != %#x\n", i, info.AllocationProtect, alloc_prot); - ok(info.State == MEM_COMMIT, "%d: %#x != MEM_COMMIT\n", i, info.State); - ok(info.Type == MEM_MAPPED, "%d: %#x != MEM_MAPPED\n", i, info.Type); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); + ok(info.BaseAddress == base, "%ld: got %p != expected %p\n", i, info.BaseAddress, base); + ok(info.RegionSize == si.dwPageSize, "%ld: got %#Ix != expected %#lx\n", i, info.RegionSize, si.dwPageSize); + ok(info.Protect == td[i].prot, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot); + ok(info.AllocationBase == base, "%ld: %p != %p\n", i, info.AllocationBase, base); + ok(info.AllocationProtect == alloc_prot, "%ld: %#lx != %#lx\n", i, info.AllocationProtect, alloc_prot); + ok(info.State == MEM_COMMIT, "%ld: %#lx != MEM_COMMIT\n", i, info.State); + ok(info.Type == MEM_MAPPED, "%ld: %#lx != MEM_MAPPED\n", i, info.Type);
if (is_mem_writable(info.Protect)) { @@ -3603,26 +3603,26 @@ static void test_CreateFileMapping_protection(void)
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "VirtualQuery failed %d\n", GetLastError()); + ok(ret, "VirtualQuery failed %ld\n", GetLastError()); /* FIXME: remove the condition below once Wine is fixed */ todo_wine_if (td[i].prot == PAGE_WRITECOPY || td[i].prot == PAGE_EXECUTE_WRITECOPY) - ok(info.Protect == td[i].prot_after_write, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot_after_write); + ok(info.Protect == td[i].prot_after_write, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot_after_write); } } else { - ok(!ret, "%d: VirtualProtect should fail\n", i); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + ok(!ret, "%ld: VirtualProtect should fail\n", i); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%ld: expected ERROR_INVALID_PARAMETER, got %ld\n", i, GetLastError()); continue; }
old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); ret = VirtualProtect(base, si.dwPageSize, PAGE_NOACCESS, &old_prot); - ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); + ok(ret, "%ld: VirtualProtect error %ld\n", i, GetLastError()); /* FIXME: remove the condition below once Wine is fixed */ todo_wine_if (td[i].prot == PAGE_WRITECOPY || td[i].prot == PAGE_EXECUTE_WRITECOPY) - ok(old_prot == td[i].prot_after_write, "%d: got %#x != expected %#x\n", i, old_prot, td[i].prot_after_write); + ok(old_prot == td[i].prot_after_write, "%ld: got %#lx != expected %#lx\n", i, old_prot, td[i].prot_after_write);
UnmapViewOfFile(base); } @@ -3799,7 +3799,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) MEMORY_BASIC_INFORMATION info, nt_info; BOOL anon_mapping = (hfile == INVALID_HANDLE_VALUE);
- trace( "testing %s mapping flags %08x %s\n", anon_mapping ? "anonymous" : "file", + trace( "testing %s mapping flags %08lx %s\n", anon_mapping ? "anonymous" : "file", sec_flags, readonly ? "readonly file" : "" ); for (i = 0; i < ARRAY_SIZE(page_prot); i++) { @@ -3811,9 +3811,9 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) { todo_wine_if(page_prot[i] == PAGE_EXECUTE_READ || page_prot[i] == PAGE_EXECUTE_WRITECOPY) { - ok(!hmap, "%d: CreateFileMapping(%04x) should fail\n", i, page_prot[i]); + ok(!hmap, "%ld: CreateFileMapping(%04lx) should fail\n", i, page_prot[i]); ok(GetLastError() == ERROR_ACCESS_DENIED || broken(GetLastError() == ERROR_INVALID_PARAMETER), - "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); } if (hmap) CloseHandle(hmap); continue; @@ -3824,7 +3824,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) HANDLE hmap2;
ok(!hmap, "CreateFileMapping(PAGE_NOACCESS) should fail\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* A trick to create a not accessible mapping */ SetLastError(0xdeadbeef); @@ -3832,10 +3832,10 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) hmap = CreateFileMappingW(hfile, NULL, PAGE_WRITECOPY | sec_flags, 0, si.dwPageSize, NULL); else hmap = CreateFileMappingW(hfile, NULL, PAGE_READONLY | sec_flags, 0, si.dwPageSize, NULL); - ok(hmap != 0, "CreateFileMapping(PAGE_READWRITE) error %d\n", GetLastError()); + ok(hmap != 0, "CreateFileMapping(PAGE_READWRITE) error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = DuplicateHandle(GetCurrentProcess(), hmap, GetCurrentProcess(), &hmap2, 0, FALSE, 0); - ok(ret, "DuplicateHandle error %d\n", GetLastError()); + ok(ret, "DuplicateHandle error %ld\n", GetLastError()); CloseHandle(hmap); hmap = hmap2; } @@ -3843,13 +3843,13 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) { ok(!hmap, "CreateFileMapping(PAGE_EXECUTE) should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); continue; }
if (!hmap) { - trace("%d: CreateFileMapping(%04x) failed: %d\n", i, page_prot[i], GetLastError()); + trace("%ld: CreateFileMapping(%04lx) failed: %ld\n", i, page_prot[i], GetLastError());
if ((sec_flags & SEC_IMAGE) && (page_prot[i] == PAGE_READWRITE || page_prot[i] == PAGE_EXECUTE_READWRITE)) @@ -3858,18 +3858,18 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) /* NT4 and win2k don't support EXEC on file mappings */ if (page_prot[i] == PAGE_EXECUTE_READ || page_prot[i] == PAGE_EXECUTE_READWRITE) { - ok(broken(!hmap), "%d: CreateFileMapping doesn't support PAGE_EXECUTE\n", i); + ok(broken(!hmap), "%ld: CreateFileMapping doesn't support PAGE_EXECUTE\n", i); continue; } /* Vista+ supports PAGE_EXECUTE_WRITECOPY, earlier versions don't */ if (page_prot[i] == PAGE_EXECUTE_WRITECOPY) { - ok(broken(!hmap), "%d: CreateFileMapping doesn't support PAGE_EXECUTE_WRITECOPY\n", i); + ok(broken(!hmap), "%ld: CreateFileMapping doesn't support PAGE_EXECUTE_WRITECOPY\n", i); continue; } }
- ok(hmap != 0, "%d: CreateFileMapping(%04x) error %d\n", i, page_prot[i], GetLastError()); + ok(hmap != 0, "%ld: CreateFileMapping(%04lx) error %ld\n", i, page_prot[i], GetLastError());
for (j = 0; j < ARRAY_SIZE(view); j++) { @@ -3878,7 +3878,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) { SetLastError(0xdeadbeef); ret = VirtualQuery(nt_base, &nt_info, sizeof(nt_info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); UnmapViewOfFile(nt_base); }
@@ -3888,22 +3888,22 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) /* Vista+ supports FILE_MAP_EXECUTE properly, earlier versions don't */ ok(!nt_base == !base || broken((view[j].access & FILE_MAP_EXECUTE) && !nt_base != !base), - "%d: (%04x/%04x) NT %p kernel %p\n", j, page_prot[i], view[j].access, nt_base, base); + "%ld: (%04lx/%04lx) NT %p kernel %p\n", j, page_prot[i], view[j].access, nt_base, base);
if (!is_compatible_access(page_prot[i], view[j].access)) { /* FILE_MAP_EXECUTE | FILE_MAP_COPY broken on XP */ if (base != NULL && view[j].access == (FILE_MAP_EXECUTE | FILE_MAP_COPY)) { - ok( broken(base != NULL), "%d: MapViewOfFile(%04x/%04x) should fail\n", + ok( broken(base != NULL), "%ld: MapViewOfFile(%04lx/%04lx) should fail\n", j, page_prot[i], view[j].access); UnmapViewOfFile( base ); } else { - ok(!base, "%d: MapViewOfFile(%04x/%04x) should fail\n", + ok(!base, "%ld: MapViewOfFile(%04lx/%04lx) should fail\n", j, page_prot[i], view[j].access); - ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %ld\n", GetLastError()); } continue; } @@ -3911,49 +3911,49 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) /* Vista+ properly supports FILE_MAP_EXECUTE, earlier versions don't */ if (!base && (view[j].access & FILE_MAP_EXECUTE)) { - ok(broken(!base), "%d: MapViewOfFile(%04x/%04x) failed %d\n", j, page_prot[i], view[j].access, GetLastError()); + ok(broken(!base), "%ld: MapViewOfFile(%04lx/%04lx) failed %ld\n", j, page_prot[i], view[j].access, GetLastError()); continue; }
- ok(base != NULL, "%d: MapViewOfFile(%04x/%04x) failed %d\n", j, page_prot[i], view[j].access, GetLastError()); + ok(base != NULL, "%ld: MapViewOfFile(%04lx/%04lx) failed %ld\n", j, page_prot[i], view[j].access, GetLastError());
SetLastError(0xdeadbeef); ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); - ok(info.BaseAddress == base, "%d: (%04x) got %p, expected %p\n", j, view[j].access, info.BaseAddress, base); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); + ok(info.BaseAddress == base, "%ld: (%04lx) got %p, expected %p\n", j, view[j].access, info.BaseAddress, base); ok(info.RegionSize == 2*si.dwPageSize || (info.RegionSize == si.dwPageSize && (sec_flags & SEC_IMAGE)), - "%d: (%04x) got %#lx != expected %#x\n", j, view[j].access, info.RegionSize, 2*si.dwPageSize); + "%ld: (%04lx) got %#Ix != expected %#lx\n", j, view[j].access, info.RegionSize, 2*si.dwPageSize); if (sec_flags & SEC_IMAGE) ok(info.Protect == PAGE_READONLY, - "%d: (%04x) got %#x, expected %#x\n", j, view[j].access, info.Protect, view[j].prot); + "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, info.Protect, view[j].prot); else ok(info.Protect == view[j].prot || broken(view[j].prot == PAGE_EXECUTE_READ && info.Protect == PAGE_READONLY) || /* win2k */ broken(view[j].prot == PAGE_EXECUTE_READWRITE && info.Protect == PAGE_READWRITE) || /* win2k */ broken(view[j].prot == PAGE_EXECUTE_WRITECOPY && info.Protect == PAGE_NOACCESS), /* XP */ - "%d: (%04x) got %#x, expected %#x\n", j, view[j].access, info.Protect, view[j].prot); - ok(info.AllocationBase == base, "%d: (%04x) got %p, expected %p\n", j, view[j].access, info.AllocationBase, base); + "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, info.Protect, view[j].prot); + ok(info.AllocationBase == base, "%ld: (%04lx) got %p, expected %p\n", j, view[j].access, info.AllocationBase, base); if (sec_flags & SEC_IMAGE) - ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: (%04x) got %#x, expected %#x\n", + ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, info.AllocationProtect, info.Protect); else - ok(info.AllocationProtect == info.Protect, "%d: (%04x) got %#x, expected %#x\n", + ok(info.AllocationProtect == info.Protect, "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, info.AllocationProtect, info.Protect); - ok(info.State == MEM_COMMIT, "%d: (%04x) got %#x, expected MEM_COMMIT\n", j, view[j].access, info.State); + ok(info.State == MEM_COMMIT, "%ld: (%04lx) got %#lx, expected MEM_COMMIT\n", j, view[j].access, info.State); ok(info.Type == (sec_flags & SEC_IMAGE) ? SEC_IMAGE : MEM_MAPPED, - "%d: (%04x) got %#x, expected MEM_MAPPED\n", j, view[j].access, info.Type); + "%ld: (%04lx) got %#lx, expected MEM_MAPPED\n", j, view[j].access, info.Type);
if (nt_base && base) { - ok(nt_info.RegionSize == info.RegionSize, "%d: (%04x) got %#lx != expected %#lx\n", j, view[j].access, nt_info.RegionSize, info.RegionSize); + ok(nt_info.RegionSize == info.RegionSize, "%ld: (%04lx) got %#Ix != expected %#Ix\n", j, view[j].access, nt_info.RegionSize, info.RegionSize); ok(nt_info.Protect == info.Protect /* Vista+ */ || broken(nt_info.AllocationProtect == PAGE_EXECUTE_WRITECOPY && info.Protect == PAGE_NOACCESS), /* XP */ - "%d: (%04x) got %#x, expected %#x\n", j, view[j].access, nt_info.Protect, info.Protect); + "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, nt_info.Protect, info.Protect); ok(nt_info.AllocationProtect == info.AllocationProtect /* Vista+ */ || broken(nt_info.AllocationProtect == PAGE_EXECUTE_WRITECOPY && info.Protect == PAGE_NOACCESS), /* XP */ - "%d: (%04x) got %#x, expected %#x\n", j, view[j].access, nt_info.AllocationProtect, info.AllocationProtect); - ok(nt_info.State == info.State, "%d: (%04x) got %#x, expected %#x\n", j, view[j].access, nt_info.State, info.State); - ok(nt_info.Type == info.Type, "%d: (%04x) got %#x, expected %#x\n", j, view[j].access, nt_info.Type, info.Type); + "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, nt_info.AllocationProtect, info.AllocationProtect); + ok(nt_info.State == info.State, "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, nt_info.State, info.State); + ok(nt_info.Type == info.Type, "%ld: (%04lx) got %#lx, expected %#lx\n", j, view[j].access, nt_info.Type, info.Type); }
prev_prot = info.Protect; @@ -3976,22 +3976,22 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) }
todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) - ok(ret, "VirtualProtect error %d, map %#x, view %#x, requested prot %#x\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); + ok(ret, "VirtualProtect error %ld, map %#lx, view %#lx, requested prot %#lx\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) - ok(old_prot == prev_prot, "got %#x, expected %#x\n", old_prot, prev_prot); + ok(old_prot == prev_prot, "got %#lx, expected %#lx\n", old_prot, prev_prot); prev_prot = actual_prot;
ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) ok(info.Protect == actual_prot, - "VirtualProtect wrong prot, map %#x, view %#x, requested prot %#x got %#x\n", + "VirtualProtect wrong prot, map %#lx, view %#lx, requested prot %#lx got %#lx\n", page_prot[i], view[j].prot, page_prot[k], info.Protect ); } else { - ok(!ret, "VirtualProtect should fail, map %#x, view %#x, requested prot %#x\n", page_prot[i], view[j].prot, page_prot[k]); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ret, "VirtualProtect should fail, map %#lx, view %#lx, requested prot %#lx\n", page_prot[i], view[j].prot, page_prot[k]); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } }
@@ -4004,34 +4004,34 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) { if (is_compatible_protection(view[j].prot, page_prot[k])) { - ok(ptr != NULL, "VirtualAlloc error %u, map %#x, view %#x, requested prot %#x\n", + ok(ptr != NULL, "VirtualAlloc error %lu, map %#lx, view %#lx, requested prot %#lx\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); } else { /* versions <= Vista accept all protections without checking */ ok(!ptr || broken(ptr != NULL), - "VirtualAlloc should fail, map %#x, view %#x, requested prot %#x\n", + "VirtualAlloc should fail, map %#lx, view %#lx, requested prot %#lx\n", page_prot[i], view[j].prot, page_prot[k]); if (!ptr) ok( GetLastError() == ERROR_INVALID_PARAMETER, - "wrong error %u\n", GetLastError()); + "wrong error %lu\n", GetLastError()); } if (ptr) { ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); ok(info.Protect == page_prot[k] || /* if the mapping doesn't have write access, * broken versions silently switch to WRITECOPY */ broken( info.Protect == map_prot_no_write(page_prot[k]) ), - "VirtualAlloc wrong prot, map %#x, view %#x, requested prot %#x got %#x\n", + "VirtualAlloc wrong prot, map %#lx, view %#lx, requested prot %#lx got %#lx\n", page_prot[i], view[j].prot, page_prot[k], info.Protect ); } } else { - ok(!ptr, "VirtualAlloc(%02x) should fail\n", page_prot[k]); - ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(!ptr, "VirtualAlloc(%02lx) should fail\n", page_prot[k]); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError()); } }
@@ -4039,15 +4039,15 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) { ret = VirtualProtect(base, sec_flags & SEC_IMAGE ? si.dwPageSize : 2*si.dwPageSize, PAGE_WRITECOPY, &old_prot); todo_wine_if(readonly && view[j].prot != PAGE_WRITECOPY) - ok(ret, "VirtualProtect error %d, map %#x, view %#x\n", GetLastError(), page_prot[i], view[j].prot); + ok(ret, "VirtualProtect error %ld, map %#lx, view %#lx\n", GetLastError(), page_prot[i], view[j].prot); if (ret) *(DWORD*)base = 0xdeadbeef; ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); todo_wine - ok(info.Protect == PAGE_READWRITE, "VirtualProtect wrong prot, map %#x, view %#x got %#x\n", + ok(info.Protect == PAGE_READWRITE, "VirtualProtect wrong prot, map %#lx, view %#lx got %#lx\n", page_prot[i], view[j].prot, info.Protect ); todo_wine_if (!(sec_flags & SEC_IMAGE)) - ok(info.RegionSize == si.dwPageSize, "wrong region size %#lx after write, map %#x, view %#x got %#x\n", + ok(info.RegionSize == si.dwPageSize, "wrong region size %#Ix after write, map %#lx, view %#lx got %#lx\n", info.RegionSize, page_prot[i], view[j].prot, info.Protect );
prev_prot = info.Protect; @@ -4056,9 +4056,9 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) if (!(sec_flags & SEC_IMAGE)) { ret = VirtualQuery((char*)base + si.dwPageSize, &info, sizeof(info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); todo_wine_if(readonly && view[j].prot != PAGE_WRITECOPY) - ok(info.Protect == PAGE_WRITECOPY, "wrong prot, map %#x, view %#x got %#x\n", + ok(info.Protect == PAGE_WRITECOPY, "wrong prot, map %#lx, view %#lx got %#lx\n", page_prot[i], view[j].prot, info.Protect); }
@@ -4078,22 +4078,22 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) }
todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) - ok(ret, "VirtualProtect error %d, map %#x, view %#x, requested prot %#x\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); + ok(ret, "VirtualProtect error %ld, map %#lx, view %#lx, requested prot %#lx\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) - ok(old_prot == prev_prot, "got %#x, expected %#x\n", old_prot, prev_prot); + ok(old_prot == prev_prot, "got %#lx, expected %#lx\n", old_prot, prev_prot);
ret = VirtualQuery(base, &info, sizeof(info)); - ok(ret, "%d: VirtualQuery failed %d\n", j, GetLastError()); + ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); todo_wine_if( map_prot_written( page_prot[k] ) != actual_prot ) ok(info.Protect == map_prot_written( page_prot[k] ), - "VirtualProtect wrong prot, map %#x, view %#x, requested prot %#x got %#x\n", + "VirtualProtect wrong prot, map %#lx, view %#lx, requested prot %#lx got %#lx\n", page_prot[i], view[j].prot, page_prot[k], info.Protect ); prev_prot = info.Protect; } else { - ok(!ret, "VirtualProtect should fail, map %#x, view %#x, requested prot %#x\n", page_prot[i], view[j].prot, page_prot[k]); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(!ret, "VirtualProtect should fail, map %#lx, view %#lx, requested prot %#lx\n", page_prot[i], view[j].prot, page_prot[k]); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } } } @@ -4115,7 +4115,7 @@ static void test_mappings(void) GetTempFileNameA(temp_path, "map", 0, file_name);
hfile = CreateFileA(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %d\n", file_name, GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %ld\n", file_name, GetLastError()); SetFilePointer(hfile, 2*si.dwPageSize, NULL, FILE_BEGIN); SetEndOfFile(hfile);
@@ -4124,14 +4124,14 @@ static void test_mappings(void) /* test that file was not modified */ SetFilePointer(hfile, 0, NULL, FILE_BEGIN); ok(ReadFile(hfile, &data, sizeof(data), &num_bytes, NULL), "ReadFile failed\n"); - ok(num_bytes == sizeof(data), "num_bytes = %d\n", num_bytes); + ok(num_bytes == sizeof(data), "num_bytes = %ld\n", num_bytes); todo_wine - ok(!data, "data = %x\n", data); + ok(!data, "data = %lx\n", data);
CloseHandle( hfile );
hfile = CreateFileA(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %d\n", file_name, GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %ld\n", file_name, GetLastError());
test_mapping( hfile, SEC_COMMIT, TRUE );
@@ -4143,7 +4143,7 @@ static void test_mappings(void) strcat( file_name, "\kernel32.dll" );
hfile = CreateFileA( file_name, GENERIC_READ|GENERIC_EXECUTE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %d\n", file_name, GetLastError()); + ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %ld\n", file_name, GetLastError());
test_mapping( hfile, SEC_IMAGE, FALSE );
@@ -4160,17 +4160,17 @@ static void test_shared_memory(BOOL is_child)
SetLastError(0xdeadbef); mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_virtual.c"); - ok(mapping != 0, "CreateFileMapping error %d\n", GetLastError()); + ok(mapping != 0, "CreateFileMapping error %ld\n", GetLastError()); if (is_child) - ok(GetLastError() == ERROR_ALREADY_EXISTS, "expected ERROR_ALREADY_EXISTS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "expected ERROR_ALREADY_EXISTS, got %ld\n", GetLastError());
SetLastError(0xdeadbef); p = MapViewOfFile(mapping, FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, 4096); - ok(p != NULL, "MapViewOfFile error %d\n", GetLastError()); + ok(p != NULL, "MapViewOfFile error %ld\n", GetLastError());
if (is_child) { - ok(*p == 0x1a2b3c4d, "expected 0x1a2b3c4d in child, got %#x\n", *p); + ok(*p == 0x1a2b3c4d, "expected 0x1a2b3c4d in child, got %#lx\n", *p); } else { @@ -4185,7 +4185,7 @@ static void test_shared_memory(BOOL is_child) winetest_get_mainargs(&argv); sprintf(cmdline, ""%s" virtual sharedmem", argv[0]); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); wait_child_process(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); @@ -4202,13 +4202,13 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access)
SetLastError(0xdeadbef); mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_virtual.c_ro"); - ok(mapping != 0, "CreateFileMapping error %d\n", GetLastError()); + ok(mapping != 0, "CreateFileMapping error %ld\n", GetLastError()); if (is_child) - ok(GetLastError() == ERROR_ALREADY_EXISTS, "expected ERROR_ALREADY_EXISTS, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_ALREADY_EXISTS, "expected ERROR_ALREADY_EXISTS, got %ld\n", GetLastError());
SetLastError(0xdeadbef); p = MapViewOfFile(mapping, is_child ? child_access : FILE_MAP_READ, 0, 0, 4096); - ok(p != NULL, "MapViewOfFile error %d\n", GetLastError()); + ok(p != NULL, "MapViewOfFile error %ld\n", GetLastError());
if (is_child) { @@ -4223,17 +4223,17 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access) DWORD ret;
winetest_get_mainargs(&argv); - sprintf(cmdline, ""%s" virtual sharedmemro %x", argv[0], child_access); + sprintf(cmdline, ""%s" virtual sharedmemro %lx", argv[0], child_access); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); + ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError()); wait_child_process(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
if(child_access & FILE_MAP_WRITE) - ok(*p == 0xdeadbeef, "*p = %x, expected 0xdeadbeef\n", *p); + ok(*p == 0xdeadbeef, "*p = %lx, expected 0xdeadbeef\n", *p); else - ok(!*p, "*p = %x, expected 0\n", *p); + ok(!*p, "*p = %lx, expected 0\n", *p); }
UnmapViewOfFile(p); @@ -4269,10 +4269,10 @@ START_TEST(virtual) BOOL ret; mem = VirtualAlloc(NULL, 1<<20, MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE); - ok(mem != NULL, "VirtualAlloc failed %u\n", GetLastError()); + ok(mem != NULL, "VirtualAlloc failed %lu\n", GetLastError()); if (mem == NULL) break; ret = VirtualFree(mem, 0, MEM_RELEASE); - ok(ret, "VirtualFree failed %u\n", GetLastError()); + ok(ret, "VirtualFree failed %lu\n", GetLastError()); if (!ret) break; } return; @@ -4297,7 +4297,7 @@ START_TEST(virtual) pVirtualAllocFromApp = (void *)GetProcAddress( hkernelbase, "VirtualAllocFromApp" );
GetSystemInfo(&si); - trace("system page size %#x\n", si.dwPageSize); + trace("system page size %#lx\n", si.dwPageSize);
test_shared_memory(FALSE); test_shared_memory_ro(FALSE, FILE_MAP_READ|FILE_MAP_WRITE); diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index 723dfabb817..9166cf228d9 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -74,20 +74,20 @@ static void test_query_dos_deviceA(void) SetLastError(0xdeadbeef); ret = QueryDosDeviceA( NULL, NULL, 0 ); ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "QueryDosDeviceA(no buffer): returned %u, le=%u\n", ret, GetLastError()); + "QueryDosDeviceA(no buffer): returned %lu, le=%lu\n", ret, GetLastError());
buffer = HeapAlloc( GetProcessHeap(), 0, buflen ); SetLastError(0xdeadbeef); ret = QueryDosDeviceA( NULL, buffer, buflen ); ok((ret && GetLastError() != ERROR_INSUFFICIENT_BUFFER), - "QueryDosDeviceA failed to return list, last error %u\n", GetLastError()); + "QueryDosDeviceA failed to return list, last error %lu\n", GetLastError());
if (ret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { p = buffer; for (;;) { if (!*p) break; ret2 = QueryDosDeviceA( p, buffer2, sizeof(buffer2) ); - ok(ret2, "QueryDosDeviceA failed to return current mapping for %s, last error %u\n", p, GetLastError()); + ok(ret2, "QueryDosDeviceA failed to return current mapping for %s, last error %lu\n", p, GetLastError()); p += strlen(p) + 1; if (ret <= (p-buffer)) break; } @@ -97,7 +97,7 @@ static void test_query_dos_deviceA(void) /* Older W2K fails with ERROR_INSUFFICIENT_BUFFER when buflen is > 32767 */ ret = QueryDosDeviceA( drivestr, buffer, buflen - 1); ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, - "QueryDosDeviceA failed to return current mapping for %s, last error %u\n", drivestr, GetLastError()); + "QueryDosDeviceA failed to return current mapping for %s, last error %lu\n", drivestr, GetLastError()); if(ret) { for (p = buffer; *p; p++) *p = toupper(*p); if (strstr(buffer, "HARDDISK") || strstr(buffer, "RAMDISK")) found = TRUE; @@ -127,16 +127,16 @@ static void test_dos_devices(void) }
ret = DefineDosDeviceA( 0, drivestr, "C:/windows/" ); - ok(ret, "failed to define drive %s, error %u\n", drivestr, GetLastError()); + ok(ret, "failed to define drive %s, error %lu\n", drivestr, GetLastError());
ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) ); - ok(ret, "failed to query drive %s, error %u\n", drivestr, GetLastError()); + ok(ret, "failed to query drive %s, error %lu\n", drivestr, GetLastError()); ok(!strcmp(buf, "\??\C:\windows\"), "got path %s\n", debugstr_a(buf));
sprintf(buf, "%s/system32", drivestr); file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - todo_wine ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + todo_wine ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError()); CloseHandle( file );
/* but it's not a volume mount point */ @@ -144,47 +144,47 @@ static void test_dos_devices(void) sprintf(buf, "%s\", drivestr); ret = GetVolumeNameForVolumeMountPointA( buf, buf2, sizeof(buf2) ); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError());
ret = DefineDosDeviceA(DDD_REMOVE_DEFINITION, drivestr, NULL); - ok(ret, "failed to remove drive %s, error %u\n", drivestr, GetLastError()); + ok(ret, "failed to remove drive %s, error %lu\n", drivestr, GetLastError());
ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %lu\n", GetLastError());
sprintf(buf, "%s/system32", drivestr); file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); ok(file == INVALID_HANDLE_VALUE, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_PATH_NOT_FOUND, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_PATH_NOT_FOUND, "got error %lu\n", GetLastError());
/* try with DDD_RAW_TARGET_PATH */
ret = DefineDosDeviceA( DDD_RAW_TARGET_PATH, drivestr, "\??\C:\windows\" ); - ok(ret, "failed to define drive %s, error %u\n", drivestr, GetLastError()); + ok(ret, "failed to define drive %s, error %lu\n", drivestr, GetLastError());
ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) ); - ok(ret, "failed to query drive %s, error %u\n", drivestr, GetLastError()); + ok(ret, "failed to query drive %s, error %lu\n", drivestr, GetLastError()); ok(!strcmp(buf, "\??\C:\windows\"), "got path %s\n", debugstr_a(buf));
sprintf(buf, "%s/system32", drivestr); file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - todo_wine ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + todo_wine ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError()); CloseHandle( file );
sprintf(buf, "%s\", drivestr); ret = GetVolumeNameForVolumeMountPointA( buf, buf2, sizeof(buf2) ); ok(!ret, "expected failure\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError()); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError());
ret = DefineDosDeviceA(DDD_REMOVE_DEFINITION, drivestr, NULL); - ok(ret, "failed to remove drive %s, error %u\n", drivestr, GetLastError()); + ok(ret, "failed to remove drive %s, error %lu\n", drivestr, GetLastError());
ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %lu\n", GetLastError()); }
static void test_FindFirstVolume(void) @@ -202,12 +202,12 @@ static void test_FindFirstVolume(void) ok( handle == INVALID_HANDLE_VALUE, "succeeded with short buffer\n" ); ok( GetLastError() == ERROR_MORE_DATA || /* XP */ GetLastError() == ERROR_FILENAME_EXCED_RANGE, /* Vista */ - "wrong error %u\n", GetLastError() ); + "wrong error %lu\n", GetLastError() ); handle = pFindFirstVolumeA( volume, 49 ); ok( handle == INVALID_HANDLE_VALUE, "succeeded with short buffer\n" ); - ok( GetLastError() == ERROR_FILENAME_EXCED_RANGE, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_FILENAME_EXCED_RANGE, "wrong error %lu\n", GetLastError() ); handle = pFindFirstVolumeA( volume, 51 ); - ok( handle != INVALID_HANDLE_VALUE, "failed err %u\n", GetLastError() ); + ok( handle != INVALID_HANDLE_VALUE, "failed err %lu\n", GetLastError() ); if (handle != INVALID_HANDLE_VALUE) { do @@ -216,7 +216,7 @@ static void test_FindFirstVolume(void) ok( !memcmp( volume, "\\?\Volume{", 11 ), "bad volume name %s\n", volume ); ok( !memcmp( volume + 47, "}\", 2 ), "bad volume name %s\n", volume ); } while (pFindNextVolumeA( handle, volume, MAX_PATH )); - ok( GetLastError() == ERROR_NO_MORE_FILES, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_NO_MORE_FILES, "wrong error %lu\n", GetLastError() ); pFindVolumeClose( handle ); } } @@ -229,14 +229,14 @@ static void test_GetVolumeNameForVolumeMountPointA(void) char temp_path[MAX_PATH];
reti = GetTempPathA(MAX_PATH, temp_path); - ok(reti != 0, "GetTempPathA error %d\n", GetLastError()); + ok(reti != 0, "GetTempPathA error %ld\n", GetLastError()); ok(reti < MAX_PATH, "temp path should fit into MAX_PATH\n");
ret = GetVolumeNameForVolumeMountPointA(path, volume, 0); ok(ret == FALSE, "GetVolumeNameForVolumeMountPointA succeeded\n"); ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE || GetLastError() == ERROR_INVALID_PARAMETER, /* Vista */ - "wrong error, last=%d\n", GetLastError()); + "wrong error, last=%ld\n", GetLastError());
if (0) { /* these crash on XP */ ret = GetVolumeNameForVolumeMountPointA(path, NULL, len); @@ -255,7 +255,7 @@ static void test_GetVolumeNameForVolumeMountPointA(void) /* test with too small buffer */ ret = GetVolumeNameForVolumeMountPointA(path, volume, 10); ok(ret == FALSE && GetLastError() == ERROR_FILENAME_EXCED_RANGE, - "GetVolumeNameForVolumeMountPointA failed, wrong error returned, was %d, should be ERROR_FILENAME_EXCED_RANGE\n", + "GetVolumeNameForVolumeMountPointA failed, wrong error returned, was %ld, should be ERROR_FILENAME_EXCED_RANGE\n", GetLastError());
/* Try on an arbitrary directory */ @@ -264,7 +264,7 @@ static void test_GetVolumeNameForVolumeMountPointA(void) ret = GetVolumeNameForVolumeMountPointA(temp_path, volume, len); ok(ret == FALSE && (GetLastError() == ERROR_NOT_A_REPARSE_POINT || GetLastError() == ERROR_INVALID_FUNCTION), - "GetVolumeNameForVolumeMountPointA failed on %s, last=%d\n", + "GetVolumeNameForVolumeMountPointA failed on %s, last=%ld\n", temp_path, GetLastError());
/* Try on a nonexistent dos drive */ @@ -278,14 +278,14 @@ static void test_GetVolumeNameForVolumeMountPointA(void) path[2] = '\'; ret = GetVolumeNameForVolumeMountPointA(path, volume, len); ok(ret == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND, - "GetVolumeNameForVolumeMountPointA failed on %s, last=%d\n", + "GetVolumeNameForVolumeMountPointA failed on %s, last=%ld\n", path, GetLastError());
/* Try without trailing \ and on a nonexistent dos drive */ path[2] = 0; ret = GetVolumeNameForVolumeMountPointA(path, volume, len); ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME, - "GetVolumeNameForVolumeMountPointA failed on %s, last=%d\n", + "GetVolumeNameForVolumeMountPointA failed on %s, last=%ld\n", path, GetLastError()); } } @@ -300,7 +300,7 @@ static void test_GetVolumeNameForVolumeMountPointW(void) ok(ret == FALSE, "GetVolumeNameForVolumeMountPointW succeeded\n"); ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE || GetLastError() == ERROR_INVALID_PARAMETER, /* Vista */ - "wrong error, last=%d\n", GetLastError()); + "wrong error, last=%ld\n", GetLastError());
if (0) { /* these crash on XP */ ret = GetVolumeNameForVolumeMountPointW(path, NULL, len); @@ -403,34 +403,34 @@ static void test_GetVolumeInformationA(void) /* get windows drive letter and update strings for testing */ result = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); ok(result < sizeof(windowsdir), "windowsdir is abnormally long!\n"); - ok(result != 0, "GetWindowsDirectory: error %d\n", GetLastError()); + ok(result != 0, "GetWindowsDirectory: error %ld\n", GetLastError()); Root_Colon[0] = windowsdir[0]; Root_Slash[0] = windowsdir[0]; Root_UNC[4] = windowsdir[0];
result = GetCurrentDirectoryA(MAX_PATH, currentdir); - ok(result, "GetCurrentDirectory: error %d\n", GetLastError()); + ok(result, "GetCurrentDirectory: error %ld\n", GetLastError()); /* Note that GetCurrentDir yields no trailing slash for subdirs */
/* check for NO error on no trailing \ when current dir is root dir */ ret = SetCurrentDirectoryA(Root_Slash); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError()); ret = GetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA root failed, last error %u\n", GetLastError()); + ok(ret, "GetVolumeInformationA root failed, last error %lu\n", GetLastError());
/* check for error on no trailing \ when current dir is subdir (windows) of queried drive */ ret = SetCurrentDirectoryA(windowsdir); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ret = GetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); ok(!ret && (GetLastError() == ERROR_INVALID_NAME), - "GetVolumeInformationA did%s fail, last error %u\n", ret ? " not":"", GetLastError()); + "GetVolumeInformationA did%s fail, last error %lu\n", ret ? " not":"", GetLastError());
/* reset current directory */ ret = SetCurrentDirectoryA(currentdir); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError());
if (toupper(currentdir[0]) == toupper(windowsdir[0])) { skip("Please re-run from another device than %c:\n", windowsdir[0]); @@ -445,26 +445,26 @@ static void test_GetVolumeInformationA(void) ok(ret, "SetEnvironmentVariable %s failed\n", Root_Env);
ret = SetCurrentDirectoryA(windowsdir); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError()); ret = SetCurrentDirectoryA(currentdir); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError());
/* windows dir is current on the root drive, call fails */ SetLastError(0xdeadbeef); ret = GetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); ok(!ret && (GetLastError() == ERROR_INVALID_NAME), - "GetVolumeInformationA did%s fail, last error %u\n", ret ? " not":"", GetLastError()); + "GetVolumeInformationA did%s fail, last error %lu\n", ret ? " not":"", GetLastError());
/* Try normal drive letter with trailing \ */ ret = GetVolumeInformationA(Root_Slash, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA with \ failed, last error %u\n", GetLastError()); + ok(ret, "GetVolumeInformationA with \ failed, last error %lu\n", GetLastError());
ret = SetCurrentDirectoryA(Root_Slash); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError()); ret = SetCurrentDirectoryA(currentdir); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError());
/* windows dir is STILL CURRENT on root drive; the call fails as before, */ /* proving that SetCurrentDir did not remember the other drive's directory */ @@ -472,7 +472,7 @@ static void test_GetVolumeInformationA(void) ret = GetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); ok(!ret && (GetLastError() == ERROR_INVALID_NAME), - "GetVolumeInformationA did%s fail, last error %u\n", ret ? " not":"", GetLastError()); + "GetVolumeInformationA did%s fail, last error %lu\n", ret ? " not":"", GetLastError());
/* Now C:\ becomes the current directory on drive C: */ ret = SetEnvironmentVariableA(Root_Env, Root_Slash); /* set =C:=C:\ */ @@ -481,42 +481,42 @@ static void test_GetVolumeInformationA(void) /* \ is current on root drive, call succeeds */ ret = GetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA failed, last error %u\n", GetLastError()); + ok(ret, "GetVolumeInformationA failed, last error %lu\n", GetLastError());
/* again, SetCurrentDirectory on another drive does not matter */ ret = SetCurrentDirectoryA(Root_Slash); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError()); ret = SetCurrentDirectoryA(currentdir); - ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ok(ret, "SetCurrentDirectory: error %ld\n", GetLastError());
/* \ is current on root drive, call succeeds */ ret = GetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA failed, last error %u\n", GetLastError()); + ok(ret, "GetVolumeInformationA failed, last error %lu\n", GetLastError()); }
/* try null root directory to return "root of the current directory" */ ret = GetVolumeInformationA(NULL, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA failed on null root dir, last error %u\n", GetLastError()); + ok(ret, "GetVolumeInformationA failed on null root dir, last error %lu\n", GetLastError());
/* Try normal drive letter with trailing \ */ ret = GetVolumeInformationA(Root_Slash, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA failed, root=%s, last error=%u\n", Root_Slash, GetLastError()); + ok(ret, "GetVolumeInformationA failed, root=%s, last error=%lu\n", Root_Slash, GetLastError());
/* try again with drive letter and the "disable parsing" prefix */ SetLastError(0xdeadbeef); ret = GetVolumeInformationA(Root_UNC, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA did%s fail, root=%s, last error=%u\n", ret ? " not":"", Root_UNC, GetLastError()); + ok(ret, "GetVolumeInformationA did%s fail, root=%s, last error=%lu\n", ret ? " not":"", Root_UNC, GetLastError());
/* try again with device name space */ Root_UNC[2] = '.'; SetLastError(0xdeadbeef); ret = GetVolumeInformationA(Root_UNC, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA did%s fail, root=%s, last error=%u\n", ret ? " not":"", Root_UNC, GetLastError()); + ok(ret, "GetVolumeInformationA did%s fail, root=%s, last error=%lu\n", ret ? " not":"", Root_UNC, GetLastError());
/* try again with a directory off the root - should generate error */ if (windowsdir[strlen(windowsdir)-1] != '\') strcat(windowsdir, "\"); @@ -524,14 +524,14 @@ static void test_GetVolumeInformationA(void) ret = GetVolumeInformationA(windowsdir, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); ok(!ret && (GetLastError()==ERROR_DIR_NOT_ROOT), - "GetVolumeInformationA did%s fail, root=%s, last error=%u\n", ret ? " not":"", windowsdir, GetLastError()); + "GetVolumeInformationA did%s fail, root=%s, last error=%lu\n", ret ? " not":"", windowsdir, GetLastError()); /* A subdir with trailing \ yields DIR_NOT_ROOT instead of INVALID_NAME */ if (windowsdir[strlen(windowsdir)-1] == '\') windowsdir[strlen(windowsdir)-1] = 0; SetLastError(0xdeadbeef); ret = GetVolumeInformationA(windowsdir, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); ok(!ret && (GetLastError()==ERROR_INVALID_NAME), - "GetVolumeInformationA did%s fail, root=%s, last error=%u\n", ret ? " not":"", windowsdir, GetLastError()); + "GetVolumeInformationA did%s fail, root=%s, last error=%lu\n", ret ? " not":"", windowsdir, GetLastError());
/* get the unique volume name for the windows drive */ ret = GetVolumeNameForVolumeMountPointA(Root_Slash, volume, MAX_PATH); @@ -540,7 +540,7 @@ static void test_GetVolumeInformationA(void) /* try again with unique volume name */ ret = GetVolumeInformationA(volume, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); - ok(ret, "GetVolumeInformationA failed, root=%s, last error=%u\n", volume, GetLastError()); + ok(ret, "GetVolumeInformationA failed, root=%s, last error=%lu\n", volume, GetLastError()); }
/* Test to check that unique volume name from windows dir mount point */ @@ -559,7 +559,7 @@ static void test_enum_vols(void) /*get windows drive letter and update strings for testing */ ret = GetWindowsDirectoryA( windowsdir, sizeof(windowsdir) ); ok(ret < sizeof(windowsdir), "windowsdir is abnormally long!\n"); - ok(ret != 0, "GetWindowsDirectory: error %d\n", GetLastError()); + ok(ret != 0, "GetWindowsDirectory: error %ld\n", GetLastError()); path[0] = windowsdir[0];
/* get the unique volume name for the windows drive */ @@ -569,7 +569,7 @@ static void test_enum_vols(void)
/* get first unique volume name of list */ hFind = pFindFirstVolumeA( Volume_2, MAX_PATH ); - ok(hFind != INVALID_HANDLE_VALUE, "FindFirstVolume failed, err=%u\n", + ok(hFind != INVALID_HANDLE_VALUE, "FindFirstVolume failed, err=%lu\n", GetLastError());
do @@ -596,7 +596,7 @@ static void test_disk_extents(void) handle = CreateFileA( "\\.\c:", GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); if (handle == INVALID_HANDLE_VALUE) { - win_skip("can't open c: drive %u\n", GetLastError()); + win_skip("can't open c: drive %lu\n", GetLastError()); return; } size = 0; @@ -608,8 +608,8 @@ static void test_disk_extents(void) CloseHandle( handle ); return; } - ok(ret, "DeviceIoControl failed %u\n", GetLastError()); - ok(size == 32, "expected 32, got %u\n", size); + ok(ret, "DeviceIoControl failed %lu\n", GetLastError()); + ok(size == 32, "expected 32, got %lu\n", size); CloseHandle( handle ); }
@@ -627,7 +627,7 @@ static void test_disk_query_property(void) 0, 0); if (handle == INVALID_HANDLE_VALUE) { - win_skip("can't open \\.\PhysicalDrive0 %#x\n", GetLastError()); + win_skip("can't open \\.\PhysicalDrive0 %#lx\n", GetLastError()); return; }
@@ -639,20 +639,20 @@ static void test_disk_query_property(void) NULL); error = GetLastError(); ok(ret, "expect ret %#x, got %#x\n", TRUE, ret); - ok(error == 0xdeadbeef, "expect err %#x, got err %#x\n", 0xdeadbeef, error); - ok(size == sizeof(header), "got size %d\n", size); - ok(header.Version == sizeof(descriptor), "got header.Version %d\n", header.Version); - ok(header.Size >= sizeof(descriptor), "got header.Size %d\n", header.Size); + ok(error == 0xdeadbeef, "expect err %#x, got err %#lx\n", 0xdeadbeef, error); + ok(size == sizeof(header), "got size %ld\n", size); + ok(header.Version == sizeof(descriptor), "got header.Version %ld\n", header.Version); + ok(header.Size >= sizeof(descriptor), "got header.Size %ld\n", header.Size);
SetLastError(0xdeadbeef); ret = DeviceIoControl(handle, IOCTL_STORAGE_QUERY_PROPERTY, &query, sizeof(query), &descriptor, sizeof(descriptor), &size, NULL); error = GetLastError(); ok(ret, "expect ret %#x, got %#x\n", TRUE, ret); - ok(error == 0xdeadbeef, "expect err %#x, got err %#x\n", 0xdeadbeef, error); - ok(size == sizeof(descriptor), "got size %d\n", size); - ok(descriptor.Version == sizeof(descriptor), "got descriptor.Version %d\n", descriptor.Version); - ok(descriptor.Size >= sizeof(descriptor), "got descriptor.Size %d\n", descriptor.Size); + ok(error == 0xdeadbeef, "expect err %#x, got err %#lx\n", 0xdeadbeef, error); + ok(size == sizeof(descriptor), "got size %ld\n", size); + ok(descriptor.Version == sizeof(descriptor), "got descriptor.Version %ld\n", descriptor.Version); + ok(descriptor.Size >= sizeof(descriptor), "got descriptor.Size %ld\n", descriptor.Size);
CloseHandle(handle); } @@ -844,7 +844,7 @@ static void test_GetVolumePathNameA(void) { /* On success Windows always returns ERROR_MORE_DATA, so only worry about failure */ success = (error == test_paths[i].error || broken(error == test_paths[i].broken_error)); - ok(success, "GetVolumePathName test %d unexpectedly returned error 0x%x (expected 0x%x).\n", + ok(success, "GetVolumePathName test %d unexpectedly returned error 0x%lx (expected 0x%lx).\n", i, error, test_paths[i].error); }
@@ -854,14 +854,14 @@ static void test_GetVolumePathNameA(void) }
ret = GetCurrentDirectoryA( sizeof(cwd), cwd ); - ok(ret, "Failed to obtain the current working directory, error %u.\n", GetLastError()); + ok(ret, "Failed to obtain the current working directory, error %lu.\n", GetLastError()); ret = GetVolumePathNameA( cwd, expect_path, sizeof(expect_path) ); - ok(ret, "Failed to obtain the current volume path, error %u.\n", GetLastError()); + ok(ret, "Failed to obtain the current volume path, error %lu.\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(relative_tests); i++) { ret = GetVolumePathNameA( relative_tests[i], volume_path, sizeof(volume_path) ); - ok(ret, "GetVolumePathName(%s) failed unexpectedly, error %u.\n", + ok(ret, "GetVolumePathName(%s) failed unexpectedly, error %lu.\n", debugstr_a( relative_tests[i] ), GetLastError()); ok(!strcmp( volume_path, expect_path ), "%s: expected %s, got %s.\n", debugstr_a( relative_tests[i] ), debugstr_a( expect_path ), debugstr_a( volume_path )); @@ -871,27 +871,27 @@ static void test_GetVolumePathNameA(void) for (i = 0; i < ARRAY_SIZE(global_prefix_tests); i++) { ret = GetVolumePathNameA( global_prefix_tests[i], volume_path, sizeof(volume_path) ); - ok(ret, "GetVolumePathName(%s) failed unexpectedly, error %u.\n", + ok(ret, "GetVolumePathName(%s) failed unexpectedly, error %lu.\n", debugstr_a( global_prefix_tests[i] ), GetLastError()); ok(!strcmp( volume_path, cwd ), "%s: expected %s, got %s.\n", debugstr_a( global_prefix_tests[i] ), debugstr_a( cwd ), debugstr_a( volume_path )); }
ret = GetVolumePathNameA( "C:.", expect_path, sizeof(expect_path) ); - ok(ret, "Failed to obtain the volume path, error %u.\n", GetLastError()); + ok(ret, "Failed to obtain the volume path, error %lu.\n", GetLastError());
SetLastError( 0xdeadbeef ); ret = GetVolumePathNameA( "C::", volume_path, 1 ); ok(!ret, "Expected failure.\n"); - ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "Got error %u.\n", GetLastError()); + ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "Got error %lu.\n", GetLastError());
ret = GetVolumePathNameA( "C::", volume_path, sizeof(volume_path) ); - ok(ret, "Failed to obtain the volume path, error %u.\n", GetLastError()); + ok(ret, "Failed to obtain the volume path, error %lu.\n", GetLastError()); ok(!strcmp(volume_path, expect_path), "Expected %s, got %s.\n", debugstr_a( expect_path ), debugstr_a( volume_path ));
ret = GetVolumePathNameA( "C:ABC:DEF:\AnInvalidFolder", volume_path, sizeof(volume_path) ); - ok(ret, "Failed to obtain the volume path, error %u.\n", GetLastError()); + ok(ret, "Failed to obtain the volume path, error %lu.\n", GetLastError()); ok(!strcmp(volume_path, expect_path), "Expected %s, got %s.\n", debugstr_a( expect_path ), debugstr_a( volume_path )); } @@ -905,7 +905,7 @@ static void test_GetVolumePathNameW(void) volume_path[1] = 0x11; ret = GetVolumePathNameW( L"C:\", volume_path, 1 ); ok(!ret, "GetVolumePathNameW test succeeded unexpectedly.\n"); - ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "GetVolumePathNameW unexpectedly returned error 0x%x (expected 0x%x).\n", + ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "GetVolumePathNameW unexpectedly returned error 0x%lx (expected 0x%x).\n", GetLastError(), ERROR_FILENAME_EXCED_RANGE); ok(volume_path[1] == 0x11, "GetVolumePathW corrupted byte after end of buffer.\n");
@@ -913,7 +913,7 @@ static void test_GetVolumePathNameW(void) volume_path[2] = 0x11; ret = GetVolumePathNameW( L"C:\", volume_path, 2 ); ok(!ret, "GetVolumePathNameW test succeeded unexpectedly.\n"); - ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "GetVolumePathNameW unexpectedly returned error 0x%x (expected 0x%x).\n", + ok(GetLastError() == ERROR_FILENAME_EXCED_RANGE, "GetVolumePathNameW unexpectedly returned error 0x%lx (expected 0x%x).\n", GetLastError(), ERROR_FILENAME_EXCED_RANGE); ok(volume_path[2] == 0x11, "GetVolumePathW corrupted byte after end of buffer.\n");
@@ -946,36 +946,36 @@ static void test_GetVolumePathNamesForVolumeNameA(void) }
ret = GetVolumeNameForVolumeMountPointA( "c:\", volume, sizeof(volume) ); - ok(ret, "failed to get volume name %u\n", GetLastError()); + ok(ret, "failed to get volume name %lu\n", GetLastError()); trace("c:\ -> %s\n", volume);
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( NULL, NULL, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( "", NULL, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( volume, NULL, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %u\n", error); + ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( volume, buffer, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %u\n", error); + ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %lu\n", error);
memset( buffer, 0xff, sizeof(buffer) ); ret = pGetVolumePathNamesForVolumeNameA( volume, buffer, sizeof(buffer), NULL ); - ok(ret, "failed to get path names %u\n", GetLastError()); + ok(ret, "failed to get path names %lu\n", GetLastError()); ok(!strcmp( "C:\", buffer ), "expected "\C:" got "%s"\n", buffer); ok(!buffer[4], "expected double null-terminated buffer\n");
@@ -984,34 +984,34 @@ static void test_GetVolumePathNamesForVolumeNameA(void) ret = pGetVolumePathNamesForVolumeNameA( NULL, NULL, 0, &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
len = 0; SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( NULL, NULL, sizeof(buffer), &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
len = 0; SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( NULL, buffer, sizeof(buffer), &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
len = 0; SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameA( NULL, buffer, sizeof(buffer), &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
len = 0; memset( buffer, 0xff, sizeof(buffer) ); ret = pGetVolumePathNamesForVolumeNameA( volume, buffer, sizeof(buffer), &len ); - ok(ret, "failed to get path names %u\n", GetLastError()); - ok(len == 5 || broken(len == 2), "expected 5 got %u\n", len); + ok(ret, "failed to get path names %lu\n", GetLastError()); + ok(len == 5 || broken(len == 2), "expected 5 got %lu\n", len); ok(!strcmp( "C:\", buffer ), "expected "\C:" got "%s"\n", buffer); ok(!buffer[4], "expected double null-terminated buffer\n"); } @@ -1034,39 +1034,39 @@ static void test_GetVolumePathNamesForVolumeNameW(void) }
ret = GetVolumeNameForVolumeMountPointW( drive_c, volume, ARRAY_SIZE(volume) ); - ok(ret, "failed to get volume name %u\n", GetLastError()); + ok(ret, "failed to get volume name %lu\n", GetLastError());
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameW( empty, NULL, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameW( volume, NULL, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %u\n", error); + ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %lu\n", error);
SetLastError( 0xdeadbeef ); ret = pGetVolumePathNamesForVolumeNameW( volume, buffer, 0, NULL ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %u\n", error); + ok(error == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %lu\n", error);
if (0) { /* crash */ ret = pGetVolumePathNamesForVolumeNameW( volume, NULL, ARRAY_SIZE(buffer), NULL ); - ok(ret, "failed to get path names %u\n", GetLastError()); + ok(ret, "failed to get path names %lu\n", GetLastError()); }
ret = pGetVolumePathNamesForVolumeNameW( volume, buffer, ARRAY_SIZE(buffer), NULL ); - ok(ret, "failed to get path names %u\n", GetLastError()); + ok(ret, "failed to get path names %lu\n", GetLastError());
len = 0; memset( buffer, 0xff, sizeof(buffer) ); ret = pGetVolumePathNamesForVolumeNameW( volume, buffer, ARRAY_SIZE(buffer), &len ); - ok(ret, "failed to get path names %u\n", GetLastError()); - ok(len == 5, "expected 5 got %u\n", len); + ok(ret, "failed to get path names %lu\n", GetLastError()); + ok(len == 5, "expected 5 got %lu\n", len); ok(!buffer[4], "expected double null-terminated buffer\n");
len = 0; @@ -1076,7 +1076,7 @@ static void test_GetVolumePathNamesForVolumeNameW(void) ret = pGetVolumePathNamesForVolumeNameW( volume, buffer, ARRAY_SIZE(buffer), &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %u\n", error); + ok(error == ERROR_INVALID_NAME, "expected ERROR_INVALID_NAME got %lu\n", error);
len = 0; volume[0] = '\'; @@ -1085,7 +1085,7 @@ static void test_GetVolumePathNamesForVolumeNameW(void) ret = pGetVolumePathNamesForVolumeNameW( volume, buffer, ARRAY_SIZE(buffer), &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - todo_wine ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", error); + todo_wine ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", error);
len = 0; lstrcpyW( volume, volume_null ); @@ -1093,7 +1093,7 @@ static void test_GetVolumePathNamesForVolumeNameW(void) ret = pGetVolumePathNamesForVolumeNameW( volume, buffer, ARRAY_SIZE(buffer), &len ); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND got %u\n", error); + ok(error == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND got %lu\n", error); }
static void test_dvd_read_structure(HANDLE handle) @@ -1123,7 +1123,7 @@ static void test_dvd_read_structure(HANDLE handle)
if(!ret) { - skip("IOCTL_DVD_READ_STRUCTURE not supported: %u\n", GetLastError()); + skip("IOCTL_DVD_READ_STRUCTURE not supported: %lu\n", GetLastError()); return; }
@@ -1180,7 +1180,7 @@ static void test_dvd_read_structure(HANDLE handle) /* Strangely, with NULL lpOutBuffer, last error is insufficient buffer, not invalid parameter as we could expect */ ret = DeviceIoControl(handle, IOCTL_DVD_READ_STRUCTURE, &dvdReadStructure, sizeof(DVD_READ_STRUCTURE), NULL, sizeof(DVD_COPYRIGHT_DESCRIPTOR), &nbBytes, NULL); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "IOCTL_DVD_READ_STRUCTURE should have failed %d %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "IOCTL_DVD_READ_STRUCTURE should have failed %d %lu\n", ret, GetLastError());
for(i=0; i<sizeof(DVD_COPYRIGHT_DESCRIPTOR); i++) { @@ -1188,7 +1188,7 @@ static void test_dvd_read_structure(HANDLE handle)
ret = DeviceIoControl(handle, IOCTL_DVD_READ_STRUCTURE, &dvdReadStructure, sizeof(DVD_READ_STRUCTURE), &dvdCopyrightDescriptor, i, &nbBytes, NULL); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "IOCTL_DVD_READ_STRUCTURE should have failed %d %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "IOCTL_DVD_READ_STRUCTURE should have failed %d %lu\n", ret, GetLastError()); }
@@ -1200,7 +1200,7 @@ static void test_dvd_read_structure(HANDLE handle) ret = DeviceIoControl(handle, IOCTL_DVD_READ_STRUCTURE, &dvdReadStructure, sizeof(DVD_READ_STRUCTURE), &completeDvdManufacturerDescriptor, sizeof(DVD_MANUFACTURER_DESCRIPTOR), &nbBytes, NULL); ok(ret || broken(GetLastError() == ERROR_NOT_READY), - "IOCTL_DVD_READ_STRUCTURE (DvdManufacturerDescriptor) failed, last error = %u\n", GetLastError()); + "IOCTL_DVD_READ_STRUCTURE (DvdManufacturerDescriptor) failed, last error = %lu\n", GetLastError()); if(!ret) return;
@@ -1214,7 +1214,7 @@ static void test_dvd_read_structure(HANDLE handle) /* Basic parameter check */ ret = DeviceIoControl(handle, IOCTL_DVD_READ_STRUCTURE, &dvdReadStructure, sizeof(DVD_READ_STRUCTURE), NULL, sizeof(DVD_MANUFACTURER_DESCRIPTOR), &nbBytes, NULL); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "IOCTL_DVD_READ_STRUCTURE should have failed %d %u\n", ret, GetLastError()); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "IOCTL_DVD_READ_STRUCTURE should have failed %d %lu\n", ret, GetLastError()); }
static void test_cdrom_ioctl(void) @@ -1226,7 +1226,7 @@ static void test_cdrom_ioctl(void) bitmask = GetLogicalDrives(); if(!bitmask) { - trace("GetLogicalDrives failed : %u\n", GetLastError()); + trace("GetLogicalDrives failed : %lu\n", GetLastError()); return; }
@@ -1248,7 +1248,7 @@ static void test_cdrom_ioctl(void) handle = CreateFileA(drive_full_path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); if(handle == INVALID_HANDLE_VALUE) { - trace("Failed to open the device : %u\n", GetLastError()); + trace("Failed to open the device : %lu\n", GetLastError()); continue; }
@@ -1273,25 +1273,25 @@ static void test_mounted_folder(void)
file = CreateFileA( "C:\", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, &info, sizeof(info), FileAttributeTagInformation ); - ok(!status, "got status %#x\n", status); + ok(!status, "got status %#lx\n", status); ok(!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", info.FileAttributes); - ok(!info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag); + && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#lx\n", info.FileAttributes); + ok(!info.ReparseTag, "got reparse tag %#lx\n", info.ReparseTag);
CloseHandle( file );
file = CreateFileA( "C:\", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, &info, sizeof(info), FileAttributeTagInformation ); - ok(!status, "got status %#x\n", status); + ok(!status, "got status %#lx\n", status); ok(!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", info.FileAttributes); - ok(!info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag); + && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#lx\n", info.FileAttributes); + ok(!info.ReparseTag, "got reparse tag %#lx\n", info.ReparseTag);
CloseHandle( file );
@@ -1304,10 +1304,10 @@ static void test_mounted_folder(void) skip("Not enough permissions to create a folder in the C: drive.\n"); return; } - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = GetVolumeNameForVolumeMountPointA( "C:\", volume_name, sizeof(volume_name) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = SetVolumeMountPointA( "C:\winetest_mnt\", volume_name ); if (!ret) @@ -1316,21 +1316,21 @@ static void test_mounted_folder(void) RemoveDirectoryA( "C:\winetest_mnt" ); return; } - todo_wine ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(ret, "got error %lu\n", GetLastError());
file = CreateFileA( "C:\winetest_mnt", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, &info, sizeof(info), FileAttributeTagInformation ); - ok(!status, "got status %#x\n", status); + ok(!status, "got status %#lx\n", status); ok((info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", info.FileAttributes); - ok(info.ReparseTag == IO_REPARSE_TAG_MOUNT_POINT, "got reparse tag %#x\n", info.ReparseTag); + && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#lx\n", info.FileAttributes); + ok(info.ReparseTag == IO_REPARSE_TAG_MOUNT_POINT, "got reparse tag %#lx\n", info.ReparseTag);
status = NtQueryInformationFile( file, &io, name, sizeof(name_buffer), FileNameInformation ); - ok(!status, "got status %#x\n", status); - ok(name->FileNameLength == wcslen(L"\winetest_mnt") * sizeof(WCHAR), "got length %u\n", name->FileNameLength); + ok(!status, "got status %#lx\n", status); + ok(name->FileNameLength == wcslen(L"\winetest_mnt") * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); ok(!wcsnicmp(name->FileName, L"\winetest_mnt", wcslen(L"\winetest_mnt")), "got name %s\n", debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR)));
@@ -1338,100 +1338,100 @@ static void test_mounted_folder(void)
file = CreateFileA( "C:\winetest_mnt", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, &info, sizeof(info), FileAttributeTagInformation ); - ok(!status, "got status %#x\n", status); + ok(!status, "got status %#lx\n", status); ok(!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", info.FileAttributes); - ok(!info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag); + && (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#lx\n", info.FileAttributes); + ok(!info.ReparseTag, "got reparse tag %#lx\n", info.ReparseTag);
status = NtQueryInformationFile( file, &io, name, sizeof(name_buffer), FileNameInformation ); - ok(!status, "got status %#x\n", status); - ok(name->FileNameLength == wcslen(L"\") * sizeof(WCHAR), "got length %u\n", name->FileNameLength); + ok(!status, "got status %#lx\n", status); + ok(name->FileNameLength == wcslen(L"\") * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); ok(!wcsnicmp(name->FileName, L"\", wcslen(L"\")), "got name %s\n", debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR)));
CloseHandle( file );
ret = GetFileAttributesA( "C:\winetest_mnt" ); - ok(ret != INVALID_FILE_ATTRIBUTES, "got error %u\n", GetLastError()); + ok(ret != INVALID_FILE_ATTRIBUTES, "got error %lu\n", GetLastError()); ok((ret & FILE_ATTRIBUTE_REPARSE_POINT) && (ret & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", ret);
file = CreateFileA( "C:\winetest_mnt\windows", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, name, sizeof(name_buffer), FileNameInformation ); - ok(!status, "got status %#x\n", status); - ok(name->FileNameLength == wcslen(L"\windows") * sizeof(WCHAR), "got length %u\n", name->FileNameLength); + ok(!status, "got status %#lx\n", status); + ok(name->FileNameLength == wcslen(L"\windows") * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); ok(!wcsnicmp(name->FileName, L"\windows", wcslen(L"\windows")), "got name %s\n", debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR)));
CloseHandle( file );
ret = GetVolumePathNameA( "C:\winetest_mnt", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\winetest_mnt\"), "got %s\n", debugstr_a(path)); SetLastError(0xdeadbeef); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_mnt", path, sizeof(path) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ret = GetVolumeInformationA( "C:\winetest_mnt", NULL, 0, NULL, NULL, NULL, NULL, 0 ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_NAME, "wrong error %lu\n", GetLastError());
ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_mnt\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, volume_name), "expected %s, got %s\n", debugstr_a(volume_name), debugstr_a(path)); ret = GetVolumeInformationA( "C:\winetest_mnt\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:\winetest_mnt\windows", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\winetest_mnt\"), "got %s\n", debugstr_a(path)); SetLastError(0xdeadbeef); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_mnt\windows\", path, sizeof(path) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_NOT_A_REPARSE_POINT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_NOT_A_REPARSE_POINT, "wrong error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ret = GetVolumeInformationA( "C:\winetest_mnt\windows\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_DIR_NOT_ROOT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_DIR_NOT_ROOT, "wrong error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:\winetest_mnt\nonexistent\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\winetest_mnt\"), "got %s\n", debugstr_a(path)); SetLastError(0xdeadbeef); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_mnt\nonexistent\", path, sizeof(path) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ret = GetVolumeInformationA( "C:\winetest_mnt\nonexistent\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:\winetest_mnt\winetest_mnt", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\winetest_mnt\winetest_mnt\"), "got %s\n", debugstr_a(path)); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_mnt\winetest_mnt\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, volume_name), "expected %s, got %s\n", debugstr_a(volume_name), debugstr_a(path)); ret = GetVolumeInformationA( "C:\winetest_mnt\winetest_mnt\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:/winetest_mnt/../winetest_mnt/.", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\winetest_mnt\"), "got %s\n", debugstr_a(path)); ret = GetVolumeNameForVolumeMountPointA( "C:/winetest_mnt/../winetest_mnt/.\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, volume_name), "expected %s, got %s\n", debugstr_a(volume_name), debugstr_a(path)); ret = GetVolumeInformationA( "C:/winetest_mnt/../winetest_mnt/.\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = GetVolumePathNamesForVolumeNameA( volume_name, path, sizeof(path), &size ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); got_path = FALSE; for (p = path; *p; p += strlen(p) + 1) { @@ -1446,62 +1446,62 @@ static void test_mounted_folder(void) if (pCreateSymbolicLinkA) { ret = pCreateSymbolicLinkA( "C:\winetest_link", "C:\winetest_mnt\", SYMBOLIC_LINK_FLAG_DIRECTORY ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:\winetest_link\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\"), "got %s\n", path); SetLastError(0xdeadbeef); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_link\", path, sizeof(path) ); ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER - || broken(GetLastError() == ERROR_SUCCESS) /* 2008 */, "wrong error %u\n", GetLastError()); + || broken(GetLastError() == ERROR_SUCCESS) /* 2008 */, "wrong error %lu\n", GetLastError()); ret = GetVolumeInformationA( "C:\winetest_link\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:\winetest_link\windows\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\"), "got %s\n", path); SetLastError(0xdeadbeef); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_link\windows\", path, sizeof(path) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_NOT_A_REPARSE_POINT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_NOT_A_REPARSE_POINT, "wrong error %lu\n", GetLastError()); SetLastError(0xdeadbeef); ret = GetVolumeInformationA( "C:\winetest_link\windows\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_DIR_NOT_ROOT, "wrong error %u\n", GetLastError()); + ok(GetLastError() == ERROR_DIR_NOT_ROOT, "wrong error %lu\n", GetLastError());
ret = GetVolumePathNameA( "C:\winetest_link\winetest_mnt", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\winetest_link\winetest_mnt\"), "got %s\n", debugstr_a(path)); ret = GetVolumeNameForVolumeMountPointA( "C:\winetest_link\winetest_mnt\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, volume_name), "expected %s, got %s\n", debugstr_a(volume_name), debugstr_a(path)); ret = GetVolumeInformationA( "C:\winetest_link\winetest_mnt\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
/* The following test makes it clear that when we encounter a symlink * while resolving, we resolve *every* junction in the path, i.e. both * mount points and symlinks. */ ret = GetVolumePathNameA( "C:\winetest_link\winetest_mnt\winetest_link\windows\", path, sizeof(path) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ok(!strcmp(path, "C:\") || !strcmp(path, "C:\winetest_link\winetest_mnt\") /* 2008 */, "got %s\n", debugstr_a(path));
file = CreateFileA( "C:\winetest_link\winetest_mnt\winetest_link\windows\", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError());
status = NtQueryInformationFile( file, &io, name, sizeof(name_buffer), FileNameInformation ); - ok(!status, "got status %#x\n", status); - ok(name->FileNameLength == wcslen(L"\windows") * sizeof(WCHAR), "got length %u\n", name->FileNameLength); + ok(!status, "got status %#lx\n", status); + ok(name->FileNameLength == wcslen(L"\windows") * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); ok(!wcsnicmp(name->FileName, L"\windows", wcslen(L"\windows")), "got name %s\n", debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR)));
CloseHandle( file );
ret = RemoveDirectoryA( "C:\winetest_link\" ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
/* The following cannot be automatically tested: * @@ -1513,9 +1513,9 @@ static void test_mounted_folder(void) }
ret = DeleteVolumeMountPointA( "C:\winetest_mnt\" ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); ret = RemoveDirectoryA( "C:\winetest_mnt" ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError()); }
static void test_GetVolumeInformationByHandle(void) @@ -1539,47 +1539,47 @@ static void test_GetVolumeInformationByHandle(void)
file = CreateFileA( "C:/windows", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = pGetVolumeInformationByHandleW( INVALID_HANDLE_VALUE, label, ARRAY_SIZE(label), &serial, &filename_len, &flags, fsname, ARRAY_SIZE(fsname) ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got error %lu\n", GetLastError());
ret = pGetVolumeInformationByHandleW( file, NULL, 0, NULL, NULL, NULL, NULL, 0 ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
ret = pGetVolumeInformationByHandleW( file, label, ARRAY_SIZE(label), &serial, &filename_len, &flags, fsname, ARRAY_SIZE(fsname) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
memset(buffer, 0, sizeof(buffer)); status = NtQueryVolumeInformationFile( file, &io, buffer, sizeof(buffer), FileFsAttributeInformation ); - ok(!status, "got status %#x\n", status); - ok(flags == attr_info->FileSystemAttributes, "expected flags %#x, got %#x\n", + ok(!status, "got status %#lx\n", status); + ok(flags == attr_info->FileSystemAttributes, "expected flags %#lx, got %#lx\n", attr_info->FileSystemAttributes, flags); - ok(filename_len == attr_info->MaximumComponentNameLength, "expected filename_len %u, got %u\n", + ok(filename_len == attr_info->MaximumComponentNameLength, "expected filename_len %lu, got %lu\n", attr_info->MaximumComponentNameLength, filename_len); ok(!wcscmp( fsname, attr_info->FileSystemName ), "expected fsname %s, got %s\n", debugstr_w( attr_info->FileSystemName ), debugstr_w( fsname )); ok(wcslen( fsname ) == attr_info->FileSystemNameLength / sizeof(WCHAR), - "expected fsname length %u, got %u\n", attr_info->FileSystemNameLength / sizeof(WCHAR), wcslen( fsname )); + "expected fsname length %Iu, got %Iu\n", attr_info->FileSystemNameLength / sizeof(WCHAR), wcslen( fsname ));
SetLastError(0xdeadbeef); ret = pGetVolumeInformationByHandleW( file, NULL, 0, NULL, &filename_len, &flags, fsname, 2 ); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_BAD_LENGTH, "got error %u\n", GetLastError()); + ok(GetLastError() == ERROR_BAD_LENGTH, "got error %lu\n", GetLastError());
memset(buffer, 0, sizeof(buffer)); status = NtQueryVolumeInformationFile( file, &io, buffer, sizeof(buffer), FileFsVolumeInformation ); - ok(!status, "got status %#x\n", status); - ok(serial == volume_info->VolumeSerialNumber, "expected serial %08x, got %08x\n", + ok(!status, "got status %#lx\n", status); + ok(serial == volume_info->VolumeSerialNumber, "expected serial %08lx, got %08lx\n", volume_info->VolumeSerialNumber, serial); ok(!wcscmp( label, volume_info->VolumeLabel ), "expected label %s, got %s\n", debugstr_w( volume_info->VolumeLabel ), debugstr_w( label )); ok(wcslen( label ) == volume_info->VolumeLabelLength / sizeof(WCHAR), - "expected label length %u, got %u\n", volume_info->VolumeLabelLength / sizeof(WCHAR), wcslen( label )); + "expected label length %Iu, got %Iu\n", volume_info->VolumeLabelLength / sizeof(WCHAR), wcslen( label ));
CloseHandle( file );
@@ -1591,33 +1591,33 @@ static void test_GetVolumeInformationByHandle(void)
file = CreateFileA( volume, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); - ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %lu\n", GetLastError());
ret = pGetVolumeInformationByHandleW( file, label, ARRAY_SIZE(label), &serial, &filename_len, &flags, fsname, ARRAY_SIZE(fsname) ); - ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %lu\n", GetLastError());
memset(buffer, 0, sizeof(buffer)); status = NtQueryVolumeInformationFile( file, &io, buffer, sizeof(buffer), FileFsVolumeInformation ); - ok(!status, "got status %#x\n", status); - ok(serial == volume_info->VolumeSerialNumber, "expected serial %08x, got %08x\n", + ok(!status, "got status %#lx\n", status); + ok(serial == volume_info->VolumeSerialNumber, "expected serial %08lx, got %08lx\n", volume_info->VolumeSerialNumber, serial); ok(!wcscmp( label, volume_info->VolumeLabel ), "expected label %s, got %s\n", debugstr_w( volume_info->VolumeLabel ), debugstr_w( label )); ok(wcslen( label ) == volume_info->VolumeLabelLength / sizeof(WCHAR), - "expected label length %u, got %u\n", volume_info->VolumeLabelLength / sizeof(WCHAR), wcslen( label )); + "expected label length %Iu, got %Iu\n", volume_info->VolumeLabelLength / sizeof(WCHAR), wcslen( label ));
memset(buffer, 0, sizeof(buffer)); status = NtQueryVolumeInformationFile( file, &io, buffer, sizeof(buffer), FileFsAttributeInformation ); - ok(!status, "got status %#x\n", status); - ok(flags == attr_info->FileSystemAttributes, "expected flags %#x, got %#x\n", + ok(!status, "got status %#lx\n", status); + ok(flags == attr_info->FileSystemAttributes, "expected flags %#lx, got %#lx\n", attr_info->FileSystemAttributes, flags); - ok(filename_len == attr_info->MaximumComponentNameLength, "expected filename_len %u, got %u\n", + ok(filename_len == attr_info->MaximumComponentNameLength, "expected filename_len %lu, got %lu\n", attr_info->MaximumComponentNameLength, filename_len); ok(!wcscmp( fsname, attr_info->FileSystemName ), "expected fsname %s, got %s\n", debugstr_w( attr_info->FileSystemName ), debugstr_w( fsname )); ok(wcslen( fsname ) == attr_info->FileSystemNameLength / sizeof(WCHAR), - "expected fsname length %u, got %u\n", attr_info->FileSystemNameLength / sizeof(WCHAR), wcslen( fsname )); + "expected fsname length %Iu, got %Iu\n", attr_info->FileSystemNameLength / sizeof(WCHAR), wcslen( fsname ));
CloseHandle( file ); } @@ -1634,14 +1634,14 @@ static void test_mountmgr_query_points(void) output = malloc(1024);
file = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, 0, 0, NULL, OPEN_EXISTING, 0, NULL ); - ok(file != INVALID_HANDLE_VALUE, "failed to open mountmgr, error %u\n", GetLastError()); + ok(file != INVALID_HANDLE_VALUE, "failed to open mountmgr, error %lu\n", GetLastError());
io.Status = 0xdeadf00d; io.Information = 0xdeadf00d; status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, NULL, 0, NULL, 0 ); - ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); + ok(io.Status == 0xdeadf00d, "got status %#lx\n", io.Status); ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information);
memset( input, 0, sizeof(*input) ); @@ -1650,16 +1650,16 @@ static void test_mountmgr_query_points(void) io.Information = 0xdeadf00d; status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input) - 1, NULL, 0 ); - ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); + ok(io.Status == 0xdeadf00d, "got status %#lx\n", io.Status); ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information);
io.Status = 0xdeadf00d; io.Information = 0xdeadf00d; status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input), NULL, 0 ); - ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); + ok(io.Status == 0xdeadf00d, "got status %#lx\n", io.Status); ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information);
io.Status = 0xdeadf00d; @@ -1667,23 +1667,23 @@ static void test_mountmgr_query_points(void) memset(output, 0xcc, sizeof(*output)); status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input), output, sizeof(*output) - 1 ); - ok(status == STATUS_INVALID_PARAMETER, "got %#x\n", status); - ok(io.Status == 0xdeadf00d, "got status %#x\n", io.Status); + ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); + ok(io.Status == 0xdeadf00d, "got status %#lx\n", io.Status); ok(io.Information == 0xdeadf00d, "got information %#Ix\n", io.Information); - ok(output->Size == 0xcccccccc, "got size %u\n", output->Size); - ok(output->NumberOfMountPoints == 0xcccccccc, "got count %u\n", output->NumberOfMountPoints); + ok(output->Size == 0xcccccccc, "got size %lu\n", output->Size); + ok(output->NumberOfMountPoints == 0xcccccccc, "got count %lu\n", output->NumberOfMountPoints);
io.Status = 0xdeadf00d; io.Information = 0xdeadf00d; memset(output, 0xcc, sizeof(*output)); status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input), output, sizeof(*output) ); - ok(status == STATUS_BUFFER_OVERFLOW, "got %#x\n", status); - ok(io.Status == STATUS_BUFFER_OVERFLOW, "got status %#x\n", io.Status); + ok(status == STATUS_BUFFER_OVERFLOW, "got %#lx\n", status); + ok(io.Status == STATUS_BUFFER_OVERFLOW, "got status %#lx\n", io.Status); todo_wine ok(io.Information == offsetof(MOUNTMGR_MOUNT_POINTS, MountPoints[0]), "got information %#Ix\n", io.Information); - ok(output->Size > offsetof(MOUNTMGR_MOUNT_POINTS, MountPoints[0]), "got size %u\n", output->Size); + ok(output->Size > offsetof(MOUNTMGR_MOUNT_POINTS, MountPoints[0]), "got size %lu\n", output->Size); todo_wine ok(output->NumberOfMountPoints && output->NumberOfMountPoints != 0xcccccccc, - "got count %u\n", output->NumberOfMountPoints); + "got count %lu\n", output->NumberOfMountPoints);
output = realloc(output, output->Size);
@@ -1691,12 +1691,12 @@ static void test_mountmgr_query_points(void) io.Information = 0xdeadf00d; status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io, IOCTL_MOUNTMGR_QUERY_POINTS, input, sizeof(*input), output, output->Size ); - ok(!status, "got %#x\n", status); - ok(!io.Status, "got status %#x\n", io.Status); - ok(io.Information == output->Size, "got size %u, information %#Ix\n", output->Size, io.Information); - ok(output->Size > offsetof(MOUNTMGR_MOUNT_POINTS, MountPoints[0]), "got size %u\n", output->Size); + ok(!status, "got %#lx\n", status); + ok(!io.Status, "got status %#lx\n", io.Status); + ok(io.Information == output->Size, "got size %lu, information %#Ix\n", output->Size, io.Information); + ok(output->Size > offsetof(MOUNTMGR_MOUNT_POINTS, MountPoints[0]), "got size %lu\n", output->Size); ok(output->NumberOfMountPoints && output->NumberOfMountPoints != 0xcccccccc, - "got count %u\n", output->NumberOfMountPoints); + "got count %lu\n", output->NumberOfMountPoints);
CloseHandle( file );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=109434
Your paranoid android.
=== w7u_el (32 bit report) ===
kernel32: comm.c:886: Test failed: WaitCommEvent used 1514 ms for waiting
=== w8adm (32 bit report) ===
kernel32: comm.c:886: Test failed: WaitCommEvent used 1531 ms for waiting
=== w1064v1507 (32 bit report) ===
kernel32: comm.c:859: Test failed: WaitCommEvent failed with a timeout comm.c:880: Test failed: WaitCommEvent error 0 comm.c:881: Test failed: WaitCommEvent: expected EV_TXEMPTY, got 0 comm.c:886: Test failed: WaitCommEvent used 1500 ms for waiting
=== w10pro64_zh_CN (64 bit report) ===
kernel32: comm.c:886: Test failed: WaitCommEvent used 1531 ms for waiting
=== w7u_2qxl (32 bit report) ===
kernel32: debugger.c:1027: Test failed: ole32.dll was not reported
=== w7u_adm (32 bit report) ===
kernel32: debugger.c:1027: Test failed: ole32.dll was not reported
=== w7u_el (32 bit report) ===
kernel32: debugger.c:1027: Test failed: ole32.dll was not reported
=== w1064v1507 (32 bit report) ===
kernel32: debugger.c:1776: Test failed: dwDebugEventCode = 1
=== w1064_tsign (32 bit report) ===
kernel32: debugger.c:155: Test failed: unable to open 'C:\Users\winetest\AppData\Local\Temp\wt5D81.tmp' debugger.c:155: Test failed: failed to open: C:\Users\winetest\AppData\Local\Temp\wt5D81.tmp debugger.c:676: Test failed: the child and debugged pids don't match: 4340 != 4352 debugger: Timeout
=== w1064_tsign (64 bit report) ===
kernel32: debugger.c:155: Test failed: unable to open 'C:\Users\winetest\AppData\Local\Temp\wt5B3F.tmp' debugger.c:155: Test failed: failed to open: C:\Users\winetest\AppData\Local\Temp\wt5B3F.tmp debugger.c:676: Test failed: the child and debugged pids don't match: 6916 != 4336
=== w1064 (32 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4070.
=== w1064_tsign (32 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4070.
=== w10pro64 (32 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4070.
=== w1064 (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w1064_2qxl (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w1064_tsign (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w10pro64 (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w10pro64_ar (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w10pro64_he (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w10pro64_ja (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w10pro64_zh_CN (64 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4070.
=== w10pro64 (32 bit report) ===
kernel32: loader.c:2834: Test failed: attached thread count should be 2
=== w10pro64_he (64 bit report) ===
kernel32: loader.c:720: Test failed: 1192: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c0000131 loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c0000130 loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1197: wrong status c000012f/c000011b loader.c:720: Test failed: 1214: wrong status c000012f/c0000130 loader.c:720: Test failed: 1219: wrong status c000012f/c0000130 loader.c:720: Test failed: 1224: wrong status c000012f/c000007b loader.c:720: Test failed: 1229: wrong status c000012f/c000007b loader.c:720: Test failed: 1234: wrong status c000012f/c000007b loader.c:720: Test failed: 1239: wrong status c000012f/c000007b loader.c:720: Test failed: 1244: wrong status c000012f/c000007b loader.c:720: Test failed: 1260: wrong status c000012f/0 loader.c:720: Test failed: 1264: wrong status c000012f/0 loader.c:720: Test failed: 1269: wrong status c000012f/0 loader.c:720: Test failed: 1273: wrong status c000012f/0 loader.c:720: Test failed: 1277: wrong status c000012f/0 loader.c:720: Test failed: 1431: wrong status c000012f/c000007b loader.c:720: Test failed: 1439: wrong status c000012f/c000007b loader.c:720: Test failed: 1444: wrong status c000012f/0 loader.c:724: Test failed: 1444: failed with c000012f expected fallback loader.c:720: Test failed: 1450: wrong status c000012f/0 loader.c:724: Test failed: 1450: failed with c000012f expected fallback loader.c:720: Test failed: 1456: wrong status c000012f/0 loader.c:724: Test failed: 1456: failed with c000012f expected fallback loader.c:720: Test failed: 1463: wrong status c000012f/0 loader.c:724: Test failed: 1463: failed with c000012f expected fallback loader.c:720: Test failed: 1469: wrong status c000012f/0 loader.c:720: Test failed: 1478: wrong status c000012f/0 loader.c:720: Test failed: 1482: wrong status c000012f/0 loader.c:720: Test failed: 1486: wrong status c000012f/0 loader.c:720: Test failed: 1490: wrong status c000012f/0 loader.c:720: Test failed: 1494: wrong status c000012f/0
=== debian11 (32 bit report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit Arabic:Morocco report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit German report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit French report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit Hebrew:Israel report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit Hindi:India report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit Japanese:Japan report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit Chinese:China report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (32 bit WoW report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 00000028, i 16. fiber.c:530: Test failed: Got unexpected val 00000011, i 4078.
=== debian11 (64 bit WoW report) ===
kernel32: fiber.c:530: Test failed: Got unexpected val 0000000000000028, i 16. fiber.c:530: Test failed: Got unexpected val 0000000000000011, i 4078.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/kernelbase/tests/Makefile.in | 1 dlls/kernelbase/tests/path.c | 274 +++++++++++++++++++------------------ dlls/kernelbase/tests/process.c | 20 +-- dlls/kernelbase/tests/sync.c | 28 ++-- 4 files changed, 161 insertions(+), 162 deletions(-)
diff --git a/dlls/kernelbase/tests/Makefile.in b/dlls/kernelbase/tests/Makefile.in index d75392c8665..675054c753d 100644 --- a/dlls/kernelbase/tests/Makefile.in +++ b/dlls/kernelbase/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = kernelbase.dll
C_SRCS = \ diff --git a/dlls/kernelbase/tests/path.c b/dlls/kernelbase/tests/path.c index af511f500f3..1c0c8a2318b 100644 --- a/dlls/kernelbase/tests/path.c +++ b/dlls/kernelbase/tests/path.c @@ -368,25 +368,25 @@ static void test_PathAllocCanonicalize(void) if (0) { hr = pPathAllocCanonicalize(NULL, 0, &path_outW); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); }
MultiByteToWideChar(CP_ACP, 0, "C:\", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathAllocCanonicalize(path_inW, 0, NULL); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
/* Test longest path */ for (i = 0; i < ARRAY_SIZE(path_maxW) - 1; i++) path_maxW[i] = 'a'; path_maxW[PATHCCH_MAX_CCH] = '\0'; path_outW = (WCHAR *)0xdeadbeef; hr = pPathAllocCanonicalize(path_maxW, PATHCCH_ALLOW_LONG_PATHS, &path_outW); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#x, got %#x\n", + ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#lx, got %#lx\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), hr); ok(path_outW == NULL, "expect path_outW null, got %p\n", path_outW);
path_maxW[PATHCCH_MAX_CCH - 1] = '\0'; hr = pPathAllocCanonicalize(path_maxW, PATHCCH_ALLOW_LONG_PATHS, &path_outW); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr); LocalFree(path_outW);
/* Check if flags added after Windows 10 1709 are supported */ @@ -410,7 +410,7 @@ static void test_PathAllocCanonicalize(void)
MultiByteToWideChar(CP_ACP, 0, t->path_in, -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathAllocCanonicalize(path_inW, t->flags, &path_outW); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path_in, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path_in, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -515,25 +515,25 @@ static void test_PathAllocCombine(void)
resultW = (WCHAR *)0xdeadbeef; hr = pPathAllocCombine(NULL, NULL, 0, &resultW); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); ok(resultW == NULL, "expect resultW null, got %p\n", resultW);
MultiByteToWideChar(CP_ACP, 0, "\a", -1, path1W, ARRAY_SIZE(path1W)); hr = pPathAllocCombine(path1W, NULL, 0, &resultW); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr); WideCharToMultiByte(CP_ACP, 0, resultW, -1, resultA, ARRAY_SIZE(resultA), NULL, NULL); ok(!lstrcmpA(resultA, "\a"), "expect \a, got %s\n", resultA); LocalFree(resultW);
MultiByteToWideChar(CP_ACP, 0, "\b", -1, path2W, ARRAY_SIZE(path2W)); hr = pPathAllocCombine(NULL, path2W, 0, &resultW); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr); WideCharToMultiByte(CP_ACP, 0, resultW, -1, resultA, ARRAY_SIZE(resultA), NULL, NULL); ok(!lstrcmpA(resultA, "\b"), "expect \b, got %s\n", resultA); LocalFree(resultW);
hr = pPathAllocCombine(path1W, path2W, 0, NULL); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(combine_tests); i++) { @@ -542,7 +542,7 @@ static void test_PathAllocCombine(void) MultiByteToWideChar(CP_ACP, 0, t->path1, -1, path1W, ARRAY_SIZE(path1W)); MultiByteToWideChar(CP_ACP, 0, t->path2, -1, path2W, ARRAY_SIZE(path2W)); hr = pPathAllocCombine(path1W, path2W, 0, &resultW); - ok(hr == S_OK, "combine %s %s expect hr %#x, got %#x\n", t->path1, t->path2, S_OK, hr); + ok(hr == S_OK, "combine %s %s expect hr %#lx, got %#lx\n", t->path1, t->path2, S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, resultW, -1, resultA, ARRAY_SIZE(resultA), NULL, NULL); @@ -569,37 +569,37 @@ static void test_PathCchCombine(void) }
hr = pPathCchCombine(output, 5, NULL, NULL); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
hr = pPathCchCombine(NULL, 2, p1, p2); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
memset(output, 0xff, sizeof(output)); hr = pPathCchCombine(output, 0, p1, p2); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr); ok(output[0] == 0xffff, "Expected output buffer to be unchanged\n");
memset(output, 0xff, sizeof(output)); hr = pPathCchCombine(output, 1, p1, p2); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08x\n", hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08lx\n", hr); ok(output[0] == 0, "Expected output buffer to contain NULL string\n");
memset(output, 0xff, sizeof(output)); hr = pPathCchCombine(output, 4, p1, p2); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08x\n", hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08lx\n", hr); ok(output[0] == 0x0, "Expected output buffer to contain NULL string\n");
memset(output, 0xff, sizeof(output)); hr = pPathCchCombine(output, 5, p1, p2); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr); ok(!lstrcmpW(output, expected), "Combination of %s + %s returned %s, expected %s\n", wine_dbgstr_w(p1), wine_dbgstr_w(p2), wine_dbgstr_w(output), wine_dbgstr_w(expected));
hr = pPathCchCombine(output, PATHCCH_MAX_CCH + 1, p1, p2); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
hr = pPathCchCombine(output, PATHCCH_MAX_CCH, p1, p2); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
for (i = 0; i < ARRAY_SIZE(combine_tests); i++) { @@ -608,7 +608,7 @@ static void test_PathCchCombine(void) MultiByteToWideChar(CP_ACP, 0, combine_tests[i].result, -1, expected, ARRAY_SIZE(expected));
hr = pPathCchCombine(output, ARRAY_SIZE(output), p1, p2); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr); ok(!lstrcmpW(output, expected), "Combining %s with %s returned %s, expected %s\n", wine_dbgstr_w(p1), wine_dbgstr_w(p2), wine_dbgstr_w(output), wine_dbgstr_w(expected)); } @@ -631,40 +631,40 @@ static void test_PathCchCombineEx(void)
output[0] = 0xff; hr = pPathCchCombineEx(output, 5, NULL, NULL, 0); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr); ok(output[0] == 0, "Expected output buffer to be empty\n");
output[0] = 0xff; hr = pPathCchCombineEx(NULL, 2, p1, p2, 0); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr); ok(output[0] == 0xff, "Expected output buffer to be unchanged\n");
memset(output, 0xff, sizeof(output)); hr = pPathCchCombineEx(output, 0, p1, p2, 0); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr); ok(output[0] == 0xffff, "Expected output buffer to be unchanged\n");
memset(output, 0xff, sizeof(output)); hr = pPathCchCombineEx(output, 1, p1, p2, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08x\n", hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08lx\n", hr); ok(output[0] == 0, "Expected output buffer to contain NULL string\n");
memset(output, 0xff, sizeof(output)); hr = pPathCchCombineEx(output, 4, p1, p2, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08x\n", hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08lx\n", hr); ok(output[0] == 0x0, "Expected output buffer to contain NULL string\n");
output[0] = 0xff; hr = pPathCchCombineEx(output, PATHCCH_MAX_CCH + 1, p1, p2, 0); - ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr); ok(output[0] == 0xff, "Expected output buffer to be 0xff\n");
hr = pPathCchCombineEx(output, PATHCCH_MAX_CCH, p1, p2, 0); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
memset(output, 0xff, sizeof(output)); hr = pPathCchCombineEx(output, 5, p1, p2, 0); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr); ok(!lstrcmpW(output, expected), "Combination of %s + %s returned %s, expected %s\n", wine_dbgstr_w(p1), wine_dbgstr_w(p2), wine_dbgstr_w(output), wine_dbgstr_w(expected)); @@ -676,7 +676,7 @@ static void test_PathCchCombineEx(void) MultiByteToWideChar(CP_ACP, 0, combine_tests[i].result, -1, expected, MAX_PATH);
hr = pPathCchCombineEx(output, MAX_PATH, p1, p2, 0); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr); ok(!lstrcmpW(output, expected), "Combining %s with %s returned %s, expected %s\n", wine_dbgstr_w(p1), wine_dbgstr_w(p2), wine_dbgstr_w(output), wine_dbgstr_w(expected)); } @@ -722,17 +722,17 @@ static void test_PathCchAddBackslash(void)
pathW[0] = 0; hr = pPathCchAddBackslash(pathW, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(pathW[0] == 0, "Unexpected path.\n");
pathW[0] = 0; hr = pPathCchAddBackslash(pathW, 1); - ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); + ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr); ok(pathW[0] == 0, "Unexpected path.\n");
pathW[0] = 0; hr = pPathCchAddBackslash(pathW, 2); - ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); + ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr); ok(pathW[0] == 0, "Unexpected path.\n");
for (i = 0; i < ARRAY_SIZE(addbackslash_tests); i++) @@ -742,7 +742,7 @@ static void test_PathCchAddBackslash(void)
MultiByteToWideChar(CP_ACP, 0, test->path, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchAddBackslash(pathW, test->size); - ok(hr == test->hr, "%u: unexpected return value %#x.\n", i, hr); + ok(hr == test->hr, "%u: unexpected return value %#lx.\n", i, hr);
WideCharToMultiByte(CP_ACP, 0, pathW, -1, path, ARRAY_SIZE(path), NULL, NULL); ok(!strcmp(path, test->result), "%u: unexpected resulting path %s.\n", i, path); @@ -765,21 +765,21 @@ static void test_PathCchAddBackslashEx(void)
pathW[0] = 0; hr = pPathCchAddBackslashEx(pathW, 0, NULL, NULL); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); ok(pathW[0] == 0, "Unexpected path.\n");
pathW[0] = 0; ptrW = (void *)0xdeadbeef; remaining = 123; hr = pPathCchAddBackslashEx(pathW, 1, &ptrW, &remaining); - ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); + ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr); ok(pathW[0] == 0, "Unexpected path.\n"); ok(ptrW == pathW, "Unexpected endptr %p.\n", ptrW); ok(remaining == 1, "Unexpected remaining size.\n");
pathW[0] = 0; hr = pPathCchAddBackslashEx(pathW, 2, NULL, NULL); - ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); + ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr); ok(pathW[0] == 0, "Unexpected path.\n");
for (i = 0; i < ARRAY_SIZE(addbackslash_tests); i++) @@ -789,7 +789,7 @@ static void test_PathCchAddBackslashEx(void)
MultiByteToWideChar(CP_ACP, 0, test->path, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchAddBackslashEx(pathW, test->size, NULL, NULL); - ok(hr == test->hr, "%u: unexpected return value %#x.\n", i, hr); + ok(hr == test->hr, "%u: unexpected return value %#lx.\n", i, hr);
WideCharToMultiByte(CP_ACP, 0, pathW, -1, path, ARRAY_SIZE(path), NULL, NULL); ok(!strcmp(path, test->result), "%u: unexpected resulting path %s.\n", i, path); @@ -798,7 +798,7 @@ static void test_PathCchAddBackslashEx(void) remaining = 123; MultiByteToWideChar(CP_ACP, 0, test->path, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchAddBackslashEx(pathW, test->size, &ptrW, &remaining); - ok(hr == test->hr, "%u: unexpected return value %#x.\n", i, hr); + ok(hr == test->hr, "%u: unexpected return value %#lx.\n", i, hr); if (SUCCEEDED(hr)) { ok(ptrW == (pathW + lstrlenW(pathW)), "%u: unexpected end pointer.\n", i); @@ -949,16 +949,16 @@ static void test_PathCchAppend(void) MultiByteToWideChar(CP_ACP, 0, "\a", -1, path1W, ARRAY_SIZE(path1W)); MultiByteToWideChar(CP_ACP, 0, "\b", -1, path2W, ARRAY_SIZE(path2W)); hr = pPathCchAppend(NULL, PATHCCH_MAX_CCH, path2W); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAppend(path1W, 0, path2W); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAppend(path1W, PATHCCH_MAX_CCH + 1, path2W); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAppend(path1W, PATHCCH_MAX_CCH, NULL); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr); WideCharToMultiByte(CP_ACP, 0, path1W, -1, path1A, ARRAY_SIZE(path1A), NULL, NULL); ok(!lstrcmpA(path1A, "\a"), "expect \a, got %s\n", path1A);
@@ -969,7 +969,7 @@ static void test_PathCchAppend(void) MultiByteToWideChar(CP_ACP, 0, t->path1, -1, path1W, ARRAY_SIZE(path1W)); MultiByteToWideChar(CP_ACP, 0, t->path2, -1, path2W, ARRAY_SIZE(path2W)); hr = pPathCchAppend(path1W, PATHCCH_MAX_CCH, path2W); - ok(hr == S_OK, "append "%s" "%s" expect hr %#x, got %#x\n", t->path1, t->path2, S_OK, hr); + ok(hr == S_OK, "append "%s" "%s" expect hr %#lx, got %#lx\n", t->path1, t->path2, S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path1W, -1, path1A, ARRAY_SIZE(path1A), NULL, NULL); @@ -996,23 +996,23 @@ static void test_PathCchAppendEx(void) MultiByteToWideChar(CP_ACP, 0, "\a", -1, path1W, ARRAY_SIZE(path1W)); MultiByteToWideChar(CP_ACP, 0, "\b", -1, path2W, ARRAY_SIZE(path2W)); hr = pPathCchAppendEx(NULL, ARRAY_SIZE(path1W), path2W, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAppendEx(path1W, 0, path2W, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); ok(path1W[0] == '\', "expect path1 unchanged\n");
hr = pPathCchAppendEx(path1W, PATHCCH_MAX_CCH + 1, path2W, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); ok(path1W[0] == '\', "expect path1 unchanged\n");
hr = pPathCchAppendEx(path1W, ARRAY_SIZE(path1W), NULL, 0); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr); WideCharToMultiByte(CP_ACP, 0, path1W, -1, path1A, ARRAY_SIZE(path1A), NULL, NULL); ok(!lstrcmpA(path1A, "\a"), "expect \a, got %s\n", path1A);
hr = pPathCchAppendEx(path1W, PATHCCH_MAX_CCH, path2W, 0); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr);
for (i = 0; i < ARRAY_SIZE(append_tests); i++) { @@ -1021,7 +1021,7 @@ static void test_PathCchAppendEx(void) MultiByteToWideChar(CP_ACP, 0, t->path1, -1, path1W, ARRAY_SIZE(path1W)); MultiByteToWideChar(CP_ACP, 0, t->path2, -1, path2W, ARRAY_SIZE(path2W)); hr = pPathCchAppendEx(path1W, PATHCCH_MAX_CCH, path2W, 0); - ok(hr == S_OK, "append "%s" "%s" expect hr %#x, got %#x\n", t->path1, t->path2, S_OK, hr); + ok(hr == S_OK, "append "%s" "%s" expect hr %#lx, got %#lx\n", t->path1, t->path2, S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path1W, -1, path1A, ARRAY_SIZE(path1A), NULL, NULL); @@ -1050,23 +1050,23 @@ static void test_PathCchAddExtension(void) MultiByteToWideChar(CP_ACP, 0, ".exe", -1, extensionW, ARRAY_SIZE(extensionW));
hr = pPathCchAddExtension(NULL, PATHCCH_MAX_CCH, extensionW); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAddExtension(pathW, 0, extensionW); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAddExtension(pathW, PATHCCH_MAX_CCH, NULL); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
/* Path length check */ hr = pPathCchAddExtension(pathW, ARRAY_SIZE("C:\.exe") - 1, extensionW); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect result %#x, got %#x\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect result %#lx, got %#lx\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr);
hr = pPathCchAddExtension(pathW, PATHCCH_MAX_CCH + 1, extensionW); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchAddExtension(pathW, PATHCCH_MAX_CCH, extensionW); - ok(hr == S_OK, "expect result %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect result %#lx, got %#lx\n", S_OK, hr);
for (i = 0; i < ARRAY_SIZE(addextension_tests); i++) { @@ -1074,7 +1074,7 @@ static void test_PathCchAddExtension(void) MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); MultiByteToWideChar(CP_ACP, 0, t->extension, -1, extensionW, ARRAY_SIZE(extensionW)); hr = pPathCchAddExtension(pathW, PATHCCH_MAX_CCH, extensionW); - ok(hr == t->hr, "path %s extension %s expect result %#x, got %#x\n", t->path, t->extension, t->hr, hr); + ok(hr == t->hr, "path %s extension %s expect result %#lx, got %#lx\n", t->path, t->extension, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, pathA, ARRAY_SIZE(pathA), NULL, NULL); @@ -1101,23 +1101,23 @@ static void test_PathCchCanonicalize(void) if (0) { hr = pPathCchCanonicalize(NULL, ARRAY_SIZE(path_outW), path_inW); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
/* MSDN says NULL path_in result in a backslash added to path_out, but the fact is that it would crash */ hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), NULL); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); }
path_inW[0] = 0; hr = pPathCchCanonicalize(path_outW, 0, path_inW); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
/* Test path length */ for (i = 0; i < MAX_PATH - 3; i++) path_inW[i] = 'a'; path_inW[MAX_PATH - 3] = '\0'; memset(path_outW, 0, sizeof(path_outW)); hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), path_inW); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#x, got %#x %s\n", + ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#lx, got %#lx %s\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), hr, wine_dbgstr_w(path_outW)); ok(!*path_outW, "got %d\n", lstrlenW(path_outW));
@@ -1125,15 +1125,15 @@ static void test_PathCchCanonicalize(void) path_inW[1] = ':'; path_inW[2] = '\'; hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), path_inW); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr);
path_inW[MAX_PATH - 4] = '\0'; hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), path_inW); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr);
/* Insufficient buffer size handling */ hr = pPathCchCanonicalize(path_outW, 1, path_inW); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#x, got %#x\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#lx, got %#lx\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr);
for (i = 0; i < ARRAY_SIZE(alloccanonicalize_tests); i++) { @@ -1145,7 +1145,7 @@ static void test_PathCchCanonicalize(void)
MultiByteToWideChar(CP_ACP, 0, t->path_in, -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), path_inW); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path_in, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path_in, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1158,7 +1158,7 @@ static void test_PathCchCanonicalize(void) /* Fill a \ at the end of X: if there is enough space */ MultiByteToWideChar(CP_ACP, 0, "C:", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), path_inW); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", "C:", S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", "C:", S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1169,7 +1169,7 @@ static void test_PathCchCanonicalize(void) /* Don't fill a \ at the end of X: if there isn't enough space */ MultiByteToWideChar(CP_ACP, 0, "C:", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalize(path_outW, 3, path_inW); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", "C:", S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", "C:", S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1179,7 +1179,7 @@ static void test_PathCchCanonicalize(void) /* Don't fill a \ at the end of X: if there is character following X: */ MultiByteToWideChar(CP_ACP, 0, "C:a", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalize(path_outW, ARRAY_SIZE(path_outW), path_inW); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", "C:a", S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", "C:a", S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1205,37 +1205,37 @@ static void test_PathCchCanonicalizeEx(void) if (0) { hr = pPathCchCanonicalizeEx(NULL, ARRAY_SIZE(path_outW), path_inW, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
/* MSDN says NULL path_in result in a backslash added to path_out, but the fact is that it would crash */ hr = pPathCchCanonicalizeEx(path_outW, ARRAY_SIZE(path_outW), NULL, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); }
path_outW[0] = 0xff; hr = pPathCchCanonicalizeEx(path_outW, 0, path_inW, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); ok(path_outW[0] = 0xff, "expect path_outW unchanged\n");
/* Test path length */ for (i = 0; i < ARRAY_SIZE(path_inW) - 1; i++) path_inW[i] = 'a'; path_inW[PATHCCH_MAX_CCH] = '\0'; hr = pPathCchCanonicalizeEx(path_outW, ARRAY_SIZE(path_outW), path_inW, PATHCCH_ALLOW_LONG_PATHS); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#x, got %#x\n", + ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#lx, got %#lx\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), hr);
path_inW[PATHCCH_MAX_CCH - 1] = '\0'; hr = pPathCchCanonicalizeEx(path_outW, ARRAY_SIZE(path_outW), path_inW, PATHCCH_ALLOW_LONG_PATHS); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr);
hr = pPathCchCanonicalizeEx(path_outW, 1, path_inW, PATHCCH_ALLOW_LONG_PATHS); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#x, got %#x\n", + ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#lx, got %#lx\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), hr);
/* No root and path > MAX_PATH - 4, return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) */ path_inW[MAX_PATH - 3] = '\0'; hr = pPathCchCanonicalizeEx(path_outW, 1, path_inW, 0); - ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#x, got %#x\n", + ok(hr == HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), "expect hr %#lx, got %#lx\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), hr);
/* Has root and path > MAX_PATH - 4 */ @@ -1243,23 +1243,23 @@ static void test_PathCchCanonicalizeEx(void) path_inW[1] = ':'; path_inW[2] = '\'; hr = pPathCchCanonicalizeEx(path_outW, 1, path_inW, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#x, got %#x\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#lx, got %#lx\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr);
path_inW[0] = '\'; path_inW[1] = path_inW[2] = 'a'; hr = pPathCchCanonicalizeEx(path_outW, 1, path_inW, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#x, got %#x\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#lx, got %#lx\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr);
path_inW[0] = path_inW[1] = '\'; path_inW[2] = 'a'; hr = pPathCchCanonicalizeEx(path_outW, 1, path_inW, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#x, got %#x\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#lx, got %#lx\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr);
/* path <= MAX_PATH - 4 */ path_inW[0] = path_inW[1] = path_inW[2] = 'a'; path_inW[MAX_PATH - 4] = '\0'; hr = pPathCchCanonicalizeEx(path_outW, 1, path_inW, 0); - ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#x, got %#x\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "expect hr %#lx, got %#lx\n", STRSAFE_E_INSUFFICIENT_BUFFER, hr);
/* Check if flags added after Windows 10 1709 are supported */ MultiByteToWideChar(CP_ACP, 0, "C:\", -1, path_inW, ARRAY_SIZE(path_inW)); @@ -1285,7 +1285,7 @@ static void test_PathCchCanonicalizeEx(void)
MultiByteToWideChar(CP_ACP, 0, t->path_in, -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalizeEx(path_outW, ARRAY_SIZE(path_outW), path_inW, t->flags); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path_in, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path_in, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1298,7 +1298,7 @@ static void test_PathCchCanonicalizeEx(void) /* Fill a \ at the end of X: if there is enough space */ MultiByteToWideChar(CP_ACP, 0, "C:", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalizeEx(path_outW, ARRAY_SIZE(path_outW), path_inW, 0); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", "C:", S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", "C:", S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1309,7 +1309,7 @@ static void test_PathCchCanonicalizeEx(void) /* Don't fill a \ at the end of X: if there isn't enough space */ MultiByteToWideChar(CP_ACP, 0, "C:", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalizeEx(path_outW, 3, path_inW, 0); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", "C:", S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", "C:", S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1319,7 +1319,7 @@ static void test_PathCchCanonicalizeEx(void) /* Don't fill a \ at the end of X: if there is character following X: */ MultiByteToWideChar(CP_ACP, 0, "C:a", -1, path_inW, ARRAY_SIZE(path_inW)); hr = pPathCchCanonicalizeEx(path_outW, ARRAY_SIZE(path_outW), path_inW, 0); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", "C:a", S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", "C:a", S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, path_outW, -1, path_outA, ARRAY_SIZE(path_outA), NULL, NULL); @@ -1386,61 +1386,61 @@ static void test_PathCchFindExtension(void) /* Arguments check */ extension = (const WCHAR *)0xdeadbeef; hr = pPathCchFindExtension(NULL, PATHCCH_MAX_CCH, &extension); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr); ok(extension == NULL, "Expect extension null, got %p\n", extension);
extension = (const WCHAR *)0xdeadbeef; hr = pPathCchFindExtension(pathW, 0, &extension); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr); ok(extension == NULL, "Expect extension null, got %p\n", extension);
/* Crashed on Windows */ if (0) { hr = pPathCchFindExtension(pathW, PATHCCH_MAX_CCH, NULL); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr); }
/* Path length check */ /* size == PATHCCH_MAX_CCH + 1 */ MultiByteToWideChar(CP_ACP, 0, "C:\1.exe", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchFindExtension(pathW, PATHCCH_MAX_CCH + 1, &extension); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
/* Size == path length + 1*/ hr = pPathCchFindExtension(pathW, ARRAY_SIZE("C:\1.exe"), &extension); - ok(hr == S_OK, "expect result %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect result %#lx, got %#lx\n", S_OK, hr); ok(*extension == '.', "wrong extension value\n");
/* Size < path length + 1 */ extension = (const WCHAR *)0xdeadbeef; hr = pPathCchFindExtension(pathW, ARRAY_SIZE("C:\1.exe") - 1, &extension); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr); ok(extension == NULL, "Expect extension null, got %p\n", extension);
/* Size == PATHCCH_MAX_CCH */ hr = pPathCchFindExtension(pathW, PATHCCH_MAX_CCH, &extension); - ok(hr == S_OK, "expect result %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect result %#lx, got %#lx\n", S_OK, hr);
/* Path length + 1 > PATHCCH_MAX_CCH */ for (i = 0; i < ARRAY_SIZE(pathW) - 1; i++) pathW[i] = 'a'; pathW[PATHCCH_MAX_CCH] = 0; hr = pPathCchFindExtension(pathW, PATHCCH_MAX_CCH, &extension); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
/* Path length + 1 == PATHCCH_MAX_CCH */ pathW[PATHCCH_MAX_CCH - 1] = 0; hr = pPathCchFindExtension(pathW, PATHCCH_MAX_CCH, &extension); - ok(hr == S_OK, "expect result %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect result %#lx, got %#lx\n", S_OK, hr);
for (i = 0; i < ARRAY_SIZE(findextension_tests); i++) { const struct findextension_test *t = findextension_tests + i; MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchFindExtension(pathW, PATHCCH_MAX_CCH, &extension); - ok(hr == S_OK, "path %s expect result %#x, got %#x\n", t->path, S_OK, hr); + ok(hr == S_OK, "path %s expect result %#lx, got %#lx\n", t->path, S_OK, hr); if (SUCCEEDED(hr)) - ok(extension - pathW == t->extension_offset, "path %s expect extension offset %d, got %ld\n", t->path, + ok(extension - pathW == t->extension_offset, "path %s expect extension offset %d, got %Id\n", t->path, t->extension_offset, (UINT_PTR)(extension - pathW)); } } @@ -1577,25 +1577,25 @@ static void test_PathCchRemoveBackslash(void) if (0) { hr = pPathCchRemoveBackslash(NULL, PATHCCH_MAX_CCH); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); }
MultiByteToWideChar(CP_ACP, 0, "C:\a\", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveBackslash(pathW, 0); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRemoveBackslash(pathW, PATHCCH_MAX_CCH + 1); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr);
hr = pPathCchRemoveBackslash(pathW, PATHCCH_MAX_CCH); - ok(hr == S_FALSE, "expect hr %#x, got %#x\n", S_FALSE, hr); + ok(hr == S_FALSE, "expect hr %#lx, got %#lx\n", S_FALSE, hr);
for (i = 0; i < ARRAY_SIZE(removebackslashex_tests); i++) { const struct removebackslashex_test *t = removebackslashex_tests + i; path_size = MultiByteToWideChar(CP_ACP, 0, t->path_in, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveBackslash(pathW, path_size); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path_in, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path_in, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, pathA, ARRAY_SIZE(pathA), NULL, NULL); @@ -1624,45 +1624,45 @@ static void test_PathCchRemoveBackslashEx(void) if (0) { hr = pPathCchRemoveBackslashEx(NULL, 0, &path_end, &path_size); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); }
path_size = MultiByteToWideChar(CP_ACP, 0, "C:\a\", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveBackslashEx(pathW, 0, &path_end, &path_size); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr);
free_size = 0xdeadbeef; hr = pPathCchRemoveBackslashEx(pathW, path_size, NULL, &free_size); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); - ok(free_size == 0, "expect %d, got %lu\n", 0, free_size); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); + ok(free_size == 0, "expect %d, got %Iu\n", 0, free_size);
path_end = (WCHAR *)0xdeadbeef; hr = pPathCchRemoveBackslashEx(pathW, path_size, &path_end, NULL); - ok(hr == E_INVALIDARG, "expect hr %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect hr %#lx, got %#lx\n", E_INVALIDARG, hr); ok(path_end == NULL, "expect null, got %p\n", path_end);
hr = pPathCchRemoveBackslashEx(pathW, PATHCCH_MAX_CCH + 1, &path_end, &free_size); - ok(hr == S_OK, "expect hr %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect hr %#lx, got %#lx\n", S_OK, hr);
hr = pPathCchRemoveBackslashEx(pathW, PATHCCH_MAX_CCH, &path_end, &free_size); - ok(hr == S_FALSE, "expect hr %#x, got %#x\n", S_FALSE, hr); + ok(hr == S_FALSE, "expect hr %#lx, got %#lx\n", S_FALSE, hr);
/* Size < original path length + 1, don't read beyond size */ MultiByteToWideChar(CP_ACP, 0, "C:\a", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveBackslashEx(pathW, ARRAY_SIZE("C:\a") - 1, &path_end, &free_size); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(removebackslashex_tests); i++) { const struct removebackslashex_test *t = removebackslashex_tests + i; path_size = MultiByteToWideChar(CP_ACP, 0, t->path_in, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveBackslashEx(pathW, path_size, &path_end, &free_size); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path_in, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path_in, t->hr, hr); if (SUCCEEDED(hr)) { - ok(path_end - pathW == t->end_offset, "path %s expect end offset %d, got %ld\n", t->path_in, t->end_offset, + ok(path_end - pathW == t->end_offset, "path %s expect end offset %d, got %Id\n", t->path_in, t->end_offset, (INT_PTR)(path_end - pathW)); - ok(free_size == t->free_size, "path %s expect free size %lu, got %lu\n", t->path_in, t->free_size, free_size); + ok(free_size == t->free_size, "path %s expect free size %Iu, got %Iu\n", t->path_in, t->free_size, free_size); WideCharToMultiByte(CP_ACP, 0, pathW, -1, pathA, ARRAY_SIZE(pathA), NULL, NULL); ok(!lstrcmpA(pathA, t->path_out), "path %s expect output path %s, got %s\n", t->path_in, t->path_out, pathA); @@ -1721,21 +1721,21 @@ static void test_PathCchRemoveExtension(void)
/* Arguments check */ hr = pPathCchRemoveExtension(NULL, PATHCCH_MAX_CCH); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRemoveExtension(pathW, 0); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRemoveExtension(pathW, PATHCCH_MAX_CCH + 1); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRemoveExtension(pathW, PATHCCH_MAX_CCH); - ok(hr == S_FALSE, "expect %#x, got %#x\n", S_FALSE, hr); + ok(hr == S_FALSE, "expect %#lx, got %#lx\n", S_FALSE, hr);
/* Size < original path length + 1 */ MultiByteToWideChar(CP_ACP, 0, "C:\1.exe", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveExtension(pathW, ARRAY_SIZE("C:\1.exe") - 1); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(removeextension_tests); i++) { @@ -1743,7 +1743,7 @@ static void test_PathCchRemoveExtension(void)
MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchRemoveExtension(pathW, ARRAY_SIZE(pathW)); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, pathA, ARRAY_SIZE(pathA), NULL, NULL); @@ -1854,10 +1854,10 @@ static void test_PathCchRemoveFileSpec(void)
/* Null arguments */ hr = pPathCchRemoveFileSpec(NULL, ARRAY_SIZE(pathW)); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRemoveFileSpec(pathW, 0); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(removefilespec_tests); i++) { @@ -1866,7 +1866,7 @@ static void test_PathCchRemoveFileSpec(void) MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); size = t->size ? t->size : ARRAY_SIZE(pathW); hr = pPathCchRemoveFileSpec(pathW, size); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, pathA, ARRAY_SIZE(pathA), NULL, NULL); @@ -1918,23 +1918,23 @@ static void test_PathCchRenameExtension(void) MultiByteToWideChar(CP_ACP, 0, ".exe", -1, extensionW, ARRAY_SIZE(extensionW));
hr = pPathCchRenameExtension(NULL, PATHCCH_MAX_CCH, extensionW); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRenameExtension(pathW, 0, extensionW); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRenameExtension(pathW, PATHCCH_MAX_CCH, NULL); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
/* Path length */ hr = pPathCchRenameExtension(pathW, ARRAY_SIZE("C:\1.exe") - 1, extensionW); - ok(E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRenameExtension(pathW, PATHCCH_MAX_CCH + 1, extensionW); - ok(hr == E_INVALIDARG, "expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchRenameExtension(pathW, PATHCCH_MAX_CCH, extensionW); - ok(hr == S_OK, "expect result %#x, got %#x\n", S_OK, hr); + ok(hr == S_OK, "expect result %#lx, got %#lx\n", S_OK, hr);
for (i = 0; i < ARRAY_SIZE(renameextension_tests); i++) { @@ -1942,7 +1942,7 @@ static void test_PathCchRenameExtension(void) MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); MultiByteToWideChar(CP_ACP, 0, t->extension, -1, extensionW, ARRAY_SIZE(extensionW)); hr = pPathCchRenameExtension(pathW, PATHCCH_MAX_CCH, extensionW); - ok(hr == S_OK, "path %s extension %s expect result %#x, got %#x\n", t->path, t->extension, S_OK, hr); + ok(hr == S_OK, "path %s extension %s expect result %#lx, got %#lx\n", t->path, t->extension, S_OK, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, pathA, ARRAY_SIZE(pathA), NULL, NULL); @@ -2058,21 +2058,21 @@ static void test_PathCchSkipRoot(void)
root_end = (const WCHAR *)0xdeadbeef; hr = pPathCchSkipRoot(NULL, &root_end); - ok(hr == E_INVALIDARG, "Expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "Expect result %#lx, got %#lx\n", E_INVALIDARG, hr); ok(root_end == (const WCHAR *)0xdeadbeef, "Expect root_end 0xdeadbeef, got %p\n", root_end);
MultiByteToWideChar(CP_ACP, 0, "C:\", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchSkipRoot(pathW, NULL); - ok(hr == E_INVALIDARG, "Expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "Expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(skiproot_tests); i++) { const struct skiproot_test *t = skiproot_tests + i; MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchSkipRoot(pathW, &root_end); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path, t->hr, hr); if (SUCCEEDED(hr)) - ok(root_end - pathW == t->root_offset, "path %s expect root offset %d, got %ld\n", t->path, t->root_offset, + ok(root_end - pathW == t->root_offset, "path %s expect root offset %d, got %Id\n", t->path, t->root_offset, (INT_PTR)(root_end - pathW)); } } @@ -2130,10 +2130,10 @@ static void test_PathCchStripPrefix(void)
/* Null arguments */ hr = pPathCchStripPrefix(NULL, PATHCCH_MAX_CCH); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
hr = pPathCchStripPrefix(pathW, 0); - ok(hr == E_INVALIDARG, "expect %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "expect %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(stripprefix_tests); i++) { @@ -2142,7 +2142,7 @@ static void test_PathCchStripPrefix(void) MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); size = t->size ? t->size : PATHCCH_MAX_CCH; hr = pPathCchStripPrefix(pathW, size); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, stripped_pathA, ARRAY_SIZE(stripped_pathA), NULL, NULL); @@ -2256,11 +2256,11 @@ static void test_PathCchStripToRoot(void)
/* Null arguments */ hr = pPathCchStripToRoot(NULL, ARRAY_SIZE(pathW)); - ok(hr == E_INVALIDARG, "Expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "Expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
MultiByteToWideChar(CP_ACP, 0, "C:\a", -1, pathW, ARRAY_SIZE(pathW)); hr = pPathCchStripToRoot(pathW, 0); - ok(hr == E_INVALIDARG, "Expect result %#x, got %#x\n", E_INVALIDARG, hr); + ok(hr == E_INVALIDARG, "Expect result %#lx, got %#lx\n", E_INVALIDARG, hr);
for (i = 0; i < ARRAY_SIZE(striptoroot_tests); i++) { @@ -2268,7 +2268,7 @@ static void test_PathCchStripToRoot(void) MultiByteToWideChar(CP_ACP, 0, t->path, -1, pathW, ARRAY_SIZE(pathW)); size = t->size ? t->size : ARRAY_SIZE(pathW); hr = pPathCchStripToRoot(pathW, size); - ok(hr == t->hr, "path %s expect result %#x, got %#x\n", t->path, t->hr, hr); + ok(hr == t->hr, "path %s expect result %#lx, got %#lx\n", t->path, t->hr, hr); if (SUCCEEDED(hr)) { WideCharToMultiByte(CP_ACP, 0, pathW, -1, rootA, ARRAY_SIZE(rootA), NULL, NULL); @@ -2339,7 +2339,7 @@ static void test_PathIsUNCEx(void) ret = pPathIsUNCEx(pathW, &server); ok(ret == t->ret, "path "%s" expect return %d, got %d\n", t->path, t->ret, ret); if (ret) - ok(server == pathW + t->server_offset, "path "%s" expect server offset %d, got %ld\n", t->path, + ok(server == pathW + t->server_offset, "path "%s" expect server offset %d, got %Id\n", t->path, t->server_offset, (INT_PTR)(server - pathW)); else ok(!server, "expect server is null, got %p\n", server); @@ -2356,10 +2356,10 @@ static void test_actctx(void) BOOL b;
b = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, L"testdll.dll", &data); - ok(b, "FindActCtxSectionString failed: %u\n", GetLastError()); + ok(b, "FindActCtxSectionString failed: %lu\n", GetLastError());
b = QueryActCtxW(0, data.hActCtx, &data.ulAssemblyRosterIndex, AssemblyDetailedInformationInActivationContext, buf, sizeof(buf), &size); - ok(b, "QueryActCtx failed: %u\n", GetLastError()); + ok(b, "QueryActCtx failed: %lu\n", GetLastError());
GetModuleFileNameW(NULL, exe_path, ARRAY_SIZE(exe_path)); ok(!lstrcmpW(info->lpAssemblyManifestPath, exe_path), "lpAssemblyManifestPath = %s expected %s\n", debugstr_w(info->lpAssemblyManifestPath), debugstr_w(exe_path)); diff --git a/dlls/kernelbase/tests/process.c b/dlls/kernelbase/tests/process.c index 1a008be9a7b..d119dca650d 100644 --- a/dlls/kernelbase/tests/process.c +++ b/dlls/kernelbase/tests/process.c @@ -44,46 +44,46 @@ static void test_CompareObjectHandles(void) }
ret = pCompareObjectHandles( GetCurrentProcess(), GetCurrentProcess() ); - ok( ret, "comparing GetCurrentProcess() to self failed with %u\n", GetLastError() ); + ok( ret, "comparing GetCurrentProcess() to self failed with %lu\n", GetLastError() );
ret = pCompareObjectHandles( GetCurrentThread(), GetCurrentThread() ); - ok( ret, "comparing GetCurrentThread() to self failed with %u\n", GetLastError() ); + ok( ret, "comparing GetCurrentThread() to self failed with %lu\n", GetLastError() );
SetLastError(0); ret = pCompareObjectHandles( GetCurrentProcess(), GetCurrentThread() ); ok( !ret && GetLastError() == ERROR_NOT_SAME_OBJECT, - "comparing GetCurrentProcess() to GetCurrentThread() returned %u\n", GetLastError() ); + "comparing GetCurrentProcess() to GetCurrentThread() returned %lu\n", GetLastError() );
h1 = NULL; ret = DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &h1, 0, FALSE, DUPLICATE_SAME_ACCESS ); - ok( ret, "failed to duplicate current process handle: %u\n", GetLastError() ); + ok( ret, "failed to duplicate current process handle: %lu\n", GetLastError() );
ret = pCompareObjectHandles( GetCurrentProcess(), h1 ); - ok( ret, "comparing GetCurrentProcess() with %p failed with %u\n", h1, GetLastError() ); + ok( ret, "comparing GetCurrentProcess() with %p failed with %lu\n", h1, GetLastError() );
CloseHandle( h1 );
h1 = CreateFileA( "\\.\NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); - ok( h1 != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError() ); + ok( h1 != INVALID_HANDLE_VALUE, "CreateFile failed (%ld)\n", GetLastError() );
h2 = NULL; ret = DuplicateHandle( GetCurrentProcess(), h1, GetCurrentProcess(), &h2, 0, FALSE, DUPLICATE_SAME_ACCESS ); - ok( ret, "failed to duplicate handle %p: %u\n", h1, GetLastError() ); + ok( ret, "failed to duplicate handle %p: %lu\n", h1, GetLastError() );
ret = pCompareObjectHandles( h1, h2 ); - ok( ret, "comparing %p with %p failed with %u\n", h1, h2, GetLastError() ); + ok( ret, "comparing %p with %p failed with %lu\n", h1, h2, GetLastError() );
CloseHandle( h2 );
h2 = CreateFileA( "\\.\NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); - ok( h2 != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError() ); + ok( h2 != INVALID_HANDLE_VALUE, "CreateFile failed (%ld)\n", GetLastError() );
SetLastError(0); ret = pCompareObjectHandles( h1, h2 ); ok( !ret && GetLastError() == ERROR_NOT_SAME_OBJECT, - "comparing %p with %p returned %u\n", h1, h2, GetLastError() ); + "comparing %p with %p returned %lu\n", h1, h2, GetLastError() );
CloseHandle( h2 ); CloseHandle( h1 ); diff --git a/dlls/kernelbase/tests/sync.c b/dlls/kernelbase/tests/sync.c index acbfdeff0b7..ecbff6d5707 100644 --- a/dlls/kernelbase/tests/sync.c +++ b/dlls/kernelbase/tests/sync.c @@ -48,7 +48,7 @@ static DWORD WINAPI test_WaitOnAddress_func(void *arg) ret = pWaitOnAddress(&address, &compare, sizeof(compare), INFINITE); ok(ret, "wait failed\n"); ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_SUCCESS) /* Win 8 */, - "got error %d\n", GetLastError()); + "got error %ld\n", GetLastError()); } } while (InterlockedCompareExchange(&address, compare - 1, compare) != compare);
@@ -81,17 +81,17 @@ static void test_WaitOnAddress(void) SetLastError(0xdeadbeef); pWakeByAddressSingle(NULL); gle = GetLastError(); - ok(gle == 0xdeadbeef, "got %d\n", gle); + ok(gle == 0xdeadbeef, "got %ld\n", gle);
SetLastError(0xdeadbeef); pWakeByAddressAll(NULL); gle = GetLastError(); - ok(gle == 0xdeadbeef, "got %d\n", gle); + ok(gle == 0xdeadbeef, "got %ld\n", gle);
SetLastError(0xdeadbeef); ret = pWaitOnAddress(NULL, NULL, 0, 0); gle = GetLastError(); - ok(gle == ERROR_INVALID_PARAMETER, "got %d\n", gle); + ok(gle == ERROR_INVALID_PARAMETER, "got %ld\n", gle); ok(!ret, "got %d\n", ret);
address = 0; @@ -99,7 +99,7 @@ static void test_WaitOnAddress(void) SetLastError(0xdeadbeef); ret = pWaitOnAddress(&address, &compare, 5, 0); gle = GetLastError(); - ok(gle == ERROR_INVALID_PARAMETER, "got %d\n", gle); + ok(gle == ERROR_INVALID_PARAMETER, "got %ld\n", gle); ok(!ret, "got %d\n", ret); ok(address == 0, "got %s\n", wine_dbgstr_longlong(address)); ok(compare == 0, "got %s\n", wine_dbgstr_longlong(compare)); @@ -109,13 +109,13 @@ static void test_WaitOnAddress(void) SetLastError(0xdeadbeef); pWakeByAddressSingle(&address); gle = GetLastError(); - ok(gle == 0xdeadbeef, "got %d\n", gle); + ok(gle == 0xdeadbeef, "got %ld\n", gle); ok(address == 0, "got %s\n", wine_dbgstr_longlong(address));
SetLastError(0xdeadbeef); pWakeByAddressAll(&address); gle = GetLastError(); - ok(gle == 0xdeadbeef, "got %d\n", gle); + ok(gle == 0xdeadbeef, "got %ld\n", gle); ok(address == 0, "got %s\n", wine_dbgstr_longlong(address));
/* different address size */ @@ -124,13 +124,13 @@ static void test_WaitOnAddress(void) SetLastError(0xdeadbeef); ret = pWaitOnAddress(&address, &compare, 2, 0); gle = GetLastError(); - ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle); + ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %ld\n", gle); ok(ret, "got %d\n", ret);
SetLastError(0xdeadbeef); ret = pWaitOnAddress(&address, &compare, 1, 0); gle = GetLastError(); - ok(gle == ERROR_TIMEOUT, "got %d\n", gle); + ok(gle == ERROR_TIMEOUT, "got %ld\n", gle); ok(!ret, "got %d\n", ret);
/* simple wait case */ @@ -139,7 +139,7 @@ static void test_WaitOnAddress(void) SetLastError(0xdeadbeef); ret = pWaitOnAddress(&address, &compare, 4, 0); gle = GetLastError(); - ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle); + ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %ld\n", gle); ok(ret, "got %d\n", ret);
/* WakeByAddressAll */ @@ -151,7 +151,7 @@ static void test_WaitOnAddress(void) address = ARRAY_SIZE(threads); pWakeByAddressAll(&address); val = WaitForMultipleObjects(ARRAY_SIZE(threads), threads, TRUE, 5000); - ok(val == WAIT_OBJECT_0, "got %d\n", val); + ok(val == WAIT_OBJECT_0, "got %ld\n", val); for (i = 0; i < ARRAY_SIZE(threads); i++) CloseHandle(threads[i]); ok(!address, "got unexpected value %s\n", wine_dbgstr_longlong(address)); @@ -168,7 +168,7 @@ static void test_WaitOnAddress(void) { pWakeByAddressSingle(&address); val = WaitForMultipleObjects(nthreads, threads, FALSE, 2000); - ok(val < WAIT_OBJECT_0 + nthreads, "got %u\n", val); + ok(val < WAIT_OBJECT_0 + nthreads, "got %lu\n", val); CloseHandle(threads[val]); memmove(&threads[val], &threads[val+1], (nthreads - val - 1) * sizeof(threads[0])); nthreads--; @@ -195,7 +195,7 @@ static void test_Sleep(void) /* Get the timer resolution before... */ r1 = 156250; status = NtQueryTimerResolution(&dummy, &dummy, &r1); - ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%x)\n", status); + ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%lx)\n", status);
for (i = 0; i < 50; i++) { Sleep(1); @@ -207,7 +207,7 @@ static void test_Sleep(void) /* ...and after in case some other process changes it during this test */ r2 = 156250; status = NtQueryTimerResolution(&dummy, &dummy, &r2); - ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%x)\n", status); + ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%lx)\n", status);
elapsed_time = (t2.QuadPart - t1.QuadPart) / (double)frequency.QuadPart; min = 50.0 * (r1 < r2 ? r1 : r2) / 10000000.0;
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/localspl/tests/Makefile.in | 1 dlls/localspl/tests/localmon.c | 250 ++++++++++++++++++++------------------- 2 files changed, 125 insertions(+), 126 deletions(-)
diff --git a/dlls/localspl/tests/Makefile.in b/dlls/localspl/tests/Makefile.in index 916a661a67b..2c2785fae16 100644 --- a/dlls/localspl/tests/Makefile.in +++ b/dlls/localspl/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = localspl.dll IMPORTS = advapi32
diff --git a/dlls/localspl/tests/localmon.c b/dlls/localspl/tests/localmon.c index a612cc0ffec..af9ce899476 100644 --- a/dlls/localspl/tests/localmon.c +++ b/dlls/localspl/tests/localmon.c @@ -316,11 +316,11 @@ static void test_AddPort(void)
SetLastError(0xdeadbeef); res = pAddPort(NULL, 0, emptyW); - ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError()); + ok(!res, "returned %ld with %lu (expected '0')\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pAddPort(NULL, 0, does_not_existW); - ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError()); + ok(!res, "returned %ld with %lu (expected '0')\n", res, GetLastError());
}
@@ -349,15 +349,15 @@ static void test_AddPortEx(void) but works with native localspl.dll in wine */ SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 1, (LPBYTE) &pi, LocalPortW); - trace("returned %u with %u\n", res, GetLastError() ); - ok( res, "got %u with %u (expected '!= 0')\n", res, GetLastError()); + trace("returned %lu with %lu\n", res, GetLastError() ); + ok( res, "got %lu with %lu (expected '!= 0')\n", res, GetLastError());
/* port already exists: */ SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 1, (LPBYTE) &pi, LocalPortW); - trace("returned %u with %u\n", res, GetLastError() ); + trace("returned %lu with %lu\n", res, GetLastError() ); ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER), - "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError()); delete_port(tempfileW);
@@ -366,27 +366,27 @@ static void test_AddPortEx(void) localspl.dll fails always with ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 1, (LPBYTE) &pi, NULL); - trace("returned %u with %u\n", res, GetLastError() ); + trace("returned %lu with %lu\n", res, GetLastError() ); ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER), - "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError()); if (res) delete_port(tempfileW);
SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 1, (LPBYTE) &pi, emptyW); - trace("returned %u with %u\n", res, GetLastError() ); + trace("returned %lu with %lu\n", res, GetLastError() ); ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER), - "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError()); if (res) delete_port(tempfileW);
SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 1, (LPBYTE) &pi, does_not_existW); - trace("returned %u with %u\n", res, GetLastError() ); + trace("returned %lu with %lu\n", res, GetLastError() ); ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER), - "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError()); if (res) delete_port(tempfileW); } @@ -395,7 +395,7 @@ static void test_AddPortEx(void) SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 1, (LPBYTE) &pi, LocalPortW); ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER), - "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError());
/* level 2 is documented as supported for Printmonitors, @@ -409,7 +409,7 @@ static void test_AddPortEx(void) SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 2, (LPBYTE) &pi, LocalPortW); ok( !res && (GetLastError() == ERROR_INVALID_LEVEL), - "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_LEVEL)\n", res, GetLastError()); if (res) delete_port(tempfileW);
@@ -418,7 +418,7 @@ static void test_AddPortEx(void) SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 0, (LPBYTE) &pi, LocalPortW); ok( !res && (GetLastError() == ERROR_INVALID_LEVEL), - "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_LEVEL)\n", res, GetLastError()); if (res) delete_port(tempfileW);
@@ -426,7 +426,7 @@ static void test_AddPortEx(void) SetLastError(0xdeadbeef); res = pAddPortEx(NULL, 3, (LPBYTE) &pi, LocalPortW); ok( !res && (GetLastError() == ERROR_INVALID_LEVEL), - "got %u with %u (expected '0' with ERROR_INVALID_LEVEL)\n", + "got %lu with %lu (expected '0' with ERROR_INVALID_LEVEL)\n", res, GetLastError()); if (res) delete_port(tempfileW);
@@ -458,13 +458,13 @@ static void test_ClosePort(void) if (res2 && (hPort2 != hPort)) { SetLastError(0xdeadbeef); res2 = pClosePort(hPort2); - ok(res2, "got %u with %u (expected '!= 0')\n", res2, GetLastError()); + ok(res2, "got %lu with %lu (expected '!= 0')\n", res2, GetLastError()); }
if (res) { SetLastError(0xdeadbeef); res = pClosePort(hPort); - ok(res, "got %u with %u (expected '!= 0')\n", res, GetLastError()); + ok(res, "got %lu with %lu (expected '!= 0')\n", res, GetLastError()); } }
@@ -480,13 +480,13 @@ static void test_ClosePort(void) if (res2 && (hPort2 != hPort)) { SetLastError(0xdeadbeef); res2 = pClosePort(hPort2); - ok(res2, "got %u with %u (expected '!= 0')\n", res2, GetLastError()); + ok(res2, "got %lu with %lu (expected '!= 0')\n", res2, GetLastError()); }
if (res) { SetLastError(0xdeadbeef); res = pClosePort(hPort); - ok(res, "got %u with %u (expected '!= 0')\n", res, GetLastError()); + ok(res, "got %lu with %lu (expected '!= 0')\n", res, GetLastError()); } }
@@ -502,13 +502,13 @@ static void test_ClosePort(void) if (res2 && (hPort2 != hPort)) { SetLastError(0xdeadbeef); res2 = pClosePort(hPort2); - ok(res2, "got %u with %u (expected '!= 0')\n", res2, GetLastError()); + ok(res2, "got %lu with %lu (expected '!= 0')\n", res2, GetLastError()); }
if (res) { SetLastError(0xdeadbeef); res = pClosePort(hPort); - ok(res, "got %u with %u (expected '!= 0')\n", res, GetLastError()); + ok(res, "got %lu with %lu (expected '!= 0')\n", res, GetLastError()); }
} @@ -518,15 +518,15 @@ static void test_ClosePort(void)
SetLastError(0xdeadbeef); res = pClosePort(NULL); - trace("got %u with %u\n", res, GetLastError()); + trace("got %lu with %lu\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pClosePort( (HANDLE) 0xdeadbeef); - trace("got %u with %u\n", res, GetLastError()); + trace("got %lu with %lu\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pClosePort(INVALID_HANDLE_VALUE); - trace("got %u with %u\n", res, GetLastError()); + trace("got %lu with %lu\n", res, GetLastError()); }
} @@ -560,15 +560,15 @@ static void test_ConfigurePort(void)
SetLastError(0xdeadbeef); res = pConfigurePort(NULL, 0, portname_com1W); - trace("returned %d with %u\n", res, GetLastError()); + trace("returned %ld with %lu\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pConfigurePort(NULL, 0, portname_lpt1W); - trace("returned %d with %u\n", res, GetLastError()); + trace("returned %ld with %lu\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pConfigurePort(NULL, 0, portname_fileW); - trace("returned %d with %u\n", res, GetLastError()); + trace("returned %ld with %lu\n", res, GetLastError()); } }
@@ -597,11 +597,11 @@ static void test_DeletePort(void)
SetLastError(0xdeadbeef); res = pDeletePort(NULL, 0, emptyW); - ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError()); + ok(!res, "returned %ld with %lu (expected '0')\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pDeletePort(NULL, 0, does_not_existW); - ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError()); + ok(!res, "returned %ld with %lu (expected '0')\n", res, GetLastError());
}
@@ -631,13 +631,13 @@ static void test_EnumPorts(void) /* NT4 fails with ERROR_INVALID_LEVEL (as expected) XP succeeds with ERROR_SUCCESS () */ ok( (cbBuf == 0) && (pcReturned == 0), - "(%d) returned %d with %u and %d, %d (expected 0, 0)\n", + "(%ld) returned %ld with %lu and %ld, %ld (expected 0, 0)\n", level, res, GetLastError(), cbBuf, pcReturned); continue; }
ok( !res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), - "(%d) returned %d with %u and %d, %d (expected '0' with " + "(%ld) returned %ld with %lu and %ld, %ld (expected '0' with " "ERROR_INSUFFICIENT_BUFFER)\n", level, res, GetLastError(), cbBuf, pcReturned);
@@ -648,7 +648,7 @@ static void test_EnumPorts(void) pcReturned = 0xdeadbeef; SetLastError(0xdeadbeef); res = pEnumPorts(NULL, level, buffer, cbBuf, &pcbNeeded, &pcReturned); - ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n", + ok( res, "(%ld) returned %ld with %lu and %ld, %ld (expected '!= 0')\n", level, res, GetLastError(), pcbNeeded, pcReturned); /* We can compare the returned Data with the Registry / "win.ini",[Ports] here */
@@ -656,7 +656,7 @@ static void test_EnumPorts(void) pcReturned = 0xdeadbeef; SetLastError(0xdeadbeef); res = pEnumPorts(NULL, level, buffer, cbBuf+1, &pcbNeeded, &pcReturned); - ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n", + ok( res, "(%ld) returned %ld with %lu and %ld, %ld (expected '!= 0')\n", level, res, GetLastError(), pcbNeeded, pcReturned);
pcbNeeded = 0xdeadbeef; @@ -664,7 +664,7 @@ static void test_EnumPorts(void) SetLastError(0xdeadbeef); res = pEnumPorts(NULL, level, buffer, cbBuf-1, &pcbNeeded, &pcReturned); ok( !res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), - "(%d) returned %d with %u and %d, %d (expected '0' with " + "(%ld) returned %ld with %lu and %ld, %ld (expected '0' with " "ERROR_INSUFFICIENT_BUFFER)\n", level, res, GetLastError(), pcbNeeded, pcReturned);
@@ -681,14 +681,14 @@ static void test_EnumPorts(void) pcReturned = 0xdeadbeef; SetLastError(0xdeadbeef); res = pEnumPorts(emptyW, level, buffer, cbBuf+1, &pcbNeeded, &pcReturned); - ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n", + ok( res, "(%ld) returned %ld with %lu and %ld, %ld (expected '!= 0')\n", level, res, GetLastError(), pcbNeeded, pcReturned);
pcbNeeded = 0xdeadbeef; pcReturned = 0xdeadbeef; SetLastError(0xdeadbeef); res = pEnumPorts(server_does_not_existW, level, buffer, cbBuf+1, &pcbNeeded, &pcReturned); - ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n", + ok( res, "(%ld) returned %ld with %lu and %ld, %ld (expected '!= 0')\n", level, res, GetLastError(), pcbNeeded, pcReturned);
HeapFree(GetProcessHeap(), 0, buffer); @@ -708,21 +708,21 @@ static void test_InitializePrintMonitor(void) res = pInitializePrintMonitor(NULL); /* The Parameter was unchecked before w2k */ ok( res || (GetLastError() == ERROR_INVALID_PARAMETER), - "returned %p with %u\n (expected '!= NULL' or: NULL with " + "returned %p with %lu\n (expected '!= NULL' or: NULL with " "ERROR_INVALID_PARAMETER)\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pInitializePrintMonitor(emptyW); ok( res || (GetLastError() == ERROR_INVALID_PARAMETER), - "returned %p with %u\n (expected '!= NULL' or: NULL with " + "returned %p with %lu\n (expected '!= NULL' or: NULL with " "ERROR_INVALID_PARAMETER)\n", res, GetLastError());
/* Every call with a non-empty string returns the same Pointer */ SetLastError(0xdeadbeef); res = pInitializePrintMonitor(Monitors_LocalPortW); ok( res == pm, - "returned %p with %u (expected %p)\n", res, GetLastError(), pm); - ok(res->dwMonitorSize == sizeof(MONITOR), "wrong dwMonitorSize %u\n", res->dwMonitorSize); + "returned %p with %lu (expected %p)\n", res, GetLastError(), pm); + ok(res->dwMonitorSize == sizeof(MONITOR), "wrong dwMonitorSize %lu\n", res->dwMonitorSize); }
static void test_InitializePrintMonitor2(void) @@ -740,8 +740,8 @@ static void test_InitializePrintMonitor2(void) init.bLocal = TRUE;
monitor2 = pInitializePrintMonitor2(&init, &hmon); - ok(monitor2 != NULL, "InitializePrintMonitor2 error %u\n", GetLastError()); - ok(monitor2->cbSize >= FIELD_OFFSET(MONITOR2, pfnSendRecvBidiDataFromPort), "wrong cbSize %u\n", monitor2->cbSize); + ok(monitor2 != NULL, "InitializePrintMonitor2 error %lu\n", GetLastError()); + ok(monitor2->cbSize >= FIELD_OFFSET(MONITOR2, pfnSendRecvBidiDataFromPort), "wrong cbSize %lu\n", monitor2->cbSize); }
/* ########################### */ @@ -762,14 +762,14 @@ static void test_OpenPort(void) hPort = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res = pOpenPort(nameW, &hPort); - ok( res, "got %u with %u and %p (expected '!= 0')\n", + ok( res, "got %lu with %lu and %p (expected '!= 0')\n", res, GetLastError(), hPort);
/* the same HANDLE is returned for a second OpenPort in native localspl */ hPort2 = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res2 = pOpenPort(nameW, &hPort2); - ok( res2, "got %u with %u and %p (expected '!= 0')\n", + ok( res2, "got %lu with %lu and %p (expected '!= 0')\n", res2, GetLastError(), hPort2);
if (res) pClosePort(hPort); @@ -783,7 +783,7 @@ static void test_OpenPort(void) SetLastError(0xdeadbeef); res = pOpenPort(nameW, &hPort); ok( res || (GetLastError() == ERROR_ACCESS_DENIED), - "got %u with %u and %p (expected '!= 0' or '0' with ERROR_ACCESS_DENIED)\n", + "got %lu with %lu and %p (expected '!= 0' or '0' with ERROR_ACCESS_DENIED)\n", res, GetLastError(), hPort);
/* the same HANDLE is returned for a second OpenPort in native localspl */ @@ -791,7 +791,7 @@ static void test_OpenPort(void) SetLastError(0xdeadbeef); res2 = pOpenPort(nameW, &hPort2); ok( res2 || (GetLastError() == ERROR_ACCESS_DENIED), - "got %u with %u and %p (expected '!= 0' or '0' with ERROR_ACCESS_DENIED)\n", + "got %lu with %lu and %p (expected '!= 0' or '0' with ERROR_ACCESS_DENIED)\n", res2, GetLastError(), hPort2);
if (res) pClosePort(hPort); @@ -804,7 +804,7 @@ static void test_OpenPort(void) hPort = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res = pOpenPort(nameW, &hPort); - ok( res, "got %u with %u and %p (expected '!= 0')\n", + ok( res, "got %lu with %lu and %p (expected '!= 0')\n", res, GetLastError(), hPort);
/* a different HANDLE is returned for a second OpenPort */ @@ -812,7 +812,7 @@ static void test_OpenPort(void) SetLastError(0xdeadbeef); res2 = pOpenPort(nameW, &hPort2); ok( res2 && (hPort2 != hPort), - "got %u with %u and %p (expected '!= 0' and '!= %p')\n", + "got %lu with %lu and %p (expected '!= 0' and '!= %p')\n", res2, GetLastError(), hPort2, hPort);
if (res) pClosePort(hPort); @@ -825,7 +825,7 @@ static void test_OpenPort(void) hPort = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res = pOpenPort(nameW, NULL); - trace("got %u with %u and %p\n", res, GetLastError(), hPort); + trace("got %lu with %lu and %p\n", res, GetLastError(), hPort); } }
@@ -833,14 +833,14 @@ static void test_OpenPort(void) SetLastError(0xdeadbeef); res = pOpenPort(does_not_existW, &hPort); ok (!res && (hPort == (HANDLE) 0xdeadbeef), - "got %u with 0x%x and %p (expected '0' and 0xdeadbeef)\n", res, GetLastError(), hPort); + "got %lu with 0x%lx and %p (expected '0' and 0xdeadbeef)\n", res, GetLastError(), hPort); if (res) pClosePort(hPort);
hPort = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res = pOpenPort(emptyW, &hPort); ok (!res && (hPort == (HANDLE) 0xdeadbeef), - "got %u with 0x%x and %p (expected '0' and 0xdeadbeef)\n", res, GetLastError(), hPort); + "got %lu with 0x%lx and %p (expected '0' and 0xdeadbeef)\n", res, GetLastError(), hPort); if (res) pClosePort(hPort);
@@ -849,7 +849,7 @@ static void test_OpenPort(void) hPort = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res = pOpenPort(NULL, &hPort); - trace("got %u with %u and %p\n", res, GetLastError(), hPort); + trace("got %lu with %lu and %p\n", res, GetLastError(), hPort); }
} @@ -873,12 +873,12 @@ static void test_XcvClosePort(void) SetLastError(0xdeadbeef); hXcv2 = (HANDLE) 0xdeadbeef; res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv2); - ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); + ok(res, "returned %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv2);
if (res) { SetLastError(0xdeadbeef); res = pXcvClosePort(hXcv2); - ok(res, "returned %d with %u (expected '!= 0')\n", res, GetLastError()); + ok(res, "returned %ld with %lu (expected '!= 0')\n", res, GetLastError());
if (0) { @@ -907,17 +907,17 @@ static void test_XcvDataPort_AddPort(void) /* create a Port for a normal, writable file */ SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_AddPortW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, NULL); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError());
/* add our testport again */ SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_AddPortW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, NULL); - ok( res == ERROR_ALREADY_EXISTS, "returned %d with %u (expected ERROR_ALREADY_EXISTS)\n", res, GetLastError()); + ok( res == ERROR_ALREADY_EXISTS, "returned %ld with %lu (expected ERROR_ALREADY_EXISTS)\n", res, GetLastError());
/* create a well-known Port */ SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_AddPortW, (PBYTE) portname_lpt1W, (lstrlenW(portname_lpt1W) + 1) * sizeof(WCHAR), NULL, 0, NULL); - ok( res == ERROR_ALREADY_EXISTS, "returned %d with %u (expected ERROR_ALREADY_EXISTS)\n", res, GetLastError()); + ok( res == ERROR_ALREADY_EXISTS, "returned %ld with %lu (expected ERROR_ALREADY_EXISTS)\n", res, GetLastError());
/* ERROR_ALREADY_EXISTS is also returned from native localspl.dll on wine, when "RPT1:" was already installed for redmonnt.dll: @@ -927,7 +927,7 @@ static void test_XcvDataPort_AddPort(void) /* cleanup */ SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_DeletePortW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, NULL); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError()); }
} @@ -952,14 +952,14 @@ static void test_XcvDataPort_ConfigureLPTPortCommandOK(void)
if (res != ERROR_SUCCESS) { /* unable to open the registry: skip the test */ - skip("got %d\n", res); + skip("got %ld\n", res); return; } org_value[0] = '\0'; needed = sizeof(org_value)-1 ; res = RegQueryValueExA(hroot, TransmissionRetryTimeoutA, NULL, NULL, (PBYTE) org_value, &needed); ok( (res == ERROR_SUCCESS) || (res == ERROR_FILE_NOT_FOUND), - "returned %u and %u for "%s" (expected ERROR_SUCCESS or " + "returned %lu and %lu for "%s" (expected ERROR_SUCCESS or " "ERROR_FILE_NOT_FOUND)\n", res, needed, org_value);
RegDeleteValueA(hroot, TransmissionRetryTimeoutA); @@ -972,11 +972,11 @@ static void test_XcvDataPort_ConfigureLPTPortCommandOK(void) skip("'ConfigureLPTPortCommandOK' not supported\n"); return; } - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError()); needed = sizeof(buffer)-1 ; res = RegQueryValueExA(hroot, TransmissionRetryTimeoutA, NULL, NULL, (PBYTE) buffer, &needed); ok( (res == ERROR_SUCCESS) && (lstrcmpA(buffer, num_0A) == 0), - "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n", + "returned %ld and '%s' (expected ERROR_SUCCESS and '%s')\n", res, buffer, num_0A);
@@ -984,33 +984,33 @@ static void test_XcvDataPort_ConfigureLPTPortCommandOK(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_ConfigureLPTPortCommandOKW, (PBYTE) num_1W, sizeof(num_1W), NULL, 0, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError()); needed = sizeof(buffer)-1 ; res = RegQueryValueExA(hroot, TransmissionRetryTimeoutA, NULL, NULL, (PBYTE) buffer, &needed); ok( (res == ERROR_SUCCESS) && (lstrcmpA(buffer, num_1A) == 0), - "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n", + "returned %ld and '%s' (expected ERROR_SUCCESS and '%s')\n", res, buffer, num_1A);
/* set to "999999" */ needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_ConfigureLPTPortCommandOKW, (PBYTE) num_999999W, sizeof(num_999999W), NULL, 0, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError()); needed = sizeof(buffer)-1 ; res = RegQueryValueExA(hroot, TransmissionRetryTimeoutA, NULL, NULL, (PBYTE) buffer, &needed); ok( (res == ERROR_SUCCESS) && (lstrcmpA(buffer, num_999999A) == 0), - "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n", + "returned %ld and '%s' (expected ERROR_SUCCESS and '%s')\n", res, buffer, num_999999A);
/* set to "1000000" */ needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_ConfigureLPTPortCommandOKW, (PBYTE) num_1000000W, sizeof(num_1000000W), NULL, 0, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError()); needed = sizeof(buffer)-1 ; res = RegQueryValueExA(hroot, TransmissionRetryTimeoutA, NULL, NULL, (PBYTE) buffer, &needed); ok( (res == ERROR_SUCCESS) && (lstrcmpA(buffer, num_1000000A) == 0), - "returned %d and '%s' (expected ERROR_SUCCESS and '%s')\n", + "returned %ld and '%s' (expected ERROR_SUCCESS and '%s')\n", res, buffer, num_1000000A);
/* using cmd_ConfigureLPTPortCommandOKW with does_not_existW: @@ -1021,7 +1021,7 @@ static void test_XcvDataPort_ConfigureLPTPortCommandOK(void) RegDeleteValueA(hroot, TransmissionRetryTimeoutA); if (org_value[0]) { res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)org_value, lstrlenA(org_value)+1); - ok(res == ERROR_SUCCESS, "unable to restore original value (got %u): %s\n", res, org_value); + ok(res == ERROR_SUCCESS, "unable to restore original value (got %lu): %s\n", res, org_value); }
RegCloseKey(hroot); @@ -1041,7 +1041,7 @@ static void test_XcvDataPort_DeletePort(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_DeletePortW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, &needed); ok( !res || (res == ERROR_FILE_NOT_FOUND), - "returned %d with %u (expected ERROR_SUCCESS or ERROR_FILE_NOT_FOUND)\n", + "returned %ld with %lu (expected ERROR_SUCCESS or ERROR_FILE_NOT_FOUND)\n", res, GetLastError());
@@ -1053,7 +1053,7 @@ static void test_XcvDataPort_DeletePort(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_DeletePortW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, &needed); ok( res == ERROR_FILE_NOT_FOUND, - "returned %d with %u (expected ERROR_FILE_NOT_FOUND)\n", res, GetLastError()); + "returned %ld with %lu (expected ERROR_FILE_NOT_FOUND)\n", res, GetLastError());
/* emptyW as Portname: ERROR_FILE_NOT_FOUND is returned */ /* NULL as Portname: Native localspl.dll crashed */ @@ -1082,8 +1082,8 @@ static void test_XcvDataPort_GetTransmissionRetryTimeout(void) } len = sizeof(DWORD); ok( (res == ERROR_INSUFFICIENT_BUFFER) && (needed == len), - "returned %d with %u and %u (expected ERROR_INSUFFICIENT_BUFFER " - "and '%u')\n", res, GetLastError(), needed, len); + "returned %ld with %lu and %lu (expected ERROR_INSUFFICIENT_BUFFER " + "and '%lu')\n", res, GetLastError(), needed, len); len = needed;
/* Read the original value from the registry */ @@ -1095,7 +1095,7 @@ static void test_XcvDataPort_GetTransmissionRetryTimeout(void)
if (res != ERROR_SUCCESS) { /* unable to open the registry: skip the test */ - skip("got %d\n", res); + skip("got %ld\n", res); return; }
@@ -1103,7 +1103,7 @@ static void test_XcvDataPort_GetTransmissionRetryTimeout(void) needed = sizeof(org_value)-1 ; res = RegQueryValueExA(hroot, TransmissionRetryTimeoutA, NULL, NULL, (PBYTE) org_value, &needed); ok( (res == ERROR_SUCCESS) || (res == ERROR_FILE_NOT_FOUND), - "returned %u and %u for "%s" (expected ERROR_SUCCESS or " + "returned %lu and %lu for "%s" (expected ERROR_SUCCESS or " "ERROR_FILE_NOT_FOUND)\n", res, needed, org_value);
/* Get default value (documented as 90 in the w2k reskit, but that is wrong) */ @@ -1113,68 +1113,68 @@ static void test_XcvDataPort_GetTransmissionRetryTimeout(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_GetTransmissionRetryTimeoutW, NULL, 0, (PBYTE) buffer, len, &needed); ok( (res == ERROR_SUCCESS) && (buffer[0] == 45), - "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS " + "returned %ld with %lu and %lu for %ld\n (expected ERROR_SUCCESS " "for '45')\n", res, GetLastError(), needed, buffer[0]);
/* the default timeout is returned, when the value is empty */ res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)emptyA, 1); - ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", GetLastError()); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", GetLastError()); needed = (DWORD) 0xdeadbeef; buffer[0] = 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_GetTransmissionRetryTimeoutW, NULL, 0, (PBYTE) buffer, len, &needed); ok( (res == ERROR_SUCCESS) && (buffer[0] == 45), - "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS " + "returned %ld with %lu and %lu for %ld\n (expected ERROR_SUCCESS " "for '45')\n", res, GetLastError(), needed, buffer[0]);
/* the dialog is limited (1 - 999999), but that is done somewhere else */ res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)num_0A, lstrlenA(num_0A)+1); - ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", GetLastError()); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", GetLastError()); needed = (DWORD) 0xdeadbeef; buffer[0] = 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_GetTransmissionRetryTimeoutW, NULL, 0, (PBYTE) buffer, len, &needed); ok( (res == ERROR_SUCCESS) && (buffer[0] == 0), - "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS " + "returned %ld with %lu and %lu for %ld\n (expected ERROR_SUCCESS " "for '0')\n", res, GetLastError(), needed, buffer[0]);
res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)num_1A, lstrlenA(num_1A)+1); - ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", GetLastError()); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", GetLastError()); needed = (DWORD) 0xdeadbeef; buffer[0] = 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_GetTransmissionRetryTimeoutW, NULL, 0, (PBYTE) buffer, len, &needed); ok( (res == ERROR_SUCCESS) && (buffer[0] == 1), - "returned %d with %u and %u for %d\n (expected 'ERROR_SUCCESS' " + "returned %ld with %lu and %lu for %ld\n (expected 'ERROR_SUCCESS' " "for '1')\n", res, GetLastError(), needed, buffer[0]);
res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)num_999999A, lstrlenA(num_999999A)+1); - ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", GetLastError()); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", GetLastError()); needed = (DWORD) 0xdeadbeef; buffer[0] = 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_GetTransmissionRetryTimeoutW, NULL, 0, (PBYTE) buffer, len, &needed); ok( (res == ERROR_SUCCESS) && (buffer[0] == 999999), - "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS " + "returned %ld with %lu and %lu for %ld\n (expected ERROR_SUCCESS " "for '999999')\n", res, GetLastError(), needed, buffer[0]);
res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)num_1000000A, lstrlenA(num_1000000A)+1); - ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", GetLastError()); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", GetLastError()); needed = (DWORD) 0xdeadbeef; buffer[0] = 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_GetTransmissionRetryTimeoutW, NULL, 0, (PBYTE) buffer, len, &needed); ok( (res == ERROR_SUCCESS) && (buffer[0] == 1000000), - "returned %d with %u and %u for %d\n (expected ERROR_SUCCESS " + "returned %ld with %lu and %lu for %ld\n (expected ERROR_SUCCESS " "for '1000000')\n", res, GetLastError(), needed, buffer[0]);
/* restore the original value */ RegDeleteValueA(hroot, TransmissionRetryTimeoutA); if (org_value[0]) { res = RegSetValueExA(hroot, TransmissionRetryTimeoutA, 0, REG_SZ, (PBYTE)org_value, lstrlenA(org_value)+1); - ok(res == ERROR_SUCCESS, "unable to restore original value (got %u): %s\n", res, org_value); + ok(res == ERROR_SUCCESS, "unable to restore original value (got %lu): %s\n", res, org_value); }
RegCloseKey(hroot); @@ -1199,11 +1199,11 @@ static void test_XcvDataPort_MonitorUI(void) return; } ok( (res == ERROR_INSUFFICIENT_BUFFER) && (needed <= MAX_PATH), - "returned %d with %u and 0x%x (expected 'ERROR_INSUFFICIENT_BUFFER' " + "returned %ld with %lu and 0x%lx (expected 'ERROR_INSUFFICIENT_BUFFER' " " and '<= MAX_PATH')\n", res, GetLastError(), needed);
if (needed > MAX_PATH) { - skip("buffer overflow (%u)\n", needed); + skip("buffer overflow (%lu)\n", needed); return; } len = needed; @@ -1212,7 +1212,7 @@ static void test_XcvDataPort_MonitorUI(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, emptyW, NULL, 0, NULL, 0, &needed); - ok( res == ERROR_INVALID_PARAMETER, "returned %d with %u and 0x%x " + ok( res == ERROR_INVALID_PARAMETER, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_INVALID_PARAMETER')\n", res, GetLastError(), needed);
if (0) { @@ -1227,7 +1227,7 @@ static void test_XcvDataPort_MonitorUI(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(NULL, cmd_MonitorUIW, NULL, 0, buffer, len, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x " + ok( res == ERROR_SUCCESS, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed);
@@ -1236,14 +1236,14 @@ static void test_XcvDataPort_MonitorUI(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_MonitorUI_lcaseW, NULL, 0, buffer, len, &needed); - ok( res == ERROR_INVALID_PARAMETER, "returned %d with %u and 0x%x " + ok( res == ERROR_INVALID_PARAMETER, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_INVALID_PARAMETER')\n", res, GetLastError(), needed);
/* off by one: larger */ needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len+1, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x " + ok( res == ERROR_SUCCESS, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed);
@@ -1252,7 +1252,7 @@ static void test_XcvDataPort_MonitorUI(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len-1, &needed); - ok( res == ERROR_INSUFFICIENT_BUFFER, "returned %d with %u and 0x%x " + ok( res == ERROR_INSUFFICIENT_BUFFER, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_INSUFFICIENT_BUFFER')\n", res, GetLastError(), needed);
/* Normal use. The DLL-Name without a Path is returned */ @@ -1260,7 +1260,7 @@ static void test_XcvDataPort_MonitorUI(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x " + ok( res == ERROR_SUCCESS, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed);
@@ -1272,7 +1272,7 @@ static void test_XcvDataPort_MonitorUI(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv_noaccess, cmd_MonitorUIW, NULL, 0, buffer, sizeof(buffer), &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x " + ok( res == ERROR_SUCCESS, "returned %ld with %lu and 0x%lx " "(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed); }
@@ -1291,7 +1291,7 @@ static void test_XcvDataPort_PortIsValid(void) skip("'PostIsValid' not supported\n"); return; } - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError());
if (0) { @@ -1304,13 +1304,13 @@ static void test_XcvDataPort_PortIsValid(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(NULL, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, NULL); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError());
/* needed is ignored */ needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, NULL); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError());
/* cbInputData is ignored */ @@ -1318,28 +1318,28 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, 0, NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, 1, NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W) -1, NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W) -2, NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
@@ -1348,7 +1348,7 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) emptyW, sizeof(emptyW), NULL, 0, &needed); ok( res == ERROR_PATH_NOT_FOUND, - "returned %d with %u and 0x%x (expected ERROR_PATH_NOT_FOUND)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_PATH_NOT_FOUND)\n", res, GetLastError(), needed);
@@ -1358,7 +1358,7 @@ static void test_XcvDataPort_PortIsValid(void) res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) tempdirW, (lstrlenW(tempdirW) + 1) * sizeof(WCHAR), NULL, 0, &needed); /* XP(admin): ERROR_INVALID_NAME, XP(user): ERROR_PATH_NOT_FOUND, w2k ERROR_ACCESS_DENIED */ ok( (res == ERROR_INVALID_NAME) || (res == ERROR_PATH_NOT_FOUND) || - (res == ERROR_ACCESS_DENIED), "returned %d with %u and 0x%x " + (res == ERROR_ACCESS_DENIED), "returned %ld with %lu and 0x%lx " "(expected ERROR_INVALID_NAME, ERROR_PATH_NOT_FOUND or ERROR_ACCESS_DENIED)\n", res, GetLastError(), needed);
@@ -1368,7 +1368,7 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt2W, sizeof(portname_lpt2W), NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
@@ -1376,7 +1376,7 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_com1W, sizeof(portname_com1W), NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
@@ -1384,7 +1384,7 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_com2W, sizeof(portname_com2W), NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
@@ -1392,7 +1392,7 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_fileW, sizeof(portname_fileW), NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
@@ -1401,7 +1401,7 @@ static void test_XcvDataPort_PortIsValid(void) SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, &needed); ok( res == ERROR_SUCCESS, - "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + "returned %ld with %lu and 0x%lx (expected ERROR_SUCCESS)\n", res, GetLastError(), needed);
@@ -1412,7 +1412,7 @@ static void test_XcvDataPort_PortIsValid(void) needed = (DWORD) 0xdeadbeef; SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv_noaccess, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, &needed); - ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + ok( res == ERROR_SUCCESS, "returned %ld with %lu (expected ERROR_SUCCESS)\n", res, GetLastError());
}
@@ -1436,7 +1436,7 @@ static void test_XcvOpenPort(void) SetLastError(0xdeadbeef); hXcv2 = (HANDLE) 0xdeadbeef; res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv2); - ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); + ok(res, "returned %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); if (res) pXcvClosePort(hXcv2);
@@ -1444,7 +1444,7 @@ static void test_XcvOpenPort(void) SetLastError(0xdeadbeef); hXcv2 = (HANDLE) 0xdeadbeef; res = pXcvOpenPort(emptyW, 0, &hXcv2); - ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); + ok(res, "returned %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); if (res) pXcvClosePort(hXcv2);
@@ -1452,13 +1452,13 @@ static void test_XcvOpenPort(void) SetLastError(0xdeadbeef); hXcv2 = (HANDLE) 0xdeadbeef; res = pXcvOpenPort(portname_lpt1W, SERVER_ALL_ACCESS, &hXcv2); - ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); + ok(res, "returned %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); if (res) pXcvClosePort(hXcv2);
SetLastError(0xdeadbeef); hXcv2 = (HANDLE) 0xdeadbeef; res = pXcvOpenPort(portname_fileW, SERVER_ALL_ACCESS, &hXcv2); - ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); + ok(res, "returned %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv2); if (res) pXcvClosePort(hXcv2);
} @@ -1489,9 +1489,9 @@ START_TEST(localmon) tempdirW[0] = '\0'; tempfileW[0] = '\0'; res = GetTempPathW(MAX_PATH, tempdirW); - ok(res != 0, "with %u\n", GetLastError()); + ok(res != 0, "with %lu\n", GetLastError()); res = GetTempFileNameW(tempdirW, wineW, 0, tempfileW); - ok(res != 0, "with %u\n", GetLastError()); + ok(res != 0, "with %lu\n", GetLastError());
pInitializePrintMonitor = (void *) GetProcAddress(hdll, "InitializePrintMonitor"); pInitializePrintMonitor2 = (void *) GetProcAddress(hdll, "InitializePrintMonitor2"); @@ -1524,22 +1524,22 @@ START_TEST(localmon) init.bLocal = TRUE;
pm2 = pInitializePrintMonitor2(&init, &hmon); - ok(pm2 != NULL, "InitializePrintMonitor2 error %u\n", GetLastError()); - ok(pm2->cbSize >= FIELD_OFFSET(MONITOR2, pfnSendRecvBidiDataFromPort), "wrong cbSize %u\n", pm2->cbSize); + ok(pm2 != NULL, "InitializePrintMonitor2 error %lu\n", GetLastError()); + ok(pm2->cbSize >= FIELD_OFFSET(MONITOR2, pfnSendRecvBidiDataFromPort), "wrong cbSize %lu\n", pm2->cbSize); }
if (pm || pm2) { if (pm) { - ok(pm->dwMonitorSize == sizeof(MONITOR), "wrong dwMonitorSize %u\n", pm->dwMonitorSize); + ok(pm->dwMonitorSize == sizeof(MONITOR), "wrong dwMonitorSize %lu\n", pm->dwMonitorSize); numentries = (pm->dwMonitorSize ) / sizeof(VOID *); /* NT4: 14, since w2k: 17 */ ok( numentries == 14 || numentries == 17, - "dwMonitorSize (%u) => %u Functions\n", pm->dwMonitorSize, numentries); + "dwMonitorSize (%lu) => %lu Functions\n", pm->dwMonitorSize, numentries); } else if (pm2) { numentries = (pm2->cbSize ) / sizeof(VOID *); ok( numentries >= 20, - "cbSize (%u) => %u Functions\n", pm2->cbSize, numentries); + "cbSize (%lu) => %lu Functions\n", pm2->cbSize, numentries); }
GET_MONITOR_FUNC2(EnumPorts); @@ -1563,11 +1563,11 @@ START_TEST(localmon) if ((pXcvOpenPort) && (pXcvDataPort) && (pXcvClosePort)) { SetLastError(0xdeadbeef); res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv); - ok(res, "hXcv: %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv); + ok(res, "hXcv: %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
SetLastError(0xdeadbeef); res = pXcvOpenPort(emptyW, 0, &hXcv_noaccess); - ok(res, "hXcv_noaccess: %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv_noaccess); + ok(res, "hXcv_noaccess: %ld with %lu and %p (expected '!= 0')\n", res, GetLastError(), hXcv_noaccess); } }
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/localui/tests/Makefile.in | 1 - dlls/localui/tests/localui.c | 34 +++++++++++++++++----------------- 2 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/dlls/localui/tests/Makefile.in b/dlls/localui/tests/Makefile.in index 9e4afd20e09..8f5cb77f291 100644 --- a/dlls/localui/tests/Makefile.in +++ b/dlls/localui/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = localui.dll IMPORTS = winspool
diff --git a/dlls/localui/tests/localui.c b/dlls/localui/tests/localui.c index 23be8c779d1..28cecaabd50 100644 --- a/dlls/localui/tests/localui.c +++ b/dlls/localui/tests/localui.c @@ -68,10 +68,10 @@ static PORT_INFO_2W * find_portinfo2(LPCWSTR pPort) win_skip("The service 'Spooler' is required for many tests\n"); return NULL; } - ok(!res, "EnumPorts succeeded: got %d\n", res); + ok(!res, "EnumPorts succeeded: got %ld\n", res); pi_buffer = HeapAlloc(GetProcessHeap(), 0, pi_needed); res = EnumPortsW(NULL, 2, pi_buffer, pi_needed, &pi_needed, &pi_numports); - ok(res == 1, "EnumPorts failed: got %d\n", res); + ok(res == 1, "EnumPorts failed: got %ld\n", res); } if (pi_buffer) { pi = (PORT_INFO_2W *) pi_buffer; @@ -137,21 +137,21 @@ static void test_AddPortUI(void) res = pAddPortUI(NULL, NULL, NULL, NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pAddPortUI(NULL, NULL, L"", NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pAddPortUI(NULL, NULL, L"does_not_exist", NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
if (winetest_interactive) { @@ -170,7 +170,7 @@ static void test_AddPortUI(void) (GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED) || (GetLastError() == ERROR_NOT_SUPPORTED), - "got %d with %u and %p (expected '!= 0' or '0' with: " + "got %ld with %lu and %p (expected '!= 0' or '0' with: " "ERROR_CANCELLED, ERROR_ACCESS_DENIED or ERROR_NOT_SUPPORTED)\n", res, GetLastError(), new_portname);
@@ -194,14 +194,14 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef); res = pConfigurePortUI(NULL, NULL, L""); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
@@ -209,7 +209,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, L"does_not_exist"); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
if (winetest_interactive && lpt_present) { @@ -217,7 +217,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, lpt_present->pPortName); ok( res || (GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED), - "got %d with %u (expected '!= 0' or '0' with: ERROR_CANCELLED or " + "got %ld with %lu (expected '!= 0' or '0' with: ERROR_CANCELLED or " "ERROR_ACCESS_DENIED)\n", res, GetLastError()); }
@@ -226,7 +226,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, lpt_absent); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); }
@@ -235,7 +235,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, com_present->pPortName); ok( res || (GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED), - "got %d with %u (expected '!= 0' or '0' with: ERROR_CANCELLED or " + "got %ld with %lu (expected '!= 0' or '0' with: ERROR_CANCELLED or " "ERROR_ACCESS_DENIED)\n", res, GetLastError()); }
@@ -244,7 +244,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, com_absent); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
} @@ -254,7 +254,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, L"FILE:"); ok( !res && ((GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED)), - "got %d with %u (expected '0' with: ERROR_CANCELLED or " + "got %ld with %lu (expected '0' with: ERROR_CANCELLED or " "ERROR_ACCESS_DENIED)\n", res, GetLastError()); } } @@ -281,7 +281,7 @@ START_TEST(localui) if (pui) { numentries = (pui->dwMonitorUISize - sizeof(DWORD)) / sizeof(VOID *); ok( numentries == 3, - "dwMonitorUISize (%d) => %d Functions\n", pui->dwMonitorUISize, numentries); + "dwMonitorUISize (%ld) => %ld Functions\n", pui->dwMonitorUISize, numentries);
if (numentries > 2) { pAddPortUI = pui->pfnAddPortUI; @@ -302,7 +302,7 @@ START_TEST(localui) /* "LPT1:" - "LPT9:" */ while (((lpt_present == NULL) || (lpt_absent == NULL)) && id < 9) { id++; - sprintf(bufferA, "LPT%u:", id); + sprintf(bufferA, "LPT%lu:", id); MultiByteToWideChar( CP_ACP, 0, bufferA, -1, bufferW, ARRAY_SIZE(bufferW)); pi2 = find_portinfo2(bufferW); if (pi2 && (lpt_present == NULL)) lpt_present = pi2; @@ -313,7 +313,7 @@ START_TEST(localui) /* "COM1:" - "COM9:" */ while (((com_present == NULL) || (com_absent == NULL)) && id < 9) { id++; - sprintf(bufferA, "COM%u:", id); + sprintf(bufferA, "COM%lu:", id); MultiByteToWideChar( CP_ACP, 0, bufferA, -1, bufferW, ARRAY_SIZE(bufferW)); pi2 = find_portinfo2(bufferW); if (pi2 && (com_present == NULL)) com_present = pi2;
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/lz32/tests/Makefile.in | 1 - dlls/lz32/tests/lzexpand_main.c | 48 ++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/dlls/lz32/tests/Makefile.in b/dlls/lz32/tests/Makefile.in index 9bb8a580efe..27e7c57c546 100644 --- a/dlls/lz32/tests/Makefile.in +++ b/dlls/lz32/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = lz32.dll IMPORTS = lz32
diff --git a/dlls/lz32/tests/lzexpand_main.c b/dlls/lz32/tests/lzexpand_main.c index 3c80bc09a6b..36903039b8f 100644 --- a/dlls/lz32/tests/lzexpand_main.c +++ b/dlls/lz32/tests/lzexpand_main.c @@ -74,7 +74,7 @@ static void full_file_path_name_in_a_CWD(const char *src, char *dst, BOOL expect char shortname[MAX_PATH];
retval = GetCurrentDirectoryA(MAX_PATH, dst); - ok(retval > 0, "GetCurrentDirectoryA returned %d, GLE=%d\n", + ok(retval > 0, "GetCurrentDirectoryA returned %ld, GLE=%ld\n", retval, GetLastError()); if(dst[retval-1] != '\') /* Append backslash only when it's missing */ @@ -84,7 +84,7 @@ static void full_file_path_name_in_a_CWD(const char *src, char *dst, BOOL expect { memcpy(shortname, dst, MAX_PATH); retval = GetShortPathNameA(shortname, dst, MAX_PATH-1); - ok(retval > 0, "GetShortPathNameA returned %d for '%s', GLE=%d\n", + ok(retval > 0, "GetShortPathNameA returned %ld for '%s', GLE=%ld\n", retval, dst, GetLastError()); } } @@ -99,7 +99,7 @@ static void create_file(char *fname) ok(file >= 0, "LZOpenFileA failed to create '%s'\n", fname); LZClose(file); retval = GetFileAttributesA(fname); - ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA('%s'): error %d\n", ofs.szPathName, GetLastError()); + ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA('%s'): error %ld\n", ofs.szPathName, GetLastError()); }
static void delete_file(char *fname) @@ -228,7 +228,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileA succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -247,7 +247,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileA succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -266,7 +266,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileA succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -285,7 +285,7 @@ static void test_LZOpenFileA_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileA succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -310,7 +310,7 @@ static void test_LZOpenFileA(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileA succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); LZClose(file);
memset(&test, 0xA5, sizeof(test)); @@ -329,7 +329,7 @@ static void test_LZOpenFileA(void) LZClose(file);
retval = GetFileAttributesA(filename_); - ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA: error %d\n", + ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesA: error %ld\n", GetLastError());
/* Check various opening options: */ @@ -424,7 +424,7 @@ static void test_LZRead(void) file = CreateFileA(filename_, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0); ok(file != INVALID_HANDLE_VALUE, "Could not create test file\n"); retok = WriteFile(file, compressed_file, compressed_file_size, &ret, 0); - ok( retok, "WriteFile: error %d\n", GetLastError()); + ok( retok, "WriteFile: error %ld\n", GetLastError()); ok(ret == compressed_file_size, "Wrote wrong number of bytes with WriteFile?\n"); CloseHandle(file);
@@ -447,7 +447,7 @@ static void test_LZRead(void) LZClose(cfile);
ret = DeleteFileA(filename_); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); }
static void test_LZCopy(void) @@ -461,9 +461,9 @@ static void test_LZCopy(void) /* Create the compressed file. */ file = CreateFileA(filename_, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0); ok(file != INVALID_HANDLE_VALUE, - "CreateFileA: error %d\n", GetLastError()); + "CreateFileA: error %ld\n", GetLastError()); retok = WriteFile(file, compressed_file, compressed_file_size, &ret, 0); - ok( retok, "WriteFile error %d\n", GetLastError()); + ok( retok, "WriteFile error %ld\n", GetLastError()); ok(ret == compressed_file_size, "Wrote wrong number of bytes\n"); CloseHandle(file);
@@ -480,19 +480,19 @@ static void test_LZCopy(void)
file = CreateFileA(filename2, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); ok(file != INVALID_HANDLE_VALUE, - "CreateFileA: error %d\n", GetLastError()); + "CreateFileA: error %ld\n", GetLastError());
retok = ReadFile(file, buf, uncompressed_data_size*2, &ret, 0); - ok( retok && ret == uncompressed_data_size, "ReadFile: error %d\n", GetLastError()); + ok( retok && ret == uncompressed_data_size, "ReadFile: error %ld\n", GetLastError()); /* Compare what we read with what we think we should read. */ ok(!memcmp(buf, uncompressed_data, uncompressed_data_size), "buffer contents mismatch\n"); CloseHandle(file);
ret = DeleteFileA(filename_); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); ret = DeleteFileA(filename2); - ok(ret, "DeleteFileA: error %d\n", GetLastError()); + ok(ret, "DeleteFileA: error %ld\n", GetLastError()); }
static void create_fileW(WCHAR *fnameW) @@ -505,7 +505,7 @@ static void create_fileW(WCHAR *fnameW) ok(file >= 0, "LZOpenFileW failed on creation\n"); LZClose(file); retval = GetFileAttributesW(fnameW); - ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesW('%s'): error %d\n", ofs.szPathName, GetLastError()); + ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributesW('%s'): error %ld\n", ofs.szPathName, GetLastError()); }
static void delete_fileW(WCHAR *fnameW) @@ -628,7 +628,7 @@ static void test_LZOpenFileW_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileW succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileW set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -647,7 +647,7 @@ static void test_LZOpenFileW_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileW succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileW set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -666,7 +666,7 @@ static void test_LZOpenFileW_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileW succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileW set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -685,7 +685,7 @@ static void test_LZOpenFileW_nonexisting_compressed(void) ok(file == LZERROR_BADINHANDLE, "LZOpenFileW succeeded on nonexistent file\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(test.cBytes == 0xA5, "LZOpenFileW set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_FILE_NOT_FOUND, @@ -712,7 +712,7 @@ static void test_LZOpenFileW(void) return; } ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "GetLastError() returns %d\n", GetLastError()); + "GetLastError() returns %ld\n", GetLastError()); ok(file == LZERROR_BADINHANDLE, "LZOpenFileW succeeded on nonexistent file\n"); LZClose(file);
@@ -732,7 +732,7 @@ static void test_LZOpenFileW(void) LZClose(file);
retval = GetFileAttributesW(filenameW_); - ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributes: error %d\n", + ok(retval != INVALID_FILE_ATTRIBUTES, "GetFileAttributes: error %ld\n", GetLastError());
/* Check various opening options: */
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/mapi32/tests/Makefile.in | 1 dlls/mapi32/tests/imalloc.c | 8 +-- dlls/mapi32/tests/prop.c | 114 +++++++++++++++++++++-------------------- dlls/mapi32/tests/util.c | 8 +-- 4 files changed, 65 insertions(+), 66 deletions(-)
diff --git a/dlls/mapi32/tests/Makefile.in b/dlls/mapi32/tests/Makefile.in index 78cb762ec94..62d86765529 100644 --- a/dlls/mapi32/tests/Makefile.in +++ b/dlls/mapi32/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = mapi32.dll IMPORTS = advapi32
diff --git a/dlls/mapi32/tests/imalloc.c b/dlls/mapi32/tests/imalloc.c index 341155cf9d6..4d391c81404 100644 --- a/dlls/mapi32/tests/imalloc.c +++ b/dlls/mapi32/tests/imalloc.c @@ -61,13 +61,13 @@ static void test_IMalloc(void) lpVoid = NULL; hRet = IMalloc_QueryInterface(lpMalloc, &IID_IUnknown, &lpVoid); ok (hRet == S_OK && lpVoid != NULL, - "IID_IUnknown: expected S_OK, non-null, got 0x%08x, %p\n", + "IID_IUnknown: expected S_OK, non-null, got 0x%08lx, %p\n", hRet, lpVoid);
lpVoid = NULL; hRet = IMalloc_QueryInterface(lpMalloc, &IID_IMalloc, &lpVoid); ok (hRet == S_OK && lpVoid != NULL, - "IID_IIMalloc: expected S_OK, non-null, got 0x%08x, %p\n", + "IID_IIMalloc: expected S_OK, non-null, got 0x%08lx, %p\n", hRet, lpVoid);
/* Prove that native mapi uses LocalAlloc/LocalFree */ @@ -84,10 +84,10 @@ static void test_IMalloc(void) LocalFree(lpMem);
ulRef = IMalloc_AddRef(lpMalloc); - ok (ulRef == 1u, "AddRef expected 1, returned %d\n", ulRef); + ok (ulRef == 1u, "AddRef expected 1, returned %ld\n", ulRef);
ulRef = IMalloc_Release(lpMalloc); - ok (ulRef == 1u, "AddRef expected 1, returned %d\n", ulRef); + ok (ulRef == 1u, "AddRef expected 1, returned %ld\n", ulRef);
IMalloc_Release(lpMalloc); } diff --git a/dlls/mapi32/tests/prop.c b/dlls/mapi32/tests/prop.c index 61ec5f16a9f..c5006662edd 100644 --- a/dlls/mapi32/tests/prop.c +++ b/dlls/mapi32/tests/prop.c @@ -114,7 +114,7 @@ static void test_PropCopyMore(void) }
scode = pMAPIAllocateBuffer(sizeof(SPropValue), &lpDest); - ok(scode == S_OK, "Expected MAPIAllocateBuffer to return S_OK, got 0x%x\n", scode); + ok(scode == S_OK, "Expected MAPIAllocateBuffer to return S_OK, got 0x%lx\n", scode); if (FAILED(scode)) { skip("MAPIAllocateBuffer failed\n"); @@ -122,7 +122,7 @@ static void test_PropCopyMore(void) }
scode = pMAPIAllocateMore(sizeof(SPropValue), lpDest, &lpSrc); - ok(scode == S_OK, "Expected MAPIAllocateMore to return S_OK, got 0x%x\n", scode); + ok(scode == S_OK, "Expected MAPIAllocateMore to return S_OK, got 0x%lx\n", scode); if (FAILED(scode)) { skip("MAPIAllocateMore failed\n"); @@ -151,7 +151,7 @@ static void test_PropCopyMore(void)
scode = pPropCopyMore(lpDest, lpSrc, (ALLOCATEMORE*)pMAPIAllocateMore, lpDest); ok(!scode && lpDest->ulPropTag == lpSrc->ulPropTag, - "PropCopyMore: Expected 0x0,%d, got 0x%08x,%d\n", + "PropCopyMore: Expected 0x0,%ld, got 0x%08lx,%ld\n", lpSrc->ulPropTag, scode, lpDest->ulPropTag); if (SUCCEEDED(scode)) { @@ -176,7 +176,7 @@ static void test_PropCopyMore(void)
/* Since all allocations are linked, freeing lpDest frees everything */ scode = pMAPIFreeBuffer(lpDest); - ok(scode == S_OK, "Expected MAPIFreeBuffer to return S_OK, got 0x%x\n", scode); + ok(scode == S_OK, "Expected MAPIFreeBuffer to return S_OK, got 0x%lx\n", scode); }
static void test_UlPropSize(void) @@ -270,7 +270,7 @@ static void test_UlPropSize(void)
res = pUlPropSize(&pv); ok(res == exp, - "pt= %d: Expected %d, got %d\n", pt, exp, res); + "pt= %ld: Expected %ld, got %ld\n", pt, exp, res); } }
@@ -303,7 +303,7 @@ static void test_FPropContainsProp(void) pvLeft.ulPropTag = pvRight.ulPropTag = pt;
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING); - ok(bRet == FALSE, "pt= %d: Expected FALSE, got %d\n", pt, bRet); + ok(bRet == FALSE, "pt= %ld: Expected FALSE, got %d\n", pt, bRet); }
/* test the various flag combinations */ @@ -536,7 +536,7 @@ static void test_FPropCompareProp(void)
bRet = pFPropCompareProp(&pvLeft, FPCProp_Results[j].relOp, &pvRight); ok(bRet == bExp, - "pt %d (%d,%d,%s): expected %d, got %d\n", ptTypes[i], + "pt %ld (%d,%d,%s): expected %d, got %d\n", ptTypes[i], FPCProp_Results[j].lVal, FPCProp_Results[j].rVal, relops[FPCProp_Results[j].relOp], bExp, bRet); } @@ -661,7 +661,7 @@ static void test_LPropCompareProp(void)
iRet = pLPropCompareProp(&pvLeft, &pvRight); ok(iRet == iExp, - "pt %d (%d,%d): expected %d, got %d\n", ptTypes[i], + "pt %ld (%d,%d): expected %d, got %d\n", ptTypes[i], LPCProp_Results[j].lVal, LPCProp_Results[j].rVal, iExp, iRet); } } @@ -684,11 +684,11 @@ static void test_PpropFindProp(void)
pRet = pPpropFindProp(&pvProp, 1u, ptTypes[i]); ok(pRet == &pvProp, - "PpropFindProp[%d]: Didn't find existing property\n", + "PpropFindProp[%ld]: Didn't find existing property\n", ptTypes[i]);
pRet = pPpropFindProp(&pvProp, 1u, i ? ptTypes[i-1] : ptTypes[i+1]); - ok(pRet == NULL, "PpropFindProp[%d]: Found nonexistent property\n", + ok(pRet == NULL, "PpropFindProp[%ld]: Found nonexistent property\n", ptTypes[i]); }
@@ -828,12 +828,12 @@ static void test_ScCountProps(void) res = pScCountProps(1, &pv, &ulRet); if (!exp) { success = res == MAPI_E_INVALID_PARAMETER && ulRet == 0xffffffff; - ok(success, "pt= %d: Expected failure, got %d, ret=0x%08X\n", + ok(success, "pt= %ld: Expected failure, got %ld, ret=0x%08lX\n", pt, ulRet, res); } else { success = res == S_OK && ulRet == exp; - ok(success, "pt= %d: Expected %d, got %d, ret=0x%08X\n", + ok(success, "pt= %ld: Expected %ld, got %ld, ret=0x%08lX\n", pt, exp, ulRet, res); } } @@ -862,14 +862,14 @@ static void test_ScCopyRelocProps(void) ulCount = 0;
sc = pScCopyProps(1, &pvProp, buffer, &ulCount); - ok(sc == S_OK, "wrong ret %d\n", sc); + ok(sc == S_OK, "wrong ret %ld\n", sc); if(sc == S_OK) { - ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %x\n",lpResProp->ulPropTag); - ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %d\n", lpResProp->Value.MVszA.cValues); + ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %lx\n",lpResProp->ulPropTag); + ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %ld\n", lpResProp->Value.MVszA.cValues); ok(lpResProp->Value.MVszA.lppszA[0] == buffer + sizeof(SPropValue) + sizeof(char*), "wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]); - ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5, "wrong count %d\n", ulCount); + ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5, "wrong count %ld\n", ulCount); ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA), "wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]); } @@ -886,11 +886,11 @@ static void test_ScCopyRelocProps(void) sc = pScRelocProps(1, (LPSPropValue)buffer2, buffer, buffer2, &ulCount); lpResProp = (LPSPropValue)buffer2;
- ok(sc == S_OK, "wrong ret %d\n", sc); + ok(sc == S_OK, "wrong ret %ld\n", sc); if(sc == S_OK) { - ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %x\n",lpResProp->ulPropTag); - ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %d\n", lpResProp->Value.MVszA.cValues); + ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %lx\n",lpResProp->ulPropTag); + ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %ld\n", lpResProp->Value.MVszA.cValues); ok(lpResProp->Value.MVszA.lppszA[0] == buffer2 + sizeof(SPropValue) + sizeof(char*), "wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]); /* Native has a bug whereby it calculates the size correctly when copying @@ -898,7 +898,7 @@ static void test_ScCopyRelocProps(void) * ignores multivalue pointers). Wine returns the correct value. */ ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5 || ulCount == sizeof(SPropValue) + 5, - "wrong count %d\n", ulCount); + "wrong count %ld\n", ulCount); ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA), "wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]); } @@ -923,20 +923,20 @@ static void test_LpValFindProp(void)
pRet = pLpValFindProp(PROP_TAG(ptTypes[i], 1u), 1u, &pvProp); ok(pRet == &pvProp, - "LpValFindProp[%d]: Didn't find existing property id/type\n", + "LpValFindProp[%ld]: Didn't find existing property id/type\n", ptTypes[i]);
pRet = pLpValFindProp(PROP_TAG(ptTypes[i], 0u), 1u, &pvProp); - ok(pRet == NULL, "LpValFindProp[%d]: Found nonexistent property id\n", + ok(pRet == NULL, "LpValFindProp[%ld]: Found nonexistent property id\n", ptTypes[i]);
pRet = pLpValFindProp(PROP_TAG(PT_NULL, 0u), 1u, &pvProp); - ok(pRet == NULL, "LpValFindProp[%d]: Found nonexistent property id/type\n", + ok(pRet == NULL, "LpValFindProp[%ld]: Found nonexistent property id/type\n", ptTypes[i]);
pRet = pLpValFindProp(PROP_TAG(PT_NULL, 1u), 1u, &pvProp); ok(pRet == &pvProp, - "LpValFindProp[%d]: Didn't find existing property id\n", + "LpValFindProp[%ld]: Didn't find existing property id\n", ptTypes[i]); } } @@ -1038,10 +1038,10 @@ static void test_FBadPropTag(void)
res = pFBadPropTag(pt); if (bBad) - ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt); + ok(res != 0, "pt= %ld: Expected non-zero, got 0\n", pt); else ok(res == 0, - "pt= %d: Expected zero, got %d\n", pt, res); + "pt= %ld: Expected zero, got %ld\n", pt, res); } }
@@ -1132,10 +1132,10 @@ static void test_FBadProp(void)
res = pFBadProp(&pv); if (bBad) - ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt); + ok(res != 0, "pt= %ld: Expected non-zero, got 0\n", pt); else ok(res == 0, - "pt= %d: Expected zero, got %d\n", pt, res); + "pt= %ld: Expected zero, got %ld\n", pt, res); } }
@@ -1186,10 +1186,10 @@ static void test_FBadColumnSet(void)
res = pFBadColumnSet(&pta); if (bBad) - ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt); + ok(res != 0, "pt= %ld: Expected non-zero, got 0\n", pt); else ok(res == 0, - "pt= %d: Expected zero, got %d\n", pt, res); + "pt= %ld: Expected zero, got %ld\n", pt, res); } }
@@ -1219,7 +1219,7 @@ static void test_IProp(void) sc = pCreateIProp(&IID_IMAPIPropData, (ALLOCATEBUFFER *)pMAPIAllocateBuffer, (ALLOCATEMORE*)pMAPIAllocateMore, (FREEBUFFER *)pMAPIFreeBuffer, NULL, &lpIProp); ok(sc == S_OK && lpIProp, - "CreateIProp: expected S_OK, non-null, got 0x%08X,%p\n", sc, lpIProp); + "CreateIProp: expected S_OK, non-null, got 0x%08lX,%p\n", sc, lpIProp);
if (sc != S_OK || !lpIProp) return; @@ -1228,13 +1228,13 @@ static void test_IProp(void) lpError = NULL; sc = IPropData_GetLastError(lpIProp, E_INVALIDARG, 0, &lpError); ok(sc == S_OK && !lpError, - "GetLastError: Expected S_OK, null, got 0x%08X,%p\n", sc, lpError); + "GetLastError: Expected S_OK, null, got 0x%08lX,%p\n", sc, lpError);
/* Get prop tags - succeeds returning 0 items */ lpTags = NULL; sc = IPropData_GetPropList(lpIProp, 0, &lpTags); ok(sc == S_OK && lpTags && lpTags->cValues == 0, - "GetPropList(empty): Expected S_OK, non-null, 0, got 0x%08X,%p,%d\n", + "GetPropList(empty): Expected S_OK, non-null, 0, got 0x%08lX,%p,%ld\n", sc, lpTags, lpTags ? lpTags->cValues : 0); if (lpTags) pMAPIFreeBuffer(lpTags); @@ -1246,12 +1246,12 @@ static void test_IProp(void) tags.aulPropTag[0] = PR_IMPORTANCE; sc = IPropData_GetProps(lpIProp, (LPSPropTagArray)&tags, 0, &count, &lpProps); ok(sc == MAPI_W_ERRORS_RETURNED && lpProps && count == 1, - "GetProps(empty): Expected ERRORS_RETURNED, non-null, 1, got 0x%08X,%p,%d\n", + "GetProps(empty): Expected ERRORS_RETURNED, non-null, 1, got 0x%08lX,%p,%ld\n", sc, lpProps, count); if (lpProps && count > 0) { ok(lpProps[0].ulPropTag == CHANGE_PROP_TYPE(PR_IMPORTANCE,PT_ERROR), - "GetProps(empty): Expected %x, got %x\n", + "GetProps(empty): Expected %x, got %lx\n", CHANGE_PROP_TYPE(PR_IMPORTANCE,PT_ERROR), lpProps[0].ulPropTag);
pMAPIFreeBuffer(lpProps); @@ -1262,7 +1262,7 @@ static void test_IProp(void) pvs[0].ulPropTag = PROP_TAG(PT_NULL,0x01); sc = IPropData_SetProps(lpIProp, 1, pvs, &lpProbs); ok(sc == MAPI_E_INVALID_PARAMETER && !lpProbs, - "SetProps(): Expected INVALID_PARAMETER, null, got 0x%08X,%p\n", + "SetProps(): Expected INVALID_PARAMETER, null, got 0x%08lX,%p\n", sc, lpProbs);
/* Add (OBJECT) - Can't add OBJECTs */ @@ -1270,7 +1270,7 @@ static void test_IProp(void) pvs[0].ulPropTag = PROP_TAG(PT_OBJECT,0x01); sc = IPropData_SetProps(lpIProp, 1, pvs, &lpProbs); ok(sc == MAPI_E_INVALID_PARAMETER && !lpProbs, - "SetProps(OBJECT): Expected INVALID_PARAMETER, null, got 0x%08X,%p\n", + "SetProps(OBJECT): Expected INVALID_PARAMETER, null, got 0x%08lX,%p\n", sc, lpProbs);
/* Add - Adds value */ @@ -1278,25 +1278,25 @@ static void test_IProp(void) pvs[0].ulPropTag = PR_IMPORTANCE; sc = IPropData_SetProps(lpIProp, 1, pvs, &lpProbs); ok(sc == S_OK && !lpProbs, - "SetProps(ERROR): Expected S_OK, null, got 0x%08X,%p\n", sc, lpProbs); + "SetProps(ERROR): Expected S_OK, null, got 0x%08lX,%p\n", sc, lpProbs);
/* Get prop list - returns 1 item */ lpTags = NULL; IPropData_GetPropList(lpIProp, 0, &lpTags); ok(sc == S_OK && lpTags && lpTags->cValues == 1, - "GetPropList: Expected S_OK, non-null, 1, got 0x%08X,%p,%d\n", + "GetPropList: Expected S_OK, non-null, 1, got 0x%08lX,%p,%ld\n", sc, lpTags, lpTags ? lpTags->cValues : 0); if (lpTags && lpTags->cValues > 0) { ok(lpTags->aulPropTag[0] == PR_IMPORTANCE, - "GetPropList: Expected %x, got %x\n", + "GetPropList: Expected %x, got %lx\n", PR_IMPORTANCE, lpTags->aulPropTag[0]); pMAPIFreeBuffer(lpTags); }
/* Set access to read and write */ sc = IPropData_HrSetObjAccess(lpIProp, IPROP_READWRITE); - ok(sc == S_OK, "SetObjAccess(WRITE): Expected S_OK got 0x%08X\n", sc); + ok(sc == S_OK, "SetObjAccess(WRITE): Expected S_OK got 0x%08lX\n", sc);
tags.cValues = 1; tags.aulPropTag[0] = PR_IMPORTANCE; @@ -1305,50 +1305,50 @@ static void test_IProp(void) access[0] = 0; sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access); ok(sc == MAPI_E_INVALID_PARAMETER, - "SetPropAccess(0): Expected INVALID_PARAMETER got 0x%08X\n",sc); + "SetPropAccess(0): Expected INVALID_PARAMETER got 0x%08lX\n",sc); access[0] = IPROP_READWRITE; sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access); ok(sc == MAPI_E_INVALID_PARAMETER, - "SetPropAccess(RW): Expected INVALID_PARAMETER got 0x%08X\n",sc); + "SetPropAccess(RW): Expected INVALID_PARAMETER got 0x%08lX\n",sc); access[0] = IPROP_CLEAN; sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access); ok(sc == MAPI_E_INVALID_PARAMETER, - "SetPropAccess(C): Expected INVALID_PARAMETER got 0x%08X\n",sc); + "SetPropAccess(C): Expected INVALID_PARAMETER got 0x%08lX\n",sc);
/* Set item access to read/write/clean */ tags.cValues = 1; tags.aulPropTag[0] = PR_IMPORTANCE; access[0] = IPROP_READWRITE|IPROP_CLEAN; sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access); - ok(sc == S_OK, "SetPropAccess(RW/C): Expected S_OK got 0x%08X\n",sc); + ok(sc == S_OK, "SetPropAccess(RW/C): Expected S_OK got 0x%08lX\n",sc);
/* Set object access to read only */ sc = IPropData_HrSetObjAccess(lpIProp, IPROP_READONLY); - ok(sc == S_OK, "SetObjAccess(READ): Expected S_OK got 0x%08X\n", sc); + ok(sc == S_OK, "SetObjAccess(READ): Expected S_OK got 0x%08lX\n", sc);
/* Set item access to read/write/dirty - doesn't care about RO object */ access[0] = IPROP_READONLY|IPROP_DIRTY; sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access); - ok(sc == S_OK, "SetPropAccess(WRITE): Expected S_OK got 0x%08X\n", sc); + ok(sc == S_OK, "SetPropAccess(WRITE): Expected S_OK got 0x%08lX\n", sc);
/* Delete any item when set to read only - Error */ lpProbs = NULL; tags.aulPropTag[0] = PR_RESPONSE_REQUESTED; sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs); ok(sc == E_ACCESSDENIED && !lpProbs, - "DeleteProps(nonexistent): Expected E_ACCESSDENIED null got 0x%08X %p\n", + "DeleteProps(nonexistent): Expected E_ACCESSDENIED null got 0x%08lX %p\n", sc, lpProbs);
/* Set access to read and write */ sc = IPropData_HrSetObjAccess(lpIProp, IPROP_READWRITE); - ok(sc == S_OK, "SetObjAccess(WRITE): Expected S_OK got 0x%08X\n", sc); + ok(sc == S_OK, "SetObjAccess(WRITE): Expected S_OK got 0x%08lX\n", sc);
/* Delete nonexistent item - No error */ lpProbs = NULL; tags.aulPropTag[0] = PR_RESPONSE_REQUESTED; sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs); ok(sc == S_OK && !lpProbs, - "DeleteProps(nonexistent): Expected S_OK null got 0x%08X %p\n", + "DeleteProps(nonexistent): Expected S_OK null got 0x%08lX %p\n", sc, lpProbs);
/* Delete existing item (r/o) - No error, but lpProbs populated */ @@ -1356,7 +1356,7 @@ static void test_IProp(void) tags.aulPropTag[0] = PR_IMPORTANCE; sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs); ok(sc == S_OK && lpProbs, - "DeleteProps(RO): Expected S_OK non-null got 0x%08X %p\n", sc, lpProbs); + "DeleteProps(RO): Expected S_OK non-null got 0x%08lX %p\n", sc, lpProbs);
if (lpProbs && lpProbs->cProblem > 0) { @@ -1364,7 +1364,7 @@ static void test_IProp(void) lpProbs->aProblem[0].ulIndex == 0 && lpProbs->aProblem[0].ulPropTag == PR_IMPORTANCE && lpProbs->aProblem[0].scode == E_ACCESSDENIED, - "DeleteProps(RO): Expected (1,0,%x,%x) got (%d,%x,%x)\n", + "DeleteProps(RO): Expected (1,0,%x,%lx) got (%ld,%lx,%lx)\n", PR_IMPORTANCE, E_ACCESSDENIED, lpProbs->aProblem[0].ulIndex, lpProbs->aProblem[0].ulPropTag, lpProbs->aProblem[0].scode); @@ -1376,18 +1376,18 @@ static void test_IProp(void) tags.aulPropTag[0] = PR_RESPONSE_REQUESTED; IPropData_HrAddObjProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs); ok(sc == S_OK && !lpProbs, - "AddObjProps(RO): Expected S_OK null got 0x%08X %p\n", sc, lpProbs); + "AddObjProps(RO): Expected S_OK null got 0x%08lX %p\n", sc, lpProbs);
/* Get prop list - returns 1 item */ lpTags = NULL; IPropData_GetPropList(lpIProp, 0, &lpTags); ok(sc == S_OK && lpTags && lpTags->cValues == 1, - "GetPropList: Expected S_OK, non-null, 1, got 0x%08X,%p,%d\n", + "GetPropList: Expected S_OK, non-null, 1, got 0x%08lX,%p,%ld\n", sc, lpTags, lpTags ? lpTags->cValues : 0); if (lpTags && lpTags->cValues > 0) { ok(lpTags->aulPropTag[0] == PR_IMPORTANCE, - "GetPropList: Expected %x, got %x\n", + "GetPropList: Expected %x, got %lx\n", PR_IMPORTANCE, lpTags->aulPropTag[0]); pMAPIFreeBuffer(lpTags); } @@ -1395,13 +1395,13 @@ static void test_IProp(void) /* Set item to r/w again */ access[0] = IPROP_READWRITE|IPROP_DIRTY; sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access); - ok(sc == S_OK, "SetPropAccess(WRITE): Expected S_OK got 0x%08X\n", sc); + ok(sc == S_OK, "SetPropAccess(WRITE): Expected S_OK got 0x%08lX\n", sc);
/* Delete existing item (r/w) - No error, no problems */ lpProbs = NULL; sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs); ok(sc == S_OK && !lpProbs, - "DeleteProps(RO): Expected S_OK null got 0x%08X %p\n", sc, lpProbs); + "DeleteProps(RO): Expected S_OK null got 0x%08lX %p\n", sc, lpProbs);
/* Free the list */ IPropData_Release(lpIProp); diff --git a/dlls/mapi32/tests/util.c b/dlls/mapi32/tests/util.c index 351106ec2bb..17b1ddf09a7 100644 --- a/dlls/mapi32/tests/util.c +++ b/dlls/mapi32/tests/util.c @@ -95,7 +95,7 @@ static void test_SwapPlong(void) longs[2] = 0x20000001; pSwapPlong(longs, 2); ok((longs[0] == 0x0100ffff && longs[1] == 0xffff0010 && longs[2] == 0x20000001), - "Expected {0x0100ffff,0xffff0010,0x20000001}, got {0x%08x,0x%08x,0x%08x}\n", + "Expected {0x0100ffff,0xffff0010,0x20000001}, got {0x%08lx,0x%08lx,0x%08lx}\n", longs[0], longs[1], longs[2]); }
@@ -160,9 +160,9 @@ static void test_UlFromSzHex(void) }
ok(pUlFromSzHex("fF") == 0xffu, - "UlFromSzHex: expected 0xff, got 0x%x\n", pUlFromSzHex("fF")); + "UlFromSzHex: expected 0xff, got 0x%lx\n", pUlFromSzHex("fF"));
- ok(pUlFromSzHex(" c") == 0, "UlFromSzHex: expected 0x0. got 0x%x\n", + ok(pUlFromSzHex(" c") == 0, "UlFromSzHex: expected 0x0. got 0x%lx\n", pUlFromSzHex(" c")); }
@@ -185,7 +185,7 @@ static void test_CbOfEncoded(void) memset(buff, '?', i); ulRet = pCbOfEncoded(buff); ok(ulRet == ulExpected, - "CbOfEncoded(length %d): expected %d, got %d\n", + "CbOfEncoded(length %d): expected %ld, got %ld\n", i, ulExpected, ulRet); } }