gdi32: Directly use ntdll in get_associated_charset_info.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1cdc74b2d6
commit
1262b1aeab
|
@ -103,6 +103,17 @@ static const WCHAR system_link_keyW[] =
|
||||||
'\\','S','y','s','t','e','m','L','i','n','k'
|
'\\','S','y','s','t','e','m','L','i','n','k'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const WCHAR associated_charset_keyW[] =
|
||||||
|
{
|
||||||
|
'\\','R','e','g','i','s','t','r','y',
|
||||||
|
'\\','M','a','c','h','i','n','e',
|
||||||
|
'\\','S','y','s','t','e','m',
|
||||||
|
'\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t',
|
||||||
|
'\\','C','o','n','t','r','o','l',
|
||||||
|
'\\','F','o','n','t','A','s','s','o','c',
|
||||||
|
'\\','A','s','s','o','c','i','a','t','e','d',' ','C','h','a','r','s','e','t'
|
||||||
|
};
|
||||||
|
|
||||||
static const WCHAR software_config_keyW[] =
|
static const WCHAR software_config_keyW[] =
|
||||||
{
|
{
|
||||||
'\\','R','e','g','i','s','t','r','y',
|
'\\','R','e','g','i','s','t','r','y',
|
||||||
|
@ -4386,32 +4397,30 @@ static DWORD get_associated_charset_info(void)
|
||||||
|
|
||||||
if (associated_charset == -1)
|
if (associated_charset == -1)
|
||||||
{
|
{
|
||||||
|
char value_buffer[FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[32 * sizeof(WCHAR)])];
|
||||||
|
KEY_VALUE_PARTIAL_INFORMATION *info = (void *)value_buffer;
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
WCHAR dataW[32];
|
|
||||||
DWORD type, data_len;
|
static const WCHAR yesW[] = {'y','e','s',0};
|
||||||
|
|
||||||
associated_charset = 0;
|
associated_charset = 0;
|
||||||
|
|
||||||
if (RegOpenKeyW(HKEY_LOCAL_MACHINE,
|
if (!(hkey = reg_open_key( NULL, associated_charset_keyW, sizeof(associated_charset_keyW) )))
|
||||||
L"System\\CurrentControlSet\\Control\\FontAssoc\\Associated Charset", &hkey))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
data_len = sizeof(dataW);
|
if (query_reg_ascii_value( hkey, "ANSI(00)", info, sizeof(value_buffer) ) &&
|
||||||
if (!RegQueryValueExW(hkey, L"ANSI(00)", NULL, &type, (LPBYTE)dataW, &data_len) &&
|
info->Type == REG_SZ && !wcsicmp( (const WCHAR *)info->Data, yesW ))
|
||||||
type == REG_SZ && !wcsicmp(dataW, L"yes"))
|
|
||||||
associated_charset |= ASSOC_CHARSET_ANSI;
|
associated_charset |= ASSOC_CHARSET_ANSI;
|
||||||
|
|
||||||
data_len = sizeof(dataW);
|
if (query_reg_ascii_value( hkey, "OEM(FF)", info, sizeof(value_buffer) ) &&
|
||||||
if (!RegQueryValueExW(hkey, L"OEM(FF)", NULL, &type, (LPBYTE)dataW, &data_len) &&
|
info->Type == REG_SZ && !wcsicmp( (const WCHAR *)info->Data, yesW ))
|
||||||
type == REG_SZ && !wcsicmp(dataW, L"yes"))
|
|
||||||
associated_charset |= ASSOC_CHARSET_OEM;
|
associated_charset |= ASSOC_CHARSET_OEM;
|
||||||
|
|
||||||
data_len = sizeof(dataW);
|
if (query_reg_ascii_value( hkey, "SYMBOL(02)", info, sizeof(value_buffer) ) &&
|
||||||
if (!RegQueryValueExW(hkey, L"SYMBOL(02)", NULL, &type, (LPBYTE)dataW, &data_len) &&
|
info->Type == REG_SZ && !wcsicmp( (const WCHAR *)info->Data, yesW ))
|
||||||
type == REG_SZ && !wcsicmp(dataW, L"yes"))
|
|
||||||
associated_charset |= ASSOC_CHARSET_SYMBOL;
|
associated_charset |= ASSOC_CHARSET_SYMBOL;
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
NtClose( hkey );
|
||||||
|
|
||||||
TRACE("associated_charset = %d\n", associated_charset);
|
TRACE("associated_charset = %d\n", associated_charset);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue