Rémi Bernon (@rbernon) commented about dlls/windows.media.playback.backgroundmediaplayer/main.c:
{ - FIXME( "iface %p, player %p stub!\n", iface, player ); - return E_NOTIMPL; + struct background_media_player_statics *impl = impl_from_IBackgroundMediaPlayerStatics( iface ); + HRESULT hr; + + TRACE( "iface %p, player %p\n", iface, player ); + + if (!impl->media_player && FAILED(hr = get_media_player( &impl->media_player ))) + { + *player = NULL; + return hr; + } + + *player = impl->media_player; + IMediaPlayer_AddRef( *player ); I suspect this will need to be guarded with a critical section as multiple threads could be calling get_Current concurrently. The same would then be needed for the release, in case some thread is releasing the last factory reference while another just acquired a new reference and called get_Current.
I would say that this is maybe a bit unnecessarily complicated for a stub. For simplicity you could allocate a new IMediaPlayer stub each time get_Current is called, and keep the media_player == media_player2 test as todo_wine. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8937#note_115423