[Bug 42469] New: GetOpenFileName should expand environment variables in lpstrInitialDir
https://bugs.winehq.org/show_bug.cgi?id=42469 Bug ID: 42469 Summary: GetOpenFileName should expand environment variables in lpstrInitialDir Product: Wine Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: comdlg32 Assignee: wine-bugs(a)winehq.org Reporter: kamil.hornicek(a)reactos.org Distribution: --- Created attachment 57319 --> https://bugs.winehq.org/attachment.cgi?id=57319 testcase When passing an environment variables such as %programfiles% to GetOpenFileName via lpstrInitialDir these get expanded in Windows 2000 / XP but not in Wine, where it fails the PathFileExistsW check in filedlg on line 1598 and is later set to null. I checked and the orignial dll imports ExpandEnvironmentStrings. Attaching a minimal testcase and a possible solution. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 --- Comment #1 from Kamil Hornicek <kamil.hornicek(a)reactos.org> --- Created attachment 57320 --> https://bugs.winehq.org/attachment.cgi?id=57320 possible fix -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |2.2 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Assignee|wine-bugs(a)winehq.org |bunglehead(a)gmail.com --- Comment #2 from Nikolay Sivov <bunglehead(a)gmail.com> --- Created attachment 57326 --> https://bugs.winehq.org/attachment.cgi?id=57326 patch Hi, Kamil. I can confirm this. I think it's better to do expansion earlier, so you don't need to make a copy of original path only to free it on dialog initialization. Does this work for you? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 --- Comment #3 from Kamil Hornicek <kamil.hornicek(a)reactos.org> --- Hi and thanks for the quick reply! Your solution works, but GetFileDialog95A needs to be modified in the same way. I wasn't sure if it's preferable to do this earlier and don't allocate and free memory immediately, or duplicate the code in two places. I should have clarified that both ANSI and Unicode versions of GetOpenFileName should expand env. variables. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 --- Comment #4 from Nikolay Sivov <bunglehead(a)gmail.com> --- Yes, it needs some cleanup in general. It already duplicates some bits, and it doesn't have to. I'll take a look. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57326|0 |1 is obsolete| | --- Comment #5 from Nikolay Sivov <bunglehead(a)gmail.com> --- Created attachment 57327 --> https://bugs.winehq.org/attachment.cgi?id=57327 patch2 Please try this one, it should work now for both A and W. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 --- Comment #6 from Kamil Hornicek <kamil.hornicek(a)reactos.org> --- Perfect. Both A/U versions now work as expected. Thanks for your effort! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest(a)luukku.com --- Comment #7 from winetest(a)luukku.com --- http://source.winehq.org/git/wine.git/commit/aef84332a2dc3a05a3e1b433158b2e9... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |aef84332a2dc3a05a3e1b433158 | |b2e91abc48ed0 Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #8 from Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- Marking as fixed -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bunglehead(a)gmail.com |wine-bugs(a)winehq.org -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #9 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 2.3. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Michael Stefaniuc <mstefani(a)redhat.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=42469 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |--- --- Comment #10 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 2.0.x milestone from bugs included in 2.0.1. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org