Did you try expanding on kthread and related ethread; there has to be a tid some where in them. IIRC both PID and TID were there in some sub structure.
It’s in the _CLIENT_ID structure of the ETHREAD. But of course don’t use it because thisis an opaque structure that varies between plaforms. Instead use the PsGetThreadId function.
>my question is how can i get the thread ID from PKTRHREAD
Why a pointer to the thread is not sufficient and why do you need the thread
ID ? If you treat the pointer as an ID what difference does that make to you
? Do you only care about what process the thread belongs to ?
I think we have lost track of the original goal, which is to discover what
thread is holding a fast mutex and failing to release it.
joe
>my question is how can i get the thread ID from PKTRHREAD
Why a pointer to the thread is not sufficient and why do you need the
thread
ID ? If you treat the pointer as an ID what difference does that make to
you
? Do you only care about what process the thread belongs to ?
If this is just for debugging purposes and you’re after a quick way to get the thread ID outside the debugger, you can get the offset into the PETHREAD structure by looking at how PsGetCurrentThreadId does it