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.

175 lines
4.8 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusDisk.h
  7. //
  8. // Description:
  9. // Header file for CClusDisk class.
  10. // The CClusDisk class performs operations that are common to the
  11. // configuration of the ClusDisk service.
  12. //
  13. // Implementation Files:
  14. // CClusDisk.cpp
  15. //
  16. // Maintained By:
  17. // Vij Vasu (Vvasu) 03-MAR-2000
  18. //
  19. //////////////////////////////////////////////////////////////////////////////
  20. // Make sure that this file is included only once per compile path.
  21. #pragma once
  22. //////////////////////////////////////////////////////////////////////////
  23. // Include Files
  24. //////////////////////////////////////////////////////////////////////////
  25. // For the CAction base class
  26. #include "CAction.h"
  27. // For the CService class
  28. #include "CService.h"
  29. //////////////////////////////////////////////////////////////////////////
  30. // Forward declaration
  31. //////////////////////////////////////////////////////////////////////////
  32. class CBaseClusterAction;
  33. //////////////////////////////////////////////////////////////////////////////
  34. //++
  35. //
  36. // class CClusDisk
  37. //
  38. // Description:
  39. // The CClusDisk class performs operations that are common to many
  40. // configuration tasks of the ClusDisk service.
  41. //
  42. // This class is intended to be used as the base class for other ClusDisk
  43. // related action classes.
  44. //
  45. // NOTE: Currently, once started, the ClusDisk service cannot be stopped.
  46. // As a result, when a computer is evicted from a cluster, the ClusDisk
  47. // service is disabled and detached from all disks, but not stopped.
  48. //
  49. //--
  50. //////////////////////////////////////////////////////////////////////////////
  51. class CClusDisk : public CAction
  52. {
  53. protected:
  54. //////////////////////////////////////////////////////////////////////////
  55. // Protected constructors and destructors
  56. //////////////////////////////////////////////////////////////////////////
  57. // Constructor.
  58. CClusDisk(
  59. CBaseClusterAction * pbcaParentActionIn
  60. );
  61. // Default destructor.
  62. ~CClusDisk();
  63. //////////////////////////////////////////////////////////////////////////
  64. // Protected methods
  65. //////////////////////////////////////////////////////////////////////////
  66. // Enable and start service.
  67. void
  68. ConfigureService();
  69. // Disable and cleanup the service.
  70. void
  71. CleanupService();
  72. // Initialize the state of the service.
  73. bool
  74. FInitializeState();
  75. // Detach ClusDisk from all disks it is attached to.
  76. void
  77. DetachFromAllDisks();
  78. // Attach to specified disks.
  79. void
  80. AttachToDisks(
  81. DWORD rgdwSignatureArrayIn[]
  82. , UINT uiArraySizeIn
  83. );
  84. // Detach from specified disks.
  85. void
  86. DetachFromDisks(
  87. DWORD rgdwSignatureArrayIn[]
  88. , UINT uiArraySizeIn
  89. );
  90. // Returns the number of progress messages that this action will send.
  91. UINT
  92. UiGetMaxProgressTicks() const throw()
  93. {
  94. // Two notifications are sent:
  95. // 1. When the service is created.
  96. // 2. When the service starts.
  97. return 2;
  98. }
  99. //////////////////////////////////////////////////////////////////////////
  100. // Protected accessors
  101. //////////////////////////////////////////////////////////////////////////
  102. // Get the ClusDisk service object.
  103. CService &
  104. RcsGetService() throw()
  105. {
  106. return m_cservClusDisk;
  107. }
  108. // Get the parent action
  109. CBaseClusterAction *
  110. PbcaGetParent() throw()
  111. {
  112. return m_pbcaParentAction;
  113. }
  114. // Get the handle to the ClusDisk service.
  115. SC_HANDLE
  116. SchGetServiceHandle() const throw()
  117. {
  118. return m_sscmhServiceHandle.HHandle();
  119. }
  120. private:
  121. //////////////////////////////////////////////////////////////////////////
  122. // Private member functions
  123. //////////////////////////////////////////////////////////////////////////
  124. // Copy constructor
  125. CClusDisk( const CClusDisk & );
  126. // Assignment operator
  127. const CClusDisk & operator =( const CClusDisk & );
  128. //////////////////////////////////////////////////////////////////////////
  129. // Private data
  130. //////////////////////////////////////////////////////////////////////////
  131. // The CService object representing the ClusDisk service.
  132. CService m_cservClusDisk;
  133. // A handle to this service.
  134. SmartSCMHandle m_sscmhServiceHandle;
  135. // Pointer to the base cluster action of which this action is a part.
  136. CBaseClusterAction * m_pbcaParentAction;
  137. }; //*** class CClusDisk