This topic has not yet been rated - Rate this topic

_rdteb

Microsoft Specific

Reads the thread pointer register (IntR13) and returns its value, which is the base address of the current thread environment block (TEB).

void* _rdteb();

The thread pointer.

Intrinsic

Architecture

_rdteb

IPF

This routine is only available as an intrinsic.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Use NtCurrentTeb() for cross platform source code.

In WinNT.h

#ifdef _M_IA64
#define NtCurrentTeb() ((struct _TEB *)_rdtebex())
#if defined(_M_AMD64) && !defined(__midl)
__forceinline
struct _TEB *
NtCurrentTeb (
VOID
)
{
return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
}
#if defined(_M_IX86) && !defined(MIDL_PASS)
#define PcTeb 0x18
#if (_MSC_FULL_VER >= 13012035)
__inline struct _TEB * NtCurrentTeb( void ) { return (struct _TEB *) (ULONG_PTR) __readfsdword (PcTeb); }
#else
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning (disable:4035) // disable 4035 (function must return something)
__inline struct _TEB * NtCurrentTeb( void ) { __asm mov eax, fs:[PcTeb] }