'Creating process with elevated privileges using CreateProcessAsUserW from system service
I'm trying to launch a process from a system service using the token handle of the currently active user with elevated privileges (if user is in admin. group). My current attempt looks like this:
- I'm getting the active session ID using
WTSEnumerateSessionsW. - I'm getting the user token handle using
WTSQueryUserToken. - I'm verifiying that the user is in the administrators group.
- ???
- Launch the process with the user token using
CreateProcessAsUserW
How do I need to modify the token so that the process will have elevated privileges? I'm aware that similar questions have been asked already, but none of them contain properly explained answers.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
