Alexandre Julliard : ntdll: Default to native loadorder for the main exe if not in system directory.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 15 13:33:36 CDT 2006


Module: wine
Branch: master
Commit: c6d9577017946c33f78db51f82af9e657d13d15d
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=c6d9577017946c33f78db51f82af9e657d13d15d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Aug 15 19:48:08 2006 +0200

ntdll: Default to native loadorder for the main exe if not in system directory.

Unlike dlls, executables can have the same name without necessarily
being the same application, so defaulting to native is more likely to
do the right thing.

---

 dlls/ntdll/loadorder.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c
index ecc0cab..c31b633 100644
--- a/dlls/ntdll/loadorder.c
+++ b/dlls/ntdll/loadorder.c
@@ -474,9 +474,17 @@ enum loadorder get_load_order( const WCH
     if (basename != module+1 && ((ret = get_load_order_value( std_key, app_key, basename )) != LO_INVALID))
         goto done;
 
+    /* if loading the main exe with an explicit path, try native first */
+    if (!app_name && basename != module+1)
+    {
+        ret = LO_NATIVE_BUILTIN;
+        TRACE( "got main exe default %s for %s\n", debugstr_loadorder(ret), debugstr_w(path) );
+        goto done;
+    }
+
     /* and last the hard-coded default */
     ret = LO_DEFAULT;
-    TRACE( "got hardcoded default %s for %s\n", debugstr_loadorder(ret), debugstr_w(path) );
+    TRACE( "got hardcoded %s for %s\n", debugstr_loadorder(ret), debugstr_w(path) );
 
  done:
     RtlFreeHeap( GetProcessHeap(), 0, module );




More information about the wine-cvs mailing list