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.

164 lines
4.8 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CEnumClusCfgManagedResources.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEnumClusCfgManagedResources
  10. // class.
  11. //
  12. // The class CEnumClusCfgManagedResources is the enumeration of cluster
  13. // managed devices. It implements the IEnumClusCfgManagedResources
  14. // interface.
  15. //
  16. // Documentation:
  17. //
  18. // Implementation Files:
  19. // CEnumClusCfgManagedResources.cpp
  20. //
  21. // Maintained By:
  22. // Galen Barbee (GalenB) 23-FEB-2000
  23. //
  24. //////////////////////////////////////////////////////////////////////////////
  25. // Make sure that this file is included only once per compile path.
  26. #pragma once
  27. //////////////////////////////////////////////////////////////////////////////
  28. // Include Files
  29. //////////////////////////////////////////////////////////////////////////////
  30. #include "PrivateInterfaces.h"
  31. //////////////////////////////////////////////////////////////////////////////
  32. // Constant Declarations
  33. //////////////////////////////////////////////////////////////////////////////
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEnumClusCfgManagedResources
  38. //
  39. // Description:
  40. // The class CEnumClusCfgManagedResources is the enumeration of
  41. // cluster managed resource enumerations.
  42. //
  43. // Interfaces:
  44. // IEnumClusCfgManagedResources
  45. // IClusCfgWbemServices
  46. // IClusCfgInitialize
  47. //
  48. //--
  49. //////////////////////////////////////////////////////////////////////////////
  50. class CEnumClusCfgManagedResources
  51. : public IEnumClusCfgManagedResources
  52. , public IClusCfgWbemServices
  53. , public IClusCfgInitialize
  54. {
  55. private:
  56. //
  57. // Private member functions and data
  58. //
  59. struct SEnumInfo
  60. {
  61. IUnknown * punk;
  62. CLSID clsid;
  63. BSTR bstrComponentName;
  64. };
  65. LONG m_cRef;
  66. LCID m_lcid;
  67. IClusCfgCallback * m_picccCallback;
  68. IWbemServices * m_pIWbemServices;
  69. SEnumInfo * m_prgEnums;
  70. BOOL m_fLoadedDevices;
  71. ULONG m_idxNextEnum;
  72. ULONG m_idxCurrentEnum;
  73. DWORD m_cTotalResources;
  74. BSTR m_bstrNodeName;
  75. //
  76. // Private constructors and destructors
  77. //
  78. CEnumClusCfgManagedResources( void );
  79. ~CEnumClusCfgManagedResources( void );
  80. //
  81. // Private copy constructor to prevent copying.
  82. //
  83. CEnumClusCfgManagedResources( const CEnumClusCfgManagedResources & nodeSrc );
  84. //
  85. // Private assignment operator to prevent copying.
  86. //
  87. const CEnumClusCfgManagedResources & operator = ( const CEnumClusCfgManagedResources & nodeSrc );
  88. HRESULT HrInit( void );
  89. HRESULT HrLoadEnum( void );
  90. HRESULT HrDoNext( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut );
  91. HRESULT HrAddToEnumsArray( IUnknown * punkIn, CLSID * pclsidIn, BSTR bstrComponentNameIn );
  92. HRESULT HrDoSkip( ULONG cNumberToSkipIn );
  93. HRESULT HrDoReset( void );
  94. HRESULT HrDoClone( IEnumClusCfgManagedResources ** ppEnumClusCfgManagedResourcesOut );
  95. HRESULT HrLoadUnknownQuorumProvider( void );
  96. HRESULT HrIsClusterServiceRunning( void );
  97. HRESULT HrIsThereAQuorumDevice( void );
  98. HRESULT HrInitializeAndSaveEnum( IUnknown * punkIn, CLSID * pclsidIn, BSTR bstrComponentNameIn );
  99. HRESULT HrGetQuorumResourceName( BSTR * pbstrQuorumResourceNameOut , BOOL * pfQuormIsOwnedByThisNodeOut );
  100. public:
  101. //
  102. // Public, non interface methods.
  103. //
  104. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  105. //
  106. // IUnknown Interfaces
  107. //
  108. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  109. STDMETHOD_( ULONG, AddRef )( void );
  110. STDMETHOD_( ULONG, Release )( void );
  111. //
  112. // IClusCfgWbemServices Interfaces
  113. //
  114. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  115. //
  116. // IClusCfgInitialize Interfaces
  117. //
  118. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  119. //
  120. // IEnumClusCfgManagedResources Interfaces
  121. //
  122. STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut );
  123. STDMETHOD( Skip )( ULONG cNumberToSkipIn );
  124. STDMETHOD( Reset )( void );
  125. STDMETHOD( Clone )( IEnumClusCfgManagedResources ** ppEnumClusCfgManagedResourcesOut );
  126. STDMETHOD( Count )( DWORD * pnCountOut );
  127. }; //*** Class CEnumClusCfgManagedResources