Commit 82930745 authored by Santino Mazza's avatar Santino Mazza Committed by Alexandre Julliard

mlang: Implement GetGlobalFontLinkObject.

parent 6360992d
...@@ -44,6 +44,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang); ...@@ -44,6 +44,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang);
#include "initguid.h" #include "initguid.h"
static INIT_ONCE font_link_global_init_once = INIT_ONCE_STATIC_INIT;
static IUnknown *font_link_global = NULL;
static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj); static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
static HRESULT MLangConvertCharset_create(IUnknown *outer, void **obj); static HRESULT MLangConvertCharset_create(IUnknown *outer, void **obj);
static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum); static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum);
...@@ -3882,11 +3885,25 @@ HRESULT WINAPI DllCanUnloadNow(void) ...@@ -3882,11 +3885,25 @@ HRESULT WINAPI DllCanUnloadNow(void)
return dll_count == 0 ? S_OK : S_FALSE; return dll_count == 0 ? S_OK : S_FALSE;
} }
static BOOL WINAPI allocate_font_link_cb(PINIT_ONCE init_once, PVOID args, PVOID *context)
{
return SUCCEEDED(MultiLanguage_create(NULL, (void**)&font_link_global));
}
HRESULT WINAPI GetGlobalFontLinkObject(void **unknown) HRESULT WINAPI GetGlobalFontLinkObject(void **unknown)
{ {
TRACE("%p\n", unknown);
if (!unknown) return E_INVALIDARG; if (!unknown) return E_INVALIDARG;
FIXME("%p: stub\n", unknown); if (!InitOnceExecuteOnce(&font_link_global_init_once, allocate_font_link_cb, NULL, NULL))
{
ERR("Failed to create global font link object.\n");
return E_FAIL;
}
return S_FALSE; IUnknown_AddRef(font_link_global);
*unknown = font_link_global;
return S_OK;
} }
...@@ -2306,18 +2306,18 @@ static void test_GetGlobalFontLinkObject(void) ...@@ -2306,18 +2306,18 @@ static void test_GetGlobalFontLinkObject(void)
unknown = (void *)0xdeadbeef; unknown = (void *)0xdeadbeef;
ret = GetGlobalFontLinkObject(&unknown); ret = GetGlobalFontLinkObject(&unknown);
todo_wine {
ok(ret == S_OK, "expected S_OK got %#lx\n", ret); ok(ret == S_OK, "expected S_OK got %#lx\n", ret);
ok(unknown != NULL && unknown != (void *)0xdeadbeef, ok(unknown != NULL && unknown != (void *)0xdeadbeef,
"GetGlobalFontLinkObject() returned %p\n", unknown); "GetGlobalFontLinkObject() returned %p\n", unknown);
if (unknown == (void *)0xdeadbeef || !unknown) return; if (unknown == (void *)0xdeadbeef || !unknown) return;
}
ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangFontLink2, (void**)&IMLFL2); ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangFontLink2, (void**)&IMLFL2);
ok(ret == E_NOINTERFACE, "expected E_NOINTERFACE got %#lx\n", ret); todo_wine ok(ret == E_NOINTERFACE, "expected E_NOINTERFACE got %#lx\n", ret);
if (ret == S_OK) IMLangFontLink2_Release(IMLFL2);
ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMultiLanguage, (void**)&IML); ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMultiLanguage, (void**)&IML);
ok(ret == E_NOINTERFACE, "expected E_NOINTERFACE got %#lx\n", ret); todo_wine ok(ret == E_NOINTERFACE, "expected E_NOINTERFACE got %#lx\n", ret);
if (ret == S_OK) IMultiLanguage_Release(IML);
ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangFontLink, (void**)&IMLFL); ret = IUnknown_QueryInterface((IUnknown*)unknown, &IID_IMLangFontLink, (void**)&IMLFL);
ok(ret == S_OK, "expected S_OK got %#lx\n", ret); ok(ret == S_OK, "expected S_OK got %#lx\n", ret);
......
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