Closed graemekelly closed 6 years ago
We used that older way to set a thread name before the new API in our code but as far as I could figure out, it was only available inside the debugger. I had a quick search there but can't see any way that we could add code to read it. Otherwise I would be happy to add something in for this too.
it was only available inside the debugger
Yes, that's right. Theoretically, Very Sleepy could capture it if the program would set it while it was being profiled. There is some code for "debugging", for the purpose of profiling new threads as they are created, however it is not currently finished, so it would take some work to get it that far.
Thank you for submitting this improvement.
Find if GetThreadDescription() is available in Kernel32.dll (it's available from the Win10 Creators update onwards). If it is, add another column "Thread Name" to the list of threads shown when selecting which thread(s) to profile. If this function is unavailable, don't show this extra column at all. If it is available, we rely on the application being profiled to have called SetThreadDescription(), but if it has not, we just show "-" instead.