shell32/shellview: Handle NULL folder pointer in SHCreateShellFolderViewEx().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7a49da5070
commit
a528ddd745
@ -3806,6 +3806,9 @@ HRESULT WINAPI SHCreateShellFolderViewEx(CSFV *desc, IShellView **shellview)
|
|||||||
TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n", desc->pshf, desc->pidl, desc->pfnCallback,
|
TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n", desc->pshf, desc->pidl, desc->pfnCallback,
|
||||||
desc->fvm, desc->psvOuter);
|
desc->fvm, desc->psvOuter);
|
||||||
|
|
||||||
|
if (!desc->pshf)
|
||||||
|
return E_UNEXPECTED;
|
||||||
|
|
||||||
*shellview = IShellView_Constructor(desc->pshf);
|
*shellview = IShellView_Constructor(desc->pshf);
|
||||||
if (!*shellview)
|
if (!*shellview)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
@ -1433,6 +1433,16 @@ static void test_SHCreateShellFolderViewEx(void)
|
|||||||
ok(refCount == 0, "refCount = %u\n", refCount);
|
ok(refCount == 0, "refCount = %u\n", refCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
/* Crashes on null shellfolder, on XP/2k3 */
|
||||||
|
memset(&csfv, 0, sizeof(csfv));
|
||||||
|
csfv.pshf = NULL;
|
||||||
|
psv = (void *)0xdeadbeef;
|
||||||
|
hr = SHCreateShellFolderViewEx(&csfv, &psv);
|
||||||
|
ok(hr == E_UNEXPECTED, "Got 0x%08x\n", hr);
|
||||||
|
ok(psv == NULL, "psv = %p\n", psv);
|
||||||
|
}
|
||||||
memset(&csfv, 0, sizeof(csfv));
|
memset(&csfv, 0, sizeof(csfv));
|
||||||
csfv.cbSize = sizeof(csfv);
|
csfv.cbSize = sizeof(csfv);
|
||||||
csfv.pshf = desktop;
|
csfv.pshf = desktop;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user