title: Get Window Station for a non-interactive user per process, user or session?
body: <p>When using CreateProcessAsUser we pass STARTUPINFO and with lpDesktop NULL, the target is winsta0/default, the interactive desktop of the interactive user.</p>
  
  <p>I wish to target a window station in another session of a second, non-interactive user, say a remote desktop user.</p>
  
  <p>I assume that it can't be winsta0 because that's reserved for the single interactive user.</p>
  
  <p>I am looking at the function list here:
  <a href="http://msdn.microsoft.com/en-us/library/ms687107(v=VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms687107(v=VS.85).aspx</a></p>
  
  <p>I can enumerate window stations on the machine, but how do I identify which window station is connected to which user/process/session?</p>
  
  <p>Each window station is connected to a session
  Each process has a target window station</p>
  
  <p>But how, for example if I have a process, or a session ID, do I determine which Window Station it is associated with?</p>