[1/6] winmm: Handle NULL parameter in joyGetPos/joyGetPosEx

Bruno Jesus 00cpxxx at gmail.com
Wed Dec 10 22:53:26 CST 2014


Tests for all the series are in the last patch, this was required to
simplify the amount of todo_wine, specially inside loops. Most tests
require a real supported joystick connected, when no joystick is
available only a few tests are executed.
-------------- next part --------------

---
 dlls/winmm/joystick.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c
index ddd556d..d4b500a 100644
--- a/dlls/winmm/joystick.c
+++ b/dlls/winmm/joystick.c
@@ -219,6 +219,7 @@ MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo)
 {
     TRACE("(%d, %p);\n", wID, lpInfo);
 
+    if (!lpInfo) return MMSYSERR_INVALPARAM;
     if (wID >= MAXJOYSTICK)	return JOYERR_PARMS;
     if (!JOY_LoadDriver(wID))	return MMSYSERR_NODRIVER;
 
@@ -244,6 +245,7 @@ MMRESULT WINAPI joyGetPos(UINT wID, LPJOYINFO lpInfo)
 {
     TRACE("(%d, %p);\n", wID, lpInfo);
 
+    if (!lpInfo) return MMSYSERR_INVALPARAM;
     if (wID >= MAXJOYSTICK)	return JOYERR_PARMS;
     if (!JOY_LoadDriver(wID))	return MMSYSERR_NODRIVER;
 
-- 
1.8.3.2



More information about the wine-patches mailing list