From f86b6e87f38355ae6c8a17b466268d8ccbe5338c Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Mon, 22 Dec 2008 13:58:08 +0100 Subject: [PATCH] dmusic: Fix IDirectMusicPortImpl_QueryInterface. --- dlls/dmusic/port.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 5264f58636f..618c2e39340 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -23,18 +23,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); /* IDirectMusicPortImpl IUnknown part: */ static HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj) { - IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface; + ICOM_THIS_MULTI(IDirectMusicPortImpl, lpVtbl, iface); + TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort) || - IsEqualGUID(riid, &IID_IDirectMusicPort8) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload8) || - IsEqualGUID(riid, &IID_IDirectMusicThru) || - IsEqualGUID(riid, &IID_IDirectMusicThru8)) { - IUnknown_AddRef(iface); - *ppobj = This; + IsEqualGUID(riid, &IID_IDirectMusicPort8)) { + *ppobj = &This->lpVtbl; + IDirectMusicPort_AddRef((LPDIRECTMUSICPORT)*ppobj); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || + IsEqualGUID(riid, &IID_IDirectMusicPortDownload8)) { + *ppobj = &This->lpDownloadVtbl; + IDirectMusicPortDownload_AddRef((LPDIRECTMUSICPORTDOWNLOAD)*ppobj); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IDirectMusicThru) || + IsEqualGUID(riid, &IID_IDirectMusicThru8)) { + *ppobj = &This->lpThruVtbl; + IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ppobj); return S_OK; } WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);