From 2acf2098b88acf14f387ca089ec254946c963a6f Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Thu, 7 Apr 2005 13:25:34 +0000 Subject: [PATCH] - don't redefine public structures in taskmgr - minor taskmgr changes and make better use of PCH - fixed definition of SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION and depending code svn path=/trunk/; revision=14536 --- reactos/include/ntos/zwtypes.h | 18 +- reactos/lib/kernel32/misc/time.c | 18 +- reactos/ntoskrnl/ex/sysinfo.c | 24 +- reactos/subsys/system/taskmgr/De.rc | 1 + reactos/subsys/system/taskmgr/Dk.rc | 1 + reactos/subsys/system/taskmgr/En.rc | 1 + reactos/subsys/system/taskmgr/Es.rc | 1 + reactos/subsys/system/taskmgr/Sv.rc | 1 + reactos/subsys/system/taskmgr/about.c | 8 - reactos/subsys/system/taskmgr/affinity.c | 11 - reactos/subsys/system/taskmgr/applpage.c | 25 +- reactos/subsys/system/taskmgr/column.c | 9 - reactos/subsys/system/taskmgr/dbgchnl.c | 14 -- reactos/subsys/system/taskmgr/debug.c | 11 - reactos/subsys/system/taskmgr/endproc.c | 11 - reactos/subsys/system/taskmgr/font.c | 8 - reactos/subsys/system/taskmgr/graph.c | 12 - reactos/subsys/system/taskmgr/graphctl.c | 9 - reactos/subsys/system/taskmgr/makefile | 2 +- reactos/subsys/system/taskmgr/optnmenu.c | 9 - reactos/subsys/system/taskmgr/perfdata.c | 158 ++++++------ reactos/subsys/system/taskmgr/perfdata.h | 290 +---------------------- reactos/subsys/system/taskmgr/perfpage.c | 13 - reactos/subsys/system/taskmgr/precomp.h | 29 ++- reactos/subsys/system/taskmgr/priority.c | 11 - reactos/subsys/system/taskmgr/proclist.c | 11 - reactos/subsys/system/taskmgr/procpage.c | 15 -- reactos/subsys/system/taskmgr/resource.h | 1 + reactos/subsys/system/taskmgr/run.c | 8 - reactos/subsys/system/taskmgr/taskmgr.c | 23 -- reactos/subsys/system/taskmgr/trayicon.c | 11 - 31 files changed, 141 insertions(+), 623 deletions(-) diff --git a/reactos/include/ntos/zwtypes.h b/reactos/include/ntos/zwtypes.h index 50147fbc46a..3a88cd6c78d 100755 --- a/reactos/include/ntos/zwtypes.h +++ b/reactos/include/ntos/zwtypes.h @@ -1401,17 +1401,17 @@ struct _SYSTEM_DEVICE_INFORMATION // SystemProcessorPerformanceInformation (8) // (one per processor in the system) typedef -struct _SYSTEM_PROCESSORTIME_INFO +struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { - TIME TotalProcessorRunTime; - TIME TotalProcessorTime; - TIME TotalProcessorUserTime; - TIME TotalDPCTime; - TIME TotalInterruptTime; - ULONG TotalInterrupts; - ULONG Unused; + LARGE_INTEGER IdleTime; + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER DpcTime; + LARGE_INTEGER InterruptTime; + ULONG InterruptCount; + ULONG Reserved; -} SYSTEM_PROCESSORTIME_INFO, *PSYSTEM_PROCESSORTIME_INFO; +} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; // SystemFlagsInformation (9) typedef diff --git a/reactos/lib/kernel32/misc/time.c b/reactos/lib/kernel32/misc/time.c index d74617f57e5..c0aea8aa67a 100644 --- a/reactos/lib/kernel32/misc/time.c +++ b/reactos/lib/kernel32/misc/time.c @@ -500,12 +500,12 @@ GetSystemTimes( LPFILETIME lpUserTime ) { - SYSTEM_PROCESSORTIME_INFO SysProcTime; + SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcPerfInfo; NTSTATUS Status; Status = ZwQuerySystemInformation(SystemProcessorPerformanceInformation, - &SysProcTime, - sizeof(SysProcTime), + &SysProcPerfInfo, + sizeof(SysProcPerfInfo), NULL); if (!NT_SUCCESS(Status)) @@ -517,14 +517,14 @@ GetSystemTimes( Good only for one processor system. */ - lpIdleTime->dwLowDateTime = SysProcTime.TotalProcessorRunTime.LowPart; - lpIdleTime->dwHighDateTime = SysProcTime.TotalProcessorRunTime.HighPart; + lpIdleTime->dwLowDateTime = SysProcPerfInfo.IdleTime.LowPart; + lpIdleTime->dwHighDateTime = SysProcPerfInfo.IdleTime.HighPart; - lpKernelTime->dwLowDateTime = SysProcTime.TotalProcessorTime.LowPart; - lpKernelTime->dwHighDateTime = SysProcTime.TotalProcessorTime.HighPart; + lpKernelTime->dwLowDateTime = SysProcPerfInfo.KernelTime.LowPart; + lpKernelTime->dwHighDateTime = SysProcPerfInfo.KernelTime.HighPart; - lpUserTime->dwLowDateTime = SysProcTime.TotalProcessorUserTime.LowPart; - lpUserTime->dwHighDateTime = SysProcTime.TotalProcessorUserTime.HighPart; + lpUserTime->dwLowDateTime = SysProcPerfInfo.UserTime.LowPart; + lpUserTime->dwHighDateTime = SysProcPerfInfo.UserTime.HighPart; return TRUE; } diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index c9d91fae7c6..3165f1ec7b5 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -725,18 +725,18 @@ QSI_DEF(SystemDeviceInformation) /* Class 8 - Processor Performance Information */ QSI_DEF(SystemProcessorPerformanceInformation) { - PSYSTEM_PROCESSORTIME_INFO Spi - = (PSYSTEM_PROCESSORTIME_INFO) Buffer; + PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION Spi + = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) Buffer; ULONG i; LARGE_INTEGER CurrentTime; PKPRCB Prcb; - *ReqSize = KeNumberProcessors * sizeof (SYSTEM_PROCESSORTIME_INFO); + *ReqSize = KeNumberProcessors * sizeof (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION); /* - * Check user buffer's size + * Check user buffer's size */ - if (Size < KeNumberProcessors * sizeof(SYSTEM_PROCESSORTIME_INFO)) + if (Size < KeNumberProcessors * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)) { return (STATUS_INFO_LENGTH_MISMATCH); } @@ -745,16 +745,16 @@ QSI_DEF(SystemProcessorPerformanceInformation) Prcb = ((PKPCR)KPCR_BASE)->Prcb; for (i = 0; i < KeNumberProcessors; i++) { - Spi->TotalProcessorRunTime.QuadPart = (Prcb->IdleThread->KernelTime + Prcb->IdleThread->UserTime) * 100000LL; // IdleTime - Spi->TotalProcessorTime.QuadPart = Prcb->KernelTime * 100000LL; // KernelTime - Spi->TotalProcessorUserTime.QuadPart = Prcb->UserTime * 100000LL; - Spi->TotalDPCTime.QuadPart = Prcb->DpcTime * 100000LL; - Spi->TotalInterruptTime.QuadPart = Prcb->InterruptTime * 100000LL; - Spi->TotalInterrupts = Prcb->InterruptCount; // Interrupt Count + Spi->IdleTime.QuadPart = (Prcb->IdleThread->KernelTime + Prcb->IdleThread->UserTime) * 100000LL; // IdleTime + Spi->KernelTime.QuadPart = Prcb->KernelTime * 100000LL; // KernelTime + Spi->UserTime.QuadPart = Prcb->UserTime * 100000LL; + Spi->DpcTime.QuadPart = Prcb->DpcTime * 100000LL; + Spi->InterruptTime.QuadPart = Prcb->InterruptTime * 100000LL; + Spi->InterruptCount = Prcb->InterruptCount; // Interrupt Count Spi++; Prcb = (PKPRCB)((ULONG_PTR)Prcb + PAGE_SIZE); } - + return (STATUS_SUCCESS); } diff --git a/reactos/subsys/system/taskmgr/De.rc b/reactos/subsys/system/taskmgr/De.rc index f13066be569..ad892364c7e 100644 --- a/reactos/subsys/system/taskmgr/De.rc +++ b/reactos/subsys/system/taskmgr/De.rc @@ -583,6 +583,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "Task-Manager" IDC_TASKMGR "Task-Manager" + IDS_IDLE_PROCESS "Leerlaufprozess" END STRINGTABLE DISCARDABLE diff --git a/reactos/subsys/system/taskmgr/Dk.rc b/reactos/subsys/system/taskmgr/Dk.rc index d72a7ffe27a..ddb7851061d 100644 --- a/reactos/subsys/system/taskmgr/Dk.rc +++ b/reactos/subsys/system/taskmgr/Dk.rc @@ -538,6 +538,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "Opgavestyring" IDC_TASKMGR "Opgavestyring" + IDS_IDLE_PROCESS "System Idle Process" END STRINGTABLE DISCARDABLE diff --git a/reactos/subsys/system/taskmgr/En.rc b/reactos/subsys/system/taskmgr/En.rc index 8e3cd75f6f8..9fa11c8a159 100644 --- a/reactos/subsys/system/taskmgr/En.rc +++ b/reactos/subsys/system/taskmgr/En.rc @@ -538,6 +538,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "Task Manager" IDC_TASKMGR "Task Manager" + IDS_IDLE_PROCESS "System Idle Process" END STRINGTABLE DISCARDABLE diff --git a/reactos/subsys/system/taskmgr/Es.rc b/reactos/subsys/system/taskmgr/Es.rc index c0b22333593..de594bd6dc8 100644 --- a/reactos/subsys/system/taskmgr/Es.rc +++ b/reactos/subsys/system/taskmgr/Es.rc @@ -611,6 +611,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "Administrador de Tareas" IDC_TASKMGR "Administrador de Tareas" + IDS_IDLE_PROCESS "System Idle Process" END STRINGTABLE DISCARDABLE diff --git a/reactos/subsys/system/taskmgr/Sv.rc b/reactos/subsys/system/taskmgr/Sv.rc index ea4385afb44..9cd0205a16b 100644 --- a/reactos/subsys/system/taskmgr/Sv.rc +++ b/reactos/subsys/system/taskmgr/Sv.rc @@ -555,6 +555,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "Aktivitetshanteraren" IDC_TASKMGR "Aktivitetshanteraren" + IDS_IDLE_PROCESS "System Idle Process" END STRINGTABLE DISCARDABLE diff --git a/reactos/subsys/system/taskmgr/about.c b/reactos/subsys/system/taskmgr/about.c index af32cc94bf7..9cd9d472c44 100644 --- a/reactos/subsys/system/taskmgr/about.c +++ b/reactos/subsys/system/taskmgr/about.c @@ -21,14 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include - -#include "about.h" INT_PTR CALLBACK AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/subsys/system/taskmgr/affinity.c b/reactos/subsys/system/taskmgr/affinity.c index 9bc30b64734..3afacd3b459 100644 --- a/reactos/subsys/system/taskmgr/affinity.c +++ b/reactos/subsys/system/taskmgr/affinity.c @@ -22,17 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "procpage.h" -#include "affinity.h" -#include "perfdata.h" HANDLE hProcessAffinityHandle; TCHAR szTemp[256]; diff --git a/reactos/subsys/system/taskmgr/applpage.c b/reactos/subsys/system/taskmgr/applpage.c index 29a918da91b..ee547ceb86d 100644 --- a/reactos/subsys/system/taskmgr/applpage.c +++ b/reactos/subsys/system/taskmgr/applpage.c @@ -22,15 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include - -#include "applpage.h" -#include "procpage.h" typedef struct { @@ -370,7 +361,7 @@ void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung) /* It is not already in the list so add it */ else { - pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)malloc(sizeof(APPLICATION_PAGE_LIST_ITEM)); + pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)HeapAlloc(GetProcessHeap(), 0, sizeof(APPLICATION_PAGE_LIST_ITEM)); pAPLI->hWnd = hWnd; pAPLI->hIcon = hIcon; @@ -409,7 +400,7 @@ void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung) ImageList_Remove(hImageListSmall, item.iItem); ListView_DeleteItem(hApplicationPageListCtrl, item.iItem); - free(pAPLI); + HeapFree(GetProcessHeap(), 0, pAPLI); bItemRemoved = TRUE; } } @@ -704,7 +695,7 @@ void ApplicationPage_OnWindowsTileHorizontally(void) HWND* hWndArray; int nWndCount; - hWndArray = (HWND*)malloc(sizeof(HWND) * ListView_GetItemCount(hApplicationPageListCtrl)); + hWndArray = (HWND*)HeapAlloc(GetProcessHeap(), 0, sizeof(HWND) * ListView_GetItemCount(hApplicationPageListCtrl)); nWndCount = 0; for (i=0; i -#include -#include -#include -#include -#include - -#include "column.h" -#include "procpage.h" UINT ColumnDataHints[25]; TCHAR szTemp[256]; diff --git a/reactos/subsys/system/taskmgr/dbgchnl.c b/reactos/subsys/system/taskmgr/dbgchnl.c index c031bc7179b..aedc5f995c5 100644 --- a/reactos/subsys/system/taskmgr/dbgchnl.c +++ b/reactos/subsys/system/taskmgr/dbgchnl.c @@ -21,20 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "procpage.h" -#include "perfdata.h" -#include "column.h" -#include "proclist.h" -#include "dbgchnl.h" -#include /* TODO: * - the dialog box could be non modal diff --git a/reactos/subsys/system/taskmgr/debug.c b/reactos/subsys/system/taskmgr/debug.c index 728096bbfd8..a6b9b4c92d9 100644 --- a/reactos/subsys/system/taskmgr/debug.c +++ b/reactos/subsys/system/taskmgr/debug.c @@ -22,17 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "procpage.h" -#include "perfdata.h" void ProcessPage_OnDebug(void) { diff --git a/reactos/subsys/system/taskmgr/endproc.c b/reactos/subsys/system/taskmgr/endproc.c index c79a731ca32..df0073baebd 100644 --- a/reactos/subsys/system/taskmgr/endproc.c +++ b/reactos/subsys/system/taskmgr/endproc.c @@ -22,17 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "endproc.h" -#include "procpage.h" -#include "perfdata.h" TCHAR szTemp[256]; TCHAR szTempA[256]; diff --git a/reactos/subsys/system/taskmgr/font.c b/reactos/subsys/system/taskmgr/font.c index d5369bacdeb..1b599c5eb11 100644 --- a/reactos/subsys/system/taskmgr/font.c +++ b/reactos/subsys/system/taskmgr/font.c @@ -21,14 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include - -#include "font.h" void Font_DrawText(HDC hDC, LPCTSTR lpszText, int x, int y) { diff --git a/reactos/subsys/system/taskmgr/graph.c b/reactos/subsys/system/taskmgr/graph.c index 861e36d9930..51f4f73b261 100644 --- a/reactos/subsys/system/taskmgr/graph.c +++ b/reactos/subsys/system/taskmgr/graph.c @@ -21,18 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "graph.h" -#include "font.h" -#include "perfdata.h" - LONG OldGraphWndProc; diff --git a/reactos/subsys/system/taskmgr/graphctl.c b/reactos/subsys/system/taskmgr/graphctl.c index 65ad43efd62..d8e2392c885 100644 --- a/reactos/subsys/system/taskmgr/graphctl.c +++ b/reactos/subsys/system/taskmgr/graphctl.c @@ -21,15 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include - -#include -#include "graphctl.h" LONG OldGraphCtrlWndProc; diff --git a/reactos/subsys/system/taskmgr/makefile b/reactos/subsys/system/taskmgr/makefile index 75bf4f700f7..cd1ba71805a 100644 --- a/reactos/subsys/system/taskmgr/makefile +++ b/reactos/subsys/system/taskmgr/makefile @@ -16,7 +16,7 @@ TARGET_INSTALLDIR = system32 TARGET_PCH = precomp.h -TARGET_CFLAGS = -Werror -Wall -DDBG -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API +TARGET_CFLAGS = -Werror -Wall -DDBG -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API TARGET_SDKLIBS = ntdll.a kernel32.a user32.a gdi32.a comctl32.a diff --git a/reactos/subsys/system/taskmgr/optnmenu.c b/reactos/subsys/system/taskmgr/optnmenu.c index ea159017afd..5377b58e123 100644 --- a/reactos/subsys/system/taskmgr/optnmenu.c +++ b/reactos/subsys/system/taskmgr/optnmenu.c @@ -27,15 +27,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include - -#include "optnmenu.h" -#include "procpage.h" void TaskManager_OnOptionsAlwaysOnTop(void) { diff --git a/reactos/subsys/system/taskmgr/perfdata.c b/reactos/subsys/system/taskmgr/perfdata.c index 595c43a2994..d1efd5d769b 100644 --- a/reactos/subsys/system/taskmgr/perfdata.c +++ b/reactos/subsys/system/taskmgr/perfdata.c @@ -21,19 +21,8 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include -#include "perfdata.h" -PROCNTQSI NtQuerySystemInformation = NULL; -PROCGGR pGetGuiResources = NULL; -PROCGPIC pGetProcessIoCounters = NULL; -CRITICAL_SECTION PerfDataCriticalSection; +CRITICAL_SECTION PerfDataCriticalSection; PPERFDATA pPerfDataOld = NULL; /* Older perf data (saved to establish delta values) */ PPERFDATA pPerfData = NULL; /* Most recent copy of perf data */ ULONG ProcessCountOld = 0; @@ -48,21 +37,14 @@ SYSTEM_PERFORMANCE_INFORMATION SystemPerfInfo; SYSTEM_BASIC_INFORMATION SystemBasicInfo; SYSTEM_CACHE_INFORMATION SystemCacheInfo; SYSTEM_HANDLE_INFORMATION SystemHandleInfo; -PSYSTEM_PROCESSORTIME_INFO SystemProcessorTimeInfo = NULL; +PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo = NULL; BOOL PerfDataInitialize(void) { - LONG status; - - NtQuerySystemInformation = (PROCNTQSI)GetProcAddress(GetModuleHandle(_T("ntdll.dll")), "NtQuerySystemInformation"); - pGetGuiResources = (PROCGGR)GetProcAddress(GetModuleHandle(_T("user32.dll")), "GetGuiResources"); - pGetProcessIoCounters = (PROCGPIC)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetProcessIoCounters"); + NTSTATUS status; InitializeCriticalSection(&PerfDataCriticalSection); - if (!NtQuerySystemInformation) - return FALSE; - /* * Get number of processors in the system */ @@ -75,15 +57,13 @@ BOOL PerfDataInitialize(void) void PerfDataUninitialize(void) { - NtQuerySystemInformation = NULL; - DeleteCriticalSection(&PerfDataCriticalSection); } void PerfDataRefresh(void) { ULONG ulSize; - LONG status; + NTSTATUS status; LPBYTE pBuffer; ULONG BufferSize; PSYSTEM_PROCESS_INFORMATION pSPI; @@ -94,18 +74,14 @@ void PerfDataRefresh(void) TCHAR szTemp[MAX_PATH]; DWORD dwSize; SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo; - SYSTEM_TIME_INFORMATION SysTimeInfo; + SYSTEM_TIMEOFDAY_INFORMATION SysTimeInfo; SYSTEM_CACHE_INFORMATION SysCacheInfo; LPBYTE SysHandleInfoData; - PSYSTEM_PROCESSORTIME_INFO SysProcessorTimeInfo; + PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcessorTimeInfo; double CurrentKernelTime; - - if (!NtQuerySystemInformation) - return; - /* Get new system time */ - status = NtQuerySystemInformation(SystemTimeInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0); + status = NtQuerySystemInformation(SystemTimeOfDayInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0); if (status != NO_ERROR) return; @@ -120,8 +96,8 @@ void PerfDataRefresh(void) return; /* Get processor time information */ - SysProcessorTimeInfo = (PSYSTEM_PROCESSORTIME_INFO)malloc(sizeof(SYSTEM_PROCESSORTIME_INFO) * SystemBasicInfo.bKeNumberProcessors); - status = NtQuerySystemInformation(SystemProcessorTimeInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSORTIME_INFO) * SystemBasicInfo.bKeNumberProcessors, &ulSize); + 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); if (status != NO_ERROR) return; @@ -133,12 +109,12 @@ void PerfDataRefresh(void) do { BufferSize += 0x10000; - SysHandleInfoData = (LPBYTE)malloc(BufferSize); + SysHandleInfoData = (LPBYTE)HeapAlloc(GetProcessHeap(), 0, BufferSize); status = NtQuerySystemInformation(SystemHandleInformation, SysHandleInfoData, BufferSize, &ulSize); if (status == 0xC0000004 /*STATUS_INFO_LENGTH_MISMATCH*/) { - free(SysHandleInfoData); + HeapFree(GetProcessHeap(), 0, SysHandleInfoData); } } while (status == 0xC0000004 /*STATUS_INFO_LENGTH_MISMATCH*/); @@ -151,12 +127,12 @@ void PerfDataRefresh(void) do { BufferSize += 0x10000; - pBuffer = (LPBYTE)malloc(BufferSize); + pBuffer = (LPBYTE)HeapAlloc(GetProcessHeap(), 0, BufferSize); status = NtQuerySystemInformation(SystemProcessInformation, pBuffer, BufferSize, &ulSize); if (status == 0xC0000004 /*STATUS_INFO_LENGTH_MISMATCH*/) { - free(pBuffer); + HeapFree(GetProcessHeap(), 0, pBuffer); } } while (status == 0xC0000004 /*STATUS_INFO_LENGTH_MISMATCH*/); @@ -177,7 +153,7 @@ void PerfDataRefresh(void) * Save system processor time info */ if (SystemProcessorTimeInfo) { - free(SystemProcessorTimeInfo); + HeapFree(GetProcessHeap(), 0, SystemProcessorTimeInfo); } SystemProcessorTimeInfo = SysProcessorTimeInfo; @@ -185,9 +161,9 @@ void PerfDataRefresh(void) * Save system handle info */ memcpy(&SystemHandleInfo, SysHandleInfoData, sizeof(SYSTEM_HANDLE_INFORMATION)); - free(SysHandleInfoData); + HeapFree(GetProcessHeap(), 0, SysHandleInfoData); - for (CurrentKernelTime=0, Idx=0; IdxRelativeOffset == 0) + if (pSPI->NextEntryOffset == 0) break; - pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->RelativeOffset); + pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->NextEntryOffset); } /* Now alloc a new PERFDATA array and fill in the data */ if (pPerfDataOld) { - free(pPerfDataOld); + HeapFree(GetProcessHeap(), 0, pPerfDataOld); } pPerfDataOld = pPerfData; - pPerfData = (PPERFDATA)malloc(sizeof(PERFDATA) * ProcessCount); + pPerfData = (PPERFDATA)HeapAlloc(GetProcessHeap(), 0, sizeof(PERFDATA) * ProcessCount); pSPI = (PSYSTEM_PROCESS_INFORMATION)pBuffer; for (Idx=0; IdxProcessId) { + if (pPerfDataOld[Idx2].ProcessId == pSPI->UniqueProcessId) { pPDOld = &pPerfDataOld[Idx2]; break; } @@ -249,25 +225,26 @@ void PerfDataRefresh(void) /* Clear out process perf data structure */ memset(&pPerfData[Idx], 0, sizeof(PERFDATA)); - if (pSPI->Name.Buffer) - wcscpy(pPerfData[Idx].ImageName, pSPI->Name.Buffer); + if (pSPI->ImageName.Buffer) + wcscpy(pPerfData[Idx].ImageName, pSPI->ImageName.Buffer); else - wcscpy(pPerfData[Idx].ImageName, L"System Idle Process"); + LoadStringW(hInst, IDS_IDLE_PROCESS, pPerfData[Idx].ImageName, + sizeof(pPerfData[Idx].ImageName) / sizeof(pPerfData[Idx].ImageName[0])); - pPerfData[Idx].ProcessId = pSPI->ProcessId; + pPerfData[Idx].ProcessId = pSPI->UniqueProcessId; if (pPDOld) { 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.bKeNumberProcessors; /* + 0.5; */ + CpuTime = CpuTime * 100.0 / (double)SystemBasicInfo.NumberProcessors; /* + 0.5; */ pPerfData[Idx].CPUUsage = (ULONG)CpuTime; } pPerfData[Idx].CPUTime.QuadPart = pSPI->UserTime.QuadPart + pSPI->KernelTime.QuadPart; - pPerfData[Idx].WorkingSetSizeBytes = pSPI->TotalWorkingSetSizeBytes; - pPerfData[Idx].PeakWorkingSetSizeBytes = pSPI->PeakWorkingSetSizeBytes; + pPerfData[Idx].WorkingSetSizeBytes = pSPI->WorkingSetSize; + pPerfData[Idx].PeakWorkingSetSizeBytes = pSPI->PeakWorkingSetSize; if (pPDOld) - pPerfData[Idx].WorkingSetSizeDelta = labs((LONG)pSPI->TotalWorkingSetSizeBytes - (LONG)pPDOld->WorkingSetSizeBytes); + pPerfData[Idx].WorkingSetSizeDelta = labs((LONG)pSPI->WorkingSetSize - (LONG)pPDOld->WorkingSetSizeBytes); else pPerfData[Idx].WorkingSetSizeDelta = 0; pPerfData[Idx].PageFaultCount = pSPI->PageFaultCount; @@ -275,15 +252,15 @@ void PerfDataRefresh(void) pPerfData[Idx].PageFaultCountDelta = labs((LONG)pSPI->PageFaultCount - (LONG)pPDOld->PageFaultCount); else pPerfData[Idx].PageFaultCountDelta = 0; - pPerfData[Idx].VirtualMemorySizeBytes = pSPI->TotalVirtualSizeBytes; - pPerfData[Idx].PagedPoolUsagePages = pSPI->TotalPagedPoolUsagePages; - pPerfData[Idx].NonPagedPoolUsagePages = pSPI->TotalNonPagedPoolUsagePages; + pPerfData[Idx].VirtualMemorySizeBytes = pSPI->VirtualSize; + pPerfData[Idx].PagedPoolUsagePages = pSPI->QuotaPagedPoolUsage; + pPerfData[Idx].NonPagedPoolUsagePages = pSPI->QuotaPeakNonPagedPoolUsage; pPerfData[Idx].BasePriority = pSPI->BasePriority; pPerfData[Idx].HandleCount = pSPI->HandleCount; - pPerfData[Idx].ThreadCount = pSPI->ThreadCount; + pPerfData[Idx].ThreadCount = pSPI->NumberOfThreads; pPerfData[Idx].SessionId = pSPI->SessionId; - hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pSPI->ProcessId); + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, (DWORD)pSPI->UniqueProcessId); if (hProcess) { if (OpenProcessToken(hProcess, TOKEN_QUERY|TOKEN_DUPLICATE|TOKEN_IMPERSONATE, &hProcessToken)) { ImpersonateLoggedOnUser(hProcessToken); @@ -306,19 +283,16 @@ int MultiByteToWideChar( RevertToSelf(); CloseHandle(hProcessToken); } - if (pGetGuiResources) { - pPerfData[Idx].USERObjectCount = pGetGuiResources(hProcess, GR_USEROBJECTS); - pPerfData[Idx].GDIObjectCount = pGetGuiResources(hProcess, GR_GDIOBJECTS); - } - if (pGetProcessIoCounters) - pGetProcessIoCounters(hProcess, &pPerfData[Idx].IOCounters); + pPerfData[Idx].USERObjectCount = GetGuiResources(hProcess, GR_USEROBJECTS); + pPerfData[Idx].GDIObjectCount = GetGuiResources(hProcess, GR_GDIOBJECTS); + GetProcessIoCounters(hProcess, &pPerfData[Idx].IOCounters); CloseHandle(hProcess); } pPerfData[Idx].UserTime.QuadPart = pSPI->UserTime.QuadPart; pPerfData[Idx].KernelTime.QuadPart = pSPI->KernelTime.QuadPart; - pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->RelativeOffset); + pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->NextEntryOffset); } - free(pBuffer); + HeapFree(GetProcessHeap(), 0, pBuffer); LeaveCriticalSection(&PerfDataCriticalSection); } @@ -365,7 +339,7 @@ ULONG PerfDataGetProcessId(ULONG Index) EnterCriticalSection(&PerfDataCriticalSection); if (Index < ProcessCount) - ProcessId = pPerfData[Index].ProcessId; + ProcessId = (ULONG)pPerfData[Index].ProcessId; else ProcessId = 0; @@ -677,8 +651,8 @@ ULONG PerfDataGetCommitChargeTotalK(void) EnterCriticalSection(&PerfDataCriticalSection); - Total = SystemPerfInfo.MmTotalCommitedPages; - PageSize = SystemBasicInfo.uPageSize; + Total = SystemPerfInfo.TotalCommittedPages; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -694,8 +668,8 @@ ULONG PerfDataGetCommitChargeLimitK(void) EnterCriticalSection(&PerfDataCriticalSection); - Limit = SystemPerfInfo.MmTotalCommitLimit; - PageSize = SystemBasicInfo.uPageSize; + Limit = SystemPerfInfo.TotalCommitLimit; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -711,8 +685,8 @@ ULONG PerfDataGetCommitChargePeakK(void) EnterCriticalSection(&PerfDataCriticalSection); - Peak = SystemPerfInfo.MmPeakLimit; - PageSize = SystemBasicInfo.uPageSize; + Peak = SystemPerfInfo.PeakCommitment; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -730,9 +704,9 @@ ULONG PerfDataGetKernelMemoryTotalK(void) EnterCriticalSection(&PerfDataCriticalSection); - Paged = SystemPerfInfo.PoolPagedBytes; - NonPaged = SystemPerfInfo.PoolNonPagedBytes; - PageSize = SystemBasicInfo.uPageSize; + Paged = SystemPerfInfo.PagedPoolUsage; + NonPaged = SystemPerfInfo.NonPagedPoolUsage; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -751,8 +725,8 @@ ULONG PerfDataGetKernelMemoryPagedK(void) EnterCriticalSection(&PerfDataCriticalSection); - Paged = SystemPerfInfo.PoolPagedBytes; - PageSize = SystemBasicInfo.uPageSize; + Paged = SystemPerfInfo.PagedPoolUsage; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -768,8 +742,8 @@ ULONG PerfDataGetKernelMemoryNonPagedK(void) EnterCriticalSection(&PerfDataCriticalSection); - NonPaged = SystemPerfInfo.PoolNonPagedBytes; - PageSize = SystemBasicInfo.uPageSize; + NonPaged = SystemPerfInfo.NonPagedPoolUsage; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -785,8 +759,8 @@ ULONG PerfDataGetPhysicalMemoryTotalK(void) EnterCriticalSection(&PerfDataCriticalSection); - Total = SystemBasicInfo.uMmNumberOfPhysicalPages; - PageSize = SystemBasicInfo.uPageSize; + Total = SystemBasicInfo.NumberOfPhysicalPages; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -802,8 +776,8 @@ ULONG PerfDataGetPhysicalMemoryAvailableK(void) EnterCriticalSection(&PerfDataCriticalSection); - Available = SystemPerfInfo.MmAvailablePages; - PageSize = SystemBasicInfo.uPageSize; + Available = SystemPerfInfo.AvailablePages; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -820,7 +794,7 @@ ULONG PerfDataGetPhysicalMemorySystemCacheK(void) EnterCriticalSection(&PerfDataCriticalSection); SystemCache = SystemCacheInfo.CurrentSize; - PageSize = SystemBasicInfo.uPageSize; + PageSize = SystemBasicInfo.PhysicalPageSize; LeaveCriticalSection(&PerfDataCriticalSection); @@ -836,7 +810,7 @@ ULONG PerfDataGetSystemHandleCount(void) EnterCriticalSection(&PerfDataCriticalSection); - HandleCount = SystemHandleInfo.Count; + HandleCount = SystemHandleInfo.NumberOfHandles; LeaveCriticalSection(&PerfDataCriticalSection); diff --git a/reactos/subsys/system/taskmgr/perfdata.h b/reactos/subsys/system/taskmgr/perfdata.h index 44766e7558e..27f8dc860e1 100644 --- a/reactos/subsys/system/taskmgr/perfdata.h +++ b/reactos/subsys/system/taskmgr/perfdata.h @@ -27,27 +27,12 @@ extern "C" { #endif - -#if 0 -typedef struct _TIME { - DWORD LowPart; - LONG HighPart; -} TIME, *PTIME; -#endif - -typedef ULARGE_INTEGER TIME, *PTIME; - -/* typedef WCHAR UNICODE_STRING; */ -typedef struct _UNICODE_STRING { - USHORT Length; - USHORT MaximumLength; - PWSTR Buffer; -} UNICODE_STRING, *PUNICODE_STRING; +#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart)) typedef struct _PERFDATA { WCHAR ImageName[MAX_PATH]; - ULONG ProcessId; + HANDLE ProcessId; WCHAR UserName[MAX_PATH]; ULONG SessionId; ULONG CPUUsage; @@ -71,277 +56,6 @@ typedef struct _PERFDATA TIME KernelTime; } PERFDATA, *PPERFDATA; -typedef struct _CLIENT_ID -{ - HANDLE UniqueProcess; - HANDLE UniqueThread; -} CLIENT_ID, *PCLIENT_ID; - -typedef enum _KWAIT_REASON -{ - Executive, - FreePage, - PageIn, - PoolAllocation, - DelayExecution, - Suspended, - UserRequest, - WrExecutive, - WrFreePage, - WrPageIn, - WrDelayExecution, - WrSuspended, - WrUserRequest, - WrQueue, - WrLpcReceive, - WrLpcReply, - WrVirtualMemory, - WrPageOut, - WrRendezvous, - Spare2, - Spare3, - Spare4, - Spare5, - Spare6, - WrKernel, - MaximumWaitReason, -} KWAIT_REASON; - -/* SystemProcessThreadInfo (5) */ -typedef struct _SYSTEM_THREAD_INFORMATION -{ - TIME KernelTime; - TIME UserTime; - TIME CreateTime; - ULONG TickCount; - ULONG StartEIP; - CLIENT_ID ClientId; - ULONG DynamicPriority; - ULONG BasePriority; - ULONG nSwitches; - DWORD State; - KWAIT_REASON WaitReason; - -} SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; - -typedef struct SYSTEM_PROCESS_INFORMATION -{ - ULONG RelativeOffset; - ULONG ThreadCount; - ULONG Unused1 [6]; - TIME CreateTime; - TIME UserTime; - TIME KernelTime; - UNICODE_STRING Name; - ULONG BasePriority; - ULONG ProcessId; - ULONG ParentProcessId; - ULONG HandleCount; - ULONG SessionId; - ULONG Unused2; - ULONG PeakVirtualSizeBytes; - ULONG TotalVirtualSizeBytes; - ULONG PageFaultCount; - ULONG PeakWorkingSetSizeBytes; - ULONG TotalWorkingSetSizeBytes; - ULONG PeakPagedPoolUsagePages; - ULONG TotalPagedPoolUsagePages; - ULONG PeakNonPagedPoolUsagePages; - ULONG TotalNonPagedPoolUsagePages; - ULONG TotalPageFileUsageBytes; - ULONG PeakPageFileUsageBytes; - ULONG TotalPrivateBytes; - SYSTEM_THREAD_INFORMATION ThreadSysInfo [1]; - -} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; - -typedef struct -{ - DWORD dwUnknown1; - ULONG uKeMaximumIncrement; - ULONG uPageSize; - ULONG uMmNumberOfPhysicalPages; - ULONG uMmLowestPhysicalPage; - ULONG uMmHighestPhysicalPage; - ULONG uAllocationGranularity; - PVOID pLowestUserAddress; - PVOID pMmHighestUserAddress; - ULONG uKeActiveProcessors; - BYTE bKeNumberProcessors; - BYTE bUnknown2; - WORD wUnknown3; -} SYSTEM_BASIC_INFORMATION; - -/* SystemPerformanceInfo (2) */ -typedef struct _SYSTEM_PERFORMANCE_INFORMATION -{ - LARGE_INTEGER /*TotalProcessorTime*/liIdleTime; - LARGE_INTEGER IoReadTransferCount; - LARGE_INTEGER IoWriteTransferCount; - LARGE_INTEGER IoOtherTransferCount; - ULONG IoReadOperationCount; - ULONG IoWriteOperationCount; - ULONG IoOtherOperationCount; - ULONG MmAvailablePages; - ULONG MmTotalCommitedPages; - ULONG MmTotalCommitLimit; - ULONG MmPeakLimit; - ULONG PageFaults; - ULONG WriteCopies; - ULONG TransitionFaults; - ULONG Unknown1; - ULONG DemandZeroFaults; - ULONG PagesInput; - ULONG PagesRead; - ULONG Unknown2; - ULONG Unknown3; - ULONG PagesOutput; - ULONG PageWrites; - ULONG Unknown4; - ULONG Unknown5; - ULONG PoolPagedBytes; - ULONG PoolNonPagedBytes; - ULONG Unknown6; - ULONG Unknown7; - ULONG Unknown8; - ULONG Unknown9; - ULONG MmTotalSystemFreePtes; - ULONG MmSystemCodepage; - ULONG MmTotalSystemDriverPages; - ULONG MmTotalSystemCodePages; - ULONG Unknown10; - ULONG Unknown11; - ULONG Unknown12; - ULONG MmSystemCachePage; - ULONG MmPagedPoolPage; - ULONG MmSystemDriverPage; - ULONG CcFastReadNoWait; - ULONG CcFastReadWait; - ULONG CcFastReadResourceMiss; - ULONG CcFastReadNotPossible; - ULONG CcFastMdlReadNoWait; - ULONG CcFastMdlReadWait; - ULONG CcFastMdlReadResourceMiss; - ULONG CcFastMdlReadNotPossible; - ULONG CcMapDataNoWait; - ULONG CcMapDataWait; - ULONG CcMapDataNoWaitMiss; - ULONG CcMapDataWaitMiss; - ULONG CcPinMappedDataCount; - ULONG CcPinReadNoWait; - ULONG CcPinReadWait; - ULONG CcPinReadNoWaitMiss; - ULONG CcPinReadWaitMiss; - ULONG CcCopyReadNoWait; - ULONG CcCopyReadWait; - ULONG CcCopyReadNoWaitMiss; - ULONG CcCopyReadWaitMiss; - ULONG CcMdlReadNoWait; - ULONG CcMdlReadWait; - ULONG CcMdlReadNoWaitMiss; - ULONG CcMdlReadWaitMiss; - ULONG CcReadaheadIos; - ULONG CcLazyWriteIos; - ULONG CcLazyWritePages; - ULONG CcDataFlushes; - ULONG CcDataPages; - ULONG ContextSwitches; - ULONG Unknown13; - ULONG Unknown14; - ULONG SystemCalls; - -} SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION; - -typedef struct -{ - LARGE_INTEGER liKeBootTime; - LARGE_INTEGER liKeSystemTime; - LARGE_INTEGER liExpTimeZoneBias; - ULONG uCurrentTimeZoneId; - DWORD dwReserved; -} SYSTEM_TIME_INFORMATION; - -/* SystemCacheInformation (21) */ -typedef struct _SYSTEM_CACHE_INFORMATION -{ - ULONG CurrentSize; - ULONG PeakSize; - ULONG PageFaultCount; - ULONG MinimumWorkingSet; - ULONG MaximumWorkingSet; - ULONG Unused[4]; - -} SYSTEM_CACHE_INFORMATION; - -/* SystemPageFileInformation (18) */ -typedef -struct _SYSTEM_PAGEFILE_INFORMATION -{ - ULONG RelativeOffset; - ULONG CurrentSizePages; - ULONG TotalUsedPages; - ULONG PeakUsedPages; - UNICODE_STRING PagefileFileName; - -} SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION; - -/* SystemHandleInformation (16) */ -/* (see ontypes.h) */ -typedef -struct _SYSTEM_HANDLE_ENTRY -{ - ULONG OwnerPid; - BYTE ObjectType; - BYTE HandleFlags; - USHORT HandleValue; - PVOID ObjectPointer; - ULONG AccessMask; - -} SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY; - -typedef -struct _SYSTEM_HANDLE_INFORMATION -{ - ULONG Count; - SYSTEM_HANDLE_ENTRY Handle [1]; - -} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; - -/* SystemProcessorPerformanceInformation (8) */ -typedef -struct _SYSTEM_PROCESSORTIME_INFO -{ - LARGE_INTEGER IdleTime; - LARGE_INTEGER KernelTime; - LARGE_INTEGER UserTime; - LARGE_INTEGER DpcTime; - LARGE_INTEGER InterruptTime; - ULONG InterruptCount; - ULONG Unused; - -} SYSTEM_PROCESSORTIME_INFO, *PSYSTEM_PROCESSORTIME_INFO; - -#define SystemBasicInformation 0 -#define SystemPerformanceInformation 2 -#define SystemTimeInformation 3 -#define SystemProcessInformation 5 -#define SystemProcessorTimeInformation 8 -#define SystemHandleInformation 16 -#define SystemPageFileInformation 18 -#define SystemCacheInformation 21 - -#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart)) - -#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000 -#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000 - -#define GR_GDIOBJECTS 0 /* Count of GDI objects */ -#define GR_USEROBJECTS 1 /* Count of USER objects */ - -typedef LONG (WINAPI *PROCNTQSI)(UINT,PVOID,ULONG,PULONG); -typedef DWORD (WINAPI *PROCGGR)(HANDLE,DWORD); -typedef BOOL (WINAPI *PROCGPIC)(HANDLE,PIO_COUNTERS); - BOOL PerfDataInitialize(void); void PerfDataUninitialize(void); void PerfDataRefresh(void); diff --git a/reactos/subsys/system/taskmgr/perfpage.c b/reactos/subsys/system/taskmgr/perfpage.c index 119fbe384ba..b3e9a12dc07 100644 --- a/reactos/subsys/system/taskmgr/perfpage.c +++ b/reactos/subsys/system/taskmgr/perfpage.c @@ -21,19 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "perfpage.h" -#include "perfdata.h" - -#include "graph.h" -#include "graphctl.h" TGraphCtrl PerformancePageCpuUsageHistoryGraph; TGraphCtrl PerformancePageMemUsageHistoryGraph; diff --git a/reactos/subsys/system/taskmgr/precomp.h b/reactos/subsys/system/taskmgr/precomp.h index 16ac717d58c..f4d5e011207 100644 --- a/reactos/subsys/system/taskmgr/precomp.h +++ b/reactos/subsys/system/taskmgr/precomp.h @@ -1,3 +1,30 @@ -#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ +#define NTOS_MODE_USER +#include #include +#include +#include +#include +#include +#include +#include +#include + #include "taskmgr.h" +#include "perfdata.h" +#include "perfpage.h" +#include "about.h" +#include "procpage.h" +#include "proclist.h" +#include "affinity.h" +#include "applpage.h" +#include "column.h" +#include "dbgchnl.h" +#include "debug.h" +#include "endproc.h" +#include "font.h" +#include "graph.h" +#include "graphctl.h" +#include "optnmenu.h" +#include "priority.h" +#include "run.h" +#include "trayicon.h" diff --git a/reactos/subsys/system/taskmgr/priority.c b/reactos/subsys/system/taskmgr/priority.c index 877cff4c8b0..888d7abf378 100644 --- a/reactos/subsys/system/taskmgr/priority.c +++ b/reactos/subsys/system/taskmgr/priority.c @@ -22,17 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "priority.h" -#include "procpage.h" -#include "perfdata.h" TCHAR szTemp[256]; TCHAR szTempA[256]; diff --git a/reactos/subsys/system/taskmgr/proclist.c b/reactos/subsys/system/taskmgr/proclist.c index 3b544a64dc4..281147c867d 100644 --- a/reactos/subsys/system/taskmgr/proclist.c +++ b/reactos/subsys/system/taskmgr/proclist.c @@ -21,17 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "procpage.h" -#include "proclist.h" -#include "perfdata.h" INT_PTR CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/reactos/subsys/system/taskmgr/procpage.c b/reactos/subsys/system/taskmgr/procpage.c index 7d872f9ca40..1e1d8e9c5f7 100644 --- a/reactos/subsys/system/taskmgr/procpage.c +++ b/reactos/subsys/system/taskmgr/procpage.c @@ -21,21 +21,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "procpage.h" -#include "perfdata.h" -#include "column.h" -#include "proclist.h" -#include "dbgchnl.h" -#include "endproc.h" -#include HWND hProcessPage; /* Process List Property Page */ diff --git a/reactos/subsys/system/taskmgr/resource.h b/reactos/subsys/system/taskmgr/resource.h index 4b248e19c90..e82c9d9d94d 100644 --- a/reactos/subsys/system/taskmgr/resource.h +++ b/reactos/subsys/system/taskmgr/resource.h @@ -2,6 +2,7 @@ // Microsoft Developer Studio generated include file. // Used by TaskMgr.rc // +#define IDS_IDLE_PROCESS 102 #define IDD_TASKMGR_DIALOG 102 #define IDD_ABOUTBOX 103 #define IDS_APP_TITLE 103 diff --git a/reactos/subsys/system/taskmgr/run.c b/reactos/subsys/system/taskmgr/run.c index 052c99fe9d5..08a228bf737 100644 --- a/reactos/subsys/system/taskmgr/run.c +++ b/reactos/subsys/system/taskmgr/run.c @@ -22,14 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include - -#include "run.h" void TaskManager_OnFileNew(void) { diff --git a/reactos/subsys/system/taskmgr/taskmgr.c b/reactos/subsys/system/taskmgr/taskmgr.c index 13eb8185444..751fe7e2f2e 100644 --- a/reactos/subsys/system/taskmgr/taskmgr.c +++ b/reactos/subsys/system/taskmgr/taskmgr.c @@ -22,29 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "resource.h" -#include "applpage.h" -#include "procpage.h" -#include "perfpage.h" -#include "run.h" -#include "perfdata.h" -#include "optnmenu.h" -#include "affinity.h" -#include "priority.h" -#include "debug.h" -#include "endproc.h" -#include "column.h" -#include "about.h" -#include "trayicon.h" -#include "dbgchnl.h" #define STATUS_WINDOW 2001 diff --git a/reactos/subsys/system/taskmgr/trayicon.c b/reactos/subsys/system/taskmgr/trayicon.c index 29acba67412..dfc4e5a1c88 100644 --- a/reactos/subsys/system/taskmgr/trayicon.c +++ b/reactos/subsys/system/taskmgr/trayicon.c @@ -22,17 +22,6 @@ */ #include "precomp.h" -#include -#include -#include -#include -#include -#include -#include - -#include "trayicon.h" -#include "perfdata.h" -#include "shellapi.h" HICON TrayIcon_GetProcessorUsageIcon(void) {