Vitaliy Margolen : dinput: Return user set limits not the device limits.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 5 07:45:08 CST 2007


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

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Fri Feb  2 00:47:01 2007 -0700

dinput: Return user set limits not the device limits.

---

 dlls/dinput/joystick_linuxinput.c |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 9c05500..0011398 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -901,35 +901,32 @@ static HRESULT WINAPI JoystickAImpl_GetP
 						REFGUID rguid,
 						LPDIPROPHEADER pdiph)
 {
-  JoystickImpl *This = (JoystickImpl *)iface;
-
-  TRACE("(this=%p,%s,%p)\n",
-	iface, debugstr_guid(rguid), pdiph);
+    JoystickImpl *This = (JoystickImpl *)iface;
 
-  if (TRACE_ON(dinput))
+    TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph);
     _dump_DIPROPHEADER(pdiph);
 
-  if (!HIWORD(rguid)) {
+    if (HIWORD(rguid)) return DI_OK;
+
     switch (LOWORD(rguid)) {
-    case (DWORD) DIPROP_RANGE: {
-      LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph;
-      int obj = find_property(&This->base.data_format, pdiph);
+    case (DWORD) DIPROP_RANGE:
+    {
+        LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph;
+        int obj = find_property(&This->base.data_format, pdiph);
+
+        if (obj < 0) return DIERR_OBJECTNOTFOUND;
 
-      if (obj >= 0) {
-	pr->lMin = This->props[obj].havemin;
-	pr->lMax = This->props[obj].havemax;
+        pr->lMin = This->props[obj].wantmin;
+        pr->lMax = This->props[obj].wantmax;
 	TRACE("range(%d, %d) obj=%d\n", pr->lMin, pr->lMax, obj);
-      }
-      break;
+        break;
     }
 
     default:
       return IDirectInputDevice2AImpl_GetProperty(iface, rguid, pdiph);
     }
-  }
 
-
-  return DI_OK;
+    return DI_OK;
 }
 
 /******************************************************************************




More information about the wine-cvs mailing list