Author: ion Date: Wed Jan 24 01:46:38 2007 New Revision: 25607
URL: http://svn.reactos.org/svn/reactos?rev=25607&view=rev Log: - Fix some warnings. - Rearrange some code. - Remove useless/deprecated code.
Modified: trunk/reactos/ntoskrnl/ex/handle.c trunk/reactos/ntoskrnl/include/internal/ke_x.h trunk/reactos/ntoskrnl/ke/wait.c
Modified: trunk/reactos/ntoskrnl/ex/handle.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=25... ============================================================================== --- trunk/reactos/ntoskrnl/ex/handle.c (original) +++ trunk/reactos/ntoskrnl/ex/handle.c Wed Jan 24 01:46:38 2007 @@ -1066,7 +1066,7 @@
/* Loop each entry */ while (NewTable->NextHandleNeedingPool < - HandleTable->NextHandleNeedingPool) + HandleTable->NextHandleNeedingPool) { /* Insert it into the duplicated copy */ if (!ExpAllocateHandleTableEntrySlow(NewTable, FALSE))
Modified: trunk/reactos/ntoskrnl/include/internal/ke_x.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/k... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke_x.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ke_x.h Wed Jan 24 01:46:38 2007 @@ -193,7 +193,8 @@ (Object)->OwnerThread = Thread; \ \ /* Disable APCs if needed */ \ - Thread->KernelApcDisable -= (Object)->ApcDisable; \ + Thread->KernelApcDisable = Thread->KernelApcDisable - \ + (Object)->ApcDisable; \ \ /* Check if it's abandoned */ \ if ((Object)->Abandoned) \ @@ -238,7 +239,8 @@ (Object)->OwnerThread = Thread; \ \ /* Disable APCs if needed */ \ - Thread->KernelApcDisable -= (Object)->ApcDisable; \ + Thread->KernelApcDisable = Thread->KernelApcDisable - \ + (Object)->ApcDisable; \ \ /* Check if it's abandoned */ \ if ((Object)->Abandoned) \ @@ -259,7 +261,7 @@ // // Satisfies the wait of any nonmutant dispatcher object // -#define KiSatisfyNonMutantWait(Object, Thread) \ +#define KiSatisfyNonMutantWait(Object) \ { \ if (((Object)->Header.Type & TIMER_OR_EVENT_TYPE) == \ EventSynchronizationObject) \ @@ -454,7 +456,7 @@ /* Fill out the wait block */ \ WaitBlock = &WaitBlockArray[Index]; \ WaitBlock->Object = Object[Index]; \ - WaitBlock->WaitKey = Index; \ + WaitBlock->WaitKey = (USHORT)Index; \ WaitBlock->WaitType = WaitType; \ WaitBlock->Thread = Thread; \ \ @@ -1470,10 +1472,6 @@ FORCEINLINE KiInsertWaitTimer(IN PKTIMER Timer) { - /* Set default data */ - Timer->Header.Inserted = TRUE; - if (!Timer->Period) Timer->Header.SignalState = FALSE; - /* Now insert it into the Timer List */ InsertAscendingList(&KiTimerListHead, Timer,
Modified: trunk/reactos/ntoskrnl/ke/wait.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/wait.c?rev=2560... ============================================================================== --- trunk/reactos/ntoskrnl/ke/wait.c (original) +++ trunk/reactos/ntoskrnl/ke/wait.c Wed Jan 24 01:46:38 2007 @@ -11,33 +11,9 @@
#include <ntoskrnl.h> #define NDEBUG -#include <internal/debug.h> +#include <debug.h>
/* PRIVATE FUNCTIONS *********************************************************/ - -#if 0 -VOID -FASTCALL -KiWaitSatisfyAll(PKWAIT_BLOCK FirstBlock) -{ - PKWAIT_BLOCK WaitBlock = FirstBlock; - PKTHREAD WaitThread = WaitBlock->Thread; - - /* Loop through all the Wait Blocks, and wake each Object */ - do - { - /* Make sure it hasn't timed out */ - if (WaitBlock->WaitKey != STATUS_TIMEOUT) - { - /* Wake the Object */ - KiSatisfyObjectWait((PKMUTANT)WaitBlock->Object, WaitThread); - } - - /* Move to the next block */ - WaitBlock = WaitBlock->NextWaitBlock; - } while (WaitBlock != FirstBlock); -} -#endif
VOID FASTCALL @@ -163,7 +139,7 @@ BOOLEAN PendingApc;
/* Make sure we're at synchronization level */ - ASSERT_IRQL_EQUAL(SYNCH_LEVEL); + ASSERT(KeGetCurrentIrql() == SYNCH_LEVEL);
/* Check if we have deferred threads */ KiCheckDeferredReadyList(Prcb); @@ -288,7 +264,7 @@
/* Check if the timer expired */ InterruptTime.QuadPart = KeQueryInterruptTime(); - if (InterruptTime.QuadPart >= Timer->DueTime.QuadPart) + if ((ULONGLONG)InterruptTime.QuadPart >= Timer->DueTime.QuadPart) { /* It did, so we don't need to wait */ goto NoWait; @@ -426,7 +402,7 @@ else if (CurrentObject->Header.SignalState > 0) { /* Another satisfied object */ - KiSatisfyNonMutantWait(CurrentObject, Thread); + KiSatisfyNonMutantWait(CurrentObject); WaitStatus = STATUS_WAIT_0; goto DontWait; } @@ -440,7 +416,8 @@ { /* Check if the timer expired */ InterruptTime.QuadPart = KeQueryInterruptTime(); - if (InterruptTime.QuadPart >= Timer->DueTime.QuadPart) + if ((ULONGLONG)InterruptTime.QuadPart >= + Timer->DueTime.QuadPart) { /* It did, so we don't need to wait */ WaitStatus = STATUS_TIMEOUT; @@ -626,7 +603,7 @@ else if (CurrentObject->Header.SignalState > 0) { /* Another signaled object, unwait and return */ - KiSatisfyNonMutantWait(CurrentObject, Thread); + KiSatisfyNonMutantWait(CurrentObject); WaitStatus = Index; goto DontWait; } @@ -702,7 +679,8 @@ { /* Check if the timer expired */ InterruptTime.QuadPart = KeQueryInterruptTime(); - if (InterruptTime.QuadPart >= Timer->DueTime.QuadPart) + if ((ULONGLONG)InterruptTime.QuadPart >= + Timer->DueTime.QuadPart) { /* It did, so we don't need to wait */ WaitStatus = STATUS_TIMEOUT;