diff --git a/dlls/explorerframe/nstc.c b/dlls/explorerframe/nstc.c index d5e78e7ebbf..a881cc46841 100644 --- a/dlls/explorerframe/nstc.c +++ b/dlls/explorerframe/nstc.c @@ -1240,7 +1240,10 @@ static HRESULT WINAPI NSTC2_fnGetSelectedItems(INameSpaceTreeControl2* iface, psiselected = get_selected_shellitem(This); if(!psiselected) + { + *psiaItems = NULL; return E_FAIL; + } hr = SHCreateShellItemArrayFromShellItem(psiselected, &IID_IShellItemArray, (void**)psiaItems); diff --git a/dlls/explorerframe/tests/nstc.c b/dlls/explorerframe/tests/nstc.c index 62870782c90..ab6a0ce22e1 100644 --- a/dlls/explorerframe/tests/nstc.c +++ b/dlls/explorerframe/tests/nstc.c @@ -1366,7 +1366,7 @@ static void test_basics(void) psia = (void*)0xdeadbeef; hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia); 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); ok(hr == S_OK, "Got (0x%08x)\n", hr);