taskmgr: Move out-of-domain checking into PerfDataGetProcessorUsage() and PerfDataGetProcessorSystemUsage().

This commit is contained in:
Gerald Pfeifer 2007-11-15 14:06:59 +01:00 committed by Alexandre Julliard
parent 7a9210fa85
commit a9742b3210
2 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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