NTSTATUS Status = STATUS_NOTHING_TO_TERMINATE;
PAGED_CODE();
PSTRACE(PS_KILL_DEBUG,
- "Process: %p ExitStatus: %p\n", Process, ExitStatus);
+ "Process: %p ExitStatus: %d\n", Process, ExitStatus);
PSREFTRACE(Process);
/* Check if this is a Critical Process */
do
{
/* Write magic value and return the next entry to process */
- NextEntry = InterlockedExchangePointer(&PspReaperListHead.Flink,
+ NextEntry = InterlockedExchangePointer((PVOID*)&PspReaperListHead.Flink,
(PVOID)1);
ASSERT((NextEntry != NULL) && (NextEntry != (PVOID)1));
} while ((NextEntry != NULL) && (NextEntry != (PVOID)1));
/* Remove magic value, keep looping if it got changed */
- } while (InterlockedCompareExchangePointer(&PspReaperListHead.Flink,
+ } while (InterlockedCompareExchangePointer((PVOID*)&PspReaperListHead.Flink,
0,
(PVOID)1) != (PVOID)1);
}
#if DBG
VOID
NTAPI
-PspCheckProcessList()
+PspCheckProcessList(VOID)
{
PLIST_ENTRY Entry;
if (Process->SeAuditProcessCreationInfo.ImageFileName)
{
/* Free it */
- ExFreePool(Process->SeAuditProcessCreationInfo.ImageFileName);
+ ExFreePoolWithTag(Process->SeAuditProcessCreationInfo.ImageFileName,
+ TAG_SEPA);
Process->SeAuditProcessCreationInfo.ImageFileName = NULL;
}
PKAPC Apc;
PTOKEN PrimaryToken;
PAGED_CODE();
- PSTRACE(PS_KILL_DEBUG, "ExitStatus: %p\n", ExitStatus);
+ PSTRACE(PS_KILL_DEBUG, "ExitStatus: %d\n", ExitStatus);
/* Get the Current Thread and Process */
Thread = PsGetCurrentThread();
NextPort = TerminationPort->Next;
/* Free the Termination Port Object */
- ExFreePool(TerminationPort);
+ ExFreePoolWithTag(TerminationPort, '=TsP');
/* Keep looping as long as there is a port */
TerminationPort = NextPort;
* 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.)
*
*/
/* 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) -
if (Apc->SystemArgument2)
{
/* Free the APC */
- Status = (NTSTATUS)Apc->NormalContext;
+ Status = PtrToUlong(Apc->NormalContext);
PspExitApcRundown(Apc);
/* Terminate the Thread */
NTSTATUS Status = STATUS_SUCCESS;
ULONG Flags;
PAGED_CODE();
- PSTRACE(PS_KILL_DEBUG, "Thread: %p ExitStatus: %p\n", Thread, ExitStatus);
+ PSTRACE(PS_KILL_DEBUG, "Thread: %p ExitStatus: %d\n", Thread, ExitStatus);
PSREFTRACE(Thread);
/* Check if this is a Critical Thread, and Bugcheck */
PspExitApcRundown,
PspExitNormalApc,
KernelMode,
- (PVOID)ExitStatus);
+ UlongToPtr(ExitStatus));
/* Insert it into the APC Queue */
if (!KeInsertQueueApc(Apc, Apc, NULL, 2))
NTAPI
PspIsProcessExiting(IN PEPROCESS Process)
{
- return Process->Flags & PSF_PROCESS_EXITING_BIT;
+ return Process->Flags & PSF_PROCESS_EXITING_BIT;
}
VOID
ULONG Actual;
PAGED_CODE();
PSTRACE(PS_KILL_DEBUG,
- "LastThread: %p Process: %p\n", LastThread, Process);
+ "LastThread: %u Process: %p\n", LastThread, Process);
PSREFTRACE(Process);
/* Set Process Exit flag */
BOOLEAN KillByHandle;
PAGED_CODE();
PSTRACE(PS_KILL_DEBUG,
- "ProcessHandle: %p ExitStatus: %p\n", ProcessHandle, ExitStatus);
+ "ProcessHandle: %p ExitStatus: %d\n", ProcessHandle, ExitStatus);
/* Were we passed a process handle? */
if (ProcessHandle)
if (!ExAcquireRundownProtection(&Process->RundownProtect))
{
/* Failed to lock, fail */
- ObDereferenceObject (Process);
+ ObDereferenceObject(Process);
return STATUS_PROCESS_IS_TERMINATING;
}
NTSTATUS Status;
PAGED_CODE();
PSTRACE(PS_KILL_DEBUG,
- "ThreadHandle: %p ExitStatus: %p\n", ThreadHandle, ExitStatus);
+ "ThreadHandle: %p ExitStatus: %d\n", ThreadHandle, ExitStatus);
/* Handle the special NULL case */
if (!ThreadHandle)
}
/* Dereference and Fail */
- ObDereferenceObject(TerminationPort);
+ ObDereferenceObject(TerminationLpcPort);
return STATUS_INSUFFICIENT_RESOURCES;
}