[3/5] dinput: Prevent EnumDevicesBySematics from enumerating keyboard and mouse as having force feedback

Lucas Fialho Zawacki lfzawacki at gmail.com
Fri Jul 8 13:00:55 CDT 2011


---
 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 6212cf6..1f16bb4 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.
-- 
1.7.0.4



More information about the wine-patches mailing list