http://bugs.winehq.org/show_bug.cgi?id=31987
Bug #: 31987 Summary: FindNextFile/DeleteFile loop fails for directories with many files Product: Wine Version: unspecified Platform: x86 OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: aric@codeweavers.com Classification: Unclassified
Created attachment 42153 --> http://bugs.winehq.org/attachment.cgi?id=42153 patch to show the issue
Doing a looping FindNextFile/DeleteFile is suppose to work on windows.
On wine if your directory contains enough files to fill the data in FIND_FIRST_INFO. Then when FindNextFile reloads the directory structure it causes it so skip a bunch of files because the state of the directory has changed.
The attached patch adds a wine test that demonstrates the issue.
You will notice in the trace a jump
file.c:2319: c:\test-dir\file38.a.a file.c:2319: c:\test-dir\file68.a.a
this means files 39 - 67 do not get deleted. resulting in the RemoveDirectory failing.
This issue affects the MechWarrior Online Patcher.