ntdll: For Mac 64-bit, poke NtCurrentTeb()->ThreadLocalStoragePointer to the…
ntdll: For Mac 64-bit, poke NtCurrentTeb()->ThreadLocalStoragePointer to the corresponding offset from %gs.
64-bit Windows apps have hard-coded accesses to %gs:0x58 baked into them. They
need to find the ThreadLocalStoragePointer there.
Technically, the gsbase register and the memory it points to belong to the
pthread implementation on macOS. It's used for the pthread TLS implementation.
Slot 11 (offset 0x58) is currently used for the implementation of the ttyname()
system library function. We do not anticipate that Wine or any of the system
libraries or frameworks it uses will call ttyname(). Furthermore, Apple has
made it so that future releases of macOS will no longer use that slot. So, we
hijack it for our purposes.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Showing
Please
register
or
sign in
to comment