mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 16:25:43 +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_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;
|
||||||
|
|
|
@ -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());
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue