diff --git a/rostests/winetests/shell32/appbar.c b/rostests/winetests/shell32/appbar.c index dbac4e64f4e..7ec3c344a65 100644 --- a/rostests/winetests/shell32/appbar.c +++ b/rostests/winetests/shell32/appbar.c @@ -424,7 +424,9 @@ static void test_GetCurrentProcessExplicitAppUserModelID(void) } if (0) /* crashes on native */ +{ hr = pGetCurrentProcessExplicitAppUserModelID(NULL); +} appid = (void*)0xdeadbeef; hr = pGetCurrentProcessExplicitAppUserModelID(&appid); diff --git a/rostests/winetests/shell32/shelldispatch.c b/rostests/winetests/shell32/shelldispatch.c index 362cc13d23f..3711fdec5d2 100644 --- a/rostests/winetests/shell32/shelldispatch.c +++ b/rostests/winetests/shell32/shelldispatch.c @@ -30,6 +30,8 @@ #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) +static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0}; + static HRESULT (WINAPI *pSHGetFolderPathW)(HWND, int, HANDLE, DWORD, LPWSTR); static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*); static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *); @@ -50,7 +52,6 @@ static void init_function_pointers(void) static void test_namespace(void) { - static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0}; static const WCHAR backslashW[] = {'\\',0}; static const WCHAR clsidW[] = { ':',':','{','6','4','5','F','F','0','4','0','-','5','0','8','1','-', @@ -306,6 +307,136 @@ static void test_namespace(void) IShellDispatch_Release(sd); } +static void test_items(void) +{ + WCHAR wstr[MAX_PATH], orig_dir[MAX_PATH]; + HRESULT r; + IShellDispatch *sd = NULL; + Folder *folder = NULL; + FolderItems *items = NULL; + FolderItems2 *items2 = NULL; + FolderItems3 *items3 = NULL; + FolderItem *item = (FolderItem*)0xdeadbeef; + IDispatch *disp = NULL; + IUnknown *unk = NULL; + FolderItemVerbs *verbs = (FolderItemVerbs*)0xdeadbeef; + VARIANT var; + LONG lcount = -1; + + r = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER, &IID_IShellDispatch, (void**)&sd); + ok(SUCCEEDED(r), "CoCreateInstance failed: %08x\n", r); + ok(!!sd, "sd is null\n"); + + GetTempPathW(MAX_PATH, wstr); + GetCurrentDirectoryW(MAX_PATH, orig_dir); + SetCurrentDirectoryW(wstr); + CreateDirectoryW(winetestW, NULL); + GetFullPathNameW(winetestW, MAX_PATH, wstr, NULL); + V_VT(&var) = VT_BSTR; + V_BSTR(&var) = SysAllocString(wstr); + r = IShellDispatch_NameSpace(sd, var, &folder); + ok(r == S_OK, "IShellDispatch::NameSpace failed: %08x\n", r); + ok(!!folder, "folder is null\n"); + SysFreeString(V_BSTR(&var)); + IShellDispatch_Release(sd); + SetCurrentDirectoryW(winetestW); + + r = Folder_Items(folder, &items); + ok(r == S_OK, "Folder::Items failed: %08x\n", r); + ok(!!items, "items is null\n"); + r = FolderItems_QueryInterface(items, &IID_FolderItems2, (void**)&items2); + ok(r == S_OK || broken(E_NOINTERFACE) /* xp and later */, "FolderItems::QueryInterface failed: %08x\n", r); + ok(!!items2 || broken(!items2) /* xp and later */, "items2 is null\n"); + r = FolderItems_QueryInterface(items, &IID_FolderItems3, (void**)&items3); + ok(r == S_OK, "FolderItems::QueryInterface failed: %08x\n", r); + ok(!!items3, "items3 is null\n"); + Folder_Release(folder); + + if (0) /* crashes on all versions of Windows */ + r = FolderItems_get_Count(items, NULL); + + r = FolderItems_get_Count(items, &lcount); +todo_wine + ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); +todo_wine + ok(!lcount, "expected 0 files, got %d\n", lcount); + + V_VT(&var) = VT_I4; + V_I4(&var) = 0; + + if (0) /* crashes on all versions of Windows */ + r = FolderItems_Item(items, var, NULL); + + r = FolderItems_Item(items, var, &item); +todo_wine + ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r); + ok(!item, "item is not null\n"); + + if (0) /* crashes on xp */ + { + r = FolderItems_get_Application(items, NULL); + ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r); + } + + r = FolderItems_get_Application(items, &disp); +todo_wine + ok(r == S_OK, "FolderItems::get_Application failed: %08x\n", r); +todo_wine + ok(!!disp, "disp is null\n"); + if (disp) IDispatch_Release(disp); + + if (0) /* crashes on xp */ + { + r = FolderItems_get_Parent(items, NULL); + ok(r == E_NOTIMPL, "expected E_NOTIMPL, got %08x\n", r); + } + + disp = (IDispatch*)0xdeadbeef; + r = FolderItems_get_Parent(items, &disp); + ok(r == E_NOTIMPL, "expected E_NOTIMPL, got %08x\n", r); + ok(!disp, "disp is not null\n"); + + if (0) /* crashes on xp */ + { + r = FolderItems__NewEnum(items, NULL); + ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r); + } + + r = FolderItems__NewEnum(items, &unk); +todo_wine + ok(r == S_OK, "FolderItems::_NewEnum failed: %08x\n", r); +todo_wine + ok(!!unk, "unk is null\n"); + if (unk) IUnknown_Release(unk); + + if (items3) + { + r = FolderItems3_Filter(items3, 0, NULL); +todo_wine + ok(r == S_OK, "expected S_OK, got %08x\n", r); + + if (0) /* crashes on xp */ + { + r = FolderItems3_get_Verbs(items3, NULL); + ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r); + } + + r = FolderItems3_get_Verbs(items3, &verbs); +todo_wine + ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r); + ok(!verbs, "verbs is not null\n"); + } + + GetTempPathW(MAX_PATH, wstr); + SetCurrentDirectoryW(wstr); + RemoveDirectoryW(winetestW); + SetCurrentDirectoryW(orig_dir); + + FolderItems_Release(items); + if (items2) FolderItems2_Release(items2); + if (items3) FolderItems3_Release(items3); +} + static void test_service(void) { static const WCHAR spooler[] = {'S','p','o','o','l','e','r',0}; @@ -597,7 +728,9 @@ todo_wine todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); if (hr == S_OK) +{ test_dispatch_typeinfo(doc, viewdual_riids); +} IWebBrowser2_Release(wb); @@ -879,6 +1012,7 @@ START_TEST(shelldispatch) init_function_pointers(); test_namespace(); + test_items(); test_service(); test_ShellFolderViewDual(); test_ShellWindows(); diff --git a/rostests/winetests/shell32/shelllink.c b/rostests/winetests/shell32/shelllink.c index f7c091e4873..8af3c978b2a 100755 --- a/rostests/winetests/shell32/shelllink.c +++ b/rostests/winetests/shell32/shelllink.c @@ -248,7 +248,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); ok(r==S_OK, "GetPath failed (0x%08x)\n", r); - ok(!strcmp(buffer, "C:\\nonexistent\\file") || + todo_wine ok(!strcmp(buffer, "C:\\nonexistent\\file") || broken(!strcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */ "case doesn't match\n"); diff --git a/rostests/winetests/shell32/shellole.c b/rostests/winetests/shell32/shellole.c index cdc65098435..eb0d45bbeff 100644 --- a/rostests/winetests/shell32/shellole.c +++ b/rostests/winetests/shell32/shellole.c @@ -871,7 +871,9 @@ static void test_SHCreateSessionKey(void) } if (0) /* crashes on native */ +{ hr = pSHCreateSessionKey(KEY_READ, NULL); +} hkey = (HKEY)0xdeadbeef; hr = pSHCreateSessionKey(0, &hkey);