Author: cwittich
Date: Sun Mar 21 20:28:13 2010
New Revision: 46319
URL:
http://svn.reactos.org/svn/reactos?rev=46319&view=rev
Log:
[HLINK]
sync hlink with wine 1.1.41
Modified:
trunk/reactos/dll/win32/hlink/browse_ctx.c
trunk/reactos/dll/win32/hlink/hlink_main.c
trunk/reactos/dll/win32/hlink/link.c
Modified: trunk/reactos/dll/win32/hlink/browse_ctx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/browse_ctx…
==============================================================================
--- trunk/reactos/dll/win32/hlink/browse_ctx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hlink/browse_ctx.c [iso-8859-1] Sun Mar 21 20:28:13 2010
@@ -155,6 +155,9 @@
HlinkBCImpl *This = (HlinkBCImpl*)iface;
TRACE("(%p)->(%p)\n", This, phlbwi);
+ if(!phlbwi)
+ return E_INVALIDARG;
+
heap_free(This->BrowseWindowInfo);
This->BrowseWindowInfo = heap_alloc(phlbwi->cbSize);
memcpy(This->BrowseWindowInfo, phlbwi, phlbwi->cbSize);
@@ -165,8 +168,18 @@
static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface,
HLBWINFO *phlbwi)
{
- FIXME("\n");
- return E_NOTIMPL;
+ HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ TRACE("(%p)->(%p)\n", This, phlbwi);
+
+ if(!phlbwi)
+ return E_INVALIDARG;
+
+ if(!This->BrowseWindowInfo)
+ phlbwi->cbSize = 0;
+ else
+ memcpy(phlbwi, This->BrowseWindowInfo, This->BrowseWindowInfo->cbSize);
+
+ return S_OK;
}
static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface,
Modified: trunk/reactos/dll/win32/hlink/hlink_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/hlink_main…
==============================================================================
--- trunk/reactos/dll/win32/hlink/hlink_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hlink/hlink_main.c [iso-8859-1] Sun Mar 21 20:28:13 2010
@@ -99,6 +99,8 @@
{
IHlink *hl = NULL;
HRESULT r = S_OK;
+ WCHAR *hash, *tgt;
+ const WCHAR *loc;
TRACE("%s %s %s %p %i %p %s %p\n", debugstr_w(pwzTarget),
debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), pihlsite,
@@ -108,8 +110,44 @@
if (FAILED(r))
return r;
- IHlink_SetStringReference(hl, HLINKSETF_TARGET | HLINKSETF_LOCATION,
- pwzTarget, pwzLocation);
+ if (pwzTarget)
+ {
+ hash = strchrW(pwzTarget, '#');
+ if (hash)
+ {
+ if (hash == pwzTarget)
+ tgt = NULL;
+ else
+ {
+ int tgt_len = hash - pwzTarget;
+ tgt = heap_alloc((tgt_len + 1) * sizeof(WCHAR));
+ if (!tgt)
+ return E_OUTOFMEMORY;
+ memcpy(tgt, pwzTarget, tgt_len * sizeof(WCHAR));
+ tgt[tgt_len] = 0;
+ }
+ if (!pwzLocation)
+ loc = hash + 1;
+ else
+ loc = pwzLocation;
+ }
+ else
+ {
+ tgt = hlink_strdupW(pwzTarget);
+ if (!tgt)
+ return E_OUTOFMEMORY;
+ loc = pwzLocation;
+ }
+ }
+ else
+ {
+ tgt = NULL;
+ loc = pwzLocation;
+ }
+
+ IHlink_SetStringReference(hl, HLINKSETF_TARGET | HLINKSETF_LOCATION, tgt, loc);
+
+ heap_free(tgt);
if (pwzFriendlyName)
IHlink_SetFriendlyName(hl, pwzFriendlyName);
Modified: trunk/reactos/dll/win32/hlink/link.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/link.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/hlink/link.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hlink/link.c [iso-8859-1] Sun Mar 21 20:28:13 2010
@@ -291,7 +291,9 @@
if (grfHLSETF & HLINKSETF_LOCATION)
{
heap_free(This->Location);
- This->Location = hlink_strdupW( pwzLocation );
+ This->Location = NULL;
+ if (pwzLocation && *pwzLocation)
+ This->Location = hlink_strdupW( pwzLocation );
}
return S_OK;