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.

135 lines
3.6 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusCfgCredentials.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CClusCfgCredentials
  10. // class.
  11. //
  12. // The class CClusCfgCredentials is the representation of
  13. // account credentials. It implements the IClusCfgCredentials interface.
  14. //
  15. // Documentation:
  16. //
  17. // Implementation Files:
  18. // CClusCfgCredentials.cpp
  19. //
  20. // Maintained By:
  21. // Galen Barbee (GalenB) 17-May-2000
  22. //
  23. //////////////////////////////////////////////////////////////////////////////
  24. // Make sure that this file is included only once per compile path.
  25. #pragma once
  26. //////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. //////////////////////////////////////////////////////////////////////////////
  29. //////////////////////////////////////////////////////////////////////////////
  30. // Constant Declarations
  31. //////////////////////////////////////////////////////////////////////////////
  32. //////////////////////////////////////////////////////////////////////////////
  33. //++
  34. //
  35. // class CClusCfgCredentials
  36. //
  37. // Description:
  38. // The class CClusCfgCredentials is the representation of a
  39. // cluster.
  40. //
  41. // Interfaces:
  42. // IClusCfgCredentials
  43. // IClusCfgInitialize
  44. // IClusCfgSetCredentials
  45. //
  46. //--
  47. //////////////////////////////////////////////////////////////////////////////
  48. class CClusCfgCredentials
  49. : public IClusCfgCredentials
  50. , public IClusCfgInitialize
  51. , public IClusCfgSetCredentials
  52. {
  53. public:
  54. //
  55. // Public constructors and destructors
  56. //
  57. CClusCfgCredentials( void );
  58. virtual ~CClusCfgCredentials( void );
  59. //
  60. // IUnknown Interfaces
  61. //
  62. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  63. STDMETHOD_( ULONG, AddRef )( void );
  64. STDMETHOD_( ULONG, Release )( void );
  65. //
  66. // IClusCfgInitialize Interfaces.
  67. //
  68. // Register callbacks, locale id, etc.
  69. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  70. //
  71. // IClusCfgCredentials Interfaces.
  72. //
  73. STDMETHOD( SetCredentials )( LPCWSTR pcszUserIn, LPCWSTR pcszDomainIn, LPCWSTR pcszPasswordIn );
  74. STDMETHOD( GetCredentials )( BSTR * pbstrUserOut, BSTR * pbstrDomainOut, BSTR * pbstrPasswordOut );
  75. STDMETHOD( GetIdentity )( BSTR * pbstrUserOut, BSTR * pbstrDomainOut );
  76. STDMETHOD( GetPassword )( BSTR * pbstrPasswordOut );
  77. STDMETHOD( AssignTo )( IClusCfgCredentials * picccDestIn );
  78. STDMETHOD( AssignFrom )( IClusCfgCredentials * picccSourceIn );
  79. //
  80. // IClusCfgSetCredentials Interfaces.
  81. //
  82. STDMETHOD( SetDomainCredentials )( LPCWSTR pcszCredentials );
  83. //
  84. // Public, non interface methods.
  85. //
  86. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  87. private:
  88. //
  89. // Private member functions and data
  90. //
  91. LONG m_cRef;
  92. LCID m_lcid;
  93. IClusCfgCallback * m_picccCallback;
  94. BSTR m_bstrAccountName;
  95. BSTR m_bstrAccountDomain;
  96. CEncryptedBSTR m_encbstrPassword;
  97. // Private copy constructor to prevent copying.
  98. CClusCfgCredentials( const CClusCfgCredentials & );
  99. // Private assignment operator to prevent copying.
  100. CClusCfgCredentials & operator = ( const CClusCfgCredentials & );
  101. HRESULT HrInit( void );
  102. }; //*** Class CClusCfgCredentials