From db1ccdf29008cf852e652021b8937164cfd222ce Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Fri, 7 Jul 2000 00:45:37 +0000 Subject: [PATCH] Fixes to timeout code svn path=/trunk/; revision=1238 --- reactos/ntoskrnl/ke/timer.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/reactos/ntoskrnl/ke/timer.c b/reactos/ntoskrnl/ke/timer.c index ef9a0045c5b..bd249520c20 100644 --- a/reactos/ntoskrnl/ke/timer.c +++ b/reactos/ntoskrnl/ke/timer.c @@ -1,4 +1,4 @@ -/* $Id: timer.c,v 1.31 2000/07/04 08:52:40 dwelch Exp $ +/* $Id: timer.c,v 1.32 2000/07/07 00:45:37 phreak Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -135,14 +135,14 @@ NTSTATUS STDCALL NtDelayExecution(IN ULONG Alertable, IN TIME* Interval) { NTSTATUS Status; - PLARGE_INTEGER IntervalP; - - IntervalP = (PLARGE_INTEGER)Interval; + LARGE_INTEGER Timeout; + Timeout = *((PLARGE_INTEGER)Interval); + Timeout.QuadPart = -Timeout.QuadPart; DPRINT("NtDelayExecution(Alertable %d, Internal %x) IntervalP %x\n", - Alertable, Internal, IntervalP); + Alertable, Internal, Timeout); - Status = KeDelayExecutionThread(UserMode, Alertable, IntervalP); + Status = KeDelayExecutionThread(UserMode, Alertable, &Timeout); return(Status); } @@ -265,15 +265,14 @@ KeSetTimerEx ( { KIRQL oldlvl; - DPRINT("KeSetTimerEx(Timer %x)\n",Timer); - + DPRINT("KeSetTimerEx(Timer %x), DueTime: \n",Timer); KeRaiseIrql( HIGH_LEVEL, &oldlvl ); KeAcquireSpinLockAtDpcLevel(&TimerListLock); Timer->Dpc = Dpc; if (DueTime.QuadPart < 0) { - Timer->DueTime.QuadPart = system_time + (-(DueTime.QuadPart)); + Timer->DueTime.QuadPart = system_time + 100000000; } else { @@ -474,7 +473,7 @@ VOID KiUpdateSystemTime (VOID) // extern ULONG EiNrUsedBlocks; extern unsigned int EiFreeNonPagedPool; extern unsigned int EiUsedNonPagedPool; - extern ULONG PiNrThreads; + // extern ULONG PiNrThreads; // extern ULONG MiNrFreePages; if (TimerInitDone == FALSE) @@ -503,15 +502,16 @@ VOID KiUpdateSystemTime (VOID) y = (EiUsedNonPagedPool * 100) / (EiFreeNonPagedPool + EiUsedNonPagedPool); } -// sprintf(str,"%.8u %.8u",EiFreeNonPagedPool,ticks); memset(str, 0, sizeof(str)); // sprintf(str,"%.8u %.8u",(unsigned int)EiNrUsedBlocks, // (unsigned int)EiFreeNonPagedPool); // sprintf(str,"%.8u %.8u",EiFreeNonPagedPool,EiUsedNonPagedPool); - sprintf(str,"%.8u %.8u",(unsigned int)PiNrRunnableThreads, - (unsigned int)PiNrThreads); +// sprintf(str,"%.8u %.8u",(unsigned int)PiNrRunnableThreads, +// (unsigned int)PiNrThreads); // sprintf(str,"%.8u %.8u", (unsigned int)PiNrRunnableThreads, // (unsigned int)MiNrFreePages); + sprintf(str,"%.8u %.8u",EiFreeNonPagedPool,(unsigned int)KiTimerTicks); + for (i=0;i<17;i++) { *vidmem=str[i];