From 8cdcbbb3420f2f6c29948e75636ad5d464843ee6 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 24 Feb 2004 01:26:31 +0000 Subject: [PATCH] Tweak the load order algorithm a bit to better reflect the user's intention, by taking into account non-wildcard module specifications for all directories. --- dlls/ntdll/loadorder.c | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c index 1adb50fed9a..cc0dff69e05 100644 --- a/dlls/ntdll/loadorder.c +++ b/dlls/ntdll/loadorder.c @@ -605,18 +605,18 @@ void MODULE_GetLoadOrderW( enum loadorder_type loadorder[], const WCHAR *app_nam goto done; } - /* then base name matching compiled-in defaults */ - if (get_default_load_order( basename, loadorder )) - { - TRACE( "got compiled-in default %s for %s\n", - debugstr_loadorder(loadorder), debugstr_w(path) ); - goto done; - } - - if (basename == module+1) + if (basename == module+1) /* module doesn't contain a path */ { static const WCHAR wildcardW[] = {'*',0}; + /* then base name matching compiled-in defaults */ + if (get_default_load_order( basename, loadorder )) + { + TRACE( "got compiled-in default %s for %s\n", + debugstr_loadorder(loadorder), debugstr_w(path) ); + goto done; + } + /* then wildcard entry in AppDefaults (only if no explicit path) */ if (app_key && get_registry_value( app_key, wildcardW, loadorder )) { @@ -640,6 +640,31 @@ void MODULE_GetLoadOrderW( enum loadorder_type loadorder[], const WCHAR *app_nam } else /* module contains an explicit path */ { + /* then base name without '*' in AppDefaults */ + if (app_key && get_registry_value( app_key, basename, loadorder )) + { + TRACE( "got basename app defaults %s for %s\n", + debugstr_loadorder(loadorder), debugstr_w(path) ); + goto done; + } + + /* then base name without '*' in standard section */ + if (std_key && get_registry_value( std_key, basename, loadorder )) + { + TRACE( "got basename standard entry %s for %s\n", + debugstr_loadorder(loadorder), debugstr_w(path) ); + goto done; + } + + /* then base name matching compiled-in defaults */ + if (get_default_load_order( basename, loadorder )) + { + TRACE( "got compiled-in default %s for %s\n", + debugstr_loadorder(loadorder), debugstr_w(path) ); + goto done; + } + + /* and last the hard-coded default */ memcpy( loadorder, default_path_loadorder, sizeof(default_path_loadorder) ); TRACE( "got hardcoded path default %s for %s\n", debugstr_loadorder(loadorder), debugstr_w(path) ); -- 2.11.4.GIT