I'm writing a program to enumerate through processes, and I want to find out the SID/user ID and session of which the specified process is running under (i.e. i have a PID/handle to process, I want the SID and session it's running under). Any clues?
For the SID, call OpenProcess to get the handle, then pass the handle to GetSecurityInfo().
For the session id, use ProcessIdToSessionId().
2.1m questions
2.1m answers
60 comments
57.0k users