https://bugs.winehq.org/show_bug.cgi?id=46454
Bug ID: 46454 Summary: Minimalistic C++ program removing non-empty directory is not working Product: Wine Version: 4.0-rc5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: contact@shaac.me Distribution: ---
Created attachment 63241 --> https://bugs.winehq.org/attachment.cgi?id=63241 The binary that works well on Windows, and less well with Wine
If Wine executes a C++ program executing `std::filesystem::remove_all`, compiled with MSVC, then it will only succeed to remove empty folders, but will silently fail if the folder is not empty. The call will not raise any error, but the folder and its content will stay on disk.
In attachment is such a program, rm.exe. If you do `rm.exe <dirname>` on wine, it will fail to delete non-empty folders. But the same command on Windows will succeed.
The only Wine terminal output, which shows both when deleting an empty folder (success) and a non empty-one (failure: bug), is: 002b:fixme:kernelbase:AppPolicyGetProcessTerminationMethod 0xfffffffffffffffa, 0x22fd10
I tested this with wine-4.0-rc5 on Archlinux. And did the Windows side of tests on a Windows 7 professional.
The program source code is:
#include <filesystem> int main(int, char** argv) { std::filesystem::remove_all(std::filesystem::path(argv[1])); }
I compiled this program with MSVC version 19.15.26732.1 for x64, with Wine, and with `/EHsc /TP /std:c++17` flags.
https://bugs.winehq.org/show_bug.cgi?id=46454
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|-unknown |ntdll CC| |dark.shadow4@web.de Ever confirmed|0 |1
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Confirming. Problem here is that SetFileInformationByHandle with FileDispositionInfo on a non-empty directory must return FALSE with error code ERROR_DIR_NOT_EMPTY.
Problem is either in kernel32 or ntdll, I assume it's the latter.
My problem here is how to check if it's an empty directory. I'd usually use FindNextFile, but since the directory is already opened (exclusively) at this point, this isn't feasible.
https://bugs.winehq.org/show_bug.cgi?id=46454
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #2 from Zebediah Figura z.figura12@gmail.com --- See https://www.winehq.org/pipermail/wine-devel/2018-November/134626.html; perhaps that will have a better chance of being accepted now that a real application does depend on it.
https://bugs.winehq.org/show_bug.cgi?id=46454
minilandl jasper.greenhill@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jasper.greenhill@gmail.com
--- Comment #3 from minilandl jasper.greenhill@gmail.com --- This also Occurs on Origin and The New EA Desktop app. Using wine 6.5 solves this issue but anything newer doesn't allow games to be added using any directory
https://bugs.winehq.org/show_bug.cgi?id=46454
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download