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.

203 lines
6.0 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusCfgCallback.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CClusCfgCallback
  10. // class.
  11. //
  12. // The class CClusCfgCallback inplements the callback
  13. // interface between this server and its clients. It implements the
  14. // IClusCfgCallback interface.
  15. //
  16. // Documentation:
  17. //
  18. // Implementation Files:
  19. // CClusCfgCallback.cpp
  20. //
  21. // Maintained By:
  22. // Galen Barbee (GalenB) 22-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 <ClusCfgPrivate.h>
  31. #include "PrivateInterfaces.h"
  32. #include <Logger.h>
  33. //////////////////////////////////////////////////////////////////////////////
  34. // Constant Declarations
  35. //////////////////////////////////////////////////////////////////////////////
  36. //////////////////////////////////////////////////////////////////////////////
  37. //++
  38. //
  39. // class CClusCfgCallback
  40. //
  41. // Description:
  42. // The class CClusCfgCallback inplements the callback
  43. // interface between this server and its clients.
  44. //
  45. // Interfaces:
  46. // IClusCfgCallback
  47. // IClusCfgInitialize
  48. // IClusCfgPollingCallback
  49. // IClusCfgSetPollingCallback
  50. //
  51. //--
  52. //////////////////////////////////////////////////////////////////////////////
  53. class CClusCfgCallback
  54. : public IClusCfgCallback
  55. , public IClusCfgInitialize
  56. , public IClusCfgPollingCallback
  57. , public IClusCfgSetPollingCallback
  58. {
  59. private:
  60. //
  61. // Private member functions and data
  62. //
  63. LONG m_cRef;
  64. IClusCfgCallback * m_pccc;
  65. LCID m_lcid;
  66. HANDLE m_hEvent;
  67. HRESULT m_hr;
  68. BOOL m_fPollingMode:1;
  69. BSTR m_bstrNodeName;
  70. LPCWSTR m_pcszNodeName;
  71. CLSID * m_pclsidTaskMajor;
  72. CLSID * m_pclsidTaskMinor;
  73. ULONG * m_pulMin;
  74. ULONG * m_pulMax;
  75. ULONG * m_pulCurrent;
  76. HRESULT * m_phrStatus;
  77. LPCWSTR m_pcszDescription;
  78. FILETIME * m_pftTime;
  79. LPCWSTR m_pcszReference;
  80. ILogger * m_plLogger; // ILogger for doing logging.
  81. // Private constructors and destructors
  82. CClusCfgCallback( void );
  83. ~CClusCfgCallback( void );
  84. // Private copy constructor to prevent copying.
  85. CClusCfgCallback( const CClusCfgCallback & nodeSrc );
  86. // Private assignment operator to prevent copying.
  87. const CClusCfgCallback & operator = ( const CClusCfgCallback & nodeSrc );
  88. HRESULT HrInit( void );
  89. HRESULT HrQueueStatusReport(
  90. LPCWSTR pcszNodeNameIn,
  91. CLSID clsidTaskMajorIn,
  92. CLSID clsidTaskMinorIn,
  93. ULONG ulMinIn,
  94. ULONG ulMaxIn,
  95. ULONG ulCurrentIn,
  96. HRESULT hrStatusIn,
  97. LPCWSTR pcszDescriptionIn,
  98. FILETIME * pftTimeIn,
  99. LPCWSTR pcszReferenceIn
  100. );
  101. public:
  102. //
  103. // Public, non interface methods.
  104. //
  105. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  106. STDMETHOD( SendStatusReport )(
  107. CLSID clsidTaskMajorIn,
  108. CLSID clsidTaskMinorIn,
  109. ULONG ulMinIn,
  110. ULONG ulMaxIn,
  111. ULONG ulCurrentIn,
  112. HRESULT hrStatusIn,
  113. const WCHAR * pcszDescriptionIn
  114. );
  115. STDMETHOD( SendStatusReport )(
  116. CLSID clsidTaskMajorIn,
  117. CLSID clsidTaskMinorIn,
  118. ULONG ulMinIn,
  119. ULONG ulMaxIn,
  120. ULONG ulCurrentIn,
  121. HRESULT hrStatusIn,
  122. DWORD dwDescriptionIn
  123. );
  124. //
  125. // IUnknown Interfaces
  126. //
  127. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  128. STDMETHOD_( ULONG, AddRef )( void );
  129. STDMETHOD_( ULONG, Release )( void );
  130. //
  131. // IClusCfgCallback Interfaces.
  132. //
  133. STDMETHOD( SendStatusReport )(
  134. LPCWSTR pcszNodeNameIn,
  135. CLSID clsidTaskMajorIn,
  136. CLSID clsidTaskMinorIn,
  137. ULONG ulMinIn,
  138. ULONG ulMaxIn,
  139. ULONG ulCurrentIn,
  140. HRESULT hrStatusIn,
  141. LPCWSTR pcszDescriptionIn,
  142. FILETIME * pftTimeIn,
  143. LPCWSTR pcszReference
  144. );
  145. //
  146. // IClusCfgPollingCallback Interfaces.
  147. //
  148. STDMETHOD( GetStatusReport )(
  149. BSTR * pbstrNodeNameOut,
  150. CLSID * pclsidTaskMajorOut,
  151. CLSID * pclsidTaskMinorOut,
  152. ULONG * pulMinOut,
  153. ULONG * pulMaxOut,
  154. ULONG * pulCurrentOut,
  155. HRESULT * phrStatusOut,
  156. BSTR * pbstrDescriptionOut,
  157. FILETIME * pftTimeOut,
  158. BSTR * pbstrReferenceOut
  159. );
  160. STDMETHOD( SetHResult )( HRESULT hrIn );
  161. //
  162. // IClusCfgInitialize Interfaces.
  163. //
  164. STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
  165. //
  166. // IClusCfgSetPollingCallback Interfaces.
  167. //
  168. STDMETHOD( SetPollingMode )( BOOL fUsePollingModeIn );
  169. }; //*** Class CClusCfgCallback