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.

169 lines
5.1 KiB

  1. // emshell.h : main header file for the EMSHELL application
  2. //
  3. #if !defined(AFX_EMSHELL_H__A4B361A0_838C_4898_A9C1_D460D1546E6B__INCLUDED_)
  4. #define AFX_EMSHELL_H__A4B361A0_838C_4898_A9C1_D460D1546E6B__INCLUDED_
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #endif // _MSC_VER > 1000
  8. #ifndef __AFXWIN_H__
  9. #error include 'stdafx.h' before including this file for PCH
  10. #endif
  11. #include "resource.h" // main symbols
  12. #include "emsvc.h"
  13. #include "emobjdef.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CEmshellApp:
  16. // See emshell.cpp for the implementation of this class
  17. //
  18. #define EM_NAMEDKEY_LEN 60
  19. #define EM_REGKEY _T("Software\\Microsoft\\EM\\shell")
  20. #define EMSVC_SESSION_KEY _T("SYSTEM\\CurrentControlSet\\Services\\emsvc\\Parameters\\Session")
  21. class CEmshellApp : public CWinApp
  22. {
  23. public:
  24. DWORD m_dwWindowWidth,
  25. m_dwWindowHeight,
  26. m_dwSessionRefreshRate,
  27. m_dwRecursive,
  28. m_dwCommandSet,
  29. m_dwMiniDump,
  30. m_dwUserDump,
  31. m_dwMsinfoDump,
  32. m_dwNotifyAdmin,
  33. m_dwShowMSInfoDlg;
  34. CString m_strApplicationPath;
  35. CString m_strAdminName;
  36. CString m_strAltSymbolPath;
  37. CString m_strCommandSet;
  38. CString m_strPassword;
  39. CString m_strPort;
  40. CString m_strUsername;
  41. SessionSettings m_SessionSettings;
  42. public:
  43. void GetCDBPathFromRegistry();
  44. void UpdateSessionData( BOOL bUpdate = FALSE );
  45. BOOL CanDisplayService(TCHAR *pszName, TCHAR *pszSecName);
  46. BOOL CanDisplayProcess(TCHAR *pszName);
  47. void SetEmShellRegOptions
  48. (
  49. const BOOL bUpdateRegistry = FALSE,
  50. const DWORD *pdwPollingSessionsFreq = NULL,
  51. const DWORD *pdwWindowHeight = NULL,
  52. const DWORD *pdwWindowWidth = NULL,
  53. const DWORD *pdwRecursive = NULL,
  54. const DWORD *pdwCommandSet = NULL,
  55. const DWORD *pdwMiniDump = NULL,
  56. const DWORD *pdwUserDump = NULL,
  57. const DWORD *pdwNotifyAdmin = NULL,
  58. const DWORD *pdwMsinfoDump = NULL,
  59. CString *pstrAdminName = NULL,
  60. CString *pstrAltSymbolPath = NULL,
  61. CString *pstrCommandSet = NULL,
  62. CString *pstrPassword = NULL,
  63. CString *pstrPort = NULL,
  64. CString *pstrUsername = NULL,
  65. const DWORD *pdwShowMSInfoDlg = NULL
  66. );
  67. void GetEmShellRegOptions
  68. (
  69. BOOL bReadFromRegistry = FALSE,
  70. DWORD *pdwPollingSessionsFreq = NULL,
  71. DWORD *pdwWindowHeight = NULL,
  72. DWORD *pdwWindowWidth = NULL,
  73. DWORD *pdwRecursive = NULL,
  74. DWORD *pdwCommandSet = NULL,
  75. DWORD *pdwMiniDump = NULL,
  76. DWORD *pdwUserDump = NULL,
  77. DWORD *pdwNotifyAdmin = NULL,
  78. DWORD *pdwMsinfoDump = NULL,
  79. CString *pstrAdminName = NULL,
  80. CString *pstrAltSymbolPath = NULL,
  81. CString *pstrCommandSet = NULL,
  82. CString *pstrPassword = NULL,
  83. CString *pstrPort = NULL,
  84. CString *pstrUsername = NULL,
  85. DWORD *pdwShowMSInfoDlg = NULL
  86. );
  87. DWORD CreateKeyAndSetData
  88. (
  89. HKEY hKeyParent,
  90. LPCTSTR lpszKeyName,
  91. LPCTSTR lpszNamedValue,
  92. LPCTSTR lpValue,
  93. LPTSTR lpszClass = REG_NONE
  94. );
  95. DWORD CreateKeyAndSetData
  96. (
  97. HKEY hKeyParent,
  98. LPCTSTR lpszKeyName,
  99. LPCTSTR lpszNamedValue,
  100. DWORD dwValue,
  101. LPTSTR lpszClass = REG_NONE
  102. );
  103. DWORD CreateEmShellRegEntries
  104. (
  105. HKEY hKey = HKEY_CURRENT_USER,
  106. LPCTSTR lpszKey = EM_REGKEY
  107. );
  108. DWORD
  109. ReadDataFromRegistry
  110. (
  111. HKEY hKey = HKEY_CURRENT_USER,
  112. LPCTSTR lpszKey = EM_REGKEY
  113. );
  114. CEmshellApp();
  115. HRESULT ExportLog( PEmObject pEmObject, CString strDirPath, IEmManager* pEmManager );
  116. BOOL AskForPath( CString &strDirPath );
  117. int DisplayErrMsgFromHR( HRESULT hr, UINT nType = MB_OK );
  118. int DisplayErrMsgFromString( CString strMessage, UINT nType = MB_OK );
  119. void GetStatusString( LONG lStatus, CString &csStatus );
  120. void GetEmObjectTypeString( LONG lType, CString &csStatusStr );
  121. EmObject* AllocEmObject();
  122. void DeAllocEmObject( EmObject* pEmObj );
  123. // Overrides
  124. // ClassWizard generated virtual function overrides
  125. //{{AFX_VIRTUAL(CEmshellApp)
  126. public:
  127. virtual BOOL InitInstance();
  128. virtual int ExitInstance();
  129. //}}AFX_VIRTUAL
  130. // Implementation
  131. //{{AFX_MSG(CEmshellApp)
  132. afx_msg void OnAppAbout();
  133. //}}AFX_MSG
  134. DECLARE_MESSAGE_MAP()
  135. protected:
  136. CString m_strIgnoreProcesses;
  137. CString m_strIgnoreServices;
  138. CString m_strWildCardIgnoreServices;
  139. bool InitEmshell (
  140. int nCmdShow = SW_SHOW
  141. );
  142. };
  143. /////////////////////////////////////////////////////////////////////////////
  144. //{{AFX_INSERT_LOCATION}}
  145. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  146. #endif // !defined(AFX_EMSHELL_H__A4B361A0_838C_4898_A9C1_D460D1546E6B__INCLUDED_)