device filtering support
Pete Batard
pete at akeo.ie
Mon Feb 6 06:06:53 EST 2012
On 2012.02.06 08:22, Vitali Lovich wrote:
> Yeah, I'm pretty sure it's possible to convert VID/PID to GUIDs, or to determine the VID/PID without actually querying the device; after all, the VID& PID are encoded in the device instance path.
And that's something we can do with our current enum process.
GUID -> VID:PID is easy, since the Windows API works with GUID.
VID:PID -> GUID is a bit more complex since you either need to find out
and query all the GUIDs (which I don't see any other way of doing other
than multiple passes since you usually have to query a GUID to find more
GUIDs that may be relevant to you), or hack into the enum part of the
registry directly. But we're obviously already doing that using the
Windows API.
I assumed the question was about a simplified "one pass" filtered enum
process using GUIDs, as this is what Travis appears to be using on his
side, and was pushing to have in libusb. Otherwise, adding filtering on
GUIDs that doesn't query hubs should be achievable with out current
enum. I think we just need to add a flag that prevents any call that may
result in IO, and then add an extra pass to remove any device from our
list that was relying on such IO, so that we eliminate any
libusbx-incomplete device.
Regards,
/Pete
More information about the libusbx
mailing list