Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/shell32/tests/shellpath.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 736cd3b8caa3..a5784237b162 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -1842,8 +1842,9 @@ static void test_NonExistentPath(void)
static void test_SHGetFolderPathEx(void) { + WCHAR buffer[MAX_PATH], *path, *path2; + unsigned int i; HRESULT hr; - WCHAR buffer[MAX_PATH], *path; DWORD len;
if (!pSHGetKnownFolderPath || !pSHGetFolderPathEx) @@ -1868,6 +1869,44 @@ if (0) { /* crashes */ ok(path != NULL, "expected path != NULL\n"); CoTaskMemFree(path);
+ for (i = 0; i < ARRAY_SIZE(known_folders); ++i) + { + const KNOWNFOLDERID *folder_id = known_folders[i].folderId; + + if (!folder_id) + continue; + + path = NULL; + hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DEFAULT, NULL, &path); + if (FAILED(hr)) + continue; + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(path != NULL, "expected path != NULL\n"); + + path2 = NULL; + hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_SIMPLE_IDLIST, NULL, &path2); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(path != NULL, "expected path != NULL\n"); + ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2)); + CoTaskMemFree(path2); + + path2 = NULL; + hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_DONT_UNEXPAND, NULL, &path2); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(path2 != NULL, "expected path != NULL\n"); + ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2)); + CoTaskMemFree(path2); + + path2 = NULL; + hr = pSHGetKnownFolderPath(folder_id, KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_UNEXPAND, NULL, &path2); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(path2 != NULL, "expected path != NULL\n"); + ok(!lstrcmpiW(path, path2), "expected equal paths: %s, %s\n", wine_dbgstr_w(path), wine_dbgstr_w(path2)); + CoTaskMemFree(path2); + + CoTaskMemFree(path); + } + path = NULL; hr = pSHGetKnownFolderPath(&FOLDERID_Desktop, 0, NULL, &path); ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
While probably not very relevant, when doing something like
---------- SHSetKnownFolderPath(&FOLDERID_SavedGames, KF_FLAG_DONT_UNEXPAND, NULL, new_path); SHGetKnownFolderPath(&FOLDERID_SavedGames, KF_FLAG_DONT_UNEXPAND, 0, &path2); ----------
then KF_FLAG_DONT_UNEXPAND still doesn't seem to do anything.I figured that's where the flag was useful, but it is completely ignored. Do we want a testcase for that too?
Regards, Fabian Maurer