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.

221 lines
5.5 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. clusres.c
  5. Abstract:
  6. Common Resource DLL Startup
  7. Author:
  8. John Vert (jvert) 12/15/1996
  9. Revision History:
  10. Sivaprasad Padisetty (sivapad) 04/22/1996 Added the local quorum
  11. --*/
  12. #include "clusres.h"
  13. #include "clusrtl.h"
  14. #include "clusudef.h"
  15. PSET_RESOURCE_STATUS_ROUTINE ClusResSetResourceStatus = NULL;
  16. PLOG_EVENT_ROUTINE ClusResLogEvent = NULL;
  17. BOOLEAN
  18. WINAPI
  19. ClusResDllEntry(
  20. IN HINSTANCE DllHandle,
  21. IN DWORD Reason,
  22. IN LPVOID Reserved
  23. )
  24. /*++
  25. Routine Description:
  26. Main DLL entrypoint for combined resource DLL.
  27. Arguments:
  28. DllHandle - Supplies the DLL handle.
  29. Reason - Supplies the call reason
  30. Return Value:
  31. TRUE if successful
  32. FALSE if unsuccessful
  33. --*/
  34. {
  35. if (Reason == DLL_PROCESS_ATTACH) {
  36. DisableThreadLibraryCalls(DllHandle);
  37. ClRtlInitialize( TRUE, NULL );
  38. ClRtlInitWmi(NULL);
  39. }
  40. //
  41. // Let everybody else have their shot at it.
  42. //
  43. if (!GenAppDllEntryPoint(DllHandle, Reason, Reserved)) {
  44. return(FALSE);
  45. }
  46. if (!GenSvcDllEntryPoint(DllHandle, Reason, Reserved)) {
  47. return(FALSE);
  48. }
  49. #if 0
  50. if (!FtSetDllEntryPoint(DllHandle, Reason, Reserved)) {
  51. return(FALSE);
  52. }
  53. #endif
  54. if (!DisksDllEntryPoint(DllHandle, Reason, Reserved)) {
  55. return(FALSE);
  56. }
  57. if (!NetNameDllEntryPoint(DllHandle, Reason, Reserved)) {
  58. return(FALSE);
  59. }
  60. if (!IpAddrDllEntryPoint(DllHandle, Reason, Reserved)) {
  61. return(FALSE);
  62. }
  63. if (!SmbShareDllEntryPoint(DllHandle, Reason, Reserved)) {
  64. return(FALSE);
  65. }
  66. if (!SplSvcDllEntryPoint(DllHandle, Reason, Reserved)) {
  67. return(FALSE);
  68. }
  69. if (!LkQuorumDllEntryPoint(DllHandle, Reason, Reserved)) {
  70. return(FALSE);
  71. }
  72. if (!TimeSvcDllEntryPoint(DllHandle, Reason, Reserved)) {
  73. return(FALSE);
  74. }
  75. if (!GenScriptDllEntryPoint(DllHandle, Reason, Reserved)) {
  76. return(FALSE);
  77. }
  78. if (!MsMQDllEntryPoint(DllHandle, Reason, Reserved)) {
  79. return(FALSE);
  80. }
  81. if (!MajorityNodeSetDllEntryPoint(DllHandle, Reason, Reserved)) {
  82. return(FALSE);
  83. }
  84. return(TRUE);
  85. }
  86. DWORD
  87. WINAPI
  88. Startup(
  89. IN LPCWSTR ResourceType,
  90. IN DWORD MinVersionSupported,
  91. IN DWORD MaxVersionSupported,
  92. IN PSET_RESOURCE_STATUS_ROUTINE SetResourceStatus,
  93. IN PLOG_EVENT_ROUTINE LogEvent,
  94. OUT PCLRES_FUNCTION_TABLE *FunctionTable
  95. )
  96. /*++
  97. Routine Description:
  98. Startup a particular resource type. This means verifying the version
  99. requested, and returning the function table for this resource type.
  100. Arguments:
  101. ResourceType - Supplies the type of resource.
  102. MinVersionSupported - The minimum version number supported by the cluster
  103. service on this system.
  104. MaxVersionSupported - The maximum version number supported by the cluster
  105. service on this system.
  106. SetResourceStatus - xxx
  107. LogEvent - xxx
  108. FunctionTable - Returns the Function Table for this resource type.
  109. Return Value:
  110. ERROR_SUCCESS if successful.
  111. A Win32 error code on failure.
  112. --*/
  113. {
  114. if ( (MinVersionSupported > CLRES_VERSION_V1_00) ||
  115. (MaxVersionSupported < CLRES_VERSION_V1_00) ) {
  116. return(ERROR_REVISION_MISMATCH);
  117. }
  118. if ( !ClusResLogEvent ) {
  119. ClusResLogEvent = LogEvent;
  120. ClusResSetResourceStatus = SetResourceStatus;
  121. }
  122. if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_GENSVC ) == 0 ) {
  123. *FunctionTable = &GenSvcFunctionTable;
  124. return(ERROR_SUCCESS);
  125. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_GENAPP ) == 0 ) {
  126. *FunctionTable = &GenAppFunctionTable;
  127. return(ERROR_SUCCESS);
  128. #if 0
  129. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_FTSET ) == 0 ) {
  130. *FunctionTable = &FtSetFunctionTable;
  131. return(ERROR_SUCCESS);
  132. #endif
  133. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_PHYS_DISK ) == 0 ) {
  134. *FunctionTable = &DisksFunctionTable;
  135. return(ERROR_SUCCESS);
  136. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_FILESHR ) == 0 ) {
  137. *FunctionTable = &SmbShareFunctionTable;
  138. return(ERROR_SUCCESS);
  139. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_NETNAME ) == 0 ) {
  140. *FunctionTable = &NetNameFunctionTable;
  141. return(ERROR_SUCCESS);
  142. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_IPADDR ) == 0 ) {
  143. *FunctionTable = &IpAddrFunctionTable;
  144. return(ERROR_SUCCESS);
  145. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_TIMESVC ) == 0 ) {
  146. *FunctionTable = &TimeSvcFunctionTable;
  147. return(ERROR_SUCCESS);
  148. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_PRTSPLR ) == 0 ) {
  149. *FunctionTable = &SplSvcFunctionTable;
  150. return(ERROR_SUCCESS);
  151. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_LKQUORUM ) == 0 ) {
  152. *FunctionTable = &LkQuorumFunctionTable;
  153. return(ERROR_SUCCESS);
  154. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_MSMQ ) == 0 ) {
  155. *FunctionTable = &MsMQFunctionTable;
  156. return(ERROR_SUCCESS);
  157. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_GENSCRIPT ) == 0 ) {
  158. *FunctionTable = &GenScriptFunctionTable;
  159. return(ERROR_SUCCESS);
  160. } else if ( lstrcmpiW( ResourceType, CLUS_RESTYPE_NAME_MAJORITYNODESET) == 0 ) {
  161. *FunctionTable = &MajorityNodeSetFunctionTable;
  162. return(ERROR_SUCCESS);
  163. } else {
  164. return(ERROR_CLUSTER_RESNAME_NOT_FOUND);
  165. }
  166. } // Startup