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.

118 lines
4.2 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1999 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. cluster.h
  7. handles starting/stopping cluster resources
  8. FILE HISTORY:
  9. */
  10. #ifndef _CLUSTER_H
  11. #define _CLUSTER_H
  12. #ifndef _DYNAMLNK_H
  13. #include "dynamlnk.h"
  14. #endif
  15. #define MAX_NAME_SIZE 256
  16. typedef enum _ClusApiIndex
  17. {
  18. CLUS_GET_NODE_CLUSTER_STATE = 0,
  19. CLUS_OPEN_CLUSTER,
  20. CLUS_CLUSTER_OPEN_ENUM,
  21. CLUS_CLUSTER_ENUM,
  22. CLUS_OPEN_CLUSTER_RESOURCE,
  23. CLUS_ONLINE_CLUSTER_RESOURCE,
  24. CLUS_OFFLINE_CLUSTER_RESOURCE,
  25. CLUS_GET_CLUSTER_RESOURCE_STATE,
  26. CLUS_CLOSE_CLUSTER_RESOURCE,
  27. CLUS_CLUSTER_CLOSE_ENUM,
  28. CLUS_CLOSE_CLUSTER,
  29. CLUS_CLUSTER_RESOURCE_CONTROL,
  30. CLUS_CLUSTER_RESOURCE_OPEN_ENUM,
  31. CLUS_CLUSTER_RESOURCE_ENUM,
  32. CLUS_CLUSTER_RESOURCE_CLOSE_ENUM,
  33. CLUS_GET_CLUSTER_INFORMATION
  34. };
  35. // not subject to localization
  36. static LPCSTR g_apchClusFunctionNames[] = {
  37. "GetNodeClusterState",
  38. "OpenCluster",
  39. "ClusterOpenEnum",
  40. "ClusterEnum",
  41. "OpenClusterResource",
  42. "OnlineClusterResource",
  43. "OfflineClusterResource",
  44. "GetClusterResourceState",
  45. "CloseClusterResource",
  46. "ClusterCloseEnum",
  47. "CloseCluster",
  48. "ClusterResourceControl",
  49. "ClusterResourceOpenEnum",
  50. "ClusterResourceEnum",
  51. "ClusterResourceCloseEnum",
  52. "GetClusterInformation",
  53. NULL
  54. };
  55. // not subject to localization
  56. extern DynamicDLL g_ClusDLL;
  57. typedef LONG (*GETNODECLUSTERSTATE) (LPCWSTR, LPDWORD);
  58. typedef HCLUSTER (*OPENCLUSTER) (LPCWSTR);
  59. typedef HCLUSENUM (*CLUSTEROPENENUM) (HCLUSTER, DWORD);
  60. typedef DWORD (*CLUSTERENUM) (HCLUSENUM, DWORD, LPDWORD, LPWSTR, LPDWORD);
  61. typedef HRESOURCE (*OPENCLUSTERRESOURCE) (HCLUSTER, LPCWSTR);
  62. typedef DWORD (*ONLINECLUSTERRESOURCE) (HRESOURCE);
  63. typedef DWORD (*OFFLINECLUSTERRESOURCE) (HRESOURCE);
  64. typedef CLUSTER_RESOURCE_STATE (*GETCLUSTERRESOURCESTATE) (HRESOURCE, LPWSTR, LPDWORD, LPWSTR, LPDWORD);
  65. typedef BOOL (*CLOSECLUSTERRESOURCE) (HRESOURCE);
  66. typedef DWORD (*CLUSTERCLOSEENUM) (HCLUSENUM);
  67. typedef BOOL (*CLOSECLUSTER) (HCLUSTER);
  68. typedef DWORD (*CLUSTERRESOURCECONTROL) (HRESOURCE, HNODE, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPVOID);
  69. typedef HRESENUM (*CLUSTERRESOURCEOPENENUM) (HRESOURCE, DWORD);
  70. typedef DWORD (*CLUSTERRESOURCEENUM) (HRESENUM, DWORD, LPDWORD, LPWSTR, LPDWORD);
  71. typedef DWORD (*CLUSTERRESOURCECLOSEENUM) (HRESENUM);
  72. typedef DWORD (*GETCLUSTERINFORMATION) (HCLUSTER, LPWSTR, LPDWORD, LPCLUSTERVERSIONINFO);
  73. // Resource utils for cluster support
  74. typedef enum _ResUtilsIndex
  75. {
  76. RESUTILS_FIND_DWORD_PROPERTY = 0,
  77. RESUTILS_FIND_SZ_PROPERTY,
  78. };
  79. // not subject to localization
  80. static LPCSTR g_apchResUtilsFunctionNames[] = {
  81. "ResUtilFindDwordProperty",
  82. "ResUtilFindSzProperty",
  83. NULL,
  84. };
  85. typedef DWORD (*RESUTILSFINDDWORDPROPERTY)(PVOID, DWORD, LPCWSTR, LPDWORD);
  86. typedef DWORD (*RESUTILSFINDSZPROPERTY)(PVOID, DWORD, LPCWSTR, LPWSTR *);
  87. // not subject to localization
  88. extern DynamicDLL g_ResUtilsDLL;
  89. DWORD ControlClusterService(LPCTSTR pszComputer, LPCTSTR pszResourceType, LPCTSTR pszServiceDesc, BOOL fStart);
  90. BOOL FIsComputerInRunningCluster(LPCTSTR pszComputer);
  91. DWORD GetClusterResourceIp(LPCTSTR pszComputer, LPCTSTR pszResourceType, CString & strAddress);
  92. DWORD StartResource(LPCTSTR pszComputer, HRESOURCE hResource, LPCTSTR pszServiceDesc);
  93. DWORD StopResource(LPCTSTR pszComputer, HRESOURCE hResource, LPCTSTR pszServiceDesc);
  94. DWORD GetResourceType(HRESOURCE hRes, LPWSTR * ppszName, DWORD dwBufSizeIn, DWORD * pdwBufSizeOut);
  95. DWORD GetResourceIpAddress(HRESOURCE hRes, CString & strAddress);
  96. DWORD FindSzProp(LPVOID pvProps, DWORD cbProps, LPCWSTR pszTarget, LPWSTR * ppszOut);
  97. DWORD GetClusterInfo(LPCTSTR pszClusIp, CString &strClusName, DWORD * pdwClusIp);
  98. #endif _CLUSTER_H