views:

149

answers:

1

How could I start a thread in a different session? I need to start a thread in the interactive session (session 1) from a service in the non-interactive session (session 0). I have done this with a process before by using SetTokenInFormation and DuplicateTokenEx and then passing this to CreateProcessAsUser. I was hoping I could do the same thing except use SetThreadToken instead of CreateProcessAsUser. Thanks in advance for the help!

+1  A: 

Threads don't belong to sessions, processes do. You'll need to create a process in the other session to host the thread you want.

Michael
Thank you very much!