mshtml: Query OleClientSite about services in ServiceProvider_QueryService.

This commit is contained in:
Piotr Caban 2009-12-28 20:08:46 +01:00 committed by Alexandre Julliard
parent 044a989d79
commit be2a86cbd5
2 changed files with 36 additions and 1 deletions

View File

@ -248,9 +248,24 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
return S_OK;
}
if(This->doc_obj->client) {
IServiceProvider *sp;
HRESULT hres;
hres = IOleClientSite_QueryInterface(This->doc_obj->client,
&IID_IServiceProvider, (void**)&sp);
if(SUCCEEDED(hres)) {
hres = IServiceProvider_QueryService(sp, guidService, riid, ppv);
IServiceProvider_Release(sp);
if(SUCCEEDED(hres))
return hres;
}
}
FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
return E_UNEXPECTED;
return E_NOINTERFACE;
}
static const IServiceProviderVtbl ServiceProviderVtbl = {

View File

@ -4508,6 +4508,24 @@ static void test_HTMLDocument_http(void)
ok(!ref, "ref=%d, expected 0\n", ref);
}
static void test_QueryService(IUnknown *unk, BOOL success)
{
IServiceProvider *sp;
IHlinkFrame *hf;
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IServiceProvider, (void**)&sp);
ok(hres == S_OK, "QueryService returned %08x\n", hres);
hres = IServiceProvider_QueryService(sp, &IID_IHlinkFrame, &IID_IHlinkFrame, (void**)&hf);
if(SUCCEEDED(hres))
IHlinkFrame_Release(hf);
ok(hres == (success?S_OK:E_NOINTERFACE), "QueryService returned %08x, expected %08x\n", hres, success?S_OK:E_NOINTERFACE);
IServiceProvider_Release(sp);
}
static void test_HTMLDocument_StreamLoad(void)
{
IOleObject *oleobj;
@ -4535,7 +4553,9 @@ static void test_HTMLDocument_StreamLoad(void)
test_readyState(unk);
test_IsDirty(unk, S_FALSE);
test_ConnectionPointContainer(unk);
test_QueryService(unk, FALSE);
test_ClientSite(oleobj, CLIENTSITE_EXPECTPATH);
test_QueryService(unk, TRUE);
test_DoVerb(oleobj);
test_MSHTML_QueryStatus(unk, OLECMDF_SUPPORTED);