http://bugs.winehq.org/show_bug.cgi?id=58229
Bug ID: 58229 Summary: _SH_SECURE sharing flag is not supported and causing _wfsopen to fail Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: bruvzg13@proton.me Distribution: ---
Calling _wfsopen with _SH_SECURE sharing flag result in failure and "012c:err:msvcrt:_wsopen_dispatch Unhandled shflags 0x80" error in the terminal.
0x80 value correspond to _SH_SECURE
Discovered while debugging Godot Engine - https://github.com/godotengine/godot/pull/106392
Seems like the case for this flag is missing: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/msvcrt/file.c?ref_typ...
The flag is documented as "shared read, exclusive write access" (https://learn.microsoft.com/en-us/cpp/c-runtime-library/sharing-constants?vi...), and the issue can be worked around by substituting it with "(mode_flags == READ) ? _SH_DENYWR : _SH_DENYRW", which result in the same behavior as on Windows (at least in our use case).