[2/2] shell32: Fix SHFileOperation(FO_MOVE) for a directory with subdirectories.

Dmitry Timoshkov dmitry at baikal.ru
Thu Mar 19 04:30:55 CDT 2015


---
 dlls/shell32/shlfileop.c       | 31 +------------------------------
 dlls/shell32/tests/shlfileop.c |  1 -
 2 files changed, 1 insertion(+), 31 deletions(-)

diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index e7e24e0..a8409f2 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -1389,42 +1389,13 @@ static DWORD delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
     return ERROR_SUCCESS;
 }
 
-static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, LPCWSTR szDestPath)
-{
-    WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
-    SHFILEOPSTRUCTW fileOp;
-
-    static const WCHAR wildCardFiles[] = {'*','.','*',0};
-
-    if (IsDotDir(feFrom->szFilename))
-        return;
-
-    SHNotifyCreateDirectoryW(szDestPath, NULL);
-
-    PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
-    szFrom[lstrlenW(szFrom) + 1] = '\0';
-
-    lstrcpyW(szTo, szDestPath);
-    szTo[lstrlenW(szDestPath) + 1] = '\0';
-
-    fileOp = *lpFileOp;
-    fileOp.pFrom = szFrom;
-    fileOp.pTo = szTo;
-
-    SHFileOperationW(&fileOp);
-}
-
 /* moves a file or directory to another directory */
 static void move_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, const FILE_ENTRY *feTo)
 {
     WCHAR szDestPath[MAX_PATH];
 
     PathCombineW(szDestPath, feTo->szFullPath, feFrom->szFilename);
-
-    if (IsAttribFile(feFrom->attributes))
-        SHNotifyMoveFileW(feFrom->szFullPath, szDestPath);
-    else if (!(lpFileOp->fFlags & FOF_FILESONLY && feFrom->bFromWildcard))
-        move_dir_to_dir(lpFileOp, feFrom, szDestPath);
+    SHNotifyMoveFileW(feFrom->szFullPath, szDestPath);
 }
 
 /* the FO_MOVE operation */
diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c
index fa83adf..d33ad5b 100644
--- a/dlls/shell32/tests/shlfileop.c
+++ b/dlls/shell32/tests/shlfileop.c
@@ -1860,7 +1860,6 @@ static void test_move(void)
 
     ok(file_exists("testdir2"), "dir should not be moved\n");
     ok(!file_exists("testdir2\\one.txt"), "file should be moved\n");
-todo_wine
     ok(!file_exists("testdir2\\nested"), "dir should be moved\n");
     ok(!file_exists("testdir2\\nested\\two.txt"), "file should be moved\n");
 
-- 
2.3.3




More information about the wine-patches mailing list