[Wine-devel] [PATCH] shell32: SHFileOperation can move several files into one directory

James Hawkins =?iso-8859-1?q?truiken_=CE=C1_gmail=2Ecom?=
Ср Июн 18 05:20:14 MSD 2008

2008/6/17 Vitaly Perov <vitperov на etersoft.ru>:
> The test was sent 2 hours ago
> If FOF_MULTIDESTFILES flag is set it's not olny mean that pTo contains
> multiple destination files, it also can contain one folder.
> Changelog:
> - shell32: SHFileOperation can move several files into one directory

--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -1426,7 +1426,8 @@ static HRESULT move_files(LPSHFILEOPSTRUCTW
lpFileOp, const FILE_LIST *flFrom, c
         return ERROR_CANCELLED;

     if ((lpFileOp->fFlags & FOF_MULTIDESTFILES) &&
-        flFrom->dwNumFiles != flTo->dwNumFiles)
+        flFrom->dwNumFiles != flTo->dwNumFiles  &&
+        !IsAttribDir(fileDest->attributes))
         return ERROR_CANCELLED;

There is a glaring error right here.  For one, you should heed
compiler warnings:

wine/dlls/shell32/shlfileop.c: In function 'SHFileOperationW':
wine/dlls/shell32/shlfileop.c:1428: warning: 'fileDest' is used
uninitialized in this function
wine/dlls/shell32/shlfileop.c:1407: note: 'fileDest' was declared here

You're using fileDest when it hasn't been initialized (as the warning
says).  Second, the tests fail:

shlfileop.c:1132: Test failed: The file is not moved - many files are
specified as a target
shlfileop.c:1206: Test failed: Expected d.txt to not exist
make: *** [shlfileop.ok] Error 2

James Hawkins

Подробная информация о списке рассылки Wine-devel