From e51dc8f2d3243fed2ee5eb169b5c55567b5b39c0 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Fri, 12 Jun 2009 11:19:42 +0200 Subject: [PATCH] mlang: Implement IMultiLanguage_GetRfc1766Info. --- dlls/mlang/mlang.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index 6199da0008f..4d3c2e58558 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -2536,8 +2536,38 @@ static HRESULT WINAPI fnIMultiLanguage_GetRfc1766Info( LCID Locale, PRFC1766INFO pRfc1766Info) { - FIXME("\n"); - return E_NOTIMPL; + LCTYPE type = LOCALE_SLANGUAGE; + + TRACE("(%p, 0x%04x, %p)\n", iface, Locale, pRfc1766Info); + + if (!pRfc1766Info) + return E_INVALIDARG; + + if ((PRIMARYLANGID(Locale) == LANG_ENGLISH) || + (PRIMARYLANGID(Locale) == LANG_CHINESE) || + (PRIMARYLANGID(Locale) == LANG_ARABIC)) { + + if (!SUBLANGID(Locale)) + type = LOCALE_SENGLANGUAGE; /* suppress country */ + } + else + { + if (!SUBLANGID(Locale)) { + TRACE("SUBLANGID missing in 0x%04x\n", Locale); + return E_FAIL; + } + } + + pRfc1766Info->lcid = Locale; + pRfc1766Info->wszRfc1766[0] = 0; + pRfc1766Info->wszLocaleName[0] = 0; + + if ((!lcid_to_rfc1766W(Locale, pRfc1766Info->wszRfc1766, MAX_RFC1766_NAME)) && + (GetLocaleInfoW(Locale, type, pRfc1766Info->wszLocaleName, MAX_LOCALE_NAME) > 0)) + return S_OK; + + /* Locale not supported */ + return E_INVALIDARG; } static HRESULT WINAPI fnIMultiLanguage_CreateConvertCharset(