[3/5] dinput: In BuildActionMap, don't assign objects to actions mapped by an user

Lucas Fialho Zawacki lfzawacki at gmail.com
Tue Aug 23 21:42:51 CDT 2011


From: Lucas Fialho Zawacki <lfzawacki at gmail.com>

---
 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;
 
-- 
1.7.0.4



More information about the wine-patches mailing list