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