mirror of
https://github.com/reactos/reactos.git
synced 2024-09-29 14:09:10 +00:00
[TASKMGR]
* Don't compare NTSTATUS to NO_ERROR. Use NT_SUCCESS macro instead. Spotted by dmex. svn path=/trunk/; revision=51556
This commit is contained in:
parent
6774978a84
commit
94aaa3b4d5
|
@ -60,7 +60,7 @@ BOOL PerfDataInitialize(void)
|
||||||
* Get number of processors in the system
|
* Get number of processors in the system
|
||||||
*/
|
*/
|
||||||
status = NtQuerySystemInformation(SystemBasicInformation, &SystemBasicInfo, sizeof(SystemBasicInfo), NULL);
|
status = NtQuerySystemInformation(SystemBasicInformation, &SystemBasicInfo, sizeof(SystemBasicInfo), NULL);
|
||||||
if (status != NO_ERROR)
|
if (!NT_SUCCESS(status))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -180,24 +180,24 @@ void PerfDataRefresh(void)
|
||||||
|
|
||||||
/* Get new system time */
|
/* Get new system time */
|
||||||
status = NtQuerySystemInformation(SystemTimeOfDayInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0);
|
status = NtQuerySystemInformation(SystemTimeOfDayInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0);
|
||||||
if (status != NO_ERROR)
|
if (!NT_SUCCESS(status))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get new CPU's idle time */
|
/* Get new CPU's idle time */
|
||||||
status = NtQuerySystemInformation(SystemPerformanceInformation, &SysPerfInfo, sizeof(SysPerfInfo), NULL);
|
status = NtQuerySystemInformation(SystemPerformanceInformation, &SysPerfInfo, sizeof(SysPerfInfo), NULL);
|
||||||
if (status != NO_ERROR)
|
if (!NT_SUCCESS(status))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get system cache information */
|
/* Get system cache information */
|
||||||
status = NtQuerySystemInformation(SystemFileCacheInformation, &SysCacheInfo, sizeof(SysCacheInfo), NULL);
|
status = NtQuerySystemInformation(SystemFileCacheInformation, &SysCacheInfo, sizeof(SysCacheInfo), NULL);
|
||||||
if (status != NO_ERROR)
|
if (!NT_SUCCESS(status))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get processor time information */
|
/* Get processor time information */
|
||||||
SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)HeapAlloc(GetProcessHeap(), 0, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberOfProcessors);
|
SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)HeapAlloc(GetProcessHeap(), 0, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberOfProcessors);
|
||||||
status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberOfProcessors, &ulSize);
|
status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberOfProcessors, &ulSize);
|
||||||
|
|
||||||
if (status != NO_ERROR)
|
if (!NT_SUCCESS(status))
|
||||||
{
|
{
|
||||||
if (SysProcessorTimeInfo != NULL)
|
if (SysProcessorTimeInfo != NULL)
|
||||||
HeapFree(GetProcessHeap(), 0, SysProcessorTimeInfo);
|
HeapFree(GetProcessHeap(), 0, SysProcessorTimeInfo);
|
||||||
|
|
Loading…
Reference in a new issue