=?UTF-8?Q?R=C3=A9mi=20Bernon=20?=: dinput/tests: Add test to validate interactions between dinput and raw input devices.

Alexandre Julliard julliard at winehq.org
Tue Aug 27 15:28:16 CDT 2019


Module: wine
Branch: master
Commit: d7916cdf4f8f8cbed7225cfdd0e37c566c9b1eff
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d7916cdf4f8f8cbed7225cfdd0e37c566c9b1eff

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Aug 26 16:06:55 2019 +0200

dinput/tests: Add test to validate interactions between dinput and raw input devices.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/tests/keyboard.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/dlls/dinput/tests/keyboard.c b/dlls/dinput/tests/keyboard.c
index d6ab5b5..0e399f0 100644
--- a/dlls/dinput/tests/keyboard.c
+++ b/dlls/dinput/tests/keyboard.c
@@ -93,6 +93,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
         };
     DIDATAFORMAT df;
     HKL hkl, hkl_orig;
+    UINT prev_raw_devices_count, raw_devices_count;
 
     hkl = activate_keyboard_layout(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), &hkl_orig);
     if (!hkl) return;
@@ -165,6 +166,22 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
     }
     keybd_event('Q', 0, KEYEVENTF_KEYUP, 0);
 
+    prev_raw_devices_count = 0;
+    GetRegisteredRawInputDevices(NULL, &prev_raw_devices_count, sizeof(RAWINPUTDEVICE));
+    ok(prev_raw_devices_count == 0 || broken(prev_raw_devices_count == 1) /* wxppro, w2003std */,
+       "Unexpected raw devices registered: %d\n", prev_raw_devices_count);
+
+    hr = IDirectInputDevice_Acquire(pKeyboard);
+    ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %08x\n", hr);
+
+    raw_devices_count = 0;
+    GetRegisteredRawInputDevices(NULL, &raw_devices_count, sizeof(RAWINPUTDEVICE));
+    ok(raw_devices_count == prev_raw_devices_count,
+       "Unexpected raw devices registered: %d\n", raw_devices_count);
+
+    hr = IDirectInputDevice_Unacquire(pKeyboard);
+    ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr);
+
     if (pKeyboard) IUnknown_Release(pKeyboard);
 
     ActivateKeyboardLayout(hkl_orig, 0);




More information about the wine-cvs mailing list