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.

142 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. rpcbind.c
  5. Abstract:
  6. RPC binding table managment routines
  7. Author:
  8. John Vert (jvert) 6/10/1996
  9. Revision History:
  10. --*/
  11. #include "fmp.h"
  12. //
  13. // Private RPC binding table
  14. //
  15. RPC_BINDING_HANDLE FmpRpcBindings[ClusterMinNodeId + ClusterDefaultMaxNodes];
  16. RPC_BINDING_HANDLE FmpRpcQuorumBindings[ClusterMinNodeId + ClusterDefaultMaxNodes];
  17. DWORD
  18. FmCreateRpcBindings(
  19. PNM_NODE Node
  20. )
  21. /*++
  22. Routine Description:
  23. Creates FM's private RPC bindings for a joining node.
  24. Called by the Node Manager.
  25. Arguments:
  26. Node - A pointer to the node for which to create RPC bindings
  27. Return Value:
  28. A Win32 status code.
  29. --*/
  30. {
  31. DWORD Status;
  32. RPC_BINDING_HANDLE BindingHandle;
  33. CL_NODE_ID NodeId = NmGetNodeId(Node);
  34. ClRtlLogPrint(LOG_NOISE,
  35. "[FM] Creating RPC bindings for node %1!u!.\n",
  36. NodeId
  37. );
  38. //
  39. // Main binding
  40. //
  41. if (FmpRpcBindings[NodeId] != NULL) {
  42. //
  43. // Reuse the old binding.
  44. //
  45. Status = ClMsgVerifyRpcBinding(FmpRpcBindings[NodeId]);
  46. if (Status != ERROR_SUCCESS) {
  47. ClRtlLogPrint(LOG_CRITICAL,
  48. "[FM] Failed to verify main RPC binding for node %1!u!, status %2!u!.\n",
  49. NodeId,
  50. Status
  51. );
  52. return(Status);
  53. }
  54. }
  55. else {
  56. //
  57. // Create a new binding
  58. //
  59. Status = ClMsgCreateRpcBinding(
  60. Node,
  61. &(FmpRpcBindings[NodeId]),
  62. 0 );
  63. if (Status != ERROR_SUCCESS) {
  64. ClRtlLogPrint(LOG_CRITICAL,
  65. "[FM] Failed to create main RPC binding for node %1!u!, status %2!u!.\n",
  66. NodeId,
  67. Status
  68. );
  69. return(Status);
  70. }
  71. }
  72. //
  73. // Quorum binding
  74. //
  75. if (FmpRpcQuorumBindings[NodeId] != NULL) {
  76. //
  77. // Reuse the old binding.
  78. //
  79. Status = ClMsgVerifyRpcBinding(FmpRpcQuorumBindings[NodeId]);
  80. if (Status != ERROR_SUCCESS) {
  81. ClRtlLogPrint(LOG_CRITICAL,
  82. "[FM] Failed to verify quorum RPC binding for node %1!u!, status %2!u!.\n",
  83. NodeId,
  84. Status
  85. );
  86. // presumably we will shutdown at this point
  87. return(Status);
  88. }
  89. }
  90. else {
  91. //
  92. // Create a new binding
  93. //
  94. Status = ClMsgCreateRpcBinding(
  95. Node,
  96. &(FmpRpcQuorumBindings[NodeId]),
  97. 0 );
  98. if (Status != ERROR_SUCCESS) {
  99. ClRtlLogPrint(LOG_CRITICAL,
  100. "[FM] Failed to create quorum RPC binding for node %1!u!, status %2!u!.\n",
  101. NodeId,
  102. Status
  103. );
  104. return(Status);
  105. }
  106. }
  107. return(ERROR_SUCCESS);
  108. } // FmpCreateRpcBindings