Commit b4a5775f authored by Zhenbo Li's avatar Zhenbo Li Committed by Alexandre Julliard

shell32: Create nonexistent destination directories in FO_MOVE.

parent 19627b13
......@@ -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;
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment