29#include "commoncontrols.h"
37#ifndef FOF_NORECURSION
38#define FOF_NORECURSION 0x1000
42#define DE_SAMEFILE 0x71
43#define DE_MANYSRC1DEST 0x72
44#define DE_DIFFDIR 0x73
45#define DE_OPCANCELLED 0x75
46#define DE_DESTSUBTREE 0x76
47#define DE_INVALIDFILES 0x7C
48#define DE_DESTSAMETREE 0x7D
49#define DE_FLDDESTISFILE 0x7E
50#define DE_FILEDESTISFLD 0x80
51#define expect_retval(ret, ret_prewin32)\
53 broken(retval == ret_prewin32),\
54 "Expected %d, got %d\n", ret, retval)
183 memset(&shfi, 0xcf,
sizeof(shfi));
185 ok(rc == 1,
"SHGetFileInfoA('' | 0) should return 1, got 0x%x\n", rc);
186 todo_wine ok(shfi.
hIcon == 0,
"SHGetFileInfoA('' | 0) did not clear hIcon\n");
191 "SHGetFileInfoA('' | 0) should not clear iIcon\n");
194 "SHGetFileInfoA('' | 0) should not clear dwAttributes\n");
196 memset(&shfiw, 0xcf,
sizeof(shfiw));
197 memset(&unset_icon, 0xcf,
sizeof(unset_icon));
199 ok(!rc,
"SHGetFileInfoW(NULL | 0) should fail\n");
200 ok(shfiw.
hIcon == unset_icon,
"SHGetFileInfoW(NULL | 0) should not clear hIcon\n");
201 ok(shfiw.
szDisplayName[0] == 0xcfcf,
"SHGetFileInfoW(NULL | 0) should not clear szDisplayName[0]\n");
202 ok(shfiw.
szTypeName[0] == 0xcfcf,
"SHGetFileInfoW(NULL | 0) should not clear szTypeName[0]\n");
203 ok(shfiw.
iIcon == 0xcfcfcfcf,
"SHGetFileInfoW(NULL | 0) should not clear iIcon\n");
204 ok(shfiw.
dwAttributes == 0xcfcfcfcf,
"SHGetFileInfoW(NULL | 0) should not clear dwAttributes\n");
209 memset(&shfi, 0xcf,
sizeof(shfi));
213 ok(rc == 1,
"SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) should return 1, got 0x%x\n", rc);
215 ok(shfi.
dwAttributes != 0xcfcfcfcf,
"dwFileAttributes is not set\n");
216 todo_wine ok(shfi.
hIcon == 0,
"SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear hIcon\n");
217 todo_wine ok(shfi.
szDisplayName[0] == 0,
"SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear szDisplayName[0]\n");
218 todo_wine ok(shfi.
szTypeName[0] == 0,
"SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) did not clear szTypeName[0]\n");
221 "SHGetFileInfoA(c:\\nonexistent | SHGFI_ATTRIBUTES) should not clear iIcon\n");
226 todo_wine ok(rc == 1,
"SHGetFileInfoA(c:\\nonexistent | SHGFI_EXETYPE) should return 1, got 0x%x\n", rc);
230 shfi.
iIcon=0xdeadbeef;
234 ok(rc == 1,
"SHGetFileInfoA(c:\\nonexistent) should return 1, got 0x%x\n", rc);
238 ok(shfi.
iIcon != 0xdeadbeef,
"SHGetFileInfoA(c:\\nonexistent) iIcon is not set\n");
247 shfi.
iIcon=0xdeadbeef;
251 ok(rc == 1,
"SHGetFileInfoA(%s, SHGFI_USEFILEATTRIBUTES) should return 1, got 0x%x\n", notepad, rc);
253 shfi2.
iIcon=0xdeadbeef;
255 &shfi2,
sizeof(shfi2),
257 ok(
rc2 == 1,
"SHGetFileInfoA(%s) failed %x\n", notepad,
rc2);
267 shfi.
iIcon=0xdeadbeef;
271 ok(rc == 1,
"SHGetFileInfoA(test4.txt/, SHGFI_USEFILEATTRIBUTES) should return 1, got 0x%x\n", rc);
273 shfi2.
iIcon=0xdeadbeef;
275 &shfi2,
sizeof(shfi2),
277 ok(
rc2 == 1,
"SHGetFileInfoA(test4.txt/) should return 1, got 0x%x\n",
rc2);
287 shfi.
iIcon=0xdeadbeef;
291 ok(rc == 1,
"SHGetFileInfoA(c:\\) should return 1, got 0x%x\n", rc);
294 ok(shfi.
hIcon != (
HICON) 0xdeadbeef,
"hIcon was expected to change\n");
295 ok(shfi.
iIcon != 0xdeadbeef,
"iIcon was expected to change\n");
302 SIZE list_size, metrics_size;
309 &IID_IImageList, (
void **)&
list );
310 IImageList_GetIconSize(
list, &list_size.
cx, &list_size.
cy );
311 IImageList_Release(
list );
319 ok( bm.bmWidth == list_size.
cx,
"got %d expected %d\n", bm.bmWidth, list_size.
cx );
320 ok( bm.bmHeight == list_size.
cy,
"got %d expected %d\n", bm.bmHeight, list_size.
cy );
324 ok( bm.bmWidth == metrics_size.
cx,
"got %d expected %d\n", bm.bmWidth, metrics_size.
cx );
325 ok( bm.bmHeight == metrics_size.
cy,
"got %d expected %d\n", bm.bmHeight, metrics_size.
cy );
340 ULONG start_refs, refs;
344 skip(
"can't get desktop pidl\n");
351 start_refs = IImageList_AddRef( small_list );
352 IImageList_Release( small_list );
354 memset(&shInfoa, 0xcf,
sizeof(shInfoa));
356 &shInfoa,
sizeof(shInfoa),
358 ok(hSysImageList == (
HIMAGELIST)small_list,
"got %p expect %p\n", hSysImageList, small_list);
359 refs = IImageList_AddRef( small_list );
360 IImageList_Release( small_list );
361 ok( refs == start_refs + 1 ||
362 broken( refs == start_refs ),
363 "got %d, start_refs %d\n", refs, start_refs );
364 todo_wine ok(shInfoa.
hIcon == 0,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n");
365 todo_wine ok(shInfoa.
szTypeName[0] == 0,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n");
366 ok(shInfoa.
iIcon != 0xcfcfcfcf,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n");
370 "SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL), unexpected dwAttributes\n");
373 memset(&shInfow, 0xcf,
sizeof(shInfow));
376 ok(hSysImageList == (
HIMAGELIST)small_list,
"got %p expect %p\n", hSysImageList, small_list);
377 todo_wine ok(shInfow.
hIcon == 0,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon\n");
378 ok(shInfow.
szTypeName[0] == 0,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]\n");
379 ok(shInfow.
iIcon != 0xcfcfcfcf,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon\n");
382 "SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) unexpected dwAttributes\n");
385 memset(&shInfow, 0xcf,
sizeof(shInfow));
388 ok(hSysImageList == (
HIMAGELIST)small_list,
"got %p expect %p\n", hSysImageList, small_list);
389 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
392 "unexpected dwAttributes\n");
394 memset(&shInfow, 0xcf,
sizeof(shInfow));
397 ok(
hr != 0,
" SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
398 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
403 memset(&shInfow, 0xcf,
sizeof(shInfow));
406 ok(
hr != 0,
"SHGFI_ICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_LARGEICON Failed\n");
407 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
412 memset(&shInfow, 0xcf,
sizeof(shInfow));
415 ok(hSysImageList == (
HIMAGELIST)large_list,
"got %p expect %p\n", hSysImageList, small_list);
416 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
419 "unexpected dwAttributes\n");
421 memset(&shInfow, 0xcf,
sizeof(shInfow));
424 ok(
hr != 0,
"SHGFI_OPENICON|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
428 memset(&shInfow, 0xcf,
sizeof(shInfow));
431 ok(
hr != 0,
"SHGFI_SHELLICONSIZE|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
435 memset(&shInfow, 0xcf,
sizeof(shInfow));
438 ok(
hr != 0,
"SHGFI_SHELLICONSIZE|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON Failed\n");
442 memset(&shInfow, 0xcf,
sizeof(shInfow));
446 ok(hSysImageList == (
HIMAGELIST)small_list,
"got %p expect %p\n", hSysImageList, small_list);
447 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
450 memset(&shInfow, 0xcf,
sizeof(shInfow));
454 todo_wine ok(hSysImageList == (
HIMAGELIST)small_list,
"got %p expect %p\n", hSysImageList, small_list);
455 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
458 "unexpected dwAttributes\n");
460 memset(&shInfow, 0xcf,
sizeof(shInfow));
463 todo_wine ok(
hr != 0,
"SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_EXETYPE Failed\n");
467 memset(&shInfow, 0xcf,
sizeof(shInfow));
470 ok(
hr != 0,
"SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_SMALLICON|SHGFI_ATTRIBUTES Failed\n");
474 memset(&shInfow, 0xcf,
sizeof(shInfow));
478 ok(hSysImageList == (
HIMAGELIST)large_list,
"got %p expect %p\n", hSysImageList, large_list);
479 ok(
hr != 0,
"SHGFI_SYSICONINDEX|SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_ATTRIBUTES Failed\n");
480 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
483 memset(&shInfow, 0xcf,
sizeof(shInfow));
486 todo_wine ok(hSysImageList == (
HIMAGELIST)large_list,
"got %p expect %p\n", hSysImageList, large_list);
487 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
490 "unexpected dwAttributes\n");
492 memset(&shInfow, 0xcf,
sizeof(shInfow));
495 todo_wine ok(
hr != 0,
"SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_EXETYPE Failed\n");
499 memset(&shInfow, 0xcf,
sizeof(shInfow));
502 ok(
hr != 0,
"SHGFI_USEFILEATTRIBUTES|SHGFI_PIDL|SHGFI_ATTRIBUTES Failed\n");
506 memset(&shInfow, 0xcf,
sizeof(shInfow));
509 ok(hSysImageList == (
HIMAGELIST)small_list,
"got %p expect %p\n", hSysImageList, small_list);
510 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
514 memset(&shInfow, 0xcf,
sizeof(shInfow));
517 ok(hSysImageList == (
HIMAGELIST)large_list,
"got %p expect %p\n", hSysImageList, small_list);
518 ok(shInfow.
iIcon!=0xcfcfcfcf,
"Icon Index Missing\n");
523 IImageList_Release( small_list );
524 IImageList_Release( large_list );
544 files +=
strlen(files) + 1;
569 ok(
dir_exists(
"test4.txt"),
"Directory should not have been removed\n");
570 ok(!
file_exists(
"test1.txt"),
"File should have been removed\n");
571 ok(!
file_exists(
"test2.txt"),
"File should have been removed\n");
572 ok(!
file_exists(
"test3.txt"),
"File should have been removed\n");
576 ok(
dir_exists(
"test4.txt"),
"Directory should not have been removed\n");
581 ok(!
dir_exists(
"test4.txt"),
"Directory should have been removed\n");
584 ok(!
ret,
"The requested file does not exist, ret=%d\n",
ret);
589 ok(
MoveFileA(
"test1.txt",
"test4.txt\\test1.txt"),
"Filling the subdirectory failed\n");
591 ok(!
dir_exists(
"test4.txt"),
"Directory is not removed\n");
594 shfo.
pFrom =
"test1.txt\0test4.txt\0";
596 ok(!
file_exists(
"test1.txt"),
"The file should have been removed\n");
597 ok(!
dir_exists(
"test4.txt"),
"Directory should have been removed\n");
598 ok(
file_exists(
"test2.txt"),
"This file should not have been removed\n");
603 shfo.
pFrom =
"*.txt\0";
605 ok(!
file_exists(
"test1.txt"),
"test1.txt should have been removed\n");
606 ok(!
file_exists(
"test_5.txt"),
"test_5.txt should have been removed\n");
607 ok(
dir_exists(
"test4.txt"),
"test4.txt should not have been removed\n");
611 shfo.
pFrom =
"test_?.txt\0test4.txt\0";
615 "test4.txt should have been removed\n");
616 ok(!
file_exists(
"test_5.txt"),
"test_5.txt should have been removed\n");
617 ok(
file_exists(
"test1.txt"),
"test1.txt should not have been removed\n");
624 shfo.
fFlags &= ~FOF_FILESONLY;
629 ok(
file_exists(
"test1.txt"),
"Expected test1.txt to exist\n");
634 shfo.
pFrom =
"test1.txt\0";
639 "Expected ERROR_INVALID_PARAMETER, got %d\n",
ret);
640 ok(
file_exists(
"test1.txt"),
"Expected test1.txt to exist\n");
650 ok(
file_exists(
"test1.txt"),
"Expected test1.txt to exist\n");
654 shfo.
pFrom =
"nonexistent.txt\0";
660 "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n",
ret);
669 shfo.
pFrom =
"testdir2\0testdir2\\one.txt\0";
673 "Expected ERROR_PATH_NOT_FOUND, got %d\n",
ret);
674 ok(!
dir_exists(
"testdir2"),
"Expected testdir2 to not exist\n");
675 ok(!
file_exists(
"testdir2\\one.txt"),
"Expected testdir2\\one.txt to not exist\n");
678 skip(
"Test would show a dialog box\n");
682 shfo.
pFrom =
"test1.txt\0nonexistent.txt\0test2.txt\0";
688 "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n",
ret);
690 ok(
file_exists(
"test1.txt"),
"Expected test1.txt to exist\n");
691 ok(
file_exists(
"test2.txt"),
"Expected test2.txt to exist\n");
695 shfo.
pFrom =
"testdir2\\nonexistent.txt\0";
700 "Expected 0x402 or ERROR_FILE_NOT_FOUND, got %x\n",
ret);
701 shfo.
pFrom =
"nonexistent\\one.txt\0";
705 "Expected 0x402 or DE_INVALIDFILES, got %x\n",
ret);
709 shfo.
pFrom =
"testdir2\0";
713 ok(!
file_exists(
"testdir2\\one.txt"),
"Expected testdir2\\one.txt to not exist\n");
714 ok(!
dir_exists(
"testdir2\\nested"),
"Expected testdir2\\nested to not exist\n");
739 "Expected ERROR_ALREADY_EXISTS or DE_FILEDESTISFLD, got %d\n", retval);
748 ok(!
file_exists(
"test4.txt\\test1.txt"),
"The file is renamed\n");
752 ok(retval ==
ERROR_SUCCESS,
"File is renamed moving to other directory\n");
753 ok(
file_exists(
"test4.txt\\test1.txt"),
"The file is not renamed\n");
762 "Expected ERROR_GEN_FAILURE or DE_MANYSRC1DEST , got %d\n", retval);
763 ok(
file_exists(
"test1.txt"),
"The file is renamed - many files are specified\n");
774 "Expected ERROR_GEN_FAILURE or DE_MANYSRC1DEST files, got %d\n", retval);
775 ok(
file_exists(
"test1.txt"),
"The file is not renamed - many files are specified\n");
780 ok(retval ==
ERROR_SUCCESS,
"Rename file failed, retval = %d\n", retval);
787 ok(retval ==
ERROR_SUCCESS,
"Rename file back failed, retval = %d\n", retval);
792 ok(retval ==
ERROR_SUCCESS,
"Rename dir failed, retval = %d\n", retval);
793 ok(!
dir_exists(
"test4.txt"),
"The dir is not renamed\n");
794 ok(
dir_exists(
"test6.txt"),
"The dir is not renamed\n");
799 ok(retval ==
ERROR_SUCCESS,
"Rename dir back failed, retval = %d\n", retval);
800 ok(
dir_exists(
"test4.txt"),
"The dir is not renamed\n");
803 shfo.
pFrom =
"test1.txt\0test2.txt\0";
804 shfo.
pTo =
"a.txt\0";
809 "Expected ERROR_GEN_FAILURE or DE_MANYSRC1DEST, got %d\n", retval);
810 ok(
file_exists(
"test1.txt"),
"Expected test1.txt to exist\n");
811 ok(
file_exists(
"test2.txt"),
"Expected test2.txt to exist\n");
815 shfo.
pFrom =
"idontexist\0";
816 shfo.
pTo =
"newfile\0";
821 "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", retval);
822 ok(!
file_exists(
"newfile"),
"Expected newfile to not exist\n");
825 shfo.
pFrom =
"test1.txt\0";
826 shfo.
pTo =
"test2.txt\0";
840 "Expected ERROR_ALREADY_EXISTS, got %d\n", retval);
844 shfo.
pFrom =
"test1.txt\0";
852 "Expected ERROR_CANCELLED or DE_DIFFDIR, got %u\n", retval);
853 ok(
file_exists(
"test1.txt"),
"Expected test1.txt to exist\n");
861 "Expected ERROR_ACCESS_DENIED or DE_MANYSRC1DEST, got %d\n", retval);
886 win_skip(
"Too many differences for old shell32\n");
904 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
905 ok(
DeleteFileA(
"test6.txt\\test1.txt"),
"The file is not copied - many files "
906 "are specified as a target\n");
914 ok(!
file_exists(
"test6.txt"),
"The file is copied - many files are "
915 "specified as a target\n");
924 ok(
file_exists(
"test6.txt"),
"The file is not copied - many files are "
925 "specified as a target\n");
938 ok(
DeleteFileA(
"test6.txt\\test1.txt"),
"The file is not copied - many files "
939 "are specified as a target\n");
941 ok(
DeleteFileA(
"test7.txt\\test2.txt"),
"The file is not copied - many files "
942 "are specified as a target\n");
948 ok(!
file_exists(
"test6.txt"),
"The file is copied - many files are "
949 "specified as a target\n");
954 ok(!
SHFileOperationA(&shfo),
"Prepare test to check how directories are copied recursively\n");
955 ok(
file_exists(
"test4.txt\\test1.txt"),
"The file is copied\n");
959 ok(!
file_exists(
"testdir2\\test1.txt"),
"The file is not copied yet\n");
960 ok(!
file_exists(
"testdir2\\test4.txt"),
"The directory is not copied yet\n");
962 ok(
file_exists(
"testdir2\\test1.txt"),
"The file is copied\n");
963 ok(
file_exists(
"testdir2\\test4.txt"),
"The directory is copied\n");
964 ok(
file_exists(
"testdir2\\test4.txt\\test1.txt"),
"The file in subdirectory is copied\n");
969 ok(!
file_exists(
"testdir2\\test1.txt"),
"The file is not copied yet\n");
970 ok(!
file_exists(
"testdir2\\test4.txt"),
"The directory is not copied yet\n");
972 ok(
file_exists(
"testdir2\\test1.txt"),
"The file is copied\n");
973 ok(!
file_exists(
"testdir2\\test4.txt"),
"The directory is copied\n");
978 ok(!
file_exists(
"testdir2\\test1.txt"),
"The file is not copied yet\n");
979 ok(!
file_exists(
"testdir2\\test2.txt"),
"The file is not copied yet\n");
981 ok(
file_exists(
"testdir2\\test1.txt"),
"The file is copied\n");
982 ok(
file_exists(
"testdir2\\test2.txt"),
"The file is copied\n");
990 ok(!
file_exists(
"testdir2\\test1.txt"),
"The file is not copied yet\n");
991 ok(!
file_exists(
"testdir2\\test2.txt"),
"The file is not copied yet\n");
995 ok(
file_exists(
"testdir2\\test1.txt"),
"The file is not copied\n");
1001 "Files are copied to other directory\n");
1002 ok(!
file_exists(
"testdir2\\test1.txt"),
"The file is copied\n");
1004 ok(!
file_exists(
"testdir2\\test2.txt"),
"The file is copied\n");
1013 ok(!retval,
"Error copying into nonexistent directory\n");
1014 ok(
file_exists(
"nonexistent"),
"nonexistent not created\n");
1015 ok(
file_exists(
"nonexistent\\notreal"),
"nonexistent\\notreal not created\n");
1016 ok(
file_exists(
"nonexistent\\notreal\\test2.txt"),
"Directory not created\n");
1017 ok(!
file_exists(
"nonexistent\\notreal\\test1.txt"),
"test1.txt should not exist\n");
1022 shfo.
pFrom =
"test1.txt\0test2.txt\0test3.txt\0";
1023 shfo.
pTo =
"testdir2\0";
1025 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1026 ok(
file_exists(
"testdir2\\test1.txt"),
"Expected testdir2\\test1 to exist\n");
1032 shfo.
pFrom =
"test1.txt\0";
1033 shfo.
pTo =
"test2.txt\0";
1061 "Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
1073 ok(!
file_exists(
"test3.txt\\test2.txt"),
"Expected test3.txt\\test2.txt to not exist\n");
1077 shfo.
fFlags &= ~FOF_NOERRORUI;
1082 "Didn't expect aborted operations\n");
1083 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1084 ok(
DeleteFileA(
"test3.txt\\test1.txt"),
"Expected test3.txt\\test1.txt to exist\n");
1085 ok(
DeleteFileA(
"test3.txt\\test2.txt"),
"Expected test3.txt\\test1.txt to exist\n");
1090 shfo.
pFrom =
"test1.txt\0test2.txt\0test3.txt\0";
1091 shfo.
pTo =
"testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0testdir2\\d.txt\0";
1097 "Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
1101 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1103 ok(
DeleteFileA(
"testdir2\\a.txt\\test1.txt"),
"Expected testdir2\\a.txt\\test1.txt to exist\n");
1105 ok(
DeleteFileA(
"testdir2\\b.txt\\test2.txt"),
"Expected testdir2\\b.txt\\test2.txt to exist\n");
1107 ok(
DeleteFileA(
"testdir2\\c.txt\\test3.txt"),
"Expected testdir2\\c.txt\\test3.txt to exist\n");
1109 ok(!
file_exists(
"testdir2\\d.txt"),
"Expected testdir2\\d.txt to not exist\n");
1116 "Expected aborted operations\n");
1117 ok(!
file_exists(
"testdir2\\a.txt"),
"Expected testdir2\\a.txt to not exist\n");
1121 shfo.
pFrom =
"test1.txt\0test2.txt\0test3.txt\0";
1122 shfo.
pTo =
"e.txt\0f.txt\0";
1127 "Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
1132 ok(retval ==
DE_SAMEFILE,
"Expected DE_SAMEFILE, got %d\n", retval);
1133 ok(
DeleteFileA(
"e.txt\\test1.txt"),
"Expected e.txt\\test1.txt to exist\n");
1135 ok(
DeleteFileA(
"f.txt\\test2.txt"),
"Expected f.txt\\test2.txt to exist\n");
1143 "Expected aborted operations\n");
1148 shfo.
pFrom =
"test1.txt\0test2.txt\0test4.txt\0";
1149 shfo.
pTo =
"testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0";
1154 "Didn't expect aborted operations\n");
1156 broken(retval == 0x100a1),
1157 "Expected ERROR_SUCCESS, got %d\n", retval);
1158 ok(
DeleteFileA(
"testdir2\\a.txt"),
"Expected testdir2\\a.txt to exist\n");
1159 ok(
DeleteFileA(
"testdir2\\b.txt"),
"Expected testdir2\\b.txt to exist\n");
1164 shfo.
pFrom =
"test1.txt\0test2.txt\0test3.txt\0";
1165 shfo.
pTo =
"a.txt\0b.txt\0c.txt\0";
1167 shfo.
fFlags &= ~FOF_MULTIDESTFILES;
1171 "Expected TRUE/FALSE fAnyOperationsAborted not 0xdeadbeef\n");
1175 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1177 ok(
DeleteFileA(
"a.txt\\test1.txt"),
"Expected a.txt\\test1.txt to exist\n");
1178 ok(
DeleteFileA(
"a.txt\\test2.txt"),
"Expected a.txt\\test2.txt to exist\n");
1179 ok(
DeleteFileA(
"a.txt\\test3.txt"),
"Expected a.txt\\test3.txt to exist\n");
1188 "Expected aborted operations\n");
1193 shfo.
pFrom =
"test?.txt\0";
1194 shfo.
pTo =
"testdir2\0";
1195 shfo.
fFlags &= ~FOF_MULTIDESTFILES;
1198 broken(retval == 0x100a1),
1199 "Expected ERROR_SUCCESS, got %d\n", retval);
1200 ok(
file_exists(
"testdir2\\test1.txt"),
"Expected testdir2\\test1.txt to exist\n");
1205 shfo.
pFrom =
"test?.txt\0";
1208 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1209 ok(
file_exists(
"testdir2\\test1.txt"),
"Expected testdir2\\test1.txt to exist\n");
1210 ok(!
dir_exists(
"testdir2\\test4.txt"),
"Expected testdir2\\test4.txt to not exist\n");
1217 shfo.
pTo =
"testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0testdir2\\d.txt\0";
1218 shfo.
fFlags &= ~FOF_FILESONLY;
1224 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1225 ok(
DeleteFileA(
"testdir2\\a.txt\\test1.txt"),
"Expected testdir2\\a.txt\\test1.txt to exist\n");
1226 ok(
DeleteFileA(
"testdir2\\a.txt\\test2.txt"),
"Expected testdir2\\a.txt\\test2.txt to exist\n");
1227 ok(
DeleteFileA(
"testdir2\\a.txt\\test3.txt"),
"Expected testdir2\\a.txt\\test3.txt to exist\n");
1228 ok(
RemoveDirectoryA(
"testdir2\\a.txt\\test4.txt"),
"Expected testdir2\\a.txt\\test4.txt to exist\n");
1236 "Expected aborted operations\n");
1237 ok(!
file_exists(
"testdir2\\a.txt"),
"Expected testdir2\\test1.txt to not exist\n");
1244 shfo.
pFrom =
"test1.txt\0";
1245 shfo.
pTo =
"b.txt\0c.txt\0";
1250 "Didn't expect aborted operations\n");
1256 win_skip(
"Skipping some tests on NT4\n");
1261 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1267 shfo.
pFrom =
"test1.txt\0test2.txt\0";
1268 shfo.
pTo =
"b.txt\0c.txt\0d.txt\0";
1274 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1276 ok(
DeleteFileA(
"b.txt\\test1.txt"),
"Expected b.txt\\test1.txt to exist\n");
1278 ok(
DeleteFileA(
"c.txt\\test2.txt"),
"Expected c.txt\\test2.txt to exist\n");
1286 "Expected aborted operations\n");
1291 shfo.
pFrom =
"test1.txt\0test4.txt\0";
1292 shfo.
pTo =
"b.txt\0c.txt\0d.txt\0";
1298 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1300 ok(
DeleteFileA(
"b.txt\\test1.txt"),
"Expected b.txt\\test1.txt to exist\n");
1310 "Expected aborted operations\n");
1317 shfo.
pFrom =
"test4.txt\0test1.txt\0";
1318 shfo.
pTo =
"testdir2\0";
1319 shfo.
fFlags &= ~FOF_MULTIDESTFILES;
1323 broken(retval == 0x100a1),
1324 "Expected ERROR_SUCCESS, got %d\n", retval);
1327 ok(
DeleteFileA(
"testdir2\\test1.txt"),
"Expected testdir2\\test1.txt to exist\n");
1328 ok(
DeleteFileA(
"testdir2\\test4.txt\\a.txt"),
"Expected a.txt to exist\n");
1329 ok(
RemoveDirectoryA(
"testdir2\\test4.txt"),
"Expected testdir2\\test4.txt to exist\n");
1333 shfo.
pFrom =
"test4.txt\0test4.txt\\a.txt\0";
1334 shfo.
pTo =
"testdir2\0";
1337 broken(retval == 0x100a1),
1338 "Expected ERROR_SUCCESS, got %d\n", retval);
1341 ok(
DeleteFileA(
"testdir2\\test4.txt\\a.txt"),
"Expected a.txt to exist\n");
1342 ok(
DeleteFileA(
"testdir2\\a.txt"),
"Expected testdir2\\a.txt to exist\n");
1346 shfo.
pFrom =
"test4.txt\\a.txt\0test4.txt\0";
1347 shfo.
pTo =
"nonexistent\0";
1352 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1353 ok(
DeleteFileA(
"nonexistent\\test4.txt\\a.txt"),
"Expected nonexistent\\test4.txt\\a.txt to exist\n");
1355 ok(
DeleteFileA(
"nonexistent\\a.txt"),
"Expected nonexistent\\a.txt to exist\n");
1363 "Expected aborted operations\n");
1364 ok(!
file_exists(
"nonexistent\\test4.txt"),
"Expected nonexistent\\test4.txt to not exist\n");
1369 shfo.
pFrom =
"test1.txt\0test2.txt\0test3.txt\0";
1370 shfo.
pTo =
"b.txt\0test2.txt\0c.txt\0";
1381 ok(retval ==
DE_SAMEFILE,
"Expected DE_SAMEFILE, got %d\n", retval);
1388 shfo.
pFrom =
"test1.txt\0test4.txt\0test3.txt\0";
1389 shfo.
pTo =
"b.txt\0test4.txt\0c.txt\0";
1401 "Expected ERROR_SUCCESS or DE_DESTSAMETREE, got %d\n", retval);
1407 shfo.
pFrom =
"test4.txt\0";
1408 shfo.
pTo =
"test4.txt\\newdir\0";
1409 shfo.
fFlags &= ~FOF_MULTIDESTFILES;
1414 "Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
1415 ok(!
RemoveDirectoryA(
"test4.txt\\newdir"),
"Expected test4.txt\\newdir to not exist\n");
1418 shfo.
pFrom =
"test4.txt\0";
1419 shfo.
pTo =
"test4.txt\0";
1424 "Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
1427 shfo.
pFrom =
"test1.txt\0test4.txt\0";
1428 shfo.
pTo =
"test4.txt\0";
1434 "Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
1435 ok(
DeleteFileA(
"test4.txt\\test1.txt"),
"Expected test4.txt\\test1.txt to exist\n");
1438 shfo.
pFrom =
"test1.txt\0test4.txt\0";
1439 shfo.
pTo =
"test4.txt\\a.txt\0";
1446 ok(
DeleteFileA(
"test4.txt\\a.txt\\test1.txt"),
"Expected test4.txt\\a.txt\\test1.txt to exist\n");
1452 ok(!
file_exists(
"test4.txt\\a.txt"),
"Expected test4.txt\\a.txt to not exist\n");
1456 shfo.
pFrom =
"e.txt\0";
1457 shfo.
pTo =
"nonexistent\0";
1460 ok(retval == 1026 ||
1463 "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", retval);
1464 ok(!
file_exists(
"nonexistent\\e.txt"),
"Expected nonexistent\\e.txt to not exist\n");
1465 ok(!
file_exists(
"nonexistent"),
"Expected nonexistent to not exist\n");
1476 shfo.
pFrom =
"test1.txt\0";
1477 shfo.
pTo =
"test2.txt\0";
1481 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1485 shfo.
pFrom =
"test3.txt\0test1.txt\0";
1486 shfo.
pTo =
"test2.txt\0one.txt\0";
1490 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1493 shfo.
pFrom =
"one.txt\0";
1494 shfo.
pTo =
"testdir2\0";
1498 ok(retval == 0,
"Expected 0, got %d\n", retval);
1499 ok(
file_has_content(
"testdir2\\one.txt",
"test1.txt\n"),
"The file was not copied\n");
1503 shfo.
pFrom =
"test4.txt\0";
1504 shfo.
pTo =
"testdir2\0";
1509 broken(retval == 0x100a1),
1510 "Expected ERROR_SUCCESS, got %d\n", retval);
1517 ok(retval == 0,
"Expected 0, got %d\n", retval);
1518 ok(
file_has_content(
"testdir2\\test4.txt\\test1.txt",
"test4.txt\\.\\test1.txt\n"),
"The file was not copied\n");
1528 shfo.
pTo =
"two.txt\0";
1531 ok(retval == 1148 || retval == 1026 ||
1534 "Unexpected return value, got %d\n", retval);
1540 ok(!
DeleteFileA(
"two.txt"),
"Expected file to not exist\n");
1548 shfo.
pFrom =
"one.txt\0";
1555 ok(!
file_exists(
"two.txt"),
"Expected two.txt to not exist\n");
1559 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1567 shfo.
pFrom =
"one.txt\0";
1568 shfo.
pTo =
"two.txt\0three.txt\0";
1574 ok(!
file_exists(
"two.txt"),
"Expected two.txt to not exist\n");
1578 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1596 ok(retval == 1148 || retval == 1026 ||
1599 "Unexpected return value, got %d\n", retval);
1605 ok(!
DeleteFileA(
"two.txt"),
"Expected file to not exist\n");
1613 shfo.
pFrom =
"one.txt\0";
1621 ok(!
file_exists(
"two.txt"),
"Expected two.txt to not exist\n");
1625 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1640 shfo.
pFrom =
"one.txt\0two.txt\0";
1647 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1648 ok(
DeleteFileA(
"threedir\\one.txt"),
"Expected file to exist\n");
1649 ok(
DeleteFileA(
"threedir\\two.txt"),
"Expected file to exist\n");
1655 ok(!
DeleteFileA(
"threedir\\one.txt"),
"Expected file to not exist\n");
1656 ok(!
DeleteFileA(
"threedir\\two.txt"),
"Expected file to not exist\n");
1657 ok(!
DeleteFileA(
"threedir"),
"Expected file to not exist\n");
1674 shfo.
pFrom =
"one.txt\0two.txt\0";
1678 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1679 ok(
DeleteFileA(
"threedir\\one.txt"),
"Expected file to exist\n");
1680 ok(
DeleteFileA(
"threedir\\two.txt"),
"Expected file to exist\n");
1698 shfo.
pFrom =
"one.txt\0two.txt\0";
1705 "Expected ERROR_CANCELLED or ERROR_SUCCESS, got %d\n", retval);
1706 ok(!
DeleteFileA(
"threedir\\one.txt"),
"Expected file to not exist\n");
1707 ok(!
DeleteFileA(
"threedir\\two.txt"),
"Expected file to not exist\n");
1730 shfo.
pFrom =
"one.txt\0two.txt\0";
1735 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1738 ok(
DeleteFileA(
"threedir\\one.txt"),
"Expected file to exist\n");
1742 ok(!
DeleteFileA(
"threedir\\two.txt"),
"Expected file to not exist\n");
1743 ok(
DeleteFileA(
"fourdir\\two.txt"),
"Expected file to exist\n");
1748 ok(
DeleteFileA(
"threedir\\two.txt"),
"Expected file to exist\n");
1749 ok(!
DeleteFileA(
"fourdir"),
"Expected file to not exist\n");
1762 shfo.
pFrom =
"one.txt\0two.txt\0";
1763 shfo.
pTo =
"threedir\0fourdir\0";
1770 "Expected ERROR_CANCELLED or DE_FILEDESTISFLD. got %d\n", retval);
1774 ok(
DeleteFileA(
"threedir\\threedir"),
"Expected file to exist\n");
1776 ok(!
DeleteFileA(
"threedir\\one.txt"),
"Expected file to not exist\n");
1777 ok(!
DeleteFileA(
"threedir\\two.txt"),
"Expected file to not exist\n");
1781 ok(!
DeleteFileA(
"fourdir"),
"Expected file to not exist\n");
1792 shfo.
pFrom =
"one.txt\0two.txt\0";
1793 shfo.
pTo =
"threedir\0fourdir\0five\0";
1797 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1800 ok(
DeleteFileA(
"threedir\\one.txt"),
"Expected file to exist\n");
1804 ok(!
DeleteFileA(
"threedir\\two.txt"),
"Expected file to not exist\n");
1805 ok(
DeleteFileA(
"fourdir\\two.txt"),
"Expected file to exist\n");
1810 ok(
DeleteFileA(
"threedir\\two.txt"),
"Expected file to exist\n");
1811 ok(!
DeleteFileA(
"fourdir"),
"Expected file to not exist\n");
1824 shfo.
pFrom =
"a*.txt\0";
1825 shfo.
pTo =
"one\0two\0";
1828 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1831 ok(!
DeleteFileA(
"two\\aa.txt"),
"Expected file to not exist\n");
1832 ok(!
DeleteFileA(
"two\\ab.txt"),
"Expected file to not exist\n");
1841 shfo.
pFrom =
"dir\\abcdefgh.abc\0";
1847 "Expected ERROR_SUCCESS, got %d\n", retval);
1849 ok(
DeleteFileA(
"abcdefgh.abc"),
"Expected file to exist\n");
1850 ok(
DeleteFileA(
"dir\\abcdefgh.abc"),
"Expected file to exist\n");
1856 shfo.
pFrom =
"test1.txt\0";
1857 shfo.
pTo =
"testdir2\0";
1868 shfo.
pFrom =
"nonexistent\0";
1869 shfo.
pTo =
"testdir2\0";
1881 shfo.
pFrom =
"dir/subdir/aa.txt\0";
1882 shfo.
pTo =
"dir\\destdir/aa.txt\0";
1887 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
1888 ok(
DeleteFileA(
"dir\\destdir\\aa.txt"),
"Expected file to exist\n");
1895 ok(
DeleteFileA(
"dir\\subdir\\aa.txt"),
"Expected file to exist\n");
1923 ok(retval != 0,
"SHFileOperation should fail\n");
1927 ok(
file_exists(
"testdir2\\one.txt"),
"file should not be moved\n");
1928 ok(
file_exists(
"testdir2\\nested"),
"dir should not be moved\n");
1929 ok(
file_exists(
"testdir2\\nested\\two.txt"),
"file should not be moved\n");
1934 ok(!retval,
"SHFileOperation error %#x\n", retval);
1938 ok(!
file_exists(
"testdir2\\one.txt"),
"file should be moved\n");
1939 ok(!
file_exists(
"testdir2\\nested"),
"dir should be moved\n");
1940 ok(!
file_exists(
"testdir2\\nested\\two.txt"),
"file should be moved\n");
1943 ok(
file_exists(
"test4.txt\\one.txt"),
"file should exist\n");
1945 ok(
file_exists(
"test4.txt\\nested\\two.txt"),
"file should exist\n");
1956 "Expected ERROR_SUCCESS, got %d\n", retval);
1961 ok(
dir_exists(
"testdir2"),
"dir should not be moved\n");
1962 ok(!
file_exists(
"testdir2\\one.txt"),
"file should be moved\n");
1963 ok(!
dir_exists(
"testdir2\\nested"),
"dir should be moved\n");
1964 ok(!
file_exists(
"testdir2\\nested\\two.txt"),
"file should be moved\n");
1966 ok(
file_exists(
"test4.txt\\one.txt"),
"file should exist\n");
1967 ok(
dir_exists(
"test4.txt\\nested"),
"dir should exist\n");
1968 ok(
file_exists(
"test4.txt\\nested\\two.txt"),
"file should exist\n");
1984 ok(!
SHFileOperationA(&shfo),
"Prepare test to check how directories are moved recursively\n");
1985 ok(!
file_exists(
"test1.txt"),
"test1.txt should not exist\n");
1986 ok(
file_exists(
"test4.txt\\test1.txt"),
"The file is not moved\n");
1990 ok(!
file_exists(
"testdir2\\test2.txt"),
"The file is not moved yet\n");
1991 ok(!
file_exists(
"testdir2\\test4.txt"),
"The directory is not moved yet\n");
1993 ok(
file_exists(
"testdir2\\test2.txt"),
"The file is moved\n");
1994 ok(
file_exists(
"testdir2\\test4.txt"),
"The directory is moved\n");
1995 ok(
file_exists(
"testdir2\\test4.txt\\test1.txt"),
"The file in subdirectory is moved\n");
2008 ok(
DeleteFileA(
"test6.txt"),
"The file is not moved - many files are "
2009 "specified as a target\n");
2034 ok(
DeleteFileA(
"test6.txt\\test1.txt"),
"The file is not moved\n");
2036 ok(
DeleteFileA(
"test7.txt\\test2.txt"),
"The file is not moved\n");
2043 ok(!
file_exists(
"test6.txt"),
"The file is not moved - many files are "
2044 "specified as a target\n");
2067 ok(retval ==
DE_SAMEFILE,
"Expected DE_SAMEFILE, got %d\n", retval);
2068 ok(
DeleteFileA(
"test6.txt\\test1.txt"),
"The file is not moved\n");
2070 ok(
DeleteFileA(
"test7.txt\\test2.txt"),
"The file is not moved\n");
2078 ok(!
file_exists(
"test6.txt"),
"The file is not moved - many files are "
2079 "specified as a target\n");
2091 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2092 ok(
DeleteFileA(
"test6.txt\\test1.txt"),
"The file is not moved\n");
2093 ok(
DeleteFileA(
"test7.txt\\test2.txt"),
"The file is not moved\n");
2095 "Directory should not be created\n");
2102 ok(!
file_exists(
"test6.txt"),
"The file is not moved - many files are "
2103 "specified as a target\n");
2114 ok(retval ==
DE_SAMEFILE,
"Expected DE_SAMEFILE, got %d\n", retval);
2115 ok(
DeleteFileA(
"test4.txt\\test1.txt"),
"The file is not moved\n");
2116 ok(
DeleteFileA(
"test5.txt\\test2.txt"),
"The file is not moved\n");
2123 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2124 ok(
DeleteFileA(
"test4.txt\\test1.txt"),
"The file is not moved\n");
2125 ok(
DeleteFileA(
"test4.txt\\test2.txt"),
"The file is not moved\n");
2126 ok(
DeleteFileA(
"test4.txt\\test3.txt"),
"The file is not moved\n");
2136 ,
"Expected ERROR_SUCCESS || ERROR_ACCESS_DENIED, got %d\n", retval);
2137 ok(!
file_exists(
"test6.txt"),
"The file should not exist\n");
2146 ,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", retval);
2147 ok(!
file_exists(
"test6.txt"),
"The file should not exist\n");
2154 ok(
file_exists(
"test4.txt\\test1.txt"),
"The file is not moved\n");
2165 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2166 ok(
DeleteFileA(
"test6.txt\\test1.txt"),
"The file is not moved. Many files are specified\n");
2167 ok(
DeleteFileA(
"test6.txt\\test2.txt"),
"The file is not moved. Many files are specified\n");
2168 ok(
DeleteFileA(
"test6.txt\\test4.txt\\test1.txt"),
"The file is not moved. Many files are specified\n");
2169 ok(
RemoveDirectoryA(
"test6.txt\\test4.txt"),
"The directory is not moved. Many files are specified\n");
2176 ok(
file_exists(
"test1.txt"),
"The file is moved. Many files are specified\n");
2177 ok(
dir_exists(
"test4.txt"),
"The directory is moved. Many files are specified\n");
2192 ok(!
dir_exists(
"test4.txt"),
"The dir is not moved\n");
2200 shfo.
pFrom =
"test1.txt\0";
2201 shfo.
pTo =
"a.txt\0b.txt\0";
2211 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2219 ok(!
file_exists(
"test1.txt"),
"Expected test1.txt to not exist\n");
2224 shfo.
pFrom =
"test2.txt\0test3.txt\0";
2225 shfo.
pTo =
"test1.txt\0";
2231 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2232 ok(
DeleteFileA(
"test1.txt\\test2.txt"),
"Expected test1.txt\\test2.txt to exist\n");
2233 ok(
DeleteFileA(
"test1.txt\\test3.txt"),
"Expected test1.txt\\test3.txt to exist\n");
2241 ok(!
file_exists(
"test1.txt"),
"Expected test1.txt to not exist\n");
2242 ok(
file_exists(
"test2.txt"),
"Expected test2.txt to exist\n");
2243 ok(
file_exists(
"test3.txt"),
"Expected test3.txt to exist\n");
2247 shfo.
pFrom =
"test4.txt\0";
2248 shfo.
pTo =
"test4.txt\\b.txt\0";
2252 "Expected ERROR_SUCCESS or DE_DESTSUBTREE, got %d\n", retval);
2253 ok(!
RemoveDirectoryA(
"test4.txt\\b.txt"),
"Expected test4.txt\\b.txt to not exist\n");
2254 ok(
dir_exists(
"test4.txt"),
"Expected test4.txt to exist\n");
2257 shfo.
pFrom =
"test2.txt\0test3.txt\0";
2258 shfo.
pTo =
"d.txt\0e.txt\0";
2264 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2265 ok(
DeleteFileA(
"d.txt\\test2.txt"),
"Expected d.txt\\test2.txt to exist\n");
2266 ok(
DeleteFileA(
"d.txt\\test3.txt"),
"Expected d.txt\\test3.txt to exist\n");
2279 shfo.
pTo =
"d.txt\0";
2295 "Expected DE_SAMEFILE, got %d\n", retval);
2296 ok(
DeleteFileA(
"d.txt\\test2.txt"),
"Expected d.txt\\test2.txt to exist\n");
2297 ok(!
file_exists(
"d.txt\\test3.txt"),
"Expected d.txt\\test3.txt to not exist\n");
2309 shfo.
pFrom =
"test2.txt\0";
2310 shfo.
pTo =
"dir1\\dir2\\test2.txt\0";
2315 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2316 ok(
DeleteFileA(
"dir1\\dir2\\test2.txt"),
"Expected dir1\\dir2\\test2.txt to exist\n");
2327 shfo.
pTo =
"test3.txt\0";
2332 ok(
file_exists(
"test2.txt"),
"Expected test2.txt to exist\n");
2336 ok(retval ==
ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", retval);
2337 ok(!
file_exists(
"test2.txt"),
"Expected test2.txt to not exist\n");
2344 ok(
file_exists(
"test3.txt"),
"Expected test3.txt to exist\n");
2355 ok(
ERROR_SUCCESS ==
ret,
"SHCreateDirectoryEx failed to create directory recursively, ret = %d\n",
ret);
2356 ok(
file_exists(
"testdir2"),
"The first directory is not created\n");
2357 ok(
file_exists(
"testdir2\\test4.txt"),
"The second directory is not created\n");
2364 ok(
file_exists(
"c:\\testdir3"),
"The directory is not created\n");
2372 BOOL UsedDefaultChar;
2377 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2382 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2387 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2392 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2393 ok(!
file_exists(
"nonexistent\\"),
"nonexistent\\ exists but shouldn't\n");
2401 "Unexpected result : 0x%08x\n",
res);
2408 "Unexpected result : 0x%08x\n",
res);
2416 "Unexpected result : 0x%08x\n",
res);
2420 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2425 ok(!
file_exists(
".\\testdir2\\test4.txt\\"),
".\\testdir2\\test4.txt\\ exists but shouldn't\n");
2436 ok(!
file_exists(
"nonexistent\\notreal"),
"nonexistent\\notreal exists but shouldn't\n");
2437 ok(!
file_exists(
"nonexistent\\"),
"nonexistent\\ exists but shouldn't\n");
2442 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2443 ok(
file_exists(
"testdir2\\test4.txt\\"),
"testdir2\\test4.txt doesn't exist but should\n");
2448 ok(
res ==
S_OK,
"res == 0x%08x, expected S_OK\n",
res);
2449 ok(
file_exists(
"nonexistent\\notreal"),
"nonexistent\\notreal doesn't exist but should\n");
2454 UsedDefaultChar =
FALSE;
2460 if (UsedDefaultChar)
2462 win_skip(
"Could not find unique multibyte representation for directory name using default codepage\n");
2470 ok(!
file_exists(UNICODE_PATH_A),
"unicode path was created but shouldn't be\n");
2476 ok(
file_exists(UNICODE_PATH_A),
"unicode path should've been created\n");
2502 "SHGetNewLinkInfoA succeeded\n");
2503 ok(mustcopy ==
FALSE,
"mustcopy should be FALSE\n");
2512 ok(mustcopy ==
FALSE,
"mustcopy should be FALSE\n");
2521 ok(mustcopy ==
FALSE,
"mustcopy should be FALSE\n");
2524 "%s does not start with %s\n",
result, destdir);
2526 "%s does not end with .lnk\n",
result);
2534 ok(mustcopy ==
FALSE,
"mustcopy should be FALSE\n");
2537 "%s does not start with %s\n", result2, destdir);
2539 "%s does not end with .lnk\n", result2);
2549 static const WCHAR UNICODE_PATH_TO[] = {
'c',
':',
'\\',0x00ae,0x00ae,
'\0'};
2569 skip(
"Unicode tests skipped on non-unicode system\n");
2574 skip(
"test needs admin rights\n");
2582 ok(!
ret,
"File is not removed, ErrorCode: %d\n",
ret);
2590 ok(!
ret,
"File is not removed, ErrorCode: %d\n",
ret);
2595 ok(!
ret,
"SHCreateDirectoryExW returned %d\n",
ret);
2597 shfoW.
fFlags &= ~FOF_ALLOWUNDO;
2599 ok(!
ret,
"Directory is not removed, ErrorCode: %d\n",
ret);
2604 ok(!
ret,
"SHCreateDirectoryExW returned %d\n",
ret);
2608 ok(!
ret,
"Directory is not removed, ErrorCode: %d\n",
ret);
2614 shfoW.
pTo = UNICODE_PATH_TO;
2646 ok(
hwnd != 0,
"FindWindowA failed to produce a hwnd\n");
2648 ok(!
ret,
"SHCreateDirectoryExW returned %d\n",
ret);
2653 "Expected ERROR_ALREADY_EXISTS, got %d\n",
ret);
2661 ok (
hres == 0x4242,
"expected 0x4242 but got %x\n",
hres);
2663 ok (
hres == 0x4242,
"expected 0x4242 but got %x\n",
hres);
2711 win_skip(
"Need to cater for old shell32 (4.0.x) on Win95\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
BOOL WINAPI CopyFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI MoveFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
INT WINAPI CompareStringA(LCID lcid, DWORD flags, LPCSTR str1, INT len1, LPCSTR str2, INT len2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
GLenum GLuint GLenum GLsizei const GLchar * buf
#define WC_NO_BEST_FIT_CHARS
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define ERROR_ALREADY_EXISTS
#define ERROR_FILE_NOT_FOUND
#define sprintf(buf, format,...)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_DIRECTORY
#define LOCALE_SYSTEM_DEFAULT
void WINAPI ILFree(LPITEMIDLIST pidl)
struct _IMAGELIST * HIMAGELIST
DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT sizeofpsfi, UINT flags)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
#define SHGFI_SYSICONINDEX
#define SHGFI_ICONLOCATION
#define SHGFI_DISPLAYNAME
#define FOF_MULTIDESTFILES
#define SHGFI_USEFILEATTRIBUTES
#define FOF_NOCONFIRMMKDIR
#define FOF_NOCONFIRMATION
#define SHGFI_SHELLICONSIZE
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags)
static CHAR CURR_DIR[MAX_PATH]
static BOOL file_has_content(const CHAR *name, const CHAR *content)
#define expect_retval(ret, ret_prewin32)
static BOOL file_exists(const CHAR *name)
static void createTestFile(const CHAR *name)
static void set_curr_dir_path(CHAR *buf, const CHAR *files)
static void test_rename(void)
static void test_delete(void)
static void test_sh_create_dir(void)
static BOOL dir_exists(const CHAR *name)
static void test_sh_path_prepare(void)
static void test_get_file_info(void)
static void test_copy(void)
static BOOL is_old_shell32(void)
static void test_get_file_info_iconlist(void)
static void test_shlmenu(void)
static void test_move(void)
static const WCHAR UNICODE_PATH[]
static BOOL file_existsW(LPCWSTR name)
static void clean_after_shfo_tests(void)
static void createTestFileW(const WCHAR *name)
static void init_shfo_tests(void)
static void test_sh_new_link_info(void)
static void test_unicode(void)
static void check_icon_size(HICON icon, DWORD flags)
int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES sec)
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
EXTERN_C HRESULT WINAPI SHPathPrepareForWriteA(HWND hwnd, IUnknown *modless, LPCSTR path, DWORD flags)
EXTERN_C HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path, DWORD flags)
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
#define SHPPFW_IGNOREFILENAME
ITEMIDLIST UNALIGNED * LPITEMIDLIST
CHAR szDisplayName[MAX_PATH]
WCHAR szDisplayName[MAX_PATH]
BOOL fAnyOperationsAborted
BOOL fAnyOperationsAborted
LPCWSTR lpszProgressTitle
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
#define ERROR_PATH_NOT_FOUND
#define ERROR_GEN_FAILURE
#define HRESULT_FROM_WIN32(x)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
HWND WINAPI FindWindowA(_In_opt_ LPCSTR, _In_opt_ LPCSTR)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)