- 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_STARTUP);
StartAutoApplications(CSIDL_COMMON_STARTUP); StartAutoApplications(CSIDL_COMMON_STARTUP);
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
return TRUE; return TRUE;

View file

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

View file

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