sync rostests to r44455
[reactos.git] / rostests / winetests / shell32 / shlfileop.c
index 33d1a94..c24a6f2 100644 (file)
@@ -585,14 +585,14 @@ static void test_delete(void)
     /* try to delete an invalid filename */
     if (0) {
         /* this crashes on win9x */
-        init_shfo_tests();
-        shfo.pFrom = "\0";
-        shfo.fFlags &= ~FOF_FILESONLY;
-        shfo.fAnyOperationsAborted = FALSE;
-        ret = SHFileOperation(&shfo);
-        ok(ret == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %d\n", ret);
-        ok(!shfo.fAnyOperationsAborted, "Expected no aborted operations\n");
-        ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
+    init_shfo_tests();
+    shfo.pFrom = "\0";
+    shfo.fFlags &= ~FOF_FILESONLY;
+    shfo.fAnyOperationsAborted = FALSE;
+    ret = SHFileOperation(&shfo);
+    ok(ret == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %d\n", ret);
+    ok(!shfo.fAnyOperationsAborted, "Expected no aborted operations\n");
+    ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
     }
 
     /* try an invalid function */
@@ -608,12 +608,12 @@ static void test_delete(void)
     /* try an invalid list, only one null terminator */
     if (0) {
         /* this crashes on win9x */
-        init_shfo_tests();
-        shfo.pFrom = "";
-        shfo.wFunc = FO_DELETE;
-        ret = SHFileOperation(&shfo);
-        ok(ret == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %d\n", ret);
-        ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
+    init_shfo_tests();
+    shfo.pFrom = "";
+    shfo.wFunc = FO_DELETE;
+    ret = SHFileOperation(&shfo);
+    ok(ret == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %d\n", ret);
+    ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
     }
 
     /* delete a nonexistent file */
@@ -632,14 +632,14 @@ static void test_delete(void)
     if (ret != ERROR_FILE_NOT_FOUND)
     {
         /* Vista would throw up a dialog box that we can't suppress */
-        init_shfo_tests();
-        shfo.pFrom = "testdir2\0testdir2\\one.txt\0";
-        ret = SHFileOperation(&shfo);
+    init_shfo_tests();
+    shfo.pFrom = "testdir2\0testdir2\\one.txt\0";
+    ret = SHFileOperation(&shfo);
         ok(ret == ERROR_PATH_NOT_FOUND ||
            broken(ret == ERROR_SUCCESS), /* NT4 */
            "Expected ERROR_PATH_NOT_FOUND, got %d\n", ret);
         ok(!dir_exists("testdir2"), "Expected testdir2 to not exist\n");
-        ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n");
+    ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n");
     }
     else
         skip("Test would show a dialog box\n");
@@ -690,7 +690,7 @@ static void test_rename(void)
     else
     {
         ok(retval == ERROR_SUCCESS, "File is renamed moving to other directory\n");
-        ok(file_exists("test4.txt\\test1.txt"), "The file is not renamed\n");
+    ok(file_exists("test4.txt\\test1.txt"), "The file is not renamed\n");
     }
 
     set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0");
@@ -800,10 +800,10 @@ static void test_rename(void)
     /* pFrom is NULL, commented out because it crashes on nt 4.0 */
     if (0)
     {
-        shfo.pFrom = NULL;
-        retval = SHFileOperationA(&shfo);
-        ok(retval == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", retval);
-    }
+    shfo.pFrom = NULL;
+    retval = SHFileOperationA(&shfo);
+    ok(retval == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", retval);
+}
 }
 
 /* tests the FO_COPY action */
@@ -842,7 +842,7 @@ static void test_copy(void)
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
         ok(!file_exists("test6.txt"), "The file is copied - many files are "
-           "specified as a target\n");
+       "specified as a target\n");
     }
 
     memcpy(&shfo2, &shfo, sizeof(SHFILEOPSTRUCTA));
@@ -876,7 +876,7 @@ static void test_copy(void)
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
         ok(!file_exists("test6.txt"), "The file is copied - many files are "
-           "specified as a target\n");
+       "specified as a target\n");
     }
 
     set_curr_dir_path(from, "test1.txt\0");
@@ -940,10 +940,10 @@ static void test_copy(void)
     set_curr_dir_path(from, "test1.txt\0");
     set_curr_dir_path(to, "nonexistent\\notreal\\test2.txt\0");
     retval= SHFileOperation(&shfo);
-    ok(!retval, "Error copying into nonexistent directory\n");
-    ok(file_exists("nonexistent"), "nonexistent not created\n");
-    ok(file_exists("nonexistent\\notreal"), "nonexistent\\notreal not created\n");
-    ok(file_exists("nonexistent\\notreal\\test2.txt"), "Directory not created\n");
+        ok(!retval, "Error copying into nonexistent directory\n");
+        ok(file_exists("nonexistent"), "nonexistent not created\n");
+        ok(file_exists("nonexistent\\notreal"), "nonexistent\\notreal not created\n");
+        ok(file_exists("nonexistent\\notreal\\test2.txt"), "Directory not created\n");
     ok(!file_exists("nonexistent\\notreal\\test1.txt"), "test1.txt should not exist\n");
 
     /* a relative dest directory is OK */
@@ -973,7 +973,7 @@ static void test_copy(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n");
+    ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n");
     }
     ok(!file_exists("test3.txt\\test2.txt"), "Expected test3.txt\\test2.txt to not exist\n");
 
@@ -982,10 +982,10 @@ static void test_copy(void)
     shfo.fFlags &= ~FOF_NOERRORUI;
     shfo.fAnyOperationsAborted = FALSE;
     retval = SHFileOperation(&shfo);
-    ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
-    ok(DeleteFile("test3.txt\\test1.txt"), "Expected test3.txt\\test1.txt to exist\n");
-    ok(DeleteFile("test3.txt\\test2.txt"), "Expected test3.txt\\test1.txt to exist\n");
-    ok(RemoveDirectory(to), "Expected test3.txt to exist\n");
+        ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+        ok(DeleteFile("test3.txt\\test1.txt"), "Expected test3.txt\\test1.txt to exist\n");
+        ok(DeleteFile("test3.txt\\test2.txt"), "Expected test3.txt\\test1.txt to exist\n");
+        ok(RemoveDirectory(to), "Expected test3.txt to exist\n");
 
     /* send in FOF_MULTIDESTFILES with too many destination files */
     init_shfo_tests();
@@ -1011,7 +1011,7 @@ static void test_copy(void)
         ok(shfo.fAnyOperationsAborted ||
            broken(!shfo.fAnyOperationsAborted), /* NT4 */
            "Expected aborted operations\n");
-        ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\a.txt to not exist\n");
+    ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\a.txt to not exist\n");
     }
 
     /* send in FOF_MULTIDESTFILES with too many destination files */
@@ -1034,7 +1034,7 @@ static void test_copy(void)
         ok(shfo.fAnyOperationsAborted ||
            broken(!shfo.fAnyOperationsAborted), /* NT4 */
            "Expected aborted operations\n");
-        ok(!file_exists("e.txt"), "Expected e.txt to not exist\n");
+    ok(!file_exists("e.txt"), "Expected e.txt to not exist\n");
     }
 
     /* use FOF_MULTIDESTFILES with files and a source directory */
@@ -1048,7 +1048,7 @@ static void test_copy(void)
     ok(DeleteFile("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
     ok(DeleteFile("testdir2\\b.txt"), "Expected testdir2\\b.txt to exist\n");
     if (retval == ERROR_SUCCESS)
-        ok(RemoveDirectory("testdir2\\c.txt"), "Expected testdir2\\c.txt to exist\n");
+    ok(RemoveDirectory("testdir2\\c.txt"), "Expected testdir2\\c.txt to exist\n");
 
     /* try many dest files without FOF_MULTIDESTFILES flag */
     shfo.pFrom = "test1.txt\0test2.txt\0test3.txt\0";
@@ -1068,7 +1068,7 @@ static void test_copy(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(!file_exists("a.txt"), "Expected a.txt to not exist\n");
+    ok(!file_exists("a.txt"), "Expected a.txt to not exist\n");
     }
 
     /* try a glob */
@@ -1079,7 +1079,7 @@ static void test_copy(void)
     ok(retval == ERROR_SUCCESS ||
        broken(retval == 0x100a1), /* WinMe */
        "Expected ERROR_SUCCESS, got %d\n", retval);
-    ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
+        ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
 
     /* try a glob with FOF_FILESONLY */
     clean_after_shfo_tests();
@@ -1087,8 +1087,8 @@ static void test_copy(void)
     shfo.pFrom = "test?.txt\0";
     shfo.fFlags |= FOF_FILESONLY;
     retval = SHFileOperation(&shfo);
-    ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
-    ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
+        ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+        ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
     ok(!dir_exists("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to not exist\n");
 
     /* try a glob with FOF_MULTIDESTFILES and the same number
@@ -1116,7 +1116,7 @@ static void test_copy(void)
         ok(shfo.fAnyOperationsAborted ||
            broken(!shfo.fAnyOperationsAborted), /* NT4 */
            "Expected aborted operations\n");
-        ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\test1.txt to not exist\n");
+    ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\test1.txt to not exist\n");
     }
     ok(!RemoveDirectory("b.txt"), "b.txt should not exist\n");
 
@@ -1161,7 +1161,7 @@ static void test_copy(void)
         ok(shfo.fAnyOperationsAborted ||
            broken(!shfo.fAnyOperationsAborted), /* NT4 */
            "Expected aborted operations\n");
-        ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n");
+    ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n");
     }
 
     /* copy one file and one directory to three others */
@@ -1184,8 +1184,8 @@ static void test_copy(void)
         ok(shfo.fAnyOperationsAborted ||
            broken(!shfo.fAnyOperationsAborted), /* NT4 */
            "Expected aborted operations\n");
-        ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n");
-        ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n");
+    ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n");
+    ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n");
     }
 
     /* copy a directory with a file beneath it, plus some files */
@@ -1201,8 +1201,8 @@ static void test_copy(void)
     if (retval == ERROR_SUCCESS)
     {
         ok(DeleteFile("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n");
-        ok(DeleteFile("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
-        ok(RemoveDirectory("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to exist\n");
+    ok(DeleteFile("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
+    ok(RemoveDirectory("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to exist\n");
     }
 
     /* copy one directory and a file in that dir to another dir */
@@ -1214,8 +1214,8 @@ static void test_copy(void)
        "Expected ERROR_SUCCESS, got %d\n", retval);
     if (retval == ERROR_SUCCESS)
     {
-        ok(DeleteFile("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
-        ok(DeleteFile("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
+    ok(DeleteFile("testdir2\\test4.txt\\a.txt"), "Expected a.txt to exist\n");
+    ok(DeleteFile("testdir2\\a.txt"), "Expected testdir2\\a.txt to exist\n");
     }
 
     /* copy a file in a directory first, and then the directory to a nonexistent dir */
@@ -1237,7 +1237,7 @@ static void test_copy(void)
         ok(shfo.fAnyOperationsAborted ||
            broken(!shfo.fAnyOperationsAborted), /* NT4 */
            "Expected aborted operations\n");
-        ok(!file_exists("nonexistent\\test4.txt"), "Expected nonexistent\\test4.txt to not exist\n");
+    ok(!file_exists("nonexistent\\test4.txt"), "Expected nonexistent\\test4.txt to not exist\n");
     }
     DeleteFile("test4.txt\\a.txt");
 
@@ -1257,7 +1257,7 @@ static void test_copy(void)
         ok(retval == DE_SAMEFILE, "Expected DE_SAMEFILE, got %d\n", retval);
         ok(DeleteFile("b.txt"), "Expected b.txt to exist\n");
     }
-    ok(!shfo.fAnyOperationsAborted, "Expected no operations to be aborted\n");
+        ok(!shfo.fAnyOperationsAborted, "Expected no operations to be aborted\n");
     ok(!file_exists("c.txt"), "Expected c.txt to not exist\n");
 
     /* destination is same as source directory */
@@ -1325,7 +1325,7 @@ static void test_copy(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(!file_exists("test4.txt\\a.txt"), "Expected test4.txt\\a.txt to not exist\n");
+    ok(!file_exists("test4.txt\\a.txt"), "Expected test4.txt\\a.txt to not exist\n");
     }
 
     /* copy a nonexistent file to a nonexistent directory */
@@ -1348,30 +1348,30 @@ static void test_copy(void)
         /* NT4 would throw up some dialog boxes and doesn't copy files that are needed
          * in subsequent tests.
          */
-        shfo.fFlags = FOF_NOCONFIRMATION;
-        shfo.pFrom = "test1.txt\0";
-        shfo.pTo = "test2.txt\0";
-        shfo.fAnyOperationsAborted = FALSE;
-        /* without FOF_NOCONFIRMATION the confirmation is Yes/No */
-        retval = SHFileOperation(&shfo);
+    shfo.fFlags = FOF_NOCONFIRMATION;
+    shfo.pFrom = "test1.txt\0";
+    shfo.pTo = "test2.txt\0";
+    shfo.fAnyOperationsAborted = FALSE;
+    /* without FOF_NOCONFIRMATION the confirmation is Yes/No */
+    retval = SHFileOperation(&shfo);
         ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
-        ok(file_has_content("test2.txt", "test1.txt\n"), "The file was not copied\n");
+    ok(file_has_content("test2.txt", "test1.txt\n"), "The file was not copied\n");
 
-        shfo.pFrom = "test3.txt\0test1.txt\0";
-        shfo.pTo = "test2.txt\0one.txt\0";
-        shfo.fFlags = FOF_NOCONFIRMATION | FOF_MULTIDESTFILES;
-        /* without FOF_NOCONFIRMATION the confirmation is Yes/Yes to All/No/Cancel */
-        retval = SHFileOperation(&shfo);
+    shfo.pFrom = "test3.txt\0test1.txt\0";
+    shfo.pTo = "test2.txt\0one.txt\0";
+    shfo.fFlags = FOF_NOCONFIRMATION | FOF_MULTIDESTFILES;
+    /* without FOF_NOCONFIRMATION the confirmation is Yes/Yes to All/No/Cancel */
+    retval = SHFileOperation(&shfo);
         ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
-        ok(file_has_content("test2.txt", "test3.txt\n"), "The file was not copied\n");
+    ok(file_has_content("test2.txt", "test3.txt\n"), "The file was not copied\n");
 
-        shfo.pFrom = "one.txt\0";
-        shfo.pTo = "testdir2\0";
-        shfo.fFlags = FOF_NOCONFIRMATION;
-        /* without FOF_NOCONFIRMATION the confirmation is Yes/No */
-        retval = SHFileOperation(&shfo);
-        ok(retval == 0, "Expected 0, got %d\n", retval);
-        ok(file_has_content("testdir2\\one.txt", "test1.txt\n"), "The file was not copied\n");
+    shfo.pFrom = "one.txt\0";
+    shfo.pTo = "testdir2\0";
+    shfo.fFlags = FOF_NOCONFIRMATION;
+    /* without FOF_NOCONFIRMATION the confirmation is Yes/No */
+    retval = SHFileOperation(&shfo);
+    ok(retval == 0, "Expected 0, got %d\n", retval);
+    ok(file_has_content("testdir2\\one.txt", "test1.txt\n"), "The file was not copied\n");
     }
 
     createTestFile("test4.txt\\test1.txt");
@@ -1386,11 +1386,11 @@ static void test_copy(void)
     shfo.fFlags = FOF_NOCONFIRMATION;
     if (ERROR_SUCCESS)
     {
-        createTestFile("test4.txt\\.\\test1.txt"); /* modify the content of the file */
-        /* without FOF_NOCONFIRMATION the confirmation is "This folder already contains a folder named ..." */
-        retval = SHFileOperation(&shfo);
-        ok(retval == 0, "Expected 0, got %d\n", retval);
-        ok(file_has_content("testdir2\\test4.txt\\test1.txt", "test4.txt\\.\\test1.txt\n"), "The file was not copied\n");
+    createTestFile("test4.txt\\.\\test1.txt"); /* modify the content of the file */
+    /* without FOF_NOCONFIRMATION the confirmation is "This folder already contains a folder named ..." */
+    retval = SHFileOperation(&shfo);
+    ok(retval == 0, "Expected 0, got %d\n", retval);
+    ok(file_has_content("testdir2\\test4.txt\\test1.txt", "test4.txt\\.\\test1.txt\n"), "The file was not copied\n");
     }
 
     createTestFile("one.txt");
@@ -1412,7 +1412,7 @@ static void test_copy(void)
         /* Vista and W2K8 (broken or new behavior ?) */
         ok(RemoveDirectory("two.txt"), "Expected two.txt to exist\n");
     else
-        ok(!DeleteFileA("two.txt"), "Expected file to not exist\n");
+    ok(!DeleteFileA("two.txt"), "Expected file to not exist\n");
 
     createTestFile("one.txt");
 
@@ -1431,7 +1431,7 @@ static void test_copy(void)
     }
     else
     {
-        ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+    ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
         ok(DeleteFileA("two.txt"), "Expected file to exist\n");
     }
     ok(DeleteFileA("one.txt"), "Expected file to exist\n");
@@ -1450,7 +1450,7 @@ static void test_copy(void)
     }
     else
     {
-        ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+    ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
         ok(DeleteFileA("two.txt"), "Expected file to exist\n");
     }
     ok(DeleteFileA("one.txt"), "Expected file to exist\n");
@@ -1477,7 +1477,7 @@ static void test_copy(void)
         /* Vista and W2K8 (broken or new behavior ?) */
         ok(RemoveDirectory("two.txt"), "Expected two.txt to exist\n");
     else
-        ok(!DeleteFileA("two.txt"), "Expected file to not exist\n");
+    ok(!DeleteFileA("two.txt"), "Expected file to not exist\n");
 
     createTestFile("one.txt");
 
@@ -1497,7 +1497,7 @@ static void test_copy(void)
     }
     else
     {
-        ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
+    ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
         ok(DeleteFileA("two.txt"), "Expected file to exist\n");
     }
     ok(DeleteFileA("one.txt"), "Expected file to exist\n");
@@ -1527,8 +1527,8 @@ static void test_copy(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(!DeleteFileA("threedir\\one.txt"), "Expected file to not exist\n");
-        ok(!DeleteFileA("threedir\\two.txt"), "Expected file to not exist\n");
+    ok(!DeleteFileA("threedir\\one.txt"), "Expected file to not exist\n");
+    ok(!DeleteFileA("threedir\\two.txt"), "Expected file to not exist\n");
         ok(!DeleteFileA("threedir"), "Expected file to not exist\n");
         ok(!RemoveDirectoryA("threedir"), "Expected dir to not exist\n");
     }
@@ -1559,33 +1559,33 @@ static void test_copy(void)
 
     if (0) {
         /* this crashes on win9x */
-        createTestFile("one.txt");
-        createTestFile("two.txt");
+    createTestFile("one.txt");
+    createTestFile("two.txt");
 
         /* pTo contains bogus 2nd name longer than MAX_PATH,
-         * multiple source files, FOF_MULTIDESTFILES
-         * dest dir does not exist
-         */
+     * multiple source files, FOF_MULTIDESTFILES
+     * dest dir does not exist
+     */
 
-        memset(to, 'a', 2 * MAX_PATH);
+    memset(to, 'a', 2 * MAX_PATH);
         memset(to+MAX_PATH*2, 0, 2);
-        lstrcpyA(to, "threedir");
-        shfo.pFrom = "one.txt\0two.txt\0";
-        shfo.pTo = to;
-        shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
-                      FOF_SILENT | FOF_NOERRORUI;
-        retval = SHFileOperation(&shfo);
-        ok(retval == ERROR_CANCELLED ||
-           retval == ERROR_SUCCESS, /* win2k3 */
-           "Expected ERROR_CANCELLED or ERROR_SUCCESS, got %d\n", retval);
-        ok(!DeleteFileA("threedir\\one.txt"), "Expected file to not exist\n");
-        ok(!DeleteFileA("threedir\\two.txt"), "Expected file to not exist\n");
-        ok(DeleteFileA("one.txt"), "Expected file to exist\n");
-        ok(DeleteFileA("two.txt"), "Expected file to exist\n");
-        ok(!RemoveDirectoryA("threedir"), "Expected dir to not exist\n");
+    lstrcpyA(to, "threedir");
+    shfo.pFrom = "one.txt\0two.txt\0";
+    shfo.pTo = to;
+    shfo.fFlags = FOF_MULTIDESTFILES | FOF_NOCONFIRMATION |
+                  FOF_SILENT | FOF_NOERRORUI;
+    retval = SHFileOperation(&shfo);
+    ok(retval == ERROR_CANCELLED ||
+       retval == ERROR_SUCCESS, /* win2k3 */
+       "Expected ERROR_CANCELLED or ERROR_SUCCESS, got %d\n", retval);
+    ok(!DeleteFileA("threedir\\one.txt"), "Expected file to not exist\n");
+    ok(!DeleteFileA("threedir\\two.txt"), "Expected file to not exist\n");
+    ok(DeleteFileA("one.txt"), "Expected file to exist\n");
+    ok(DeleteFileA("two.txt"), "Expected file to exist\n");
+    ok(!RemoveDirectoryA("threedir"), "Expected dir to not exist\n");
 
-        /* file exists in win2k */
-        DeleteFileA("threedir");
+    /* file exists in win2k */
+    DeleteFileA("threedir");
     }
 
 
@@ -1620,9 +1620,9 @@ static void test_copy(void)
     }
     else
     {
-        ok(DeleteFileA("threedir\\two.txt"), "Expected file to exist\n");
-        ok(!DeleteFileA("fourdir"), "Expected file to not exist\n");
-        ok(!RemoveDirectoryA("fourdir"), "Expected dir to not exist\n");
+    ok(DeleteFileA("threedir\\two.txt"), "Expected file to exist\n");
+    ok(!DeleteFileA("fourdir"), "Expected file to not exist\n");
+    ok(!RemoveDirectoryA("fourdir"), "Expected dir to not exist\n");
     }
     ok(RemoveDirectoryA("threedir"), "Expected dir to exist\n");
 
@@ -1682,9 +1682,9 @@ static void test_copy(void)
     }
     else
     {
-        ok(DeleteFileA("threedir\\two.txt"), "Expected file to exist\n");
-        ok(!DeleteFileA("fourdir"), "Expected file to not exist\n");
-        ok(!RemoveDirectoryA("fourdir"), "Expected dit to not exist\n");
+    ok(DeleteFileA("threedir\\two.txt"), "Expected file to exist\n");
+    ok(!DeleteFileA("fourdir"), "Expected file to not exist\n");
+    ok(!RemoveDirectoryA("fourdir"), "Expected dit to not exist\n");
     }
     ok(RemoveDirectoryA("threedir"), "Expected dir to exist\n");
     ok(!DeleteFileA("five"), "Expected file to not exist\n");
@@ -1774,8 +1774,8 @@ static void test_move(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(!file_exists("test6.txt"), "The file is not moved - many files are "
-           "specified as a target\n");
+    ok(!file_exists("test6.txt"), "The file is not moved - many files are "
+       "specified as a target\n");
     }
 
     init_shfo_tests();
@@ -1861,8 +1861,8 @@ static void test_move(void)
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
         ok(!file_exists("test1.txt"), "Expected test1.txt to not exist\n");
-        ok(file_exists("test2.txt"), "Expected test2.txt to exist\n");
-        ok(file_exists("test3.txt"), "Expected test3.txt to exist\n");
+    ok(file_exists("test2.txt"), "Expected test2.txt to exist\n");
+    ok(file_exists("test3.txt"), "Expected test3.txt to exist\n");
     }
 
     /* move a directory into itself */
@@ -1892,8 +1892,8 @@ static void test_move(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(!DeleteFile("d.txt"), "Expected d.txt to not exist\n");
-        ok(!DeleteFile("e.txt"), "Expected e.txt to not exist\n");
+    ok(!DeleteFile("d.txt"), "Expected d.txt to not exist\n");
+    ok(!DeleteFile("e.txt"), "Expected e.txt to not exist\n");
     }
 
     /* number of sources != number of targets */
@@ -1913,7 +1913,7 @@ static void test_move(void)
     else
     {
         expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */);
-        ok(!DeleteFile("d.txt"), "Expected d.txt to not exist\n");
+    ok(!DeleteFile("d.txt"), "Expected d.txt to not exist\n");
     }
 
     /* FO_MOVE does not create dest directories */
@@ -1946,8 +1946,8 @@ static void test_move(void)
     {
         ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval);
         ok(!file_exists("test2.txt"), "Expected test2.txt to not exist\n");
-        ok(file_exists("test3.txt"), "Expected test3.txt to exist\n");
-    }
+    ok(file_exists("test3.txt"), "Expected test3.txt to exist\n");
+}
 }
 
 static void test_sh_create_dir(void)
@@ -1958,7 +1958,7 @@ static void test_sh_create_dir(void)
     if(!pSHCreateDirectoryExA)
     {
         win_skip("skipping SHCreateDirectoryExA tests\n");
-        return;
+       return;
     }
 
     set_curr_dir_path(path, "testdir2\\test4.txt\0");
@@ -1983,7 +1983,7 @@ static void test_sh_path_prepare(void)
     if(!pSHPathPrepareForWriteA)
     {
        win_skip("skipping SHPathPrepareForWriteA tests\n");
-       return;
+           return;
     }
 
     /* directory exists, SHPPFW_NONE */