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.

300 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. fscfg.h
  5. Abstract:
  6. FTP Configuration Module definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. //
  14. // Include Files
  15. //
  16. #include <lmcons.h>
  17. #include <lmapibuf.h>
  18. #include <svcloc.h>
  19. //
  20. // Required by VC5
  21. //
  22. #ifndef MIDL_INTERFACE
  23. #define MIDL_INTERFACE(x) struct
  24. #endif // MIDL_INTERFACE
  25. #ifndef __RPCNDR_H_VERSION__
  26. #define __RPCNDR_H_VERSION__ 440
  27. #endif // __RPCNDR_H_VERSION__
  28. #include <ftpd.h>
  29. #include "resource.h"
  30. #include "mmc.h"
  31. #include "svrinfo.h"
  32. #include "comprop.h"
  33. extern const LPCTSTR g_cszSvc;
  34. extern HINSTANCE hInstance;
  35. class CConfigDll : public CWinApp
  36. /*++
  37. Class Description:
  38. USRDLL CWinApp module
  39. Public Interface:
  40. CConfigDll : Constructor
  41. InitInstance : Perform initialization of this module
  42. ExitInstance : Perform termination and cleanup
  43. --*/
  44. {
  45. public:
  46. CConfigDll(
  47. IN LPCTSTR pszAppName = NULL
  48. );
  49. virtual BOOL InitInstance();
  50. virtual int ExitInstance();
  51. protected:
  52. //{{AFX_MSG(CConfigDll)
  53. //}}AFX_MSG
  54. DECLARE_MESSAGE_MAP()
  55. private:
  56. CString m_strHelpPath;
  57. LPCTSTR m_lpOldHelpPath;
  58. };
  59. inline BOOL LoggingEnabled(
  60. IN DWORD dwLogType
  61. )
  62. {
  63. return (dwLogType == MD_LOG_TYPE_ENABLED);
  64. }
  65. inline void EnableLogging(
  66. OUT DWORD & dwLogType,
  67. IN BOOL fEnabled = TRUE
  68. )
  69. {
  70. dwLogType = fEnabled ? MD_LOG_TYPE_ENABLED : MD_LOG_TYPE_DISABLED;
  71. }
  72. class CFTPInstanceProps : public CInstanceProps
  73. /*++
  74. Class Description:
  75. FTP Properties
  76. Public Interface:
  77. CFTPInstanceProps : Constructor
  78. --*/
  79. {
  80. public:
  81. //
  82. // Constructor
  83. //
  84. CFTPInstanceProps(
  85. IN LPCTSTR lpszServerName,
  86. IN DWORD dwInstance = MASTER_INSTANCE
  87. );
  88. public:
  89. //
  90. // Write Data if dirty
  91. //
  92. virtual HRESULT WriteDirtyProps();
  93. protected:
  94. //
  95. // Break out GetAllData() data to data fields
  96. //
  97. virtual void ParseFields();
  98. public:
  99. //
  100. // Service Page
  101. //
  102. MP_CILong m_nMaxConnections;
  103. MP_CILong m_nConnectionTimeOut;
  104. MP_DWORD m_dwLogType;
  105. //
  106. // Accounts Page
  107. //
  108. MP_CString m_strUserName;
  109. MP_CString m_strPassword;
  110. MP_BOOL m_fAllowAnonymous;
  111. MP_BOOL m_fOnlyAnonymous;
  112. MP_BOOL m_fPasswordSync;
  113. MP_CBlob m_acl;
  114. //
  115. // Message Page
  116. //
  117. MP_CString m_strExitMessage;
  118. MP_CString m_strMaxConMsg;
  119. MP_CStringListEx m_strlWelcome;
  120. //
  121. // Directory Properties Page
  122. //
  123. MP_BOOL m_fDosDirOutput;
  124. //
  125. // Default Site page
  126. //
  127. MP_DWORD m_dwDownlevelInstance;
  128. };
  129. class CFTPDirProps : public CChildNodeProps
  130. /*++
  131. Class Description:
  132. FTP Directory properties
  133. Public Interface:
  134. CFTPDirProps : Constructor
  135. --*/
  136. {
  137. public:
  138. CFTPDirProps(
  139. IN LPCTSTR lpszServerName,
  140. IN DWORD dwInstance = MASTER_INSTANCE,
  141. IN LPCTSTR lpszParent = NULL,
  142. IN LPCTSTR lpszAlias = NULL
  143. );
  144. public:
  145. //
  146. // Write Data if dirty
  147. //
  148. virtual HRESULT WriteDirtyProps();
  149. protected:
  150. //
  151. // Break out GetAllData() data to data fields
  152. //
  153. virtual void ParseFields();
  154. public:
  155. //
  156. // Directory properties page
  157. //
  158. MP_CString m_strUserName;
  159. MP_CString m_strPassword;
  160. MP_BOOL m_fDontLog;
  161. MP_CBlob m_ipl;
  162. };
  163. class CFtpSheet : public CInetPropertySheet
  164. {
  165. /*++
  166. Class Description:
  167. Ftp Property sheet
  168. Public Interface:
  169. CFtpSheet : Constructor
  170. Initialize : Initialize config data
  171. --*/
  172. public:
  173. //
  174. // Constructor
  175. //
  176. CFtpSheet(
  177. IN LPCTSTR pszCaption,
  178. IN LPCTSTR lpszServer,
  179. IN DWORD dwInstance,
  180. IN LPCTSTR lpszParent,
  181. IN LPCTSTR lpszAlias,
  182. IN CWnd * pParentWnd = NULL,
  183. IN LPARAM lParam = 0L,
  184. IN LONG_PTR handle = 0L,
  185. IN UINT iSelectPage = 0
  186. );
  187. ~CFtpSheet();
  188. public:
  189. HRESULT QueryInstanceResult() const;
  190. HRESULT QueryDirectoryResult() const;
  191. CFTPInstanceProps & GetInstanceProperties() { return *m_ppropInst; }
  192. CFTPDirProps & GetDirectoryProperties() { return *m_ppropDir; }
  193. virtual HRESULT LoadConfigurationParameters();
  194. virtual void FreeConfigurationParameters();
  195. protected:
  196. virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT);
  197. // Generated message map functions
  198. //{{AFX_MSG(CFtpSheet)
  199. //}}AFX_MSG
  200. DECLARE_MESSAGE_MAP()
  201. private:
  202. CFTPInstanceProps * m_ppropInst;
  203. CFTPDirProps * m_ppropDir;
  204. };
  205. //
  206. // Inline Expansion
  207. //
  208. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  209. inline HRESULT CFtpSheet::QueryInstanceResult() const
  210. {
  211. return m_ppropInst ? m_ppropInst->QueryResult() : S_OK;
  212. }
  213. inline HRESULT CFtpSheet::QueryDirectoryResult() const
  214. {
  215. return m_ppropDir ? m_ppropDir->QueryResult() : S_OK;
  216. }
  217. #define FTPSCFG_DLL_NAME _T("FSCFG.DLL")