ntdll: Avoid accidentally picking up ntdll's __wine_unix_call_funcs for other DLLs.
commitd6829bdcbabd5e1a32a2585604eb0aa96b2a6271
authorMartin Storsjö <martin@martin.st>
Wed, 23 Nov 2022 12:41:14 +0000 (23 14:41 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 23 Nov 2022 19:35:06 +0000 (23 20:35 +0100)
treefed2db110c75a86c9e507b007abdc15431ba4058
parentc2a43defec3efca05d38cd83ffa53412766fdc80
ntdll: Avoid accidentally picking up ntdll's __wine_unix_call_funcs for other DLLs.

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/unix_private.h