Module: wine Branch: master Commit: 80f6197fdc1811dc3bf0d70944151a19f433eb33 URL: http://source.winehq.org/git/wine.git/?a=commit;h=80f6197fdc1811dc3bf0d70944...
Author: André Hentschel nerv@dawncrow.de Date: Thu Apr 4 00:10:37 2013 +0200
explorerframe: Clear pointer when nothing is selected.
---
dlls/explorerframe/nstc.c | 3 +++ dlls/explorerframe/tests/nstc.c | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/explorerframe/nstc.c b/dlls/explorerframe/nstc.c index d5e78e7..a881cc4 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 6287078..ab6a0ce 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);