mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-26 04:22:50 -05:00
src: launcher: LogonCreateProcess: ImpersonateLoggedOnUser
This commit is contained in:
@@ -207,6 +207,10 @@ static BOOL LogonCreateProcess(
|
|||||||
Environment = EnvironmentBlock;
|
Environment = EnvironmentBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Success = ImpersonateLoggedOnUser(LogonToken);
|
||||||
|
if (!Success)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
Success = CreateProcessAsUserW(
|
Success = CreateProcessAsUserW(
|
||||||
LogonToken,
|
LogonToken,
|
||||||
ApplicationName,
|
ApplicationName,
|
||||||
@@ -220,6 +224,10 @@ static BOOL LogonCreateProcess(
|
|||||||
StartupInfo,
|
StartupInfo,
|
||||||
ProcessInformation);
|
ProcessInformation);
|
||||||
|
|
||||||
|
if (!RevertToSelf())
|
||||||
|
/* should not happen! */
|
||||||
|
ExitProcess(GetLastError());
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (!Success)
|
if (!Success)
|
||||||
LastError = GetLastError();
|
LastError = GetLastError();
|
||||||
|
Reference in New Issue
Block a user