shell32: FOF_MULTIDESTFILES must be set when copying files into directory

James Hawkins truiken at gmail.com
Sat Oct 18 06:24:09 CDT 2008


On Sat, Oct 18, 2008 at 5:48 AM, Vitaly Perov <vitperov at etersoft.ru> wrote:
>>We've been over this before.  This needs a test case.  Either way,
>>this doesn't look right.  What are you trying to fix?
>
> Some program call SHFileOperationW to move one folder to another without
> FOF_MULTIDESTFILES. The source folder contain subfolders, so SHFileOperationW
> is called recursively. To move subfolder function move_dir_to_dir is called.
> Now it pass parent lpFileOp to the new iteration of SHFileOperationW, so
> FOF_MULTIDESTFILES is no set (but it should be set, as we copy files to the
> folder). So in the function move_files the following condition is true:
>
> if (!(lpFileOp->fFlags & FOF_MULTIDESTFILES) &&
>        !flFrom->bAnyDirectories &&
>        flFrom->dwNumFiles > flTo->dwNumFiles)
>    {
>        return ERROR_CANCELLED;
>    }
>
> and SHFileOperationW return error.
>

You never mentioned a specific program, so I still don't know if this
is a real world bug you're running into.  Either way, your logic is
flawed, as fileOp.pTo is a single directory in this case, so using
FOF_MULTIDESTFILES is wrong.

-- 
James Hawkins



More information about the wine-devel mailing list