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.

158 lines
5.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CClusOCMTask.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the class CClusOCMTask.
  10. // This class represents a task performed by ClusOCM. For example, an
  11. // upgrade of the cluster binaries is a task performed by ClusOCM. It is
  12. // intended to be used as a base class for other task related classes.
  13. //
  14. // Implementation Files:
  15. // CClusOCMTask.cpp
  16. //
  17. // Maintained By:
  18. // Vij Vasu (Vvasu) 03-MAR-2000
  19. //
  20. //////////////////////////////////////////////////////////////////////////////
  21. #pragma once
  22. //////////////////////////////////////////////////////////////////////////////
  23. // Include Files
  24. //////////////////////////////////////////////////////////////////////////////
  25. // For the definition of a few basic types
  26. #include <windows.h>
  27. // Contains setup API function and type declarations
  28. #include <setupapi.h>
  29. //////////////////////////////////////////////////////////////////////////////
  30. // Forward Declarations
  31. //////////////////////////////////////////////////////////////////////////////
  32. class CClusOCMApp;
  33. //////////////////////////////////////////////////////////////////////////////
  34. //++
  35. //
  36. // class CClusOCMTask
  37. //
  38. // Description:
  39. // This class represents a task performed by ClusOCM. For example, an
  40. // upgrade of the cluster binaries is a task performed by ClusOCM. It is
  41. // intended to be used as a base class for other task related classes.
  42. //
  43. //--
  44. //////////////////////////////////////////////////////////////////////////////
  45. class CClusOCMTask
  46. {
  47. public:
  48. //////////////////////////////////////////////////////////////////////////
  49. // Constructors and destructors
  50. //////////////////////////////////////////////////////////////////////////
  51. // Constructor.
  52. CClusOCMTask( const CClusOCMApp & rAppIn );
  53. // Destructor.
  54. virtual ~CClusOCMTask( void );
  55. //////////////////////////////////////////////////////////////////////////
  56. // Virtual message handlers
  57. //////////////////////////////////////////////////////////////////////////
  58. // Handler for the OC_CALC_DISK_SPACE message.
  59. // Note: this handler is not a pure virutal function since its functionality
  60. // has to remain the same regardless of whether an upgrade or a clean install
  61. // is in progress. As a result an implementation is provided in this class.
  62. DWORD
  63. DwOcCalcDiskSpace(
  64. bool fAddFilesIn
  65. , HDSKSPC hDiskSpaceListIn
  66. );
  67. // Handler for the OC_QUEUE_FILE_OPS message.
  68. virtual DWORD
  69. DwOcQueueFileOps( HSPFILEQ hSetupFileQueueIn ) = 0;
  70. // Handler for the OC_COMPLETE_INSTALLATION message.
  71. virtual DWORD
  72. DwOcCompleteInstallation( void ) = 0;
  73. // Handler for the OC_CLEANUP message.
  74. virtual DWORD
  75. DwOcCleanup( void ) = 0;
  76. protected:
  77. //////////////////////////////////////////////////////////////////////////
  78. // Protected accessor functions
  79. //////////////////////////////////////////////////////////////////////////
  80. // Get a pointer to the main application object.
  81. const CClusOCMApp &
  82. RGetApp( void ) const
  83. {
  84. return m_rApp;
  85. }
  86. //////////////////////////////////////////////////////////////////////////
  87. // Other protected virtual methods
  88. //////////////////////////////////////////////////////////////////////////
  89. // A helper function that calls the DwSetDirectoryIds() function to set the
  90. // directory ids and processes the files listed in the input section.
  91. virtual DWORD
  92. DwOcQueueFileOps(
  93. HSPFILEQ hSetupFileQueueIn
  94. , const WCHAR * pcszInstallSectionNameIn
  95. );
  96. // A helper function that performs some of the more common operations
  97. // done by handlers of the OC_CLEANUP message.
  98. virtual DWORD
  99. DwOcCleanup( const WCHAR * pcszInstallSectionNameIn );
  100. // A helper function that processes registry operations, COM component
  101. // registrations, creation of servies, etc., listed in the input section.
  102. DWORD
  103. DwOcCompleteInstallation( const WCHAR * pcszInstallSectionNameIn );
  104. // A helper function that maps the directory id CLUSTER_DEFAULT_INSTALL_DIRID
  105. // to the default cluster installation directory CLUSTER_DEFAULT_INSTALL_DIR.
  106. virtual DWORD
  107. DwSetDirectoryIds( void );
  108. private:
  109. //////////////////////////////////////////////////////////////////////////
  110. // Forbidden methods
  111. //////////////////////////////////////////////////////////////////////////
  112. //
  113. // Copying an object of this class is not allowed.
  114. //
  115. // Private copy constructor.
  116. CClusOCMTask( const CClusOCMTask & );
  117. // Private assignment operator.
  118. const CClusOCMTask & operator =( const CClusOCMTask & );
  119. //////////////////////////////////////////////////////////////////////////
  120. // Private data
  121. //////////////////////////////////////////////////////////////////////////
  122. // The app object
  123. const CClusOCMApp & m_rApp;
  124. }; //*** class CClusOCMTask