Commit Graph

1277 Commits

Author SHA1 Message Date
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
Rémi Bernon 2921714f3c dinput/tests: Add some Windows.Gaming.Input.ForceFeedback.ConstantForceEffect tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:03:07 +02:00
Rémi Bernon 3f290740c0 dinput/tests: Remove output and feature report buffers length checks.
They are checked against the expected packet anyway, and they otherwise
are enforced to match their specific individual report length, which we
don't have any info about here.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:03:05 +02:00
Rémi Bernon 92f05bd3e7 dinput/tests: Move Windows.Gaming.Input.RacingWheel tests to joystick8.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:03:05 +02:00
Rémi Bernon 4ee3edf98c dinput/tests: Enforce HID report descriptor buffer size.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:03:05 +02:00
Rémi Bernon b8a54fb1b8 dinput/tests: Increase delayed TryResetAsync test wait timeout.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:03:05 +02:00
Rémi Bernon 846e94f03d dinput/tests: Remove racy controller removed handler check.
It now consistently fails on w1064_tsign, and it's called concurrently
with the handler invocation.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:03:03 +02:00
Zebediah Figura 887f6891e7 dinput/tests: Set the callback event after setting "impl->invoked".
Fixes an intermittent test failure.

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-03 19:03:01 +02:00
Zebediah Figura 982a5b9f91 dinput/tests: Do not test that reports are identical when polling.
This is dependent on timing, and currently fails occasionally both on Windows
and Wine.

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-03 19:02:58 +02:00
Rémi Bernon 730b35ba46 windows.gaming.input: Import IAsyncOperation from windows.media.speech.
Adapting it for the IAsyncOperation_boolean interface and use it to
implement IForceFeedbackMotor_Try(Enable|Disable|Reset)Async.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-26 22:21:04 +02:00
Rémi Bernon 78261e08bf windows.gaming.input: Implement IForceFeedbackMotor_(Pause|Resume|StopAll)Effects.
And IForceFeedbackMotor_get_AreEffectsPaused.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:14 +02:00
Rémi Bernon fec8aae236 windows.gaming.input: Implement IForceFeedbackMotor_(get|put)_MasterGain.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:11 +02:00
Rémi Bernon cd24005266 windows.gaming.input: Acquire the device exclusively when creating ForceFeedbackMotor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:07 +02:00
Rémi Bernon 69745cc12d windows.gaming.input: Implement ForceFeedbackMotor stub runtimeclass.
And create it for RawGameController and RacingWheel motors.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:04 +02:00
Rémi Bernon 5c88fea5e7 windows.gaming.input: Return an empty vector from RawGameController_get_ForceFeedbackMotors.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:00 +02:00
Rémi Bernon b01760e734 dinput/tests: Remove unreliable IAsyncOperation_boolean checks.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:54 +02:00
Rémi Bernon ea30b88a99 dinput/tests: Add some RacingWheel runtimeclass tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-22 13:20:13 +02:00
Rémi Bernon d141e35456 dinput/tests: Add more IForceFeedbackMotor and IAsyncOperation_boolean tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-21 21:19:40 +02:00
Rémi Bernon c6966b5294 dinput/tests: Queue IRP when the expect ret_status is STATUS_PENDING.
And complete it on the next IOCTL_WINETEST_HID_WAIT_EXPECT ioctl.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-21 21:19:35 +02:00
Rémi Bernon 19f0f3cb65 dinput/tests: Add some IRawGameController_get_ForceFeedbackMotors tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-21 21:19:31 +02:00
Rémi Bernon 43eb6707bc dinput/tests: Add tests for joystick with many axes and units.
Checking that only a few axes get really mapped to the slider axes, and
that we shouldn't use HID_USAGE_SIMULATION_RUDDER if there's already an
Rz mapped axis.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-21 21:19:29 +02:00
Rémi Bernon 70609b4d6c dinput/tests: Add some HidD_GetPhysicalDescriptor tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-30 21:56:43 +02:00
Rémi Bernon d9fdde935a dinput/tests: Keep child PDO remove IRP pending until fully removed.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-24 23:22:06 +01:00
Rémi Bernon 9955ce8fd2 dinput/tests: Wait for spurious Win7 polled HID device events.
Win7 has spurious device arrival / removal messages for the first polled
HID device created, probably when installing the driver the first time,
and it causes a timeout if we open it before it completed its sequence.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-24 23:22:06 +01:00
Rémi Bernon dcfd15ff93 dinput/tests: Remove now unused HID test driver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:51:06 +01:00
Rémi Bernon 2644f63617 dinput/tests: Create all HID devices from the Bus driver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:51:06 +01:00
Rémi Bernon 2a52c8dcd2 dinput/tests: Create a HID device from the Bus device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:51:02 +01:00
Rémi Bernon 709e31fffc dinput/tests: Create a child PDO from the Bus driver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:41:50 +01:00
Rémi Bernon 657e07aea5 dinput/tests: Introduce a new Wine Test Bus driver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-22 18:41:46 +01:00
Rémi Bernon c44ba8735c dinput/tests: Add more HID device and extension pointers tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:09 +01:00
Rémi Bernon d470e7832c dinput/tests: Introduce a new find_hid_device_path helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:09 +01:00
Rémi Bernon acbfddd38c dinput/tests: Remove the HID driver IRP_MJ_POWER handler.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:09 +01:00
Rémi Bernon f6d2495c50 dinput/tests: Rename HID driver identifiers and files.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:09 +01:00
Rémi Bernon 4c336655c9 dinput/tests: Add more debug traces to the HID driver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 14:28:09 +01:00
Rémi Bernon 62d40eb0c8 dinput: Allow setting DIPROP_AUTOCENTER when exclusively acquired.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-18 17:29:58 +01:00
Rémi Bernon ace5d0adb8 windows.gaming.input: Fix IIterator_IInspectable_MoveNext returne value.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 18:30:39 +01:00
Rémi Bernon 87ada5544e dinput/tests: Test IIterator_IInspectable_MoveNext returned values.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 18:30:36 +01:00
Rémi Bernon 0fc5a07770 windows.gaming.input: Always return S_OK from TryGetFactoryControllerFromGameController.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Rémi Bernon 1e9b83a440 windows.gaming.input: Implement Controller(Added|Removed) event support.
Using a generic EventHandler<IInspectable *> implementation.

This adds several todo_wine because we currently do not implement custom
game controller factories.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 18:27:44 +01:00
Rémi Bernon e609c640a2 windows.gaming.input: Implement IGamepadStatics_get_Gamepads.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 18:27:44 +01:00
Rémi Bernon 1ca51d33c2 windows.gaming.input: Implement IRawGameControllerStatics_get_RawGameControllers.
It is important to add RawGameController instances to the vector in the
initialization callback, because some games check the vector, as well
as the Gamepad class vector in the OnGameControllerAdded callback.

This also removes the OnGameControllerAdded failure case, to avoid
leaking controllers that were already added to the controller vector,
and instead rely on the OnGameControllerRemoved call to do the cleanup.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 18:27:44 +01:00
Rémi Bernon 8b288980b2 dinput: Use a custom GUID to open a device from a device path.
So that we can access all the controller devices conveniently through
DInput without having to reimplement the whole HID client, or having
to enumerate the devices every time a new device needs to be open,
and being able to workaround the limitations of the device the XInput
controllers are usually exposing.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-04 19:16:40 +01:00
Rémi Bernon 42c8860b23 dinput: Check collection nodes to find HID simulation device usages.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 21:32:01 +01:00
Rémi Bernon 9d2c868db3 dinput: Refactor HID joystick device type detection logic.
Detecting main type first, then subtype.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 21:31:44 +01:00
Rémi Bernon ab780cee83 dinput: Add object names for simulation HID usages.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 21:31:41 +01:00
Rémi Bernon df0566d531 dinput/tests: Add tests for ICustomGameControllerFactory_CreateGameController.
This shows that the runtime uses COM aggregation to provide the
IGameController and IGameControllerBatteryInfo implementation, while
expecting the custom controller to implement several other interfaces
depending on the type of provider used as a backend.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-02 20:18:13 +01:00
Rémi Bernon e1b8de1a2d dinput/tests: Add tests for IGameControllerFactoryManagerStatics_RegisterCustomFactoryForHardwareId.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-02 20:18:03 +01:00
Rémi Bernon 57c0f18603 dinput/tests: Simplify windows.gaming.input tests with events.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 21:31:56 +01:00