Commit 31f88936 authored by Alexandre Julliard's avatar Alexandre Julliard

taskmgr: Use definitions from winternl.h instead of duplicating them.

parent 69abf20f
......@@ -1363,7 +1363,7 @@ typedef struct _SYSTEM_PROCESS_INFORMATION {
HANDLE UniqueProcessId; /* 44/50 */
HANDLE ParentProcessId; /* 48/58 */
ULONG HandleCount; /* 4c/60 */
DWORD dwUnknown3; /* 50/64 */
ULONG SessionId; /* 50/64 */
DWORD dwUnknown4; /* 54/68 */
VM_COUNTERS vmCounters; /* 58/70 */
IO_COUNTERS ioCounters; /* 88/d0 */
......
......@@ -23,25 +23,9 @@
#ifndef __PERFDATA_H
#define __PERFDATA_H
#ifdef __cplusplus
extern "C" {
#endif
#include "winternl.h"
#if 0
typedef struct _TIME {
DWORD LowPart;
LONG HighPart;
} TIME, *PTIME;
#endif
typedef ULARGE_INTEGER TIME, *PTIME;
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING, *PUNICODE_STRING;
typedef ULARGE_INTEGER TIME;
typedef struct _PERFDATA
{
......@@ -51,227 +35,20 @@ typedef struct _PERFDATA
ULONG SessionId;
ULONG CPUUsage;
TIME CPUTime;
ULONG WorkingSetSizeBytes;
ULONG PeakWorkingSetSizeBytes;
ULONG WorkingSetSizeDelta;
ULONG PageFaultCount;
ULONG PageFaultCountDelta;
ULONG VirtualMemorySizeBytes;
ULONG PagedPoolUsagePages;
ULONG NonPagedPoolUsagePages;
ULONG BasePriority;
ULONG HandleCount;
ULONG ThreadCount;
ULONG USERObjectCount;
ULONG GDIObjectCount;
SIZE_T WorkingSetSizeDelta;
ULONG PageFaultCountDelta;
VM_COUNTERS vmCounters;
IO_COUNTERS IOCounters;
TIME UserTime;
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 MmTotalCommittedPages;
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
......@@ -281,54 +58,8 @@ struct _SYSTEM_PAGEFILE_INFORMATION
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).QuadPart))
#define GR_GDIOBJECTS 0 /* Count of GDI objects */
......@@ -339,7 +70,6 @@ typedef DWORD (WINAPI *PROCGGR)(HANDLE,DWORD);
typedef BOOL (WINAPI *PROCGPIC)(HANDLE,PIO_COUNTERS);
BOOL PerfDataInitialize(void);
void PerfDataUninitialize(void);
void PerfDataRefresh(void);
ULONG PerfDataGetProcessCount(void);
......@@ -383,9 +113,4 @@ ULONG PerfDataGetSystemHandleCount(void);
ULONG PerfDataGetTotalThreadCount(void);
#ifdef __cplusplus
};
#endif
#endif /* __PERFDATA_H */
......@@ -1101,6 +1101,5 @@ int APIENTRY WinMain(HINSTANCE hInstance,
/* Save our settings to the registry */
SaveSettings();
PerfDataUninitialize();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment