Debugging Tools for Windows |
The GetCurrentThreadAddr function returns the location of the system data that describes the current thread.
VOID
GetCurrentThreadAddr(
DWORD Processor,
PULONG64 Address
);
In kernel-mode debugging, this is the index of a virtual thread, which is the index of a processor on the target computer.
None
In user-mode debugging, GetCurrentThreadAddr returns the location of the thread's Thread Environment Block (TEB). This is the same location that GetTebAddress returns.
In kernel-mode debugging, GetCurrentThreadAddr returns the location of the KTHREAD structure of the operating system thread that was executing on the processor when the last event occurred.
For details on the KTHREAD and TEB structures, see Microsoft Windows Internals by David Solomon and Mark Russinovich.
Headers: Defined in wdbgexts.h. If you are writing a WdbgExts extension, include wdbgexts.h. If you are writing a DbgEng extension that calls this function, include wdbgexts.h before dbgeng.h (see Writing DbgEng Extension Code for details).