mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
- Added a missing dereferencing in NtTerminateProcess.
- Don't access already freed memory while sending messages to the termination port (in PspExitThread). svn path=/trunk/; revision=15700
This commit is contained in:
parent
9029590177
commit
63843d944f
1 changed files with 7 additions and 7 deletions
|
@ -266,19 +266,18 @@ PspExitThread(NTSTATUS ExitStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process the Termination Ports */
|
/* Process the Termination Ports */
|
||||||
TerminationPort = CurrentThread->TerminationPort;
|
while ((TerminationPort = CurrentThread->TerminationPort)) {
|
||||||
DPRINT("TerminationPort: %p\n", TerminationPort);
|
|
||||||
while (TerminationPort) {
|
DPRINT("TerminationPort: %p\n", TerminationPort);
|
||||||
|
|
||||||
|
/* Get the next one */
|
||||||
|
CurrentThread->TerminationPort = TerminationPort->Next;
|
||||||
|
|
||||||
/* Send the LPC Message */
|
/* Send the LPC Message */
|
||||||
LpcSendTerminationPort(TerminationPort->Port, CurrentThread->CreateTime);
|
LpcSendTerminationPort(TerminationPort->Port, CurrentThread->CreateTime);
|
||||||
|
|
||||||
/* Free the Port */
|
/* Free the Port */
|
||||||
ExFreePool(TerminationPort);
|
ExFreePool(TerminationPort);
|
||||||
|
|
||||||
/* Get the next one */
|
|
||||||
TerminationPort = TerminationPort->Next;
|
|
||||||
DPRINT("TerminationPort: %p\n", TerminationPort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rundown Win32 Structures */
|
/* Rundown Win32 Structures */
|
||||||
|
@ -463,6 +462,7 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
|
||||||
if(Process->ExitTime.QuadPart != 0)
|
if(Process->ExitTime.QuadPart != 0)
|
||||||
{
|
{
|
||||||
PsUnlockProcess(Process);
|
PsUnlockProcess(Process);
|
||||||
|
ObDereferenceObject(Process);
|
||||||
return STATUS_PROCESS_IS_TERMINATING;
|
return STATUS_PROCESS_IS_TERMINATING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue