https://bugs.winehq.org/show_bug.cgi?id=54491
Bug ID: 54491 Summary: regedit/regproc.c - export_key() is unable to return TRUE Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: programs Assignee: wine-bugs@winehq.org Reporter: gonzomdx@gmail.com Distribution: ---
export_key() function should return either TRUE if succeeded or FALSE if failed.
Values are returned in lines 1459 and 1463 (hardcoded FALSE) as well as line 1471 (BOOL ret).
Due to the fact that ret get its value returned from the function export_registry_data() (line 1466) which EVER returns an int of value 0, there is no possibility that export_key() succeeds.
The easiest solution would be to simply return TRUE instead of ret. The most elegant solution would be to let export_registry_data() sane data.
https://bugs.winehq.org/show_bug.cgi?id=54491
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- That probably means that returns values are not used anywhere. Maybe it should be propagated properly and result in user-facing error message.
Did you find this by inspecting the code, or some other way?
https://bugs.winehq.org/show_bug.cgi?id=54491
--- Comment #2 from Robert Naumann gonzomdx@gmail.com --- I found it out while synching wine Code to a forked regedit.exe in another project (which I will not mention here because it's not desired - I'm sure you know what I mean). On our side I worked around the bug with setting res to True before returning it, which seems more like a hack than a real fix. I'll give you our Bug ID CORE-18603 if you want to look at it. The return value is also checked in wine here: https://source.winehq.org/git/wine.git/blob/HEAD:/programs/regedit/framewnd.... but no error is observed because inside this code block is only a commented printf line.
https://bugs.winehq.org/show_bug.cgi?id=54491
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- So what's the problem exactly, and what needs to be done? Do we need to improve error handling or remove it? Instead of external references please describe what the issue is.
https://bugs.winehq.org/show_bug.cgi?id=54491
--- Comment #4 from Robert Naumann gonzomdx@gmail.com --- Created attachment 74048 --> https://bugs.winehq.org/attachment.cgi?id=74048 a patch which makes the bug visible
I hope you can reproduce it that way:
1. Apply this attached patch 2. Open regedit, select the root key and try to export it. 3. it works without error ( export_all() is called which works correct ) 4. Open regedit, select any different key and try to export it. 5. it should work without, but throws an error ( export_key() is called which works not correct because it will EVER return FALSE because it gets its return value from export_registry_data(), which is ever 0 )
What I want is to either fix export_key() or export_registry_data(), so that in the end export_key() returns TRUE if succeeded and FALSE if failed.
I hope this makes it a bit clearer.
https://bugs.winehq.org/show_bug.cgi?id=54491
--- Comment #5 from Robert Naumann gonzomdx@gmail.com --- What I forgot to mention is, at point 5,the error is shown but the export does indeed work correctly.
https://bugs.winehq.org/show_bug.cgi?id=54491
--- Comment #6 from Robert Naumann gonzomdx@gmail.com --- fixed by commit f5fe9a6cf9121004ecdf5c0b285fcd88ec8a0d94. Thank you very much, Hugh.
https://bugs.winehq.org/show_bug.cgi?id=54491
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f5fe9a6cf9121004ecdf5c0b285 | |fcd88ec8a0d94 Version|unspecified |8.1 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #7 from Gijs Vermeulen gijsvrm@gmail.com --- Thanks for retesting, marking FIXED.
https://bugs.winehq.org/show_bug.cgi?id=54491
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.4.