[PATCH v2 16/22] ntdll: Don't use exclusive loader lock in LdrLoadDll() when possible.

Paul Gofman pgofman at codeweavers.com
Tue Oct 5 17:49:22 CDT 2021


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/ntdll/loader.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 368ae2db42c..e3610667e06 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3305,6 +3305,8 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags,
     WINE_MODREF *wm;
     NTSTATUS nts;
 
+    if (!LdrGetDllHandleEx( 0, path_name, NULL, libname, hModule )) return STATUS_SUCCESS;
+
     lock_loader_exclusive();
 
     nts = load_dll( path_name, libname->Buffer, L".dll", flags, &wm );
-- 
2.31.1




More information about the wine-devel mailing list