Commit Graph

1254 Commits

Author SHA1 Message Date
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
Rémi Bernon 61db4aa66d dinput: Use DIEFT_GETTYPE instead masking bits.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:34 +01:00
Rémi Bernon a3b0cb74cd dinput: Ignore override flag for non-XInput devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:34 +01:00
Rémi Bernon cd6bab2b2a dinput: Set HID joystick internal ref before trying to open it.
So that an open failure will not decrement it to -1.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:34 +01:00
Francois Gouget 57d342afe5 dinput/tests: Remove an unneeded NULL cast.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:42 +01:00
Francois Gouget c76b617119 dinput/tests: Remove spaces before linefeeds.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:42 +01:00
Rémi Bernon 19a5881b0b dinput/tests: Fix printf warnings with long types.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 11:26:48 +01:00
Rémi Bernon 9f472f00d8 dinput: Fix printf warnings with long types.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 10:58:55 +01:00
Rémi Bernon be6d33824a dinput: Canonicalize DirectInput(8) instance creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 10:49:03 +01:00
Rémi Bernon 1591021f53 dinput: Use consistent parameter names and types.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 10:48:58 +01:00
Rémi Bernon f0935f850c dinput: Rename IDirectInputImpl to struct dinput.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 10:48:54 +01:00
Rémi Bernon 73ba9d3459 dinput: Cleanup IDirectInput8W names and traces.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-07 11:02:31 +01:00
Rémi Bernon d33103bf05 dinput: Cleanup IDirectInput7W names and traces.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-07 11:02:29 +01:00