[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 commits c1929445d (r49627) and 925c587c8 (r56318).

IMPORTANT NOTE: The ARM64 definition does not exist yet in our headers!
This commit is contained in:
Hermès Bélusca-Maïto 2024-02-23 22:58:06 +01:00
parent cec7adb97f
commit 352b7f6785
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 47 additions and 37 deletions

View file

@ -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