Leaked source code of windows server 2003
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.

387 lines
6.5 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. INT_PTR
  99. CALLBACK
  100. MainWndProc(
  101. HWND hWnd,
  102. UINT message,
  103. WPARAM DWORD,
  104. LPARAM lParam
  105. );
  106. LONG APIENTRY
  107. CpuWndProc(
  108. HWND hWnd,
  109. UINT message,
  110. DWORD DWORD,
  111. LONG lParam
  112. );
  113. INT_PTR
  114. CALLBACK
  115. About(
  116. HWND hDlg,
  117. UINT message,
  118. WPARAM DWORD,
  119. LPARAM lParam
  120. );
  121. BOOL APIENTRY MGetWindowExt(HDC hdc, INT * pcx, INT * pcy);
  122. BOOL APIENTRY MGetCurrentPosition(HDC hdc, INT * px, INT * py);
  123. HANDLE APIENTRY MGetInstHandle(VOID);
  124. LPSTR MGetCmdLine(VOID);
  125. VOID
  126. UpdateCpuMeter(
  127. IN HDC hDC,
  128. IN SHORT cxClient,
  129. IN SHORT cyClient
  130. );
  131. VOID
  132. DrawCpuMeter(
  133. IN HDC hDC,
  134. IN SHORT cxClient,
  135. IN SHORT cyClient,
  136. IN ULONG DisplayItem
  137. );
  138. VOID
  139. ReScalePerfWindow(
  140. IN HDC hDC,
  141. IN PDISPLAY_ITEM DisplayItem
  142. );
  143. BOOL
  144. CalcCpuTime(
  145. PDISPLAY_ITEM PerfListItem
  146. );
  147. ULONG
  148. InitPerfInfo(VOID);
  149. VOID
  150. InitProfileData(PWINPERF_INFO pWinperfInfo);
  151. VOID
  152. DrawPerfWindow(
  153. IN HDC hDC,
  154. IN PDISPLAY_ITEM DisplayItem
  155. );
  156. VOID
  157. UpdatePerfWindow(
  158. IN HDC hDC,
  159. IN PDISPLAY_ITEM DisplayItem
  160. );
  161. //
  162. // change style constants
  163. //
  164. #define STYLE_ENABLE_MENU WS_OVERLAPPEDWINDOW
  165. #define STYLE_DISABLE_MENU (WS_THICKFRAME+WS_BORDER)
  166. LONG APIENTRY
  167. DbgWndProc(
  168. HWND hWnd,
  169. UINT message,
  170. DWORD wParam,
  171. LONG lParam
  172. );
  173. INT_PTR
  174. CALLBACK ThunkDlgProc(
  175. HWND hDlg,
  176. unsigned int message,
  177. WPARAM wParam,
  178. LPARAM lParam
  179. );
  180. INT_PTR
  181. CALLBACK CalcDlgProc(
  182. HWND hDlg,
  183. unsigned int message,
  184. WPARAM wParam,
  185. LPARAM lParam
  186. );
  187. BOOLEAN
  188. FitPerfWindows(
  189. IN HWND hWnd,
  190. IN HDC hDC,
  191. IN PDISPLAY_ITEM DisplayItems
  192. );
  193. VOID
  194. RefitWindows (
  195. IN HWND hWnd,
  196. IN HDC CurhDC
  197. );
  198. BOOLEAN
  199. InitPerfWindowDisplay(
  200. IN HWND hWnd,
  201. IN HDC hDC,
  202. IN PDISPLAY_ITEM DisplayItems,
  203. IN ULONG NumberOfWindows
  204. );
  205. INT_PTR
  206. CALLBACK SelectDlgProc(
  207. HWND hDlg,
  208. unsigned int message,
  209. WPARAM wParam,
  210. LPARAM lParam
  211. );
  212. VOID
  213. DrawFrame(
  214. HDC hDC,
  215. PDISPLAY_ITEM DisplayItem
  216. );
  217. BOOL
  218. CalcPerf(
  219. PDISPLAY_ITEM pPerf1
  220. );
  221. VOID
  222. CalcDrawFrame(
  223. PDISPLAY_ITEM DisplayItem
  224. );
  225. VOID
  226. DrawPerfText(
  227. HDC hDC,
  228. PDISPLAY_ITEM DisplayItem
  229. );
  230. VOID
  231. DrawPerfGraph(
  232. HDC hDC,
  233. PDISPLAY_ITEM DisplayItem
  234. );
  235. BOOLEAN
  236. CreateMemoryContext(
  237. HDC hDC,
  238. PDISPLAY_ITEM DisplayItem
  239. );
  240. VOID
  241. DeleteMemoryContext(
  242. PDISPLAY_ITEM DisplayItem
  243. );
  244. VOID
  245. ShiftPerfGraph(
  246. HDC hDC,
  247. PDISPLAY_ITEM DisplayItem
  248. );
  249. PDISPLAY_ITEM AllocateDisplayItem(VOID);
  250. VOID
  251. SetDefaultDisplayMode (
  252. IN HWND hWnd,
  253. IN ULONG mode
  254. );
  255. VOID
  256. DoCSTest(
  257. IN HWND hWnd
  258. );
  259. VOID
  260. FreeDisplayItem(
  261. PDISPLAY_ITEM pPerf
  262. );
  263. VOID
  264. SetP5Perf (
  265. HWND hDlg,
  266. ULONG IdCombo,
  267. ULONG p5counter
  268. );
  269. VOID
  270. ClearGraph (
  271. PDISPLAY_ITEM pPerf
  272. );
  273. VOID
  274. SetP5CounterEncodings (
  275. PVOID encoding
  276. );
  277. VOID
  278. SetDisplayToTrue (
  279. PDISPLAY_ITEM pPerf,
  280. ULONG sort
  281. );
  282. PDISPLAY_ITEM
  283. SetDisplayToFalse (
  284. PDISPLAY_ITEM pPerf
  285. );
  286. #endif /* _WINPERFH_INCLUDED_ */