Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Thread Session ID

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.

like image 636
user37875 Avatar asked Mar 19 '26 17:03

user37875


1 Answers

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.

like image 106
Michael Avatar answered Mar 22 '26 13:03

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!