[CMAKE]
[reactos.git] / include / psdk / winnt.h
index 1606cd0..50dbd6b 100644 (file)
@@ -5086,43 +5086,6 @@ static __inline__ PVOID GetCurrentFiber(void)
 }
 #endif
 
-#if defined(_M_IX86)
-extern __inline__ struct _TEB * NtCurrentTeb(void)
-{
-    struct _TEB *ret;
-
-    __asm__ __volatile__ (
-        "movl %%fs:0x18, %0\n"
-        : "=r" (ret)
-        : /* no inputs */
-    );
-
-    return ret;
-}
-#elif defined(_M_ARM)
-
-//
-// NT-ARM is not documented
-//
-#include <armddk.h>
-
-#elif defined(_M_AMD64)
-FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
-{
-    return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
-}
-#elif defined(_M_PPC)
-extern __inline__ struct _TEB * NtCurrentTeb(void)
-{
-    return __readfsdword_winnt(0x18);
-}
-#else
-extern __inline__ struct _TEB * NtCurrentTeb(void)
-{
-    return __readfsdword_winnt(0x18);
-}
-#endif
-
 #elif defined(__WATCOMC__)
 
 extern PVOID GetCurrentFiber(void);
@@ -5131,18 +5094,11 @@ extern PVOID GetCurrentFiber(void);
         value [eax] \
         modify [eax];
 
-extern struct _TEB * NtCurrentTeb(void);
-#pragma aux NtCurrentTeb = \
-        "mov   eax, dword ptr fs:0x18" \
-        value [eax] \
-        modify [eax];
-
 #elif defined(_MSC_VER)
 
 #if (_MSC_FULL_VER >= 13012035)
 
 __inline PVOID GetCurrentFiber(void) { return (PVOID)(ULONG_PTR)__readfsdword(0x10); }
-__inline struct _TEB * NtCurrentTeb(void) { return (struct _TEB *)(ULONG_PTR)__readfsdword(0x18); }
 
 #else
 
@@ -5154,18 +5110,12 @@ static __inline PVOID GetCurrentFiber(void)
     return p;
 }
 
-static __inline struct _TEB * NtCurrentTeb(void)
-{
-    struct _TEB *p;
-       __asm mov eax, fs:[18h]
-       __asm mov [p], eax
-    return p;
-}
-
 #endif /* _MSC_FULL_VER */
 
 #endif /* __GNUC__/__WATCOMC__/_MSC_VER */
 
+#include "inline_ntcurrentteb.h"
+
 static __inline PVOID GetFiberData(void)
 {
        return *((PVOID *)GetCurrentFiber());