- PspSetPrimaryToken: Fix some incorrect object dereferencing.

- WlxStartApplication: Fix handle leaks.
- Make userinit.exe exit when it's done everything. No need to wait for explorer to exit first.

svn path=/trunk/; revision=35013
This commit is contained in:
Jeffrey Morlan 2008-08-01 16:54:14 +00:00
parent f0ae9e7e83
commit ec8d684215
3 changed files with 4 additions and 6 deletions

View file

@ -263,7 +263,6 @@ TryToStartShell(
StartAutoApplications(CSIDL_STARTUP);
StartAutoApplications(CSIDL_COMMON_STARTUP);
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return TRUE;

View file

@ -247,6 +247,8 @@ WlxStartApplication(
CurrentDirectory,
&StartupInfo,
&ProcessInformation);
CloseHandle(ProcessInformation.hProcess);
CloseHandle(ProcessInformation.hThread);
CloseHandle(hAppToken);
if (!ret)
WARN("CreateProcessAsUserW() failed with error %lu\n", GetLastError());

View file

@ -255,7 +255,7 @@ PspSetPrimaryToken(IN PEPROCESS Process,
PreviousMode))
{
/* Failed, dereference */
if (TokenHandle) ObDereferenceObject(Token);
if (TokenHandle) ObDereferenceObject(NewToken);
return STATUS_PRIVILEGE_NOT_HELD;
}
}
@ -311,13 +311,10 @@ PspSetPrimaryToken(IN PEPROCESS Process,
STANDARD_RIGHTS_ALL |
PROCESS_SET_QUOTA);
}
/* Dereference the process */
ObDereferenceObject(Process);
}
/* Dereference the token */
if (Token) ObDereferenceObject(NewToken);
if (TokenHandle) ObDereferenceObject(NewToken);
return Status;
}