Commit e240aeb7 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

comdlg32/tests: Enable compilation with long types.

parent cd4c58f5
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = comdlg32.dll
IMPORTS = uuid shell32 ole32 comdlg32 winspool user32 gdi32
......
......@@ -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);
......
......@@ -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); \
......
......@@ -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);
......
......@@ -96,10 +96,10 @@ static HWND get_hwnd_from_ifiledialog(IFileDialog *pfd)
HRESULT hr;
hr = IFileDialog_QueryInterface(pfd, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IOleWindow_GetWindow(pow, &dlg_hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IOleWindow_Release(pow);
......@@ -213,7 +213,7 @@ static HRESULT WINAPI IFileDialogEvents_fnOnFolderChange(IFileDialogEvents *ifac
ok(dlg_hwnd != NULL, "Got NULL.\n");
hr = IFileDialog_SetFileName(pfd, This->set_filename);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(!This->set_filename_tried)
{
......@@ -290,7 +290,7 @@ static HRESULT WINAPI IFileDialogEvents_fnOnOverwrite(IFileDialogEvents *iface,
This->OnOverwrite++;
ok(*pResponse == FDEOR_DEFAULT, "overwrite response %u\n", *pResponse);
*pResponse = FDEOR_ACCEPT;
ok(!This->OnFileOk, "OnFileOk already called %u times\n", This->OnFileOk);
ok(!This->OnFileOk, "OnFileOk already called %lu times\n", This->OnFileOk);
return S_OK;
}
......@@ -337,88 +337,88 @@ static BOOL test_instantiation(void)
win_skip("Could not instantiate the FileOpenDialog.\n");
return FALSE;
}
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IFileDialog_Release(pfd);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomizeAlt, (void**)&unk2);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(punk == unk2, "got %p, %p\n", punk, unk2);
IUnknown_Release(punk);
IUnknown_Release(unk2);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileSaveDialog, (void**)&pfsd);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IFileSaveDialog_Release(pfsd);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IServiceProvider, (void**)&psp);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
IExplorerBrowser *peb;
IShellBrowser *psb;
hr = IServiceProvider_QueryService(psp, &SID_SExplorerBrowserFrame, &IID_ICommDlgBrowser, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
/* since win8, the result is E_NOTIMPL for all other services */
hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IExplorerBrowser, (void**)&peb);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08x (expected E_NOTIMPL)\n", hr);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08lx (expected E_NOTIMPL)\n", hr);
if(SUCCEEDED(hr)) IExplorerBrowser_Release(peb);
hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IShellBrowser, (void**)&psb);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08x (expected E_NOTIMPL)\n", hr);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08lx (expected E_NOTIMPL)\n", hr);
if(SUCCEEDED(hr)) IShellBrowser_Release(psb);
hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_ICommDlgBrowser, (void**)&punk);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08x (expected E_NOTIMPL)\n", hr);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08lx (expected E_NOTIMPL)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IUnknown, (void**)&punk);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08x (expected E_NOTIMPL)\n", hr);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08lx (expected E_NOTIMPL)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IServiceProvider_QueryService(psp, &IID_IUnknown, &IID_IUnknown, (void**)&punk);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08x (expected E_NOTIMPL)\n", hr);
ok(hr == E_NOTIMPL || broken(hr == E_FAIL), "got 0x%08lx (expected E_NOTIMPL)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
IServiceProvider_Release(psp);
}
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogEvents, (void**)&punk);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IExplorerBrowser, (void**)&punk);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IExplorerBrowserEvents, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_ICommDlgBrowser3, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IShellBrowser, (void**)&punk);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
HWND hwnd;
hr = IOleWindow_ContextSensitiveHelp(pow, TRUE);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IOleWindow_ContextSensitiveHelp(pow, FALSE);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(0)
{
......@@ -427,14 +427,14 @@ static BOOL test_instantiation(void)
}
hr = IOleWindow_GetWindow(pow, &hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(hwnd == NULL, "Got %p\n", hwnd);
IOleWindow_Release(pow);
}
ref = IFileOpenDialog_Release(pfod);
ok(!ref, "Got refcount %d, should have been released.\n", ref);
ok(!ref, "Got refcount %ld, should have been released.\n", ref);
/* Instantiate FileSaveDialog */
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
......@@ -444,56 +444,56 @@ static BOOL test_instantiation(void)
win_skip("Could not instantiate the FileSaveDialog.\n");
return FALSE;
}
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IFileDialog_Release(pfd);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogCustomize, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogCustomizeAlt, (void**)&unk2);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(punk == unk2, "got %p, %p\n", punk, unk2);
IUnknown_Release(punk);
IUnknown_Release(unk2);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileOpenDialog, (void**)&pfod);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IFileOpenDialog_Release(pfod);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogEvents, (void**)&punk);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IFileDialog_Release(pfd);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowser, (void**)&punk);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowserEvents, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_ICommDlgBrowser3, (void**)&punk);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IShellBrowser, (void**)&punk);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
HWND hwnd;
hr = IOleWindow_ContextSensitiveHelp(pow, TRUE);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IOleWindow_ContextSensitiveHelp(pow, FALSE);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(0)
{
......@@ -502,7 +502,7 @@ static BOOL test_instantiation(void)
}
hr = IOleWindow_GetWindow(pow, &hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(hwnd == NULL, "Got %p\n", hwnd);
IOleWindow_Release(pow);
......@@ -510,7 +510,7 @@ static BOOL test_instantiation(void)
ref = IFileSaveDialog_Release(pfsd);
ok(!ref, "Got refcount %d, should have been released.\n", ref);
ok(!ref, "Got refcount %ld, should have been released.\n", ref);
return TRUE;
}
......@@ -558,205 +558,205 @@ static void test_basics(void)
/* Instantiate FileOpenDialog and FileSaveDialog */
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileOpenDialog, (void**)&pfod);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileSaveDialog, (void**)&pfsd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
/* ClearClientData */
todo_wine
{
hr = IFileOpenDialog_ClearClientData(pfod);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_ClearClientData(pfsd);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
}
/* GetOptions */
hr = IFileOpenDialog_GetOptions(pfod, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetOptions(pfsd, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
/* Check default options */
hr = IFileOpenDialog_GetOptions(pfod, &fdoptions);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR),
"Unexpected default options: 0x%08x\n", fdoptions);
"Unexpected default options: 0x%08lx\n", fdoptions);
hr = IFileSaveDialog_GetOptions(pfsd, &fdoptions);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(fdoptions == (FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR),
"Unexpected default options: 0x%08x\n", fdoptions);
"Unexpected default options: 0x%08lx\n", fdoptions);
/* Check SetOptions invalid options handling */
for (i = 0; i < ARRAY_SIZE(invalid_fos); i++)
{
hr = IFileOpenDialog_SetOptions(pfod, invalid_fos[i]);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_GetOptions(pfod, &fdoptions);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR), "got %08x\n", fdoptions);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR), "got %08lx\n", fdoptions);
hr = IFileSaveDialog_SetOptions(pfsd, invalid_fos[i]);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetOptions(pfsd, &fdoptions);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(fdoptions == (FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR),
"got %08x\n", fdoptions);
"got %08lx\n", fdoptions);
}
/* GetResult */
hr = IFileOpenDialog_GetResult(pfod, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetResult(pfsd, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
psi = (void*)0xdeadbeef;
hr = IFileOpenDialog_GetResult(pfod, &psi);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
ok(psi == (void*)0xdeadbeef, "got %p.\n", psi);
psi = (void*)0xdeadbeef;
hr = IFileSaveDialog_GetResult(pfsd, &psi);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
ok(psi == (void*)0xdeadbeef, "got %p.\n", psi);
/* GetCurrentSelection */
if(0) {
/* Crashes on Vista/W2K8. Tests below passes on Windows 7 */
hr = IFileOpenDialog_GetCurrentSelection(pfod, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetCurrentSelection(pfsd, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_GetCurrentSelection(pfod, &psi);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetCurrentSelection(pfsd, &psi);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
}
/* GetFileName */
hr = IFileOpenDialog_GetFileName(pfod, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
filename = (void*)0xdeadbeef;
hr = IFileOpenDialog_GetFileName(pfod, &filename);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
ok(filename == NULL, "got %p\n", filename);
hr = IFileSaveDialog_GetFileName(pfsd, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
filename = (void*)0xdeadbeef;
hr = IFileSaveDialog_GetFileName(pfsd, &filename);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
ok(filename == NULL, "got %p\n", filename);
/* GetFileTypeIndex */
hr = IFileOpenDialog_GetFileTypeIndex(pfod, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
filetype = 0x12345;
hr = IFileOpenDialog_GetFileTypeIndex(pfod, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(filetype == 0, "got %d.\n", filetype);
hr = IFileSaveDialog_GetFileTypeIndex(pfsd, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
filetype = 0x12345;
hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(filetype == 0, "got %d.\n", filetype);
/* SetFileTypes / SetFileTypeIndex */
hr = IFileOpenDialog_SetFileTypes(pfod, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypeIndex(pfod, 1);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 1, filterspec);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_GetFileTypeIndex(pfod, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(filetype == 1, "got %d\n", filetype);
hr = IFileOpenDialog_SetFileTypeIndex(pfod, 100);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_GetFileTypeIndex(pfod, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(filetype == 1, "got %d\n", filetype);
hr = IFileOpenDialog_SetFileTypes(pfod, 1, filterspec);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 1, &filterspec[1]);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 0);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 1);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFileTypes(pfsd, 2, filterspec);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
/* I hope no one relies on this one */
todo_wine ok(filetype == 0, "got %d\n", filetype);
hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(filetype == 1, "got %d\n", filetype);
hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 100);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &filetype);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(filetype == 2, "got %d\n", filetype);
hr = IFileSaveDialog_SetFileTypes(pfsd, 1, filterspec);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFileTypes(pfsd, 1, &filterspec[1]);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
/* SetFilter */
todo_wine
{
hr = IFileOpenDialog_SetFilter(pfod, NULL);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFilter(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
/* SetFolder */
hr = IFileOpenDialog_SetFolder(pfod, NULL);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFolder(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
/* SetDefaultExtension */
hr = IFileOpenDialog_SetDefaultExtension(pfod, NULL);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetDefaultExtension(pfod, txt);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetDefaultExtension(pfod, null);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetDefaultExtension(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetDefaultExtension(pfsd, txt);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetDefaultExtension(pfsd, null);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
/* SetDefaultFolder */
hr = IFileOpenDialog_SetDefaultFolder(pfod, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetDefaultFolder(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetDefaultFolder(pfod, psidesktop);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetDefaultFolder(pfsd, psidesktop);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
if(0)
{
......@@ -767,27 +767,27 @@ static void test_basics(void)
/* GetFolder / SetFolder */
hr = IFileOpenDialog_GetFolder(pfod, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_GetFolder(pfod, &psi_original);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
hr = IFileOpenDialog_SetFolder(pfod, psidesktop);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileOpenDialog_SetFolder(pfod, psi_original);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IShellItem_Release(psi_original);
}
hr = IFileSaveDialog_GetFolder(pfsd, &psi_original);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
hr = IFileSaveDialog_SetFolder(pfsd, psidesktop);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileSaveDialog_SetFolder(pfsd, psi_original);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IShellItem_Release(psi_original);
}
......@@ -800,105 +800,105 @@ static void test_basics(void)
}
hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_TOP + 1);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_BOTTOM);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_TOP);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_TOP + 1);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_BOTTOM);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_TOP);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* SetFileName */
hr = IFileOpenDialog_SetFileName(pfod, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetFileName(pfod, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
filename = NULL;
hr = IFileOpenDialog_GetFileName(pfod, &filename);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, null), "Strings do not match.\n");
CoTaskMemFree(filename);
hr = IFileOpenDialog_SetFileName(pfod, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
filename = (void*)0xdeadbeef;
hr = IFileOpenDialog_GetFileName(pfod, &filename);
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
ok(filename == NULL, "got %p.\n", filename);
hr = IFileOpenDialog_SetFileName(pfod, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_GetFileName(pfod, &filename);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, txt), "Strings do not match.\n");
CoTaskMemFree(filename);
hr = IFileSaveDialog_SetFileName(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetFileName(pfsd, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetFileName(pfsd, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_GetFileName(pfsd, &filename);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, txt), "Strings do not match.\n");
CoTaskMemFree(filename);
/* SetFileNameLabel */
hr = IFileOpenDialog_SetFileNameLabel(pfod, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetFileNameLabel(pfod, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetFileNameLabel(pfod, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetFileNameLabel(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetFileNameLabel(pfsd, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetFileNameLabel(pfsd, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* Close */
hr = IFileOpenDialog_Close(pfod, S_FALSE);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_Close(pfsd, S_FALSE);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* SetOkButtonLabel */
hr = IFileOpenDialog_SetOkButtonLabel(pfod, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetOkButtonLabel(pfod, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetOkButtonLabel(pfod, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetOkButtonLabel(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetOkButtonLabel(pfsd, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetOkButtonLabel(pfsd, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* SetTitle */
hr = IFileOpenDialog_SetTitle(pfod, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetTitle(pfod, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileOpenDialog_SetTitle(pfod, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetTitle(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetTitle(pfsd, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetTitle(pfsd, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/** IFileOpenDialog specific **/
......@@ -910,7 +910,7 @@ static void test_basics(void)
}
psia = (void*)0xdeadbeef;
hr = IFileOpenDialog_GetResults(pfod, &psia);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
ok(psia == NULL, "got %p.\n", psia);
/* GetSelectedItems */
......@@ -918,10 +918,10 @@ static void test_basics(void)
{
/* Crashes under W2K8 */
hr = IFileOpenDialog_GetSelectedItems(pfod, NULL);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
psia = (void*)0xdeadbeef;
hr = IFileOpenDialog_GetSelectedItems(pfod, &psia);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
ok(psia == (void*)0xdeadbeef, "got %p.\n", psia);
}
......@@ -937,10 +937,10 @@ static void test_basics(void)
/* GetProperties */
hr = IFileSaveDialog_GetProperties(pfsd, NULL);
todo_wine ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
todo_wine ok(hr == E_UNEXPECTED, "got 0x%08lx\n", hr);
pps = (void*)0xdeadbeef;
hr = IFileSaveDialog_GetProperties(pfsd, &pps);
todo_wine ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
todo_wine ok(hr == E_UNEXPECTED, "got 0x%08lx\n", hr);
ok(pps == (void*)0xdeadbeef, "got %p\n", pps);
/* SetProperties */
......@@ -948,72 +948,72 @@ static void test_basics(void)
{
/* Crashes under W2K8 */
hr = IFileSaveDialog_SetProperties(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
/* SetCollectedProperties */
todo_wine
{
hr = IFileSaveDialog_SetCollectedProperties(pfsd, NULL, TRUE);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetCollectedProperties(pfsd, NULL, FALSE);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
/* SetSaveAsItem */
todo_wine
{
hr = IFileSaveDialog_SetSaveAsItem(pfsd, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileSaveDialog_SetSaveAsItem(pfsd, psidesktop);
ok(hr == MK_E_NOOBJECT, "got 0x%08x\n", hr);
ok(hr == MK_E_NOOBJECT, "got 0x%08lx\n", hr);
}
/** IFileDialog2 **/
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialog2, (void**)&pfd2);
ok((hr == S_OK) || broken(hr == E_NOINTERFACE), "got 0x%08x\n", hr);
ok((hr == S_OK) || broken(hr == E_NOINTERFACE), "got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
/* SetCancelButtonLabel */
hr = IFileDialog2_SetOkButtonLabel(pfd2, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileDialog2_SetOkButtonLabel(pfd2, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileDialog2_SetOkButtonLabel(pfd2, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* SetNavigationRoot */
todo_wine
{
hr = IFileDialog2_SetNavigationRoot(pfd2, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IFileDialog2_SetNavigationRoot(pfd2, psidesktop);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
IFileDialog2_Release(pfd2);
}
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialog2, (void**)&pfd2);
ok((hr == S_OK) || broken(hr == E_NOINTERFACE), "got 0x%08x\n", hr);
ok((hr == S_OK) || broken(hr == E_NOINTERFACE), "got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
/* SetCancelButtonLabel */
hr = IFileDialog2_SetOkButtonLabel(pfd2, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileDialog2_SetOkButtonLabel(pfd2, null);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileDialog2_SetOkButtonLabel(pfd2, txt);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
/* SetNavigationRoot */
todo_wine
{
hr = IFileDialog2_SetNavigationRoot(pfd2, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IFileDialog2_SetNavigationRoot(pfd2, psidesktop);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
IFileDialog2_Release(pfd2);
......@@ -1022,20 +1022,20 @@ static void test_basics(void)
/* Cleanup */
IShellItem_Release(psidesktop);
ref = IFileOpenDialog_Release(pfod);
ok(!ref, "Got refcount %d, should have been released.\n", ref);
ok(!ref, "Got refcount %ld, should have been released.\n", ref);
ref = IFileSaveDialog_Release(pfsd);
ok(!ref, "Got refcount %d, should have been released.\n", ref);
ok(!ref, "Got refcount %ld, should have been released.\n", ref);
}
static void ensure_zero_events_(const char *file, int line, IFileDialogEventsImpl *impl)
{
ok_(file, line)(!impl->OnFileOk, "OnFileOk: %d\n", impl->OnFileOk);
ok_(file, line)(!impl->OnFolderChanging, "OnFolderChanging: %d\n", impl->OnFolderChanging);
ok_(file, line)(!impl->OnFolderChange, "OnFolderChange: %d\n", impl->OnFolderChange);
ok_(file, line)(!impl->OnSelectionChange, "OnSelectionChange: %d\n", impl->OnSelectionChange);
ok_(file, line)(!impl->OnShareViolation, "OnShareViolation: %d\n", impl->OnShareViolation);
ok_(file, line)(!impl->OnTypeChange, "OnTypeChange: %d\n", impl->OnTypeChange);
ok_(file, line)(!impl->OnOverwrite, "OnOverwrite: %d\n", impl->OnOverwrite);
ok_(file, line)(!impl->OnFileOk, "OnFileOk: %ld\n", impl->OnFileOk);
ok_(file, line)(!impl->OnFolderChanging, "OnFolderChanging: %ld\n", impl->OnFolderChanging);
ok_(file, line)(!impl->OnFolderChange, "OnFolderChange: %ld\n", impl->OnFolderChange);
ok_(file, line)(!impl->OnSelectionChange, "OnSelectionChange: %ld\n", impl->OnSelectionChange);
ok_(file, line)(!impl->OnShareViolation, "OnShareViolation: %ld\n", impl->OnShareViolation);
ok_(file, line)(!impl->OnTypeChange, "OnTypeChange: %ld\n", impl->OnTypeChange);
ok_(file, line)(!impl->OnOverwrite, "OnOverwrite: %ld\n", impl->OnOverwrite);
impl->OnFileOk = impl->OnFolderChanging = impl->OnFolderChange = 0;
impl->OnSelectionChange = impl->OnShareViolation = impl->OnTypeChange = 0;
impl->OnOverwrite = 0;
......@@ -1057,55 +1057,55 @@ static void test_advise_helper(IFileDialog *pfd)
if (0)
{
hr = IFileDialog_Advise(pfd, NULL, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IFileDialog_Advise(pfd, pfde, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
}
hr = IFileDialog_Advise(pfd, NULL, &cookie[0]);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(pfdeimpl->ref == 1, "got ref %d\n", pfdeimpl->ref);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
ok(pfdeimpl->ref == 1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Unadvise(pfd, 0);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
for(i = 0; i < 10; i++) {
hr = IFileDialog_Advise(pfd, pfde, &cookie[i]);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(cookie[i] == i+cookie[0], "Got cookie: %d\n", cookie[i]);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(cookie[i] == i+cookie[0], "Got cookie: %ld\n", cookie[i]);
}
ok(pfdeimpl->ref == 10+1, "got ref %d\n", pfdeimpl->ref);
ok(pfdeimpl->ref == 10+1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
for(i = 3; i < 7; i++) {
hr = IFileDialog_Unadvise(pfd, cookie[i]);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
ok(pfdeimpl->ref == 6+1, "got ref %d\n", pfdeimpl->ref);
ok(pfdeimpl->ref == 6+1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
for(i = 0; i < 3; i++) {
hr = IFileDialog_Unadvise(pfd, cookie[i]);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
ok(pfdeimpl->ref == 3+1, "got ref %d\n", pfdeimpl->ref);
ok(pfdeimpl->ref == 3+1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
for(i = 7; i < 10; i++) {
hr = IFileDialog_Unadvise(pfd, cookie[i]);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
}
ok(pfdeimpl->ref == 1, "got ref %d\n", pfdeimpl->ref);
ok(pfdeimpl->ref == 1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Unadvise(pfd, cookie[9]+1);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
ok(pfdeimpl->ref == 1, "got ref %d\n", pfdeimpl->ref);
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
ok(pfdeimpl->ref == 1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Advise(pfd, pfde, &cookie[0]);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(cookie[0] >= 1, "got cookie: %d\n", cookie[0]);
ok(pfdeimpl->ref == 1+1, "got ref %d\n", pfdeimpl->ref);
ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(cookie[0] >= 1, "got cookie: %ld\n", cookie[0]);
ok(pfdeimpl->ref == 1+1, "got ref %ld\n", pfdeimpl->ref);
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Unadvise(pfd, cookie[0]);
......@@ -1130,18 +1130,18 @@ static void test_advise(void)
trace("Testing FileOpenDialog (advise)\n");
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
test_advise_helper(pfd);
ref = IFileDialog_Release(pfd);
ok(!ref, "Got refcount %d, should have been released.\n", ref);
ok(!ref, "Got refcount %ld, should have been released.\n", ref);
trace("Testing FileSaveDialog (advise)\n");
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
test_advise_helper(pfd);
ref = IFileDialog_Release(pfd);
ok(!ref, "Got refcount %d, should have been released.\n", ref);
ok(!ref, "Got refcount %ld, should have been released.\n", ref);
}
static void filedialog_change_filetype(IFileDialog *pfd, HWND dlg_hwnd)
......@@ -1191,35 +1191,35 @@ static void test_events(void)
*/
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->events_test = IFDEVENT_TEST2;
hr = IFileDialog_Advise(pfd, pfde, &cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_Show(pfd, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "got 0x%08x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "got 0x%08lx.\n", hr);
ok(pfdeimpl->OnFolderChanging == 1, "Got %d\n", pfdeimpl->OnFolderChanging);
ok(pfdeimpl->OnFolderChanging == 1, "Got %ld\n", pfdeimpl->OnFolderChanging);
pfdeimpl->OnFolderChanging = 0;
ok(pfdeimpl->OnFolderChange == 1, "Got %d\n", pfdeimpl->OnFolderChange);
ok(pfdeimpl->OnFolderChange == 1, "Got %ld\n", pfdeimpl->OnFolderChange);
pfdeimpl->OnFolderChange = 0;
/* pfdeimpl->OnSelectionChange too unreliable to test. Can be 0, 1 or even 2. */
pfdeimpl->OnSelectionChange = 0;
ok(pfdeimpl->OnTypeChange == 0, "Got %d\n", pfdeimpl->OnTypeChange);
ok(pfdeimpl->OnTypeChange == 0, "Got %ld\n", pfdeimpl->OnTypeChange);
pfdeimpl->OnTypeChange = 0;
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Unadvise(pfd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialogEvents_Release(pfde);
ref = IFileDialog_Release(pfd);
ok(!ref || broken(ref /* win2008_64 (intermittently) */), "Got %d\n", ref);
ok(!ref || broken(ref /* win2008_64 (intermittently) */), "Got %ld\n", ref);
/*
......@@ -1227,41 +1227,41 @@ static void test_events(void)
*/
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->events_test = IFDEVENT_TEST2;
hr = IFileDialog_Advise(pfd, pfde, &cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetFileTypes(pfd, 2, filterspec);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Show(pfd, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "got 0x%08x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "got 0x%08lx.\n", hr);
ok(pfdeimpl->OnFolderChanging == 1, "Got %d\n", pfdeimpl->OnFolderChanging);
ok(pfdeimpl->OnFolderChanging == 1, "Got %ld\n", pfdeimpl->OnFolderChanging);
pfdeimpl->OnFolderChanging = 0;
ok(pfdeimpl->OnFolderChange == 1, "Got %d\n", pfdeimpl->OnFolderChange);
ok(pfdeimpl->OnFolderChange == 1, "Got %ld\n", pfdeimpl->OnFolderChange);
pfdeimpl->OnFolderChange = 0;
/* pfdeimpl->OnSelectionChange too unreliable to test. Can be 0, 1 or even 2. */
pfdeimpl->OnSelectionChange = 0;
/* Called once just by showing the dialog */
ok(pfdeimpl->OnTypeChange == 1, "Got %d\n", pfdeimpl->OnTypeChange);
ok(pfdeimpl->OnTypeChange == 1, "Got %ld\n", pfdeimpl->OnTypeChange);
pfdeimpl->OnTypeChange = 0;
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Unadvise(pfd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialogEvents_Release(pfde);
ref = IFileDialog_Release(pfd);
ok(!ref || broken(ref /* win2008_64 (intermittently) */), "Got %d\n", ref);
ok(!ref || broken(ref /* win2008_64 (intermittently) */), "Got %ld\n", ref);
/*
......@@ -1269,41 +1269,41 @@ static void test_events(void)
*/
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->events_test = IFDEVENT_TEST3;
hr = IFileDialog_Advise(pfd, pfde, &cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetFileTypes(pfd, 2, filterspec);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Show(pfd, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "got 0x%08x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "got 0x%08lx.\n", hr);
ok(pfdeimpl->OnFolderChanging == 1, "Got %d\n", pfdeimpl->OnFolderChanging);
ok(pfdeimpl->OnFolderChanging == 1, "Got %ld\n", pfdeimpl->OnFolderChanging);
pfdeimpl->OnFolderChanging = 0;
ok(pfdeimpl->OnFolderChange == 1, "Got %d\n", pfdeimpl->OnFolderChange);
ok(pfdeimpl->OnFolderChange == 1, "Got %ld\n", pfdeimpl->OnFolderChange);
pfdeimpl->OnFolderChange = 0;
/* pfdeimpl->OnSelectionChange too unreliable to test. Can be 0, 1 or even 2. */
pfdeimpl->OnSelectionChange = 0;
/* Called once by showing the dialog and once again when changing the filetype */
todo_wine ok(pfdeimpl->OnTypeChange == 2, "Got %d\n", pfdeimpl->OnTypeChange);
todo_wine ok(pfdeimpl->OnTypeChange == 2, "Got %ld\n", pfdeimpl->OnTypeChange);
pfdeimpl->OnTypeChange = 0;
ensure_zero_events(pfdeimpl);
hr = IFileDialog_Unadvise(pfd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialogEvents_Release(pfde);
ref = IFileDialog_Release(pfd);
ok(!ref || broken(ref /* win2008_64 (intermittently) */), "Got %d\n", ref);
ok(!ref || broken(ref /* win2008_64 (intermittently) */), "Got %ld\n", ref);
}
static void touch_file(LPCWSTR filename)
......@@ -1329,48 +1329,48 @@ static void test_filename_savedlg_(LPCWSTR set_filename, LPCWSTR defext,
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileSaveDialog, (void**)&pfsd);
ok_(file,line)(hr == S_OK, "Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "Got 0x%08lx\n", hr);
if(fs_count)
{
hr = IFileSaveDialog_SetFileTypes(pfsd, fs_count, filterspec);
ok_(file,line)(hr == S_OK, "SetFileTypes failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "SetFileTypes failed: Got 0x%08lx\n", hr);
}
if(defext)
{
hr = IFileSaveDialog_SetDefaultExtension(pfsd, defext);
ok_(file,line)(hr == S_OK, "SetDefaultExtensions failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "SetDefaultExtensions failed: Got 0x%08lx\n", hr);
}
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->set_filename = set_filename;
hr = IFileSaveDialog_Advise(pfsd, pfde, &cookie);
ok_(file,line)(hr == S_OK, "Advise failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "Advise failed: Got 0x%08lx\n", hr);
hr = IFileSaveDialog_Show(pfsd, NULL);
ok_(file,line)(hr == S_OK, "Show failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "Show failed: Got 0x%08lx\n", hr);
hr = IFileSaveDialog_GetFileName(pfsd, &filename);
ok_(file,line)(hr == S_OK, "GetFileName failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetFileName failed: Got 0x%08lx\n", hr);
ok_(file,line)(!lstrcmpW(filename, set_filename), "Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
hr = IFileSaveDialog_GetResult(pfsd, &psi);
ok_(file,line)(hr == S_OK, "GetResult failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetResult failed: Got 0x%08lx\n", hr);
hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &filename);
ok_(file,line)(hr == S_OK, "GetDisplayName failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetDisplayName failed: Got 0x%08lx\n", hr);
ok_(file,line)(!lstrcmpW(filename, exp_filename), "(GetDisplayName) Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
IShellItem_Release(psi);
hr = IFileSaveDialog_Unadvise(pfsd, cookie);
ok_(file,line)(hr == S_OK, "Unadvise failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "Unadvise failed: Got 0x%08lx\n", hr);
ref = IFileSaveDialog_Release(pfsd);
ok_(file,line)(!ref, "Got refcount %d, should have been released.\n", ref);
ok_(file,line)(!ref, "Got refcount %ld, should have been released.\n", ref);
IFileDialogEvents_Release(pfde);
}
......@@ -1393,51 +1393,51 @@ static void test_filename_opendlg_(LPCWSTR set_filename, IShellItem *psi_current
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileOpenDialog, (void**)&pfod);
ok_(file,line)(hr == S_OK, "CoCreateInstance failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "CoCreateInstance failed: Got 0x%08lx\n", hr);
if(defext)
{
hr = IFileOpenDialog_SetDefaultExtension(pfod, defext);
ok_(file,line)(hr == S_OK, "SetDefaultExtensions failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "SetDefaultExtensions failed: Got 0x%08lx\n", hr);
}
if(fs_count)
{
hr = IFileOpenDialog_SetFileTypes(pfod, 2, filterspec);
ok_(file,line)(hr == S_OK, "SetFileTypes failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "SetFileTypes failed: Got 0x%08lx\n", hr);
}
hr = IFileOpenDialog_SetFolder(pfod, psi_current);
ok_(file,line)(hr == S_OK, "SetFolder failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "SetFolder failed: Got 0x%08lx\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->set_filename = set_filename;
pfdeimpl->set_filename_tried = FALSE;
hr = IFileOpenDialog_Advise(pfod, pfde, &cookie);
ok_(file,line)(hr == S_OK, "Advise failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "Advise failed: Got 0x%08lx\n", hr);
hr = IFileOpenDialog_Show(pfod, NULL);
ok_(file,line)(hr == S_OK || (!exp_filename && hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)),
"Show failed: Got 0x%08x\n", hr);
"Show failed: Got 0x%08lx\n", hr);
if(hr == S_OK)
{
hr = IFileOpenDialog_GetResult(pfod, &psi);
ok_(file,line)(hr == S_OK, "GetResult failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetResult failed: Got 0x%08lx\n", hr);
hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &filename);
ok_(file,line)(hr == S_OK, "GetDisplayName(Result) failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetDisplayName(Result) failed: Got 0x%08lx\n", hr);
ok_(file,line)(!lstrcmpW(filename, exp_filename), "(GetResult) Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
IShellItem_Release(psi);
hr = IFileOpenDialog_GetResults(pfod, &psia);
ok_(file,line)(hr == S_OK, "GetResults failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetResults failed: Got 0x%08lx\n", hr);
hr = IShellItemArray_GetItemAt(psia, 0, &psi);
ok_(file,line)(hr == S_OK, "GetItemAt failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetItemAt failed: Got 0x%08lx\n", hr);
hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &filename);
ok_(file,line)(hr == S_OK, "GetDisplayName(Results) failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetDisplayName(Results) failed: Got 0x%08lx\n", hr);
ok_(file,line)(!lstrcmpW(filename, exp_filename), "(GetResults) Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
......@@ -1447,23 +1447,23 @@ static void test_filename_opendlg_(LPCWSTR set_filename, IShellItem *psi_current
else
{
hr = IFileOpenDialog_GetResult(pfod, &psi);
ok_(file,line)(hr == E_UNEXPECTED, "GetResult: Got 0x%08x\n", hr);
ok_(file,line)(hr == E_UNEXPECTED, "GetResult: Got 0x%08lx\n", hr);
hr = IFileOpenDialog_GetResults(pfod, &psia);
ok_(file,line)(hr == E_FAIL, "GetResults: Got 0x%08x\n", hr);
ok_(file,line)(hr == E_FAIL, "GetResults: Got 0x%08lx\n", hr);
}
hr = IFileOpenDialog_GetFileName(pfod, &filename);
ok_(file,line)(hr == S_OK, "GetFileName failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "GetFileName failed: Got 0x%08lx\n", hr);
ok_(file,line)(!lstrcmpW(filename, set_filename), "(GetFileName) Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
hr = IFileOpenDialog_Unadvise(pfod, cookie);
ok_(file,line)(hr == S_OK, "Unadvise failed: Got 0x%08x\n", hr);
ok_(file,line)(hr == S_OK, "Unadvise failed: Got 0x%08lx\n", hr);
ref = IFileOpenDialog_Release(pfod);
ok_(file,line)(!ref, "Got refcount %d, should have been released.\n", ref);
ok_(file,line)(!ref, "Got refcount %ld, should have been released.\n", ref);
IFileDialogEvents_Release(pfde);
}
......@@ -1520,7 +1520,7 @@ static void test_filename(void)
GetCurrentDirectoryW(MAX_PATH, buf);
ok(!!pSHCreateItemFromParsingName, "SHCreateItemFromParsingName is missing.\n");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psi_current);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
touch_file(filename_noextW);
touch_file(filename_defextW);
......@@ -1643,10 +1643,10 @@ static void test_customize(void)
HRESULT hr;
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfod);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(FAILED(hr))
{
skip("Skipping IFileDialogCustomize tests.\n");
......@@ -1656,195 +1656,195 @@ static void test_customize(void)
i = 0;
hr = IFileDialogCustomize_AddPushButton(pfdc, i, pushbutton1W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddPushButton(pfdc, i, pushbutton1W);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialog_QueryInterface(pfod, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IOleWindow_GetWindow(pow, &dlg_hwnd);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(dlg_hwnd == NULL, "NULL\n");
IOleWindow_Release(pow);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, label2);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, i);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, i);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, i+1);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
ok(cdstate == 0xdeadbeef, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(!cdstate, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, CDCS_ENABLEDVISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, label2);
ok(hr == E_NOTIMPL, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == E_NOTIMPL, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_AddMenu(pfdc, i, menuW);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddMenu(pfdc, ++i, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, label2);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_AddPushButton(pfdc, i, pushbutton2W);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddPushButton(pfdc, ++i, pushbutton2W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, label2);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_AddComboBox(pfdc, i);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddComboBox(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, label2);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_AddRadioButtonList(pfdc, i);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, radiobutton1W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, radiobutton1W);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, radiobutton2W);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_AddCheckButton(pfdc, i, label, TRUE);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddCheckButton(pfdc, ++i, checkbutton1W, TRUE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, checkbutton2W);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
if(SUCCEEDED(hr))
{
BOOL checked;
hr = IFileDialogCustomize_GetCheckButtonState(pfdc, i, &checked);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(checked, "checkbox not checked.\n");
hr = IFileDialogCustomize_SetCheckButtonState(pfdc, i, FALSE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_GetCheckButtonState(pfdc, i, &checked);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(!checked, "checkbox checked.\n");
hr = IFileDialogCustomize_SetCheckButtonState(pfdc, i, TRUE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_GetCheckButtonState(pfdc, i, &checked);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(checked, "checkbox not checked.\n");
}
hr = IFileDialogCustomize_AddEditBox(pfdc, i, label);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddEditBox(pfdc, ++i, editbox1W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
/* Does not affect the text in the editbox */
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, editbox2W);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_GetEditBoxText(pfdc, i, &tmpstr);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
ok(!lstrcmpW(tmpstr, editbox1W), "got %s.\n", wine_dbgstr_w(tmpstr));
......@@ -1852,10 +1852,10 @@ static void test_customize(void)
}
hr = IFileDialogCustomize_SetEditBoxText(pfdc, i, label2);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_GetEditBoxText(pfdc, i, &tmpstr);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
ok(!lstrcmpW(tmpstr, label2), "got %s.\n", wine_dbgstr_w(tmpstr));
......@@ -1863,96 +1863,96 @@ static void test_customize(void)
}
hr = IFileDialogCustomize_AddSeparator(pfdc, i);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddSeparator(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, separatorW);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_AddText(pfdc, i, label);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddText(pfdc, ++i, textW);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, text2W);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
hr = IFileDialogCustomize_StartVisualGroup(pfdc, i, label);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_StartVisualGroup(pfdc, ++i, visualgroup1W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
ok(hr == E_NOINTERFACE, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, visualgroup2W);
ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == S_OK, "got 0x%08lx (control: %d).\n", hr, i);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_StartVisualGroup(pfdc, ++i, label);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
ok(hr == E_UNEXPECTED, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_EndVisualGroup(pfdc);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
i++; /* Nonexisting control */
hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, label);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_SetControlLabel(pfdc, i, label2);
ok(hr == E_INVALIDARG, "got 0x%08x (control: %d).\n", hr, i);
ok(hr == E_INVALIDARG, "got 0x%08lx (control: %d).\n", hr, i);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
todo_wine ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
ok(cdstate == 0xdeadbeef, "got 0x%08x.\n", cdstate);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->events_test = IFDEVENT_TEST1;
hr = IFileDialog_Advise(pfod, pfde, &cookie);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = IFileDialog_Show(pfod, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "Got 0x%08x\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "Got 0x%08lx\n", hr);
hr = IFileDialog_Unadvise(pfod, cookie);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IFileDialogEvents_Release(pfde);
IFileDialogCustomize_Release(pfdc);
ref = IFileDialog_Release(pfod);
ok(!ref, "Refcount not zero (%d).\n", ref);
ok(!ref, "Refcount not zero (%ld).\n", ref);
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfod);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
i = 0;
hr = IFileDialogCustomize_AddMenu(pfdc, ++i, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
DWORD selected;
......@@ -1961,42 +1961,42 @@ static void test_customize(void)
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_AddControlItem(pfdc, i, j, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected);
ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == 0, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, CDCS_ENABLEDVISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_RemoveAllControlItems(pfdc, i);
ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_RemoveControlItem(pfdc, i, j);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
}
hr = IFileDialogCustomize_AddPushButton(pfdc, ++i, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_AddComboBox(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
DWORD selected = -1;
......@@ -2005,54 +2005,54 @@ static void test_customize(void)
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_AddControlItem(pfdc, i, j, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(selected == -1, "got %d.\n", selected);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
ok(selected == -1, "got %ld.\n", selected);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == 0, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, CDCS_ENABLEDVISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_SetSelectedControlItem(pfdc, i, j);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(selected == j, "got %d.\n", selected);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(selected == j, "got %ld.\n", selected);
}
j++;
hr = IFileDialogCustomize_SetSelectedControlItem(pfdc, i, j);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_RemoveAllControlItems(pfdc, i);
ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_RemoveControlItem(pfdc, i, j);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
}
hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
DWORD selected = -1;
......@@ -2061,53 +2061,53 @@ static void test_customize(void)
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_AddControlItem(pfdc, i, j, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected);
ok(hr == E_FAIL, "got 0x%08x.\n", hr);
ok(selected == -1, "got %d.\n", selected);
ok(hr == E_FAIL, "got 0x%08lx.\n", hr);
ok(selected == -1, "got %ld.\n", selected);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == 0, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, CDCS_ENABLEDVISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_SetSelectedControlItem(pfdc, i, j);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(selected == j, "got %d.\n", selected);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(selected == j, "got %ld.\n", selected);
}
j++;
hr = IFileDialogCustomize_SetSelectedControlItem(pfdc, i, j);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
ok(hr == E_INVALIDARG, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_RemoveAllControlItems(pfdc, i);
ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_RemoveControlItem(pfdc, i, j);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
}
hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, ++i);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if(SUCCEEDED(hr))
{
DWORD selected = -1;
......@@ -2116,166 +2116,166 @@ static void test_customize(void)
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_AddControlItem(pfdc, i, j, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(selected == 0, "got %d.\n", selected);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(selected == 0, "got %ld.\n", selected);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == 0, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetControlItemState(pfdc, i, 0, CDCS_ENABLEDVISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_SetSelectedControlItem(pfdc, i, 0);
todo_wine ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
todo_wine ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
hr = IFileDialogCustomize_RemoveAllControlItems(pfdc, i);
ok(hr == E_NOTIMPL, "got 0x%08x.\n", hr);
ok(hr == E_NOTIMPL, "got 0x%08lx.\n", hr);
for(j = 0; j < 10; j++)
{
hr = IFileDialogCustomize_RemoveControlItem(pfdc, i, j);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
}
}
IFileDialogCustomize_Release(pfdc);
ref = IFileDialog_Release(pfod);
ok(!ref, "Refcount not zero (%d).\n", ref);
ok(!ref, "Refcount not zero (%ld).\n", ref);
/* Some more tests for VisualGroup behavior */
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&pfod);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
i = -1;
id_vgroup1 = ++i;
hr = IFileDialogCustomize_StartVisualGroup(pfdc, id_vgroup1, visualgroup1W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
id_text = ++i;
hr = IFileDialogCustomize_AddText(pfdc, id_text, label);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
id_editbox1 = ++i;
hr = IFileDialogCustomize_AddEditBox(pfdc, id_editbox1, editbox1W);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
/* Set all Visible but not Enabled */
hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1, CDCS_VISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_VISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
/* Set text to Visible but not Enabled */
hr = IFileDialogCustomize_SetControlState(pfdc, id_text, CDCS_VISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_VISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_VISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
/* Set vgroup to inactive */
hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1, CDCS_INACTIVE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_INACTIVE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_VISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
/* Set vgroup to Enabled and Visible again */
hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1, CDCS_ENABLEDVISIBLE);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_VISIBLE, "got 0x%08x.\n", cdstate);
cdstate = 0xdeadbeef;
hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate);
hr = IFileDialogCustomize_MakeProminent(pfdc, id_vgroup1);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialogCustomize_Release(pfdc);
ref = IFileDialog_Release(pfod);
ok(!ref, "Refcount not zero (%d).\n", ref);
ok(!ref, "Refcount not zero (%ld).\n", ref);
}
static void test_persistent_state(void)
......@@ -2285,7 +2285,7 @@ static void test_persistent_state(void)
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&fd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
if (0)
{
......@@ -2294,10 +2294,10 @@ if (0)
}
hr = IFileDialog_SetClientGuid(fd, &IID_IUnknown);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IFileDialog_SetClientGuid(fd, &IID_NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "got 0x%08lx\n", hr);
IFileDialog_Release(fd);
}
......@@ -2317,40 +2317,40 @@ static void test_overwrite(void)
GetCurrentDirectoryW(MAX_PATH, buf);
ok(!!pSHCreateItemFromParsingName, "SHCreateItemFromParsingName is missing.\n");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psi_current);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
touch_file(filename_winetest);
/* FOS_OVERWRITEPROMPT has no effect on open dialog */
hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&fd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetOptions(fd, FOS_OVERWRITEPROMPT | FOS_NOCHANGEDIR);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetFolder(fd, psi_current);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->set_filename = filename_winetest;
hr = IFileDialog_Advise(fd, pfde, &cookie);
ok(hr == S_OK, "Advise failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Advise failed: Got 0x%08lx\n", hr);
hr = IFileDialog_Show(fd, NULL);
ok(hr == S_OK, "Show failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Show failed: Got 0x%08lx\n", hr);
ok(!pfdeimpl->OnOverwrite, "got %u overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %u ok events\n", pfdeimpl->OnFileOk);
ok(!pfdeimpl->OnOverwrite, "got %lu overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %lu ok events\n", pfdeimpl->OnFileOk);
hr = IFileDialog_GetFileName(fd, &filename);
ok(hr == S_OK, "GetFileName failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "GetFileName failed: Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, filename_winetest), "Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
hr = IFileDialog_Unadvise(fd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialog_Release(fd);
......@@ -2359,33 +2359,33 @@ static void test_overwrite(void)
/* Save dialog doesn't check for overwrite without FOS_OVERWRITEPROMPT set */
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&fd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetOptions(fd, FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetFolder(fd, psi_current);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->set_filename = filename_winetest;
hr = IFileDialog_Advise(fd, pfde, &cookie);
ok(hr == S_OK, "Advise failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Advise failed: Got 0x%08lx\n", hr);
hr = IFileDialog_Show(fd, NULL);
ok(hr == S_OK, "Show failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Show failed: Got 0x%08lx\n", hr);
ok(!pfdeimpl->OnOverwrite, "got %u overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %u ok events\n", pfdeimpl->OnFileOk);
ok(!pfdeimpl->OnOverwrite, "got %lu overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %lu ok events\n", pfdeimpl->OnFileOk);
hr = IFileDialog_GetFileName(fd, &filename);
ok(hr == S_OK, "GetFileName failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "GetFileName failed: Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, filename_winetest), "Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
hr = IFileDialog_Unadvise(fd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialog_Release(fd);
......@@ -2394,30 +2394,30 @@ static void test_overwrite(void)
/* Save dialog with FOS_OVERWRITEPROMPT set */
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&fd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetFolder(fd, psi_current);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->set_filename = filename_winetest;
hr = IFileDialog_Advise(fd, pfde, &cookie);
ok(hr == S_OK, "Advise failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Advise failed: Got 0x%08lx\n", hr);
hr = IFileDialog_Show(fd, NULL);
ok(hr == S_OK, "Show failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Show failed: Got 0x%08lx\n", hr);
ok(pfdeimpl->OnOverwrite == 1, "got %u overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %u ok events\n", pfdeimpl->OnFileOk);
ok(pfdeimpl->OnOverwrite == 1, "got %lu overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %lu ok events\n", pfdeimpl->OnFileOk);
hr = IFileDialog_GetFileName(fd, &filename);
ok(hr == S_OK, "GetFileName failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "GetFileName failed: Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, filename_winetest), "Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
hr = IFileDialog_Unadvise(fd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialog_Release(fd);
......@@ -2428,30 +2428,30 @@ static void test_overwrite(void)
/* Save dialog with FOS_OVERWRITEPROMPT set but without existing file */
hr = CoCreateInstance(&CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER,
&IID_IFileDialog, (void**)&fd);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
hr = IFileDialog_SetFolder(fd, psi_current);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
pfde = IFileDialogEvents_Constructor();
pfdeimpl = impl_from_IFileDialogEvents(pfde);
pfdeimpl->set_filename = filename_winetest;
hr = IFileDialog_Advise(fd, pfde, &cookie);
ok(hr == S_OK, "Advise failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Advise failed: Got 0x%08lx\n", hr);
hr = IFileDialog_Show(fd, NULL);
ok(hr == S_OK, "Show failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "Show failed: Got 0x%08lx\n", hr);
ok(!pfdeimpl->OnOverwrite, "got %u overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %u ok events\n", pfdeimpl->OnFileOk);
ok(!pfdeimpl->OnOverwrite, "got %lu overwrite events\n", pfdeimpl->OnOverwrite);
ok(pfdeimpl->OnFileOk == 1, "got %lu ok events\n", pfdeimpl->OnFileOk);
hr = IFileDialog_GetFileName(fd, &filename);
ok(hr == S_OK, "GetFileName failed: Got 0x%08x\n", hr);
ok(hr == S_OK, "GetFileName failed: Got 0x%08lx\n", hr);
ok(!lstrcmpW(filename, filename_winetest), "Got %s\n", wine_dbgstr_w(filename));
CoTaskMemFree(filename);
hr = IFileDialog_Unadvise(fd, cookie);
ok(hr == S_OK, "got 0x%08x.\n", hr);
ok(hr == S_OK, "got 0x%08lx.\n", hr);
IFileDialog_Release(fd);
......
......@@ -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());
}
/* ########################### */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment