winmm: Allow calling joyReleaseCapture multiple times.

This commit is contained in:
Bruno Jesus 2014-12-11 02:53:36 -02:00 committed by Alexandre Julliard
parent 45f46bd359
commit 3db2e9113e
1 changed files with 8 additions and 5 deletions

View File

@ -279,11 +279,14 @@ MMRESULT WINAPI joyReleaseCapture(UINT wID)
if (wID >= MAXJOYSTICK) return JOYERR_PARMS;
if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER;
if (!JOY_Sticks[wID].hCapture) return JOYERR_NOCANDO;
KillTimer(JOY_Sticks[wID].hCapture, JOY_Sticks[wID].wTimer);
JOY_Sticks[wID].hCapture = 0;
JOY_Sticks[wID].wTimer = 0;
if (JOY_Sticks[wID].hCapture)
{
KillTimer(JOY_Sticks[wID].hCapture, JOY_Sticks[wID].wTimer);
JOY_Sticks[wID].hCapture = 0;
JOY_Sticks[wID].wTimer = 0;
}
else
TRACE("Joystick is not captured, ignoring request.\n");
return JOYERR_NOERROR;
}