1998-11-25 17:39:47 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright 1997 Marcus Meissner
|
|
|
|
* Copyright 1998 Juergen Schmied
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
1999-06-12 17:45:58 +02:00
|
|
|
#include "debugtools.h"
|
1999-01-23 15:12:48 +01:00
|
|
|
#include "winerror.h"
|
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
#include "wine/obj_base.h"
|
|
|
|
#include "wine/obj_storage.h"
|
1999-02-24 16:58:26 +01:00
|
|
|
#include "wine/obj_shelllink.h"
|
1999-07-25 14:21:43 +02:00
|
|
|
#include "wine/undocshell.h"
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1999-02-24 16:58:26 +01:00
|
|
|
#include "heap.h"
|
|
|
|
#include "winnls.h"
|
1999-01-23 15:12:48 +01:00
|
|
|
#include "pidl.h"
|
1998-11-25 17:39:47 +01:00
|
|
|
#include "shell32_main.h"
|
1999-01-23 15:12:48 +01:00
|
|
|
#include "shlguid.h"
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1999-04-19 16:56:29 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(shell)
|
|
|
|
|
1999-02-24 16:58:26 +01:00
|
|
|
/* link file formats */
|
|
|
|
|
1999-04-25 14:36:53 +02:00
|
|
|
#include "pshpack1.h"
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-08-15 16:31:36 +02:00
|
|
|
/* flag1: lnk elements: simple link has 0x0B */
|
1999-02-24 16:58:26 +01:00
|
|
|
#define WORKDIR 0x10
|
|
|
|
#define ARGUMENT 0x20
|
|
|
|
#define ICON 0x40
|
1999-08-15 16:31:36 +02:00
|
|
|
#define UNC 0x80
|
1999-07-10 13:48:37 +02:00
|
|
|
|
1999-08-15 16:31:36 +02:00
|
|
|
/* fStartup */
|
1999-02-24 16:58:26 +01:00
|
|
|
#define NORMAL 0x01
|
|
|
|
#define MAXIMIZED 0x03
|
|
|
|
#define MINIMIZED 0x07
|
|
|
|
|
|
|
|
typedef struct _LINK_HEADER
|
|
|
|
{ DWORD MagicStr; /* 0x00 'L','\0','\0','\0' */
|
|
|
|
GUID MagicGuid; /* 0x04 is CLSID_ShellLink */
|
|
|
|
DWORD Flag1; /* 0x14 describes elements following */
|
|
|
|
DWORD Flag2; /* 0x18 */
|
|
|
|
FILETIME Time1; /* 0x1c */
|
|
|
|
FILETIME Time2; /* 0x24 */
|
|
|
|
FILETIME Time3; /* 0x2c */
|
|
|
|
DWORD Unknown1; /* 0x34 */
|
|
|
|
DWORD Unknown2; /* 0x38 icon number */
|
1999-08-15 16:31:36 +02:00
|
|
|
DWORD fStartup; /* 0x3c startup type */
|
1999-07-10 13:48:37 +02:00
|
|
|
DWORD wHotKey; /* 0x40 hotkey */
|
1999-02-24 16:58:26 +01:00
|
|
|
DWORD Unknown5; /* 0x44 */
|
|
|
|
DWORD Unknown6; /* 0x48 */
|
|
|
|
USHORT PidlSize; /* 0x4c */
|
|
|
|
ITEMIDLIST Pidl; /* 0x4e */
|
|
|
|
} LINK_HEADER, * PLINK_HEADER;
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
#define LINK_HEADER_SIZE (sizeof(LINK_HEADER)-sizeof(ITEMIDLIST))
|
|
|
|
|
1999-04-25 14:36:53 +02:00
|
|
|
#include "poppack.h"
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
static ICOM_VTABLE(IShellLink) slvt;
|
|
|
|
static ICOM_VTABLE(IShellLinkW) slvtw;
|
|
|
|
static ICOM_VTABLE(IPersistFile) pfvt;
|
|
|
|
static ICOM_VTABLE(IPersistStream) psvt;
|
|
|
|
|
|
|
|
/* IShellLink Implementation */
|
|
|
|
|
1999-02-17 16:57:24 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
ICOM_VTABLE(IShellLink)* lpvtbl;
|
|
|
|
DWORD ref;
|
|
|
|
|
|
|
|
ICOM_VTABLE(IShellLinkW)* lpvtblw;
|
|
|
|
ICOM_VTABLE(IPersistFile)* lpvtblPersistFile;
|
|
|
|
ICOM_VTABLE(IPersistStream)* lpvtblPersistStream;
|
|
|
|
|
|
|
|
/* internal stream of the IPersistFile interface */
|
|
|
|
IStream* lpFileStream;
|
|
|
|
|
|
|
|
/* data structures according to the informations in the lnk */
|
1999-02-24 16:58:26 +01:00
|
|
|
LPSTR sPath;
|
|
|
|
LPITEMIDLIST pPidl;
|
1999-07-10 13:48:37 +02:00
|
|
|
WORD wHotKey;
|
1999-08-15 16:31:36 +02:00
|
|
|
SYSTEMTIME time1;
|
|
|
|
SYSTEMTIME time2;
|
|
|
|
SYSTEMTIME time3;
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
} IShellLinkImpl;
|
1999-01-17 17:32:32 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
#define _IShellLinkW_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblw)))
|
|
|
|
#define _ICOM_THIS_From_IShellLinkW(class, name) class* This = (class*)(((char*)name)-_IShellLinkW_Offset);
|
1999-01-17 17:32:32 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
#define _IPersistFile_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblPersistFile)))
|
|
|
|
#define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
#define _IPersistStream_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblPersistStream)))
|
|
|
|
#define _ICOM_THIS_From_IPersistStream(class, name) class* This = (class*)(((char*)name)-_IPersistStream_Offset);
|
|
|
|
#define _IPersistStream_From_ICOM_THIS(class, name) class* StreamThis = (class*)(((char*)name)+_IPersistStream_Offset);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IPersistFile_QueryInterface
|
|
|
|
*/
|
1999-01-17 17:32:32 +01:00
|
|
|
static HRESULT WINAPI IPersistFile_fnQueryInterface(
|
1999-07-10 13:48:37 +02:00
|
|
|
IPersistFile* iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID *ppvObj)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)\n",This);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
|
|
|
|
}
|
1998-12-14 15:51:27 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* IPersistFile_AddRef
|
|
|
|
*/
|
1999-02-18 14:26:22 +01:00
|
|
|
static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_AddRef((IShellLink*)This);
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
|
|
|
* IPersistFile_Release
|
|
|
|
*/
|
1999-02-18 14:26:22 +01:00
|
|
|
static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_Release((IShellLink*)This);
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
|
|
|
|
1999-07-31 15:13:23 +02:00
|
|
|
static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile* iface, CLSID *pClassID)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)\n",This);
|
1998-12-14 15:51:27 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-07-31 15:13:23 +02:00
|
|
|
static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)\n",This);
|
1998-12-14 15:51:27 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface)
|
|
|
|
_IPersistStream_From_ICOM_THIS(IPersistStream, This)
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
LPSTR sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);
|
1999-02-24 16:58:26 +01:00
|
|
|
HRESULT hRet = E_FAIL;
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p, %s)\n",This, sFile);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
if (This->lpFileStream)
|
|
|
|
IStream_Release(This->lpFileStream);
|
|
|
|
|
|
|
|
if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream)))
|
|
|
|
{
|
|
|
|
if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream))
|
|
|
|
{
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
}
|
1999-04-22 11:20:01 +02:00
|
|
|
|
1999-02-24 16:58:26 +01:00
|
|
|
return hRet;
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
|
1999-07-10 13:48:37 +02:00
|
|
|
return NOERROR;
|
1999-01-17 17:32:32 +01:00
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
|
1999-07-10 13:48:37 +02:00
|
|
|
return NOERROR;
|
1999-01-17 17:32:32 +01:00
|
|
|
}
|
1999-07-31 15:13:23 +02:00
|
|
|
static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *ppszFileName)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)\n",This);
|
1998-12-14 15:51:27 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-07-10 13:48:37 +02:00
|
|
|
|
|
|
|
static ICOM_VTABLE(IPersistFile) pfvt =
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-05-22 13:41:38 +02:00
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
1999-02-24 16:58:26 +01:00
|
|
|
IPersistFile_fnQueryInterface,
|
|
|
|
IPersistFile_fnAddRef,
|
|
|
|
IPersistFile_fnRelease,
|
|
|
|
IPersistFile_fnGetClassID,
|
|
|
|
IPersistFile_fnIsDirty,
|
|
|
|
IPersistFile_fnLoad,
|
|
|
|
IPersistFile_fnSave,
|
|
|
|
IPersistFile_fnSaveCompleted,
|
|
|
|
IPersistFile_fnGetCurFile
|
1999-01-17 17:32:32 +01:00
|
|
|
};
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_QueryInterface
|
1998-12-14 15:51:27 +01:00
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
static HRESULT WINAPI IPersistStream_fnQueryInterface(
|
|
|
|
IPersistStream* iface,
|
|
|
|
REFIID riid,
|
|
|
|
VOID** ppvoid)
|
1999-02-17 16:57:24 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
1999-01-17 17:32:32 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)\n",This);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_QueryInterface((IShellLink*)This, riid, ppvoid);
|
|
|
|
}
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_Release
|
|
|
|
*/
|
|
|
|
static ULONG WINAPI IPersistStream_fnRelease(
|
|
|
|
IPersistStream* iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)\n",This);
|
|
|
|
|
|
|
|
return IShellLink_Release((IShellLink*)This);
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1999-07-10 13:48:37 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_AddRef
|
1998-12-14 15:51:27 +01:00
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
static ULONG WINAPI IPersistStream_fnAddRef(
|
|
|
|
IPersistStream* iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)\n",This);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_AddRef((IShellLink*)This);
|
|
|
|
}
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_GetClassID
|
|
|
|
*
|
1998-12-14 15:51:27 +01:00
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
static HRESULT WINAPI IPersistStream_fnGetClassID(
|
1999-07-31 15:13:23 +02:00
|
|
|
IPersistStream* iface,
|
1999-07-10 13:48:37 +02:00
|
|
|
CLSID* pClassID)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
if (pClassID==0)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
/* memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */
|
|
|
|
|
|
|
|
return S_OK;
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1999-07-10 13:48:37 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_IsDirty (IPersistStream)
|
1998-12-14 15:51:27 +01:00
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
static HRESULT WINAPI IPersistStream_fnIsDirty(
|
|
|
|
IPersistStream* iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
return S_OK;
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1999-07-10 13:48:37 +02:00
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_Load (IPersistStream)
|
1998-12-14 15:51:27 +01:00
|
|
|
*/
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
static HRESULT WINAPI IPersistStream_fnLoad(
|
|
|
|
IPersistStream* iface,
|
|
|
|
IStream* pLoadStream)
|
|
|
|
{
|
|
|
|
PLINK_HEADER lpLinkHeader = HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);
|
|
|
|
ULONG dwBytesRead;
|
|
|
|
DWORD ret = E_FAIL;
|
|
|
|
char sTemp[512];
|
|
|
|
|
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)(%p)\n", This, pLoadStream);
|
1998-12-14 15:51:27 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
if ( ! pLoadStream)
|
|
|
|
{
|
|
|
|
return STG_E_INVALIDPOINTER;
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
IStream_AddRef (pLoadStream);
|
|
|
|
if(lpLinkHeader)
|
|
|
|
{
|
|
|
|
if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead)))
|
|
|
|
{
|
|
|
|
if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink))
|
|
|
|
{
|
|
|
|
lpLinkHeader = HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);
|
|
|
|
if (lpLinkHeader)
|
|
|
|
{
|
|
|
|
if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead)))
|
|
|
|
{
|
|
|
|
if (pcheck (&lpLinkHeader->Pidl))
|
|
|
|
{
|
|
|
|
This->pPidl = ILClone (&lpLinkHeader->Pidl);
|
|
|
|
|
1999-07-25 14:21:43 +02:00
|
|
|
SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp);
|
1999-07-10 13:48:37 +02:00
|
|
|
This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp);
|
|
|
|
}
|
1999-08-15 16:31:36 +02:00
|
|
|
This->wHotKey = lpLinkHeader->wHotKey;
|
|
|
|
FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1);
|
|
|
|
FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2);
|
|
|
|
FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3);
|
|
|
|
#if 1
|
|
|
|
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256);
|
|
|
|
TRACE("-- time1: %s\n", sTemp);
|
|
|
|
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256);
|
|
|
|
TRACE("-- time1: %s\n", sTemp);
|
|
|
|
GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256);
|
|
|
|
TRACE("-- time1: %s\n", sTemp);
|
|
|
|
pdump (This->pPidl);
|
|
|
|
#endif
|
|
|
|
ret = S_OK;
|
1999-07-10 13:48:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
1999-08-15 16:31:36 +02:00
|
|
|
{
|
|
|
|
WARN("stream contains no link!\n");
|
1999-07-10 13:48:37 +02:00
|
|
|
}
|
|
|
|
}
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
IStream_Release (pLoadStream);
|
|
|
|
|
|
|
|
pdump(This->pPidl);
|
|
|
|
|
|
|
|
HeapFree(GetProcessHeap(), 0, lpLinkHeader);
|
|
|
|
|
|
|
|
return ret;
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1999-07-10 13:48:37 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_Save (IPersistStream)
|
1998-12-14 15:51:27 +01:00
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
static HRESULT WINAPI IPersistStream_fnSave(
|
|
|
|
IPersistStream* iface,
|
|
|
|
IStream* pOutStream,
|
|
|
|
BOOL fClearDirty)
|
1999-01-17 17:32:32 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty);
|
|
|
|
|
1998-12-14 15:51:27 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
/************************************************************************
|
|
|
|
* IPersistStream_GetSizeMax (IPersistStream)
|
1999-02-24 16:58:26 +01:00
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
static HRESULT WINAPI IPersistStream_fnGetSizeMax(
|
|
|
|
IPersistStream* iface,
|
|
|
|
ULARGE_INTEGER* pcbSize)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
1999-01-17 17:32:32 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
static ICOM_VTABLE(IPersistStream) psvt =
|
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
IPersistStream_fnQueryInterface,
|
|
|
|
IPersistStream_fnAddRef,
|
|
|
|
IPersistStream_fnRelease,
|
|
|
|
IPersistStream_fnGetClassID,
|
|
|
|
IPersistStream_fnIsDirty,
|
|
|
|
IPersistStream_fnLoad,
|
|
|
|
IPersistStream_fnSave,
|
|
|
|
IPersistStream_fnGetSizeMax
|
|
|
|
};
|
1998-11-25 17:39:47 +01:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* IShellLink_Constructor
|
|
|
|
*/
|
1999-07-10 13:48:37 +02:00
|
|
|
IShellLink * IShellLink_Constructor(BOOL bUnicode)
|
1999-02-24 16:58:26 +01:00
|
|
|
{ IShellLinkImpl * sl;
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1999-07-25 14:21:43 +02:00
|
|
|
sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));
|
1998-11-25 17:39:47 +01:00
|
|
|
sl->ref = 1;
|
|
|
|
sl->lpvtbl = &slvt;
|
1999-07-10 13:48:37 +02:00
|
|
|
sl->lpvtblw = &slvtw;
|
|
|
|
sl->lpvtblPersistFile = &pfvt;
|
|
|
|
sl->lpvtblPersistStream = &psvt;
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->()\n",sl);
|
1999-01-23 15:12:48 +01:00
|
|
|
shell32_ObjCount++;
|
1999-07-10 13:48:37 +02:00
|
|
|
return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;
|
1998-11-25 17:39:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
1999-07-10 13:48:37 +02:00
|
|
|
* IShellLink_QueryInterface
|
1998-11-25 17:39:47 +01:00
|
|
|
*/
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnQueryInterface( IShellLink * iface, REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
|
|
|
char xriid[50];
|
1998-12-14 15:51:27 +01:00
|
|
|
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid);
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1998-12-14 15:51:27 +01:00
|
|
|
*ppvObj = NULL;
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
if(IsEqualIID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualIID(riid, &IID_IShellLink))
|
|
|
|
{
|
|
|
|
*ppvObj = This;
|
|
|
|
}
|
|
|
|
else if(IsEqualIID(riid, &IID_IShellLinkW))
|
|
|
|
{
|
|
|
|
*ppvObj = (IShellLinkW *)&(This->lpvtblw);
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1999-07-10 13:48:37 +02:00
|
|
|
else if(IsEqualIID(riid, &IID_IPersistFile))
|
|
|
|
{
|
|
|
|
*ppvObj = (IPersistFile *)&(This->lpvtblPersistFile);
|
|
|
|
}
|
|
|
|
else if(IsEqualIID(riid, &IID_IPersistStream))
|
|
|
|
{
|
|
|
|
*ppvObj = (IPersistStream *)&(This->lpvtblPersistStream);
|
1998-12-14 15:51:27 +01:00
|
|
|
}
|
1998-11-25 17:39:47 +01:00
|
|
|
|
1998-12-14 15:51:27 +01:00
|
|
|
if(*ppvObj)
|
1999-07-10 13:48:37 +02:00
|
|
|
{
|
|
|
|
IUnknown_AddRef((IUnknown*)(*ppvObj));
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
|
1998-12-14 15:51:27 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("-- Interface: E_NOINTERFACE\n");
|
1998-12-14 15:51:27 +01:00
|
|
|
return E_NOINTERFACE;
|
1998-11-25 17:39:47 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
|
|
|
* IShellLink_AddRef
|
|
|
|
*/
|
1999-02-24 16:58:26 +01:00
|
|
|
static ULONG WINAPI IShellLink_fnAddRef(IShellLink * iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
|
|
|
shell32_ObjCount++;
|
1999-02-24 16:58:26 +01:00
|
|
|
return ++(This->ref);
|
1998-11-25 17:39:47 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
1998-12-14 15:51:27 +01:00
|
|
|
* IShellLink_Release
|
1998-11-25 17:39:47 +01:00
|
|
|
*/
|
1999-02-24 16:58:26 +01:00
|
|
|
static ULONG WINAPI IShellLink_fnRelease(IShellLink * iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
|
|
|
shell32_ObjCount--;
|
1999-02-24 16:58:26 +01:00
|
|
|
if (!--(This->ref))
|
1999-06-12 17:45:58 +02:00
|
|
|
{ TRACE("-- destroying IShellLink(%p)\n",This);
|
1999-07-10 13:48:37 +02:00
|
|
|
|
|
|
|
if (This->sPath)
|
|
|
|
HeapFree(GetProcessHeap(),0,This->sPath);
|
|
|
|
|
|
|
|
if (This->pPidl)
|
|
|
|
SHFree(This->pPidl);
|
|
|
|
|
|
|
|
if (This->lpFileStream)
|
|
|
|
IStream_Release(This->lpFileStream);
|
|
|
|
|
1999-02-24 16:58:26 +01:00
|
|
|
HeapFree(GetProcessHeap(),0,This);
|
1998-12-14 15:51:27 +01:00
|
|
|
return 0;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
return This->ref;
|
1998-11-25 17:39:47 +01:00
|
|
|
}
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetPath(IShellLink * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath));
|
|
|
|
|
|
|
|
if (This->sPath)
|
1999-07-25 14:21:43 +02:00
|
|
|
lstrcpynA(pszFile,This->sPath, cchMaxPath);
|
1999-07-10 13:48:37 +02:00
|
|
|
else
|
|
|
|
return E_FAIL;
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetIDList(IShellLink * iface, LPITEMIDLIST * ppidl)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(ppidl=%p)\n",This, ppidl);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
*ppidl = ILClone(This->pPidl);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetIDList(IShellLink * iface, LPCITEMIDLIST pidl)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(pidl=%p)\n",This, pidl);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
if (This->pPidl)
|
|
|
|
SHFree(This->pPidl);
|
|
|
|
This->pPidl = ILClone (pidl);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetDescription(IShellLink * iface, LPSTR pszName,INT cchMaxName)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
|
1999-07-25 14:21:43 +02:00
|
|
|
lstrcpynA(pszName,"Description, FIXME",cchMaxName);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetDescription(IShellLink * iface, LPCSTR pszName)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(desc=%s)\n",This, pszName);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetWorkingDirectory(IShellLink * iface, LPSTR pszDir,INT cchMaxPath)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->()\n",This);
|
1999-07-25 14:21:43 +02:00
|
|
|
lstrcpynA(pszDir,"c:\\", cchMaxPath);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetWorkingDirectory(IShellLink * iface, LPCSTR pszDir)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(dir=%s)\n",This, pszDir);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetArguments(IShellLink * iface, LPSTR pszArgs,INT cchMaxPath)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
|
1999-07-25 14:21:43 +02:00
|
|
|
lstrcpynA(pszArgs, "", cchMaxPath);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetArguments(IShellLink * iface, LPCSTR pszArgs)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(args=%s)\n",This, pszArgs);
|
1999-07-10 13:48:37 +02:00
|
|
|
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetHotkey(IShellLink * iface, WORD *pwHotkey)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey);
|
|
|
|
|
|
|
|
*pwHotkey = This->wHotKey;
|
|
|
|
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetHotkey(IShellLink * iface, WORD wHotkey)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
|
|
|
|
|
|
|
|
This->wHotKey = wHotkey;
|
|
|
|
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetShowCmd(IShellLink * iface, INT *piShowCmd)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p)\n",This, piShowCmd);
|
1998-11-25 17:39:47 +01:00
|
|
|
*piShowCmd=0;
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetShowCmd(IShellLink * iface, INT iShowCmd)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnGetIconLocation(IShellLink * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
|
1999-07-25 14:21:43 +02:00
|
|
|
lstrcpynA(pszIconPath,"shell32.dll",cchIconPath);
|
1998-11-25 17:39:47 +01:00
|
|
|
*piIcon=1;
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetIconLocation(IShellLink * iface, LPCSTR pszIconPath,INT iIcon)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetRelativePath(IShellLink * iface, LPCSTR pszPathRel, DWORD dwReserved)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnResolve(IShellLink * iface, HWND hwnd, DWORD fFlags)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLink_fnSetPath(IShellLink * iface, LPCSTR pszFile)
|
|
|
|
{
|
|
|
|
ICOM_THIS(IShellLinkImpl, iface);
|
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(path=%s)\n",This, pszFile);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
1999-02-24 16:58:26 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellLink Implementation
|
|
|
|
*/
|
|
|
|
|
|
|
|
static ICOM_VTABLE(IShellLink) slvt =
|
1999-05-22 13:41:38 +02:00
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
IShellLink_fnQueryInterface,
|
1999-02-24 16:58:26 +01:00
|
|
|
IShellLink_fnAddRef,
|
|
|
|
IShellLink_fnRelease,
|
|
|
|
IShellLink_fnGetPath,
|
|
|
|
IShellLink_fnGetIDList,
|
|
|
|
IShellLink_fnSetIDList,
|
|
|
|
IShellLink_fnGetDescription,
|
|
|
|
IShellLink_fnSetDescription,
|
|
|
|
IShellLink_fnGetWorkingDirectory,
|
|
|
|
IShellLink_fnSetWorkingDirectory,
|
|
|
|
IShellLink_fnGetArguments,
|
|
|
|
IShellLink_fnSetArguments,
|
|
|
|
IShellLink_fnGetHotkey,
|
|
|
|
IShellLink_fnSetHotkey,
|
|
|
|
IShellLink_fnGetShowCmd,
|
|
|
|
IShellLink_fnSetShowCmd,
|
|
|
|
IShellLink_fnGetIconLocation,
|
|
|
|
IShellLink_fnSetIconLocation,
|
|
|
|
IShellLink_fnSetRelativePath,
|
|
|
|
IShellLink_fnResolve,
|
|
|
|
IShellLink_fnSetPath
|
|
|
|
};
|
|
|
|
|
1998-11-25 17:39:47 +01:00
|
|
|
|
|
|
|
/**************************************************************************
|
1999-02-24 16:58:26 +01:00
|
|
|
* IShellLinkW_fnQueryInterface
|
1998-11-25 17:39:47 +01:00
|
|
|
*/
|
1999-02-24 16:58:26 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnQueryInterface(
|
|
|
|
IShellLinkW * iface, REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_QueryInterface((IShellLink*)This, riid, ppvObj);
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1998-11-25 17:39:47 +01:00
|
|
|
/******************************************************************************
|
1999-02-24 16:58:26 +01:00
|
|
|
* IShellLinkW_fnAddRef
|
1998-11-25 17:39:47 +01:00
|
|
|
*/
|
1999-02-24 16:58:26 +01:00
|
|
|
static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_AddRef((IShellLink*)This);
|
1998-11-25 17:39:47 +01:00
|
|
|
}
|
|
|
|
/******************************************************************************
|
1999-02-24 16:58:26 +01:00
|
|
|
* IShellLinkW_fnRelease
|
1998-11-25 17:39:47 +01:00
|
|
|
*/
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
TRACE("(%p)->(count=%lu)\n",This,This->ref);
|
1999-01-23 15:12:48 +01:00
|
|
|
|
1999-07-10 13:48:37 +02:00
|
|
|
return IShellLink_Release((IShellLink*)This);
|
1998-11-25 17:39:47 +01:00
|
|
|
}
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags);
|
1998-11-25 17:39:47 +01:00
|
|
|
lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(ppidl=%p)\n",This, ppidl);
|
1998-11-25 17:39:47 +01:00
|
|
|
*ppidl = _ILCreateDesktop();
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(pidl=%p)\n",This, pidl);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName);
|
1998-11-25 17:39:47 +01:00
|
|
|
lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->()\n",This);
|
1998-11-25 17:39:47 +01:00
|
|
|
lstrcpynAtoW(pszDir,"c:\\", cchMaxPath);
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath);
|
1998-11-25 17:39:47 +01:00
|
|
|
lstrcpynAtoW(pszArgs, "", cchMaxPath);
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p)\n",This, pwHotkey);
|
1998-11-25 17:39:47 +01:00
|
|
|
*pwHotkey=0x0;
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(hotkey=%x)\n",This, wHotkey);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p)\n",This, piShowCmd);
|
1998-11-25 17:39:47 +01:00
|
|
|
*piShowCmd=0;
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon);
|
1998-11-25 17:39:47 +01:00
|
|
|
lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath);
|
|
|
|
*piIcon=1;
|
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags)
|
1999-02-24 16:58:26 +01:00
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags);
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
1999-02-24 16:58:26 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile)
|
|
|
|
{
|
1999-07-10 13:48:37 +02:00
|
|
|
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
|
1999-02-24 16:58:26 +01:00
|
|
|
|
1999-06-12 17:45:58 +02:00
|
|
|
FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
|
1998-11-25 17:39:47 +01:00
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
1999-02-24 16:58:26 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* IShellLinkW Implementation
|
|
|
|
*/
|
|
|
|
|
|
|
|
static ICOM_VTABLE(IShellLinkW) slvtw =
|
1999-05-22 13:41:38 +02:00
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
IShellLinkW_fnQueryInterface,
|
1999-02-24 16:58:26 +01:00
|
|
|
IShellLinkW_fnAddRef,
|
|
|
|
IShellLinkW_fnRelease,
|
|
|
|
IShellLinkW_fnGetPath,
|
|
|
|
IShellLinkW_fnGetIDList,
|
|
|
|
IShellLinkW_fnSetIDList,
|
|
|
|
IShellLinkW_fnGetDescription,
|
|
|
|
IShellLinkW_fnSetDescription,
|
|
|
|
IShellLinkW_fnGetWorkingDirectory,
|
|
|
|
IShellLinkW_fnSetWorkingDirectory,
|
|
|
|
IShellLinkW_fnGetArguments,
|
|
|
|
IShellLinkW_fnSetArguments,
|
|
|
|
IShellLinkW_fnGetHotkey,
|
|
|
|
IShellLinkW_fnSetHotkey,
|
|
|
|
IShellLinkW_fnGetShowCmd,
|
|
|
|
IShellLinkW_fnSetShowCmd,
|
|
|
|
IShellLinkW_fnGetIconLocation,
|
|
|
|
IShellLinkW_fnSetIconLocation,
|
|
|
|
IShellLinkW_fnSetRelativePath,
|
|
|
|
IShellLinkW_fnResolve,
|
|
|
|
IShellLinkW_fnSetPath
|
|
|
|
};
|
|
|
|
|