* 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-o... [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.