Alexandre Julliard : ntdll: Fix the check for the main exe in get_load_order().

Alexandre Julliard julliard at winehq.org
Thu May 6 14:56:18 CDT 2021


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu May  6 16:28:13 2021 +0200

ntdll: Fix the check for the main exe in get_load_order().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/loadorder.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/unix/loadorder.c b/dlls/ntdll/unix/loadorder.c
index 4d7ad24d2b7..aa987a80186 100644
--- a/dlls/ntdll/unix/loadorder.c
+++ b/dlls/ntdll/unix/loadorder.c
@@ -58,6 +58,7 @@ static const WCHAR separatorsW[] = {',',' ','\t',0};
 static HANDLE std_key;
 static HANDLE app_key;
 static BOOL init_done;
+static BOOL main_exe_loaded;
 
 
 /***************************************************************************
@@ -365,6 +366,7 @@ void set_load_order_app_name( const WCHAR *app_name )
 
     if ((p = wcsrchr( app_name, '\\' ))) app_name = p + 1;
     app_key = open_app_key( app_name );
+    main_exe_loaded = TRUE;
 }
 
 
@@ -379,7 +381,7 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name )
     static const WCHAR prefixW[] = {'\\','?','?','\\'};
     enum loadorder ret = LO_INVALID;
     const WCHAR *path = nt_name->Buffer;
-    const WCHAR *p, *app_name = NULL;
+    const WCHAR *p;
     WCHAR *module, *basename;
     int len;
 
@@ -418,7 +420,7 @@ enum loadorder get_load_order( const UNICODE_STRING *nt_name )
         goto done;
 
     /* if loading the main exe with an explicit path, try native first */
-    if (!app_name && basename != module+1)
+    if (!main_exe_loaded && basename != module+1)
     {
         ret = LO_NATIVE_BUILTIN;
         TRACE( "got main exe default %s for %s\n", debugstr_loadorder(ret), debugstr_w(path) );




More information about the wine-cvs mailing list