From: Jacek Caban Subject: [PATCH 3/4] include: Add MSVC ARM version of NtCurrentTeb. Message-Id: <3aee74a6-72a5-765f-f75a-e7213126e649@codeweavers.com> Date: Fri, 26 Feb 2021 15:55:26 +0100 Signed-off-by: Jacek Caban --- With that headers seem good enough for ARM MSVC builds, but many modules will not link due to missing 64-bit integer support functions. include/winnt.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index e594c89419a..e19f515eddb 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2815,6 +2815,12 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) __asm__("mrc p15, 0, %0, c13, c0, 2" : "=r" (teb)); return teb; } +#elif defined(__arm__) && defined(_MSC_VER) +#pragma intrinsic(_MoveFromCoprocessor) +static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) +{ + return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(15, 0, 13, 0, 2); +} #else extern struct _TEB * WINAPI NtCurrentTeb(void); #endif