hidapi/windows: fixed PS4 controllers over Bluetooth on Windows 7 #578
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!578
Loading…
Reference in a new issue
No description provided.
Delete branch "slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -1053,3 +1090,4 @@int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length){DWORD bytes_written = 0;please see https://github.com/libusb/hidapi/pull/224
I'm confident we need to do the same thing for
HidD_SetOutputReportas well.This looks similar to a problem described in https://github.com/libusb/hidapi/issues/513.
@DJm00n what do you think?
@DJm00n
Sorry to ping.
Overall looks good
I'd prefer
hid_internal_is_windows_version_or_greater- so it is easily distinguishable from public methodI'd prefer
hid_internal_write_output_report- so it is easily distinguishable from public methodOkay, I've updated the PR with your suggestions.
either here or at the place of usage (in case of error) we need to register an error string
@ -1053,3 +1090,4 @@int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length){DWORD bytes_written = 0;@slouken any thoughs/comments?
Yep, good point. Added!
@ -1053,3 +1090,4 @@int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length){DWORD bytes_written = 0;@slouken It seems, you missed to respond to this question
@ -1053,3 +1090,4 @@int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length){DWORD bytes_written = 0;It looks like #224 was just pre-allocating the buffer. Were you referring to another change that made sure the buffer size matched feature_report_length? I think, but I'm not sure, that the feature_report_length is the wrong size in this case.
@ -1053,3 +1090,4 @@int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length){DWORD bytes_written = 0;I mean that the buffer size has to be at least
output_report_lengthbytes in size.If user passes less data - logically it is not a proble, but WinAPI implementation is known to crash if bufer is too small.
The workaround (as in #224) is to pre-allocate buffer that is large-enough if needed.
Now that Windows 7 has been out of support for a while, I am not so sure if we still care about Windows 7 or not, if this issue is only specific to Windows 7.
https://learn.microsoft.com/en-us/lifecycle/products/windows-7
On the other hand, #513 does not seem to be related to Windows 7.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.