Commit graph

1324 commits

Author SHA1 Message Date
Rémi Bernon 1854001c79 dinput/tests: Remove racy IForceFeedbackEffect reference count checks.
Because the async operation holds a reference on the invoker and the
param, it may keep the effect alive until the worker thread releases
its reference on the async operation. We have no way to synchronize on
that.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53199
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-07-07 11:20:27 +02:00
Rémi Bernon 2020541b4b dinput/tests: Avoid window activation race conditions with Wine.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53240
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-07-07 11:20:27 +02:00
Rémi Bernon e1083de9a7 dinput/tests: Merge keyboard.c tests into device8.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 11:59:25 +02:00
Rémi Bernon cda4596cad dinput/tests: Run keyboard info tests for every dinput version.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 11:59:25 +02:00
Rémi Bernon 74b9bd6767 dinput/tests: Merge mouse.c tests into device8.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 11:59:24 +02:00
Rémi Bernon fd46b4bb48 dinput/tests: Run mouse info tests for every dinput version.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 11:59:24 +02:00
Rémi Bernon d4ea5f98c3 dinput: Fix DIPROP_FFGAIN mouse and keyboard tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 11:59:24 +02:00
Rémi Bernon 6a95003b8b dinput/tests: Add some broken joystick axis results.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 11:59:24 +02:00
Zebediah Figura cf2e168c3a dinput: Use IOCTL_HID_GET_WINE_RAWINPUT_HANDLE to retrieve the raw input handle.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-09 20:55:37 +02:00
Rémi Bernon a53298f4d0 dinput/tests: Merge device.c tests into device8.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-09 20:55:20 +02:00
Rémi Bernon f5e9079ed7 dinput/tests: Use dinput_test_(init|exit) for all tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-09 20:55:20 +02:00
Rémi Bernon 4e04c710ad dinput/tests: Avoid requiring foreground window in SetCooperativeLevel tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-09 20:55:20 +02:00
Rémi Bernon fab2af1529 dinput/tests: Add a test for multiple top-level collections.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-02 17:25:06 +02:00
Rémi Bernon c76915958b dinput/tests: Support test IOCTLs on the bus control interface.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-02 17:25:06 +02:00
Rémi Bernon 5611335198 dinput/tests: Fix source file in driver test context.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-02 17:25:06 +02:00
Rémi Bernon 01e8a9d03b dinput/tests: Enforce ioctl buffer sizes to avoid overflows.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-02 17:25:06 +02:00
Rémi Bernon 5a1d2b58b3 dinput/tests: Move bus PDO ioctl handling to a separate helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-02 17:25:06 +02:00
Rémi Bernon b7f51783bb windows.gaming.input: Implement IForceFeedbackEffect_get_State.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-19 18:30:45 +02:00
Rémi Bernon b2b1e6a438 windows.gaming.input: Implement IForceFeedbackEffect_(Start|Stop).
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-19 18:30:43 +02:00
Rémi Bernon 11cb3bbf69 dinput: Make sure converted direction values are always positive.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:35 +02:00
Rémi Bernon 37abfa73f2 windows.gaming.input: Implement IConditionForceEffect_SetParameters.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:33 +02:00
Rémi Bernon 84fe8c2246 windows.gaming.input: Implement IPeriodicForceEffect_SetParameters(WithEnvelope).
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:32 +02:00
Rémi Bernon 081a289126 windows.gaming.input: Implement IRampForceEffect_SetParameters(WithEnvelope).
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:31 +02:00
Rémi Bernon aba20b0624 windows.gaming.input: Implement IConstantForceEffect_SetParameters(WithEnvelope).
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:29 +02:00
Rémi Bernon bc6df7ca57 windows.gaming.input: Implement IForceFeedbackEffect_(get|put)_Gain.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:28 +02:00
Rémi Bernon c578aa7cd3 windows.gaming.input: Always assume at least two force feedback axes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:27 +02:00
Rémi Bernon 0c6f463fe1 dinput/tests: Remove IAsyncOperation reference count checks.
They are unreliable as the worker thread is holding a reference on the
async operation itself.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 21:46:24 +02:00
Rémi Bernon 4e04446c9b windows.gaming.input: Implement Windows.Gaming.Input.ConditionForceEffect runtimeclass.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 20:46:52 +02:00
Rémi Bernon 8d45305400 windows.gaming.input: Implement Windows.Gaming.Input.PeriodicForceEffect runtimeclass.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 20:46:51 +02:00
Rémi Bernon 569036b1f0 windows.gaming.input: Implement Windows.Gaming.Input.RampForceEffect runtimeclass.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 20:46:49 +02:00
Rémi Bernon ea71b9f81b dinput/tests: Add some Windows.Gaming.Input.ForceFeedback.ConditionForceEffect tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 20:46:48 +02:00
Rémi Bernon e9f430d955 dinput/tests: Add some Windows.Gaming.Input.ForceFeedback.RampForceEffect tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 20:46:48 +02:00
Rémi Bernon b5b71d9aed dinput/tests: Add some Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 20:46:48 +02:00
Zebediah Figura 21379f3ddf dinput: Pass the device instance directly to hid_joystick_device_(try_)open.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 11:49:58 +02:00
Zebediah Figura cd33f7154d dinput: Pass a single GUID pointer to hid_joystick_device_open().
We set the instance and product IDs for all joysticks to match the latter parts
of hid_joystick_guid and dinput_pidvid_guid, respectively. Therefore there is no
need to manually check which one we are matching against.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 11:49:53 +02:00
Zebediah Figura bb791a7dd0 dinput: Allocate the dinput_device structure in the caller to dinput_device_alloc().
Rename it to dinput_device_init() accordingly.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Rémi Bernon c6011504a4 dinput: Rename This to device in dinput_device_alloc.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Rémi Bernon 10b00e66bc dinput: Return an HRESULT from hid_joystick_device_try_open.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Zebediah Figura ac7fa1677a dinput: Return E_OUTOFMEMORY on allocation failure in hid_joystick_create_device().
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Zebediah Figura dd5f3b6fc1 dinput: Rename dinput_device_init() to dinput_device_init_device_format().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Zebediah Figura cc5178fe73 dinput: Factor out the dinput_device_init() call into dinput7_CreateDeviceEx().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Rémi Bernon 39f903481c dinput: Store the user_format field inline in struct dinput_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Zebediah Figura 34bb223715 dinput: Store the device_format field inline in struct dinput_device.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 22:10:15 +02:00
Rémi Bernon 7259346ab0 windows.gaming.input: Implement IForceFeedbackMotor_LoadEffectAsync.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 11:21:42 +02:00
Rémi Bernon d5edf656ef windows.gaming.input: Implement IForceFeedbackEffect interface for ConstantForceEffect.
Using COM aggregation and a new IWineForceFeedbackEffectImpl interface,
deriving from IUnknown as it is only used internally.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 11:21:39 +02:00
Rémi Bernon aa37aad2c8 windows.gaming.input: Implement and instantiate ConstantForceEffect runtimeclass stubs.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 11:21:38 +02:00
Rémi Bernon 5097e67f55 dinput/tests: Increase async bool handler wait timeout.
We waited on the driver-side buffers to be sent, but sometimes the
async completion needs a bit more time to complete itself.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 11:21:36 +02:00
Rémi Bernon b1306875ff windows.gaming.input: Implement stub ConstantForceEffect runtimeclass factory.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-11 11:40:43 +02:00
Rémi Bernon 606dc246ff dinput/tests: Wait for the expected report to actually be pending.
There is a race otherwise where we try to complete a pending IRP but
because the async is writing the report from another thread we didn't
find it and instead ignored it.

Instead we need to atomically check if there was a pending IRP, and if
the queue is empty, or queue the wait.

Later, when a report is going to be marked as pending, and if there's
someone waiting for it already, we instead complete it immediately.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-11 11:40:35 +02:00
Rémi Bernon 78ecbc4b2d dinput: Do not delete static critical section.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 21:36:38 +02:00