Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change running process session ID and lpDesktop?

After building a service that launches an interactive processes in a user's session via CreateProcessAsUser and lpDesktop specified in STARTUPINFO -- is it possible to change the session that a process is executing in on the fly?

So if we have notepad running in Session 1 and another user logged onto the same machine in Session 2, can we change Notepad's ProcessId from 1 to 2? I understand the well-followed and sane way to accomplish this is to just start notepad in Session 2, but can we use API calls to make it happen?

By the way I'm writing in C# but am entirely comfortable using pInvoke or low level languages.

like image 891
cvocvo Avatar asked Mar 15 '12 15:03

cvocvo


1 Answers

It is not possible to move a running process from one session to another.

like image 150
David Heffernan Avatar answered Nov 06 '22 11:11

David Heffernan