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"
15 #include "wine/undocshell.h"
20 #include "shell32_main.h"
23 DEFAULT_DEBUG_CHANNEL(shell)
25 /* link file formats */
29 /* flag1: lnk elements: simple link has 0x0B */
37 #define MAXIMIZED 0x03
38 #define MINIMIZED 0x07
40 typedef struct _LINK_HEADER
41 { DWORD MagicStr; /* 0x00 'L','\0','\0','\0' */
42 GUID MagicGuid; /* 0x04 is CLSID_ShellLink */
43 DWORD Flag1; /* 0x14 describes elements following */
44 DWORD Flag2; /* 0x18 */
45 FILETIME Time1; /* 0x1c */
46 FILETIME Time2; /* 0x24 */
47 FILETIME Time3; /* 0x2c */
48 DWORD Unknown1; /* 0x34 */
49 DWORD Unknown2; /* 0x38 icon number */
50 DWORD fStartup; /* 0x3c startup type */
51 DWORD wHotKey; /* 0x40 hotkey */
52 DWORD Unknown5; /* 0x44 */
53 DWORD Unknown6; /* 0x48 */
54 USHORT PidlSize; /* 0x4c */
55 ITEMIDLIST Pidl; /* 0x4e */
56 } LINK_HEADER, * PLINK_HEADER;
58 #define LINK_HEADER_SIZE (sizeof(LINK_HEADER)-sizeof(ITEMIDLIST))
62 static ICOM_VTABLE(IShellLink) slvt;
63 static ICOM_VTABLE(IShellLinkW) slvtw;
64 static ICOM_VTABLE(IPersistFile) pfvt;
65 static ICOM_VTABLE(IPersistStream) psvt;
67 /* IShellLink Implementation */
71 ICOM_VFIELD(IShellLink);
74 ICOM_VTABLE(IShellLinkW)* lpvtblw;
75 ICOM_VTABLE(IPersistFile)* lpvtblPersistFile;
76 ICOM_VTABLE(IPersistStream)* lpvtblPersistStream;
78 /* internal stream of the IPersistFile interface */
79 IStream* lpFileStream;
81 /* data structures according to the informations in the lnk */
91 #define _IShellLinkW_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblw)))
92 #define _ICOM_THIS_From_IShellLinkW(class, name) class* This = (class*)(((char*)name)-_IShellLinkW_Offset);
94 #define _IPersistFile_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblPersistFile)))
95 #define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset);
97 #define _IPersistStream_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblPersistStream)))
98 #define _ICOM_THIS_From_IPersistStream(class, name) class* This = (class*)(((char*)name)-_IPersistStream_Offset);
99 #define _IPersistStream_From_ICOM_THIS(class, name) class* StreamThis = (class*)(((char*)name)+_IPersistStream_Offset);
101 /**************************************************************************
102 * IPersistFile_QueryInterface
104 static HRESULT WINAPI IPersistFile_fnQueryInterface(
109 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
111 TRACE("(%p)\n",This);
113 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
116 /******************************************************************************
117 * IPersistFile_AddRef
119 static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface)
121 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
123 TRACE("(%p)->(count=%lu)\n",This,This->ref);
125 return IShellLink_AddRef((IShellLink*)This);
127 /******************************************************************************
128 * IPersistFile_Release
130 static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface)
132 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
134 TRACE("(%p)->(count=%lu)\n",This,This->ref);
136 return IShellLink_Release((IShellLink*)This);
139 static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile* iface, CLSID *pClassID)
141 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
142 FIXME("(%p)\n",This);
145 static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface)
147 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
148 FIXME("(%p)\n",This);
151 static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
153 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
154 _IPersistStream_From_ICOM_THIS(IPersistStream, This)
156 LPSTR sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);
157 HRESULT hRet = E_FAIL;
159 TRACE("(%p, %s)\n",This, sFile);
162 if (This->lpFileStream)
163 IStream_Release(This->lpFileStream);
165 if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream)))
167 if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream))
176 static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
178 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
179 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
182 static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName)
184 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
185 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
188 static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *ppszFileName)
190 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
191 FIXME("(%p)\n",This);
195 static ICOM_VTABLE(IPersistFile) pfvt =
197 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
198 IPersistFile_fnQueryInterface,
199 IPersistFile_fnAddRef,
200 IPersistFile_fnRelease,
201 IPersistFile_fnGetClassID,
202 IPersistFile_fnIsDirty,
205 IPersistFile_fnSaveCompleted,
206 IPersistFile_fnGetCurFile
209 /************************************************************************
210 * IPersistStream_QueryInterface
212 static HRESULT WINAPI IPersistStream_fnQueryInterface(
213 IPersistStream* iface,
217 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
219 TRACE("(%p)\n",This);
221 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvoid);
224 /************************************************************************
225 * IPersistStream_Release
227 static ULONG WINAPI IPersistStream_fnRelease(
228 IPersistStream* iface)
230 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
232 TRACE("(%p)\n",This);
234 return IShellLink_Release((IShellLink*)This);
237 /************************************************************************
238 * IPersistStream_AddRef
240 static ULONG WINAPI IPersistStream_fnAddRef(
241 IPersistStream* iface)
243 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
245 TRACE("(%p)\n",This);
247 return IShellLink_AddRef((IShellLink*)This);
250 /************************************************************************
251 * IPersistStream_GetClassID
254 static HRESULT WINAPI IPersistStream_fnGetClassID(
255 IPersistStream* iface,
258 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
260 TRACE("(%p)\n", This);
265 /* memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */
270 /************************************************************************
271 * IPersistStream_IsDirty (IPersistStream)
273 static HRESULT WINAPI IPersistStream_fnIsDirty(
274 IPersistStream* iface)
276 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
278 TRACE("(%p)\n", This);
282 /************************************************************************
283 * IPersistStream_Load (IPersistStream)
286 static HRESULT WINAPI IPersistStream_fnLoad(
287 IPersistStream* iface,
288 IStream* pLoadStream)
290 PLINK_HEADER lpLinkHeader = HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
293 char sTemp[MAX_PATH];
295 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
297 TRACE("(%p)(%p)\n", This, pLoadStream);
301 return STG_E_INVALIDPOINTER;
304 IStream_AddRef (pLoadStream);
307 if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead)))
309 if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink))
311 lpLinkHeader = HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
314 if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead)))
316 if (pcheck (&lpLinkHeader->Pidl))
318 This->pPidl = ILClone (&lpLinkHeader->Pidl);
320 SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp);
321 This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp);
323 This->wHotKey = lpLinkHeader->wHotKey;
324 FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1);
325 FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2);
326 FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3);
328 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
329 TRACE("-- time1: %s\n", sTemp);
330 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256);
331 TRACE("-- time1: %s\n", sTemp);
332 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256);
333 TRACE("-- time1: %s\n", sTemp);
342 WARN("stream contains no link!\n");
347 IStream_Release (pLoadStream);
351 HeapFree(GetProcessHeap(), 0, lpLinkHeader);
356 /************************************************************************
357 * IPersistStream_Save (IPersistStream)
359 static HRESULT WINAPI IPersistStream_fnSave(
360 IPersistStream* iface,
364 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
366 TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty);
371 /************************************************************************
372 * IPersistStream_GetSizeMax (IPersistStream)
374 static HRESULT WINAPI IPersistStream_fnGetSizeMax(
375 IPersistStream* iface,
376 ULARGE_INTEGER* pcbSize)
378 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
380 TRACE("(%p)\n", This);
385 static ICOM_VTABLE(IPersistStream) psvt =
387 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
388 IPersistStream_fnQueryInterface,
389 IPersistStream_fnAddRef,
390 IPersistStream_fnRelease,
391 IPersistStream_fnGetClassID,
392 IPersistStream_fnIsDirty,
393 IPersistStream_fnLoad,
394 IPersistStream_fnSave,
395 IPersistStream_fnGetSizeMax
398 /**************************************************************************
399 * IShellLink_Constructor
401 IShellLink * IShellLink_Constructor(BOOL bUnicode)
402 { IShellLinkImpl * sl;
404 sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));
406 ICOM_VTBL(sl) = &slvt;
407 sl->lpvtblw = &slvtw;
408 sl->lpvtblPersistFile = &pfvt;
409 sl->lpvtblPersistStream = &psvt;
411 TRACE("(%p)->()\n",sl);
413 return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
416 /**************************************************************************
417 * IShellLink_QueryInterface
419 static HRESULT WINAPI IShellLink_fnQueryInterface( IShellLink * iface, REFIID riid, LPVOID *ppvObj)
421 ICOM_THIS(IShellLinkImpl, iface);
424 WINE_StringFromCLSID((LPCLSID)riid,xriid);
425 TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid);
429 if(IsEqualIID(riid, &IID_IUnknown) ||
430 IsEqualIID(riid, &IID_IShellLink))
434 else if(IsEqualIID(riid, &IID_IShellLinkW))
436 *ppvObj = (IShellLinkW *)&(This->lpvtblw);
438 else if(IsEqualIID(riid, &IID_IPersistFile))
440 *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile);
442 else if(IsEqualIID(riid, &IID_IPersistStream))
444 *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream);
449 IUnknown_AddRef((IUnknown*)(*ppvObj));
450 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
453 TRACE("-- Interface: E_NOINTERFACE\n");
454 return E_NOINTERFACE;
456 /******************************************************************************
459 static ULONG WINAPI IShellLink_fnAddRef(IShellLink * iface)
461 ICOM_THIS(IShellLinkImpl, iface);
463 TRACE("(%p)->(count=%lu)\n",This,This->ref);
466 return ++(This->ref);
468 /******************************************************************************
471 static ULONG WINAPI IShellLink_fnRelease(IShellLink * iface)
473 ICOM_THIS(IShellLinkImpl, iface);
475 TRACE("(%p)->(count=%lu)\n",This,This->ref);
479 { TRACE("-- destroying IShellLink(%p)\n",This);
482 HeapFree(GetProcessHeap(),0,This->sPath);
487 if (This->lpFileStream)
488 IStream_Release(This->lpFileStream);
490 HeapFree(GetProcessHeap(),0,This);
496 static HRESULT WINAPI IShellLink_fnGetPath(IShellLink * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
498 ICOM_THIS(IShellLinkImpl, iface);
500 TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath));
503 lstrcpynA(pszFile,This->sPath, cchMaxPath);
509 static HRESULT WINAPI IShellLink_fnGetIDList(IShellLink * iface, LPITEMIDLIST * ppidl)
511 ICOM_THIS(IShellLinkImpl, iface);
513 TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
515 *ppidl = ILClone(This->pPidl);
518 static HRESULT WINAPI IShellLink_fnSetIDList(IShellLink * iface, LPCITEMIDLIST pidl)
520 ICOM_THIS(IShellLinkImpl, iface);
522 TRACE("(%p)->(pidl=%p)\n",This, pidl);
526 This->pPidl = ILClone (pidl);
529 static HRESULT WINAPI IShellLink_fnGetDescription(IShellLink * iface, LPSTR pszName,INT cchMaxName)
531 ICOM_THIS(IShellLinkImpl, iface);
533 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
534 lstrcpynA(pszName,"Description, FIXME",cchMaxName);
537 static HRESULT WINAPI IShellLink_fnSetDescription(IShellLink * iface, LPCSTR pszName)
539 ICOM_THIS(IShellLinkImpl, iface);
541 FIXME("(%p)->(desc=%s)\n",This, pszName);
544 static HRESULT WINAPI IShellLink_fnGetWorkingDirectory(IShellLink * iface, LPSTR pszDir,INT cchMaxPath)
546 ICOM_THIS(IShellLinkImpl, iface);
548 FIXME("(%p)->()\n",This);
549 lstrcpynA(pszDir,"c:\\", cchMaxPath);
552 static HRESULT WINAPI IShellLink_fnSetWorkingDirectory(IShellLink * iface, LPCSTR pszDir)
554 ICOM_THIS(IShellLinkImpl, iface);
556 FIXME("(%p)->(dir=%s)\n",This, pszDir);
559 static HRESULT WINAPI IShellLink_fnGetArguments(IShellLink * iface, LPSTR pszArgs,INT cchMaxPath)
561 ICOM_THIS(IShellLinkImpl, iface);
563 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
564 lstrcpynA(pszArgs, "", cchMaxPath);
567 static HRESULT WINAPI IShellLink_fnSetArguments(IShellLink * iface, LPCSTR pszArgs)
569 ICOM_THIS(IShellLinkImpl, iface);
571 FIXME("(%p)->(args=%s)\n",This, pszArgs);
575 static HRESULT WINAPI IShellLink_fnGetHotkey(IShellLink * iface, WORD *pwHotkey)
577 ICOM_THIS(IShellLinkImpl, iface);
579 TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey);
581 *pwHotkey = This->wHotKey;
585 static HRESULT WINAPI IShellLink_fnSetHotkey(IShellLink * iface, WORD wHotkey)
587 ICOM_THIS(IShellLinkImpl, iface);
589 TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
591 This->wHotKey = wHotkey;
595 static HRESULT WINAPI IShellLink_fnGetShowCmd(IShellLink * iface, INT *piShowCmd)
597 ICOM_THIS(IShellLinkImpl, iface);
599 FIXME("(%p)->(%p)\n",This, piShowCmd);
603 static HRESULT WINAPI IShellLink_fnSetShowCmd(IShellLink * iface, INT iShowCmd)
605 ICOM_THIS(IShellLinkImpl, iface);
607 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
610 static HRESULT WINAPI IShellLink_fnGetIconLocation(IShellLink * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon)
612 ICOM_THIS(IShellLinkImpl, iface);
614 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
615 lstrcpynA(pszIconPath,"shell32.dll",cchIconPath);
619 static HRESULT WINAPI IShellLink_fnSetIconLocation(IShellLink * iface, LPCSTR pszIconPath,INT iIcon)
621 ICOM_THIS(IShellLinkImpl, iface);
623 FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
626 static HRESULT WINAPI IShellLink_fnSetRelativePath(IShellLink * iface, LPCSTR pszPathRel, DWORD dwReserved)
628 ICOM_THIS(IShellLinkImpl, iface);
630 FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
633 static HRESULT WINAPI IShellLink_fnResolve(IShellLink * iface, HWND hwnd, DWORD fFlags)
635 ICOM_THIS(IShellLinkImpl, iface);
637 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
640 static HRESULT WINAPI IShellLink_fnSetPath(IShellLink * iface, LPCSTR pszFile)
642 ICOM_THIS(IShellLinkImpl, iface);
644 FIXME("(%p)->(path=%s)\n",This, pszFile);
648 /**************************************************************************
649 * IShellLink Implementation
652 static ICOM_VTABLE(IShellLink) slvt =
654 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
655 IShellLink_fnQueryInterface,
657 IShellLink_fnRelease,
658 IShellLink_fnGetPath,
659 IShellLink_fnGetIDList,
660 IShellLink_fnSetIDList,
661 IShellLink_fnGetDescription,
662 IShellLink_fnSetDescription,
663 IShellLink_fnGetWorkingDirectory,
664 IShellLink_fnSetWorkingDirectory,
665 IShellLink_fnGetArguments,
666 IShellLink_fnSetArguments,
667 IShellLink_fnGetHotkey,
668 IShellLink_fnSetHotkey,
669 IShellLink_fnGetShowCmd,
670 IShellLink_fnSetShowCmd,
671 IShellLink_fnGetIconLocation,
672 IShellLink_fnSetIconLocation,
673 IShellLink_fnSetRelativePath,
674 IShellLink_fnResolve,
679 /**************************************************************************
680 * IShellLinkW_fnQueryInterface
682 static HRESULT WINAPI IShellLinkW_fnQueryInterface(
683 IShellLinkW * iface, REFIID riid, LPVOID *ppvObj)
685 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
687 return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
690 /******************************************************************************
691 * IShellLinkW_fnAddRef
693 static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface)
695 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
697 TRACE("(%p)->(count=%lu)\n",This,This->ref);
699 return IShellLink_AddRef((IShellLink*)This);
701 /******************************************************************************
702 * IShellLinkW_fnRelease
705 static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface)
707 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
709 TRACE("(%p)->(count=%lu)\n",This,This->ref);
711 return IShellLink_Release((IShellLink*)This);
714 static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
716 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
718 FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags);
719 lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);
723 static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl)
725 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
727 FIXME("(%p)->(ppidl=%p)\n",This, ppidl);
728 *ppidl = _ILCreateDesktop();
732 static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl)
734 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
736 FIXME("(%p)->(pidl=%p)\n",This, pidl);
740 static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName)
742 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
744 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
745 lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);
749 static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName)
751 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
753 FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
757 static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath)
759 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
761 FIXME("(%p)->()\n",This);
762 lstrcpynAtoW(pszDir,"c:\\", cchMaxPath);
766 static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir)
768 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
770 FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
774 static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath)
776 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
778 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
779 lstrcpynAtoW(pszArgs, "", cchMaxPath);
783 static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs)
785 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
787 FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
791 static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey)
793 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
795 FIXME("(%p)->(%p)\n",This, pwHotkey);
800 static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey)
802 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
804 FIXME("(%p)->(hotkey=%x)\n",This, wHotkey);
808 static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd)
810 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
812 FIXME("(%p)->(%p)\n",This, piShowCmd);
817 static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd)
819 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
821 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
825 static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon)
827 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
829 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
830 lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath);
835 static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon)
837 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
839 FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
843 static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved)
845 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
847 FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved);
851 static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags)
853 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
855 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
859 static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile)
861 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
863 FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
867 /**************************************************************************
868 * IShellLinkW Implementation
871 static ICOM_VTABLE(IShellLinkW) slvtw =
873 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
874 IShellLinkW_fnQueryInterface,
875 IShellLinkW_fnAddRef,
876 IShellLinkW_fnRelease,
877 IShellLinkW_fnGetPath,
878 IShellLinkW_fnGetIDList,
879 IShellLinkW_fnSetIDList,
880 IShellLinkW_fnGetDescription,
881 IShellLinkW_fnSetDescription,
882 IShellLinkW_fnGetWorkingDirectory,
883 IShellLinkW_fnSetWorkingDirectory,
884 IShellLinkW_fnGetArguments,
885 IShellLinkW_fnSetArguments,
886 IShellLinkW_fnGetHotkey,
887 IShellLinkW_fnSetHotkey,
888 IShellLinkW_fnGetShowCmd,
889 IShellLinkW_fnSetShowCmd,
890 IShellLinkW_fnGetIconLocation,
891 IShellLinkW_fnSetIconLocation,
892 IShellLinkW_fnSetRelativePath,
893 IShellLinkW_fnResolve,
894 IShellLinkW_fnSetPath