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.

167 lines
4.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusCfgNodeInfo.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the
  10. // CClusCfgNodeInfo class.
  11. //
  12. // The class CClusCfgNodeInfo is the representation of a
  13. // computer that can be a cluster node. It implements the
  14. // IClusCfgNodeInfo interface.
  15. //
  16. // Documentation:
  17. //
  18. // Implementation Files:
  19. // CClusCfgNodeInfo.cpp
  20. //
  21. // Maintained By:
  22. // Galen Barbee (GalenB) 21-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 CClusCfgNodeInfo
  38. //
  39. // Description:
  40. // The class CClusCfgNodeInfo is the representation of a
  41. // computer that can be a cluster node.
  42. //
  43. // Interfaces:
  44. // IClusCfgNodeInfo
  45. // IClusCfgWbemServices
  46. // IClusCfgInitialize
  47. //
  48. //--
  49. //////////////////////////////////////////////////////////////////////////////
  50. class CClusCfgNodeInfo
  51. : public IClusCfgNodeInfo
  52. , public IClusCfgWbemServices
  53. , public IClusCfgInitialize
  54. {
  55. private:
  56. //
  57. // Private member functions, structs and data
  58. //
  59. struct SSCSIInfo
  60. {
  61. UINT uiSCSIBus;
  62. UINT uiSCSIPort;
  63. };
  64. struct SDriveLetterUsage
  65. {
  66. WCHAR szDrive[ 4 ];
  67. EDriveLetterUsage edluUsage;
  68. UINT cDisks;
  69. SSCSIInfo * psiInfo;
  70. };
  71. LONG m_cRef;
  72. BSTR m_bstrFullDnsName;
  73. LCID m_lcid;
  74. IClusCfgCallback * m_picccCallback;
  75. IWbemServices * m_pIWbemServices;
  76. DWORD m_fIsClusterNode;
  77. IUnknown * m_punkClusterInfo;
  78. SYSTEM_INFO m_si;
  79. DWORD m_cMaxNodes;
  80. SDriveLetterUsage m_rgdluDrives[ 26 ];
  81. // Private constructors and destructors
  82. CClusCfgNodeInfo( void );
  83. ~CClusCfgNodeInfo( void );
  84. // Private copy constructor to prevent copying.
  85. CClusCfgNodeInfo( const CClusCfgNodeInfo & nodeSrc );
  86. // Private assignment operator to prevent copying.
  87. const CClusCfgNodeInfo & operator = ( const CClusCfgNodeInfo & nodeSrc );
  88. HRESULT HrInit( void );
  89. HRESULT HrComputeDriveLetterUsage( WCHAR * pszDrivesIn );
  90. HRESULT HrComputeSystemDriveLetterUsage( void );
  91. HRESULT HrSetPageFileEnumIndex( void );
  92. HRESULT HrSetCrashDumpEnumIndex( void );
  93. HRESULT HrGetVolumeInfo( void );
  94. DWORD ScGetDiskExtents( HANDLE hVolumeIn, VOLUME_DISK_EXTENTS ** ppvdeInout, DWORD * pcbvdeInout );
  95. DWORD ScGetSCSIAddressInfo( HANDLE hDiskIn, SCSI_ADDRESS * psaAddressOut );
  96. DWORD ScGetStorageDeviceNumber( HANDLE hDiskIn, STORAGE_DEVICE_NUMBER * psdnOut );
  97. HRESULT HrUpdateSystemBusDrives( void );
  98. public:
  99. //
  100. // Public, non interface methods.
  101. //
  102. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  103. //
  104. // IUnknown Interfaces
  105. //
  106. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  107. STDMETHOD_( ULONG, AddRef )( void );
  108. STDMETHOD_( ULONG, Release )( void );
  109. //
  110. // IClusCfgWbemServices Interfaces
  111. //
  112. STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
  113. //
  114. // IClusCfgInitialize Interfaces
  115. //
  116. // Register callbacks, locale id, etc.
  117. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  118. //
  119. // IClusCfgNodeInfo Interfaces
  120. //
  121. STDMETHOD( GetName )( BSTR * pbstrNameOut );
  122. STDMETHOD( SetName )( LPCWSTR pcszNameIn );
  123. STDMETHOD( IsMemberOfCluster )( void );
  124. STDMETHOD( GetClusterConfigInfo )( IClusCfgClusterInfo ** ppClusCfgClusterInfoOut );
  125. STDMETHOD( GetOSVersion )( DWORD * pdwMajorVersionOut, DWORD * pdwMinorVersionOut, WORD * pwSuiteMaskOut, BYTE * pbProductTypeOut, BSTR * pbstrCSDVersionOut );
  126. STDMETHOD( GetClusterVersion )( DWORD * pdwNodeHighestVersion, DWORD * pdwNodeLowestVersion );
  127. STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterUsageOut );
  128. STDMETHOD( GetMaxNodeCount )( DWORD * pcMaxNodesOut );
  129. STDMETHOD( GetProcessorInfo )( WORD * pwProcessorArchitectureOut, WORD * pwProcessorLevelOut );
  130. }; //*** Class CClusCfgNodeInfo