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.

321 lines
7.7 KiB

  1. /*++
  2. Module Name:
  3. DfsWiz.h
  4. Abstract:
  5. This module contains the declaration for CCreateDfsRootWizPage1, 2, 3, 4, 5, 6.
  6. These classes implement pages in the CreateDfs Root wizard.
  7. --*/
  8. #ifndef __CREATE_DFSROOT_WIZARD_PAGES_H_
  9. #define __CREATE_DFSROOT_WIZARD_PAGES_H_
  10. #include "QWizPage.h" // The base class that implements the common functionality
  11. // of wizard pages
  12. #include "MmcAdmin.h"
  13. #include "utils.h"
  14. // This structure is used to pass information to and from the pages.
  15. // Finally this is used to create the dfs root
  16. class CREATEDFSROOTWIZINFO
  17. {
  18. public:
  19. HFONT hBigBoldFont;
  20. HFONT hBoldFont;
  21. DFS_TYPE DfsType;
  22. BSTR bstrSelectedDomain;
  23. BSTR bstrSelectedServer;
  24. bool bPostW2KVersion;
  25. BOOL bShareExists;
  26. BSTR bstrSharePath;
  27. BSTR bstrDfsRootName;
  28. BSTR bstrDfsRootComment;
  29. CMmcDfsAdmin* pMMCAdmin;
  30. bool bRootReplica;
  31. bool bDfsSetupSuccess;
  32. CREATEDFSROOTWIZINFO()
  33. :DfsType(DFS_TYPE_UNASSIGNED),
  34. bstrSelectedDomain(NULL),
  35. bstrSelectedServer(NULL),
  36. bPostW2KVersion(false),
  37. bShareExists(FALSE),
  38. bstrSharePath(NULL),
  39. bstrDfsRootName(NULL),
  40. bstrDfsRootComment(NULL),
  41. pMMCAdmin(NULL),
  42. bRootReplica(false),
  43. bDfsSetupSuccess(false)
  44. {
  45. SetupFonts( _Module.GetResourceInstance(), NULL, &hBigBoldFont, &hBoldFont );
  46. return;
  47. }
  48. ~CREATEDFSROOTWIZINFO()
  49. {
  50. DestroyFonts(hBigBoldFont, hBoldFont);
  51. SAFE_SYSFREESTRING(&bstrSelectedDomain);
  52. SAFE_SYSFREESTRING(&bstrSelectedServer);
  53. SAFE_SYSFREESTRING(&bstrSharePath);
  54. SAFE_SYSFREESTRING(&bstrDfsRootName);
  55. SAFE_SYSFREESTRING(&bstrDfsRootComment);
  56. return;
  57. }
  58. };
  59. typedef CREATEDFSROOTWIZINFO *LPCREATEDFSROOTWIZINFO;
  60. // ----------------------------------------------------------------------------
  61. // CCreateDfsRootWizPage1: Welcome page
  62. class CCreateDfsRootWizPage1: public CQWizardPageImpl<CCreateDfsRootWizPage1>
  63. {
  64. public:
  65. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE1 };
  66. CCreateDfsRootWizPage1(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  67. BOOL OnSetActive();
  68. private:
  69. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  70. };
  71. // ----------------------------------------------------------------------------
  72. // CCreateDfsRootWizPage2: Dfsroot type selection, domain or standalone
  73. class CCreateDfsRootWizPage2: public CQWizardPageImpl<CCreateDfsRootWizPage2>
  74. {
  75. public:
  76. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE2 };
  77. CCreateDfsRootWizPage2(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  78. BOOL OnSetActive();
  79. BOOL OnWizardNext();
  80. BOOL OnWizardBack();
  81. private:
  82. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  83. };
  84. // ----------------------------------------------------------------------------
  85. // CCreateDfsRootWizPage3: Domain selection for DFS root
  86. class CCreateDfsRootWizPage3: public CQWizardPageImpl<CCreateDfsRootWizPage3>
  87. {
  88. public:
  89. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE3 };
  90. BEGIN_MSG_MAP(CCreateDfsRootWizPage3)
  91. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  92. MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
  93. CHAIN_MSG_MAP(CQWizardPageImpl<CCreateDfsRootWizPage3>)
  94. END_MSG_MAP()
  95. CCreateDfsRootWizPage3(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  96. BOOL OnSetActive();
  97. BOOL OnWizardNext();
  98. BOOL OnWizardBack();
  99. LRESULT OnNotify(
  100. IN UINT i_uMsg,
  101. IN WPARAM i_wParam,
  102. IN LPARAM i_lParam,
  103. IN OUT BOOL& io_bHandled
  104. );
  105. BOOL OnItemChanged(
  106. IN INT i_iItem
  107. );
  108. LRESULT OnInitDialog(
  109. IN UINT i_uMsg,
  110. IN WPARAM i_wParam,
  111. IN LPARAM i_lParam,
  112. IN OUT BOOL& io_bHandled
  113. );
  114. private:
  115. // Add the domains to the list
  116. HRESULT AddDomainsToList(
  117. IN HWND i_hImageList
  118. );
  119. // To set default values for the controls, etc
  120. HRESULT SetDefaultValues(
  121. );
  122. private:
  123. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  124. };
  125. // ----------------------------------------------------------------------------
  126. // CCreateDfsRootWizPage4: Server selection
  127. class CCreateDfsRootWizPage4: public CQWizardPageImpl<CCreateDfsRootWizPage4>
  128. {
  129. public:
  130. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE4 };
  131. BEGIN_MSG_MAP(CCreateDfsRootWizPage4)
  132. COMMAND_ID_HANDLER(IDCSERVERS_BROWSE, OnBrowse)
  133. CHAIN_MSG_MAP(CQWizardPageImpl<CCreateDfsRootWizPage4>)
  134. END_MSG_MAP()
  135. CCreateDfsRootWizPage4(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  136. BOOL OnSetActive();
  137. BOOL OnWizardNext();
  138. BOOL OnWizardBack();
  139. BOOL OnBrowse(
  140. IN WORD wNotifyCode,
  141. IN WORD wID,
  142. IN HWND hWndCtl,
  143. IN BOOL& bHandled
  144. );
  145. private:
  146. HRESULT IsServerInDomain(IN LPCTSTR lpszServer);
  147. // To check if the user entered proper values
  148. HRESULT CheckUserEnteredValues(
  149. IN LPCTSTR i_szMachineName,
  150. OUT BSTR* o_pbstrComputerName
  151. );
  152. private:
  153. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  154. CLIPFORMAT m_cfDsObjectNames;
  155. };
  156. // ----------------------------------------------------------------------------
  157. // CCreateDfsRootWizPage5: Share selection
  158. // Displays the shares given a server. Allows choosing from this list or
  159. // creating a new one.
  160. class CCreateDfsRootWizPage5: public CQWizardPageImpl<CCreateDfsRootWizPage5>
  161. {
  162. public:
  163. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE5 };
  164. BEGIN_MSG_MAP(CCreateDfsRootWizPage5)
  165. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  166. COMMAND_ID_HANDLER(IDCSHARE_BROWSE, OnBrowse)
  167. CHAIN_MSG_MAP(CQWizardPageImpl<CCreateDfsRootWizPage5>)
  168. END_MSG_MAP()
  169. CCreateDfsRootWizPage5(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  170. BOOL OnSetActive();
  171. BOOL OnWizardNext();
  172. BOOL OnWizardBack();
  173. LRESULT OnInitDialog(
  174. IN UINT i_uMsg,
  175. IN WPARAM i_wParam,
  176. IN LPARAM i_lParam,
  177. IN OUT BOOL& io_bHandled
  178. );
  179. BOOL OnBrowse(
  180. IN WORD wNotifyCode,
  181. IN WORD wID,
  182. IN HWND hWndCtl,
  183. IN BOOL& bHandled
  184. );
  185. private:
  186. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  187. };
  188. // ----------------------------------------------------------------------------
  189. // CCreateDfsRootWizPage6: DfsRoot name selection, share has to be the same as the root
  190. class CCreateDfsRootWizPage6: public CQWizardPageImpl<CCreateDfsRootWizPage6>
  191. {
  192. BEGIN_MSG_MAP(CCreateDfsRootWizPage6)
  193. COMMAND_HANDLER(IDC_EDIT_DFSROOT_NAME, EN_CHANGE, OnChangeDfsRoot)
  194. CHAIN_MSG_MAP(CQWizardPageImpl<CCreateDfsRootWizPage6>)
  195. END_MSG_MAP()
  196. public:
  197. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE6 };
  198. CCreateDfsRootWizPage6(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  199. BOOL OnSetActive();
  200. BOOL OnWizardNext();
  201. BOOL OnWizardBack();
  202. LRESULT OnChangeDfsRoot(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  203. private:
  204. // Update the text labels
  205. HRESULT UpdateLabels();
  206. private:
  207. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  208. };
  209. // ----------------------------------------------------------------------------
  210. // CCreateDfsRootWizPage7: Completion page
  211. class CCreateDfsRootWizPage7: public CQWizardPageImpl<CCreateDfsRootWizPage7>
  212. {
  213. public:
  214. enum { IDD = IDD_CREATE_DFSROOT_WIZ_PAGE7 };
  215. CCreateDfsRootWizPage7(IN LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  216. BOOL OnSetActive();
  217. BOOL OnWizardFinish();
  218. BOOL OnWizardBack();
  219. BOOL OnQueryCancel();
  220. private:
  221. LPCREATEDFSROOTWIZINFO m_lpWizInfo;
  222. };
  223. // Helper Function to Set Up Dfs, called from wizard
  224. HRESULT _SetUpDfs(LPCREATEDFSROOTWIZINFO i_lpWizInfo);
  225. #endif // __CREATE_DFSROOT_WIZARD_PAGES_H_