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.

132 lines
5.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // TaskCommitClusterChanges.h
  7. //
  8. // Description:
  9. // CTaskCommitClusterChanges implementation.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 22-NOV-1999
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Make sure that this file is included only once per compile path.
  16. #pragma once
  17. //////////////////////////////////////////////////////////////////////////////
  18. // Include Files
  19. //////////////////////////////////////////////////////////////////////////////
  20. #include "TaskTracking.h"
  21. //////////////////////////////////////////////////////////////////////////////
  22. // Constant Declarations
  23. //////////////////////////////////////////////////////////////////////////////
  24. //////////////////////////////////////////////////////////////////////////////
  25. //++
  26. //
  27. // class CTaskCommitClusterChanges
  28. //
  29. // Description:
  30. // This is the base class for the task that commits the user's
  31. // configuration changes to the cluster.
  32. //
  33. //--
  34. //////////////////////////////////////////////////////////////////////////////
  35. class CTaskCommitClusterChanges
  36. : public ITaskCommitClusterChanges
  37. , public INotifyUI
  38. , public IClusCfgCallback
  39. , public CTaskTracking
  40. {
  41. private:
  42. // IUnknown
  43. LONG m_cRef;
  44. // ITaskCommitClusterChanges
  45. BOOL m_fJoining; // If we are attempting to join...
  46. OBJECTCOOKIE m_cookie; // Task completion cookie
  47. IClusCfgCallback * m_pcccb; // Marshalled callback interface
  48. OBJECTCOOKIE * m_pcookies; // Completion cookies for the subtasks.
  49. ULONG m_cNodes; // Count of nodes/subtasks that need to signal completion.
  50. HANDLE m_event; // Synchronization event to signal when subtasks have completed.
  51. OBJECTCOOKIE m_cookieCluster; // Cookie of the cluster to commit changes
  52. OBJECTCOOKIE m_cookieFormingNode; // Cookie of the forming node.
  53. IUnknown * m_punkFormingNode; // The node to form the cluster.
  54. BSTR m_bstrClusterName; // The cluster to form
  55. BSTR m_bstrClusterBindingString; // The cluster to form
  56. IClusCfgCredentials * m_pccc; // The cluster service account credentials.
  57. ULONG m_ulIPAddress; // IP address of the new cluster.
  58. ULONG m_ulSubnetMask; // IP subnet mask of the new cluster.
  59. BSTR m_bstrNetworkUID; // UID of the network the IP should be advertized.
  60. BSTR m_bstrNodeName; // Node name used be SendStatusReport.
  61. BOOL m_fStop; // Should this task stop?
  62. IEnumCookies * m_pen; // Nodes to form/join
  63. INotifyUI * m_pnui;
  64. IObjectManager * m_pom;
  65. ITaskManager * m_ptm;
  66. IConnectionManager * m_pcm;
  67. // INotifyUI
  68. ULONG m_cSubTasksDone; // The number of subtasks done.
  69. HRESULT m_hrStatus; // Status of callbacks
  70. CTaskCommitClusterChanges( void );
  71. ~CTaskCommitClusterChanges( void );
  72. // Private copy constructor to prevent copying.
  73. CTaskCommitClusterChanges( const CTaskCommitClusterChanges & );
  74. // Private assignment operator to prevent copying.
  75. CTaskCommitClusterChanges & operator = ( const CTaskCommitClusterChanges & );
  76. STDMETHOD( HrInit )( void );
  77. HRESULT HrCompareAndPushInformationToNodes( void );
  78. HRESULT HrGatherClusterInformation( void );
  79. HRESULT HrFormFirstNode( void );
  80. HRESULT HrAddJoiningNodes( void );
  81. HRESULT HrAddAJoiningNode( BSTR bstrNameIn, OBJECTCOOKIE cookieIn );
  82. HRESULT HrSendStatusReport( LPCWSTR pcszNodeNameIn, CLSID clsidMajorIn, CLSID clsidMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrIn, int nDescriptionIdIn );
  83. public: // Methods
  84. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  85. // IUnknown
  86. STDMETHOD( QueryInterface )( REFIID riidIn, LPVOID * ppvOut );
  87. STDMETHOD_( ULONG, AddRef )( void );
  88. STDMETHOD_( ULONG, Release )( void );
  89. // IDoTask / ITaskCommitClusterChanges
  90. STDMETHOD( BeginTask )( void );
  91. STDMETHOD( StopTask )( void );
  92. STDMETHOD( SetCookie )( OBJECTCOOKIE cookieIn );
  93. STDMETHOD( SetClusterCookie )( OBJECTCOOKIE cookieClusterIn );
  94. STDMETHOD( SetJoining )( void );
  95. // IClusCfgCallback
  96. STDMETHOD( SendStatusReport )(
  97. LPCWSTR pcszNodeNameIn
  98. , CLSID clsidTaskMajorIn
  99. , CLSID clsidTaskMinorIn
  100. , ULONG ulMinIn
  101. , ULONG ulMaxIn
  102. , ULONG ulCurrentIn
  103. , HRESULT hrStatusIn
  104. , LPCWSTR pcszDescriptionIn
  105. , FILETIME * pftTimeIn
  106. , LPCWSTR pcszReferenceIn
  107. );
  108. // INotifyUI
  109. STDMETHOD( ObjectChanged )( OBJECTCOOKIE cookieIn );
  110. }; //*** class CTaskCommitClusterChanges