When f7332ab4a6e199d03e4318d82c0b16a0396b935c switched load_so_dll over to a proper Unix syscall, ntdll.so started providing the symbol __wine_unix_call_funcs.
When a DLL calls NtQueryVirtualMemory(MemoryWineUnixFuncs), it can do so speculatively, not knowing whether the corresponding unix lib actually does provide anything.
When ntdll.so started providing this symbol, then such speculative calls to NtQueryVirtualMemory(MemoryWineUnixFuncs) would end up returning ntdll's __wine_unix_call_funcs if the intended DLL's unix library lacked one.
This is the case with bcrypt, where the unix library doesn't provide __wine_unix_call_funcs if gnutls is unavailable.
This fixes crashes after f7332ab4a6e199d03e4318d82c0b16a0396b935c, in builds without gnutls.
Signed-off-by: Martin Storsjö martin@martin.st
-- v2: ntdll: Avoid accidentally picking up ntdll's __wine_unix_call_funcs for other DLLs
From: Martin Storsjö martin@martin.st
When f7332ab4a6e199d03e4318d82c0b16a0396b935c switched load_so_dll over to a proper Unix syscall, ntdll.so started providing the symbol __wine_unix_call_funcs.
When a DLL calls NtQueryVirtualMemory(MemoryWineUnixFuncs), it can do so speculatively, not knowing whether the corresponding unix lib actually does provide anything.
When ntdll.so started providing this symbol, then such speculative calls to NtQueryVirtualMemory(MemoryWineUnixFuncs) would end up returning ntdll's __wine_unix_call_funcs if the intended DLL's unix library lacked one.
This is the case with bcrypt, where the unix library doesn't provide __wine_unix_call_funcs if gnutls is unavailable.
This fixes crashes after f7332ab4a6e199d03e4318d82c0b16a0396b935c, in builds without gnutls.
Signed-off-by: Martin Storsjö martin@martin.st --- dlls/ntdll/unix/loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index f87e11f073c..dc566007eb6 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -2114,7 +2114,7 @@ static ULONG_PTR get_image_address(void) /*********************************************************************** * __wine_unix_call_funcs */ -const unixlib_entry_t __wine_unix_call_funcs[] = +const DECLSPEC_HIDDEN unixlib_entry_t __wine_unix_call_funcs[] = { load_so_dll, init_builtin_dll, @@ -2130,7 +2130,7 @@ static NTSTATUS wow64_unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESS /*********************************************************************** * __wine_unix_call_wow64_funcs */ -const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +const DECLSPEC_HIDDEN unixlib_entry_t __wine_unix_call_wow64_funcs[] = { wow64_load_so_dll, wow64_init_builtin_dll,