ReactOS
0.4.17-dev-1343-g8fe3cee
Functions
inline_ntcurrentteb.h File Reference
Go to the source code of this file.
Functions
FORCEINLINE
struct
_TEB
*
NtCurrentTeb
(
VOID
)
Function Documentation
◆
NtCurrentTeb()
FORCEINLINE
struct
_TEB
* NtCurrentTeb
(
VOID
)
Definition at line
8
of file
inline_ntcurrentteb.h
.
9
{
10
#if defined(_M_IX86)
11
return
(
struct
_TEB
*)
__readfsdword
(0x18);
12
#elif defined(_M_AMD64)
13
return
(
struct
_TEB
*)__readgsqword(
FIELD_OFFSET
(
NT_TIB
, Self));
14
#elif defined(_M_ARM)
15
// return (struct _TEB *)KeGetPcr()->Used_Self;
16
return
(
struct
_TEB
*)(
ULONG_PTR
)_MoveFromCoprocessor(
CP15_TPIDRURW
);
17
#elif defined (_M_ARM64)
18
return
(
struct
_TEB
*)
__readx18qword
(
FIELD_OFFSET
(
NT_TIB
, Self));
19
// #elif defined(_M_PPC)
20
// return (struct _TEB *)_read_teb_dword(0x18);
21
#else
22
#error Unsupported architecture
23
#endif
24
}
ULONG_PTR
#define ULONG_PTR
Definition:
config.h:101
__readx18qword
__INTRIN_INLINE unsigned __int64 __readx18qword(unsigned long offset)
Definition:
intrin_arm64.h:809
__readfsdword
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
Definition:
intrin_ppc.h:382
CP15_TPIDRURW
#define CP15_TPIDRURW
Definition:
ketypes.h:131
_NT_TIB
Definition:
compat.h:710
_TEB
Definition:
compat.h:836
FIELD_OFFSET
#define FIELD_OFFSET(t, f)
Definition:
typedefs.h:255
sdk
include
ndk
inline_ntcurrentteb.h
Generated on Wed Nov 11 2026 06:33:52 for ReactOS by
1.9.6