blob: 5d54e88c0a52f70c4c5205db4a057996c5395326 [file] [log] [blame]
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00001/*
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
Francois Gouget552fddc2000-11-08 05:06:10 +000019#ifndef __WINE_RPCDCEP_H
20#define __WINE_RPCDCEP_H
21
Francois Gouget552fddc2000-11-08 05:06:10 +000022typedef struct _RPC_VERSION {
23 unsigned short MajorVersion;
24 unsigned short MinorVersion;
25} RPC_VERSION;
26
27typedef struct _RPC_SYNTAX_IDENTIFIER {
28 GUID SyntaxGUID;
29 RPC_VERSION SyntaxVersion;
30} RPC_SYNTAX_IDENTIFIER, *PRPC_SYNTAX_IDENTIFIER;
31
32typedef 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
Patrik Stridvall9aab47e2002-08-28 23:42:34 +000047typedef void (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message);
Ove Kaaven29b30612002-08-09 01:11:39 +000048
49typedef struct
50{
51 unsigned int DispatchTableCount;
52 RPC_DISPATCH_FUNCTION* DispatchTable;
53 LONG_PTR Reserved;
54} RPC_DISPATCH_TABLE, *PRPC_DISPATCH_TABLE;
55
56typedef struct _RPC_PROTSEQ_ENDPOINT
57{
58 unsigned char* RpcProtocolSequence;
59 unsigned char* Endpoint;
60} RPC_PROTSEQ_ENDPOINT, *PRPC_PROTSEQ_ENDPOINT;
61
62#define NT351_INTERFACE_SIZE 0x40
63#define RPC_INTERFACE_HAS_PIPES 0x0001
64
65typedef struct _RPC_SERVER_INTERFACE
66{
67 unsigned int Length;
68 RPC_SYNTAX_IDENTIFIER InterfaceId;
69 RPC_SYNTAX_IDENTIFIER TransferSyntax;
70 PRPC_DISPATCH_TABLE DispatchTable;
71 unsigned int RpcProtseqEndpointCount;
72 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
73 RPC_MGR_EPV* DefaultManagerEpv;
74 void const* InterpreterInfo;
75 unsigned int Flags;
76} RPC_SERVER_INTERFACE, *PRPC_SERVER_INTERFACE;
77
78typedef struct _RPC_CLIENT_INTERFACE
79{
80 unsigned int Length;
81 RPC_SYNTAX_IDENTIFIER InterfaceId;
82 RPC_SYNTAX_IDENTIFIER TransferSyntax;
83 PRPC_DISPATCH_TABLE DispatchTable;
84 unsigned int RpcProtseqEndpointCount;
85 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint;
86 ULONG_PTR Reserved;
87 void const* InterpreterInfo;
88 unsigned int Flags;
89} RPC_CLIENT_INTERFACE, *PRPC_CLIENT_INTERFACE;
90
91#define TRANSPORT_TYPE_CN 0x01
92#define TRANSPORT_TYPE_DG 0x02
93#define TRANSPORT_TYPE_LPC 0x04
94#define TRANSPORT_TYPE_WMSG 0x08
95
Ove Kaaven29b30612002-08-09 01:11:39 +000096RPCRTAPI RPC_STATUS RPC_ENTRY
97 I_RpcGetBuffer( RPC_MESSAGE* Message );
98RPCRTAPI RPC_STATUS RPC_ENTRY
99 I_RpcGetBufferWithObject( RPC_MESSAGE* Message, UUID* ObjectUuid );
100RPCRTAPI RPC_STATUS RPC_ENTRY
101 I_RpcSendReceive( RPC_MESSAGE* Message );
102RPCRTAPI RPC_STATUS RPC_ENTRY
103 I_RpcFreeBuffer( RPC_MESSAGE* Message );
104RPCRTAPI RPC_STATUS RPC_ENTRY
105 I_RpcSend( RPC_MESSAGE* Message );
106RPCRTAPI RPC_STATUS RPC_ENTRY
107 I_RpcReceive( RPC_MESSAGE* Message );
108
109RPCRTAPI void* RPC_ENTRY
110 I_RpcAllocate( unsigned int Size );
111RPCRTAPI void RPC_ENTRY
112 I_RpcFree( void* Object );
113
114RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
115 I_RpcGetCurrentCallHandle( void );
116
Mike McCormack0b871be2004-09-03 01:02:44 +0000117/*
118 * The platform SDK headers don't define these functions at all if WINNT is defined
119 * The MSVC6 headers define two different sets of functions :
120 * If WINNT and MSWMSG are defined, the NT versions are defined
121 * If WINNT is not defined, the windows 9x versions are defined.
122 * Note that the prototypes for I_RpcBindingSetAsync are different for each case.
123 *
124 * Wine defaults to the WinNT case and only defines these function is MSWMSG is
125 * defined. Defining the NT functions by default causes MIDL generated proxys
126 * to not compile.
127 */
128
129#if 1 /* WINNT */
130#ifdef MSWMSG
131
Ove Kaaven29b30612002-08-09 01:11:39 +0000132RPCRTAPI RPC_STATUS RPC_ENTRY
Mike McCormack0b871be2004-09-03 01:02:44 +0000133 I_RpcServerStartListening( HWND hWnd );
Ove Kaaven29b30612002-08-09 01:11:39 +0000134RPCRTAPI RPC_STATUS RPC_ENTRY
135 I_RpcServerStopListening( void );
136/* WINNT */
137RPCRTAPI RPC_STATUS RPC_ENTRY
138 I_GetThreadWindowHandle( HWND* hWnd );
139RPCRTAPI RPC_STATUS RPC_ENTRY
140 I_RpcAsyncSendReceive( RPC_MESSAGE* Message, void* Context, HWND hWnd );
141
Mike McCormack0b871be2004-09-03 01:02:44 +0000142typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, HANDLE hSyncEvent);
143
Ove Kaaven29b30612002-08-09 01:11:39 +0000144RPCRTAPI RPC_STATUS RPC_ENTRY
145 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn );
Ove Kaaven29b30612002-08-09 01:11:39 +0000146
Greg Turner2339b832002-11-01 01:47:43 +0000147RPCRTAPI UINT RPC_ENTRY
148 I_RpcWindowProc( void* hWnd, UINT Message, UINT wParam, ULONG lParam );
Ove Kaaven29b30612002-08-09 01:11:39 +0000149
Ove Kaaven29b30612002-08-09 01:11:39 +0000150RPCRTAPI RPC_STATUS RPC_ENTRY
151 I_RpcSetWMsgEndpoint( WCHAR* Endpoint );
152
153RPCRTAPI RPC_STATUS RPC_ENTRY
154 I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding, unsigned int* Type );
155
Mike McCormack0b871be2004-09-03 01:02:44 +0000156#endif
157
158#else
159
160/* WIN9x */
161RPCRTAPI RPC_STATUS RPC_ENTRY
162 I_RpcServerStartListening( void* hWnd );
163
164RPCRTAPI RPC_STATUS RPC_ENTRY
165 I_RpcServerStopListening( void );
166
167typedef RPC_STATUS (*RPC_BLOCKING_FN)(void* hWnd, void* Context, void* hSyncEvent);
168
169RPCRTAPI RPC_STATUS RPC_ENTRY
170 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn, unsigned long ServerTid );
171
172RPCRTAPI RPC_STATUS RPC_ENTRY
173 I_RpcSetThreadParams( int fClientFree, void* Context, void* hWndClient );
174
175RPCRTAPI UINT RPC_ENTRY
176 I_RpcWindowProc( void* hWnd, unsigned int Message, unsigned int wParam, unsigned long lParam );
177
178#endif
179
Ove Kaaven29b30612002-08-09 01:11:39 +0000180#endif /*__WINE_RPCDCEP_H */