Commit be0c5268 authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

windows.media.mediacontrol: Implement IMusicDisplayProperties::get/put_Title().

Called by Roon.
parent ce59ba8c
......@@ -121,6 +121,8 @@ struct music_properties
{
IMusicDisplayProperties IMusicDisplayProperties_iface;
LONG ref;
HSTRING title;
};
static inline struct music_properties *impl_from_IMusicDisplayProperties( IMusicDisplayProperties *iface )
......@@ -164,7 +166,11 @@ static ULONG WINAPI music_properties_Release( IMusicDisplayProperties *iface )
TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref );
if (!ref) free( impl );
if (!ref)
{
WindowsDeleteString( impl->title );
free( impl );
}
return ref;
}
......@@ -188,14 +194,17 @@ static HRESULT WINAPI music_properties_GetTrustLevel( IMusicDisplayProperties *i
static HRESULT WINAPI music_properties_get_Title( 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->title, value );
}
static HRESULT WINAPI music_properties_put_Title( 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->title );
return WindowsDuplicateString( value, &impl->title );
}
static HRESULT WINAPI music_properties_get_AlbumArtist( IMusicDisplayProperties *iface, HSTRING *value )
......
......@@ -178,17 +178,17 @@ static void test_MediaControlStatics(void)
check_interface( music_properties, &IID_IAgileObject );
hr = IMusicDisplayProperties_put_Title( 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"Wine", wcslen( L"Wine" ), &header, &str );
ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IMusicDisplayProperties_put_Title( 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_Title( 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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment