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.

153 lines
5.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // EvictCleanup.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEvictCleanup
  10. // class. This class handles is used to clean up a node after it has been
  11. // evicted from a cluster.
  12. //
  13. // Documentation:
  14. // TODO: fill in pointer to external documentation
  15. //
  16. // Implementation Files:
  17. // EvictCleanup.cpp
  18. //
  19. // Maintained By:
  20. // Galen Barbee (GalenB) 04-AUG-2000
  21. //
  22. //////////////////////////////////////////////////////////////////////////////
  23. // Make sure that this file is included only once per compile path.
  24. #pragma once
  25. //////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. //////////////////////////////////////////////////////////////////////////////
  28. // For IUnknown
  29. #include <unknwn.h>
  30. // For IClusCfgEvictCleanup
  31. #include <ClusCfgServer.h>
  32. // For ILogger
  33. #include <ClusCfgClient.h>
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEvictCleanup
  38. //
  39. // Description:
  40. // This class handles is used to clean up a node after it has been
  41. // evicted from a cluster.
  42. //
  43. //--
  44. //////////////////////////////////////////////////////////////////////////////
  45. class CEvictCleanup
  46. : public IClusCfgEvictCleanup
  47. , public IClusCfgCallback
  48. {
  49. private:
  50. //////////////////////////////////////////////////////////////////////////
  51. // Private data
  52. //////////////////////////////////////////////////////////////////////////
  53. // IUnknown
  54. LONG m_cRef; // Reference counter.
  55. // IClusCfgCallback
  56. BSTR m_bstrNodeName; // Name of the local node.
  57. ILogger * m_plLogger; // ILogger for doing logging.
  58. //////////////////////////////////////////////////////////////////////////
  59. // Private member functions
  60. //////////////////////////////////////////////////////////////////////////
  61. // Second phase of a two phase constructor.
  62. HRESULT HrInit( void );
  63. // Instruct the SCM to stop a service
  64. DWORD
  65. ScStopService(
  66. const WCHAR * pcszServiceNameIn
  67. , ULONG ulQueryIntervalMilliSecIn = 500
  68. , ULONG cQueryCountIn = 10
  69. );
  70. // Wrap logging to the logger object.
  71. void
  72. LogMsg( DWORD nLogEntryTypeIn, LPCWSTR pszLogMsgIn, ... );
  73. //
  74. // Private constructors, destructor and assignment operator.
  75. // All of these methods are private for two reasons:
  76. // 1. Lifetimes of objects of this class are controlled by S_HrCreateInstance and Release.
  77. // 2. Copying of an object of this class is prohibited.
  78. //
  79. // Default constructor.
  80. CEvictCleanup( void );
  81. // Destructor.
  82. ~CEvictCleanup( void );
  83. // Copy constructor.
  84. CEvictCleanup( const CEvictCleanup & );
  85. // Assignment operator.
  86. CEvictCleanup & operator =( const CEvictCleanup & );
  87. public:
  88. //////////////////////////////////////////////////////////////////////////
  89. // IUnknown methods
  90. //////////////////////////////////////////////////////////////////////////
  91. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  92. STDMETHOD_( ULONG, AddRef )( void );
  93. STDMETHOD_( ULONG, Release )( void );
  94. //////////////////////////////////////////////////////////////////////////
  95. // IClusCfgEvictCleanup methods
  96. //////////////////////////////////////////////////////////////////////////
  97. // Performs the clean up actions on the local node after it has been
  98. // evicted from a cluster
  99. STDMETHOD( CleanupLocalNode )( DWORD dwDelayIn );
  100. // Performs the clean up actions on a remote node after it has been
  101. // evicted from a cluster
  102. STDMETHOD( CleanupRemoteNode )( const WCHAR * pcszEvictedNodeNameIn, DWORD dwDelayIn );
  103. //////////////////////////////////////////////////////////////////////////
  104. // IClusCfgCallback methods
  105. //////////////////////////////////////////////////////////////////////////
  106. STDMETHOD( SendStatusReport )(
  107. LPCWSTR pcszNodeNameIn
  108. , CLSID clsidTaskMajorIn
  109. , CLSID clsidTaskMinorIn
  110. , ULONG ulMinIn
  111. , ULONG ulMaxIn
  112. , ULONG ulCurrentIn
  113. , HRESULT hrStatusIn
  114. , LPCWSTR pcszDescriptionIn
  115. , FILETIME * pftTimeIn
  116. , LPCWSTR pcszReference
  117. );
  118. //////////////////////////////////////////////////////////////////////////
  119. // Other public methods
  120. //////////////////////////////////////////////////////////////////////////
  121. // Create an instance of this class.
  122. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  123. }; //*** class CEvictCleanup