Commit 6152fe70 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Use query_interface in the dispex vtbl for builtin constructors.

parent e03b5f0f
......@@ -758,22 +758,12 @@ static HRESULT WINAPI HTMLImageElementFactory_QueryInterface(IHTMLImageElementFa
{
HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IUnknown, riid)) {
*ppv = &This->IHTMLImageElementFactory_iface;
}else if(IsEqualGUID(&IID_IHTMLImageElementFactory, riid)) {
*ppv = &This->IHTMLImageElementFactory_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
if(dispex_query_interface(&This->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;
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
*ppv = NULL;
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI HTMLImageElementFactory_AddRef(IHTMLImageElementFactory *iface)
......@@ -921,6 +911,16 @@ static inline HTMLImageElementFactory *impl_from_DispatchEx(DispatchEx *iface)
return CONTAINING_RECORD(iface, HTMLImageElementFactory, dispex);
}
static void *HTMLImageElementFactory_query_interface(DispatchEx *dispex, REFIID riid)
{
HTMLImageElementFactory *This = impl_from_DispatchEx(dispex);
if(IsEqualGUID(&IID_IHTMLImageElementFactory, riid))
return &This->IHTMLImageElementFactory_iface;
return NULL;
}
static void HTMLImageElementFactory_destructor(DispatchEx *dispex)
{
HTMLImageElementFactory *This = impl_from_DispatchEx(dispex);
......@@ -961,6 +961,7 @@ static const tid_t HTMLImageElementFactory_iface_tids[] = {
};
static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = {
.query_interface = HTMLImageElementFactory_query_interface,
.destructor = HTMLImageElementFactory_destructor,
.value = HTMLImageElementFactory_value,
};
......
......@@ -430,24 +430,12 @@ static HRESULT WINAPI HTMLOptionElementFactory_QueryInterface(IHTMLOptionElement
{
HTMLOptionElementFactory *This = impl_from_IHTMLOptionElementFactory(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IUnknown, riid)) {
*ppv = &This->IHTMLOptionElementFactory_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
*ppv = &This->IHTMLOptionElementFactory_iface;
}else if(IsEqualGUID(&IID_IHTMLOptionElementFactory, riid)) {
*ppv = &This->IHTMLOptionElementFactory_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
if(dispex_query_interface(&This->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;
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
*ppv = NULL;
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI HTMLOptionElementFactory_AddRef(IHTMLOptionElementFactory *iface)
......@@ -566,6 +554,16 @@ static inline HTMLOptionElementFactory *HTMLOptionElementFactory_from_DispatchEx
return CONTAINING_RECORD(iface, HTMLOptionElementFactory, dispex);
}
static void *HTMLOptionElementFactory_query_interface(DispatchEx *dispex, REFIID riid)
{
HTMLOptionElementFactory *This = HTMLOptionElementFactory_from_DispatchEx(dispex);
if(IsEqualGUID(&IID_IHTMLOptionElementFactory, riid))
return &This->IHTMLOptionElementFactory_iface;
return NULL;
}
static void HTMLOptionElementFactory_destructor(DispatchEx *dispex)
{
HTMLOptionElementFactory *This = HTMLOptionElementFactory_from_DispatchEx(dispex);
......@@ -610,6 +608,7 @@ static const tid_t HTMLOptionElementFactory_iface_tids[] = {
};
static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl = {
.query_interface = HTMLOptionElementFactory_query_interface,
.destructor = HTMLOptionElementFactory_destructor,
.value = HTMLOptionElementFactory_value,
};
......
......@@ -1641,24 +1641,12 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_QueryInterface(IHTMLXMLHttpReque
{
HTMLXMLHttpRequestFactory *This = impl_from_IHTMLXMLHttpRequestFactory(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IUnknown, riid)) {
*ppv = &This->IHTMLXMLHttpRequestFactory_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
*ppv = &This->IHTMLXMLHttpRequestFactory_iface;
}else if(IsEqualGUID(&IID_IHTMLXMLHttpRequestFactory, riid)) {
*ppv = &This->IHTMLXMLHttpRequestFactory_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
if(dispex_query_interface(&This->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;
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
*ppv = NULL;
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI HTMLXMLHttpRequestFactory_AddRef(IHTMLXMLHttpRequestFactory *iface)
......@@ -1798,6 +1786,16 @@ static inline HTMLXMLHttpRequestFactory *factory_from_DispatchEx(DispatchEx *ifa
return CONTAINING_RECORD(iface, HTMLXMLHttpRequestFactory, dispex);
}
static void *HTMLXMLHttpRequestFactory_query_interface(DispatchEx *dispex, REFIID riid)
{
HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex);
if(IsEqualGUID(&IID_IHTMLXMLHttpRequestFactory, riid))
return &This->IHTMLXMLHttpRequestFactory_iface;
return NULL;
}
static void HTMLXMLHttpRequestFactory_destructor(DispatchEx *dispex)
{
HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex);
......@@ -1828,6 +1826,7 @@ static HRESULT HTMLXMLHttpRequestFactory_value(DispatchEx *iface, LCID lcid, WOR
}
static const dispex_static_data_vtbl_t HTMLXMLHttpRequestFactory_dispex_vtbl = {
.query_interface = HTMLXMLHttpRequestFactory_query_interface,
.destructor = HTMLXMLHttpRequestFactory_destructor,
.value = HTMLXMLHttpRequestFactory_value
};
......
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