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

hlink: Return requested interface from HlinkCreateFromString().

parent 19f802c0
......@@ -80,7 +80,7 @@ HRESULT WINAPI HlinkCreateFromString( LPCWSTR pwzTarget, LPCWSTR pwzLocation,
IUnknown* piunkOuter, REFIID riid, void** ppvObj)
{
IHlink *hl = NULL;
HRESULT r;
HRESULT hr;
WCHAR *hash, *tgt;
const WCHAR *loc;
......@@ -88,9 +88,9 @@ HRESULT WINAPI HlinkCreateFromString( LPCWSTR pwzTarget, LPCWSTR pwzLocation,
debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), pihlsite,
dwSiteData, piunkOuter, debugstr_guid(riid), ppvObj);
r = CoCreateInstance(&CLSID_StdHlink, piunkOuter, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&hl);
if (FAILED(r))
return r;
hr = CoCreateInstance(&CLSID_StdHlink, piunkOuter, CLSCTX_INPROC_SERVER, &IID_IHlink, (void **)&hl);
if (FAILED(hr))
return hr;
if (pwzTarget)
{
......@@ -137,10 +137,10 @@ HRESULT WINAPI HlinkCreateFromString( LPCWSTR pwzTarget, LPCWSTR pwzLocation,
if (pihlsite)
IHlink_SetHlinkSite(hl, pihlsite, dwSiteData);
TRACE("Returning %lx\n",r);
*ppvObj = hl;
hr = IHlink_QueryInterface(hl, riid, ppvObj);
IHlink_Release(hl);
return r;
return hr;
}
......
......@@ -2623,6 +2623,16 @@ static void test_HlinkCreateFromMoniker(void)
IMoniker_Release(moniker);
}
static void test_HlinkCreateFromString(void)
{
IPersistStream *stream;
HRESULT hr;
hr = HlinkCreateFromString(L"http://winehq.org", NULL, NULL, NULL, 0, NULL, &IID_IPersistStream, (void **)&stream);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IPersistStream_Release(stream);
}
START_TEST(hlink)
{
CoInitialize(NULL);
......@@ -2644,6 +2654,7 @@ START_TEST(hlink)
test_Hlink_Navigate();
test_HlinkUpdateStackItem();
test_HlinkCreateFromMoniker();
test_HlinkCreateFromString();
CoUninitialize();
}
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