mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
- Moved the deleting of the process id from PiTerminateProcess to PiDeleteProcessWorker.
- Checked the status at the end of NtOpenProcessTokenEx. svn path=/trunk/; revision=14162
This commit is contained in:
parent
a392c38668
commit
100f53e3ab
2 changed files with 20 additions and 13 deletions
|
@ -329,11 +329,6 @@ PiTerminateProcess(PEPROCESS Process,
|
|||
}
|
||||
|
||||
ObDeleteHandleTable(Process);
|
||||
if(Process->UniqueProcessId != NULL)
|
||||
{
|
||||
PsDeleteCidHandle(Process->UniqueProcessId, PsProcessType);
|
||||
}
|
||||
|
||||
if (Process != CurrentProcess)
|
||||
{
|
||||
KeDetachProcess();
|
||||
|
|
|
@ -243,15 +243,23 @@ NtOpenProcessTokenEx(
|
|||
&hToken);
|
||||
ObDereferenceObject(Token);
|
||||
|
||||
_SEH_TRY
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
*TokenHandle = hToken;
|
||||
|
||||
_SEH_TRY
|
||||
{
|
||||
*TokenHandle = hToken;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END;
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
NtClose(hToken);
|
||||
}
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END;
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
@ -518,6 +526,11 @@ PiDeleteProcessWorker(PVOID pContext)
|
|||
KeDetachProcess();
|
||||
}
|
||||
|
||||
if(Process->UniqueProcessId != NULL)
|
||||
{
|
||||
PsDeleteCidHandle(Process->UniqueProcessId, PsProcessType);
|
||||
}
|
||||
|
||||
MmReleaseMmInfo(Process);
|
||||
if (Context->IsWorkerQueue)
|
||||
{
|
||||
|
@ -1371,7 +1384,6 @@ NtOpenProcess(OUT PHANDLE ProcessHandle,
|
|||
DPRINT("NtOpenProcess() = STATUS_UNSUCCESSFUL\n");
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue