Commit Graph

250 Commits

Author SHA1 Message Date
Ivo Ivanov d97426be02 hidparse.sys: Preserve the original report_count in parse_new_value_caps.
We force state->items.report_count to 1 while building the alternate
value array, but the item is global and should be preserved across caps.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51822
Signed-off-by: Ivo Ivanov <logos128@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:51 +02:00
Rémi Bernon 4961876804 dinput: Implement HID joystick IDirectInputDevice8_CreateEffect stub.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:39 +02:00
Rémi Bernon 84e586124c dinput: Send DISFFC_RESET command on HID joystick (Un)Acquire.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:32 +02:00
Rémi Bernon a382646e38 dinput: Implement hid_joystick_SendForceFeedbackCommand.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:24 +02:00
Rémi Bernon ff7685dea4 dinput: Look for the PID device control output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:20 +02:00
Rémi Bernon b33bece87e dinput: Stub hid_joystick force feedback methods.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:14 +02:00
Rémi Bernon e69f27d2ee dinput8/tests: Add some HID joystick IDirectInputDevice8_CreateEffect tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:23 +02:00
Rémi Bernon 6d7e5c714b dinput8/tests: Add the required PID reports to create effects.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:19 +02:00
Rémi Bernon f9bb8f9897 dinput8/tests: Add some HID joystick IDirectInputDevice8_SendDeviceData tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:16 +02:00
Rémi Bernon 4ea75e55b6 dinput8/tests: Add some HID joystick IDirectInputDevice8_SendForceFeedbackCommand tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:13 +02:00
Rémi Bernon beedf615b2 dinput8/tests: Add some HID joystick IDirectInputDevice8_GetForceFeedbackState tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:10 +02:00
Rémi Bernon 5b09ceae91 dinput8/tests: Add some HID joystick IDirectInputDevice8_Escape tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:07 +02:00
Rémi Bernon 46a42c78af dinput8/tests: Add the required PID reports to acquire the device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:23:03 +02:00
Rémi Bernon e47fcc112f dinput8/tests: Add some HID joystick IDirectInputDevice8_GetEffectInfo tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:22:58 +02:00
Rémi Bernon 5f492b5e8a dinput8/tests: Add the required PID reports to enumerate some effects.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:22:54 +02:00
Rémi Bernon be27b637a1 dinput8/tests: Add some HID joystick IDirectInputDevice8_EnumEffects tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:22:48 +02:00
Rémi Bernon 3bc1263e5a dinput8/tests: Don't try running more tests after a win_skip.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:22:44 +02:00
Rémi Bernon 78207cf4d2 dinput: Enumerate output button objects in their declaration order.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:13 +02:00
Rémi Bernon b468349ec2 dinput: Enumerate HID joystick DIDFT_OUTPUT objects.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:13 +02:00
Rémi Bernon 6c26901c93 dinput8/tests: Add a new force-feedback capable HID joystick test.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:13 +02:00
Rémi Bernon 5732347cbe dinput: Implement HID joystick DIPROP_AUTOCENTER property.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:44 +02:00
Rémi Bernon 5eb65418eb dinput: Implement HID joystick DIPROP_(DEADZONE|SATURATION|GRANULARITY).
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:42 +02:00
Rémi Bernon 9646873d63 dinput: Scale HID joystick axis values according to their center point.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:39 +02:00
Rémi Bernon 3886634c82 dinput: Reset the HID joystick state values on DIPROP_RANGE changes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:36 +02:00
Rémi Bernon 844db6e53e dinput: Check that DIPROP_RANGE lMin and lMax are ordered.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:32 +02:00
Rémi Bernon 5d1f3baacd dinput: Return DIERR_UNSUPPORTED when reading DIPROP_RANGE with DIPH_DEVICE mode.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:27 +02:00
Rémi Bernon 50c1f45441 dinput: Return DIERR_NOTFOUND when DIPROP_RANGE object isn't found.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 10:06:22 +02:00
Rémi Bernon 42ba8f605d dinput: Compute HID joystick object offsets dynamically.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:34:43 +02:00
Rémi Bernon 85d7c56a83 dinput: Convert DIPH_BYOFFSET filter to use current data format offsets.
Instead of hardcoded DIJOYSTATE2 offsets.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:34:43 +02:00
Rémi Bernon e990e4b232 dinput: Return proper error status from HID joystick GetObjectInfo.
When no object matched the enumeration or when DIPH_DEVICE is used.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:34:43 +02:00
Rémi Bernon 1f8487e2f0 dinput: Enumerate all HID joystick objects at once.
Instead of using individual helpers.

The force-feedback EnumObjects test shows that we should enumerate the
output objects in their original order in the HID report descriptor, not
depending on their button/value nature.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:34:43 +02:00
Rémi Bernon 5c18aa58d3 dinput: Report HID joystick wheel usage as a Z axis.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:43 +02:00
Rémi Bernon b61a272882 dinput8/tests: Add a wheel and vendor defined axis caps.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:39 +02:00
Rémi Bernon 1316142b62 dinput: Use fixed axis object instance number for common axes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:29 +02:00
Rémi Bernon eab7819d7a dinput: Add an instance number to HID joystick collection objects.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:23 +02:00
Rémi Bernon aa60766259 dinput: Set HID joystick objects wCollectionNumber field.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:19 +02:00
Rémi Bernon 0686815ff6 dinput: Check acquired state in IDirectInputDevice2WImpl_SetCooperativeLevel.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:15 +02:00
Rémi Bernon 0e75722971 dinput: Check data format dwObjSize in IDirectInputDevice2WImpl_SetDataFormat.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:11:09 +02:00
Rémi Bernon f17ba9f67a hidparse.sys: Fill additional HID internal structure fields.
Although we don't need them, it fixes a few todo_wine and reduces the
test output.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:45 +02:00
Rémi Bernon 9aaea0c17d hidparse.sys: Output array caps data indexes in the correct order.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:45 +02:00
Rémi Bernon e1e82148f8 hidparse.sys: Make internal HID structures compatible with native.
Or compatible enough ast least.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:45 +02:00
Rémi Bernon 54b2fc3553 dinput: Return correct errors from HID joystick IDirectInputDevice8_Poll.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:47 +02:00
Rémi Bernon aa43d24cd8 dinput: Return correct errors from HID joystick IDirectInputDevice8_GetDeviceState.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:44 +02:00
Rémi Bernon 78f04ca082 dinput: Return correct errors from HID joystick IDirectInputDevice8_SetProperty.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:42 +02:00
Rémi Bernon b4dfa8ff7b dinput: Check sizes in HID joystick IDirectInputDevice8_GetProperty.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:37 +02:00
Rémi Bernon 0daf841712 dinput: Fix HID joystick DIPH_BYUSAGE object enumeration.
This adds some todo_wine because we now get the correct object, but it
has incorrect offset and instance number.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:30 +02:00
Rémi Bernon af58bbb0c4 dinput8/tests: Don't check device object data sequence numbers.
We usually have them wrong but sometimes right.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:24 +02:00
Rémi Bernon 7c4941d0ec dinput: Implement more accurate HID joystick device subtypes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon 9c30042c0c dinput8/tests: Add some HID joystick device types tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon ae9f7b0364 dinput8/tests: Add some HID joystick IDirectInputDevice8_Initialize tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon 50ae254747 dinput8/tests: Add some HID joystick IDirectInputDevice8_GetObjectInfo tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Alexandre Julliard 6ba7773121 makefiles: Add a -mcygwin flag to specify the inverse of -mno-cygwin.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Rémi Bernon 4b28a061ea dinput8/tests: Add some HID joystick IDirectInputDevice8_EnumObjects tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:48:18 +02:00
Rémi Bernon 10ac8095cd dinput8/tests: Add some HID joystick IDirectInputDevice8_SetProperty tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:48:18 +02:00
Rémi Bernon 878dff8dae dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceData tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:48:18 +02:00
Rémi Bernon 635219f92b dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceState tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:48:49 +02:00
Rémi Bernon e293db88a8 dinput8/tests: Make ret_length optional in struct hid_expect.
So that we don't have to specify it explicitely every time. Input
reports length is now enforced, and we don't mean to test the length
every time we inject input.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:48:46 +02:00
Rémi Bernon f9486e9847 dinput8/tests: Add some HID joystick IDirectInputDevice8_(Un)Acquire tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Rémi Bernon 2975ad8134 dinput8/tests: Add some HID joystick IDirectInputDevice8_SetCooperativeLevel tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Rémi Bernon 7da842a738 dinput8/tests: Add some HID joystick IDirectInputDevice8_SetEventNotification tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Rémi Bernon 7fcca74881 dinput8/tests: Add some HID joystick IDirectInputDevice8_SetDataFormat tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Rémi Bernon 2972e9973e dinput8/tests: Add some HID joystick IDirectInput8_CreateDevice tests.
Creating a device with the instance guid may get the wrong one if a
true controller is plugged in.

This is because driver_hid.dll runs in a different process from
winehid.sys, and so gets another set of rawinput handles.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Rémi Bernon c5e864d4b6 dinput8/tests: Add some HID joystick IDirectInputDevice8_GetProperty tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Rémi Bernon 8325c5331e dinput8/tests: Add some HID joystick IDirectInputDevice8_GetCapabilities tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:21 +02:00
Rémi Bernon 52377b3dec dinput8/tests: Add some HID joystick IDirectInputDevice8_GetDeviceInfo tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:21 +02:00
Rémi Bernon 7da8ad6dac dinput8/tests: Add a new HID joystick test based on the HID driver.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:21 +02:00
Rémi Bernon c0ea122c0c dinput8/tests: Add tests for the internal HID preparsed data structures.
Correct DInput implementation will require it to iterate on the internal
HID structures, instead of using the higher-level value / button caps
abstraction.

This will make Wine DInput incompatible with native HID stack, unless
the internal structure match.

These tests exhibit native internal structures, which are close to what
Wine uses, so it should not be too complicated to restore compatibility.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:21 +02:00
Rémi Bernon 46f3ca4919 hidclass.sys: Complete all pending reads in polled mode only.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:32:04 +02:00
Rémi Bernon 10dd608700 dinput8/tests: Fix reported expected length in test message.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:32:02 +02:00
Rémi Bernon d40d8d9686 hidclass.sys: Drop input packets with unexpected length in non-polled mode.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:32:00 +02:00
Rémi Bernon 880d7a11d7 dinput8/tests: Don't expect any IOCTL_HID_GET_STRING call.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:31:58 +02:00
Rémi Bernon 0b0d0cd6ed dinput8/tests: Add some non-polled READ_REPORT tests.
Using the new custom IOCTL to complete reads on demand.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:31:56 +02:00
Rémi Bernon 10ddee1cda dinput8/tests: Control expected READ_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-14 18:31:54 +02:00
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