Commit e57ab97f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent ff934e82
......@@ -2229,12 +2229,22 @@ 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) {
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
static HRESULT WINAPI SFCF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
{
IClassFactoryImpl *This = impl_from_IClassFactory(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
*obj = NULL;
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
if (IsEqualIID(&IID_IClassFactory, riid) || IsEqualIID(&IID_IUnknown, riid))
{
*obj = iface;
IClassFactory_AddRef(iface);
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI
......
......@@ -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)
......
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