mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 06:27:38 +00:00
Move the process object dereference from NtTerminateProcess to PspExitProcess (comments inside).
svn path=/trunk/; revision=14257
This commit is contained in:
parent
49b1d66ec3
commit
8c984877c4
|
@ -390,6 +390,10 @@ PspExitProcess(PEPROCESS Process)
|
||||||
|
|
||||||
ObKillProcess(Process);
|
ObKillProcess(Process);
|
||||||
KeSetProcess(&Process->Pcb, IO_NO_INCREMENT);
|
KeSetProcess(&Process->Pcb, IO_NO_INCREMENT);
|
||||||
|
|
||||||
|
/* NOTE: This dereference corresponds to reference in NtTerminateProcess. */
|
||||||
|
ObDereferenceObject(Process);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,8 +443,13 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
|
||||||
/* Only master thread remains... kill it off */
|
/* Only master thread remains... kill it off */
|
||||||
if (PsGetCurrentThread()->ThreadsProcess == Process) {
|
if (PsGetCurrentThread()->ThreadsProcess == Process) {
|
||||||
|
|
||||||
/* Unlock and dereference */
|
/*
|
||||||
ObDereferenceObject(Process);
|
* NOTE: Dereferencing of the Process structure takes place in
|
||||||
|
* PspExitProcess. If we would do it here the Win32 Process
|
||||||
|
* information would be destroyed before the Win32 Destroy
|
||||||
|
* thread/process callback is called.
|
||||||
|
*/
|
||||||
|
|
||||||
PspExitThread(ExitStatus);
|
PspExitThread(ExitStatus);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue