Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/tests/driver_bus.c | 2 +- dlls/dinput/tests/driver_hid.h | 4 +++- dlls/dinput/tests/force_feedback.c | 11 +++++++---- dlls/dinput/tests/hid.c | 4 ++++ dlls/dinput/tests/hotplug.c | 1 + dlls/dinput/tests/joystick8.c | 21 ++++++++++++++++----- 6 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/dlls/dinput/tests/driver_bus.c b/dlls/dinput/tests/driver_bus.c index 45a984b6c36..9ece4414a1a 100644 --- a/dlls/dinput/tests/driver_bus.c +++ b/dlls/dinput/tests/driver_bus.c @@ -458,7 +458,7 @@ struct phys_device
BOOL use_report_id; DWORD report_descriptor_len; - char report_descriptor_buf[1024]; + char report_descriptor_buf[MAX_HID_DESCRIPTOR_LEN];
HIDP_CAPS caps; HID_DEVICE_ATTRIBUTES attributes; diff --git a/dlls/dinput/tests/driver_hid.h b/dlls/dinput/tests/driver_hid.h index 1010499fc41..4711d391bfe 100644 --- a/dlls/dinput/tests/driver_hid.h +++ b/dlls/dinput/tests/driver_hid.h @@ -62,13 +62,15 @@ struct hid_expect };
/* create/remove device */ +#define MAX_HID_DESCRIPTOR_LEN 2048 + struct hid_device_desc { BOOL is_polled; BOOL use_report_id;
DWORD report_descriptor_len; - char report_descriptor_buf[1024]; + char report_descriptor_buf[MAX_HID_DESCRIPTOR_LEN];
HIDP_CAPS caps; HID_DEVICE_ATTRIBUTES attributes; diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index d9dad38446c..f6525657450 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -1672,7 +1672,8 @@ static void test_condition_effect( IDirectInputDevice8W *device, HANDLE file, DW static BOOL test_force_feedback_joystick( DWORD version ) { #include "psh_hid_macros.h" - const unsigned char report_descriptor[] = { + const unsigned char report_descriptor[] = + { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), USAGE(1, HID_USAGE_GENERIC_JOYSTICK), COLLECTION(1, Application), @@ -2005,7 +2006,7 @@ static BOOL test_force_feedback_joystick( DWORD version ) END_COLLECTION, END_COLLECTION, }; -#undef REPORT_ID_OR_USAGE_PAGE + C_ASSERT(sizeof(report_descriptor) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -3460,6 +3461,7 @@ static void test_device_managed_effect(void) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(report_descriptor) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -4576,7 +4578,8 @@ struct bool_async_handler default_bool_async_handler = {{&bool_async_handler_vtb static void test_windows_gaming_input(void) { #include "psh_hid_macros.h" - const unsigned char report_desc[] = { + const unsigned char report_desc[] = + { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), USAGE(1, HID_USAGE_GENERIC_JOYSTICK), COLLECTION(1, Application), @@ -4997,7 +5000,7 @@ static void test_windows_gaming_input(void) END_COLLECTION, END_COLLECTION, }; -#undef REPORT_ID_OR_USAGE_PAGE + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = diff --git a/dlls/dinput/tests/hid.c b/dlls/dinput/tests/hid.c index 4e107625064..66019e766ad 100644 --- a/dlls/dinput/tests/hid.c +++ b/dlls/dinput/tests/hid.c @@ -2855,6 +2855,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled ) END_COLLECTION, }; #undef REPORT_ID_OR_USAGE_PAGE + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
const HIDP_CAPS caps = @@ -3063,6 +3064,7 @@ static void test_hidp_kdr(void) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -3572,6 +3574,7 @@ DWORD WINAPI dinput_test_device_thread( void *stop_event ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(gamepad_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h" static const HID_DEVICE_ATTRIBUTES attributes = { @@ -3616,6 +3619,7 @@ static void test_bus_driver(void) INPUT(1, Data|Var|Abs), END_COLLECTION, }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
static const HID_DEVICE_ATTRIBUTES attributes = diff --git a/dlls/dinput/tests/hotplug.c b/dlls/dinput/tests/hotplug.c index 2d000317c9f..fca04c36ef5 100644 --- a/dlls/dinput/tests/hotplug.c +++ b/dlls/dinput/tests/hotplug.c @@ -133,6 +133,7 @@ static BOOL test_input_lost( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index 32d03a603c3..eeb8b90d0c8 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -396,7 +396,7 @@ static void test_simple_joystick( DWORD version ) END_COLLECTION, END_COLLECTION, }; -#undef REPORT_ID_OR_USAGE_PAGE + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -2110,6 +2110,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(unknown_desc) < MAX_HID_DESCRIPTOR_LEN); static const unsigned char limited_desc[] = { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), @@ -2140,6 +2141,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(limited_desc) < MAX_HID_DESCRIPTOR_LEN); static const unsigned char gamepad_desc[] = { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), @@ -2170,6 +2172,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(gamepad_desc) < MAX_HID_DESCRIPTOR_LEN); static const unsigned char joystick_desc[] = { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), @@ -2210,6 +2213,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(joystick_desc) < MAX_HID_DESCRIPTOR_LEN); static const unsigned char wheel_steering_only_desc[] = { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), @@ -2248,6 +2252,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(wheel_steering_only_desc) < MAX_HID_DESCRIPTOR_LEN); static const unsigned char wheel_dualpedals_desc[] = { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), @@ -2289,6 +2294,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(wheel_dualpedals_desc) < MAX_HID_DESCRIPTOR_LEN); static const unsigned char wheel_threepedals_desc[] = { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), @@ -2331,6 +2337,7 @@ static BOOL test_device_types( DWORD version ) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(wheel_threepedals_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
static struct device_desc device_desc[] = @@ -2690,7 +2697,7 @@ static void test_many_axes_joystick(void) END_COLLECTION, END_COLLECTION, }; -#undef REPORT_ID_OR_USAGE_PAGE + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -3221,7 +3228,7 @@ static void test_driving_wheel_axes(void) END_COLLECTION, END_COLLECTION, }; -#undef REPORT_ID_OR_USAGE_PAGE + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -3415,7 +3422,8 @@ done: static BOOL test_winmm_joystick(void) { #include "psh_hid_macros.h" - const unsigned char report_desc[] = { + const unsigned char report_desc[] = + { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), USAGE(1, HID_USAGE_GENERIC_JOYSTICK), COLLECTION(1, Application), @@ -3461,6 +3469,7 @@ static BOOL test_winmm_joystick(void) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -3864,7 +3873,8 @@ static struct controller_handler controller_added = {{&controller_handler_vtbl}} static void test_windows_gaming_input(void) { #include "psh_hid_macros.h" - const unsigned char report_desc[] = { + const unsigned char report_desc[] = + { USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), USAGE(1, HID_USAGE_GENERIC_GAMEPAD), COLLECTION(1, Application), @@ -3906,6 +3916,7 @@ static void test_windows_gaming_input(void) END_COLLECTION, END_COLLECTION, }; + C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc =
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/tests/force_feedback.c | 44 ++---------- dlls/dinput/tests/joystick8.c | 109 +++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 40 deletions(-)
diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index f6525657450..c07cdf66b02 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -4587,17 +4587,15 @@ static void test_windows_gaming_input(void) COLLECTION(1, Physical), REPORT_ID(1, 1),
- USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_STEERING), - USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_ACCELERATOR), - USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_BRAKE), - USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_CLUTCH), 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, 127), PHYSICAL_MINIMUM(1, 0), PHYSICAL_MAXIMUM(1, 127), REPORT_SIZE(1, 8), - REPORT_COUNT(1, 5), + REPORT_COUNT(1, 3), INPUT(1, Data|Var|Abs),
USAGE(1, HID_USAGE_GENERIC_HATSWITCH), @@ -5006,7 +5004,7 @@ static void test_windows_gaming_input(void) struct hid_device_desc desc = { .use_report_id = TRUE, - .caps = { .InputReportByteLength = 8 }, + .caps = { .InputReportByteLength = 6 }, .attributes = default_attributes, }; struct hid_expect expect_init[] = @@ -5148,7 +5146,6 @@ static void test_windows_gaming_input(void) }; static const WCHAR *force_feedback_motor = RuntimeClass_Windows_Gaming_Input_ForceFeedback_ForceFeedbackMotor; static const WCHAR *controller_class_name = RuntimeClass_Windows_Gaming_Input_RawGameController; - static const WCHAR *racing_wheel_class_name = RuntimeClass_Windows_Gaming_Input_RacingWheel;
DIPROPGUIDANDPATH guid_path = { @@ -5166,16 +5163,11 @@ static void test_windows_gaming_input(void) EventRegistrationToken controller_added_token; struct bool_async_handler bool_async_handler; IVectorView_ForceFeedbackMotor *motors_view; - IVectorView_RacingWheel *racing_wheels_view; - IRacingWheelStatics2 *racing_wheel_statics2; - IRacingWheelStatics *racing_wheel_statics; ForceFeedbackEffectAxes supported_axes; IAsyncOperation_boolean *bool_async; IRawGameController *raw_controller; - IGameController *game_controller; IDirectInputDevice8W *device; IForceFeedbackMotor *motor; - IRacingWheel *racing_wheel; BOOLEAN paused, enabled; IAsyncInfo *async_info; DOUBLE gain; @@ -5244,34 +5236,6 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "GetAt returned %#lx\n", hr ); IVectorView_RawGameController_Release( controllers_view );
- hr = pWindowsCreateString( racing_wheel_class_name, wcslen( racing_wheel_class_name ), &str ); - ok( hr == S_OK, "WindowsCreateString returned %#lx\n", hr ); - hr = pRoGetActivationFactory( str, &IID_IRacingWheelStatics, (void **)&racing_wheel_statics ); - ok( hr == S_OK, "RoGetActivationFactory returned %#lx\n", hr ); - hr = pRoGetActivationFactory( str, &IID_IRacingWheelStatics2, (void **)&racing_wheel_statics2 ); - ok( hr == S_OK, "RoGetActivationFactory returned %#lx\n", hr ); - pWindowsDeleteString( str ); - - /* HID driving wheels aren't exposed as WGI gamepads on Windows */ - - hr = IRacingWheelStatics_get_RacingWheels( racing_wheel_statics, &racing_wheels_view ); - ok( hr == S_OK, "get_RacingWheels returned %#lx\n", hr ); - hr = IVectorView_RacingWheel_get_Size( racing_wheels_view, &size ); - ok( hr == S_OK, "get_Size returned %#lx\n", hr ); - todo_wine /* but Wine currently intentionally does */ - ok( size == 0, "got size %u\n", size ); - IVectorView_RacingWheel_Release( racing_wheels_view ); - IRacingWheelStatics_Release( racing_wheel_statics ); - - hr = IRawGameController_QueryInterface( raw_controller, &IID_IGameController, (void **)&game_controller ); - ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); - hr = IRacingWheelStatics2_FromGameController( racing_wheel_statics2, game_controller, &racing_wheel ); - ok( hr == S_OK, "FromGameController returned %#lx\n", hr ); - todo_wine - ok( racing_wheel == NULL, "got racing_wheel %p\n", racing_wheel ); - IGameController_Release( game_controller ); - IRacingWheelStatics2_Release( racing_wheel_statics2 ); - set_hid_expect( file, expect_acquire, sizeof(expect_acquire) ); hr = IRawGameController_get_ForceFeedbackMotors( raw_controller, &motors_view ); ok( hr == S_OK, "get_ForceFeedbackMotors returned %#lx\n", hr ); diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index eeb8b90d0c8..08a4e6b5597 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -3917,6 +3917,49 @@ static void test_windows_gaming_input(void) END_COLLECTION, }; C_ASSERT(sizeof(report_desc) < MAX_HID_DESCRIPTOR_LEN); + static const unsigned char wheel_threepedals_desc[] = + { + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_JOYSTICK), + COLLECTION(1, Application), + USAGE(1, HID_USAGE_GENERIC_JOYSTICK), + COLLECTION(1, Physical), + USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_STEERING), + USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_ACCELERATOR), + USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_BRAKE), + USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_CLUTCH), + USAGE(1, HID_USAGE_GENERIC_Y), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 127), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 127), + REPORT_SIZE(1, 8), + REPORT_COUNT(1, 5), + INPUT(1, Data|Var|Abs), + + USAGE(1, HID_USAGE_GENERIC_HATSWITCH), + LOGICAL_MINIMUM(1, 1), + LOGICAL_MAXIMUM(1, 8), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 8), + REPORT_SIZE(1, 8), + REPORT_COUNT(1, 1), + INPUT(1, Data|Var|Abs|Null), + + USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_MINIMUM(1, 1), + USAGE_MAXIMUM(1, 5), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 1), + REPORT_SIZE(1, 1), + REPORT_COUNT(1, 16), + INPUT(1, Data|Var|Abs), + END_COLLECTION, + END_COLLECTION, + }; + C_ASSERT(sizeof(wheel_threepedals_desc) < MAX_HID_DESCRIPTOR_LEN); #include "pop_hid_macros.h"
struct hid_device_desc desc = @@ -3926,15 +3969,20 @@ static void test_windows_gaming_input(void) .attributes = default_attributes, }; static const WCHAR *controller_class_name = RuntimeClass_Windows_Gaming_Input_RawGameController; + static const WCHAR *racing_wheel_class_name = RuntimeClass_Windows_Gaming_Input_RacingWheel; static const WCHAR *gamepad_class_name = RuntimeClass_Windows_Gaming_Input_Gamepad;
IRawGameController *raw_controller, *tmp_raw_controller; IVectorView_RawGameController *controllers_view; IRawGameControllerStatics *controller_statics; EventRegistrationToken controller_added_token; + IVectorView_RacingWheel *racing_wheels_view; + IRacingWheelStatics2 *racing_wheel_statics2; + IRacingWheelStatics *racing_wheel_statics; IVectorView_Gamepad *gamepads_view; IGamepadStatics *gamepad_statics; IGameController *game_controller; + IRacingWheel *racing_wheel; UINT32 size; HSTRING str; HRESULT hr; @@ -4044,6 +4092,67 @@ static void test_windows_gaming_input(void) hr = IRawGameControllerStatics_remove_RawGameControllerAdded( controller_statics, controller_added_token ); ok( hr == S_OK, "remove_RawGameControllerAdded returned %#lx\n", hr );
+ hid_device_stop( &desc ); + + + desc.report_descriptor_len = sizeof(wheel_threepedals_desc); + memcpy( desc.report_descriptor_buf, wheel_threepedals_desc, sizeof(wheel_threepedals_desc) ); + fill_context( __LINE__, desc.context, ARRAY_SIZE(desc.context) ); + + controller_added.event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ok( !!controller_added.event, "CreateEventW failed, error %lu\n", GetLastError() ); + + hr = IRawGameControllerStatics_add_RawGameControllerAdded( controller_statics, &controller_added.IEventHandler_RawGameController_iface, + &controller_added_token ); + ok( hr == S_OK, "add_RawGameControllerAdded returned %#lx\n", hr ); + ok( controller_added_token.value, "got token %I64u\n", controller_added_token.value ); + + if (!hid_device_start( &desc )) goto done; + WaitForSingleObject( controller_added.event, INFINITE ); + CloseHandle( controller_added.event ); + + hr = IRawGameControllerStatics_get_RawGameControllers( controller_statics, &controllers_view ); + ok( hr == S_OK, "get_RawGameControllers returned %#lx\n", hr ); + hr = IVectorView_RawGameController_get_Size( controllers_view, &size ); + ok( hr == S_OK, "get_Size returned %#lx\n", hr ); + ok( size == 1, "got size %u\n", size ); + hr = IVectorView_RawGameController_GetAt( controllers_view, 0, &raw_controller ); + ok( hr == S_OK, "GetAt returned %#lx\n", hr ); + IVectorView_RawGameController_Release( controllers_view ); + + hr = IRawGameControllerStatics_remove_RawGameControllerAdded( controller_statics, controller_added_token ); + ok( hr == S_OK, "remove_RawGameControllerAdded returned %#lx\n", hr ); + + hr = pWindowsCreateString( racing_wheel_class_name, wcslen( racing_wheel_class_name ), &str ); + ok( hr == S_OK, "WindowsCreateString returned %#lx\n", hr ); + hr = pRoGetActivationFactory( str, &IID_IRacingWheelStatics, (void **)&racing_wheel_statics ); + ok( hr == S_OK, "RoGetActivationFactory returned %#lx\n", hr ); + hr = pRoGetActivationFactory( str, &IID_IRacingWheelStatics2, (void **)&racing_wheel_statics2 ); + ok( hr == S_OK, "RoGetActivationFactory returned %#lx\n", hr ); + pWindowsDeleteString( str ); + + /* HID driving wheels aren't exposed as WGI RacingWheel on Windows */ + + hr = IRacingWheelStatics_get_RacingWheels( racing_wheel_statics, &racing_wheels_view ); + ok( hr == S_OK, "get_RacingWheels returned %#lx\n", hr ); + hr = IVectorView_RacingWheel_get_Size( racing_wheels_view, &size ); + ok( hr == S_OK, "get_Size returned %#lx\n", hr ); + todo_wine /* but Wine currently intentionally does */ + ok( size == 0, "got size %u\n", size ); + IVectorView_RacingWheel_Release( racing_wheels_view ); + IRacingWheelStatics_Release( racing_wheel_statics ); + + hr = IRawGameController_QueryInterface( raw_controller, &IID_IGameController, (void **)&game_controller ); + ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); + hr = IRacingWheelStatics2_FromGameController( racing_wheel_statics2, game_controller, &racing_wheel ); + ok( hr == S_OK, "FromGameController returned %#lx\n", hr ); + todo_wine + ok( racing_wheel == NULL, "got racing_wheel %p\n", racing_wheel ); + if (racing_wheel) IRacingWheel_Release( racing_wheel ); + IGameController_Release( game_controller ); + IRacingWheelStatics2_Release( racing_wheel_statics2 ); + + IRawGameController_Release( raw_controller ); IRawGameControllerStatics_Release( controller_statics );
done:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/tests/driver_bus.c | 10 +++++----- dlls/dinput/tests/force_feedback.c | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/dinput/tests/driver_bus.c b/dlls/dinput/tests/driver_bus.c index 9ece4414a1a..cadf8a0043c 100644 --- a/dlls/dinput/tests/driver_bus.c +++ b/dlls/dinput/tests/driver_bus.c @@ -1076,7 +1076,7 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size ); ok( !out_size, "got output size %lu\n", out_size ); - ok( packet->reportBufferLen >= expected_size, "got report size %lu\n", packet->reportBufferLen ); + ok( packet->reportBufferLen <= expected_size, "got report size %lu\n", packet->reportBufferLen );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) ); winetest_push_context( "%s expect[%ld]", context, index ); @@ -1099,7 +1099,7 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) ok( !in_size, "got input size %lu\n", in_size ); ok( out_size == sizeof(*packet), "got output size %lu\n", out_size );
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen ); + ok( packet->reportBufferLen <= expected_size, "got len %lu\n", packet->reportBufferLen ); ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, FALSE, context, sizeof(context) ); @@ -1123,7 +1123,7 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) ok( in_size == sizeof(*packet), "got input size %lu\n", in_size ); ok( !out_size, "got output size %lu\n", out_size );
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen ); + ok( packet->reportBufferLen <= expected_size, "got len %lu\n", packet->reportBufferLen ); ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) ); @@ -1147,7 +1147,7 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) ok( !in_size, "got input size %lu\n", in_size ); ok( out_size == sizeof(*packet), "got output size %lu\n", out_size );
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen ); + ok( packet->reportBufferLen <= expected_size, "got len %lu\n", packet->reportBufferLen ); ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, FALSE, context, sizeof(context) ); @@ -1171,7 +1171,7 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) ok( in_size == sizeof(*packet), "got input size %lu\n", in_size ); ok( !out_size, "got output size %lu\n", out_size );
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen ); + ok( packet->reportBufferLen <= expected_size, "got len %lu\n", packet->reportBufferLen ); ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) ); diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index c07cdf66b02..ed8c15ae55f 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -2012,7 +2012,11 @@ static BOOL test_force_feedback_joystick( DWORD version ) struct hid_device_desc desc = { .use_report_id = TRUE, - .caps = { .InputReportByteLength = 5 }, + .caps = + { + .InputReportByteLength = 5, + .OutputReportByteLength = 11, + }, .attributes = default_attributes, }; const DIDEVCAPS expect_caps = @@ -3467,7 +3471,12 @@ static void test_device_managed_effect(void) struct hid_device_desc desc = { .use_report_id = TRUE, - .caps = { .InputReportByteLength = 5 }, + .caps = + { + .InputReportByteLength = 5, + .OutputReportByteLength = 11, + .FeatureReportByteLength = 5, + }, .attributes = default_attributes, }; struct hid_expect expect_acquire[] = @@ -5004,7 +5013,12 @@ static void test_windows_gaming_input(void) struct hid_device_desc desc = { .use_report_id = TRUE, - .caps = { .InputReportByteLength = 6 }, + .caps = + { + .InputReportByteLength = 6, + .OutputReportByteLength = 11, + .FeatureReportByteLength = 5, + }, .attributes = default_attributes, }; struct hid_expect expect_init[] =
PATCH 3 is wrong, I've cancelled the run and I will resend. PATCH 2 possibly too, I'll have a look.