Maarten Lankhorst : include: Add NtCurrentTeb assembly for win64.
Alexandre Julliard
julliard at winehq.org
Mon Dec 1 07:34:21 CST 2008
Module: wine
Branch: master
Commit: e32bd2896b836effc35bdcb9d469815294ddb820
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e32bd2896b836effc35bdcb9d469815294ddb820
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Wed Nov 26 14:42:48 2008 +0100
include: Add NtCurrentTeb assembly for win64.
---
include/winnt.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/include/winnt.h b/include/winnt.h
index a1e9fe0..90c4d3b 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -2007,6 +2007,21 @@ extern inline struct _TEB * WINAPI NtCurrentTeb(void)
__asm mov teb, eax;
return teb;
}
+#elif defined(__x86_64__) && defined(__GNUC__)
+extern inline struct _TEB * WINAPI NtCurrentTeb(void)
+{
+ struct _TEB *teb;
+ __asm__(".byte 0x65\n\tmovq (0x30),%0" : "=r" (teb));
+ return teb;
+}
+#elif defined(__x86_64__) && defined (_MSC_VER)
+extern inline struct _TEB * WINAPI NtCurrentTeb(void)
+{
+ struct _TEB *teb;
+ __asm mov rax, gs:[0x30];
+ __asm mov teb, rax;
+ return teb;
+}
#else
extern struct _TEB * WINAPI NtCurrentTeb(void);
#endif
More information about the wine-cvs
mailing list