Change some FS:x reading macros for better compatibility with MSVC compiler and move...
[reactos.git] / reactos / w32api / include / winnt.h
index c780ec7..36432ef 100644 (file)
@@ -3609,6 +3609,16 @@ extern struct _TEB * NtCurrentTeb(void);
 
 #elif defined(_MSC_VER)
 
+#if (_MSC_FULL_VER >= 13012035)
+
+DWORD __readfsdword(DWORD);
+#pragma intrinsic(__readfsdword)
+
+__inline PVOID GetCurrentFiber(void) { return (PVOID)(ULONG_PTR)__readfsdword(0x10); }
+__inline struct _TEB * NtCurrentTeb(void) { return (PVOID)(ULONG_PTR)__readfsdword(0x18); }
+
+#else
+
 static __inline PVOID GetCurrentFiber(void)
 {
     PVOID p;
@@ -3625,6 +3635,8 @@ static __inline struct _TEB * NtCurrentTeb(void)
     return p;
 }
 
+#endif /* _MSC_FULL_VER */
+
 #endif /* __GNUC__/__WATCOMC__/_MSC_VER */
 
 static __inline PVOID GetFiberData(void)