Patch from w3seek

svn path=/trunk/; revision=23253
This commit is contained in:
Magnus Olsen 2006-07-23 19:14:19 +00:00
parent 92583a9250
commit 6cf55b644f
5 changed files with 18 additions and 18 deletions

View file

@ -27,7 +27,7 @@ PspCatchCriticalBreak(IN PCHAR Message,
IN PVOID ProcessOrThread, IN PVOID ProcessOrThread,
IN PCHAR ImageName) IN PCHAR ImageName)
{ {
UCHAR Action[2]; CHAR Action[2];
BOOLEAN Handled = FALSE; BOOLEAN Handled = FALSE;
PAGED_CODE(); PAGED_CODE();
@ -121,7 +121,7 @@ PspShutdownProcessManager(VOID)
PEPROCESS Process = NULL; PEPROCESS Process = NULL;
/* Loop every process */ /* Loop every process */
Process == PsGetNextProcess(Process); Process = PsGetNextProcess(Process);
while (Process) while (Process)
{ {
/* Make sure this isn't the idle or initial process */ /* Make sure this isn't the idle or initial process */
@ -132,7 +132,7 @@ PspShutdownProcessManager(VOID)
} }
/* Get the next process */ /* Get the next process */
Process == PsGetNextProcess(Process); Process = PsGetNextProcess(Process);
} }
} }

View file

@ -190,7 +190,7 @@ KPRIORITY
NTAPI NTAPI
PspComputeQuantumAndPriority(IN PEPROCESS Process, PspComputeQuantumAndPriority(IN PEPROCESS Process,
IN PSPROCESSPRIORITYMODE Mode, IN PSPROCESSPRIORITYMODE Mode,
OUT PCHAR Quantum) OUT PUCHAR Quantum)
{ {
ULONG i; ULONG i;
UCHAR LocalQuantum, MemoryPriority; UCHAR LocalQuantum, MemoryPriority;
@ -303,7 +303,7 @@ PsChangeQuantumTable(IN BOOLEAN Immediate,
if (Immediate) if (Immediate)
{ {
/* We are...loop every process */ /* We are...loop every process */
Process == PsGetNextProcess(Process); Process = PsGetNextProcess(Process);
while (Process) while (Process)
{ {
/* /*
@ -339,7 +339,7 @@ PsChangeQuantumTable(IN BOOLEAN Immediate,
KeSetQuantumProcess(&Process->Pcb, Quantum); KeSetQuantumProcess(&Process->Pcb, Quantum);
/* Get the next process */ /* Get the next process */
Process == PsGetNextProcess(Process); Process = PsGetNextProcess(Process);
} }
} }
} }

View file

@ -483,7 +483,7 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
NTSTATUS Status; NTSTATUS Status;
HANDLE PortHandle = NULL; HANDLE PortHandle = NULL;
HANDLE TokenHandle = NULL; HANDLE TokenHandle = NULL;
PROCESS_SESSION_INFORMATION SessionInfo; PROCESS_SESSION_INFORMATION SessionInfo = {0};
PEPORT ExceptionPort; PEPORT ExceptionPort;
PAGED_CODE(); PAGED_CODE();

View file

@ -51,7 +51,7 @@ PspDeleteThreadSecurity(IN PETHREAD Thread)
{ {
/* Free it */ /* Free it */
ExFreePool(Thread->ImpersonationInfo); ExFreePool(Thread->ImpersonationInfo);
InterlockedAnd(&Thread->CrossThreadFlags, InterlockedAnd((PLONG)&Thread->CrossThreadFlags,
~CT_ACTIVE_IMPERSONATION_INFO_BIT); ~CT_ACTIVE_IMPERSONATION_INFO_BIT);
Thread->ImpersonationInfo = NULL; Thread->ImpersonationInfo = NULL;
} }
@ -537,7 +537,7 @@ PsRevertThreadToSelf(IN PETHREAD Thread)
if (Thread->ActiveImpersonationInfo) if (Thread->ActiveImpersonationInfo)
{ {
/* Disable impersonation */ /* Disable impersonation */
InterlockedAnd(&Thread->CrossThreadFlags, InterlockedAnd((PLONG)&Thread->CrossThreadFlags,
~CT_ACTIVE_IMPERSONATION_INFO_BIT); ~CT_ACTIVE_IMPERSONATION_INFO_BIT);
/* Get the token */ /* Get the token */
@ -584,7 +584,7 @@ PsImpersonateClient(IN PETHREAD Thread,
if (Thread->ActiveImpersonationInfo) if (Thread->ActiveImpersonationInfo)
{ {
/* Disable impersonation */ /* Disable impersonation */
InterlockedAnd(&Thread->CrossThreadFlags, InterlockedAnd((PLONG)&Thread->CrossThreadFlags,
~CT_ACTIVE_IMPERSONATION_INFO_BIT); ~CT_ACTIVE_IMPERSONATION_INFO_BIT);
/* Get the token */ /* Get the token */
@ -632,7 +632,7 @@ PsImpersonateClient(IN PETHREAD Thread,
else else
{ {
/* Otherwise, enable impersonation */ /* Otherwise, enable impersonation */
InterlockedOr(&Thread->CrossThreadFlags, InterlockedOr((PLONG)&Thread->CrossThreadFlags,
CT_ACTIVE_IMPERSONATION_INFO_BIT); CT_ACTIVE_IMPERSONATION_INFO_BIT);
} }
@ -811,7 +811,7 @@ PsDisableImpersonation(IN PETHREAD Thread,
{ {
/* Attempt to change the flag */ /* Attempt to change the flag */
NewValue = NewValue =
InterlockedCompareExchange(&Thread->CrossThreadFlags, InterlockedCompareExchange((PLONG)&Thread->CrossThreadFlags,
OldValue &~ OldValue &~
CT_ACTIVE_IMPERSONATION_INFO_BIT, CT_ACTIVE_IMPERSONATION_INFO_BIT,
OldValue); OldValue);
@ -880,13 +880,13 @@ PsRestoreImpersonation(IN PETHREAD Thread,
Impersonation->Token = ImpersonationState->Token; Impersonation->Token = ImpersonationState->Token;
/* Enable impersonation */ /* Enable impersonation */
InterlockedOr(&Thread->CrossThreadFlags, InterlockedOr((PLONG)&Thread->CrossThreadFlags,
CT_ACTIVE_IMPERSONATION_INFO_BIT); CT_ACTIVE_IMPERSONATION_INFO_BIT);
} }
else else
{ {
/* Disable impersonation */ /* Disable impersonation */
InterlockedAnd(&Thread->CrossThreadFlags, InterlockedAnd((PLONG)&Thread->CrossThreadFlags,
~CT_ACTIVE_IMPERSONATION_INFO_BIT); ~CT_ACTIVE_IMPERSONATION_INFO_BIT);
} }

View file

@ -366,7 +366,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
/* Access state failed, thread is dead */ /* Access state failed, thread is dead */
InterlockedOr(&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT); InterlockedOr((PLONG)&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT);
/* If we were suspended, wake it up */ /* If we were suspended, wake it up */
if (CreateSuspended) KeResumeThread(&Thread->Tcb); if (CreateSuspended) KeResumeThread(&Thread->Tcb);
@ -407,7 +407,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
Status = _SEH_GetExceptionCode(); Status = _SEH_GetExceptionCode();
/* Thread insertion failed, thread is dead */ /* Thread insertion failed, thread is dead */
InterlockedOr(&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT); InterlockedOr((PLONG)&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT);
/* If we were suspended, wake it up */ /* If we were suspended, wake it up */
if (CreateSuspended) KeResumeThread(&Thread->Tcb); if (CreateSuspended) KeResumeThread(&Thread->Tcb);
@ -429,7 +429,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
else else
{ {
/* Thread insertion failed, thread is dead */ /* Thread insertion failed, thread is dead */
InterlockedOr(&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT); InterlockedOr((PLONG)&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT);
/* If we were suspended, wake it up */ /* If we were suspended, wake it up */
if (CreateSuspended) KeResumeThread(&Thread->Tcb); if (CreateSuspended) KeResumeThread(&Thread->Tcb);
@ -449,7 +449,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
/* Thread insertion failed, thread is dead */ /* Thread insertion failed, thread is dead */
InterlockedOr(&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT); InterlockedOr((PLONG)&Thread->CrossThreadFlags, CT_DEAD_THREAD_BIT);
/* If we were suspended, wake it up */ /* If we were suspended, wake it up */
if (CreateSuspended) KeResumeThread(&Thread->Tcb); if (CreateSuspended) KeResumeThread(&Thread->Tcb);