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.

182 lines
4.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1997 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Iis.h
  7. //
  8. // Abstract:
  9. // Definition of the CIISVirtualRootParamsPage class, which implements the
  10. // Parameters page for IIS resources.
  11. //
  12. // Implementation File:
  13. // Iis.cpp
  14. //
  15. // Author:
  16. // Pete Benoit (v-pbenoi) October 16, 1996
  17. // David Potter (davidp) October 17, 1996
  18. //
  19. // Revision History:
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _IIS_H_
  25. #define _IIS_H_
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. /////////////////////////////////////////////////////////////////////////////
  29. #ifndef _BASEPAGE_H_
  30. #include "BasePage.h" // for CBasePropertyPage
  31. #endif
  32. #include "ConstDef.h" // for IIS_SVC_NAME_WWW/IIS_SVC_NAME_FTP
  33. #define SERVER_TYPE_FTP 0
  34. #define SERVER_TYPE_WWW 1
  35. #define SERVER_TYPE_UNKNOWN -1
  36. /////////////////////////////////////////////////////////////////////////////
  37. // Forward Class Declarations
  38. /////////////////////////////////////////////////////////////////////////////
  39. class CIISVirtualRootParamsPage;
  40. class IISMapper;
  41. //
  42. // Private prototypes
  43. //
  44. class IISMapper {
  45. public:
  46. IISMapper() {}
  47. IISMapper( LPWSTR pszName, LPWSTR pszId, BOOL fClusterEnabled, int nServerType = SERVER_TYPE_UNKNOWN)
  48. : m_strName ( pszName ),
  49. m_strId ( pszId ),
  50. m_fClusterEnabled ( fClusterEnabled),
  51. m_nServerType ( nServerType )
  52. {
  53. }
  54. CString& GetName() { return m_strName; }
  55. CString& GetId() { return m_strId; }
  56. int GetServerType() { return m_nServerType; }
  57. BOOL IsClusterEnabled() { return m_fClusterEnabled; }
  58. private:
  59. CString m_strName;
  60. CString m_strId;
  61. BOOL m_fClusterEnabled;
  62. int m_nServerType;
  63. } ;
  64. /////////////////////////////////////////////////////////////////////////////
  65. //
  66. // CIISVirtualRootParamsPage
  67. //
  68. // Purpose:
  69. // Parameters page for resources.
  70. //
  71. /////////////////////////////////////////////////////////////////////////////
  72. class CIISVirtualRootParamsPage : public CBasePropertyPage
  73. {
  74. DECLARE_DYNCREATE(CIISVirtualRootParamsPage)
  75. // Construction
  76. public:
  77. CIISVirtualRootParamsPage(void);
  78. // Dialog Data
  79. //{{AFX_DATA(CIISVirtualRootParamsPage)
  80. enum { IDD = IDD_PP_IIS_PARAMETERS };
  81. CButton m_ckbWrite;
  82. CButton m_ckbRead;
  83. CButton m_groupAccess;
  84. CEdit m_editPassword;
  85. CStatic m_staticPassword;
  86. CEdit m_editAccountName;
  87. CStatic m_staticAccountName;
  88. CButton m_groupAccountInfo;
  89. CEdit m_editDirectory;
  90. CButton m_rbWWW;
  91. CButton m_rbFTP;
  92. int m_nServerType;
  93. int m_nInitialServerType;
  94. CString m_strDirectory;
  95. CString m_strAccountName;
  96. CString m_strPassword;
  97. CEdit m_editInstanceId;
  98. CComboBox m_cInstanceId;
  99. CString m_strInstanceName;
  100. CString m_strInstanceId;
  101. BOOL m_bRead;
  102. BOOL m_bWrite;
  103. //}}AFX_DATA
  104. CString m_strServiceName;
  105. CString m_strPrevServiceName;
  106. CString m_strPrevDirectory;
  107. CString m_strPrevAccountName;
  108. CString m_strPrevPassword;
  109. CString m_strPrevInstanceId;
  110. DWORD m_dwAccessMask;
  111. DWORD m_dwPrevAccessMask;
  112. protected:
  113. enum
  114. {
  115. epropServiceName,
  116. epropInstanceId,
  117. epropMAX
  118. };
  119. CObjectProperty m_rgProps[epropMAX];
  120. // Overrides
  121. public:
  122. // ClassWizard generate virtual function overrides
  123. //{{AFX_VIRTUAL(CIISVirtualRootParamsPage)
  124. public:
  125. virtual BOOL OnSetActive();
  126. protected:
  127. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  128. //}}AFX_VIRTUAL
  129. protected:
  130. virtual const CObjectProperty * Pprops(void) const { return m_rgProps; }
  131. virtual DWORD Cprops(void) const { return sizeof(m_rgProps) / sizeof(CObjectProperty); }
  132. void FillServerList();
  133. void SetEnableNext();
  134. private:
  135. BOOL m_fReadList;
  136. CArray <IISMapper, IISMapper> m_W3Array, m_FTPArray;
  137. LPWSTR NameToMetabaseId( BOOL fIsW3, CString& strName);
  138. LPWSTR MetabaseIdToName( BOOL fIsW3, CString& strId);
  139. HRESULT ReadList(CArray <IISMapper, IISMapper>* pMapperArray, LPWSTR pszPath, LPCWSTR wcsServerName, int nServerType);
  140. // Implementation
  141. protected:
  142. // Generated message map functions
  143. //{{AFX_MSG(CIISVirtualRootParamsPage)
  144. virtual BOOL OnInitDialog();
  145. afx_msg void OnChangeRequiredField();
  146. afx_msg void OnChangeServiceType();
  147. afx_msg void OnRefresh();
  148. //}}AFX_MSG
  149. DECLARE_MESSAGE_MAP()
  150. }; //*** class CIISVirtualRootParamsPage
  151. /////////////////////////////////////////////////////////////////////////////
  152. #endif // _IIS_H_