Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/gdi32/font.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index db87a283b13..cb170c0b862 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3891,23 +3891,24 @@ const struct gdi_dc_funcs font_driver = GDI_PRIORITY_FONT_DRV /* priority */ };
-static DWORD get_key_value( HKEY key, const WCHAR *name, DWORD *value ) +static DWORD get_key_value( HKEY key1, HKEY key2, const WCHAR *name, DWORD *value ) { WCHAR buf[12]; DWORD count = sizeof(buf), type, err;
- err = RegQueryValueExW( key, name, NULL, &type, (BYTE *)buf, &count ); - if (!err) - { - if (type == REG_DWORD) memcpy( value, buf, sizeof(*value) ); - else *value = wcstol( buf, NULL, 10 ); - } - return err; + if ((err = RegQueryValueExW( key1, name, NULL, &type, (BYTE *)buf, &count )) + && (err = RegQueryValueExW( key2, name, NULL, &type, (BYTE *)buf, &count ))) + return err; + + if (type == REG_DWORD) memcpy( value, buf, sizeof(*value) ); + else *value = wcstol( buf, NULL, 10 ); + + return 0; }
static void init_font_options(void) { - HKEY key; + HKEY key, volatile_key = NULL; DWORD i, type, size, val, gamma = 1400; WCHAR buffer[20];
@@ -3920,8 +3921,10 @@ static void init_font_options(void)
if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Control Panel\Desktop", &key )) { + RegOpenKeyW( HKEY_CURRENT_USER, L"Software\Wine\Temporary System Parameters\Control Panel\Desktop", + &volatile_key ); /* FIXME: handle vertical orientations even though Windows doesn't */ - if (!get_key_value( key, L"FontSmoothingOrientation", &val )) + if (!get_key_value( volatile_key, key, L"FontSmoothingOrientation", &val )) { switch (val) { @@ -3933,18 +3936,20 @@ static void init_font_options(void) break; } } - if (!get_key_value( key, L"FontSmoothing", &val ) && val /* enabled */) + if (!get_key_value( volatile_key, key, L"FontSmoothing", &val ) && val /* enabled */) { - if (!get_key_value( key, L"FontSmoothingType", &val ) && val == 2 /* FE_FONTSMOOTHINGCLEARTYPE */) + if (!get_key_value( volatile_key, key, L"FontSmoothingType", &val ) && val == 2 /* FE_FONTSMOOTHINGCLEARTYPE */) font_smoothing = subpixel_orientation; else font_smoothing = GGO_GRAY4_BITMAP; } - if (!get_key_value( key, L"FontSmoothingGamma", &val ) && val) + if (!get_key_value( volatile_key, key, L"FontSmoothingGamma", &val ) && val) { gamma = min( max( val, 1000 ), 2200 ); } RegCloseKey( key ); + if (volatile_key) + RegCloseKey( volatile_key ); }
/* Calibrating the difference between the registry value and the Wine gamma value.