I am running a program in SYSTEM user context and want to user StartProcessAsCurrentUser to initiate a new instance of the same program but in logged-in user context. When I call StartProcessCurrentUser, "StartProcessAsCurrentUser: CreateProcessAsUser failed." error is raised and quitting. What could be wrong?
I am obtaining a user token with the code below and passing it to CreateProcessAsUser:
hUserToken = WindowsIdentity.GetCurrent().Token;
I am running a program in SYSTEM user context and want to user StartProcessAsCurrentUser to initiate a new instance of the same program but in logged-in user context. When I call StartProcessCurrentUser, "StartProcessAsCurrentUser: CreateProcessAsUser failed." error is raised and quitting. What could be wrong? I am obtaining a user token with the code below and passing it to CreateProcessAsUser: hUserToken = WindowsIdentity.GetCurrent().Token;