Commit 94edcc1d authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

hlink: Implement IHlinkBrowseContext::GetBrowseWindowInfo.

parent 3e041586
......@@ -155,6 +155,9 @@ static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
HlinkBCImpl *This = (HlinkBCImpl*)iface;
TRACE("(%p)->(%p)\n", This, phlbwi);
if(!phlbwi)
return E_INVALIDARG;
heap_free(This->BrowseWindowInfo);
This->BrowseWindowInfo = heap_alloc(phlbwi->cbSize);
memcpy(This->BrowseWindowInfo, phlbwi, phlbwi->cbSize);
......@@ -165,8 +168,18 @@ static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface,
HLBWINFO *phlbwi)
{
FIXME("\n");
return E_NOTIMPL;
HlinkBCImpl *This = (HlinkBCImpl*)iface;
TRACE("(%p)->(%p)\n", This, phlbwi);
if(!phlbwi)
return E_INVALIDARG;
if(!This->BrowseWindowInfo)
phlbwi->cbSize = 0;
else
memcpy(phlbwi, This->BrowseWindowInfo, This->BrowseWindowInfo->cbSize);
return S_OK;
}
static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface,
......
......@@ -80,11 +80,58 @@ static void test_SetInitialHlink(void)
IMoniker_Release(dummy);
}
static void test_BrowseWindowInfo(void)
{
IHlinkBrowseContext *bc;
HLBWINFO bwinfo_set, bwinfo_get;
HRESULT hres;
hres = HlinkCreateBrowseContext(NULL, &IID_IHlinkBrowseContext, (void**)&bc);
ok(hres == S_OK, "HlinkCreateBrowseContext failed: 0x%08x\n", hres);
hres = IHlinkBrowseContext_GetBrowseWindowInfo(bc, NULL);
ok(hres == E_INVALIDARG, "GetBrowseWindow failed with wrong code: 0x%08x\n", hres);
hres = IHlinkBrowseContext_SetBrowseWindowInfo(bc, NULL);
ok(hres == E_INVALIDARG, "SetBrowseWindow failed with wrong code: 0x%08x\n", hres);
memset(&bwinfo_get, -1, sizeof(HLBWINFO));
hres = IHlinkBrowseContext_GetBrowseWindowInfo(bc, &bwinfo_get);
ok(hres == S_OK, "GetBrowseWindowInfo failed: 0x%08x\n", hres);
ok(bwinfo_get.cbSize == 0, "Got wrong size: %x\n", bwinfo_get.cbSize);
bwinfo_set.cbSize = sizeof(HLBWINFO);
bwinfo_set.grfHLBWIF = HLBWIF_WEBTOOLBARHIDDEN;
bwinfo_set.rcFramePos.left = 1;
bwinfo_set.rcFramePos.right = 2;
bwinfo_set.rcFramePos.top = 3;
bwinfo_set.rcFramePos.bottom = 4;
bwinfo_set.rcDocPos.left = 5;
bwinfo_set.rcDocPos.right = 6;
bwinfo_set.rcDocPos.top = 7;
bwinfo_set.rcDocPos.bottom = 8;
bwinfo_set.hltbinfo.uDockType = 4321;
bwinfo_set.hltbinfo.rcTbPos.left = 9;
bwinfo_set.hltbinfo.rcTbPos.right = 10;
bwinfo_set.hltbinfo.rcTbPos.top = 11;
bwinfo_set.hltbinfo.rcTbPos.bottom = 12;
hres = IHlinkBrowseContext_SetBrowseWindowInfo(bc, &bwinfo_set);
ok(hres == S_OK, "SetBrowseWindowInfo failed: 0x%08x\n", hres);
memset(&bwinfo_get, 0, sizeof(HLBWINFO));
hres = IHlinkBrowseContext_GetBrowseWindowInfo(bc, &bwinfo_get);
ok(hres == S_OK, "GetBrowseWindowInfo failed: 0x%08x\n", hres);
ok(!memcmp(&bwinfo_set, &bwinfo_get, sizeof(HLBWINFO)), "Set and Get differ");
}
START_TEST(browse_ctx)
{
CoInitialize(NULL);
test_SetInitialHlink();
test_BrowseWindowInfo();
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