These tests ensure the Instance GUID and Product GUIDs are the same for keyboard and mouse.
Signed-off-by: Brendan McGrath brendan@redmandi.com --- Changes since v4: - Add todo_wine in 1/2 - Remove todo_wine in 2/2
dlls/dinput/tests/dinput.c | 14 ++++++++++++++ dlls/dinput8/tests/dinput.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/dlls/dinput/tests/dinput.c b/dlls/dinput/tests/dinput.c index 7e2da9ff32d..650252ba09d 100644 --- a/dlls/dinput/tests/dinput.c +++ b/dlls/dinput/tests/dinput.c @@ -392,6 +392,20 @@ 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"; + int cmp = memcmp(&instance->guidInstance, + &instance->guidProduct, + sizeof(instance->guidInstance)); + todo_wine + ok(cmp == 0, "%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; } diff --git a/dlls/dinput8/tests/dinput.c b/dlls/dinput8/tests/dinput.c index b093437096d..9d342dee3dd 100644 --- a/dlls/dinput8/tests/dinput.c +++ b/dlls/dinput8/tests/dinput.c @@ -377,6 +377,20 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo instance->wUsagePage, instance->wUsage);
+ if ((instance->dwDevType & 0xff) == DI8DEVTYPE_KEYBOARD || + (instance->dwDevType & 0xff) == DI8DEVTYPE_MOUSE) { + const char *device = ((instance->dwDevType & 0xff) == + DI8DEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse"; + int cmp = memcmp(&instance->guidInstance, + &instance->guidProduct, + sizeof(instance->guidInstance)); + todo_wine + ok(cmp == 0, "%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; }