44DEFINE_GUID(IID_IParentAndItem, 0xB3A4B685, 0xB685, 0x4805, 0x99,0xD9, 0x5D,0xEA,0xD2,0x87,0x32,0x36);
45DEFINE_GUID(CLSID_ShellDocObjView, 0xe7e4bc40, 0xe76a, 0x11ce, 0xa9,0xbb, 0x00,0xaa,0x00,0x4a,0xe8,0x37);
106#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
109 MAKEFUNC(SHCreateItemFromRelativeName);
110 MAKEFUNC(SHCreateItemInKnownFolder);
123 MAKEFUNC(SHGetSetFolderCustomSettings);
128 ok(
broken(
ptr == 0) ||
ptr != 0,
"expected named export for ILFree\n");
131#define TESTNAMED(f) \
132 ptr = (void*)GetProcAddress(hmod, #f); \
133 ok(ptr != 0, "expected named export for " #f "\n");
157 ok(
hr ==
S_OK,
"SHGetMalloc failed %08x\n",
hr);
171 if (lpszPath[-1] !=
'\\')
186 {{
'c',
':',
'\\',0},
S_OK},
188 {{
'c',
':',
'\\',
'f',
'a',
'k',
'e',0}, 0x80070002},
191 {{
'c',
':',
'\\',
'w',
'i',
'n',
'd',
'o',
'w',
's',0},
S_OK},
192 {{
'c',
':',
'\\',
'w',
'i',
'n',
'd',
'o',
'w',
's',
'\\',0},
S_OK},
193 {{
'c',
':',
'\\',
'w',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
'.',0},
E_INVALIDARG, 1},
194 {{
'c',
':',
'\\',
'w',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
'.',
'.',0},
E_INVALIDARG, 1},
197 {{
't',
'e',
's',
't',0}, 0x80070002},
198 {{
't',
'e',
's',
't',
'\\',0}, 0x80070002},
199 {{
's',
'u',
'b',
'\\',
'd',
'i',
'r',0}, 0x80070002},
200 {{
's',
'u',
'b',
'/',
'd',
'i',
'r',0},
E_INVALIDARG, 1},
201 {{
'h',
't',
't',
'p',
':',0},
S_OK, 1},
202 {{
'h',
't',
't',
'p',
':',
't',
'e',
's',
't',0},
S_OK, 1},
203 {{
'h',
't',
't',
'p',
':',
'\\',
't',
'e',
's',
't',0},
S_OK, 1},
204 {{
'x',
'x',
':',0},
S_OK, 1},
209 static WCHAR testdirW[] = {
'p',
'a',
'r',
's',
'e',
't',
'e',
's',
't',0};
219 ok(
hr ==
S_OK,
"Expected SHGetDesktopFolder to return S_OK, got 0x%08x\n",
hr);
239 ok(bRes,
"SHGetSpecialFolderPath(CSIDL_PERSONAL) failed! %u\n",
GetLastError());
242 ok(
hr ==
S_OK,
"DesktopFolder->ParseDisplayName failed. hr = %08x.\n",
hr);
245 "Last pidl should be of type PT_FOLDER, but is: %02x\n",
256 ok(
hr == 0x80070002,
"got %#x\n",
hr);
276 IShellFolder_Release(desktop);
329 static const WORD iResults [5][5] =
338#define SFGAO_testfor SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR | SFGAO_CAPABILITYMASK
340 static const ULONG attrs[5] =
342 SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
343 SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
344 SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
345 SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
346 SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
348 static const ULONG full_attrs[5] =
350 SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
351 SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
352 SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
353 SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
354 SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
357 hr = IShellFolder_EnumObjects(iFolder,
NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList);
358 ok(
hr ==
S_OK,
"EnumObjects failed %08x\n",
hr);
364 while (IEnumIDList_Next(iEnumList, 10-
i, &idlArr[
i], &NumPIDLs) ==
S_OK)
366 ok (
i == 5,
"i: %d\n",
i);
368 hr = IEnumIDList_Release(iEnumList);
369 ok(
hr ==
S_OK,
"IEnumIDList_Release failed %08x\n",
hr);
372 for (
i=0;
i<5;
i++)
for (
j=0;
j<5;
j++)
376 idlArr[
i] = idlArr[
j];
380 for (
i=0;
i<5;
i++)
for (
j=0;
j<5;
j++)
383 ok(
hr == iResults[
i][
j],
"Got %x expected [%d]-[%d]=%x\n",
hr,
i,
j, iResults[
i][
j]);
387 for (
i = 0;
i < 5;
i++)
390#define SFGAO_VISTA SFGAO_DROPTARGET | SFGAO_CANLINK | SFGAO_CANCOPY
392 flags = SFGAO_CANCOPY;
395 ok(
hr ==
S_OK,
"GetAttributesOf returns %08x\n",
hr);
398 "GetAttributesOf[%i] got %08x, expected %08x\n",
i,
flags, attrs[
i]);
403 ok(
hr ==
S_OK,
"GetAttributesOf returns %08x\n",
hr);
404 ok(
flags == attrs[
i],
"GetAttributesOf[%i] got %08x, expected %08x\n",
i,
flags, attrs[
i]);
408 ok(
hr ==
S_OK,
"GetAttributesOf returns %08x\n",
hr);
409 ok((
flags & ~(SFGAO_HASSUBFOLDER|SFGAO_COMPRESSED)) == full_attrs[
i],
"%d: got %08x expected %08x\n",
i,
flags, full_attrs[
i]);
413 IMalloc_Free(
ppM, idlArr[
i]);
420 IShellFolder *psfDesktop, *psfChild, *psfMyComputer, *psfSystemDir;
429 WCHAR wszMyComputer[] = {
430 ':',
':',
'{',
'2',
'0',
'D',
'0',
'4',
'F',
'E',
'0',
'-',
'3',
'A',
'E',
'A',
'-',
'1',
'0',
'6',
'9',
'-',
431 'A',
'2',
'D',
'8',
'-',
'0',
'8',
'0',
'0',
'2',
'B',
'3',
'0',
'3',
'0',
'9',
'D',
'}',0 };
432 static const CHAR filename_html[] =
"winetest.html";
433 static const CHAR filename_txt[] =
"winetest.txt";
434 static const CHAR filename_foo[] =
"winetest.foo";
440 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
443 hr = IShellFolder_BindToObject(psfDesktop, pidlEmpty,
NULL, &IID_IShellFolder, (
LPVOID*)&psfChild);
444 ok (
hr ==
E_INVALIDARG,
"Desktop's BindToObject should fail, when called with empty pidl! hr = %08x\n",
hr);
446 hr = IShellFolder_BindToObject(psfDesktop,
NULL,
NULL, &IID_IShellFolder, (
LPVOID*)&psfChild);
447 ok (
hr ==
E_INVALIDARG,
"Desktop's BindToObject should fail, when called with NULL pidl! hr = %08x\n",
hr);
450 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse MyComputer's CLSID! hr = %08x\n",
hr);
452 IShellFolder_Release(psfDesktop);
456 hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer,
NULL, &IID_IShellFolder, (
LPVOID*)&psfMyComputer);
457 ok (
hr ==
S_OK,
"Desktop failed to bind to MyComputer object! hr = %08x\n",
hr);
458 IShellFolder_Release(psfDesktop);
459 IMalloc_Free(
ppM, pidlMyComputer);
462 hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty,
NULL, &IID_IShellFolder, (
LPVOID*)&psfChild);
463 ok (
hr ==
E_INVALIDARG,
"MyComputers's BindToObject should fail, when called with empty pidl! hr = %08x\n",
hr);
465 hr = IShellFolder_BindToObject(psfMyComputer,
NULL,
NULL, &IID_IShellFolder, (
LPVOID*)&psfChild);
466 ok (
hr ==
E_INVALIDARG,
"MyComputers's BindToObject should fail, when called with NULL pidl! hr = %08x\n",
hr);
471 IShellFolder_Release(psfMyComputer);
477 ok (
hr ==
S_OK,
"MyComputers's ParseDisplayName failed to parse the SystemDirectory! hr = %08x\n",
hr);
479 IShellFolder_Release(psfMyComputer);
483 hr = IShellFolder_BindToObject(psfMyComputer, pidlSystemDir,
NULL, &IID_IShellFolder, (
LPVOID*)&psfSystemDir);
484 ok (
hr ==
S_OK,
"MyComputer failed to bind to a FileSystem ShellFolder! hr = %08x\n",
hr);
485 IShellFolder_Release(psfMyComputer);
486 IMalloc_Free(
ppM, pidlSystemDir);
489 hr = IShellFolder_BindToObject(psfSystemDir, pidlEmpty,
NULL, &IID_IShellFolder, (
LPVOID*)&psfChild);
491 "FileSystem ShellFolder's BindToObject should fail, when called with empty pidl! hr = %08x\n",
hr);
493 hr = IShellFolder_BindToObject(psfSystemDir,
NULL,
NULL, &IID_IShellFolder, (
LPVOID*)&psfChild);
495 "FileSystem ShellFolder's BindToObject should fail, when called with NULL pidl! hr = %08x\n",
hr);
497 IShellFolder_Release(psfSystemDir);
502 skip(
"Failed to get current directory, skipping tests.\n");
523 hr = IShellFolder_BindToObject(psfDesktop, pidl,
NULL, &IID_IShellFolder, (
void**)&psfChild);
530 hr = IShellFolder_QueryInterface(psfChild, &
IID_IPersist, (
void**)&pp);
535 hr = IPersist_GetClassID(pp, &
id);
538 IPersist_Release(pp);
541 IShellFolder_Release(psfChild);
548 win_skip(
"Failed to create .html testfile.\n");
562 hr = IShellFolder_BindToObject(psfDesktop, pidl,
NULL, &IID_IShellFolder, (
void**)&psfChild);
572 win_skip(
"Failed to create .txt testfile.\n");
586 hr = IShellFolder_BindToObject(psfDesktop, pidl,
NULL, &IID_IShellFolder, (
void**)&psfChild);
596 win_skip(
"Failed to create .foo testfile.\n");
609 hr = IShellFolder_BindToObject(psfDesktop, pidl,
NULL, &IID_IShellFolder, (
void **)&psfChild);
628 hr = IShellFolder_BindToObject(psfDesktop, pidl,
NULL, &IID_IShellFolder, (
void **)&psfChild);
636 IShellFolder_Release(psfDesktop);
648 LPSHELLFOLDER psfDesktop, psfPersonal;
653 static const CHAR szFileName[] =
"winetest.foo";
654 static const WCHAR wszFileName[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'f',
'o',
'o',0 };
655 static const WCHAR wszDirName[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',0 };
658 WCHAR wszAbsoluteFilename[] = {
'C',
':',
'\\',
'w',
'i',
'n',
'e',
't',
'e',
's',
't', 0 };
680 ok(0,
"unable to create the '%s' directory\n", szTestDir);
694 ok(
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
700 ok(
hr ==
S_OK,
"Desktop->ParseDisplayName failed! hr = %08x\n",
hr);
702 IShellFolder_Release(psfDesktop);
707 ok(pidlLast->mkid.cb >= 76,
"Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb);
708 if (pidlLast->mkid.cb >= 28) {
710 "Filename should be stored as ansi-string at this position!\n");
713 if (pidlLast->mkid.cb >= 76) {
718 "Filename should be stored as wchar-string at this position!\n");
728 IUnknown_Release(psfFile);
732 hr =
SHBindToParent(pidlTestFile, &IID_IShellFolder, (
void **)&psfPersonal, &pidlLast);
733 ok(
hr ==
S_OK,
"SHBindToParent failed! hr = %08x\n",
hr);
736 hr = IShellFolder_SetNameOf(psfPersonal,
NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
737 ok (
hr ==
S_OK,
"SetNameOf failed! hr = %08x\n",
hr);
740 "pidl returned from SetNameOf should be simple!\n");
744 hr = IShellFolder_SetNameOf(psfPersonal,
NULL, pidlNew, wszAbsoluteFilename, SHGDN_FORPARSING,
NULL);
750 ok (
hr ==
S_OK,
"SetNameOf failed! hr = %08x\n",
hr);
753 IShellFolder_Release(psfPersonal);
762 ok (!
lstrcmpiW(wszTestFile, wszTestFile2),
"SHGetPathFromIDListW returns incorrect path!\n");
767 "SHBindToParent(NULL) should fail! hr = %08x\n",
hr);
770 hr =
SHBindToParent(pidlEmpty, &IID_IShellFolder, (
void **)&psfPersonal, &pidlLast);
771 ok (
hr ==
S_OK,
"SHBindToParent(empty PIDL) should succeed! hr = %08x\n",
hr);
772 ok (pidlLast == pidlEmpty,
"The last element of an empty PIDL should be the PIDL itself!\n");
774 IShellFolder_Release(psfPersonal);
777 hr =
SHBindToParent(pidlTestFile, &IID_IShellFolder, (
void **)&psfPersonal, &pidlLast);
778 ok (
hr ==
S_OK,
"SHBindToParent failed! hr = %08x\n",
hr);
780 IShellFolder_Release(psfDesktop);
787 "SHBindToParent doesn't return the last id of the pidl param!\n");
790 ok (
hr ==
S_OK,
"Personal->GetDisplayNameOf failed! hr = %08x\n",
hr);
792 IShellFolder_Release(psfDesktop);
793 IShellFolder_Release(psfPersonal);
798 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
799 ok (!
lstrcmpiW(wszTestFile, wszTestFile2),
"GetDisplayNameOf returns incorrect path!\n");
802 IShellFolder_Release(psfDesktop);
803 IShellFolder_Release(psfPersonal);
812 LPSHELLFOLDER psfDesktop;
814 DWORD dwAttributes, dwCallForAttributes, dwOrigAttributes, dwOrigCallForAttributes;
815 static const WCHAR wszAttributes[] = {
'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
's',0 };
816 static const WCHAR wszCallForAttributes[] = {
817 'C',
'a',
'l',
'l',
'F',
'o',
'r',
'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
's',0 };
818 static const WCHAR wszMyDocumentsKey[] = {
819 'C',
'L',
'S',
'I',
'D',
'\\',
'{',
'4',
'5',
'0',
'D',
'8',
'F',
'B',
'A',
'-',
'A',
'D',
'2',
'5',
'-',
820 '1',
'1',
'D',
'0',
'-',
'9',
'8',
'A',
'8',
'-',
'0',
'8',
'0',
'0',
'3',
'6',
'1',
'B',
'1',
'1',
'0',
'3',
'}',
821 '\\',
'S',
'h',
'e',
'l',
'l',
'F',
'o',
'l',
'd',
'e',
'r',0 };
822 WCHAR wszMyDocuments[] = {
823 ':',
':',
'{',
'4',
'5',
'0',
'D',
'8',
'F',
'B',
'A',
'-',
'A',
'D',
'2',
'5',
'-',
'1',
'1',
'D',
'0',
'-',
824 '9',
'8',
'A',
'8',
'-',
'0',
'8',
'0',
'0',
'3',
'6',
'1',
'B',
'1',
'1',
'0',
'3',
'}',0 };
836 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
840 &pidlMyDocuments,
NULL);
842 "Desktop's ParseDisplayName failed to parse MyDocuments's CLSID! hr = %08x\n",
hr);
844 IShellFolder_Release(psfDesktop);
849 hr = IShellFolder_GetAttributesOf(psfDesktop, 1,
851 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(MyDocuments) failed! hr = %08x\n",
hr);
854 ok (
dwAttributes & SFGAO_FILESYSTEM,
"SFGAO_FILESYSTEM attribute is not set for MyDocuments!\n");
855 ok (!(
dwAttributes & SFGAO_ISSLOW),
"SFGAO_ISSLOW attribute is set for MyDocuments!\n");
856 ok (!(
dwAttributes & SFGAO_GHOSTED),
"SFGAO_GHOSTED attribute is set for MyDocuments!\n");
864 "RegOpenKeyEx failed! result: %08x\n", lResult);
867 skip(
"Not enough rights to open the registry key\n");
868 IMalloc_Free(
ppM, pidlMyDocuments);
869 IShellFolder_Release(psfDesktop);
876 ok (lResult ==
ERROR_SUCCESS,
"RegQueryValueEx failed! result: %08x\n", lResult);
879 IMalloc_Free(
ppM, pidlMyDocuments);
880 IShellFolder_Release(psfDesktop);
888 ok (lResult ==
ERROR_SUCCESS,
"RegQueryValueEx failed! result: %08x\n", lResult);
891 IMalloc_Free(
ppM, pidlMyDocuments);
892 IShellFolder_Release(psfDesktop);
901 dwCallForAttributes = SFGAO_ISSLOW|SFGAO_FILESYSTEM;
910 dwAttributes = SFGAO_ISSLOW|SFGAO_GHOSTED|SFGAO_FILESYSTEM;
911 hr = IShellFolder_GetAttributesOf(psfDesktop, 1,
913 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(MyDocuments) failed! hr = %08x\n",
hr);
916 "Desktop->GetAttributes(MyDocuments) returned unexpected attributes: %08x\n",
924 IMalloc_Free(
ppM, pidlMyDocuments);
925 IShellFolder_Release(psfDesktop);
931 LPSHELLFOLDER psfDesktop, psfMyComputer;
936 static const DWORD desktopFlags = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
937 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
938 static const DWORD myComputerFlags = SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
939 SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
940 WCHAR wszMyComputer[] = {
941 ':',
':',
'{',
'2',
'0',
'D',
'0',
'4',
'F',
'E',
'0',
'-',
'3',
'A',
'E',
'A',
'-',
'1',
'0',
'6',
'9',
'-',
942 'A',
'2',
'D',
'8',
'-',
'0',
'8',
'0',
'0',
'2',
'B',
'3',
'0',
'3',
'0',
'9',
'D',
'}',0 };
945 static WCHAR cTestDirW[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
951 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
956 hr = IShellFolder_GetAttributesOf(psfDesktop, 1, &pidlEmpty, &
dwFlags);
957 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(empty pidl) failed! hr = %08x\n",
hr);
962 hr = IShellFolder_GetAttributesOf(psfDesktop, 0,
NULL, &
dwFlags);
963 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(NULL) failed! hr = %08x\n",
hr);
968 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse MyComputer's CLSID! hr = %08x\n",
hr);
970 IShellFolder_Release(psfDesktop);
979 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(MyComputer) failed! hr = %08x\n",
hr);
981 ok (
dwFlags == (myComputerFlags | SFGAO_CANLINK),
"Wrong MyComputer attributes: %08x\n",
dwFlags);
983 hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer,
NULL, &IID_IShellFolder, (
LPVOID*)&psfMyComputer);
984 ok (
hr ==
S_OK,
"Desktop failed to bind to MyComputer object! hr = %08x\n",
hr);
985 IShellFolder_Release(psfDesktop);
986 IMalloc_Free(
ppM, pidlMyComputer);
989 hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &
dwFlags);
991 ok (
hr ==
E_INVALIDARG,
"MyComputer->GetAttributesOf(empty pidl) should fail! hr = %08x\n",
hr);
994 hr = IShellFolder_GetAttributesOf(psfMyComputer, 0,
NULL, &
dwFlags);
995 ok (
hr ==
S_OK,
"MyComputer->GetAttributesOf(NULL) failed! hr = %08x\n",
hr);
997 ok (
dwFlags == myComputerFlags,
"Wrong MyComputer attributes: %08x\n",
dwFlags);
999 IShellFolder_Release(psfMyComputer);
1005 win_skip(
"GetCurrentDirectoryA returned empty string. Skipping test_GetAttributesOf\n");
1008 if (
len > 3 && cCurrDirA[
len-1] ==
'\\')
1009 cCurrDirA[
len-1] = 0;
1017 ok(
hr ==
S_OK,
"SHGetDesktopfolder failed %08x\n",
hr);
1020 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1022 hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL,
NULL, (
REFIID)&IID_IShellFolder, (
LPVOID *)&testIShellFolder);
1023 ok(
hr ==
S_OK,
"BindToObject failed %08x\n",
hr);
1025 IMalloc_Free(
ppM, newPIDL);
1029 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1034 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf() failed! hr = %08x\n",
hr);
1035 ok ((
dwFlags&SFGAO_FOLDER),
"Wrong directory attribute for relative PIDL: %08x\n",
dwFlags);
1038 IMalloc_Free(
ppM, newPIDL);
1041 if (cCurrDirA[
len-1] ==
'\\')
1042 cCurrDirA[
len-1] = 0;
1047 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1052 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf() failed! hr = %08x\n",
hr);
1053 ok ((
dwFlags&SFGAO_FOLDER),
"Wrong directory attribute for absolute PIDL: %08x\n",
dwFlags);
1056 IMalloc_Free(
ppM, newPIDL);
1058 IShellFolder_Release(testIShellFolder);
1062 IShellFolder_Release(IDesktopFolder);
1073 LPSHELLFOLDER psfDesktop;
1074 WCHAR wszMyComputer[] = {
1075 ':',
':',
'{',
'2',
'0',
'D',
'0',
'4',
'F',
'E',
'0',
'-',
'3',
'A',
'E',
'A',
'-',
'1',
'0',
'6',
'9',
'-',
1076 'A',
'2',
'D',
'8',
'-',
'0',
'8',
'0',
'0',
'2',
'B',
'3',
'0',
'3',
'0',
'9',
'D',
'}',0 };
1081 static WCHAR wszTestFile[] = {
1082 'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'f',
'o',
'o',0 };
1090 ok(!wszPath[0],
"Expected empty string\n");
1100 ok(!
lstrcmpiW(wszDesktop, wszPath),
"SHGetPathFromIDListW didn't return desktop path for empty pidl!\n");
1104 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
1108 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse MyComputer's CLSID! hr = %08x\n",
hr);
1110 IShellFolder_Release(psfDesktop);
1118 ok (!
result,
"SHGetPathFromIDListW succeeded where it shouldn't!\n");
1121 "Unexpected last error from SHGetPathFromIDListW: %u\n",
GetLastError());
1122 ok (!wszPath[0],
"Expected empty path\n");
1124 IShellFolder_Release(psfDesktop);
1128 IMalloc_Free(
ppM, pidlMyComputer);
1133 IShellFolder_Release(psfDesktop);
1141 IShellFolder_Release(psfDesktop);
1147 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse filename hr = %08x\n",
hr);
1149 IShellFolder_Release(psfDesktop);
1151 IMalloc_Free(
ppM, pidlTestFile);
1158 ok (
hr ==
S_OK,
"Desktop's GetDisplayNamfOf failed! hr = %08x\n",
hr);
1159 IShellFolder_Release(psfDesktop);
1162 IMalloc_Free(
ppM, pidlTestFile);
1167 "Desktop->GetDisplayNameOf(pidlTestFile, SHGDN_FORPARSING) "
1168 "returned incorrect path for file placed on desktop\n");
1172 ok(0 ==
lstrcmpW(
wszFileName, wszPath),
"SHGetPathFromIDListW returned incorrect path for file placed on desktop\n");
1174 if (pSHGetPathFromIDListEx)
1176 result = pSHGetPathFromIDListEx(pidlEmpty, wszPath,
MAX_PATH, SFGAO_FILESYSTEM);
1178 ok(!
lstrcmpiW(wszDesktop, wszPath),
"Unexpected SHGetPathFromIDListEx result %s, expected %s\n",
1181 result = pSHGetPathFromIDListEx(pidlTestFile, wszPath,
MAX_PATH, SFGAO_FILESYSTEM);
1187 memset(wszPath, 0x55,
sizeof(wszPath));
1188 result = pSHGetPathFromIDListEx(pidlTestFile, wszPath, 5, SFGAO_FILESYSTEM);
1192 memset(wszPath, 0x55,
sizeof(wszPath));
1193 result = pSHGetPathFromIDListEx(pidlEmpty, wszPath, 5, SFGAO_FILESYSTEM);
1197 win_skip(
"SHGetPathFromIDListEx not available\n");
1199 IMalloc_Free(
ppM, pidlTestFile);
1203 ok(
hr ==
S_OK,
"SHGetFolderLocation failed: 0x%08x\n",
hr);
1207 IMalloc_Free(
ppM, pidlPrograms);
1208 ok(
result,
"SHGetPathFromIDListW failed\n");
1216 static const CHAR cTestDirA[] =
"\\testdir";
1225 win_skip(
"GetCurrentDirectoryA returned empty string. Skipping test_EnumObjects_and_CompareIDs\n");
1228 if(cCurrDirA[
len-1] ==
'\\')
1229 cCurrDirA[
len-1] = 0;
1235 ok(
hr ==
S_OK,
"SHGetDesktopfolder failed %08x\n",
hr);
1240 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1242 hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL,
NULL, (
REFIID)&IID_IShellFolder, (
LPVOID *)&testIShellFolder);
1243 ok(
hr ==
S_OK,
"BindToObject failed %08x\n",
hr);
1247 IShellFolder_Release(testIShellFolder);
1251 IMalloc_Free(
ppM, newPIDL);
1253 IShellFolder_Release(IDesktopFolder);
1268 ok (
FALSE,
"InitPropertyBag asked for unknown interface!\n");
1272 IPropertyBag_AddRef(iface);
1287 static const WCHAR wszTargetSpecialFolder[] = {
1288 'T',
'a',
'r',
'g',
'e',
't',
'S',
'p',
'e',
'c',
'i',
'a',
'l',
'F',
'o',
'l',
'd',
'e',
'r',0 };
1289 static const WCHAR wszTarget[] = {
1290 'T',
'a',
'r',
'g',
'e',
't',0 };
1291 static const WCHAR wszAttributes[] = {
1292 'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
's',0 };
1293 static const WCHAR wszResolveLinkFlags[] = {
1294 'R',
'e',
's',
'o',
'l',
'v',
'e',
'L',
'i',
'n',
'k',
'F',
'l',
'a',
'g',
's',0 };
1295 static const WCHAR wszTargetKnownFolder[] = {
1296 'T',
'a',
'r',
'g',
'e',
't',
'K',
'n',
'o',
'w',
'n',
'F',
'o',
'l',
'd',
'e',
'r',0 };
1297 static const WCHAR wszCLSID[] = {
1298 'C',
'L',
'S',
'I',
'D',0 };
1300 if (!
lstrcmpW(pszPropName, wszTargetSpecialFolder)) {
1301 ok(
V_VT(pVar) ==
VT_I4,
"Wrong variant type for 'TargetSpecialFolder' property!\n");
1305 if (!
lstrcmpW(pszPropName, wszResolveLinkFlags))
1307 ok(
V_VT(pVar) ==
VT_UI4,
"Wrong variant type for 'ResolveLinkFlags' property!\n");
1311 if (!
lstrcmpW(pszPropName, wszTarget)) {
1315 ok(
V_VT(pVar) ==
VT_BSTR,
"Wrong variant type for 'Target' property!\n");
1326 if (!
lstrcmpW(pszPropName, wszAttributes)) {
1327 ok(
V_VT(pVar) ==
VT_UI4,
"Wrong variant type for 'Attributes' property!\n");
1329 V_UI4(pVar) = SFGAO_FOLDER|SFGAO_HASSUBFOLDER|SFGAO_FILESYSANCESTOR|
1330 SFGAO_CANRENAME|SFGAO_FILESYSTEM;
1334 if (!
lstrcmpW(pszPropName, wszTargetKnownFolder)) {
1335 ok(
V_VT(pVar) ==
VT_BSTR,
"Wrong variant type for 'TargetKnownFolder' property!\n");
1340 if (!
lstrcmpW(pszPropName, wszCLSID)) {
1341 ok(
V_VT(pVar) ==
VT_EMPTY,
"Wrong variant type for 'CLSID' property!\n");
1353 ok(
FALSE,
"Unexpected call to IPropertyBag_Write\n");
1378 LPITEMIDLIST pidlCurrentFolder, pidlWineTestFolder, pidlSubFolder;
1380 WCHAR wszWineTestFolder[] = {
1381 ':',
':',
'{',
'9',
'B',
'3',
'5',
'2',
'E',
'B',
'F',
'-',
'2',
'7',
'6',
'5',
'-',
'4',
'5',
'C',
'1',
'-',
1382 'B',
'4',
'C',
'6',
'-',
'8',
'5',
'C',
'C',
'7',
'F',
'7',
'A',
'B',
'C',
'6',
'4',
'}',0 };
1383 WCHAR wszShellExtKey[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
1384 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
'W',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
1385 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
1386 'E',
'x',
'p',
'l',
'o',
'r',
'e',
'r',
'\\',
'D',
'e',
's',
'k',
't',
'o',
'p',
'\\',
1387 'N',
'a',
'm',
'e',
'S',
'p',
'a',
'c',
'e',
'\\',
1388 '{',
'9',
'b',
'3',
'5',
'2',
'e',
'b',
'f',
'-',
'2',
'7',
'6',
'5',
'-',
'4',
'5',
'c',
'1',
'-',
1389 'b',
'4',
'c',
'6',
'-',
'8',
'5',
'c',
'c',
'7',
'f',
'7',
'a',
'b',
'c',
'6',
'4',
'}',0 };
1391 WCHAR wszSomeSubFolder[] = {
'S',
'u',
'b',
'F',
'o',
'l',
'd',
'e',
'r', 0};
1393 {0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}};
1402 win_skip(
"CLSID_FolderShortcut is not implemented\n");
1405 ok (
hr ==
S_OK,
"CoCreateInstance failed! hr = 0x%08x\n",
hr);
1409 ok(
hr ==
S_OK,
"IPersistPropertyBag_Load failed! hr = %08x\n",
hr);
1411 IPersistPropertyBag_Release(pPersistPropertyBag);
1415 hr = IPersistPropertyBag_QueryInterface(pPersistPropertyBag, &IID_IShellFolder,
1417 IPersistPropertyBag_Release(pPersistPropertyBag);
1418 ok(
hr ==
S_OK,
"IPersistPropertyBag_QueryInterface(IShellFolder) failed! hr = %08x\n",
hr);
1423 "IShellFolder_GetDisplayNameOf(NULL) failed! hr = %08x\n",
hr);
1425 IShellFolder_Release(pShellFolder);
1434 ok(!
lstrcmpiW(wszDesktopPath, wszBuffer),
"FolderShortcut returned incorrect folder!\n");
1436 hr = IShellFolder_QueryInterface(pShellFolder, &IID_IPersistFolder3, (
LPVOID*)&pPersistFolder3);
1437 IShellFolder_Release(pShellFolder);
1438 ok(
hr ==
S_OK,
"IShellFolder_QueryInterface(IID_IPersistFolder3 failed! hr = 0x%08x\n",
hr);
1441 hr = IPersistFolder3_GetClassID(pPersistFolder3, &
clsid);
1442 ok(
hr ==
S_OK,
"IPersistFolder3_GetClassID failed! hr=0x%08x\n",
hr);
1445 hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
1447 ok(!pidlCurrentFolder,
"IPersistFolder3_GetCurFolder should return a NULL pidl!\n");
1456 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
1464 &pidlWineTestFolder,
NULL);
1466 IShellFolder_Release(pDesktopFolder);
1467 ok (
hr ==
S_OK,
"IShellFolder::ParseDisplayName failed! hr = %08x\n",
hr);
1470 hr = IPersistFolder3_Initialize(pPersistFolder3, pidlWineTestFolder);
1471 ok (
hr ==
S_OK,
"IPersistFolder3::Initialize failed! hr = %08x\n",
hr);
1473 IPersistFolder3_Release(pPersistFolder3);
1474 ILFree(pidlWineTestFolder);
1478 hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
1479 ok(
hr ==
S_OK,
"IPersistFolder3_GetCurFolder failed! hr=0x%08x\n",
hr);
1480 ok(
ILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
1481 "IPersistFolder3_GetCurFolder should return pidlWineTestFolder!\n");
1482 ILFree(pidlCurrentFolder);
1483 ILFree(pidlWineTestFolder);
1485 hr = IPersistFolder3_QueryInterface(pPersistFolder3, &IID_IShellFolder, (
LPVOID*)&pShellFolder);
1486 IPersistFolder3_Release(pPersistFolder3);
1487 ok(
hr ==
S_OK,
"IPersistFolder3_QueryInterface(IShellFolder) failed! hr = %08x\n",
hr);
1491 ok(
hr ==
S_OK,
"IShellFolder_GetDisplayNameOf(NULL) failed! hr = %08x\n",
hr);
1493 IShellFolder_Release(pShellFolder);
1498 ok(!
lstrcmpiW(wszDesktopPath, wszBuffer),
"FolderShortcut returned incorrect folder!\n");
1503 lstrcatW(wszDesktopPath, wszSomeSubFolder);
1505 IShellFolder_Release(pShellFolder);
1510 &pidlSubFolder,
NULL);
1512 ok (
hr ==
S_OK,
"IShellFolder::ParseDisplayName failed! hr = %08x\n",
hr);
1514 IShellFolder_Release(pShellFolder);
1518 hr = IShellFolder_BindToObject(pShellFolder, pidlSubFolder,
NULL, &IID_IPersistFolder3,
1519 (
LPVOID*)&pPersistFolder3);
1520 IShellFolder_Release(pShellFolder);
1522 ok (
hr ==
S_OK,
"IShellFolder::BindToObject failed! hr = %08x\n",
hr);
1528 hr = IPersistFolder3_GetClassID(pPersistFolder3, &
clsid);
1529 ok(
hr ==
S_OK,
"IPersistFolder3_GetClassID failed! hr=0x%08x\n",
hr);
1531 "IPersistFolder3::GetClassID returned unexpected CLSID!\n");
1533 IPersistFolder3_Release(pPersistFolder3);
1536#include "pshpack1.h"
1564 LPSHELLFOLDER psfDesktop, psfPersonal;
1569 WCHAR wszFile[3][17] = { {
'e',
'v',
'e',
'n',
'_',0 }, {
'o',
'd',
'd',
'_',0 },
1570 {
'l',
'o',
'n',
'g',
'e',
'r',
'_',
't',
'h',
'a',
'n',
'.',
'8',
'_',
'3',0 } };
1574 ok(bResult,
"SHGetSpecialFolderPathW failed! Last error: %u\n",
GetLastError());
1575 if (!bResult)
return;
1580 win_skip(
"Most W-calls are not implemented\n");
1583 ok(bResult,
"SetCurrentDirectory failed! Last error: %u\n",
GetLastError());
1584 if (!bResult)
return;
1587 ok(
hr ==
S_OK,
"SHGetDesktopFolder failed! hr: %08x\n",
hr);
1591 ok(
hr ==
S_OK,
"psfDesktop->ParseDisplayName failed! hr = %08x\n",
hr);
1593 IShellFolder_Release(psfDesktop);
1597 hr = IShellFolder_BindToObject(psfDesktop, pidlPersonal,
NULL, &IID_IShellFolder,
1599 IShellFolder_Release(psfDesktop);
1601 ok(
hr ==
S_OK,
"psfDesktop->BindToObject failed! hr = %08x\n",
hr);
1604 for (
i=0;
i<3;
i++) {
1614 IShellFolder_Release(psfPersonal);
1621 ok(
hr ==
S_OK,
"psfPersonal->ParseDisplayName failed! hr: %08x\n",
hr);
1623 IShellFolder_Release(psfPersonal);
1627 pFileStructA = (
struct FileStructA *)pidlFile->mkid.abID;
1628 ok(pFileStructA->
type == 0x32,
"PIDLTYPE should be 0x32!\n");
1629 ok(pFileStructA->
dummy == 0x00,
"Dummy Byte should be 0x00!\n");
1630 ok(pFileStructA->
dwFileSize == 0,
"Filesize should be zero!\n");
1633 ok(!
strcmp(szFile, (
CHAR*)&pidlFile->mkid.abID[12]),
"Wrong file name!\n");
1641 ok(pidlFile->mkid.abID[18] ==
'~',
"Should be derived 8.3 name!\n");
1644 ok(pidlFile->mkid.abID[12 +
strlen(szFile) + 1] !=
'\0',
1645 "Alignment byte, where there shouldn't be!\n");
1648 ok(pidlFile->mkid.abID[12 +
strlen(szFile) + 1] ==
'\0',
1649 "There should be an alignment byte, but isn't!\n");
1652 cbOffset = *(
WORD*)(((
LPBYTE)pidlFile)+pidlFile->mkid.cb-
sizeof(
WORD));
1654 cbOffset <= pidlFile->mkid.cb -
sizeof(
struct FileStructW)),
1655 "Wrong offset value (%d) stored at the end of the PIDL\n", cbOffset);
1658 cbOffset <= pidlFile->mkid.cb -
sizeof(
struct FileStructW))
1664 "FileStructW's offset and length should add up to the PIDL's length!\n");
1675 "Last write time should match creation time!\n");
1686 "Last write date and time should match last access date and time!\n");
1692 trace (
"Filesystem may be FAT. Performing less strict atime test.\n");
1693 ok ((pFileStructW->
uTime2 & 0x1F) == 0,
1694 "Last access time on FAT filesystems should have zero seconds.\n");
1702 "The filename should be stored in unicode at this position!\n");
1709 IShellFolder_Release(psfPersonal);
1714 static const BOOL is_win64 =
sizeof(
void *) >
sizeof(
int);
1725 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1729 win_skip(
"Program Files (x86) not supported\n" );
1732 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1737 ok(
strstr( path_x86,
"x86" ) !=
NULL,
"32-bit path '%s' doesn't contain x86\n", path_x86 );
1753 ok( !
lstrcmpiA( path_key, path_x86 ),
"paths differ '%s' != '%s'\n", path_key, path_x86 );
1755 else ok( !
is_win64 && !
is_wow64,
"ProgramFilesDir (x86) should exist on 64-bit setup\n" );
1760 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1764 win_skip(
"Common Files (x86) not supported\n" );
1767 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1772 ok(
strstr( path_x86,
"x86" ) !=
NULL,
"32-bit path '%s' doesn't contain x86\n", path_x86 );
1788 ok( !
lstrcmpiA( path_key, path_x86 ),
"paths differ '%s' != '%s'\n", path_key, path_x86 );
1790 else ok( !
is_win64 && !
is_wow64,
"CommonFilesDir (x86) should exist on 64-bit setup\n" );
1800 static const char wine[] =
"wine";
1801 static const char winetemp[] =
"wine\\temp";
1804 static char toolongpath[
MAX_PATH+1];
1808 win_skip(
"SHGetFolderPathA failed for CSIDL_LOCAL_APPDATA!\n");
1835 "expected %s to start with %s\n", testpath,
appdata);
1837 "expected %s to end with %s\n", testpath, winetemp);
1842 ok(0,
"expected S_OK or E_INVALIDARG, got %x\n",
ret);
1862 toolongpath[
i] =
'0' +
i % 10;
1883 "expected %s to start with %s\n", testpath,
appdata);
1885 "expected %s to end with %s\n", testpath, winetemp);
1904 static char resourcefile[
MAX_PATH];
1910 static const char desktopini_contents1[] =
1911 "[.ShellClassInfo]\r\n"
1912 "LocalizedResourceName=@";
1913 static const char desktopini_contents2[] =
1915 static WCHAR foldernameW[] = {
't',
'e',
's',
't',
'f',
'o',
'l',
'd',
'e',
'r',0};
1916 static const WCHAR folderdisplayW[] = {
'F',
'o',
'l',
'd',
'e',
'r',
' ',
'N',
'a',
'm',
'e',
' ',
'R',
'e',
's',
'o',
'u',
'r',
'c',
'e',0};
1939 win_skip(
"GetCurrentDirectoryA returned empty string. Skipping test_LocalizedNames\n");
1942 if(cCurrDirA[
len-1] ==
'\\')
1943 cCurrDirA[
len-1] = 0;
1948 ok(
hr ==
S_OK,
"SHGetDesktopfolder failed %08x\n",
hr);
1951 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1953 hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL,
NULL, (
REFIID)&IID_IShellFolder, (
LPVOID *)&testIShellFolder);
1954 ok(
hr ==
S_OK,
"BindToObject failed %08x\n",
hr);
1956 IMalloc_Free(
ppM, newPIDL);
1960 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1963 ok(
hr ==
S_OK,
"GetDisplayNameOf failed %08x\n",
hr);
1966 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
1972 ok(
hr ==
S_OK,
"GetDisplayNameOf failed %08x\n",
hr);
1975 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
1981 ok(
hr ==
S_OK,
"GetDisplayNameOf failed %08x\n",
hr);
1984 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
1987 IShellFolder_Release(IDesktopFolder);
1988 IShellFolder_Release(testIShellFolder);
1990 IMalloc_Free(
ppM, newPIDL);
2002 LPITEMIDLIST pidl_cwd=
NULL, pidl_testfile, pidl_abstestfile, pidl_test, pidl_desktop;
2012 if (!pSHCreateShellItem)
2014 win_skip(
"SHCreateShellItem isn't available\n");
2020 win_skip(
"GetCurrentDirectoryA returned empty string, skipping test_SHCreateShellItem\n");
2035 ret = IShellFolder_BindToObject(desktopfolder, pidl_cwd,
NULL, &IID_IShellFolder, (
void**)¤tfolder);
2043 pidl_abstestfile =
ILCombine(pidl_cwd, pidl_testfile);
2045 shellitem = (
void*)0xdeadbeef;
2048 ok(shellitem == 0,
"Got %p\n", shellitem);
2053 pSHCreateShellItem(pidl_cwd,
NULL,
NULL, &shellitem);
2054 pSHCreateShellItem(
NULL, currentfolder,
NULL, &shellitem);
2055 pSHCreateShellItem(pidl_cwd, currentfolder,
NULL, &shellitem);
2058 ret = pSHCreateShellItem(
NULL,
NULL, pidl_cwd, &shellitem);
2062 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2066 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2070 ok(
ILIsEqual(pidl_cwd, pidl_test),
"id lists are not equal\n");
2073 IPersistIDList_Release(persistidl);
2075 IShellItem_Release(shellitem);
2078 ret = pSHCreateShellItem(pidl_cwd,
NULL, pidl_testfile, &shellitem);
2082 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2086 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2090 ok(
ILIsEqual(pidl_abstestfile, pidl_test),
"id lists are not equal\n");
2093 IPersistIDList_Release(persistidl);
2096 ret = IShellItem_GetParent(shellitem, &shellitem2);
2100 ret = IShellItem_QueryInterface(shellitem2, &IID_IPersistIDList, (
void**)&persistidl);
2104 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2108 ok(
ILIsEqual(pidl_cwd, pidl_test),
"id lists are not equal\n");
2111 IPersistIDList_Release(persistidl);
2113 IShellItem_Release(shellitem2);
2116 IShellItem_Release(shellitem);
2119 ret = pSHCreateShellItem(
NULL, currentfolder, pidl_testfile, &shellitem);
2123 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2127 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2131 ok(
ILIsEqual(pidl_abstestfile, pidl_test),
"id lists are not equal\n");
2134 IPersistIDList_Release(persistidl);
2136 IShellItem_Release(shellitem);
2140 ret = pSHCreateShellItem(pidl_cwd, desktopfolder, pidl_testfile, &shellitem);
2144 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2148 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2152 ok(
ILIsEqual(pidl_abstestfile, pidl_test),
"id lists are not equal\n");
2155 IPersistIDList_Release(persistidl);
2157 IShellItem_Release(shellitem);
2160 ret = pSHCreateShellItem(
NULL, desktopfolder, pidl_testfile, &shellitem);
2164 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2168 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2172 ok(
ILIsEqual(pidl_testfile, pidl_test),
"id lists are not equal\n");
2175 IPersistIDList_Release(persistidl);
2178 IShellItem_Release(shellitem);
2181 ret = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem);
2185 ret = IShellItem_GetParent(shellitem, &shellitem2);
2188 IShellItem_Release(shellitem);
2192 if(pSHCreateItemFromParsingName)
2197 pSHCreateItemFromParsingName(
NULL,
NULL, &IID_IShellItem,
NULL);
2200 shellitem = (
void*)0xdeadbeef;
2201 ret = pSHCreateItemFromParsingName(
NULL,
NULL, &IID_IShellItem, (
void**)&shellitem);
2203 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2205 ret = pSHCreateItemFromParsingName(
testfileW,
NULL, &IID_IShellItem, (
void**)&shellitem);
2207 "SHCreateItemFromParsingName returned %x\n",
ret);
2214 ret = pSHCreateItemFromParsingName(fnbufW,
NULL, &IID_IShellItem, (
void**)&shellitem);
2215 ok(
ret ==
S_OK,
"SHCreateItemFromParsingName returned %x\n",
ret);
2219 ret = IShellItem_GetDisplayName(shellitem, SIGDN_FILESYSPATH, &tmp_fname);
2223 ok(!
lstrcmpW(fnbufW, tmp_fname),
"strings not equal\n");
2226 IShellItem_Release(shellitem);
2230 win_skip(
"No SHCreateItemFromParsingName\n");
2234 if(pSHCreateItemFromIDList)
2239 pSHCreateItemFromIDList(
NULL, &IID_IShellItem,
NULL);
2242 ret = pSHCreateItemFromIDList(
NULL, &IID_IShellItem, (
void**)&shellitem);
2245 ret = pSHCreateItemFromIDList(pidl_cwd, &IID_IShellItem, (
void**)&shellitem);
2246 ok(
ret ==
S_OK,
"SHCreateItemFromIDList returned %x\n",
ret);
2249 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2253 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2257 ok(
ILIsEqual(pidl_cwd, pidl_test),
"id lists are not equal\n");
2260 IPersistIDList_Release(persistidl);
2262 IShellItem_Release(shellitem);
2265 ret = pSHCreateItemFromIDList(pidl_testfile, &IID_IShellItem, (
void**)&shellitem);
2266 ok(
ret ==
S_OK,
"SHCreateItemFromIDList returned %x\n",
ret);
2269 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2273 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2277 ok(
ILIsEqual(pidl_testfile, pidl_test),
"id lists are not equal\n");
2280 IPersistIDList_Release(persistidl);
2282 IShellItem_Release(shellitem);
2286 win_skip(
"No SHCreateItemFromIDList\n");
2289 if(pSHCreateItemFromRelativeName && pSHGetKnownFolderPath)
2292 WCHAR *desktop_path, *displayname;
2298 ret = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem_desktop);
2299 ok(
ret ==
S_OK,
"SHCreateShellItem failed: 0x%08x.\n",
ret);
2301 shellitem = (
void*)0xdeadbeef;
2302 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
NULL,
NULL, &IID_IShellItem,
2303 (
void**)&shellitem);
2304 ok(
ret ==
E_INVALIDARG,
"Expected 0x%08x but SHCreateItemFromRelativeName return: 0x%08x.\n",
2306 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2309 shellitem = (
void*)0xdeadbeef;
2310 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
testfileW,
NULL, &IID_IShellItem,
2311 (
void**)&shellitem);
2313 "Expected 0x%08x but SHCreateItemFromRelativeName return: 0x%08x.\n",
2315 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2318 pSHGetKnownFolderPath(&FOLDERID_Desktop, 0,
NULL, &desktop_path);
2319 lstrcatW(testfile_path, desktop_path);
2326 shellitem = (
void*)0xdeadbeef;
2327 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
testfileW,
NULL, &IID_IShellItem,
2328 (
void**)&shellitem);
2329 ok(
ret ==
S_OK,
"SHCreateItemFromRelativeName failed: 0x%08x.\n",
ret);
2330 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2333 ret = IShellItem_GetDisplayName(shellitem, 0, &displayname);
2334 ok(
ret ==
S_OK,
"IShellItem_GetDisplayName failed: 0x%08x.\n",
ret);
2338 shellitem2 = (
void*)0xdeadbeef;
2339 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
testfileW,
NULL, &IID_IShellItem,
2340 (
void**)&shellitem2);
2341 ok(
ret ==
S_OK,
"SHCreateItemFromRelativeName failed: 0x%08x.\n",
ret);
2342 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2343 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2345 IShellItem_Release(shellitem2);
2347 shellitem2 = (
void*)0xdeadbeef;
2349 &pidl_desktop_testfile,
NULL);
2350 ok(
ret ==
S_OK,
"ParseDisplayName failed 0x%08x.\n",
ret);
2351 ret = pSHCreateItemFromIDList(pidl_desktop_testfile, &IID_IShellItem, (
void**)&shellitem2);
2352 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2353 ok(
ret ==
S_OK,
"IShellItem_Compare fail: 0x%08x.\n",
ret);
2355 ILFree(pidl_desktop_testfile);
2356 IShellItem_Release(shellitem2);
2358 IShellItem_Release(shellitem);
2363 IShellItem_Release(shellitem_desktop);
2366 win_skip(
"No SHCreateItemFromRelativeName or SHGetKnownFolderPath\n");
2369 if(pSHCreateItemInKnownFolder && pSHGetKnownFolderPath)
2371 WCHAR *desktop_path;
2378 shellitem = (
void*)0xdeadbeef;
2379 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
NULL, &IID_IShellItem,
2380 (
void**)&shellitem);
2381 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2382 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2385 shellitem2 = (
void*)0xdeadbeef;
2386 ret = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem2);
2390 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2391 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2393 IShellItem_Release(shellitem2);
2395 IShellItem_Release(shellitem);
2399 shellitem = (
void*)0xdeadbeef;
2400 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
testfileW, &IID_IShellItem,
2401 (
void**)&shellitem);
2403 "Expected 0x%08x but SHCreateItemInKnownFolder return: 0x%08x.\n",
2405 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2407 pSHGetKnownFolderPath(&FOLDERID_Desktop, 0,
NULL, &desktop_path);
2408 lstrcatW(testfile_path, desktop_path);
2415 shellitem = (
void*)0xdeadbeef;
2416 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
testfileW, &IID_IShellItem,
2417 (
void**)&shellitem);
2418 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2419 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2422 ret = IShellItem_GetDisplayName(shellitem, 0, &displayname);
2423 ok(
ret ==
S_OK,
"IShellItem_GetDisplayName failed: 0x%08x.\n",
ret);
2428 shellitem2 = (
void*)0xdeadbeef;
2429 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
testfileW, &IID_IShellItem,
2430 (
void**)&shellitem2);
2431 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2432 ok(shellitem2 !=
NULL,
"shellitem was %p.\n", shellitem);
2433 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2434 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2436 IShellItem_Release(shellitem2);
2438 shellitem2 = (
void*)0xdeadbeef;
2440 &pidl_desktop_testfile,
NULL);
2442 ret = pSHCreateItemFromIDList(pidl_desktop_testfile, &IID_IShellItem, (
void**)&shellitem2);
2443 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2444 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2446 ILFree(pidl_desktop_testfile);
2447 IShellItem_Release(shellitem2);
2449 IShellItem_Release(shellitem);
2452 shellitem = (
void*)0xdeadbeef;
2453 ret = pSHCreateItemInKnownFolder(&FOLDERID_Documents, 0,
NULL, &IID_IShellItem,
2454 (
void**)&shellitem);
2455 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2456 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2459 shellitem2 = (
void*)0xdeadbeef;
2460 ret = pSHCreateItemInKnownFolder(&FOLDERID_Documents, 0,
NULL, &IID_IShellItem,
2461 (
void**)&shellitem2);
2462 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2463 ok(shellitem2 !=
NULL,
"shellitem was %p.\n", shellitem);
2464 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2465 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2467 IShellItem_Release(shellitem2);
2469 IShellItem_Release(shellitem);
2475 win_skip(
"No SHCreateItemInKnownFolder or SHGetKnownFolderPath\n");
2478 ILFree(pidl_abstestfile);
2482 IShellFolder_Release(currentfolder);
2483 IShellFolder_Release(desktopfolder);
2494 SIGDN_NORMALDISPLAY, SIGDN_PARENTRELATIVEPARSING,
2495 SIGDN_DESKTOPABSOLUTEPARSING,SIGDN_PARENTRELATIVEEDITING,
2496 SIGDN_DESKTOPABSOLUTEEDITING,
2497 SIGDN_PARENTRELATIVEFORADDRESSBAR,SIGDN_PARENTRELATIVE, -1234};
2499 if(!pSHGetNameFromIDList)
2501 win_skip(
"SHGetNameFromIDList missing.\n");
2506 ok(pSHCreateShellItem !=
NULL,
"SHCreateShellItem missing.\n");
2511 pSHGetNameFromIDList(
NULL, 0,
NULL);
2514 hres = pSHGetNameFromIDList(
NULL, 0, &name_string);
2520 hres = pSHCreateShellItem(
NULL,
NULL, pidl, &shellitem);
2524 WCHAR *nameSI, *nameSH;
2534 hrSI = IShellItem_GetDisplayName(shellitem,
flags[
i], &nameSI);
2535 ok(hrSI ==
S_OK,
"Got 0x%08x\n", hrSI);
2536 hrSH = pSHGetNameFromIDList(pidl,
flags[
i], &nameSH);
2537 ok(hrSH ==
S_OK,
"Got 0x%08x\n", hrSH);
2539 ok(hrSF ==
S_OK,
"Got 0x%08x\n", hrSF);
2542 ok(!
lstrcmpW(nameSI, nameSH),
"Strings differ.\n");
2555 IShellFolder_Release(psf);
2557 hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
2558 ok(hrSI ==
S_OK,
"Got 0x%08x\n", hrSI);
2565 hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
2569 IShellItem_Release(shellitem);
2576 hres = pSHCreateShellItem(
NULL,
NULL, pidl, &shellitem);
2580 WCHAR *nameSI, *nameSH;
2590 hrSI = IShellItem_GetDisplayName(shellitem,
flags[
i], &nameSI);
2591 ok(hrSI ==
S_OK,
"Got 0x%08x\n", hrSI);
2592 hrSH = pSHGetNameFromIDList(pidl,
flags[
i], &nameSH);
2593 ok(hrSH ==
S_OK,
"Got 0x%08x\n", hrSH);
2595 ok(hrSF ==
S_OK,
"Got 0x%08x\n", hrSF);
2598 ok(!
lstrcmpW(nameSI, nameSH),
"Strings differ.\n");
2611 IShellFolder_Release(psf);
2613 hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
2621 hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
2623 "Got 0x%08x\n",
hres);
2626 IShellItem_Release(shellitem);
2638 if(!pSHGetItemFromDataObject)
2640 win_skip(
"No SHGetItemFromDataObject.\n");
2647 pSHGetItemFromDataObject(
NULL, 0, &IID_IShellItem,
NULL);
2650 hres = pSHGetItemFromDataObject(
NULL, 0, &IID_IShellItem, (
void**)&psv);
2655 hres = IShellFolder_CreateViewObject(psfdesktop,
NULL, &IID_IShellView, (
void**)&psv);
2663 enum_flags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
2664 hres = IShellFolder_EnumObjects(psfdesktop,
NULL, enum_flags, &peidl);
2682 hres = pSHGetItemFromDataObject(pdo, DOGIF_DEFAULT, &IID_IShellItem, (
void**)&psi);
2691 hres = pSHGetItemFromDataObject(pdo,
DOGIF_NO_URL, &IID_IShellItem, (
void**)&psi);
2698 IDataObject_Release(pdo);
2702 skip(
"No file(s) found - skipping single-file test.\n");
2711 hres = pSHGetItemFromDataObject(pdo, DOGIF_DEFAULT, &IID_IShellItem, (
void**)&psi);
2720 hres = pSHGetItemFromDataObject(pdo,
DOGIF_NO_URL, &IID_IShellItem, (
void**)&psi);
2726 IDataObject_Release(pdo);
2730 skip(
"zero or one file found - skipping multi-file test.\n");
2735 IEnumIDList_Release(peidl);
2738 IShellView_Release(psv);
2741 IShellFolder_Release(psfdesktop);
2753 static const WCHAR filesW[][9] = {
2754 {
'a',
'\\',
'a',0}, {
'a',
'\\',
'b',0}, {
'a',
'\\',
'c',0},
2755 {
'b',
'\\',
'a',0}, {
'b',
'\\',
'b',0}, {
'b',
'\\',
'c',0},
2756 {
'c',
'\\',
'a',0}, {
'c',
'\\',
'b',0}, {
'c',
'\\',
'c',0} };
2760 if(!pSHCreateShellItem)
2762 win_skip(
"SHCreateShellItem missing.\n");
2769 skip(
"Failed to get current directory, skipping.\n");
2789 hr = IShellFolder_BindToObject(psf_desktop, pidl_cwd,
NULL, &IID_IShellFolder, (
void**)&psf_current);
2791 IShellFolder_Release(psf_desktop);
2795 memset(&psi, 0,
sizeof(psi));
2797 for(
i = 0;
i < 9;
i++)
2806 hr = pSHCreateShellItem(
NULL,
NULL, pidl_testfile, &psi[
i]);
2814 skip(
"Failed to create all shellitems.\n");
2819 hr = IShellItem_GetParent(psi[0], &psi_a);
2822 hr = IShellItem_GetParent(psi[3], &psi_b);
2825 hr = IShellItem_GetParent(psi[6], &psi_c);
2831 skip(
"Failed to create shellitems.\n");
2838 IShellItem_Compare(psi_a,
NULL, 0,
NULL);
2839 IShellItem_Compare(psi_a, psi_b, 0,
NULL);
2840 IShellItem_Compare(psi_a,
NULL, 0, &
order);
2844 for(
i = 0;
i < 9;
i++)
2846 hr = IShellItem_Compare(psi[
i], psi[
i], SICHINT_DISPLAY, &
order);
2849 hr = IShellItem_Compare(psi[
i], psi[
i], SICHINT_CANONICAL, &
order);
2852 hr = IShellItem_Compare(psi[
i], psi[
i], SICHINT_ALLFIELDS, &
order);
2859 hr = IShellItem_Compare(psi[1], psi[0], SICHINT_DISPLAY, &
order);
2862 hr = IShellItem_Compare(psi[1], psi[2], SICHINT_DISPLAY, &
order);
2865 hr = IShellItem_Compare(psi[1], psi[1], SICHINT_DISPLAY, &
order);
2870 hr = IShellItem_Compare(psi[4], psi[1], SICHINT_DISPLAY, &
order);
2873 hr = IShellItem_Compare(psi[4], psi[7], SICHINT_DISPLAY, &
order);
2876 hr = IShellItem_Compare(psi[4], psi[4], SICHINT_DISPLAY, &
order);
2881 hr = IShellItem_Compare(psi_b, psi[0], SICHINT_DISPLAY, &
order);
2884 hr = IShellItem_Compare(psi_b, psi[2], SICHINT_DISPLAY, &
order);
2887 hr = IShellItem_Compare(psi_b, psi[1], SICHINT_DISPLAY, &
order);
2892 hr = IShellItem_Compare(psi_b, psi[6], SICHINT_DISPLAY, &
order);
2895 hr = IShellItem_Compare(psi_b, psi[8], SICHINT_DISPLAY, &
order);
2898 hr = IShellItem_Compare(psi_b, psi[7], SICHINT_DISPLAY, &
order);
2903 hr = IShellItem_Compare(psi[1], psi[0], SICHINT_CANONICAL, &
order);
2906 hr = IShellItem_Compare(psi[1], psi[2], SICHINT_CANONICAL, &
order);
2909 hr = IShellItem_Compare(psi[1], psi[1], SICHINT_CANONICAL, &
order);
2914 hr = IShellItem_Compare(psi[4], psi[1], SICHINT_CANONICAL, &
order);
2917 hr = IShellItem_Compare(psi[4], psi[7], SICHINT_CANONICAL, &
order);
2920 hr = IShellItem_Compare(psi[4], psi[4], SICHINT_CANONICAL, &
order);
2925 hr = IShellItem_Compare(psi_b, psi[0], SICHINT_CANONICAL, &
order);
2928 hr = IShellItem_Compare(psi_b, psi[2], SICHINT_CANONICAL, &
order);
2931 hr = IShellItem_Compare(psi_b, psi[1], SICHINT_CANONICAL, &
order);
2936 hr = IShellItem_Compare(psi_b, psi[6], SICHINT_CANONICAL, &
order);
2939 hr = IShellItem_Compare(psi_b, psi[8], SICHINT_CANONICAL, &
order);
2942 hr = IShellItem_Compare(psi_b, psi[7], SICHINT_CANONICAL, &
order);
2947 IShellFolder_Release(psf_current);
2962 if(psi_a) IShellItem_Release(psi_a);
2963 if(psi_b) IShellItem_Release(psi_b);
2964 if(psi_c) IShellItem_Release(psi_c);
2966 for(
i = 0;
i < 9;
i++)
2967 if(psi[
i]) IShellItem_Release(psi[
i]);
2995 This->ifaces[
i].count++;
3029 struct if_count ifaces[] =
3030 { {&IID_IPersistIDList, 0},
3031 {&IID_IPersistFolder2, 0},
3033 {&IID_IParentAndItem, 0},
3034 {&IID_IFolderView, 0},
3037 if(!pSHGetIDListFromObject)
3039 win_skip(
"SHGetIDListFromObject missing.\n");
3046 pSHGetIDListFromObject(
NULL,
NULL);
3047 pSHGetIDListFromObject((
void*)0xDEADBEEF,
NULL);
3050 hres = pSHGetIDListFromObject(
NULL, &pidl);
3055 punkimpl->
ifaces = ifaces;
3060 ok(ifaces[0].
count,
"interface not requested.\n");
3061 ok(ifaces[1].
count,
"interface not requested.\n");
3062 ok(ifaces[2].
count,
"interface not requested.\n");
3065 "interface not requested.\n");
3067 "interface not requested.\n");
3072 pidl_desktop =
NULL;
3074 ok(pidl_desktop !=
NULL,
"Failed to get desktop pidl.\n");
3079 if(pSHCreateShellItem)
3082 hres = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem);
3086 hres = pSHGetIDListFromObject((
IUnknown*)shellitem, &pidl);
3090 ok(
ILIsEqual(pidl_desktop, pidl),
"pidl not equal.\n");
3093 IShellItem_Release(shellitem);
3097 skip(
"no SHCreateShellItem.\n");
3100 hres = pSHGetIDListFromObject((
IUnknown*)psfdesktop, &pidl);
3104 ok(
ILIsEqual(pidl_desktop, pidl),
"pidl not equal.\n");
3108 hres = IShellFolder_CreateViewObject(psfdesktop,
NULL, &IID_IShellView, (
void**)&psv);
3121 ok(
ILIsEqual(pidl_desktop, pidl),
"pidl not equal.\n");
3126 enum_flags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
3127 hres = IShellFolder_EnumObjects(psfdesktop,
NULL, enum_flags, &peidl);
3144 pidl = (
void*)0xDEADBEEF;
3147 ok(pidl !=
NULL,
"pidl is NULL.\n");
3148 ok(
ILIsEqual(pidl, apidl[0]),
"pidl not equal.\n");
3151 IDataObject_Release(pdo);
3155 skip(
"No files found - skipping single-file test.\n");
3164 pidl = (
void*)0xDEADBEEF;
3167 "got 0x%08x\n",
hres);
3168 ok(pidl ==
NULL,
"pidl is not NULL.\n");
3170 IDataObject_Release(pdo);
3174 skip(
"zero or one file found - skipping multi-file test.\n");
3179 IEnumIDList_Release(peidl);
3182 IShellView_Release(psv);
3185 IShellFolder_Release(psfdesktop);
3197 struct if_count ifaces[] =
3198 { {&IID_IPersistIDList, 0},
3199 {&IID_IPersistFolder2, 0},
3201 {&IID_IParentAndItem, 0},
3202 {&IID_IFolderView, 0},
3205 if(!pSHGetItemFromObject)
3207 skip(
"No SHGetItemFromObject.\n");
3218 pSHGetItemFromObject((
IUnknown*)psfdesktop,
NULL, (
void**)&punk);
3226 punkimpl->
ifaces = ifaces;
3232 ok(ifaces[0].
count,
"interface not requested.\n");
3233 ok(ifaces[1].
count,
"interface not requested.\n");
3234 ok(ifaces[2].
count,
"interface not requested.\n");
3237 "interface not requested.\n");
3239 "interface not requested.\n");
3245 hres = pSHGetItemFromObject((
IUnknown*)psfdesktop, &IID_IShellItem, (
void**)&psi);
3250 hres = pSHGetItemFromObject((
IUnknown*)psi, &IID_IShellItem, (
void**)&psi2);
3255 ok(psi == psi2,
"Different instances (%p != %p).\n", psi, psi2);
3256 IShellItem_Release(psi2);
3258 IShellItem_Release(psi);
3261 IShellFolder_Release(psfdesktop);
3267 IShellItemArray *psia;
3272 static const WCHAR testdirW[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
3274 if(!pSHCreateShellItemArray) {
3275 skip(
"No pSHCreateShellItemArray!\n");
3284 pSHCreateShellItemArray(
NULL, pdesktopsf, 0,
NULL,
NULL);
3292 hr = pSHCreateShellItemArray(
NULL, pdesktopsf, 0,
NULL, &psia);
3295 hr = pSHCreateShellItemArray(
NULL, pdesktopsf, 1,
NULL, &psia);
3299 hr = pSHCreateShellItemArray(pidl,
NULL, 0,
NULL, &psia);
3313 hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir,
NULL, (
REFIID)&IID_IShellFolder,
3317 IShellFolder_Release(pdesktopsf);
3321 skip(
"Failed to set up environment for SHCreateShellItemArray tests.\n");
3327 hr = IShellFolder_EnumObjects(psf,
NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &peidl);
3332 UINT done, numitems,
i;
3334 for(done = 0; done < 5; done++)
3335 if(IEnumIDList_Next(peidl, 1, &apidl[done],
NULL) !=
S_OK)
3337 ok(done == 5,
"Got %d pidls\n", done);
3338 IEnumIDList_Release(peidl);
3350 IShellItemArray_GetCount(psia,
NULL);
3353 IShellItemArray_GetCount(psia, &numitems);
3354 ok(numitems == done,
"Got %d, expected %d\n", numitems, done);
3356 hr = IShellItemArray_GetItemAt(psia, numitems, &psi);
3360 for(
i = 0;
i < numitems;
i++)
3363 pidl_abs =
ILCombine(pidl_testdir, apidl[
i]);
3365 hr = IShellItemArray_GetItemAt(psia,
i, &psi);
3366 ok(
hr ==
S_OK,
"(%d) Failed with 0x%08x\n",
i,
hr);
3369 hr = pSHGetIDListFromObject((
IUnknown*)psi, &pidl);
3373 ok(
ILIsEqual(pidl_abs, pidl),
"Pidl not equal.\n");
3376 IShellItem_Release(psi);
3380 for(
i = 0;
i < done;
i++)
3382 IShellItemArray_Release(psia);
3387 if(pSHCreateShellItemArrayFromShellItem)
3394 pSHCreateShellItemArrayFromShellItem(
NULL, &IID_IShellItemArray,
NULL);
3395 pSHCreateShellItemArrayFromShellItem(
NULL, &IID_IShellItemArray, (
void**)&psia);
3396 pSHCreateShellItemArrayFromShellItem(psi, &IID_IShellItemArray,
NULL);
3399 hr = pSHCreateItemFromIDList(pidl_testdir, &IID_IShellItem, (
void**)&psi);
3403 hr = pSHCreateShellItemArrayFromShellItem(psi, &IID_IShellItemArray, (
void**)&psia);
3409 hr = IShellItemArray_GetCount(psia, &
count);
3412 hr = IShellItemArray_GetItemAt(psia, 0, &psi2);
3415 ok(psi != psi2,
"ShellItems are of the same instance.\n");
3419 hr = pSHGetIDListFromObject((
IUnknown*)psi, &pidl1);
3421 ok(pidl1 !=
NULL,
"pidl1 was null.\n");
3422 hr = pSHGetIDListFromObject((
IUnknown*)psi2, &pidl2);
3424 ok(pidl2 !=
NULL,
"pidl2 was null.\n");
3425 ok(
ILIsEqual(pidl1, pidl2),
"pidls not equal.\n");
3428 IShellItem_Release(psi2);
3430 hr = IShellItemArray_GetItemAt(psia, 1, &psi2);
3432 IShellItemArray_Release(psia);
3434 IShellItem_Release(psi);
3438 skip(
"No SHCreateShellItemArrayFromShellItem.\n");
3440 if(pSHCreateShellItemArrayFromDataObject)
3447 pSHCreateShellItemArrayFromDataObject(
NULL, &IID_IShellItemArray,
NULL);
3449 hr = pSHCreateShellItemArrayFromDataObject(
NULL, &IID_IShellItemArray, (
void**)&psia);
3452 hr = IShellFolder_CreateViewObject(psf,
NULL, &IID_IShellView, (
void**)&psv);
3460 enum_flags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
3461 hr = IShellFolder_EnumObjects(psf,
NULL, enum_flags, &peidl);
3480 hr = pSHCreateShellItemArrayFromDataObject(pdo, &IID_IShellItemArray,
3486 hr = IShellItemArray_GetCount(psia, &count_sia);
3488 ok(count_sia ==
count,
"Counts differ (%d, %d)\n",
count, count_sia);
3489 for(
i = 0;
i < count_sia;
i++)
3493 hr = IShellItemArray_GetItemAt(psia,
i, &psi);
3498 hr = pSHGetIDListFromObject((
IUnknown*)psi, &pidl);
3500 ok(pidl !=
NULL,
"pidl as NULL.\n");
3503 IShellItem_Release(psi);
3508 IShellItemArray_Release(psia);
3511 IDataObject_Release(pdo);
3517 skip(
"No files found - skipping test.\n");
3519 IEnumIDList_Release(peidl);
3521 IShellView_Release(psv);
3525 skip(
"No SHCreateShellItemArrayFromDataObject.\n");
3527 if(pSHCreateShellItemArrayFromIDLists)
3529 WCHAR test1W[] = {
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
3537 hr = pSHCreateShellItemArrayFromIDLists(0,
NULL,
NULL);
3540 psia = (
void*)0xdeadbeef;
3541 hr = pSHCreateShellItemArrayFromIDLists(0,
NULL, &psia);
3543 ok(psia ==
NULL,
"Got %p\n", psia);
3545 psia = (
void*)0xdeadbeef;
3546 hr = pSHCreateShellItemArrayFromIDLists(0, pidl_array, &psia);
3548 ok(psia ==
NULL,
"Got %p\n", psia);
3550 psia = (
void*)0xdeadbeef;
3551 pidl_array[0] =
NULL;
3552 hr = pSHCreateShellItemArrayFromIDLists(1, pidl_array, &psia);
3554 ok(psia ==
NULL,
"Got %p\n", psia);
3556 psia = (
void*)0xdeadbeef;
3557 pidl_array[0] = pidl_testdir;
3558 pidl_array[1] =
NULL;
3559 hr = pSHCreateShellItemArrayFromIDLists(2, pidl_array, &psia);
3567 hr = IShellItemArray_GetCount(psia, &
count);
3571 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
3576 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3582 IShellItem_Release(psi);
3585 hr = IShellItemArray_GetItemAt(psia, 1, &psi);
3596 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3602 IShellItem_Release(psi);
3606 IShellItemArray_Release(psia);
3611 psia = (
void*)0xdeadbeef;
3612 pidl_array[0] = pidl_testdir;
3613 hr = pSHCreateShellItemArrayFromIDLists(1, pidl_array, &psia);
3620 hr = IShellItemArray_GetCount(psia, &
count);
3624 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
3629 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3635 IShellItem_Release(psi);
3638 IShellItemArray_Release(psia);
3652 psia = (
void*)0xdeadbeef;
3653 pidl_array[0] = pidl_testdir;
3654 pidl_array[1] = pidltest1;
3655 hr = pSHCreateShellItemArrayFromIDLists(2, pidl_array, &psia);
3662 hr = IShellItemArray_GetCount(psia, &
count);
3666 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
3671 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3677 IShellItem_Release(psi);
3680 hr = IShellItemArray_GetItemAt(psia, 1, &psi);
3685 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3691 IShellItem_Release(psi);
3695 IShellItemArray_Release(psia);
3701 IShellFolder_Release(pdesktopsf);
3704 skip(
"No SHCreateShellItemArrayFromIDLists.\n");
3706 IShellFolder_Release(psf);
3718 static const WCHAR testdirW[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
3720 if(!pSHCreateShellItemArray)
3722 win_skip(
"No SHCreateShellItemArray, skipping test...\n");
3738 hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir,
NULL, (
REFIID)&IID_IShellFolder,
3743 IShellFolder_Release(pdesktopsf);
3746 hr = IShellFolder_EnumObjects(psf,
NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &peidl);
3750 IShellItemArray *psia;
3752 UINT done, numitems,
i;
3754 for(done = 0; done < 5; done++)
3755 if(IEnumIDList_Next(peidl, 1, &apidl[done],
NULL) !=
S_OK)
3757 ok(done == 5,
"Got %d pidls\n", done);
3758 IEnumIDList_Release(peidl);
3769 IShellItemArray_GetCount(psia, &numitems);
3770 ok(numitems == done,
"Got %d, expected %d\n", numitems, done);
3773 hr = IShellItemArray_EnumItems(psia, &iesi);
3775 ok(iesi !=
NULL,
"Got NULL\n");
3781 for(
i = 0;
i < 10;
i++) my_array[
i] = (
void*)0xdeadbeef;
3782 hr = IEnumShellItems_Next(iesi, 2, my_array,
NULL);
3784 for(
i = 0;
i < 2;
i++)
3786 ok(my_array[
i] == (
void*)0xdeadbeef ||
3787 broken(my_array[
i] != (
void*)0xdeadbeef && my_array[
i] !=
NULL),
3788 "Got %p (%d)\n", my_array[
i],
i);
3790 if(my_array[
i] != (
void*)0xdeadbeef)
3791 IShellItem_Release(my_array[
i]);
3793 ok(my_array[2] == (
void*)0xdeadbeef,
"Got %p\n", my_array[2]);
3795 IEnumShellItems_Reset(iesi);
3796 for(
i = 0;
i < 10;
i++) my_array[
i] = (
void*)0xdeadbeef;
3797 hr = IEnumShellItems_Next(iesi, 1, my_array,
NULL);
3799 ok(my_array[0] !=
NULL && my_array[0] != (
void*)0xdeadbeef,
"Got %p\n", my_array[0]);
3800 if(my_array[0] !=
NULL && my_array[0] != (
void*)0xdeadbeef)
3801 IShellItem_Release(my_array[0]);
3802 ok(my_array[1] == (
void*)0xdeadbeef,
"Got %p\n", my_array[1]);
3804 IEnumShellItems_Reset(iesi);
3806 for(
i = 0;
i < 10;
i++) my_array[
i] = (
void*)0xdeadbeef;
3807 hr = IEnumShellItems_Next(iesi, numitems, my_array, &fetched);
3809 ok(fetched == numitems,
"Got %d\n", fetched);
3810 for(
i = 0;
i < numitems;
i++)
3812 ok(my_array[
i] !=
NULL && my_array[
i] != (
void*)0xdeadbeef,
3813 "Got %p at %d\n", my_array[
i],
i);
3815 if(my_array[
i] !=
NULL && my_array[
i] != (
void*)0xdeadbeef)
3816 IShellItem_Release(my_array[
i]);
3818 ok(my_array[
i] == (
void*)0xdeadbeef,
"Got %p\n", my_array[
i]);
3821 IEnumShellItems_Reset(iesi);
3822 for(
i = 0;
i < numitems;
i++)
3827 hr = IShellItemArray_GetItemAt(psia,
i, &psi);
3829 hr = IEnumShellItems_Next(iesi, 1, my_array, &fetched);
3831 ok(fetched == 1,
"Got %d\n", fetched);
3833 hr = IShellItem_Compare(psi, my_array[0], 0, &
order);
3837 IShellItem_Release(psi);
3838 IShellItem_Release(my_array[0]);
3841 my_array[0] = (
void*)0xdeadbeef;
3842 hr = IEnumShellItems_Next(iesi, 1, my_array, &fetched);
3844 ok(fetched == 0,
"Got %d\n", fetched);
3845 ok(my_array[0] == (
void*)0xdeadbeef,
"Got %p\n", my_array[0]);
3848 iesi2 = (
void*)0xdeadbeef;
3849 hr = IEnumShellItems_Clone(iesi, &iesi2);
3851 ok(iesi2 ==
NULL ||
broken(iesi2 == (
void*)0xdeadbeef) ,
"Got %p\n", iesi2);
3853 IEnumShellItems_Release(iesi);
3856 IShellItemArray_Release(psia);
3859 for(
i = 0;
i < done;
i++)
3863 IShellFolder_Release(psf);
3873 if(!pSHCreateShellItem)
3875 skip(
"SHCreateShellItem missing.\n");
3883 hr = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &psi);
3901 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFObject, &IID_IShellFolder, (
void**)&punk);
3904 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFObject, &IID_IPersistFolder2, (
void**)&ppf2);
3909 hr = IPersistFolder2_GetCurFolder(ppf2, &pidl_tmp);
3913 ok(
ILIsEqual(pidl_desktop, pidl_tmp),
"Pidl not equal (%p, %p)\n", pidl_desktop, pidl_tmp);
3916 IPersistFolder2_Release(ppf2);
3923 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFUIObject, &IID_IContextMenu, (
void**)&punk);
3935 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFViewObject, &IID_IShellView, (
void**)&punk);
3938 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFViewObject, &IID_IShellFolderView, (
void**)&punk);
3943 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Storage, &IID_IStream, (
void**)&punk);
3946 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Storage, &
IID_IUnknown, (
void**)&punk);
3951 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Stream, &IID_IStream, (
void**)&punk);
3954 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Stream, &
IID_IUnknown, (
void**)&punk);
3959 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_StorageEnum, &IID_IEnumShellItems, (
void**)&punk);
3966 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Transfer, &IID_ITransferSource, (
void**)&punk);
3970 IUnknown_Release(punk);
3972 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Transfer, &IID_ITransferDestination, (
void**)&punk);
3976 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Transfer, &
IID_IUnknown, (
void**)&punk);
3982 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_EnumItems, &IID_IEnumShellItems, (
void**)&punk);
3987 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Filter, &
IID_IUnknown, (
void**)&punk);
3992 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_LinkTargetItem, &IID_IShellItem, (
void**)&punk);
3995 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_LinkTargetItem, &
IID_IUnknown, (
void**)&punk);
4000 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_PropertyStore, &IID_IPropertyStore, (
void**)&punk);
4003 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_PropertyStore, &IID_IPropertyStoreFactory, (
void**)&punk);
4008 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_ThumbnailHandler, &
IID_IUnknown, (
void**)&punk);
4013 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_AssociationArray, &IID_IQueryAssociations, (
void**)&punk);
4018 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_EnumAssocHandlers, &
IID_IUnknown, (
void**)&punk);
4023 IShellItem_Release(psi);
4026 skip(
"Failed to create ShellItem.\n");
4040 static const WCHAR testdir1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
4041 static const WCHAR testfile1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
4043 if(!pSHCreateShellItem)
4045 skip(
"SHCreateShellItem missing.\n");
4053 hr = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &psi);
4059 skip(
"Skipping tests.\n");
4066 IShellItem_GetAttributes(psi, 0,
NULL);
4071 hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER, &sfgao);
4073 ok(sfgao == SFGAO_FOLDER ||
broken(sfgao == 0) ,
"Got 0x%08x\n", sfgao);
4075 IShellItem_Release(psi);
4088 hr = pSHCreateShellItem(
NULL,
NULL, pidl, &psi_folder1);
4089 ok(
hr ==
S_OK,
"Got 0x%08x\n", sfgao);
4096 hr = pSHCreateShellItem(
NULL,
NULL, pidl, &psi_file1);
4097 ok(
hr ==
S_OK,
"Got 0x%08x\n", sfgao);
4100 IShellFolder_Release(pdesktopsf);
4103 hr = IShellItem_GetAttributes(psi_folder1, 0, &sfgao);
4105 ok(sfgao == 0,
"Got 0x%08x\n", sfgao);
4108 hr = IShellItem_GetAttributes(psi_folder1, SFGAO_FOLDER, &sfgao);
4110 ok(sfgao == SFGAO_FOLDER,
"Got 0x%08x\n", sfgao);
4113 hr = IShellItem_GetAttributes(psi_file1, SFGAO_FOLDER, &sfgao);
4115 ok(sfgao == 0,
"Got 0x%08x\n", sfgao);
4117 IShellItem_Release(psi_folder1);
4118 IShellItem_Release(psi_file1);
4125 IShellItemArray *psia_files, *psia_folders1, *psia_folders2, *psia_all;
4133 static const WCHAR testdir1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
4134 static const WCHAR testdir2W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'2',0};
4135 static const WCHAR testdir3W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'3',0};
4136 static const WCHAR testfile1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
4137 static const WCHAR testfile2W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'2',
'.',
't',
'x',
't',0};
4138 static const WCHAR *testfilesW[5] = { testdir1W, testdir2W, testdir3W, testfile1W, testfile2W };
4140 if(!pSHCreateShellItemArrayFromShellItem)
4142 win_skip(
"No SHCreateShellItemArrayFromShellItem, skipping test...\n");
4154 for(
i = 0;
i < 5;
i++)
4161 IShellFolder_Release(pdesktopsf);
4163 hr = pSHCreateShellItemArrayFromIDLists(2, pidl_array, &psia_folders1);
4165 hr = pSHCreateShellItemArrayFromIDLists(2, &pidl_array[1], &psia_folders2);
4167 hr = pSHCreateShellItemArrayFromIDLists(2, &pidl_array[3], &psia_files);
4169 hr = pSHCreateShellItemArrayFromIDLists(4, &pidl_array[1], &psia_all);
4172 for(
i = 0;
i < 5;
i++)
4177 hr = IShellItemArray_GetAttributes(psia_folders1, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4181 hr = IShellItemArray_GetAttributes(psia_folders1, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4187 hr = IShellItemArray_GetAttributes(psia_folders2, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4189 ok(
attr == SFGAO_FOLDER,
"Got 0x%08x\n",
attr);
4191 hr = IShellItemArray_GetAttributes(psia_files, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4195 hr = IShellItemArray_GetAttributes(psia_all, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4199 hr = IShellItemArray_GetAttributes(psia_folders2, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4201 ok(
attr == SFGAO_FOLDER,
"Got 0x%08x\n",
attr);
4203 hr = IShellItemArray_GetAttributes(psia_files, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4207 hr = IShellItemArray_GetAttributes(psia_all, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4209 ok(
attr == SFGAO_FOLDER,
"Got 0x%08x\n",
attr);
4211 IShellItemArray_Release(psia_folders1);
4212 IShellItemArray_Release(psia_folders2);
4213 IShellItemArray_Release(psia_files);
4214 IShellItemArray_Release(psia_all);
4222 static WCHAR cdrom_drive[] = {
'A',
':',
'\\',0};
4225 cdrom_drive[0] =
'A';
4235 drives = drives >> 1;
4263 ok(pidl1 == 0,
"expected null ptr, got %p\n", pidl1);
4274 ok(
ret ==
TRUE,
"expected equal idls\n");
4287 ok(
ret ==
TRUE,
"expected equal idls\n");
4307 ok(
ret ==
FALSE,
"expected different idls\n");
4312 IShellFolder_Release(desktop);
4316 skip(
"No empty cdrom drive found, skipping test\n");
4336 hr = IShellFolder_QueryInterface(desktop, &
IID_IPersist, (
void**)&persist);
4344 IPersist_GetClassID(persist,
NULL);
4347 hr = IPersist_GetClassID(persist, &
clsid);
4350 IPersist_Release(persist);
4353 hr = IShellFolder_QueryInterface(desktop, &IID_IPersistFolder2, (
void**)&ppf2);
4359 hr = IShellFolder_QueryInterface(desktop, &IID_IPersistFolder, (
void**)&ppf);
4360 ok(
hr ==
S_OK,
"IID_IPersistFolder2 without IID_IPersistFolder.\n");
4362 IPersistFolder_Release(ppf);
4365 hr = IPersistFolder2_Initialize(ppf2,
NULL);
4370 hr = IPersistFolder2_GetCurFolder(ppf2, &pidl);
4372 ok(pidl !=
NULL,
"pidl was NULL.\n");
4375 IPersistFolder2_Release(ppf2);
4378 IShellFolder_Release(desktop);
4386 hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (
void **)&unk);
4388 ok(
hr ==
S_OK,
"Failed to get IShellExtInit, hr %#x.\n",
hr);
4390 IUnknown_Release(unk);
4394 ok(
hr ==
S_OK,
"Failed to get IShellExtInit, hr %#x.\n",
hr);
4396 IUnknown_Release(unk);
4402 const int id_upper_limit = 32767;
4403 const int baseItem = 0x40;
4404 INT max_id, max_id_check;
4410 hr = IContextMenu_QueryContextMenu(menu,
hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL);
4414 ok(max_id <= id_upper_limit,
"Got %d\n", max_id);
4423 char buf[255], buf2[255];
4428 mii.
cch =
sizeof(buf2);
4434 "Got non-separator ID out of range: %d (type: %x)\n", mii.
wID, mii.
fType);
4437 max_id_check = (mii.
wID > max_id_check) ? mii.
wID : max_id_check;
4438 hr = IContextMenu_GetCommandString(menu, mii.
wID - baseItem, GCS_VERBA, 0,
buf,
sizeof(
buf));
4444 trace(
"for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.
wID - baseItem, mii.
dwTypeData);
4447 max_id_check -= baseItem;
4448 ok((max_id_check == max_id) ||
4449 (max_id_check == max_id-1) ||
4450 (max_id_check == max_id-2) ||
4451 (max_id_check == max_id-3),
4452 "Not equal (or near equal), got %d and %d\n", max_id_check, max_id);
4456 CMINVOKECOMMANDINFO cmi;
4458 memset(&cmi, 0,
sizeof(CMINVOKECOMMANDINFO));
4459 cmi.cbSize =
sizeof(CMINVOKECOMMANDINFO);
4463 hr = IContextMenu_InvokeCommand(menu, &cmi);
4467 cmi.lpVerb =
"foobar_wine_test";
4468 hr = IContextMenu_InvokeCommand(menu, &cmi);
4472 "Unexpected hr %#x.\n",
hr);
4486 {
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
4493 skip(
"GetCurrentDirectoryW returned an empty string.\n");
4505 ok(
hr ==
S_OK,
"Failed to bind to folder, hr %#x.\n",
hr);
4508 hr = IShellFolder_GetUIObjectOf(psf,
NULL, 1, &pidl_child, &IID_IContextMenu,
NULL, (
void **)&pcm);
4509 ok(
hr ==
S_OK,
"GetUIObjectOf() failed, hr %#x.\n",
hr);
4511 IContextMenu_Release(pcm);
4514 hr = IShellFolder_GetUIObjectOf(psf_desktop,
NULL, 0,
NULL, &IID_IContextMenu,
NULL, (
void **)&pcm);
4515 ok(
hr ==
S_OK,
"GetUIObjectOf() failed, hr %#x.\n",
hr);
4517 IContextMenu_Release(pcm);
4519 IShellFolder_Release(psf);
4522 IShellFolder_Release(psf_desktop);
4526#define verify_pidl(i,p) r_verify_pidl(__LINE__, i, p)
4541 ok_(__FILE__,
l)(
hr ==
S_OK,
"SHBindToParent failed: 0x%08x\n",
hr);
4546 ok_(__FILE__,
l)(
hr ==
S_OK,
"GetDisplayNameOf failed: 0x%08x\n",
hr);
4548 IShellFolder_Release(
parent);
4553 "Got unexpected string type: %d\n",
filename.uType);
4556 "didn't get expected path (%s), instead: %s\n",
4561 "didn't get expected path (%s), instead: %s\n",
4565 IShellFolder_Release(
parent);
4567 ok_(__FILE__,
l)(pidl ==
NULL,
"Expected PIDL to be NULL\n");
4572 const WCHAR adirW[] = {
'C',
':',
'\\',
's',
'i',
'd',
'l',
'f',
'p',
'd',
'i',
'r',0};
4573 const CHAR adirA[] =
"C:\\sidlfpdir";
4624 ok(0,
"SetFindData called\n");
4646 *
pfd->cFileName =
'a';
4647 *
pfd->cAlternateFileName =
'a';
4654 static const WCHAR adirW[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',0};
4678 WCHAR wFileSystemBindData[] =
4679 {
'F',
'i',
'l',
'e',
' ',
'S',
'y',
's',
't',
'e',
'm',
' ',
'B',
'i',
'n',
'd',
' ',
'D',
'a',
't',
'a',0};
4680 WCHAR adirW[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',0};
4681 WCHAR afileW[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',
'\\',
'f',
'i',
'l',
'e',
'.',
't',
'x',
't',0};
4682 WCHAR afile2W[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',
'\\',
's',
'\\',
'f',
'i',
'l',
'e',
'.',
't',
'x',
't',0};
4694 win_skip(
"Most W-calls are not implemented\n");
4701 win_skip(
"Failed to get IShellFolder, can't run tests\n");
4707 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4709 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4711 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4718 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4720 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4722 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4725 hres = IBindCtx_RegisterObjectParam(pbc, wFileSystemBindData, (
IUnknown*)&
fsbd);
4848 IBindCtx_Release(pbc);
4849 IShellFolder_Release(psf);
4853#define WM_USER_NOTIFY (WM_APP+1)
4863 {
"MKDIR", 1, 0,
SHCNE_MKDIR,
"C:\\shell32_cn_test\\test",
""},
4864 {
"CREATE", 1, 0,
SHCNE_CREATE,
"C:\\shell32_cn_test\\test\\file.txt",
""},
4865 {
"RMDIR", 1, 0,
SHCNE_RMDIR,
"C:\\shell32_cn_test\\test",
""},
4884 ok(hLock !=
NULL,
"SHChangeNotification_Lock returned NULL\n");
4888 "%s: expected notification type %x, got: %x\n",
4904 ok(0,
"Didn't expect a WM_USER_NOTIFY message (event: %x)\n",
signal);
4916 cls.
cbSize =
sizeof(cls);
4932 while (
exp_data->missing_events && (
c++ < 10)){
4949 BOOL br, has_unicode;
4951 const CHAR root_dirA[] =
"C:\\shell32_cn_test";
4952 const WCHAR root_dirW[] = {
'C',
':',
'\\',
's',
'h',
'e',
'l',
'l',
'3',
'2',
'_',
'c',
'n',
'_',
't',
'e',
's',
't',0};
4954 trace(
"SHChangeNotify tests (%x)\n", test_new_delivery);
4960 if(!test_new_delivery)
4966 ok(wnd !=
NULL,
"Failed to make a window\n");
4976 ok(
hr ==
S_OK,
"SHILCreateFromPath failed: 0x%08x\n",
hr);
4981 ok(notifyID != 0,
"Failed to register a window for change notifications\n");
4992 ok(
exp_data->missing_events == 0,
"%s: Expected wndproc to be called\n",
exp_data->id);
5003 ok(
exp_data->missing_events == 0,
"%s: Expected wndproc to be called\n",
exp_data->id);
5031 {
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
5032 if(!pSHCreateDefaultContextMenu)
5034 win_skip(
"SHCreateDefaultContextMenu missing.\n");
5041 skip(
"GetCurrentDirectoryW returned an empty string.\n");
5056 IShellFolder_QueryInterface(
folder,&IID_IPersistFolder2,(
void**)&persist);
5057 IPersistFolder2_GetCurFolder(persist,&pidlFolder);
5058 IPersistFolder2_Release(persist);
5071 hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(
void**)&cmenu);
5074 IContextMenu_Release(cmenu);
5077 hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(
void**)&cmenu);
5080 IContextMenu_Release(cmenu);
5088 hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(
void**)&cmenu);
5091 IContextMenu_Release(cmenu);
5095 IShellFolder_Release(
folder);
5097 IShellFolder_Release(desktop);
5110 DWORD cf_shellidlist;
5115 hres = IShellFolder_EnumObjects(desktop,
NULL,
5116 SHCONTF_NONFOLDERS|SHCONTF_FOLDERS|SHCONTF_INCLUDEHIDDEN, &peidl);
5119 if(IEnumIDList_Next(peidl, 1, &apidl,
NULL) !=
S_OK) {
5120 skip(
"no files on desktop - skipping GetDataObject tests\n");
5121 IEnumIDList_Release(peidl);
5122 IShellFolder_Release(desktop);
5125 IEnumIDList_Release(peidl);
5131 IShellFolder_Release(desktop);
5134 fmt.cfFormat = cf_shellidlist;
5136 fmt.dwAspect = DVASPECT_CONTENT;
5138 fmt.tymed = TYMED_HGLOBAL;
5139 hres = IDataObject_QueryGetData(data_obj, &
fmt);
5142 fmt.tymed = TYMED_HGLOBAL | TYMED_ISTREAM;
5143 hres = IDataObject_QueryGetData(data_obj, &
fmt);
5146 fmt.tymed = TYMED_ISTREAM;
5147 hres = IDataObject_QueryGetData(data_obj, &
fmt);
5150 fmt.tymed = TYMED_HGLOBAL | TYMED_ISTREAM;
5151 hres = IDataObject_GetData(data_obj, &
fmt, &medium);
5153 ok(medium.tymed == TYMED_HGLOBAL,
"medium.tymed = %x\n", medium.tymed);
5156 IDataObject_Release(data_obj);
5161 static const CLSID *folders[] =
5165 &CLSID_ControlPanel,
5166 &CLSID_NetworkPlaces,
5169 &CLSID_ShellDesktop,
5194 ok(
sort == 123 &&
display == 123,
"Unexpected default column.\n");
5199 ok(
display == 123,
"Unexpected default column.\n");
5204 ok(
sort == 123,
"Unexpected default column.\n");
5206 IShellFolder2_Release(
folder);
5214 static const CLSID *folders[] =
5218 &CLSID_ControlPanel,
5219 &CLSID_NetworkPlaces,
5222 &CLSID_ShellDesktop,
5249 hr = IShellFolder2_GetDefaultSearchGUID(
folder, &
guid);
5254 IShellFolder2_Release(
folder);
5267 ok(
hr ==
S_OK,
"Failed to get desktop folder, hr %#x.\n",
hr);
5273 hwnd =
CreateWindowA(
"EDIT",
NULL,
WS_VISIBLE, 0, 0, 100, 30,
NULL,
NULL,
NULL,
NULL);
5274 ok(
hwnd !=
NULL,
"Failed to create Edit control.\n");
5278 ok(
hr ==
S_OK,
"Failed to set input limits, hr %#x.\n",
hr);
5282 ok(
hr ==
S_OK,
"Failed to set input limits, hr %#x.\n",
hr);
5285 IShellFolder_Release(desktop);
5291 SHFOLDERCUSTOMSETTINGS fcs;
5295 static const WCHAR somedirW[] = {
's',
'o',
'm',
'e',
'_',
'd',
'i',
'r',0};
5296 static const WCHAR iconW[] = {
'\\',
's',
'o',
'm',
'e',
'_',
'i',
'c',
'o',
'n',
'.',
'i',
'c',
'o',0};
5297 static const WCHAR desktop_iniW[] = {
'\\',
'D',
'e',
's',
'k',
't',
'o',
'p',
'.',
'i',
'n',
'i',0};
5299 if (!pSHGetSetFolderCustomSettings)
5301 win_skip(
"SHGetSetFolderCustomSetting not exported by name (only by ordinal) for version XP/win2003\n");
5312 memset(&fcs, 0,
sizeof(fcs));
5313 fcs.dwSize =
sizeof(fcs);
5315 fcs.pszIconFile = iconpathW;
5318 ok(
hr ==
S_OK,
"Expected S_OK, got %#x\n",
hr);
5320 memset(&fcs, 0,
sizeof(fcs));
5321 fcs.dwSize =
sizeof(fcs);
5324 fcs.pszIconFile = bufferW;
5327 hr = pSHGetSetFolderCustomSettings(&fcs, pathW,
FCS_READ);
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
EXTERN_C HRESULT WINAPI SHCreateShellItemArrayFromDataObject(_In_ IDataObject *pdo, _In_ REFIID riid, _Out_ void **ppv)
EXTERN_C HRESULT WINAPI SHCreateShellItem(PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psfParent, PCUITEMID_CHILD pidl, IShellItem **ppsi)
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static const WCHAR nameW[]
static WCHAR wszFileName[MAX_PATH]
#define RegCloseKey(hKey)
EXTERN_C HANDLE WINAPI SHChangeNotification_Lock(HANDLE hTicket, DWORD dwOwnerPID, LPITEMIDLIST **lppidls, LPLONG lpwEventId)
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
EXTERN_C BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock)
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
static const WCHAR backslashW[]
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
#define ERROR_CALL_NOT_IMPLEMENTED
#define GetCurrentDirectoryW(x, y)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define GetCurrentProcess()
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
static void cleanup(void)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetSystemWow64DirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
const GUID CLSID_UnixDosFolder
void WINAPI SHFree(LPVOID pv)
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
static const BOOL is_win64
HRESULT WINAPI SHGetFolderPathAndSubDirA(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCSTR pszSubPath, LPSTR pszPath)
BOOL WINAPI SHGetSpecialFolderPathA(HWND hwndOwner, LPSTR szPath, int nFolder, BOOL bCreate)
HRESULT WINAPI SHGetFolderPathA(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath)
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
#define IShellFolder_ParseDisplayName
#define IShellFolder_CompareIDs
#define IShellFolder_GetDisplayNameOf
static const WCHAR iconW[]
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLdouble GLdouble GLint GLint order
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
#define FILE_FLAG_WRITE_THROUGH
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define sprintf(buf, format,...)
static PEXPLICIT_ACCESSW *static HMODULE hmod
static void test_contextmenu(void)
const IID IID_IObjectWithSite
static const char * strw(LPCWSTR x)
#define todo_wine_if(is_todo)
static const WCHAR testfileW[]
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
static const WCHAR path1[]
static const WCHAR path2[]
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_DIRECTORY
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
BSTR WINAPI SysAllocString(LPCOLESTR str)
const GUID IID_IPropertyBag
const GUID IID_IDataObject
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
void WINAPI ILFree(LPITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName)
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
HRESULT WINAPI ILSaveToStream(IStream *pStream, LPCITEMIDLIST pPidl)
LPITEMIDLIST WINAPI ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID item, BOOL bEnd)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv)
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
PUIDLIST_RELATIVE WINAPI ILFindChild(PIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2)
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path)
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
const GUID IID_IPersistPropertyBag
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2)
DWORD WINAPI GetVersion()
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define CSIDL_FLAG_CREATE
HRESULT WINAPI SHLimitInputEdit(HWND hWnd, IShellFolder *psf)
static ULONG WINAPI fsbd_Release(IFileSystemBindData *fsbd)
struct ChNotifyTest chnotify_tests[]
static void test_GetUIObject(void)
static void Cleanup(void)
static void test_SHLimitInputEdit(void)
static IBindCtx void **static PCWSTR
static IBindCtx void **static IBindCtx void **static void **static IShellFolder LPCITEMIDLIST
static WCHAR * get_empty_cddrive(void)
static void test_ShellItemArrayEnumItems(void)
static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
static void test_SHGetFolderPathA(void)
static HRESULT WINAPI unk_fnQueryInterface(IUnknown *iunk, REFIID riid, void **punk)
static struct @1740 parse_tests[]
static void test_SHCreateShellItemArray(void)
static void CreateTestFile(const CHAR *name)
static void test_ShellItemCompare(void)
static void test_ParseDisplayName(void)
static void test_SHCreateShellItem(void)
static HRESULT WINAPI InitPropertyBag_IPropertyBag_Write(IPropertyBag *iface, LPCOLESTR pszPropName, VARIANT *pVar)
static struct IPropertyBag InitPropertyBag
static void test_SHGetItemFromObject(void)
static void test_LocalizedNames(void)
static void init_function_pointers(void)
static ULONG WINAPI InitPropertyBag_IPropertyBag_Release(IPropertyBag *iface)
static ULONG WINAPI unk_fnAddRef(IUnknown *iunk)
#define verify_pidl(i, p)
static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPCOLESTR pszPropName, VARIANT *pVar, IErrorLog *pErrorLog)
static void test_desktop_IPersist(void)
static void register_testwindow_class(void)
static HRESULT WINAPI fsbd_GetFindData_nul(IFileSystemBindData *fsbd, WIN32_FIND_DATAW *pfd)
static void test_GetDefaultColumn(void)
static LPWSTR myPathAddBackslashW(LPWSTR lpszPath)
static REFIID void ** ppv
static void do_events(void)
static void test_SHGetItemFromDataObject(void)
static IBindCtx void **static IBindCtx void **static void **static IShellFolder IShellItem **static IShellFolder LPCITEMIDLIST IShellItemArray **static PCIDLIST_ABSOLUTE IShellItemArray **static void **static void **static HANDLE
static void test_SHParseDisplayName(void)
static int strcmp_wa(LPCWSTR strw, const char *stra)
static void test_ShellItemArrayGetAttributes(void)
static WCHAR * make_wstr(const char *str)
static IBindCtx void **static IBindCtx void **static void **static IShellFolder IShellItem **static IShellFolder LPCITEMIDLIST IShellItemArray **static PCIDLIST_ABSOLUTE IShellItemArray **static void **static void **static PWSTR *static SIGDN
static void test_ITEMIDLIST_format(void)
static HRESULT WINAPI InitPropertyBag_IPropertyBag_QueryInterface(IPropertyBag *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI fsbd_GetFindData_valid(IFileSystemBindData *fsbd, WIN32_FIND_DATAW *pfd)
static void test_SHCreateDefaultContextMenu(void)
static void test_contextmenu_qi(IContextMenu *menu, BOOL todo)
static IBindCtx void **static IBindCtx void **static DWORD
static void test_SHGetPathFromIDList(void)
static IBindCtx void **static IBindCtx void **static void **static IShellFolder IShellItem **static IShellFolder LPCITEMIDLIST IShellItemArray **static PCIDLIST_ABSOLUTE IShellItemArray **static void **static void **static PWSTR *static PWSTR *static DATAOBJ_GET_ITEM_FLAGS
static const CHAR testwindow_class[]
static ULONG WINAPI unk_fnRelease(IUnknown *iunk)
static IFileSystemBindData fsbd
static ULONG WINAPI fsbd_AddRef(IFileSystemBindData *fsbd)
static HRESULT WINAPI fsbd_SetFindData(IFileSystemBindData *fsbd, const WIN32_FIND_DATAW *pfd)
static IBindCtx void **static IBindCtx void **static void **static IShellFolder IShellItem **static IShellFolder LPCITEMIDLIST IShellItemArray **static PCIDLIST_ABSOLUTE IShellItemArray **static void **static void **static PWSTR *static PWSTR *static void **static PIDLIST_ABSOLUTE *static void **static PBOOL
static void test_GetAttributesOf(void)
static void test_EnumObjects_and_CompareIDs(void)
static void test_SHGetFolderPathAndSubDirA(void)
static void test_SHChangeNotify(BOOL test_new_delivery)
static void test_FolderShortcut(void)
static void test_ParseDisplayNamePBC(void)
static void test_SHGetIDListFromObject(void)
static HRESULT WINAPI fsbd_GetFindData_invalid(IFileSystemBindData *fsbd, WIN32_FIND_DATAW *pfd)
static void test_BindToObject(void)
static void CreateFilesFolders(void)
static void test_GetDisplayName(void)
static void **static WCHAR GPFIDL_FLAGS
static void test_ShellItemBindToHandler(void)
BOOL test_new_delivery_flag
static void test_SHSimpleIDListFromPath(void)
static const IUnknownVtbl vt_IUnknown
static HRESULT WINAPI fsbd_GetFindData_fail(IFileSystemBindData *fsbd, WIN32_FIND_DATAW *pfd)
static void test_SHGetNameFromIDList(void)
static void test_ShellItemGetAttributes(void)
static IUnknownImpl * impl_from_IUnknown(IUnknown *iface)
static void r_verify_pidl(unsigned l, LPCITEMIDLIST pidl, const WCHAR *path)
static void test_CallForAttributes(void)
static HRESULT WINAPI fsbd_GetFindData_junk(IFileSystemBindData *fsbd, WIN32_FIND_DATAW *pfd)
static HRESULT WINAPI fsbd_QueryInterface(IFileSystemBindData *fsbd, REFIID riid, void **ppv)
static void test_DataObject(void)
static const IPropertyBagVtbl InitPropertyBag_IPropertyBagVtbl
static void test_SHGetSetFolderCustomSettings(void)
static void test_GetDefaultSearchGUID(void)
static IFileSystemBindDataVtbl fsbdVtbl
static ULONG WINAPI InitPropertyBag_IPropertyBag_AddRef(IPropertyBag *iface)
static IBindCtx void **static IBindCtx void **static void **static IShellFolder IShellItem **static IShellFolder UINT
static void test_EnumObjects(IShellFolder *iFolder)
struct ChNotifyTest * exp_data
#define CSIDL_PROGRAM_FILES
HRESULT WINAPI SHILCreateFromPath(_In_ PCWSTR, _Outptr_ PIDLIST_ABSOLUTE *, _Inout_opt_ DWORD *)
#define CSIDL_DESKTOPDIRECTORY
#define CSIDL_FLAG_DONT_VERIFY
#define SHCNRF_NewDelivery
#define SHCNRF_ShellLevel
#define CSIDL_LOCAL_APPDATA
#define CSIDL_PROGRAM_FILES_COMMONX86
#define CSIDL_PROGRAM_FILES_COMMON
#define CSIDL_PROGRAM_FILESX86
PIDLIST_ABSOLUTE WINAPI SHSimpleIDListFromPath(PCWSTR)
static const WCHAR CFSTR_SHELLIDLISTW[]
HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv)
HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv)
HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl, PCIDLIST_ABSOLUTE_ARRAY pidl_array, IShellItemArray **psia)
HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray)
HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *psi, REFIID riid, void **ppv)
HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
const ITEMIDLIST_ABSOLUTE * PCIDLIST_ABSOLUTE
KNOWNFOLDERID * REFKNOWNFOLDERID
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
static PIXELFORMATDESCRIPTOR pfd
struct IUnknownImpl::if_count * ifaces
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define CONTAINING_RECORD(address, type, field)
static const WCHAR wszFile[]
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetLogicalDrives(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define REGDB_E_CLASSNOTREG
#define ERROR_PATH_NOT_FOUND
#define ERROR_NO_ASSOCIATION
#define ERROR_FILENAME_EXCED_RANGE
#define HRESULT_FROM_WIN32(x)
static const char appdata[]
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
struct tagMENUITEMINFOA MENUITEMINFOA
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI GetMenuItemInfoA(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOA)
BOOL WINAPI DestroyWindow(_In_ HWND)