From d8de94af8a58dd8cc2a89440474f89d3a02f83c1 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Mon, 20 Jun 2005 22:15:59 +0000 Subject: [PATCH] Build taskmgr with NDK svn path=/trunk/; revision=16192 --- reactos/include/ndk/zwtypes.h | 2 +- reactos/subsys/system/taskmgr/perfdata.c | 70 ++++++++++++------------ reactos/subsys/system/taskmgr/perfdata.h | 8 +-- reactos/subsys/system/taskmgr/precomp.h | 4 +- reactos/subsys/system/taskmgr/procpage.c | 2 +- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/reactos/include/ndk/zwtypes.h b/reactos/include/ndk/zwtypes.h index a2fb1a84e66..f936b74c722 100644 --- a/reactos/include/ndk/zwtypes.h +++ b/reactos/include/ndk/zwtypes.h @@ -871,7 +871,7 @@ typedef struct _SYSTEM_CACHE_INFORMATION ULONG CurrentSizeIncludingTransitionInPages; ULONG PeakSizeIncludingTransitionInPages; ULONG Unused[2]; -} SYSTEM_CACHE_INFORMATION; +} SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION; /* Class 22 */ typedef struct _SYSTEM_POOLTAG diff --git a/reactos/subsys/system/taskmgr/perfdata.c b/reactos/subsys/system/taskmgr/perfdata.c index e2be4b094ad..86bd366a3d3 100644 --- a/reactos/subsys/system/taskmgr/perfdata.c +++ b/reactos/subsys/system/taskmgr/perfdata.c @@ -91,13 +91,13 @@ void PerfDataRefresh(void) return; /* Get system cache information */ - status = NtQuerySystemInformation(SystemCacheInformation, &SysCacheInfo, sizeof(SysCacheInfo), NULL); + status = NtQuerySystemInformation(SystemFileCacheInformation, &SysCacheInfo, sizeof(SysCacheInfo), NULL); if (status != NO_ERROR) return; /* Get processor time information */ - SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)HeapAlloc(GetProcessHeap(), 0, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors); - status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors, &ulSize); + 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); if (status != NO_ERROR) return; @@ -163,7 +163,7 @@ void PerfDataRefresh(void) memcpy(&SystemHandleInfo, SysHandleInfoData, sizeof(SYSTEM_HANDLE_INFORMATION)); HeapFree(GetProcessHeap(), 0, SysHandleInfoData); - for (CurrentKernelTime=0, Idx=0; IdxKernelTime) + Li2Double(pSPI->UserTime); double OldTime = Li2Double(pPDOld->KernelTime) + Li2Double(pPDOld->UserTime); double CpuTime = (CurTime - OldTime) / dbSystemTime; - CpuTime = CpuTime * 100.0 / (double)SystemBasicInfo.NumberProcessors; /* + 0.5; */ + CpuTime = CpuTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */ pPerfData[Idx].CPUUsage = (ULONG)CpuTime; } pPerfData[Idx].CPUTime.QuadPart = pSPI->UserTime.QuadPart + pSPI->KernelTime.QuadPart; @@ -253,7 +253,7 @@ void PerfDataRefresh(void) else pPerfData[Idx].PageFaultCountDelta = 0; pPerfData[Idx].VirtualMemorySizeBytes = pSPI->VirtualSize; - pPerfData[Idx].PagedPoolUsagePages = pSPI->QuotaPagedPoolUsage; + pPerfData[Idx].PagedPoolUsagePages = pSPI->QuotaPeakPagedPoolUsage; pPerfData[Idx].NonPagedPoolUsagePages = pSPI->QuotaPeakNonPagedPoolUsage; pPerfData[Idx].BasePriority = pSPI->BasePriority; pPerfData[Idx].HandleCount = pSPI->HandleCount; @@ -416,9 +416,9 @@ ULONG PerfDataGetCPUUsage(ULONG Index) return CpuUsage; } -TIME PerfDataGetCPUTime(ULONG Index) +LARGE_INTEGER PerfDataGetCPUTime(ULONG Index) { - TIME CpuTime = {{0,0}}; + LARGE_INTEGER CpuTime = {{0,0}}; EnterCriticalSection(&PerfDataCriticalSection); @@ -528,34 +528,34 @@ ULONG PerfDataGetVirtualMemorySizeBytes(ULONG Index) ULONG PerfDataGetPagedPoolUsagePages(ULONG Index) { - ULONG PagedPoolUsagePages; + ULONG PagedPoolUsage; EnterCriticalSection(&PerfDataCriticalSection); if (Index < ProcessCount) - PagedPoolUsagePages = pPerfData[Index].PagedPoolUsagePages; + PagedPoolUsage = pPerfData[Index].PagedPoolUsagePages; else - PagedPoolUsagePages = 0; + PagedPoolUsage = 0; LeaveCriticalSection(&PerfDataCriticalSection); - return PagedPoolUsagePages; + return PagedPoolUsage; } ULONG PerfDataGetNonPagedPoolUsagePages(ULONG Index) { - ULONG NonPagedPoolUsagePages; + ULONG NonPagedPoolUsage; EnterCriticalSection(&PerfDataCriticalSection); if (Index < ProcessCount) - NonPagedPoolUsagePages = pPerfData[Index].NonPagedPoolUsagePages; + NonPagedPoolUsage = pPerfData[Index].NonPagedPoolUsagePages; else - NonPagedPoolUsagePages = 0; + NonPagedPoolUsage = 0; LeaveCriticalSection(&PerfDataCriticalSection); - return NonPagedPoolUsagePages; + return NonPagedPoolUsage; } ULONG PerfDataGetBasePriority(ULONG Index) @@ -664,8 +664,8 @@ ULONG PerfDataGetCommitChargeTotalK(void) EnterCriticalSection(&PerfDataCriticalSection); - Total = SystemPerfInfo.TotalCommittedPages; - PageSize = SystemBasicInfo.PhysicalPageSize; + Total = SystemPerfInfo.CommittedPages; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -681,8 +681,8 @@ ULONG PerfDataGetCommitChargeLimitK(void) EnterCriticalSection(&PerfDataCriticalSection); - Limit = SystemPerfInfo.TotalCommitLimit; - PageSize = SystemBasicInfo.PhysicalPageSize; + Limit = SystemPerfInfo.CommitLimit; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -699,7 +699,7 @@ ULONG PerfDataGetCommitChargePeakK(void) EnterCriticalSection(&PerfDataCriticalSection); Peak = SystemPerfInfo.PeakCommitment; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -717,9 +717,9 @@ ULONG PerfDataGetKernelMemoryTotalK(void) EnterCriticalSection(&PerfDataCriticalSection); - Paged = SystemPerfInfo.PagedPoolUsage; - NonPaged = SystemPerfInfo.NonPagedPoolUsage; - PageSize = SystemBasicInfo.PhysicalPageSize; + Paged = SystemPerfInfo.PagedPoolPages; + NonPaged = SystemPerfInfo.NonPagedPoolPages; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -738,8 +738,8 @@ ULONG PerfDataGetKernelMemoryPagedK(void) EnterCriticalSection(&PerfDataCriticalSection); - Paged = SystemPerfInfo.PagedPoolUsage; - PageSize = SystemBasicInfo.PhysicalPageSize; + Paged = SystemPerfInfo.PagedPoolPages; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -755,8 +755,8 @@ ULONG PerfDataGetKernelMemoryNonPagedK(void) EnterCriticalSection(&PerfDataCriticalSection); - NonPaged = SystemPerfInfo.NonPagedPoolUsage; - PageSize = SystemBasicInfo.PhysicalPageSize; + NonPaged = SystemPerfInfo.NonPagedPoolPages; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -773,7 +773,7 @@ ULONG PerfDataGetPhysicalMemoryTotalK(void) EnterCriticalSection(&PerfDataCriticalSection); Total = SystemBasicInfo.NumberOfPhysicalPages; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -790,7 +790,7 @@ ULONG PerfDataGetPhysicalMemoryAvailableK(void) EnterCriticalSection(&PerfDataCriticalSection); Available = SystemPerfInfo.AvailablePages; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -807,7 +807,7 @@ ULONG PerfDataGetPhysicalMemorySystemCacheK(void) EnterCriticalSection(&PerfDataCriticalSection); SystemCache = SystemCacheInfo.CurrentSize; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize; LeaveCriticalSection(&PerfDataCriticalSection); diff --git a/reactos/subsys/system/taskmgr/perfdata.h b/reactos/subsys/system/taskmgr/perfdata.h index 987243a3016..de26d6acf4f 100644 --- a/reactos/subsys/system/taskmgr/perfdata.h +++ b/reactos/subsys/system/taskmgr/perfdata.h @@ -36,7 +36,7 @@ typedef struct _PERFDATA WCHAR UserName[MAX_PATH]; ULONG SessionId; ULONG CPUUsage; - TIME CPUTime; + LARGE_INTEGER CPUTime; ULONG WorkingSetSizeBytes; ULONG PeakWorkingSetSizeBytes; ULONG WorkingSetSizeDelta; @@ -52,8 +52,8 @@ typedef struct _PERFDATA ULONG GDIObjectCount; IO_COUNTERS IOCounters; - TIME UserTime; - TIME KernelTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER KernelTime; } PERFDATA, *PPERFDATA; BOOL PerfDataInitialize(void); @@ -69,7 +69,7 @@ ULONG PerfDataGetProcessId(ULONG Index); BOOL PerfDataGetUserName(ULONG Index, LPTSTR lpUserName, int nMaxCount); ULONG PerfDataGetSessionId(ULONG Index); ULONG PerfDataGetCPUUsage(ULONG Index); -TIME PerfDataGetCPUTime(ULONG Index); +LARGE_INTEGER PerfDataGetCPUTime(ULONG Index); ULONG PerfDataGetWorkingSetSizeBytes(ULONG Index); ULONG PerfDataGetPeakWorkingSetSizeBytes(ULONG Index); ULONG PerfDataGetWorkingSetSizeDelta(ULONG Index); diff --git a/reactos/subsys/system/taskmgr/precomp.h b/reactos/subsys/system/taskmgr/precomp.h index f4d5e011207..e5ab0f15e2f 100644 --- a/reactos/subsys/system/taskmgr/precomp.h +++ b/reactos/subsys/system/taskmgr/precomp.h @@ -1,6 +1,6 @@ -#define NTOS_MODE_USER -#include #include +#define NTOS_MODE_USER +#include #include #include #include diff --git a/reactos/subsys/system/taskmgr/procpage.c b/reactos/subsys/system/taskmgr/procpage.c index 2fb59fe308c..9b3989b7520 100644 --- a/reactos/subsys/system/taskmgr/procpage.c +++ b/reactos/subsys/system/taskmgr/procpage.c @@ -158,7 +158,7 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam) ULONG Index; ULONG ColumnIndex; IO_COUNTERS iocounters; - TIME time; + LARGE_INTEGER time; idctrl = (int) wParam; pnmh = (LPNMHDR) lParam;