http://bugs.winehq.org/show_bug.cgi?id=21023
Summary: SetupDiOpenDevRegKey() returns wrong HKEY Product: Wine Version: 1.1.34 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: setupapi AssignedTo: wine-bugs@winehq.org ReportedBy: mdealencar@gmail.com
Created an attachment (id=25222) --> (http://bugs.winehq.org/attachment.cgi?id=25222) bug example
In a Windows XP system SetupDiOpenDevRegKey() returns the "Device Parameters" HKEY under the device instance corresponding to the supplied (DeviceInfoSet, &DeviceInfoData) pair.
Wine's SetupDiOpenDevRegKey() returns the device instance HKEY instead.
The relevant registry keys are not created by Wine, so I had to import them from a Windows XP system
Example:
Windows HKEY returned corresponds to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_0451&Pid_6951\5&5a20206&0&1\Device Parameters
Wine HKEY returned corresponds to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_0451&Pid_6951\5&5a20206&0&1
The attached registry patches and source code enable the reproduction of the bug.
http://bugs.winehq.org/show_bug.cgi?id=21023
--- Comment #1 from Mauricio de Alencar mdealencar@gmail.com 2009-12-15 14:32:22 --- Created an attachment (id=25223) --> (http://bugs.winehq.org/attachment.cgi?id=25223) relevant registry entries
this must be merged with the registry for the example code to work
http://bugs.winehq.org/show_bug.cgi?id=21023
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase
http://bugs.winehq.org/show_bug.cgi?id=21023
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2009-12-15 19:41:57 --- Have a real world application that depends on this? Wine doesn't support any hardware drivers, so some of that information is kind of irrelevant.
http://bugs.winehq.org/show_bug.cgi?id=21023
--- Comment #3 from Juan Lang juan_lang@yahoo.com 2009-12-15 21:46:45 --- Part of the reason we can't install drivers is that setupapi is incomplete. Some drivers, e.g. USB drivers, should be possible to support. Besides, what's the point of broken code in the Wine tree? Arguing for incompleteness makes sense, but I don't see the point in just plain wrong code if it can be helped. (Note: I probably wrote the code in question. Oops.)
http://bugs.winehq.org/show_bug.cgi?id=21023
--- Comment #4 from Mauricio de Alencar mdealencar@gmail.com 2009-12-16 04:10:57 --- The application that I need which depends on this is an utility program that configures an USB DAQ module (Novus myPCLab). The module works well with the ti_usb_3410_5052 kernel module and can be accessed from wine through a COM_ port pointing to /dev/ttyACM_.
The config program, though, browses through the registry to locate the device, and fails because of this bug.
My workaround was to create the necessary registry values inside the wrong HKEY returned.
By the way, the example program can be compiled with:
i586-mingw32msvc-gcc -o bug_example_SetupDiOpenDevRegKey.exe bug_example_SetupDiOpenDevRegKey.c -lsetupapi
It will list the subkeys of the HKEY returned from SetupDiOpenDevRegKey().
Under Wine it shows three registry keys, among them the "Device Parameters" one.
Under Windows it shows nothing (the "Device Parameters" has no subkeys).
http://bugs.winehq.org/show_bug.cgi?id=21023
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2009-12-16 13:33:28 --- It seems like you have enough knowledge to fix this yourself. Why not have a go?
http://bugs.winehq.org/show_bug.cgi?id=21023
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #25222|text/x-csrc |text/plain mime type| |
http://bugs.winehq.org/show_bug.cgi?id=21023
--- Comment #6 from Austin English austinenglish@gmail.com 2012-04-02 00:26:20 CDT --- In 1.5.1, nothing is printed, and the return value is 1.
Added some printf's, it's failing at this call: HKEY KeyDevice; DWORD len = MAX_NAME_PORTS;
if (!SetupDiEnumDeviceInfo(DeviceInfoSet,numDev,&DeviceInfoData)) { SetupDiDestroyDeviceInfoList(DeviceInfoSet); return 1; }
http://bugs.winehq.org/show_bug.cgi?id=21023
Juan Lang juan.lang@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #7 from Juan Lang juan.lang@gmail.com 2012-04-02 15:03:24 CDT --- This deserves confirmation, then.
https://bugs.winehq.org/show_bug.cgi?id=21023
--- Comment #8 from Austin English austinenglish@gmail.com --- austin@aw25 ~ $ winegcc -m32 -o bug_example_SetupDiOpenDevRegKey.exe bug_example_SetupDiOpenDevRegKey.c -lsetupapi ; echo $? 0 austin@aw25 ~ $ wine bug_example_SetupDiOpenDevRegKey.exe.so ; echo $? 1 austin@aw25 ~ $ wine --version wine-1.7.23
https://bugs.winehq.org/show_bug.cgi?id=21023
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com Fixed by SHA1| |486fffa45c47fa102a40f88ea4f | |46c74fbd7640c Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #9 from Zebediah Figura z.figura12@gmail.com --- Fixed by https://source.winehq.org/git/wine.git/commit/486fffa45c47fa102a40f88ea4f46c74fbd7640c.
https://bugs.winehq.org/show_bug.cgi?id=21023
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.3.