mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 13:43:37 +00:00
winmm: Don't operate on freed data in timer.
This commit is contained in:
parent
7107a6969d
commit
93b6f15826
|
@ -359,6 +359,7 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc,
|
||||||
MMRESULT WINAPI timeKillEvent(UINT wID)
|
MMRESULT WINAPI timeKillEvent(UINT wID)
|
||||||
{
|
{
|
||||||
WINE_TIMERENTRY *lpSelf = NULL, *lpTimer;
|
WINE_TIMERENTRY *lpSelf = NULL, *lpTimer;
|
||||||
|
DWORD wFlags;
|
||||||
|
|
||||||
TRACE("(%u)\n", wID);
|
TRACE("(%u)\n", wID);
|
||||||
EnterCriticalSection(&WINMM_cs);
|
EnterCriticalSection(&WINMM_cs);
|
||||||
|
@ -378,10 +379,11 @@ MMRESULT WINAPI timeKillEvent(UINT wID)
|
||||||
WARN("wID=%u is not a valid timer ID\n", wID);
|
WARN("wID=%u is not a valid timer ID\n", wID);
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
}
|
}
|
||||||
if (lpSelf->wFlags & TIME_KILL_SYNCHRONOUS)
|
wFlags = lpSelf->wFlags;
|
||||||
|
if (wFlags & TIME_KILL_SYNCHRONOUS)
|
||||||
EnterCriticalSection(&TIME_cbcrst);
|
EnterCriticalSection(&TIME_cbcrst);
|
||||||
HeapFree(GetProcessHeap(), 0, lpSelf);
|
HeapFree(GetProcessHeap(), 0, lpSelf);
|
||||||
if (lpSelf->wFlags & TIME_KILL_SYNCHRONOUS)
|
if (wFlags & TIME_KILL_SYNCHRONOUS)
|
||||||
LeaveCriticalSection(&TIME_cbcrst);
|
LeaveCriticalSection(&TIME_cbcrst);
|
||||||
return TIMERR_NOERROR;
|
return TIMERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue