Unable to retrieve bus_type for some devices on Windows #502
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#502
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
On windows, we currently inspect the parent devnode to get
bus_type:github.com/libusb/hidapi@4ebce6b505/windows/hid.c (L498-L552)However, some filtered HID device (e.g. imbushuo/mac-precision-touchpad) whose parent is the filter driver, which don't have a correct
compatible_id. The device tree is like this:If we want to know the
bus_typefor (1), according to the code, we're inspecting thecompatible_idfor (2), which is empty.However if we go one step further we hit (3), which has the correct
compatible_id:BTHENUM\{GUID}. Now we know it's a Bluetooth device.I suggest we go all the way up, until to the root to find a recognizable
compatible_id, and stop after we found one.I don't really know if this is the correct / sane thing to do. Could you give me some ideas?
BTW, on a UEFI laptop some devices have a ancestor with a
compatible_idlike*PNP0A03, but no more recognizable value. Do you know what that is? (Maybe we can open another issue for this?)is #464 of any relevance to the issue described here?
I'm not quite sure but maybe no.
In this situation, we don't even find
USBin any of thecompatible_ids, while #464 attempts to add some extra logic inif(wcsstr(compatible_id, L"USB") != NULL)@DJm00n can you help with this Bluetooth bus_type issue?
This does sounds like a good solution. But I guess i has to be in line with other changes (including #464).
@AlexGuo1998 thank you for reporting. I'll review
cr = CM_Get_Parent(&dev_node, dev_node, 0);after #464 get merged.PS: according to the
C:\Windows\INF\pci.infPNP0A03is a "PCI Bus".@DJm00n
#464 has been merged. Maybe you want to take a look at this issue now.