30#include "commoncontrols.h"
41#ifndef SLDF_HAS_LOGO3ID
42# define SLDF_HAS_LOGO3ID 0x00000800
57 0x45e2b4ae, 0xb1c3, 0x11d0,
58 { 0xb9, 0x2f, 0x00, 0xa0, 0xc9, 0x03, 0x12, 0xe1 }
72 if (!pSHSimpleIDListFromPathAW)
76 if (!pSHSimpleIDListFromPathAW)
77 win_skip(
"SHSimpleIDListFromPathAW not found in shell32.dll\n");
82 if (pSHSimpleIDListFromPathAW && (
GetVersion() & 0x80000000))
83 pidl=pSHSimpleIDListFromPathAW(
path);
95 r=pSHILCreateFromPath(pathW, &pidl,
NULL);
96 ok(
r ==
S_OK,
"SHILCreateFromPath failed (0x%08x)\n",
r);
121 &IID_IShellLinkA, (
LPVOID*)&sl);
122 ok(
r ==
S_OK,
"no IID_IShellLinkA (0x%08x)\n",
r);
129 ok(
r ==
S_OK,
"GetDescription failed (0x%08x)\n",
r);
132 str=
"Some description";
133 r = IShellLinkA_SetDescription(sl,
str);
134 ok(
r ==
S_OK,
"SetDescription failed (0x%08x)\n",
r);
138 ok(
r ==
S_OK,
"GetDescription failed (0x%08x)\n",
r);
141 r = IShellLinkA_SetDescription(sl,
NULL);
142 ok(
r ==
S_OK,
"SetDescription failed (0x%08x)\n",
r);
146 ok(
r ==
S_OK,
"GetDescription failed (0x%08x)\n",
r);
151 r = IShellLinkA_GetWorkingDirectory(sl,
buffer,
sizeof(
buffer));
152 ok(
r ==
S_OK,
"GetWorkingDirectory failed (0x%08x)\n",
r);
155 str=
"c:\\nonexistent\\directory";
156 r = IShellLinkA_SetWorkingDirectory(sl,
str);
157 ok(
r ==
S_OK,
"SetWorkingDirectory failed (0x%08x)\n",
r);
160 r = IShellLinkA_GetWorkingDirectory(sl,
buffer,
sizeof(
buffer));
161 ok(
r ==
S_OK,
"GetWorkingDirectory failed (0x%08x)\n",
r);
171 memset(&finddata, 0xaa,
sizeof(finddata));
172 r = IShellLinkA_GetPath(sl,
buffer,
sizeof(
buffer), &finddata, SLGP_RAWPATH);
175 ok(finddata.dwFileAttributes == 0,
"unexpected attributes %x\n", finddata.dwFileAttributes);
176 ok(finddata.cFileName[0] == 0,
"unexpected filename '%s'\n", finddata.cFileName);
179 &IID_IShellLinkW, (
LPVOID*)&slW);
180 ok(
r ==
S_OK,
"CoCreateInstance failed (0x%08x)\n",
r);
181 if (!slW || !pGetLongPathNameA )
182 skip(
"SetPath with NULL parameter crashes on Win9x and some NT4\n");
185 IShellLinkW_Release(slW);
186 r = IShellLinkA_SetPath(sl,
NULL);
189 "SetPath returned wrong error (0x%08x)\n",
r);
192 r = IShellLinkA_SetPath(sl,
"");
193 ok(
r==
S_OK,
"SetPath failed (0x%08x)\n",
r);
201 str=
"c:\\nonexistent\\file";
202 r = IShellLinkA_SetPath(sl,
str);
207 ok(
r ==
S_OK,
"GetPath failed (0x%08x)\n",
r);
211 memset(&finddata, 0xaa,
sizeof(finddata));
212 r = IShellLinkA_GetPath(sl,
buffer,
sizeof(
buffer), &finddata, SLGP_RAWPATH);
213 ok(
r ==
S_OK,
"GetPath failed (0x%08x)\n",
r);
215 ok(finddata.dwFileAttributes == 0,
"unexpected attributes %x\n", finddata.dwFileAttributes);
216 ok(
lstrcmpiA(finddata.cFileName,
"file") == 0,
"unexpected filename '%s'\n", finddata.cFileName);
224 r = IShellLinkA_GetIDList(sl, &tmp_pidl);
225 ok(
r ==
S_OK,
"GetIDList failed (0x%08x)\n",
r);
232 ok(
ret,
"SHGetPathFromIDListA failed\n");
239 ok(pidl!=
NULL,
"path_to_pidl returned a NULL pidl\n");
245 r = IShellLinkA_SetIDList(sl, pidl);
246 ok(
r ==
S_OK,
"SetIDList failed (0x%08x)\n",
r);
249 r = IShellLinkA_GetIDList(sl, &tmp_pidl);
250 ok(
r ==
S_OK,
"GetIDList failed (0x%08x)\n",
r);
251 ok(tmp_pidl && pILIsEqual(pidl, tmp_pidl),
252 "GetIDList returned an incorrect pidl\n");
254 r = IShellLinkA_GetIDList(sl, &second_pidl);
255 ok(
r ==
S_OK,
"GetIDList failed (0x%08x)\n",
r);
256 ok(second_pidl && pILIsEqual(pidl, second_pidl),
257 "GetIDList returned an incorrect pidl\n");
258 ok(second_pidl != tmp_pidl,
"pidls are the same\n");
260 pILFree(second_pidl);
266 ok(
r ==
S_OK,
"GetPath failed (0x%08x)\n",
r);
270 memset(&finddata, 0xaa,
sizeof(finddata));
271 r = IShellLinkA_GetPath(sl,
buffer,
sizeof(
buffer), &finddata, SLGP_RAWPATH);
272 ok(
r ==
S_OK,
"GetPath failed (0x%08x)\n",
r);
274 ok(finddata.dwFileAttributes != 0,
"unexpected attributes %x\n", finddata.dwFileAttributes);
275 ok(
lstrcmpiA(finddata.cFileName,
"regedit.exe") == 0,
"unexpected filename '%s'\n", finddata.cFileName);
278 if (pSHGetFolderLocation)
283 ok(
r ==
S_OK,
"SHGetFolderLocation failed (0x%08x)\n",
r);
285 r = IShellLinkA_SetIDList(sl, pidl_controls);
286 ok(
r ==
S_OK,
"SetIDList failed (0x%08x)\n",
r);
294 memset(&finddata, 0xaa,
sizeof(finddata));
295 r = IShellLinkA_GetPath(sl,
buffer,
sizeof(
buffer), &finddata, SLGP_RAWPATH);
298 ok(finddata.dwFileAttributes == 0,
"unexpected attributes %x\n", finddata.dwFileAttributes);
299 ok(finddata.cFileName[0] == 0,
"unexpected filename '%s'\n", finddata.cFileName);
301 pILFree(pidl_controls);
305 r = IShellLinkA_SetPath(sl,
"\"c:\\nonexistent\\file\"");
310 ok(
r==
S_OK,
"GetPath failed (0x%08x)\n",
r);
313 "case doesn't match\n");
315 r = IShellLinkA_SetPath(sl,
"\"c:\\foo");
318 r = IShellLinkA_SetPath(sl,
"\"\"c:\\foo");
321 r = IShellLinkA_SetPath(sl,
"c:\\foo\"");
324 r = IShellLinkA_SetPath(sl,
"\"\"c:\\foo\"");
327 r = IShellLinkA_SetPath(sl,
"\"\"c:\\foo\"\"");
333 ok(
r ==
S_OK,
"GetArguments failed (0x%08x)\n",
r);
336 str=
"param1 \"spaced param2\"";
337 r = IShellLinkA_SetArguments(sl,
str);
338 ok(
r ==
S_OK,
"SetArguments failed (0x%08x)\n",
r);
342 ok(
r ==
S_OK,
"GetArguments failed (0x%08x)\n",
r);
346 r = IShellLinkA_SetArguments(sl,
NULL);
347 ok(
r ==
S_OK,
"SetArguments failed (0x%08x)\n",
r);
349 ok(
r ==
S_OK,
"GetArguments failed (0x%08x)\n",
r);
353 r = IShellLinkA_SetArguments(sl,
"");
354 ok(
r ==
S_OK,
"SetArguments failed (0x%08x)\n",
r);
356 ok(
r ==
S_OK,
"GetArguments failed (0x%08x)\n",
r);
361 r = IShellLinkA_GetShowCmd(sl, &
i);
362 ok(
r ==
S_OK,
"GetShowCmd failed (0x%08x)\n",
r);
366 ok(
r ==
S_OK,
"SetShowCmd failed (0x%08x)\n",
r);
369 r = IShellLinkA_GetShowCmd(sl, &
i);
370 ok(
r ==
S_OK,
"GetShowCmd failed (0x%08x)\n",
r);
377 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
379 ok(
i==0,
"GetIconLocation returned %d\n",
i);
381 str=
"c:\\nonexistent\\file";
382 r = IShellLinkA_SetIconLocation(sl,
str, 0xbabecafe);
383 ok(
r ==
S_OK,
"SetIconLocation failed (0x%08x)\n",
r);
387 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
389 ok(
i==0xbabecafe,
"GetIconLocation returned %d'\n",
i);
393 r = IShellLinkA_GetHotkey(sl, &
w);
394 ok(
r ==
S_OK,
"GetHotkey failed (0x%08x)\n",
r);
395 ok(
w==0,
"GetHotkey returned %d\n",
w);
397 r = IShellLinkA_SetHotkey(sl, 0x5678);
398 ok(
r ==
S_OK,
"SetHotkey failed (0x%08x)\n",
r);
401 r = IShellLinkA_GetHotkey(sl, &
w);
402 ok(
r ==
S_OK,
"GetHotkey failed (0x%08x)\n",
r);
403 ok(
w==0x5678,
"GetHotkey returned %d'\n",
w);
405 IShellLinkA_Release(sl);
413#define lok ok_(__FILE__, line)
414#define check_lnk(a,b,c) check_lnk_(__LINE__, (a), (b), (c))
423 &IID_IShellLinkA, (
LPVOID*)&sl);
424 lok(
r ==
S_OK,
"no IID_IShellLinkA (0x%08x)\n",
r);
428 if (
desc->description)
430 r = IShellLinkA_SetDescription(sl,
desc->description);
431 lok(
r ==
S_OK,
"SetDescription failed (0x%08x)\n",
r);
435 r = IShellLinkA_SetWorkingDirectory(sl,
desc->workdir);
436 lok(
r ==
S_OK,
"SetWorkingDirectory failed (0x%08x)\n",
r);
440 r = IShellLinkA_SetPath(sl,
desc->path);
445 r = IShellLinkA_SetIDList(sl,
desc->pidl);
446 lok(
r ==
S_OK,
"SetIDList failed (0x%08x)\n",
r);
450 r = IShellLinkA_SetArguments(sl,
desc->arguments);
451 lok(
r ==
S_OK,
"SetArguments failed (0x%08x)\n",
r);
455 r = IShellLinkA_SetShowCmd(sl,
desc->showcmd);
456 lok(
r ==
S_OK,
"SetShowCmd failed (0x%08x)\n",
r);
460 r = IShellLinkA_SetIconLocation(sl,
desc->icon,
desc->icon_id);
461 lok(
r ==
S_OK,
"SetIconLocation failed (0x%08x)\n",
r);
465 r = IShellLinkA_SetHotkey(sl,
desc->hotkey);
466 lok(
r ==
S_OK,
"SetHotkey failed (0x%08x)\n",
r);
470 lok(
r ==
S_OK,
"no IID_IPersistFile (0x%08x)\n",
r);
478 IPersistFile_GetCurFile(pf,
NULL);
483 r = IPersistFile_GetCurFile(pf, &
str);
491 lok(
r ==
S_OK,
"save failed (0x%08x)\n",
r);
494 r = IPersistFile_GetCurFile(pf, &
str);
498 "Didn't expect NULL\n");
510 win_skip(
"GetCurFile fails on shell32 < 5.0\n");
512 IPersistFile_Release(pf);
515 IShellLinkA_Release(sl);
527 &IID_IShellLinkA, (
LPVOID*)&sl);
528 lok(
r ==
S_OK,
"no IID_IShellLinkA (0x%08x)\n",
r);
533 lok(
r ==
S_OK,
"no IID_IPersistFile (0x%08x)\n",
r);
536 IShellLinkA_Release(sl);
542 r = IPersistFile_GetCurFile(pf, &
str);
549 lok(
r ==
S_OK,
"load failed (0x%08x)\n",
r);
552 r = IPersistFile_GetCurFile(pf, &
str);
556 "Didn't expect NULL\n");
568 win_skip(
"GetCurFile fails on shell32 < 5.0\n");
570 IPersistFile_Release(pf);
573 IShellLinkA_Release(sl);
577 if (
desc->description)
581 lok(
r ==
S_OK,
"GetDescription failed (0x%08x)\n",
r);
583 lok(
strcmp(
buffer,
desc->description)==0,
"GetDescription returned '%s' instead of '%s'\n",
589 r = IShellLinkA_GetWorkingDirectory(sl,
buffer,
sizeof(
buffer));
590 lok(
r ==
S_OK,
"GetWorkingDirectory failed (0x%08x)\n",
r);
607 r = IShellLinkA_GetIDList(sl, &pidl);
608 lok(
r ==
S_OK,
"GetIDList failed (0x%08x)\n",
r);
610 lok(pILIsEqual(pidl,
desc->pidl),
"GetIDList returned an incorrect pidl\n");
615 r = IShellLinkA_GetShowCmd(sl, &
i);
616 lok(
r ==
S_OK,
"GetShowCmd failed (0x%08x)\n",
r);
618 lok(
i==
desc->showcmd,
"GetShowCmd returned 0x%0x instead of 0x%0x\n",
626 lok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
630 lok(
i==
desc->icon_id,
"GetIconLocation returned 0x%0x instead of 0x%0x\n",
637 r = IShellLinkA_GetHotkey(sl, &
i);
638 lok(
r ==
S_OK,
"GetHotkey failed (0x%08x)\n",
r);
640 lok(
i==
desc->hotkey,
"GetHotkey returned 0x%04x instead of 0x%04x\n",
644 IShellLinkA_Release(sl);
651 static const char lnkfileA_name[] =
"\\test.lnk";
661 if (!pGetLongPathNameA)
663 win_skip(
"GetLongPathNameA is not available\n");
686 desc.workdir=
"c:\\Nonexitent\\work\\directory";
687 desc.path=
"c:\\nonexistent\\path";
691 desc.icon=
"c:\\nonexistent\\icon\\file";
698 ok(
r<
sizeof(
mypath),
"GetModuleFileName failed (%d)\n",
r);
708 desc.description=
"test 2";
712 desc.arguments=
"/option1 /option2 \"Some string\"";
725 desc.description=
"absolute path without .exe";
729 desc.arguments=
"/option1 /option2 \"Some string\"";
739 desc.description=
"command on path";
741 desc.path=
"rundll32.exe";
743 desc.arguments=
"/option1 /option2 \"Some string\"";
755 desc.description=
"command on path without .exe";
757 desc.path=
"rundll32";
759 desc.arguments=
"/option1 /option2 \"Some string\"";
773 r=pGetLongPathNameA(
mypath, mydir,
sizeof(mydir));
774 ok(
r<
sizeof(mydir),
"GetLongPathName failed (%d), err %d\n",
r,
GetLastError());
786 desc.description=
"non-executable file";
802 strcat(realpath,
"\\test.txt");
806 desc.description=
"non-executable file";
836 desc.description=
"batch file";
846 desc.path = realpath;
863 static const WCHAR lnk[] = {
864 ':',
':',
'{',
'9',
'd',
'b',
'1',
'1',
'8',
'6',
'e',
'-',
'4',
'0',
'd',
'f',
'-',
'1',
865 '1',
'd',
'1',
'-',
'a',
'a',
'8',
'c',
'-',
'0',
'0',
'c',
'0',
'4',
'f',
'b',
'6',
'7',
866 '8',
'6',
'3',
'}',
':',
'2',
'6',
',',
'!',
'!',
'g',
'x',
's',
'f',
'(',
'N',
'g',
']',
867 'q',
'F',
'`',
'H',
'{',
'L',
's',
'A',
'C',
'C',
'E',
'S',
'S',
'F',
'i',
'l',
'e',
's',
868 '>',
'p',
'l',
'T',
']',
'j',
'I',
'{',
'j',
'f',
'(',
'=',
'1',
'&',
'L',
'[',
'-',
'8',
869 '1',
'-',
']',
':',
':',0 };
870 static const WCHAR comp[] = {
871 '2',
'6',
',',
'!',
'!',
'g',
'x',
's',
'f',
'(',
'N',
'g',
']',
'q',
'F',
'`',
'H',
'{',
872 'L',
's',
'A',
'C',
'C',
'E',
'S',
'S',
'F',
'i',
'l',
'e',
's',
'>',
'p',
'l',
'T',
']',
873 'j',
'I',
'{',
'j',
'f',
'(',
'=',
'1',
'&',
'L',
'[',
'-',
'8',
'1',
'-',
']',0 };
881 &IID_IShellLinkW, (
LPVOID*)&sl );
884 "CoCreateInstance failed (0x%08x)\n",
r);
894 "IShellLinkW_QueryInterface failed (0x%08x)\n",
r);
898 win_skip(
"no datalink interface\n");
899 IShellLinkW_Release( sl );
904 r = IShellLinkDataList_GetFlags( dl, &
flags );
905 ok(
r ==
S_OK,
"GetFlags failed\n");
906 ok(
flags == 0,
"GetFlags returned wrong flags\n");
910 ok(
r ==
E_FAIL,
"CopyDataBlock failed\n");
911 ok( dar ==
NULL,
"should be null\n");
913 if (!pGetLongPathNameA )
914 skip(
"SetPath with NULL parameter crashes on NT4\n");
917 r = IShellLinkW_SetPath(sl,
NULL);
921 r = IShellLinkW_SetPath(sl, lnk);
922 ok(
r ==
S_OK,
"SetPath failed\n");
927 IShellLinkDataList_GetFlags( dl,
NULL );
931 r = IShellLinkDataList_GetFlags( dl, &
flags );
932 ok(
r ==
S_OK,
"GetFlags failed\n");
935 "GetFlags returned wrong flags\n");
939 ok(
r ==
S_OK,
"CopyDataBlock failed\n");
946 IShellLinkDataList_Release( dl );
947 IShellLinkW_Release( sl );
955 if (!pSHDefExtractIconA)
957 win_skip(
"SHDefExtractIconA is unavailable\n");
961 res = pSHDefExtractIconA(
"shell32.dll", 0, 0, &hiconlarge, &hiconsmall,
MAKELONG(16,24));
963 ok(hiconlarge !=
NULL,
"got null hiconlarge\n");
964 ok(hiconsmall !=
NULL,
"got null hiconsmall\n");
969 res = pSHDefExtractIconA(
"shell32.dll", 0, 0,
NULL, &hiconsmall,
MAKELONG(16,24));
971 ok(hiconsmall !=
NULL,
"got null hiconsmall\n");
989 &IID_IShellLinkA, (
LPVOID*)&sl);
990 ok(
r ==
S_OK,
"no IID_IShellLinkA (0x%08x)\n",
r);
997 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
999 ok(
i == 0,
"GetIconLocation returned %d\n",
i);
1001 str =
"c:\\some\\path";
1002 r = IShellLinkA_SetPath(sl,
str);
1008 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
1010 ok(
i == 0,
"GetIconLocation returned %d\n",
i);
1015 r = IShellLinkA_SetIDList(sl, pidl);
1016 ok(
r ==
S_OK,
"SetPath failed (0x%08x)\n",
r);
1022 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
1024 ok(
i == 0,
"GetIconLocation returned %d\n",
i);
1026 str =
"c:\\nonexistent\\file";
1027 r = IShellLinkA_SetIconLocation(sl,
str, 0xbabecafe);
1028 ok(
r ==
S_OK,
"SetIconLocation failed (0x%08x)\n",
r);
1032 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
1034 ok(
i == 0xbabecafe,
"GetIconLocation returned %#x.\n",
i);
1036 r = IShellLinkA_SetIconLocation(sl,
NULL, 0xcafefe);
1037 ok(
r ==
S_OK,
"SetIconLocation failed (0x%08x)\n",
r);
1041 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
1043 ok(
i == 0xcafefe,
"GetIconLocation returned %#x.\n",
i);
1045 r = IShellLinkA_QueryInterface(sl, &IID_IShellLinkW, (
void **)&slW);
1046 ok(
SUCCEEDED(
r),
"Failed to get IShellLinkW, hr %#x.\n",
r);
1048 str =
"c:\\nonexistent\\file";
1049 r = IShellLinkA_SetIconLocation(sl,
str, 0xbabecafe);
1050 ok(
r ==
S_OK,
"SetIconLocation failed (0x%08x)\n",
r);
1052 r = IShellLinkA_SetIconLocation(sl,
NULL, 0xcafefe);
1053 ok(
r ==
S_OK,
"SetIconLocation failed (0x%08x)\n",
r);
1057 ok(
r ==
S_OK,
"GetIconLocation failed (0x%08x)\n",
r);
1059 ok(
i == 0xcafefe,
"GetIconLocation returned %#x.\n",
i);
1061 IShellLinkW_Release(slW);
1062 IShellLinkA_Release(sl);
1073 if (!pSHGetStockIconInfo)
1075 win_skip(
"SHGetStockIconInfo not available\n");
1093 "%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n",
1094 i,
hr, sii->iSysImageIndex, sii->iIcon);
1097 trace(
"%3d: got iSysImageIndex %3d, iIcon %3d and %s\n",
i, sii->iSysImageIndex,
1109 ok(sii->iSysImageIndex == -1,
"%d: got iSysImageIndex %d\n",
i, sii->iSysImageIndex);
1110 ok(sii->iIcon == -1,
"%d: got iIcon %d\n",
i, sii->iIcon);
1118 ok(
hr ==
S_OK,
"got 0x%x (expected S_OK)\n",
hr);
1119 ok(!sii->hIcon,
"got %p (expected NULL)\n", sii->hIcon);
1120 ok(sii->iSysImageIndex == -1,
"got %d (expected -1)\n", sii->iSysImageIndex);
1126 ok(
hr ==
E_INVALIDARG,
"+2: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n",
hr, sii->iSysImageIndex, sii->iIcon);
1131 ok(
hr ==
E_INVALIDARG,
"+1: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n",
hr, sii->iSysImageIndex, sii->iIcon);
1136 ok(
hr ==
E_INVALIDARG,
"-1: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n",
hr, sii->iSysImageIndex, sii->iIcon);
1141 ok(
hr ==
E_INVALIDARG,
"-2: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n",
hr, sii->iSysImageIndex, sii->iIcon);
1147 for(
i = 0;
i < 140;
i++)
1152 ok(
hr ==
S_OK,
"got 0x%x (expected S_OK)\n",
hr);
1153 ok(sii->hIcon !=
NULL,
"got NULL, expected an icon handle\n");
1154 ok(sii->iIcon != 0,
"got unexpected 0 for SIID %d\n",
i);
1155 ok(sii->iSysImageIndex == -1,
"got %d (expected -1)\n", sii->iSysImageIndex);
1158 trace(
"%3d: got iSysImageIndex %3d, iIcon %3d and %s\n",
i, sii->iSysImageIndex,
1165 static const WCHAR notepadW[] = {
'n',
'o',
't',
'e',
'p',
'a',
'd',
'.',
'e',
'x',
'e',0};
1166 static const WCHAR shell32W[] = {
's',
'h',
'e',
'l',
'l',
'3',
'2',
'.',
'd',
'l',
'l',0};
1172 if (!pSHExtractIconsW)
1174 win_skip(
"SHExtractIconsW not available\n");
1178 ret = pSHExtractIconsW(
emptyW, 0, 16, 16, icons,
ids, 1, 0);
1181 ret = pSHExtractIconsW(notepadW, 0, 16, 16,
NULL,
NULL, 1, 0);
1184 icons[0] = (
HICON)0xdeadbeef;
1185 ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons,
NULL, 1, 0);
1187 ok(icons[0] != (
HICON)0xdeadbeef,
"icon not set\n");
1190 icons[0] = (
HICON)0xdeadbeef;
1191 ids[0] = 0xdeadbeef;
1192 ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons,
ids, 1, 0);
1194 ok(icons[0] != (
HICON)0xdeadbeef,
"icon not set\n");
1195 ok(
ids[0] != 0xdeadbeef,
"id not set\n");
1198 ret = pSHExtractIconsW(shell32W, 0, 16, 16,
NULL,
NULL, 0, 0);
1201 "icon count should be independent of requested icon sizes and base icon index\n");
1203 ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons,
ids, 0, 0);
1206 ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons,
ids, 3, 0);
1228 &IID_IShellLinkA, (
void**)&linkA);
1231 hr = IShellLinkA_QueryInterface(linkA, &IID_IShellLinkW, (
void**)&
linkW);
1234 hr = IShellLinkA_QueryInterface(linkA, &IID_IPropertyStore, (
void**)&ps);
1238 IPropertyStore_Release(ps);
1240 hr = IShellLinkW_QueryInterface(
linkW, &IID_IPropertyStore, (
void**)&ps);
1243 hr = IPropertyStore_QueryInterface(ps, &IID_IPropertyStoreCache, (
void**)&pscache);
1246 IPropertyStore_Release(ps);
1249 win_skip(
"IShellLink doesn't support IPropertyStore.\n");
1251 IShellLinkA_Release(linkA);
1252 IShellLinkW_Release(
linkW);
1257 static const WCHAR nameW[] = {
'\\',
'e',
'x',
't',
'r',
'a',
'c',
't',
'i',
'c',
'o',
'n',
'_',
't',
'e',
's',
't',
'.',
't',
'x',
't',0};
1258 static const WCHAR shell32W[] = {
's',
'h',
'e',
'l',
'l',
'3',
'2',
'.',
'd',
'l',
'l',0};
1260 HICON hicon, hicon2;
1270 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1272 ok(hicon2 !=
NULL,
"Got icon %p\n", hicon2);
1281 ok(
HandleToLong(hicon) > 1 && hicon == hicon2,
"Got icon %p\n", hicon);
1285 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1296 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1299 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1303 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1313 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1316 ok(hicon2 !=
NULL,
"Got icon %p\n", hicon2);
1329 ok(
HandleToLong(hicon) > 1 && hicon == hicon2,
"Got icon %p\n", hicon);
1333 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1344 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1347 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1351 ok(hicon ==
NULL,
"Got icon %p\n", hicon);
1368 ok(hicon !=
NULL,
"Got icon %p\n", hicon);
1378 ok(hicon !=
NULL,
"Got icon %p\n", hicon);
1389 ok(hicon !=
NULL,
"Got icon %p\n", hicon);
1401 ok(hicon !=
NULL,
"Got icon %p\n", hicon);
1429 ULONG start_refs, refs;
1431 BOOL dpi_aware = pIsProcessDPIAware && pIsProcessDPIAware();
1435 start_refs = IImageList_AddRef(
list );
1436 IImageList_Release(
list );
1440 ok(
list == list2,
"lists differ\n" );
1441 refs = IImageList_AddRef(
list );
1442 IImageList_Release(
list );
1443 ok( refs == start_refs + 1,
"got %d, start_refs %d\n", refs, start_refs );
1444 IImageList_Release( list2 );
1455 refs = IImageList_AddRef(
list );
1456 IImageList_Release(
list );
1457 ok( refs == start_refs,
"got %d, start_refs %d\n", refs, start_refs );
1459 IImageList_Release( list2 );
1460 IImageList_Release(
list );
1467 "%d: got %08x\n",
i,
hr );
1495 IImageList_Release(
list );
1518 ok(
r ==
S_OK,
"CoInitialize failed (0x%08x)\n",
r);
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static const WCHAR nameW[]
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
static const WCHAR linkW[]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
GLubyte GLubyte GLubyte GLubyte w
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon)
static const WCHAR emptyW[]
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
static PEXPLICIT_ACCESSW *static HMODULE hmod
static const WCHAR desc[]
static HINSTANCE hkernel32
#define todo_wine_if(is_todo)
static void *__cdecl * pmalloc(unsigned int)
const GUID IID_IPersistFile
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
DWORD WINAPI GetVersion()
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
static int winetest_strcmpW(const WCHAR *str1, const WCHAR *str2)
HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex)
#define create_lnk(a, b, c)
struct _SHSTOCKICONINFO SHSTOCKICONINFO
#define SHGSI_ICONLOCATION
static void check_lnk_(int line, const WCHAR *path, lnk_desc_t *desc, int todo)
static LPITEMIDLIST DWORD *static PIDLIST_ABSOLUTE *static UINT
static void test_datalink(void)
static void test_ExtractAssociatedIcon(void)
static SHSTOCKICONINFO *static LPSTR
#define check_lnk(a, b, c)
static void test_propertystore(void)
static void test_shdefextracticon(void)
static const GUID _IID_IShellLinkDataList
static LPITEMIDLIST DWORD *static PIDLIST_ABSOLUTE *static int
void create_lnk_(int line, const WCHAR *path, lnk_desc_t *desc, int save_fails)
static LPITEMIDLIST DWORD *static DWORD
static void test_get_set(void)
static void test_SHGetImageList(void)
static void test_SHExtractIcons(void)
static LPITEMIDLIST DWORD *static HANDLE
static void test_load_save(void)
static LPITEMIDLIST DWORD *static INT
static void test_SHGetStockIconInfo(void)
static LPITEMIDLIST path_to_pidl(const char *path)
static void test_ExtractIcon(void)
static int get_shell_icon_size(void)
static void test_GetIconLocation(void)
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
#define EXP_DARWIN_ID_SIG
ITEMIDLIST UNALIGNED * LPITEMIDLIST
WCHAR szwDarwinID[MAX_PATH]
DWORD WINAPI GetLastError(void)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define HKEY_CURRENT_USER
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
DWORD WINAPI CharLowerBuffA(_Inout_updates_(cchLength) LPSTR lpsz, _In_ DWORD cchLength)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)