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.

188 lines
4.4 KiB

  1. /*++
  2. Module Name:
  3. NewFrs.h
  4. Abstract:
  5. This module contains the declaration for CNewReplicaSet wizard pages.
  6. These classes implement pages in the Create Replica Set wizard.
  7. --*/
  8. #ifndef _NEWFRS_H_
  9. #define _NEWFRS_H_
  10. #include "dfscore.h"
  11. #include "QWizPage.h"
  12. #include "mmcroot.h"
  13. #include <list>
  14. using namespace std;
  15. class CAlternateReplicaInfo
  16. {
  17. public:
  18. CComBSTR m_bstrDisplayName;
  19. CComBSTR m_bstrDnsHostName;
  20. CComBSTR m_bstrRootPath;
  21. CComBSTR m_bstrStagingPath;
  22. FRSSHARE_TYPE m_nFRSShareType;
  23. HRESULT m_hrFRS;
  24. DWORD m_dwServiceStartType;
  25. DWORD m_dwServiceState;
  26. CAlternateReplicaInfo() { Reset(); }
  27. void Reset();
  28. };
  29. typedef list<CAlternateReplicaInfo *> AltRepList;
  30. void FreeAltRepList(AltRepList* pList);
  31. class CNewReplicaSet
  32. {
  33. public:
  34. CComBSTR m_bstrDomain;
  35. CComBSTR m_bstrReplicaSetDN;
  36. CComBSTR m_bstrPrimaryServer;
  37. CComBSTR m_bstrTopologyPref;
  38. CComBSTR m_bstrHubServer;
  39. CComBSTR m_bstrFileFilter;
  40. CComBSTR m_bstrDirFilter;
  41. HRESULT m_hr;
  42. AltRepList m_AltRepList;
  43. CComPtr<IReplicaSet> m_piReplicaSet;
  44. HRESULT Initialize(
  45. BSTR i_bstrDomain,
  46. BSTR i_bstrReplicaSetDN,
  47. DFS_REPLICA_LIST* i_pMmcRepList
  48. );
  49. private:
  50. BOOL _InsertList(CAlternateReplicaInfo* pInfo);
  51. void _Reset();
  52. };
  53. class CNewReplicaSetPage0:
  54. public CQWizardPageImpl<CNewReplicaSetPage0>
  55. {
  56. BEGIN_MSG_MAP(CNewReplicaSetPage0)
  57. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  58. CHAIN_MSG_MAP(CQWizardPageImpl<CNewReplicaSetPage0>)
  59. END_MSG_MAP()
  60. public:
  61. enum { IDD = IDD_NEWFRSWIZ_PAGE0 };
  62. CNewReplicaSetPage0();
  63. ~CNewReplicaSetPage0();
  64. BOOL OnSetActive();
  65. LRESULT OnInitDialog(
  66. IN UINT i_uMsg,
  67. IN WPARAM i_wParam,
  68. IN LPARAM i_lParam,
  69. IN OUT BOOL& io_bHandled
  70. );
  71. private:
  72. HFONT m_hBigBoldFont;
  73. };
  74. class CNewReplicaSetPage1:
  75. public CQWizardPageImpl<CNewReplicaSetPage1>
  76. {
  77. BEGIN_MSG_MAP(CNewReplicaSetPage1)
  78. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  79. MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
  80. COMMAND_ID_HANDLER(IDC_NEWFRSWIZ_STAGING, OnStaging)
  81. CHAIN_MSG_MAP(CQWizardPageImpl<CNewReplicaSetPage1>)
  82. END_MSG_MAP()
  83. public:
  84. enum { IDD = IDD_NEWFRSWIZ_PAGE1 };
  85. CNewReplicaSetPage1(CNewReplicaSet* i_pRepSet);
  86. BOOL OnSetActive();
  87. BOOL OnWizardBack();
  88. BOOL OnWizardNext();
  89. LRESULT OnInitDialog(
  90. IN UINT i_uMsg,
  91. IN WPARAM i_wParam,
  92. IN LPARAM i_lParam,
  93. IN OUT BOOL& io_bHandled
  94. );
  95. LRESULT OnNotify(
  96. IN UINT i_uMsg,
  97. IN WPARAM i_wParam,
  98. IN LPARAM i_lParam,
  99. IN OUT BOOL& io_bHandled
  100. );
  101. BOOL OnItemChanged();
  102. BOOL OnStaging(
  103. IN WORD wNotifyCode,
  104. IN WORD wID,
  105. IN HWND hWndCtl,
  106. IN BOOL& bHandled
  107. );
  108. private:
  109. void _Reset();
  110. CNewReplicaSet* m_pRepSet;
  111. int m_nCount; // number of eligible members
  112. };
  113. class CNewReplicaSetPage2:
  114. public CQWizardPageImpl<CNewReplicaSetPage2>
  115. {
  116. BEGIN_MSG_MAP(CNewReplicaSetPage2)
  117. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  118. COMMAND_ID_HANDLER(IDC_NEWFRSWIZ_TOPOLOGYPREF, OnTopologyPref)
  119. CHAIN_MSG_MAP(CQWizardPageImpl<CNewReplicaSetPage2>)
  120. END_MSG_MAP()
  121. public:
  122. enum { IDD = IDD_NEWFRSWIZ_PAGE2 };
  123. CNewReplicaSetPage2(CNewReplicaSet* i_pRepSet, BOOL i_bNewSchema);
  124. BOOL OnSetActive();
  125. BOOL OnWizardBack();
  126. BOOL OnWizardFinish();
  127. LRESULT OnInitDialog(
  128. IN UINT i_uMsg,
  129. IN WPARAM i_wParam,
  130. IN LPARAM i_lParam,
  131. IN OUT BOOL& io_bHandled
  132. );
  133. BOOL OnTopologyPref(
  134. IN WORD wNotifyCode,
  135. IN WORD wID,
  136. IN HWND hWndCtl,
  137. IN BOOL& bHandled
  138. );
  139. private:
  140. void _Reset();
  141. HRESULT _CreateReplicaSet();
  142. CNewReplicaSet* m_pRepSet;
  143. BOOL m_bNewSchema;
  144. };
  145. #endif // _NEWFRS_H_