From 3db2e9113e5afbd9d68b373a27920e7dd9a07815 Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Thu, 11 Dec 2014 02:53:36 -0200 Subject: [PATCH] winmm: Allow calling joyReleaseCapture multiple times. --- dlls/winmm/joystick.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index d4b500a68c3..9c06fc26fd0 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -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; }