comdlg32/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-23 09:11:47 +01:00 committed by Alexandre Julliard
parent cd4c58f588
commit e240aeb757
6 changed files with 564 additions and 565 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = comdlg32.dll
IMPORTS = uuid shell32 ole32 comdlg32 winspool user32 gdi32

View File

@ -50,7 +50,7 @@ static void toolbarcheck( HWND hDlg)
}
ok( ctrl != NULL, "could not get the toolbar control\n");
ret = SendMessageA( ctrl, TB_ADDSTRINGA, 0, (LPARAM)"winetestwinetest\0\0");
ok( ret == 0, "addstring returned %d (expected 0)\n", ret);
ok( ret == 0, "addstring returned %ld (expected 0)\n", ret);
maxtextrows = SendMessageA( ctrl, TB_GETTEXTROWS, 0, 0);
ok( maxtextrows == 0 || broken(maxtextrows == 1), /* Win2k and below */
"Get(Max)TextRows returned %d (expected 0)\n", maxtextrows);
@ -108,25 +108,25 @@ static void test_DialogCancel(void)
PrintDlgA(NULL);
ok(CDERR_INITIALIZATION == CommDlgExtendedError(),
"expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
"expected CDERR_INITIALIZATION, got %ld\n", CommDlgExtendedError());
result = GetOpenFileNameA(&ofn);
ok(FALSE == result, "expected FALSE, got %d\n", result);
ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
ok(0 == CommDlgExtendedError(), "expected 0, got %ld\n",
CommDlgExtendedError());
PrintDlgA(NULL);
ok(CDERR_INITIALIZATION == CommDlgExtendedError(),
"expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
"expected CDERR_INITIALIZATION, got %ld\n", CommDlgExtendedError());
result = GetSaveFileNameA(&ofn);
ok(FALSE == result, "expected FALSE, got %d\n", result);
ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
ok(0 == CommDlgExtendedError(), "expected 0, got %ld\n",
CommDlgExtendedError());
PrintDlgA(NULL);
ok(CDERR_INITIALIZATION == CommDlgExtendedError(),
"expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
"expected CDERR_INITIALIZATION, got %ld\n", CommDlgExtendedError());
/* Before passing the ofn to Unicode functions, remove the ANSI strings */
ofn.lpstrFilter = NULL;
@ -135,7 +135,7 @@ static void test_DialogCancel(void)
PrintDlgA(NULL);
ok(CDERR_INITIALIZATION == CommDlgExtendedError(),
"expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError());
"expected CDERR_INITIALIZATION, got %ld\n", CommDlgExtendedError());
SetLastError(0xdeadbeef);
result = GetOpenFileNameW((LPOPENFILENAMEW) &ofn);
@ -144,7 +144,7 @@ static void test_DialogCancel(void)
else
{
ok(FALSE == result, "expected FALSE, got %d\n", result);
ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError());
ok(0 == CommDlgExtendedError(), "expected 0, got %ld\n", CommDlgExtendedError());
}
SetLastError(0xdeadbeef);
@ -154,7 +154,7 @@ static void test_DialogCancel(void)
else
{
ok(FALSE == result, "expected FALSE, got %d\n", result);
ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError());
ok(0 == CommDlgExtendedError(), "expected 0, got %ld\n", CommDlgExtendedError());
}
}
@ -173,7 +173,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
RECT rect = {0, 0, 0, 0};
hr = IShellBrowser_QueryActiveShellView(shell_browser, &shell_view);
ok(SUCCEEDED(hr), "QueryActiveShellView returned %#x\n", hr);
ok(SUCCEEDED(hr), "QueryActiveShellView returned %#lx\n", hr);
if (FAILED(hr)) goto cleanup;
hr = IShellView_QueryInterface(shell_view, &IID_IShellView2, (void **)&shell_view2);
@ -182,11 +182,11 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
win_skip("IShellView2 not supported\n");
goto cleanup;
}
ok(SUCCEEDED(hr), "QueryInterface returned %#x\n", hr);
ok(SUCCEEDED(hr), "QueryInterface returned %#lx\n", hr);
if (FAILED(hr)) goto cleanup;
hr = IShellView2_DestroyViewWindow(shell_view2);
ok(SUCCEEDED(hr), "DestroyViewWindow returned %#x\n", hr);
ok(SUCCEEDED(hr), "DestroyViewWindow returned %#lx\n", hr);
folder_settings.ViewMode = FVM_LIST;
folder_settings.fFlags = 0;
@ -205,17 +205,17 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
win_skip("CreateViewWindow2 is broken on Vista/W2K8\n");
goto cleanup;
}
ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#x\n", hr);
ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#lx\n", hr);
if (FAILED(hr)) goto cleanup;
hr = IShellView2_GetCurrentInfo(shell_view2, &folder_settings);
ok(SUCCEEDED(hr), "GetCurrentInfo returned %#x\n", hr);
ok(SUCCEEDED(hr), "GetCurrentInfo returned %#lx\n", hr);
ok(folder_settings.ViewMode == FVM_LIST,
"view mode is %d, expected FVM_LIST\n",
folder_settings.ViewMode);
hr = IShellView2_DestroyViewWindow(shell_view2);
ok(SUCCEEDED(hr), "DestroyViewWindow returned %#x\n", hr);
ok(SUCCEEDED(hr), "DestroyViewWindow returned %#lx\n", hr);
/* XP and W2K3 need this. On W2K the call to DestroyWindow() fails and has
* no side effects. NT4 doesn't get here. (FIXME: Vista doesn't get here yet).
@ -224,11 +224,11 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
view_params.pvid = &VID_Details;
hr = IShellView2_CreateViewWindow2(shell_view2, &view_params);
ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#x\n", hr);
ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#lx\n", hr);
if (FAILED(hr)) goto cleanup;
hr = IShellView2_GetCurrentInfo(shell_view2, &folder_settings);
ok(SUCCEEDED(hr), "GetCurrentInfo returned %#x\n", hr);
ok(SUCCEEDED(hr), "GetCurrentInfo returned %#lx\n", hr);
ok(folder_settings.ViewMode == FVM_DETAILS || broken(folder_settings.ViewMode == FVM_LIST), /* nt4 */
"view mode is %d, expected FVM_DETAILS\n",
folder_settings.ViewMode);
@ -275,9 +275,9 @@ static void test_create_view_window2(void)
ofn.lpfnHook = create_view_window2_hook;
ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER;
ret = GetOpenFileNameA(&ofn);
ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
ok(!ret, "GetOpenFileNameA returned %#lx\n", ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
}
static void test_create_view_template(void)
@ -295,9 +295,9 @@ static void test_create_view_template(void)
ofn.lpTemplateName = "template1";
ofn.lpstrFilter="text\0*.txt\0All\0*\0\0";
ret = GetOpenFileNameA(&ofn);
ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
ok(!ret, "GetOpenFileNameA returned %#lx\n", ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
}
/* test cases for resizing of the file dialog */
@ -397,10 +397,10 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
GetWindowRect( parent, &rc);
todo_wine_if( resize_testcases[index].todo){
ok( resize == rc.right - rc.left - initrc.right + initrc.left,
"testid %d size-x change %d expected %d\n", index,
"testid %d size-x change %ld expected %d\n", index,
rc.right - rc.left - initrc.right + initrc.left, resize);
ok( resize == rc.bottom - rc.top - initrc.bottom + initrc.top,
"testid %d size-y change %d expected %d\n", index,
"testid %d size-y change %ld expected %d\n", index,
rc.bottom - rc.top - initrc.bottom + initrc.top, resize);
}
if( resize_testcases[index].testcontrols) {
@ -532,9 +532,9 @@ static void test_resize(void)
ofn.Flags = resize_testcases[i].flags |
OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE | OFN_SHOWHELP ;
ret = GetOpenFileNameA(&ofn);
ok(!ret, "GetOpenFileName returned %#x\n", ret);
ok(!ret, "GetOpenFileName returned %#lx\n", ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
}
}
@ -628,7 +628,7 @@ static void test_ok(void)
BOOL cdret;
cdret = GetCurrentDirectoryA(sizeof(curdir), curdir);
ok(cdret, "Failed to get current dir err %d\n", GetLastError());
ok(cdret, "Failed to get current dir err %ld\n", GetLastError());
if (!GetTempFileNameA(".", "txt", 0, tmpfilename)) {
skip("Failed to create a temporary file name\n");
return;
@ -646,14 +646,14 @@ static void test_ok(void)
ok( ok_testcases[i].expclose == ok_testcases[i].actclose,
"testid %d: Open File dialog should %shave closed.\n", i,
ok_testcases[i].expclose ? "" : "NOT ");
ok(ret == ok_testcases[i].expclose, "testid %d: GetOpenFileName returned %#x\n", i, ret);
ok(ret == ok_testcases[i].expclose, "testid %d: GetOpenFileName returned %#lx\n", i, ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
cdret = SetCurrentDirectoryA(curdir);
ok(cdret, "Failed to restore current dir err %d\n", GetLastError());
ok(cdret, "Failed to restore current dir err %ld\n", GetLastError());
}
ret = DeleteFileA( tmpfilename);
ok( ret, "Failed to delete temporary file %s err %d\n", tmpfilename, GetLastError());
ok( ret, "Failed to delete temporary file %s err %ld\n", tmpfilename, GetLastError());
}
/* test arranging with a custom template */
@ -759,18 +759,18 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
if( !(style & WS_SIZEBOX)) {
/* without the OFN_ENABLESIZING flag */
ok( wrcParent.bottom - wrcParent.top == expecty,
"Wrong height of dialog %d, expected %d\n",
"Wrong height of dialog %ld, expected %d\n",
wrcParent.bottom - wrcParent.top, expecty);
ok( wrcParent.right - wrcParent.left == expectx,
"Wrong width of dialog %d, expected %d\n",
"Wrong width of dialog %ld, expected %d\n",
wrcParent.right - wrcParent.left, expectx);
} else {
/* with the OFN_ENABLESIZING flag */
ok( wrcParent.bottom - wrcParent.top > expecty,
"Wrong height of dialog %d, expected more than %d\n",
"Wrong height of dialog %ld, expected more than %d\n",
wrcParent.bottom - wrcParent.top, expecty);
ok( wrcParent.right - wrcParent.left > expectx,
"Wrong width of dialog %d, expected more than %d\n",
"Wrong width of dialog %ld, expected more than %d\n",
wrcParent.right - wrcParent.left, expectx);
}
@ -851,9 +851,9 @@ static void test_arrange(void)
itemtemplateBtn->cx = arrange_tests[i].poszBtn.cx;
itemtemplateBtn->cy = arrange_tests[i].poszBtn.cy;
ret = GetOpenFileNameA(&ofn);
ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
ok(!ret, "GetOpenFileNameA returned %#lx\n", ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
}
}
@ -912,12 +912,12 @@ static void test_getfolderpath(void)
result = GetOpenFileNameA(&ofn);
ok(FALSE == result, "expected FALSE, got %d\n", result);
ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
ok(0 == CommDlgExtendedError(), "expected 0, got %ld\n",
CommDlgExtendedError());
result = GetSaveFileNameA(&ofn);
ok(FALSE == result, "expected FALSE, got %d\n", result);
ok(0 == CommDlgExtendedError(), "expected 0, got %d\n",
ok(0 == CommDlgExtendedError(), "expected 0, got %ld\n",
CommDlgExtendedError());
}
@ -942,24 +942,24 @@ static void test_resizable2(void)
ret = GetOpenFileNameA(&ofn);
ok( ret == TRUE, "File Dialog should have been sizable\n");
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
ofn.Flags = OFN_EXPLORER | OFN_ENABLETEMPLATE;
ret = GetOpenFileNameA(&ofn);
ok( !ret, "File Dialog should NOT have been sizable\n");
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
ofn.Flags = OFN_EXPLORER | OFN_ENABLETEMPLATEHANDLE;
ofn.hInstance = LoadResource( GetModuleHandleA(NULL), FindResourceA( GetModuleHandleA(NULL), "template1", (LPSTR)RT_DIALOG));
ofn.lpTemplateName = NULL;
ret = GetOpenFileNameA(&ofn);
ok( !ret, "File Dialog should NOT have been sizable\n");
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
ofn.Flags = OFN_EXPLORER | OFN_ENABLEHOOK;
ret = GetOpenFileNameA(&ofn);
ok( !ret, "File Dialog should NOT have been sizable\n");
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
}
static void test_mru(void)
@ -982,15 +982,15 @@ static void test_mru(void)
SetLastError(0xdeadbeef);
ret = CreateDirectoryA(test_dir_name, NULL);
ok(ret == TRUE, "CreateDirectoryA should have succeeded: %d\n", GetLastError());
ok(ret == TRUE, "CreateDirectoryA should have succeeded: %ld\n", GetLastError());
/* "teach" comdlg32 about this directory */
strcpy(filename_buf, test_full_path);
SetLastError(0xdeadbeef);
ret = GetOpenFileNameA(&ofn);
ok(ret, "GetOpenFileNameA should have succeeded: %d\n", GetLastError());
ok(ret, "GetOpenFileNameA should have succeeded: %ld\n", GetLastError());
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %x\n", ret);
ok(!ret, "CommDlgExtendedError returned %lx\n", ret);
ok(testcase.actclose, "Open File dialog should have closed.\n");
ok(!strcmp(ofn.lpstrFile, test_full_path), "Expected to get %s, got %s\n", test_full_path, ofn.lpstrFile);
@ -999,16 +999,16 @@ static void test_mru(void)
strcpy(filename_buf, test_file_name);
SetLastError(0xdeadbeef);
ret = GetOpenFileNameA(&ofn);
ok(ret, "GetOpenFileNameA should have succeeded: %d\n", GetLastError());
ok(ret, "GetOpenFileNameA should have succeeded: %ld\n", GetLastError());
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %x\n", ret);
ok(!ret, "CommDlgExtendedError returned %lx\n", ret);
ok(testcase.actclose, "Open File dialog should have closed.\n");
if(strcmp(ofn.lpstrFile, test_full_path) != 0)
win_skip("Platform doesn't save MRU data\n");
SetLastError(0xdeadbeef);
ret = RemoveDirectoryA(test_dir_name);
ok(ret == TRUE, "RemoveDirectoryA should have succeeded: %d\n", GetLastError());
ok(ret == TRUE, "RemoveDirectoryA should have succeeded: %ld\n", GetLastError());
}
static UINT_PTR WINAPI test_extension_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
@ -1040,7 +1040,7 @@ static void test_extension_helper(OPENFILENAMEA* ofn, const char *filter,
ok(boolret, "%s: expected TRUE\n", filter);
ret = CommDlgExtendedError();
ok(!ret, "%s: CommDlgExtendedError returned %#x\n", filter, ret);
ok(!ret, "%s: CommDlgExtendedError returned %#lx\n", filter, ret);
filename_ptr = ofn->lpstrFile + ofn->nFileOffset;
ok(strcmp(filename_ptr, expected_filename) == 0,
@ -1071,7 +1071,7 @@ static void test_extension(void)
};
boolret = GetTempPathA(sizeof(dir), dir);
ok(boolret, "Failed to get current dir err %d\n", GetLastError());
ok(boolret, "Failed to get current dir err %ld\n", GetLastError());
ofn.hwndOwner = NULL;
ofn.lpstrFile = filename;
@ -1168,9 +1168,9 @@ static void test_null_filename(void)
ofnA.lpstrFilter = "text\0*.txt\0All\0*\0\0";
ofnA.lpstrDefExt = NULL;
ret = GetOpenFileNameA(&ofnA);
todo_wine ok(ret, "GetOpenFileNameA returned %#x\n", ret);
todo_wine ok(ret, "GetOpenFileNameA returned %#lx\n", ret);
ret = CommDlgExtendedError();
todo_wine ok(!ret, "CommDlgExtendedError returned %#x, should be 0\n", ret);
todo_wine ok(!ret, "CommDlgExtendedError returned %#lx, should be 0\n", ret);
todo_wine ok(ofnA.nFileOffset != 0xdead, "ofnA.nFileOffset is 0xdead\n");
todo_wine ok(ofnA.nFileExtension != 0xbeef, "ofnA.nFileExtension is 0xbeef\n");
@ -1180,9 +1180,9 @@ static void test_null_filename(void)
ofnA.nFileOffset = 0xdead;
ofnA.nFileExtension = 0xbeef;
ret = GetOpenFileNameA(&ofnA);
ok(ret, "GetOpenFileNameA returned %#x\n", ret);
ok(ret, "GetOpenFileNameA returned %#lx\n", ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
ok(ofnA.nFileOffset != 0xdead, "ofnA.nFileOffset is 0xdead\n");
ok(ofnA.nFileExtension == 0, "ofnA.nFileExtension is 0x%x, should be 0\n", ofnA.nFileExtension);
@ -1199,9 +1199,9 @@ static void test_null_filename(void)
ofnW.lpstrFilter = filterW;
ofnW.lpstrDefExt = NULL;
ret = GetOpenFileNameW(&ofnW);
todo_wine ok(ret, "GetOpenFileNameW returned %#x\n", ret);
todo_wine ok(ret, "GetOpenFileNameW returned %#lx\n", ret);
ret = CommDlgExtendedError();
todo_wine ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
todo_wine ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
todo_wine ok(ofnW.nFileOffset != 0xdead, "ofnW.nFileOffset is 0xdead\n");
todo_wine ok(ofnW.nFileExtension != 0xbeef, "ofnW.nFileExtension is 0xbeef\n");
@ -1211,9 +1211,9 @@ static void test_null_filename(void)
ofnW.nFileOffset = 0xdead;
ofnW.nFileExtension = 0xbeef;
ret = GetOpenFileNameW(&ofnW);
ok(ret, "GetOpenFileNameA returned %#x\n", ret);
ok(ret, "GetOpenFileNameA returned %#lx\n", ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
ok(!ret, "CommDlgExtendedError returned %#lx\n", ret);
ok(ofnW.nFileOffset != 0xdead, "ofnW.nFileOffset is 0xdead\n");
ok(ofnW.nFileExtension == 0, "ofnW.nFileExtension is 0x%x, should be 0\n", ofnW.nFileExtension);
@ -1244,7 +1244,7 @@ static void test_directory_filename(void)
ofnA.lpstrFilter = "text\0*.txt\0All\0*\0\0";
ofnA.lpstrDefExt = NULL;
ret = GetOpenFileNameA(&ofnA);
todo_wine ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
todo_wine ok(!ret, "GetOpenFileNameA returned %#lx\n", ret);
/* unicode tests */
ofnW.lStructSize = OPENFILENAME_SIZE_VERSION_400W;
@ -1256,7 +1256,7 @@ static void test_directory_filename(void)
ofnW.lpstrFilter = filterW;
ofnW.lpstrDefExt = NULL;
ret = GetOpenFileNameW(&ofnW);
todo_wine ok(!ret, "GetOpenFileNameW returned %#x\n", ret);
todo_wine ok(!ret, "GetOpenFileNameW returned %#lx\n", ret);
}
static UINT_PTR WINAPI test_ole_init_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
@ -1264,7 +1264,7 @@ static UINT_PTR WINAPI test_ole_init_wndproc(HWND dlg, UINT msg, WPARAM wParam,
HRESULT hr;
hr = OleInitialize(NULL);
ok(hr == S_FALSE, "OleInitialize() returned %#x\n", hr);
ok(hr == S_FALSE, "OleInitialize() returned %#lx\n", hr);
OleUninitialize();
if (msg == WM_NOTIFY)
@ -1291,7 +1291,7 @@ static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp)
hr = OleInitialize(NULL);
ok((first_dlg ? hr == S_OK : hr == S_FALSE)
|| broken(first_dlg && hr == S_FALSE),
"OleInitialize() returned %#x (first dialog %#x)\n", hr, first_dlg);
"OleInitialize() returned %#lx (first dialog %#x)\n", hr, first_dlg);
OleUninitialize();
first_dlg = FALSE;
}
@ -1320,7 +1320,7 @@ static void test_ole_initialization(void)
ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
hr = OleInitialize(NULL);
ok(hr == S_OK, "OleInitialize() returned %#x\n", hr);
ok(hr == S_OK, "OleInitialize() returned %#lx\n", hr);
OleUninitialize();
UnhookWindowsHookEx(hook);

View File

@ -58,7 +58,7 @@ static void test_param_check(void)
ok(is_ok, "%s should%s fail\n", #FUNC, FAIL ? "" : "n't"); \
if (FAIL && is_ok) { \
DWORD ext_err = CommDlgExtendedError(); \
ok(ext_err == ERR_CODE, "expected err %x got %x\n", \
ok(ext_err == ERR_CODE, "expected err %x got %lx\n", \
ERR_CODE, ext_err); \
} else { \
DestroyWindow(hwnd); \

View File

@ -108,8 +108,8 @@ static void test_ChooseFontA(void)
ok(ret == TRUE, "ChooseFontA returned FALSE\n");
ok(cfa.iPointSize == expected_pointsize, "Expected %i, got %i\n", expected_pointsize, cfa.iPointSize);
ok(lfa.lfHeight == expected_lfheight, "Expected %i, got %i\n", expected_lfheight, lfa.lfHeight);
ok(lfa.lfWeight == FW_NORMAL, "Expected FW_NORMAL, got %i\n", lfa.lfWeight);
ok(lfa.lfHeight == expected_lfheight, "Expected %i, got %li\n", expected_lfheight, lfa.lfHeight);
ok(lfa.lfWeight == FW_NORMAL, "Expected FW_NORMAL, got %li\n", lfa.lfWeight);
ok(lfa.lfCharSet == SYMBOL_CHARSET, "Expected SYMBOL_CHARSET, got %i\n", lfa.lfCharSet);
ok(strcmp(lfa.lfFaceName, "Symbol") == 0, "Expected Symbol, got %s\n", lfa.lfFaceName);
@ -142,8 +142,8 @@ static void test_ChooseFontA(void)
ok(ret == TRUE, "ChooseFontA returned FALSE\n");
ok(cfa.iPointSize == expected_pointsize, "Expected %i, got %i\n", expected_pointsize, cfa.iPointSize);
ok(lfa.lfHeight == expected_lfheight, "Expected %i, got %i\n", expected_lfheight, lfa.lfHeight);
ok(lfa.lfWeight == FW_NORMAL, "Expected FW_NORMAL, got %i\n", lfa.lfWeight);
ok(lfa.lfHeight == expected_lfheight, "Expected %i, got %li\n", expected_lfheight, lfa.lfHeight);
ok(lfa.lfWeight == FW_NORMAL, "Expected FW_NORMAL, got %li\n", lfa.lfWeight);
ok((strcmp(lfa.lfFaceName, "Symbol") == 0) ||
broken(*lfa.lfFaceName == 0), "Expected Symbol, got %s\n", lfa.lfFaceName);

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ static void test_PageSetupDlgA(void)
SetLastError(0xdeadbeef);
res = PageSetupDlgA(NULL);
ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION),
"returned %u with %u and 0x%x (expected '0' and "
"returned %lu with %lu and 0x%lx (expected '0' and "
"CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError());
ZeroMemory(pDlg, sizeof(PAGESETUPDLGA));
@ -73,7 +73,7 @@ static void test_PageSetupDlgA(void)
SetLastError(0xdeadbeef);
res = PageSetupDlgA(pDlg);
ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
"returned %u with %u and 0x%x (expected '0' and "
"returned %lu with %lu and 0x%lx (expected '0' and "
"CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());
ZeroMemory(pDlg, sizeof(PAGESETUPDLGA));
@ -82,7 +82,7 @@ static void test_PageSetupDlgA(void)
SetLastError(0xdeadbeef);
res = PageSetupDlgA(pDlg);
ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
"returned %u with %u and 0x%x (expected '0' and CDERR_STRUCTSIZE)\n",
"returned %lu with %lu and 0x%lx (expected '0' and CDERR_STRUCTSIZE)\n",
res, GetLastError(), CommDlgExtendedError());
@ -92,7 +92,7 @@ static void test_PageSetupDlgA(void)
SetLastError(0xdeadbeef);
res = PageSetupDlgA(pDlg);
ok( res || (CommDlgExtendedError() == PDERR_NODEFAULTPRN),
"returned %u with %u and 0x%x (expected '!= 0' or '0' and "
"returned %lu with %lu and 0x%lx (expected '!= 0' or '0' and "
"PDERR_NODEFAULTPRN)\n", res, GetLastError(), CommDlgExtendedError());
if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) {
@ -146,7 +146,7 @@ static void test_PrintDlgA(void)
SetLastError(0xdeadbeef);
res = PrintDlgA(NULL);
ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION),
"returned %d with 0x%x and 0x%x (expected '0' and "
"returned %ld with 0x%lx and 0x%lx (expected '0' and "
"CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError());
ZeroMemory(pDlg, sizeof(PRINTDLGA));
@ -154,7 +154,7 @@ static void test_PrintDlgA(void)
SetLastError(0xdeadbeef);
res = PrintDlgA(pDlg);
ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
"returned %d with 0x%x and 0x%x (expected '0' and "
"returned %ld with 0x%lx and 0x%lx (expected '0' and "
"CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());
ZeroMemory(pDlg, sizeof(PRINTDLGA));
@ -163,7 +163,7 @@ static void test_PrintDlgA(void)
SetLastError(0xdeadbeef);
res = PrintDlgA(pDlg);
ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
"returned %u with %u and 0x%x (expected '0' and "
"returned %lu with %lu and 0x%lx (expected '0' and "
"CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());
@ -173,7 +173,7 @@ static void test_PrintDlgA(void)
SetLastError(0xdeadbeef);
res = PrintDlgA(pDlg);
ok( res || (CommDlgExtendedError() == PDERR_NODEFAULTPRN),
"returned %d with 0x%x and 0x%x (expected '!= 0' or '0' and "
"returned %ld with 0x%lx and 0x%lx (expected '!= 0' or '0' and "
"PDERR_NODEFAULTPRN)\n", res, GetLastError(), CommDlgExtendedError());
if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) {
@ -213,7 +213,7 @@ static void test_PrintDlgA(void)
res = GetProfileStringA(PrinterPortsA, device, emptyA, buffer, sizeof(buffer));
ptr = strchr(buffer, ',');
ok( (res > 1) && (ptr != NULL),
"got %u with %u and %p for '%s' (expected '>1' and '!= NULL')\n",
"got %lu with %lu and %p for '%s' (expected '>1' and '!= NULL')\n",
res, GetLastError(), ptr, buffer);
if (ptr) ptr[0] = '\0';
@ -240,7 +240,7 @@ static void test_PrintDlgA(void)
pDlg->Flags = PD_ENABLEPRINTHOOK;
pDlg->lpfnPrintHook = print_hook_proc;
res = PrintDlgA(pDlg);
ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
ok(res, "PrintDlg error %#lx\n", CommDlgExtendedError());
/* Version of Microsoft XPS Document Writer driver shipped before Win7
* reports that it can print multiple copies, but returns 1.
*/
@ -259,7 +259,7 @@ static void test_PrintDlgA(void)
pDlg->Flags = PD_ENABLEPRINTHOOK | PD_USEDEVMODECOPIES;
pDlg->lpfnPrintHook = print_hook_proc;
res = PrintDlgA(pDlg);
ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
ok(res, "PrintDlg error %#lx\n", CommDlgExtendedError());
ok(pDlg->nCopies == 1, "expected nCopies 1, got %d\n", pDlg->nCopies);
ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n");
dm = GlobalLock(pDlg->hDevMode);
@ -308,7 +308,7 @@ static HRESULT WINAPI callback_SelectionChange(IPrintDialogCallback *iface)
static HRESULT WINAPI callback_HandleMessage(IPrintDialogCallback *iface,
HWND hdlg, UINT msg, WPARAM wp, LPARAM lp, LRESULT *res)
{
trace("callback_HandleMessage %p,%04x,%lx,%lx,%p\n", hdlg, msg, wp, lp, res);
trace("callback_HandleMessage %p,%04x,%Ix,%Ix,%p\n", hdlg, msg, wp, lp, res);
/* *res = PD_RESULT_PRINT; */
return S_OK;
}
@ -386,7 +386,7 @@ static void test_PrintDlgExW(void)
SetLastError(0xdeadbeef);
res = pPrintDlgExW(NULL);
ok( (res == E_INVALIDARG),
"got 0x%x with %u and %u (expected 'E_INVALIDARG')\n",
"got 0x%lx with %lu and %lu (expected 'E_INVALIDARG')\n",
res, GetLastError(), CommDlgExtendedError() );
}
@ -400,7 +400,7 @@ static void test_PrintDlgExW(void)
SetLastError(0xdeadbeef);
res = pPrintDlgExW(pDlg);
ok( (res == E_INVALIDARG),
"got 0x%x with %u and %u (expected 'E_INVALIDARG')\n",
"got 0x%lx with %lu and %lu (expected 'E_INVALIDARG')\n",
res, GetLastError(), CommDlgExtendedError());
@ -410,7 +410,7 @@ static void test_PrintDlgExW(void)
SetLastError(0xdeadbeef);
res = pPrintDlgExW(pDlg);
ok( (res == E_INVALIDARG),
"got 0x%x with %u and %u (expected 'E_INVALIDARG')\n",
"got 0x%lx with %lu and %lu (expected 'E_INVALIDARG')\n",
res, GetLastError(), CommDlgExtendedError());
@ -419,7 +419,7 @@ static void test_PrintDlgExW(void)
SetLastError(0xdeadbeef);
res = pPrintDlgExW(pDlg);
ok( (res == E_HANDLE),
"got 0x%x with %u and %u (expected 'E_HANDLE')\n",
"got 0x%lx with %lu and %lu (expected 'E_HANDLE')\n",
res, GetLastError(), CommDlgExtendedError());
/* nStartPage must be START_PAGE_GENERAL for the general page or a valid property sheet index */
@ -428,7 +428,7 @@ static void test_PrintDlgExW(void)
pDlg->hwndOwner = GetDesktopWindow();
pDlg->Flags = PD_RETURNDEFAULT | PD_NOWARNING | PD_NOPAGENUMS;
res = pPrintDlgExW(pDlg);
ok((res == E_INVALIDARG), "got 0x%x (expected 'E_INVALIDARG')\n", res);
ok((res == E_INVALIDARG), "got 0x%lx (expected 'E_INVALIDARG')\n", res);
/* Use PD_NOPAGENUMS or set nMaxPageRanges and lpPageRanges */
ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
@ -437,7 +437,7 @@ static void test_PrintDlgExW(void)
pDlg->Flags = PD_RETURNDEFAULT | PD_NOWARNING;
pDlg->nStartPage = START_PAGE_GENERAL;
res = pPrintDlgExW(pDlg);
ok((res == E_INVALIDARG), "got 0x%x (expected 'E_INVALIDARG')\n", res);
ok((res == E_INVALIDARG), "got 0x%lx (expected 'E_INVALIDARG')\n", res);
/* this is invalid: a valid lpPageRanges with 0 for nMaxPageRanges */
ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
@ -447,7 +447,7 @@ static void test_PrintDlgExW(void)
pDlg->lpPageRanges = pagerange;
pDlg->nStartPage = START_PAGE_GENERAL;
res = pPrintDlgExW(pDlg);
ok((res == E_INVALIDARG), "got 0x%x (expected 'E_INVALIDARG')\n", res);
ok((res == E_INVALIDARG), "got 0x%lx (expected 'E_INVALIDARG')\n", res);
/* this is invalid: NULL for lpPageRanges with a valid nMaxPageRanges */
ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
@ -457,7 +457,7 @@ static void test_PrintDlgExW(void)
pDlg->nMaxPageRanges = 1;
pDlg->nStartPage = START_PAGE_GENERAL;
res = pPrintDlgExW(pDlg);
ok((res == E_INVALIDARG), "got 0x%x (expected 'E_INVALIDARG')\n", res);
ok((res == E_INVALIDARG), "got 0x%lx (expected 'E_INVALIDARG')\n", res);
/* this works: lpPageRanges with a valid nMaxPageRanges */
ZeroMemory(pDlg, sizeof(PRINTDLGEXW));
@ -475,7 +475,7 @@ static void test_PrintDlgExW(void)
return;
}
ok(res == S_OK, "got 0x%x (expected S_OK)\n", res);
ok(res == S_OK, "got 0x%lx (expected S_OK)\n", res);
dn = GlobalLock(pDlg->hDevNames);
ok(dn != NULL, "expected '!= NULL' for GlobalLock(%p)\n",pDlg->hDevNames);
@ -498,7 +498,7 @@ static void test_PrintDlgExW(void)
pDlg->Flags = PD_RETURNDEFAULT | PD_NOWARNING | PD_NOPAGENUMS;
pDlg->nStartPage = START_PAGE_GENERAL;
res = pPrintDlgExW(pDlg);
ok(res == S_OK, "got 0x%x (expected S_OK)\n", res);
ok(res == S_OK, "got 0x%lx (expected S_OK)\n", res);
GlobalFree(pDlg->hDevMode);
GlobalFree(pDlg->hDevNames);
@ -509,7 +509,7 @@ static void test_PrintDlgExW(void)
pDlg->Flags = PD_RETURNDEFAULT | PD_NOWARNING | PD_NOPAGENUMS | PD_RETURNDC;
pDlg->nStartPage = START_PAGE_GENERAL;
res = pPrintDlgExW(pDlg);
ok(res == S_OK, "got 0x%x (expected S_OK)\n", res);
ok(res == S_OK, "got 0x%lx (expected S_OK)\n", res);
ok(pDlg->hDC != NULL, "HDC missing for PD_RETURNDC\n");
GlobalFree(pDlg->hDevMode);
GlobalFree(pDlg->hDevNames);
@ -522,7 +522,7 @@ static void test_PrintDlgExW(void)
pDlg->Flags = PD_RETURNDEFAULT | PD_NOWARNING | PD_NOPAGENUMS | PD_RETURNIC;
pDlg->nStartPage = START_PAGE_GENERAL;
res = pPrintDlgExW(pDlg);
ok(res == S_OK, "got 0x%x (expected S_OK)\n", res);
ok(res == S_OK, "got 0x%lx (expected S_OK)\n", res);
ok(pDlg->hDC != NULL, "HDC missing for PD_RETURNIC\n");
GlobalFree(pDlg->hDevMode);
GlobalFree(pDlg->hDevNames);
@ -545,8 +545,8 @@ static void test_PrintDlgExW(void)
pDlg->lpCallback = &unknown;
pDlg->dwResultAction = S_OK;
res = pPrintDlgExW(pDlg);
ok(res == S_OK, "got 0x%x (expected S_OK)\n", res);
ok(pDlg->dwResultAction == PD_RESULT_PRINT, "expected PD_RESULT_PRINT, got %#x\n", pDlg->dwResultAction);
ok(res == S_OK, "got 0x%lx (expected S_OK)\n", res);
ok(pDlg->dwResultAction == PD_RESULT_PRINT, "expected PD_RESULT_PRINT, got %#lx\n", pDlg->dwResultAction);
ok(pDlg->hDC != NULL, "HDC missing for PD_RETURNIC\n");
GlobalFree(pDlg->hDevMode);
GlobalFree(pDlg->hDevNames);
@ -602,7 +602,7 @@ static void test_abort_proc(void)
ok(job_id > 0 ||
GetLastError() == ERROR_SPL_NO_STARTDOC, /* Vista can fail with this error when using the XPS driver */
"StartDocA failed ret %d gle %d\n", job_id, GetLastError());
"StartDocA failed ret %d gle %ld\n", job_id, GetLastError());
if(job_id <= 0)
{
@ -630,7 +630,7 @@ static void test_abort_proc(void)
end:
SetLastError(0xdeadbeef);
if(!DeleteFileA(filename))
trace("Failed to delete temporary file (err = %x)\n", GetLastError());
trace("Failed to delete temporary file (err = %lx)\n", GetLastError());
}
/* ########################### */