Commit Graph

127 Commits

Author SHA1 Message Date
Rémi Bernon 88a8e824e6 hidclass.sys: Enforce output packet lengths to match report lengths.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:34:10 +02:00
Rémi Bernon 29b90620c1 dinput8/tests: Control expected GET_INPUT reports from the test executable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:34:05 +02:00
Rémi Bernon 441baa556a dinput8/tests: Control expected WRITE_REPORT reports from the test executable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:34:03 +02:00
Rémi Bernon e56d6e496b dinput8/tests: Control expected SET_OUTPUT reports from the test executable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:59 +02:00
Rémi Bernon c9bcc74c86 dinput8/tests: Control expected GET_FEATURE reports from the test executable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:56 +02:00
Rémi Bernon af6971b5d0 dinput8/tests: Control expected SET_FEATURE reports from the test executable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:54 +02:00
Rémi Bernon 7e1609db5f dinput8/tests: Fix inverted winetest_win_skip condition.
And change skipped test message. It's not really useful and it will fail
the tests if the main test summary doesn't match the number of skipped
messages.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:51 +02:00
Rémi Bernon 78254f6ec3 hidclass.sys: Call HID_READ_REPORT to read reports in polled mode.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 21:58:28 +02:00
Rémi Bernon 202296c282 dinput8/tests: Stop increasing the sequence in HID_GET_INPUT_REPORT.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 21:58:28 +02:00
Rémi Bernon 03e68ae3fc dinput8/tests: Read the expected lengths from the registry.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 21:58:28 +02:00
Rémi Bernon 97a6870c10 dinput8/tests: Read HID_DEVICE_ATTRIBUTES from the registry.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 21:58:28 +02:00
Rémi Bernon b648e67fd3 dinput8/tests: Read the HID report descriptor from the registry.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-10 21:58:28 +02:00
Rémi Bernon 6aef301e08 dinput8/tests: Move HID driver tests from ntoskrnl.exe.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 22:30:45 +02:00
Rémi Bernon afa1e60b27 dinput: Introduce new HID joystick backend.
This adds a new joystick backend, implemented on top of HID and without
any host dependencies. This will be progressively implementated, and
it's not going to be usable until at least a few more patches.

Because of that, and because it may also introduce regressions compared
to the existing backends, it is disabled by default and is optionally
enabled using the following global registry key:

  [HKCU\\Software\\Wine\\DirectInput\\Joysticks]
  "HID"="enabled"

Or using the corresponding AppDefaults registry key:

  [HKCU\\Software\\Wine\\AppDefaults\\<app.exe>\\DirectInput\\Joysticks]
  "HID"="enabled"

This setting will be removed later, when it becomes usable enough, to
use the individual device disable mechanism available in joy.cpl.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 21:49:09 +02:00
Arkadiusz Hiler 6b777d0b20 dinput8: Use scan codes to test uAppData.
Virtual key codes are layout dependant while direct input works with
scan codes.

Using virtual key code for 'A' with AZERTY layout resulted in scan code
for 'Q' being sent out, which in turn made the tests fail.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50987
Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-26 21:29:38 +02:00
Rémi Bernon 740f8dc6d8 dinput: Move IDirectInputDeviceA wrappers to ansi.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 21:13:01 +02:00
Arkadiusz Hiler 8d206333fd dinput: Implement DIPROP_APPDATA.
This fixes not working analog inputs on game controllers in Slay the Spire.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 20:44:41 +01:00
Arkadiusz Hiler 542f613456 dinput: Clear action mapping with SetDataFormat().
Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 20:44:18 +01:00
Arkadiusz Hiler d3e7e0426c dinput8/tests: Make input helper function more versatile.
test_device_input() now takes properly sized appdata expected value and
can be used to send any keyboard event. It also drains device's queue so
it can be called multiple times on a single device instance.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 20:44:10 +01:00
Michael Stefaniuc 21e3ba96f8 dinput8/tests: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-07 11:24:12 +02:00
Rémi Bernon 81d1c79dcd dinput8: Use rawinput interface for mouse device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 21:17:17 +02:00
Rémi Bernon 03ad3ca17a dinput8/tests: Add DISCL_EXCLUSIVE / rawinput test.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 21:17:13 +02:00
Rémi Bernon 1e7378d80c user32: Implement GetRegisteredRawInputDevices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-13 21:17:11 +02:00
Brendan Shanks f65cfbfe9b dinput: Fix DInput8 keyboard behavior for injected events with scancode=0.
Grand Theft Auto IV injects VK_F8 and scancode=0, and expects DirectInput not
to report that F8 is pressed.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-21 22:54:26 +02:00
Brendan Shanks d5fd3c8a38 dinput: Block Acquire() until hooks are installed to prevent input being lost.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-21 22:54:26 +02:00
Brendan Shanks f042ba4991 dinput8/tests: Test injecting keyboard events.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-13 12:15:03 +02:00
Jacek Caban 3ad95e03b8 makedep: Link importlib object files into module only when it's explicitly imported.
To prevent msvcrt linking its own importlib into DLL.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-23 21:11:29 +01:00
Francois Gouget 1bc90ab802 dinput8/tests: A spelling fix in a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-09 16:25:56 +02:00
Rémi Bernon e001daf5c1 dinput8/tests: Add window name and window class name test.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-27 21:54:52 +02:00
Rémi Bernon 2f51ebd961 dinput8/tests: Add test to validate interactions between dinput8 and raw input devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-27 21:54:50 +02:00
Alexandre Julliard a125baf4da dinput8/tests: Remove duplicate const.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:37:38 +02:00
Alistair Leslie-Hughes a2c10f4dca dinput: Don't return unsupported interfaces.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-03 21:51:08 +02:00
Sven Baars 76cbd21c5a dinput8/tests: Fix some memory leaks (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-21 16:06:33 +01:00
Alexandre Julliard 00c57ad89a makefiles: Add support for sharing resource files with parent dll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-21 13:59:15 +01:00
Zebediah Figura feb23d367f dinput8: Include common resources from dinput.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-20 15:34:01 +01:00
Brendan McGrath 3a2834b3a4 dinput: Use the same GUID for Instance and Product.
Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-31 17:22:36 +01:00
Brendan McGrath c357f3670f dinput/tests: Test that the GUID is the same for Instance and Product.
Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-31 17:22:33 +01:00
Alistair Leslie-Hughes 56345c8757 dinput8: Share source with dinput.
Based on a patch by Andrew Wesie.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45568
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-21 23:21:52 +02:00
Michael Stefaniuc 91c3e8ebac dinput8/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-11 11:41:59 +02:00
Jetro Jormalainen 41b126b5fc dinput: Handle username in EnumDevicesBySemantics.
EnumDevicesBySemantics enums only devices with given username when
DIEDBSFL_THISUSER is set and only unowned devices when
DIEDBSFL_AVAILABLEDEVICES is set.

Signed-off-by: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-03 20:43:39 +01:00
Jetro Jormalainen 967399eba0 dinput: Keep username same between device objects.
Signed-off-by: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-03 20:43:39 +01:00
Jetro Jormalainen 04bddb6c93 dinput: Give correct count of devices still to be enumerated.
EnumDevicesBySemantics should give count of all devices instead of
just keyboard and mouse still to be enumerated when calling callback.

Signed-off-by: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-09 19:38:07 +01:00
Bruno Jesus d19ff2d828 dinput8/tests: Debug device information during enumeration callback.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-15 12:56:35 +09:00
Michael Stefaniuc 12f8274539 dinput8/tests: Make use of todo_wine_if().
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-05 09:14:28 -05:00
Bernhard Übelacker 86cdf0b1cb dinput8/tests: Add valid wide string termination to actionName member.
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-05 09:07:12 -05:00
Bernhard Übelacker fbc85ddc28 dinput: Implement device property DIPROP_USERNAME.
Signed-off-by: Bernhard Übelacker <bernhardu@vr-web.de>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-31 15:57:32 +09:00
Piotr Caban 8d5b1dd502 dinput8: Create a window that will receive events generated by input tests. 2014-03-07 11:30:27 +01:00
Andrey Gusev add85f4687 Assorted typos fixes. 2014-02-12 19:15:32 +01:00
Alexandre Julliard 99ef0d6ff0 makefiles: Get rid of the MAKE_TEST_RULES variable. 2014-01-02 12:13:16 +01:00
Alexandre Julliard 5e7416e5c8 makefiles: Get rid of the MAKE_DLL_RULES variable. 2014-01-02 12:08:18 +01:00