shell32: Fix last parameter behavior in SHBindToFolderIDListParent().

This commit is contained in:
Mohamad Al-Jaf 2023-04-24 20:43:14 -04:00 committed by Alexandre Julliard
parent 27434f360e
commit 33598db743
2 changed files with 7 additions and 6 deletions

View file

@ -1304,13 +1304,14 @@ HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl,
TRACE_(shell)("%p,%p,%s\n", psf, pidl, debugstr_guid(riid));
pdump(pidl);
if (!pidl || !ppv)
return E_INVALIDARG;
*ppv = NULL;
if (ppidlLast)
*ppidlLast = NULL;
if (!pidl || !ppv)
return E_INVALIDARG;
*ppv = NULL;
if (!psf)
{
hr = SHGetDesktopFolder(&psfDesktop);

View file

@ -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)