windows - Official way to get the Thread Information/Environment Block (TIB/TEB) -
in windows, it's long been common, if undocumented, knowledge thread information block (tib) of current thread can found @ fs:0. works on intel cpus, fs register exists in first place. wanna tib on arm-based windows system (windows phone , maybe windows rt). there api that, please?
edit: want thread stack base crash reporting purposes.
information tib/teb: http://www.microsoft.com/msj/archive/s2ce.aspx
the macro ntcurrentteb()
available in winnt.h
supported architectures, including arm (windows rt):
#if defined(_m_arm) && !defined(__midl) && !defined(_m_cee_pure) __forceinline struct _teb * ntcurrentteb ( void ) { return (struct _teb *)(ulong_ptr)_movefromcoprocessor(cp15_tpidrurw); }