Module: wine Branch: master Commit: 780a173f45aaab0f3b78d04122cbe6ec071c7c82 URL: https://gitlab.winehq.org/wine/wine/-/commit/780a173f45aaab0f3b78d04122cbe6e...
Author: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Thu Sep 28 18:48:44 2023 -0400
windows.media.mediacontrol: Implement IMusicDisplayProperties::get/put_Artist().
Called by Roon.
---
dlls/windows.media.mediacontrol/main.c | 13 +++++++++---- dlls/windows.media.mediacontrol/tests/mediacontrol.c | 10 +++++----- 2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/dlls/windows.media.mediacontrol/main.c b/dlls/windows.media.mediacontrol/main.c index a09fbf50b46..0c66b569170 100644 --- a/dlls/windows.media.mediacontrol/main.c +++ b/dlls/windows.media.mediacontrol/main.c @@ -122,6 +122,7 @@ struct music_properties IMusicDisplayProperties IMusicDisplayProperties_iface; LONG ref;
+ HSTRING artist; HSTRING title; };
@@ -168,6 +169,7 @@ static ULONG WINAPI music_properties_Release( IMusicDisplayProperties *iface )
if (!ref) { + WindowsDeleteString( impl->artist ); WindowsDeleteString( impl->title ); free( impl ); } @@ -221,14 +223,17 @@ static HRESULT WINAPI music_properties_put_AlbumArtist( IMusicDisplayProperties
static HRESULT WINAPI music_properties_get_Artist( IMusicDisplayProperties *iface, HSTRING *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct music_properties *impl = impl_from_IMusicDisplayProperties( iface ); + TRACE( "iface %p, value %p\n", iface, value ); + return WindowsDuplicateString( impl->artist, value ); }
static HRESULT WINAPI music_properties_put_Artist( IMusicDisplayProperties *iface, HSTRING value ) { - FIXME( "iface %p, value %s stub!\n", iface, debugstr_hstring(value) ); - return E_NOTIMPL; + struct music_properties *impl = impl_from_IMusicDisplayProperties( iface ); + TRACE( "iface %p, value %p\n", iface, value ); + WindowsDeleteString( impl->artist ); + return WindowsDuplicateString( value, &impl->artist ); }
static const IMusicDisplayPropertiesVtbl music_properties_vtbl = diff --git a/dlls/windows.media.mediacontrol/tests/mediacontrol.c b/dlls/windows.media.mediacontrol/tests/mediacontrol.c index 6311327b4f9..8b8d48c4e37 100644 --- a/dlls/windows.media.mediacontrol/tests/mediacontrol.c +++ b/dlls/windows.media.mediacontrol/tests/mediacontrol.c @@ -193,17 +193,17 @@ static void test_MediaControlStatics(void) WindowsDeleteString( ret_str );
hr = IMusicDisplayProperties_put_Artist( music_properties, NULL ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCreateStringReference( L"The Wine Project", wcslen( L"The Wine Project" ), &header, &str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IMusicDisplayProperties_put_Artist( music_properties, str ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IMusicDisplayProperties_get_Artist( music_properties, &ret_str ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCompareStringOrdinal( str, ret_str, &res ); ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine ok( !res, "got string %s.\n", debugstr_hstring( ret_str ) ); - todo_wine ok( str != ret_str, "got same HSTRINGs %p, %p.\n", str, ret_str ); + ok( !res, "got string %s.\n", debugstr_hstring( ret_str ) ); + ok( str != ret_str, "got same HSTRINGs %p, %p.\n", str, ret_str ); WindowsDeleteString( str ); WindowsDeleteString( ret_str );