Bruno Jesus : winmm: Allow calling joyReleaseCapture multiple times.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 11 15:22:15 CST 2014


Module: wine
Branch: master
Commit: 3db2e9113e5afbd9d68b373a27920e7dd9a07815
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3db2e9113e5afbd9d68b373a27920e7dd9a07815

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Thu Dec 11 02:53:36 2014 -0200

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 d4b500a..9c06fc2 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;
 }




More information about the wine-cvs mailing list