Commit 8adebaaa authored by Alexandre Julliard's avatar Alexandre Julliard

mlang: Use a registry script to register codepages.

parent 083dea7f
......@@ -3,7 +3,7 @@ IMPORTLIB = mlang
IMPORTS = uuid ole32 gdi32 advapi32
DELAYIMPORTS = oleaut32
C_SRCS = \
mlang.c
IDL_SRCS = mlang_classes.idl
SOURCES = \
mlang.c \
mlang.rc \
mlang_classes.idl
......@@ -3922,69 +3922,6 @@ 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;
status = RegCreateKeyW(HKEY_CLASSES_ROOT, L"MIME\\Database\\Codepage", &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++)
{
swprintf(buf, ARRAY_SIZE(buf), L"%u", 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, L"Family", 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();
}
/***********************************************************************
* DllUnregisterServer (MLANG.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources();
}
HRESULT WINAPI GetGlobalFontLinkObject(void **unknown)
{
if (!unknown) return E_INVALIDARG;
......
/*
* Copyright 2022 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* @makedep: mlang.rgs */
2 WINE_REGISTRY mlang.rgs
......@@ -2581,7 +2581,6 @@ 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
......
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