From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media.mediacontrol/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/windows.media.mediacontrol/main.c b/dlls/windows.media.mediacontrol/main.c index e8c74ed6ed3..8d0df992768 100644 --- a/dlls/windows.media.mediacontrol/main.c +++ b/dlls/windows.media.mediacontrol/main.c @@ -24,6 +24,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(mediacontrol);
+static EventRegistrationToken dummy_token = {.value = 0xdeadbeef}; + struct media_control_statics { IActivationFactory IActivationFactory_iface; @@ -800,13 +802,14 @@ static HRESULT WINAPI media_control_add_ButtonPressed( ISystemMediaTransportCont ITypedEventHandler_SystemMediaTransportControls_SystemMediaTransportControlsButtonPressedEventArgs *handler, EventRegistrationToken *token ) { FIXME( "iface %p, handler %p, token %p stub!\n", iface, handler, token ); - return E_NOTIMPL; + *token = dummy_token; + return S_OK; }
static HRESULT WINAPI media_control_remove_ButtonPressed( ISystemMediaTransportControls *iface, EventRegistrationToken token ) { FIXME( "iface %p, token %#I64x stub!\n", iface, token.value ); - return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI media_control_add_PropertyChanged( ISystemMediaTransportControls *iface,
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media.mediacontrol/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/windows.media.mediacontrol/main.c b/dlls/windows.media.mediacontrol/main.c index 8d0df992768..8015fbf7a1a 100644 --- a/dlls/windows.media.mediacontrol/main.c +++ b/dlls/windows.media.mediacontrol/main.c @@ -473,7 +473,7 @@ static HRESULT WINAPI display_updater_CopyFromFileAsync( ISystemMediaTransportCo static HRESULT WINAPI display_updater_ClearAll( ISystemMediaTransportControlsDisplayUpdater *iface ) { FIXME( "iface %p stub!\n", iface ); - return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI display_updater_Update( ISystemMediaTransportControlsDisplayUpdater *iface )
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media.mediacontrol/main.c | 17 +++++++++++++---- .../tests/mediacontrol.c | 7 +++++++ 2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media.mediacontrol/main.c b/dlls/windows.media.mediacontrol/main.c index 8015fbf7a1a..ee78444998b 100644 --- a/dlls/windows.media.mediacontrol/main.c +++ b/dlls/windows.media.mediacontrol/main.c @@ -514,6 +514,7 @@ struct media_control HWND window; MediaPlaybackStatus media_playback_status; boolean is_play_enabled; + boolean is_stop_enabled; boolean is_pause_enabled; boolean is_previous_enabled; boolean is_next_enabled; @@ -668,14 +669,22 @@ static HRESULT WINAPI media_control_put_IsPlayEnabled( ISystemMediaTransportCont
static HRESULT WINAPI media_control_get_IsStopEnabled( ISystemMediaTransportControls *iface, boolean *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct media_control *impl = impl_from_ISystemMediaTransportControls( iface ); + + TRACE( "iface %p, value %p\n", iface, value ); + + *value = impl->is_stop_enabled; + return S_OK; }
static HRESULT WINAPI media_control_put_IsStopEnabled( ISystemMediaTransportControls *iface, boolean value ) { - FIXME( "iface %p, value %d stub!\n", iface, value ); - return E_NOTIMPL; + struct media_control *impl = impl_from_ISystemMediaTransportControls( iface ); + + TRACE( "iface %p, value %d\n", iface, value ); + + impl->is_stop_enabled = value; + return S_OK; }
static HRESULT WINAPI media_control_get_IsPauseEnabled( ISystemMediaTransportControls *iface, boolean *value ) diff --git a/dlls/windows.media.mediacontrol/tests/mediacontrol.c b/dlls/windows.media.mediacontrol/tests/mediacontrol.c index 4adab552d9f..4d84b5a10e1 100644 --- a/dlls/windows.media.mediacontrol/tests/mediacontrol.c +++ b/dlls/windows.media.mediacontrol/tests/mediacontrol.c @@ -118,6 +118,8 @@ static void test_MediaControlStatics(void)
hr = ISystemMediaTransportControls_put_IsPlayEnabled( media_control_statics, FALSE ); ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr ); + hr = ISystemMediaTransportControls_put_IsStopEnabled( media_control_statics, FALSE ); + ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr ); hr = ISystemMediaTransportControls_put_IsPauseEnabled( media_control_statics, FALSE ); ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr ); hr = ISystemMediaTransportControls_put_IsPreviousEnabled( media_control_statics, FALSE ); @@ -132,6 +134,11 @@ static void test_MediaControlStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr ); ok( value == FALSE, "got value %d.\n", value );
+ value = TRUE; + hr = ISystemMediaTransportControls_get_IsStopEnabled( media_control_statics, &value ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( value == FALSE, "got value %d.\n", value ); + value = TRUE; hr = ISystemMediaTransportControls_get_IsPauseEnabled( media_control_statics, &value ); ok( hr == S_OK, "got hr %#lx.\n", hr );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media.mediacontrol/main.c | 10 ++++++---- dlls/windows.media.mediacontrol/tests/mediacontrol.c | 9 +++++++++ 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media.mediacontrol/main.c b/dlls/windows.media.mediacontrol/main.c index ee78444998b..2bc02248c59 100644 --- a/dlls/windows.media.mediacontrol/main.c +++ b/dlls/windows.media.mediacontrol/main.c @@ -422,16 +422,18 @@ static HRESULT WINAPI display_updater_put_AppMediaId( ISystemMediaTransportContr return E_NOTIMPL; }
-static HRESULT WINAPI display_updater_get_Thumbnail( ISystemMediaTransportControlsDisplayUpdater *iface, __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStreamReference **value ) +static HRESULT WINAPI display_updater_get_Thumbnail( ISystemMediaTransportControlsDisplayUpdater *iface, IRandomAccessStreamReference **value ) { FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + + *value = NULL; + return S_OK; }
-static HRESULT WINAPI display_updater_put_Thumbnail( ISystemMediaTransportControlsDisplayUpdater *iface, __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStreamReference *value ) +static HRESULT WINAPI display_updater_put_Thumbnail( ISystemMediaTransportControlsDisplayUpdater *iface, IRandomAccessStreamReference *value ) { FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI display_updater_get_MusicProperties( ISystemMediaTransportControlsDisplayUpdater *iface, IMusicDisplayProperties **value ) diff --git a/dlls/windows.media.mediacontrol/tests/mediacontrol.c b/dlls/windows.media.mediacontrol/tests/mediacontrol.c index 4d84b5a10e1..1b9e59348a0 100644 --- a/dlls/windows.media.mediacontrol/tests/mediacontrol.c +++ b/dlls/windows.media.mediacontrol/tests/mediacontrol.c @@ -29,6 +29,7 @@ #define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" #define WIDL_using_Windows_Media +#define WIDL_using_Windows_Storage_Streams #include "windows.media.h" #include "systemmediatransportcontrolsinterop.h"
@@ -64,6 +65,7 @@ static void test_MediaControlStatics(void) ISystemMediaTransportControls *media_control_statics = NULL; IMusicDisplayProperties2 *music_properties2 = NULL; IMusicDisplayProperties *music_properties = NULL; + IRandomAccessStreamReference *stream_ref; MediaPlaybackType playback_type; IActivationFactory *factory; HSTRING_HEADER header; @@ -172,6 +174,8 @@ static void test_MediaControlStatics(void) ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); hr = ISystemMediaTransportControlsDisplayUpdater_put_Type( display_updater, MediaPlaybackType_Music ); ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = ISystemMediaTransportControlsDisplayUpdater_put_Thumbnail( display_updater, NULL ); + ok( hr == S_OK, "got hr %#lx.\n", hr );
playback_type = -1; hr = ISystemMediaTransportControlsDisplayUpdater_get_Type( display_updater, &playback_type ); @@ -184,6 +188,11 @@ static void test_MediaControlStatics(void) hr = ISystemMediaTransportControlsDisplayUpdater_get_MusicProperties( display_updater, &music_properties ); ok( hr == S_OK, "got hr %#lx.\n", hr );
+ stream_ref = (void *)0xdeadbeef; + hr = ISystemMediaTransportControlsDisplayUpdater_get_Thumbnail( display_updater, &stream_ref ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( stream_ref == NULL, "got stream_ref %p.\n", stream_ref ); + check_interface( music_properties, &IID_IUnknown ); check_interface( music_properties, &IID_IInspectable ); check_interface( music_properties, &IID_IAgileObject );
This merge request was approved by Rémi Bernon.