include: Add support for NtCurrentTeb and PSDK compiler in 64-bit mode.

This commit is contained in:
Dmitry Timoshkov 2015-07-13 14:17:10 +08:00 committed by Alexandre Julliard
parent c3dd56c993
commit 770e15eef1
1 changed files with 6 additions and 0 deletions

View File

@ -2335,6 +2335,12 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
__asm__(".byte 0x65\n\tmovq (0x30),%0" : "=r" (teb));
return teb;
}
#elif defined(__x86_64__) && defined(_MSC_VER)
#pragma intrinsic(__readgsqword)
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
}
#else
extern struct _TEB * WINAPI NtCurrentTeb(void);
#endif