explorerframe: Clear pointer when nothing is selected.

This commit is contained in:
André Hentschel 2013-04-04 00:10:37 +02:00 committed by Alexandre Julliard
parent a2bebdcc7c
commit 80f6197fdc
2 changed files with 4 additions and 1 deletions

View File

@ -1240,7 +1240,10 @@ static HRESULT WINAPI NSTC2_fnGetSelectedItems(INameSpaceTreeControl2* iface,
psiselected = get_selected_shellitem(This); psiselected = get_selected_shellitem(This);
if(!psiselected) if(!psiselected)
{
*psiaItems = NULL;
return E_FAIL; return E_FAIL;
}
hr = SHCreateShellItemArrayFromShellItem(psiselected, &IID_IShellItemArray, hr = SHCreateShellItemArrayFromShellItem(psiselected, &IID_IShellItemArray,
(void**)psiaItems); (void**)psiaItems);

View File

@ -1366,7 +1366,7 @@ static void test_basics(void)
psia = (void*)0xdeadbeef; psia = (void*)0xdeadbeef;
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia); hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
ok(hr == E_FAIL, "Got 0x%08x\n", hr); ok(hr == E_FAIL, "Got 0x%08x\n", hr);
ok(psia == (void*)0xdeadbeef, "Got %p\n", psia); ok(!psia || broken(psia == (void*)0xdeadbeef /* before Win8 */), "Got %p\n", psia);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir2, SHCONTF_FOLDERS, 0, NULL); hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir2, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr); ok(hr == S_OK, "Got (0x%08x)\n", hr);