From de11d172dc701740fb58fc9510eb344b23210f20 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 18 Nov 2019 03:07:53 +0000 Subject: [PATCH] dmstyle: Add GUID_IDirectMusicStyle support in Style Track GetParam. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/dmstyle/styletrack.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/dmstyle/styletrack.c b/dlls/dmstyle/styletrack.c index cc15bd81d12..06fe1c7ca88 100644 --- a/dlls/dmstyle/styletrack.c +++ b/dlls/dmstyle/styletrack.c @@ -132,15 +132,31 @@ static HRESULT WINAPI style_track_Play(IDirectMusicTrack8 *iface, void *pStateDa return S_OK; } -static HRESULT WINAPI style_track_GetParam(IDirectMusicTrack8 *iface, REFGUID rguidType, - MUSIC_TIME mtTime, MUSIC_TIME *pmtNext, void *pParam) +static HRESULT WINAPI style_track_GetParam(IDirectMusicTrack8 *iface, REFGUID type, + MUSIC_TIME time, MUSIC_TIME *next, void *param) { IDirectMusicStyleTrack *This = impl_from_IDirectMusicTrack8(iface); - FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam); + struct list *item = NULL; - if (!rguidType) + FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(type), time, next, param); + + if (!type) return E_POINTER; + if (IsEqualGUID(&GUID_IDirectMusicStyle, type)) { + LIST_FOR_EACH (item, &This->Items) { + DMUS_PRIVATE_STYLE_ITEM *style = LIST_ENTRY(item, DMUS_PRIVATE_STYLE_ITEM, entry); + if (style->pObject) { + IDirectMusicStyle8_AddRef(style->pObject); + *((IDirectMusicStyle8**)param) = style->pObject; + + return S_OK; + } + } + + return DMUS_E_NOT_FOUND; + } + return S_OK; }