Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. winperf.h
  5. Abstract:
  6. This module contains the definit
  7. Author:
  8. Mark Lucovsky (markl) 28-Mar-1991
  9. Revision History:
  10. --*/
  11. #ifndef _WINPERFH_INCLUDED_
  12. #define _WINPERFH_INCLUDED_
  13. #define DIALOG_SUCCESS 100
  14. #define DIALOG_CANCEL 0
  15. #define IDM_EXIT 1100
  16. #define IDM_SELECT 1101
  17. #define IDM_ALL 1103
  18. #define TIMER_ID 1001
  19. #define IDM_CPU_GRP 1002
  20. #define IDM_PERF_GRP 1003
  21. #define IDM_SEL_DLG 1004
  22. #define IDM_STYLE_GRP 1005
  23. #define IDM_CPU0 101
  24. #define IDM_CPU1 102
  25. #define IDM_CPU2 103
  26. #define IDM_CPU3 104
  27. #define IDM_CPU4 105
  28. #define IDM_CPU5 106
  29. #define IDM_CPU6 107
  30. #define IDM_CPU7 108
  31. #define IDM_CPU8 109
  32. #define IDM_CPU9 110
  33. #define IDM_CPU10 111
  34. #define IDM_CPU11 112
  35. #define IDM_CPU12 113
  36. #define IDM_CPU13 114
  37. #define IDM_CPU14 115
  38. #define IDM_CPU15 116
  39. #define IDM_PGFLT 117
  40. #define IDM_PGAV 118
  41. #define IDM_CONTEXT 119
  42. #define IDM_1TB 120
  43. #define IDM_2TB 121
  44. #define IDM_SYSCALL 122
  45. #define IDM_INT 123
  46. #define IDM_POOL 124
  47. #define IDM_NONPOOL 125
  48. #define IDM_PROCESS 126
  49. #define IDM_THREAD 127
  50. #define IDM_ALIGN 128
  51. #define IDM_EXCEPT 129
  52. #define IDM_FLOAT 130
  53. #define IDM_INS_EMUL 131
  54. #define IDM_CPU_TOTAL 132
  55. #define IDM_SEL_LINE 133
  56. #define IDM_SEL_BAR 134
  57. #define WINPERF_ICON 1011
  58. #define CPUTHERM_ICON 1012
  59. #define BALL_BITMAP 1011
  60. #define CPU_STYLE_LINE 0
  61. #define CPU_STYLE_BAR 1
  62. #include "calcperf.h"
  63. typedef struct _WINPERF_INFO
  64. {
  65. DWORD WindowPositionX;
  66. DWORD WindowPositionY;
  67. DWORD WindowSizeX;
  68. DWORD WindowSizeY;
  69. DWORD DisplayElement[SAVE_SUBJECTS];
  70. DWORD DisplayMode;
  71. DWORD CpuStyle;
  72. HPEN hBluePen;
  73. HPEN hRedPen;
  74. HPEN hGreenPen;
  75. HPEN hMagentaPen;
  76. HPEN hYellowPen;
  77. HPEN hDotPen;
  78. HBRUSH hBackground;
  79. HBRUSH hRedBrush;
  80. HBRUSH hGreenBrush;
  81. HBRUSH hBlueBrush;
  82. HBRUSH hMagentaBrush;
  83. HBRUSH hYellowBrush;
  84. HBRUSH hLightBrush;
  85. HBRUSH hDarkBrush;
  86. HFONT LargeFont;
  87. HFONT MediumFont;
  88. HFONT SmallFont;
  89. HFONT hOldFont;
  90. HMENU hMenu;
  91. HWND hWndMain;
  92. UINT_PTR TimerId;
  93. UINT NumberOfProcessors;
  94. BOOL DisplayMenu;
  95. } WINPERF_INFO,*PWINPERF_INFO;
  96. BOOL
  97. InitApplication(
  98. HANDLE hInstance,
  99. HBRUSH hBackground
  100. );
  101. BOOL
  102. InitInstance(
  103. HANDLE hInstance,
  104. int nCmdShow
  105. );
  106. LRESULT APIENTRY
  107. MainWndProc(
  108. HWND hWnd,
  109. UINT message,
  110. WPARAM wParam,
  111. LPARAM lParam
  112. );
  113. LRESULT APIENTRY
  114. CpuWndProc(
  115. HWND hWnd,
  116. UINT message,
  117. WPARAM wParam,
  118. LPARAM lParam
  119. );
  120. BOOL
  121. APIENTRY About(
  122. HWND hDlg,
  123. UINT message,
  124. WPARAM wParam,
  125. LPARAM lParam
  126. );
  127. BOOL APIENTRY MoveToEx(IN HDC, IN int, IN int, OUT LPPOINT);
  128. BOOL APIENTRY SetViewportExtEx(IN HDC, IN int, IN int, OUT LPSIZE);
  129. BOOL APIENTRY SetViewportOrgEx(IN HDC, IN int, IN int, OUT LPPOINT);
  130. BOOL APIENTRY SetWindowExtEx(IN HDC, IN int, IN int, OUT LPSIZE);
  131. BOOL APIENTRY SetWindowOrgEx(IN HDC, IN int, IN int, OUT LPPOINT);
  132. BOOL APIENTRY GetWindowExtEx(IN HDC, OUT LPSIZE);
  133. BOOL APIENTRY GetCurrentPositionEx(IN HDC, OUT LPPOINT);
  134. BOOL APIENTRY MGetWindowExt(HDC hdc, INT * pcx, INT * pcy);
  135. BOOL APIENTRY MGetCurrentPosition(HDC hdc, INT * px, INT * py);
  136. HANDLE APIENTRY MGetInstHandle(VOID);
  137. LPSTR MGetCmdLine(VOID);
  138. VOID
  139. UpdateCpuMeter(
  140. IN HDC hDC,
  141. IN SHORT cxClient,
  142. IN SHORT cyClient
  143. );
  144. VOID
  145. DrawCpuMeter(
  146. IN HDC hDC,
  147. IN SHORT cxClient,
  148. IN SHORT cyClient,
  149. IN ULONG DisplayItem
  150. );
  151. VOID
  152. ReScalePerfWindow(
  153. IN HDC hDC,
  154. IN PDISPLAY_ITEM DisplayItem
  155. );
  156. BOOL
  157. CalcCpuTime(
  158. PDISPLAY_ITEM PerfListItem
  159. );
  160. ULONG
  161. InitPerfInfo(VOID);
  162. VOID
  163. InitProfileData(PWINPERF_INFO pWinperfInfo);
  164. VOID
  165. SaveProfileData(PWINPERF_INFO pWinperfInfo);
  166. VOID
  167. DrawPerfWindow(
  168. IN HDC hDC,
  169. IN PDISPLAY_ITEM DisplayItem
  170. );
  171. VOID
  172. UpdatePerfWindow(
  173. IN HDC hDC,
  174. IN PDISPLAY_ITEM DisplayItem
  175. );
  176. //
  177. // change style constants
  178. //
  179. #define STYLE_ENABLE_MENU WS_OVERLAPPEDWINDOW
  180. #define STYLE_DISABLE_MENU (WS_THICKFRAME+WS_BORDER)
  181. LRESULT APIENTRY
  182. DbgWndProc(
  183. HWND hWnd,
  184. UINT message,
  185. WPARAM wParam,
  186. LPARAM lParam
  187. );
  188. BOOLEAN
  189. FitPerfWindows(
  190. IN HWND hWnd,
  191. IN HDC hDC,
  192. IN PDISPLAY_ITEM DisplayItems,
  193. IN ULONG NumberOfWindows
  194. );
  195. BOOLEAN
  196. InitPerfWindowDisplay(
  197. IN HWND hWnd,
  198. IN HDC hDC,
  199. IN PDISPLAY_ITEM DisplayItems,
  200. IN ULONG NumberOfWindows
  201. );
  202. INT_PTR
  203. APIENTRY SelectDlgProc(
  204. HWND hDlg,
  205. UINT message,
  206. WPARAM wParam,
  207. LPARAM lParam
  208. );
  209. VOID
  210. DrawFrame(
  211. HDC hDC,
  212. PDISPLAY_ITEM DisplayItem
  213. );
  214. VOID
  215. CalcDrawFrame(
  216. PDISPLAY_ITEM DisplayItem
  217. );
  218. VOID
  219. DrawPerfText(
  220. HDC hDC,
  221. PDISPLAY_ITEM DisplayItem,
  222. UINT Item
  223. );
  224. VOID
  225. DrawPerfGraph(
  226. HDC hDC,
  227. PDISPLAY_ITEM DisplayItem
  228. );
  229. BOOLEAN
  230. CreateMemoryContext(
  231. HDC hDC,
  232. PDISPLAY_ITEM DisplayItem
  233. );
  234. VOID
  235. DeleteMemoryContext(
  236. PDISPLAY_ITEM DisplayItem
  237. );
  238. VOID
  239. ShiftPerfGraph(
  240. HDC hDC,
  241. PDISPLAY_ITEM DisplayItem
  242. );
  243. VOID
  244. DrawCpuBarGraph(
  245. HDC hDC,
  246. PDISPLAY_ITEM DisplayItem,
  247. UINT Item
  248. );
  249. #endif /* _WINPERFH_INCLUDED_ */