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.

365 lines
8.1 KiB

  1. /*++
  2. Copyright (c) 1991-1995 Microsoft Corporation
  3. Module Name:
  4. rpcdcep.h
  5. Abstract:
  6. This module contains the private RPC runtime APIs for use by the
  7. stubs and by support libraries. Applications must not call these
  8. routines.
  9. --*/
  10. #ifndef __RPCDCEP_H__
  11. #define __RPCDCEP_H__
  12. // Set the packing level for RPC structures for Dos and Windows.
  13. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  14. #pragma pack(2)
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. typedef struct _RPC_VERSION {
  20. unsigned short MajorVersion;
  21. unsigned short MinorVersion;
  22. } RPC_VERSION;
  23. typedef struct _RPC_SYNTAX_IDENTIFIER {
  24. GUID SyntaxGUID;
  25. RPC_VERSION SyntaxVersion;
  26. } RPC_SYNTAX_IDENTIFIER, __RPC_FAR * PRPC_SYNTAX_IDENTIFIER;
  27. typedef struct _RPC_MESSAGE
  28. {
  29. RPC_BINDING_HANDLE Handle;
  30. unsigned long DataRepresentation;
  31. void __RPC_FAR * Buffer;
  32. unsigned int BufferLength;
  33. unsigned int ProcNum;
  34. PRPC_SYNTAX_IDENTIFIER TransferSyntax;
  35. void __RPC_FAR * RpcInterfaceInformation;
  36. void __RPC_FAR * ReservedForRuntime;
  37. RPC_MGR_EPV __RPC_FAR * ManagerEpv;
  38. void __RPC_FAR * ImportContext;
  39. unsigned long RpcFlags;
  40. } RPC_MESSAGE, __RPC_FAR * PRPC_MESSAGE;
  41. typedef RPC_STATUS RPC_FORWARD_FUNCTION(
  42. IN UUID __RPC_FAR * InterfaceId,
  43. IN RPC_VERSION __RPC_FAR * InterfaceVersion,
  44. IN UUID __RPC_FAR * ObjectId,
  45. IN unsigned char __RPC_FAR * Rpcpro,
  46. IN void __RPC_FAR * __RPC_FAR * ppDestEndpoint);
  47. /*
  48. * Types of function calls for datagram and COM rpc
  49. */
  50. #define RPC_NCA_FLAGS_DEFAULT 0x00000000 /* 0b000...000 */
  51. #define RPC_NCA_FLAGS_IDEMPOTENT 0x00000001 /* 0b000...001 */
  52. #define RPC_NCA_FLAGS_BROADCAST 0x00000002 /* 0b000...010 */
  53. #define RPC_NCA_FLAGS_MAYBE 0x00000004 /* 0b000...100 */
  54. #define RPCFLG_ASYNCHRONOUS 0x40000000UL
  55. #define RPCFLG_INPUT_SYNCHRONOUS 0x20000000UL
  56. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  57. #define RPC_FLAGS_VALID_BIT 0x8000
  58. #endif
  59. #if defined(__RPC_WIN32__) || defined(__RPC_MAC__)
  60. #define RPC_FLAGS_VALID_BIT 0x00008000
  61. #endif
  62. typedef
  63. void
  64. (__RPC_STUB __RPC_FAR * RPC_DISPATCH_FUNCTION) (
  65. IN OUT PRPC_MESSAGE Message
  66. );
  67. typedef struct {
  68. unsigned int DispatchTableCount;
  69. RPC_DISPATCH_FUNCTION __RPC_FAR * DispatchTable;
  70. int Reserved;
  71. } RPC_DISPATCH_TABLE, __RPC_FAR * PRPC_DISPATCH_TABLE;
  72. typedef struct _RPC_PROTSEQ_ENDPOINT
  73. {
  74. unsigned char __RPC_FAR * RpcProtocolSequence;
  75. unsigned char __RPC_FAR * Endpoint;
  76. } RPC_PROTSEQ_ENDPOINT, __RPC_FAR * PRPC_PROTSEQ_ENDPOINT;
  77. /*
  78. Both of these types MUST start with the InterfaceId and TransferSyntax.
  79. Look at RpcIfInqId and I_RpcIfInqTransferSyntaxes to see why.
  80. */
  81. typedef struct _RPC_SERVER_INTERFACE
  82. {
  83. unsigned int Length;
  84. RPC_SYNTAX_IDENTIFIER InterfaceId;
  85. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  86. PRPC_DISPATCH_TABLE DispatchTable;
  87. unsigned int RpcProtseqEndpointCount;
  88. PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
  89. RPC_MGR_EPV __RPC_FAR *DefaultManagerEpv;
  90. void const __RPC_FAR *InterpreterInfo;
  91. } RPC_SERVER_INTERFACE, __RPC_FAR * PRPC_SERVER_INTERFACE;
  92. typedef struct _RPC_CLIENT_INTERFACE
  93. {
  94. unsigned int Length;
  95. RPC_SYNTAX_IDENTIFIER InterfaceId;
  96. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  97. PRPC_DISPATCH_TABLE DispatchTable;
  98. unsigned int RpcProtseqEndpointCount;
  99. PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
  100. unsigned long Reserved;
  101. void const __RPC_FAR * InterpreterInfo;
  102. } RPC_CLIENT_INTERFACE, __RPC_FAR * PRPC_CLIENT_INTERFACE;
  103. RPC_STATUS RPC_ENTRY
  104. I_RpcGetBuffer (
  105. IN OUT RPC_MESSAGE __RPC_FAR * Message
  106. );
  107. RPC_STATUS RPC_ENTRY
  108. I_RpcSendReceive (
  109. IN OUT RPC_MESSAGE __RPC_FAR * Message
  110. );
  111. RPC_STATUS RPC_ENTRY
  112. I_RpcFreeBuffer (
  113. IN OUT RPC_MESSAGE __RPC_FAR * Message
  114. );
  115. typedef void * I_RPC_MUTEX;
  116. void RPC_ENTRY
  117. I_RpcRequestMutex (
  118. IN OUT I_RPC_MUTEX * Mutex
  119. );
  120. void RPC_ENTRY
  121. I_RpcClearMutex (
  122. IN I_RPC_MUTEX Mutex
  123. );
  124. void RPC_ENTRY
  125. I_RpcDeleteMutex (
  126. IN I_RPC_MUTEX Mutex
  127. );
  128. void __RPC_FAR * RPC_ENTRY
  129. I_RpcAllocate (
  130. IN unsigned int Size
  131. );
  132. void RPC_ENTRY
  133. I_RpcFree (
  134. IN void __RPC_FAR * Object
  135. );
  136. void RPC_ENTRY
  137. I_RpcPauseExecution (
  138. IN unsigned long Milliseconds
  139. );
  140. typedef
  141. void
  142. (__RPC_USER __RPC_FAR * PRPC_RUNDOWN) (
  143. void __RPC_FAR * AssociationContext
  144. );
  145. RPC_STATUS RPC_ENTRY
  146. I_RpcMonitorAssociation (
  147. IN RPC_BINDING_HANDLE Handle,
  148. IN PRPC_RUNDOWN RundownRoutine,
  149. IN void * Context
  150. );
  151. RPC_STATUS RPC_ENTRY
  152. I_RpcStopMonitorAssociation (
  153. IN RPC_BINDING_HANDLE Handle
  154. );
  155. RPC_BINDING_HANDLE RPC_ENTRY
  156. I_RpcGetCurrentCallHandle(
  157. void
  158. );
  159. RPC_STATUS RPC_ENTRY
  160. I_RpcGetAssociationContext (
  161. OUT void __RPC_FAR * __RPC_FAR * AssociationContext
  162. );
  163. RPC_STATUS RPC_ENTRY
  164. I_RpcSetAssociationContext (
  165. IN void __RPC_FAR * AssociationContext
  166. );
  167. #ifdef __RPC_NT__
  168. RPC_STATUS RPC_ENTRY
  169. I_RpcNsBindingSetEntryName (
  170. IN RPC_BINDING_HANDLE Binding,
  171. IN unsigned long EntryNameSyntax,
  172. IN unsigned short __RPC_FAR * EntryName
  173. );
  174. #else
  175. RPC_STATUS RPC_ENTRY
  176. I_RpcNsBindingSetEntryName (
  177. IN RPC_BINDING_HANDLE Binding,
  178. IN unsigned long EntryNameSyntax,
  179. IN unsigned char __RPC_FAR * EntryName
  180. );
  181. #endif
  182. #ifdef __RPC_NT__
  183. RPC_STATUS RPC_ENTRY
  184. I_RpcBindingInqDynamicEndpoint (
  185. IN RPC_BINDING_HANDLE Binding,
  186. OUT unsigned short __RPC_FAR * __RPC_FAR * DynamicEndpoint
  187. );
  188. #else
  189. RPC_STATUS RPC_ENTRY
  190. I_RpcBindingInqDynamicEndpoint (
  191. IN RPC_BINDING_HANDLE Binding,
  192. OUT unsigned char __RPC_FAR * __RPC_FAR * DynamicEndpoint
  193. );
  194. #endif
  195. #define TRANSPORT_TYPE_CN 0x1
  196. #define TRANSPORT_TYPE_DG 0x2
  197. #define TRANSPORT_TYPE_LPC 0x4
  198. #define TRANSPORT_TYPE_WMSG 0x8
  199. RPC_STATUS RPC_ENTRY
  200. I_RpcBindingInqTransportType (
  201. IN RPC_BINDING_HANDLE Binding,
  202. OUT unsigned int __RPC_FAR * Type
  203. );
  204. typedef struct _RPC_TRANSFER_SYNTAX
  205. {
  206. UUID Uuid;
  207. unsigned short VersMajor;
  208. unsigned short VersMinor;
  209. } RPC_TRANSFER_SYNTAX;
  210. RPC_STATUS RPC_ENTRY
  211. I_RpcIfInqTransferSyntaxes (
  212. IN RPC_IF_HANDLE RpcIfHandle,
  213. OUT RPC_TRANSFER_SYNTAX __RPC_FAR * TransferSyntaxes,
  214. IN unsigned int TransferSyntaxSize,
  215. OUT unsigned int __RPC_FAR * TransferSyntaxCount
  216. );
  217. RPC_STATUS RPC_ENTRY
  218. I_UuidCreate (
  219. OUT UUID __RPC_FAR * Uuid
  220. );
  221. RPC_STATUS RPC_ENTRY
  222. I_RpcBindingCopy (
  223. IN RPC_BINDING_HANDLE SourceBinding,
  224. OUT RPC_BINDING_HANDLE __RPC_FAR * DestinationBinding
  225. );
  226. RPC_STATUS RPC_ENTRY
  227. I_RpcBindingIsClientLocal (
  228. IN RPC_BINDING_HANDLE BindingHandle OPTIONAL,
  229. OUT unsigned int __RPC_FAR * ClientLocalFlag
  230. );
  231. void RPC_ENTRY
  232. I_RpcSsDontSerializeContext (
  233. void
  234. );
  235. RPC_STATUS RPC_ENTRY
  236. I_RpcServerRegisterForwardFunction (
  237. IN RPC_FORWARD_FUNCTION __RPC_FAR * pForwardFunction
  238. );
  239. #ifdef __RPC_WIN32__
  240. typedef
  241. RPC_STATUS
  242. (__RPC_USER __RPC_FAR * RPC_BLOCKING_FUNCTION) (
  243. IN void __RPC_FAR *RpcWindowHandle,
  244. IN void __RPC_FAR *Context
  245. );
  246. RPC_STATUS RPC_ENTRY
  247. I_RpcBindingSetAsync(
  248. IN RPC_BINDING_HANDLE Binding,
  249. IN RPC_BLOCKING_FUNCTION BlockingHook
  250. );
  251. RPC_STATUS RPC_ENTRY
  252. I_RpcAsyncSendReceive(
  253. IN OUT RPC_MESSAGE __RPC_FAR * Message,
  254. IN void __RPC_FAR * Context
  255. );
  256. RPC_STATUS RPC_ENTRY
  257. I_RpcGetThreadWindowHandle(
  258. OUT void __RPC_FAR * __RPC_FAR * WindowHandle
  259. );
  260. RPC_STATUS RPC_ENTRY
  261. I_RpcServerThreadPauseListening(
  262. );
  263. RPC_STATUS RPC_ENTRY
  264. I_RpcServerThreadContinueListening(
  265. );
  266. RPC_STATUS RPC_ENTRY
  267. I_RpcServerUnregisterEndpointA (
  268. IN unsigned char * Protseq,
  269. IN unsigned char * Endpoint
  270. );
  271. RPC_STATUS RPC_ENTRY
  272. I_RpcServerUnregisterEndpointW (
  273. IN unsigned short * Protseq,
  274. IN unsigned short * Endpoint
  275. );
  276. #ifdef UNICODE
  277. #define I_RpcServerUnregisterEndpoint I_RpcServerUnregisterEndpointW
  278. #else
  279. #define I_RpcServerUnregisterEndpoint I_RpcServerUnregisterEndpointA
  280. #endif
  281. #endif // __RPC_WIN32__
  282. #ifdef __cplusplus
  283. }
  284. #endif
  285. // Reset the packing level for Dos and Windows.
  286. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  287. #pragma pack()
  288. #endif
  289. #endif /* __RPCDCEP_H__ */