- Add more defines from Wine.
[reactos.git] / reactos / include / psdk / rpcdcep.h
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef __WINE_RPCDCEP_H
20 #define __WINE_RPCDCEP_H
21
22 typedef struct _RPC_VERSION {
23 unsigned short MajorVersion;
24 unsigned short MinorVersion;
25 } RPC_VERSION;
26
27 typedef struct _RPC_SYNTAX_IDENTIFIER {
28 GUID SyntaxGUID;
29 RPC_VERSION SyntaxVersion;
30 } RPC_SYNTAX_IDENTIFIER, *PRPC_SYNTAX_IDENTIFIER;
31
32 typedef struct _RPC_MESSAGE
33 {
34 RPC_BINDING_HANDLE Handle;
35 unsigned long DataRepresentation;
36 void* Buffer;
37 unsigned int BufferLength;
38 unsigned int ProcNum;
39 PRPC_SYNTAX_IDENTIFIER TransferSyntax;
40 void* RpcInterfaceInformation;
41 void* ReservedForRuntime;
42 RPC_MGR_EPV* ManagerEpv;
43 void* ImportContext;
44 unsigned long RpcFlags;
45 } RPC_MESSAGE, *PRPC_MESSAGE;
46
47 #define RPC_CONTEXT_HANDLE_DEFAULT_GUARD ((void *)0xfffff00d)
48
49 #define RPC_CONTEXT_HANDLE_DEFAULT_FLAGS 0x00000000
50 #define RPC_CONTEXT_HANDLE_FLAGS 0x30000000
51 #define RPC_CONTEXT_HANDLE_SERIALIZE 0x10000000
52 #define RPC_CONTEXT_HANDLE_DONT_SERIALIZE 0x20000000
53 #define RPC_TYPE_STRICT_CONTEXT_HANDLE 0x40000000
54
55 #define RPC_NCA_FLAGS_DEFAULT 0x00000000
56 #define RPC_NCA_FLAGS_IDEMPOTENT 0x00000001
57 #define RPC_NCA_FLAGS_BROADCAST 0x00000002
58 #define RPC_NCA_FLAGS_MAYBE 0x00000004
59
60 #define RPC_BUFFER_COMPLETE 0x00001000
61 #define RPC_BUFFER_PARTIAL 0x00002000
62 #define RPC_BUFFER_EXTRA 0x00004000
63 #define RPC_BUFFER_ASYNC 0x00008000
64 #define RPC_BUFFER_NONOTIFY 0x00010000
65
66 #define RPCFLG_MESSAGE 0x01000000
67 #define RPCFLG_HAS_MULTI_SYNTAXES 0x02000000
68 #define RPCFLG_HAS_CALLBACK 0x04000000
69 #define RPCFLG_AUTO_COMPLETE 0x08000000
70 #define RPCFLG_LOCAL_CALL 0x10000000
71 #define RPCFLG_INPUT_SYNCHRONOUS 0x20000000
72 #define RPCFLG_ASYNCHRONOUS 0x40000000
73 #define RPCFLG_NON_NDR 0x80000000
74
75 typedef void (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message);
76
77 typedef struct
78 {
79 unsigned int DispatchTableCount;
80 RPC_DISPATCH_FUNCTION* DispatchTable;
81 LONG_PTR Reserved;
82 } RPC_DISPATCH_TABLE, *PRPC_DISPATCH_TABLE;
83
84 typedef struct _RPC_PROTSEQ_ENDPOINT
85 {
86 unsigned char* RpcProtocolSequence;
87 unsigned char* Endpoint;
88 } RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT;
89
90 #define NT351_INTERFACE_SIZE 0x40
91 #define RPC_INTERFACE_HAS_PIPES 0x0001
92
93 typedef struct _RPC_SERVER_INTERFACE
94 {
95 unsigned int Length;
96 RPC_SYNTAX_IDENTIFIER InterfaceId;
97 RPC_SYNTAX_IDENTIFIER TransferSyntax;
98 PRPC_DISPATCH_TABLE DispatchTable;
99 unsigned int RpcProtseqEndpointCount;
100 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
101 RPC_MGR_EPV* DefaultManagerEpv;
102 void const* InterpreterInfo;
103 unsigned int Flags;
104 } RPC_SERVER_INTERFACE, *PRPC_SERVER_INTERFACE;
105
106 typedef struct _RPC_CLIENT_INTERFACE
107 {
108 unsigned int Length;
109 RPC_SYNTAX_IDENTIFIER InterfaceId;
110 RPC_SYNTAX_IDENTIFIER TransferSyntax;
111 PRPC_DISPATCH_TABLE DispatchTable;
112 unsigned int RpcProtseqEndpointCount;
113 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
114 ULONG_PTR Reserved;
115 void const* InterpreterInfo;
116 unsigned int Flags;
117 } RPC_CLIENT_INTERFACE, *PRPC_CLIENT_INTERFACE;
118
119 #define TRANSPORT_TYPE_CN 0x01
120 #define TRANSPORT_TYPE_DG 0x02
121 #define TRANSPORT_TYPE_LPC 0x04
122 #define TRANSPORT_TYPE_WMSG 0x08
123
124 RPCRTAPI RPC_STATUS RPC_ENTRY
125 I_RpcGetBuffer( RPC_MESSAGE* Message );
126 RPCRTAPI RPC_STATUS RPC_ENTRY
127 I_RpcGetBufferWithObject( RPC_MESSAGE* Message, UUID* ObjectUuid );
128 RPCRTAPI RPC_STATUS RPC_ENTRY
129 I_RpcSendReceive( RPC_MESSAGE* Message );
130 RPCRTAPI RPC_STATUS RPC_ENTRY
131 I_RpcFreeBuffer( RPC_MESSAGE* Message );
132 RPCRTAPI RPC_STATUS RPC_ENTRY
133 I_RpcSend( RPC_MESSAGE* Message );
134 RPCRTAPI RPC_STATUS RPC_ENTRY
135 I_RpcReceive( RPC_MESSAGE* Message );
136
137 RPCRTAPI void* RPC_ENTRY
138 I_RpcAllocate( unsigned int Size );
139 RPCRTAPI void RPC_ENTRY
140 I_RpcFree( void* Object );
141
142 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
143 I_RpcGetCurrentCallHandle( void );
144
145 /*
146 * The platform SDK headers don't define these functions at all if WINNT is defined
147 * The MSVC6 headers define two different sets of functions :
148 * If WINNT and MSWMSG are defined, the NT versions are defined
149 * If WINNT is not defined, the windows 9x versions are defined.
150 * Note that the prototypes for I_RpcBindingSetAsync are different for each case.
151 *
152 * Wine defaults to the WinNT case and only defines these function is MSWMSG is
153 * defined. Defining the NT functions by default causes MIDL generated proxys
154 * to not compile.
155 */
156
157 #if 1 /* WINNT */
158 #ifdef MSWMSG
159
160 RPCRTAPI RPC_STATUS RPC_ENTRY
161 I_RpcServerStartListening( HWND hWnd );
162 RPCRTAPI RPC_STATUS RPC_ENTRY
163 I_RpcServerStopListening( void );
164 /* WINNT */
165 RPCRTAPI RPC_STATUS RPC_ENTRY
166 I_GetThreadWindowHandle( HWND* hWnd );
167 RPCRTAPI RPC_STATUS RPC_ENTRY
168 I_RpcAsyncSendReceive( RPC_MESSAGE* Message, void* Context, HWND hWnd );
169
170 typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, HANDLE hSyncEvent);
171
172 RPCRTAPI RPC_STATUS RPC_ENTRY
173 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn );
174
175 RPCRTAPI UINT RPC_ENTRY
176 I_RpcWindowProc( void* hWnd, UINT Message, UINT wParam, ULONG lParam );
177
178 RPCRTAPI RPC_STATUS RPC_ENTRY
179 I_RpcSetWMsgEndpoint( WCHAR* Endpoint );
180
181 RPCRTAPI RPC_STATUS RPC_ENTRY
182 I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding, unsigned int* Type );
183
184 #endif
185
186 #else
187
188 /* WIN9x */
189 RPCRTAPI RPC_STATUS RPC_ENTRY
190 I_RpcServerStartListening( void* hWnd );
191
192 RPCRTAPI RPC_STATUS RPC_ENTRY
193 I_RpcServerStopListening( void );
194
195 typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, void* hSyncEvent);
196
197 RPCRTAPI RPC_STATUS RPC_ENTRY
198 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn, unsigned long ServerTid );
199
200 RPCRTAPI RPC_STATUS RPC_ENTRY
201 I_RpcSetThreadParams( int fClientFree, void* Context, void* hWndClient );
202
203 RPCRTAPI UINT RPC_ENTRY
204 I_RpcWindowProc( void* hWnd, unsigned int Message, unsigned int wParam, unsigned long lParam );
205
206 #endif
207
208 #endif /*__WINE_RPCDCEP_H */