mshtml: Use query_interface in the dispex vtbl for HTMLStorage.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2023-09-08 18:24:27 +03:00 committed by Alexandre Julliard
parent ab0cc29c00
commit fcde70d9a4

View file

@ -363,22 +363,12 @@ static HRESULT WINAPI HTMLStorage_QueryInterface(IHTMLStorage *iface, REFIID rii
{
HTMLStorage *This = impl_from_IHTMLStorage(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
if(IsEqualGUID(&IID_IUnknown, riid)) {
*ppv = &This->IHTMLStorage_iface;
}else if(IsEqualGUID(&IID_IHTMLStorage, riid)) {
*ppv = &This->IHTMLStorage_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 HTMLStorage_AddRef(IHTMLStorage *iface)
@ -1055,6 +1045,16 @@ static inline HTMLStorage *impl_from_DispatchEx(DispatchEx *iface)
return CONTAINING_RECORD(iface, HTMLStorage, dispex);
}
static void *HTMLStorage_query_interface(DispatchEx *dispex, REFIID riid)
{
HTMLStorage *This = impl_from_DispatchEx(dispex);
if(IsEqualGUID(&IID_IHTMLStorage, riid))
return &This->IHTMLStorage_iface;
return NULL;
}
static void HTMLStorage_destructor(DispatchEx *dispex)
{
HTMLStorage *This = impl_from_DispatchEx(dispex);
@ -1310,6 +1310,7 @@ static HRESULT HTMLStorage_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pi
}
static const dispex_static_data_vtbl_t HTMLStorage_dispex_vtbl = {
.query_interface = HTMLStorage_query_interface,
.destructor = HTMLStorage_destructor,
.get_dispid = HTMLStorage_get_dispid,
.get_name = HTMLStorage_get_name,