diff --git a/reactos/include/ddk/exfuncs.h b/reactos/include/ddk/exfuncs.h index c2979b81db4..3513274fce5 100644 --- a/reactos/include/ddk/exfuncs.h +++ b/reactos/include/ddk/exfuncs.h @@ -254,15 +254,15 @@ ExfInterlockedCompareExchange64( VOID STDCALL ExGetCurrentProcessorCounts ( - PVOID IdleThreadTime, - PVOID SystemTime, - PVOID Number - ); + PULONG ThreadKernelTime, + PULONG TotalCpuTime, + PULONG ProcessorNumber +); VOID STDCALL ExGetCurrentProcessorCpuUsage ( - PVOID RetVal + PULONG CpuUsage ); ULONG diff --git a/reactos/ntoskrnl/ex/list.c b/reactos/ntoskrnl/ex/list.c index 90afeb5d9c8..ee294e29cdb 100644 --- a/reactos/ntoskrnl/ex/list.c +++ b/reactos/ntoskrnl/ex/list.c @@ -1,4 +1,4 @@ -/* $Id: list.c,v 1.13 2004/08/15 16:39:01 chorns Exp $ +/* $Id: list.c,v 1.14 2004/10/12 00:56:46 ion Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -22,7 +22,7 @@ static KSPIN_LOCK ExpGlobalListLock = { 0, }; /* FUNCTIONS *************************************************************/ /* - * @unimplemented + * @implemented */ PSLIST_ENTRY FASTCALL @@ -30,10 +30,12 @@ ExInterlockedFlushSList ( IN PSLIST_HEADER ListHead ) { - PSLIST_ENTRY Old = NULL; + PSLIST_ENTRY Old; - UNIMPLEMENTED; - return Old; + Old = &ListHead->Next; + ListHead->Next.Next = 0; + + return Old; } /* diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index 49f3ec0343f..3ae1a85f54c 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1,4 +1,4 @@ -/* $Id: sysinfo.c,v 1.50 2004/10/08 20:02:30 gvg Exp $ +/* $Id: sysinfo.c,v 1.51 2004/10/12 00:56:46 ion Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -44,28 +44,50 @@ ExEnumHandleTable ( } /* - * @unimplemented - */ -VOID -STDCALL -ExGetCurrentProcessorCounts ( - PVOID IdleThreadTime, - PVOID SystemTime, - PVOID Number - ) -{ - UNIMPLEMENTED; -} -/* - * @unimplemented + * @implemented */ VOID STDCALL ExGetCurrentProcessorCpuUsage ( - PVOID RetVal + PULONG CpuUsage ) { - UNIMPLEMENTED; + PKPCR Pcr; + ULONG TotalTime; + ULONG PercentTime; + + Pcr = KeGetCurrentKPCR(); + + TotalTime = Pcr->PrcbData.KernelTime + Pcr->PrcbData.UserTime; + PercentTime = 100 - (TotalTime / Pcr->PrcbData.CurrentThread->KernelTime * 100); + CpuUsage = &PercentTime; +} + +/* + * @implemented + */ +VOID +STDCALL +ExGetCurrentProcessorCounts ( + PULONG ThreadKernelTime, + PULONG TotalCpuTime, + PULONG ProcessorNumber + ) +{ + PKPCR Pcr; + ULONG TotalTime; + ULONG ThreadTime; + ULONG ProcNumber; + + Pcr = KeGetCurrentKPCR(); + + TotalTime = Pcr->PrcbData.KernelTime + Pcr->PrcbData.UserTime; + ThreadTime = Pcr->PrcbData.CurrentThread->KernelTime; + ProcNumber = Pcr->ProcessorNumber; + + ThreadKernelTime = &ThreadTime; + TotalCpuTime = &TotalTime; + ProcessorNumber = &ProcNumber; } NTSTATUS STDCALL diff --git a/reactos/ntoskrnl/ex/util.c b/reactos/ntoskrnl/ex/util.c index 082a3a95f89..25c4bee59a4 100644 --- a/reactos/ntoskrnl/ex/util.c +++ b/reactos/ntoskrnl/ex/util.c @@ -43,8 +43,9 @@ ExUuidCreate( UNIMPLEMENTED; return FALSE; } + /* - * @unimplemented + * @implemented */ STDCALL BOOLEAN @@ -52,8 +53,8 @@ ExVerifySuite( SUITE_TYPE SuiteType ) { - UNIMPLEMENTED; - return FALSE; + if (SuiteType == Personal) return TRUE; + return FALSE; } /* EOF */ diff --git a/reactos/ntoskrnl/ke/catch.c b/reactos/ntoskrnl/ke/catch.c index 575be795d89..3423446dc67 100644 --- a/reactos/ntoskrnl/ke/catch.c +++ b/reactos/ntoskrnl/ke/catch.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: catch.c,v 1.48 2004/08/21 21:19:06 tamlin Exp $ +/* $Id: catch.c,v 1.49 2004/10/12 00:56:46 ion Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/catch.c @@ -208,17 +208,29 @@ ExRaiseStatus (IN NTSTATUS Status) } + /* - * @unimplemented + * @implemented */ VOID STDCALL ExRaiseException ( - PEXCEPTION_RECORD pExcptRec + PEXCEPTION_RECORD ExceptionRecord ) { - UNIMPLEMENTED; + RtlRaiseException(ExceptionRecord); } + +/* + * @implemented + */ +BOOLEAN +STDCALL +ExSystemExceptionFilter() +{ + return KeGetPreviousMode() != KernelMode ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH; +} + /* * @unimplemented */ @@ -236,18 +248,6 @@ ExRaiseHardError ( UNIMPLEMENTED; } - -/* - * @unimplemented - */ -BOOLEAN -STDCALL -ExSystemExceptionFilter() -{ - UNIMPLEMENTED; - return FALSE; -} - /* * @unimplemented */