Is there a way to get a notification that the thread is no longer working (returned) in your application?
I know this is possible in kernel mode (using PsSetCreateThreadNotifyRoutine), but is there any way to find this out from user mode using only the Win32 API?
The problem is that I cannot control the code in the stream, because my module is part of the library. Creating a driver for monitoring the system will not be too complicated, but it is annoying for users to install the driver even for the base application that uses my library.
My code uses TLS storage, and on Linux / Unix pthread_key_create can take a pointer to a function that is called when the thread is destroyed. But TlsAlloc (Windows) has nothing of the kind ...
Thanks in advance!
source share