Added patch to improve performance of LdrGetDllHandle when DLL is not loaded.

This commit is contained in:
Sebastian Lackner 2017-02-20 15:56:33 +01:00
parent 33efbf2440
commit 53aeae58ad
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From 2689c394dda377cdda8099164e561bfed4b07962 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 15 Feb 2017 16:50:04 +0100
Subject: ntdll: Improve speed of LdrGetDllHandle when searching for the
basename of modules that are not loaded.
FIXME: Can we do a similar optimization when the activation context is present?
---
dlls/ntdll/loader.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 1168bad03ae..97cde883545 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2506,6 +2506,11 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
RtlFreeHeap( GetProcessHeap(), 0, dllname );
return status;
}
+ else if (!handle)
+ {
+ /* Do not resolve full name if basename cannot be found */
+ return STATUS_DLL_NOT_FOUND;
+ }
}
if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH)
--
2.11.0

View File

@ -0,0 +1 @@
Fixes: Improve performance of LdrGetDllHandle when DLL is not loaded

View File

@ -234,6 +234,7 @@ patch_enable_all ()
enable_ntdll_Hide_Wine_Exports="$1"
enable_ntdll_Junction_Points="$1"
enable_ntdll_LdrEnumerateLoadedModules="$1"
enable_ntdll_LdrGetDllHandle="$1"
enable_ntdll_Loader_Machine_Type="$1"
enable_ntdll_NtAccessCheck="$1"
enable_ntdll_NtAllocateUuids="$1"
@ -915,6 +916,9 @@ patch_enable ()
ntdll-LdrEnumerateLoadedModules)
enable_ntdll_LdrEnumerateLoadedModules="$2"
;;
ntdll-LdrGetDllHandle)
enable_ntdll_LdrGetDllHandle="$2"
;;
ntdll-Loader_Machine_Type)
enable_ntdll_Loader_Machine_Type="$2"
;;
@ -5445,6 +5449,18 @@ if test "$enable_ntdll_LdrEnumerateLoadedModules" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-LdrGetDllHandle
# |
# | Modified files:
# | * dlls/ntdll/loader.c
# |
if test "$enable_ntdll_LdrGetDllHandle" -eq 1; then
patch_apply ntdll-LdrGetDllHandle/0001-ntdll-Improve-speed-of-LdrGetDllHandle-when-searchin.patch
(
printf '%s\n' '+ { "Michael Müller", "ntdll: Improve speed of LdrGetDllHandle when searching for the basename of modules that are not loaded.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-NtAccessCheck
# |
# | Modified files: