- 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:
Hartmut Birr 2005-03-17 18:51:20 +00:00
parent a392c38668
commit 100f53e3ab
2 changed files with 20 additions and 13 deletions

View file

@ -329,11 +329,6 @@ PiTerminateProcess(PEPROCESS Process,
}
ObDeleteHandleTable(Process);
if(Process->UniqueProcessId != NULL)
{
PsDeleteCidHandle(Process->UniqueProcessId, PsProcessType);
}
if (Process != CurrentProcess)
{
KeDetachProcess();

View file

@ -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);
}