[DINPUT_WINETEST] Sync with Wine Staging 4.0. CORE-15682
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 25 Jan 2019 12:11:40 +0000 (13:11 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 25 Jan 2019 12:11:40 +0000 (13:11 +0100)
modules/rostests/winetests/dinput/dinput.c
modules/rostests/winetests/dinput/keyboard.c

index 7e2da9f..cb72689 100644 (file)
@@ -392,6 +392,16 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo
 {
     struct enum_devices_test *enum_test = context;
 
+    if ((instance->dwDevType & 0xff) == DIDEVTYPE_KEYBOARD ||
+           (instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE) {
+        const char *device = ((instance->dwDevType & 0xff) ==
+                                   DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
+        ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct),
+           "%s guidInstance (%s) does not match guidProduct (%s)\n",
+           device, wine_dbgstr_guid(&instance->guidInstance),
+           wine_dbgstr_guid(&instance->guidProduct));
+    }
+
     enum_test->device_count++;
     return enum_test->return_value;
 }
index 8ee22fa..e8dfb4f 100644 (file)
@@ -411,6 +411,8 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid)
 
         if (!PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE))
         {
+            U(in).ki.dwFlags = KEYEVENTF_KEYUP;
+            SendInput(1, &in, sizeof(in));
             win_skip("failed to queue keyboard event\n");
             break;
         }
@@ -471,6 +473,7 @@ static void keyboard_tests(DWORD version)
     hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200,
                          NULL, NULL, NULL, NULL);
     ok(hwnd != NULL, "err: %d\n", GetLastError());
+    SetForegroundWindow( hwnd );
 
     if (hwnd)
     {