Commit Graph

1266 Commits

Author SHA1 Message Date
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
Rémi Bernon 9a9d73b572 dinput/tests: Make combase.dll dependency optional.
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
Rémi Bernon 3c2bb0f87c dinput/tests: Add tests for IGamepadStatics_get_Gamepads.
Showing that HID gamepads aren't listed as WGI gamepads.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:38:40 +01:00
Rémi Bernon d337f6fbce dinput/tests: Add tests for IRawGameControllerStatics_FromGameController.
And check the RawGameController IGameController interface.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:38:37 +01:00
Rémi Bernon d0248b6c6a dinput/tests: Add some windows.gaming.input device tests.
Only works with an XBox gamepad, looks like DInput gamepads aren't
exposed as WGI gamepads.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:38:34 +01:00
Rémi Bernon 7e7c0ed9c5 dinput/tests: Add some windows.gaming.input hotplug tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:38:30 +01:00
Rémi Bernon 21cdca2d8c dinput/tests: Add more tests for simulation HID usages.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 20:04:09 +01:00
Rémi Bernon 0bb48fcb6d dinput: Avoid invalid rglDirection access when effect cAxes is 0.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 20:03:56 +01:00
Rémi Bernon 482768a9e6 dinput: Report optional force feedback state only if supported.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Rémi Bernon d5ff6917b7 dinput: Remove unnecessary critical section entry.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Rémi Bernon 6d7889ef53 dinput: Only read effect state reports when exclusively acquired.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Rémi Bernon f6ef943b9c dinput: Also trace report buffers on immediate ReadFile success.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00