Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51784 Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
The first two patches aren't really solving the mentionned bug but they should help. At least they prevent this series from overflowing.
dlls/dinput8/tests/hid.c | 498 +++++++++++++++++++-------------------- 1 file changed, 249 insertions(+), 249 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index f4e180a85f3..466331b326b 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3735,7 +3735,7 @@ static void test_simple_joystick(void) }
hr = IDirectInput8_EnumDevices( di, DI8DEVCLASS_ALL, find_test_device, &devinst, DIEDFL_ALLDEVICES ); - ok( hr == DI_OK, "IDirectInput8_EnumDevices returned: %#x\n", hr ); + ok( hr == DI_OK, "EnumDevices returned: %#x\n", hr ); if (!IsEqualGUID( &devinst.guidProduct, &expect_guid_product )) { win_skip( "device not found, skipping tests\n" ); @@ -3755,62 +3755,62 @@ static void test_simple_joystick(void) check_member( devinst, expect_devinst, "%04x", wUsage );
hr = IDirectInput8_CreateDevice( di, &devinst.guidInstance, NULL, NULL ); - ok( hr == E_POINTER, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == E_POINTER, "CreateDevice returned %#x\n", hr ); hr = IDirectInput8_CreateDevice( di, NULL, &device, NULL ); - ok( hr == E_POINTER, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == E_POINTER, "CreateDevice returned %#x\n", hr ); hr = IDirectInput8_CreateDevice( di, &GUID_NULL, &device, NULL ); - ok( hr == DIERR_DEVICENOTREG, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == DIERR_DEVICENOTREG, "CreateDevice returned %#x\n", hr ); hr = IDirectInput8_CreateDevice( di, &devinst.guidInstance, &device, NULL ); - ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_VIDPID returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_VIDPID returned %#x\n", hr ); /* Wine may get the wrong device here, because the test driver creates another instance of hidclass.sys, and gets duplicate rawinput handles, which we use in the guidInstance */ todo_wine_if( prop_dword.dwData != EXPECT_VIDPID ) ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n", prop_dword.dwData, EXPECT_VIDPID );
ref = IDirectInputDevice8_Release( device ); - ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
hr = IDirectInput8_CreateDevice( di, &expect_guid_product, &device, NULL ); - ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, instance, 0x0700, &GUID_NULL ); todo_wine - ok( hr == DIERR_BETADIRECTINPUTVERSION, "IDirectInputDevice8_Initialize returned %#x\n", hr ); + ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr ); hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, NULL ); todo_wine - ok( hr == E_POINTER, "IDirectInputDevice8_Initialize returned %#x\n", hr ); + ok( hr == E_POINTER, "Initialize returned %#x\n", hr ); hr = IDirectInputDevice8_Initialize( device, NULL, DIRECTINPUT_VERSION, &GUID_NULL ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_Initialize returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr ); hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &GUID_NULL ); todo_wine - ok( hr == REGDB_E_CLASSNOTREG, "IDirectInputDevice8_Initialize returned %#x\n", hr ); + ok( hr == REGDB_E_CLASSNOTREG, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidInstance ); - ok( hr == DI_OK, "IDirectInputDevice8_Initialize returned %#x\n", hr ); + ok( hr == DI_OK, "Initialize returned %#x\n", hr ); guid = devinst.guidInstance; memset( &devinst, 0, sizeof(devinst) ); devinst.dwSize = sizeof(DIDEVICEINSTANCEW); hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr ); ok( IsEqualGUID( &guid, &devinst.guidInstance ), "got %s expected %s\n", debugstr_guid( &guid ), debugstr_guid( &devinst.guidInstance ) ); hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidProduct ); - ok( hr == DI_OK, "IDirectInputDevice8_Initialize returned %#x\n", hr ); + ok( hr == DI_OK, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, NULL ); - ok( hr == E_POINTER, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == E_POINTER, "GetDeviceInfo returned %#x\n", hr ); devinst.dwSize = sizeof(DIDEVICEINSTANCEW) + 1; hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetDeviceInfo returned %#x\n", hr );
devinst.dwSize = sizeof(DIDEVICEINSTANCE_DX3W); hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr ); todo_wine check_member_guid( devinst, expect_devinst, guidInstance ); check_member_guid( devinst, expect_devinst, guidProduct ); @@ -3823,7 +3823,7 @@ static void test_simple_joystick(void) memset( &devinst, 0, sizeof(devinst) ); devinst.dwSize = sizeof(DIDEVICEINSTANCEW); hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr ); check_member( devinst, expect_devinst, "%d", dwSize ); todo_wine check_member_guid( devinst, expect_devinst, guidInstance ); @@ -3838,13 +3838,13 @@ static void test_simple_joystick(void) check_member( devinst, expect_devinst, "%04x", wUsage );
hr = IDirectInputDevice8_GetCapabilities( device, NULL ); - ok( hr == E_POINTER, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr ); + ok( hr == E_POINTER, "GetCapabilities returned %#x\n", hr ); hr = IDirectInputDevice8_GetCapabilities( device, &caps ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetCapabilities returned %#x\n", hr ); caps.dwSize = sizeof(DIDEVCAPS); hr = IDirectInputDevice8_GetCapabilities( device, &caps ); - ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr ); + ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr ); check_member( caps, expect_caps, "%d", dwSize ); check_member( caps, expect_caps, "%#x", dwFlags ); check_member( caps, expect_caps, "%#x", dwDevType ); @@ -3858,25 +3858,25 @@ static void test_simple_joystick(void) check_member( caps, expect_caps, "%d", dwFFDriverVersion );
hr = IDirectInputDevice8_GetProperty( device, NULL, NULL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, &GUID_NULL, NULL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, NULL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_string.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr ); prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER) - 1; hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr ); prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER);
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_VIDPID returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_VIDPID returned %#x\n", hr ); ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n", prop_dword.dwData, EXPECT_VIDPID );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr ); todo_wine ok( IsEqualGUID( &prop_guid_path.guidClass, &GUID_DEVCLASS_HIDCLASS ), "got guid %s\n", debugstr_guid( &prop_guid_path.guidClass ) ); @@ -3892,77 +3892,77 @@ static void test_simple_joystick(void) }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_INSTANCENAME returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_INSTANCENAME returned %#x\n", hr ); todo_wine ok( !wcscmp( prop_string.wsz, expect_devinst.tszInstanceName ), "got instance %s\n", debugstr_w(prop_string.wsz) ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); todo_wine ok( !wcscmp( prop_string.wsz, expect_devinst.tszProductName ), "got product %s\n", debugstr_w(prop_string.wsz) ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_TYPENAME returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_TYPENAME returned %#x\n", hr ); todo_wine ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph ); - ok( hr == S_FALSE, "IDirectInputDevice8_GetProperty DIPROP_USERNAME returned %#x\n", hr ); + ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr ); todo_wine ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_JOYSTICKID returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_JOYSTICKID returned %#x\n", hr ); todo_wine ok( prop_dword.dwData == 0, "got %#x expected %#x\n", prop_dword.dwData, 0 );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_AXISMODE, &prop_dword.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_AXISMODE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_AXISMODE returned %#x\n", hr ); todo_wine ok( prop_dword.dwData == DIPROPAXISMODE_ABS, "got %u expected %u\n", prop_dword.dwData, DIPROPAXISMODE_ABS ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); ok( prop_dword.dwData == 0, "got %#x expected %#x\n", prop_dword.dwData, 0 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFGAIN, &prop_dword.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_FFGAIN returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_FFGAIN returned %#x\n", hr ); todo_wine ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty DIPROP_CALIBRATION returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_CALIBRATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); todo_wine - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( prop_dword.dwData == 0, "got %u expected %u\n", prop_dword.dwData, 0 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( prop_dword.dwData == 1, "got %u expected %u\n", prop_dword.dwData, 1 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
prop_range.diph.dwHow = DIPH_BYUSAGE; @@ -3970,18 +3970,18 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_X ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( prop_range.lMin == 0, "got %d expected %d\n", prop_range.lMin, 0 ); ok( prop_range.lMax == 65535, "got %d expected %d\n", prop_range.lMax, 65535 );
@@ -3989,35 +3989,35 @@ static void test_simple_joystick(void) prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph ); todo_wine - ok( hr == DIERR_NOTINITIALIZED, "IDirectInputDevice8_GetProperty DIPROP_APPDATA returned %#x\n", hr ); + ok( hr == DIERR_NOTINITIALIZED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
hr = IDirectInputDevice8_EnumObjects( device, NULL, NULL, DIDFT_ALL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "EnumObjects returned %#x\n", hr ); hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, 0x20 ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "EnumObjects returned %#x\n", hr ); res = 0; hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumObjects returned %#x\n", hr ); ok( res == 5, "got %u expected %u\n", res, 5 ); hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumObjects returned %#x\n", hr ); ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n", check_objects_params.expect_count - check_objects_params.index );
hr = IDirectInputDevice8_GetObjectInfo( device, NULL, 0, DIPH_DEVICE ); - ok( hr == E_POINTER, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == E_POINTER, "GetObjectInfo returned: %#x\n", hr ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0, DIPH_DEVICE ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetObjectInfo returned: %#x\n", hr ); objinst.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0, DIPH_DEVICE ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetObjectInfo returned: %#x\n", hr );
res = MAKELONG( HID_USAGE_GENERIC_Z, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr ); res = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE ); - ok( hr == DI_OK, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
check_member( objinst, expect_objects[1], "%u", dwSize ); check_member_guid( objinst, expect_objects[1], guidType ); @@ -4036,15 +4036,15 @@ static void test_simple_joystick(void) check_member( objinst, expect_objects[1], "%u", wReportId );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0x14, DIPH_BYOFFSET ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0, DIPH_BYOFFSET ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr ); res = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( 3 ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYID ); - ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr ); res = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( 1 ); hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYID ); - ok( hr == DI_OK, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
check_member( objinst, expect_objects[5], "%u", dwSize ); check_member_guid( objinst, expect_objects[5], guidType ); @@ -4063,46 +4063,46 @@ static void test_simple_joystick(void) check_member( objinst, expect_objects[5], "%u", wReportId );
hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "EnumEffects returned %#x\n", hr ); res = 0; hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, 0xfe ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( res == 0, "got %u expected %u\n", res, 0 ); res = 0; hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, DIEFT_PERIODIC ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( res == 0, "got %u expected %u\n", res, 0 ); hr = IDirectInputDevice8_EnumEffects( device, check_effects, &check_effects_params, DIEFT_ALL ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n", check_effects_params.expect_count - check_effects_params.index );
hr = IDirectInputDevice8_GetEffectInfo( device, NULL, &GUID_Sine ); - ok( hr == E_POINTER, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); + ok( hr == E_POINTER, "GetEffectInfo returned %#x\n", hr ); effectinfo.dwSize = sizeof(DIEFFECTINFOW) + 1; hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetEffectInfo returned %#x\n", hr ); effectinfo.dwSize = sizeof(DIEFFECTINFOW); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_NULL ); - ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); + ok( hr == DIERR_DEVICENOTREG, "GetEffectInfo returned %#x\n", hr ); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); - ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); + ok( hr == DIERR_DEVICENOTREG, "GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, NULL ); - ok( hr == E_POINTER, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); + ok( hr == E_POINTER, "SetDataFormat returned: %#x\n", hr ); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr ); dataformat.dwSize = sizeof(DIDATAFORMAT); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr ); dataformat.dwObjSize = sizeof(DIOBJECTDATAFORMAT); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); - ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); + ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr ); hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 ); - ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); + ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, DIJOFS_Y, DIPH_BYOFFSET ); - ok( hr == DI_OK, "IDirectInputDevice8_GetObjectInfo returned: %#x\n", hr ); + ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
check_member( objinst, expect_objects[0], "%u", dwSize ); check_member_guid( objinst, expect_objects[0], guidType ); @@ -4122,71 +4122,71 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_SetEventNotification( device, (HANDLE)0xdeadbeef ); todo_wine - ok( hr == E_HANDLE, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr ); + ok( hr == E_HANDLE, "SetEventNotification returned: %#x\n", hr ); event = CreateEventW( NULL, FALSE, FALSE, NULL ); ok( event != NULL, "CreateEventW failed, last error %u\n", GetLastError() ); hr = IDirectInputDevice8_SetEventNotification( device, event ); - ok( hr == DI_OK, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr ); + ok( hr == DI_OK, "SetEventNotification returned: %#x\n", hr );
file = CreateFileW( prop_guid_path.wszPath, FILE_READ_ACCESS | FILE_WRITE_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); ok( file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError() );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, 0 ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE ); - ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == E_HANDLE, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_EXCLUSIVE ); - ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == E_HANDLE, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_FOREGROUND | DISCL_EXCLUSIVE ); - ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == E_HANDLE, "SetCooperativeLevel returned: %#x\n", hr );
hwnd = CreateWindowW( L"static", L"dinput", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200, NULL, NULL, NULL, NULL );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE ); - ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE ); - ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE ); - ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_NOEFFECT, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_NOEFFECT, "Unacquire returned: %#x\n", hr ); hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE ); - ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DIERR_ACQUIRED, "SetCooperativeLevel returned: %#x\n", hr ); hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
DestroyWindow( hwnd );
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE ); - ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DIERR_NOTACQUIRED, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DIERR_NOTACQUIRED, "GetDeviceState returned: %#x\n", hr );
hr = IDirectInputDevice8_Poll( device ); - ok( hr == DIERR_NOTACQUIRED, "IDirectInputDevice8_Poll returned: %#x\n", hr ); + ok( hr == DIERR_NOTACQUIRED, "Poll returned: %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
hr = IDirectInputDevice8_Poll( device ); - ok( hr == DI_NOEFFECT, "IDirectInputDevice8_Poll returned: %#x\n", hr ); + ok( hr == DI_NOEFFECT, "Poll returned: %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2) + 1, &state ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetDeviceState returned: %#x\n", hr );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i) { winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); check_member( state, expect_state[i], "%d", lX ); check_member( state, expect_state[i], "%d", lY ); check_member( state, expect_state[i], "%d", lZ ); @@ -4207,7 +4207,7 @@ static void test_simple_joystick(void) }
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); check_member( state, expect_state[i], "%d", lX ); check_member( state, expect_state[i], "%d", lY ); @@ -4223,24 +4223,24 @@ static void test_simple_joystick(void) res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA) - 1, objdata, &res, DIGDD_PEEK ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "GetDeviceData returned %#x\n", hr ); res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); - ok( hr == DIERR_NOTBUFFERED, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DIERR_NOTBUFFERED, "GetDeviceData returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwObj = 0; prop_dword.dwData = 1; hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr ); ok( res == 0, "got %u expected %u\n", res, 0 );
send_hid_input( file, &injected_input[0], sizeof(*injected_input) ); @@ -4250,23 +4250,23 @@ static void test_simple_joystick(void)
res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); - ok( hr == DI_BUFFEROVERFLOW, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr ); ok( res == 0, "got %u expected %u\n", res, 0 ); res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr ); ok( res == 0, "got %u expected %u\n", res, 0 );
hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwObj = 0; prop_dword.dwData = 10; hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
send_hid_input( file, &injected_input[1], sizeof(*injected_input) ); res = WaitForSingleObject( event, 100 ); @@ -4275,14 +4275,14 @@ static void test_simple_joystick(void)
res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr ); ok( res == 1, "got %u expected %u\n", res, 1 ); check_member( objdata[0], expect_objdata[0], "%#x", dwOfs ); check_member( objdata[0], expect_objdata[0], "%#x", dwData ); ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 ); res = 4; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr ); ok( res == 4, "got %u expected %u\n", res, 4 ); for (i = 0; i < 4; ++i) { @@ -4304,7 +4304,7 @@ static void test_simple_joystick(void)
res = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); - ok( hr == DI_BUFFEROVERFLOW, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr ); ok( res == 1, "got %u expected %u\n", res, 1 ); todo_wine check_member( objdata[0], expect_objdata[5], "%#x", dwOfs ); @@ -4313,7 +4313,7 @@ static void test_simple_joystick(void) ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 ); res = ARRAY_SIZE(objdata); hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceData returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr ); ok( res == 8, "got %u expected %u\n", res, 8 ); for (i = 0; i < 8; ++i) { @@ -4332,7 +4332,7 @@ static void test_simple_joystick(void) ResetEvent( event );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); check_member( state, expect_state[3], "%d", lX ); check_member( state, expect_state[3], "%d", lY ); check_member( state, expect_state[3], "%d", lZ ); @@ -4348,30 +4348,30 @@ static void test_simple_joystick(void) prop_range.lMin = 1000; prop_range.lMax = 51000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwHow = DIPH_BYUSAGE; prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_range.lMin = -4000; prop_range.lMax = -14000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.lMin = -14000; prop_range.lMax = -4000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_DEVICE; prop_range.diph.dwObj = 0; prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwHow = DIPH_BYUSAGE; prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( prop_range.lMin == -14000, "got %d expected %d\n", prop_range.lMin, -14000 ); ok( prop_range.lMax == -4000, "got %d expected %d\n", prop_range.lMax, -4000 ); prop_range.diph.dwHow = DIPH_BYUSAGE; @@ -4379,12 +4379,12 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( prop_range.lMin == 1000, "got %d expected %d\n", prop_range.lMin, 1000 ); ok( prop_range.lMax == 51000, "got %d expected %d\n", prop_range.lMax, 51000 );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); check_member( state, expect_state_abs[1], "%d", lX ); check_member( state, expect_state_abs[1], "%d", lY ); check_member( state, expect_state_abs[1], "%d", lZ ); @@ -4396,118 +4396,118 @@ static void test_simple_joystick(void) check_member( state, expect_state_abs[1], "%#x", rgbButtons[2] );
hr = IDirectInputDevice8_SetProperty( device, NULL, NULL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, &GUID_NULL, NULL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, NULL ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_string.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwObj = 0; prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_dword.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_VIDPID returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_VIDPID returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_GUIDANDPATH returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
prop_string.diph.dwHow = DIPH_DEVICE; prop_string.diph.dwObj = 0; wcscpy( prop_string.wsz, L"instance name" ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SetProperty DIPROP_INSTANCENAME returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
wcscpy( prop_string.wsz, L"product name" ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); todo_wine ok( !wcscmp( prop_string.wsz, expect_devinst.tszProductName ), "got product %s\n", debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_TYPENAME, &prop_string.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_TYPENAME returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_TYPENAME returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_USERNAME, &prop_string.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_USERNAME returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_USERNAME returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_FFLOAD returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_FFLOAD returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_GRANULARITY returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_GRANULARITY returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph ); todo_wine - ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_JOYSTICKID returned %#x\n", hr ); + ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_JOYSTICKID returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph ); - ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_AXISMODE returned %#x\n", hr ); + ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_AXISMODE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); - ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); + ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); prop_pointer.diph.dwHow = DIPH_BYUSAGE; prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph ); todo_wine - ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_APPDATA returned %#x\n", hr ); + ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwObj = 0; prop_dword.dwData = 10001; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_DEADZONE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_SATURATION returned %#x\n", hr ); prop_dword.dwData = 1000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_DEADZONE returned %#x\n", hr ); prop_dword.dwData = 6000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 2000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( prop_dword.dwData == 2000, "got %u expected %u\n", prop_dword.dwData, 2000 ); prop_dword.dwData = 7000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( prop_dword.dwData == 2000, "got %u expected %u\n", prop_dword.dwData, 2000 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( prop_dword.dwData == 7000, "got %u expected %u\n", prop_dword.dwData, 7000 );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_Y, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( prop_dword.dwData == 1000, "got %u expected %u\n", prop_dword.dwData, 1000 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( prop_dword.dwData == 6000, "got %u expected %u\n", prop_dword.dwData, 6000 );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i) { winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" ); else { @@ -4532,7 +4532,7 @@ static void test_simple_joystick(void) }
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); check_member( state, expect_state_abs[i], "%d", lX ); check_member( state, expect_state_abs[i], "%d", lY ); @@ -4546,56 +4546,56 @@ static void test_simple_joystick(void) winetest_pop_context();
hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwObj = 0; hr = IDirectInputDevice8_SetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SetProperty DIPROP_JOYSTICKID returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_JOYSTICKID returned %#x\n", hr ); prop_dword.dwData = 0x1000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); prop_dword.dwData = DIPROPAUTOCENTER_ON; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); prop_pointer.diph.dwHow = DIPH_BYUSAGE; prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_pointer.uData = 0xfeedcafe; hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_APPDATA returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_AXISMODE returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_AXISMODE returned %#x\n", hr ); prop_dword.dwData = DIPROPAXISMODE_REL; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_AXISMODE returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_AXISMODE returned %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_AXISMODE, &prop_dword.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_AXISMODE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_AXISMODE returned %#x\n", hr ); todo_wine ok( prop_dword.dwData == DIPROPAXISMODE_REL, "got %u expected %u\n", prop_dword.dwData, DIPROPAXISMODE_REL );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); ok( prop_dword.dwData == 0x1000, "got %#x expected %#x\n", prop_dword.dwData, 0x1000 );
prop_pointer.diph.dwHow = DIPH_BYUSAGE; prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_APPDATA returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_APPDATA returned %#x\n", hr ); ok( prop_pointer.uData == 0xfeedcafe, "got %p expected %p\n", (void *)prop_pointer.uData, (void *)0xfeedcafe );
prop_dword.diph.dwHow = DIPH_DEVICE; @@ -4603,28 +4603,28 @@ static void test_simple_joystick(void) prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_FFGAIN returned %#x\n", hr ); prop_dword.dwData = 1000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_FFGAIN returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_CALIBRATION returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_CALIBRATION returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_DEADZONE returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_SATURATION returned %#x\n", hr );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i) { winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); todo_wine check_member( state, expect_state_rel[i], "%d", lX ); todo_wine @@ -4648,7 +4648,7 @@ static void test_simple_joystick(void) }
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); todo_wine check_member( state, expect_state_rel[i], "%d", lX ); @@ -4665,63 +4665,63 @@ static void test_simple_joystick(void) winetest_pop_context();
hr = IDirectInputDevice8_GetForceFeedbackState( device, NULL ); - ok( hr == E_POINTER, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); + ok( hr == E_POINTER, "GetForceFeedbackState returned %#x\n", hr ); res = 0xdeadbeef; hr = IDirectInputDevice8_GetForceFeedbackState( device, &res ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "SendForceFeedbackCommand returned %#x\n", hr );
objdata[0].dwOfs = 0xd; objdata[0].dwData = 0x80; res = 1; hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0xdeadbeef ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr ); res = 1; hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 1 /*DISDD_CONTINUE*/ ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr ); res = 1; hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL ); - ok( hr == E_POINTER, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr ); hr = IDirectInputDevice8_CreateEffect( device, NULL, NULL, &effect, NULL ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr ); hr = IDirectInputDevice8_CreateEffect( device, &GUID_NULL, NULL, &effect, NULL ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr ); hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL ); - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "CreateEffect returned %#x\n", hr );
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, NULL, effect, 0 ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "EnumCreatedEffectObjects returned %#x\n", hr ); hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_no_created_effect_objects, effect, 0xdeadbeef ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "EnumCreatedEffectObjects returned %#x\n", hr ); hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_no_created_effect_objects, (void *)0xdeadbeef, 0 ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumCreatedEffectObjects returned %#x\n", hr );
hr = IDirectInputDevice8_Escape( device, NULL ); todo_wine - ok( hr == E_POINTER, "IDirectInputDevice8_Escape returned: %#x\n", hr ); + ok( hr == E_POINTER, "Escape returned: %#x\n", hr ); hr = IDirectInputDevice8_Escape( device, &escape ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_Escape returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "Escape returned: %#x\n", hr ); escape.dwSize = sizeof(DIEFFESCAPE) + 1; hr = IDirectInputDevice8_Escape( device, &escape ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_Escape returned: %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "Escape returned: %#x\n", hr ); escape.dwSize = sizeof(DIEFFESCAPE); escape.dwCommand = 0; escape.lpvInBuffer = buffer; @@ -4730,19 +4730,19 @@ static void test_simple_joystick(void) escape.cbOutBuffer = 10; hr = IDirectInputDevice8_Escape( device, &escape ); todo_wine - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_Escape returned: %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "Escape returned: %#x\n", hr );
/* FIXME: we have to wait a bit because Wine DInput internal thread keeps a reference */ Sleep( 100 );
ref = IDirectInputDevice8_Release( device ); - ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
CloseHandle( event ); CloseHandle( file );
ref = IDirectInput8_Release( di ); - ok( ref == 0, "IDirectInput8_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
done: pnp_driver_stop(); @@ -5030,7 +5030,7 @@ static BOOL test_device_types(void) }
hr = IDirectInput8_EnumDevices( di, DI8DEVCLASS_ALL, find_test_device, &devinst, DIEDFL_ALLDEVICES ); - ok( hr == DI_OK, "IDirectInput8_EnumDevices returned: %#x\n", hr ); + ok( hr == DI_OK, "EnumDevices returned: %#x\n", hr ); if (!IsEqualGUID( &devinst.guidProduct, &expect_guid_product )) { win_skip( "device not found, skipping tests\n" ); @@ -5040,10 +5040,10 @@ static BOOL test_device_types(void) }
hr = IDirectInput8_CreateDevice( di, &expect_guid_product, &device, NULL ); - ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr ); check_member( devinst, expect_devinst[i], "%d", dwSize ); todo_wine check_member_guid( devinst, expect_devinst[i], guidInstance ); @@ -5058,7 +5058,7 @@ static BOOL test_device_types(void) check_member( devinst, expect_devinst[i], "%04x", wUsage );
hr = IDirectInputDevice8_GetCapabilities( device, &caps ); - ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr ); + ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr ); check_member( caps, expect_caps[i], "%d", dwSize ); check_member( caps, expect_caps[i], "%#x", dwFlags ); check_member( caps, expect_caps[i], "%#x", dwDevType ); @@ -5072,10 +5072,10 @@ static BOOL test_device_types(void) check_member( caps, expect_caps[i], "%d", dwFFDriverVersion );
ref = IDirectInputDevice8_Release( device ); - ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
ref = IDirectInput8_Release( di ); - ok( ref == 0, "IDirectInput8_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
done: pnp_driver_stop(); @@ -5095,29 +5095,29 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ULONG ref;
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL ); - ok( hr == E_POINTER, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr ); hr = IDirectInputDevice8_CreateEffect( device, NULL, NULL, &effect, NULL ); todo_wine - ok( hr == E_POINTER, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr ); if (hr == DI_OK) IDirectInputEffect_Release( effect ); hr = IDirectInputDevice8_CreateEffect( device, &GUID_NULL, NULL, &effect, NULL ); todo_wine - ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == DIERR_DEVICENOTREG, "CreateEffect returned %#x\n", hr ); if (hr == DI_OK) IDirectInputEffect_Release( effect );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL ); - ok( hr == DI_OK, "IDirectInputDevice8_CreateEffect returned %#x\n", hr ); + ok( hr == DI_OK, "CreateEffect returned %#x\n", hr ); if (hr != DI_OK) return;
hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_no_created_effect_objects, effect, 0xdeadbeef ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "EnumCreatedEffectObjects returned %#x\n", hr ); check_params.expect_effect = effect; hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_created_effect_objects, &check_params, 0 ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumCreatedEffectObjects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumCreatedEffectObjects returned %#x\n", hr ); ok( check_params.count == 1, "got count %u, expected 1\n", check_params.count );
ref = IDirectInputEffect_Release( effect ); - ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref ); }
static void test_force_feedback_joystick( void ) @@ -5664,7 +5664,7 @@ static void test_force_feedback_joystick( void ) }
hr = IDirectInput8_EnumDevices( di, DI8DEVCLASS_ALL, find_test_device, &devinst, DIEDFL_ALLDEVICES ); - ok( hr == DI_OK, "IDirectInput8_EnumDevices returned: %#x\n", hr ); + ok( hr == DI_OK, "EnumDevices returned: %#x\n", hr ); if (!IsEqualGUID( &devinst.guidProduct, &expect_guid_product )) { win_skip( "device not found, skipping tests\n" ); @@ -5673,10 +5673,10 @@ static void test_force_feedback_joystick( void ) }
hr = IDirectInput8_CreateDevice( di, &expect_guid_product, &device, NULL ); - ok( hr == DI_OK, "IDirectInput8_CreateDevice returned %#x\n", hr ); + ok( hr == DI_OK, "CreateDevice returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst ); - ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceInfo returned %#x\n", hr ); + ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr ); check_member( devinst, expect_devinst, "%d", dwSize ); todo_wine check_member_guid( devinst, expect_devinst, guidInstance ); @@ -5692,7 +5692,7 @@ static void test_force_feedback_joystick( void )
caps.dwSize = sizeof(DIDEVCAPS); hr = IDirectInputDevice8_GetCapabilities( device, &caps ); - ok( hr == DI_OK, "IDirectInputDevice8_GetCapabilities returned %#x\n", hr ); + ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr ); check_member( caps, expect_caps, "%d", dwSize ); check_member( caps, expect_caps, "%#x", dwFlags ); check_member( caps, expect_caps, "%#x", dwDevType ); @@ -5708,35 +5708,35 @@ static void test_force_feedback_joystick( void ) prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFGAIN, &prop_dword.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_FFGAIN returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_FFGAIN returned %#x\n", hr ); todo_wine ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); todo_wine - ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr ); + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumObjects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumObjects returned %#x\n", hr ); 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_EnumEffects( device, check_effect_count, &res, 0xfe ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( res == 0, "got %u expected %u\n", res, 0 ); res = 0; hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, DIEFT_PERIODIC ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( res == 1, "got %u expected %u\n", res, 1 ); hr = IDirectInputDevice8_EnumEffects( device, check_effects, &check_effects_params, DIEFT_ALL ); - ok( hr == DI_OK, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); + ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n", check_effects_params.expect_count - check_effects_params.index );
effectinfo.dwSize = sizeof(DIEFFECTINFOW); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); - ok( hr == DI_OK, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); + ok( hr == DI_OK, "GetEffectInfo returned %#x\n", hr ); check_member_guid( effectinfo, expect_effects[0], guid ); check_member( effectinfo, expect_effects[0], "%#x", dwEffType ); check_member( effectinfo, expect_effects[0], "%#x", dwStaticParams ); @@ -5744,10 +5744,10 @@ static void test_force_feedback_joystick( void ) check_member_wstr( effectinfo, expect_effects[0], tszName );
hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 ); - ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); + ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph ); - ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr ); + ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
file = CreateFileW( prop_guid_path.wszPath, FILE_READ_ACCESS | FILE_WRITE_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); @@ -5757,33 +5757,33 @@ static void test_force_feedback_joystick( void ) NULL, NULL, NULL, NULL );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE ); - ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwObj = 0; prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_FFGAIN returned %#x\n", hr ); prop_dword.dwData = 1000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph ); todo_wine - ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_FFGAIN returned %#x\n", hr ); + ok( hr == DI_OK, "SetProperty DIPROP_FFGAIN returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); - ok( hr == DIERR_READONLY, "IDirectInputDevice8_SetProperty DIPROP_FFLOAD returned %#x\n", hr ); + ok( hr == DIERR_READONLY, "SetProperty DIPROP_FFLOAD returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); todo_wine - ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr ); + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr ); hr = IDirectInputDevice8_GetForceFeedbackState( device, &res ); todo_wine - ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "GetForceFeedbackState returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); - ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "SendForceFeedbackCommand returned %#x\n", hr );
escape.dwSize = sizeof(DIEFFESCAPE); escape.dwCommand = 0; @@ -5793,75 +5793,75 @@ static void test_force_feedback_joystick( void ) escape.cbOutBuffer = 10; hr = IDirectInputDevice8_Escape( device, &escape ); todo_wine - ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "IDirectInputDevice8_Escape returned: %#x\n", hr ); + ok( hr == DIERR_NOTEXCLUSIVEACQUIRED, "Escape returned: %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE ); - ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr ); + ok( hr == DI_OK, "SetCooperativeLevel returned: %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Acquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr ); set_hid_expect( file, NULL, 0 );
hr = IDirectInputDevice8_Escape( device, &escape ); todo_wine - ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_Escape returned: %#x\n", hr ); + ok( hr == DIERR_UNSUPPORTED, "Escape returned: %#x\n", hr );
prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); todo_wine - ok( hr == 0x80040301, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr ); + ok( hr == 0x80040301, "GetProperty DIPROP_FFLOAD returned %#x\n", hr ); res = 0xdeadbeef; hr = IDirectInputDevice8_GetForceFeedbackState( device, &res ); todo_wine - ok( hr == 0x80040301, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); + ok( hr == 0x80040301, "GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef ); - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SendForceFeedbackCommand returned %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); - ok( hr == DI_OK, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == DI_OK, "SendForceFeedbackCommand returned %#x\n", hr ); set_hid_expect( file, NULL, 0 );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_STOPALL ); - ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_PAUSE ); - ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_CONTINUE ); - ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_SETACTUATORSON ); - ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_SETACTUATORSOFF ); - ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); + ok( hr == HIDP_STATUS_USAGE_NOT_FOUND, "SendForceFeedbackCommand returned %#x\n", hr );
objdata.dwOfs = 0x1e; objdata.dwData = 0x80; res = 1; hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), &objdata, &res, 0 ); todo_wine - ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendDeviceData returned %#x\n", hr ); + ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
test_periodic_effect( device, file );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); hr = IDirectInputDevice8_Unacquire( device ); - ok( hr == DI_OK, "IDirectInputDevice8_Unacquire returned: %#x\n", hr ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); set_hid_expect( file, NULL, 0 );
/* FIXME: we have to wait a bit because Wine DInput internal thread keeps a reference */ Sleep( 100 );
ref = IDirectInputDevice8_Release( device ); - ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
DestroyWindow( hwnd ); CloseHandle( file );
ref = IDirectInput8_Release( di ); - ok( ref == 0, "IDirectInput8_Release returned %d\n", ref ); + ok( ref == 0, "Release returned %d\n", ref );
done: pnp_driver_stop();
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51784 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/hid.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 466331b326b..71159fb66be 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -499,11 +499,15 @@ static BOOL pnp_driver_start( const WCHAR *resource ) WCHAR path[MAX_PATH], filename[MAX_PATH]; SC_HANDLE manager, service; const CERT_CONTEXT *cert; + int old_mute_threshold; BOOL ret, need_reboot; HANDLE catalog; HDEVINFO set; FILE *f;
+ old_mute_threshold = winetest_mute_threshold; + winetest_mute_threshold = 1; + load_resource( resource, filename ); ret = MoveFileExW( filename, L"winetest.sys", MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING ); ok( ret, "failed to move file, error %u\n", GetLastError() ); @@ -536,6 +540,7 @@ static BOOL pnp_driver_start( const WCHAR *resource ) ok( ret, "Failed to delete file, error %u\n", GetLastError() ); ret = DeleteFileW( L"winetest.sys" ); ok( ret, "Failed to delete file, error %u\n", GetLastError() ); + winetest_mute_threshold = old_mute_threshold; return FALSE; }
@@ -584,6 +589,8 @@ static BOOL pnp_driver_start( const WCHAR *resource )
CloseServiceHandle( service ); CloseServiceHandle( manager ); + + winetest_mute_threshold = old_mute_threshold; return ret || GetLastError() == ERROR_SERVICE_ALREADY_RUNNING; }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/hid.c | 76 +++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 13 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 71159fb66be..6f97f17108f 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5100,6 +5100,7 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) IDirectInputEffect *effect; HRESULT hr; ULONG ref; + GUID guid;
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL ); ok( hr == E_POINTER, "CreateEffect returned %#x\n", hr ); @@ -5123,6 +5124,34 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ok( hr == DI_OK, "EnumCreatedEffectObjects returned %#x\n", hr ); ok( check_params.count == 1, "got count %u, expected 1\n", check_params.count );
+ hr = IDirectInputEffect_Initialize( effect, NULL, DIRECTINPUT_VERSION, &GUID_Sine ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr ); + hr = IDirectInputEffect_Initialize( effect, instance, 0, &GUID_Sine ); + todo_wine + ok( hr == DIERR_NOTINITIALIZED, "Initialize returned %#x\n", hr ); + hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, NULL ); + todo_wine + ok( hr == E_POINTER, "Initialize returned %#x\n", hr ); + + hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, &GUID_NULL ); + todo_wine + ok( hr == DIERR_DEVICENOTREG, "Initialize returned %#x\n", hr ); + hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, &GUID_Sine ); + ok( hr == DI_OK, "Initialize returned %#x\n", hr ); + hr = IDirectInputEffect_Initialize( effect, instance, DIRECTINPUT_VERSION, &GUID_Square ); + ok( hr == DI_OK, "Initialize returned %#x\n", hr ); + + hr = IDirectInputEffect_GetEffectGuid( effect, NULL ); + todo_wine + ok( hr == E_POINTER, "GetEffectGuid returned %#x\n", hr ); + hr = IDirectInputEffect_GetEffectGuid( effect, &guid ); + todo_wine + ok( hr == DI_OK, "GetEffectGuid returned %#x\n", hr ); + todo_wine + ok( IsEqualGUID( &guid, &GUID_Square ), "got guid %s, expected %s\n", debugstr_guid( &guid ), + debugstr_guid( &GUID_Square ) ); + ref = IDirectInputEffect_Release( effect ); ok( ref == 0, "Release returned %d\n", ref ); } @@ -5238,11 +5267,12 @@ static void test_force_feedback_joystick( void )
USAGE(1, PID_USAGE_EFFECT_TYPE), COLLECTION(1, NamedArray), + USAGE(1, PID_USAGE_ET_SQUARE), USAGE(1, PID_USAGE_ET_SINE), LOGICAL_MINIMUM(1, 1), - LOGICAL_MAXIMUM(1, 1), + LOGICAL_MAXIMUM(1, 2), PHYSICAL_MINIMUM(1, 1), - PHYSICAL_MAXIMUM(1, 1), + PHYSICAL_MAXIMUM(1, 2), REPORT_SIZE(1, 8), REPORT_COUNT(1, 1), OUTPUT(1, Data|Ary|Abs), @@ -5459,10 +5489,10 @@ static void test_force_feedback_joystick( void ) .dwOfs = 0x1e, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(11)|DIDFT_OUTPUT, .dwFlags = 0x80008000, - .tszName = L"ET Sine", + .tszName = L"ET Square", .wCollectionNumber = 8, .wUsagePage = HID_USAGE_PAGE_PID, - .wUsage = PID_USAGE_ET_SINE, + .wUsage = PID_USAGE_ET_SQUARE, .wReportId = 3, }, { @@ -5471,6 +5501,18 @@ static void test_force_feedback_joystick( void ) .dwOfs = 0x1f, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(12)|DIDFT_OUTPUT, .dwFlags = 0x80008000, + .tszName = L"ET Sine", + .wCollectionNumber = 8, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_ET_SINE, + .wReportId = 3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x20, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(13)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, .tszName = L"X Axis", .wCollectionNumber = 9, .wUsagePage = HID_USAGE_PAGE_GENERIC, @@ -5480,8 +5522,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x20, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(13)|DIDFT_OUTPUT, + .dwOfs = 0x21, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(14)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Direction Enable", .wCollectionNumber = 7, @@ -5493,7 +5535,7 @@ static void test_force_feedback_joystick( void ) .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, .dwOfs = 0x14, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(14)|DIDFT_OUTPUT, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(15)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Magnitude", .wCollectionNumber = 10, @@ -5603,6 +5645,14 @@ static void test_force_feedback_joystick( void ) }; const DIEFFECTINFOW expect_effects[] = { + { + .dwSize = sizeof(DIEFFECTINFOW), + .guid = GUID_Square, + .dwEffType = DIEFT_PERIODIC, + .dwStaticParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS, + .dwDynamicParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS, + .tszName = L"GUID_Square", + }, { .dwSize = sizeof(DIEFFECTINFOW), .guid = GUID_Sine, @@ -5735,7 +5785,7 @@ static void test_force_feedback_joystick( void ) res = 0; hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, DIEFT_PERIODIC ); ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); - ok( res == 1, "got %u expected %u\n", res, 1 ); + ok( res == 2, "got %u expected %u\n", res, 2 ); hr = IDirectInputDevice8_EnumEffects( device, check_effects, &check_effects_params, DIEFT_ALL ); ok( hr == DI_OK, "EnumEffects returned %#x\n", hr ); ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n", @@ -5744,11 +5794,11 @@ static void test_force_feedback_joystick( void ) effectinfo.dwSize = sizeof(DIEFFECTINFOW); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); ok( hr == DI_OK, "GetEffectInfo returned %#x\n", hr ); - check_member_guid( effectinfo, expect_effects[0], guid ); - check_member( effectinfo, expect_effects[0], "%#x", dwEffType ); - check_member( effectinfo, expect_effects[0], "%#x", dwStaticParams ); - check_member( effectinfo, expect_effects[0], "%#x", dwDynamicParams ); - check_member_wstr( effectinfo, expect_effects[0], tszName ); + check_member_guid( effectinfo, expect_effects[1], guid ); + check_member( effectinfo, expect_effects[1], "%#x", dwEffType ); + check_member( effectinfo, expect_effects[1], "%#x", dwStaticParams ); + check_member( effectinfo, expect_effects[1], "%#x", dwDynamicParams ); + check_member_wstr( effectinfo, expect_effects[1], tszName );
hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 ); ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/hid.c | 193 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 192 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 6f97f17108f..f4f1a4d282b 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5096,10 +5096,29 @@ static BOOL test_device_types(void)
static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) { + struct hid_expect expect_dc_reset = + { + .code = IOCTL_HID_WRITE_REPORT, + .report_id = 1, + .report_len = 2, + .report_buf = {1, 0x01}, + }; + static const DWORD expect_axes_init[2] = {0}; + static const DIEFFECT expect_desc_init = + { + .dwSize = sizeof(DIEFFECT), + .dwTriggerButton = -1, + .rgdwAxes = (void *)expect_axes_init, + }; struct check_created_effect_params check_params = {0}; IDirectInputEffect *effect; + DIPERIODIC periodic = {0}; + DIENVELOPE envelope = {0}; + LONG directions[4] = {0}; + DIEFFECT desc = {0}; + DWORD axes[4] = {0}; + ULONG ref, flags; HRESULT hr; - ULONG ref; GUID guid;
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, NULL, NULL ); @@ -5152,6 +5171,178 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) ok( IsEqualGUID( &guid, &GUID_Square ), "got guid %s, expected %s\n", debugstr_guid( &guid ), debugstr_guid( &GUID_Square ) );
+ hr = IDirectInputEffect_GetParameters( effect, NULL, 0 ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_GetParameters( effect, NULL, DIEP_DURATION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_GetParameters( effect, &desc, 0 ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + desc.dwSize = sizeof(DIEFFECT); + hr = IDirectInputEffect_GetParameters( effect, &desc, 0 ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Unacquire( device ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DURATION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Acquire( device ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + desc.dwDuration = 0xdeadbeef; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DURATION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwDuration ); + memset( &desc, 0xcd, sizeof(desc) ); + desc.dwSize = sizeof(DIEFFECT); + desc.dwFlags = 0; + flags = DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | DIEP_TRIGGERREPEATINTERVAL; + hr = IDirectInputEffect_GetParameters( effect, &desc, flags ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwSamplePeriod ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwGain ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwStartDelay ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwTriggerRepeatInterval ); + + memset( &desc, 0xcd, sizeof(desc) ); + desc.dwSize = sizeof(DIEFFECT); + desc.dwFlags = 0; + desc.lpEnvelope = NULL; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_ENVELOPE ); + todo_wine + ok( hr == E_POINTER, "GetParameters returned %#x\n", hr ); + desc.lpEnvelope = &envelope; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_ENVELOPE ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + envelope.dwSize = sizeof(DIENVELOPE); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_ENVELOPE ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + + desc.dwFlags = 0; + desc.cAxes = 0; + desc.rgdwAxes = NULL; + desc.rglDirection = NULL; + desc.lpEnvelope = NULL; + desc.cbTypeSpecificParams = 0; + desc.lpvTypeSpecificParams = NULL; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_ALLPARAMS ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_TRIGGERBUTTON ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + desc.dwFlags = DIEFF_OBJECTOFFSETS; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_TRIGGERBUTTON ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc_init, "%#x", dwTriggerButton ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + check_member( desc, expect_desc_init, "%u", cAxes ); + desc.dwFlags = DIEFF_OBJECTIDS; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_TRIGGERBUTTON ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc_init, "%#x", dwTriggerButton ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + check_member( desc, expect_desc_init, "%u", cAxes ); + desc.dwFlags |= DIEFF_CARTESIAN; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.dwFlags == DIEFF_OBJECTIDS, "got flags %#x, expected %#x\n", desc.dwFlags, DIEFF_OBJECTIDS ); + desc.dwFlags |= DIEFF_POLAR; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.dwFlags == DIEFF_OBJECTIDS, "got flags %#x, expected %#x\n", desc.dwFlags, DIEFF_OBJECTIDS ); + desc.dwFlags |= DIEFF_SPHERICAL; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + check_member( desc, expect_desc_init, "%u", cAxes ); + todo_wine + ok( desc.dwFlags == DIEFF_OBJECTIDS, "got flags %#x, expected %#x\n", desc.dwFlags, DIEFF_OBJECTIDS ); + + desc.dwFlags |= DIEFF_SPHERICAL; + desc.cAxes = 2; + desc.rgdwAxes = axes; + desc.rglDirection = directions; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES | DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc_init, "%u", cAxes ); + check_member( desc, expect_desc_init, "%u", rgdwAxes[0] ); + check_member( desc, expect_desc_init, "%u", rgdwAxes[1] ); + todo_wine + check_member( desc, expect_desc_init, "%p", rglDirection ); + todo_wine + ok( desc.dwFlags == DIEFF_OBJECTIDS, "got flags %#x, expected %#x\n", desc.dwFlags, DIEFF_OBJECTIDS ); + + desc.dwFlags |= DIEFF_SPHERICAL; + desc.lpEnvelope = &envelope; + desc.cbTypeSpecificParams = sizeof(periodic); + desc.lpvTypeSpecificParams = &periodic; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_ALLPARAMS ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwDuration ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwSamplePeriod ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwGain ); + todo_wine + check_member( desc, expect_desc_init, "%#x", dwTriggerButton ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwTriggerRepeatInterval ); + todo_wine + check_member( desc, expect_desc_init, "%u", cAxes ); + check_member( desc, expect_desc_init, "%u", rgdwAxes[0] ); + check_member( desc, expect_desc_init, "%u", rgdwAxes[1] ); + todo_wine + check_member( desc, expect_desc_init, "%p", rglDirection ); + todo_wine + check_member( desc, expect_desc_init, "%p", lpEnvelope ); + todo_wine + check_member( desc, expect_desc_init, "%u", cbTypeSpecificParams ); + todo_wine + check_member( desc, expect_desc_init, "%u", dwStartDelay ); + ref = IDirectInputEffect_Release( effect ); ok( ref == 0, "Release returned %d\n", ref ); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/hid.c | 110 ++++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 35 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index f4f1a4d282b..77882187edf 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5360,12 +5360,13 @@ static void test_force_feedback_joystick( void )
USAGE(1, HID_USAGE_GENERIC_X), USAGE(1, HID_USAGE_GENERIC_Y), + USAGE(1, HID_USAGE_GENERIC_Z), LOGICAL_MINIMUM(1, 0), LOGICAL_MAXIMUM(1, 0x7f), PHYSICAL_MINIMUM(1, 0), PHYSICAL_MAXIMUM(1, 0x7f), REPORT_SIZE(1, 8), - REPORT_COUNT(1, 2), + REPORT_COUNT(1, 3), INPUT(1, Data|Var|Abs),
USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), @@ -5472,18 +5473,20 @@ static void test_force_feedback_joystick( void ) USAGE(1, PID_USAGE_AXES_ENABLE), COLLECTION(1, Logical), USAGE(4, (HID_USAGE_PAGE_GENERIC << 16)|HID_USAGE_GENERIC_X), + USAGE(4, (HID_USAGE_PAGE_GENERIC << 16)|HID_USAGE_GENERIC_Y), + USAGE(4, (HID_USAGE_PAGE_GENERIC << 16)|HID_USAGE_GENERIC_Z), LOGICAL_MINIMUM(1, 0), LOGICAL_MAXIMUM(1, 1), PHYSICAL_MINIMUM(1, 0), PHYSICAL_MAXIMUM(1, 1), REPORT_SIZE(1, 1), - REPORT_COUNT(1, 1), + REPORT_COUNT(1, 3), OUTPUT(1, Data|Var|Abs), END_COLLECTION, USAGE(1, PID_USAGE_DIRECTION_ENABLE), REPORT_COUNT(1, 1), OUTPUT(1, Data|Var|Abs), - REPORT_COUNT(1, 6), + REPORT_COUNT(1, 4), OUTPUT(1, Cnst|Var|Abs), END_COLLECTION,
@@ -5507,14 +5510,14 @@ static void test_force_feedback_joystick( void )
static const HIDP_CAPS hid_caps = { - .InputReportByteLength = 4, + .InputReportByteLength = 5, }; static const DIDEVCAPS expect_caps = { .dwSize = sizeof(DIDEVCAPS), .dwFlags = DIDC_FORCEFEEDBACK | DIDC_ATTACHED | DIDC_EMULATED, .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK, - .dwAxes = 2, + .dwAxes = 3, .dwButtons = 2, .dwFFSamplePeriod = 1000000, .dwFFMinTimeResolution = 1000000, @@ -5543,11 +5546,23 @@ static void test_force_feedback_joystick( void ) }; const DIDEVICEOBJECTINSTANCEW expect_objects[] = { + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_ZAxis, + .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(2)|DIDFT_FFACTUATOR, + .dwFlags = DIDOI_ASPECTPOSITION|DIDOI_FFACTUATOR, + .tszName = L"Z Axis", + .wCollectionNumber = 1, + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_Z, + .wReportId = 1, + }, { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_YAxis, - .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(1), - .dwFlags = DIDOI_ASPECTPOSITION, + .dwOfs = 0x4, + .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(1)|DIDFT_FFACTUATOR, + .dwFlags = DIDOI_ASPECTPOSITION|DIDOI_FFACTUATOR, .tszName = L"Y Axis", .wCollectionNumber = 1, .wUsagePage = HID_USAGE_PAGE_GENERIC, @@ -5557,7 +5572,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_XAxis, - .dwOfs = 0x4, + .dwOfs = 0x8, .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(0)|DIDFT_FFACTUATOR, .dwFlags = DIDOI_ASPECTPOSITION|DIDOI_FFACTUATOR, .tszName = L"X Axis", @@ -5569,7 +5584,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Button, - .dwOfs = 0x18, + .dwOfs = 0x1c, .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(0)|DIDFT_FFEFFECTTRIGGER, .dwFlags = DIDOI_FFEFFECTTRIGGER, .tszName = L"Button 0", @@ -5581,7 +5596,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Button, - .dwOfs = 0x19, + .dwOfs = 0x1d, .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(1)|DIDFT_FFEFFECTTRIGGER, .dwFlags = DIDOI_FFEFFECTTRIGGER, .tszName = L"Button 1", @@ -5593,8 +5608,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1a, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(4)|DIDFT_OUTPUT, + .dwOfs = 0x1e, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(5)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"DC Device Reset", .wCollectionNumber = 4, @@ -5605,8 +5620,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x8, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(5)|DIDFT_OUTPUT, + .dwOfs = 0xc, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(6)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Effect Block Index", .wCollectionNumber = 5, @@ -5617,8 +5632,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1b, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(6)|DIDFT_OUTPUT, + .dwOfs = 0x1f, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(7)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Op Effect Start", .wCollectionNumber = 6, @@ -5629,8 +5644,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1c, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(7)|DIDFT_OUTPUT, + .dwOfs = 0x20, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(8)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Op Effect Start Solo", .wCollectionNumber = 6, @@ -5641,8 +5656,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1d, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(8)|DIDFT_OUTPUT, + .dwOfs = 0x21, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(9)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Op Effect Stop", .wCollectionNumber = 6, @@ -5653,8 +5668,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0xc, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(9)|DIDFT_OUTPUT, + .dwOfs = 0x10, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(10)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Loop Count", .wCollectionNumber = 5, @@ -5665,8 +5680,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x10, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(10)|DIDFT_OUTPUT, + .dwOfs = 0x14, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(11)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Effect Block Index", .wCollectionNumber = 7, @@ -5677,8 +5692,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1e, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(11)|DIDFT_OUTPUT, + .dwOfs = 0x22, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(12)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"ET Square", .wCollectionNumber = 8, @@ -5689,8 +5704,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1f, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(12)|DIDFT_OUTPUT, + .dwOfs = 0x23, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(13)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"ET Sine", .wCollectionNumber = 8, @@ -5701,8 +5716,32 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x20, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(13)|DIDFT_OUTPUT, + .dwOfs = 0x24, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(14)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Z Axis", + .wCollectionNumber = 9, + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_Z, + .wReportId = 3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x25, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(15)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Y Axis", + .wCollectionNumber = 9, + .wUsagePage = HID_USAGE_PAGE_GENERIC, + .wUsage = HID_USAGE_GENERIC_Y, + .wReportId = 3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x26, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(16)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"X Axis", .wCollectionNumber = 9, @@ -5713,8 +5752,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x21, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(14)|DIDFT_OUTPUT, + .dwOfs = 0x27, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(17)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Direction Enable", .wCollectionNumber = 7, @@ -5725,8 +5764,8 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x14, - .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(15)|DIDFT_OUTPUT, + .dwOfs = 0x18, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(18)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Magnitude", .wCollectionNumber = 10, @@ -5829,7 +5868,8 @@ static void test_force_feedback_joystick( void ) }; const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = { - {}, + {.type = TRUE, .flags = TRUE}, + {.type = TRUE, .flags = TRUE}, {.type = TRUE, .flags = TRUE}, {.type = TRUE, .flags = TRUE}, {.type = TRUE, .flags = TRUE},
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/hid.c | 364 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 364 insertions(+)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 77882187edf..ebb7239a911 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -5110,6 +5110,50 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) .dwTriggerButton = -1, .rgdwAxes = (void *)expect_axes_init, }; + static const DWORD expect_axes[3] = + { + DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 2 ) | DIDFT_FFACTUATOR, + DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 0 ) | DIDFT_FFACTUATOR, + DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 1 ) | DIDFT_FFACTUATOR, + }; + static const LONG expect_directions[3] = + { + +3000, + -6000, + 0, + }; + static const DIENVELOPE expect_envelope = + { + .dwSize = sizeof(DIENVELOPE), + .dwAttackLevel = 1000, + .dwAttackTime = 2000, + .dwFadeLevel = 3000, + .dwFadeTime = 4000, + }; + static const DIPERIODIC expect_periodic = + { + .dwMagnitude = 1000, + .lOffset = 2000, + .dwPhase = 3000, + .dwPeriod = 4000, + }; + static const DIEFFECT expect_desc = + { + .dwSize = sizeof(DIEFFECT), + .dwFlags = DIEFF_SPHERICAL | DIEFF_OBJECTIDS, + .dwDuration = 1000, + .dwSamplePeriod = 2000, + .dwGain = 3000, + .dwTriggerButton = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( 0 ) | DIDFT_FFEFFECTTRIGGER, + .dwTriggerRepeatInterval = 5000, + .cAxes = 3, + .rgdwAxes = (void *)expect_axes, + .rglDirection = (void *)expect_directions, + .lpEnvelope = (void *)&expect_envelope, + .cbTypeSpecificParams = sizeof(DIPERIODIC), + .lpvTypeSpecificParams = (void *)&expect_periodic, + .dwStartDelay = 6000, + }; struct check_created_effect_params check_params = {0}; IDirectInputEffect *effect; DIPERIODIC periodic = {0}; @@ -5343,6 +5387,326 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file ) todo_wine check_member( desc, expect_desc_init, "%u", dwStartDelay );
+ hr = IDirectInputEffect_SetParameters( effect, NULL, DIEP_NODOWNLOAD ); + todo_wine + ok( hr == E_POINTER, "SetParameters returned %#x\n", hr ); + memset( &desc, 0, sizeof(desc) ); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + desc.dwSize = sizeof(DIEFFECT); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Unacquire( device ); + ok( hr == DI_OK, "Unacquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DURATION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); + hr = IDirectInputDevice8_Acquire( device ); + ok( hr == DI_OK, "Acquire returned: %#x\n", hr ); + set_hid_expect( file, NULL, 0 ); + + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DURATION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + + desc.dwTriggerButton = -1; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DURATION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", dwDuration ); + check_member( desc, expect_desc_init, "%u", dwSamplePeriod ); + check_member( desc, expect_desc_init, "%u", dwGain ); + check_member( desc, expect_desc_init, "%#x", dwTriggerButton ); + check_member( desc, expect_desc_init, "%u", dwTriggerRepeatInterval ); + check_member( desc, expect_desc_init, "%u", cAxes ); + check_member( desc, expect_desc_init, "%p", rglDirection ); + check_member( desc, expect_desc_init, "%p", lpEnvelope ); + check_member( desc, expect_desc_init, "%u", cbTypeSpecificParams ); + check_member( desc, expect_desc_init, "%u", dwStartDelay ); + + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, + DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | + DIEP_TRIGGERREPEATINTERVAL | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + desc.dwDuration = 0; + flags = DIEP_DURATION | DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | DIEP_TRIGGERREPEATINTERVAL; + hr = IDirectInputEffect_GetParameters( effect, &desc, flags ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", dwDuration ); + todo_wine + check_member( desc, expect_desc, "%u", dwSamplePeriod ); + todo_wine + check_member( desc, expect_desc, "%u", dwGain ); + check_member( desc, expect_desc_init, "%#x", dwTriggerButton ); + todo_wine + check_member( desc, expect_desc, "%u", dwTriggerRepeatInterval ); + check_member( desc, expect_desc_init, "%u", cAxes ); + check_member( desc, expect_desc_init, "%p", rglDirection ); + check_member( desc, expect_desc_init, "%p", lpEnvelope ); + check_member( desc, expect_desc_init, "%u", cbTypeSpecificParams ); + todo_wine + check_member( desc, expect_desc, "%u", dwStartDelay ); + + desc.lpEnvelope = NULL; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_ENVELOPE | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + desc.lpEnvelope = &envelope; + envelope.dwSize = 0; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_ENVELOPE | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_ENVELOPE | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + + desc.lpEnvelope = &envelope; + envelope.dwSize = sizeof(DIENVELOPE); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_ENVELOPE ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( envelope, expect_envelope, "%u", dwAttackLevel ); + todo_wine + check_member( envelope, expect_envelope, "%u", dwAttackTime ); + todo_wine + check_member( envelope, expect_envelope, "%u", dwFadeLevel ); + todo_wine + check_member( envelope, expect_envelope, "%u", dwFadeTime ); + + desc.dwFlags = 0; + desc.cAxes = 0; + desc.rgdwAxes = NULL; + desc.rglDirection = NULL; + desc.lpEnvelope = NULL; + desc.cbTypeSpecificParams = 0; + desc.lpvTypeSpecificParams = NULL; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_ALLPARAMS | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_TRIGGERBUTTON | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_AXES | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + + desc.dwFlags = DIEFF_OBJECTOFFSETS; + desc.cAxes = 1; + desc.rgdwAxes = axes; + desc.rgdwAxes[0] = DIJOFS_X; + desc.dwTriggerButton = DIJOFS_BUTTON( 1 ); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_AXES | DIEP_TRIGGERBUTTON | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_AXES | DIEP_TRIGGERBUTTON | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_ALREADYINITIALIZED, "SetParameters returned %#x\n", hr ); + + desc.cAxes = 0; + desc.dwFlags = DIEFF_OBJECTIDS; + desc.rgdwAxes = axes; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES | DIEP_TRIGGERBUTTON ); + todo_wine + ok( hr == DIERR_MOREDATA, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", cAxes ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES | DIEP_TRIGGERBUTTON ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%#x", dwTriggerButton ); + todo_wine + check_member( desc, expect_desc, "%u", cAxes ); + todo_wine + check_member( desc, expect_desc, "%u", rgdwAxes[0] ); + todo_wine + check_member( desc, expect_desc, "%u", rgdwAxes[1] ); + todo_wine + check_member( desc, expect_desc, "%u", rgdwAxes[2] ); + + desc.dwFlags = DIEFF_OBJECTOFFSETS; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_AXES | DIEP_TRIGGERBUTTON ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.dwTriggerButton == 0x30, "got %#x expected %#x\n", desc.dwTriggerButton, 0x30 ); + todo_wine + ok( desc.rgdwAxes[0] == 8, "got %#x expected %#x\n", desc.rgdwAxes[0], 8 ); + ok( desc.rgdwAxes[1] == 0, "got %#x expected %#x\n", desc.rgdwAxes[1], 0 ); + todo_wine + ok( desc.rgdwAxes[2] == 4, "got %#x expected %#x\n", desc.rgdwAxes[2], 4 ); + + desc.dwFlags = DIEFF_CARTESIAN; + desc.cAxes = 0; + desc.rglDirection = directions; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + desc.cAxes = 3; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + desc.dwFlags = DIEFF_POLAR; + desc.cAxes = 3; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DIRECTION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + + desc.dwFlags = DIEFF_SPHERICAL; + desc.cAxes = 1; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_MOREDATA, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", cAxes ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", cAxes ); + todo_wine + ok( desc.rglDirection[0] == 3000, "got rglDirection[0] %d expected %d\n", desc.rglDirection[0], 3000 ); + todo_wine + ok( desc.rglDirection[1] == 30000, "got rglDirection[1] %d expected %d\n", desc.rglDirection[1], 30000 ); + ok( desc.rglDirection[2] == 0, "got rglDirection[2] %d expected %d\n", desc.rglDirection[2], 0 ); + desc.dwFlags = DIEFF_CARTESIAN; + desc.cAxes = 2; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_MOREDATA, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", cAxes ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( desc, expect_desc, "%u", cAxes ); + todo_wine + ok( desc.rglDirection[0] == 4330, "got rglDirection[0] %d expected %d\n", desc.rglDirection[0], 4330 ); + todo_wine + ok( desc.rglDirection[1] == 2500, "got rglDirection[1] %d expected %d\n", desc.rglDirection[1], 2500 ); + todo_wine + ok( desc.rglDirection[2] == -8660, "got rglDirection[2] %d expected %d\n", desc.rglDirection[2], -8660 ); + desc.dwFlags = DIEFF_POLAR; + desc.cAxes = 3; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "GetParameters returned %#x\n", hr ); + + desc.cbTypeSpecificParams = 0; + desc.lpvTypeSpecificParams = &periodic; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_TYPESPECIFICPARAMS | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr ); + desc.cbTypeSpecificParams = sizeof(DIPERIODIC); + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_TYPESPECIFICPARAMS | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_TYPESPECIFICPARAMS | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_TYPESPECIFICPARAMS ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + check_member( periodic, expect_periodic, "%u", dwMagnitude ); + todo_wine + check_member( periodic, expect_periodic, "%d", lOffset ); + todo_wine + check_member( periodic, expect_periodic, "%u", dwPhase ); + todo_wine + check_member( periodic, expect_periodic, "%u", dwPeriod ); + + ref = IDirectInputEffect_Release( effect ); + ok( ref == 0, "Release returned %d\n", ref ); + + hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, NULL, &effect, NULL ); + ok( hr == DI_OK, "CreateEffect returned %#x\n", hr ); + + desc.dwFlags = DIEFF_POLAR | DIEFF_OBJECTIDS; + desc.cAxes = 2; + desc.rgdwAxes[0] = DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 2 ) | DIDFT_FFACTUATOR; + desc.rgdwAxes[1] = DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 0 ) | DIDFT_FFACTUATOR; + desc.rglDirection[0] = 3000; + desc.rglDirection[1] = 0; + desc.rglDirection[2] = 0; + hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_AXES | DIEP_DIRECTION | DIEP_NODOWNLOAD ); + todo_wine + ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr ); + desc.rglDirection[0] = 0; + + desc.dwFlags = DIEFF_SPHERICAL; + desc.cAxes = 1; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_MOREDATA, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.cAxes == 2, "got cAxes %u expected 2\n", desc.cAxes ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.cAxes == 2, "got cAxes %u expected 2\n", desc.cAxes ); + todo_wine + ok( desc.rglDirection[0] == 30000, "got rglDirection[0] %d expected %d\n", desc.rglDirection[0], 30000 ); + ok( desc.rglDirection[1] == 0, "got rglDirection[1] %d expected %d\n", desc.rglDirection[1], 0 ); + ok( desc.rglDirection[2] == 0, "got rglDirection[2] %d expected %d\n", desc.rglDirection[2], 0 ); + + desc.dwFlags = DIEFF_CARTESIAN; + desc.cAxes = 1; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_MOREDATA, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.cAxes == 2, "got cAxes %u expected 2\n", desc.cAxes ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.cAxes == 2, "got cAxes %u expected 2\n", desc.cAxes ); + todo_wine + ok( desc.rglDirection[0] == 5000, "got rglDirection[0] %d expected %d\n", desc.rglDirection[0], 5000 ); + todo_wine + ok( desc.rglDirection[1] == -8660, "got rglDirection[1] %d expected %d\n", desc.rglDirection[1], -8660 ); + ok( desc.rglDirection[2] == 0, "got rglDirection[2] %d expected %d\n", desc.rglDirection[2], 0 ); + + desc.dwFlags = DIEFF_POLAR; + desc.cAxes = 1; + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DIERR_MOREDATA, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.cAxes == 2, "got cAxes %u expected 2\n", desc.cAxes ); + hr = IDirectInputEffect_GetParameters( effect, &desc, DIEP_DIRECTION ); + todo_wine + ok( hr == DI_OK, "GetParameters returned %#x\n", hr ); + todo_wine + ok( desc.cAxes == 2, "got cAxes %u expected 2\n", desc.cAxes ); + todo_wine + ok( desc.rglDirection[0] == 3000, "got rglDirection[0] %d expected %d\n", desc.rglDirection[0], 3000 ); + ok( desc.rglDirection[1] == 0, "got rglDirection[1] %d expected %d\n", desc.rglDirection[1], 0 ); + ok( desc.rglDirection[2] == 0, "got rglDirection[2] %d expected %d\n", desc.rglDirection[2], 0 ); + ref = IDirectInputEffect_Release( effect ); ok( ref == 0, "Release returned %d\n", ref ); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/hid.c | 227 +++++++++++++++++++++++++++++++++++---- 1 file changed, 208 insertions(+), 19 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index ebb7239a911..019e7b7ae87 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3296,6 +3296,8 @@ struct check_objects_todos { BOOL type; BOOL flags; + BOOL dimension; + BOOL exponent; };
struct check_objects_params @@ -3332,7 +3334,9 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar check_member( *obj, *exp, "%u", wDesignatorIndex ); check_member( *obj, *exp, "%#04x", wUsagePage ); check_member( *obj, *exp, "%#04x", wUsage ); + todo_wine_if( todo->dimension ) check_member( *obj, *exp, "%#04x", dwDimension ); + todo_wine_if( todo->exponent ) check_member( *obj, *exp, "%#04x", wExponent ); check_member( *obj, *exp, "%u", wReportId );
@@ -3369,8 +3373,11 @@ static BOOL CALLBACK check_effects( const DIEFFECTINFOW *effect, void *args )
check_member( *effect, *exp, "%u", dwSize ); check_member_guid( *effect, *exp, guid ); + todo_wine check_member( *effect, *exp, "%#x", dwEffType ); + todo_wine check_member( *effect, *exp, "%#x", dwStaticParams ); + todo_wine check_member( *effect, *exp, "%#x", dwDynamicParams ); check_member_wstr( *effect, *exp, tszName );
@@ -5852,6 +5859,29 @@ static void test_force_feedback_joystick( void ) OUTPUT(1, Data|Var|Abs), REPORT_COUNT(1, 4), OUTPUT(1, Cnst|Var|Abs), + + USAGE(1, PID_USAGE_DURATION), + USAGE(1, PID_USAGE_START_DELAY), + UNIT(2, 0x1003), /* Eng Lin:Time */ + UNIT_EXPONENT(1, -3), /* 10^-3 */ + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(2, 0x7fff), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(2, 0x7fff), + REPORT_SIZE(1, 16), + REPORT_COUNT(1, 2), + OUTPUT(1, Data|Var|Abs), + UNIT(1, 0), + UNIT_EXPONENT(1, 0), + + USAGE(1, PID_USAGE_TRIGGER_BUTTON), + LOGICAL_MINIMUM(1, 1), + LOGICAL_MAXIMUM(1, 0x08), + PHYSICAL_MINIMUM(1, 1), + PHYSICAL_MAXIMUM(1, 0x08), + REPORT_SIZE(1, 8), + REPORT_COUNT(1, 1), + OUTPUT(1, Data|Var|Abs), END_COLLECTION,
USAGE(1, PID_USAGE_SET_PERIODIC_REPORT), @@ -5867,6 +5897,36 @@ static void test_force_feedback_joystick( void ) REPORT_COUNT(1, 1), OUTPUT(1, Data|Var|Abs), END_COLLECTION, + + USAGE(1, PID_USAGE_SET_ENVELOPE_REPORT), + COLLECTION(1, Logical), + REPORT_ID(1, 6), + + USAGE(1, PID_USAGE_ATTACK_LEVEL), + USAGE(1, PID_USAGE_FADE_LEVEL), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(2, 0x00ff), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(2, 0x2710), + REPORT_SIZE(1, 8), + REPORT_COUNT(1, 2), + OUTPUT(1, Data|Var|Abs), + + USAGE(1, PID_USAGE_ATTACK_TIME), + USAGE(1, PID_USAGE_FADE_TIME), + UNIT(2, 0x1003), /* Eng Lin:Time */ + UNIT_EXPONENT(1, -3), /* 10^-3 */ + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(2, 0x7fff), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(2, 0x7fff), + REPORT_SIZE(1, 16), + REPORT_COUNT(1, 2), + OUTPUT(1, Data|Var|Abs), + PHYSICAL_MAXIMUM(1, 0), + UNIT_EXPONENT(1, 0), + UNIT(1, 0), + END_COLLECTION, END_COLLECTION, }; #undef REPORT_ID_OR_USAGE_PAGE @@ -5879,7 +5939,7 @@ static void test_force_feedback_joystick( void ) static const DIDEVCAPS expect_caps = { .dwSize = sizeof(DIDEVCAPS), - .dwFlags = DIDC_FORCEFEEDBACK | DIDC_ATTACHED | DIDC_EMULATED, + .dwFlags = DIDC_FORCEFEEDBACK | DIDC_ATTACHED | DIDC_EMULATED | DIDC_STARTDELAY | DIDC_FFFADE | DIDC_FFATTACK, .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK, .dwAxes = 3, .dwButtons = 2, @@ -5948,7 +6008,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Button, - .dwOfs = 0x1c, + .dwOfs = 0x38, .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(0)|DIDFT_FFEFFECTTRIGGER, .dwFlags = DIDOI_FFEFFECTTRIGGER, .tszName = L"Button 0", @@ -5960,7 +6020,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Button, - .dwOfs = 0x1d, + .dwOfs = 0x39, .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(1)|DIDFT_FFEFFECTTRIGGER, .dwFlags = DIDOI_FFEFFECTTRIGGER, .tszName = L"Button 1", @@ -5972,7 +6032,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1e, + .dwOfs = 0x3a, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(5)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"DC Device Reset", @@ -5996,7 +6056,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x1f, + .dwOfs = 0x3b, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(7)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Op Effect Start", @@ -6008,7 +6068,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x20, + .dwOfs = 0x3c, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(8)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Op Effect Start Solo", @@ -6020,7 +6080,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x21, + .dwOfs = 0x3d, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(9)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Op Effect Stop", @@ -6056,7 +6116,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x22, + .dwOfs = 0x3e, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(12)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"ET Square", @@ -6068,7 +6128,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x23, + .dwOfs = 0x3f, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(13)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"ET Sine", @@ -6080,7 +6140,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x24, + .dwOfs = 0x40, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(14)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Z Axis", @@ -6092,7 +6152,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x25, + .dwOfs = 0x41, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(15)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Y Axis", @@ -6104,7 +6164,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x26, + .dwOfs = 0x42, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(16)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"X Axis", @@ -6116,7 +6176,7 @@ static void test_force_feedback_joystick( void ) { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, - .dwOfs = 0x27, + .dwOfs = 0x43, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(17)|DIDFT_OUTPUT, .dwFlags = 0x80008000, .tszName = L"Direction Enable", @@ -6131,12 +6191,104 @@ static void test_force_feedback_joystick( void ) .dwOfs = 0x18, .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(18)|DIDFT_OUTPUT, .dwFlags = 0x80008000, + .tszName = L"Start Delay", + .wCollectionNumber = 7, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_START_DELAY, + .wReportId = 3, + .dwDimension = 0x1003, + .wExponent = -3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x1c, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(19)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Duration", + .wCollectionNumber = 7, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_DURATION, + .wReportId = 3, + .dwDimension = 0x1003, + .wExponent = -3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x20, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(20)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Trigger Button", + .wCollectionNumber = 7, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_TRIGGER_BUTTON, + .wReportId = 3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x24, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(21)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, .tszName = L"Magnitude", .wCollectionNumber = 10, .wUsagePage = HID_USAGE_PAGE_PID, .wUsage = PID_USAGE_MAGNITUDE, .wReportId = 5, }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x28, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(22)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Fade Level", + .wCollectionNumber = 11, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_FADE_LEVEL, + .wReportId = 6, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x2c, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(23)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Attack Level", + .wCollectionNumber = 11, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_ATTACK_LEVEL, + .wReportId = 6, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x30, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(24)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Fade Time", + .wCollectionNumber = 11, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_FADE_TIME, + .wReportId = 6, + .dwDimension = 0x1003, + .wExponent = -3, + }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwOfs = 0x34, + .dwType = DIDFT_NODATA|DIDFT_MAKEINSTANCE(25)|DIDFT_OUTPUT, + .dwFlags = 0x80008000, + .tszName = L"Attack Time", + .wCollectionNumber = 11, + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_ATTACK_TIME, + .wReportId = 6, + .dwDimension = 0x1003, + .wExponent = -3, + }, { .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), .guidType = GUID_Unknown, @@ -6229,6 +6381,14 @@ static void test_force_feedback_joystick( void ) .wUsagePage = HID_USAGE_PAGE_PID, .wUsage = PID_USAGE_SET_PERIODIC_REPORT, }, + { + .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW), + .guidType = GUID_Unknown, + .dwType = DIDFT_COLLECTION|DIDFT_NODATA|DIDFT_MAKEINSTANCE(11), + .tszName = L"Collection 11 - Set Envelope Report", + .wUsagePage = HID_USAGE_PAGE_PID, + .wUsage = PID_USAGE_SET_ENVELOPE_REPORT, + }, }; const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = { @@ -6237,23 +6397,48 @@ static void test_force_feedback_joystick( void ) {.type = TRUE, .flags = TRUE}, {.type = TRUE, .flags = TRUE}, {.type = TRUE, .flags = TRUE}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {.dimension = TRUE, .exponent = TRUE}, + {.dimension = TRUE, .exponent = TRUE}, + {}, + {}, + {}, + {}, + {.dimension = TRUE, .exponent = TRUE}, + {.dimension = TRUE, .exponent = TRUE}, }; const DIEFFECTINFOW expect_effects[] = { { .dwSize = sizeof(DIEFFECTINFOW), .guid = GUID_Square, - .dwEffType = DIEFT_PERIODIC, - .dwStaticParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS, - .dwDynamicParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS, + .dwEffType = DIEFT_PERIODIC | DIEFT_STARTDELAY | DIEFT_FFFADE | DIEFT_FFATTACK, + .dwStaticParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS | DIEP_STARTDELAY | + DIEP_DURATION | DIEP_TRIGGERBUTTON | DIEP_ENVELOPE, + .dwDynamicParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS | DIEP_STARTDELAY | + DIEP_DURATION | DIEP_TRIGGERBUTTON | DIEP_ENVELOPE, .tszName = L"GUID_Square", }, { .dwSize = sizeof(DIEFFECTINFOW), .guid = GUID_Sine, - .dwEffType = DIEFT_PERIODIC, - .dwStaticParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS, - .dwDynamicParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS, + .dwEffType = DIEFT_PERIODIC | DIEFT_STARTDELAY | DIEFT_FFFADE | DIEFT_FFATTACK, + .dwStaticParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS | DIEP_STARTDELAY | + DIEP_DURATION | DIEP_TRIGGERBUTTON | DIEP_ENVELOPE, + .dwDynamicParams = DIEP_AXES | DIEP_TYPESPECIFICPARAMS | DIEP_STARTDELAY | + DIEP_DURATION | DIEP_TRIGGERBUTTON | DIEP_ENVELOPE, .tszName = L"GUID_Sine", } }; @@ -6346,6 +6531,7 @@ static void test_force_feedback_joystick( void ) hr = IDirectInputDevice8_GetCapabilities( device, &caps ); ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr ); check_member( caps, expect_caps, "%d", dwSize ); + todo_wine check_member( caps, expect_caps, "%#x", dwFlags ); check_member( caps, expect_caps, "%#x", dwDevType ); check_member( caps, expect_caps, "%d", dwAxes ); @@ -6390,8 +6576,11 @@ static void test_force_feedback_joystick( void ) hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); ok( hr == DI_OK, "GetEffectInfo returned %#x\n", hr ); check_member_guid( effectinfo, expect_effects[1], guid ); + todo_wine check_member( effectinfo, expect_effects[1], "%#x", dwEffType ); + todo_wine check_member( effectinfo, expect_effects[1], "%#x", dwStaticParams ); + todo_wine check_member( effectinfo, expect_effects[1], "%#x", dwDynamicParams ); check_member_wstr( effectinfo, expect_effects[1], tszName );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 18 ++++++++++++++++++ dlls/dinput8/tests/hid.c | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 1a22c7c8baa..846d4095391 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -255,6 +255,23 @@ static BOOL enum_object( struct hid_joystick *impl, const DIPROPHEADER *filter, return DIENUM_CONTINUE; }
+static void check_pid_effect_axis_caps( struct hid_joystick *impl, DIDEVICEOBJECTINSTANCEW *instance ) +{ + struct pid_effect_update *effect_update = &impl->pid_effect_update; + ULONG i; + + for (i = 0; i < effect_update->axis_count; ++i) + { + if (effect_update->axis_caps[i]->usage_page != instance->wUsagePage) continue; + if (effect_update->axis_caps[i]->usage_min > instance->wUsage) continue; + if (effect_update->axis_caps[i]->usage_max >= instance->wUsage) break; + } + + if (i == effect_update->axis_count) return; + instance->dwType |= DIDFT_FFACTUATOR; + instance->dwFlags |= DIDOI_FFACTUATOR; +} + static void set_axis_type( DIDEVICEOBJECTINSTANCEW *instance, BOOL *seen, DWORD i, DWORD *count ) { if (!seen[i]) instance->dwType = DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( i ); @@ -331,6 +348,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps->report_id; instance.wCollectionNumber = caps->link_collection; + check_pid_effect_axis_caps( impl, &instance ); ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; value_ofs += sizeof(LONG); diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 019e7b7ae87..aad23ad4c61 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -6392,9 +6392,9 @@ static void test_force_feedback_joystick( void ) }; const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = { - {.type = TRUE, .flags = TRUE}, - {.type = TRUE, .flags = TRUE}, - {.type = TRUE, .flags = TRUE}, + {}, + {}, + {}, {.type = TRUE, .flags = TRUE}, {.type = TRUE, .flags = TRUE}, {},
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 9 ++++++++- dlls/dinput8/tests/hid.c | 8 ++------ 2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 846d4095391..1c7c54e20c9 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -285,7 +285,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, DWORD collection = 0, object = 0, axis = 0, button = 0, pov = 0, value_ofs = 0, button_ofs = 0, i, j; struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)impl->preparsed; DIDEVICEOBJECTINSTANCEW instance = {.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW)}; - struct hid_value_caps *caps, *caps_end, *nary, *nary_end; + struct hid_value_caps *caps, *caps_end, *nary, *nary_end, *effect_caps; DIDATAFORMAT *format = impl->base.data_format.wine_df; int *offsets = impl->base.data_format.offsets; struct hid_collection_node *node, *node_end; @@ -356,6 +356,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, } }
+ effect_caps = impl->pid_effect_update.trigger_button_caps; + for (caps = HID_INPUT_VALUE_CAPS( preparsed ), caps_end = caps + preparsed->input_caps_count; caps != caps_end; ++caps) { @@ -372,6 +374,11 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.dwOfs = button_ofs; instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( button++ ); instance.dwFlags = 0; + if (effect_caps && effect_caps->logical_min <= j && effect_caps->logical_max >= j) + { + instance.dwType |= DIDFT_FFEFFECTTRIGGER; + instance.dwFlags |= DIDOI_FFEFFECTTRIGGER; + } instance.wUsagePage = caps->usage_page; instance.wUsage = j; instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index aad23ad4c61..df0a07546fb 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3294,8 +3294,6 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c
struct check_objects_todos { - BOOL type; - BOOL flags; BOOL dimension; BOOL exponent; }; @@ -3323,9 +3321,7 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar check_member( *obj, *exp, "%u", dwSize ); check_member_guid( *obj, *exp, guidType ); check_member( *obj, *exp, "%#x", dwOfs ); - todo_wine_if( todo->type ) check_member( *obj, *exp, "%#x", dwType ); - todo_wine_if( todo->flags ) check_member( *obj, *exp, "%#x", dwFlags ); if (!localized) todo_wine check_member_wstr( *obj, *exp, tszName ); check_member( *obj, *exp, "%u", dwFFMaxForce ); @@ -6395,8 +6391,8 @@ static void test_force_feedback_joystick( void ) {}, {}, {}, - {.type = TRUE, .flags = TRUE}, - {.type = TRUE, .flags = TRUE}, + {}, + {}, {}, {}, {},
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 10 +++++++++ dlls/dinput8/tests/hid.c | 42 -------------------------------------- 2 files changed, 10 insertions(+), 42 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 1c7c54e20c9..2ef01ac6ace 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -348,6 +348,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps->report_id; instance.wCollectionNumber = caps->link_collection; + instance.dwDimension = caps->units; + instance.wExponent = caps->units_exp; check_pid_effect_axis_caps( impl, &instance ); ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; @@ -384,6 +386,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = caps->report_id; instance.wCollectionNumber = caps->link_collection; + instance.dwDimension = caps->units; + instance.wExponent = caps->units_exp; ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; button_ofs++; @@ -417,6 +421,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.guidType = GUID_Unknown; instance.wReportId = nary->report_id; instance.wCollectionNumber = nary->link_collection; + instance.dwDimension = caps->units; + instance.wExponent = caps->units_exp; ret = enum_object( impl, &filter, flags, callback, nary, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; button_ofs++; @@ -434,6 +440,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.guidType = GUID_Unknown; instance.wReportId = caps->report_id; instance.wCollectionNumber = caps->link_collection; + instance.dwDimension = caps->units; + instance.wExponent = caps->units_exp; ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret;
@@ -458,6 +466,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage ); instance.wReportId = 0; instance.wCollectionNumber = node->parent; + instance.dwDimension = 0; + instance.wExponent = 0; ret = enum_object( impl, &filter, flags, callback, NULL, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; } diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index df0a07546fb..e55adb0aa56 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3292,18 +3292,11 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c return DIENUM_CONTINUE; }
-struct check_objects_todos -{ - BOOL dimension; - BOOL exponent; -}; - struct check_objects_params { UINT index; UINT expect_count; const DIDEVICEOBJECTINSTANCEW *expect_objs; - const struct check_objects_todos *todo_objs; };
static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) @@ -3311,7 +3304,6 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar static const DIDEVICEOBJECTINSTANCEW unexpected_obj = {0}; struct check_objects_params *params = args; const DIDEVICEOBJECTINSTANCEW *exp = params->expect_objs + params->index; - const struct check_objects_todos *todo = params->todo_objs + params->index;
winetest_push_context( "obj[%d]", params->index );
@@ -3330,9 +3322,7 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar check_member( *obj, *exp, "%u", wDesignatorIndex ); check_member( *obj, *exp, "%#04x", wUsagePage ); check_member( *obj, *exp, "%#04x", wUsage ); - todo_wine_if( todo->dimension ) check_member( *obj, *exp, "%#04x", dwDimension ); - todo_wine_if( todo->exponent ) check_member( *obj, *exp, "%#04x", wExponent ); check_member( *obj, *exp, "%u", wReportId );
@@ -3652,14 +3642,12 @@ static void test_simple_joystick(void) .wUsage = HID_USAGE_GENERIC_JOYSTICK, }, }; - const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = {}; const DIEFFECTINFOW expect_effects[] = {};
struct check_objects_params check_objects_params = { .expect_count = ARRAY_SIZE(expect_objects), .expect_objs = expect_objects, - .todo_objs = objects_todos, }; struct check_effects_params check_effects_params = { @@ -6386,35 +6374,6 @@ static void test_force_feedback_joystick( void ) .wUsage = PID_USAGE_SET_ENVELOPE_REPORT, }, }; - const struct check_objects_todos objects_todos[ARRAY_SIZE(expect_objects)] = - { - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {.dimension = TRUE, .exponent = TRUE}, - {.dimension = TRUE, .exponent = TRUE}, - {}, - {}, - {}, - {}, - {.dimension = TRUE, .exponent = TRUE}, - {.dimension = TRUE, .exponent = TRUE}, - }; const DIEFFECTINFOW expect_effects[] = { { @@ -6443,7 +6402,6 @@ static void test_force_feedback_joystick( void ) { .expect_count = ARRAY_SIZE(expect_objects), .expect_objs = expect_objects, - .todo_objs = objects_todos, }; struct check_effects_params check_effects_params = {
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 99 +++++++++++++++++++++++++++++++++++++- dlls/dinput8/tests/hid.c | 8 +-- 2 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2ef01ac6ace..f8623ce7fdb 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -224,6 +224,89 @@ static const WCHAR *effect_guid_to_string( const GUID *guid ) return NULL; }
+static const WCHAR *object_usage_to_string( DIDEVICEOBJECTINSTANCEW *instance ) +{ + static const WCHAR x_axis_w[] = {'X',' ','A','x','i','s',0}; + static const WCHAR y_axis_w[] = {'Y',' ','A','x','i','s',0}; + static const WCHAR z_axis_w[] = {'Z',' ','A','x','i','s',0}; + static const WCHAR x_rotation_w[] = {'X',' ','R','o','t','a','t','i','o','n',0}; + static const WCHAR y_rotation_w[] = {'Y',' ','R','o','t','a','t','i','o','n',0}; + static const WCHAR z_rotation_w[] = {'Z',' ','R','o','t','a','t','i','o','n',0}; + static const WCHAR wheel_w[] = {'W','h','e','e','l',0}; + static const WCHAR hat_switch_w[] = {'H','a','t',' ','S','w','i','t','c','h',0}; + static const WCHAR joystick_w[] = {'J','o','y','s','t','i','c','k',0}; + + static const WCHAR dc_device_reset_w[] = {'D','C',' ','D','e','v','i','c','e',' ','R','e','s','e','t',0}; + static const WCHAR effect_block_index_w[] = {'E','f','f','e','c','t',' ','B','l','o','c','k',' ','I','n','d','e','x',0}; + static const WCHAR op_effect_start_w[] = {'O','p',' ','E','f','f','e','c','t',' ','S','t','a','r','t',0}; + static const WCHAR op_effect_start_solo_w[] = {'O','p',' ','E','f','f','e','c','t',' ','S','t','a','r','t',' ','S','o','l','o',0}; + static const WCHAR op_effect_stop_w[] = {'O','p',' ','E','f','f','e','c','t',' ','S','t','o','p',0}; + static const WCHAR loop_count_w[] = {'L','o','o','p',' ','C','o','u','n','t',0}; + static const WCHAR et_square_w[] = {'E','T',' ','S','q','u','a','r','e',0}; + static const WCHAR et_sine_w[] = {'E','T',' ','S','i','n','e',0}; + static const WCHAR direction_enable_w[] = {'D','i','r','e','c','t','i','o','n',' ','E','n','a','b','l','e',0}; + static const WCHAR magnitude_w[] = {'M','a','g','n','i','t','u','d','e',0}; + static const WCHAR state_report_w[] = {'P','I','D',' ','S','t','a','t','e',' ','R','e','p','o','r','t',0}; + static const WCHAR device_control_report_w[] = {'P','I','D',' ','D','e','v','i','c','e',' ','C','o','n','t','r','o','l',' ','R','e','p','o','r','t',0}; + static const WCHAR device_control_w[] = {'P','I','D',' ','D','e','v','i','c','e',' ','C','o','n','t','r','o','l',0}; + static const WCHAR effect_operation_report_w[] = {'E','f','f','e','c','t',' ','O','p','e','r','a','t','i','o','n',' ','R','e','p','o','r','t',0}; + static const WCHAR effect_operation_w[] = {'E','f','f','e','c','t',' ','O','p','e','r','a','t','i','o','n',0}; + static const WCHAR set_effect_report_w[] = {'S','e','t',' ','E','f','f','e','c','t',' ','R','e','p','o','r','t',0}; + static const WCHAR effect_type_w[] = {'E','f','f','e','c','t',' ','T','y','p','e',0}; + static const WCHAR axes_enable_w[] = {'A','x','e','s',' ','E','n','a','b','l','e',0}; + static const WCHAR set_periodic_report_w[] = {'S','e','t',' ','P','e','r','i','o','d','i','c',' ','R','e','p','o','r','t',0}; + static const WCHAR start_delay_w[] = {'S','t','a','r','t',' ','D','e','l','a','y',0}; + static const WCHAR duration_w[] = {'D','u','r','a','t','i','o','n',0}; + static const WCHAR trigger_button_w[] = {'T','r','i','g','g','e','r',' ','B','u','t','t','o','n',0}; + static const WCHAR fade_level_w[] = {'F','a','d','e',' ','L','e','v','e','l',0}; + static const WCHAR attack_level_w[] = {'A','t','t','a','c','k',' ','L','e','v','e','l',0}; + static const WCHAR fade_time_w[] = {'F','a','d','e',' ','T','i','m','e',0}; + static const WCHAR attack_time_w[] = {'A','t','t','a','c','k',' ','T','i','m','e',0}; + static const WCHAR set_envelope_report_w[] = {'S','e','t',' ','E','n','v','e','l','o','p','e',' ','R','e','p','o','r','t',0}; + + switch (MAKELONG(instance->wUsage, instance->wUsagePage)) + { + case MAKELONG(HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC): return x_axis_w; + case MAKELONG(HID_USAGE_GENERIC_Y, HID_USAGE_PAGE_GENERIC): return y_axis_w; + case MAKELONG(HID_USAGE_GENERIC_Z, HID_USAGE_PAGE_GENERIC): return z_axis_w; + case MAKELONG(HID_USAGE_GENERIC_RX, HID_USAGE_PAGE_GENERIC): return x_rotation_w; + case MAKELONG(HID_USAGE_GENERIC_RY, HID_USAGE_PAGE_GENERIC): return y_rotation_w; + case MAKELONG(HID_USAGE_GENERIC_RZ, HID_USAGE_PAGE_GENERIC): return z_rotation_w; + case MAKELONG(HID_USAGE_GENERIC_WHEEL, HID_USAGE_PAGE_GENERIC): return wheel_w; + case MAKELONG(HID_USAGE_GENERIC_HATSWITCH, HID_USAGE_PAGE_GENERIC): return hat_switch_w; + case MAKELONG(HID_USAGE_GENERIC_JOYSTICK, HID_USAGE_PAGE_GENERIC): return joystick_w; + + case MAKELONG(PID_USAGE_DC_DEVICE_RESET, HID_USAGE_PAGE_PID): return dc_device_reset_w; + case MAKELONG(PID_USAGE_EFFECT_BLOCK_INDEX, HID_USAGE_PAGE_PID): return effect_block_index_w; + case MAKELONG(PID_USAGE_OP_EFFECT_START, HID_USAGE_PAGE_PID): return op_effect_start_w; + case MAKELONG(PID_USAGE_OP_EFFECT_START_SOLO, HID_USAGE_PAGE_PID): return op_effect_start_solo_w; + case MAKELONG(PID_USAGE_OP_EFFECT_STOP, HID_USAGE_PAGE_PID): return op_effect_stop_w; + case MAKELONG(PID_USAGE_LOOP_COUNT, HID_USAGE_PAGE_PID): return loop_count_w; + case MAKELONG(PID_USAGE_ET_SQUARE, HID_USAGE_PAGE_PID): return et_square_w; + case MAKELONG(PID_USAGE_ET_SINE, HID_USAGE_PAGE_PID): return et_sine_w; + case MAKELONG(PID_USAGE_DIRECTION_ENABLE, HID_USAGE_PAGE_PID): return direction_enable_w; + case MAKELONG(PID_USAGE_MAGNITUDE, HID_USAGE_PAGE_PID): return magnitude_w; + case MAKELONG(PID_USAGE_STATE_REPORT, HID_USAGE_PAGE_PID): return state_report_w; + case MAKELONG(PID_USAGE_DEVICE_CONTROL_REPORT, HID_USAGE_PAGE_PID): return device_control_report_w; + case MAKELONG(PID_USAGE_DEVICE_CONTROL, HID_USAGE_PAGE_PID): return device_control_w; + case MAKELONG(PID_USAGE_EFFECT_OPERATION_REPORT, HID_USAGE_PAGE_PID): return effect_operation_report_w; + case MAKELONG(PID_USAGE_EFFECT_OPERATION, HID_USAGE_PAGE_PID): return effect_operation_w; + case MAKELONG(PID_USAGE_SET_EFFECT_REPORT, HID_USAGE_PAGE_PID): return set_effect_report_w; + case MAKELONG(PID_USAGE_EFFECT_TYPE, HID_USAGE_PAGE_PID): return effect_type_w; + case MAKELONG(PID_USAGE_AXES_ENABLE, HID_USAGE_PAGE_PID): return axes_enable_w; + case MAKELONG(PID_USAGE_SET_PERIODIC_REPORT, HID_USAGE_PAGE_PID): return set_periodic_report_w; + case MAKELONG(PID_USAGE_START_DELAY, HID_USAGE_PAGE_PID): return start_delay_w; + case MAKELONG(PID_USAGE_DURATION, HID_USAGE_PAGE_PID): return duration_w; + case MAKELONG(PID_USAGE_TRIGGER_BUTTON, HID_USAGE_PAGE_PID): return trigger_button_w; + case MAKELONG(PID_USAGE_FADE_LEVEL, HID_USAGE_PAGE_PID): return fade_level_w; + case MAKELONG(PID_USAGE_ATTACK_LEVEL, HID_USAGE_PAGE_PID): return attack_level_w; + case MAKELONG(PID_USAGE_FADE_TIME, HID_USAGE_PAGE_PID): return fade_time_w; + case MAKELONG(PID_USAGE_ATTACK_TIME, HID_USAGE_PAGE_PID): return attack_time_w; + case MAKELONG(PID_USAGE_SET_ENVELOPE_REPORT, HID_USAGE_PAGE_PID): return set_envelope_report_w; + default: return NULL; + } +} + typedef BOOL (*enum_object_callback)( struct hid_joystick *impl, struct hid_value_caps *caps, DIDEVICEOBJECTINSTANCEW *instance, void *data );
@@ -282,7 +365,10 @@ static void set_axis_type( DIDEVICEOBJECTINSTANCEW *instance, BOOL *seen, DWORD static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, DWORD flags, enum_object_callback callback, void *data ) { - DWORD collection = 0, object = 0, axis = 0, button = 0, pov = 0, value_ofs = 0, button_ofs = 0, i, j; + static const WCHAR collection_format_w[] = {'C','o','l','l','e','c','t','i','o','n',' ','%','u',' ','-',' ',0}; + static const WCHAR usage_format_w[] = {'U','s','a','g','e',' ','%','0','4','x',':','%','0','4','x',0}; + static const WCHAR button_format_w[] = {'B','u','t','t','o','n',' ','%','u',0}; + DWORD collection = 0, object = 0, axis = 0, button = 0, pov = 0, value_ofs = 0, button_ofs = 0, len, i, j; struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)impl->preparsed; DIDEVICEOBJECTINSTANCEW instance = {.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW)}; struct hid_value_caps *caps, *caps_end, *nary, *nary_end, *effect_caps; @@ -291,6 +377,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, struct hid_collection_node *node, *node_end; DIPROPHEADER filter = *header; BOOL ret, seen_axis[6] = {0}; + const WCHAR *tmp;
if (filter.dwHow == DIPH_BYOFFSET) { @@ -350,6 +437,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.wCollectionNumber = caps->link_collection; instance.dwDimension = caps->units; instance.wExponent = caps->units_exp; + if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); + else snprintfW( instance.tszName, MAX_PATH, usage_format_w, instance.wUsagePage, instance.wUsage ); check_pid_effect_axis_caps( impl, &instance ); ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; @@ -388,6 +477,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.wCollectionNumber = caps->link_collection; instance.dwDimension = caps->units; instance.wExponent = caps->units_exp; + snprintfW( instance.tszName, MAX_PATH, button_format_w, DIDFT_GETINSTANCE( instance.dwType ) ); ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; button_ofs++; @@ -423,6 +513,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.wCollectionNumber = nary->link_collection; instance.dwDimension = caps->units; instance.wExponent = caps->units_exp; + if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); + else snprintfW( instance.tszName, MAX_PATH, usage_format_w, instance.wUsagePage, instance.wUsage ); ret = enum_object( impl, &filter, flags, callback, nary, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; button_ofs++; @@ -442,6 +534,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.wCollectionNumber = caps->link_collection; instance.dwDimension = caps->units; instance.wExponent = caps->units_exp; + if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName, tmp, MAX_PATH ); + else snprintfW( instance.tszName, MAX_PATH, usage_format_w, instance.wUsagePage, instance.wUsage ); ret = enum_object( impl, &filter, flags, callback, caps, &instance, data ); if (ret != DIENUM_CONTINUE) return ret;
@@ -468,6 +562,9 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, instance.wCollectionNumber = node->parent; instance.dwDimension = 0; instance.wExponent = 0; + len = snprintfW( instance.tszName, MAX_PATH, collection_format_w, DIDFT_GETINSTANCE( instance.dwType ) ); + if ((tmp = object_usage_to_string( &instance ))) lstrcpynW( instance.tszName + len, tmp, MAX_PATH - len ); + else snprintfW( instance.tszName + len, MAX_PATH - len, usage_format_w, instance.wUsagePage, instance.wUsage ); ret = enum_object( impl, &filter, flags, callback, NULL, &instance, data ); if (ret != DIENUM_CONTINUE) return ret; } diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index e55adb0aa56..4e02fe73394 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3315,7 +3315,7 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar check_member( *obj, *exp, "%#x", dwOfs ); check_member( *obj, *exp, "%#x", dwType ); check_member( *obj, *exp, "%#x", dwFlags ); - if (!localized) todo_wine check_member_wstr( *obj, *exp, tszName ); + if (!localized) check_member_wstr( *obj, *exp, tszName ); check_member( *obj, *exp, "%u", dwFFMaxForce ); check_member( *obj, *exp, "%u", dwFFForceResolution ); check_member( *obj, *exp, "%u", wCollectionNumber ); @@ -4022,7 +4022,7 @@ static void test_simple_joystick(void) check_member( objinst, expect_objects[1], "%#x", dwOfs ); check_member( objinst, expect_objects[1], "%#x", dwType ); check_member( objinst, expect_objects[1], "%#x", dwFlags ); - if (!localized) todo_wine check_member_wstr( objinst, expect_objects[1], tszName ); + if (!localized) check_member_wstr( objinst, expect_objects[1], tszName ); check_member( objinst, expect_objects[1], "%u", dwFFMaxForce ); check_member( objinst, expect_objects[1], "%u", dwFFForceResolution ); check_member( objinst, expect_objects[1], "%u", wCollectionNumber ); @@ -4049,7 +4049,7 @@ static void test_simple_joystick(void) check_member( objinst, expect_objects[5], "%#x", dwOfs ); check_member( objinst, expect_objects[5], "%#x", dwType ); check_member( objinst, expect_objects[5], "%#x", dwFlags ); - if (!localized) todo_wine check_member_wstr( objinst, expect_objects[5], tszName ); + if (!localized) check_member_wstr( objinst, expect_objects[5], tszName ); check_member( objinst, expect_objects[5], "%u", dwFFMaxForce ); check_member( objinst, expect_objects[5], "%u", dwFFForceResolution ); check_member( objinst, expect_objects[5], "%u", wCollectionNumber ); @@ -4107,7 +4107,7 @@ static void test_simple_joystick(void) check_member( objinst, expect_objects[0], "%#x", dwOfs ); check_member( objinst, expect_objects[0], "%#x", dwType ); check_member( objinst, expect_objects[0], "%#x", dwFlags ); - if (!localized) todo_wine check_member_wstr( objinst, expect_objects[0], tszName ); + if (!localized) check_member_wstr( objinst, expect_objects[0], tszName ); check_member( objinst, expect_objects[0], "%u", dwFFMaxForce ); check_member( objinst, expect_objects[0], "%u", dwFFForceResolution ); check_member( objinst, expect_objects[0], "%u", wCollectionNumber );
Please ignore that last patch, I'm not sure it's really useful to implement these names as they are localized, and I didn't want to send it yet anyway.