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);
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
GLubyte GLubyte GLubyte GLubyte w
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
char * strcat(char *DstString, const char *SrcString)
GLdouble GLdouble GLdouble r
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
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
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
char * strcpy(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
static LPITEMIDLIST path_to_pidl(const char *path)
ITEMIDLIST UNALIGNED * LPITEMIDLIST