Commit 45210447 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

hlink: Implement IHlinkBrowseContext_UpdateHlink().

parent ba40bbfc
......@@ -212,12 +212,56 @@ static HRESULT WINAPI IHlinkBC_OnNavigateHlink(IHlinkBrowseContext *iface,
return S_OK;
}
static struct link_entry *context_get_entry(HlinkBCImpl *ctxt, ULONG hlid)
{
struct list *entry;
switch (hlid)
{
case HLID_PREVIOUS:
entry = list_prev(&ctxt->links, &ctxt->current->entry);
break;
case HLID_NEXT:
entry = list_next(&ctxt->links, &ctxt->current->entry);
break;
case HLID_CURRENT:
entry = &ctxt->current->entry;
break;
case HLID_STACKBOTTOM:
entry = list_tail(&ctxt->links);
break;
case HLID_STACKTOP:
entry = list_head(&ctxt->links);
break;
default:
WARN("unknown id 0x%x\n", hlid);
entry = NULL;
}
return entry ? LIST_ENTRY(entry, struct link_entry, entry) : NULL;
}
static HRESULT WINAPI IHlinkBC_UpdateHlink(IHlinkBrowseContext* iface,
ULONG uHLID, IMoniker* pimkTarget, LPCWSTR pwzLocation,
LPCWSTR pwzFriendlyName)
ULONG hlid, IMoniker *target, LPCWSTR location, LPCWSTR friendly_name)
{
FIXME("\n");
return E_NOTIMPL;
HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
struct link_entry *entry = context_get_entry(This, hlid);
IHlink *link;
HRESULT hr;
TRACE("(%p)->(0x%x %p %s %s)\n", This, hlid, target, debugstr_w(location), debugstr_w(friendly_name));
if (!entry)
return E_INVALIDARG;
hr = HlinkCreateFromMoniker(target, location, friendly_name, NULL, 0, NULL, &IID_IHlink, (void**)&link);
if (FAILED(hr))
return hr;
IHlink_Release(entry->link);
entry->link = link;
return S_OK;
}
static HRESULT WINAPI IHlinkBC_EnumNavigationStack( IHlinkBrowseContext *iface,
......@@ -238,37 +282,13 @@ static HRESULT WINAPI IHlinkBC_GetHlink(IHlinkBrowseContext* iface, ULONG hlid,
{
HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
struct link_entry *link;
struct list *entry;
TRACE("(%p)->(0x%x %p)\n", This, hlid, ret);
switch (hlid)
{
case HLID_PREVIOUS:
entry = list_prev(&This->links, &This->current->entry);
break;
case HLID_NEXT:
entry = list_next(&This->links, &This->current->entry);
break;
case HLID_CURRENT:
entry = &This->current->entry;
break;
case HLID_STACKBOTTOM:
entry = list_tail(&This->links);
break;
case HLID_STACKTOP:
entry = list_head(&This->links);
break;
default:
WARN("unknown id 0x%x\n", hlid);
entry = NULL;
}
if (!entry)
link = context_get_entry(This, hlid);
if (!link)
return E_FAIL;
link = LIST_ENTRY(entry, struct link_entry, entry);
*ret = link->link;
IHlink_AddRef(*ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment