SHFileOperation regression test

Rolf Kalbermatter rolf.kalbermatter at
Sun Mar 30 03:34:40 CST 2003

While working on SHFileOperation in shell32.dll I came across the error
in line 286 and 287 which happens on Win98/ME/2K/XP but not on 95/NT.

Investigation showed that the copy operation of multiple files with
one source file not existing in the list, has different behaviour on
these two groups of OS Versions.

Win 95/NT abort the copy operation at the first file not existing, and
return WITHOUT any error indication whatsoever, leaving the already
copied files in the target directory. Win 98/ME/2K/XP have obviously
fixed this bug in a rather strict manner, in that such a copy operation
is aborted with error return value 1026 (undocumented, resp. meaningless
in this cicumstance other than that it is non-zero), and no file is
copied at all. (There still exists a small bug, at least in 2K, in that
the  fAnyOperationsAborted flag in the SHFILEOPSTRUCT structure is not
set at all in this case on return.)

Obviously our shlfileop.c test needs fixing but I'm not sure how to
proceed as I'm fairly new to the Wine regression testing. From what
I gathered it is not really acceptable to create Windows version
dependant tests in the regression framework, which leaves only two
other options, IMO:
1) Remove this particular test altogether              or
2) Test only the behaviour which is consistent on all platforms which
in this case would be only the non-existence of the test2.txt file.

Both options leave out possibly important regression test cases for the

Any comments on this issue from the more seasoned guys into regression
test writing?

Appended is the patch which is correct for Win 98/ME/2K/XP but will
cause test failure on 95/NT.

Rolf Kalbermatter

Index: dlls/shell32/tests/shlfileop.c
RCS file: /home/wine/wine/dlls/shell32/tests/shlfileop.c,v
retrieving revision 1.6
diff -u -r1.6 shlfileop.c
--- dlls/shell32/tests/shlfileop.c	14 Jan 2003 23:43:42 -0000	1.6
+++ dlls/shell32/tests/shlfileop.c	30 Mar 2003 08:52:58 -0000
@@ -278,13 +278,15 @@
     ok(file_exists(".\\testdir2\\test2.txt"), "The file is copied");
+    /* Copying multiple files with one not existing as source, fails the
+       entire operation in Win98/ME/2K/XP with return value 1026, but only
+       the files after the one not existing and without any error indication
+       in 95/NT, ! */
     tmp_flags = shfo.fFlags;
     set_curr_dir_path(from, "test1.txt\0test10.txt\0test2.txt\0");
     ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet");
     ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not copied yet");
-    ok(!SHFileOperationA(&shfo), "Files are copied to other directory ");
-    ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied");
+    ok(SHFileOperationA(&shfo), "Files are copied to other directory ");
+    ok(!file_exists(".\\testdir2\\test1.txt"), "The file is copied");
     ok(!file_exists(".\\testdir2\\test2.txt"), "The file is copied");
     shfo.fFlags = tmp_flags;

More information about the wine-devel mailing list