From 23c0047c818c20f73fb8244a0227a13581963ffe Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 9 Oct 2018 15:55:00 +0200 Subject: [PATCH] mlang: Register codepages info in registry. Outlook 2016 requires Codepage key to exist (it doesn't seem to require it to be filled). Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mlang/mlang.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ loader/wine.inf.in | 1 + 2 files changed, 54 insertions(+) diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index fc162522af1..f12df298f13 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -3928,12 +3928,65 @@ HRESULT WINAPI DllCanUnloadNow(void) return dll_count == 0 ? S_OK : S_FALSE; } +static BOOL register_codepages(void) +{ + const struct mlang_data *family; + const MIME_CP_INFO *info; + HKEY db_key, key; + WCHAR buf[32]; + LSTATUS status; + + static const WCHAR db_key_nameW[] = { + 'M','I','M','E', + '\\','D','a','t','a','b','a','s','e', + '\\','C','o','d','e','p','a','g','e',0}; + static const WCHAR familyW[] = {'F','a','m','i','l','y',0}; + static const WCHAR formatW[] = {'%','u',0}; + + status = RegCreateKeyW(HKEY_CLASSES_ROOT, db_key_nameW, &db_key); + if (status != ERROR_SUCCESS) + return FALSE; + + for (family = mlang_data; family < mlang_data + ARRAY_SIZE(mlang_data); family++) + { + for (info = family->mime_cp_info; info < family->mime_cp_info + family->number_of_cp; info++) + { + sprintfW(buf, formatW, info->cp); + status = RegCreateKeyW(db_key, buf, &key); + if (status != ERROR_SUCCESS) + continue; + + RegSetValueExA(key, "BodyCharset", 0, REG_SZ, (BYTE*)info->body_charset, + strlen(info->body_charset) + 1); + + if (info->cp == family->family_codepage) + { + RegSetValueExA(key, "FixedWidthFont", 0, REG_SZ, (BYTE*)family->fixed_font, + strlen(family->fixed_font) + 1); + RegSetValueExA(key, "ProportionalFont", 0, REG_SZ, (BYTE*)family->proportional_font, + strlen(family->proportional_font) + 1); + } + else + { + RegSetValueExW(key, familyW, 0, REG_DWORD, (BYTE*)&family->family_codepage, + sizeof(family->family_codepage)); + } + + RegCloseKey(key); + } + } + + RegCloseKey(db_key); + return TRUE; +} /*********************************************************************** * DllRegisterServer (MLANG.@) */ HRESULT WINAPI DllRegisterServer(void) { + if(!register_codepages()) + return E_FAIL; return __wine_register_resources( instance ); } diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 5767b29887c..b6aeb1c86f3 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2508,6 +2508,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,cryptdlg.dll,1 11,,cryptnet.dll,1 11,,devenum.dll,1 +11,,mlang.dll,1 11,,mp3dmod.dll,1 11,,mscoree.dll,1 11,,mshtml.dll,1