mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
- 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:
parent
f0ae9e7e83
commit
ec8d684215
3 changed files with 4 additions and 6 deletions
|
@ -263,7 +263,6 @@ TryToStartShell(
|
|||
|
||||
StartAutoApplications(CSIDL_STARTUP);
|
||||
StartAutoApplications(CSIDL_COMMON_STARTUP);
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
return TRUE;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue