mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:23:14 +00:00
[SDK:NDK/XDK] Sync NtCurrentTeb() definitions between NDK and PSDK winnt.h (#6542)
The definitions in the NDK inline_ntcurrentteb.h and psfuncs.h files are synced togther with those of winnt.h (in the winnt_old.h generator file). See commitsc1929445d
(r49627) and925c587c8
(r56318). IMPORTANT NOTE: The ARM64 definition does not exist yet in our headers!
This commit is contained in:
parent
cec7adb97f
commit
352b7f6785
3 changed files with 47 additions and 37 deletions
|
@ -420,15 +420,23 @@ NtCreateThread(
|
|||
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
|
||||
{
|
||||
#if defined(_M_IX86)
|
||||
return (PTEB)__readfsdword(0x18);
|
||||
return (struct _TEB *)__readfsdword(0x18);
|
||||
#elif defined (_M_AMD64)
|
||||
return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
|
||||
#elif defined (_M_ARM)
|
||||
return (struct _TEB *)KeGetPcr()->Used_Self;
|
||||
// return (struct _TEB *)KeGetPcr()->Used_Self;
|
||||
return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRURW);
|
||||
#elif defined (_M_ARM64)
|
||||
//UNIMPLEMENTED;
|
||||
return 0;
|
||||
// #elif defined(_M_PPC)
|
||||
// return (struct _TEB *)_read_teb_dword(0x18);
|
||||
#else
|
||||
#error Unsupported architecture
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
struct _TEB * NtCurrentTeb(void);
|
||||
struct _TEB * NtCurrentTeb(VOID);
|
||||
#endif
|
||||
|
||||
NTSYSCALLAPI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue