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