Module: wine Branch: master Commit: 33598db74314b461adfe07a9ff28ad46470b1984 URL: https://gitlab.winehq.org/wine/wine/-/commit/33598db74314b461adfe07a9ff28ad4...
Author: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Mon Apr 24 20:43:14 2023 -0400
shell32: Fix last parameter behavior in SHBindToFolderIDListParent().
---
dlls/shell32/pidl.c | 7 ++++--- dlls/shell32/tests/shlfolder.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index a95e4c5f295..c9ff5acbfc5 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -1304,12 +1304,13 @@ HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl, TRACE_(shell)("%p,%p,%s\n", psf, pidl, debugstr_guid(riid)); pdump(pidl);
+ if (ppidlLast) + *ppidlLast = NULL; + if (!pidl || !ppv) return E_INVALIDARG; - + *ppv = NULL; - if (ppidlLast) - *ppidlLast = NULL;
if (!psf) { diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 5a5eb9fead8..be22e577c8b 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -779,7 +779,7 @@ static void test_GetDisplayName(void) hr = SHBindToParent(NULL, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast); ok (hr == E_INVALIDARG || broken(hr == E_OUTOFMEMORY) /* XP */, "SHBindToParent(NULL) should fail! hr = %08lx\n", hr); - todo_wine ok(pidlLast == NULL, "got %p\n", pidlLast); + ok(pidlLast == NULL, "got %p\n", pidlLast);
/* But it succeeds with an empty PIDL. */ hr = SHBindToParent(pidlEmpty, &IID_IShellFolder, (void **)&psfPersonal, &pidlLast); @@ -5601,7 +5601,7 @@ static void test_SHBindToFolderIDListParent(void) pidl_last = (LPITEMIDLIST)0xdeadbeef; hr = pSHBindToFolderIDListParent(NULL, NULL, &IID_IShellFolder, (void **)&psf, &pidl_last); ok(hr == E_INVALIDARG, "got %#lx\n", hr); - todo_wine ok(pidl_last == NULL, "got %p\n", pidl_last); + ok(pidl_last == NULL, "got %p\n", pidl_last); }
START_TEST(shlfolder)