hlink: Site data should only be set if the hlink has an HlinkSite.

oldstable
Andrew Eikum 2010-11-01 12:06:08 -05:00 committed by Alexandre Julliard
parent 5c5e53ae21
commit a8e39c66f7
3 changed files with 4 additions and 4 deletions

View File

@ -211,10 +211,11 @@ static HRESULT WINAPI IHlink_fnGetHlinkSite( IHlink* iface,
TRACE("(%p)->(%p %p)\n", This, ppihlSite, pdwSiteData);
*ppihlSite = This->Site;
*pdwSiteData = This->SiteData;
if (This->Site)
if (This->Site) {
IHlinkSite_AddRef(This->Site);
*pdwSiteData = This->SiteData;
}
return S_OK;
}

View File

@ -1788,7 +1788,7 @@ static void test_HlinkClone(void)
hres = IHlink_GetHlinkSite(cloned, &fnd_site, &fnd_data);
ok(hres == S_OK, "GetHlinkSite failed: %08x\n", hres);
ok(fnd_site == NULL, "Expected NULL site\n");
todo_wine ok(fnd_data == 4, "Expected site data to be 4, was: %d\n", fnd_data);
ok(fnd_data == 4, "Expected site data to be 4, was: %d\n", fnd_data);
IHlink_Release(cloned);
IHlink_Release(hl);

View File

@ -708,7 +708,6 @@ static HRESULT WINAPI HlinkFrame_Navigate(IHlinkFrame *iface, DWORD grfHLNF, LPB
hres = IHlink_GetHlinkSite(pihlNavigate, &site, &site_data);
ok(hres == S_OK, "GetHlinkSite failed: %08x\n", hres);
ok(site == NULL, "site = %p\n, expected NULL\n", site);
todo_wine
ok(site_data == 0xdeadbeef, "site_data = %x\n", site_data);
}