ReactOS 0.4.15-dev-5664-g3bf4ef6
hlink_main.c File Reference
#include "hlink_private.h"
#include "winreg.h"
#include "rpcproxy.h"
#include "hlguids.h"
#include "wine/debug.h"
Include dependency graph for hlink_main.c:

Go to the source code of this file.

Classes

struct  CFImpl
 

Typedefs

typedef HRESULT(* LPFNCREATEINSTANCE) (IUnknown *, REFIID, LPVOID *)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (hlink)
 
static CFImplimpl_from_IClassFactory (IClassFactory *iface)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI HlinkCreateFromMoniker (IMoniker *pimkTrgt, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName, IHlinkSite *pihlsite, DWORD dwSiteData, IUnknown *piunkOuter, REFIID riid, void **ppvObj)
 
HRESULT WINAPI HlinkCreateFromString (LPCWSTR pwzTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName, IHlinkSite *pihlsite, DWORD dwSiteData, IUnknown *piunkOuter, REFIID riid, void **ppvObj)
 
HRESULT WINAPI HlinkCreateBrowseContext (IUnknown *piunkOuter, REFIID riid, void **ppvObj)
 
HRESULT WINAPI HlinkNavigate (IHlink *phl, IHlinkFrame *phlFrame, DWORD grfHLNF, LPBC pbc, IBindStatusCallback *pbsc, IHlinkBrowseContext *phlbc)
 
HRESULT WINAPI HlinkOnNavigate (IHlinkFrame *phlFrame, IHlinkBrowseContext *phlbc, DWORD grfHLNF, IMoniker *pmkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName, ULONG *puHLID)
 
HRESULT WINAPI HlinkCreateFromData (IDataObject *piDataObj, IHlinkSite *pihlsite, DWORD dwSiteData, IUnknown *piunkOuter, REFIID riid, void **ppvObj)
 
HRESULT WINAPI HlinkQueryCreateFromData (IDataObject *piDataObj)
 
HRESULT WINAPI HlinkNavigateToStringReference (LPCWSTR pwzTarget, LPCWSTR pwzLocation, IHlinkSite *pihlsite, DWORD dwSiteData, IHlinkFrame *pihlframe, DWORD grfHLNF, LPBC pibc, IBindStatusCallback *pibsc, IHlinkBrowseContext *pihlbc)
 
HRESULT WINAPI HlinkIsShortcut (LPCWSTR pwzFileName)
 
HRESULT WINAPI HlinkGetSpecialReference (ULONG uReference, LPWSTR *ppwzReference)
 
HRESULT WINAPI HlinkTranslateURL (LPCWSTR pwzURL, DWORD grfFlags, LPWSTR *ppwzTranslatedURL)
 
HRESULT WINAPI HlinkUpdateStackItem (IHlinkFrame *frame, IHlinkBrowseContext *bc, ULONG hlid, IMoniker *target, LPCWSTR location, LPCWSTR friendly_name)
 
HRESULT WINAPI HlinkParseDisplayName (LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNoForceAbs, ULONG *pcchEaten, IMoniker **ppimk)
 
HRESULT WINAPI HlinkResolveMonikerForData (LPMONIKER pimkReference, DWORD reserved, LPBC pibc, ULONG cFmtetc, FORMATETC *rgFmtetc, IBindStatusCallback *pibsc, LPMONIKER pimkBase)
 
HRESULT WINAPI HlinkClone (IHlink *hlink, REFIID riid, IHlinkSite *hls, DWORD site_data, void **obj)
 
static HRESULT WINAPI HLinkCF_fnQueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI HLinkCF_fnAddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI HLinkCF_fnRelease (LPCLASSFACTORY iface)
 
static HRESULT WINAPI HLinkCF_fnCreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
 
static HRESULT WINAPI HLinkCF_fnLockServer (LPCLASSFACTORY iface, BOOL fLock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE instance
 
static const IClassFactoryVtbl hlcfvt
 
static CFImpl HLink_cf = { { &hlcfvt }, HLink_Constructor }
 
static CFImpl HLinkBrowseContext_cf = { { &hlcfvt }, HLinkBrowseContext_Constructor }
 

Typedef Documentation

◆ LPFNCREATEINSTANCE

typedef HRESULT(* LPFNCREATEINSTANCE) (IUnknown *, REFIID, LPVOID *)

Definition at line 33 of file hlink_main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 63 of file hlink_main.c.

64{
65 return S_FALSE;
66}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID ppv 
)

Definition at line 582 of file hlink_main.c.

583{
584 IClassFactory *pcf = NULL;
585
586 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
587
588 if (!ppv)
589 return E_INVALIDARG;
590 *ppv = NULL;
591
592 if (IsEqualIID(rclsid, &CLSID_StdHlink))
594 else if (IsEqualIID(rclsid, &CLSID_StdHlinkBrowseContext))
596 else
598
599 return IClassFactory_QueryInterface(pcf, iid, ppv);
600}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: hlink_main.c:37
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 46 of file hlink_main.c.

47{
48 TRACE("%p %d %p\n", hinstDLL, fdwReason, lpvReserved);
49
50 switch (fdwReason)
51 {
53 instance = hinstDLL;
55 break;
56 }
57 return TRUE;
58}
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static IN DWORD IN LPVOID lpvReserved

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 605 of file hlink_main.c.

606{
608}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 613 of file hlink_main.c.

614{
616}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ HLinkCF_fnAddRef()

static ULONG WINAPI HLinkCF_fnAddRef ( LPCLASSFACTORY  iface)
static

Definition at line 539 of file hlink_main.c.

540{
541 return 2;
542}

◆ HLinkCF_fnCreateInstance()

static HRESULT WINAPI HLinkCF_fnCreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pUnkOuter,
REFIID  riid,
LPVOID ppvObject 
)
static

Definition at line 549 of file hlink_main.c.

551{
553
554 TRACE("%p->(%p,%s,%p)\n", This, pUnkOuter, debugstr_guid(riid), ppvObject);
555
556 *ppvObject = NULL;
557
558 return This->lpfnCI(pUnkOuter, riid, ppvObject);
559}
REFIID riid
Definition: atlbase.h:39
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ HLinkCF_fnLockServer()

static HRESULT WINAPI HLinkCF_fnLockServer ( LPCLASSFACTORY  iface,
BOOL  fLock 
)
static

Definition at line 561 of file hlink_main.c.

562{
563 FIXME("%p %d\n", iface, fLock);
564 return E_NOTIMPL;
565}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HLinkCF_fnQueryInterface()

static HRESULT WINAPI HLinkCF_fnQueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 519 of file hlink_main.c.

521{
523
524 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObj);
525
526 *ppvObj = NULL;
527
530 {
531 *ppvObj = &This->IClassFactory_iface;
532 return S_OK;
533 }
534
535 TRACE("-- E_NOINTERFACE\n");
536 return E_NOINTERFACE;
537}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define S_OK
Definition: intsafe.h:52
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ HLinkCF_fnRelease()

static ULONG WINAPI HLinkCF_fnRelease ( LPCLASSFACTORY  iface)
static

Definition at line 544 of file hlink_main.c.

545{
546 return 1;
547}

◆ HlinkClone()

HRESULT WINAPI HlinkClone ( IHlink hlink,
REFIID  riid,
IHlinkSite hls,
DWORD  site_data,
void **  obj 
)

Definition at line 457 of file hlink_main.c.

459{
460 IMoniker *mk, *clone_mk = NULL;
461 WCHAR *loc, *name = NULL;
463
464 if(!hlink || !riid || !obj)
465 return E_INVALIDARG;
466
467 *obj = NULL;
468
469 hres = IHlink_GetMonikerReference(hlink, HLINKGETREF_DEFAULT, &mk, &loc);
470 if(FAILED(hres))
471 return hres;
472
473 if(mk) {
474 IStream *strm;
475 LARGE_INTEGER lgint;
476
478 if(FAILED(hres)) {
479 IMoniker_Release(mk);
480 goto cleanup;
481 }
482
483 hres = OleSaveToStream((IPersistStream*)mk, strm);
484 if(FAILED(hres)) {
485 IStream_Release(strm);
486 IMoniker_Release(mk);
487 goto cleanup;
488 }
489 IMoniker_Release(mk);
490
491 lgint.QuadPart = 0;
492 hres = IStream_Seek(strm, lgint, STREAM_SEEK_SET, NULL);
493 if(FAILED(hres)) {
494 IStream_Release(strm);
495 goto cleanup;
496 }
497
498 hres = OleLoadFromStream(strm, &IID_IMoniker, (void**)&clone_mk);
499 IStream_Release(strm);
500 if(FAILED(hres))
501 goto cleanup;
502 }
503
504 hres = IHlink_GetFriendlyName(hlink, HLFNAMEF_DEFAULT, &name);
505 if(FAILED(hres))
506 goto cleanup;
507
508 hres = HlinkCreateFromMoniker(clone_mk, loc, name, hls, site_data, NULL,
509 &IID_IHlink, obj);
510
511cleanup:
512 if(clone_mk)
513 IMoniker_Release(clone_mk);
514 CoTaskMemFree(loc);
516 return hres;
517}
static void cleanup(void)
Definition: main.c:1335
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI OleLoadFromStream(IStream *pStm, REFIID iidInterface, void **ppvObj)
Definition: storage32.c:9129
HRESULT WINAPI OleSaveToStream(IPersistStream *pPStm, IStream *pStm)
Definition: storage32.c:9164
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
Definition: name.c:39
LONGLONG QuadPart
Definition: typedefs.h:114
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_HlinkClone().

◆ HlinkCreateBrowseContext()

HRESULT WINAPI HlinkCreateBrowseContext ( IUnknown piunkOuter,
REFIID  riid,
void **  ppvObj 
)

Definition at line 175 of file hlink_main.c.

176{
177 TRACE("%p %s %p\n", piunkOuter, debugstr_guid(riid), ppvObj);
178 return CoCreateInstance(&CLSID_StdHlinkBrowseContext, piunkOuter, CLSCTX_INPROC_SERVER, riid, ppvObj);
179}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325

Referenced by test_BrowseWindowInfo(), test_GetObject(), and test_SetInitialHlink().

◆ HlinkCreateFromData()

HRESULT WINAPI HlinkCreateFromData ( IDataObject piDataObj,
IHlinkSite pihlsite,
DWORD  dwSiteData,
IUnknown piunkOuter,
REFIID  riid,
void **  ppvObj 
)

Definition at line 225 of file hlink_main.c.

228{
229 FIXME("%p, %p, %d, %p, %s, %p\n", piDataObj, pihlsite, dwSiteData,
230 piunkOuter, debugstr_guid(riid), ppvObj);
231 *ppvObj = NULL;
232 return E_NOTIMPL;
233}

◆ HlinkCreateFromMoniker()

HRESULT WINAPI HlinkCreateFromMoniker ( IMoniker pimkTrgt,
LPCWSTR  pwzLocation,
LPCWSTR  pwzFriendlyName,
IHlinkSite pihlsite,
DWORD  dwSiteData,
IUnknown piunkOuter,
REFIID  riid,
void **  ppvObj 
)

Definition at line 71 of file hlink_main.c.

74{
75 IHlink *hl = NULL;
76 HRESULT r;
77
78 TRACE("%p %s %s %p %i %p %s %p\n", pimkTrgt, debugstr_w(pwzLocation),
79 debugstr_w(pwzFriendlyName), pihlsite, dwSiteData, piunkOuter,
80 debugstr_guid(riid), ppvObj);
81
82 r = CoCreateInstance(&CLSID_StdHlink, piunkOuter, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&hl);
83 if (FAILED(r))
84 return r;
85
86 IHlink_SetMonikerReference(hl, HLINKSETF_LOCATION | HLINKSETF_TARGET, pimkTrgt, pwzLocation);
87
88 if (pwzFriendlyName)
89 IHlink_SetFriendlyName(hl, pwzFriendlyName);
90 if (pihlsite)
91 IHlink_SetHlinkSite(hl, pihlsite, dwSiteData);
92
93 *ppvObj = hl;
94
95 TRACE("Returning %i\n",r);
96
97 return r;
98}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_w
Definition: kernel32.h:32

Referenced by HlinkClone(), IHlinkBC_SetInitialHlink(), IHlinkBC_UpdateHlink(), test_Hlink_Navigate(), test_HlinkClone(), test_HlinkGetSetMonikerReference(), test_HlinkGetSetStringReference(), and test_HlinkSite().

◆ HlinkCreateFromString()

HRESULT WINAPI HlinkCreateFromString ( LPCWSTR  pwzTarget,
LPCWSTR  pwzLocation,
LPCWSTR  pwzFriendlyName,
IHlinkSite pihlsite,
DWORD  dwSiteData,
IUnknown piunkOuter,
REFIID  riid,
void **  ppvObj 
)

Definition at line 103 of file hlink_main.c.

106{
107 IHlink *hl = NULL;
108 HRESULT r;
109 WCHAR *hash, *tgt;
110 const WCHAR *loc;
111
112 TRACE("%s %s %s %p %i %p %s %p\n", debugstr_w(pwzTarget),
113 debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), pihlsite,
114 dwSiteData, piunkOuter, debugstr_guid(riid), ppvObj);
115
116 r = CoCreateInstance(&CLSID_StdHlink, piunkOuter, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&hl);
117 if (FAILED(r))
118 return r;
119
120 if (pwzTarget)
121 {
122 hash = wcschr(pwzTarget, '#');
123 if (hash)
124 {
125 if (hash == pwzTarget)
126 tgt = NULL;
127 else
128 {
129 int tgt_len = hash - pwzTarget;
130 tgt = heap_alloc((tgt_len + 1) * sizeof(WCHAR));
131 if (!tgt)
132 return E_OUTOFMEMORY;
133 memcpy(tgt, pwzTarget, tgt_len * sizeof(WCHAR));
134 tgt[tgt_len] = 0;
135 }
136 if (!pwzLocation)
137 loc = hash + 1;
138 else
139 loc = pwzLocation;
140 }
141 else
142 {
143 tgt = hlink_strdupW(pwzTarget);
144 if (!tgt)
145 return E_OUTOFMEMORY;
146 loc = pwzLocation;
147 }
148 }
149 else
150 {
151 tgt = NULL;
152 loc = pwzLocation;
153 }
154
155 IHlink_SetStringReference(hl, HLINKSETF_TARGET | HLINKSETF_LOCATION, tgt, loc);
156
157 heap_free(tgt);
158
159 if (pwzFriendlyName)
160 IHlink_SetFriendlyName(hl, pwzFriendlyName);
161
162 if (pihlsite)
163 IHlink_SetHlinkSite(hl, pihlsite, dwSiteData);
164
165 TRACE("Returning %i\n",r);
166 *ppvObj = hl;
167
168 return r;
169}
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define wcschr
Definition: compat.h:17
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: _hash_fun.h:40

Referenced by HlinkNavigateToStringReference(), test_HashLink(), test_HlinkClone(), test_HlinkMoniker(), test_HlinkSite(), test_persist(), and test_reference().

◆ HlinkGetSpecialReference()

HRESULT WINAPI HlinkGetSpecialReference ( ULONG  uReference,
LPWSTR ppwzReference 
)

Definition at line 293 of file hlink_main.c.

294{
295 DWORD res, type, size = 100;
296 LPCWSTR value_name;
297 WCHAR *buf;
298 HKEY hkey;
299
300 static const WCHAR start_pageW[] = {'S','t','a','r','t',' ','P','a','g','e',0};
301 static const WCHAR search_pageW[] = {'S','e','a','r','c','h',' ','P','a','g','e',0};
302
303 static const WCHAR ie_main_keyW[] =
304 {'S','o','f','t','w','a','r','e',
305 '\\','M','i','c','r','o','s','o','f','t','\\',
306 'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',
307 '\\','M','a','i','n',0};
308
309 TRACE("(%u %p)\n", uReference, ppwzReference);
310
311 *ppwzReference = NULL;
312
313 switch(uReference) {
314 case HLSR_HOME:
315 value_name = start_pageW;
316 break;
317 case HLSR_SEARCHPAGE:
318 value_name = search_pageW;
319 break;
321 return E_NOTIMPL;
322 default:
323 return E_INVALIDARG;
324 }
325
326 res = RegOpenKeyW(HKEY_CURRENT_USER, ie_main_keyW, &hkey);
327 if(res != ERROR_SUCCESS) {
328 WARN("Could not open key: %u\n", res);
329 return HRESULT_FROM_WIN32(res);
330 }
331
333 res = RegQueryValueExW(hkey, value_name, NULL, &type, (PBYTE)buf, &size);
335 if(res == ERROR_MORE_DATA)
336 res = RegQueryValueExW(hkey, value_name, NULL, &type, (PBYTE)buf, &size);
337 RegCloseKey(hkey);
338 if(res != ERROR_SUCCESS) {
339 WARN("Could not query value %s: %u\n", debugstr_w(value_name), res);
341 return HRESULT_FROM_WIN32(res);
342 }
343
344 *ppwzReference = buf;
345 return S_OK;
346}
#define WARN(fmt,...)
Definition: debug.h:112
#define RegCloseKey(hKey)
Definition: registry.h:47
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3291
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
Definition: ifs.c:460
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
BYTE * PBYTE
Definition: pedump.c:66
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HKEY_CURRENT_USER
Definition: winreg.h:11
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by test_special_reference().

◆ HlinkIsShortcut()

HRESULT WINAPI HlinkIsShortcut ( LPCWSTR  pwzFileName)

Definition at line 272 of file hlink_main.c.

273{
274 int len;
275
276 static const WCHAR url_ext[] = {'.','u','r','l',0};
277
278 TRACE("(%s)\n", debugstr_w(pwzFileName));
279
280 if(!pwzFileName)
281 return E_INVALIDARG;
282
283 len = lstrlenW(pwzFileName)-4;
284 if(len < 0)
285 return S_FALSE;
286
287 return wcsicmp(pwzFileName+len, url_ext) ? S_FALSE : S_OK;
288}
#define wcsicmp
Definition: compat.h:15
#define lstrlenW
Definition: compat.h:750
GLenum GLsizei len
Definition: glext.h:6722

Referenced by test_HlinkIsShortcut().

◆ HlinkNavigate()

HRESULT WINAPI HlinkNavigate ( IHlink phl,
IHlinkFrame phlFrame,
DWORD  grfHLNF,
LPBC  pbc,
IBindStatusCallback pbsc,
IHlinkBrowseContext phlbc 
)

Definition at line 184 of file hlink_main.c.

187{
188 HRESULT r = S_OK;
189
190 TRACE("%p %p %i %p %p %p\n", phl, phlFrame, grfHLNF, pbc, pbsc, phlbc);
191
192 if (phlFrame)
193 r = IHlinkFrame_Navigate(phlFrame, grfHLNF, pbc, pbsc, phl);
194 else if (phl)
195 r = IHlink_Navigate(phl, grfHLNF, pbc, pbsc, phlbc);
196
197 return r;
198}

Referenced by HlinkNavigateToStringReference().

◆ HlinkNavigateToStringReference()

HRESULT WINAPI HlinkNavigateToStringReference ( LPCWSTR  pwzTarget,
LPCWSTR  pwzLocation,
IHlinkSite pihlsite,
DWORD  dwSiteData,
IHlinkFrame pihlframe,
DWORD  grfHLNF,
LPBC  pibc,
IBindStatusCallback pibsc,
IHlinkBrowseContext pihlbc 
)

Definition at line 247 of file hlink_main.c.

251{
252 HRESULT r;
253 IHlink *hlink = NULL;
254
255 TRACE("%s %s %p %08x %p %08x %p %p %p\n",
256 debugstr_w(pwzTarget), debugstr_w(pwzLocation), pihlsite,
257 dwSiteData, pihlframe, grfHLNF, pibc, pibsc, pihlbc);
258
259 r = HlinkCreateFromString( pwzTarget, pwzLocation, NULL, pihlsite,
260 dwSiteData, NULL, &IID_IHlink, (LPVOID*) &hlink );
261 if (SUCCEEDED(r)) {
262 r = HlinkNavigate(hlink, pihlframe, grfHLNF, pibc, pibsc, pihlbc);
263 IHlink_Release(hlink);
264 }
265
266 return r;
267}
#define SUCCEEDED(hr)
Definition: intsafe.h:50

Referenced by test_Hlink_Navigate().

◆ HlinkOnNavigate()

HRESULT WINAPI HlinkOnNavigate ( IHlinkFrame phlFrame,
IHlinkBrowseContext phlbc,
DWORD  grfHLNF,
IMoniker pmkTarget,
LPCWSTR  pwzLocation,
LPCWSTR  pwzFriendlyName,
ULONG puHLID 
)

Definition at line 203 of file hlink_main.c.

206{
207 HRESULT r;
208
209 TRACE("%p %p %i %p %s %s %p\n",phlFrame, phlbc, grfHLNF, pmkTarget,
210 debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), puHLID);
211
212 r = IHlinkBrowseContext_OnNavigateHlink(phlbc, grfHLNF, pmkTarget,
213 pwzLocation, pwzFriendlyName, puHLID);
214
215 if (phlFrame)
216 r = IHlinkFrame_OnNavigate(phlFrame,grfHLNF,pmkTarget, pwzLocation,
217 pwzFriendlyName, 0);
218
219 return r;
220}

◆ HlinkParseDisplayName()

HRESULT WINAPI HlinkParseDisplayName ( LPBC  pibc,
LPCWSTR  pwzDisplayName,
BOOL  fNoForceAbs,
ULONG pcchEaten,
IMoniker **  ppimk 
)

Definition at line 380 of file hlink_main.c.

382{
383 static const WCHAR file_colonW[] = {'f','i','l','e',':'};
384 ULONG eaten = 0;
386
387 TRACE("(%p %s %x %p %p)\n", pibc, debugstr_w(pwzDisplayName), fNoForceAbs, pcchEaten, ppimk);
388
389 if(fNoForceAbs)
390 FIXME("Unsupported fNoForceAbs\n");
391
392 if(!_wcsnicmp(pwzDisplayName, file_colonW, ARRAY_SIZE(file_colonW))) {
393 pwzDisplayName += ARRAY_SIZE(file_colonW);
394 eaten += ARRAY_SIZE(file_colonW);
395
396 while(*pwzDisplayName == '/') {
397 pwzDisplayName++;
398 eaten++;
399 }
400 }else {
401 hres = MkParseDisplayNameEx(pibc, pwzDisplayName, pcchEaten, ppimk);
402 if(SUCCEEDED(hres))
403 return hres;
404
405 hres = MkParseDisplayName(pibc, pwzDisplayName, pcchEaten, ppimk);
406 if(SUCCEEDED(hres))
407 return hres;
408 }
409
410 hres = CreateFileMoniker(pwzDisplayName, ppimk);
411 if(SUCCEEDED(hres))
412 *pcchEaten = eaten + lstrlenW(pwzDisplayName);
413
414 return hres;
415}
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
Definition: moniker.c:1129
HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, IMoniker **ppmk)
Definition: filemoniker.c:1414
unsigned int ULONG
Definition: retypes.h:1
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
HRESULT WINAPI MkParseDisplayNameEx(IBindCtx *pbc, LPCWSTR szDisplayName, ULONG *pchEaten, LPMONIKER *ppmk)
Definition: umon.c:795

Referenced by test_HlinkParseDisplayName().

◆ HlinkQueryCreateFromData()

HRESULT WINAPI HlinkQueryCreateFromData ( IDataObject piDataObj)

Definition at line 238 of file hlink_main.c.

239{
240 FIXME("%p\n", piDataObj);
241 return E_NOTIMPL;
242}

◆ HlinkResolveMonikerForData()

HRESULT WINAPI HlinkResolveMonikerForData ( LPMONIKER  pimkReference,
DWORD  reserved,
LPBC  pibc,
ULONG  cFmtetc,
FORMATETC *  rgFmtetc,
IBindStatusCallback pibsc,
LPMONIKER  pimkBase 
)

Definition at line 420 of file hlink_main.c.

422{
424 IBindCtx *bctx;
425 DWORD mksys = 0;
426 void *obj = NULL;
428
429 TRACE("(%p %x %p %d %p %p %p)\n", pimkReference, reserved, pibc, cFmtetc, rgFmtetc, pibsc, pimkBase);
430
431 if(cFmtetc || rgFmtetc || pimkBase)
432 FIXME("Unsupported args\n");
433
434 hres = RegisterBindStatusCallback(pibc, pibsc, NULL /* FIXME */, 0);
435 if(FAILED(hres))
436 return hres;
437
438 hres = IMoniker_IsSystemMoniker(pimkReference, &mksys);
439 if(SUCCEEDED(hres) && mksys != MKSYS_URLMONIKER)
440 WARN("sysmk = %x\n", mksys);
441
442 /* FIXME: What is it for? */
443 CreateBindCtx(0, &bctx);
444 hres = IMoniker_GetDisplayName(pimkReference, bctx, NULL, &name);
445 IBindCtx_Release(bctx);
446 if(SUCCEEDED(hres)) {
447 TRACE("got display name %s\n", debugstr_w(name));
449 }
450
451 return IMoniker_BindToStorage(pimkReference, pibc, NULL, &IID_IUnknown, &obj);
452}
r reserved
Definition: btrfs.c:3006
static LPOLESTR
Definition: stg_prop.c:27
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbscPrevious, DWORD dwReserved)
Definition: bindctx.c:615

Referenced by test_HlinkResolveMonikerForData().

◆ HlinkTranslateURL()

HRESULT WINAPI HlinkTranslateURL ( LPCWSTR  pwzURL,
DWORD  grfFlags,
LPWSTR ppwzTranslatedURL 
)

Definition at line 351 of file hlink_main.c.

352{
353 FIXME("(%s %08x %p)\n", debugstr_w(pwzURL), grfFlags, ppwzTranslatedURL);
354 return E_NOTIMPL;
355}

◆ HlinkUpdateStackItem()

HRESULT WINAPI HlinkUpdateStackItem ( IHlinkFrame frame,
IHlinkBrowseContext bc,
ULONG  hlid,
IMoniker target,
LPCWSTR  location,
LPCWSTR  friendly_name 
)

Definition at line 360 of file hlink_main.c.

362{
363 HRESULT hr;
364
365 TRACE("(%p %p 0x%x %p %s %s)\n", frame, bc, hlid, target, debugstr_w(location), debugstr_w(friendly_name));
366
367 if (!frame && !bc) return E_INVALIDARG;
368
369 if (frame)
370 hr = IHlinkFrame_UpdateHlink(frame, hlid, target, location, friendly_name);
371 else
372 hr = IHlinkBrowseContext_UpdateHlink(bc, hlid, target, location, friendly_name);
373
374 return hr;
375}
PBATCH_CONTEXT bc
Definition: batch.c:67
GLenum target
Definition: glext.h:7315
static const WCHAR friendly_name[]
Definition: devenum.c:40
HRESULT hr
Definition: shlfolder.c:183

Referenced by test_HlinkUpdateStackItem().

◆ impl_from_IClassFactory()

static CFImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 41 of file hlink_main.c.

42{
43 return CONTAINING_RECORD(iface, CFImpl, IClassFactory_iface);
44}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by HLinkCF_fnCreateInstance(), and HLinkCF_fnQueryInterface().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( hlink  )

Variable Documentation

◆ hlcfvt

const IClassFactoryVtbl hlcfvt
static
Initial value:
=
{
}

Definition at line 567 of file hlink_main.c.

◆ HLink_cf

CFImpl HLink_cf = { { &hlcfvt }, HLink_Constructor }
static

Definition at line 576 of file hlink_main.c.

Referenced by DllGetClassObject().

◆ HLinkBrowseContext_cf

CFImpl HLinkBrowseContext_cf = { { &hlcfvt }, HLinkBrowseContext_Constructor }
static

Definition at line 577 of file hlink_main.c.

Referenced by DllGetClassObject().

◆ instance

HINSTANCE instance
static

Definition at line 31 of file hlink_main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().