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.

223 lines
6.2 KiB

  1. #ifdef DEFINE_GLOBALS
  2. #define GLOBAL
  3. // #include "counters.h"
  4. // initialize some of the globals
  5. // only perfmon.c will define DEFINE_GLOBALS
  6. int aiIntervals [] = { 1, 5, 15, 30, 60, 120, 300, 600, 3600 } ;
  7. // setup CVS delimiter and line ending used by Export routines
  8. CHAR CommasStr[] = "," ;
  9. CHAR TabStr[] = "\t" ;
  10. CHAR *pDelimiter = TabStr ;
  11. CHAR LineEndStr[] = "\n" ;
  12. TCHAR DashLine[] = TEXT("- - - -") ;
  13. // PDFN CounterFuncEntry = CounterEntry ;
  14. #else
  15. // only perfmon.c define DEFINE_GLOBALS,
  16. // all other references to them as extern
  17. #define GLOBAL extern
  18. #define NumIntervals 9
  19. GLOBAL int aiIntervals [] ;
  20. // setup CVS delimiter and line ending used by Export routines
  21. GLOBAL CHAR CommasStr[] ;
  22. GLOBAL CHAR TabStr[] ;
  23. GLOBAL CHAR *pDelimiter ;
  24. GLOBAL CHAR LineEndStr[] ;
  25. GLOBAL TCHAR DashLine[] ;
  26. #endif
  27. //=============================//
  28. // Graph Data Information //
  29. //=============================//
  30. // GLOBAL PPERFSYSTEM pSysInfo ;
  31. GLOBAL PGRAPHSTRUCT pGraphs;
  32. //=============================//
  33. // Font Information //
  34. //=============================//
  35. GLOBAL HFONT hFontScales ;
  36. GLOBAL HFONT hFontScalesBold ;
  37. GLOBAL LONG HalfTextHeight;
  38. #ifdef KEEP_PRINT
  39. GLOBAL HFONT hFontPrinterScales ;
  40. GLOBAL HFONT hFontPrinterScalesBold ;
  41. #endif
  42. //=============================//
  43. // Control Information //
  44. //=============================//
  45. GLOBAL INT iPerfmonView ;
  46. GLOBAL LANGID iLanguage ;
  47. GLOBAL LANGID iEnglishLanguage ;
  48. GLOBAL OPTIONS Options ;
  49. GLOBAL HICON hIcon ;
  50. GLOBAL HANDLE hInstance;
  51. GLOBAL HANDLE hAccelerators ;
  52. GLOBAL HANDLE hEventLog ;
  53. GLOBAL LPTSTR szMessageArray[8]; // used for reporting events
  54. GLOBAL WORD wMessageIndex;
  55. GLOBAL DWORD dwMessageData[8]; // used to report data in event msg
  56. GLOBAL DWORD dwMessageDataBytes;
  57. GLOBAL HMENU hMenuChart ;
  58. GLOBAL HMENU hMenuAlert ;
  59. GLOBAL HMENU hMenuLog ;
  60. GLOBAL HMENU hMenuReport ;
  61. //=============================//
  62. // Windows //
  63. //=============================//
  64. GLOBAL HWND hWndMain ;
  65. GLOBAL HWND hWndGraph ;
  66. GLOBAL HWND hWndLog ;
  67. GLOBAL HWND hWndAlert ;
  68. GLOBAL HWND hWndReport ;
  69. GLOBAL HWND hWndGraphDisplay ;
  70. GLOBAL HWND hWndGraphLegend ;
  71. GLOBAL HWND hWndGraphStatus ;
  72. GLOBAL HWND hWndAlertLegend ;
  73. GLOBAL HWND hWndLogEntries ;
  74. GLOBAL HWND hWndToolbar ;
  75. GLOBAL HWND hWndStatus ;
  76. //=============================//
  77. // System Metrics //
  78. //=============================//
  79. GLOBAL int xScreenWidth ;
  80. GLOBAL int yScreenHeight ;
  81. GLOBAL int xBorderWidth ;
  82. GLOBAL int yBorderHeight ;
  83. GLOBAL int xScrollWidth ;
  84. GLOBAL int yScrollHeight ;
  85. GLOBAL int xScrollThumbWidth ;
  86. GLOBAL int yScrollThumbHeight ;
  87. GLOBAL int xDlgBorderWidth ;
  88. GLOBAL int yDlgBorderHeight ;
  89. GLOBAL int MinimumSize ;
  90. //=============================//
  91. // Miscellaneous //
  92. //=============================//
  93. GLOBAL int iUnviewedAlerts ;
  94. GLOBAL COLORREF crLastUnviewedAlert ;
  95. GLOBAL LPTSTR pChartFileName ;
  96. GLOBAL LPTSTR pChartFullFileName ;
  97. GLOBAL LPTSTR pAlertFileName ;
  98. GLOBAL LPTSTR pAlertFullFileName ;
  99. GLOBAL LPTSTR pLogFileName ;
  100. GLOBAL LPTSTR pLogFullFileName ;
  101. GLOBAL LPTSTR pReportFileName ;
  102. GLOBAL LPTSTR pReportFullFileName ;
  103. GLOBAL LPTSTR pWorkSpaceFileName ;
  104. GLOBAL LPTSTR pWorkSpaceFullFileName ;
  105. // globals for perfmornance improvements
  106. // frequently used GDI objects
  107. GLOBAL UINT ColorBtnFace ; // for concave/convex button painting
  108. GLOBAL HBRUSH hBrushFace ; // for concave/convex button painting
  109. GLOBAL HPEN hPenHighlight ; // for concave/convex button painting
  110. GLOBAL HPEN hPenShadow ; // for concave/convex button painting
  111. GLOBAL HPEN hWhitePen ; // for chart highlighting
  112. GLOBAL HANDLE hbLightGray ; // for painting the background
  113. // bPerfmonIconic is TRUE when perfmon is minimized.
  114. // Thus, we don't need to update chart or report view until
  115. // it is not iconized
  116. GLOBAL BOOL bPerfmonIconic ;
  117. // bAddLineInPorgress is TRUE when Addline dialog is up. It is used
  118. // in freeing unused system during data collecting. (But not while
  119. // addline dialog is still up)
  120. GLOBAL BOOL bAddLineInProgress ;
  121. // bDelayAddAction is TRUE when reading setting files or adding more
  122. // than 1 counter. This is to delay some of the costly screen adjustments
  123. // until we have added all the lines.
  124. GLOBAL BOOL bDelayAddAction ;
  125. // bExplainTxtButtonHit is TRUE when the ExplainText button in addline
  126. // dialog is clicked. This is to save time and memory for fetching the
  127. // help text, during BuildNameTable(), unless it is needed.
  128. GLOBAL BOOL bExplainTextButtonHit ;
  129. // globals used for WinHelp
  130. GLOBAL DWORD dwCurrentDlgID ;
  131. GLOBAL DWORD dwCurrentMenuID ;
  132. GLOBAL LPTSTR pszHelpFile ;
  133. // Following includes space for trailing NULL and preceeding \\'s
  134. GLOBAL TCHAR LocalComputerName[MAX_COMPUTERNAME_LENGTH + 3];
  135. GLOBAL TCHAR CmdLineComputerName[MAX_COMPUTERNAME_LENGTH + 3];
  136. // Flag to indicate if we need to close local machine
  137. GLOBAL BOOL bCloseLocalMachine ;
  138. // Timeout for data collection thread in msec
  139. GLOBAL DWORD DataTimeOut ;
  140. // flag to indicate duplicate instance names should be allowed
  141. GLOBAL BOOL bMonitorDuplicateInstances;
  142. // flag to indicate that events should be reported to the event log
  143. GLOBAL BOOL bReportEvents;
  144. // flag to indicate that percentages should/shouldn't be limited to 100
  145. GLOBAL BOOL bCapPercentsAt100;
  146. // 20 sec for the data thread timeout
  147. #define DEFAULT_DATA_TIMEOUT 20000L
  148. //=============================//
  149. // Log Playback Information //
  150. //=============================//
  151. GLOBAL PLAYBACKLOG PlaybackLog ;
  152. GLOBAL REPORT Report ;
  153. GLOBAL ALERT Alert ;
  154. GLOBAL LOG Log ;
  155.