How to get thread stack information on Windows?
I enumerate all threads in a process through the CreateToolhelp32Snapshot function. I would like to get some basic stack information for each thread. More specifically I would like to get stack bottom address and if possible I would like to get current stack top address. Basically this is the information displayed with the ~*k command in WinDbg. So how can I obtain the stack information from the thread's ID or HANDLE? (Definitions can be found here .) To get stack boundaries: THREAD_BASIC_INFORMATION basicInfo; NT_TIB tib; // Get TEB address NtQueryInformationThread(YOUR_THREAD_HANDLE,