Lucas Fialho Zawacki : dinput: Prevent EnumDevicesBySematics from enumerating keyboard and mouse as having force feedback .

Alexandre Julliard julliard at winehq.org
Mon Jul 11 13:17:49 CDT 2011


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

Author: Lucas Fialho Zawacki <lfzawacki at gmail.com>
Date:   Fri Jul  8 15:00:55 2011 -0300

dinput: Prevent EnumDevicesBySematics from enumerating keyboard and mouse as having force feedback.

---

 dlls/dinput/dinput_main.c   |    4 ++++
 dlls/dinput8/tests/device.c |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 207d559..0f84e7c 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -865,6 +865,8 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
 
     didevi.dwSize = sizeof(didevi);
 
+    if (dwFlags & DIEDBSFL_FORCEFEEDBACK) return DI_OK;
+
     /* Enumerate keyboard and mouse */
     for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++)
     {
@@ -903,6 +905,8 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
 
     didevi.dwSize = sizeof(didevi);
 
+    if (dwFlags & DIEDBSFL_FORCEFEEDBACK) return DI_OK;
+
     /* Enumerate keyboard and mouse */
     for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++)
     {
diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
index e86e0d8..94b1f2d 100644
--- a/dlls/dinput8/tests/device.c
+++ b/dlls/dinput8/tests/device.c
@@ -263,8 +263,8 @@ static void test_action_mapping(void)
     count.mouse = NULL;
     hr = IDirectInput8_EnumDevicesBySemantics(pDI, 0, &af, counting_callback, &count, DIEDBSFL_FORCEFEEDBACK);
     ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
-    todo_wine ok (count.keyboard == NULL, "Keyboard should not be enumerated when asking for forcefeedback\n");
-    todo_wine ok (count.mouse == NULL, "Mouse should not be enumerated when asking for forcefeedback\n");
+    ok (count.keyboard == NULL, "Keyboard should not be enumerated when asking for forcefeedback\n");
+    ok (count.mouse == NULL, "Mouse should not be enumerated when asking for forcefeedback\n");
 
     /* Enumerate available devices. That is devices with not owned by any user.
        Before setting the action map for all devices we still have them available.




More information about the wine-cvs mailing list