[Bug 47054] New: SHCreateDirectory/ SHCreateDirectoryEx error result incorrect when hwnd is not NULL and directory already exists

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 47054] New: SHCreateDirectory/ SHCreateDirectoryEx error result incorrect when hwnd is not NULL and directory already exists

Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=47054

            Bug ID: 47054
           Summary: SHCreateDirectory/SHCreateDirectoryEx error result
                    incorrect when hwnd is not NULL and directory already
                    exists
           Product: Wine
           Version: 4.6
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: shell32
          Assignee: [hidden email]
          Reporter: [hidden email]
      Distribution: ---

Created attachment 64221
  --> https://bugs.winehq.org/attachment.cgi?id=64221
Test case (source)

When SHCreateDirectory/SHCreateDirectoryEx is called with a non-NULL hwnd and a
path to a directory that already exists,
Wine returns 1223 (ERROR_CANCELLED) instead of 183 (ERROR_ALREADY_EXISTS).
This is being set in
https://source.winehq.org/git/wine.git/blob/fabde842ede40fc53cf6f5743d5b477841f7b11c:/dlls/shell32/shlfileop.c#l766

According to the MSDN
(https://docs.microsoft.com/en-us/windows/desktop/api/shlobj_core/nf-shlobj_core-shcreatedirectoryexw#remarks):
it seems that ERROR_CANCELLED should only be returned in special cases,
independent of whether hwnd is NULL or not.

This may also affect other error conditions.

Windows XP (VM) test case output (no warning messagebox is created):

SHCreateDirectory, NULL hwnd: 183
SHCreateDirectory, actual hwnd: 183
SHCreateDirectoryExW, NULL hwnd: 183
SHCreateDirectoryExW, actual hwnd: 183

Wine test case output:

SHCreateDirectory, NULL hwnd: 183
0009:fixme:shell:SHCreateDirectoryExW Show system error message, creating path
L"C:\\Windows\\Temp\\test", failed with error 183
SHCreateDirectory, actual hwnd: 1223
SHCreateDirectoryExW, NULL hwnd: 183
0009:fixme:shell:SHCreateDirectoryExW Show system error message, creating path
L"C:\\Windows\\Temp\\test", failed with error 183
SHCreateDirectoryExW, actual hwnd: 1223


This affects Atelier Lydie and Suelle: saving doesn't work when the SAVEDATA
directory already exists.
This probably happens since the game is checking if SHCreateDirectoryExW
succeeds or returns ERROR_ALREADY_EXISTS,
as manually patching shell32.dll.so to skip the FIXME section fixes the issue.

Associated Proton issue: https://github.com/ValveSoftware/Proton/issues/2452

--
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.


Reply | Threaded
Open this post in threaded view
|

[Bug 47054] SHCreateDirectory/ SHCreateDirectoryEx error result incorrect when hwnd is not NULL and directory already exists

Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=47054

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from [hidden email] ---
Ack, dup of 47023.

*** This bug has been marked as a duplicate of bug 47023 ***

--
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.


Reply | Threaded
Open this post in threaded view
|

[Bug 47054] SHCreateDirectory/ SHCreateDirectoryEx error result incorrect when hwnd is not NULL and directory already exists

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=47054

Alistair Leslie-Hughes <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #2 from Alistair Leslie-Hughes <[hidden email]> ---
Closing Duplicate.

--
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.