Module: wine Branch: master Commit: 366aa9e74eb5f69a4159cbc32618eb166201f969 URL: http://source.winehq.org/git/wine.git/?a=commit;h=366aa9e74eb5f69a4159cbc326...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Feb 19 19:47:32 2015 +0300
wshom.ocx: Fix WshShell instance QI behaviour.
---
dlls/wshom.ocx/shell.c | 10 ++++++---- dlls/wshom.ocx/tests/wshom.c | 13 ++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/dlls/wshom.ocx/shell.c b/dlls/wshom.ocx/shell.c index 0284967..198531e 100644 --- a/dlls/wshom.ocx/shell.c +++ b/dlls/wshom.ocx/shell.c @@ -817,9 +817,11 @@ static HRESULT WINAPI WshShell3_QueryInterface(IWshShell3 *iface, REFIID riid, v
*ppv = NULL;
- if(IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IDispatch) || - IsEqualGUID(riid, &IID_IWshShell3)) + if (IsEqualGUID(riid, &IID_IDispatch) || + IsEqualGUID(riid, &IID_IWshShell3) || + IsEqualGUID(riid, &IID_IWshShell2) || + IsEqualGUID(riid, &IID_IWshShell) || + IsEqualGUID(riid, &IID_IUnknown)) { *ppv = iface; } @@ -829,7 +831,7 @@ static HRESULT WINAPI WshShell3_QueryInterface(IWshShell3 *iface, REFIID riid, v } else { - FIXME("Unknown iface %s\n", debugstr_guid(riid)); + WARN("unknown iface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; }
diff --git a/dlls/wshom.ocx/tests/wshom.c b/dlls/wshom.ocx/tests/wshom.c index a836f10..888023f 100644 --- a/dlls/wshom.ocx/tests/wshom.c +++ b/dlls/wshom.ocx/tests/wshom.c @@ -44,7 +44,7 @@ static void test_wshshell(void) IDispatchEx *dispex; IWshCollection *coll; IDispatch *disp, *shortcut; - IUnknown *shell; + IUnknown *shell, *unk; IFolderCollection *folders; IWshShortcut *shcut; ITypeInfo *ti; @@ -71,6 +71,17 @@ static void test_wshshell(void) hr = IUnknown_QueryInterface(shell, &IID_IWshShell3, (void**)&sh3); EXPECT_HR(hr, S_OK);
+ hr = IWshShell3_QueryInterface(sh3, &IID_IObjectWithSite, (void**)&unk); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + + hr = IWshShell3_QueryInterface(sh3, &IID_IWshShell, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); + IUnknown_Release(unk); + + hr = IWshShell3_QueryInterface(sh3, &IID_IWshShell2, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); + IUnknown_Release(unk); + hr = IWshShell3_get_SpecialFolders(sh3, &coll); EXPECT_HR(hr, S_OK);