From: Zhenbo Li litimetal@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=25207 --- dlls/shell32/shlfileop.c | 6 ++++-- dlls/shell32/tests/shlfileop.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index b4a941187ab..a7e88c813d2 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -1398,6 +1398,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const INT mismatched = 0; const FILE_ENTRY *entryToMove; const FILE_ENTRY *fileDest; + int ret;
if (!flFrom->dwNumFiles) return ERROR_SUCCESS; @@ -1418,8 +1419,9 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const return ERROR_CANCELLED; }
- if (!PathFileExistsW(flTo->feFiles[0].szDirectory)) - return ERROR_CANCELLED; + ret = SHCreateDirectoryExW(NULL, flTo->feFiles[0].szDirectory, NULL); + if (ret && ret != ERROR_ALREADY_EXISTS) + return ret;
if (lpFileOp->fFlags & FOF_MULTIDESTFILES) mismatched = flFrom->dwNumFiles - flTo->dwNumFiles; diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 1b00780499c..097e99fd113 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -2165,8 +2165,8 @@ static void test_move(void) shfo.pFrom = "test2.txt\0"; shfo.pTo = "dir1\dir2\test2.txt\0"; retval = SHFileOperationA(&shfo); - todo_wine ok(!retval, "got %ld\n", retval); - todo_wine ok(DeleteFileA("dir1\dir2\test2.txt"), "Expected dir1\dir2\test2.txt to exist\n"); + ok(!retval, "got %ld\n", retval); + ok(DeleteFileA("dir1\dir2\test2.txt"), "Expected dir1\dir2\test2.txt to exist\n"); RemoveDirectoryA("dir1\dir2"); RemoveDirectoryA("dir1"); createTestFile("test2.txt");