Source code of Windows XP (NT5)
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.

112 lines
4.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // TaskAnalyzeCluster.h
  7. //
  8. // Description:
  9. // CTaskAnalyzeCluster implementation.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 22-NOV-1999
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #pragma once
  16. // CTaskAnalyzeCluster
  17. class
  18. CTaskAnalyzeCluster:
  19. public ITaskAnalyzeCluster,
  20. public IClusCfgCallback,
  21. public INotifyUI
  22. {
  23. private:
  24. // IUnknown
  25. LONG m_cRef;
  26. // ITaskAnalyzeCluster
  27. OBJECTCOOKIE m_cookieCompletion; // Task completion cookie
  28. IClusCfgCallback * m_pcccb; // Callback interface
  29. OBJECTCOOKIE * m_pcookies; // Completion cookies for the subtasks.
  30. ULONG m_cCookies; // Count of completion cookies in m_pcookies
  31. ULONG m_cNodes; // Count of nodes in configuration
  32. HANDLE m_event; // Synchronization event to signal when subtasks have completed.
  33. OBJECTCOOKIE m_cookieCluster; // Cookie of the cluster to analyze
  34. BSTR m_bstrClusterName; // Name of the cluster to analyze
  35. BOOL m_fJoiningMode; // FALSE = forming mode. TRUE = joining mode.
  36. ULONG m_cUserNodes; // The count of nodes that the user entered. It is also the "sizeof" the array, m_pcookiesUser.
  37. OBJECTCOOKIE * m_pcookiesUser; // The cookies of nodes that the user entered.
  38. BSTR m_bstrNodeName;
  39. INotifyUI * m_pnui;
  40. IObjectManager * m_pom;
  41. ITaskManager * m_ptm;
  42. IConnectionManager * m_pcm;
  43. BSTR m_bstrQuorumUID; // Quorum device UID
  44. bool m_fStop;
  45. // INotifyUI
  46. ULONG m_cSubTasksDone; // The number of subtasks done.
  47. HRESULT m_hrStatus; // Status of callbacks
  48. CTaskAnalyzeCluster( void );
  49. ~CTaskAnalyzeCluster( void );
  50. STDMETHOD( Init )( void );
  51. HRESULT HrWaitForClusterConnection( void );
  52. HRESULT HrCountNumberOfNodes( void );
  53. HRESULT HrCreateSubTasksToGatherNodeInfo( void );
  54. HRESULT HrCreateSubTasksToGatherNodeResourcesAndNetworks( void );
  55. HRESULT HrCheckClusterFeasibility( void );
  56. HRESULT HrAddJoinedNodes( void );
  57. HRESULT HrCheckClusterMembership( void );
  58. HRESULT HrCompareResources( void );
  59. HRESULT HrCreateNewManagedResourceInClusterConfiguration( IClusCfgManagedResourceInfo * pccmriIn, IClusCfgManagedResourceInfo ** ppccmriNewOut );
  60. HRESULT HrCheckForCommonQuorumResource( void );
  61. HRESULT HrCompareNetworks( void );
  62. HRESULT HrCreateNewNetworkInClusterConfiguration( IClusCfgNetworkInfo * pccmriIn, IClusCfgNetworkInfo ** ppccmriNewOut );
  63. HRESULT HrFreeCookies( void );
  64. HRESULT HrRetrieveCookiesName( CLSID clsidMajorIn, OBJECTCOOKIE cookieIn, BSTR * pbstrNameOut );
  65. HRESULT HrCheckInteroperability( void );
  66. HRESULT HrEnsureAllJoiningNodesSameVersion( DWORD * pdwNodeHighestVersionOut, DWORD * pdwNodeLowestVersionOut, bool * pfAllNodesMatchOut );
  67. HRESULT HrGetUsersNodesCookies( void );
  68. HRESULT HrIsUserAddedNode( BSTR bstrNodeNameIn );
  69. public: // Methods
  70. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  71. // IUnknown
  72. STDMETHOD( QueryInterface )( REFIID riid, LPVOID *ppv );
  73. STDMETHOD_( ULONG, AddRef )( void );
  74. STDMETHOD_( ULONG, Release )( void );
  75. // IDoTask / ITaskAnalyzeCluster
  76. STDMETHOD( BeginTask )( void );
  77. STDMETHOD( StopTask )( void );
  78. STDMETHOD( SetJoiningMode )( void );
  79. STDMETHOD( SetCookie )( OBJECTCOOKIE cookieIn );
  80. STDMETHOD( SetClusterCookie )( OBJECTCOOKIE cookieClusterIn );
  81. // IClusCfgCallback
  82. STDMETHOD( SendStatusReport )(
  83. LPCWSTR pcszNodeNameIn
  84. , CLSID clsidTaskMajorIn
  85. , CLSID clsidTaskMinorIn
  86. , ULONG ulMinIn
  87. , ULONG ulMaxIn
  88. , ULONG ulCurrentIn
  89. , HRESULT hrStatusIn
  90. , LPCWSTR pcszDescriptionIn
  91. , FILETIME * pftTimeIn
  92. , LPCWSTR pcszReferenceIn
  93. );
  94. // INotifyUI
  95. STDMETHOD( ObjectChanged )( OBJECTCOOKIE cookieIn );
  96. }; // class CTaskAnalyzeCluster