Module: wine Branch: master Commit: c04319e5a09dc2b2e85beeada1c4bf5bc31b8519 URL: https://gitlab.winehq.org/wine/wine/-/commit/c04319e5a09dc2b2e85beeada1c4bf5...
Author: Florian Will florian.will@gmail.com Date: Sun Apr 2 00:10:34 2023 +0200
dinput/tests: Add EnumObjects callback return value test.
---
dlls/dinput/tests/device8.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index ea0ec8db837..128fb2992f6 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -991,6 +991,13 @@ static BOOL CALLBACK check_object_count( const DIDEVICEOBJECTINSTANCEW *obj, voi return DIENUM_CONTINUE; }
+static BOOL CALLBACK check_object_count_bad_retval( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) +{ + DWORD *count = args; + *count = *count + 1; + return -1; /* Invalid, but should CONTINUE. Only explicit DIENUM_STOP will stop enumeration. */ +} + static void test_sys_mouse( DWORD version ) { const DIDEVCAPS expect_caps = @@ -1336,6 +1343,11 @@ static void test_sys_mouse( DWORD version ) ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n", check_objects_params.expect_count - check_objects_params.index );
+ res = 0; + hr = IDirectInputDevice8_EnumObjects( device, check_object_count_bad_retval, &res, DIDFT_AXIS ); + ok( hr == DI_OK, "EnumObjects returned %#lx\n", hr ); + todo_wine ok( res == 3, "got %lu expected 3\n", res ); + objinst.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW); res = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );