Author: tfaber Date: Fri Feb 20 12:04:57 2015 New Revision: 66369
URL: http://svn.reactos.org/svn/reactos?rev=66369&view=rev Log: [NTOS:PS] - In PspExitThread, correctly set the ZeroInit field of the message before calling LpcRequestPort (which would otherwise complain with STATUS_INVALID_PARAMETER and fail to send the message) - In NtRegisterThreadTerminatePort, dereference the port object in case of failure, not a null pointer CORE-9234 #resolve
Modified: trunk/reactos/ntoskrnl/ps/kill.c
Modified: trunk/reactos/ntoskrnl/ps/kill.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=6636... ============================================================================== --- trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] Fri Feb 20 12:04:57 2015 @@ -696,11 +696,11 @@ * port, which means that it died before being fully created. Since we * still have to notify an LPC Server, we'll use the exception port, * which we know exists. However, we need to know how far the thread - * actually got created. We have three possibilites: + * actually got created. We have three possibilities: * * - NtCreateThread returned an error really early: DeadThread is set. * - NtCreateThread managed to create the thread: DeadThread is off. - * - NtCreateThread was creating the thread (with Deadthread set, + * - NtCreateThread was creating the thread (with DeadThread set, * but the thread got killed prematurely: STATUS_THREAD_IS_TERMINATING * is our exit code.) * @@ -709,6 +709,7 @@ */
/* Setup the message header */ + TerminationMsg.h.u2.ZeroInit = 0; TerminationMsg.h.u2.s2.Type = LPC_CLIENT_DIED; TerminationMsg.h.u1.s1.TotalLength = sizeof(TerminationMsg); TerminationMsg.h.u1.s1.DataLength = sizeof(TerminationMsg) - @@ -1202,7 +1203,7 @@ if (!ExAcquireRundownProtection(&Process->RundownProtect)) { /* Failed to lock, fail */ - ObDereferenceObject (Process); + ObDereferenceObject(Process); return STATUS_PROCESS_IS_TERMINATING; }
@@ -1372,6 +1373,6 @@ }
/* Dereference and Fail */ - ObDereferenceObject(TerminationPort); + ObDereferenceObject(TerminationLpcPort); return STATUS_INSUFFICIENT_RESOURCES; }