mirror of
https://github.com/reactos/reactos.git
synced 2024-08-01 09:01:13 +00:00
[ADVAPI32]
CreateProcessAsUserA/W: Make hToken optional. svn path=/trunk/; revision=70478
This commit is contained in:
parent
42fdef7ea4
commit
94a6bf4cf5
|
@ -125,20 +125,23 @@ CreateProcessAsUserA(HANDLE hToken,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessToken.Token = hToken;
|
if (hToken != NULL)
|
||||||
AccessToken.Thread = NULL;
|
|
||||||
|
|
||||||
/* Set the new process token */
|
|
||||||
Status = NtSetInformationProcess(lpProcessInformation->hProcess,
|
|
||||||
ProcessAccessToken,
|
|
||||||
(PVOID)&AccessToken,
|
|
||||||
sizeof(AccessToken));
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
{
|
||||||
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
AccessToken.Token = hToken;
|
||||||
TerminateProcess(lpProcessInformation->hProcess, Status);
|
AccessToken.Thread = NULL;
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
|
||||||
return FALSE;
|
/* Set the new process token */
|
||||||
|
Status = NtSetInformationProcess(lpProcessInformation->hProcess,
|
||||||
|
ProcessAccessToken,
|
||||||
|
(PVOID)&AccessToken,
|
||||||
|
sizeof(AccessToken));
|
||||||
|
if (!NT_SUCCESS (Status))
|
||||||
|
{
|
||||||
|
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
||||||
|
TerminateProcess(lpProcessInformation->hProcess, Status);
|
||||||
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resume the main thread */
|
/* Resume the main thread */
|
||||||
|
@ -190,20 +193,23 @@ CreateProcessAsUserW(HANDLE hToken,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessToken.Token = hToken;
|
if (hToken != NULL)
|
||||||
AccessToken.Thread = NULL;
|
|
||||||
|
|
||||||
/* Set the new process token */
|
|
||||||
Status = NtSetInformationProcess(lpProcessInformation->hProcess,
|
|
||||||
ProcessAccessToken,
|
|
||||||
(PVOID)&AccessToken,
|
|
||||||
sizeof(AccessToken));
|
|
||||||
if (!NT_SUCCESS (Status))
|
|
||||||
{
|
{
|
||||||
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
AccessToken.Token = hToken;
|
||||||
TerminateProcess(lpProcessInformation->hProcess, Status);
|
AccessToken.Thread = NULL;
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
|
||||||
return FALSE;
|
/* Set the new process token */
|
||||||
|
Status = NtSetInformationProcess(lpProcessInformation->hProcess,
|
||||||
|
ProcessAccessToken,
|
||||||
|
(PVOID)&AccessToken,
|
||||||
|
sizeof(AccessToken));
|
||||||
|
if (!NT_SUCCESS (Status))
|
||||||
|
{
|
||||||
|
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
||||||
|
TerminateProcess(lpProcessInformation->hProcess, Status);
|
||||||
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resume the main thread */
|
/* Resume the main thread */
|
||||||
|
|
Loading…
Reference in a new issue