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.

1663 lines
49 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. rpctran.h
  5. Abstract:
  6. The interface to the loadable transport interface modules is described
  7. in this file.
  8. Author:
  9. Steve Zeck (stevez) 06-May-1991
  10. Revision History:
  11. 01-Mar-1992 mikemon
  12. The shared state between the runtime and the transport interface
  13. modules was removed. Status codes were specified for each routine,
  14. and coding convensions were fixed.
  15. 27-Jul-1995 jroberts
  16. Moved the datagram interface here, too.
  17. --*/
  18. #ifndef __RPCTRAN_H__
  19. #define __RPCTRAN_H__
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #define RPC_TRANSPORT_INTERFACE_VERSION 9
  24. #define IDLE_SECONDS 60
  25. #define RPC_BIND_TIMEOUT 30
  26. typedef void PAPI * RPC_TRANSPORT_CONNECTION;
  27. typedef void PAPI * RPC_TRANSPORT_ADDRESS;
  28. #define RPC_TRANS_STATUS RPC_STATUS
  29. #if defined(DOS) && !defined(WIN)
  30. #pragma warning(disable:4147)
  31. #endif
  32. typedef RPC_TRANS_STATUS
  33. (RPC_ENTRY * TRANS_SERVER_SETUPWITHENDPOINT) (
  34. IN RPC_TRANSPORT_ADDRESS ThisAddress,
  35. IN RPC_CHAR PAPI * Endpoint,
  36. OUT RPC_CHAR PAPI * lNetworkAddress,
  37. OUT unsigned int PAPI * NumNetworkAddress,
  38. IN unsigned int NetworkAddressLength,
  39. IN void PAPI * SecurityDescriptor, OPTIONAL
  40. IN unsigned int PendingQueueSize,
  41. IN RPC_CHAR PAPI * RpcProtocolSequence,
  42. IN unsigned long EndpointFlags,
  43. IN unsigned long NICFlags
  44. );
  45. /*++
  46. Routine Description:
  47. We use this routine to setup and address with a know endpoint. Once
  48. memory has been allocated for a transport address, either this routine
  49. or SetupUnknownEndpoint will be called. Things must be setup so that
  50. packets can be received when ReceiveAny is called.
  51. Arguments:
  52. ThisAddress - Supplies a pointer to memory reserved for the transport
  53. interface module to place information about the address. The size
  54. of this memory is specified by the SizeOfAddress field in the
  55. structure returned by TransportLoad.
  56. Endpoint - Supplies the endpoint for the address. The transport
  57. interface module does not need to make a copy of this argument.
  58. We will guarantee the endpoint will not be deallocated once
  59. ReceiveAny has been called for the first time.
  60. NetworkAddress - Returns the network address for this server. The
  61. caller will have allocated a buffer to contain the network address.
  62. If the buffer is not large enough, this routine must return
  63. RPC_P_NETWORK_ADDRESS_TOO_SMALL; the caller will try again with
  64. a larger buffer.
  65. NetworkAddressLength - Supplies the length in characters of the network
  66. address buffer. On systems which support unicode, each character
  67. will be two bytes wide, otherwise, each character will be one byte
  68. wide.
  69. SecurityDescriptor - Optionally supplies a security descriptor to be
  70. placed on the address. The semantics of the security descriptor
  71. depend upon the particular transport interface involved.
  72. PendinqQueueSize - Supplies the argument passed as MaxCalls to the
  73. RpcServerUseProtseq* and RpcServerUseAllProtseqs* calls. This is
  74. intended to specify the size of pending packet queue for sockets.
  75. RpcProtocolSequence - Supplies the rpc protocol sequence for which we
  76. want to setup an address. This argument is intended to allow a
  77. single transport interface module support than one different rpc
  78. protocol sequence.
  79. Return Value:
  80. RPC_S_OK - The address has been setup correctly. It is now ready
  81. to start receiving packets (the ReceiveAny operation will be used
  82. to do this).
  83. RPC_S_INVALID_SECURITY_DESC - The supplied security descriptor is
  84. invalid.
  85. RPC_S_CANT_CREATE_ENDPOINT - The endpoint format is correct, but the
  86. endpoint can not be created. This will likely occur because some
  87. other server has already taken the endpoint.
  88. RPC_S_INVALID_ENDPOINT_FORMAT - The endpoint is not a valid endpoint
  89. for this particular transport interface.
  90. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to
  91. setup the address.
  92. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to setup the
  93. address.
  94. RPC_P_NETWORK_ADDRESS_TOO_SMALL - The supplied network address buffer
  95. is too small to hold the network address. This status code indicates
  96. that the caller should try again with a larger network address
  97. buffer.
  98. --*/
  99. typedef RPC_TRANS_STATUS
  100. (RPC_ENTRY * TRANS_SERVER_SETUPUNKNOWNENDPOINT) (
  101. IN RPC_TRANSPORT_ADDRESS ThisAddress,
  102. OUT RPC_CHAR PAPI * Endpoint,
  103. IN unsigned int EndpointLength,
  104. OUT RPC_CHAR PAPI * lNetworkAddress,
  105. OUT unsigned int PAPI * NumNetworkAddress,
  106. IN unsigned int NetworkAddressLength,
  107. IN void PAPI * SecurityDescriptor, OPTIONAL
  108. IN unsigned int PendingQueueSize,
  109. IN RPC_CHAR PAPI * RpcProtocolSequence,
  110. IN unsigned long EndpointFlags,
  111. IN unsigned long NICFlags
  112. );
  113. /*++
  114. Routine Description:
  115. We use this routine to setup and address with an unknow endpoint. Once
  116. memory has been allocated for a transport address, either this routine
  117. or SetupWithEndpoint will be called. A endpoint must be dynamically
  118. created and setup. You can think of this routine as randomly creating
  119. a syntactically valid endpoint and then calling SetupWithEndpoint. This
  120. must be repeated until SetupWithEndpoint returns something other than
  121. RPC_S_CANT_CREATE_ENDPOINT. Things must be setup so that packets can be
  122. received when ReceiveAny is called.
  123. Arguments:
  124. ThisAddress - Supplies a pointer to memory reserved for the transport
  125. interface module to place information about the address. The size
  126. of this memory is specified by the SizeOfAddress field in the
  127. structure returned by TransportLoad.
  128. Endpoint - Returns the dynamic endpoint for the address. The transport
  129. interface module does not need to make a copy of this argument.
  130. We will guarantee the endpoint will not be deallocated once
  131. ReceiveAny has been called for the first time. The caller wil
  132. have allocated a buffer to contain the endpoint. If the buffer
  133. is too small, this routine must return RPC_P_ENDPOINT_TOO_SMALL,
  134. and the caller will try again with a larger buffer.
  135. EndpointLength - Supplies the length in characters of the endpoint
  136. buffer. On systems which support unicode, each character will
  137. be two bytes wide, otherwise, each character will be one byte
  138. wide.
  139. NetworkAddress - Returns the network address for this server. The
  140. caller will have allocated a buffer to contain the network address.
  141. If the buffer is not large enough, this routine must return
  142. RPC_P_NETWORK_ADDRESS_TOO_SMALL; the caller will try again with
  143. a larger buffer.
  144. NetworkAddressLength - Supplies the length in characters of the network
  145. address buffer. On systems which support unicode, each character
  146. will be two bytes wide, otherwise, each character will be one byte
  147. wide.
  148. SecurityDescriptor - Optionally supplies a security descriptor to be
  149. placed on the address. The semantics of the security descriptor
  150. depend upon the particular transport interface involved.
  151. PendinqQueueSize - Supplies the argument passed as MaxCalls to the
  152. RpcServerUseProtseq* and RpcServerUseAllProtseqs* calls. This is
  153. intended to specify the size of pending packet queue for sockets.
  154. RpcProtocolSequence - Supplies the rpc protocol sequence for which we
  155. want to setup an address. This argument is intended to allow a
  156. single transport interface module support than one different rpc
  157. protocol sequence.
  158. Return Value:
  159. RPC_S_OK - The address has been setup correctly. It is now ready
  160. to start receiving packets (the ReceiveAny operation will be used
  161. to do this).
  162. RPC_S_INVALID_SECURITY_DESC - The supplied security descriptor is
  163. invalid.
  164. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to
  165. setup the address.
  166. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to setup the
  167. address.
  168. RPC_P_NETWORK_ADDRESS_TOO_SMALL - The supplied network address buffer
  169. is too small to hold the network address. This status code indicates
  170. that the caller should try again with a larger network address
  171. buffer.
  172. RPC_P_ENDPOINT_TOO_SMALL - The supplied endpoint buffer is too small
  173. to hold the endpoint. This status code indicates that the caller
  174. should try again with a larger endpoint buffer.
  175. --*/
  176. typedef void
  177. (RPC_ENTRY * TRANS_SERVER_ABORTSETUPADDRESS) (
  178. IN RPC_TRANSPORT_ADDRESS ThisAddress
  179. );
  180. /*++
  181. Routine Description:
  182. There are failure scenerios in which the runtime will be unable to
  183. complete adding an address. This routine is used to abort a transport
  184. address; we guarantee to never call this routine after ReceiveAny has
  185. been called at least once.
  186. Arguments:
  187. ThisAddress - Supplies a pointer to the transport interface module level
  188. information about the address to be aborted.
  189. --*/
  190. typedef RPC_TRANS_STATUS
  191. (RPC_ENTRY * TRANS_SERVER_CLOSE) (
  192. IN RPC_TRANSPORT_CONNECTION ThisConnection
  193. );
  194. /*++
  195. Routine Description:
  196. This entry point is used by the runtime to close a transport interface
  197. module level connection. We guarantee that this routine will be called
  198. at most once, and only if another routine did not return an error
  199. indicating that the connection had been closed.
  200. Arguments:
  201. ThisConnection - Supplies the connection to be closed. The connection
  202. is specified as a pointer to memory containing tranport interface
  203. module level information about the connection.
  204. Return Value:
  205. RPC_S_OK - This value must always be returned.
  206. --*/
  207. typedef RPC_TRANS_STATUS
  208. (RPC_ENTRY * TRANS_SERVER_SEND) (
  209. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  210. IN void PAPI * Buffer,
  211. IN unsigned int BufferLength
  212. );
  213. /*++
  214. Routine Description:
  215. Arguments:
  216. ThisConnection - Supplies the connection to be sent on. The
  217. connection is specified as a pointer to memory containing tranport
  218. interface module level information about the connection.
  219. Buffer - Supplies a buffer containing the packet to be sent to the
  220. client.
  221. BufferLength - Supplies the length of the buffer in bytes.
  222. Return Value:
  223. RPC_S_OK - The packet was successfully sent to the client.
  224. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to perform the
  225. operation. The connection will not have been closed if this error
  226. occurs.
  227. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to perform
  228. the operation. The connection will not have been closed if this
  229. error occurs.
  230. RPC_P_SEND_FAILED - The send operation failed. The connection
  231. will have been closed, so the close operation must not be performed
  232. on the connection after this error code has been returned.
  233. --*/
  234. typedef RPC_TRANS_STATUS
  235. (RPC_ENTRY * TRANS_SERVER_RECEIVEANY) (
  236. IN RPC_TRANSPORT_ADDRESS ThisAddress,
  237. OUT RPC_TRANSPORT_CONNECTION PAPI * SConnection,
  238. IN OUT void PAPI * PAPI * Buffer,
  239. OUT unsigned int PAPI * BufferLength,
  240. IN long Timeout
  241. );
  242. /*++
  243. Routine Description:
  244. This routine waits until a packet is received from any of the connections
  245. connected to this address, or until one of the connections closes. At
  246. that point, it returns. One a single thread will call this routine at
  247. a time for each address.
  248. Arguments:
  249. ThisAddress - Supplies a pointer to the transport level address on which
  250. to perform the receive any operation.
  251. SConnection - Returns the connection which either closed or just had
  252. a packet received from it.
  253. Buffer - Supplies zero as the buffer, and returns a buffer containing a
  254. packet received from the connection. Zero is supplied as the
  255. buffer so that the runtime can determine on error whether or not
  256. a buffer needs to be freed.
  257. BufferLength - Returns the length of the buffer in bytes.
  258. Timeout - Supplies a timeout value which indicates in milliseconds
  259. how long to wait for either a packet to be received or a connection
  260. to close before returning with RPC_P_TIMEOUT. A value of negative
  261. one (-1) indicates to wait forever.
  262. Return Value:
  263. RPC_S_OK - A packet has successfully been received from one of the
  264. connections on this address.
  265. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to complete the
  266. operation. The address must continue to operate even if this error
  267. code is returned.
  268. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to complete
  269. the operation. The address must continue to operate even if this
  270. error code is returned.
  271. RPC_P_CONNECTION_CLOSED - The connection returned by the SConnection
  272. argument has closed.
  273. RPC_P_TIMEOUT - The transport interface module timed out waiting for
  274. a packet or a connection to close.
  275. RPC_P_SERVER_TRANSPORT_ERROR - The transport got an unrecoverable error.
  276. --*/
  277. typedef RPC_TRANS_STATUS
  278. (RPC_ENTRY * TRANS_SERVER_IMPERSONATECLIENT) (
  279. IN RPC_TRANSPORT_CONNECTION ThisConnection
  280. );
  281. /*++
  282. Routine Description:
  283. We need this routine in order for the server to beable to impersonate
  284. the client in some situations. This is done in a transport specific
  285. manner on transports which are actually session layers.
  286. Arguments:
  287. ThisConnection - Supplies a pointer to the transport interface module
  288. level information about the transport connection.
  289. Return Value:
  290. RPC_S_OK - The thread which called this routine is now impersonating
  291. the client.
  292. RPC_S_NO_CONTEXT_AVAILABLE - No client security context is available
  293. for the server thread to use for impersonation.
  294. --*/
  295. typedef RPC_TRANS_STATUS
  296. (RPC_ENTRY * TRANS_SERVER_REVERTTOSELF) (
  297. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  298. IN void PAPI * ThreadHandle
  299. );
  300. /*++
  301. Routine Description:
  302. A server thread which has impersonated a client needs to go back to
  303. having its original security context. This routine is used to do
  304. that.
  305. Arguments:
  306. ThisConnection - Supplies a pointer to the transport interface module
  307. level information about the transport connection which we no longer
  308. wish to impersonate.
  309. ThreadHandle - Supplies a handle to the thread opened before the thread
  310. started impersonating the client. This is necessary on NT so that
  311. the server thread can revert to self.
  312. Return Value:
  313. RPC_S_OK - This value will always be returned.
  314. --*/
  315. typedef struct _RPC_TRANSPORT_CLIENT_PROCESS
  316. {
  317. void * FirstPart;
  318. void * SecondPart;
  319. } RPC_CLIENT_PROCESS_IDENTIFIER;
  320. typedef RPC_TRANS_STATUS
  321. (RPC_ENTRY * TRANS_SERVER_QUERYCLIENTPROCESS) (
  322. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  323. OUT RPC_CLIENT_PROCESS_IDENTIFIER * ClientProcess
  324. );
  325. /*++
  326. Routine Description:
  327. This routine is only necessary for NT named pipes. All other transports
  328. should supply zero for the pointer to this routine in the
  329. RPC_SERVER_TRANSPORT_INFO.
  330. For the really curious, we need this to make context handles secure.
  331. --*/
  332. typedef RPC_TRANS_STATUS
  333. (RPC_ENTRY * TRANS_SERVER_RECEIVEDIRECT) (
  334. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  335. IN OUT void PAPI * PAPI * Buffer,
  336. OUT unsigned int PAPI * BufferLength
  337. );
  338. /*++
  339. Routine Description:
  340. The receive direct operation is performed on a transport connection
  341. using this operation. It will block until either a packet is received
  342. or the connection closes.
  343. Arguments:
  344. ThisConnection - Supplies the receive direct transport connection to
  345. receive from.
  346. Buffer - Returns the buffer of data which we received.
  347. BufferLength - Returns the length of the buffer in bytes.
  348. Return Value:
  349. RPC_S_OK - A packet has successfully been received from the connection.
  350. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to complete the
  351. operation.
  352. RPC_P_CONNECTION_CLOSED - The connection has closed.
  353. --*/
  354. typedef RPC_TRANS_STATUS
  355. (RPC_ENTRY * TRANS_SERVER_QUERYCLIENTADDRESS) (
  356. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  357. OUT RPC_CHAR PAPI * NetworkAddress,
  358. IN unsigned int NetworkAddressLength
  359. );
  360. /*++
  361. Routine Description:
  362. We use this routine to obtain the network address of the client at the
  363. other end of this connection. This functionality is necessary to support
  364. RpcBindingServerFromClient.
  365. Arguments:
  366. ThisConnection - Supplies a pointer to the connection for which we want
  367. to perform the operation.
  368. NetworkAddress - Returns the network address of the client. The caller
  369. will have allocated a buffer to contain the network address. If the
  370. buffer is not large enough, this routine must return
  371. RPC_P_NETWORK_ADDRESS_TOO_SMALL; the caller will try again with a
  372. larger buffer.
  373. NetworkAddressLength - Supplies the length in characters of the network
  374. address buffer. On systems which support unicode, each character
  375. will be two bytes wide, otherwise, each character will be one byte
  376. wide.
  377. Return Value:
  378. RPC_S_OK - The network address has successfully been obtained.
  379. RPC_P_NETWORK_ADDRESS_TOO_SMALL - The supplied network address buffer
  380. is too small to hold the network address. This status code indicates
  381. that the caller should try again with a larger network address
  382. buffer.
  383. --*/
  384. #if defined(NTENV) || defined(WIN96)
  385. typedef RPC_TRANS_STATUS
  386. (RPC_ENTRY * TRANS_SERVER_STARTLISTENING) (
  387. IN RPC_TRANSPORT_ADDRESS ThisAddress
  388. );
  389. /*++
  390. Routine Description:
  391. Arguments:
  392. ThisConnection - Supplies a pointer to the connection for which we want
  393. to perform the operation.
  394. Return Value:
  395. RPC_S_OK - The network address has successfully been obtained.
  396. --*/
  397. #endif
  398. typedef struct _RPC_SERVER_TRANSPORT_INFO
  399. {
  400. unsigned short TransInterfaceVersion;
  401. unsigned int MaximumPacketSize;
  402. unsigned int SizeOfAddress;
  403. unsigned int SizeOfConnection;
  404. TRANS_SERVER_SETUPWITHENDPOINT SetupWithEndpoint;
  405. TRANS_SERVER_SETUPUNKNOWNENDPOINT SetupUnknownEndpoint;
  406. TRANS_SERVER_ABORTSETUPADDRESS AbortSetupAddress;
  407. TRANS_SERVER_CLOSE Close;
  408. TRANS_SERVER_SEND Send;
  409. TRANS_SERVER_RECEIVEANY ReceiveAny;
  410. TRANS_SERVER_IMPERSONATECLIENT ImpersonateClient;
  411. TRANS_SERVER_REVERTTOSELF RevertToSelf;
  412. TRANS_SERVER_QUERYCLIENTPROCESS QueryClientProcess;
  413. TRANS_SERVER_RECEIVEDIRECT ReceiveDirect;
  414. TRANS_SERVER_QUERYCLIENTADDRESS QueryClientAddress;
  415. #if defined(NTENV) || defined(WIN96)
  416. TRANS_SERVER_STARTLISTENING StartListening ;
  417. #endif
  418. } RPC_SERVER_TRANSPORT_INFO;
  419. RPC_TRANSPORT_CONNECTION RPC_ENTRY
  420. I_RpcTransServerNewConnection (
  421. IN RPC_TRANSPORT_ADDRESS ThisAddress,
  422. IN int ConnectionKey,
  423. OUT unsigned int PAPI * ReceiveFlag
  424. );
  425. RPC_TRANSPORT_CONNECTION RPC_ENTRY
  426. I_RpcTransServerFindConnection (
  427. IN RPC_TRANSPORT_ADDRESS ThisAddress,
  428. IN int ConnectionKey
  429. );
  430. unsigned short RPC_ENTRY
  431. I_RpcTransServerMaxFrag (
  432. IN RPC_TRANSPORT_CONNECTION ThisConnection
  433. );
  434. RPC_STATUS RPC_ENTRY
  435. I_RpcTransServerReallocBuffer (
  436. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  437. IN OUT void PAPI * PAPI * Buffer,
  438. IN unsigned int OldBufferLength,
  439. IN unsigned int NewBufferLength
  440. );
  441. void RPC_ENTRY
  442. I_RpcTransServerFreeBuffer (
  443. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  444. IN void PAPI * Buffer
  445. );
  446. void PAPI * RPC_ENTRY
  447. I_RpcTransServerProtectThread (
  448. void
  449. );
  450. void RPC_ENTRY
  451. I_RpcTransServerUnprotectThread (
  452. IN void PAPI * Thread
  453. );
  454. void RPC_ENTRY
  455. I_RpcTransServerReceiveDirectReady (
  456. IN RPC_TRANSPORT_CONNECTION ThisConnection
  457. );
  458. void RPC_ENTRY
  459. I_RpcConnectionInqSockBuffSize2(
  460. OUT unsigned long __RPC_FAR * RecvWindowSize
  461. );
  462. #if defined(NTENV) || defined(WIN96)
  463. int RPC_ENTRY
  464. I_RpcTransMaybeMakeReceiveDirect (
  465. IN RPC_TRANSPORT_ADDRESS TransAddress,
  466. IN RPC_TRANSPORT_CONNECTION ThisConnection
  467. ) ;
  468. int RPC_ENTRY
  469. I_RpcTransMaybeMakeReceiveAny (
  470. IN RPC_TRANSPORT_CONNECTION ThisConnection
  471. ) ;
  472. void RPC_ENTRY
  473. I_RpcTransCancelMigration(
  474. IN RPC_TRANSPORT_CONNECTION ThisConnection
  475. ) ;
  476. #endif
  477. RPC_STATUS RPC_ENTRY
  478. I_RpcTransPingServer(
  479. IN RPC_TRANSPORT_CONNECTION ThisConnection
  480. ) ;
  481. typedef RPC_TRANS_STATUS
  482. (RPC_ENTRY * TRANS_CLIENT_OPEN) (
  483. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  484. IN RPC_CHAR PAPI * NetworkAddress,
  485. IN RPC_CHAR PAPI * Endpoint,
  486. IN RPC_CHAR PAPI * NetworkOptions,
  487. IN RPC_CHAR PAPI * TransportAddress,
  488. IN RPC_CHAR PAPI * RpcProtocolSequence,
  489. IN unsigned int Timeout
  490. );
  491. /*++
  492. Routine Description:
  493. Arguments:
  494. ThisConnection - Supplies a pointer to memory reserved for the transport
  495. interface module to place information about the connection. The size
  496. of this memory is specified by the SizeOfConnection field in the
  497. structure returned by TransportLoad.
  498. NetworkAddress - Supplies the network address part of the string binding.
  499. Endpoint - Supplies the endpoint part of the string binding.
  500. NetworkOptions - Supplies the network options part of the string binding.
  501. TransportAddress - Supplies the network address part of the string
  502. binding concatenated with the endpoint part of the string binding.
  503. Some transport interfaces want the network address seperate from
  504. the endpoint, and others want them concatenated together.
  505. RpcProtocolSequence - Supplies the rpc protocol sequence part of the
  506. string binding. This parameter allows a single transport interface
  507. module to support more than one rpc protocol sequence.
  508. Timeout - Supplies a hint specifying how long to keep trying to establish
  509. a connection. The timeout value is an integer value from zero to
  510. ten; the values represent a relative amount of time to spend to
  511. establish a connection with the server. For a more complete
  512. description of this, see the documentation for RpcMgmtSetComTimeout.
  513. The following constants are defined for the timeout values.
  514. RPC_C_BINDING_INFINITE_TIMEOUT - This is defined to be ten; it means
  515. to keep trying to establish communications forever. The runtime
  516. will repeatedly call the transport if necessary to support this
  517. functionality.
  518. RPC_C_BINDING_MIN_TIMEOUT - This value of zero indicates to wait the
  519. minimum amount of time for the network protocol being used.
  520. RPC_C_BINDING_DEFAULT_TIMEOUT - You should try an average amount of
  521. time for the network protocol being used. This is the default
  522. value.
  523. RPC_C_BINDING_MAX_TIMEOUT - This value of nine indicates that you
  524. should try for the longest amount of time for the network
  525. protocol being used.
  526. Return Value:
  527. RPC_S_OK - We successfully allocated a connection and connected
  528. to the server.
  529. RPC_S_SERVER_UNAVAILABLE - We were unable to connect with the server;
  530. just because this status code is returned does not mean that
  531. the server is not there.
  532. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to complete
  533. the operation.
  534. RPC_S_OUT_OF_RESOURCES - Insufficient resources, some as file system
  535. handles or sockets are available to complete the operation.
  536. RPC_S_SERVER_TOO_BUSY - The server is there, but it is too busy
  537. to respond to our connect request. Not all transports will be
  538. able to detect this condition; if they can not, can not connect
  539. will be returned.
  540. RPC_S_ACCESS_DENIED - The client is denied access for security
  541. reasons to the server.
  542. RPC_S_INVALID_NETWORK_OPTIONS - The specified network options are
  543. invalid. See a description of the particular transport interface
  544. module for what constitutes valid network options.
  545. RPC_S_INVALID_ENDPOINT_FORMAT - The specified endpoint was an incorrect
  546. format and invalid. The format is entirly dependent on the
  547. transport being used.
  548. --*/
  549. typedef RPC_TRANS_STATUS
  550. (RPC_ENTRY * TRANS_CLIENT_CLOSE) (
  551. IN RPC_TRANSPORT_CONNECTION ThisConnection
  552. );
  553. /*++
  554. Routine Description:
  555. This entry point is used by the runtime to close a transport interface
  556. module level connection. We guarantee that this routine will be called
  557. at most once, and only if another routine did not return an error
  558. indicating that the connection had been closed.
  559. Arguments:
  560. ThisConnection - Supplies the connection to be closed. The connection
  561. is specified as a pointer to memory containing tranport interface
  562. module level information about the connection.
  563. Return Value:
  564. RPC_S_OK - This value must always be returned.
  565. --*/
  566. typedef RPC_TRANS_STATUS
  567. (RPC_ENTRY * TRANS_CLIENT_SEND) (
  568. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  569. IN void PAPI * Buffer,
  570. IN unsigned int BufferLength
  571. );
  572. /*++
  573. Routine Description:
  574. Arguments:
  575. ThisConnection - Supplies the connection to be sent on. The
  576. connection is specified as a pointer to memory containing tranport
  577. interface module level information about the connection.
  578. Buffer - Supplies a buffer containing the packet to be sent to the
  579. server.
  580. BufferLength - Supplies the length of the buffer in bytes.
  581. Return Value:
  582. RPC_S_OK - The packet was successfully sent to the server.
  583. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to perform the
  584. operation. The connection will not have been closed if this error
  585. occurs.
  586. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to perform
  587. the operation. The connection will not have been closed if this
  588. error occurs.
  589. RPC_P_SEND_FAILED - The send operation failed. The connection
  590. will have been closed, so the close operation must not be performed
  591. on the connection after this error code has been returned.
  592. --*/
  593. typedef RPC_TRANS_STATUS
  594. (RPC_ENTRY * TRANS_CLIENT_RECEIVE) (
  595. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  596. IN OUT void PAPI * PAPI * Buffer,
  597. IN OUT unsigned int PAPI * BufferLength
  598. );
  599. /*++
  600. Routine Description:
  601. Arguments:
  602. ThisConnection - Supplies the connection to be received from. The
  603. connection is specified as a pointer to memory containing tranport
  604. interface module level information about the connection.
  605. Buffer - Supplies a preallocated buffer to the receive the packet into
  606. if it will fit. If the packet does not fit, the transport interface
  607. module must allocate a larger buffer which will hold the entire
  608. packet. The buffer will contain the packet upon return.
  609. BufferLength - Supplies the length of the preallocated buffer in bytes
  610. and returns the length of the received packet in bytes.
  611. Return Value:
  612. RPC_S_OK - A packet was successfully received from the server.
  613. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to allocate a
  614. buffer to receive the packet into. The connection will not have
  615. been closed if this error occurs.
  616. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to perform
  617. the operation. The connection will not have been closed if this
  618. error occurs.
  619. RPC_P_RECEIVE_FAILED - The receive operation failed. The connection
  620. will have been closed, so the close operation must not be performed
  621. on the connection after this error code has been returned.
  622. --*/
  623. typedef RPC_TRANS_STATUS
  624. (RPC_ENTRY * TRANS_CLIENT_SET_TIMEOUT) (
  625. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  626. IN long Timeout
  627. );
  628. /*++
  629. Routine Description:
  630. Arguments:
  631. ThisConnection - Supplies the connection to be received from. The
  632. connection is specified as a pointer to memory containing tranport
  633. interface module level information about the connection.
  634. Timeout - Timeout value in seconds. !0, seconds,
  635. RPC_C_CANCEL_INFINITE_TIMEOUT.
  636. Return Value:
  637. RPC_S_OK - success.
  638. --*/
  639. typedef RPC_TRANS_STATUS
  640. (RPC_ENTRY * TRANS_CLIENT_SENDRECEIVE) (
  641. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  642. IN void PAPI * SendBuffer,
  643. IN unsigned int SendBufferLength,
  644. IN OUT void PAPI * PAPI * ReceiveBuffer,
  645. IN OUT unsigned int PAPI * ReceiveBufferLength
  646. );
  647. /*++
  648. Routine Description:
  649. Arguments:
  650. ThisConnection - Supplies the connection to be sent on and then received
  651. from. The connection is specified as a pointer to memory containing
  652. transport interface module level information about the connection.
  653. SendBuffer - Supplies a buffer containing the packet to be sent to the
  654. server.
  655. SendBufferLength - Supplies the length of the send buffer in bytes.
  656. ReceiveBuffer - Supplies a preallocated buffer to the receive the packet
  657. into if it will fit. If the packet does not fit, the transport
  658. interface module must allocate a larger buffer which will hold the
  659. entire packet. The buffer will contain the packet upon return.
  660. ReceiveBufferLength - Supplies the length of the preallocated receive
  661. buffer in bytes and returns the length of the received packet in bytes.
  662. Return Value:
  663. RPC_S_OK - The packet was successfully sent to the server, and we
  664. successfully received one back.
  665. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to perform the
  666. operation. The connection will not have been closed if this error
  667. occurs.
  668. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to perform
  669. the operation. The connection will not have been closed if this
  670. error occurs.
  671. RPC_P_SEND_FAILED - The send operation failed. The connection
  672. will have been closed, so the close operation must not be performed
  673. on the connection after this error code has been returned.
  674. RPC_P_RECEIVE_FAILED - The receive operation failed. The connection
  675. will have been closed, so the close operation must not be performed
  676. on the connection after this error code has been returned.
  677. --*/
  678. typedef RPC_TRANS_STATUS
  679. (RPC_ENTRY * TRANS_CLIENT_RECEIVE_WITH_TIMEOUT) (
  680. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  681. IN OUT void PAPI * PAPI * Buffer,
  682. IN OUT unsigned int PAPI * BufferLength,
  683. IN unsigned long dwTimeout
  684. );
  685. /*++
  686. Routine Description:
  687. Arguments:
  688. ThisConnection - Supplies the connection to be received from. The
  689. connection is specified as a pointer to memory containing tranport
  690. interface module level information about the connection.
  691. Buffer - Supplies a preallocated buffer to the receive the packet into
  692. if it will fit. If the packet does not fit, the transport interface
  693. module must allocate a larger buffer which will hold the entire
  694. packet. The buffer will contain the packet upon return.
  695. BufferLength - Supplies the length of the preallocated buffer in bytes
  696. and returns the length of the received packet in bytes.
  697. dwTimeout - Receive Timeout
  698. Return Value:
  699. RPC_S_OK - A packet was successfully received from the server.
  700. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to allocate a
  701. buffer to receive the packet into. The connection will not have
  702. been closed if this error occurs.
  703. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to perform
  704. the operation. The connection will not have been closed if this
  705. error occurs.
  706. RPC_P_RECEIVE_FAILED - The receive operation failed. The connection
  707. will have been closed, so the close operation must not be performed
  708. on the connection after this error code has been returned.
  709. --*/
  710. typedef RPC_TRANS_STATUS
  711. (RPC_ENTRY * TRANS_CLIENT_SENDRECEIVE_WITH_TIMEOUT) (
  712. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  713. IN void PAPI * SendBuffer,
  714. IN unsigned int SendBufferLength,
  715. IN OUT void PAPI * PAPI * ReceiveBuffer,
  716. IN OUT unsigned int PAPI * ReceiveBufferLength,
  717. IN unsigned long dwTimeout
  718. );
  719. /*++
  720. Routine Description:
  721. Arguments:
  722. ThisConnection - Supplies the connection to be sent on and then received
  723. from. The connection is specified as a pointer to memory containing
  724. transport interface module level information about the connection.
  725. SendBuffer - Supplies a buffer containing the packet to be sent to the
  726. server.
  727. SendBufferLength - Supplies the length of the send buffer in bytes.
  728. ReceiveBuffer - Supplies a preallocated buffer to the receive the packet
  729. into if it will fit. If the packet does not fit, the transport
  730. interface module must allocate a larger buffer which will hold the
  731. entire packet. The buffer will contain the packet upon return.
  732. ReceiveBufferLength - Supplies the length of the preallocated receive
  733. buffer in bytes and returns the length of the received packet in bytes.
  734. dwTimeout - Receive Timeout
  735. Return Value:
  736. RPC_S_OK - The packet was successfully sent to the server, and we
  737. successfully received one back.
  738. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to perform the
  739. operation. The connection will not have been closed if this error
  740. occurs.
  741. RPC_S_OUT_OF_RESOURCES - Insufficient resources are available to perform
  742. the operation. The connection will not have been closed if this
  743. error occurs.
  744. RPC_P_SEND_FAILED - The send operation failed. The connection
  745. will have been closed, so the close operation must not be performed
  746. on the connection after this error code has been returned.
  747. RPC_P_RECEIVE_FAILED - The receive operation failed. The connection
  748. will have been closed, so the close operation must not be performed
  749. on the connection after this error code has been returned.
  750. --*/
  751. typedef RPC_TRANS_STATUS
  752. (RPC_ENTRY * TRANS_CLIENT_TOWERCONSTRUCT) (
  753. IN char PAPI * Endpoint,
  754. IN char PAPI * NetworkAddress,
  755. OUT unsigned short PAPI * Floors,
  756. OUT unsigned long PAPI * ByteCount,
  757. OUT unsigned char PAPI * PAPI * Tower,
  758. IN char PAPI * Protseq
  759. );
  760. /*++
  761. Routine Description:
  762. Arguments:
  763. Endpoint - Supplies the Endpoint that needs to be encoded into the tower
  764. NetworkAddress - Supplies the Network Address that needs to be encoded into
  765. the tower.
  766. Floors - The transport will return the number of floors it encoded here.
  767. ByteCount - This field specifies the size of the "upper-transport-specific"
  768. tower that is encoded and returned by the transport.
  769. Tower - The encoded "upper tower" that is returned by the transport. Memory
  770. for this is allocated by the transport and must be freed by the
  771. caller.
  772. Return Value:
  773. RPC_S_OK - The packet was successfully sent to the server, and we
  774. successfully received one back.
  775. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to perform the
  776. operation. The connection will not have been closed if this error
  777. occurs.
  778. --*/
  779. typedef RPC_TRANS_STATUS
  780. (RPC_ENTRY * TRANS_CLIENT_TOWEREXPLODE) (
  781. IN unsigned char PAPI * Tower,
  782. OUT char PAPI * PAPI * Protseq,
  783. OUT char PAPI * PAPI * Endpoint,
  784. OUT char PAPI * PAPI * NetworkAddress
  785. );
  786. /*++
  787. Routine Description:
  788. Arguments:
  789. Tower - The encoded "upper tower" that needs to be parsed by the transport.
  790. Endpoint - ASCII Endpoint returned by the transport.
  791. NetworkAddress - ASCII NW Addressed returned by the transport.
  792. Return Value:
  793. RPC_S_OK - The packet was successfully sent to the server, and we
  794. successfully received one back.
  795. RPC_S_OUT_OF_MEMORY - Insufficient memory is available to perform the
  796. operation. The connection will not have been closed if this error
  797. occurs.
  798. --*/
  799. typedef struct _RPC_CLIENT_TRANSPORT_INFO
  800. {
  801. unsigned short TransInterfaceVersion;
  802. unsigned short TransId;
  803. // BUGBUG
  804. //
  805. // TowerConstruct and TowerExplode must be at the same offset in both
  806. // connection and datagram transport info structures. They are used
  807. // by OsfTowerConstruct, which ignores the fact that c/o and DG use
  808. // different structures.
  809. //
  810. TRANS_CLIENT_TOWERCONSTRUCT TowerConstruct;
  811. TRANS_CLIENT_TOWEREXPLODE TowerExplode;
  812. unsigned MaximumPacketSize;
  813. unsigned SizeOfConnection;
  814. TRANS_CLIENT_OPEN Open;
  815. TRANS_CLIENT_CLOSE Close;
  816. TRANS_CLIENT_SEND Send;
  817. TRANS_CLIENT_RECEIVE Receive;
  818. TRANS_CLIENT_SENDRECEIVE SendReceive;
  819. TRANS_CLIENT_SET_TIMEOUT SetTimeout;
  820. TRANS_CLIENT_RECEIVE_WITH_TIMEOUT ReceiveWithTimeout ;
  821. TRANS_CLIENT_SENDRECEIVE_WITH_TIMEOUT SendReceiveWithTimeout ;
  822. } RPC_CLIENT_TRANSPORT_INFO;
  823. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_TRANSPORT_UNLOAD)();
  824. /*++
  825. Routine Description:
  826. Destructor for the server transport.
  827. Arguments:
  828. <none>
  829. Return Value:
  830. <none>
  831. --*/
  832. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_RECEIVE_PACKET) (
  833. IN void __RPC_FAR * Endpoint,
  834. IN void __RPC_FAR * Buffer,
  835. IN unsigned long __RPC_FAR * BufferLength,
  836. IN unsigned long Timeout,
  837. IN void __RPC_FAR * ServerAddress
  838. );
  839. /*++
  840. Routine Description:
  841. Receives a packet from the transport address the passed packet is
  842. associated with.
  843. Arguments:
  844. pTransAddress - Server's transport address information.
  845. LargestPacketSize - Size of largest packet we can accept.
  846. pNcaPacketHeader - Pointer to buffer to place incoming pkt into.
  847. pDataLength - Number of bytes read in.
  848. pTimeReceived - Time the data was read in.
  849. Timeout - Receive timeout in milliseconds.
  850. ppFrom - Pointer to the client address structure.
  851. Return Value:
  852. RPC_S_OK
  853. <return from MapStatusCode>
  854. --*/
  855. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_REGISTER_CALL) (
  856. IN void __RPC_FAR * pClientCall,
  857. IN RPC_CHAR __RPC_FAR * Server,
  858. IN RPC_CHAR __RPC_FAR * Endpoint,
  859. OUT void __RPC_FAR * __RPC_FAR* ppTransAddress
  860. );
  861. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_DEREGISTER_CALL) (
  862. IN void __RPC_FAR * pTransAddress
  863. );
  864. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_SEND_PACKET) (
  865. IN void __RPC_FAR * Endpoint,
  866. IN void __RPC_FAR * Buffer,
  867. IN unsigned long BufferLength,
  868. IN BOOL Broadcast,
  869. IN void __RPC_FAR * pTransAddress
  870. );
  871. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_ASSIGN_ENDPOINT) (
  872. IN void __RPC_FAR * Endpoint
  873. );
  874. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_FREE_ENDPOINT) (
  875. IN void __RPC_FAR * Endpoint
  876. );
  877. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_TRANSLATE_CLIENT_ENDPOINT)
  878. (
  879. IN void PAPI * pBinaryEndpoint,
  880. OUT RPC_CHAR PAPI * pClientEndpoint
  881. );
  882. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_SET_BUFFER_LENGTH)
  883. (
  884. IN void PAPI * pBinaryEndpoint,
  885. IN unsigned Length
  886. );
  887. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_INQ_BUFFER_LENGTH)
  888. (
  889. IN void __RPC_FAR * pBinaryEndpoint,
  890. IN unsigned __RPC_FAR * Length
  891. );
  892. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_CLIENT_BEGIN_CALL)
  893. (
  894. IN void __RPC_FAR * Endpoint,
  895. IN void __RPC_FAR * Connection
  896. );
  897. typedef void (RPC_ENTRY * DG_TRANS_CLIENT_END_CALL)
  898. (
  899. IN void __RPC_FAR * Endpoint
  900. );
  901. typedef struct _DG_RPC_CLIENT_TRANSPORT_INFO
  902. {
  903. unsigned short TransInterfaceVersion;
  904. unsigned short TransId;
  905. // BUGBUG
  906. //
  907. // TowerConstruct and TowerExplode must be at the same offset in both
  908. // connection and datagram transport info structures. They are used
  909. // by OsfTowerConstruct, which ignores the fact that c/o and DG use
  910. // different structures.
  911. //
  912. TRANS_CLIENT_TOWERCONSTRUCT TowerConstruct;
  913. TRANS_CLIENT_TOWEREXPLODE TowerExplode;
  914. unsigned short AddressSize;
  915. unsigned short EndpointSize;
  916. unsigned short EndpointStringSize;
  917. void __RPC_FAR *EndpointManager;
  918. DG_TRANS_CLIENT_TRANSPORT_UNLOAD TransportUnload;
  919. DG_TRANS_CLIENT_RECEIVE_PACKET ReceivePacket;
  920. DG_TRANS_CLIENT_SEND_PACKET Send;
  921. DG_TRANS_CLIENT_REGISTER_CALL RegisterCall;
  922. DG_TRANS_CLIENT_DEREGISTER_CALL DeregisterCall;
  923. DG_TRANS_CLIENT_ASSIGN_ENDPOINT AssignEndpoint;
  924. DG_TRANS_CLIENT_FREE_ENDPOINT FreeEndpoint;
  925. DG_TRANS_CLIENT_TRANSLATE_CLIENT_ENDPOINT GetEndpoint;
  926. DG_TRANS_CLIENT_SET_BUFFER_LENGTH SetBufferLength;
  927. DG_TRANS_CLIENT_INQ_BUFFER_LENGTH InqBufferLength;
  928. DG_TRANS_CLIENT_BEGIN_CALL BeginCall;
  929. DG_TRANS_CLIENT_END_CALL EndCall;
  930. unsigned short BaselinePduSize;
  931. unsigned short PreferredPduSize;
  932. unsigned short MaxPduSize;
  933. unsigned short MaxPacketSize;
  934. unsigned DefaultBufferLength;
  935. } DG_RPC_CLIENT_TRANSPORT_INFO;
  936. typedef DG_RPC_CLIENT_TRANSPORT_INFO PAPI * PDG_RPC_CLIENT_TRANSPORT_INFO;
  937. #define MAX_ANY_ENDPOINT_STRING 128
  938. /*++
  939. DG_SERVER_DG_TRANS_ADDRESS Description:
  940. This structure represents a network address. It is used on the server side
  941. to identify an endpoint; it is used on the client side to identify a
  942. binding.
  943. Fields:
  944. pServerAddress - Pointer back to the DG_ADDRESS object that is associated
  945. with this.
  946. pTsap - The transport service access point we will receive on. IE: socket.
  947. --*/
  948. typedef struct
  949. {
  950. void * pServerAddress;
  951. void * pTsap;
  952. } DG_SERVER_TRANS_ADDRESS;
  953. typedef DG_SERVER_TRANS_ADDRESS * PDG_SERVER_TRANS_ADDRESS;
  954. /*++
  955. DG_DG_TRANS_CLIENT_HANDLE Description:
  956. This structure represents a network address. It is used on the server side
  957. to identify an endpoint; it is used on the client side to identify a
  958. binding.
  959. Fields:
  960. pTransAddress - The transport address that the client is talking on.
  961. pFrom - The client port address we are receiveing from. IE: sockaddr
  962. typedef struct _DG_DG_TRANS_CLIENT_HANDLE{
  963. void * pTransAddress;
  964. void * pFrom;
  965. }DG_DG_TRANS_CLIENT_HANDLE;
  966. --*/
  967. typedef void * PDG_TRANS_CLIENT_ENDPOINT;
  968. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_TRANSPORT_UNLOAD)
  969. (
  970. );
  971. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_RECEIVE_PACKET)
  972. (
  973. IN void __RPC_FAR * pAddress,
  974. PDG_SERVER_TRANS_ADDRESS pTransAddress,
  975. unsigned long LargestPacketSize,
  976. char * pNcaPacketHeader,
  977. unsigned * pDataLength,
  978. unsigned long Timeout,
  979. void * pClientEndpoint
  980. );
  981. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_FORWARD_PACKET)
  982. (
  983. IN PDG_SERVER_TRANS_ADDRESS pTransAddress,
  984. IN char * pNcaPacketHeader,
  985. IN unsigned long DataLength,
  986. void * pEndpoint
  987. );
  988. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_REGISTER_ENDPOINT)
  989. (
  990. IN void * pServerAddress,
  991. IN RPC_CHAR * pEndpoint,
  992. OUT PDG_SERVER_TRANS_ADDRESS * ppTransAddress,
  993. OUT RPC_CHAR PAPI * lNetworkAddress,
  994. OUT unsigned int PAPI * NumNetworkAddress,
  995. IN unsigned int NetworkAddressLength,
  996. IN unsigned long EndpointFlags,
  997. IN unsigned long NICFlags
  998. );
  999. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_DEREGISTER_ENDPOINT)
  1000. (
  1001. IN OUT PDG_SERVER_TRANS_ADDRESS * pServerTransAddress
  1002. );
  1003. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_REGISTER_ANY_ENDPOINT)
  1004. (
  1005. IN void * pServerAddress,
  1006. OUT RPC_CHAR * pEndpointName,
  1007. OUT PDG_SERVER_TRANS_ADDRESS * ppServerTransAddress,
  1008. OUT RPC_CHAR PAPI * lNetworkAddress,
  1009. OUT unsigned int PAPI * NumNetworkAddress,
  1010. IN unsigned int NetworkAddressLength,
  1011. IN unsigned int EndpointLength,
  1012. IN unsigned long EndpointFlags,
  1013. IN unsigned long NICFlags
  1014. );
  1015. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_SEND_PACKET_BACK)
  1016. (
  1017. IN PDG_SERVER_TRANS_ADDRESS pTransAddress,
  1018. IN char * pNcaPacketHeader,
  1019. IN unsigned DataLength,
  1020. void * pClientEndpoint
  1021. );
  1022. typedef void (RPC_ENTRY * DG_TRANS_SERVER_CLOSE_CLIENT_ENDPOINT)
  1023. (
  1024. IN void * pHandle
  1025. );
  1026. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_TRANSLATE_CLIENT_ADDRESS)
  1027. (
  1028. IN void * pClientEndpoint,
  1029. OUT RPC_CHAR * pClientAddress
  1030. );
  1031. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_TRANSLATE_CLIENT_ENDPOINT)
  1032. (
  1033. IN void * pBinaryEndpoint,
  1034. OUT RPC_CHAR * pClientEndpoint
  1035. );
  1036. typedef RPC_STATUS (RPC_ENTRY * TRANS_SERVER_START_LISTENING)
  1037. (
  1038. IN PDG_SERVER_TRANS_ADDRESS pTransAddress
  1039. );
  1040. typedef RPC_STATUS (RPC_ENTRY * DG_TRANS_SERVER_SET_BUFFER_LENGTH)
  1041. (
  1042. IN void PAPI * pBinaryEndpoint,
  1043. IN unsigned Length
  1044. );
  1045. typedef struct _DG_RPC_SERVER_TRANSPORT_INFO
  1046. {
  1047. unsigned short TransInterfaceVersion;
  1048. unsigned int SizeOfAddress;
  1049. unsigned int SizeOfConnection;
  1050. unsigned SizeOfAddressString;
  1051. unsigned SizeOfEndpointString;
  1052. DG_TRANS_SERVER_TRANSPORT_UNLOAD TransportUnload;
  1053. DG_TRANS_SERVER_RECEIVE_PACKET ReceivePacket;
  1054. DG_TRANS_SERVER_REGISTER_ENDPOINT RegisterEndpoint;
  1055. DG_TRANS_SERVER_DEREGISTER_ENDPOINT DeregisterEndpoint;
  1056. DG_TRANS_SERVER_REGISTER_ANY_ENDPOINT RegisterAnyEndpoint;
  1057. DG_TRANS_SERVER_SEND_PACKET_BACK SendPacketBack;
  1058. DG_TRANS_SERVER_FORWARD_PACKET ForwardPacket;
  1059. DG_TRANS_SERVER_CLOSE_CLIENT_ENDPOINT CloseClientEndpoint;
  1060. DG_TRANS_SERVER_TRANSLATE_CLIENT_ADDRESS TranslateClientAddress;
  1061. DG_TRANS_SERVER_TRANSLATE_CLIENT_ENDPOINT TranslateClientEndpoint;
  1062. TRANS_SERVER_START_LISTENING StartListening;
  1063. DG_TRANS_SERVER_SET_BUFFER_LENGTH SetBufferLength;
  1064. unsigned short BaselinePduSize;
  1065. unsigned short PreferredPduSize;
  1066. unsigned short MaxPduSize;
  1067. unsigned short MaxPacketSize;
  1068. } DG_RPC_SERVER_TRANSPORT_INFO;
  1069. typedef DG_RPC_SERVER_TRANSPORT_INFO PAPI * PDG_RPC_SERVER_TRANSPORT_INFO;
  1070. RPC_STATUS RPC_ENTRY
  1071. I_RpcTransClientReallocBuffer (
  1072. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  1073. IN OUT void PAPI * PAPI * Buffer,
  1074. IN unsigned int OldBufferLength,
  1075. IN unsigned int NewBufferLength
  1076. );
  1077. unsigned short RPC_ENTRY
  1078. I_RpcTransClientMaxFrag (
  1079. IN RPC_TRANSPORT_CONNECTION ThisConnection
  1080. );
  1081. RPC_STATUS RPC_ENTRY
  1082. I_RpcIOAlerted(
  1083. IN RPC_TRANSPORT_CONNECTION TransportConnection
  1084. );
  1085. #ifdef NTENV
  1086. HANDLE RPC_ENTRY
  1087. I_RpcGetThreadEvent();
  1088. RPC_STATUS RPC_ENTRY
  1089. I_RpcServerAllocatePort(
  1090. IN unsigned long flags,
  1091. IN unsigned short *pport);
  1092. #endif
  1093. #ifdef __RPC_WIN16__
  1094. typedef RPC_STATUS
  1095. (RPC_ENTRY * RPC_TRANS_CLIENT_REALLOC_BUFFER) (
  1096. IN RPC_TRANSPORT_CONNECTION ThisConnection,
  1097. IN OUT void PAPI * PAPI * Buffer,
  1098. IN unsigned int OldBufferLength,
  1099. IN unsigned int NewBufferLength
  1100. );
  1101. typedef HANDLE
  1102. (PAPI PASCAL * RPC_WIN_ASYNC_CALL_BEGIN) (
  1103. IN LPVOID lpContext
  1104. );
  1105. typedef int
  1106. (PAPI PASCAL * RPC_WIN_ASYNC_CALL_WAIT) (
  1107. IN HANDLE hCall,
  1108. IN HWND hDallyWnd,
  1109. IN unsigned long Timeout
  1110. );
  1111. typedef void
  1112. (PAPI PASCAL * RPC_WIN_ASYNC_CALL_END) (
  1113. IN HANDLE hCall
  1114. );
  1115. typedef void
  1116. (PAPI PASCAL * RPC_WIN_ASYNC_CALL_COMPLETE) (
  1117. IN LPVOID lpContext
  1118. );
  1119. typedef __RPC_FAR *
  1120. (RPC_ENTRY * RPC_ALLOCATE) (
  1121. IN unsigned int Size
  1122. );
  1123. typedef void
  1124. (RPC_ENTRY * RPC_FREE) (
  1125. IN void __RPC_FAR * Object
  1126. );
  1127. typedef long
  1128. (__far __pascal * RPC_REG_CLOSE_KEY) (
  1129. void __far * Key
  1130. );
  1131. typedef long
  1132. (__far __pascal * RPC_REG_OPEN_KEY) (
  1133. void __far * Key,
  1134. const char __far * SubKey,
  1135. void __far * __far * Result
  1136. );
  1137. typedef long
  1138. (__far __pascal * RPC_REG_QUERY_VALUE) (
  1139. void __far * Key,
  1140. const char __far * SubKey,
  1141. const char __far * Value,
  1142. unsigned long __far * ValueLength
  1143. );
  1144. typedef unsigned
  1145. (__far __pascal * RPC_WIN_IS_TASK_YIELDING) (
  1146. IN HANDLE hCall
  1147. );
  1148. typedef BOOL
  1149. (PASCAL FAR * WIN_DLL_AT_EXIT) (
  1150. void * exitfunc
  1151. );
  1152. #define RPC_WIN_CALLBACK_INFO_VERSION 1
  1153. #define RPC_WIN_INFINITE_TIMEOUT (~0UL)
  1154. #define RPC_WIN_WAIT_ABORTED 0
  1155. #define RPC_WIN_WAIT_SUCCESS 1
  1156. #define RPC_WIN_WAIT_TIMEOUT 2
  1157. typedef struct _RPC_CLIENT_RUNTIME_INFO
  1158. {
  1159. unsigned Version;
  1160. RPC_TRANS_CLIENT_REALLOC_BUFFER ReallocBuffer;
  1161. RPC_WIN_ASYNC_CALL_BEGIN AsyncCallBegin;
  1162. RPC_WIN_ASYNC_CALL_WAIT AsyncCallWait;
  1163. RPC_WIN_ASYNC_CALL_END AsyncCallEnd;
  1164. RPC_WIN_ASYNC_CALL_COMPLETE AsyncCallComplete;
  1165. RPC_WIN_IS_TASK_YIELDING TaskYielding;
  1166. RPC_ALLOCATE Allocate;
  1167. RPC_FREE Free;
  1168. RPC_REG_OPEN_KEY RegOpenKey;
  1169. RPC_REG_CLOSE_KEY RegCloseKey;
  1170. RPC_REG_QUERY_VALUE RegQueryValue;
  1171. unsigned short TaskExiting;
  1172. WIN_DLL_AT_EXIT WinDLLAtExit ;
  1173. } RPC_CLIENT_RUNTIME_INFO;
  1174. typedef RPC_CLIENT_TRANSPORT_INFO PAPI *
  1175. (RPC_ENTRY * TRANS_CLIENT_INIT_ROUTINE) (
  1176. IN RPC_CHAR PAPI * RpcProtocolSequence,
  1177. IN RPC_CLIENT_RUNTIME_INFO PAPI * RpcRuntimeInfo
  1178. );
  1179. #else // __RPC_WIN16__
  1180. typedef RPC_CLIENT_TRANSPORT_INFO PAPI *
  1181. (RPC_ENTRY * TRANS_CLIENT_INIT_ROUTINE) (
  1182. IN RPC_CHAR PAPI * RpcProtocolSequence
  1183. );
  1184. #endif // __RPC_WIN16__
  1185. typedef RPC_SERVER_TRANSPORT_INFO PAPI *
  1186. (RPC_ENTRY * TRANS_SERVER_INIT_ROUTINE) (
  1187. IN RPC_CHAR PAPI * RpcProtocolSequence
  1188. );
  1189. #ifdef DOS
  1190. typedef int (*AT_EXIT)(void);
  1191. void RPC_ENTRY I_DosAtExit(AT_EXIT);
  1192. #endif // DOS
  1193. #if defined(DOS) && !defined(WIN)
  1194. #pragma warning(default:4147)
  1195. #endif
  1196. #ifdef __cplusplus
  1197. }
  1198. #endif
  1199. #endif // __RPCTRAN_H__