ReactOS 0.4.17-dev-769-g1500a35
link.c File Reference
#include "hlink_private.h"
#include "shellapi.h"
#include "hlguids.h"
#include "wine/debug.h"
Include dependency graph for link.c:

Go to the source code of this file.

Classes

struct  HlinkImpl
 

Macros

#define HLINK_SAVE_MAGIC   0x00000002
 
#define HLINK_SAVE_MONIKER_PRESENT   0x01
 
#define HLINK_SAVE_MONIKER_IS_ABSOLUTE   0x02
 
#define HLINK_SAVE_LOCATION_PRESENT   0x08
 
#define HLINK_SAVE_FRIENDLY_PRESENT   0x10
 
#define HLINK_SAVE_TARGET_FRAME_PRESENT   0x80
 
#define HLINK_SAVE_ALL   (HLINK_SAVE_TARGET_FRAME_PRESENT|HLINK_SAVE_FRIENDLY_PRESENT|HLINK_SAVE_LOCATION_PRESENT|0x04|HLINK_SAVE_MONIKER_IS_ABSOLUTE|HLINK_SAVE_MONIKER_PRESENT)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (hlink)
 
static HlinkImplimpl_from_IHlink (IHlink *iface)
 
static HlinkImplimpl_from_IPersistStream (IPersistStream *iface)
 
static HlinkImplimpl_from_IDataObject (IDataObject *iface)
 
static HRESULT __GetMoniker (HlinkImpl *This, IMoniker **moniker, DWORD ref_type)
 
static HRESULT WINAPI IHlink_fnQueryInterface (IHlink *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI IHlink_fnAddRef (IHlink *iface)
 
static ULONG WINAPI IHlink_fnRelease (IHlink *iface)
 
static HRESULT WINAPI IHlink_fnSetHlinkSite (IHlink *iface, IHlinkSite *pihlSite, DWORD dwSiteData)
 
static HRESULT WINAPI IHlink_fnGetHlinkSite (IHlink *iface, IHlinkSite **ppihlSite, DWORD *pdwSiteData)
 
static HRESULT WINAPI IHlink_fnSetMonikerReference (IHlink *iface, DWORD rfHLSETF, IMoniker *pmkTarget, LPCWSTR pwzLocation)
 
static HRESULT WINAPI IHlink_fnSetStringReference (IHlink *iface, DWORD grfHLSETF, LPCWSTR pwzTarget, LPCWSTR pwzLocation)
 
static HRESULT WINAPI IHlink_fnGetMonikerReference (IHlink *iface, DWORD dwWhichRef, IMoniker **ppimkTarget, LPWSTR *ppwzLocation)
 
static HRESULT WINAPI IHlink_fnGetStringReference (IHlink *iface, DWORD dwWhichRef, LPWSTR *ppwzTarget, LPWSTR *ppwzLocation)
 
static HRESULT WINAPI IHlink_fnSetFriendlyName (IHlink *iface, LPCWSTR pwzFriendlyName)
 
static HRESULT WINAPI IHlink_fnGetFriendlyName (IHlink *iface, DWORD grfHLFNAMEF, LPWSTR *ppwzFriendlyName)
 
static HRESULT WINAPI IHlink_fnSetTargetFrameName (IHlink *iface, LPCWSTR pwzTargetFramename)
 
static HRESULT WINAPI IHlink_fnGetTargetFrameName (IHlink *iface, LPWSTR *ppwzTargetFrameName)
 
static HRESULT WINAPI IHlink_fnGetMiscStatus (IHlink *iface, DWORD *pdwStatus)
 
static HRESULT WINAPI IHlink_fnNavigate (IHlink *iface, DWORD flags, IBindCtx *user_bind_ctx, IBindStatusCallback *bind_callback, IHlinkBrowseContext *browse_ctx)
 
static HRESULT WINAPI IHlink_fnSetAdditionalParams (IHlink *iface, LPCWSTR pwzAdditionalParams)
 
static HRESULT WINAPI IHlink_fnGetAdditionalParams (IHlink *iface, LPWSTR *ppwzAdditionalParams)
 
static HRESULT WINAPI IDataObject_fnQueryInterface (IDataObject *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI IDataObject_fnAddRef (IDataObject *iface)
 
static ULONG WINAPI IDataObject_fnRelease (IDataObject *iface)
 
static HRESULT WINAPI IDataObject_fnGetData (IDataObject *iface, FORMATETC *pformatetcIn, STGMEDIUM *pmedium)
 
static HRESULT WINAPI IDataObject_fnGetDataHere (IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
 
static HRESULT WINAPI IDataObject_fnQueryGetData (IDataObject *iface, FORMATETC *pformatetc)
 
static HRESULT WINAPI IDataObject_fnGetConicalFormatEtc (IDataObject *iface, FORMATETC *pformatetcIn, FORMATETC *pformatetcOut)
 
static HRESULT WINAPI IDataObject_fnSetData (IDataObject *iface, FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
 
static HRESULT WINAPI IDataObject_fnEnumFormatEtc (IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
 
static HRESULT WINAPI IDataObject_fnDAdvise (IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
 
static HRESULT WINAPI IDataObject_fnDUnadvise (IDataObject *iface, DWORD dwConnection)
 
static HRESULT WINAPI IDataObject_fnEnumDAdvise (IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
 
static HRESULT WINAPI IPersistStream_fnQueryInterface (IPersistStream *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI IPersistStream_fnAddRef (IPersistStream *iface)
 
static ULONG WINAPI IPersistStream_fnRelease (IPersistStream *iface)
 
static HRESULT WINAPI IPersistStream_fnGetClassID (IPersistStream *iface, CLSID *pClassID)
 
static HRESULT WINAPI IPersistStream_fnIsDirty (IPersistStream *iface)
 
static HRESULT write_hlink_string (IStream *pStm, LPCWSTR str)
 
static ULONG size_hlink_string (LPCWSTR str)
 
static HRESULT read_hlink_string (IStream *pStm, LPWSTR *out_str)
 
static HRESULT WINAPI IPersistStream_fnLoad (IPersistStream *iface, IStream *pStm)
 
static HRESULT WINAPI IPersistStream_fnSave (IPersistStream *iface, IStream *pStm, BOOL fClearDirty)
 
static HRESULT WINAPI IPersistStream_fnGetSizeMax (IPersistStream *iface, ULARGE_INTEGER *pcbSize)
 
static HlinkImplimpl_from_IBindStatusCallback (IBindStatusCallback *iface)
 
static HRESULT WINAPI bind_callback_QueryInterface (IBindStatusCallback *iface, REFIID iid, void **out)
 
static ULONG WINAPI bind_callback_AddRef (IBindStatusCallback *iface)
 
static ULONG WINAPI bind_callback_Release (IBindStatusCallback *iface)
 
static HRESULT WINAPI bind_callback_OnStartBinding (IBindStatusCallback *iface, DWORD reserved, IBinding *binding)
 
static HRESULT WINAPI bind_callback_GetPriority (IBindStatusCallback *iface, LONG *priority)
 
static HRESULT WINAPI bind_callback_OnLowResource (IBindStatusCallback *iface, DWORD reserved)
 
static HRESULT WINAPI bind_callback_OnProgress (IBindStatusCallback *iface, ULONG progress, ULONG max, ULONG status, const WCHAR *text)
 
static HRESULT WINAPI bind_callback_OnStopBinding (IBindStatusCallback *iface, HRESULT hr, const WCHAR *error)
 
static HRESULT WINAPI bind_callback_GetBindInfo (IBindStatusCallback *iface, DWORD *bind_flags, BINDINFO *bind_info)
 
static HRESULT WINAPI bind_callback_OnDataAvailable (IBindStatusCallback *iface, DWORD flags, DWORD size, FORMATETC *formatetc, STGMEDIUM *stgmed)
 
static HRESULT WINAPI bind_callback_OnObjectAvailable (IBindStatusCallback *iface, REFIID iid, IUnknown *unk)
 
HRESULT HLink_Constructor (IUnknown *pUnkOuter, REFIID riid, void **ppv)
 

Variables

static const IHlinkVtbl hlvt
 
static const IDataObjectVtbl dovt
 
static const IPersistStreamVtbl psvt
 
static const IBindStatusCallbackVtbl bind_callback_vtbl
 

Macro Definition Documentation

◆ HLINK_SAVE_ALL

◆ HLINK_SAVE_FRIENDLY_PRESENT

#define HLINK_SAVE_FRIENDLY_PRESENT   0x10

Definition at line 34 of file link.c.

◆ HLINK_SAVE_LOCATION_PRESENT

#define HLINK_SAVE_LOCATION_PRESENT   0x08

Definition at line 33 of file link.c.

◆ HLINK_SAVE_MAGIC

#define HLINK_SAVE_MAGIC   0x00000002

Definition at line 30 of file link.c.

◆ HLINK_SAVE_MONIKER_IS_ABSOLUTE

#define HLINK_SAVE_MONIKER_IS_ABSOLUTE   0x02

Definition at line 32 of file link.c.

◆ HLINK_SAVE_MONIKER_PRESENT

#define HLINK_SAVE_MONIKER_PRESENT   0x01

Definition at line 31 of file link.c.

◆ HLINK_SAVE_TARGET_FRAME_PRESENT

#define HLINK_SAVE_TARGET_FRAME_PRESENT   0x80

Definition at line 36 of file link.c.

Function Documentation

◆ __GetMoniker()

static HRESULT __GetMoniker ( HlinkImpl This,
IMoniker **  moniker,
DWORD  ref_type 
)
static

Definition at line 79 of file link.c.

81{
83
84 if (ref_type == HLINKGETREF_DEFAULT)
85 ref_type = HLINKGETREF_RELATIVE;
86
87 if (This->Moniker)
88 {
89 DWORD mktype = MKSYS_NONE;
90
91 hres = IMoniker_IsSystemMoniker(This->Moniker, &mktype);
92 if (hres == S_OK && mktype != MKSYS_NONE)
93 {
94 *moniker = This->Moniker;
95 IMoniker_AddRef(*moniker);
96 return S_OK;
97 }
98 }
99
100 if (ref_type == HLINKGETREF_ABSOLUTE && This->Site)
101 {
102 IMoniker *hls_moniker;
103
104 hres = IHlinkSite_GetMoniker(This->Site, This->SiteData,
105 OLEGETMONIKER_FORCEASSIGN, OLEWHICHMK_CONTAINER, &hls_moniker);
106 if (FAILED(hres))
107 return hres;
108
109 if (This->Moniker)
110 {
111 hres = IMoniker_ComposeWith(hls_moniker, This->Moniker, FALSE,
112 moniker);
113 IMoniker_Release(hls_moniker);
114 return hres;
115 }
116
117 *moniker = hls_moniker;
118 return S_OK;
119 }
120
121 *moniker = This->Moniker;
122 if (*moniker)
123 IMoniker_AddRef(*moniker);
124
125 return S_OK;
126}
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
Definition: main.c:40

Referenced by IHlink_fnGetFriendlyName(), IHlink_fnGetMonikerReference(), IHlink_fnGetStringReference(), IHlink_fnNavigate(), IPersistStream_fnGetSizeMax(), and IPersistStream_fnSave().

◆ bind_callback_AddRef()

static ULONG WINAPI bind_callback_AddRef ( IBindStatusCallback iface)
static

Definition at line 988 of file link.c.

989{
991 return IHlink_AddRef(&hlink->IHlink_iface);
992}
Definition: link.c:41
IHlink IHlink_iface
Definition: link.c:42

◆ bind_callback_GetBindInfo()

static HRESULT WINAPI bind_callback_GetBindInfo ( IBindStatusCallback iface,
DWORD bind_flags,
BINDINFO *  bind_info 
)
static

Definition at line 1064 of file link.c.

1066{
1068
1069 TRACE("hlink %p, bind_flags %p, bind_info %p.\n", hlink, bind_flags, bind_info);
1070
1071 if (hlink->bind_callback)
1072 return IBindStatusCallback_GetBindInfo(hlink->bind_callback, bind_flags, bind_info);
1073 return S_OK;
1074}
static IInternetBindInfo bind_info
Definition: mimeole.c:1246
#define TRACE(s)
Definition: solgame.cpp:4
IBindStatusCallback * bind_callback
Definition: link.c:57

◆ bind_callback_GetPriority()

static HRESULT WINAPI bind_callback_GetPriority ( IBindStatusCallback iface,
LONG priority 
)
static

Definition at line 1012 of file link.c.

1013{
1014 FIXME("iface %p, priority %p, stub!\n", iface, priority);
1015 return E_NOTIMPL;
1016}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
static int priority
Definition: timer.c:163

◆ bind_callback_OnDataAvailable()

static HRESULT WINAPI bind_callback_OnDataAvailable ( IBindStatusCallback iface,
DWORD  flags,
DWORD  size,
FORMATETC *  formatetc,
STGMEDIUM *  stgmed 
)
static

Definition at line 1076 of file link.c.

1078{
1079 FIXME("iface %p, flags %#lx, size %ld, formatetc %p, stgmed %p, stub!\n",
1080 iface, flags, size, formatetc, stgmed);
1081 return E_NOTIMPL;
1082}
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161

◆ bind_callback_OnLowResource()

static HRESULT WINAPI bind_callback_OnLowResource ( IBindStatusCallback iface,
DWORD  reserved 
)
static

Definition at line 1018 of file link.c.

1019{
1021
1022 TRACE("hlink %p, reserved %#lx.\n", hlink, reserved);
1023
1024 if (hlink->bind_callback)
1025 return IBindStatusCallback_OnLowResource(hlink->bind_callback, reserved);
1026 return S_OK;
1027}
r reserved
Definition: btrfs.c:3006

◆ bind_callback_OnObjectAvailable()

static HRESULT WINAPI bind_callback_OnObjectAvailable ( IBindStatusCallback iface,
REFIID  iid,
IUnknown unk 
)
static

Definition at line 1084 of file link.c.

1086{
1089 HRESULT hr;
1090
1091 TRACE("hlink %p, iid %s, unk %p.\n", hlink, debugstr_guid(iid), unk);
1092
1093 if (hlink->bind_callback)
1094 IBindStatusCallback_OnObjectAvailable(hlink->bind_callback, iid, unk);
1095
1096 if (hlink->async_bind_ctx)
1097 {
1098 hr = IUnknown_QueryInterface(unk, &IID_IHlinkTarget, (void **)&target);
1099 if (FAILED(hr))
1100 return hr;
1101
1102 IHlinkTarget_SetBrowseContext(target, hlink->async_browse_ctx);
1103 hr = IHlinkTarget_Navigate(target, hlink->async_flags, hlink->Location);
1104 IHlinkTarget_Release(target);
1105
1106 if (hlink->Site)
1107 IHlinkSite_OnNavigationComplete(hlink->Site, hlink->SiteData, 0, hr, NULL);
1108
1109 return hr;
1110 }
1111
1112 return S_OK;
1113}
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define debugstr_guid
Definition: kernel32.h:35
DWORD SiteData
Definition: link.c:53
DWORD async_flags
Definition: link.c:59
IHlinkSite * Site
Definition: link.c:52
IHlinkBrowseContext * async_browse_ctx
Definition: link.c:60
LPWSTR Location
Definition: link.c:49
IBindCtx * async_bind_ctx
Definition: link.c:58
Definition: tools.h:99

◆ bind_callback_OnProgress()

static HRESULT WINAPI bind_callback_OnProgress ( IBindStatusCallback iface,
ULONG  progress,
ULONG  max,
ULONG  status,
const WCHAR text 
)
static

Definition at line 1029 of file link.c.

1031{
1033
1034 TRACE("hlink %p, progress %lu, max %lu, status %lu, text %s.\n",
1035 hlink, progress, max, status, debugstr_w(text));
1036
1037 if (hlink->bind_callback)
1038 return IBindStatusCallback_OnProgress(hlink->bind_callback, progress, max, status, text);
1039 return S_OK;
1040}
cd_progress_ptr progress
Definition: cdjpeg.h:152
const WCHAR * text
Definition: package.c:1794
#define debugstr_w
Definition: kernel32.h:32
Definition: ps.c:97
#define max(a, b)
Definition: svc.c:63

◆ bind_callback_OnStartBinding()

static HRESULT WINAPI bind_callback_OnStartBinding ( IBindStatusCallback iface,
DWORD  reserved,
IBinding binding 
)
static

Definition at line 1000 of file link.c.

1002{
1004
1005 TRACE("hlink %p, reserved %#lx, binding %p.\n", hlink, reserved, binding);
1006
1007 if (hlink->bind_callback)
1008 return IBindStatusCallback_OnStartBinding(hlink->bind_callback, reserved, binding);
1009 return S_OK;
1010}
static RPC_BINDING_HANDLE binding
Definition: server.c:166

◆ bind_callback_OnStopBinding()

static HRESULT WINAPI bind_callback_OnStopBinding ( IBindStatusCallback iface,
HRESULT  hr,
const WCHAR error 
)
static

Definition at line 1042 of file link.c.

1044{
1046
1047 TRACE("hlink %p, hr %#lx, error %s.\n", hlink, hr, debugstr_w(error));
1048
1049 if (hlink->bind_callback)
1050 IBindStatusCallback_OnStopBinding(hlink->bind_callback, hr, error);
1051
1052 if (hlink->async_bind_ctx)
1053 {
1054 if (hlink->bind_callback)
1055 IBindStatusCallback_Release(hlink->bind_callback);
1057 IBindCtx_Release(hlink->async_bind_ctx);
1058 IHlinkBrowseContext_Release(hlink->async_browse_ctx);
1059 hlink->async_bind_ctx = NULL;
1060 }
1061 return S_OK;
1062}
#define error(str)
Definition: mkdosfs.c:1605
HRESULT WINAPI RevokeBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc)
Definition: bindctx.c:676

◆ bind_callback_QueryInterface()

static HRESULT WINAPI bind_callback_QueryInterface ( IBindStatusCallback iface,
REFIID  iid,
void **  out 
)
static

Definition at line 976 of file link.c.

977{
978 if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IBindStatusCallback))
979 {
980 IBindStatusCallback_AddRef(*out = iface);
981 return S_OK;
982 }
983
984 WARN("No interface for %s.\n", debugstr_guid(iid));
985 return E_NOINTERFACE;
986}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ bind_callback_Release()

static ULONG WINAPI bind_callback_Release ( IBindStatusCallback iface)
static

Definition at line 994 of file link.c.

995{
997 return IHlink_Release(&hlink->IHlink_iface);
998}

◆ HLink_Constructor()

HRESULT HLink_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)

Definition at line 1130 of file link.c.

1131{
1132 HlinkImpl * hl;
1133 HRESULT hr;
1134
1135 TRACE("unkOut=%p riid=%s\n", pUnkOuter, debugstr_guid(riid));
1136 *ppv = NULL;
1137
1138 if (pUnkOuter)
1139 return CLASS_E_NOAGGREGATION;
1140
1141 if (!(hl = calloc(1, sizeof(*hl))))
1142 return E_OUTOFMEMORY;
1143
1144 hl->ref = 1;
1145 hl->IHlink_iface.lpVtbl = &hlvt;
1146 hl->IPersistStream_iface.lpVtbl = &psvt;
1147 hl->IDataObject_iface.lpVtbl = &dovt;
1149
1150 hr = IHlink_QueryInterface(&hl->IHlink_iface, riid, ppv);
1151 IHlink_Release(&hl->IHlink_iface);
1152
1153 return hr;
1154}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define calloc
Definition: rosglue.h:14
IDataObject IDataObject_iface
Definition: link.c:46
IBindStatusCallback IBindStatusCallback_iface
Definition: link.c:56
IPersistStream IPersistStream_iface
Definition: link.c:45
LONG ref
Definition: link.c:43
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ IDataObject_fnAddRef()

static ULONG WINAPI IDataObject_fnAddRef ( IDataObject iface)
static

Definition at line 603 of file link.c.

604{
606 TRACE("%p\n", This);
607 return IHlink_AddRef(&This->IHlink_iface);
608}

◆ IDataObject_fnDAdvise()

static HRESULT WINAPI IDataObject_fnDAdvise ( IDataObject iface,
FORMATETC *  pformatetc,
DWORD  advf,
IAdviseSink pAdvSink,
DWORD pdwConnection 
)
static

Definition at line 659 of file link.c.

662{
663 FIXME("\n");
664 return E_NOTIMPL;
665}

◆ IDataObject_fnDUnadvise()

static HRESULT WINAPI IDataObject_fnDUnadvise ( IDataObject iface,
DWORD  dwConnection 
)
static

Definition at line 667 of file link.c.

669{
670 FIXME("\n");
671 return E_NOTIMPL;
672}

◆ IDataObject_fnEnumDAdvise()

static HRESULT WINAPI IDataObject_fnEnumDAdvise ( IDataObject iface,
IEnumSTATDATA **  ppenumAdvise 
)
static

Definition at line 674 of file link.c.

676{
677 FIXME("\n");
678 return E_NOTIMPL;
679}

◆ IDataObject_fnEnumFormatEtc()

static HRESULT WINAPI IDataObject_fnEnumFormatEtc ( IDataObject iface,
DWORD  dwDirection,
IEnumFORMATETC **  ppenumFormatEtc 
)
static

Definition at line 652 of file link.c.

654{
655 FIXME("\n");
656 return E_NOTIMPL;
657}

◆ IDataObject_fnGetConicalFormatEtc()

static HRESULT WINAPI IDataObject_fnGetConicalFormatEtc ( IDataObject iface,
FORMATETC *  pformatetcIn,
FORMATETC *  pformatetcOut 
)
static

Definition at line 638 of file link.c.

640{
641 FIXME("\n");
642 return E_NOTIMPL;
643}

◆ IDataObject_fnGetData()

static HRESULT WINAPI IDataObject_fnGetData ( IDataObject iface,
FORMATETC *  pformatetcIn,
STGMEDIUM *  pmedium 
)
static

Definition at line 617 of file link.c.

619{
620 FIXME("\n");
621 return E_NOTIMPL;
622}

◆ IDataObject_fnGetDataHere()

static HRESULT WINAPI IDataObject_fnGetDataHere ( IDataObject iface,
FORMATETC *  pformatetc,
STGMEDIUM *  pmedium 
)
static

Definition at line 624 of file link.c.

626{
627 FIXME("\n");
628 return E_NOTIMPL;
629}

◆ IDataObject_fnQueryGetData()

static HRESULT WINAPI IDataObject_fnQueryGetData ( IDataObject iface,
FORMATETC *  pformatetc 
)
static

Definition at line 631 of file link.c.

633{
634 FIXME("\n");
635 return E_NOTIMPL;
636}

◆ IDataObject_fnQueryInterface()

static HRESULT WINAPI IDataObject_fnQueryInterface ( IDataObject iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 595 of file link.c.

597{
599 TRACE("%p\n", This);
600 return IHlink_QueryInterface(&This->IHlink_iface, riid, ppvObj);
601}

◆ IDataObject_fnRelease()

static ULONG WINAPI IDataObject_fnRelease ( IDataObject iface)
static

Definition at line 610 of file link.c.

611{
613 TRACE("%p\n", This);
614 return IHlink_Release(&This->IHlink_iface);
615}

◆ IDataObject_fnSetData()

static HRESULT WINAPI IDataObject_fnSetData ( IDataObject iface,
FORMATETC *  pformatetc,
STGMEDIUM *  pmedium,
BOOL  fRelease 
)
static

Definition at line 645 of file link.c.

647{
648 FIXME("\n");
649 return E_NOTIMPL;
650}

◆ IHlink_fnAddRef()

static ULONG WINAPI IHlink_fnAddRef ( IHlink iface)
static

Definition at line 152 of file link.c.

153{
155 ULONG refCount = InterlockedIncrement(&This->ref);
156
157 TRACE("(%p)->(count=%lu)\n", This, refCount - 1);
158
159 return refCount;
160}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59

◆ IHlink_fnGetAdditionalParams()

static HRESULT WINAPI IHlink_fnGetAdditionalParams ( IHlink iface,
LPWSTR ppwzAdditionalParams 
)
static

Definition at line 567 of file link.c.

569{
570 TRACE("Not implemented in native IHlink\n");
571 return E_NOTIMPL;
572}

◆ IHlink_fnGetFriendlyName()

static HRESULT WINAPI IHlink_fnGetFriendlyName ( IHlink iface,
DWORD  grfHLFNAMEF,
LPWSTR ppwzFriendlyName 
)
static

Definition at line 408 of file link.c.

410{
412
413 TRACE("(%p) -> (%li %p)\n", This, grfHLFNAMEF, ppwzFriendlyName);
414
415 /* FIXME: Only using explicitly set and cached friendly names */
416
417 if (This->FriendlyName)
418 *ppwzFriendlyName = hlink_co_strdupW( This->FriendlyName );
419 else
420 {
422 HRESULT hres = __GetMoniker(This, &moniker, HLINKGETREF_DEFAULT);
423 if (FAILED(hres))
424 {
425 *ppwzFriendlyName = NULL;
426 return hres;
427 }
428 if (moniker)
429 {
430 IBindCtx *bcxt;
431 CreateBindCtx(0, &bcxt);
432
433 IMoniker_GetDisplayName(moniker, bcxt, NULL, ppwzFriendlyName);
434 IBindCtx_Release(bcxt);
435 IMoniker_Release(moniker);
436 }
437 else
438 *ppwzFriendlyName = NULL;
439 }
440
441 return S_OK;
442}
HRESULT WINAPI CreateBindCtx(DWORD reserved, IBindCtx **bind_context)
Definition: bindctx.c:491

◆ IHlink_fnGetHlinkSite()

static HRESULT WINAPI IHlink_fnGetHlinkSite ( IHlink iface,
IHlinkSite **  ppihlSite,
DWORD pdwSiteData 
)
static

Definition at line 202 of file link.c.

204{
206
207 TRACE("(%p)->(%p %p)\n", This, ppihlSite, pdwSiteData);
208
209 *ppihlSite = This->Site;
210
211 if (This->Site) {
212 IHlinkSite_AddRef(This->Site);
213 *pdwSiteData = This->SiteData;
214 }
215
216 return S_OK;
217}

◆ IHlink_fnGetMiscStatus()

static HRESULT WINAPI IHlink_fnGetMiscStatus ( IHlink iface,
DWORD pdwStatus 
)
static

Definition at line 475 of file link.c.

476{
477 FIXME("\n");
478 return E_NOTIMPL;
479}

◆ IHlink_fnGetMonikerReference()

static HRESULT WINAPI IHlink_fnGetMonikerReference ( IHlink iface,
DWORD  dwWhichRef,
IMoniker **  ppimkTarget,
LPWSTR ppwzLocation 
)
static

Definition at line 322 of file link.c.

324{
326
327 TRACE("(%p) -> (%li %p %p)\n", This, dwWhichRef, ppimkTarget,
328 ppwzLocation);
329
330 if (ppimkTarget)
331 {
332 HRESULT hres = __GetMoniker(This, ppimkTarget, dwWhichRef);
333 if (FAILED(hres))
334 {
335 if (ppwzLocation)
336 *ppwzLocation = NULL;
337 return hres;
338 }
339 }
340
341 if (ppwzLocation)
342 IHlink_GetStringReference(iface, dwWhichRef, NULL, ppwzLocation);
343
344 return S_OK;
345}

◆ IHlink_fnGetStringReference()

static HRESULT WINAPI IHlink_fnGetStringReference ( IHlink iface,
DWORD  dwWhichRef,
LPWSTR ppwzTarget,
LPWSTR ppwzLocation 
)
static

Definition at line 347 of file link.c.

349{
351
352 TRACE("(%p) -> (%li %p %p)\n", This, dwWhichRef, ppwzTarget, ppwzLocation);
353
354 if(dwWhichRef != -1 && dwWhichRef & ~(HLINKGETREF_DEFAULT | HLINKGETREF_ABSOLUTE | HLINKGETREF_RELATIVE))
355 {
356 if(ppwzTarget)
357 *ppwzTarget = NULL;
358 if(ppwzLocation)
359 *ppwzLocation = NULL;
360 return E_INVALIDARG;
361 }
362
363 if (ppwzTarget)
364 {
365 IMoniker* mon;
366 HRESULT hres = __GetMoniker(This, &mon, dwWhichRef);
367 if (FAILED(hres))
368 {
369 if (ppwzLocation)
370 *ppwzLocation = NULL;
371 return hres;
372 }
373 if (mon)
374 {
375 IBindCtx *pbc;
376
377 CreateBindCtx( 0, &pbc);
378 IMoniker_GetDisplayName(mon, pbc, NULL, ppwzTarget);
379 IBindCtx_Release(pbc);
380 IMoniker_Release(mon);
381 }
382 else
383 *ppwzTarget = NULL;
384 }
385 if (ppwzLocation)
386 *ppwzLocation = hlink_co_strdupW( This->Location );
387
388 TRACE("(Target: %s Location: %s)\n",
389 (ppwzTarget)?debugstr_w(*ppwzTarget):"<NULL>",
390 (ppwzLocation)?debugstr_w(*ppwzLocation):"<NULL>");
391
392 return S_OK;
393}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ IHlink_fnGetTargetFrameName()

static HRESULT WINAPI IHlink_fnGetTargetFrameName ( IHlink iface,
LPWSTR ppwzTargetFrameName 
)
static

Definition at line 456 of file link.c.

458{
460
461 TRACE("(%p)->(%p)\n", This, ppwzTargetFrameName);
462
463 if(!This->TargetFrameName) {
464 *ppwzTargetFrameName = NULL;
465 return S_FALSE;
466 }
467
468 *ppwzTargetFrameName = hlink_co_strdupW( This->TargetFrameName );
469 if(!*ppwzTargetFrameName)
470 return E_OUTOFMEMORY;
471
472 return S_OK;
473}
#define S_FALSE
Definition: winerror.h:3451

◆ IHlink_fnNavigate()

static HRESULT WINAPI IHlink_fnNavigate ( IHlink iface,
DWORD  flags,
IBindCtx user_bind_ctx,
IBindStatusCallback bind_callback,
IHlinkBrowseContext browse_ctx 
)
static

Definition at line 481 of file link.c.

483{
485 IMoniker *mon = NULL;
486 HRESULT r;
487
488 TRACE("hlink %p, flags %#lx, user_bind_ctx %p, bind_callback %p, browse_ctx %p.\n",
489 This, flags, user_bind_ctx, bind_callback, browse_ctx);
490
491 if (This->async_bind_ctx)
492 return E_UNEXPECTED;
493
494 r = __GetMoniker(This, &mon, HLINKGETREF_ABSOLUTE);
495 TRACE("Moniker %p\n", mon);
496
497 if (SUCCEEDED(r))
498 {
499 IBindCtx *bind_ctx = NULL;
500 IUnknown *unk = NULL;
502
503 if (browse_ctx)
504 {
505 r = IHlinkBrowseContext_GetObject(browse_ctx, mon, TRUE, &unk);
506 if (r != S_OK)
507 {
508 CreateBindCtx(0, &bind_ctx);
509 RegisterBindStatusCallback(bind_ctx, &This->IBindStatusCallback_iface, NULL, 0);
510 This->bind_callback = bind_callback;
511 r = IMoniker_BindToObject(mon, bind_ctx, NULL, &IID_IUnknown, (void**)&unk);
512 if (r == MK_S_ASYNCHRONOUS)
513 {
514 This->async_bind_ctx = bind_ctx;
515 This->async_flags = flags;
516 if (bind_callback)
517 IBindStatusCallback_AddRef(bind_callback);
518 IHlinkBrowseContext_AddRef(This->async_browse_ctx = browse_ctx);
519 IMoniker_Release(mon);
520 return r;
521 }
522 }
523 if (r == S_OK)
524 {
525 r = IUnknown_QueryInterface(unk, &IID_IHlinkTarget, (void **)&target);
526 IUnknown_Release(unk);
527 }
528 if (r == S_OK)
529 {
530 if (bind_ctx) IHlinkTarget_SetBrowseContext(target, browse_ctx);
531 r = IHlinkTarget_Navigate(target, flags, This->Location);
532 IHlinkTarget_Release(target);
533 }
534
535 RevokeBindStatusCallback(bind_ctx, &This->IBindStatusCallback_iface);
536 if (bind_ctx) IBindCtx_Release(bind_ctx);
537 }
538 else
539 {
541
542 r = IHlink_GetStringReference(iface, HLINKGETREF_DEFAULT, &target, NULL);
543 if (SUCCEEDED(r) && target)
544 {
548 }
549 }
550 IMoniker_Release(mon);
551 }
552
553 if (This->Site)
554 IHlinkSite_OnNavigationComplete(This->Site, This->SiteData, 0, r, NULL);
555
556 TRACE("Finished Navigation\n");
557 return r;
558}
#define TRUE
Definition: types.h:120
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define L(x)
Definition: resources.c:13
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2787
uint16_t * LPWSTR
Definition: typedefs.h:56
HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbscPrevious, DWORD dwReserved)
Definition: bindctx.c:615
#define DRAGDROP_S_DROP
Definition: winerror.h:3758
#define E_UNEXPECTED
Definition: winerror.h:3528
#define SW_SHOW
Definition: winuser.h:786

◆ IHlink_fnQueryInterface()

static HRESULT WINAPI IHlink_fnQueryInterface ( IHlink iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 128 of file link.c.

130{
132
133 TRACE ("(%p)->(%s,%p)\n", This, debugstr_guid (riid), ppvObj);
134
135 *ppvObj = NULL;
136
137 if (IsEqualIID(riid, &IID_IUnknown) || (IsEqualIID(riid, &IID_IHlink)))
138 *ppvObj = &This->IHlink_iface;
140 *ppvObj = &This->IPersistStream_iface;
141 else if (IsEqualIID(riid, &IID_IDataObject))
142 *ppvObj = &This->IDataObject_iface;
143
144 if (*ppvObj)
145 {
146 IUnknown_AddRef((IUnknown*)(*ppvObj));
147 return S_OK;
148 }
149 return E_NOINTERFACE;
150}
const GUID IID_IDataObject
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ IHlink_fnRelease()

static ULONG WINAPI IHlink_fnRelease ( IHlink iface)
static

Definition at line 162 of file link.c.

163{
165 ULONG refCount = InterlockedDecrement(&This->ref);
166
167 TRACE("(%p)->(count=%lu)\n", This, refCount + 1);
168 if (refCount)
169 return refCount;
170
171 TRACE("-- destroying IHlink (%p)\n", This);
172 free(This->FriendlyName);
173 free(This->TargetFrameName);
174 free(This->Location);
175 if (This->Moniker)
176 IMoniker_Release(This->Moniker);
177 if (This->Site)
178 IHlinkSite_Release(This->Site);
179 free(This);
180 return 0;
181}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5

◆ IHlink_fnSetAdditionalParams()

static HRESULT WINAPI IHlink_fnSetAdditionalParams ( IHlink iface,
LPCWSTR  pwzAdditionalParams 
)
static

Definition at line 560 of file link.c.

562{
563 TRACE("Not implemented in native IHlink\n");
564 return E_NOTIMPL;
565}

◆ IHlink_fnSetFriendlyName()

static HRESULT WINAPI IHlink_fnSetFriendlyName ( IHlink iface,
LPCWSTR  pwzFriendlyName 
)
static

Definition at line 395 of file link.c.

397{
399
400 TRACE("(%p) -> (%s)\n", This, debugstr_w(pwzFriendlyName));
401
402 free(This->FriendlyName);
403 This->FriendlyName = wcsdup( pwzFriendlyName );
404
405 return S_OK;
406}
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94

◆ IHlink_fnSetHlinkSite()

static HRESULT WINAPI IHlink_fnSetHlinkSite ( IHlink iface,
IHlinkSite pihlSite,
DWORD  dwSiteData 
)
static

Definition at line 183 of file link.c.

185{
187
188 TRACE("(%p)->(%p %li)\n", This, pihlSite, dwSiteData);
189
190 if (This->Site)
191 IHlinkSite_Release(This->Site);
192
193 This->Site = pihlSite;
194 if (This->Site)
195 IHlinkSite_AddRef(This->Site);
196
197 This->SiteData = dwSiteData;
198
199 return S_OK;
200}

◆ IHlink_fnSetMonikerReference()

static HRESULT WINAPI IHlink_fnSetMonikerReference ( IHlink iface,
DWORD  rfHLSETF,
IMoniker pmkTarget,
LPCWSTR  pwzLocation 
)
static

Definition at line 219 of file link.c.

221{
223
224 TRACE("(%p)->(%li %p %s)\n", This, rfHLSETF, pmkTarget,
225 debugstr_w(pwzLocation));
226
227 if(rfHLSETF == 0)
228 return E_INVALIDARG;
229 if(!(rfHLSETF & (HLINKSETF_TARGET | HLINKSETF_LOCATION)))
230 return rfHLSETF;
231
232 if(rfHLSETF & HLINKSETF_TARGET){
233 if (This->Moniker)
234 IMoniker_Release(This->Moniker);
235
236 This->Moniker = pmkTarget;
237 if (This->Moniker)
238 {
239 IBindCtx *pbc;
240 LPOLESTR display_name;
241 IMoniker_AddRef(This->Moniker);
242 CreateBindCtx( 0, &pbc);
243 IMoniker_GetDisplayName(This->Moniker, pbc, NULL, &display_name);
244 IBindCtx_Release(pbc);
245 This->absolute = display_name && wcschr(display_name, ':');
246 CoTaskMemFree(display_name);
247 }
248 }
249
250 if(rfHLSETF & HLINKSETF_LOCATION){
251 free(This->Location);
252 This->Location = wcsdup( pwzLocation );
253 }
254
255 return S_OK;
256}
#define wcschr
Definition: compat.h:17

◆ IHlink_fnSetStringReference()

static HRESULT WINAPI IHlink_fnSetStringReference ( IHlink iface,
DWORD  grfHLSETF,
LPCWSTR  pwzTarget,
LPCWSTR  pwzLocation 
)
static

Definition at line 258 of file link.c.

260{
262
263 TRACE("(%p)->(%li %s %s)\n", This, grfHLSETF, debugstr_w(pwzTarget),
264 debugstr_w(pwzLocation));
265
266 if(grfHLSETF > (HLINKSETF_TARGET | HLINKSETF_LOCATION) &&
267 grfHLSETF < -(HLINKSETF_TARGET | HLINKSETF_LOCATION))
268 return grfHLSETF;
269
270 if (grfHLSETF & HLINKSETF_TARGET)
271 {
272 if (This->Moniker)
273 {
274 IMoniker_Release(This->Moniker);
275 This->Moniker = NULL;
276 }
277 if (pwzTarget && *pwzTarget)
278 {
279 IMoniker *pMon;
280 IBindCtx *pbc = NULL;
281 ULONG eaten;
282 HRESULT r;
283
284 r = CreateBindCtx(0, &pbc);
285 if (FAILED(r))
286 return E_OUTOFMEMORY;
287
288 r = MkParseDisplayName(pbc, pwzTarget, &eaten, &pMon);
289 IBindCtx_Release(pbc);
290
291 if (FAILED(r))
292 {
293 LPCWSTR p = wcschr(pwzTarget, ':');
294 if (p && (p - pwzTarget > 1))
295 r = CreateURLMoniker(NULL, pwzTarget, &pMon);
296 else
297 r = CreateFileMoniker(pwzTarget, &pMon);
298 if (FAILED(r))
299 {
300 ERR("couldn't create moniker for %s, failed with error 0x%08lx\n",
301 debugstr_w(pwzTarget), r);
302 return r;
303 }
304 }
305
306 IHlink_SetMonikerReference(iface, HLINKSETF_TARGET, pMon, NULL);
307 IMoniker_Release(pMon);
308 }
309 }
310
311 if (grfHLSETF & HLINKSETF_LOCATION)
312 {
313 free(This->Location);
314 This->Location = NULL;
315 if (pwzLocation && *pwzLocation)
316 This->Location = wcsdup( pwzLocation );
317 }
318
319 return S_OK;
320}
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
Definition: moniker.c:838
HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, IMoniker **ppmk)
Definition: filemoniker.c:1360
GLfloat GLfloat p
Definition: glext.h:8902
const uint16_t * LPCWSTR
Definition: typedefs.h:57
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:747

◆ IHlink_fnSetTargetFrameName()

static HRESULT WINAPI IHlink_fnSetTargetFrameName ( IHlink iface,
LPCWSTR  pwzTargetFramename 
)
static

Definition at line 444 of file link.c.

446{
448 TRACE("(%p)->(%s)\n", This, debugstr_w(pwzTargetFramename));
449
450 free(This->TargetFrameName);
451 This->TargetFrameName = wcsdup( pwzTargetFramename );
452
453 return S_OK;
454}

◆ impl_from_IBindStatusCallback()

static HlinkImpl * impl_from_IBindStatusCallback ( IBindStatusCallback iface)
static

◆ impl_from_IDataObject()

static HlinkImpl * impl_from_IDataObject ( IDataObject iface)
inlinestatic

Definition at line 74 of file link.c.

75{
76 return CONTAINING_RECORD(iface, HlinkImpl, IDataObject_iface);
77}

Referenced by IDataObject_fnAddRef(), IDataObject_fnQueryInterface(), and IDataObject_fnRelease().

◆ impl_from_IHlink()

◆ impl_from_IPersistStream()

static HlinkImpl * impl_from_IPersistStream ( IPersistStream iface)
inlinestatic

◆ IPersistStream_fnAddRef()

static ULONG WINAPI IPersistStream_fnAddRef ( IPersistStream iface)
static

Definition at line 705 of file link.c.

706{
708 TRACE("(%p)\n", This);
709 return IHlink_AddRef(&This->IHlink_iface);
710}

◆ IPersistStream_fnGetClassID()

static HRESULT WINAPI IPersistStream_fnGetClassID ( IPersistStream iface,
CLSID pClassID 
)
static

Definition at line 719 of file link.c.

721{
723 TRACE("(%p)\n", This);
724 *pClassID = CLSID_StdHlink;
725 return S_OK;
726}

◆ IPersistStream_fnGetSizeMax()

static HRESULT WINAPI IPersistStream_fnGetSizeMax ( IPersistStream iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 916 of file link.c.

918{
919 HRESULT r;
922
923 TRACE("(%p) Moniker(%p)\n", This, This->Moniker);
924
925 pcbSize->QuadPart = sizeof(DWORD)*2;
926
927 if (This->TargetFrameName)
928 pcbSize->QuadPart += size_hlink_string(This->TargetFrameName);
929
930 if (This->FriendlyName)
931 pcbSize->QuadPart += size_hlink_string(This->FriendlyName);
932
933 r = __GetMoniker(This, &moniker, HLINKGETREF_DEFAULT);
934 if (FAILED(r))
935 return r;
936 r = E_FAIL;
937
938 if (moniker)
939 {
940 IPersistStream* monstream = NULL;
941 IMoniker_QueryInterface(moniker, &IID_IPersistStream,
942 (LPVOID*)&monstream);
943 if (monstream)
944 {
945 ULARGE_INTEGER mon_size;
946 r = IPersistStream_GetSizeMax(monstream, &mon_size);
947 pcbSize->QuadPart += mon_size.QuadPart;
948 IPersistStream_Release(monstream);
949 }
950 IMoniker_Release(moniker);
951 }
952
953 if (This->Location)
954 pcbSize->QuadPart += size_hlink_string(This->Location);
955
956 return r;
957}
#define E_FAIL
Definition: ddrawi.h:102
#define DWORD
Definition: nt_native.h:44
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185

◆ IPersistStream_fnIsDirty()

static HRESULT WINAPI IPersistStream_fnIsDirty ( IPersistStream iface)
static

Definition at line 728 of file link.c.

729{
730 FIXME("\n");
731 return E_NOTIMPL;
732}

◆ IPersistStream_fnLoad()

static HRESULT WINAPI IPersistStream_fnLoad ( IPersistStream iface,
IStream pStm 
)
static

Definition at line 790 of file link.c.

792{
793 HRESULT r;
794 DWORD hdr[2];
795 DWORD read;
797
798 r = IStream_Read(pStm, hdr, sizeof(hdr), &read);
799 if (read != sizeof(hdr) || (hdr[0] != HLINK_SAVE_MAGIC))
800 {
801 r = E_FAIL;
802 goto end;
803 }
804 if (hdr[1] & ~HLINK_SAVE_ALL)
805 FIXME("unknown flag(s) 0x%lx\n", hdr[1] & ~HLINK_SAVE_ALL);
806
808 {
809 TRACE("loading target frame name\n");
810 r = read_hlink_string(pStm, &This->TargetFrameName);
811 if (FAILED(r)) goto end;
812 }
813
815 {
816 TRACE("loading target friendly name\n");
817 if (!(hdr[1] & 0x4))
818 FIXME("0x4 flag not present with friendly name flag - not sure what this means\n");
819 r = read_hlink_string(pStm, &This->FriendlyName);
820 if (FAILED(r)) goto end;
821 }
822
824 {
825 TRACE("loading moniker\n");
826 r = OleLoadFromStream(pStm, &IID_IMoniker, (LPVOID*)&(This->Moniker));
827 if (FAILED(r))
828 goto end;
829 This->absolute = (hdr[1] & HLINK_SAVE_MONIKER_IS_ABSOLUTE) != 0;
830 }
831
833 {
834 TRACE("loading location\n");
835 r = read_hlink_string(pStm, &This->Location);
836 if (FAILED(r)) goto end;
837 }
838
839end:
840 TRACE("Load Result 0x%lx (%p)\n", r, This->Moniker);
841
842 return r;
843}
#define read
Definition: acwin.h:97
HRESULT WINAPI OleLoadFromStream(IStream *pStm, REFIID iidInterface, void **ppvObj)
Definition: storage32.c:9001
GLuint GLuint end
Definition: gl.h:1545
char hdr[14]
Definition: iptest.cpp:33

◆ IPersistStream_fnQueryInterface()

static HRESULT WINAPI IPersistStream_fnQueryInterface ( IPersistStream iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 697 of file link.c.

699{
701 TRACE("(%p)\n", This);
702 return IHlink_QueryInterface(&This->IHlink_iface, riid, ppvObj);
703}

◆ IPersistStream_fnRelease()

static ULONG WINAPI IPersistStream_fnRelease ( IPersistStream iface)
static

Definition at line 712 of file link.c.

713{
715 TRACE("(%p)\n", This);
716 return IHlink_Release(&This->IHlink_iface);
717}

◆ IPersistStream_fnSave()

static HRESULT WINAPI IPersistStream_fnSave ( IPersistStream iface,
IStream pStm,
BOOL  fClearDirty 
)
static

Definition at line 845 of file link.c.

847{
848 HRESULT r;
850 DWORD hdr[2];
852
853 TRACE("(%p) Moniker(%p)\n", This, This->Moniker);
854
855 r = __GetMoniker(This, &moniker, HLINKGETREF_DEFAULT);
856 if (FAILED(r))
857 return r;
858 r = E_FAIL;
859
861 hdr[1] = 0;
862
863 if (moniker)
865 if (This->absolute)
867 if (This->Location)
869 if (This->FriendlyName)
870 hdr[1] |= HLINK_SAVE_FRIENDLY_PRESENT | 4 /* FIXME */;
871 if (This->TargetFrameName)
873
874 IStream_Write(pStm, hdr, sizeof(hdr), NULL);
875
876 if (This->TargetFrameName)
877 {
878 r = write_hlink_string(pStm, This->TargetFrameName);
879 if (FAILED(r)) goto end;
880 }
881
882 if (This->FriendlyName)
883 {
884 r = write_hlink_string(pStm, This->FriendlyName);
885 if (FAILED(r)) goto end;
886 }
887
888 if (moniker)
889 {
890 IPersistStream* monstream;
891
892 monstream = NULL;
893 IMoniker_QueryInterface(moniker, &IID_IPersistStream,
894 (LPVOID*)&monstream);
895 if (monstream)
896 {
897 r = OleSaveToStream(monstream, pStm);
898 IPersistStream_Release(monstream);
899 }
900 if (FAILED(r)) goto end;
901 }
902
903 if (This->Location)
904 {
905 r = write_hlink_string(pStm, This->Location);
906 if (FAILED(r)) goto end;
907 }
908
909end:
910 if (moniker) IMoniker_Release(moniker);
911 TRACE("Save Result 0x%lx\n", r);
912
913 return r;
914}
HRESULT WINAPI OleSaveToStream(IPersistStream *pPStm, IStream *pStm)
Definition: storage32.c:9036

◆ read_hlink_string()

static HRESULT read_hlink_string ( IStream pStm,
LPWSTR out_str 
)
static

Definition at line 757 of file link.c.

758{
759 LPWSTR str;
760 DWORD len;
761 ULONG read;
762 HRESULT hr;
763
764 hr = IStream_Read(pStm, &len, sizeof(len), &read);
765 if (FAILED(hr)) return hr;
766 if (read != sizeof(len)) return STG_E_READFAULT;
767
768 TRACE("read len %ld\n", len);
769
770 str = malloc(len * sizeof(WCHAR));
771 if (!str) return E_OUTOFMEMORY;
772
773 hr = IStream_Read(pStm, str, len * sizeof(WCHAR), &read);
774 if (FAILED(hr))
775 {
776 free(str);
777 return hr;
778 }
779 if (read != len * sizeof(WCHAR))
780 {
781 free(str);
782 return STG_E_READFAULT;
783 }
784 TRACE("read string %s\n", debugstr_w(str));
785
786 *out_str = str;
787 return S_OK;
788}
#define malloc
Definition: debug_ros.c:4
GLenum GLsizei len
Definition: glext.h:6722
short WCHAR
Definition: pedump.c:58
const WCHAR * str
#define STG_E_READFAULT
Definition: winerror.h:3671

Referenced by IPersistStream_fnLoad().

◆ size_hlink_string()

static ULONG size_hlink_string ( LPCWSTR  str)
inlinestatic

Definition at line 752 of file link.c.

753{
754 return sizeof(DWORD) + (lstrlenW(str) + 1) * sizeof(WCHAR);
755}
#define lstrlenW
Definition: compat.h:750

Referenced by IPersistStream_fnGetSizeMax().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( hlink  )

◆ write_hlink_string()

static HRESULT write_hlink_string ( IStream pStm,
LPCWSTR  str 
)
static

Definition at line 734 of file link.c.

735{
736 DWORD len;
737 HRESULT hr;
738
739 TRACE("(%p, %s)\n", pStm, debugstr_w(str));
740
741 len = lstrlenW(str) + 1;
742
743 hr = IStream_Write(pStm, &len, sizeof(len), NULL);
744 if (FAILED(hr)) return hr;
745
746 hr = IStream_Write(pStm, str, len * sizeof(WCHAR), NULL);
747 if (FAILED(hr)) return hr;
748
749 return S_OK;
750}

Referenced by IPersistStream_fnSave().

Variable Documentation

◆ bind_callback_vtbl

const IBindStatusCallbackVtbl bind_callback_vtbl
static
Initial value:
=
{
}

Definition at line 1115 of file link.c.

Referenced by HLink_Constructor().

◆ dovt

const IDataObjectVtbl dovt
static
Initial value:
=
{
}

Definition at line 681 of file link.c.

Referenced by HLink_Constructor().

◆ hlvt

const IHlinkVtbl hlvt
static
Initial value:
=
{
}

Definition at line 574 of file link.c.

Referenced by HLink_Constructor().

◆ psvt

const IPersistStreamVtbl psvt
static
Initial value:
=
{
}

Definition at line 959 of file link.c.

Referenced by HLink_Constructor().