src: launcher: LogonCreateProcess: ImpersonateLoggedOnUser

This commit is contained in:
Bill Zissimopoulos 2017-12-09 17:45:10 -08:00
parent 42e01a9b27
commit ea873ece22
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -207,6 +207,10 @@ static BOOL LogonCreateProcess(
Environment = EnvironmentBlock;
}
Success = ImpersonateLoggedOnUser(LogonToken);
if (!Success)
goto exit;
Success = CreateProcessAsUserW(
LogonToken,
ApplicationName,
@ -220,6 +224,10 @@ static BOOL LogonCreateProcess(
StartupInfo,
ProcessInformation);
if (!RevertToSelf())
/* should not happen! */
ExitProcess(GetLastError());
exit:
if (!Success)
LastError = GetLastError();