hidapi/windows: fixed PS4 controllers over Bluetooth on Windows 7 #578

Open
slouken wants to merge 2 commits from slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch into master
slouken commented 2023-05-26 11:22:56 -05:00 (Migrated from github.com)
No description provided.
Youw (Migrated from github.com) reviewed 2023-05-31 12:34:42 -05:00
@ -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;
Youw (Migrated from github.com) commented 2023-05-31 12:34:42 -05:00

please see https://github.com/libusb/hidapi/pull/224
I'm confident we need to do the same thing for HidD_SetOutputReport as well.

please see https://github.com/libusb/hidapi/pull/224 I'm confident we need to do the same thing for `HidD_SetOutputReport` as well.
Youw commented 2023-05-31 12:36:14 -05:00 (Migrated from github.com)

This looks similar to a problem described in https://github.com/libusb/hidapi/issues/513.
@DJm00n what do you think?

This looks similar to a problem described in https://github.com/libusb/hidapi/issues/513. @DJm00n what do you think?
mcuee commented 2023-10-18 19:40:46 -05:00 (Migrated from github.com)

@DJm00n

Sorry to ping.

@DJm00n Sorry to ping.
DJm00n (Migrated from github.com) reviewed 2023-11-10 14:09:29 -06:00
DJm00n (Migrated from github.com) left a comment

Overall looks good

Overall looks good
DJm00n (Migrated from github.com) commented 2023-11-10 14:09:06 -06:00

I'd prefer hid_internal_is_windows_version_or_greater - so it is easily distinguishable from public method

I'd prefer `hid_internal_is_windows_version_or_greater` - so it is easily distinguishable from public method
DJm00n (Migrated from github.com) commented 2023-11-10 14:08:31 -06:00

I'd prefer hid_internal_write_output_report - so it is easily distinguishable from public method

I'd prefer `hid_internal_write_output_report` - so it is easily distinguishable from public method
slouken commented 2023-11-10 21:18:14 -06:00 (Migrated from github.com)

Okay, I've updated the PR with your suggestions.

Okay, I've updated the PR with your suggestions.
DJm00n (Migrated from github.com) approved these changes 2023-11-11 01:25:40 -06:00
Youw (Migrated from github.com) reviewed 2023-11-11 06:53:02 -06:00
Youw (Migrated from github.com) commented 2023-11-11 06:53:02 -06:00

either here or at the place of usage (in case of error) we need to register an error string

either here or at the place of usage (in case of error) we need to register an error string
Youw (Migrated from github.com) reviewed 2023-11-11 06:53:36 -06:00
@ -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;
Youw (Migrated from github.com) commented 2023-11-11 06:53:35 -06:00

@slouken any thoughs/comments?

@slouken any thoughs/comments?
slouken (Migrated from github.com) reviewed 2023-11-11 08:49:22 -06:00
slouken (Migrated from github.com) commented 2023-11-11 08:49:22 -06:00

Yep, good point. Added!

Yep, good point. Added!
JoergAtGithub (Migrated from github.com) reviewed 2024-03-09 00:13:18 -06:00
@ -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;
JoergAtGithub (Migrated from github.com) commented 2024-03-09 00:13:18 -06:00

@slouken It seems, you missed to respond to this question

@slouken It seems, you missed to respond to this question
slouken (Migrated from github.com) reviewed 2024-03-10 10:40:52 -05:00
@ -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 (Migrated from github.com) commented 2024-03-10 10:40:52 -05:00

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.

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.
Youw (Migrated from github.com) reviewed 2024-04-06 05:30:25 -05:00
@ -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;
Youw (Migrated from github.com) commented 2024-04-06 05:30:25 -05:00

I mean that the buffer size has to be at least output_report_length bytes 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.

I mean that the buffer size has to be at least `output_report_length` bytes 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_.
mcuee commented 2024-11-27 02:28:15 -06:00 (Migrated from github.com)

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

Listing Start Date Mainstream End Date Extended End Date
Windows 7 Oct 22, 2009 Jan 13, 2015 Jan 14, 2020
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 Listing | Start Date | Mainstream End Date | Extended End Date -- | -- | -- | -- Windows 7 | Oct 22, 2009 | Jan 13, 2015 | Jan 14, 2020
mcuee commented 2024-11-27 02:29:09 -06:00 (Migrated from github.com)

On the other hand, #513 does not seem to be related to Windows 7.

On the other hand, #513 does not seem to be related to Windows 7. * https://github.com/libusb/hidapi/issues/513
This pull request has changes conflicting with the target branch.
  • windows/hid.c
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.
git fetch -u origin 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch:slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git switch 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'

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.

git switch 'master'
git merge --no-ff 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git switch 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git rebase 'master'
git switch 'master'
git merge --ff-only 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git switch 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git rebase 'master'
git switch 'master'
git merge --no-ff 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git switch 'master'
git merge --squash 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git switch 'master'
git merge --ff-only 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git switch 'master'
git merge 'slouken/0001-hidapi-windows-fixed-PS4-controllers-over-Bluetooth-.patch'
git push origin 'master'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!578
No description provided.