The _ _rdthread intrinsic has the following declaration:
void *__rdthread(void);
This intrinsic function executes a CALL_PAL RDTHREAD (Read Current Thread) instruction. The return value is the thread object address for the currently executing thread on the current processor.
This intrinsic may only be executed in kernel mode.