Author: tfaber
Date: Tue Apr 12 17:44:47 2016
New Revision: 71153
URL:
http://svn.reactos.org/svn/reactos?rev=71153&view=rev
Log:
[NTOS:PS]
- Return sensible values for KernelTime/UserTime from
NtQueryInformationProcess:ProcessTimes
CORE-7007 #resolve
Modified:
trunk/reactos/ntoskrnl/ps/query.c
trunk/rostests/apitests/ntdll/NtQueryInformationProcess.c
Modified: trunk/reactos/ntoskrnl/ps/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=71…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] Tue Apr 12 17:44:47 2016
@@ -70,6 +70,7 @@
PPROCESS_BASIC_INFORMATION ProcessBasicInfo =
(PPROCESS_BASIC_INFORMATION)ProcessInformation;
PKERNEL_USER_TIMES ProcessTime = (PKERNEL_USER_TIMES)ProcessInformation;
+ ULONG UserTime, KernelTime;
PPROCESS_PRIORITY_CLASS PsPriorityClass =
(PPROCESS_PRIORITY_CLASS)ProcessInformation;
ULONG HandleCount;
PPROCESS_SESSION_INFORMATION SessionInfo =
@@ -296,12 +297,10 @@
_SEH2_TRY
{
/* Copy time information from EPROCESS/KPROCESS */
- /* FIXME: Call KeQueryRuntimeProcess */
+ KernelTime = KeQueryRuntimeProcess(&Process->Pcb, &UserTime);
ProcessTime->CreateTime = Process->CreateTime;
- ProcessTime->UserTime.QuadPart = Process->Pcb.UserTime *
- KeMaximumIncrement;
- ProcessTime->KernelTime.QuadPart = Process->Pcb.KernelTime *
- KeMaximumIncrement;
+ ProcessTime->UserTime.QuadPart = (LONGLONG)UserTime *
KeMaximumIncrement;
+ ProcessTime->KernelTime.QuadPart = (LONGLONG)KernelTime *
KeMaximumIncrement;
ProcessTime->ExitTime = Process->ExitTime;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
Modified: trunk/rostests/apitests/ntdll/NtQueryInformationProcess.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtQueryInf…
==============================================================================
--- trunk/rostests/apitests/ntdll/NtQueryInformationProcess.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/NtQueryInformationProcess.c [iso-8859-1] Tue Apr 12
17:44:47 2016
@@ -1,6 +1,6 @@
/*
* PROJECT: ReactOS API tests
- * LICENSE: LGPLv2.1+ - See COPYING in the top level directory
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Tests for the NtQueryInformationProcess API
* PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
*/