From ae6fb7511d6ef08646b5fea392fbb982a513f182 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 24 Apr 2012 22:33:01 +0200 Subject: [PATCH] dmusic: Cleanup IDirectMusicBufferImpl_QueryInterface. --- dlls/dmusic/buffer.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index 3c3395dbc28..838ceeed830 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -27,18 +27,23 @@ static inline IDirectMusicBufferImpl *impl_from_IDirectMusicBuffer(IDirectMusicB } /* IDirectMusicBufferImpl IUnknown part: */ -static HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface(LPDIRECTMUSICBUFFER iface, REFIID riid, LPVOID *ppobj) +static HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface(LPDIRECTMUSICBUFFER iface, REFIID riid, LPVOID *ret_iface) { - IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); - TRACE("(%p, (%s, %p)\n",This,debugstr_dmguid(riid),ppobj); - if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IDirectMusicBuffer)) { - IUnknown_AddRef(iface); - *ppobj = This; - return S_OK; - } - WARN("(%p, (%s, %p): not found\n",This,debugstr_dmguid(riid),ppobj); - return E_NOINTERFACE; + TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface); + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IDirectMusicBuffer)) + { + IDirectMusicBuffer_AddRef(iface); + *ret_iface = iface; + return S_OK; + } + + *ret_iface = NULL; + + WARN("(%p)->(%s, %p): not found\n", iface, debugstr_dmguid(riid), ret_iface); + + return E_NOINTERFACE; } static ULONG WINAPI IDirectMusicBufferImpl_AddRef(LPDIRECTMUSICBUFFER iface)