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);
649 LPSHELLFOLDER psfDesktop, psfPersonal;
654 static const CHAR szFileName[] =
"winetest.foo";
655 static const WCHAR wszFileName[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'f',
'o',
'o',0 };
656 static const WCHAR wszDirName[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',0 };
659 WCHAR wszAbsoluteFilename[] = {
'C',
':',
'\\',
'w',
'i',
'n',
'e',
't',
'e',
's',
't', 0 };
681 ok(0,
"unable to create the '%s' directory\n", szTestDir);
695 ok(
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
701 ok(
hr ==
S_OK,
"Desktop->ParseDisplayName failed! hr = %08x\n",
hr);
703 IShellFolder_Release(psfDesktop);
708 ok(pidlLast->mkid.cb >= 76,
"Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb);
709 if (pidlLast->mkid.cb >= 28) {
711 "Filename should be stored as ansi-string at this position!\n");
714 if (pidlLast->mkid.cb >= 76) {
719 "Filename should be stored as wchar-string at this position!\n");
729 IUnknown_Release(psfFile);
733 hr =
SHBindToParent(pidlTestFile, &IID_IShellFolder, (
void **)&psfPersonal, &pidlLast);
734 ok(
hr ==
S_OK,
"SHBindToParent failed! hr = %08x\n",
hr);
737 hr = IShellFolder_SetNameOf(psfPersonal,
NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
738 ok (
hr ==
S_OK,
"SetNameOf failed! hr = %08x\n",
hr);
741 "pidl returned from SetNameOf should be simple!\n");
745 hr = IShellFolder_SetNameOf(psfPersonal,
NULL, pidlNew, wszAbsoluteFilename, SHGDN_FORPARSING,
NULL);
751 ok (
hr ==
S_OK,
"SetNameOf failed! hr = %08x\n",
hr);
754 IShellFolder_Release(psfPersonal);
763 ok (!
lstrcmpiW(wszTestFile, wszTestFile2),
"SHGetPathFromIDListW returns incorrect path!\n");
768 "SHBindToParent(NULL) should fail! hr = %08x\n",
hr);
771 hr =
SHBindToParent(pidlEmpty, &IID_IShellFolder, (
void **)&psfPersonal, &pidlLast);
772 ok (
hr ==
S_OK,
"SHBindToParent(empty PIDL) should succeed! hr = %08x\n",
hr);
773 ok (pidlLast == pidlEmpty,
"The last element of an empty PIDL should be the PIDL itself!\n");
775 IShellFolder_Release(psfPersonal);
778 hr =
SHBindToParent(pidlTestFile, &IID_IShellFolder, (
void **)&psfPersonal, &pidlLast);
779 ok (
hr ==
S_OK,
"SHBindToParent failed! hr = %08x\n",
hr);
781 IShellFolder_Release(psfDesktop);
788 "SHBindToParent doesn't return the last id of the pidl param!\n");
791 ok (
hr ==
S_OK,
"Personal->GetDisplayNameOf failed! hr = %08x\n",
hr);
793 IShellFolder_Release(psfDesktop);
794 IShellFolder_Release(psfPersonal);
799 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
800 ok (!
lstrcmpiW(wszTestFile, wszTestFile2),
"GetDisplayNameOf returns incorrect path!\n");
803 IShellFolder_Release(psfDesktop);
804 IShellFolder_Release(psfPersonal);
814 LPSHELLFOLDER psfDesktop;
816 DWORD dwAttributes, dwCallForAttributes, dwOrigAttributes, dwOrigCallForAttributes;
817 static const WCHAR wszAttributes[] = {
'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
's',0 };
818 static const WCHAR wszCallForAttributes[] = {
819 'C',
'a',
'l',
'l',
'F',
'o',
'r',
'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
's',0 };
820 static const WCHAR wszMyDocumentsKey[] = {
821 'C',
'L',
'S',
'I',
'D',
'\\',
'{',
'4',
'5',
'0',
'D',
'8',
'F',
'B',
'A',
'-',
'A',
'D',
'2',
'5',
'-',
822 '1',
'1',
'D',
'0',
'-',
'9',
'8',
'A',
'8',
'-',
'0',
'8',
'0',
'0',
'3',
'6',
'1',
'B',
'1',
'1',
'0',
'3',
'}',
823 '\\',
'S',
'h',
'e',
'l',
'l',
'F',
'o',
'l',
'd',
'e',
'r',0 };
824 WCHAR wszMyDocuments[] = {
825 ':',
':',
'{',
'4',
'5',
'0',
'D',
'8',
'F',
'B',
'A',
'-',
'A',
'D',
'2',
'5',
'-',
'1',
'1',
'D',
'0',
'-',
826 '9',
'8',
'A',
'8',
'-',
'0',
'8',
'0',
'0',
'3',
'6',
'1',
'B',
'1',
'1',
'0',
'3',
'}',0 };
838 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
842 &pidlMyDocuments,
NULL);
844 "Desktop's ParseDisplayName failed to parse MyDocuments's CLSID! hr = %08x\n",
hr);
846 IShellFolder_Release(psfDesktop);
851 hr = IShellFolder_GetAttributesOf(psfDesktop, 1,
853 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(MyDocuments) failed! hr = %08x\n",
hr);
856 ok (
dwAttributes & SFGAO_FILESYSTEM,
"SFGAO_FILESYSTEM attribute is not set for MyDocuments!\n");
857 ok (!(
dwAttributes & SFGAO_ISSLOW),
"SFGAO_ISSLOW attribute is set for MyDocuments!\n");
858 ok (!(
dwAttributes & SFGAO_GHOSTED),
"SFGAO_GHOSTED attribute is set for MyDocuments!\n");
866 "RegOpenKeyEx failed! result: %08x\n", lResult);
869 skip(
"Not enough rights to open the registry key\n");
870 IMalloc_Free(
ppM, pidlMyDocuments);
871 IShellFolder_Release(psfDesktop);
878 ok (lResult ==
ERROR_SUCCESS,
"RegQueryValueEx failed! result: %08x\n", lResult);
881 IMalloc_Free(
ppM, pidlMyDocuments);
882 IShellFolder_Release(psfDesktop);
890 ok (lResult ==
ERROR_SUCCESS,
"RegQueryValueEx failed! result: %08x\n", lResult);
893 IMalloc_Free(
ppM, pidlMyDocuments);
894 IShellFolder_Release(psfDesktop);
903 dwCallForAttributes = SFGAO_ISSLOW|SFGAO_FILESYSTEM;
912 dwAttributes = SFGAO_ISSLOW|SFGAO_GHOSTED|SFGAO_FILESYSTEM;
913 hr = IShellFolder_GetAttributesOf(psfDesktop, 1,
915 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(MyDocuments) failed! hr = %08x\n",
hr);
918 "Desktop->GetAttributes(MyDocuments) returned unexpected attributes: %08x\n",
926 IMalloc_Free(
ppM, pidlMyDocuments);
927 IShellFolder_Release(psfDesktop);
933 LPSHELLFOLDER psfDesktop, psfMyComputer;
938 static const DWORD desktopFlags = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
939 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
940 static const DWORD myComputerFlags = SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
941 SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
942 WCHAR wszMyComputer[] = {
943 ':',
':',
'{',
'2',
'0',
'D',
'0',
'4',
'F',
'E',
'0',
'-',
'3',
'A',
'E',
'A',
'-',
'1',
'0',
'6',
'9',
'-',
944 'A',
'2',
'D',
'8',
'-',
'0',
'8',
'0',
'0',
'2',
'B',
'3',
'0',
'3',
'0',
'9',
'D',
'}',0 };
947 static WCHAR cTestDirW[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
953 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
958 hr = IShellFolder_GetAttributesOf(psfDesktop, 1, &pidlEmpty, &
dwFlags);
959 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(empty pidl) failed! hr = %08x\n",
hr);
964 hr = IShellFolder_GetAttributesOf(psfDesktop, 0,
NULL, &
dwFlags);
965 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(NULL) failed! hr = %08x\n",
hr);
970 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse MyComputer's CLSID! hr = %08x\n",
hr);
972 IShellFolder_Release(psfDesktop);
981 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf(MyComputer) failed! hr = %08x\n",
hr);
983 ok (
dwFlags == (myComputerFlags | SFGAO_CANLINK),
"Wrong MyComputer attributes: %08x\n",
dwFlags);
985 hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer,
NULL, &IID_IShellFolder, (
LPVOID*)&psfMyComputer);
986 ok (
hr ==
S_OK,
"Desktop failed to bind to MyComputer object! hr = %08x\n",
hr);
987 IShellFolder_Release(psfDesktop);
988 IMalloc_Free(
ppM, pidlMyComputer);
991 hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &
dwFlags);
993 ok (
hr ==
E_INVALIDARG,
"MyComputer->GetAttributesOf(empty pidl) should fail! hr = %08x\n",
hr);
996 hr = IShellFolder_GetAttributesOf(psfMyComputer, 0,
NULL, &
dwFlags);
997 ok (
hr ==
S_OK,
"MyComputer->GetAttributesOf(NULL) failed! hr = %08x\n",
hr);
999 ok (
dwFlags == myComputerFlags,
"Wrong MyComputer attributes: %08x\n",
dwFlags);
1001 IShellFolder_Release(psfMyComputer);
1007 win_skip(
"GetCurrentDirectoryA returned empty string. Skipping test_GetAttributesOf\n");
1010 if (
len > 3 && cCurrDirA[
len-1] ==
'\\')
1011 cCurrDirA[
len-1] = 0;
1019 ok(
hr ==
S_OK,
"SHGetDesktopfolder failed %08x\n",
hr);
1022 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1024 hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL,
NULL, (
REFIID)&IID_IShellFolder, (
LPVOID *)&testIShellFolder);
1025 ok(
hr ==
S_OK,
"BindToObject failed %08x\n",
hr);
1027 IMalloc_Free(
ppM, newPIDL);
1031 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1036 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf() failed! hr = %08x\n",
hr);
1037 ok ((
dwFlags&SFGAO_FOLDER),
"Wrong directory attribute for relative PIDL: %08x\n",
dwFlags);
1040 IMalloc_Free(
ppM, newPIDL);
1043 if (cCurrDirA[
len-1] ==
'\\')
1044 cCurrDirA[
len-1] = 0;
1049 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1054 ok (
hr ==
S_OK,
"Desktop->GetAttributesOf() failed! hr = %08x\n",
hr);
1055 ok ((
dwFlags&SFGAO_FOLDER),
"Wrong directory attribute for absolute PIDL: %08x\n",
dwFlags);
1058 IMalloc_Free(
ppM, newPIDL);
1060 IShellFolder_Release(testIShellFolder);
1064 IShellFolder_Release(IDesktopFolder);
1075 LPSHELLFOLDER psfDesktop;
1076 WCHAR wszMyComputer[] = {
1077 ':',
':',
'{',
'2',
'0',
'D',
'0',
'4',
'F',
'E',
'0',
'-',
'3',
'A',
'E',
'A',
'-',
'1',
'0',
'6',
'9',
'-',
1078 'A',
'2',
'D',
'8',
'-',
'0',
'8',
'0',
'0',
'2',
'B',
'3',
'0',
'3',
'0',
'9',
'D',
'}',0 };
1083 static WCHAR wszTestFile[] = {
1084 'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'f',
'o',
'o',0 };
1092 ok(!wszPath[0],
"Expected empty string\n");
1102 ok(!
lstrcmpiW(wszDesktop, wszPath),
"SHGetPathFromIDListW didn't return desktop path for empty pidl!\n");
1106 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
1110 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse MyComputer's CLSID! hr = %08x\n",
hr);
1112 IShellFolder_Release(psfDesktop);
1120 ok (!
result,
"SHGetPathFromIDListW succeeded where it shouldn't!\n");
1123 "Unexpected last error from SHGetPathFromIDListW: %u\n",
GetLastError());
1124 ok (!wszPath[0],
"Expected empty path\n");
1126 IShellFolder_Release(psfDesktop);
1130 IMalloc_Free(
ppM, pidlMyComputer);
1135 IShellFolder_Release(psfDesktop);
1143 IShellFolder_Release(psfDesktop);
1149 ok (
hr ==
S_OK,
"Desktop's ParseDisplayName failed to parse filename hr = %08x\n",
hr);
1151 IShellFolder_Release(psfDesktop);
1153 IMalloc_Free(
ppM, pidlTestFile);
1160 ok (
hr ==
S_OK,
"Desktop's GetDisplayNamfOf failed! hr = %08x\n",
hr);
1161 IShellFolder_Release(psfDesktop);
1164 IMalloc_Free(
ppM, pidlTestFile);
1169 "Desktop->GetDisplayNameOf(pidlTestFile, SHGDN_FORPARSING) "
1170 "returned incorrect path for file placed on desktop\n");
1174 ok(0 ==
lstrcmpW(
wszFileName, wszPath),
"SHGetPathFromIDListW returned incorrect path for file placed on desktop\n");
1176 if (pSHGetPathFromIDListEx)
1178 result = pSHGetPathFromIDListEx(pidlEmpty, wszPath,
MAX_PATH, SFGAO_FILESYSTEM);
1180 ok(!
lstrcmpiW(wszDesktop, wszPath),
"Unexpected SHGetPathFromIDListEx result %s, expected %s\n",
1183 result = pSHGetPathFromIDListEx(pidlTestFile, wszPath,
MAX_PATH, SFGAO_FILESYSTEM);
1189 memset(wszPath, 0x55,
sizeof(wszPath));
1190 result = pSHGetPathFromIDListEx(pidlTestFile, wszPath, 5, SFGAO_FILESYSTEM);
1194 memset(wszPath, 0x55,
sizeof(wszPath));
1195 result = pSHGetPathFromIDListEx(pidlEmpty, wszPath, 5, SFGAO_FILESYSTEM);
1199 win_skip(
"SHGetPathFromIDListEx not available\n");
1201 IMalloc_Free(
ppM, pidlTestFile);
1205 ok(
hr ==
S_OK,
"SHGetFolderLocation failed: 0x%08x\n",
hr);
1209 IMalloc_Free(
ppM, pidlPrograms);
1210 ok(
result,
"SHGetPathFromIDListW failed\n");
1218 static const CHAR cTestDirA[] =
"\\testdir";
1227 win_skip(
"GetCurrentDirectoryA returned empty string. Skipping test_EnumObjects_and_CompareIDs\n");
1230 if(cCurrDirA[
len-1] ==
'\\')
1231 cCurrDirA[
len-1] = 0;
1237 ok(
hr ==
S_OK,
"SHGetDesktopfolder failed %08x\n",
hr);
1242 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1244 hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL,
NULL, (
REFIID)&IID_IShellFolder, (
LPVOID *)&testIShellFolder);
1245 ok(
hr ==
S_OK,
"BindToObject failed %08x\n",
hr);
1249 IShellFolder_Release(testIShellFolder);
1253 IMalloc_Free(
ppM, newPIDL);
1255 IShellFolder_Release(IDesktopFolder);
1270 ok (
FALSE,
"InitPropertyBag asked for unknown interface!\n");
1274 IPropertyBag_AddRef(iface);
1289 static const WCHAR wszTargetSpecialFolder[] = {
1290 'T',
'a',
'r',
'g',
'e',
't',
'S',
'p',
'e',
'c',
'i',
'a',
'l',
'F',
'o',
'l',
'd',
'e',
'r',0 };
1291 static const WCHAR wszTarget[] = {
1292 'T',
'a',
'r',
'g',
'e',
't',0 };
1293 static const WCHAR wszAttributes[] = {
1294 'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
's',0 };
1295 static const WCHAR wszResolveLinkFlags[] = {
1296 'R',
'e',
's',
'o',
'l',
'v',
'e',
'L',
'i',
'n',
'k',
'F',
'l',
'a',
'g',
's',0 };
1297 static const WCHAR wszTargetKnownFolder[] = {
1298 'T',
'a',
'r',
'g',
'e',
't',
'K',
'n',
'o',
'w',
'n',
'F',
'o',
'l',
'd',
'e',
'r',0 };
1299 static const WCHAR wszCLSID[] = {
1300 'C',
'L',
'S',
'I',
'D',0 };
1302 if (!
lstrcmpW(pszPropName, wszTargetSpecialFolder)) {
1303 ok(
V_VT(pVar) ==
VT_I4,
"Wrong variant type for 'TargetSpecialFolder' property!\n");
1307 if (!
lstrcmpW(pszPropName, wszResolveLinkFlags))
1309 ok(
V_VT(pVar) ==
VT_UI4,
"Wrong variant type for 'ResolveLinkFlags' property!\n");
1313 if (!
lstrcmpW(pszPropName, wszTarget)) {
1317 ok(
V_VT(pVar) ==
VT_BSTR,
"Wrong variant type for 'Target' property!\n");
1328 if (!
lstrcmpW(pszPropName, wszAttributes)) {
1329 ok(
V_VT(pVar) ==
VT_UI4,
"Wrong variant type for 'Attributes' property!\n");
1331 V_UI4(pVar) = SFGAO_FOLDER|SFGAO_HASSUBFOLDER|SFGAO_FILESYSANCESTOR|
1332 SFGAO_CANRENAME|SFGAO_FILESYSTEM;
1336 if (!
lstrcmpW(pszPropName, wszTargetKnownFolder)) {
1337 ok(
V_VT(pVar) ==
VT_BSTR,
"Wrong variant type for 'TargetKnownFolder' property!\n");
1342 if (!
lstrcmpW(pszPropName, wszCLSID)) {
1343 ok(
V_VT(pVar) ==
VT_EMPTY,
"Wrong variant type for 'CLSID' property!\n");
1355 ok(
FALSE,
"Unexpected call to IPropertyBag_Write\n");
1380 LPITEMIDLIST pidlCurrentFolder, pidlWineTestFolder, pidlSubFolder;
1382 WCHAR wszWineTestFolder[] = {
1383 ':',
':',
'{',
'9',
'B',
'3',
'5',
'2',
'E',
'B',
'F',
'-',
'2',
'7',
'6',
'5',
'-',
'4',
'5',
'C',
'1',
'-',
1384 'B',
'4',
'C',
'6',
'-',
'8',
'5',
'C',
'C',
'7',
'F',
'7',
'A',
'B',
'C',
'6',
'4',
'}',0 };
1385 WCHAR wszShellExtKey[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
1386 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
'W',
'i',
'n',
'd',
'o',
'w',
's',
'\\',
1387 'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
'\\',
1388 'E',
'x',
'p',
'l',
'o',
'r',
'e',
'r',
'\\',
'D',
'e',
's',
'k',
't',
'o',
'p',
'\\',
1389 'N',
'a',
'm',
'e',
'S',
'p',
'a',
'c',
'e',
'\\',
1390 '{',
'9',
'b',
'3',
'5',
'2',
'e',
'b',
'f',
'-',
'2',
'7',
'6',
'5',
'-',
'4',
'5',
'c',
'1',
'-',
1391 'b',
'4',
'c',
'6',
'-',
'8',
'5',
'c',
'c',
'7',
'f',
'7',
'a',
'b',
'c',
'6',
'4',
'}',0 };
1393 WCHAR wszSomeSubFolder[] = {
'S',
'u',
'b',
'F',
'o',
'l',
'd',
'e',
'r', 0};
1395 {0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}};
1404 win_skip(
"CLSID_FolderShortcut is not implemented\n");
1407 ok (
hr ==
S_OK,
"CoCreateInstance failed! hr = 0x%08x\n",
hr);
1411 ok(
hr ==
S_OK,
"IPersistPropertyBag_Load failed! hr = %08x\n",
hr);
1413 IPersistPropertyBag_Release(pPersistPropertyBag);
1417 hr = IPersistPropertyBag_QueryInterface(pPersistPropertyBag, &IID_IShellFolder,
1419 IPersistPropertyBag_Release(pPersistPropertyBag);
1420 ok(
hr ==
S_OK,
"IPersistPropertyBag_QueryInterface(IShellFolder) failed! hr = %08x\n",
hr);
1425 "IShellFolder_GetDisplayNameOf(NULL) failed! hr = %08x\n",
hr);
1427 IShellFolder_Release(pShellFolder);
1436 ok(!
lstrcmpiW(wszDesktopPath, wszBuffer),
"FolderShortcut returned incorrect folder!\n");
1438 hr = IShellFolder_QueryInterface(pShellFolder, &IID_IPersistFolder3, (
LPVOID*)&pPersistFolder3);
1439 IShellFolder_Release(pShellFolder);
1440 ok(
hr ==
S_OK,
"IShellFolder_QueryInterface(IID_IPersistFolder3 failed! hr = 0x%08x\n",
hr);
1443 hr = IPersistFolder3_GetClassID(pPersistFolder3, &
clsid);
1444 ok(
hr ==
S_OK,
"IPersistFolder3_GetClassID failed! hr=0x%08x\n",
hr);
1447 hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
1449 ok(!pidlCurrentFolder,
"IPersistFolder3_GetCurFolder should return a NULL pidl!\n");
1458 ok (
hr ==
S_OK,
"SHGetDesktopFolder failed! hr = %08x\n",
hr);
1466 &pidlWineTestFolder,
NULL);
1468 IShellFolder_Release(pDesktopFolder);
1469 ok (
hr ==
S_OK,
"IShellFolder::ParseDisplayName failed! hr = %08x\n",
hr);
1472 hr = IPersistFolder3_Initialize(pPersistFolder3, pidlWineTestFolder);
1473 ok (
hr ==
S_OK,
"IPersistFolder3::Initialize failed! hr = %08x\n",
hr);
1475 IPersistFolder3_Release(pPersistFolder3);
1476 ILFree(pidlWineTestFolder);
1480 hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
1481 ok(
hr ==
S_OK,
"IPersistFolder3_GetCurFolder failed! hr=0x%08x\n",
hr);
1482 ok(
ILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
1483 "IPersistFolder3_GetCurFolder should return pidlWineTestFolder!\n");
1484 ILFree(pidlCurrentFolder);
1485 ILFree(pidlWineTestFolder);
1487 hr = IPersistFolder3_QueryInterface(pPersistFolder3, &IID_IShellFolder, (
LPVOID*)&pShellFolder);
1488 IPersistFolder3_Release(pPersistFolder3);
1489 ok(
hr ==
S_OK,
"IPersistFolder3_QueryInterface(IShellFolder) failed! hr = %08x\n",
hr);
1493 ok(
hr ==
S_OK,
"IShellFolder_GetDisplayNameOf(NULL) failed! hr = %08x\n",
hr);
1495 IShellFolder_Release(pShellFolder);
1500 ok(!
lstrcmpiW(wszDesktopPath, wszBuffer),
"FolderShortcut returned incorrect folder!\n");
1505 lstrcatW(wszDesktopPath, wszSomeSubFolder);
1507 IShellFolder_Release(pShellFolder);
1512 &pidlSubFolder,
NULL);
1514 ok (
hr ==
S_OK,
"IShellFolder::ParseDisplayName failed! hr = %08x\n",
hr);
1516 IShellFolder_Release(pShellFolder);
1520 hr = IShellFolder_BindToObject(pShellFolder, pidlSubFolder,
NULL, &IID_IPersistFolder3,
1521 (
LPVOID*)&pPersistFolder3);
1522 IShellFolder_Release(pShellFolder);
1524 ok (
hr ==
S_OK,
"IShellFolder::BindToObject failed! hr = %08x\n",
hr);
1530 hr = IPersistFolder3_GetClassID(pPersistFolder3, &
clsid);
1531 ok(
hr ==
S_OK,
"IPersistFolder3_GetClassID failed! hr=0x%08x\n",
hr);
1533 "IPersistFolder3::GetClassID returned unexpected CLSID!\n");
1535 IPersistFolder3_Release(pPersistFolder3);
1538#include "pshpack1.h"
1566 LPSHELLFOLDER psfDesktop, psfPersonal;
1571 WCHAR wszFile[3][17] = { {
'e',
'v',
'e',
'n',
'_',0 }, {
'o',
'd',
'd',
'_',0 },
1572 {
'l',
'o',
'n',
'g',
'e',
'r',
'_',
't',
'h',
'a',
'n',
'.',
'8',
'_',
'3',0 } };
1576 ok(bResult,
"SHGetSpecialFolderPathW failed! Last error: %u\n",
GetLastError());
1577 if (!bResult)
return;
1582 win_skip(
"Most W-calls are not implemented\n");
1585 ok(bResult,
"SetCurrentDirectory failed! Last error: %u\n",
GetLastError());
1586 if (!bResult)
return;
1589 ok(
hr ==
S_OK,
"SHGetDesktopFolder failed! hr: %08x\n",
hr);
1593 ok(
hr ==
S_OK,
"psfDesktop->ParseDisplayName failed! hr = %08x\n",
hr);
1595 IShellFolder_Release(psfDesktop);
1599 hr = IShellFolder_BindToObject(psfDesktop, pidlPersonal,
NULL, &IID_IShellFolder,
1601 IShellFolder_Release(psfDesktop);
1603 ok(
hr ==
S_OK,
"psfDesktop->BindToObject failed! hr = %08x\n",
hr);
1606 for (
i=0;
i<3;
i++) {
1616 IShellFolder_Release(psfPersonal);
1623 ok(
hr ==
S_OK,
"psfPersonal->ParseDisplayName failed! hr: %08x\n",
hr);
1625 IShellFolder_Release(psfPersonal);
1629 pFileStructA = (
struct FileStructA *)pidlFile->mkid.abID;
1630 ok(pFileStructA->
type == 0x32,
"PIDLTYPE should be 0x32!\n");
1631 ok(pFileStructA->
dummy == 0x00,
"Dummy Byte should be 0x00!\n");
1632 ok(pFileStructA->
dwFileSize == 0,
"Filesize should be zero!\n");
1635 ok(!
strcmp(szFile, (
CHAR*)&pidlFile->mkid.abID[12]),
"Wrong file name!\n");
1643 ok(pidlFile->mkid.abID[18] ==
'~',
"Should be derived 8.3 name!\n");
1646 ok(pidlFile->mkid.abID[12 +
strlen(szFile) + 1] !=
'\0',
1647 "Alignment byte, where there shouldn't be!\n");
1650 ok(pidlFile->mkid.abID[12 +
strlen(szFile) + 1] ==
'\0',
1651 "There should be an alignment byte, but isn't!\n");
1654 cbOffset = *(
WORD*)(((
LPBYTE)pidlFile)+pidlFile->mkid.cb-
sizeof(
WORD));
1656 cbOffset <= pidlFile->mkid.cb -
sizeof(
struct FileStructW)),
1657 "Wrong offset value (%d) stored at the end of the PIDL\n", cbOffset);
1660 cbOffset <= pidlFile->mkid.cb -
sizeof(
struct FileStructW))
1666 "FileStructW's offset and length should add up to the PIDL's length!\n");
1677 "Last write time should match creation time!\n");
1688 "Last write date and time should match last access date and time!\n");
1694 trace (
"Filesystem may be FAT. Performing less strict atime test.\n");
1695 ok ((pFileStructW->
uTime2 & 0x1F) == 0,
1696 "Last access time on FAT filesystems should have zero seconds.\n");
1704 "The filename should be stored in unicode at this position!\n");
1711 IShellFolder_Release(psfPersonal);
1716 static const BOOL is_win64 =
sizeof(
void *) >
sizeof(
int);
1727 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1731 win_skip(
"Program Files (x86) not supported\n" );
1734 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1739 ok(
strstr( path_x86,
"x86" ) !=
NULL,
"32-bit path '%s' doesn't contain x86\n", path_x86 );
1755 ok( !
lstrcmpiA( path_key, path_x86 ),
"paths differ '%s' != '%s'\n", path_key, path_x86 );
1757 else ok( !
is_win64 && !
is_wow64,
"ProgramFilesDir (x86) should exist on 64-bit setup\n" );
1762 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1766 win_skip(
"Common Files (x86) not supported\n" );
1769 ok(
hr ==
S_OK,
"SHGetFolderPathA failed %x\n",
hr );
1774 ok(
strstr( path_x86,
"x86" ) !=
NULL,
"32-bit path '%s' doesn't contain x86\n", path_x86 );
1790 ok( !
lstrcmpiA( path_key, path_x86 ),
"paths differ '%s' != '%s'\n", path_key, path_x86 );
1792 else ok( !
is_win64 && !
is_wow64,
"CommonFilesDir (x86) should exist on 64-bit setup\n" );
1802 static const char wine[] =
"wine";
1803 static const char winetemp[] =
"wine\\temp";
1806 static char toolongpath[
MAX_PATH+1];
1810 win_skip(
"SHGetFolderPathA failed for CSIDL_LOCAL_APPDATA!\n");
1837 "expected %s to start with %s\n", testpath,
appdata);
1839 "expected %s to end with %s\n", testpath, winetemp);
1844 ok(0,
"expected S_OK or E_INVALIDARG, got %x\n",
ret);
1864 toolongpath[
i] =
'0' +
i % 10;
1885 "expected %s to start with %s\n", testpath,
appdata);
1887 "expected %s to end with %s\n", testpath, winetemp);
1906 static char resourcefile[
MAX_PATH];
1912 static const char desktopini_contents1[] =
1913 "[.ShellClassInfo]\r\n"
1914 "LocalizedResourceName=@";
1915 static const char desktopini_contents2[] =
1917 static WCHAR foldernameW[] = {
't',
'e',
's',
't',
'f',
'o',
'l',
'd',
'e',
'r',0};
1918 static const WCHAR folderdisplayW[] = {
'F',
'o',
'l',
'd',
'e',
'r',
' ',
'N',
'a',
'm',
'e',
' ',
'R',
'e',
's',
'o',
'u',
'r',
'c',
'e',0};
1941 win_skip(
"GetCurrentDirectoryA returned empty string. Skipping test_LocalizedNames\n");
1944 if(cCurrDirA[
len-1] ==
'\\')
1945 cCurrDirA[
len-1] = 0;
1950 ok(
hr ==
S_OK,
"SHGetDesktopfolder failed %08x\n",
hr);
1953 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1955 hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL,
NULL, (
REFIID)&IID_IShellFolder, (
LPVOID *)&testIShellFolder);
1956 ok(
hr ==
S_OK,
"BindToObject failed %08x\n",
hr);
1958 IMalloc_Free(
ppM, newPIDL);
1962 ok(
hr ==
S_OK,
"ParseDisplayName failed %08x\n",
hr);
1965 ok(
hr ==
S_OK,
"GetDisplayNameOf failed %08x\n",
hr);
1968 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
1974 ok(
hr ==
S_OK,
"GetDisplayNameOf failed %08x\n",
hr);
1977 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
1983 ok(
hr ==
S_OK,
"GetDisplayNameOf failed %08x\n",
hr);
1986 ok (
hr ==
S_OK,
"StrRetToBufW failed! hr = %08x\n",
hr);
1989 IShellFolder_Release(IDesktopFolder);
1990 IShellFolder_Release(testIShellFolder);
1992 IMalloc_Free(
ppM, newPIDL);
2004 LPITEMIDLIST pidl_cwd=
NULL, pidl_testfile, pidl_abstestfile, pidl_test, pidl_desktop;
2014 if (!pSHCreateShellItem)
2016 win_skip(
"SHCreateShellItem isn't available\n");
2022 win_skip(
"GetCurrentDirectoryA returned empty string, skipping test_SHCreateShellItem\n");
2037 ret = IShellFolder_BindToObject(desktopfolder, pidl_cwd,
NULL, &IID_IShellFolder, (
void**)¤tfolder);
2045 pidl_abstestfile =
ILCombine(pidl_cwd, pidl_testfile);
2047 shellitem = (
void*)0xdeadbeef;
2050 ok(shellitem == 0,
"Got %p\n", shellitem);
2055 pSHCreateShellItem(pidl_cwd,
NULL,
NULL, &shellitem);
2056 pSHCreateShellItem(
NULL, currentfolder,
NULL, &shellitem);
2057 pSHCreateShellItem(pidl_cwd, currentfolder,
NULL, &shellitem);
2060 ret = pSHCreateShellItem(
NULL,
NULL, pidl_cwd, &shellitem);
2064 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2068 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2072 ok(
ILIsEqual(pidl_cwd, pidl_test),
"id lists are not equal\n");
2075 IPersistIDList_Release(persistidl);
2077 IShellItem_Release(shellitem);
2080 ret = pSHCreateShellItem(pidl_cwd,
NULL, pidl_testfile, &shellitem);
2084 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2088 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2092 ok(
ILIsEqual(pidl_abstestfile, pidl_test),
"id lists are not equal\n");
2095 IPersistIDList_Release(persistidl);
2098 ret = IShellItem_GetParent(shellitem, &shellitem2);
2102 ret = IShellItem_QueryInterface(shellitem2, &IID_IPersistIDList, (
void**)&persistidl);
2106 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2110 ok(
ILIsEqual(pidl_cwd, pidl_test),
"id lists are not equal\n");
2113 IPersistIDList_Release(persistidl);
2115 IShellItem_Release(shellitem2);
2118 IShellItem_Release(shellitem);
2121 ret = pSHCreateShellItem(
NULL, currentfolder, pidl_testfile, &shellitem);
2125 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2129 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2133 ok(
ILIsEqual(pidl_abstestfile, pidl_test),
"id lists are not equal\n");
2136 IPersistIDList_Release(persistidl);
2138 IShellItem_Release(shellitem);
2142 ret = pSHCreateShellItem(pidl_cwd, desktopfolder, pidl_testfile, &shellitem);
2146 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2150 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2154 ok(
ILIsEqual(pidl_abstestfile, pidl_test),
"id lists are not equal\n");
2157 IPersistIDList_Release(persistidl);
2159 IShellItem_Release(shellitem);
2162 ret = pSHCreateShellItem(
NULL, desktopfolder, pidl_testfile, &shellitem);
2166 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2170 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2174 ok(
ILIsEqual(pidl_testfile, pidl_test),
"id lists are not equal\n");
2177 IPersistIDList_Release(persistidl);
2180 IShellItem_Release(shellitem);
2183 ret = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem);
2187 ret = IShellItem_GetParent(shellitem, &shellitem2);
2190 IShellItem_Release(shellitem);
2194 if(pSHCreateItemFromParsingName)
2199 pSHCreateItemFromParsingName(
NULL,
NULL, &IID_IShellItem,
NULL);
2202 shellitem = (
void*)0xdeadbeef;
2203 ret = pSHCreateItemFromParsingName(
NULL,
NULL, &IID_IShellItem, (
void**)&shellitem);
2205 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2207 ret = pSHCreateItemFromParsingName(
testfileW,
NULL, &IID_IShellItem, (
void**)&shellitem);
2209 "SHCreateItemFromParsingName returned %x\n",
ret);
2216 ret = pSHCreateItemFromParsingName(fnbufW,
NULL, &IID_IShellItem, (
void**)&shellitem);
2217 ok(
ret ==
S_OK,
"SHCreateItemFromParsingName returned %x\n",
ret);
2221 ret = IShellItem_GetDisplayName(shellitem, SIGDN_FILESYSPATH, &tmp_fname);
2225 ok(!
lstrcmpW(fnbufW, tmp_fname),
"strings not equal\n");
2228 IShellItem_Release(shellitem);
2232 win_skip(
"No SHCreateItemFromParsingName\n");
2236 if(pSHCreateItemFromIDList)
2241 pSHCreateItemFromIDList(
NULL, &IID_IShellItem,
NULL);
2244 ret = pSHCreateItemFromIDList(
NULL, &IID_IShellItem, (
void**)&shellitem);
2247 ret = pSHCreateItemFromIDList(pidl_cwd, &IID_IShellItem, (
void**)&shellitem);
2248 ok(
ret ==
S_OK,
"SHCreateItemFromIDList returned %x\n",
ret);
2251 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2255 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2259 ok(
ILIsEqual(pidl_cwd, pidl_test),
"id lists are not equal\n");
2262 IPersistIDList_Release(persistidl);
2264 IShellItem_Release(shellitem);
2267 ret = pSHCreateItemFromIDList(pidl_testfile, &IID_IShellItem, (
void**)&shellitem);
2268 ok(
ret ==
S_OK,
"SHCreateItemFromIDList returned %x\n",
ret);
2271 ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (
void**)&persistidl);
2275 ret = IPersistIDList_GetIDList(persistidl, &pidl_test);
2279 ok(
ILIsEqual(pidl_testfile, pidl_test),
"id lists are not equal\n");
2282 IPersistIDList_Release(persistidl);
2284 IShellItem_Release(shellitem);
2288 win_skip(
"No SHCreateItemFromIDList\n");
2291 if(pSHCreateItemFromRelativeName && pSHGetKnownFolderPath)
2294 WCHAR *desktop_path, *displayname;
2300 ret = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem_desktop);
2301 ok(
ret ==
S_OK,
"SHCreateShellItem failed: 0x%08x.\n",
ret);
2303 shellitem = (
void*)0xdeadbeef;
2304 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
NULL,
NULL, &IID_IShellItem,
2305 (
void**)&shellitem);
2306 ok(
ret ==
E_INVALIDARG,
"Expected 0x%08x but SHCreateItemFromRelativeName return: 0x%08x.\n",
2308 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2311 shellitem = (
void*)0xdeadbeef;
2312 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
testfileW,
NULL, &IID_IShellItem,
2313 (
void**)&shellitem);
2315 "Expected 0x%08x but SHCreateItemFromRelativeName return: 0x%08x.\n",
2317 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2320 pSHGetKnownFolderPath(&FOLDERID_Desktop, 0,
NULL, &desktop_path);
2321 lstrcatW(testfile_path, desktop_path);
2328 shellitem = (
void*)0xdeadbeef;
2329 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
testfileW,
NULL, &IID_IShellItem,
2330 (
void**)&shellitem);
2331 ok(
ret ==
S_OK,
"SHCreateItemFromRelativeName failed: 0x%08x.\n",
ret);
2332 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2335 ret = IShellItem_GetDisplayName(shellitem, 0, &displayname);
2336 ok(
ret ==
S_OK,
"IShellItem_GetDisplayName failed: 0x%08x.\n",
ret);
2340 shellitem2 = (
void*)0xdeadbeef;
2341 ret = pSHCreateItemFromRelativeName(shellitem_desktop,
testfileW,
NULL, &IID_IShellItem,
2342 (
void**)&shellitem2);
2343 ok(
ret ==
S_OK,
"SHCreateItemFromRelativeName failed: 0x%08x.\n",
ret);
2344 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2345 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2347 IShellItem_Release(shellitem2);
2349 shellitem2 = (
void*)0xdeadbeef;
2351 &pidl_desktop_testfile,
NULL);
2352 ok(
ret ==
S_OK,
"ParseDisplayName failed 0x%08x.\n",
ret);
2353 ret = pSHCreateItemFromIDList(pidl_desktop_testfile, &IID_IShellItem, (
void**)&shellitem2);
2354 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2355 ok(
ret ==
S_OK,
"IShellItem_Compare fail: 0x%08x.\n",
ret);
2357 ILFree(pidl_desktop_testfile);
2358 IShellItem_Release(shellitem2);
2360 IShellItem_Release(shellitem);
2365 IShellItem_Release(shellitem_desktop);
2368 win_skip(
"No SHCreateItemFromRelativeName or SHGetKnownFolderPath\n");
2371 if(pSHCreateItemInKnownFolder && pSHGetKnownFolderPath)
2373 WCHAR *desktop_path;
2380 shellitem = (
void*)0xdeadbeef;
2381 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
NULL, &IID_IShellItem,
2382 (
void**)&shellitem);
2383 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2384 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2387 shellitem2 = (
void*)0xdeadbeef;
2388 ret = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem2);
2392 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2393 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2395 IShellItem_Release(shellitem2);
2397 IShellItem_Release(shellitem);
2401 shellitem = (
void*)0xdeadbeef;
2402 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
testfileW, &IID_IShellItem,
2403 (
void**)&shellitem);
2405 "Expected 0x%08x but SHCreateItemInKnownFolder return: 0x%08x.\n",
2407 ok(shellitem ==
NULL,
"shellitem was %p.\n", shellitem);
2409 pSHGetKnownFolderPath(&FOLDERID_Desktop, 0,
NULL, &desktop_path);
2410 lstrcatW(testfile_path, desktop_path);
2417 shellitem = (
void*)0xdeadbeef;
2418 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
testfileW, &IID_IShellItem,
2419 (
void**)&shellitem);
2420 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2421 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2424 ret = IShellItem_GetDisplayName(shellitem, 0, &displayname);
2425 ok(
ret ==
S_OK,
"IShellItem_GetDisplayName failed: 0x%08x.\n",
ret);
2430 shellitem2 = (
void*)0xdeadbeef;
2431 ret = pSHCreateItemInKnownFolder(&FOLDERID_Desktop, 0,
testfileW, &IID_IShellItem,
2432 (
void**)&shellitem2);
2433 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2434 ok(shellitem2 !=
NULL,
"shellitem was %p.\n", shellitem);
2435 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2436 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2438 IShellItem_Release(shellitem2);
2440 shellitem2 = (
void*)0xdeadbeef;
2442 &pidl_desktop_testfile,
NULL);
2444 ret = pSHCreateItemFromIDList(pidl_desktop_testfile, &IID_IShellItem, (
void**)&shellitem2);
2445 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2446 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2448 ILFree(pidl_desktop_testfile);
2449 IShellItem_Release(shellitem2);
2451 IShellItem_Release(shellitem);
2454 shellitem = (
void*)0xdeadbeef;
2455 ret = pSHCreateItemInKnownFolder(&FOLDERID_Documents, 0,
NULL, &IID_IShellItem,
2456 (
void**)&shellitem);
2457 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2458 ok(shellitem !=
NULL,
"shellitem was %p.\n", shellitem);
2461 shellitem2 = (
void*)0xdeadbeef;
2462 ret = pSHCreateItemInKnownFolder(&FOLDERID_Documents, 0,
NULL, &IID_IShellItem,
2463 (
void**)&shellitem2);
2464 ok(
ret ==
S_OK,
"SHCreateItemInKnownFolder failed: 0x%08x.\n",
ret);
2465 ok(shellitem2 !=
NULL,
"shellitem was %p.\n", shellitem);
2466 ret = IShellItem_Compare(shellitem, shellitem2, 0, &
order);
2467 ok(
ret ==
S_OK,
"IShellItem_Compare failed: 0x%08x.\n",
ret);
2469 IShellItem_Release(shellitem2);
2471 IShellItem_Release(shellitem);
2477 win_skip(
"No SHCreateItemInKnownFolder or SHGetKnownFolderPath\n");
2480 ILFree(pidl_abstestfile);
2484 IShellFolder_Release(currentfolder);
2485 IShellFolder_Release(desktopfolder);
2496 SIGDN_NORMALDISPLAY, SIGDN_PARENTRELATIVEPARSING,
2497 SIGDN_DESKTOPABSOLUTEPARSING,SIGDN_PARENTRELATIVEEDITING,
2498 SIGDN_DESKTOPABSOLUTEEDITING,
2499 SIGDN_PARENTRELATIVEFORADDRESSBAR,SIGDN_PARENTRELATIVE, -1234};
2501 if(!pSHGetNameFromIDList)
2503 win_skip(
"SHGetNameFromIDList missing.\n");
2508 ok(pSHCreateShellItem !=
NULL,
"SHCreateShellItem missing.\n");
2513 pSHGetNameFromIDList(
NULL, 0,
NULL);
2516 hres = pSHGetNameFromIDList(
NULL, 0, &name_string);
2522 hres = pSHCreateShellItem(
NULL,
NULL, pidl, &shellitem);
2526 WCHAR *nameSI, *nameSH;
2536 hrSI = IShellItem_GetDisplayName(shellitem,
flags[
i], &nameSI);
2537 ok(hrSI ==
S_OK,
"Got 0x%08x\n", hrSI);
2538 hrSH = pSHGetNameFromIDList(pidl,
flags[
i], &nameSH);
2539 ok(hrSH ==
S_OK,
"Got 0x%08x\n", hrSH);
2541 ok(hrSF ==
S_OK,
"Got 0x%08x\n", hrSF);
2544 ok(!
lstrcmpW(nameSI, nameSH),
"Strings differ.\n");
2557 IShellFolder_Release(psf);
2559 hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
2560 ok(hrSI ==
S_OK,
"Got 0x%08x\n", hrSI);
2567 hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
2571 IShellItem_Release(shellitem);
2578 hres = pSHCreateShellItem(
NULL,
NULL, pidl, &shellitem);
2582 WCHAR *nameSI, *nameSH;
2592 hrSI = IShellItem_GetDisplayName(shellitem,
flags[
i], &nameSI);
2593 ok(hrSI ==
S_OK,
"Got 0x%08x\n", hrSI);
2594 hrSH = pSHGetNameFromIDList(pidl,
flags[
i], &nameSH);
2595 ok(hrSH ==
S_OK,
"Got 0x%08x\n", hrSH);
2597 ok(hrSF ==
S_OK,
"Got 0x%08x\n", hrSF);
2600 ok(!
lstrcmpW(nameSI, nameSH),
"Strings differ.\n");
2613 IShellFolder_Release(psf);
2615 hrSI = pSHGetNameFromIDList(pidl, SIGDN_FILESYSPATH, &nameSI);
2623 hres = pSHGetNameFromIDList(pidl, SIGDN_URL, &name_string);
2625 "Got 0x%08x\n",
hres);
2628 IShellItem_Release(shellitem);
2640 if(!pSHGetItemFromDataObject)
2642 win_skip(
"No SHGetItemFromDataObject.\n");
2649 pSHGetItemFromDataObject(
NULL, 0, &IID_IShellItem,
NULL);
2652 hres = pSHGetItemFromDataObject(
NULL, 0, &IID_IShellItem, (
void**)&psv);
2657 hres = IShellFolder_CreateViewObject(psfdesktop,
NULL, &IID_IShellView, (
void**)&psv);
2665 enum_flags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
2666 hres = IShellFolder_EnumObjects(psfdesktop,
NULL, enum_flags, &peidl);
2684 hres = pSHGetItemFromDataObject(pdo, DOGIF_DEFAULT, &IID_IShellItem, (
void**)&psi);
2693 hres = pSHGetItemFromDataObject(pdo,
DOGIF_NO_URL, &IID_IShellItem, (
void**)&psi);
2700 IDataObject_Release(pdo);
2704 skip(
"No file(s) found - skipping single-file test.\n");
2713 hres = pSHGetItemFromDataObject(pdo, DOGIF_DEFAULT, &IID_IShellItem, (
void**)&psi);
2722 hres = pSHGetItemFromDataObject(pdo,
DOGIF_NO_URL, &IID_IShellItem, (
void**)&psi);
2728 IDataObject_Release(pdo);
2732 skip(
"zero or one file found - skipping multi-file test.\n");
2737 IEnumIDList_Release(peidl);
2740 IShellView_Release(psv);
2743 IShellFolder_Release(psfdesktop);
2755 static const WCHAR filesW[][9] = {
2756 {
'a',
'\\',
'a',0}, {
'a',
'\\',
'b',0}, {
'a',
'\\',
'c',0},
2757 {
'b',
'\\',
'a',0}, {
'b',
'\\',
'b',0}, {
'b',
'\\',
'c',0},
2758 {
'c',
'\\',
'a',0}, {
'c',
'\\',
'b',0}, {
'c',
'\\',
'c',0} };
2762 if(!pSHCreateShellItem)
2764 win_skip(
"SHCreateShellItem missing.\n");
2771 skip(
"Failed to get current directory, skipping.\n");
2791 hr = IShellFolder_BindToObject(psf_desktop, pidl_cwd,
NULL, &IID_IShellFolder, (
void**)&psf_current);
2793 IShellFolder_Release(psf_desktop);
2797 memset(&psi, 0,
sizeof(psi));
2799 for(
i = 0;
i < 9;
i++)
2808 hr = pSHCreateShellItem(
NULL,
NULL, pidl_testfile, &psi[
i]);
2816 skip(
"Failed to create all shellitems.\n");
2821 hr = IShellItem_GetParent(psi[0], &psi_a);
2824 hr = IShellItem_GetParent(psi[3], &psi_b);
2827 hr = IShellItem_GetParent(psi[6], &psi_c);
2833 skip(
"Failed to create shellitems.\n");
2840 IShellItem_Compare(psi_a,
NULL, 0,
NULL);
2841 IShellItem_Compare(psi_a, psi_b, 0,
NULL);
2842 IShellItem_Compare(psi_a,
NULL, 0, &
order);
2846 for(
i = 0;
i < 9;
i++)
2848 hr = IShellItem_Compare(psi[
i], psi[
i], SICHINT_DISPLAY, &
order);
2851 hr = IShellItem_Compare(psi[
i], psi[
i], SICHINT_CANONICAL, &
order);
2854 hr = IShellItem_Compare(psi[
i], psi[
i], SICHINT_ALLFIELDS, &
order);
2861 hr = IShellItem_Compare(psi[1], psi[0], SICHINT_DISPLAY, &
order);
2864 hr = IShellItem_Compare(psi[1], psi[2], SICHINT_DISPLAY, &
order);
2867 hr = IShellItem_Compare(psi[1], psi[1], SICHINT_DISPLAY, &
order);
2872 hr = IShellItem_Compare(psi[4], psi[1], SICHINT_DISPLAY, &
order);
2875 hr = IShellItem_Compare(psi[4], psi[7], SICHINT_DISPLAY, &
order);
2878 hr = IShellItem_Compare(psi[4], psi[4], SICHINT_DISPLAY, &
order);
2883 hr = IShellItem_Compare(psi_b, psi[0], SICHINT_DISPLAY, &
order);
2886 hr = IShellItem_Compare(psi_b, psi[2], SICHINT_DISPLAY, &
order);
2889 hr = IShellItem_Compare(psi_b, psi[1], SICHINT_DISPLAY, &
order);
2894 hr = IShellItem_Compare(psi_b, psi[6], SICHINT_DISPLAY, &
order);
2897 hr = IShellItem_Compare(psi_b, psi[8], SICHINT_DISPLAY, &
order);
2900 hr = IShellItem_Compare(psi_b, psi[7], SICHINT_DISPLAY, &
order);
2905 hr = IShellItem_Compare(psi[1], psi[0], SICHINT_CANONICAL, &
order);
2908 hr = IShellItem_Compare(psi[1], psi[2], SICHINT_CANONICAL, &
order);
2911 hr = IShellItem_Compare(psi[1], psi[1], SICHINT_CANONICAL, &
order);
2916 hr = IShellItem_Compare(psi[4], psi[1], SICHINT_CANONICAL, &
order);
2919 hr = IShellItem_Compare(psi[4], psi[7], SICHINT_CANONICAL, &
order);
2922 hr = IShellItem_Compare(psi[4], psi[4], SICHINT_CANONICAL, &
order);
2927 hr = IShellItem_Compare(psi_b, psi[0], SICHINT_CANONICAL, &
order);
2930 hr = IShellItem_Compare(psi_b, psi[2], SICHINT_CANONICAL, &
order);
2933 hr = IShellItem_Compare(psi_b, psi[1], SICHINT_CANONICAL, &
order);
2938 hr = IShellItem_Compare(psi_b, psi[6], SICHINT_CANONICAL, &
order);
2941 hr = IShellItem_Compare(psi_b, psi[8], SICHINT_CANONICAL, &
order);
2944 hr = IShellItem_Compare(psi_b, psi[7], SICHINT_CANONICAL, &
order);
2949 IShellFolder_Release(psf_current);
2964 if(psi_a) IShellItem_Release(psi_a);
2965 if(psi_b) IShellItem_Release(psi_b);
2966 if(psi_c) IShellItem_Release(psi_c);
2968 for(
i = 0;
i < 9;
i++)
2969 if(psi[
i]) IShellItem_Release(psi[
i]);
2997 This->ifaces[
i].count++;
3031 struct if_count ifaces[] =
3032 { {&IID_IPersistIDList, 0},
3033 {&IID_IPersistFolder2, 0},
3035 {&IID_IParentAndItem, 0},
3036 {&IID_IFolderView, 0},
3039 if(!pSHGetIDListFromObject)
3041 win_skip(
"SHGetIDListFromObject missing.\n");
3048 pSHGetIDListFromObject(
NULL,
NULL);
3049 pSHGetIDListFromObject((
void*)0xDEADBEEF,
NULL);
3052 hres = pSHGetIDListFromObject(
NULL, &pidl);
3057 punkimpl->
ifaces = ifaces;
3062 ok(ifaces[0].
count,
"interface not requested.\n");
3063 ok(ifaces[1].
count,
"interface not requested.\n");
3064 ok(ifaces[2].
count,
"interface not requested.\n");
3067 "interface not requested.\n");
3069 "interface not requested.\n");
3074 pidl_desktop =
NULL;
3076 ok(pidl_desktop !=
NULL,
"Failed to get desktop pidl.\n");
3081 if(pSHCreateShellItem)
3084 hres = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &shellitem);
3088 hres = pSHGetIDListFromObject((
IUnknown*)shellitem, &pidl);
3092 ok(
ILIsEqual(pidl_desktop, pidl),
"pidl not equal.\n");
3095 IShellItem_Release(shellitem);
3099 skip(
"no SHCreateShellItem.\n");
3102 hres = pSHGetIDListFromObject((
IUnknown*)psfdesktop, &pidl);
3106 ok(
ILIsEqual(pidl_desktop, pidl),
"pidl not equal.\n");
3110 hres = IShellFolder_CreateViewObject(psfdesktop,
NULL, &IID_IShellView, (
void**)&psv);
3123 ok(
ILIsEqual(pidl_desktop, pidl),
"pidl not equal.\n");
3128 enum_flags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
3129 hres = IShellFolder_EnumObjects(psfdesktop,
NULL, enum_flags, &peidl);
3146 pidl = (
void*)0xDEADBEEF;
3149 ok(pidl !=
NULL,
"pidl is NULL.\n");
3150 ok(
ILIsEqual(pidl, apidl[0]),
"pidl not equal.\n");
3153 IDataObject_Release(pdo);
3157 skip(
"No files found - skipping single-file test.\n");
3166 pidl = (
void*)0xDEADBEEF;
3169 "got 0x%08x\n",
hres);
3170 ok(pidl ==
NULL,
"pidl is not NULL.\n");
3172 IDataObject_Release(pdo);
3176 skip(
"zero or one file found - skipping multi-file test.\n");
3181 IEnumIDList_Release(peidl);
3184 IShellView_Release(psv);
3187 IShellFolder_Release(psfdesktop);
3199 struct if_count ifaces[] =
3200 { {&IID_IPersistIDList, 0},
3201 {&IID_IPersistFolder2, 0},
3203 {&IID_IParentAndItem, 0},
3204 {&IID_IFolderView, 0},
3207 if(!pSHGetItemFromObject)
3209 skip(
"No SHGetItemFromObject.\n");
3228 punkimpl->
ifaces = ifaces;
3234 ok(ifaces[0].
count,
"interface not requested.\n");
3235 ok(ifaces[1].
count,
"interface not requested.\n");
3236 ok(ifaces[2].
count,
"interface not requested.\n");
3239 "interface not requested.\n");
3241 "interface not requested.\n");
3247 hres = pSHGetItemFromObject((
IUnknown*)psfdesktop, &IID_IShellItem, (
void**)&psi);
3252 hres = pSHGetItemFromObject((
IUnknown*)psi, &IID_IShellItem, (
void**)&psi2);
3257 ok(psi == psi2,
"Different instances (%p != %p).\n", psi, psi2);
3258 IShellItem_Release(psi2);
3260 IShellItem_Release(psi);
3263 IShellFolder_Release(psfdesktop);
3269 IShellItemArray *psia;
3274 static const WCHAR testdirW[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
3276 if(!pSHCreateShellItemArray) {
3277 skip(
"No pSHCreateShellItemArray!\n");
3286 pSHCreateShellItemArray(
NULL, pdesktopsf, 0,
NULL,
NULL);
3294 hr = pSHCreateShellItemArray(
NULL, pdesktopsf, 0,
NULL, &psia);
3297 hr = pSHCreateShellItemArray(
NULL, pdesktopsf, 1,
NULL, &psia);
3301 hr = pSHCreateShellItemArray(pidl,
NULL, 0,
NULL, &psia);
3315 hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir,
NULL, (
REFIID)&IID_IShellFolder,
3319 IShellFolder_Release(pdesktopsf);
3323 skip(
"Failed to set up environment for SHCreateShellItemArray tests.\n");
3329 hr = IShellFolder_EnumObjects(psf,
NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &peidl);
3334 UINT done, numitems,
i;
3336 for(done = 0; done < 5; done++)
3337 if(IEnumIDList_Next(peidl, 1, &apidl[done],
NULL) !=
S_OK)
3339 ok(done == 5,
"Got %d pidls\n", done);
3340 IEnumIDList_Release(peidl);
3352 IShellItemArray_GetCount(psia,
NULL);
3355 IShellItemArray_GetCount(psia, &numitems);
3356 ok(numitems == done,
"Got %d, expected %d\n", numitems, done);
3358 hr = IShellItemArray_GetItemAt(psia, numitems, &psi);
3362 for(
i = 0;
i < numitems;
i++)
3365 pidl_abs =
ILCombine(pidl_testdir, apidl[
i]);
3367 hr = IShellItemArray_GetItemAt(psia,
i, &psi);
3368 ok(
hr ==
S_OK,
"(%d) Failed with 0x%08x\n",
i,
hr);
3371 hr = pSHGetIDListFromObject((
IUnknown*)psi, &pidl);
3375 ok(
ILIsEqual(pidl_abs, pidl),
"Pidl not equal.\n");
3378 IShellItem_Release(psi);
3382 for(
i = 0;
i < done;
i++)
3384 IShellItemArray_Release(psia);
3389 if(pSHCreateShellItemArrayFromShellItem)
3396 pSHCreateShellItemArrayFromShellItem(
NULL, &IID_IShellItemArray,
NULL);
3397 pSHCreateShellItemArrayFromShellItem(
NULL, &IID_IShellItemArray, (
void**)&psia);
3398 pSHCreateShellItemArrayFromShellItem(psi, &IID_IShellItemArray,
NULL);
3401 hr = pSHCreateItemFromIDList(pidl_testdir, &IID_IShellItem, (
void**)&psi);
3405 hr = pSHCreateShellItemArrayFromShellItem(psi, &IID_IShellItemArray, (
void**)&psia);
3411 hr = IShellItemArray_GetCount(psia, &
count);
3414 hr = IShellItemArray_GetItemAt(psia, 0, &psi2);
3417 ok(psi != psi2,
"ShellItems are of the same instance.\n");
3421 hr = pSHGetIDListFromObject((
IUnknown*)psi, &pidl1);
3423 ok(pidl1 !=
NULL,
"pidl1 was null.\n");
3424 hr = pSHGetIDListFromObject((
IUnknown*)psi2, &pidl2);
3426 ok(pidl2 !=
NULL,
"pidl2 was null.\n");
3427 ok(
ILIsEqual(pidl1, pidl2),
"pidls not equal.\n");
3430 IShellItem_Release(psi2);
3432 hr = IShellItemArray_GetItemAt(psia, 1, &psi2);
3434 IShellItemArray_Release(psia);
3436 IShellItem_Release(psi);
3440 skip(
"No SHCreateShellItemArrayFromShellItem.\n");
3442 if(pSHCreateShellItemArrayFromDataObject)
3449 pSHCreateShellItemArrayFromDataObject(
NULL, &IID_IShellItemArray,
NULL);
3451 hr = pSHCreateShellItemArrayFromDataObject(
NULL, &IID_IShellItemArray, (
void**)&psia);
3454 hr = IShellFolder_CreateViewObject(psf,
NULL, &IID_IShellView, (
void**)&psv);
3462 enum_flags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN;
3463 hr = IShellFolder_EnumObjects(psf,
NULL, enum_flags, &peidl);
3482 hr = pSHCreateShellItemArrayFromDataObject(pdo, &IID_IShellItemArray,
3488 hr = IShellItemArray_GetCount(psia, &count_sia);
3490 ok(count_sia ==
count,
"Counts differ (%d, %d)\n",
count, count_sia);
3491 for(
i = 0;
i < count_sia;
i++)
3495 hr = IShellItemArray_GetItemAt(psia,
i, &psi);
3500 hr = pSHGetIDListFromObject((
IUnknown*)psi, &pidl);
3502 ok(pidl !=
NULL,
"pidl as NULL.\n");
3505 IShellItem_Release(psi);
3510 IShellItemArray_Release(psia);
3513 IDataObject_Release(pdo);
3519 skip(
"No files found - skipping test.\n");
3521 IEnumIDList_Release(peidl);
3523 IShellView_Release(psv);
3527 skip(
"No SHCreateShellItemArrayFromDataObject.\n");
3529 if(pSHCreateShellItemArrayFromIDLists)
3531 WCHAR test1W[] = {
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
3539 hr = pSHCreateShellItemArrayFromIDLists(0,
NULL,
NULL);
3542 psia = (
void*)0xdeadbeef;
3543 hr = pSHCreateShellItemArrayFromIDLists(0,
NULL, &psia);
3545 ok(psia ==
NULL,
"Got %p\n", psia);
3547 psia = (
void*)0xdeadbeef;
3548 hr = pSHCreateShellItemArrayFromIDLists(0, pidl_array, &psia);
3550 ok(psia ==
NULL,
"Got %p\n", psia);
3552 psia = (
void*)0xdeadbeef;
3553 pidl_array[0] =
NULL;
3554 hr = pSHCreateShellItemArrayFromIDLists(1, pidl_array, &psia);
3556 ok(psia ==
NULL,
"Got %p\n", psia);
3558 psia = (
void*)0xdeadbeef;
3559 pidl_array[0] = pidl_testdir;
3560 pidl_array[1] =
NULL;
3561 hr = pSHCreateShellItemArrayFromIDLists(2, pidl_array, &psia);
3569 hr = IShellItemArray_GetCount(psia, &
count);
3573 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
3578 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3584 IShellItem_Release(psi);
3587 hr = IShellItemArray_GetItemAt(psia, 1, &psi);
3598 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3604 IShellItem_Release(psi);
3608 IShellItemArray_Release(psia);
3613 psia = (
void*)0xdeadbeef;
3614 pidl_array[0] = pidl_testdir;
3615 hr = pSHCreateShellItemArrayFromIDLists(1, pidl_array, &psia);
3622 hr = IShellItemArray_GetCount(psia, &
count);
3626 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
3631 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3637 IShellItem_Release(psi);
3640 IShellItemArray_Release(psia);
3654 psia = (
void*)0xdeadbeef;
3655 pidl_array[0] = pidl_testdir;
3656 pidl_array[1] = pidltest1;
3657 hr = pSHCreateShellItemArrayFromIDLists(2, pidl_array, &psia);
3664 hr = IShellItemArray_GetCount(psia, &
count);
3668 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
3673 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3679 IShellItem_Release(psi);
3682 hr = IShellItemArray_GetItemAt(psia, 1, &psi);
3687 hr = IShellItem_GetDisplayName(psi, SIGDN_DESKTOPABSOLUTEPARSING, &
path);
3693 IShellItem_Release(psi);
3697 IShellItemArray_Release(psia);
3703 IShellFolder_Release(pdesktopsf);
3706 skip(
"No SHCreateShellItemArrayFromIDLists.\n");
3708 IShellFolder_Release(psf);
3720 static const WCHAR testdirW[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
3722 if(!pSHCreateShellItemArray)
3724 win_skip(
"No SHCreateShellItemArray, skipping test...\n");
3740 hr = IShellFolder_BindToObject(pdesktopsf, pidl_testdir,
NULL, (
REFIID)&IID_IShellFolder,
3745 IShellFolder_Release(pdesktopsf);
3748 hr = IShellFolder_EnumObjects(psf,
NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &peidl);
3752 IShellItemArray *psia;
3754 UINT done, numitems,
i;
3756 for(done = 0; done < 5; done++)
3757 if(IEnumIDList_Next(peidl, 1, &apidl[done],
NULL) !=
S_OK)
3759 ok(done == 5,
"Got %d pidls\n", done);
3760 IEnumIDList_Release(peidl);
3771 IShellItemArray_GetCount(psia, &numitems);
3772 ok(numitems == done,
"Got %d, expected %d\n", numitems, done);
3775 hr = IShellItemArray_EnumItems(psia, &iesi);
3777 ok(iesi !=
NULL,
"Got NULL\n");
3783 for(
i = 0;
i < 10;
i++) my_array[
i] = (
void*)0xdeadbeef;
3784 hr = IEnumShellItems_Next(iesi, 2, my_array,
NULL);
3786 for(
i = 0;
i < 2;
i++)
3788 ok(my_array[
i] == (
void*)0xdeadbeef ||
3789 broken(my_array[
i] != (
void*)0xdeadbeef && my_array[
i] !=
NULL),
3790 "Got %p (%d)\n", my_array[
i],
i);
3792 if(my_array[
i] != (
void*)0xdeadbeef)
3793 IShellItem_Release(my_array[
i]);
3795 ok(my_array[2] == (
void*)0xdeadbeef,
"Got %p\n", my_array[2]);
3797 IEnumShellItems_Reset(iesi);
3798 for(
i = 0;
i < 10;
i++) my_array[
i] = (
void*)0xdeadbeef;
3799 hr = IEnumShellItems_Next(iesi, 1, my_array,
NULL);
3801 ok(my_array[0] !=
NULL && my_array[0] != (
void*)0xdeadbeef,
"Got %p\n", my_array[0]);
3802 if(my_array[0] !=
NULL && my_array[0] != (
void*)0xdeadbeef)
3803 IShellItem_Release(my_array[0]);
3804 ok(my_array[1] == (
void*)0xdeadbeef,
"Got %p\n", my_array[1]);
3806 IEnumShellItems_Reset(iesi);
3808 for(
i = 0;
i < 10;
i++) my_array[
i] = (
void*)0xdeadbeef;
3809 hr = IEnumShellItems_Next(iesi, numitems, my_array, &fetched);
3811 ok(fetched == numitems,
"Got %d\n", fetched);
3812 for(
i = 0;
i < numitems;
i++)
3814 ok(my_array[
i] !=
NULL && my_array[
i] != (
void*)0xdeadbeef,
3815 "Got %p at %d\n", my_array[
i],
i);
3817 if(my_array[
i] !=
NULL && my_array[
i] != (
void*)0xdeadbeef)
3818 IShellItem_Release(my_array[
i]);
3820 ok(my_array[
i] == (
void*)0xdeadbeef,
"Got %p\n", my_array[
i]);
3823 IEnumShellItems_Reset(iesi);
3824 for(
i = 0;
i < numitems;
i++)
3829 hr = IShellItemArray_GetItemAt(psia,
i, &psi);
3831 hr = IEnumShellItems_Next(iesi, 1, my_array, &fetched);
3833 ok(fetched == 1,
"Got %d\n", fetched);
3835 hr = IShellItem_Compare(psi, my_array[0], 0, &
order);
3839 IShellItem_Release(psi);
3840 IShellItem_Release(my_array[0]);
3843 my_array[0] = (
void*)0xdeadbeef;
3844 hr = IEnumShellItems_Next(iesi, 1, my_array, &fetched);
3846 ok(fetched == 0,
"Got %d\n", fetched);
3847 ok(my_array[0] == (
void*)0xdeadbeef,
"Got %p\n", my_array[0]);
3850 iesi2 = (
void*)0xdeadbeef;
3851 hr = IEnumShellItems_Clone(iesi, &iesi2);
3853 ok(iesi2 ==
NULL ||
broken(iesi2 == (
void*)0xdeadbeef) ,
"Got %p\n", iesi2);
3855 IEnumShellItems_Release(iesi);
3858 IShellItemArray_Release(psia);
3861 for(
i = 0;
i < done;
i++)
3865 IShellFolder_Release(psf);
3875 if(!pSHCreateShellItem)
3877 skip(
"SHCreateShellItem missing.\n");
3885 hr = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &psi);
3903 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFObject, &IID_IShellFolder, (
void**)&
punk);
3906 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFObject, &IID_IPersistFolder2, (
void**)&ppf2);
3911 hr = IPersistFolder2_GetCurFolder(ppf2, &pidl_tmp);
3915 ok(
ILIsEqual(pidl_desktop, pidl_tmp),
"Pidl not equal (%p, %p)\n", pidl_desktop, pidl_tmp);
3918 IPersistFolder2_Release(ppf2);
3925 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFUIObject, &IID_IContextMenu, (
void**)&
punk);
3937 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFViewObject, &IID_IShellView, (
void**)&
punk);
3940 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_SFViewObject, &IID_IShellFolderView, (
void**)&
punk);
3945 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Storage, &IID_IStream, (
void**)&
punk);
3953 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Stream, &IID_IStream, (
void**)&
punk);
3961 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_StorageEnum, &IID_IEnumShellItems, (
void**)&
punk);
3968 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Transfer, &IID_ITransferSource, (
void**)&
punk);
3972 IUnknown_Release(
punk);
3974 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_Transfer, &IID_ITransferDestination, (
void**)&
punk);
3984 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_EnumItems, &IID_IEnumShellItems, (
void**)&
punk);
3994 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_LinkTargetItem, &IID_IShellItem, (
void**)&
punk);
4002 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_PropertyStore, &IID_IPropertyStore, (
void**)&
punk);
4005 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_PropertyStore, &IID_IPropertyStoreFactory, (
void**)&
punk);
4015 hr = IShellItem_BindToHandler(psi,
NULL, &BHID_AssociationArray, &IID_IQueryAssociations, (
void**)&
punk);
4025 IShellItem_Release(psi);
4028 skip(
"Failed to create ShellItem.\n");
4042 static const WCHAR testdir1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
4043 static const WCHAR testfile1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
4045 if(!pSHCreateShellItem)
4047 skip(
"SHCreateShellItem missing.\n");
4055 hr = pSHCreateShellItem(
NULL,
NULL, pidl_desktop, &psi);
4061 skip(
"Skipping tests.\n");
4068 IShellItem_GetAttributes(psi, 0,
NULL);
4073 hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER, &sfgao);
4075 ok(sfgao == SFGAO_FOLDER ||
broken(sfgao == 0) ,
"Got 0x%08x\n", sfgao);
4077 IShellItem_Release(psi);
4090 hr = pSHCreateShellItem(
NULL,
NULL, pidl, &psi_folder1);
4091 ok(
hr ==
S_OK,
"Got 0x%08x\n", sfgao);
4098 hr = pSHCreateShellItem(
NULL,
NULL, pidl, &psi_file1);
4099 ok(
hr ==
S_OK,
"Got 0x%08x\n", sfgao);
4102 IShellFolder_Release(pdesktopsf);
4105 hr = IShellItem_GetAttributes(psi_folder1, 0, &sfgao);
4107 ok(sfgao == 0,
"Got 0x%08x\n", sfgao);
4110 hr = IShellItem_GetAttributes(psi_folder1, SFGAO_FOLDER, &sfgao);
4112 ok(sfgao == SFGAO_FOLDER,
"Got 0x%08x\n", sfgao);
4115 hr = IShellItem_GetAttributes(psi_file1, SFGAO_FOLDER, &sfgao);
4117 ok(sfgao == 0,
"Got 0x%08x\n", sfgao);
4119 IShellItem_Release(psi_folder1);
4120 IShellItem_Release(psi_file1);
4127 IShellItemArray *psia_files, *psia_folders1, *psia_folders2, *psia_all;
4135 static const WCHAR testdir1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',0};
4136 static const WCHAR testdir2W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'2',0};
4137 static const WCHAR testdir3W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'3',0};
4138 static const WCHAR testfile1W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
4139 static const WCHAR testfile2W[] = {
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'2',
'.',
't',
'x',
't',0};
4140 static const WCHAR *testfilesW[5] = { testdir1W, testdir2W, testdir3W, testfile1W, testfile2W };
4142 if(!pSHCreateShellItemArrayFromShellItem)
4144 win_skip(
"No SHCreateShellItemArrayFromShellItem, skipping test...\n");
4156 for(
i = 0;
i < 5;
i++)
4163 IShellFolder_Release(pdesktopsf);
4165 hr = pSHCreateShellItemArrayFromIDLists(2, pidl_array, &psia_folders1);
4167 hr = pSHCreateShellItemArrayFromIDLists(2, &pidl_array[1], &psia_folders2);
4169 hr = pSHCreateShellItemArrayFromIDLists(2, &pidl_array[3], &psia_files);
4171 hr = pSHCreateShellItemArrayFromIDLists(4, &pidl_array[1], &psia_all);
4174 for(
i = 0;
i < 5;
i++)
4179 hr = IShellItemArray_GetAttributes(psia_folders1, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4183 hr = IShellItemArray_GetAttributes(psia_folders1, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4189 hr = IShellItemArray_GetAttributes(psia_folders2, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4191 ok(
attr == SFGAO_FOLDER,
"Got 0x%08x\n",
attr);
4193 hr = IShellItemArray_GetAttributes(psia_files, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4197 hr = IShellItemArray_GetAttributes(psia_all, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &
attr);
4201 hr = IShellItemArray_GetAttributes(psia_folders2, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4203 ok(
attr == SFGAO_FOLDER,
"Got 0x%08x\n",
attr);
4205 hr = IShellItemArray_GetAttributes(psia_files, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4209 hr = IShellItemArray_GetAttributes(psia_all, SIATTRIBFLAGS_OR, SFGAO_FOLDER, &
attr);
4211 ok(
attr == SFGAO_FOLDER,
"Got 0x%08x\n",
attr);
4213 IShellItemArray_Release(psia_folders1);
4214 IShellItemArray_Release(psia_folders2);
4215 IShellItemArray_Release(psia_files);
4216 IShellItemArray_Release(psia_all);
4224 static WCHAR cdrom_drive[] = {
'A',
':',
'\\',0};
4227 cdrom_drive[0] =
'A';
4237 drives = drives >> 1;
4265 ok(pidl1 == 0,
"expected null ptr, got %p\n", pidl1);
4276 ok(
ret ==
TRUE,
"expected equal idls\n");
4289 ok(
ret ==
TRUE,
"expected equal idls\n");
4309 ok(
ret ==
FALSE,
"expected different idls\n");
4314 IShellFolder_Release(desktop);
4318 skip(
"No empty cdrom drive found, skipping test\n");
4338 hr = IShellFolder_QueryInterface(desktop, &
IID_IPersist, (
void**)&persist);
4346 IPersist_GetClassID(persist,
NULL);
4349 hr = IPersist_GetClassID(persist, &
clsid);
4352 IPersist_Release(persist);
4355 hr = IShellFolder_QueryInterface(desktop, &IID_IPersistFolder2, (
void**)&ppf2);
4361 hr = IShellFolder_QueryInterface(desktop, &IID_IPersistFolder, (
void**)&ppf);
4362 ok(
hr ==
S_OK,
"IID_IPersistFolder2 without IID_IPersistFolder.\n");
4364 IPersistFolder_Release(ppf);
4367 hr = IPersistFolder2_Initialize(ppf2,
NULL);
4372 hr = IPersistFolder2_GetCurFolder(ppf2, &pidl);
4374 ok(pidl !=
NULL,
"pidl was NULL.\n");
4377 IPersistFolder2_Release(ppf2);
4380 IShellFolder_Release(desktop);
4388 hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (
void **)&unk);
4390 ok(
hr ==
S_OK,
"Failed to get IShellExtInit, hr %#x.\n",
hr);
4392 IUnknown_Release(unk);
4396 ok(
hr ==
S_OK,
"Failed to get IShellExtInit, hr %#x.\n",
hr);
4398 IUnknown_Release(unk);
4404 const int id_upper_limit = 32767;
4405 const int baseItem = 0x40;
4406 INT max_id, max_id_check;
4412 hr = IContextMenu_QueryContextMenu(menu,
hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL);
4416 ok(max_id <= id_upper_limit,
"Got %d\n", max_id);
4425 char buf[255], buf2[255];
4430 mii.
cch =
sizeof(buf2);
4436 "Got non-separator ID out of range: %d (type: %x)\n", mii.
wID, mii.
fType);
4439 max_id_check = (mii.
wID > max_id_check) ? mii.
wID : max_id_check;
4440 hr = IContextMenu_GetCommandString(menu, mii.
wID - baseItem, GCS_VERBA, 0,
buf,
sizeof(
buf));
4446 trace(
"for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.
wID - baseItem, mii.
dwTypeData);
4449 max_id_check -= baseItem;
4450 ok((max_id_check == max_id) ||
4451 (max_id_check == max_id-1) ||
4452 (max_id_check == max_id-2) ||
4453 (max_id_check == max_id-3),
4454 "Not equal (or near equal), got %d and %d\n", max_id_check, max_id);
4458 CMINVOKECOMMANDINFO cmi;
4460 memset(&cmi, 0,
sizeof(CMINVOKECOMMANDINFO));
4461 cmi.cbSize =
sizeof(CMINVOKECOMMANDINFO);
4465 hr = IContextMenu_InvokeCommand(menu, &cmi);
4469 cmi.lpVerb =
"foobar_wine_test";
4470 hr = IContextMenu_InvokeCommand(menu, &cmi);
4474 "Unexpected hr %#x.\n",
hr);
4488 {
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
4495 skip(
"GetCurrentDirectoryW returned an empty string.\n");
4507 ok(
hr ==
S_OK,
"Failed to bind to folder, hr %#x.\n",
hr);
4510 hr = IShellFolder_GetUIObjectOf(psf,
NULL, 1, &pidl_child, &IID_IContextMenu,
NULL, (
void **)&pcm);
4511 ok(
hr ==
S_OK,
"GetUIObjectOf() failed, hr %#x.\n",
hr);
4513 IContextMenu_Release(pcm);
4516 hr = IShellFolder_GetUIObjectOf(psf_desktop,
NULL, 0,
NULL, &IID_IContextMenu,
NULL, (
void **)&pcm);
4517 ok(
hr ==
S_OK,
"GetUIObjectOf() failed, hr %#x.\n",
hr);
4519 IContextMenu_Release(pcm);
4521 IShellFolder_Release(psf);
4524 IShellFolder_Release(psf_desktop);
4528#define verify_pidl(i,p) r_verify_pidl(__LINE__, i, p)
4543 ok_(__FILE__,
l)(
hr ==
S_OK,
"SHBindToParent failed: 0x%08x\n",
hr);
4548 ok_(__FILE__,
l)(
hr ==
S_OK,
"GetDisplayNameOf failed: 0x%08x\n",
hr);
4550 IShellFolder_Release(
parent);
4555 "Got unexpected string type: %d\n",
filename.uType);
4558 "didn't get expected path (%s), instead: %s\n",
4563 "didn't get expected path (%s), instead: %s\n",
4567 IShellFolder_Release(
parent);
4569 ok_(__FILE__,
l)(pidl ==
NULL,
"Expected PIDL to be NULL\n");
4574 const WCHAR adirW[] = {
'C',
':',
'\\',
's',
'i',
'd',
'l',
'f',
'p',
'd',
'i',
'r',0};
4575 const CHAR adirA[] =
"C:\\sidlfpdir";
4626 ok(0,
"SetFindData called\n");
4648 *
pfd->cFileName =
'a';
4649 *
pfd->cAlternateFileName =
'a';
4656 static const WCHAR adirW[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',0};
4680 WCHAR wFileSystemBindData[] =
4681 {
'F',
'i',
'l',
'e',
' ',
'S',
'y',
's',
't',
'e',
'm',
' ',
'B',
'i',
'n',
'd',
' ',
'D',
'a',
't',
'a',0};
4682 WCHAR adirW[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',0};
4683 WCHAR afileW[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',
'\\',
'f',
'i',
'l',
'e',
'.',
't',
'x',
't',0};
4684 WCHAR afile2W[] = {
'C',
':',
'\\',
'f',
's',
'b',
'd',
'd',
'i',
'r',
'\\',
's',
'\\',
'f',
'i',
'l',
'e',
'.',
't',
'x',
't',0};
4696 win_skip(
"Most W-calls are not implemented\n");
4703 win_skip(
"Failed to get IShellFolder, can't run tests\n");
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);
4713 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);
4724 ok(
hres == exp_err,
"ParseDisplayName failed with wrong error: 0x%08x\n",
hres);
4727 hres = IBindCtx_RegisterObjectParam(pbc, wFileSystemBindData, (
IUnknown*)&
fsbd);
4850 IBindCtx_Release(pbc);
4851 IShellFolder_Release(psf);
4855#define WM_USER_NOTIFY (WM_APP+1)
4865 {
"MKDIR", 1, 0,
SHCNE_MKDIR,
"C:\\shell32_cn_test\\test",
""},
4866 {
"CREATE", 1, 0,
SHCNE_CREATE,
"C:\\shell32_cn_test\\test\\file.txt",
""},
4867 {
"RMDIR", 1, 0,
SHCNE_RMDIR,
"C:\\shell32_cn_test\\test",
""},
4886 ok(hLock !=
NULL,
"SHChangeNotification_Lock returned NULL\n");
4890 "%s: expected notification type %x, got: %x\n",
4906 ok(0,
"Didn't expect a WM_USER_NOTIFY message (event: %x)\n",
signal);
4918 cls.
cbSize =
sizeof(cls);
4934 while (
exp_data->missing_events && (
c++ < 10)){
4951 BOOL br, has_unicode;
4953 const CHAR root_dirA[] =
"C:\\shell32_cn_test";
4954 const WCHAR root_dirW[] = {
'C',
':',
'\\',
's',
'h',
'e',
'l',
'l',
'3',
'2',
'_',
'c',
'n',
'_',
't',
'e',
's',
't',0};
4956 trace(
"SHChangeNotify tests (%x)\n", test_new_delivery);
4962 if(!test_new_delivery)
4968 ok(wnd !=
NULL,
"Failed to make a window\n");
4978 ok(
hr ==
S_OK,
"SHILCreateFromPath failed: 0x%08x\n",
hr);
4983 ok(notifyID != 0,
"Failed to register a window for change notifications\n");
4994 ok(
exp_data->missing_events == 0,
"%s: Expected wndproc to be called\n",
exp_data->id);
5005 ok(
exp_data->missing_events == 0,
"%s: Expected wndproc to be called\n",
exp_data->id);
5033 {
'\\',
't',
'e',
's',
't',
'd',
'i',
'r',
'\\',
't',
'e',
's',
't',
'1',
'.',
't',
'x',
't',0};
5034 if(!pSHCreateDefaultContextMenu)
5036 win_skip(
"SHCreateDefaultContextMenu missing.\n");
5043 skip(
"GetCurrentDirectoryW returned an empty string.\n");
5058 IShellFolder_QueryInterface(
folder,&IID_IPersistFolder2,(
void**)&persist);
5059 IPersistFolder2_GetCurFolder(persist,&pidlFolder);
5060 IPersistFolder2_Release(persist);
5073 hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(
void**)&cmenu);
5076 IContextMenu_Release(cmenu);
5079 hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(
void**)&cmenu);
5082 IContextMenu_Release(cmenu);
5090 hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(
void**)&cmenu);
5093 IContextMenu_Release(cmenu);
5097 IShellFolder_Release(
folder);
5099 IShellFolder_Release(desktop);
5112 DWORD cf_shellidlist;
5117 hres = IShellFolder_EnumObjects(desktop,
NULL,
5118 SHCONTF_NONFOLDERS|SHCONTF_FOLDERS|SHCONTF_INCLUDEHIDDEN, &peidl);
5121 if(IEnumIDList_Next(peidl, 1, &apidl,
NULL) !=
S_OK) {
5122 skip(
"no files on desktop - skipping GetDataObject tests\n");
5123 IEnumIDList_Release(peidl);
5124 IShellFolder_Release(desktop);
5127 IEnumIDList_Release(peidl);
5133 IShellFolder_Release(desktop);
5136 fmt.cfFormat = cf_shellidlist;
5138 fmt.dwAspect = DVASPECT_CONTENT;
5140 fmt.tymed = TYMED_HGLOBAL;
5141 hres = IDataObject_QueryGetData(data_obj, &
fmt);
5144 fmt.tymed = TYMED_HGLOBAL | TYMED_ISTREAM;
5145 hres = IDataObject_QueryGetData(data_obj, &
fmt);
5148 fmt.tymed = TYMED_ISTREAM;
5149 hres = IDataObject_QueryGetData(data_obj, &
fmt);
5152 fmt.tymed = TYMED_HGLOBAL | TYMED_ISTREAM;
5153 hres = IDataObject_GetData(data_obj, &
fmt, &medium);
5155 ok(medium.tymed == TYMED_HGLOBAL,
"medium.tymed = %x\n", medium.tymed);
5158 IDataObject_Release(data_obj);
5163 static const CLSID *folders[] =
5167 &CLSID_ControlPanel,
5168 &CLSID_NetworkPlaces,
5171 &CLSID_ShellDesktop,
5196 ok(
sort == 123 &&
display == 123,
"Unexpected default column.\n");
5201 ok(
display == 123,
"Unexpected default column.\n");
5206 ok(
sort == 123,
"Unexpected default column.\n");
5208 IShellFolder2_Release(
folder);
5216 static const CLSID *folders[] =
5220 &CLSID_ControlPanel,
5221 &CLSID_NetworkPlaces,
5224 &CLSID_ShellDesktop,
5251 hr = IShellFolder2_GetDefaultSearchGUID(
folder, &
guid);
5256 IShellFolder2_Release(
folder);
5269 ok(
hr ==
S_OK,
"Failed to get desktop folder, hr %#x.\n",
hr);
5275 hwnd =
CreateWindowA(
"EDIT",
NULL,
WS_VISIBLE, 0, 0, 100, 30,
NULL,
NULL,
NULL,
NULL);
5276 ok(
hwnd !=
NULL,
"Failed to create Edit control.\n");
5280 ok(
hr ==
S_OK,
"Failed to set input limits, hr %#x.\n",
hr);
5284 ok(
hr ==
S_OK,
"Failed to set input limits, hr %#x.\n",
hr);
5287 IShellFolder_Release(desktop);
5293 SHFOLDERCUSTOMSETTINGS fcs;
5297 static const WCHAR somedirW[] = {
's',
'o',
'm',
'e',
'_',
'd',
'i',
'r',0};
5298 static const WCHAR iconW[] = {
'\\',
's',
'o',
'm',
'e',
'_',
'i',
'c',
'o',
'n',
'.',
'i',
'c',
'o',0};
5299 static const WCHAR desktop_iniW[] = {
'\\',
'D',
'e',
's',
'k',
't',
'o',
'p',
'.',
'i',
'n',
'i',0};
5301 if (!pSHGetSetFolderCustomSettings)
5303 win_skip(
"SHGetSetFolderCustomSetting not exported by name (only by ordinal) for version XP/win2003\n");
5314 memset(&fcs, 0,
sizeof(fcs));
5315 fcs.dwSize =
sizeof(fcs);
5317 fcs.pszIconFile = iconpathW;
5320 ok(
hr ==
S_OK,
"Expected S_OK, got %#x\n",
hr);
5322 memset(&fcs, 0,
sizeof(fcs));
5323 fcs.dwSize =
sizeof(fcs);
5326 fcs.pszIconFile = bufferW;
5329 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)
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)
DWORD WINAPI GetVersion(void)
DWORD WINAPI DECLSPEC_HOTPATCH GetLogicalDrives(void)
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)
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)
static const BOOL is_win64
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 todo_wine_if(is_todo)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
#define FILE_FLAG_WRITE_THROUGH
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static PEXPLICIT_ACCESSW *static HMODULE hmod
static void test_contextmenu(void)
const IID IID_IObjectWithSite
static const char * strw(LPCWSTR x)
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[]
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
#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)
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 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 struct @1835 parse_tests[]
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)
#define REGDB_E_CLASSNOTREG
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define ERROR_PATH_NOT_FOUND
#define ERROR_NO_ASSOCIATION
#define ERROR_FILENAME_EXCED_RANGE
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)