USB Support
Steve Kenton
skenton at ou.edu
Tue Apr 28 21:25:15 CDT 2015
On 04/25/2015 05:22 AM, Saulius Krasuckas wrote:
> * On Tue, 14 Apr 2015, Steve Kenton wrote:
>> On 04/14/2015 06:04 PM, Saulius Krasuckas wrote:
>>> * On Sun, 12 Apr 2015, Steve Kenton wrote:
>>>> I spent some more time looking at this last night and it looks like
>>>> the registry enum keys are about every device ever plugged into the
>>>> system, whether it's currently present or not and the actual Windows
>>>> device tree is maintained in memory, so just the registry keys
>>>> probably won't suffice.
>>>
>>> Steve, it won't of course. But this is the first required step. I
>>> would say that another way:
>>>
>>> let's make the HwDetect [6] (custom program) work in Wine the same way
>>> it works in Windows (except for disabling devices -- just the
>>> monitoring part). It reads very small amount of data from "Enum\USB"
>>> subkey (I guess).
>>>
>>> Another step might be fixing Wine so "USB Device Tree Viewer" [7]
>>> works as in Windows. But this one looks like a lot more complicated
>>> testcase.
> ...
>>> [6] http://www.codeproject.com/Articles/14500/Detecting-Hardware-Insertion-and-or-Removal
>>> [7] http://www.uwe-sieber.de/usbtreeview_e.html
>>>
>> I was thinking along those same lines with something like the display
>> portion of Windows Device Manager. ~wine/server/device.c has some
>> routines for managing devices, I need to spend some more time
>> understanding the current state of things. But yes, it does look like a
>> good place to start.
>
> In bug report 37724 Henrik Haftmann talks [8] about similar issue and
> offers code excerpt which uses related functions:
>
> SetupDiGetClassDevs()
> SetupDiEnumDeviceInfo()
> SetupDiOpenDevRegKey()
> SetupDiDestroyDeviceInfoList()
> SetupDiEnumDeviceInterfaces()
> SetupDiGetDeviceInterfaceDetail()
>
> You might be interested in collaboration:)
>
> S.
>
> [8] https://bugs.winehq.org/show_bug.cgi?id=37724
>
Actually, I think I'll come at it starting with a modified
regedit so I can get familiar with the Windows API and GUI
while displaying device information. And hopefully get a
handle on the registry while I'm at it.
I got into this because I'm writing firmware for a custom USB device
to use in an embedded Linux system and the vendor tools are only
available for Windows. Sigh. And of course Wine handles everything
fine *except* the USB snooping. I've spent my entire professional
life working the in Unix workstation & HPC world staring with PDP-11 and
later VAX "boot me" tapes from Bell Labs / Western Electric. I think
the last time I had to write a Windows GUI app was when the original
Windows 95 was released :-( So I'm woefully out of date on Windows.
Uwe Bonnes made this comment in another email:
"Newer usb devices often use winusb for usb communication. A translation
dll winusb->libusb is thinkable. However the problem of device detection
remains."
Crawling through /sys and /proc or writing a device driver shim I think
I can handle, Displaying the information or adding it to the registry is
is murky (to me) which is why I'm looking at such a bass-ackwards approach.
Steve
More information about the wine-devel
mailing list