Rémi Bernon : gdi32: Only request registry font path when necessary.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 15:40:34 CST 2020


Module: wine
Branch: master
Commit: cae74aa7d9f96f57d044e5b7f0b491ff7b3b02df
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cae74aa7d9f96f57d044e5b7f0b491ff7b3b02df

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Nov 27 15:38:04 2020 +0100

gdi32: Only request registry font path when necessary.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/font.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index d3202d83a15..4cc072bd785 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -7910,7 +7910,7 @@ static void load_registry_fonts(void)
 
     vlen = ARRAY_SIZE(value);
     dlen = sizeof(data);
-    while (!RegEnumValueW( hkey, i++, value, &vlen, NULL, &type, (LPBYTE)data, &dlen ))
+    while (!RegEnumValueW( hkey, i++, value, &vlen, NULL, &type, NULL, NULL ))
     {
         if (type != REG_SZ) goto next;
         dlen /= sizeof(WCHAR);
@@ -7918,6 +7918,13 @@ static void load_registry_fonts(void)
         if (find_face_from_full_name( value )) goto next;
         if (tmp && !*tmp) *tmp = ' ';
 
+        if (RegQueryValueExW( hkey, value, NULL, NULL, (LPBYTE)data, &dlen ))
+        {
+            WARN( "Unable to get face path %s\n", debugstr_w(value) );
+            goto next;
+        }
+
+        dlen /= sizeof(WCHAR);
         if (data[0] && data[1] == ':')
             add_font_resource( data, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_TO_CACHE );
         else if (dlen >= 6 && !wcsicmp( data + dlen - 5, L".fon" ))




More information about the wine-cvs mailing list