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.

276 lines
4.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_IO_GRP 1002
  20. #define IDM_OP_GRP 1003
  21. #define IDM_SEL_DLG 1004
  22. #define IDM_STYLE_GRP 1005
  23. #define IDM_INSB 101
  24. #define IDM_INSW 102
  25. #define IDM_OUTSB 103
  26. #define IDM_OUTSW 104
  27. #define IDM_INB 105
  28. #define IDM_INW 106
  29. #define IDM_OUTB 107
  30. #define IDM_OUTW 108
  31. #define IDM_VDMOPCODEF 109
  32. #define IDM_PUSHF 110
  33. #define IDM_POPF 111
  34. #define IDM_INTNN 112
  35. #define IDM_INTO 113
  36. #define IDM_IRET 114
  37. #define IDM_HLT 115
  38. #define IDM_CLI 116
  39. #define IDM_STI 117
  40. #define IDM_BOP 118
  41. #define IDM_SEGNOTP 119
  42. #define WINPERF_ICON 1011
  43. #include "calcperf.h"
  44. typedef struct _VDMPERF_INFO
  45. {
  46. DWORD WindowPositionX;
  47. DWORD WindowPositionY;
  48. DWORD WindowSizeX;
  49. DWORD WindowSizeY;
  50. DWORD DisplayElement[SAVE_SUBJECTS];
  51. DWORD DisplayMode;
  52. HPEN hBluePen;
  53. HPEN hRedPen;
  54. HPEN hGreenPen;
  55. HPEN hDotPen;
  56. HBRUSH hBackground;
  57. HBRUSH hRedBrush;
  58. HBRUSH hGreenBrush;
  59. HBRUSH hBlueBrush;
  60. HBRUSH hLightBrush;
  61. HBRUSH hDarkBrush;
  62. HFONT LargeFont;
  63. HFONT MediumFont;
  64. HFONT SmallFont;
  65. HFONT hOldFont;
  66. HMENU hMenu;
  67. HWND hWndMain;
  68. UINT_PTR TimerId;
  69. BOOL DisplayMenu;
  70. } VDMPERF_INFO,*PVDMPERF_INFO;
  71. BOOL
  72. InitApplication(
  73. HANDLE hInstance,
  74. HBRUSH hBackground
  75. );
  76. BOOL
  77. InitInstance(
  78. HANDLE hInstance,
  79. int nCmdShow
  80. );
  81. LRESULT APIENTRY
  82. MainWndProc(
  83. HWND hWnd,
  84. UINT message,
  85. WPARAM DWORD,
  86. LPARAM lParam
  87. );
  88. INT_PTR APIENTRY
  89. CpuWndProc(
  90. HWND hWnd,
  91. UINT message,
  92. WPARAM DWORD,
  93. LPARAM lParam
  94. );
  95. INT_PTR
  96. APIENTRY About(
  97. HWND hDlg,
  98. unsigned message,
  99. WPARAM DWORD,
  100. LPARAM lParam
  101. );
  102. #include <port1632.h>
  103. VOID
  104. UpdateCpuMeter(
  105. IN HDC hDC,
  106. IN SHORT cxClient,
  107. IN SHORT cyClient
  108. );
  109. VOID
  110. DrawCpuMeter(
  111. IN HDC hDC,
  112. IN SHORT cxClient,
  113. IN SHORT cyClient,
  114. IN ULONG DisplayItem
  115. );
  116. VOID
  117. ReScalePerfWindow(
  118. IN HDC hDC,
  119. IN PDISPLAY_ITEM DisplayItem
  120. );
  121. BOOL
  122. CalcCpuTime(
  123. PDISPLAY_ITEM PerfListItem
  124. );
  125. ULONG
  126. InitPerfInfo(VOID);
  127. VOID
  128. InitProfileData(PVDMPERF_INFO pVdmperfInfo);
  129. VOID
  130. SaveProfileData(PVDMPERF_INFO pVdmperfInfo);
  131. VOID
  132. DrawPerfWindow(
  133. IN HDC hDC,
  134. IN PDISPLAY_ITEM DisplayItem
  135. );
  136. VOID
  137. UpdatePerfWindow(
  138. IN HDC hDC,
  139. IN PDISPLAY_ITEM DisplayItem
  140. );
  141. //
  142. // change style constants
  143. //
  144. #define STYLE_ENABLE_MENU WS_OVERLAPPEDWINDOW
  145. #define STYLE_DISABLE_MENU (WS_THICKFRAME+WS_BORDER)
  146. LONG APIENTRY
  147. DbgWndProc(
  148. HWND hWnd,
  149. UINT message,
  150. DWORD wParam,
  151. LONG lParam
  152. );
  153. BOOLEAN
  154. FitPerfWindows(
  155. IN HWND hWnd,
  156. IN HDC hDC,
  157. IN PDISPLAY_ITEM DisplayItems,
  158. IN ULONG NumberOfWindows
  159. );
  160. BOOLEAN
  161. InitPerfWindowDisplay(
  162. IN HWND hWnd,
  163. IN HDC hDC,
  164. IN PDISPLAY_ITEM DisplayItems,
  165. IN ULONG NumberOfWindows
  166. );
  167. INT_PTR
  168. APIENTRY SelectDlgProc(
  169. HWND hDlg,
  170. unsigned message,
  171. WPARAM wParam,
  172. LPARAM lParam
  173. );
  174. VOID
  175. DrawFrame(
  176. HDC hDC,
  177. PDISPLAY_ITEM DisplayItem
  178. );
  179. VOID
  180. CalcDrawFrame(
  181. PDISPLAY_ITEM DisplayItem
  182. );
  183. VOID
  184. DrawPerfText(
  185. HDC hDC,
  186. PDISPLAY_ITEM DisplayItem,
  187. UINT Item
  188. );
  189. VOID
  190. DrawPerfGraph(
  191. HDC hDC,
  192. PDISPLAY_ITEM DisplayItem
  193. );
  194. BOOLEAN
  195. CreateMemoryContext(
  196. HDC hDC,
  197. PDISPLAY_ITEM DisplayItem
  198. );
  199. VOID
  200. DeleteMemoryContext(
  201. PDISPLAY_ITEM DisplayItem
  202. );
  203. VOID
  204. ShiftPerfGraph(
  205. HDC hDC,
  206. PDISPLAY_ITEM DisplayItem
  207. );
  208. VOID
  209. DrawCpuBarGraph(
  210. HDC hDC,
  211. PDISPLAY_ITEM DisplayItem,
  212. UINT Item
  213. );
  214. #endif /* _WINPERFH_INCLUDED_ */