Alexandre Julliard : kernel: Don' t bother checking load order of the exe in the parent process.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 22 10:32:15 CST 2006


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb 22 16:21:12 2006 +0100

kernel: Don't bother checking load order of the exe in the parent process.

---

 dlls/kernel/process.c |   72 ++++++++++---------------------------------------
 1 files changed, 14 insertions(+), 58 deletions(-)

diff --git a/dlls/kernel/process.c b/dlls/kernel/process.c
index 07851b0..bf5d938 100644
--- a/dlls/kernel/process.c
+++ b/dlls/kernel/process.c
@@ -39,7 +39,6 @@
 #include "wine/winuser16.h"
 #include "winioctl.h"
 #include "winternl.h"
-#include "module.h"
 #include "kernel_private.h"
 #include "wine/exception.h"
 #include "wine/server.h"
@@ -189,46 +188,20 @@ static void *open_builtin_exe_file( cons
  */
 static HANDLE open_exe_file( const WCHAR *name )
 {
-    enum loadorder_type loadorder[LOADORDER_NTYPES];
-    WCHAR buffer[MAX_PATH];
     HANDLE handle;
-    int i, file_exists;
 
     TRACE("looking for %s\n", debugstr_w(name) );
 
     if ((handle = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,
                                NULL, OPEN_EXISTING, 0, 0 )) == INVALID_HANDLE_VALUE)
     {
+        WCHAR buffer[MAX_PATH];
         /* file doesn't exist, check for builtin */
         if (!contains_path( name )) goto error;
         if (!get_builtin_path( name, NULL, buffer, sizeof(buffer) )) goto error;
-        name = buffer;
-    }
-
-    MODULE_GetLoadOrderW( loadorder, NULL, name );
-
-    for(i = 0; i < LOADORDER_NTYPES; i++)
-    {
-        if (loadorder[i] == LOADORDER_INVALID) break;
-        switch(loadorder[i])
-        {
-        case LOADORDER_DLL:
-            TRACE( "Trying native exe %s\n", debugstr_w(name) );
-            if (handle != INVALID_HANDLE_VALUE) return handle;
-            break;
-        case LOADORDER_BI:
-            TRACE( "Trying built-in exe %s\n", debugstr_w(name) );
-            open_builtin_exe_file( name, NULL, 0, 1, &file_exists );
-            if (file_exists)
-            {
-                if (handle != INVALID_HANDLE_VALUE) CloseHandle(handle);
-                return 0;
-            }
-        default:
-            break;
-        }
+        handle = 0;
     }
-    if (handle != INVALID_HANDLE_VALUE) CloseHandle(handle);
+    return handle;
 
  error:
     SetLastError( ERROR_FILE_NOT_FOUND );
@@ -247,9 +220,7 @@ static HANDLE open_exe_file( const WCHAR
 static BOOL find_exe_file( const WCHAR *name, WCHAR *buffer, int buflen, HANDLE *handle )
 {
     static const WCHAR exeW[] = {'.','e','x','e',0};
-
-    enum loadorder_type loadorder[LOADORDER_NTYPES];
-    int i, file_exists;
+    int file_exists;
 
     TRACE("looking for %s\n", debugstr_w(name) );
 
@@ -268,34 +239,19 @@ static BOOL find_exe_file( const WCHAR *
         return FALSE;
     }
 
-    MODULE_GetLoadOrderW( loadorder, NULL, buffer );
+    TRACE( "Trying native exe %s\n", debugstr_w(buffer) );
+    if ((*handle = CreateFileW( buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,
+                                NULL, OPEN_EXISTING, 0, 0 )) != INVALID_HANDLE_VALUE)
+        return TRUE;
 
-    for(i = 0; i < LOADORDER_NTYPES; i++)
+    TRACE( "Trying built-in exe %s\n", debugstr_w(buffer) );
+    open_builtin_exe_file( buffer, NULL, 0, 1, &file_exists );
+    if (file_exists)
     {
-        if (loadorder[i] == LOADORDER_INVALID) break;
-        switch(loadorder[i])
-        {
-        case LOADORDER_DLL:
-            TRACE( "Trying native exe %s\n", debugstr_w(buffer) );
-            if ((*handle = CreateFileW( buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,
-                                        NULL, OPEN_EXISTING, 0, 0 )) != INVALID_HANDLE_VALUE)
-                return TRUE;
-            if (GetLastError() != ERROR_FILE_NOT_FOUND) return TRUE;
-            break;
-        case LOADORDER_BI:
-            TRACE( "Trying built-in exe %s\n", debugstr_w(buffer) );
-            open_builtin_exe_file( buffer, NULL, 0, 1, &file_exists );
-            if (file_exists)
-            {
-                *handle = 0;
-                return TRUE;
-            }
-            break;
-        default:
-            break;
-        }
+        *handle = 0;
+        return TRUE;
     }
-    SetLastError( ERROR_FILE_NOT_FOUND );
+
     return FALSE;
 }
 




More information about the wine-cvs mailing list