Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/dmstyle/style.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 6eaedb1fbd..efa8d843af 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -137,9 +137,36 @@ static ULONG WINAPI IDirectMusicStyle8Impl_Release(IDirectMusicStyle8 *iface) static HRESULT WINAPI IDirectMusicStyle8Impl_GetBand(IDirectMusicStyle8 *iface, WCHAR *pwszName, IDirectMusicBand **ppBand) { - IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); - FIXME("(%p, %p, %p): stub\n", This, pwszName, ppBand); - return S_OK; + IDirectMusicStyle8Impl *This = impl_from_IDirectMusicStyle8(iface); + struct style_band *band; + HRESULT hr; + + TRACE("(%p, %s, %p): stub\n", This, debugstr_w(pwszName), ppBand); + + if (!pwszName) + return E_POINTER; + + LIST_FOR_EACH_ENTRY(band, &This->bands, struct style_band, entry) { + IDirectMusicObject *obj; + + hr = IDirectMusicBand_QueryInterface(band->pBand, &IID_IDirectMusicObject, (void**)&obj); + if (SUCCEEDED(hr)) { + DMUS_OBJECTDESC desc; + + if (IDirectMusicObject_GetDescriptor(obj, &desc) == S_OK) { + if(desc.dwValidData & DMUS_OBJ_NAME && !lstrcmpW(pwszName, desc.wszName)) { + IDirectMusicObject_Release(obj); + IDirectMusicBand_AddRef(band->pBand); + *ppBand = band->pBand; + return S_OK; + } + } + + IDirectMusicObject_Release(obj); + } + } + + return S_FALSE; }
static HRESULT WINAPI IDirectMusicStyle8Impl_EnumBand(IDirectMusicStyle8 *iface, DWORD dwIndex,