diff --git a/dll/win32/winmm/playsound.c b/dll/win32/winmm/playsound.c index 425b50d1603..d0819b65f9b 100644 --- a/dll/win32/winmm/playsound.c +++ b/dll/win32/winmm/playsound.c @@ -35,6 +35,7 @@ typedef struct tagWINE_PLAYSOUND } WINE_PLAYSOUND; static WINE_PLAYSOUND *PlaySoundList; +static BOOL bPlaySoundStop; static HMMIO get_mmioFromFile(LPCWSTR lpszName) { @@ -501,7 +502,7 @@ static BOOL proc_PlaySound(WINE_PLAYSOUND *wps) mmioSeek(wps->hmmio, mmckInfo.dwDataOffset, SEEK_SET); while (left) { - if (WaitForSingleObject(psStopEvent, 0) == WAIT_OBJECT_0) + if (bPlaySoundStop) { waveOutReset(hWave); wps->bLoop = FALSE; @@ -597,13 +598,13 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo ResetEvent(psLastEvent); /* FIXME: doc says we have to stop all instances of pszSound if it's non * NULL... as of today, we stop all playing instances */ - SetEvent(psStopEvent); + bPlaySoundStop = TRUE; LeaveCriticalSection(&WINMM_cs); WaitForSingleObject(psLastEvent, INFINITE); EnterCriticalSection(&WINMM_cs); - ResetEvent(psStopEvent); + bPlaySoundStop = FALSE; } if (wps) wps->lpNext = PlaySoundList; diff --git a/dll/win32/winmm/winmm.c b/dll/win32/winmm/winmm.c index e055a2da031..1ecf53b5385 100644 --- a/dll/win32/winmm/winmm.c +++ b/dll/win32/winmm/winmm.c @@ -49,7 +49,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winmm); HINSTANCE hWinMM32Instance; HANDLE psLastEvent; -HANDLE psStopEvent; CRITICAL_SECTION WINMM_cs; @@ -59,7 +58,6 @@ CRITICAL_SECTION WINMM_cs; static BOOL WINMM_CreateIData(HINSTANCE hInstDLL) { hWinMM32Instance = hInstDLL; - psStopEvent = CreateEventW(NULL, TRUE, FALSE, NULL); psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL); InitializeCriticalSection(&WINMM_cs); return TRUE; @@ -74,7 +72,6 @@ static void WINMM_DeleteIData(void) /* FIXME: should also free content and resources allocated * inside WINMM_IData */ - CloseHandle(psStopEvent); CloseHandle(psLastEvent); DeleteCriticalSection(&WINMM_cs); }