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.

288 lines
7.5 KiB

  1. /*++
  2. Module Name:
  3. MmcRep.h
  4. Abstract:
  5. This module contains the definition for CMmcDfsReplica class. This is an class
  6. for MMC display related calls for the thrid level node(the DfsReplica nodes)
  7. --*/
  8. #if !defined(AFX_MMCDFSREPLICA_H__6A7EDAC4_3FAC_11D1_AA1C_00C06C00392D__INCLUDED_)
  9. #define AFX_MMCDFSREPLICA_H__6A7EDAC4_3FAC_11D1_AA1C_00C06C00392D__INCLUDED_
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13. #include "DfsCore.h"
  14. #include "MmcDispl.h"
  15. #include "MmcRoot.h"
  16. #include "MmcJP.h"
  17. #include "NewFrs.h"
  18. class CMmcDfsReplica : public CMmcDisplay
  19. {
  20. public:
  21. CMmcDfsReplica(
  22. IDfsReplica* i_pReplicaObject,
  23. CMmcDfsJunctionPoint* i_pJPObject
  24. );
  25. CMmcDfsReplica(
  26. IDfsReplica* i_pReplicaObject,
  27. CMmcDfsRoot* i_pJPObject
  28. );
  29. virtual ~CMmcDfsReplica();
  30. // For adding context menu items
  31. STDMETHOD(AddMenuItems)(
  32. IN LPCONTEXTMENUCALLBACK i_lpContextMenuCallback,
  33. IN LPLONG i_lpInsertionAllowed
  34. );
  35. // For taking action on a context menu selection.
  36. STDMETHOD(Command)(
  37. IN LONG i_lCommandID
  38. );
  39. // Set the headers for the listview (in the result pane) column
  40. STDMETHOD(SetColumnHeader)(
  41. IN LPHEADERCTRL2 i_piHeaderControl
  42. );
  43. // Return the requested display information for the Result Pane
  44. STDMETHOD(GetResultDisplayInfo)(
  45. IN OUT LPRESULTDATAITEM io_pResultDataItem
  46. );
  47. // Return the requested display information for the Scope Pane
  48. STDMETHOD(GetScopeDisplayInfo)(
  49. IN OUT LPSCOPEDATAITEM io_pScopeDataItem
  50. ) { return S_OK; }
  51. // Add items(or folders), if any to the Scope Pane
  52. STDMETHOD(EnumerateScopePane)(
  53. IN LPCONSOLENAMESPACE i_lpConsoleNameSpace,
  54. IN HSCOPEITEM i_hParent
  55. ) { return S_OK; }
  56. // Add items(or folders), if any to the Result Pane
  57. STDMETHOD(EnumerateResultPane)(
  58. IN OUT IResultData* io_pResultData
  59. ) { return S_OK; }
  60. // Set the console verb settings. Change the state, decide the default verb, etc
  61. STDMETHOD(SetConsoleVerbs)(
  62. IN LPCONSOLEVERB i_lpConsoleVerb
  63. );
  64. // Add an item to the result pane
  65. STDMETHOD(AddItemToResultPane)(
  66. IN IResultData* i_lpResultData
  67. );
  68. // Checks whether the object has pages to display
  69. STDMETHOD(QueryPagesFor)(
  70. ) { return S_FALSE; };
  71. // Creates and passes back the pages to be displayed
  72. STDMETHOD(CreatePropertyPages)(
  73. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  74. IN LONG_PTR i_lNotifyHandle
  75. ) { return E_UNEXPECTED; };
  76. // Used to notify the object that it's properties have changed
  77. STDMETHOD(PropertyChanged)(
  78. ) { return E_UNEXPECTED; };
  79. // Used to set the result view description bar text
  80. STDMETHOD(SetDescriptionBarText)(
  81. IN LPRESULTDATA i_lpResultData
  82. )
  83. {
  84. RETURN_INVALIDARG_IF_NULL(i_lpResultData);
  85. return i_lpResultData->SetDescBarText(NULL);
  86. }
  87. STDMETHOD(SetStatusText)(
  88. IN LPCONSOLE2 i_lpConsole
  89. )
  90. {
  91. RETURN_INVALIDARG_IF_NULL(i_lpConsole);
  92. return i_lpConsole->SetStatusText(m_bstrStatusText);
  93. }
  94. // MMCN_DBLCLICK invoke the open ctxmenu.
  95. STDMETHOD(DoDblClick)(
  96. ) { (void) OnOpen(); return S_OK; }
  97. // Delete the current item.
  98. STDMETHOD(DoDelete)(
  99. );
  100. // Remove a replica
  101. STDMETHOD(RemoveReplica)(
  102. );
  103. // Remove a replica
  104. STDMETHOD(OnRemoveReplica)(
  105. );
  106. // confirm removal of replica
  107. STDMETHOD(ConfirmOperationOnDfsTarget)(int idString);
  108. // Check the replica status
  109. STDMETHOD(OnCheckStatus)(
  110. );
  111. // Handle a select event for the node. Handle only toolbar related
  112. // activities here
  113. STDMETHOD(ToolbarSelect)(
  114. IN const LONG i_lArg,
  115. IN IToolbar* i_pToolBar
  116. );
  117. // Handle a click on the toolbar
  118. STDMETHOD(ToolbarClick)(
  119. IN const LPCONTROLBAR i_pControlbar,
  120. IN const LPARAM i_lParam
  121. );
  122. STDMETHOD(TakeReplicaOffline)(
  123. );
  124. STDMETHOD(ViewChange)(
  125. IResultData* i_pResultData,
  126. LONG_PTR i_lHint
  127. );
  128. DISPLAY_OBJECT_TYPE GetDisplayObjectType()
  129. { return DISPLAY_OBJECT_TYPE_REPLICA; }
  130. HRESULT CreateToolbar(
  131. IN const LPCONTROLBAR i_pControlbar,
  132. IN const LPEXTENDCONTROLBAR i_lExtendControlbar,
  133. OUT IToolbar** o_pToolBar
  134. );
  135. HRESULT OnRefresh(
  136. ) { return(E_NOTIMPL); }
  137. HRESULT OnReplicate();
  138. HRESULT OnStopReplication(BOOL bConfirm = FALSE);
  139. HRESULT GetReplicationInfo();
  140. HRESULT GetReplicationInfoEx(CAlternateReplicaInfo** o_ppInfo);
  141. HRESULT ShowReplicationInfo(IReplicaSet* i_piReplicaSet);
  142. HRESULT GetBadMemberInfo(
  143. IN IReplicaSet* i_piReplicaSet,
  144. IN BSTR i_bstrServerName,
  145. OUT BSTR* o_pbstrDnsHostName,
  146. OUT BSTR* o_pbstrRootPath);
  147. HRESULT DeleteBadFRSMember(
  148. IN IReplicaSet* i_piReplicaSet,
  149. IN BSTR i_bstrDisplayName,
  150. IN HRESULT i_hres);
  151. HRESULT AddFRSMember(
  152. IN IReplicaSet* i_piReplicaSet,
  153. IN BSTR i_bstrDnsHostName,
  154. IN BSTR i_bstrRootPath,
  155. IN BSTR i_bstrStagingPath);
  156. HRESULT DeleteFRSMember(
  157. IN IReplicaSet* i_piReplicaSet,
  158. IN BSTR i_bstrDnsHostName,
  159. IN BSTR i_bstrRootPath);
  160. HRESULT RemoveReplicaFromSet();
  161. HRESULT AllowFRSMemberDeletion(BOOL* pbRepSetExist);
  162. // Internal methods
  163. private:
  164. friend class CMmcDfsRoot;
  165. HRESULT OnOpen();
  166. STDMETHOD(RemoveFromMMC)() { return S_OK; }
  167. STDMETHOD(CleanScopeChildren)() { return S_OK; }
  168. STDMETHOD(CleanResultChildren)() { return S_OK; }
  169. STDMETHOD(GetEntryPath)(BSTR* o_pbstrEntryPath) { return E_NOTIMPL;}
  170. void _UpdateThisItem();
  171. // Constants, Statics, etc
  172. public:
  173. static const int m_iIMAGE_OFFSET;
  174. CComBSTR m_bstrServerName;
  175. CComBSTR m_bstrShareName;
  176. CComBSTR m_bstrDisplayName; // Display name of the current Replica
  177. long m_lReferralState;
  178. long m_lTargetState;
  179. private:
  180. HRESULTITEM m_hResultItem; // Resultitem handle
  181. CComPtr<IResultData> m_pResultData;
  182. CComPtr<IDfsReplica> m_pDfsReplicaObject;
  183. CMmcDfsJunctionPoint* m_pDfsParentJP;
  184. CMmcDfsRoot* m_pDfsParentRoot;
  185. BOOL m_bFRSMember;
  186. CAlternateReplicaInfo* m_pRepInfo;
  187. CComBSTR m_bstrStatusText;
  188. CComBSTR m_bstrFRSColumnText;
  189. CComBSTR m_bstrDfsReferralColumnText;
  190. CComBSTR m_bstrTargetStatusColumnText;
  191. };
  192. #endif // !defined(AFX_MMCDFSREPLICA_H__6A7EDAC4_3FAC_11D1_AA1C_00C06C00392D__INCLUDED_)