mshtml: Introduce EventTarget_QI.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-09-21 23:25:36 +02:00 committed by Alexandre Julliard
parent d69f1f01e5
commit 632d897c10
5 changed files with 14 additions and 13 deletions

View File

@ -1638,6 +1638,16 @@ HRESULT doc_init_events(HTMLDocumentNode *doc)
return S_OK;
}
HRESULT EventTarget_QI(EventTarget *event_target, REFIID riid, void **ppv)
{
if(dispex_query_interface(&event_target->dispex, riid, ppv))
return *ppv ? S_OK : E_NOINTERFACE;
WARN("(%p)->(%s %p)\n", event_target, debugstr_mshtml_guid(riid), ppv);
*ppv = NULL;
return E_NOINTERFACE;
}
static int event_id_cmp(const void *key, const struct wine_rb_entry *entry)
{
return (INT_PTR)key - WINE_RB_ENTRY_VALUE(entry, handler_vector_t, entry)->event_id;

View File

@ -1399,12 +1399,8 @@ HRESULT HTMLDOMNode_QI(HTMLDOMNode *This, REFIID riid, void **ppv)
}else if(IsEqualGUID(&IID_nsCycleCollectionISupports, riid)) {
*ppv = &This->IHTMLDOMNode_iface;
return S_OK;
}else if(dispex_query_interface(&This->event_target.dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
}else {
*ppv = NULL;
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
return EventTarget_QI(&This->event_target, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);

View File

@ -198,9 +198,7 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii
assert(!*ppv);
return E_NOINTERFACE;
}else {
*ppv = NULL;
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
return EventTarget_QI(&This->inner_window->event_target, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);

View File

@ -1041,6 +1041,7 @@ void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLEleme
void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
void EventTarget_Init(EventTarget*,IUnknown*,dispex_static_data_t*,compat_mode_t) DECLSPEC_HIDDEN;
HRESULT EventTarget_QI(EventTarget*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
void HTMLDOMNode_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;

View File

@ -223,12 +223,8 @@ static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface(IHTMLXMLHttpRequest *ifa
*ppv = &This->IProvideClassInfo2_iface;
}else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) {
*ppv = &This->IProvideClassInfo2_iface;
}else if(dispex_query_interface(&This->event_target.dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
}else {
*ppv = NULL;
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
return EventTarget_QI(&This->event_target, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv);