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.

236 lines
16 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // Dll.cpp
  7. //
  8. // Description:
  9. // DLL services/entry points.
  10. //
  11. // Maintained By:
  12. // David Potter (DavidP) 19-MAR-2001
  13. // Geoffrey Pease (GPease) 09-FEB-2000
  14. //
  15. //////////////////////////////////////////////////////////////////////////////
  16. #include "Pch.h"
  17. #include "Register.h"
  18. #include "DllResources.h"
  19. #include <InitGuid.h>
  20. #include <Guids.h>
  21. //
  22. // Add object headers here
  23. //
  24. // Common
  25. #include "..\Common\CClusCfgCredentials.h"
  26. // Server
  27. #include "..\Server\CClusCfgServer.h"
  28. #include "..\Server\CClusCfgNodeInfo.h"
  29. #include "..\Server\CClusCfgClusterInfo.h"
  30. #include "..\Server\CClusCfgCallback.h"
  31. #include "..\Server\CEnumClusCfgManagedResources.h"
  32. #include "..\Server\CPhysicalDisk.h"
  33. #include "..\Server\CEnumPhysicalDisks.h"
  34. #include "..\Server\CEnumClusterResources.h"
  35. #include "..\Server\CClusterResource.h"
  36. #include "..\Server\CEnumClusCfgNetworks.h"
  37. #include "..\Server\CEnumClusCfgIPAddresses.h"
  38. #include "..\Server\CClusCfgNetworkInfo.h"
  39. #include "..\Server\CClusCfgIPAddressInfo.h"
  40. #include "..\Server\CClusCfgCapabilities.h"
  41. #include "..\Server\CLocalQuorum.h"
  42. #include "..\Server\CEnumLocalQuorum.h"
  43. #include "..\Server\CMajorityNodeSet.h"
  44. #include "..\Server\CEnumMajorityNodeSet.h"
  45. #include "..\Server\CUnknownQuorum.h"
  46. // Middle Tier
  47. #include "..\MiddleTier\TaskManager.h"
  48. #include "..\MiddleTier\ConnectionManager.h"
  49. #include "..\MiddleTier\ObjectManager.h"
  50. #include "..\MiddleTier\NotificationManager.h"
  51. #include "..\MiddleTier\ServiceManager.h"
  52. #include "..\MiddleTier\LogManager.h"
  53. #include "..\MiddleTier\ClusterConfiguration.h"
  54. #include "..\MiddleTier\ManagedDevice.h"
  55. #include "..\MiddleTier\ManagedNetwork.h"
  56. #include "..\MiddleTier\NodeInformation.h"
  57. #include "..\MiddleTier\TaskGatherNodeInfo.h"
  58. #include "..\MiddleTier\ConfigConnection.h"
  59. #include "..\MiddleTier\TaskAnalyzeCluster.h"
  60. #include "..\MiddleTier\TaskCommitClusterChanges.h"
  61. #include "..\MiddleTier\EnumNodeInformation.h"
  62. #include "..\MiddleTier\TaskGatherInformation.h"
  63. #include "..\MiddleTier\ManagedDevice.h"
  64. #include "..\MiddleTier\TaskCompareAndPushInformation.h"
  65. #include "..\MiddleTier\EnumManageableResources.h"
  66. #include "..\MiddleTier\EnumManageableNetworks.h"
  67. #include "..\MiddleTier\TaskGatherClusterInfo.h"
  68. #include "..\MiddleTier\TaskKeepMTAAlive.h"
  69. #include "..\MiddleTier\EnumCookies.h"
  70. #include "..\MiddleTier\TaskLoginDomain.h"
  71. #include "..\MiddleTier\TaskPollingCallback.h"
  72. #include "..\MiddleTier\TaskVerifyIPAddress.h"
  73. #include "..\MiddleTier\IPAddressInfo.h"
  74. #include "..\MiddleTier\EnumIPAddresses.h"
  75. #include "..\Inc\Logger.h"
  76. // W2kProxy
  77. #include "..\Common\IHandleProvider.h"
  78. #include "..\W2kProxy\ConfigClusApi.h"
  79. // Wizard
  80. #include "..\Wizard\ClusCfg.h"
  81. #include "..\MiddleTier\TaskGetDomains.h"
  82. // BaseCluster
  83. #include "..\BaseCluster\CBCAInterface.h"
  84. // Post Config
  85. #include "..\PostCfg\GroupHandle.h"
  86. #include "..\PostCfg\ResourceEntry.h"
  87. #include "..\PostCfg\IPostCfgManager.h"
  88. #include "..\PostCfg\IPrivatePostCfgResource.h"
  89. #include "..\PostCfg\PostCfgMgr.h"
  90. #include "..\PostCfg\ResTypeGenScript.h"
  91. #include "..\PostCfg\ResTypeMajorityNodeSet.h"
  92. #include "..\PostCfg\ResTypeServices.h"
  93. // EvictCleanup
  94. #include "..\EvictCleanup\EvictCleanup.h"
  95. #include "..\EvictCleanup\AsyncEvictCleanup.h"
  96. // Startup
  97. #include "..\Startup\StartupNotify.h"
  98. //
  99. // Define the debugging module name for this DLL.
  100. //
  101. DEFINE_MODULE( "ClusConfig" )
  102. //
  103. // Category IDs in this Component
  104. //
  105. // This table is used to register the Category IDs (CATIDs) used by this DLL.
  106. //
  107. BEGIN_CATIDTABLE
  108. DEFINE_CATID( CATID_ClusCfgCapabilities, "Cluster Configuration Cluster Capabilities" )
  109. DEFINE_CATID( CATID_EnumClusCfgManagedResources, "Cluster Configuration Managed Resource Enumerators" )
  110. DEFINE_CATID( CATID_ClusCfgResourceTypes, "Cluster Configuration Resource Types" )
  111. DEFINE_CATID( CATID_ClusCfgMemberSetChangeListeners, "Cluster Configuration Member Set Change Listeners" )
  112. DEFINE_CATID( CATID_ClusCfgStartupListeners, "Cluster Configuration Service Startup Listeners" )
  113. END_CATIDTABLE
  114. //
  115. // Classes in this Component
  116. //
  117. // This table is used to create the objects supported in this DLL. It also is
  118. // used to map a name with a particular CLSID. HrCoCreateInternalInstance() uses
  119. // this table to shortcut COM.
  120. //
  121. BEGIN_CLASSTABLE // S_HrCreateInstance CLSID User Friendly Name Apartment Model Extra registration goo....
  122. DEFINE_CLASS_WITH_APPID( CClusCfgServer::S_HrCreateInstance, CLSID_ClusCfgServer, "ClusCfg Server", "Apartment", APPID_ClusCfgServer, "" /*DllSurrogate*/ )
  123. DEFINE_CLASS( CClusCfgNodeInfo::S_HrCreateInstance, CLSID_ClusCfgNodeInfo, "ClusCfg Node Information", "Apartment" )
  124. DEFINE_CLASS( CClusCfgClusterInfo::S_HrCreateInstance, CLSID_ClusCfgClusterInfo, "ClusCfg Cluster Information", "Apartment" )
  125. DEFINE_CLASS( CEnumClusCfgManagedResources::S_HrCreateInstance, CLSID_EnumClusCfgManagedResources, "ClusCfg Manged Resources Enumeration", "Apartment" )
  126. DEFINE_CLASS( CPhysicalDisk::S_HrCreateInstance, CLSID_PhysicalDisk, "ClusCfg Physical Disk Information", "Apartment" )
  127. DEFINE_CLASS( CEnumClusCfgNetworks::S_HrCreateInstance, CLSID_EnumClusCfgNetworks, "ClusCfg Networks Enumeration", "Apartment" )
  128. DEFINE_CLASS( CClusCfgNetworkInfo::S_HrCreateInstance, CLSID_ClusCfgNetworkInfo, "ClusCfg Network Information", "Apartment" )
  129. DEFINE_CLASS( CEnumClusCfgIPAddresses::S_HrCreateInstance, CLSID_EnumClusCfgIPAddresses, "ClusCfg IP Address Enumeration", "Apartment" )
  130. DEFINE_CLASS( CClusCfgIPAddressInfo::S_HrCreateInstance, CLSID_ClusCfgIPAddressInfo, "ClusCfg IP Address Information", "Apartment" )
  131. DEFINE_CLASS( CTaskManager::S_HrCreateInstance, CLSID_TaskManager, "ClusCfg Task Manager", "Free" )
  132. DEFINE_CLASS( CConnectionManager::S_HrCreateInstance, CLSID_ClusterConnectionManager, "ClusCfg Connection Manager", "Apartment" )
  133. DEFINE_CLASS( CObjectManager::S_HrCreateInstance, CLSID_ObjectManager, "ClusCfg ObjectManager", "Apartment" )
  134. DEFINE_CLASS( CLogManager::S_HrCreateInstance, CLSID_LogManager, "ClusCfg LogManager", "Apartment" )
  135. DEFINE_CLASS( CNotificationManager::S_HrCreateInstance, CLSID_NotificationManager, "ClusCfg Notification Manager", "Apartment" )
  136. DEFINE_CLASS( CServiceManager::S_HrCreateInstance, CLSID_ServiceManager, "ClusCfg Service Manager", "Free" )
  137. DEFINE_CLASS( CNodeInformation::S_HrCreateInstance, DFGUID_NodeInformation, "ClusCfg Node Information Data Format", "Apartment" )
  138. DEFINE_CLASS( CTaskGatherNodeInfo::S_HrCreateInstance, TASK_GatherNodeInfo, "ClusCfg Task Gather Node Information", "Both" )
  139. DEFINE_CLASS( CConfigurationConnection::S_HrCreateInstance, CLSID_ConfigurationConnection, "ClusCfg Configuration Connection", "Apartment" )
  140. DEFINE_CLASS( CTaskAnalyzeCluster::S_HrCreateInstance, TASK_AnalyzeCluster, "ClusCfg Task Analyze Cluster", "Both" )
  141. DEFINE_CLASS( CTaskCommitClusterChanges::S_HrCreateInstance, TASK_CommitClusterChanges, "ClusCfg Task Commit Cluster Changes", "Both" )
  142. DEFINE_CLASS( CEnumNodeInformation::S_HrCreateInstance, DFGUID_EnumNodes, "ClusCfg Enum Node Information Format", "Apartment" )
  143. DEFINE_CLASS( CTaskGatherInformation::S_HrCreateInstance, TASK_GatherInformation, "ClusCfg Task Gather Information", "Both" )
  144. DEFINE_CLASS( CManagedDevice::S_HrCreateInstance, DFGUID_ManagedResource, "ClusCfg Managed Resource Data Format", "Apartment" )
  145. DEFINE_CLASS( CManagedNetwork::S_HrCreateInstance, DFGUID_NetworkResource, "ClusCfg Managed Network Data Format", "Apartment" )
  146. DEFINE_CLASS( CTaskCompareAndPushInformation::S_HrCreateInstance, TASK_CompareAndPushInformation, "ClusCfg Task Compare and Push Information", "Both" )
  147. DEFINE_CLASS( CEnumManageableResources::S_HrCreateInstance, DFGUID_EnumManageableResources, "ClusCfg Enum Manageable Resources Data Format", "Apartment" )
  148. DEFINE_CLASS( CEnumManageableNetworks::S_HrCreateInstance, DFGUID_EnumManageableNetworks, "ClusCfg Enum Manageable Networks Data Format", "Apartment" )
  149. DEFINE_CLASS_WITH_APPID( CClusCfgWizard::S_HrCreateInstance, CLSID_ClusCfgWizard, "ClusCfg Cluster Configuration Wizard", "Apartment", APPID_ClusCfgWizard, "" /*DllSUrrogate*/ )
  150. DEFINE_CLASS( CTaskGetDomains::S_HrCreateInstance, TASK_GetDomains, "ClusCfg Task Get Domains", "Both" )
  151. DEFINE_CLASS( CTaskPollingCallback::S_HrCreateInstance, TASK_PollingCallback, "ClusCfg Task Polling Callback", "Both" )
  152. DEFINE_CLASS_WITH_APPID( CBCAInterface::S_HrCreateInstance, CLSID_ClusCfgBaseCluster, "ClusCfg Base Cluster", "Apartment", APPID_ClusCfgBaseCluster, "" /*DllSurrogate*/ )
  153. DEFINE_CLASS( CClusterConfiguration::S_HrCreateInstance, DFGUID_ClusterConfigurationInfo, "ClusCfg Cluster Configuration Data Format", "Apartment" )
  154. DEFINE_CLASS( CTaskGatherClusterInfo::S_HrCreateInstance, TASK_GatherClusterInfo, "ClusCfg Task Gather Cluster Info", "Both" )
  155. DEFINE_CLASS( CTaskKeepMTAAlive::S_HrCreateInstance, TASK_KeepMTAAlive, "ClusCfg Task Keep MTA Alive", "Both" )
  156. DEFINE_CLASS_CATIDREG( CEnumPhysicalDisks::S_HrCreateInstance, CLSID_EnumPhysicalDisks, "ClusCfg Physical Disk Enumeration", "Apartment", CEnumPhysicalDisks::S_RegisterCatIDSupport )
  157. //DEFINE_CLASS_CATIDREG( CEnumClusterResources::S_HrCreateInstance, CLSID_EnumClusterResources, "ClusCfg Cluster Resource Enumeration", "Apartment", CEnumClusterResources::S_RegisterCatIDSupport )
  158. //DEFINE_CLASS( CClusterResource::S_HrCreateInstance, CLSID_ClusterResource, "ClusCfg Cluster Resource Information", "Apartment" )
  159. DEFINE_CLASS( CEnumCookies::S_HrCreateInstance, DFGUID_EnumCookies, "ClusCfg Enum Cookies", "Apartment" )
  160. DEFINE_CLASS( CTaskLoginDomain::S_HrCreateInstance, TASK_LoginDomain, "ClusCfg Task Login Domain", "Both" )
  161. DEFINE_CLASS( CClusCfgCredentials::S_HrCreateInstance, CLSID_ClusCfgCredentials, "ClusCfg Credentials", "Apartment" )
  162. DEFINE_CLASS( CPostCfgManager::S_HrCreateInstance, CLSID_ClusCfgPostConfigManager, "ClusCfg Post Configuration Manager", "Apartment" )
  163. DEFINE_CLASS_CATIDREG( CResTypeGenScript::S_HrCreateInstance, CLSID_ClusCfgResTypeGenScript, "ClusCfg Generic Script Resource Type Configuration","Apartment", CResTypeGenScript::S_RegisterCatIDSupport )
  164. DEFINE_CLASS_CATIDREG( CResTypeMajorityNodeSet::S_HrCreateInstance, CLSID_ClusCfgResTypeMajorityNodeSet,"ClusCfg Majority Node Set Resource Type Configuration", "Apartment", CResTypeMajorityNodeSet::S_RegisterCatIDSupport )
  165. DEFINE_CLASS( CTaskVerifyIPAddress::S_HrCreateInstance, TASK_VerifyIPAddress, "ClusCfg Task Verify IP Address", "Both" )
  166. DEFINE_CLASS( CConfigClusApi::S_HrCreateInstance, CLSID_ConfigClusApi, "ClusCfg Configure Cluster API Proxy Server", "Both" )
  167. DEFINE_CLASS( CIPAddressInfo::S_HrCreateInstance, DFGUID_IPAddressInfo, "ClusCfg IP Address Info Data Format", "Apartment" )
  168. DEFINE_CLASS( CEnumIPAddresses::S_HrCreateInstance, DFGUID_EnumIPAddressInfo, "ClusCfg Enum IP Address Info Data Format", "Apartment" )
  169. DEFINE_CLASS( CResTypeServices::S_HrCreateInstance, CLSID_ClusCfgResTypeServices, "ClusCfg Resource Type Services", "Apartment" )
  170. DEFINE_CLASS_WITH_APPID( CEvictCleanup::S_HrCreateInstance, CLSID_ClusCfgEvictCleanup, "ClusCfg Eviction Processing", "Free", APPID_ClusCfgEvictCleanup, "" /*DllSUrrogate*/ )
  171. DEFINE_CLASS_WITH_APPID( CAsyncEvictCleanup::S_HrCreateInstance, CLSID_ClusCfgAsyncEvictCleanup, "ClusCfg Asynchronous Eviction Processing", "Apartment", APPID_ClusCfgAsyncEvictCleanup, "" /*DllSUrrogate*/ )
  172. DEFINE_CLASS_WITH_APPID( CStartupNotify::S_HrCreateInstance, CLSID_ClusCfgStartupNotify, "ClusCfg Cluster Startup Notification", "Free", APPID_ClusCfgStartupNotify, "" /*DllSUrrogate*/ )
  173. DEFINE_CLASS_CATIDREG( CClusCfgCapabilities::S_HrCreateInstance, CLSID_ClusCfgCapabilities, "ClusCfg Cluster Capabilities", "Apartment", CClusCfgCapabilities::S_RegisterCatIDSupport )
  174. DEFINE_CLASS_WITH_APPID( CClCfgSrvLogger::S_HrCreateInstance, CLSID_ClCfgSrvLogger, "ClusCfg Logger", "Apartment", APPID_ClCfgSrvLogger, "" /*DllSUrrogate*/ )
  175. DEFINE_CLASS( CLocalQuorum::S_HrCreateInstance, CLSID_LocalQuorum, "ClusCfg Local Quorum Information", "Apartment" )
  176. DEFINE_CLASS_CATIDREG( CEnumLocalQuorum::S_HrCreateInstance, CLSID_EnumLocalQuorum, "ClusCfg Local Quorum Enumeration", "Apartment", CEnumLocalQuorum::S_RegisterCatIDSupport )
  177. DEFINE_CLASS( CMajorityNodeSet::S_HrCreateInstance, CLSID_MajorityNodeSet, "ClusCfg Majority Node Set Information", "Apartment" )
  178. DEFINE_CLASS_CATIDREG( CEnumMajorityNodeSet::S_HrCreateInstance, CLSID_EnumMajorityNodeSet, "ClusCfg Majority Node Set Enumeration", "Apartment", CEnumMajorityNodeSet::S_RegisterCatIDSupport )
  179. DEFINE_CLASS( CUnknownQuorum::S_HrCreateInstance, CLSID_UnknownQuorum, "ClusCfg Unknown Quorum", "Apartment" )
  180. //DEFINE_CLASS_CATIDREG( CEnumUnknownQuorum::S_HrCreateInstance, CLSID_EnumUnknownQuorum, "ClusCfg Unknown Quorum Enumeration", "Apartment", CEnumUnknownQuorum::S_RegisterCatIDSupport )
  181. END_CLASSTABLE
  182. //
  183. // RPC Proxy/Stub entry points
  184. //
  185. extern "C" {
  186. HRESULT
  187. STDAPICALLTYPE
  188. ProxyStubDllGetClassObject(
  189. REFCLSID rclsid,
  190. REFIID riid,
  191. void ** ppv
  192. );
  193. HRESULT
  194. STDAPICALLTYPE
  195. ProxyStubDllCanUnloadNow( );
  196. HRESULT
  197. STDAPICALLTYPE
  198. ProxyStubDllRegisterServer( );
  199. HRESULT
  200. STDAPICALLTYPE
  201. ProxyStubDllUnregisterServer( );
  202. } // extern "C"
  203. //
  204. // Indicate that we need to have Fusion initialized and uninitialized properly
  205. // on process attach and detach.
  206. //
  207. #define USE_FUSION
  208. #include "DllSrc.cpp"