mscoree: There can be only one QI implementation in a COM object.

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-09-08 21:25:27 +02:00 committed by Alexandre Julliard
parent 478f3dd67b
commit cac5a5996a
1 changed files with 9 additions and 20 deletions

View File

@ -73,18 +73,19 @@ static inline ConfigFileHandler *impl_from_ISAXErrorHandler(ISAXErrorHandler *if
static HRESULT WINAPI ConfigFileHandler_QueryInterface(ISAXContentHandler *iface, static HRESULT WINAPI ConfigFileHandler_QueryInterface(ISAXContentHandler *iface,
REFIID riid, void **ppvObject) REFIID riid, void **ppvObject)
{ {
if (IsEqualGUID(riid, &IID_ISAXContentHandler) || ConfigFileHandler *This = impl_from_ISAXContentHandler(iface);
IsEqualGUID(riid, &IID_IUnknown))
{ if (IsEqualGUID(riid, &IID_ISAXContentHandler) || IsEqualGUID(riid, &IID_IUnknown))
*ppvObject = iface; *ppvObject = &This->ISAXContentHandler_iface;
} else if (IsEqualGUID(riid, &IID_ISAXErrorHandler))
*ppvObject = &This->ISAXErrorHandler_iface;
else else
{ {
WARN("Unsupported interface %s\n", debugstr_guid(riid)); WARN("Unsupported interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
ISAXContentHandler_AddRef(iface); IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK; return S_OK;
} }
@ -377,20 +378,8 @@ static const struct ISAXContentHandlerVtbl ConfigFileHandlerVtbl =
static HRESULT WINAPI ConfigFileHandler_Error_QueryInterface(ISAXErrorHandler *iface, static HRESULT WINAPI ConfigFileHandler_Error_QueryInterface(ISAXErrorHandler *iface,
REFIID riid, void **ppvObject) REFIID riid, void **ppvObject)
{ {
if (IsEqualGUID(riid, &IID_ISAXErrorHandler) || ConfigFileHandler *This = impl_from_ISAXErrorHandler(iface);
IsEqualGUID(riid, &IID_IUnknown)) return ISAXContentHandler_QueryInterface(&This->ISAXContentHandler_iface, riid, ppvObject);
{
*ppvObject = iface;
}
else
{
WARN("Unsupported interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
ISAXErrorHandler_AddRef(iface);
return S_OK;
} }
static ULONG WINAPI ConfigFileHandler_Error_AddRef(ISAXErrorHandler *iface) static ULONG WINAPI ConfigFileHandler_Error_AddRef(ISAXErrorHandler *iface)