hlink: Fix HlinkCreateFromString to create a URL moniker if the input target is a URL.
This commit is contained in:
parent
58634e8481
commit
873905ac43
|
@ -134,17 +134,22 @@ HRESULT WINAPI HlinkCreateFromString( LPCWSTR pwzTarget, LPCWSTR pwzLocation,
|
||||||
|
|
||||||
if (FAILED(r))
|
if (FAILED(r))
|
||||||
{
|
{
|
||||||
FIXME("ParseDisplayName failed, falling back to file\n");
|
LPCWSTR p = strchrW(pwzTarget, ':');
|
||||||
r = CreateFileMoniker(pwzTarget,&pTgtMk);
|
if (p && (p - pwzTarget > 1))
|
||||||
|
r = CreateURLMoniker(NULL, pwzTarget, &pTgtMk);
|
||||||
|
else
|
||||||
|
r = CreateFileMoniker(pwzTarget,&pTgtMk);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTgtMk)
|
if (FAILED(r))
|
||||||
{
|
{
|
||||||
IHlink_SetMonikerReference(hl, 0, pTgtMk, pwzLocation);
|
ERR("couldn't create moniker for %s, failed with error 0x%08x\n",
|
||||||
IMoniker_Release(pTgtMk);
|
debugstr_w(pwzTarget), r);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
FIXME("Unable to come up with a moniker, expect problems\n");
|
IHlink_SetMonikerReference(hl, 0, pTgtMk, pwzLocation);
|
||||||
|
IMoniker_Release(pTgtMk);
|
||||||
|
|
||||||
IHlink_SetStringReference(hl, HLINKSETF_TARGET, pwzTarget, NULL);
|
IHlink_SetStringReference(hl, HLINKSETF_TARGET, pwzTarget, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue