Michael Stefaniuc : dmime: Properly use SetCooperativeLevel() on the dsound ifaces we create.
Module: wine Branch: master Commit: 9a90a3e8e505bb92ca80289c3896e28eff034dc0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9a90a3e8e505bb92ca80289c38... Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Thu May 4 17:17:01 2017 +0200 dmime: Properly use SetCooperativeLevel() on the dsound ifaces we create. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/performance.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 7e115bf..a0f70b0 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -256,10 +256,6 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init(IDirectMusicPerformance8 FIXME("(iface = %p, dmusic = %p, dsound = %p, hwnd = %p)\n", This, ppDirectMusic, pDirectSound, hWnd); if (This->pDirectMusic || This->pDirectSound) return DMUS_E_ALREADY_INITED; - - if (NULL == hWnd) { - hWnd = GetForegroundWindow(); - } if (NULL != pDirectSound) { This->pDirectSound = pDirectSound; @@ -268,12 +264,9 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init(IDirectMusicPerformance8 DirectSoundCreate8(NULL, (LPDIRECTSOUND8*) &This->pDirectSound, NULL); if (!This->pDirectSound) return DSERR_NODRIVER; - if (NULL != hWnd) { - IDirectSound8_SetCooperativeLevel(This->pDirectSound, hWnd, DSSCL_PRIORITY); - } else { - /* how to get the ForeGround window handle ? */ - /*IDirectSound8_SetCooperativeLevel(This->pDirectSound, hWnd, DSSCL_PRIORITY);*/ - } + if (!hWnd) + hWnd = GetForegroundWindow(); + IDirectSound_SetCooperativeLevel(This->pDirectSound, hWnd, DSSCL_PRIORITY); } if (NULL != ppDirectMusic && NULL != *ppDirectMusic) { @@ -917,6 +910,9 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio(IDirectMusicPerform FIXME("return dsound(%p,%d)\n", dsound, hr); if (FAILED(hr) || !dsound) return DSERR_NODRIVER; + if (!hWnd) + hWnd = GetForegroundWindow(); + IDirectSound_SetCooperativeLevel(dsound, hWnd, DSSCL_PRIORITY); if (ppDirectSound) *ppDirectSound = dsound; }
participants (1)
-
Alexandre Julliard