From: Arimil <renari@arimil.com> --- dlls/shell32/shfldr_fs.c | 1 - dlls/shell32/tests/shlfolder.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index fabd27e984f..0d74f4578c5 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -1409,7 +1409,6 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl) if (IsEqualCLSID( This->pclsid, &CLSID_MyDocuments )) { if (!SHGetSpecialFolderPathW( 0, wszTemp, CSIDL_PERSONAL, FALSE )) return E_FAIL; - PathAddBackslashW( wszTemp ); } else lstrcpyW( wszTemp, L"\\\\?\\unix\\" ); } diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 5f8b4dc3470..08c8c73dd47 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -1501,6 +1501,34 @@ static void test_SHGetPathFromIDList(void) ok(result, "SHGetPathFromIDListW failed\n"); } +static void test_SHGetPathFromIDList_personal(void) +{ + WCHAR personal[MAX_PATH], path[MAX_PATH]; + LPITEMIDLIST pidl; + HRESULT hr; + BOOL ret; + int len; + + ret = SHGetSpecialFolderPathW(NULL, personal, CSIDL_PERSONAL, FALSE); + ok(ret, "SHGetSpecialFolderPathW(CSIDL_PERSONAL) failed, error %lu.\n", GetLastError()); + if (!ret) return; + + hr = SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &pidl); + ok(hr == S_OK, "SHGetSpecialFolderLocation(CSIDL_PERSONAL) failed, hr %#lx.\n", hr); + if (hr != S_OK) return; + + ret = SHGetPathFromIDListW(pidl, path); + ILFree(pidl); + ok(ret, "SHGetPathFromIDListW(CSIDL_PERSONAL) failed, error %lu.\n", GetLastError()); + if (!ret) return; + ok(!lstrcmpiW(path, personal), "got %s, expected %s.\n", wine_dbgstr_w(path), + wine_dbgstr_w(personal)); + + len = lstrlenW(path); + ok(len && path[len - 1] != '\\', "CSIDL_PERSONAL path has trailing backslash: %s.\n", + wine_dbgstr_w(path)); +} + static void test_EnumObjects_and_CompareIDs(void) { ITEMIDLIST *newPIDL; @@ -6291,6 +6319,7 @@ START_TEST(shlfolder) test_GetDisplayName(); test_GetAttributesOf(); test_SHGetPathFromIDList(); + test_SHGetPathFromIDList_personal(); test_CallForAttributes(); test_FolderShortcut(); test_ITEMIDLIST_format(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10946