From 8302f073b6d81ea496e6242715c8c24c83e2d9d9 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 2 Oct 2006 21:07:31 +0200 Subject: [PATCH] shdocvw: Silence common invalid QueryInterface FIXMEs. --- dlls/shdocvw/tests/webbrowser.c | 16 ++++++++++++++++ dlls/shdocvw/webbrowser.c | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c index a21d732d47d..0525dd54495 100644 --- a/dlls/shdocvw/tests/webbrowser.c +++ b/dlls/shdocvw/tests/webbrowser.c @@ -936,6 +936,21 @@ static void test_Extent(IUnknown *unk) IOleObject_Release(oleobj); } +static void test_QueryInterface(IUnknown *unk) +{ + IQuickActivate *qa = (IQuickActivate*)0xdeadbeef; + IRunnableObject *runnable = (IRunnableObject*)0xdeadbeef; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IQuickActivate, (void**)&qa); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); + ok(qa == NULL, "qa=%p, ezpected NULL\n", qa); + + hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&runnable); + ok(hres == E_NOINTERFACE, "QueryInterface returned %08lx, expected E_NOINTERFACE\n", hres); + ok(runnable == NULL, "runnable=%p, ezpected NULL\n", runnable); +} + static void test_WebBrowser(void) { IUnknown *unk = NULL; @@ -948,6 +963,7 @@ static void test_WebBrowser(void) if(FAILED(hres)) return; + test_QueryInterface(unk); test_ClassInfo(unk); test_ClientSite(unk, &ClientSite); test_Extent(unk); diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c index 3740aabe832..9a61613e5c9 100644 --- a/dlls/shdocvw/webbrowser.c +++ b/dlls/shdocvw/webbrowser.c @@ -99,6 +99,12 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid }else if(IsEqualGUID(&IID_IHlinkFrame, riid)) { TRACE("(%p)->(IID_IHlinkFrame %p)\n", This, ppv); *ppv = HLINKFRAME(This); + }else if(IsEqualGUID(&IID_IQuickActivate, riid)) { + TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This, ppv); + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { + TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); + return E_NOINTERFACE; } if(*ppv) {