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.

385 lines
6.0 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_THUNK 1102
  18. #define IDM_ALL 1103
  19. #define IDM_HACK 1104
  20. #define TIMER_ID 1001
  21. #define IDM_SEL_DLG 1004
  22. #define IDM_THUNK_DLG 1005
  23. #define IDM_CALC_DLG 1006
  24. #define IDM_DISPLAY_TOTAL 1106
  25. #define IDM_DISPLAY_BREAKDOWN 1107
  26. #define IDM_DISPLAY_PER_PROCESSOR 1108
  27. #define IDM_TOPMOST 1109
  28. #define IDM_ACCEPT 1200
  29. #define IDM_P5_GEN1 1206
  30. #define IDM_P5_R0_0 1207
  31. #define IDM_P5_R3_0 1208
  32. #define IDM_P5_K_0 1209
  33. #define IDM_P5_GEN2 1210
  34. #define IDM_P5_R0_1 1211
  35. #define IDM_P5_R3_1 1212
  36. #define IDM_P5_K_1 1213
  37. #define IDM_PERCENT 1214
  38. #define IDM_SPIN_ACQUIRE 1250
  39. #define IDM_SPIN_COLL 1251
  40. #define IDM_SPIN_SPIN 1252
  41. #define IDM_IRQL 1253
  42. #define IDM_INT 1254
  43. #define IDM_LOGIT 1260
  44. #define IDM_SCALE 1261
  45. #define IDM_THUNK_LIST 1301
  46. #define IDM_THUNK_SOURCE 1302
  47. #define IDM_THUNK_IMPORT 1303
  48. #define IDM_THUNK_FUNCTION 1304
  49. #define IDM_THUNK_ADD 1305
  50. #define IDM_THUNK_REMOVE 1306
  51. #define IDM_THUNK_CLEAR_ALL 1307
  52. #define IDM_CALC_TEXTA 1350
  53. #define IDM_CALC_TEXTB 1351
  54. #define IDM_CALC_FORM1 1352
  55. #define IDM_CALC_FORM2 1353
  56. #define IDM_CALC_FORM3 1354
  57. #define IDM_CALC_FORM4 1355
  58. #define WINPERF_ICON 1011
  59. #define CPUTHERM_ICON 1012
  60. #define BALL_BITMAP 1011
  61. #include "calcperf.h"
  62. typedef struct _WINPERF_INFO
  63. {
  64. DWORD WindowPositionX;
  65. DWORD WindowPositionY;
  66. DWORD WindowSizeX;
  67. DWORD WindowSizeY;
  68. DWORD DisplayMode;
  69. HPEN hBluePen; // total pen
  70. HPEN hPPen[MAX_PROCESSORS];
  71. HPEN hDotPen;
  72. HBRUSH hBackground;
  73. HBRUSH hRedBrush;
  74. HBRUSH hGreenBrush;
  75. HBRUSH hBlueBrush;
  76. HBRUSH hLightBrush;
  77. HBRUSH hDarkBrush;
  78. HFONT LargeFont;
  79. HFONT MediumFont;
  80. HFONT SmallFont;
  81. HFONT hOldFont;
  82. HMENU hMenu;
  83. HWND hWndMain;
  84. UINT TimerId;
  85. UINT NumberOfProcessors;
  86. BOOL DisplayMenu;
  87. } WINPERF_INFO,*PWINPERF_INFO;
  88. BOOL
  89. InitApplication(
  90. HANDLE hInstance,
  91. HBRUSH hBackground
  92. );
  93. BOOL
  94. InitInstance(
  95. HANDLE hInstance,
  96. int nCmdShow
  97. );
  98. LONG APIENTRY
  99. MainWndProc(
  100. HWND hWnd,
  101. UINT message,
  102. DWORD DWORD,
  103. LONG lParam
  104. );
  105. LONG APIENTRY
  106. CpuWndProc(
  107. HWND hWnd,
  108. UINT message,
  109. DWORD DWORD,
  110. LONG lParam
  111. );
  112. BOOL
  113. APIENTRY About(
  114. HWND hDlg,
  115. unsigned message,
  116. WORD DWORD,
  117. LONG lParam
  118. );
  119. BOOL APIENTRY MGetWindowExt(HDC hdc, INT * pcx, INT * pcy);
  120. BOOL APIENTRY MGetCurrentPosition(HDC hdc, INT * px, INT * py);
  121. HANDLE APIENTRY MGetInstHandle(VOID);
  122. LPSTR MGetCmdLine(VOID);
  123. VOID
  124. UpdateCpuMeter(
  125. IN HDC hDC,
  126. IN SHORT cxClient,
  127. IN SHORT cyClient
  128. );
  129. VOID
  130. DrawCpuMeter(
  131. IN HDC hDC,
  132. IN SHORT cxClient,
  133. IN SHORT cyClient,
  134. IN ULONG DisplayItem
  135. );
  136. VOID
  137. ReScalePerfWindow(
  138. IN HDC hDC,
  139. IN PDISPLAY_ITEM DisplayItem
  140. );
  141. BOOL
  142. CalcCpuTime(
  143. PDISPLAY_ITEM PerfListItem
  144. );
  145. ULONG
  146. InitPerfInfo(VOID);
  147. VOID
  148. InitProfileData(PWINPERF_INFO pWinperfInfo);
  149. VOID
  150. DrawPerfWindow(
  151. IN HDC hDC,
  152. IN PDISPLAY_ITEM DisplayItem
  153. );
  154. VOID
  155. UpdatePerfWindow(
  156. IN HDC hDC,
  157. IN PDISPLAY_ITEM DisplayItem
  158. );
  159. //
  160. // change style constants
  161. //
  162. #define STYLE_ENABLE_MENU WS_OVERLAPPEDWINDOW
  163. #define STYLE_DISABLE_MENU (WS_THICKFRAME+WS_BORDER)
  164. LONG APIENTRY
  165. DbgWndProc(
  166. HWND hWnd,
  167. UINT message,
  168. DWORD wParam,
  169. LONG lParam
  170. );
  171. BOOL
  172. APIENTRY ThunkDlgProc(
  173. HWND hDlg,
  174. unsigned message,
  175. DWORD wParam,
  176. LONG lParam
  177. );
  178. BOOL
  179. APIENTRY CalcDlgProc(
  180. HWND hDlg,
  181. unsigned message,
  182. DWORD wParam,
  183. LONG lParam
  184. );
  185. BOOLEAN
  186. FitPerfWindows(
  187. IN HWND hWnd,
  188. IN HDC hDC,
  189. IN PDISPLAY_ITEM DisplayItems
  190. );
  191. VOID
  192. RefitWindows (
  193. IN HWND hWnd,
  194. IN HDC CurhDC
  195. );
  196. BOOLEAN
  197. InitPerfWindowDisplay(
  198. IN HWND hWnd,
  199. IN HDC hDC,
  200. IN PDISPLAY_ITEM DisplayItems,
  201. IN ULONG NumberOfWindows
  202. );
  203. BOOL
  204. APIENTRY SelectDlgProc(
  205. HWND hDlg,
  206. unsigned message,
  207. DWORD wParam,
  208. LONG lParam
  209. );
  210. VOID
  211. DrawFrame(
  212. HDC hDC,
  213. PDISPLAY_ITEM DisplayItem
  214. );
  215. BOOL
  216. CalcPerf(
  217. PDISPLAY_ITEM pPerf1
  218. );
  219. VOID
  220. CalcDrawFrame(
  221. PDISPLAY_ITEM DisplayItem
  222. );
  223. VOID
  224. DrawPerfText(
  225. HDC hDC,
  226. PDISPLAY_ITEM DisplayItem
  227. );
  228. VOID
  229. DrawPerfGraph(
  230. HDC hDC,
  231. PDISPLAY_ITEM DisplayItem
  232. );
  233. BOOLEAN
  234. CreateMemoryContext(
  235. HDC hDC,
  236. PDISPLAY_ITEM DisplayItem
  237. );
  238. VOID
  239. DeleteMemoryContext(
  240. PDISPLAY_ITEM DisplayItem
  241. );
  242. VOID
  243. ShiftPerfGraph(
  244. HDC hDC,
  245. PDISPLAY_ITEM DisplayItem
  246. );
  247. PDISPLAY_ITEM AllocateDisplayItem(VOID);
  248. VOID
  249. SetDefaultDisplayMode (
  250. IN HWND hWnd,
  251. IN ULONG mode
  252. );
  253. VOID
  254. DoCSTest(
  255. IN HWND hWnd
  256. );
  257. VOID
  258. FreeDisplayItem(
  259. PDISPLAY_ITEM pPerf
  260. );
  261. VOID
  262. SetP5Perf (
  263. HWND hDlg,
  264. ULONG IdCombo,
  265. ULONG p5counter
  266. );
  267. VOID
  268. ClearGraph (
  269. PDISPLAY_ITEM pPerf
  270. );
  271. VOID
  272. SetP5CounterEncodings (
  273. PVOID encoding
  274. );
  275. VOID
  276. SetDisplayToTrue (
  277. PDISPLAY_ITEM pPerf,
  278. ULONG sort
  279. );
  280. PDISPLAY_ITEM
  281. SetDisplayToFalse (
  282. PDISPLAY_ITEM pPerf
  283. );
  284. #endif /* _WINPERFH_INCLUDED_ */
  285.