Robert Shearman : ntdll: Loader optimization.
Module: wine Branch: refs/heads/master Commit: 2d08465b81d90e8cf1389b5abf5abefee7ba6462 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=2d08465b81d90e8cf1389b5a... Author: Robert Shearman <rob(a)codeweavers.com> Date: Wed Jan 18 14:22:19 2006 +0100 ntdll: Loader optimization. Optimize for the case where a DLL with no path is requested and it is already loaded. --- dlls/ntdll/loader.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 47cc1da..5996523 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1487,6 +1487,12 @@ static NTSTATUS find_dll_file( const WCH } nt_name.Buffer = NULL; + + if (!contains_path( libname )) + { + if ((*pwm = find_basename_module( libname )) != NULL) goto found; + } + if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) { /* we need to search for it */ @@ -1496,11 +1502,6 @@ static NTSTATUS find_dll_file( const WCH if (len >= *size) goto overflow; if ((*pwm = find_fullname_module( filename )) != NULL) goto found; - /* check for already loaded module in a different path */ - if (!contains_path( libname )) - { - if ((*pwm = find_basename_module( file_part )) != NULL) goto found; - } if (!RtlDosPathNameToNtPathName_U( filename, &nt_name, NULL, NULL )) { RtlFreeHeap( GetProcessHeap(), 0, dllname ); @@ -1525,7 +1526,6 @@ static NTSTATUS find_dll_file( const WCH len = strlenW(libname) * sizeof(WCHAR); if (len >= *size) goto overflow; strcpyW( filename, libname ); - *pwm = find_basename_module( filename ); goto found; } }
participants (1)
-
Alexandre Julliard