reactos/include/ndk/inline_ntcurrentteb.h
Cameron Gutman 2b82fe44ea [WLAN-BRINGUP]
- Create a branch to drop my ndisuio work

svn path=/branches/wlan-bringup/; revision=54809
2012-01-02 20:53:24 +00:00

31 lines
607 B
C

#ifndef _INLINE_NT_CURRENTTEB_H_
#define _INLINE_NT_CURRENTTEB_H_
#if defined(_M_IX86)
FORCEINLINE struct _TEB * NtCurrentTeb(void)
{
return (struct _TEB *)__readfsdword(0x18);
}
#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)
FORCEINLINE struct _TEB * NtCurrentTeb(void)
{
return (struct _TEB *)__readfsdword_winnt(0x18);
}
#else
#error Unsupported architecture
#endif
#endif//_INLINE_NT_CURRENTTEB_H_