taskmgr: Move out-of-domain checking into PerfDataGetProcessorUsage() and PerfDataGetProcessorSystemUsage().
This commit is contained in:
parent
7a9210fa85
commit
a9742b3210
|
@ -332,11 +332,19 @@ ULONG PerfDataGetProcessCount(void)
|
|||
|
||||
ULONG PerfDataGetProcessorUsage(void)
|
||||
{
|
||||
if( dbIdleTime < 0.0 )
|
||||
return 0;
|
||||
if( dbIdleTime > 100.0 )
|
||||
return 100;
|
||||
return (ULONG)dbIdleTime;
|
||||
}
|
||||
|
||||
ULONG PerfDataGetProcessorSystemUsage(void)
|
||||
{
|
||||
if( dbKernelTime < 0.0 )
|
||||
return 0;
|
||||
if( dbKernelTime > 100.0 )
|
||||
return 100;
|
||||
return (ULONG)dbKernelTime;
|
||||
}
|
||||
|
||||
|
|
|
@ -234,10 +234,6 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
*/
|
||||
CpuUsage = PerfDataGetProcessorUsage();
|
||||
CpuKernelUsage = PerfDataGetProcessorSystemUsage();
|
||||
if (CpuUsage < 0 ) CpuUsage = 0;
|
||||
if (CpuUsage > 100) CpuUsage = 100;
|
||||
if (CpuKernelUsage < 0) CpuKernelUsage = 0;
|
||||
if (CpuKernelUsage > 100) CpuKernelUsage = 100;
|
||||
|
||||
/*
|
||||
* Get the memory usage
|
||||
|
|
Loading…
Reference in New Issue