/* GLOBALS *******************************************************************/
-LIST_ENTRY PspReaperListHead = {0};
+LIST_ENTRY PspReaperListHead = { NULL, NULL };
WORK_QUEUE_ITEM PspReaperWorkItem;
LARGE_INTEGER ShortTime = {{-10 * 100 * 1000, -1}};
do
{
/* Write magic value and return the next entry to process */
- NextEntry = InterlockedExchangePointer((PVOID*)&PspReaperListHead.Flink,
+ NextEntry = InterlockedExchangePointer(&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((PVOID*)&PspReaperListHead.Flink,
- (PVOID)0,
- (PVOID)1) != (PVOID)1);
+ } while (InterlockedCompareExchangePointer(&PspReaperListHead.Flink,
+ 0,
+ 1) != (PVOID)1);
}
VOID
Process->SectionObject = NULL;
}
- /* Clean LDT and VDM_OBJECTS */
+#if defined(_X86_)
+ /* Clean Ldt and Vdm objects */
PspDeleteLdt(Process);
PspDeleteVdmObjects(Process);
+#endif
/* Delete the Object Table */
if (Process->ObjectTable)
PEPROCESS CurrentProcess;
PETHREAD Thread, OtherThread, PreviousThread = NULL;
PVOID DeallocationStack;
- ULONG_PTR Dummy;
+ ULONG Dummy;
BOOLEAN Last = FALSE;
PTERMINATION_PORT TerminationPort, NextPort;
PLIST_ENTRY FirstEntry, CurrentEntry;
if (TerminationPort)
{
/* 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) -
ObFastDereferenceObject(&CurrentProcess->Token, PrimaryToken);
/* Check if this is a VDM Process and rundown the VDM DPCs if so */
- if (CurrentProcess->VdmObjects);// VdmRundownDpcs(CurrentProcess);
+ if (CurrentProcess->VdmObjects) { /* VdmRundownDpcs(CurrentProcess); */ }
/* Kill the process in the Object Manager */
ObKillProcess(CurrentProcess);
if (Apc->SystemArgument2)
{
/* Free the APC */
- Status = (NTSTATUS)(ULONG_PTR)Apc->NormalContext;
+ Status = (NTSTATUS)Apc->NormalContext;
PspExitApcRundown(Apc);
/* Terminate the Thread */
/* Allocate the APC */
Apc = ExAllocatePoolWithTag(NonPagedPool, sizeof(KAPC), TAG_TERMINATE_APC);
+ if (!Apc) return STATUS_INSUFFICIENT_RESOURCES;
/* Set the Terminated Flag */
Flags = Thread->CrossThreadFlags | CT_TERMINATED_BIT;
PspExitApcRundown,
PspExitNormalApc,
KernelMode,
- (PVOID)(ULONG_PTR)ExitStatus);
+ (PVOID)ExitStatus);
/* Insert it into the APC Queue */
if (!KeInsertQueueApc(Apc, Apc, NULL, 2))
{
/* The APC was already in the queue, fail */
- ExFreePool(Apc);
Status = STATUS_UNSUCCESSFUL;
}
else
/* Allocate the Port and make sure it suceeded */
TerminationPort = ExAllocatePoolWithTag(NonPagedPool,
sizeof(TERMINATION_PORT),
- TAG('P', 's', 'T', '='));
+ '=TsP');
if(TerminationPort)
{
/* Associate the Port */