Windows NT 4.0 source code leak
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.

290 lines
5.3 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. binding.hxx
  5. Abstract:
  6. The class representing a DCE binding lives here. A DCE binding
  7. consists of an optional object UUID, an RPC protocol sequence, a
  8. network address, an optional endpoint, and zero or more network
  9. options.
  10. Author:
  11. Michael Montague (mikemon) 04-Nov-1991
  12. Revision History:
  13. --*/
  14. #ifndef __BINDING_HXX__
  15. #define __BINDING_HXX__
  16. class BINDING_HANDLE;
  17. class DCE_BINDING
  18. /*++
  19. Class Description:
  20. Instances of this class represent an internalized form of a string
  21. binding. In particular, a string binding can be used to construct
  22. an instance of DCE_BINDING. We parse the string binding into
  23. its components and convert the object UUID from a string to a
  24. UUID.
  25. Fields:
  26. ObjectUuid - Contains the object uuid for this binding. This
  27. field will always contain a valid object uuid. If no object
  28. uuid was specified in the string binding used to create an
  29. instance, then ObjectUuid will be the NULL UUID.
  30. RpcProtocolSequence - Contains the rpc protocol sequence for this
  31. binding. This field will always either point to a string or
  32. be zero.
  33. NetworkAddress - Contains the network addres for this binding. This
  34. field will always be zero or point to a string (which is the
  35. network address for this dce binding).
  36. Endpoint - Contains the endpoint for this binding, which will either
  37. pointer to a string or be zero.
  38. Options - Contains the optional network options for this binding.
  39. As will the other fields, this field will either point to a string,
  40. or be zero.
  41. --*/
  42. {
  43. private:
  44. RPC_UUID ObjectUuid;
  45. RPC_CHAR * RpcProtocolSequence;
  46. RPC_CHAR * NetworkAddress;
  47. RPC_CHAR * Endpoint;
  48. RPC_CHAR * Options;
  49. public:
  50. DCE_BINDING (
  51. IN RPC_CHAR PAPI * ObjectUuid OPTIONAL,
  52. IN RPC_CHAR PAPI * RpcProtocolSequence OPTIONAL,
  53. IN RPC_CHAR PAPI * NetworkAddress OPTIONAL,
  54. IN RPC_CHAR PAPI * Endpoint OPTIONAL,
  55. IN RPC_CHAR PAPI * Options OPTIONAL,
  56. OUT RPC_STATUS PAPI * Status
  57. );
  58. DCE_BINDING (
  59. IN RPC_CHAR PAPI * StringBinding,
  60. OUT RPC_STATUS PAPI * Status
  61. );
  62. ~DCE_BINDING (
  63. );
  64. RPC_CHAR PAPI *
  65. StringBindingCompose (
  66. IN RPC_UUID PAPI * Uuid OPTIONAL
  67. );
  68. RPC_CHAR PAPI *
  69. ObjectUuidCompose (
  70. OUT RPC_STATUS PAPI * Status
  71. );
  72. RPC_CHAR PAPI *
  73. RpcProtocolSequenceCompose (
  74. OUT RPC_STATUS PAPI * Status
  75. );
  76. RPC_CHAR PAPI *
  77. NetworkAddressCompose (
  78. OUT RPC_STATUS PAPI * Status
  79. );
  80. RPC_CHAR PAPI *
  81. EndpointCompose (
  82. OUT RPC_STATUS PAPI * Status
  83. );
  84. RPC_CHAR PAPI *
  85. OptionsCompose (
  86. OUT RPC_STATUS PAPI * Status
  87. );
  88. BINDING_HANDLE *
  89. CreateBindingHandle (
  90. OUT RPC_STATUS PAPI * Status
  91. );
  92. RPC_CHAR *
  93. InqNetworkAddress (
  94. );
  95. RPC_CHAR *
  96. InqEndpoint (
  97. );
  98. RPC_CHAR *
  99. InqNetworkOptions (
  100. );
  101. RPC_CHAR *
  102. InqRpcProtocolSequence (
  103. );
  104. void
  105. AddEndpoint(
  106. IN RPC_CHAR *Endpoint
  107. );
  108. RPC_STATUS
  109. ResolveEndpointIfNecessary (
  110. IN PRPC_CLIENT_INTERFACE RpcInterfaceInformation,
  111. IN RPC_UUID * ObjectUuid,
  112. IN OUT void PAPI * PAPI * EpLookupHandle,
  113. IN BOOL UseEpMapperEp,
  114. IN unsigned Timeout
  115. );
  116. int
  117. Compare (
  118. IN DCE_BINDING * DceBinding
  119. );
  120. DCE_BINDING *
  121. DuplicateDceBinding (
  122. );
  123. void
  124. MakePartiallyBound (
  125. );
  126. };
  127. inline RPC_CHAR *
  128. DCE_BINDING::InqNetworkAddress (
  129. )
  130. /*++
  131. Routine Description:
  132. A pointer to the network address for this address is returned.
  133. --*/
  134. {
  135. return(NetworkAddress);
  136. }
  137. inline RPC_CHAR *
  138. DCE_BINDING::InqEndpoint (
  139. )
  140. /*++
  141. Routine Description:
  142. A pointer to the endpoint for this address is returned.
  143. --*/
  144. {
  145. return(Endpoint);
  146. }
  147. inline RPC_CHAR *
  148. DCE_BINDING::InqNetworkOptions (
  149. )
  150. /*++
  151. Routine Description:
  152. A pointer to the network options for this address is returned.
  153. --*/
  154. {
  155. return(Options);
  156. }
  157. inline RPC_CHAR *
  158. DCE_BINDING::InqRpcProtocolSequence (
  159. )
  160. /*++
  161. Routine Description:
  162. A pointer to the rpc protocol sequence for this binding is returned.
  163. --*/
  164. {
  165. return(RpcProtocolSequence);
  166. }
  167. extern RPC_STATUS
  168. IsRpcProtocolSequenceSupported (
  169. IN RPC_CHAR PAPI * RpcProtocolSequence
  170. );
  171. extern void *
  172. OsfClientMapRpcProtocolSequence (
  173. IN RPC_CHAR PAPI * RpcProtocolSequence,
  174. OUT RPC_STATUS PAPI * Status
  175. );
  176. extern BINDING_HANDLE *
  177. OsfCreateBindingHandle (
  178. );
  179. extern BINDING_HANDLE *
  180. SpcCreateBindingHandle (
  181. );
  182. extern BINDING_HANDLE *
  183. WmsgCreateBindingHandle (
  184. void
  185. );
  186. extern BINDING_HANDLE *
  187. DgCreateBindingHandle (
  188. void
  189. );
  190. extern RPC_CHAR *
  191. AllocateEmptyString (
  192. void
  193. );
  194. extern RPC_CHAR *
  195. DuplicateString (
  196. IN RPC_CHAR PAPI * String
  197. );
  198. #if defined(WIN) || defined(MAC)
  199. extern RPC_CHAR PAPI *
  200. AllocateEmptyStringPAPI (
  201. void
  202. );
  203. extern RPC_CHAR PAPI *
  204. DuplicateStringPAPI (
  205. IN RPC_CHAR * String
  206. );
  207. #else // WIN
  208. #define DuplicateStringPAPI DuplicateString
  209. #define AllocateEmptyStringPAPI AllocateEmptyString
  210. #endif // WIN
  211. #ifdef WIN32RPC
  212. extern UUID MgmtIf;
  213. extern UUID NullUuid;
  214. #endif
  215. #endif // __BINDING_HXX__