On Tue, 17 Jul 2012, Pete Batard wrote: > >> Does Windows guarantee that the DeviceAddress value is always > 0? > > > > The field is unsigned short, so yes. > > Ah you meant > 0, not >= 0. > > I already partially answered that, but my current assumption is that > Windows will never let a device that has a DeviceAddress of 0 be > accessible, since it wouldn't have been able to fetch the data > (descriptors) it needs to have to instantiate it. > > We do issue an IOCTL to a hub to get the DeviceAddress, so there's still > a remote possibility we get a zero if we're unlucky enough to query the > hub before low level OS initialization is complete.
On Linux this sort of thing can't happen because a new device isn't exposed to userspace until after its address has been assigned and it has been enumerated. > However, our querying of the hub is tied to already having identified a > device instantiated by Windows, and trying to populate some of its data. > Thus that DeviceAddress 0 entry we see should be an extra entry that > will be dropped, as failing to matching anything we know. Okay. So using DeviceAddress + 1 should work perfectly well. Alan Stern ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel