Build taskmgr with NDK Modified: trunk/reactos/include/ndk/zwtypes.h Modified: trunk/reactos/subsys/system/taskmgr/perfdata.c Modified: trunk/reactos/subsys/system/taskmgr/perfdata.h Modified: trunk/reactos/subsys/system/taskmgr/precomp.h Modified: trunk/reactos/subsys/system/taskmgr/procpage.c _____
Modified: trunk/reactos/include/ndk/zwtypes.h --- trunk/reactos/include/ndk/zwtypes.h 2005-06-20 21:50:02 UTC (rev 16191) +++ trunk/reactos/include/ndk/zwtypes.h 2005-06-20 22:15:59 UTC (rev 16192) @@ -871,7 +871,7 @@
ULONG CurrentSizeIncludingTransitionInPages; ULONG PeakSizeIncludingTransitionInPages; ULONG Unused[2]; -} SYSTEM_CACHE_INFORMATION; +} SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
/* Class 22 */ typedef struct _SYSTEM_POOLTAG _____
Modified: trunk/reactos/subsys/system/taskmgr/perfdata.c --- trunk/reactos/subsys/system/taskmgr/perfdata.c 2005-06-20 21:50:02 UTC (rev 16191) +++ trunk/reactos/subsys/system/taskmgr/perfdata.c 2005-06-20 22:15:59 UTC (rev 16192) @@ -91,13 +91,13 @@
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 @@ memcpy(&SystemHandleInfo, SysHandleInfoData, sizeof(SYSTEM_HANDLE_INFORMATION)); HeapFree(GetProcessHeap(), 0, SysHandleInfoData);
- for (CurrentKernelTime=0, Idx=0; Idx<SystemBasicInfo.NumberProcessors; Idx++) { + for (CurrentKernelTime=0, Idx=0; Idx<SystemBasicInfo.NumberOfProcessors; Idx++) { CurrentKernelTime += Li2Double(SystemProcessorTimeInfo[Idx].KernelTime); CurrentKernelTime += Li2Double(SystemProcessorTimeInfo[Idx].DpcTime); CurrentKernelTime += Li2Double(SystemProcessorTimeInfo[Idx].InterruptTime); @@ -172,7 +172,7 @@ /* If it's a first call - skip idle time calcs */ if (liOldIdleTime.QuadPart != 0) { /* CurrentValue = NewValue - OldValue */ - dbIdleTime = Li2Double(SysPerfInfo.IdleTime) - Li2Double(liOldIdleTime); + dbIdleTime = Li2Double(SysPerfInfo.IdleProcessTime) - Li2Double(liOldIdleTime); dbKernelTime = CurrentKernelTime - OldKernelTime; dbSystemTime = Li2Double(SysTimeInfo.CurrentTime) - Li2Double(liOldSystemTime);
@@ -181,12 +181,12 @@ dbKernelTime = dbKernelTime / dbSystemTime;
/* CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors */ - dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberProcessors; /* + 0.5; */ - dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberProcessors; /* + 0.5; */ + dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */ + dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */ }
/* Store new CPU's idle and system time */ - liOldIdleTime = SysPerfInfo.IdleTime; + liOldIdleTime = SysPerfInfo.IdleProcessTime; liOldSystemTime = SysTimeInfo.CurrentTime; OldKernelTime = CurrentKernelTime;
@@ -237,7 +237,7 @@ double CurTime = Li2Double(pSPI->KernelTime) + 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 @@ 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 @@ 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 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 @@
EnterCriticalSection(&PerfDataCriticalSection);
- Total = SystemPerfInfo.TotalCommittedPages; - PageSize = SystemBasicInfo.PhysicalPageSize; + Total = SystemPerfInfo.CommittedPages; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -681,8 +681,8 @@
EnterCriticalSection(&PerfDataCriticalSection);
- Limit = SystemPerfInfo.TotalCommitLimit; - PageSize = SystemBasicInfo.PhysicalPageSize; + Limit = SystemPerfInfo.CommitLimit; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -699,7 +699,7 @@ EnterCriticalSection(&PerfDataCriticalSection);
Peak = SystemPerfInfo.PeakCommitment; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -717,9 +717,9 @@
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 @@
EnterCriticalSection(&PerfDataCriticalSection);
- Paged = SystemPerfInfo.PagedPoolUsage; - PageSize = SystemBasicInfo.PhysicalPageSize; + Paged = SystemPerfInfo.PagedPoolPages; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -755,8 +755,8 @@
EnterCriticalSection(&PerfDataCriticalSection);
- NonPaged = SystemPerfInfo.NonPagedPoolUsage; - PageSize = SystemBasicInfo.PhysicalPageSize; + NonPaged = SystemPerfInfo.NonPagedPoolPages; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -773,7 +773,7 @@ EnterCriticalSection(&PerfDataCriticalSection);
Total = SystemBasicInfo.NumberOfPhysicalPages; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -790,7 +790,7 @@ EnterCriticalSection(&PerfDataCriticalSection);
Available = SystemPerfInfo.AvailablePages; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
@@ -807,7 +807,7 @@ EnterCriticalSection(&PerfDataCriticalSection);
SystemCache = SystemCacheInfo.CurrentSize; - PageSize = SystemBasicInfo.PhysicalPageSize; + PageSize = SystemBasicInfo.PageSize;
LeaveCriticalSection(&PerfDataCriticalSection);
_____
Modified: trunk/reactos/subsys/system/taskmgr/perfdata.h --- trunk/reactos/subsys/system/taskmgr/perfdata.h 2005-06-20 21:50:02 UTC (rev 16191) +++ trunk/reactos/subsys/system/taskmgr/perfdata.h 2005-06-20 22:15:59 UTC (rev 16192) @@ -36,7 +36,7 @@
WCHAR UserName[MAX_PATH]; ULONG SessionId; ULONG CPUUsage; - TIME CPUTime; + LARGE_INTEGER CPUTime; ULONG WorkingSetSizeBytes; ULONG PeakWorkingSetSizeBytes; ULONG WorkingSetSizeDelta; @@ -52,8 +52,8 @@ ULONG GDIObjectCount; IO_COUNTERS IOCounters;
- TIME UserTime; - TIME KernelTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER KernelTime; } PERFDATA, *PPERFDATA;
BOOL PerfDataInitialize(void); @@ -69,7 +69,7 @@ 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); _____
Modified: trunk/reactos/subsys/system/taskmgr/precomp.h --- trunk/reactos/subsys/system/taskmgr/precomp.h 2005-06-20 21:50:02 UTC (rev 16191) +++ trunk/reactos/subsys/system/taskmgr/precomp.h 2005-06-20 22:15:59 UTC (rev 16192) @@ -1,6 +1,6 @@
+#include <windows.h> #define NTOS_MODE_USER -#include <ntos.h> -#include <windows.h> +#include <ndk/ntndk.h> #include <commctrl.h> #include <shellapi.h> #include <stdlib.h> _____
Modified: trunk/reactos/subsys/system/taskmgr/procpage.c --- trunk/reactos/subsys/system/taskmgr/procpage.c 2005-06-20 21:50:02 UTC (rev 16191) +++ trunk/reactos/subsys/system/taskmgr/procpage.c 2005-06-20 22:15:59 UTC (rev 16192) @@ -158,7 +158,7 @@
ULONG Index; ULONG ColumnIndex; IO_COUNTERS iocounters; - TIME time; + LARGE_INTEGER time;
idctrl = (int) wParam; pnmh = (LPNMHDR) lParam;