[NDK]
[reactos.git] / include / ndk / inline_ntcurrentteb.h
1 #ifndef _INLINE_NT_CURRENTTEB_H_
2 #define _INLINE_NT_CURRENTTEB_H_
3
4 #if defined(_M_IX86)
5 FORCEINLINE struct _TEB * NtCurrentTeb(void)
6 {
7 return (struct _TEB *)__readfsdword(0x18);
8 }
9 #elif defined(_M_ARM)
10
11 //
12 // NT-ARM is not documented
13 //
14 #include <armddk.h>
15
16 #elif defined(_M_AMD64)
17 FORCEINLINE struct _TEB * NtCurrentTeb(void)
18 {
19 return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
20 }
21 #elif defined(_M_PPC)
22 FORCEINLINE struct _TEB * NtCurrentTeb(void)
23 {
24 return (struct _TEB *)__readfsdword_winnt(0x18);
25 }
26 #else
27 #error Unsupported architecture
28 #endif
29
30 #endif//_INLINE_NT_CURRENTTEB_H_