[PATCH 4/4] ntdll: Avoid taking loader lock in LdrGetDllHandle().

Alexandre Julliard julliard at winehq.org
Wed Nov 4 10:20:52 CST 2020


Paul Gofman <pgofman at codeweavers.com> writes:

> @@ -2267,12 +2267,17 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, void
>      NTSTATUS status;
>      HANDLE handle, mapping;
>  
> +    if (loaded_only)
> +        lock_ldr_data();
>      if ((*pwm = find_fullname_module( nt_name )))
>      {
>          NtUnmapViewOfSection( NtCurrentProcess(), *module );
>          *module = NULL;
> +        /* ldr_data_section to be unlocked by the caller. */

Not releasing the lock in the same scope is ugly and fragile, please try
to find a better way.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list