[PATCH v2 0/1] MR9825: winefile: Successfully get path for shell files.
Non-folder entries in the shell namespace have no ->folder, so their this would fail to get the path. Instead always look up the attributes using the parent. -- v2: winefile: Successfully get path for shell files. https://gitlab.winehq.org/wine/wine/-/merge_requests/9825
From: Theodore Dubois <tblodt@icloud.com> Non-folder entries in the shell namespace have no ->folder, so their this would fail to get the path. Instead always look up the attributes using the parent. --- programs/winefile/winefile.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index e37f3371bab..8c2b3c36b2e 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -1127,19 +1127,15 @@ static void get_path(Entry* dir, PWSTR path) if (dir->etype == ET_SHELL) { - SFGAOF attribs; + SFGAOF attribs = 0; HRESULT hr = S_OK; + IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop; path[0] = '\0'; - attribs = 0; - - if (dir->folder) - hr = IShellFolder_GetAttributesOf(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs); + hr = IShellFolder_GetAttributesOf(parent, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs); if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) { - IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop; - hr = path_from_pidlW(parent, dir->pidl, path, MAX_PATH); } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9825
participants (2)
-
tbodt (@tbodt) -
Theodore Dubois