Commit 6b9c2148 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Use query_interface in the dispex vtbl for XMLHttpRequest.

parent 070b51d7
...@@ -4577,27 +4577,6 @@ void *EventTarget_query_interface(EventTarget *event_target, REFIID riid) ...@@ -4577,27 +4577,6 @@ void *EventTarget_query_interface(EventTarget *event_target, REFIID riid)
return NULL; return NULL;
} }
HRESULT EventTarget_QI(EventTarget *event_target, REFIID riid, void **ppv)
{
if(IsEqualGUID(riid, &IID_IEventTarget)) {
if(use_event_quirks(event_target)) {
WARN("IEventTarget queried, but not supported by in document mode\n");
*ppv = NULL;
return E_NOINTERFACE;
}
IEventTarget_AddRef(&event_target->IEventTarget_iface);
*ppv = &event_target->IEventTarget_iface;
return S_OK;
}
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;
}
void EventTarget_init_dispex_info(dispex_data_t *dispex_info, compat_mode_t compat_mode) void EventTarget_init_dispex_info(dispex_data_t *dispex_info, compat_mode_t compat_mode)
{ {
static const dispex_hook_t IEventTarget_hooks[] = { static const dispex_hook_t IEventTarget_hooks[] = {
......
...@@ -1211,7 +1211,6 @@ void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMElement*,dispex_stati ...@@ -1211,7 +1211,6 @@ void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMElement*,dispex_stati
void EventTarget_Init(EventTarget*,IUnknown*,dispex_static_data_t*,compat_mode_t); void EventTarget_Init(EventTarget*,IUnknown*,dispex_static_data_t*,compat_mode_t);
void *EventTarget_query_interface(EventTarget*,REFIID); void *EventTarget_query_interface(EventTarget*,REFIID);
HRESULT EventTarget_QI(EventTarget*,REFIID,void**);
void EventTarget_init_dispex_info(dispex_data_t*,compat_mode_t); void EventTarget_init_dispex_info(dispex_data_t*,compat_mode_t);
void *HTMLDOMNode_QI(HTMLDOMNode*,REFIID); void *HTMLDOMNode_QI(HTMLDOMNode*,REFIID);
......
...@@ -508,28 +508,12 @@ static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface(IHTMLXMLHttpRequest *ifa ...@@ -508,28 +508,12 @@ static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface(IHTMLXMLHttpRequest *ifa
{ {
HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); if(dispex_query_interface(&This->event_target.dispex, riid, ppv))
return *ppv ? S_OK : E_NOINTERFACE;
if(IsEqualGUID(&IID_IUnknown, riid)) {
*ppv = &This->IHTMLXMLHttpRequest_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
*ppv = &This->IHTMLXMLHttpRequest_iface;
}else if(IsEqualGUID(&IID_IHTMLXMLHttpRequest, riid)) {
*ppv = &This->IHTMLXMLHttpRequest_iface;
}else if(IsEqualGUID(&IID_IHTMLXMLHttpRequest2, riid)) {
*ppv = &This->IHTMLXMLHttpRequest2_iface;
}else if(IsEqualGUID(&IID_IWineXMLHttpRequestPrivate, riid)) {
*ppv = &This->IWineXMLHttpRequestPrivate_iface;
}else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) {
*ppv = &This->IProvideClassInfo2_iface;
}else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) {
*ppv = &This->IProvideClassInfo2_iface;
}else {
return EventTarget_QI(&This->event_target, riid, ppv);
}
IUnknown_AddRef((IUnknown*)*ppv); *ppv = NULL;
return S_OK; WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
} }
static ULONG WINAPI HTMLXMLHttpRequest_AddRef(IHTMLXMLHttpRequest *iface) static ULONG WINAPI HTMLXMLHttpRequest_AddRef(IHTMLXMLHttpRequest *iface)
...@@ -1517,6 +1501,24 @@ static inline HTMLXMLHttpRequest *impl_from_DispatchEx(DispatchEx *iface) ...@@ -1517,6 +1501,24 @@ static inline HTMLXMLHttpRequest *impl_from_DispatchEx(DispatchEx *iface)
return CONTAINING_RECORD(iface, HTMLXMLHttpRequest, event_target.dispex); return CONTAINING_RECORD(iface, HTMLXMLHttpRequest, event_target.dispex);
} }
static void *HTMLXMLHttpRequest_query_interface(DispatchEx *dispex, REFIID riid)
{
HTMLXMLHttpRequest *This = impl_from_DispatchEx(dispex);
if(IsEqualGUID(&IID_IHTMLXMLHttpRequest, riid))
return &This->IHTMLXMLHttpRequest_iface;
if(IsEqualGUID(&IID_IHTMLXMLHttpRequest2, riid))
return &This->IHTMLXMLHttpRequest2_iface;
if(IsEqualGUID(&IID_IWineXMLHttpRequestPrivate, riid))
return &This->IWineXMLHttpRequestPrivate_iface;
if(IsEqualGUID(&IID_IProvideClassInfo, riid))
return &This->IProvideClassInfo2_iface;
if(IsEqualGUID(&IID_IProvideClassInfo2, riid))
return &This->IProvideClassInfo2_iface;
return EventTarget_query_interface(&This->event_target, riid);
}
static void HTMLXMLHttpRequest_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) static void HTMLXMLHttpRequest_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{ {
HTMLXMLHttpRequest *This = impl_from_DispatchEx(dispex); HTMLXMLHttpRequest *This = impl_from_DispatchEx(dispex);
...@@ -1606,6 +1608,7 @@ static void HTMLXMLHttpRequest_init_dispex_info(dispex_data_t *info, compat_mode ...@@ -1606,6 +1608,7 @@ static void HTMLXMLHttpRequest_init_dispex_info(dispex_data_t *info, compat_mode
static const event_target_vtbl_t HTMLXMLHttpRequest_event_target_vtbl = { static const event_target_vtbl_t HTMLXMLHttpRequest_event_target_vtbl = {
{ {
.query_interface = HTMLXMLHttpRequest_query_interface,
.destructor = HTMLXMLHttpRequest_destructor, .destructor = HTMLXMLHttpRequest_destructor,
.traverse = HTMLXMLHttpRequest_traverse, .traverse = HTMLXMLHttpRequest_traverse,
.unlink = HTMLXMLHttpRequest_unlink, .unlink = HTMLXMLHttpRequest_unlink,
......
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