Ignore:
Timestamp:
Mar 26, 2000, 6:34:57 PM (25 years ago)
Author:
cbratschi
Message:

merged with Corel WINE 20000324

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/shelllink.cpp

    r1215 r3243  
    1 /* $Id: shelllink.cpp,v 1.2 1999-10-09 11:17:04 sandervl Exp $ */
     1/* $Id: shelllink.cpp,v 1.3 2000-03-26 16:34:50 cbratschi Exp $ */
    22/*
    33 *
    4  *      Copyright 1997  Marcus Meissner
    5  *      Copyright 1998  Juergen Schmied
     4 *      Copyright 1997  Marcus Meissner
     5 *      Copyright 1998  Juergen Schmied
    66 *
     7 * Corel WINE 20000324 level
    78 */
    89
     
    3738
    3839/* flag1: lnk elements: simple link has 0x0B */
    39 #define WORKDIR         0x10
    40 #define ARGUMENT        0x20
    41 #define ICON            0x40
    42 #define UNC             0x80
     40#define WORKDIR         0x10
     41#define ARGUMENT        0x20
     42#define ICON            0x40
     43#define UNC             0x80
    4344
    4445/* fStartup */
    45 #define NORMAL          0x01
    46 #define MAXIMIZED       0x03
    47 #define MINIMIZED       0x07
    48 
    49 typedef struct _LINK_HEADER     
    50 {       DWORD   MagicStr;       /* 0x00 'L','\0','\0','\0' */
    51         GUID    MagicGuid;      /* 0x04 is CLSID_ShellLink */
    52         DWORD   Flag1;          /* 0x14 describes elements following */
    53         DWORD   Flag2;          /* 0x18 */
    54         FILETIME Time1;         /* 0x1c */
    55         FILETIME Time2;         /* 0x24 */
    56         FILETIME Time3;         /* 0x2c */
    57         DWORD   Unknown1;       /* 0x34 */
    58         DWORD   Unknown2;       /* 0x38 icon number */
    59         DWORD   fStartup;       /* 0x3c startup type */
    60         DWORD   wHotKey;        /* 0x40 hotkey */
    61         DWORD   Unknown5;       /* 0x44 */
    62         DWORD   Unknown6;       /* 0x48 */
    63         USHORT  PidlSize;       /* 0x4c */
    64         ITEMIDLIST Pidl;        /* 0x4e */
     46#define NORMAL          0x01
     47#define MAXIMIZED       0x03
     48#define MINIMIZED       0x07
     49
     50typedef struct _LINK_HEADER
     51{       DWORD   MagicStr;       /* 0x00 'L','\0','\0','\0' */
     52        GUID    MagicGuid;      /* 0x04 is CLSID_ShellLink */
     53        DWORD   Flag1;          /* 0x14 describes elements following */
     54        DWORD   Flag2;          /* 0x18 */
     55        FILETIME Time1;         /* 0x1c */
     56        FILETIME Time2;         /* 0x24 */
     57        FILETIME Time3;         /* 0x2c */
     58        DWORD   Unknown1;       /* 0x34 */
     59        DWORD   Unknown2;       /* 0x38 icon number */
     60        DWORD   fStartup;       /* 0x3c startup type */
     61        DWORD   wHotKey;        /* 0x40 hotkey */
     62        DWORD   Unknown5;       /* 0x44 */
     63        DWORD   Unknown6;       /* 0x48 */
     64        USHORT  PidlSize;       /* 0x4c */
     65        ITEMIDLIST Pidl;        /* 0x4e */
    6566} LINK_HEADER, * PLINK_HEADER;
    6667
     
    6970#include "poppack.h"
    7071
    71 //static ICOM_VTABLE(IShellLink)                slvt;
    72 //static ICOM_VTABLE(IShellLinkW)               slvtw;
    73 //static ICOM_VTABLE(IPersistFile)      pfvt;
    74 //static ICOM_VTABLE(IPersistStream)    psvt;
     72//static ICOM_VTABLE(IShellLink)                slvt;
     73//static ICOM_VTABLE(IShellLinkW)               slvtw;
     74//static ICOM_VTABLE(IPersistFile)      pfvt;
     75//static ICOM_VTABLE(IPersistStream)    psvt;
    7576
    7677/* IShellLink Implementation */
     
    7879typedef struct
    7980{
    80         ICOM_VTABLE(IShellLink)*        lpvtbl;
    81         DWORD                           ref;
    82 
    83         ICOM_VTABLE(IShellLinkW)*       lpvtblw;
    84         ICOM_VTABLE(IPersistFile)*      lpvtblPersistFile;
    85         ICOM_VTABLE(IPersistStream)*    lpvtblPersistStream;
    86        
    87         /* internal stream of the IPersistFile interface */
    88         IStream*                        lpFileStream;
    89        
    90         /* data structures according to the informations in the lnk */
    91         LPSTR           sPath;
    92         LPITEMIDLIST    pPidl;
    93         WORD            wHotKey;
    94         SYSTEMTIME      time1;
    95         SYSTEMTIME      time2;
    96         SYSTEMTIME      time3;
     81        ICOM_VTABLE(IShellLink)*        lpvtbl;
     82        DWORD                           ref;
     83
     84        ICOM_VTABLE(IShellLinkW)*       lpvtblw;
     85        ICOM_VTABLE(IPersistFile)*      lpvtblPersistFile;
     86        ICOM_VTABLE(IPersistStream)*    lpvtblPersistStream;
     87
     88        /* internal stream of the IPersistFile interface */
     89        IStream*                        lpFileStream;
     90
     91        /* data structures according to the informations in the lnk */
     92        LPSTR           sPath;
     93        LPITEMIDLIST    pPidl;
     94        WORD            wHotKey;
     95        SYSTEMTIME      time1;
     96        SYSTEMTIME      time2;
     97        SYSTEMTIME      time3;
    9798
    9899} IShellLinkImpl;
     
    112113 */
    113114static HRESULT WINAPI IPersistFile_fnQueryInterface(
    114         IPersistFile* iface,
    115         REFIID riid,
    116         LPVOID *ppvObj)
    117 {
    118         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
    119 
    120         TRACE("(%p)\n",This);
    121 
    122         return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
     115        IPersistFile* iface,
     116        REFIID riid,
     117        LPVOID *ppvObj)
     118{
     119        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
     120
     121        TRACE("(%p)\n",This);
     122
     123        return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
    123124}
    124125
     
    128129static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface)
    129130{
    130         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
    131 
    132         TRACE("(%p)->(count=%lu)\n",This,This->ref);
    133 
    134         return IShellLink_AddRef((IShellLink*)This);
     131        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
     132
     133        TRACE("(%p)->(count=%lu)\n",This,This->ref);
     134
     135        return IShellLink_AddRef((IShellLink*)This);
    135136}
    136137/******************************************************************************
     
    139140static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface)
    140141{
    141         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
    142 
    143         TRACE("(%p)->(count=%lu)\n",This,This->ref);
    144 
    145         return IShellLink_Release((IShellLink*)This);
     142        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
     143
     144        TRACE("(%p)->(count=%lu)\n",This,This->ref);
     145
     146        return IShellLink_Release((IShellLink*)This);
    146147}
    147148
    148149static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile* iface, CLSID *pClassID)
    149150{
    150         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
    151         FIXME("(%p)\n",This);
    152         return NOERROR;
     151        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
     152        FIXME("(%p)\n",This);
     153        return NOERROR;
    153154}
    154155static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface)
    155156{
    156         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
    157         FIXME("(%p)\n",This);
    158         return NOERROR;
     157        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
     158        FIXME("(%p)\n",This);
     159        return NOERROR;
    159160}
    160161static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
    161162{
    162         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
    163         _IPersistStream_From_ICOM_THIS(IPersistStream, This)
    164 
    165         LPSTR           sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);
    166         HRESULT         hRet = E_FAIL;
    167 
    168         TRACE("(%p, %s)\n",This, sFile);
    169        
    170 
    171         if (This->lpFileStream)
    172           IStream_Release(This->lpFileStream);
    173        
    174         if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream)))
    175         {
    176           if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream))
    177           {
    178             return NOERROR;
    179           }
    180         }
    181        
    182         return hRet;
     163        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
     164        _IPersistStream_From_ICOM_THIS(IPersistStream, This)
     165
     166        LPSTR           sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);
     167        HRESULT         hRet = E_FAIL;
     168
     169        TRACE("(%p, %s)\n",This, sFile);
     170
     171
     172        if (This->lpFileStream)
     173          IStream_Release(This->lpFileStream);
     174
     175        if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream)))
     176        {
     177          if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream))
     178          {
     179            return NOERROR;
     180          }
     181        }
     182
     183        return hRet;
    183184}
    184185
    185186static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
    186187{
    187         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
    188         FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
    189         return NOERROR;
     188        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
     189        FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
     190        return NOERROR;
    190191}
    191192static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName)
    192193{
    193         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
    194         FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
    195         return NOERROR;
     194        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
     195        FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
     196        return NOERROR;
    196197}
    197198static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *ppszFileName)
    198199{
    199         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
    200         FIXME("(%p)\n",This);
    201         return NOERROR;
     200        _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
     201        FIXME("(%p)\n",This);
     202        return NOERROR;
    202203}
    203204
    204205static ICOM_VTABLE(IPersistFile) pfvt =
    205206{
    206         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
    207         IPersistFile_fnQueryInterface,
    208         IPersistFile_fnAddRef,
    209         IPersistFile_fnRelease,
    210         IPersistFile_fnGetClassID,
    211         IPersistFile_fnIsDirty,
    212         IPersistFile_fnLoad,
    213         IPersistFile_fnSave,
    214         IPersistFile_fnSaveCompleted,
    215         IPersistFile_fnGetCurFile
     207        ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     208        IPersistFile_fnQueryInterface,
     209        IPersistFile_fnAddRef,
     210        IPersistFile_fnRelease,
     211        IPersistFile_fnGetClassID,
     212        IPersistFile_fnIsDirty,
     213        IPersistFile_fnLoad,
     214        IPersistFile_fnSave,
     215        IPersistFile_fnSaveCompleted,
     216        IPersistFile_fnGetCurFile
    216217};
    217218
     
    220221 */
    221222static HRESULT WINAPI IPersistStream_fnQueryInterface(
    222         IPersistStream* iface,
    223         REFIID     riid,
    224         VOID**     ppvoid)
    225 {
    226         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    227 
    228         TRACE("(%p)\n",This);
    229 
    230         return IShellLink_QueryInterface((IShellLink*)This, riid, ppvoid);
     223        IPersistStream* iface,
     224        REFIID     riid,
     225        VOID**     ppvoid)
     226{
     227        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     228
     229        TRACE("(%p)\n",This);
     230
     231        return IShellLink_QueryInterface((IShellLink*)This, riid, ppvoid);
    231232}
    232233
     
    235236 */
    236237static ULONG WINAPI IPersistStream_fnRelease(
    237         IPersistStream* iface)
    238 {
    239         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    240 
    241         TRACE("(%p)\n",This);
    242 
    243         return IShellLink_Release((IShellLink*)This);
     238        IPersistStream* iface)
     239{
     240        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     241
     242        TRACE("(%p)\n",This);
     243
     244        return IShellLink_Release((IShellLink*)This);
    244245}
    245246
     
    248249 */
    249250static ULONG WINAPI IPersistStream_fnAddRef(
    250         IPersistStream* iface)
    251 {
    252         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    253 
    254         TRACE("(%p)\n",This);
    255 
    256         return IShellLink_AddRef((IShellLink*)This);
     251        IPersistStream* iface)
     252{
     253        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     254
     255        TRACE("(%p)\n",This);
     256
     257        return IShellLink_AddRef((IShellLink*)This);
    257258}
    258259
     
    262263 */
    263264static HRESULT WINAPI IPersistStream_fnGetClassID(
    264         IPersistStream* iface,
    265         CLSID* pClassID)
    266 {
    267         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    268 
    269         TRACE("(%p)\n", This);
    270 
    271         if (pClassID==0)
    272           return E_POINTER;
    273 
    274 /*      memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */
    275 
    276         return S_OK;
     265        IPersistStream* iface,
     266        CLSID* pClassID)
     267{
     268        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     269
     270        TRACE("(%p)\n", This);
     271
     272        if (pClassID==0)
     273          return E_POINTER;
     274
     275/*      memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */
     276
     277        return S_OK;
    277278}
    278279
     
    281282 */
    282283static HRESULT WINAPI IPersistStream_fnIsDirty(
    283         IPersistStream*  iface)
    284 {
    285         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    286 
    287         TRACE("(%p)\n", This);
    288 
    289         return S_OK;
     284        IPersistStream*  iface)
     285{
     286        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     287
     288        TRACE("(%p)\n", This);
     289
     290        return S_OK;
    290291}
    291292/************************************************************************
     
    294295
    295296static HRESULT WINAPI IPersistStream_fnLoad(
    296         IPersistStream*  iface,
    297         IStream*         pLoadStream)
    298 {
    299         PLINK_HEADER lpLinkHeader = (PLINK_HEADER)HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
    300         ULONG   dwBytesRead;
    301         DWORD   ret = E_FAIL;
    302         char    sTemp[512];
    303        
    304         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    305 
    306         TRACE("(%p)(%p)\n", This, pLoadStream);
    307 
    308         if ( ! pLoadStream)
    309         {
    310           return STG_E_INVALIDPOINTER;
    311         }
    312        
    313         IStream_AddRef (pLoadStream);
    314         if(lpLinkHeader)
    315         {
    316           if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead)))
    317           {
    318             if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink))
    319             {
    320               lpLinkHeader = (PLINK_HEADER)HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
    321               if (lpLinkHeader)
    322               {
    323                 if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead)))
    324                 {
    325                   if (pcheck (&lpLinkHeader->Pidl))
    326                   {     
    327                     This->pPidl = ILClone (&lpLinkHeader->Pidl);
    328 
    329                     SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp);
    330                     This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp);
    331                   }
    332                   This->wHotKey = lpLinkHeader->wHotKey;
    333                   FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1);
    334                   FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2);
    335                   FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3);
     297        IPersistStream*  iface,
     298        IStream*         pLoadStream)
     299{
     300        PLINK_HEADER lpLinkHeader = (PLINK_HEADER)HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
     301        ULONG   dwBytesRead;
     302        DWORD   ret = E_FAIL;
     303        char    sTemp[512];
     304
     305        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     306
     307        TRACE("(%p)(%p)\n", This, pLoadStream);
     308
     309        if ( ! pLoadStream)
     310        {
     311          return STG_E_INVALIDPOINTER;
     312        }
     313
     314        IStream_AddRef (pLoadStream);
     315        if(lpLinkHeader)
     316        {
     317          if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead)))
     318          {
     319            if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink))
     320            {
     321              lpLinkHeader = (PLINK_HEADER)HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
     322              if (lpLinkHeader)
     323              {
     324                if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead)))
     325                {
     326                  if (pcheck (&lpLinkHeader->Pidl))
     327                  {
     328                    This->pPidl = ILClone (&lpLinkHeader->Pidl);
     329
     330                    SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp);
     331                    This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp);
     332                  }
     333                  This->wHotKey = lpLinkHeader->wHotKey;
     334                  FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1);
     335                  FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2);
     336                  FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3);
    336337#if 1
    337                   GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
    338                   TRACE("-- time1: %s\n", sTemp);
    339                   GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256);
    340                   TRACE("-- time1: %s\n", sTemp);
    341                   GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256);
    342                   TRACE("-- time1: %s\n", sTemp);
    343                   pdump (This->pPidl);
    344 #endif         
    345                   ret = S_OK;
    346                 }
    347               }
    348             }
    349             else
    350             {
    351               WARN("stream contains no link!\n");
    352             }
    353           }
    354         }
    355 
    356         IStream_Release (pLoadStream);
    357 
    358         pdump(This->pPidl);
    359        
    360         HeapFree(GetProcessHeap(), 0, lpLinkHeader);
    361 
    362         return ret;
     338                  GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
     339                  TRACE("-- time1: %s\n", sTemp);
     340                  GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256);
     341                  TRACE("-- time1: %s\n", sTemp);
     342                  GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256);
     343                  TRACE("-- time1: %s\n", sTemp);
     344                  pdump (This->pPidl);
     345#endif
     346                  ret = S_OK;
     347                }
     348              }
     349            }
     350            else
     351            {
     352              WARN("stream contains no link!\n");
     353            }
     354          }
     355        }
     356
     357        IStream_Release (pLoadStream);
     358
     359        pdump(This->pPidl);
     360
     361        HeapFree(GetProcessHeap(), 0, lpLinkHeader);
     362
     363        return ret;
    363364}
    364365
     
    367368 */
    368369static HRESULT WINAPI IPersistStream_fnSave(
    369         IPersistStream*  iface,
    370         IStream*         pOutStream,
    371         BOOL             fClearDirty)
    372 {
    373         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    374        
    375         TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty);
    376 
    377         return E_NOTIMPL;
     370        IPersistStream*  iface,
     371        IStream*         pOutStream,
     372        BOOL             fClearDirty)
     373{
     374        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     375
     376        TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty);
     377
     378        return E_NOTIMPL;
    378379}
    379380
     
    382383 */
    383384static HRESULT WINAPI IPersistStream_fnGetSizeMax(
    384         IPersistStream*  iface,
    385         ULARGE_INTEGER*  pcbSize)
    386 {
    387         _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
    388        
    389         TRACE("(%p)\n", This);
    390 
    391         return E_NOTIMPL;
     385        IPersistStream*  iface,
     386        ULARGE_INTEGER*  pcbSize)
     387{
     388        _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
     389
     390        TRACE("(%p)\n", This);
     391
     392        return E_NOTIMPL;
    392393}
    393394
    394395static ICOM_VTABLE(IPersistStream) psvt =
    395396{
    396         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
    397         IPersistStream_fnQueryInterface,
    398         IPersistStream_fnAddRef,
    399         IPersistStream_fnRelease,
    400         IPersistStream_fnGetClassID,
    401         IPersistStream_fnIsDirty,
    402         IPersistStream_fnLoad,
    403         IPersistStream_fnSave,
    404         IPersistStream_fnGetSizeMax
     397        ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     398        IPersistStream_fnQueryInterface,
     399        IPersistStream_fnAddRef,
     400        IPersistStream_fnRelease,
     401        IPersistStream_fnGetClassID,
     402        IPersistStream_fnIsDirty,
     403        IPersistStream_fnLoad,
     404        IPersistStream_fnSave,
     405        IPersistStream_fnGetSizeMax
    405406};
    406407
     
    410411static HRESULT WINAPI IShellLink_fnQueryInterface( IShellLink * iface, REFIID riid,  LPVOID *ppvObj)
    411412{
    412         ICOM_THIS(IShellLinkImpl, iface);
    413        
    414         char    xriid[50];
    415         WINE_StringFromCLSID((LPCLSID)riid,xriid);
    416         TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid);
    417 
    418         *ppvObj = NULL;
    419 
    420         if(IsEqualIID(riid, &IID_IUnknown) ||
    421            IsEqualIID(riid, &IID_IShellLink))
    422         {
    423           *ppvObj = This;
    424         }
    425         else if(IsEqualIID(riid, &IID_IShellLinkW))
    426         {
    427           *ppvObj = (IShellLinkW *)&(This->lpvtblw);
    428         }
    429         else if(IsEqualIID(riid, &IID_IPersistFile))
    430         {
    431           *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile);
    432         }
    433         else if(IsEqualIID(riid, &IID_IPersistStream))
    434         {
    435           *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream);
    436         }
    437 
    438         if(*ppvObj)
    439         {
    440           IUnknown_AddRef((IUnknown*)(*ppvObj));
    441           TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
    442           return S_OK;
    443         }
    444         TRACE("-- Interface: E_NOINTERFACE\n");
    445         return E_NOINTERFACE;
     413        ICOM_THIS(IShellLinkImpl, iface);
     414
     415        char    xriid[50];
     416        WINE_StringFromCLSID((LPCLSID)riid,xriid);
     417        TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid);
     418
     419        *ppvObj = NULL;
     420
     421        if(IsEqualIID(riid, &IID_IUnknown) ||
     422           IsEqualIID(riid, &IID_IShellLink))
     423        {
     424          *ppvObj = This;
     425        }
     426        else if(IsEqualIID(riid, &IID_IShellLinkW))
     427        {
     428          *ppvObj = (IShellLinkW *)&(This->lpvtblw);
     429        }
     430        else if(IsEqualIID(riid, &IID_IPersistFile))
     431        {
     432          *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile);
     433        }
     434        else if(IsEqualIID(riid, &IID_IPersistStream))
     435        {
     436          *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream);
     437        }
     438
     439        if(*ppvObj)
     440        {
     441          IUnknown_AddRef((IUnknown*)(*ppvObj));
     442          TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
     443          return S_OK;
     444        }
     445        TRACE("-- Interface: E_NOINTERFACE\n");
     446        return E_NOINTERFACE;
    446447}
    447448/******************************************************************************
     
    450451static ULONG WINAPI IShellLink_fnAddRef(IShellLink * iface)
    451452{
    452         ICOM_THIS(IShellLinkImpl, iface);
    453        
    454         TRACE("(%p)->(count=%lu)\n",This,This->ref);
    455 
    456         shell32_ObjCount++;
    457         return ++(This->ref);
     453        ICOM_THIS(IShellLinkImpl, iface);
     454
     455        TRACE("(%p)->(count=%lu)\n",This,This->ref);
     456
     457        shell32_ObjCount++;
     458        return ++(This->ref);
    458459}
    459460/******************************************************************************
    460  *      IShellLink_Release
     461 *      IShellLink_Release
    461462 */
    462463static ULONG WINAPI IShellLink_fnRelease(IShellLink * iface)
    463464{
    464         ICOM_THIS(IShellLinkImpl, iface);
    465        
    466         TRACE("(%p)->(count=%lu)\n",This,This->ref);
    467 
    468         shell32_ObjCount--;
    469         if (!--(This->ref))
    470         { TRACE("-- destroying IShellLink(%p)\n",This);
    471 
    472           if (This->sPath)
    473             HeapFree(GetProcessHeap(),0,This->sPath);
    474 
    475           if (This->pPidl)
    476             SHFree(This->pPidl);
    477 
    478           if (This->lpFileStream)
    479             IStream_Release(This->lpFileStream);
    480 
    481           HeapFree(GetProcessHeap(),0,This);
    482           return 0;
    483         }
    484         return This->ref;
     465        ICOM_THIS(IShellLinkImpl, iface);
     466
     467        TRACE("(%p)->(count=%lu)\n",This,This->ref);
     468
     469        shell32_ObjCount--;
     470        if (!--(This->ref))
     471        { TRACE("-- destroying IShellLink(%p)\n",This);
     472
     473          if (This->sPath)
     474            HeapFree(GetProcessHeap(),0,This->sPath);
     475
     476          if (This->pPidl)
     477            SHFree(This->pPidl);
     478
     479          if (This->lpFileStream)
     480            IStream_Release(This->lpFileStream);
     481
     482          HeapFree(GetProcessHeap(),0,This);
     483          return 0;
     484        }
     485        return This->ref;
    485486}
    486487
    487488static HRESULT WINAPI IShellLink_fnGetPath(IShellLink * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
    488489{
    489         ICOM_THIS(IShellLinkImpl, iface);
    490        
    491         TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath));
    492 
    493         if (This->sPath)
    494           lstrcpynA(pszFile,This->sPath, cchMaxPath);
    495         else
    496           return E_FAIL;
    497 
    498         return NOERROR;
     490        ICOM_THIS(IShellLinkImpl, iface);
     491
     492        TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath));
     493
     494        if (This->sPath)
     495          lstrcpynA(pszFile,This->sPath, cchMaxPath);
     496        else
     497          return E_FAIL;
     498
     499        return NOERROR;
    499500}
    500501static HRESULT WINAPI IShellLink_fnGetIDList(IShellLink * iface, LPITEMIDLIST * ppidl)
    501502{
    502         ICOM_THIS(IShellLinkImpl, iface);
    503        
    504         TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
    505 
    506         *ppidl = ILClone(This->pPidl);
    507         return NOERROR;
     503        ICOM_THIS(IShellLinkImpl, iface);
     504
     505        TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
     506
     507        *ppidl = ILClone(This->pPidl);
     508        return NOERROR;
    508509}
    509510static HRESULT WINAPI IShellLink_fnSetIDList(IShellLink * iface, LPCITEMIDLIST pidl)
    510511{
    511         ICOM_THIS(IShellLinkImpl, iface);
    512        
    513         TRACE("(%p)->(pidl=%p)\n",This, pidl);
    514 
    515         if (This->pPidl)
    516             SHFree(This->pPidl);
    517         This->pPidl = ILClone (pidl);
    518         return NOERROR;
     512        ICOM_THIS(IShellLinkImpl, iface);
     513
     514        TRACE("(%p)->(pidl=%p)\n",This, pidl);
     515
     516        if (This->pPidl)
     517            SHFree(This->pPidl);
     518        This->pPidl = ILClone (pidl);
     519        return NOERROR;
    519520}
    520521static HRESULT WINAPI IShellLink_fnGetDescription(IShellLink * iface, LPSTR pszName,INT cchMaxName)
    521522{
    522         ICOM_THIS(IShellLinkImpl, iface);
    523        
    524         FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
    525         lstrcpynA(pszName,"Description, FIXME",cchMaxName);
    526         return NOERROR;
     523        ICOM_THIS(IShellLinkImpl, iface);
     524
     525        FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
     526        lstrcpynA(pszName,"Description, FIXME",cchMaxName);
     527        return NOERROR;
    527528}
    528529static HRESULT WINAPI IShellLink_fnSetDescription(IShellLink * iface, LPCSTR pszName)
    529530{
    530         ICOM_THIS(IShellLinkImpl, iface);
    531        
    532         FIXME("(%p)->(desc=%s)\n",This, pszName);
    533         return NOERROR;
     531        ICOM_THIS(IShellLinkImpl, iface);
     532
     533        FIXME("(%p)->(desc=%s)\n",This, pszName);
     534        return NOERROR;
    534535}
    535536static HRESULT WINAPI IShellLink_fnGetWorkingDirectory(IShellLink * iface, LPSTR pszDir,INT cchMaxPath)
    536537{
    537         ICOM_THIS(IShellLinkImpl, iface);
    538        
    539         FIXME("(%p)->()\n",This);
    540         lstrcpynA(pszDir,"c:\\", cchMaxPath);
    541         return NOERROR;
     538        ICOM_THIS(IShellLinkImpl, iface);
     539
     540        FIXME("(%p)->()\n",This);
     541        lstrcpynA(pszDir,"c:\\", cchMaxPath);
     542        return NOERROR;
    542543}
    543544static HRESULT WINAPI IShellLink_fnSetWorkingDirectory(IShellLink * iface, LPCSTR pszDir)
    544545{
    545         ICOM_THIS(IShellLinkImpl, iface);
    546        
    547         FIXME("(%p)->(dir=%s)\n",This, pszDir);
    548         return NOERROR;
     546        ICOM_THIS(IShellLinkImpl, iface);
     547
     548        FIXME("(%p)->(dir=%s)\n",This, pszDir);
     549        return NOERROR;
    549550}
    550551static HRESULT WINAPI IShellLink_fnGetArguments(IShellLink * iface, LPSTR pszArgs,INT cchMaxPath)
    551552{
    552         ICOM_THIS(IShellLinkImpl, iface);
    553        
    554         FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
    555         lstrcpynA(pszArgs, "", cchMaxPath);
    556         return NOERROR;
     553        ICOM_THIS(IShellLinkImpl, iface);
     554
     555        FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
     556        lstrcpynA(pszArgs, "", cchMaxPath);
     557        return NOERROR;
    557558}
    558559static HRESULT WINAPI IShellLink_fnSetArguments(IShellLink * iface, LPCSTR pszArgs)
    559560{
    560         ICOM_THIS(IShellLinkImpl, iface);
    561        
    562         FIXME("(%p)->(args=%s)\n",This, pszArgs);
    563 
    564         return NOERROR;
     561        ICOM_THIS(IShellLinkImpl, iface);
     562
     563        FIXME("(%p)->(args=%s)\n",This, pszArgs);
     564
     565        return NOERROR;
    565566}
    566567static HRESULT WINAPI IShellLink_fnGetHotkey(IShellLink * iface, WORD *pwHotkey)
    567568{
    568         ICOM_THIS(IShellLinkImpl, iface);
    569        
    570         TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey);
    571 
    572         *pwHotkey = This->wHotKey;
    573 
    574         return NOERROR;
     569        ICOM_THIS(IShellLinkImpl, iface);
     570
     571        TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey);
     572
     573        *pwHotkey = This->wHotKey;
     574
     575        return NOERROR;
    575576}
    576577static HRESULT WINAPI IShellLink_fnSetHotkey(IShellLink * iface, WORD wHotkey)
    577578{
    578         ICOM_THIS(IShellLinkImpl, iface);
    579        
    580         TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
    581        
    582         This->wHotKey = wHotkey;
    583 
    584         return NOERROR;
     579        ICOM_THIS(IShellLinkImpl, iface);
     580
     581        TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
     582
     583        This->wHotKey = wHotkey;
     584
     585        return NOERROR;
    585586}
    586587static HRESULT WINAPI IShellLink_fnGetShowCmd(IShellLink * iface, INT *piShowCmd)
    587588{
    588         ICOM_THIS(IShellLinkImpl, iface);
    589        
    590         FIXME("(%p)->(%p)\n",This, piShowCmd);
    591         *piShowCmd=0;
    592         return NOERROR;
     589        ICOM_THIS(IShellLinkImpl, iface);
     590
     591        FIXME("(%p)->(%p)\n",This, piShowCmd);
     592        *piShowCmd=0;
     593        return NOERROR;
    593594}
    594595static HRESULT WINAPI IShellLink_fnSetShowCmd(IShellLink * iface, INT iShowCmd)
    595596{
    596         ICOM_THIS(IShellLinkImpl, iface);
    597        
    598         FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
    599         return NOERROR;
     597        ICOM_THIS(IShellLinkImpl, iface);
     598
     599        FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
     600        return NOERROR;
    600601}
    601602static HRESULT WINAPI IShellLink_fnGetIconLocation(IShellLink * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon)
    602603{
    603         ICOM_THIS(IShellLinkImpl, iface);
    604        
    605         FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
    606         lstrcpynA(pszIconPath,"shell32.dll",cchIconPath);
    607         *piIcon=1;
    608         return NOERROR;
     604        ICOM_THIS(IShellLinkImpl, iface);
     605
     606        FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
     607        lstrcpynA(pszIconPath,"shell32.dll",cchIconPath);
     608        *piIcon=1;
     609        return NOERROR;
    609610}
    610611static HRESULT WINAPI IShellLink_fnSetIconLocation(IShellLink * iface, LPCSTR pszIconPath,INT iIcon)
    611612{
    612         ICOM_THIS(IShellLinkImpl, iface);
    613        
    614         FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
    615         return NOERROR;
     613        ICOM_THIS(IShellLinkImpl, iface);
     614
     615        FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
     616        return NOERROR;
    616617}
    617618static HRESULT WINAPI IShellLink_fnSetRelativePath(IShellLink * iface, LPCSTR pszPathRel, DWORD dwReserved)
    618619{
    619         ICOM_THIS(IShellLinkImpl, iface);
    620        
    621         FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
    622         return NOERROR;
     620        ICOM_THIS(IShellLinkImpl, iface);
     621
     622        FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
     623        return NOERROR;
    623624}
    624625static HRESULT WINAPI IShellLink_fnResolve(IShellLink * iface, HWND hwnd, DWORD fFlags)
    625626{
    626         ICOM_THIS(IShellLinkImpl, iface);
    627        
    628         FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
    629         return NOERROR;
     627        ICOM_THIS(IShellLinkImpl, iface);
     628
     629        FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
     630        return NOERROR;
    630631}
    631632static HRESULT WINAPI IShellLink_fnSetPath(IShellLink * iface, LPCSTR pszFile)
    632633{
    633         ICOM_THIS(IShellLinkImpl, iface);
    634        
    635         FIXME("(%p)->(path=%s)\n",This, pszFile);
    636         return NOERROR;
     634        ICOM_THIS(IShellLinkImpl, iface);
     635
     636        FIXME("(%p)->(path=%s)\n",This, pszFile);
     637        return NOERROR;
    637638}
    638639
     
    642643
    643644static ICOM_VTABLE(IShellLink) slvt =
    644 {       
    645         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
    646         IShellLink_fnQueryInterface,
    647         IShellLink_fnAddRef,
    648         IShellLink_fnRelease,
    649         IShellLink_fnGetPath,
    650         IShellLink_fnGetIDList,
    651         IShellLink_fnSetIDList,
    652         IShellLink_fnGetDescription,
    653         IShellLink_fnSetDescription,
    654         IShellLink_fnGetWorkingDirectory,
    655         IShellLink_fnSetWorkingDirectory,
    656         IShellLink_fnGetArguments,
    657         IShellLink_fnSetArguments,
    658         IShellLink_fnGetHotkey,
    659         IShellLink_fnSetHotkey,
    660         IShellLink_fnGetShowCmd,
    661         IShellLink_fnSetShowCmd,
    662         IShellLink_fnGetIconLocation,
    663         IShellLink_fnSetIconLocation,
    664         IShellLink_fnSetRelativePath,
    665         IShellLink_fnResolve,
    666         IShellLink_fnSetPath
     645{
     646        ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     647        IShellLink_fnQueryInterface,
     648        IShellLink_fnAddRef,
     649        IShellLink_fnRelease,
     650        IShellLink_fnGetPath,
     651        IShellLink_fnGetIDList,
     652        IShellLink_fnSetIDList,
     653        IShellLink_fnGetDescription,
     654        IShellLink_fnSetDescription,
     655        IShellLink_fnGetWorkingDirectory,
     656        IShellLink_fnSetWorkingDirectory,
     657        IShellLink_fnGetArguments,
     658        IShellLink_fnSetArguments,
     659        IShellLink_fnGetHotkey,
     660        IShellLink_fnSetHotkey,
     661        IShellLink_fnGetShowCmd,
     662        IShellLink_fnSetShowCmd,
     663        IShellLink_fnGetIconLocation,
     664        IShellLink_fnSetIconLocation,
     665        IShellLink_fnSetRelativePath,
     666        IShellLink_fnResolve,
     667        IShellLink_fnSetPath
    667668};
    668669
     
    674675  IShellLinkW * iface, REFIID riid, LPVOID *ppvObj)
    675676{
    676         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    677        
    678         return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
     677        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     678
     679        return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
    679680}
    680681
     
    684685static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface)
    685686{
    686         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    687        
    688         TRACE("(%p)->(count=%lu)\n",This,This->ref);
    689 
    690         return IShellLink_AddRef((IShellLink*)This);
     687        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     688
     689        TRACE("(%p)->(count=%lu)\n",This,This->ref);
     690
     691        return IShellLink_AddRef((IShellLink*)This);
    691692}
    692693/******************************************************************************
     
    696697static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface)
    697698{
    698         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    699        
    700         TRACE("(%p)->(count=%lu)\n",This,This->ref);
    701 
    702         return IShellLink_Release((IShellLink*)This);
     699        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     700
     701        TRACE("(%p)->(count=%lu)\n",This,This->ref);
     702
     703        return IShellLink_Release((IShellLink*)This);
    703704}
    704705
    705706static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
    706707{
    707         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    708        
    709         FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags);
    710         lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);
    711         return NOERROR;
     708        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     709
     710        FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags);
     711        lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);
     712        return NOERROR;
    712713}
    713714
    714715static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl)
    715716{
    716         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    717        
    718         FIXME("(%p)->(ppidl=%p)\n",This, ppidl);
    719         *ppidl = _ILCreateDesktop();
    720         return NOERROR;
     717        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     718
     719        FIXME("(%p)->(ppidl=%p)\n",This, ppidl);
     720        *ppidl = _ILCreateDesktop();
     721        return NOERROR;
    721722}
    722723
    723724static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl)
    724725{
    725         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    726        
    727         FIXME("(%p)->(pidl=%p)\n",This, pidl);
    728         return NOERROR;
     726        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     727
     728        FIXME("(%p)->(pidl=%p)\n",This, pidl);
     729        return NOERROR;
    729730}
    730731
    731732static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName)
    732733{
    733         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    734        
    735         FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
    736         lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);
    737         return NOERROR;
     734        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     735
     736        FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
     737        lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);
     738        return NOERROR;
    738739}
    739740
    740741static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName)
    741742{
    742         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    743        
    744         FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
    745         return NOERROR;
     743        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     744
     745        FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
     746        return NOERROR;
    746747}
    747748
    748749static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath)
    749750{
    750         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    751        
    752         FIXME("(%p)->()\n",This);
    753         lstrcpynAtoW(pszDir,"c:\\", cchMaxPath);
    754         return NOERROR;
     751        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     752
     753        FIXME("(%p)->()\n",This);
     754        lstrcpynAtoW(pszDir,"c:\\", cchMaxPath);
     755        return NOERROR;
    755756}
    756757
    757758static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir)
    758759{
    759         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    760        
    761         FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
    762         return NOERROR;
     760        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     761
     762        FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
     763        return NOERROR;
    763764}
    764765
    765766static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath)
    766767{
    767         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    768        
    769         FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
    770         lstrcpynAtoW(pszArgs, "", cchMaxPath);
    771         return NOERROR;
     768        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     769
     770        FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
     771        lstrcpynAtoW(pszArgs, "", cchMaxPath);
     772        return NOERROR;
    772773}
    773774
    774775static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs)
    775776{
    776         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    777        
    778         FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
    779         return NOERROR;
     777        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     778
     779        FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
     780        return NOERROR;
    780781}
    781782
    782783static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey)
    783784{
    784         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    785        
    786         FIXME("(%p)->(%p)\n",This, pwHotkey);
    787         *pwHotkey=0x0;
    788         return NOERROR;
     785        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     786
     787        FIXME("(%p)->(%p)\n",This, pwHotkey);
     788        *pwHotkey=0x0;
     789        return NOERROR;
    789790}
    790791
    791792static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey)
    792793{
    793         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    794        
    795         FIXME("(%p)->(hotkey=%x)\n",This, wHotkey);
    796         return NOERROR;
     794        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     795
     796        FIXME("(%p)->(hotkey=%x)\n",This, wHotkey);
     797        return NOERROR;
    797798}
    798799
    799800static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd)
    800801{
    801         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    802        
    803         FIXME("(%p)->(%p)\n",This, piShowCmd);
    804         *piShowCmd=0;
    805         return NOERROR;
     802        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     803
     804        FIXME("(%p)->(%p)\n",This, piShowCmd);
     805        *piShowCmd=0;
     806        return NOERROR;
    806807}
    807808
    808809static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd)
    809810{
    810         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    811        
    812         FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
    813         return NOERROR;
     811        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     812
     813        FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
     814        return NOERROR;
    814815}
    815816
    816817static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon)
    817818{
    818         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    819        
    820         FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
    821         lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath);
    822         *piIcon=1;
    823         return NOERROR;
     819        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     820
     821        FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
     822        lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath);
     823        *piIcon=1;
     824        return NOERROR;
    824825}
    825826
    826827static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon)
    827828{
    828         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    829        
    830         FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
    831         return NOERROR;
     829        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     830
     831        FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
     832        return NOERROR;
    832833}
    833834
    834835static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved)
    835836{
    836         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    837        
    838         FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved);
    839         return NOERROR;
     837        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     838
     839        FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved);
     840        return NOERROR;
    840841}
    841842
    842843static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags)
    843844{
    844         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    845        
    846         FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
    847         return NOERROR;
     845        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     846
     847        FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
     848        return NOERROR;
    848849}
    849850
    850851static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile)
    851852{
    852         _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    853        
    854         FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
    855         return NOERROR;
     853        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
     854
     855        FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
     856        return NOERROR;
    856857}
    857858
     
    861862
    862863static ICOM_VTABLE(IShellLinkW) slvtw =
    863 {       
    864         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
    865         IShellLinkW_fnQueryInterface,
    866         IShellLinkW_fnAddRef,
    867         IShellLinkW_fnRelease,
    868         IShellLinkW_fnGetPath,
    869         IShellLinkW_fnGetIDList,
    870         IShellLinkW_fnSetIDList,
    871         IShellLinkW_fnGetDescription,
    872         IShellLinkW_fnSetDescription,
    873         IShellLinkW_fnGetWorkingDirectory,
    874         IShellLinkW_fnSetWorkingDirectory,
    875         IShellLinkW_fnGetArguments,
    876         IShellLinkW_fnSetArguments,
    877         IShellLinkW_fnGetHotkey,
    878         IShellLinkW_fnSetHotkey,
    879         IShellLinkW_fnGetShowCmd,
    880         IShellLinkW_fnSetShowCmd,
    881         IShellLinkW_fnGetIconLocation,
    882         IShellLinkW_fnSetIconLocation,
    883         IShellLinkW_fnSetRelativePath,
    884         IShellLinkW_fnResolve,
    885         IShellLinkW_fnSetPath
     864{
     865        ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     866        IShellLinkW_fnQueryInterface,
     867        IShellLinkW_fnAddRef,
     868        IShellLinkW_fnRelease,
     869        IShellLinkW_fnGetPath,
     870        IShellLinkW_fnGetIDList,
     871        IShellLinkW_fnSetIDList,
     872        IShellLinkW_fnGetDescription,
     873        IShellLinkW_fnSetDescription,
     874        IShellLinkW_fnGetWorkingDirectory,
     875        IShellLinkW_fnSetWorkingDirectory,
     876        IShellLinkW_fnGetArguments,
     877        IShellLinkW_fnSetArguments,
     878        IShellLinkW_fnGetHotkey,
     879        IShellLinkW_fnSetHotkey,
     880        IShellLinkW_fnGetShowCmd,
     881        IShellLinkW_fnSetShowCmd,
     882        IShellLinkW_fnGetIconLocation,
     883        IShellLinkW_fnSetIconLocation,
     884        IShellLinkW_fnSetRelativePath,
     885        IShellLinkW_fnResolve,
     886        IShellLinkW_fnSetPath
    886887};
    887888
    888889/**************************************************************************
    889  *        IShellLink_Constructor
     890 *        IShellLink_Constructor
    890891 */
    891892IShellLink * IShellLink_Constructor(BOOL bUnicode)
    892 {       IShellLinkImpl * sl;
    893 
    894         sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));
    895         sl->ref = 1;
    896         sl->lpvtbl = &slvt;
    897         sl->lpvtblw = &slvtw;
    898         sl->lpvtblPersistFile = &pfvt;
    899         sl->lpvtblPersistStream = &psvt;
    900        
    901         TRACE("(%p)->()\n",sl);
    902         shell32_ObjCount++;
    903         return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
    904 }
    905 
    906 
     893{       IShellLinkImpl * sl;
     894
     895        sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));
     896        sl->ref = 1;
     897        sl->lpvtbl = &slvt;
     898        sl->lpvtblw = &slvtw;
     899        sl->lpvtblPersistFile = &pfvt;
     900        sl->lpvtblPersistStream = &psvt;
     901
     902        TRACE("(%p)->()\n",sl);
     903        shell32_ObjCount++;
     904        return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
     905}
     906
     907
Note: See TracChangeset for help on using the changeset viewer.