Commit Graph

318 Commits

Author SHA1 Message Date
Rémi Bernon 8fb10882c9 winebus.sys: Add a VID and PID to mouse and keyboard devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Alexandre Julliard 80a57c617b winebus.sys: Remove the no longer used CFStringToWSTR function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:57:24 +02:00
Alexandre Julliard aff08c7e14 winebus.sys: Fix a typo in find_device_from_iohid().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:51:36 +02:00
Rémi Bernon 334d89a253 winebus.sys: Use wide character strings literals.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:48 +02:00
Rémi Bernon 5bbf1d1095 winebus.sys: Use new unixlib subsystem.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:46 +02:00
Rémi Bernon cc2f669390 winebus.sys: Use a pthread_mutex_t instead of CRITICAL_SECTION.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:43 +02:00
Rémi Bernon 8f6932fd35 winebus.sys: Avoid process heap allocations on the unix side.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:41 +02:00
Rémi Bernon e54ff70e5d winebus.sys: Build with msvcrt.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:38 +02:00
Rémi Bernon 39ca4de665 winebus.sys: Use Rtl CS functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:39 +02:00
Rémi Bernon 35a6148acf winebus.sys: Use Rtl heap functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:37 +02:00
Rémi Bernon 0017b5eb63 winebus.sys: Load SDL bus mappings before calling bus_init.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:36 +02:00
Rémi Bernon 7032b41747 winebus.sys: Move is_xbox_gamepad to unixlib.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:34 +02:00
Rémi Bernon 2a2fc11d8c winebus.sys: Remove the now useless device_compare callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:32 +02:00
Rémi Bernon 421a6f53ad winebus.sys: Pass a unix_device pointer in every bus event.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:30 +02:00
Rémi Bernon cdaf1d9a7f winebus.sys: Remove the DEVICE_OBJECT arg on device_start.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:41 +02:00
Rémi Bernon 5f8ebe7a60 winebus.sys: Remove the now useless get_unix_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:32 +02:00
Rémi Bernon be503e97fb winebus.sys: Poll all UDEV fds together in the bus_wait thread.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:14 +02:00
Rémi Bernon bc0ad0e13b winebus.sys: Return an event from IOHID bus wait on input report.
Instead of calling process_hid_report.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:11 +02:00
Rémi Bernon e0ac56267f winebus.sys: Return an event from UDEV bus wait on input report.
Instead of calling process_hid_report.

We need to guard the event queue as the input reports are read from
dedicated threads.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:08 +02:00
Rémi Bernon 8b434bdc7f winebus.sys: Return an event from SDL bus wait on input report.
Instead of calling process_hid_report.

This adds a reference count on unix devices to make sure they are kept
alive until all their input report events have been processed.

This also uses a bus-specific device list, to be able to find devices
from joystick ids without having to call back to the win32 side.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:03 +02:00
Rémi Bernon 5380167ca0 winebus.sys: Move process_hid_report helper around.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:02:51 +02:00
Rémi Bernon 1f12b2160d winebus.sys: Free unix device in unix_device_remove.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:50:01 +02:00
Rémi Bernon bf1446523c winebus.sys: Allocate mouse and keyboard devices dynamically.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:49:59 +02:00
Rémi Bernon b86eade743 winebus.sys: Use helpers to create and destroy unix devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:49:57 +02:00
Rémi Bernon cd830398dd winebus.sys: Split destroy to a separate stop method.
So we can stop the device when it's removed from the ntoskrnl.exe device
list, and then destroy it only when it's not referenced anymore.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:49:55 +02:00
Rémi Bernon 56a4aaf419 winebus.sys: Remove the now useless get_string callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:39 +02:00
Rémi Bernon ff0d402efa winebus.sys: Query serialnumber string on device creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:36 +02:00
Rémi Bernon 093c13e333 winebus.sys: Query product string on device creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:34 +02:00
Rémi Bernon 9d4b70473c winebus.sys: Query manufacturer string on device creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:32 +02:00
Rémi Bernon e4f0b4ab8a winebus.sys: Remove the now useless native product strings.
This should now be handled by winexinput.sys.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:30 +02:00
Rémi Bernon 83f0de4487 winebus.sys: Return an event from IOHID bus wait on device creation.
Instead of calling bus_create_hid_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:40:56 +02:00
Rémi Bernon f7be0f5edf winebus.sys: Return an event from UDEV bus wait on device creation.
And queued events generated from initial device enumeration.

Instead of calling bus_create_hid_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:40:52 +02:00
Rémi Bernon 507a3076de winebus.sys: Return an event from SDL bus wait on device creation.
Instead of calling bus_create_hid_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:40:48 +02:00
Rémi Bernon 60740e8745 winebus.sys: Remove the now useless bus_enumerate_hid_devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:04 +02:00
Rémi Bernon 6ce5ba8f2f winebus.sys: Look for duplicate UDEV devices on the unix side.
Devices are only added from a single thread but they may be destroyed
concurrently so we need to guard the list against race conditions.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon 4366cba6e6 winebus.sys: Move device vtable to the struct unix_device side.
And name the callbacks a bit more consistently.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon 08f943b595 winebus.sys: Create devices using a struct device_desc descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon 5e0c1ce443 winebus.sys: Move mouse and keyboard devices to unixlib.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 2457113970 winebus.sys: Return an event from IOHID bus wait on device removal.
Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 9f09e2a3cb winebus.sys: Return an event from UDEV bus wait on device removal.
Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 6006758ca8 winebus.sys: Return an event from SDL bus wait on device removal.
Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon f6d567d3e3 winebus.sys: Pass a struct bus_event pointer to bus_wait.
Allocated on the caller side.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon d22ece4c58 winebus.sys: Stop enforcing input and IG suffix on gamepads.
The &IG_00 suffix is now automatically added by winexinput.sys.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 7b4b48a774 winebus.sys: Report WINEBUS\WINE_COMP_XINPUT compatible id for gamepads.
In addition, and before WINEBUS\WINE_COMP_HID, so that winexinput.sys
will match first as soon as it is introduced.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:30:24 +02:00
Rémi Bernon 06ab0d5405 winebus.sys: Report WINEBUS\WINE_COMP_HID compatible id.
And match it in winehid.sys instead of individual bus ids.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:30:20 +02:00
Michael Stefaniuc 079c47a38e winebus.sys: Print the debug string and not the pointer to it.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 10:40:09 +02:00
Rémi Bernon 11c6b376c0 winebus.sys: Use the private data pointer as device unique id.
Instead of a separately allocated device list entry pointer. And link
the device object into the device list directly.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:18 +02:00
Rémi Bernon 09c14c6321 winebus.sys: Allocate private device data separately.
And use an opaque struct unix_device as private data.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:16 +02:00
Rémi Bernon 7e1d1fac70 winebus.sys: Load bus options in main.c.
And pass them to bus_init function.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:14 +02:00
Rémi Bernon edbb3fac25 winebus.sys: Introduce a new unixlib interface.
And use it for bus entry points.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:11 +02:00
Rémi Bernon b4d8cd3891 winebus.sys: Create the IOHID bus thread in main.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:09 +02:00
Rémi Bernon 9d7f1eefa1 winebus.sys: Create the UDEV bus thread in main.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:07 +02:00
Rémi Bernon 9a78467975 winebus.sys: Create the SDL bus thread in main.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:05 +02:00
Rémi Bernon 6e7ca58374 winebus.sys: Pass HID_XFER_PACKET and IO_STATUS_BLOCK to callbacks.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:53 +02:00
Rémi Bernon ee5cde83da winebus.sys: Merge begin_report_processing with start_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:50 +02:00
Rémi Bernon 8f065f97c9 winebus.sys: Remove the now useless bus_remove_hid_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:47 +02:00
Rémi Bernon 620b514aa0 winebus.sys: Build report descriptors in start_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:44 +02:00
Rémi Bernon 68c6c7d936 winebus.sys: Introduce a new start_device callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:26 +02:00
Rémi Bernon db410052a3 winebus.sys: Unlink device before releasing it.
Otherwise the device will still be linked in the device list and any
thread iterating it to find a matching device will access stale pointer.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:52 +02:00
Rémi Bernon d3885f92fc winebus.sys: Return NTSTATUS from build_report_descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:50 +02:00
Rémi Bernon 12ef137b47 winebus.sys: Ignore EV_REL / EV_ABS ioctl failures.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:48 +02:00
Rémi Bernon fd73402ce6 winebus.sys: Parse udev device version and input number from uevent.
And try parsing it from the hid or input and usb parent nodes, but not
beyond.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:46 +02:00
Rémi Bernon c2fc919e04 winebus.sys: Simplify parsing udev device info from uevent.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:44 +02:00
Rémi Bernon aa40700f9f winebus.sys: Only read EVIOCGID result if the ioctl succeeded.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:42 +02:00
Rémi Bernon acff5b4191 winebus.sys: Always call the EVDEV ioctls for input UDEV subsystem.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:41 +02:00
Rémi Bernon 5c3f2f88a6 winebus.sys: Use bus_find_hid_device to find SDL devices from id.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:39 +02:00
Rémi Bernon 5703d5c0b3 winebus.sys: Pass bus id instead of vtbl to lookup functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 00:43:36 +02:00
Rémi Bernon a67ac02dc3 winebus.sys: Move SDL mapping loading to a separate helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:43 +02:00
Rémi Bernon 90b8a97237 winebus.sys: Move SDL function loading to a separate helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:41 +02:00
Rémi Bernon 5d6419a53c winebus.sys: Fix duplicate lnxev / hidraw device lookup.
The comparison result was wrong, and the device syspath always differs
anyway between two different subsystems. We need to compare the parent
device syspath.

The input subsystem devices also needs to be deduplicated between eventX
devices and jsX devices.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:39 +02:00
Rémi Bernon 3fb4eec6c3 winebus.sys: Make hidraw report callbacks consistent.
This was inconsistently forcing the first report byte to the report id.

The report ids are stripped when they aren't used, in the packet
hidclass.sys provides, but hidraw API wants them all the time, so we
need to use an intermediate buffer.

Also ioctl length argument have a lower size capacity, so we have to
check for it as well.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:36 +02:00
Rémi Bernon f884ee46fb winebus.sys: Report lnxev axes individually in the descriptor.
Fixing invalid axis range when they differ between two axis of the same
usage page.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:34 +02:00
Rémi Bernon dba263756c winebus.sys: Only keep lnxev absolute axis info locally.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:32 +02:00
Rémi Bernon 28f797ec8b winebus.sys: Read irp->IoStatus.Status before leaving the CS.
Or we may have a race condition where a pending IRP may be completed
after we left the CS but before we read its status.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-13 11:52:30 +02:00
Rémi Bernon 6ae7e808bd winebus.sys: Use HID descriptor helpers in bus_sdl.c.
And remove old helpers.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 40e445572a winebus.sys: Use HID descriptor helpers in bus_udev.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 2ea19ff357 winebus.sys: Introduce new HID report descriptor helpers.
And use them for mouse and keyboard.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 5b9c1e9163 winebus.sys: Fix lnxev button start byte vs bit index.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 5679e006ca winebus.sys: Use irp IoStatus.Status consistently.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 8f37267f92 winebus.sys: Use nameless unions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon a446e0e57d winebus.sys: Use a local variable to store buffer len.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 2d7fa05ce4 winebus.sys: Remove duplicate LeaveCriticalSection call.
Breaking out of the switch will leave it already.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 199f689ff1 winebus.sys: Return STATUS_SUCCESS from IRP_MN_SURPRISE_REMOVAL.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon ab8f8258a5 winebus.sys: Add missing keyboard free_device callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 0f48202335 winebus.sys: Handle IRP_MN_SURPRISE_REMOVAL and set removed flag.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 25155186c6 winebus.sys: Introduce new remove_pending_irps helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 001b70774f winebus.sys: Add some buttons to HID keyboard input report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 318e5feda5 winebus.sys: Add some buttons to HID mouse input report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 0baabde716 winebus.sys: Use macros to define HID reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:28:03 +02:00
Rémi Bernon 709c801fb1 winebus.sys: Create stub Wine HID keyboard device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Zebediah Figura 1fdcf1f183 winebus.sys: Return success from IRP_MN_START_DEVICE on the child PDO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:09 +02:00
Zebediah Figura bbdc0cc924 winebus.sys: Do not print a FIXME for IRP_MN_QUERY_DEVICE_RELATIONS in pdo_pnp_dispatch().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:45 +02:00
Zebediah Figura 27f40156ba winebus.sys: Move device destruction to IRP_MN_REMOVE_DEVICE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:34:01 +02:00
Zebediah Figura b0f25d7e1b winebus.sys: Reject ioctls on a removed device.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:33:57 +02:00
Zebediah Figura f8ec3fdcdb winebus.sys: Move platform-specific device cleanup to a callback function.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:33:53 +02:00
Zebediah Figura b6409950d9 winebus.sys: Rename "report_cs" to "cs".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:33:49 +02:00
Arkadiusz Hiler ee4e33ed9a winebus.sys: Remove incorrect Report ID from the bus_sdl HID report descriptor.
According to "USB Device Class Definition for Human Interface Devices
Firmware Specification Version 1.11" Report ID 0 is reserved and should
not be used.

On top of that if Report ID is used anywhere in the descriptor the
reports are expected to be prepended with an ID and this is not the case
for bus_sdl devices.

It worked only because our current HID parser implementation treats the
Report ID 0 as there would be none.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-23 22:30:31 +01:00
Zebediah Figura 141fdcc0ef winebus.sys: Return STATUS_DELETE_PENDING rather than STATUS_CANCELLED when a device is removed.
Microsoft doesn't really clearly document this, but their driver samples return it here, and so do remove locks.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:49 +01:00
Zebediah Figura dece98fb59 winebus.sys: Return success from IRP_MN_QUERY_CAPABILITIES.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:28 +01:00
Zebediah Figura eaf2d6224c winebus.sys: Fix the definition of ABS_TO_HID_MAP.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:01:01 +01:00
Alex Henrie 3e8b27fef3 winebus: Remove redundant preprocessor check for libsdl2.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-29 21:18:53 +01:00
Dean M Greer e4fbae832c configure: Don't prepend folder name for SDL.h.
This fixes pkgconfig SDL2 detection when SDL2 is installed in a non-standard location.

Signed-off-by: Dean M Greer <gcenx83@gmail.com>
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-02 21:47:41 +01:00
Hans Leidekker 3a007a95e8 winebus.sys: Support setting SDL controller mapping through environment variable.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50154
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 20:20:27 +01:00
Hans Leidekker 6ce03d9313 winebus.sys: Fix registry access rights for SDL controller mapping.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48545
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 20:20:24 +01:00
Brendan Shanks 9c0c0e2b57 winebus.sys: Open IOHID devices individually to fix macOS Catalina and Big Sur.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50153
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 16:53:52 +01:00
Alexandre Julliard 4650dff5c4 winebus.sys: Move winebus.inf into the module resources.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-11 11:04:06 +01:00
Francois Gouget 335656e433 winebus.sys: Fix the spelling of HID_USAGE_SIMULATION_ACCELERATOR.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 12:16:36 +02:00
Alexandre Julliard 3760b7a9f8 winebus.sys: Use standard dlopen() instead of the libwine wrappers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-07 14:26:20 +02:00
Zebediah Figura 602f20826d winebus.sys: Use public HID_USAGE_* constants.
Fix a typo in the process (HID_USAGE_DIGITIZER_Y_TILT is 0x3E, not 0x3F).

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 10:51:44 +01:00
Zebediah Figura da7d60bf97 winebus.sys: Fix reporting axis values for joysticks.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-09 22:16:30 +01:00
Michael Cronenworth 388348ddbf winebus: Global variable compatibility update for gcc 10.
Signed-off-by: Michael Cronenworth <mike@cchtml.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-24 18:19:06 +01:00
Andrew Eikum 6cb3d0fb37 winebus.sys: Don't return too early if SDL initialization succeeds.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-21 20:56:05 +01:00
Piotr Caban c3bfc1b726 winebus: Fix DEVICE_RELATIONS content on device removal.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 22:05:58 +01:00
Piotr Caban cc395391ed winebus: Reference PDOs added to DEVICE_RELATIONS structure.
Fixes crash caused by 81cda52d15.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 22:05:58 +01:00
Zebediah Figura c074966b9d winebus.sys: Stop creating a setupapi device.
ntoskrnl.exe handles this now.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:55 +01:00
Zebediah Figura 81cda52d15 ntoskrnl.exe: BusRelations is also used when devices are removed.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:53 +01:00
Zebediah Figura ca683dcaad ntoskrnl.exe: IoInvalidateDeviceRelations() receives the parent PDO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:51 +01:00
Zebediah Figura a60a014dc4 winebus.sys: Initialize and teardown the HID backends while the bus FDO is still extant.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:46 +01:00
Zebediah Figura cba5674d60 winebus.sys: Implement AddDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:39 +01:00
Piotr Caban 5e8eb5f4c5 winebus.sys: Make device_id string more similar to native.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 00:46:29 +02:00
Piotr Caban 9d5c801d35 winebus.sys: Stop SDL deviceloop_thread to avoid crash on driver unload.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:50:41 +02:00
Piotr Caban 485aed9f1c winebus.sys: Don't do anything in iohid_driver_unload if iohid was not initialized.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:50:35 +02:00
Piotr Caban ef59d2d11f winebus.sys: Don't do anything in udev_driver_unload if udev was not initialized.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:50:31 +02:00
Rémi Bernon f36e9e3a2c winebus.sys: Report the native product string for some Xbox gamepads.
Some games are checking the hid product string of connected gamepads in
order to decide whether or not to activate rumble.

Wine usually delegates these queries to the backend driver, but they
don't always report the same product strings as on Windows. This will
allow to override backend strings with the actual strings as reported
by native drivers.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-20 12:50:10 +02:00
Rémi Bernon 3d2f43a1da winebus.sys: Use the SDL joystick index as device id instead of instance id.
Some games are using the HID device id as the gamepad index for xinput
API. When hotplugging devices, SDL increases its instance id and it
doesn't match anymore with xinput gamepad numbers.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-20 12:50:07 +02:00
Andrew Eikum e83f427a65 winebus.sys: Fix build without Linux event support.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-18 23:04:26 +02:00
Piotr Caban 4b3437907b winebus.sys: Stop device report threads to avoid crash on driver unload.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Piotr Caban 90fa9967bc winebus.sys: Stop deviceloop_thread to avoid crash on driver unload.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Andrew Eikum 439b80e4c4 winebus.sys: Don't WARN about backends we didn't build.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-11 17:03:04 +02:00
Andrew Eikum d5fb7383d0 winebus.sys: Report device revision number for hidraw, too.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-12 16:15:56 +02:00
Zebediah Figura 9c6ea01935 winebus.sys: Create a stub mouse device.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-04 21:14:53 +02:00
Alistair Leslie-Hughes 90a1e5d943 winebus.sys: Increase buffer size to match max length available.
The current buffer is 1024, however the ioctl call can handle
a max length of 8191.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47013
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-28 10:57:55 +02:00
Andrew Eikum f8a04c7f2e winebus.sys: Close SDL handles when a device is removed.
This fixes opening SDL haptic handles after a device is removed and
re-added.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:28:55 +02:00
Zebediah Figura 6c6aeea8a8 ntoskrnl.exe: Correctly handle instance IDs.
The instance ID is only the third part of the "A\B\C" form, and must be
combined with the device ID to form the whole name for setupapi (the "device
instance ID").

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:20 +02:00
Zebediah Figura eebb1d9931 winebus.sys: Allocate IRP return buffers from paged pool.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:44:49 +02:00
Zebediah Figura e83fd91d5f winebus.sys: Just report the bus ID when enumerating compatible IDs.
It's the only one we actually match against.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-04 23:05:46 +02:00
Zebediah Figura f39adfe914 winebus.sys: Make the device and instance IDs consistent.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-04 23:05:40 +02:00
Zebediah Figura 9af088243c winebus.sys: Avoid IoCreateDriver().
This is not a documented function, and anyway we don't need separate driver
objects.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:26 +02:00
Zebediah Figura d525c736b9 winebus.sys: Move udev configuration values to the winebus service key.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:26 +02:00
Zebediah Figura 50b9456e87 winebus.sys: Use the winebus driver to create all devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:26 +02:00
Andrew Eikum f8ebb3ac37 winebus.sys: Add missing padding between hatswitch and constant.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-20 18:31:45 +02:00
Piotr Caban 40ae0e8455 winebus.sys: Restore IG_ substring in gamepads endpoint path.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47209
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 20:54:23 +02:00
Andrew Eikum 042e062569 winebus.sys: Fix report length calculation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47188
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 23:04:49 +02:00
Piotr Caban 8cd6d61639 winebus.sys: Correctly set HID device input number in device endpoint path.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 19:24:43 +02:00
Piotr Caban 6a0005747c winebus.sys: Fix typo in endpoint name.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 19:24:40 +02:00
Alexandre Julliard c0604a9341 winebus.sys: Avoid ssize_t.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:39:22 +02:00
Andrew Eikum 5ff326f801 winebus.sys: Pack hatswitch values into button bytes.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:20:18 -05:00
Andrew Eikum ba79a14369 winebus.sys: Report SDL controller buttons in the right order.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:20:11 -05:00
Andrew Eikum 564e7b4db9 winebus.sys: Report SDL controller dpad as hatswitch.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:20:02 -05:00