Long story short, I’m working on a .NET profiler that at one point gets a notification that a managed thread is running on a certain native kernel thread, which is not the currently executing thread. In this notification, I’m hoping to record a pointer in the TLS of the target thread. Again, that’s not the current thread.
I’m not seeing any TLS functions that would allow this type of rather unconventional behavior, but I was hoping somebody knew a trick.
You can get to it if you can get to the Thread Environment Block of the thread in question. You probably can’t though, especially in .Net land.