Rémi Bernon (@rbernon) commented about dlls/windows.media.playback.backgroundmediaplayer/tests/playback.c:
hr = IActivationFactory_QueryInterface( factory, &IID_IBackgroundMediaPlayerStatics, (void **)&background_media_player_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
- hr = IBackgroundMediaPlayerStatics_get_Current( background_media_player_statics, &media_player );
- ok( hr == S_OK, "got hr %#lx.\n", hr );
- hr = IBackgroundMediaPlayerStatics_get_Current( background_media_player_statics, &media_player2 );
- ok( hr == S_OK, "got hr %#lx.\n", hr );
- ok( media_player == media_player2, "got media_player %p, media_player2 %p.\n", media_player, media_player2 );
- ref = IBackgroundMediaPlayerStatics_Release( background_media_player_statics );
- ok( ref == 2, "got ref %ld.\n", ref );
- ref = IMediaPlayer_Release( media_player2 );
- ok( ref == 2 || broken(ref == 4) /* w1064v1507 */, "got ref %ld.\n", ref );
- ref = IMediaPlayer_Release( media_player );
- ok( ref == 1 || broken(ref == 3) /* w1064v1507 */, "got ref %ld.\n", ref );
Fwiw ref count checks can be useful in some cases, and they are useful at the end of a test when releasing the last reference to check for leaks, but in general we don't care about matching windows refcounting exactly, and if the test needs to include broken results because some windows versions don't match it's probably worth removing the reference count checks entirely.