oleaut32: Implement IClassFactory::QueryInterface() for StdFont object.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-08-25 21:50:40 +03:00 committed by Alexandre Julliard
parent ff934e82a8
commit e57ab97f6f
2 changed files with 30 additions and 5 deletions

View File

@ -2229,11 +2229,21 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
}
static HRESULT WINAPI
SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
static HRESULT WINAPI SFCF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
{
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
*obj = NULL;
if (IsEqualIID(&IID_IClassFactory, riid) || IsEqualIID(&IID_IUnknown, riid))
{
*obj = iface;
IClassFactory_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}

View File

@ -1230,6 +1230,7 @@ static void test_realization(void)
static void test_OleCreateFontIndirect(void)
{
FONTDESC fontdesc;
IUnknown *unk, *unk2;
IFont *font;
HRESULT hr;
@ -1261,6 +1262,20 @@ static void test_OleCreateFontIndirect(void)
hr = pOleCreateFontIndirect(&fontdesc, &IID_IFont, (void**)&font);
EXPECT_HR(hr, S_OK);
IFont_Release(font);
hr = OleInitialize(NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = CoGetClassObject(&CLSID_StdFont, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&unk);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void**)&unk2);
ok(hr == S_OK, "got 0x%08x\n", hr);
IUnknown_Release(unk);
IUnknown_Release(unk2);
OleUninitialize();
}
START_TEST(olefont)