Commit 366aa9e7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wshom.ocx: Fix WshShell instance QI behaviour.

parent c633cadb
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment