2 * Copyright (C) 2000 Francois Gouget
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_RPCDCEP_H
20 #define __WINE_RPCDCEP_H
22 typedef struct _RPC_VERSION {
23 unsigned short MajorVersion;
24 unsigned short MinorVersion;
27 typedef struct _RPC_SYNTAX_IDENTIFIER {
29 RPC_VERSION SyntaxVersion;
30 } RPC_SYNTAX_IDENTIFIER, *PRPC_SYNTAX_IDENTIFIER;
32 typedef struct _RPC_MESSAGE
34 RPC_BINDING_HANDLE Handle;
35 unsigned long DataRepresentation;
37 unsigned int BufferLength;
39 PRPC_SYNTAX_IDENTIFIER TransferSyntax;
40 void* RpcInterfaceInformation;
41 void* ReservedForRuntime;
42 RPC_MGR_EPV* ManagerEpv;
44 unsigned long RpcFlags;
45 } RPC_MESSAGE, *PRPC_MESSAGE;
47 #define RPC_NCA_FLAGS_DEFAULT 0x00000000
48 #define RPC_NCA_FLAGS_IDEMPOTENT 0x00000001
49 #define RPC_NCA_FLAGS_BROADCAST 0x00000002
50 #define RPC_NCA_FLAGS_MAYBE 0x00000004
52 typedef void (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message);
56 unsigned int DispatchTableCount;
57 RPC_DISPATCH_FUNCTION* DispatchTable;
59 } RPC_DISPATCH_TABLE, *PRPC_DISPATCH_TABLE;
61 typedef struct _RPC_PROTSEQ_ENDPOINT
63 unsigned char* RpcProtocolSequence;
64 unsigned char* Endpoint;
65 } RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT;
67 #define NT351_INTERFACE_SIZE 0x40
68 #define RPC_INTERFACE_HAS_PIPES 0x0001
70 typedef struct _RPC_SERVER_INTERFACE
73 RPC_SYNTAX_IDENTIFIER InterfaceId;
74 RPC_SYNTAX_IDENTIFIER TransferSyntax;
75 PRPC_DISPATCH_TABLE DispatchTable;
76 unsigned int RpcProtseqEndpointCount;
77 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
78 RPC_MGR_EPV* DefaultManagerEpv;
79 void const* InterpreterInfo;
81 } RPC_SERVER_INTERFACE, *PRPC_SERVER_INTERFACE;
83 typedef struct _RPC_CLIENT_INTERFACE
86 RPC_SYNTAX_IDENTIFIER InterfaceId;
87 RPC_SYNTAX_IDENTIFIER TransferSyntax;
88 PRPC_DISPATCH_TABLE DispatchTable;
89 unsigned int RpcProtseqEndpointCount;
90 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
92 void const* InterpreterInfo;
94 } RPC_CLIENT_INTERFACE, *PRPC_CLIENT_INTERFACE;
96 #define TRANSPORT_TYPE_CN 0x01
97 #define TRANSPORT_TYPE_DG 0x02
98 #define TRANSPORT_TYPE_LPC 0x04
99 #define TRANSPORT_TYPE_WMSG 0x08
101 RPCRTAPI RPC_STATUS RPC_ENTRY
102 I_RpcGetBuffer( RPC_MESSAGE* Message );
103 RPCRTAPI RPC_STATUS RPC_ENTRY
104 I_RpcGetBufferWithObject( RPC_MESSAGE* Message, UUID* ObjectUuid );
105 RPCRTAPI RPC_STATUS RPC_ENTRY
106 I_RpcSendReceive( RPC_MESSAGE* Message );
107 RPCRTAPI RPC_STATUS RPC_ENTRY
108 I_RpcFreeBuffer( RPC_MESSAGE* Message );
109 RPCRTAPI RPC_STATUS RPC_ENTRY
110 I_RpcSend( RPC_MESSAGE* Message );
111 RPCRTAPI RPC_STATUS RPC_ENTRY
112 I_RpcReceive( RPC_MESSAGE* Message );
114 RPCRTAPI void* RPC_ENTRY
115 I_RpcAllocate( unsigned int Size );
116 RPCRTAPI void RPC_ENTRY
117 I_RpcFree( void* Object );
119 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
120 I_RpcGetCurrentCallHandle( void );
123 * The platform SDK headers don't define these functions at all if WINNT is defined
124 * The MSVC6 headers define two different sets of functions :
125 * If WINNT and MSWMSG are defined, the NT versions are defined
126 * If WINNT is not defined, the windows 9x versions are defined.
127 * Note that the prototypes for I_RpcBindingSetAsync are different for each case.
129 * Wine defaults to the WinNT case and only defines these function is MSWMSG is
130 * defined. Defining the NT functions by default causes MIDL generated proxys
137 RPCRTAPI RPC_STATUS RPC_ENTRY
138 I_RpcServerStartListening( HWND hWnd );
139 RPCRTAPI RPC_STATUS RPC_ENTRY
140 I_RpcServerStopListening( void );
142 RPCRTAPI RPC_STATUS RPC_ENTRY
143 I_GetThreadWindowHandle( HWND* hWnd );
144 RPCRTAPI RPC_STATUS RPC_ENTRY
145 I_RpcAsyncSendReceive( RPC_MESSAGE* Message, void* Context, HWND hWnd );
147 typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, HANDLE hSyncEvent);
149 RPCRTAPI RPC_STATUS RPC_ENTRY
150 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn );
152 RPCRTAPI UINT RPC_ENTRY
153 I_RpcWindowProc( void* hWnd, UINT Message, UINT wParam, ULONG lParam );
155 RPCRTAPI RPC_STATUS RPC_ENTRY
156 I_RpcSetWMsgEndpoint( WCHAR* Endpoint );
158 RPCRTAPI RPC_STATUS RPC_ENTRY
159 I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding, unsigned int* Type );
166 RPCRTAPI RPC_STATUS RPC_ENTRY
167 I_RpcServerStartListening( void* hWnd );
169 RPCRTAPI RPC_STATUS RPC_ENTRY
170 I_RpcServerStopListening( void );
172 typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, void* hSyncEvent);
174 RPCRTAPI RPC_STATUS RPC_ENTRY
175 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn, unsigned long ServerTid );
177 RPCRTAPI RPC_STATUS RPC_ENTRY
178 I_RpcSetThreadParams( int fClientFree, void* Context, void* hWndClient );
180 RPCRTAPI UINT RPC_ENTRY
181 I_RpcWindowProc( void* hWnd, unsigned int Message, unsigned int wParam, unsigned long lParam );
185 #endif /*__WINE_RPCDCEP_H */