properly set the access token in CreateProcessAsUser()
Modified: trunk/reactos/lib/advapi32/misc/logon.c
_____
Modified: trunk/reactos/lib/advapi32/misc/logon.c
--- trunk/reactos/lib/advapi32/misc/logon.c 2005-01-21 18:15:10 UTC
(rev 13191)
+++ trunk/reactos/lib/advapi32/misc/logon.c 2005-01-21 20:31:24 UTC
(rev 13192)
@@ -30,6 +30,7 @@
LPSTARTUPINFOA lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation)
{
+ PROCESS_ACCESS_TOKEN AccessToken;
NTSTATUS Status;
/* Create the process with a suspended main thread */
@@ -47,11 +48,14 @@
return FALSE;
}
+ AccessToken.Token = hToken;
+ AccessToken.Thread = NULL;
+
/* Set the new process token */
Status = NtSetInformationProcess (lpProcessInformation->hProcess,
ProcessAccessToken,
- (PVOID)&hToken,
- sizeof (HANDLE));
+ (PVOID)&AccessToken,
+ sizeof (AccessToken));
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
@@ -84,6 +88,7 @@
LPSTARTUPINFOW lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation)
{
+ PROCESS_ACCESS_TOKEN AccessToken;
NTSTATUS Status;
/* Create the process with a suspended main thread */
@@ -101,11 +106,14 @@
return FALSE;
}
+ AccessToken.Token = hToken;
+ AccessToken.Thread = NULL;
+
/* Set the new process token */
Status = NtSetInformationProcess (lpProcessInformation->hProcess,
ProcessAccessToken,
- (PVOID)&hToken,
- sizeof (HANDLE));
+ (PVOID)&AccessToken,
+ sizeof (AccessToken));
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));