shell32: Always initialize shellitem to NULL in SHCreateShellItem.
This commit is contained in:
parent
9ff6853478
commit
815b532b64
|
@ -555,6 +555,8 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
|||
|
||||
TRACE("(%p,%p,%p,%p)\n", pidlParent, psfParent, pidl, ppsi);
|
||||
|
||||
*ppsi = NULL;
|
||||
|
||||
if (!pidl)
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
|
@ -604,7 +606,6 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
|||
}
|
||||
else
|
||||
{
|
||||
*ppsi = NULL;
|
||||
ILFree(new_pidl);
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -2236,8 +2236,10 @@ static void test_SHCreateShellItem(void)
|
|||
|
||||
pidl_abstestfile = pILCombine(pidl_cwd, pidl_testfile);
|
||||
|
||||
shellitem = (void*)0xdeadbeef;
|
||||
ret = pSHCreateShellItem(NULL, NULL, NULL, &shellitem);
|
||||
ok(ret == E_INVALIDARG, "SHCreateShellItem returned %x\n", ret);
|
||||
ok(shellitem == 0, "Got %p\n", shellitem);
|
||||
|
||||
if (0) /* crashes on Windows XP */
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue