dmsynth: Cleanup QueryInterface methods.

This commit is contained in:
Christian Costa 2012-05-11 08:18:42 +02:00 committed by Alexandre Julliard
parent 9120852797
commit 6894f384f1
2 changed files with 42 additions and 31 deletions

View File

@ -34,27 +34,32 @@ static inline IDirectMusicSynth8Impl *impl_from_IDirectMusicSynth8(IDirectMusicS
} }
/* IDirectMusicSynth8Impl IUnknown part: */ /* IDirectMusicSynth8Impl IUnknown part: */
static HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface(LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj) static HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface(LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ret_iface)
{ {
IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface);
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
if (IsEqualIID (riid, &IID_IUnknown) || if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicSynth) || IsEqualIID (riid, &IID_IDirectMusicSynth) ||
IsEqualIID (riid, &IID_IDirectMusicSynth8)) { IsEqualIID (riid, &IID_IDirectMusicSynth8))
IUnknown_AddRef(iface); {
*ppobj = This; IUnknown_AddRef(iface);
return S_OK; *ret_iface = iface;
} return S_OK;
else if (IsEqualIID(riid, &IID_IKsControl)) { }
IUnknown_AddRef(iface); else if (IsEqualIID(riid, &IID_IKsControl))
*ppobj = &This->IKsControl_iface; {
return S_OK; IUnknown_AddRef(iface);
*ret_iface = &This->IKsControl_iface;
return S_OK;
} }
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj); *ret_iface = NULL;
return E_NOINTERFACE;
WARN("(%p)->(%s, %p): not found\n", iface, debugstr_dmguid(riid), ret_iface);
return E_NOINTERFACE;
} }
static ULONG WINAPI IDirectMusicSynth8Impl_AddRef(LPDIRECTMUSICSYNTH8 iface) static ULONG WINAPI IDirectMusicSynth8Impl_AddRef(LPDIRECTMUSICSYNTH8 iface)

View File

@ -30,25 +30,31 @@ static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirect
} }
/* IDirectMusicSynthSinkImpl IUnknown part: */ /* IDirectMusicSynthSinkImpl IUnknown part: */
static HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface(LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj) static HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface(LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ret_iface)
{ {
IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface);
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
if (IsEqualIID (riid, &IID_IUnknown) || TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
IsEqualIID (riid, &IID_IDirectMusicSynthSink)) {
IUnknown_AddRef(iface); if (IsEqualIID (riid, &IID_IUnknown) ||
*ppobj = This; IsEqualIID (riid, &IID_IDirectMusicSynthSink))
return S_OK; {
} IUnknown_AddRef(iface);
else if (IsEqualIID(riid, &IID_IKsControl)) { *ret_iface = iface;
IUnknown_AddRef(iface); return S_OK;
*ppobj = &This->IKsControl_iface; }
return S_OK; else if (IsEqualIID(riid, &IID_IKsControl))
{
IUnknown_AddRef(iface);
*ret_iface = &This->IKsControl_iface;
return S_OK;
} }
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj); *ret_iface = NULL;
return E_NOINTERFACE;
WARN("(%p)->(%s, %p): not found\n", iface, debugstr_dmguid(riid), ret_iface);
return E_NOINTERFACE;
} }
static ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef(LPDIRECTMUSICSYNTHSINK iface) static ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef(LPDIRECTMUSICSYNTHSINK iface)