I am trying to get the name of the winstation (for example "winsta0") that a separate process has opened using only its Process ID. I can't find anything that does this on MSDN. They only seem to have GetProcessWindowStation() which only works for your own process.
Any ideas?
UPDATE: Maybe this is part of the puzzle...
BOOL ProcessIdToSessionId( __in DWORD dwProcessId, __out DWORD *pSessionId );