https://bugs.winehq.org/show_bug.cgi?id=45266
Bug ID: 45266 Summary: SHFileOperation FO_MOVE fails to move files to target directory Product: Wine Version: 2.0 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: shell32 Assignee: wine-bugs@winehq.org Reporter: fheidenreich@gmail.com
When moving multiple files to one target directory, the SHFileOperation is aborted with ERROR_CANCELLED.
I think it's caused by an erroneous check at https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/shell32/shlfileop.c#l...
if (!(lpFileOp->fFlags & FOF_MULTIDESTFILES) && !flFrom->bAnyDirectories && flFrom->dwNumFiles > flTo->dwNumFiles) { return ERROR_CANCELLED; }
If the target is one single directory, FOF_MULTIDESTFILES is not set. flFrom->bAnyDirectories is false, since no directories are moved. And flFrom->dwNumFiles > flTo->dwNumFiles since we move multiple files to one target directory.
I'm not sure what's the reasoning behind !flFrom->bAnyDirectories anyway. Maybe it's just a typo and should read !flTo->bAnyDirectories