[ros-kernel] Thread termination

Ge van Geldorp ge at gse.nl
Mon Dec 15 19:46:02 CET 2003


When a thread is terminated, a win32k cleanup routine is called from
PiDeleteThread(). This cleanup routine runs in the context of some
system thread, not in the context of the terminating thread. This is
causing lots of problems for us win32k people. We have to drag a pointer
to the ETHREAD structure around whereever we go during the cleanup.
Today another problem appeared, where we're using PsGetCurrentThread()
at the moment but really want access to the ETHREAD structure of the
terminating thread. Currently, the PETHREAD we want is only available 6
subroutine levels above where we need it (TextIntRealizeFont <--
NtGdiSelectObject <-- NtGdiSetDCState <-- DceReleaseDC <--
DceFreeWindowDCE <-- IntDestroyWindow, TextIntRealizeFont wants the
pointer, IntDestroyWindow has it).

So, a request to the kernel people: is it possible to run the win32k
cleanup routine in the context of the terminating thread? Pretty please?

Gé van Geldorp.




More information about the Ros-kernel mailing list