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.

224 lines
5.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 2000
  6. //
  7. // File: programoptions.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ProgramOptions.h: interface for the CProgramOptions class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #if !defined(AFX_PROGRAMOPTIONS_H__D0C1E0B9_9F50_11D2_83A2_000000000000__INCLUDED_)
  14. #define AFX_PROGRAMOPTIONS_H__D0C1E0B9_9F50_11D2_83A2_000000000000__INCLUDED_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif // _MSC_VER > 1000
  18. #ifndef NO_STRICT
  19. #ifndef STRICT
  20. #define STRICT 1
  21. #endif
  22. #endif /* NO_STRICT */
  23. #include <WINDOWS.H>
  24. #include <TCHAR.H>
  25. class CProgramOptions
  26. {
  27. static const LPTSTR g_DefaultSymbolPath;
  28. public:
  29. bool fDoesModuleMatchOurSearch(LPCTSTR tszModulePathToTest);
  30. void DisplaySimpleHelp();
  31. void DisplayHelp();
  32. CProgramOptions();
  33. virtual ~CProgramOptions();
  34. bool Initialize();
  35. bool ProcessCommandLineArguments(int argc, TCHAR *argv[]);
  36. // We're going to perform bitwise operations on any number after the -Y switch
  37. // to determine what type of symbol path searching is desired...
  38. enum SymbolPathSearchAlgorithms
  39. {
  40. enumSymbolPathNormal = 0x0,
  41. enumSymbolPathOnly = 0x1,
  42. enumSymbolPathRecursion = 0x2,
  43. enumSymbolsModeUsingDBGInMISCSection = 0x4
  44. };
  45. enum DebugLevel
  46. {
  47. enumDebugSearchPaths = 0x1
  48. };
  49. enum ProgramModes {
  50. // Help Modes
  51. SimpleHelpMode,
  52. HelpMode,
  53. // Input Methods
  54. InputProcessesFromLiveSystemMode, // Querying live processes
  55. InputDriversFromLiveSystemMode, // Querying live processes
  56. InputProcessesWithMatchingNameOrPID, // Did the user provide a PID or Process Name?
  57. InputModulesDataFromFileSystemMode, // Input Modules Data from File System
  58. InputCSVFileMode, // Input Data from CSV File
  59. InputDmpFileMode, // Input Data from DMP File
  60. // Collection Options
  61. CollectVersionInfoMode,
  62. // Matching Options
  63. MatchModuleMode,
  64. // Verification Modes
  65. VerifySymbolsMode,
  66. VerifySymbolsModeWithSymbolPath,
  67. VerifySymbolsModeWithSymbolPathOnly,
  68. VerifySymbolsModeWithSymbolPathRecursion,
  69. VerifySymbolsModeUsingDBGInMISCSection,
  70. VerifySymbolsModeWithSQLServer,
  71. VerifySymbolsModeWithSQLServer2, // SQL2 - mjl 12/14/99
  72. // Output Methods
  73. OutputSymbolInformationMode,
  74. BuildSymbolTreeMode,
  75. PrintTaskListMode,
  76. QuietMode, // No output to stdout...
  77. OutputCSVFileMode,
  78. OverwriteOutputFileMode,
  79. OutputDiscrepanciesOnly,
  80. ExceptionMonitorMode
  81. };
  82. bool GetMode(enum ProgramModes mode);
  83. bool SetMode(enum ProgramModes mode, bool fState);
  84. bool DisplayProgramArguments();
  85. // INLINE Methods!
  86. #ifdef _UNICODE
  87. inline bool IsRunningWindows() { // If Windows 9x
  88. return (m_osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
  89. };
  90. #endif
  91. inline bool IsRunningWindowsNT() { // If Windows NT
  92. return (m_osver.dwPlatformId == VER_PLATFORM_WIN32_NT);
  93. };
  94. inline LPTSTR GetProcessName() {
  95. return m_tszProcessName;
  96. };
  97. inline LPTSTR GetModuleToMatch() {
  98. return m_tszModuleToMatch;
  99. };
  100. inline LPTSTR GetOutputFilePath() {
  101. return m_tszOutputCSVFilePath;
  102. };
  103. inline LPTSTR GetSQLServerName() {
  104. return m_tszSQLServer;
  105. };
  106. inline LPTSTR GetSQLServerName2() {
  107. return m_tszSQLServer2;
  108. };
  109. inline LPTSTR GetSymbolPath() {
  110. return m_tszSymbolPath;
  111. };
  112. inline LPTSTR GetInputFilePath() {
  113. return m_tszInputCSVFilePath;
  114. };
  115. inline LPTSTR GetDmpFilePath() {
  116. return m_tszInputDmpFilePath;
  117. };
  118. inline LPTSTR GetSymbolTreeToBuild() {
  119. return m_tszSymbolTreeToBuild;
  120. };
  121. inline LPTSTR GetInputModulesDataFromFileSystemPath() {
  122. return m_tszInputModulesDataFromFileSystemPath;
  123. };
  124. inline DWORD GetProcessID() {
  125. return m_iProcessID;
  126. };
  127. inline bool fDebugSearchPaths()
  128. {
  129. return (m_dwDebugLevel & enumDebugSearchPaths) == enumDebugSearchPaths;
  130. };
  131. inline unsigned int GetVerificationLevel() {
  132. return m_iVerificationLevel;
  133. };
  134. protected:
  135. OSVERSIONINFOA m_osver;
  136. bool VerifySemiColonSeparatedPath(LPTSTR tszPath);
  137. bool SetProcessID(DWORD iPID);
  138. unsigned int m_iVerificationLevel;
  139. DWORD m_iProcessID;
  140. DWORD m_dwDebugLevel;
  141. LPTSTR m_tszInputCSVFilePath;
  142. LPTSTR m_tszInputDmpFilePath;
  143. LPTSTR m_tszOutputCSVFilePath;
  144. LPTSTR m_tszProcessName;
  145. LPTSTR m_tszModuleToMatch;
  146. LPTSTR m_tszSymbolPath;
  147. LPTSTR m_tszSymbolTreeToBuild;
  148. LPTSTR m_tszInputModulesDataFromFileSystemPath;
  149. LPTSTR m_tszSQLServer;
  150. LPTSTR m_tszSQLServer2; // SQL2 - mjl 12/14/99
  151. bool m_fSimpleHelpMode;
  152. bool m_fHelpMode;
  153. bool m_fInputProcessesFromLiveSystemMode;
  154. bool m_fInputDriversFromLiveSystemMode;
  155. bool m_fInputProcessesWithMatchingNameOrPID;
  156. bool m_fInputCSVFileMode;
  157. bool m_fInputDmpFileMode;
  158. bool m_fInputModulesDataFromFileSystemMode;
  159. bool m_fMatchModuleMode;
  160. bool m_fOutputSymbolInformationMode;
  161. bool m_fCollectVersionInfoMode;
  162. bool m_fVerifySymbolsMode;
  163. bool m_fVerifySymbolsModeWithSymbolPath;
  164. bool m_fVerifySymbolsModeWithSymbolPathOnly;
  165. bool m_fVerifySymbolsModeWithSymbolPathRecursion;
  166. bool m_fVerifySymbolsModeUsingDBGInMISCSection;
  167. bool m_fVerifySymbolsModeWithSQLServer;
  168. bool m_fVerifySymbolsModeWithSQLServer2; // SQL2 - mjl 12/14/99
  169. bool m_fSymbolTreeToBuildMode;
  170. bool m_fPrintTaskListMode;
  171. bool m_fQuietMode;
  172. bool m_fOutputCSVFileMode;
  173. bool m_fOutputDiscrepanciesOnly;
  174. bool m_fOverwriteOutputFileMode;
  175. bool m_fExceptionMonitorMode;
  176. };
  177. #endif // !defined(AFX_PROGRAMOPTIONS_H__D0C1E0B9_9F50_11D2_83A2_000000000000__INCLUDED_)