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.

466 lines
9.9 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_ENTRY 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 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 RPC_BUFFER_COMPLETE 0x00001000 /* used by pipes */
  55. #define RPC_BUFFER_PARTIAL 0x00002000 /* used by pipes */
  56. #define RPC_BUFFER_EXTRA 0x00004000 /* used by pipes */
  57. #define RPCFLG_ASYNCHRONOUS 0x40000000UL
  58. #define RPCFLG_INPUT_SYNCHRONOUS 0x20000000UL
  59. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  60. #define RPC_FLAGS_VALID_BIT 0x8000
  61. #endif
  62. #if defined(__RPC_WIN32__) || defined(__RPC_MAC__)
  63. #define RPC_FLAGS_VALID_BIT 0x00008000
  64. #endif
  65. typedef
  66. void
  67. (__RPC_STUB __RPC_FAR * RPC_DISPATCH_FUNCTION) (
  68. IN OUT PRPC_MESSAGE Message
  69. );
  70. typedef struct {
  71. unsigned int DispatchTableCount;
  72. RPC_DISPATCH_FUNCTION __RPC_FAR * DispatchTable;
  73. int Reserved;
  74. } RPC_DISPATCH_TABLE, __RPC_FAR * PRPC_DISPATCH_TABLE;
  75. typedef struct _RPC_PROTSEQ_ENDPOINT
  76. {
  77. unsigned char __RPC_FAR * RpcProtocolSequence;
  78. unsigned char __RPC_FAR * Endpoint;
  79. } RPC_PROTSEQ_ENDPOINT, __RPC_FAR * PRPC_PROTSEQ_ENDPOINT;
  80. /*
  81. Both of these types MUST start with the InterfaceId and TransferSyntax.
  82. Look at RpcIfInqId and I_RpcIfInqTransferSyntaxes to see why.
  83. */
  84. #define NT351_INTERFACE_SIZE 0x40
  85. #define RPC_INTERFACE_HAS_PIPES 0x0001
  86. typedef struct _RPC_SERVER_INTERFACE
  87. {
  88. unsigned int Length;
  89. RPC_SYNTAX_IDENTIFIER InterfaceId;
  90. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  91. PRPC_DISPATCH_TABLE DispatchTable;
  92. unsigned int RpcProtseqEndpointCount;
  93. PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
  94. RPC_MGR_EPV __RPC_FAR *DefaultManagerEpv;
  95. void const __RPC_FAR *InterpreterInfo;
  96. unsigned int Flags ;
  97. } RPC_SERVER_INTERFACE, __RPC_FAR * PRPC_SERVER_INTERFACE;
  98. typedef struct _RPC_CLIENT_INTERFACE
  99. {
  100. unsigned int Length;
  101. RPC_SYNTAX_IDENTIFIER InterfaceId;
  102. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  103. PRPC_DISPATCH_TABLE DispatchTable;
  104. unsigned int RpcProtseqEndpointCount;
  105. PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
  106. unsigned long Reserved;
  107. void const __RPC_FAR * InterpreterInfo;
  108. unsigned int Flags ;
  109. } RPC_CLIENT_INTERFACE, __RPC_FAR * PRPC_CLIENT_INTERFACE;
  110. RPC_STATUS RPC_ENTRY
  111. I_RpcGetBuffer (
  112. IN OUT RPC_MESSAGE __RPC_FAR * Message
  113. );
  114. RPC_STATUS RPC_ENTRY
  115. I_RpcSendReceive (
  116. IN OUT RPC_MESSAGE __RPC_FAR * Message
  117. );
  118. RPC_STATUS RPC_ENTRY
  119. I_RpcFreeBuffer (
  120. IN OUT RPC_MESSAGE __RPC_FAR * Message
  121. );
  122. RPC_STATUS RPC_ENTRY
  123. I_RpcSend (
  124. IN OUT PRPC_MESSAGE Message
  125. ) ;
  126. RPC_STATUS RPC_ENTRY
  127. I_RpcReceive (
  128. IN OUT PRPC_MESSAGE Message,
  129. IN unsigned int Size
  130. ) ;
  131. RPC_STATUS RPC_ENTRY
  132. I_RpcFreePipeBuffer (
  133. IN OUT RPC_MESSAGE __RPC_FAR * Message
  134. ) ;
  135. RPC_STATUS RPC_ENTRY
  136. I_RpcReallocPipeBuffer (
  137. IN PRPC_MESSAGE Message,
  138. IN unsigned int NewSize
  139. ) ;
  140. typedef void * I_RPC_MUTEX;
  141. void RPC_ENTRY
  142. I_RpcRequestMutex (
  143. IN OUT I_RPC_MUTEX * Mutex
  144. );
  145. void RPC_ENTRY
  146. I_RpcClearMutex (
  147. IN I_RPC_MUTEX Mutex
  148. );
  149. void RPC_ENTRY
  150. I_RpcDeleteMutex (
  151. IN I_RPC_MUTEX Mutex
  152. );
  153. void __RPC_FAR * RPC_ENTRY
  154. I_RpcAllocate (
  155. IN unsigned int Size
  156. );
  157. void RPC_ENTRY
  158. I_RpcFree (
  159. IN void __RPC_FAR * Object
  160. );
  161. void RPC_ENTRY
  162. I_RpcPauseExecution (
  163. IN unsigned long Milliseconds
  164. );
  165. typedef
  166. void
  167. (__RPC_USER __RPC_FAR * PRPC_RUNDOWN) (
  168. void __RPC_FAR * AssociationContext
  169. );
  170. RPC_STATUS RPC_ENTRY
  171. I_RpcMonitorAssociation (
  172. IN RPC_BINDING_HANDLE Handle,
  173. IN PRPC_RUNDOWN RundownRoutine,
  174. IN void * Context
  175. );
  176. RPC_STATUS RPC_ENTRY
  177. I_RpcStopMonitorAssociation (
  178. IN RPC_BINDING_HANDLE Handle
  179. );
  180. RPC_BINDING_HANDLE RPC_ENTRY
  181. I_RpcGetCurrentCallHandle(
  182. void
  183. );
  184. RPC_STATUS RPC_ENTRY
  185. I_RpcGetAssociationContext (
  186. OUT void __RPC_FAR * __RPC_FAR * AssociationContext
  187. );
  188. RPC_STATUS RPC_ENTRY
  189. I_RpcSetAssociationContext (
  190. IN void __RPC_FAR * AssociationContext
  191. );
  192. #ifdef __RPC_NT__
  193. RPC_STATUS RPC_ENTRY
  194. I_RpcNsBindingSetEntryName (
  195. IN RPC_BINDING_HANDLE Binding,
  196. IN unsigned long EntryNameSyntax,
  197. IN unsigned short __RPC_FAR * EntryName
  198. );
  199. #else
  200. RPC_STATUS RPC_ENTRY
  201. I_RpcNsBindingSetEntryName (
  202. IN RPC_BINDING_HANDLE Binding,
  203. IN unsigned long EntryNameSyntax,
  204. IN unsigned char __RPC_FAR * EntryName
  205. );
  206. #endif
  207. #ifdef __RPC_NT__
  208. RPC_STATUS RPC_ENTRY
  209. I_RpcBindingInqDynamicEndpoint (
  210. IN RPC_BINDING_HANDLE Binding,
  211. OUT unsigned short __RPC_FAR * __RPC_FAR * DynamicEndpoint
  212. );
  213. #else
  214. RPC_STATUS RPC_ENTRY
  215. I_RpcBindingInqDynamicEndpoint (
  216. IN RPC_BINDING_HANDLE Binding,
  217. OUT unsigned char __RPC_FAR * __RPC_FAR * DynamicEndpoint
  218. );
  219. #endif
  220. #define TRANSPORT_TYPE_CN 0x1
  221. #define TRANSPORT_TYPE_DG 0x2
  222. #define TRANSPORT_TYPE_LPC 0x4
  223. #define TRANSPORT_TYPE_WMSG 0x8
  224. RPC_STATUS RPC_ENTRY
  225. I_RpcBindingInqTransportType (
  226. IN RPC_BINDING_HANDLE Binding,
  227. OUT unsigned int __RPC_FAR * Type
  228. );
  229. typedef struct _RPC_TRANSFER_SYNTAX
  230. {
  231. UUID Uuid;
  232. unsigned short VersMajor;
  233. unsigned short VersMinor;
  234. } RPC_TRANSFER_SYNTAX;
  235. RPC_STATUS RPC_ENTRY
  236. I_RpcIfInqTransferSyntaxes (
  237. IN RPC_IF_HANDLE RpcIfHandle,
  238. OUT RPC_TRANSFER_SYNTAX __RPC_FAR * TransferSyntaxes,
  239. IN unsigned int TransferSyntaxSize,
  240. OUT unsigned int __RPC_FAR * TransferSyntaxCount
  241. );
  242. RPC_STATUS RPC_ENTRY
  243. I_UuidCreate (
  244. OUT UUID __RPC_FAR * Uuid
  245. );
  246. RPC_STATUS RPC_ENTRY
  247. I_RpcBindingCopy (
  248. IN RPC_BINDING_HANDLE SourceBinding,
  249. OUT RPC_BINDING_HANDLE __RPC_FAR * DestinationBinding
  250. );
  251. RPC_STATUS RPC_ENTRY
  252. I_RpcBindingIsClientLocal (
  253. IN RPC_BINDING_HANDLE BindingHandle OPTIONAL,
  254. OUT unsigned int __RPC_FAR * ClientLocalFlag
  255. );
  256. void RPC_ENTRY
  257. I_RpcSsDontSerializeContext (
  258. void
  259. );
  260. RPC_STATUS RPC_ENTRY
  261. I_RpcLaunchDatagramReceiveThread(
  262. void __RPC_FAR * pAddress
  263. );
  264. RPC_STATUS RPC_ENTRY
  265. I_RpcServerRegisterForwardFunction (
  266. IN RPC_FORWARD_FUNCTION __RPC_FAR * pForwardFunction
  267. );
  268. RPC_STATUS RPC_ENTRY
  269. I_RpcConnectionInqSockBuffSize(
  270. OUT unsigned long __RPC_FAR * RecvBuffSize,
  271. OUT unsigned long __RPC_FAR * SendBuffSize
  272. );
  273. RPC_STATUS RPC_ENTRY
  274. I_RpcConnectionSetSockBuffSize(
  275. IN unsigned long RecvBuffSize,
  276. IN unsigned long SendBuffSize
  277. );
  278. #ifdef MSWMSG
  279. RPC_STATUS RPC_ENTRY
  280. I_RpcServerStartListening(
  281. HWND hWnd
  282. ) ;
  283. RPC_STATUS RPC_ENTRY
  284. I_RpcServerStopListening(
  285. ) ;
  286. RPC_STATUS RPC_ENTRY
  287. I_RpcGetThreadWindowHandle(
  288. OUT HWND *WindowHandle
  289. ) ;
  290. typedef RPC_STATUS (*RPC_BLOCKING_FN) (
  291. IN void *wnd,
  292. IN void *Context,
  293. IN HANDLE hSyncEvent
  294. ) ;
  295. RPC_STATUS RPC_ENTRY
  296. I_RpcAsyncSendReceive(
  297. IN OUT PRPC_MESSAGE pRpcMessage,
  298. IN OPTIONAL void *Context,
  299. HWND hWnd
  300. ) ;
  301. RPC_STATUS RPC_ENTRY
  302. I_RpcBindingSetAsync(
  303. IN RPC_BINDING_HANDLE Binding,
  304. IN RPC_BLOCKING_FN BlockingFn
  305. ) ;
  306. LONG RPC_ENTRY
  307. I_RpcWindowProc(
  308. IN HWND hWnd,
  309. IN UINT Message,
  310. IN WPARAM wParam,
  311. IN LPARAM lParam
  312. ) ;
  313. #endif
  314. RPC_STATUS RPC_ENTRY
  315. I_RpcServerInqTransportType(
  316. OUT unsigned int __RPC_FAR * Type
  317. ) ;
  318. #ifdef __cplusplus
  319. #ifdef __RPC_WIN32__
  320. typedef
  321. RPC_STATUS
  322. (__RPC_USER __RPC_FAR * RPC_BLOCKING_FUNCTION) (
  323. IN void __RPC_FAR *RpcWindowHandle,
  324. IN void __RPC_FAR *Context
  325. );
  326. RPC_STATUS RPC_ENTRY
  327. I_RpcBindingSetAsync(
  328. IN RPC_BINDING_HANDLE Binding,
  329. IN RPC_BLOCKING_FUNCTION BlockingHook
  330. );
  331. RPC_STATUS RPC_ENTRY
  332. I_RpcAsyncSendReceive(
  333. IN OUT RPC_MESSAGE __RPC_FAR * Message,
  334. IN void __RPC_FAR * Context
  335. );
  336. RPC_STATUS RPC_ENTRY
  337. I_RpcGetThreadWindowHandle(
  338. OUT void __RPC_FAR * __RPC_FAR * WindowHandle
  339. );
  340. RPC_STATUS RPC_ENTRY
  341. I_RpcServerThreadPauseListening(
  342. );
  343. RPC_STATUS RPC_ENTRY
  344. I_RpcServerThreadContinueListening(
  345. );
  346. RPC_STATUS RPC_ENTRY
  347. I_RpcServerUnregisterEndpointA (
  348. IN unsigned char * Protseq,
  349. IN unsigned char * Endpoint
  350. );
  351. RPC_STATUS RPC_ENTRY
  352. I_RpcServerUnregisterEndpointW (
  353. IN unsigned short * Protseq,
  354. IN unsigned short * Endpoint
  355. );
  356. #ifdef UNICODE
  357. #define I_RpcServerUnregisterEndpoint I_RpcServerUnregisterEndpointW
  358. #else
  359. #define I_RpcServerUnregisterEndpoint I_RpcServerUnregisterEndpointA
  360. #endif
  361. #endif // __RPC_WIN32__
  362. }
  363. #endif
  364. // Reset the packing level for Dos and Windows.
  365. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  366. #pragma pack()
  367. #endif
  368. #endif /* __RPCDCEP_H__ */
  369.