Lucas Fialho Zawacki : dinput: In BuildActionMap, don' t assign objects to actions mapped by an user.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 14:05:18 CDT 2011


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

Author: Lucas Fialho Zawacki <lfzawacki at gmail.com>
Date:   Tue Aug 23 23:42:51 2011 -0300

dinput: In BuildActionMap, don't assign objects to actions mapped by an user.

---

 dlls/dinput/device.c   |    3 +++
 dlls/dinput/joystick.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index a2412b8..d2de525 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -605,6 +605,9 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf,
 
     for (i=0; i < lpdiaf->dwNumActions; i++)
     {
+        /* Don't touch an user configured action */
+        if (lpdiaf->rgoAction[i].dwHow == DIAH_USERCONFIG) continue;
+
         if ((lpdiaf->rgoAction[i].dwSemantic & devMask) == devMask)
         {
             DWORD obj_id = semantic_to_obj_id(This, lpdiaf->rgoAction[i].dwSemantic);
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index c6bae98..779472d 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -445,6 +445,9 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
         DWORD type = 0x000000ff & (lpdiaf->rgoAction[i].dwSemantic >> 8);
         DWORD genre = 0xff000000 & lpdiaf->rgoAction[i].dwSemantic;
 
+        /* Don't touch an user configured action */
+        if (lpdiaf->rgoAction[i].dwHow == DIAH_USERCONFIG) continue;
+
         /* Only consider actions of the right genre */
         if (lpdiaf->dwGenre != genre && genre != DIGENRE_ANY) continue;
 




More information about the wine-cvs mailing list