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

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 14 09:42:25 CDT 2015


Module: wine
Branch: master
Commit: 770e15eef1aee5f9cf0096be92c3d95623b260aa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=770e15eef1aee5f9cf0096be92c3d95623b260aa

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Jul 13 14:17:10 2015 +0800

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

---

 include/winnt.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/winnt.h b/include/winnt.h
index 68a33f3..a1116bd 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -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




More information about the wine-cvs mailing list