From: Danyil Blyschak dblyschak@codeweavers.com
In update_external_font_keys(), remove the fonts from the registry immediately after we mark them for deletion, and then proceed to add or update values in the registry.
This prevents a font from being marked as deleted, then being updated in the registry, and then removed from the registry regardless. When this happened, the registry would not contain the value for this font that we intended to update it with. This function would need to run again for this value to be added to the registry, but since this function runs during initialization, this means that a subsequent launch of wine was necessary. By removing the old value from the registry first, and then adding the new one, the initialization process becomes idempotent starting from the first run. --- dlls/win32u/font.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 277849ac4d9..7e70cccf568 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -6664,6 +6664,14 @@ static void update_external_font_keys(void) list_add_tail( &external_keys, &key->entry ); }
+ LIST_FOR_EACH_ENTRY_SAFE( key, next, &external_keys, struct external_key, entry ) + { + reg_delete_value( win9x_key, key->value ); + reg_delete_value( winnt_key, key->value ); + reg_delete_value( hkey, key->value ); + list_remove( &key->entry ); + free( key ); + } WINE_RB_FOR_EACH_ENTRY( family, &family_name_tree, struct gdi_font_family, name_entry ) { LIST_FOR_EACH_ENTRY( face, &family->faces, struct gdi_font_face, entry ) @@ -6690,14 +6698,6 @@ static void update_external_font_keys(void) set_reg_value( hkey, value, REG_SZ, file, len ); } } - LIST_FOR_EACH_ENTRY_SAFE( key, next, &external_keys, struct external_key, entry ) - { - reg_delete_value( win9x_key, key->value ); - reg_delete_value( winnt_key, key->value ); - reg_delete_value( hkey, key->value ); - list_remove( &key->entry ); - free( key ); - } NtClose( win9x_key ); NtClose( winnt_key ); NtClose( hkey );