rpcdcep.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * Copyright (C) 2000 Francois Gouget
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __WINE_RPCDCEP_H
  19. #define __WINE_RPCDCEP_H
  20. typedef struct _RPC_VERSION {
  21. unsigned short MajorVersion;
  22. unsigned short MinorVersion;
  23. } RPC_VERSION;
  24. typedef struct _RPC_SYNTAX_IDENTIFIER {
  25. GUID SyntaxGUID;
  26. RPC_VERSION SyntaxVersion;
  27. } RPC_SYNTAX_IDENTIFIER, *PRPC_SYNTAX_IDENTIFIER;
  28. typedef struct _RPC_MESSAGE
  29. {
  30. RPC_BINDING_HANDLE Handle;
  31. unsigned long DataRepresentation;
  32. void* Buffer;
  33. unsigned int BufferLength;
  34. unsigned int ProcNum;
  35. PRPC_SYNTAX_IDENTIFIER TransferSyntax;
  36. void* RpcInterfaceInformation;
  37. void* ReservedForRuntime;
  38. RPC_MGR_EPV* ManagerEpv;
  39. void* ImportContext;
  40. unsigned long RpcFlags;
  41. } RPC_MESSAGE, *PRPC_MESSAGE;
  42. typedef void (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message);
  43. typedef struct
  44. {
  45. unsigned int DispatchTableCount;
  46. RPC_DISPATCH_FUNCTION* DispatchTable;
  47. LONG_PTR Reserved;
  48. } RPC_DISPATCH_TABLE, *PRPC_DISPATCH_TABLE;
  49. typedef struct _RPC_PROTSEQ_ENDPOINT
  50. {
  51. unsigned char* RpcProtocolSequence;
  52. unsigned char* Endpoint;
  53. } RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT;
  54. #define NT351_INTERFACE_SIZE 0x40
  55. #define RPC_INTERFACE_HAS_PIPES 0x0001
  56. typedef struct _RPC_SERVER_INTERFACE
  57. {
  58. unsigned int Length;
  59. RPC_SYNTAX_IDENTIFIER InterfaceId;
  60. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  61. PRPC_DISPATCH_TABLE DispatchTable;
  62. unsigned int RpcProtseqEndpointCount;
  63. PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
  64. RPC_MGR_EPV* DefaultManagerEpv;
  65. void const* InterpreterInfo;
  66. unsigned int Flags;
  67. } RPC_SERVER_INTERFACE, *PRPC_SERVER_INTERFACE;
  68. typedef struct _RPC_CLIENT_INTERFACE
  69. {
  70. unsigned int Length;
  71. RPC_SYNTAX_IDENTIFIER InterfaceId;
  72. RPC_SYNTAX_IDENTIFIER TransferSyntax;
  73. PRPC_DISPATCH_TABLE DispatchTable;
  74. unsigned int RpcProtseqEndpointCount;
  75. PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
  76. ULONG_PTR Reserved;
  77. void const* InterpreterInfo;
  78. unsigned int Flags;
  79. } RPC_CLIENT_INTERFACE, *PRPC_CLIENT_INTERFACE;
  80. #define TRANSPORT_TYPE_CN 0x01
  81. #define TRANSPORT_TYPE_DG 0x02
  82. #define TRANSPORT_TYPE_LPC 0x04
  83. #define TRANSPORT_TYPE_WMSG 0x08
  84. RPCRTAPI RPC_STATUS RPC_ENTRY
  85. I_RpcGetBuffer( RPC_MESSAGE* Message );
  86. RPCRTAPI RPC_STATUS RPC_ENTRY
  87. I_RpcGetBufferWithObject( RPC_MESSAGE* Message, UUID* ObjectUuid );
  88. RPCRTAPI RPC_STATUS RPC_ENTRY
  89. I_RpcSendReceive( RPC_MESSAGE* Message );
  90. RPCRTAPI RPC_STATUS RPC_ENTRY
  91. I_RpcFreeBuffer( RPC_MESSAGE* Message );
  92. RPCRTAPI RPC_STATUS RPC_ENTRY
  93. I_RpcSend( RPC_MESSAGE* Message );
  94. RPCRTAPI RPC_STATUS RPC_ENTRY
  95. I_RpcReceive( RPC_MESSAGE* Message );
  96. RPCRTAPI void* RPC_ENTRY
  97. I_RpcAllocate( unsigned int Size );
  98. RPCRTAPI void RPC_ENTRY
  99. I_RpcFree( void* Object );
  100. RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
  101. I_RpcGetCurrentCallHandle( void );
  102. /*
  103. * The platform SDK headers don't define these functions at all if WINNT is defined
  104. * The MSVC6 headers define two different sets of functions :
  105. * If WINNT and MSWMSG are defined, the NT versions are defined
  106. * If WINNT is not defined, the windows 9x versions are defined.
  107. * Note that the prototypes for I_RpcBindingSetAsync are different for each case.
  108. *
  109. * Wine defaults to the WinNT case and only defines these function is MSWMSG is
  110. * defined. Defining the NT functions by default causes MIDL generated proxys
  111. * to not compile.
  112. */
  113. #if 1 /* WINNT */
  114. #ifdef MSWMSG
  115. RPCRTAPI RPC_STATUS RPC_ENTRY
  116. I_RpcServerStartListening( HWND hWnd );
  117. RPCRTAPI RPC_STATUS RPC_ENTRY
  118. I_RpcServerStopListening( void );
  119. /* WINNT */
  120. RPCRTAPI RPC_STATUS RPC_ENTRY
  121. I_GetThreadWindowHandle( HWND* hWnd );
  122. RPCRTAPI RPC_STATUS RPC_ENTRY
  123. I_RpcAsyncSendReceive( RPC_MESSAGE* Message, void* Context, HWND hWnd );
  124. typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, HANDLE hSyncEvent);
  125. RPCRTAPI RPC_STATUS RPC_ENTRY
  126. I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn );
  127. RPCRTAPI UINT RPC_ENTRY
  128. I_RpcWindowProc( void* hWnd, UINT Message, UINT wParam, ULONG lParam );
  129. RPCRTAPI RPC_STATUS RPC_ENTRY
  130. I_RpcSetWMsgEndpoint( WCHAR* Endpoint );
  131. RPCRTAPI RPC_STATUS RPC_ENTRY
  132. I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding, unsigned int* Type );
  133. #endif
  134. #else
  135. /* WIN9x */
  136. RPCRTAPI RPC_STATUS RPC_ENTRY
  137. I_RpcServerStartListening( void* hWnd );
  138. RPCRTAPI RPC_STATUS RPC_ENTRY
  139. I_RpcServerStopListening( void );
  140. typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, void* hSyncEvent);
  141. RPCRTAPI RPC_STATUS RPC_ENTRY
  142. I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn, unsigned long ServerTid );
  143. RPCRTAPI RPC_STATUS RPC_ENTRY
  144. I_RpcSetThreadParams( int fClientFree, void* Context, void* hWndClient );
  145. RPCRTAPI UINT RPC_ENTRY
  146. I_RpcWindowProc( void* hWnd, unsigned int Message, unsigned int wParam, unsigned long lParam );
  147. #endif
  148. #endif /*__WINE_RPCDCEP_H */