Because of a race during the shutdown of an application I work on, I want to control deletion of a thread that is in a third party library which does have a proper shutdown implemented. I know we need to fix this in the third party library, but for now I want to continue and solve the issue.
The thread is created using CreateThread. In the lpParameter a struct is supplied which contains the name of the thread. There are multiple threads created, so I want to iterate over the threads and find the thread by name in the struct.
Is it possible to list all threads for the current process and filter on the parameter with which the thread was created?