3 * Copyright 1997 Marcus Meissner
4 * Copyright 1998 Juergen Schmied
9 #include "debugtools.h"
12 #include "wine/obj_base.h"
13 #include "wine/obj_storage.h"
14 #include "wine/obj_shelllink.h"
19 #include "shell32_main.h"
22 DEFAULT_DEBUG_CHANNEL(shell)
24 /* link file formats */
28 /* lnk elements: simple link has 0x0B */
35 #define MAXIMIZED 0x03
36 #define MINIMIZED 0x07
38 typedef struct _LINK_HEADER
39 { DWORD MagicStr; /* 0x00 'L','\0','\0','\0' */
40 GUID MagicGuid; /* 0x04 is CLSID_ShellLink */
41 DWORD Flag1; /* 0x14 describes elements following */
42 DWORD Flag2; /* 0x18 */
43 FILETIME Time1; /* 0x1c */
44 FILETIME Time2; /* 0x24 */
45 FILETIME Time3; /* 0x2c */
46 DWORD Unknown1; /* 0x34 */
47 DWORD Unknown2; /* 0x38 icon number */
48 DWORD Flag3; /* 0x3c startup type */
49 DWORD wHotKey; /* 0x40 hotkey */
50 DWORD Unknown5; /* 0x44 */
51 DWORD Unknown6; /* 0x48 */
52 USHORT PidlSize; /* 0x4c */
53 ITEMIDLIST Pidl; /* 0x4e */
54 } LINK_HEADER, * PLINK_HEADER;
56 #define LINK_HEADER_SIZE (sizeof(LINK_HEADER)-sizeof(ITEMIDLIST))
60 static ICOM_VTABLE(IShellLink) slvt;
61 static ICOM_VTABLE(IShellLinkW) slvtw;
62 static ICOM_VTABLE(IPersistFile) pfvt;
63 static ICOM_VTABLE(IPersistStream) psvt;
65 /* IShellLink Implementation */
69 ICOM_VTABLE(IShellLink)* lpvtbl;
72 ICOM_VTABLE(IShellLinkW)* lpvtblw;
73 ICOM_VTABLE(IPersistFile)* lpvtblPersistFile;
74 ICOM_VTABLE(IPersistStream)* lpvtblPersistStream;
76 /* internal stream of the IPersistFile interface */
77 IStream* lpFileStream;
79 /* data structures according to the informations in the lnk */
86 #define _IShellLinkW_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblw)))
87 #define _ICOM_THIS_From_IShellLinkW(class, name) class* This = (class*)(((char*)name)-_IShellLinkW_Offset);
89 #define _IPersistFile_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblPersistFile)))
90 #define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset);
92 #define _IPersistStream_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblPersistStream)))
93 #define _ICOM_THIS_From_IPersistStream(class, name) class* This = (class*)(((char*)name)-_IPersistStream_Offset);
94 #define _IPersistStream_From_ICOM_THIS(class, name) class* StreamThis = (class*)(((char*)name)+_IPersistStream_Offset);
96 /**************************************************************************
97 * IPersistFile_QueryInterface
99 static HRESULT WINAPI IPersistFile_fnQueryInterface(
104 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
106 TRACE("(%p)\n",This);
108 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
111 /******************************************************************************
112 * IPersistFile_AddRef
114 static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface)
116 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
118 TRACE("(%p)->(count=%lu)\n",This,This->ref);
120 return IShellLink_AddRef((IShellLink*)This);
122 /******************************************************************************
123 * IPersistFile_Release
125 static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface)
127 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
129 TRACE("(%p)->(count=%lu)\n",This,This->ref);
131 return IShellLink_Release((IShellLink*)This);
134 static HRESULT WINAPI IPersistFile_fnGetClassID(const IPersistFile* iface, CLSID *pClassID)
136 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
137 FIXME("(%p)\n",This);
140 static HRESULT WINAPI IPersistFile_fnIsDirty(const IPersistFile* iface)
142 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
143 FIXME("(%p)\n",This);
146 static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
148 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
149 _IPersistStream_From_ICOM_THIS(IPersistStream, This)
151 LPSTR sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);
152 HRESULT hRet = E_FAIL;
154 TRACE("(%p, %s)\n",This, sFile);
157 if (This->lpFileStream)
158 IStream_Release(This->lpFileStream);
160 if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream)))
162 if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream))
171 static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
173 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
174 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
177 static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName)
179 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
180 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
183 static HRESULT WINAPI IPersistFile_fnGetCurFile(const IPersistFile* iface, LPOLESTR *ppszFileName)
185 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
186 FIXME("(%p)\n",This);
190 static ICOM_VTABLE(IPersistFile) pfvt =
192 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
193 IPersistFile_fnQueryInterface,
194 IPersistFile_fnAddRef,
195 IPersistFile_fnRelease,
196 IPersistFile_fnGetClassID,
197 IPersistFile_fnIsDirty,
200 IPersistFile_fnSaveCompleted,
201 IPersistFile_fnGetCurFile
204 /************************************************************************
205 * IPersistStream_QueryInterface
207 static HRESULT WINAPI IPersistStream_fnQueryInterface(
208 IPersistStream* iface,
212 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
214 TRACE("(%p)\n",This);
216 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvoid);
219 /************************************************************************
220 * IPersistStream_Release
222 static ULONG WINAPI IPersistStream_fnRelease(
223 IPersistStream* iface)
225 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
227 TRACE("(%p)\n",This);
229 return IShellLink_Release((IShellLink*)This);
232 /************************************************************************
233 * IPersistStream_AddRef
235 static ULONG WINAPI IPersistStream_fnAddRef(
236 IPersistStream* iface)
238 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
240 TRACE("(%p)\n",This);
242 return IShellLink_AddRef((IShellLink*)This);
245 /************************************************************************
246 * IPersistStream_GetClassID
249 static HRESULT WINAPI IPersistStream_fnGetClassID(
250 const IPersistStream* iface,
253 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
255 TRACE("(%p)\n", This);
260 /* memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */
265 /************************************************************************
266 * IPersistStream_IsDirty (IPersistStream)
268 static HRESULT WINAPI IPersistStream_fnIsDirty(
269 IPersistStream* iface)
271 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
273 TRACE("(%p)\n", This);
277 /************************************************************************
278 * IPersistStream_Load (IPersistStream)
281 static HRESULT WINAPI IPersistStream_fnLoad(
282 IPersistStream* iface,
283 IStream* pLoadStream)
285 PLINK_HEADER lpLinkHeader = HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
290 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
292 TRACE("(%p)(%p)\n", This, pLoadStream);
296 return STG_E_INVALIDPOINTER;
299 IStream_AddRef (pLoadStream);
302 if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead)))
304 if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink))
306 lpLinkHeader = HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
309 if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead)))
311 if (pcheck (&lpLinkHeader->Pidl))
313 This->pPidl = ILClone (&lpLinkHeader->Pidl);
315 _ILGetPidlPath(&lpLinkHeader->Pidl, sTemp, 512);
316 This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp);
317 This->wHotKey = lpLinkHeader->wHotKey;
324 { WARN("stream contains no link!\n");
329 /* old code for debugging */
331 FileTimeToSystemTime (&pImage->Time1, &time);
332 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&time, NULL, sTemp, 256);
333 TRACE("-- time1: %s\n", sTemp);
335 pdump (&pImage->Pidl);
338 IStream_Release (pLoadStream);
342 HeapFree(GetProcessHeap(), 0, lpLinkHeader);
347 /************************************************************************
348 * IPersistStream_Save (IPersistStream)
350 static HRESULT WINAPI IPersistStream_fnSave(
351 IPersistStream* iface,
355 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
357 TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty);
362 /************************************************************************
363 * IPersistStream_GetSizeMax (IPersistStream)
365 static HRESULT WINAPI IPersistStream_fnGetSizeMax(
366 IPersistStream* iface,
367 ULARGE_INTEGER* pcbSize)
369 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
371 TRACE("(%p)\n", This);
376 static ICOM_VTABLE(IPersistStream) psvt =
378 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
379 IPersistStream_fnQueryInterface,
380 IPersistStream_fnAddRef,
381 IPersistStream_fnRelease,
382 IPersistStream_fnGetClassID,
383 IPersistStream_fnIsDirty,
384 IPersistStream_fnLoad,
385 IPersistStream_fnSave,
386 IPersistStream_fnGetSizeMax
389 /**************************************************************************
390 * IShellLink_Constructor
392 IShellLink * IShellLink_Constructor(BOOL bUnicode)
393 { IShellLinkImpl * sl;
395 sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(),0,sizeof(IShellLinkImpl));
398 sl->lpvtblw = &slvtw;
399 sl->lpvtblPersistFile = &pfvt;
400 sl->lpvtblPersistStream = &psvt;
403 sl->lpFileStream = NULL;
405 TRACE("(%p)->()\n",sl);
407 return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
410 /**************************************************************************
411 * IShellLink_QueryInterface
413 static HRESULT WINAPI IShellLink_fnQueryInterface( IShellLink * iface, REFIID riid, LPVOID *ppvObj)
415 ICOM_THIS(IShellLinkImpl, iface);
418 WINE_StringFromCLSID((LPCLSID)riid,xriid);
419 TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid);
423 if(IsEqualIID(riid, &IID_IUnknown) ||
424 IsEqualIID(riid, &IID_IShellLink))
428 else if(IsEqualIID(riid, &IID_IShellLinkW))
430 *ppvObj = (IShellLinkW *)&(This->lpvtblw);
432 else if(IsEqualIID(riid, &IID_IPersistFile))
434 *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile);
436 else if(IsEqualIID(riid, &IID_IPersistStream))
438 *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream);
443 IUnknown_AddRef((IUnknown*)(*ppvObj));
444 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
447 TRACE("-- Interface: E_NOINTERFACE\n");
448 return E_NOINTERFACE;
450 /******************************************************************************
453 static ULONG WINAPI IShellLink_fnAddRef(IShellLink * iface)
455 ICOM_THIS(IShellLinkImpl, iface);
457 TRACE("(%p)->(count=%lu)\n",This,This->ref);
460 return ++(This->ref);
462 /******************************************************************************
465 static ULONG WINAPI IShellLink_fnRelease(IShellLink * iface)
467 ICOM_THIS(IShellLinkImpl, iface);
469 TRACE("(%p)->(count=%lu)\n",This,This->ref);
473 { TRACE("-- destroying IShellLink(%p)\n",This);
476 HeapFree(GetProcessHeap(),0,This->sPath);
481 if (This->lpFileStream)
482 IStream_Release(This->lpFileStream);
484 HeapFree(GetProcessHeap(),0,This);
490 static HRESULT WINAPI IShellLink_fnGetPath(IShellLink * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
492 ICOM_THIS(IShellLinkImpl, iface);
494 TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath));
497 strncpy(pszFile,This->sPath, cchMaxPath);
503 static HRESULT WINAPI IShellLink_fnGetIDList(IShellLink * iface, LPITEMIDLIST * ppidl)
505 ICOM_THIS(IShellLinkImpl, iface);
507 TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
509 *ppidl = ILClone(This->pPidl);
512 static HRESULT WINAPI IShellLink_fnSetIDList(IShellLink * iface, LPCITEMIDLIST pidl)
514 ICOM_THIS(IShellLinkImpl, iface);
516 TRACE("(%p)->(pidl=%p)\n",This, pidl);
520 This->pPidl = ILClone (pidl);
523 static HRESULT WINAPI IShellLink_fnGetDescription(IShellLink * iface, LPSTR pszName,INT cchMaxName)
525 ICOM_THIS(IShellLinkImpl, iface);
527 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
528 strncpy(pszName,"Description, FIXME",cchMaxName);
531 static HRESULT WINAPI IShellLink_fnSetDescription(IShellLink * iface, LPCSTR pszName)
533 ICOM_THIS(IShellLinkImpl, iface);
535 FIXME("(%p)->(desc=%s)\n",This, pszName);
538 static HRESULT WINAPI IShellLink_fnGetWorkingDirectory(IShellLink * iface, LPSTR pszDir,INT cchMaxPath)
540 ICOM_THIS(IShellLinkImpl, iface);
542 FIXME("(%p)->()\n",This);
543 strncpy(pszDir,"c:\\", cchMaxPath);
546 static HRESULT WINAPI IShellLink_fnSetWorkingDirectory(IShellLink * iface, LPCSTR pszDir)
548 ICOM_THIS(IShellLinkImpl, iface);
550 FIXME("(%p)->(dir=%s)\n",This, pszDir);
553 static HRESULT WINAPI IShellLink_fnGetArguments(IShellLink * iface, LPSTR pszArgs,INT cchMaxPath)
555 ICOM_THIS(IShellLinkImpl, iface);
557 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
558 strncpy(pszArgs, "", cchMaxPath);
561 static HRESULT WINAPI IShellLink_fnSetArguments(IShellLink * iface, LPCSTR pszArgs)
563 ICOM_THIS(IShellLinkImpl, iface);
565 FIXME("(%p)->(args=%s)\n",This, pszArgs);
569 static HRESULT WINAPI IShellLink_fnGetHotkey(IShellLink * iface, WORD *pwHotkey)
571 ICOM_THIS(IShellLinkImpl, iface);
573 TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey);
575 *pwHotkey = This->wHotKey;
579 static HRESULT WINAPI IShellLink_fnSetHotkey(IShellLink * iface, WORD wHotkey)
581 ICOM_THIS(IShellLinkImpl, iface);
583 TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
585 This->wHotKey = wHotkey;
589 static HRESULT WINAPI IShellLink_fnGetShowCmd(IShellLink * iface, INT *piShowCmd)
591 ICOM_THIS(IShellLinkImpl, iface);
593 FIXME("(%p)->(%p)\n",This, piShowCmd);
597 static HRESULT WINAPI IShellLink_fnSetShowCmd(IShellLink * iface, INT iShowCmd)
599 ICOM_THIS(IShellLinkImpl, iface);
601 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
604 static HRESULT WINAPI IShellLink_fnGetIconLocation(IShellLink * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon)
606 ICOM_THIS(IShellLinkImpl, iface);
608 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
609 strncpy(pszIconPath,"shell32.dll",cchIconPath);
613 static HRESULT WINAPI IShellLink_fnSetIconLocation(IShellLink * iface, LPCSTR pszIconPath,INT iIcon)
615 ICOM_THIS(IShellLinkImpl, iface);
617 FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
620 static HRESULT WINAPI IShellLink_fnSetRelativePath(IShellLink * iface, LPCSTR pszPathRel, DWORD dwReserved)
622 ICOM_THIS(IShellLinkImpl, iface);
624 FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
627 static HRESULT WINAPI IShellLink_fnResolve(IShellLink * iface, HWND hwnd, DWORD fFlags)
629 ICOM_THIS(IShellLinkImpl, iface);
631 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
634 static HRESULT WINAPI IShellLink_fnSetPath(IShellLink * iface, LPCSTR pszFile)
636 ICOM_THIS(IShellLinkImpl, iface);
638 FIXME("(%p)->(path=%s)\n",This, pszFile);
642 /**************************************************************************
643 * IShellLink Implementation
646 static ICOM_VTABLE(IShellLink) slvt =
648 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
649 IShellLink_fnQueryInterface,
651 IShellLink_fnRelease,
652 IShellLink_fnGetPath,
653 IShellLink_fnGetIDList,
654 IShellLink_fnSetIDList,
655 IShellLink_fnGetDescription,
656 IShellLink_fnSetDescription,
657 IShellLink_fnGetWorkingDirectory,
658 IShellLink_fnSetWorkingDirectory,
659 IShellLink_fnGetArguments,
660 IShellLink_fnSetArguments,
661 IShellLink_fnGetHotkey,
662 IShellLink_fnSetHotkey,
663 IShellLink_fnGetShowCmd,
664 IShellLink_fnSetShowCmd,
665 IShellLink_fnGetIconLocation,
666 IShellLink_fnSetIconLocation,
667 IShellLink_fnSetRelativePath,
668 IShellLink_fnResolve,
673 /**************************************************************************
674 * IShellLinkW_fnQueryInterface
676 static HRESULT WINAPI IShellLinkW_fnQueryInterface(
677 IShellLinkW * iface, REFIID riid, LPVOID *ppvObj)
679 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
681 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
684 /******************************************************************************
685 * IShellLinkW_fnAddRef
687 static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface)
689 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
691 TRACE("(%p)->(count=%lu)\n",This,This->ref);
693 return IShellLink_AddRef((IShellLink*)This);
695 /******************************************************************************
696 * IShellLinkW_fnRelease
699 static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface)
701 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
703 TRACE("(%p)->(count=%lu)\n",This,This->ref);
705 return IShellLink_Release((IShellLink*)This);
708 static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
710 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
712 FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags);
713 lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);
717 static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl)
719 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
721 FIXME("(%p)->(ppidl=%p)\n",This, ppidl);
722 *ppidl = _ILCreateDesktop();
726 static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl)
728 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
730 FIXME("(%p)->(pidl=%p)\n",This, pidl);
734 static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName)
736 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
738 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
739 lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);
743 static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName)
745 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
747 FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
751 static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath)
753 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
755 FIXME("(%p)->()\n",This);
756 lstrcpynAtoW(pszDir,"c:\\", cchMaxPath);
760 static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir)
762 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
764 FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
768 static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath)
770 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
772 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
773 lstrcpynAtoW(pszArgs, "", cchMaxPath);
777 static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs)
779 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
781 FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
785 static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey)
787 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
789 FIXME("(%p)->(%p)\n",This, pwHotkey);
794 static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey)
796 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
798 FIXME("(%p)->(hotkey=%x)\n",This, wHotkey);
802 static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd)
804 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
806 FIXME("(%p)->(%p)\n",This, piShowCmd);
811 static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd)
813 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
815 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
819 static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon)
821 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
823 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
824 lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath);
829 static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon)
831 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
833 FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
837 static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved)
839 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
841 FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved);
845 static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags)
847 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
849 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
853 static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile)
855 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
857 FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
861 /**************************************************************************
862 * IShellLinkW Implementation
865 static ICOM_VTABLE(IShellLinkW) slvtw =
867 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
868 IShellLinkW_fnQueryInterface,
869 IShellLinkW_fnAddRef,
870 IShellLinkW_fnRelease,
871 IShellLinkW_fnGetPath,
872 IShellLinkW_fnGetIDList,
873 IShellLinkW_fnSetIDList,
874 IShellLinkW_fnGetDescription,
875 IShellLinkW_fnSetDescription,
876 IShellLinkW_fnGetWorkingDirectory,
877 IShellLinkW_fnSetWorkingDirectory,
878 IShellLinkW_fnGetArguments,
879 IShellLinkW_fnSetArguments,
880 IShellLinkW_fnGetHotkey,
881 IShellLinkW_fnSetHotkey,
882 IShellLinkW_fnGetShowCmd,
883 IShellLinkW_fnSetShowCmd,
884 IShellLinkW_fnGetIconLocation,
885 IShellLinkW_fnSetIconLocation,
886 IShellLinkW_fnSetRelativePath,
887 IShellLinkW_fnResolve,
888 IShellLinkW_fnSetPath