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
26 typedef struct _RPC_VERSION
{
27 unsigned short MajorVersion
;
28 unsigned short MinorVersion
;
31 typedef struct _RPC_SYNTAX_IDENTIFIER
{
33 RPC_VERSION SyntaxVersion
;
34 } RPC_SYNTAX_IDENTIFIER
, *PRPC_SYNTAX_IDENTIFIER
;
36 typedef struct _RPC_MESSAGE
38 RPC_BINDING_HANDLE Handle
;
39 unsigned long DataRepresentation
;
41 unsigned int BufferLength
;
43 PRPC_SYNTAX_IDENTIFIER TransferSyntax
;
44 void* RpcInterfaceInformation
;
45 void* ReservedForRuntime
;
46 RPC_MGR_EPV
* ManagerEpv
;
48 unsigned long RpcFlags
;
49 } RPC_MESSAGE
, *PRPC_MESSAGE
;
51 #define RPC_CONTEXT_HANDLE_DEFAULT_GUARD ((void *)0xfffff00d)
53 #define RPC_CONTEXT_HANDLE_DEFAULT_FLAGS 0x00000000
54 #define RPC_CONTEXT_HANDLE_FLAGS 0x30000000
55 #define RPC_CONTEXT_HANDLE_SERIALIZE 0x10000000
56 #define RPC_CONTEXT_HANDLE_DONT_SERIALIZE 0x20000000
57 #define RPC_TYPE_STRICT_CONTEXT_HANDLE 0x40000000
59 #define RPC_NCA_FLAGS_DEFAULT 0x00000000
60 #define RPC_NCA_FLAGS_IDEMPOTENT 0x00000001
61 #define RPC_NCA_FLAGS_BROADCAST 0x00000002
62 #define RPC_NCA_FLAGS_MAYBE 0x00000004
64 typedef void (__RPC_STUB
*RPC_DISPATCH_FUNCTION
)(PRPC_MESSAGE Message
);
65 typedef RPC_STATUS (RPC_ENTRY
*RPC_FORWARD_FUNCTION
)(UUID
*InterfaceId
, RPC_VERSION
*InterfaceVersion
, UUID
*ObjectId
, unsigned char *Rpcpro
, void **ppDestEndpoint
);
69 unsigned int DispatchTableCount
;
70 RPC_DISPATCH_FUNCTION
* DispatchTable
;
72 } RPC_DISPATCH_TABLE
, *PRPC_DISPATCH_TABLE
;
74 typedef struct _RPC_PROTSEQ_ENDPOINT
76 unsigned char* RpcProtocolSequence
;
77 unsigned char* Endpoint
;
78 } RPC_PROTSEQ_ENDPOINT
, *PRPC_PROTSEQ_ENDPOINT
;
80 #define NT351_INTERFACE_SIZE 0x40
81 #define RPC_INTERFACE_HAS_PIPES 0x0001
83 typedef struct _RPC_SERVER_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
;
91 RPC_MGR_EPV
* DefaultManagerEpv
;
92 void const* InterpreterInfo
;
94 } RPC_SERVER_INTERFACE
, *PRPC_SERVER_INTERFACE
;
96 typedef struct _RPC_CLIENT_INTERFACE
99 RPC_SYNTAX_IDENTIFIER InterfaceId
;
100 RPC_SYNTAX_IDENTIFIER TransferSyntax
;
101 PRPC_DISPATCH_TABLE DispatchTable
;
102 unsigned int RpcProtseqEndpointCount
;
103 PRPC_PROTSEQ_ENDPOINT RpcProtseqEndpoint
;
105 void const* InterpreterInfo
;
107 } RPC_CLIENT_INTERFACE
, *PRPC_CLIENT_INTERFACE
;
109 #define TRANSPORT_TYPE_CN 0x01
110 #define TRANSPORT_TYPE_DG 0x02
111 #define TRANSPORT_TYPE_LPC 0x04
112 #define TRANSPORT_TYPE_WMSG 0x08
114 RPCRTAPI RPC_STATUS RPC_ENTRY
115 I_RpcGetBuffer( RPC_MESSAGE
* Message
);
116 RPCRTAPI RPC_STATUS RPC_ENTRY
117 I_RpcGetBufferWithObject( RPC_MESSAGE
* Message
, UUID
* ObjectUuid
);
118 RPCRTAPI RPC_STATUS RPC_ENTRY
119 I_RpcSendReceive( RPC_MESSAGE
* Message
);
120 RPCRTAPI RPC_STATUS RPC_ENTRY
121 I_RpcFreeBuffer( RPC_MESSAGE
* Message
);
122 RPCRTAPI RPC_STATUS RPC_ENTRY
123 I_RpcSend( RPC_MESSAGE
* Message
);
124 RPCRTAPI RPC_STATUS RPC_ENTRY
125 I_RpcReceive( RPC_MESSAGE
* Message
);
127 RPCRTAPI
void* RPC_ENTRY
128 I_RpcAllocate( unsigned int Size
);
129 RPCRTAPI
void RPC_ENTRY
130 I_RpcFree( void* Object
);
132 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
133 I_RpcGetCurrentCallHandle( void );
136 * The platform SDK headers don't define these functions at all if WINNT is defined
137 * The MSVC6 headers define two different sets of functions :
138 * If WINNT and MSWMSG are defined, the NT versions are defined
139 * If WINNT is not defined, the windows 9x versions are defined.
140 * Note that the prototypes for I_RpcBindingSetAsync are different for each case.
142 * Wine defaults to the WinNT case and only defines these function is MSWMSG is
143 * defined. Defining the NT functions by default causes MIDL generated proxies
150 RPCRTAPI RPC_STATUS RPC_ENTRY
151 I_RpcServerStartListening( HWND hWnd
);
152 RPCRTAPI RPC_STATUS RPC_ENTRY
153 I_RpcServerStopListening( void );
155 RPCRTAPI RPC_STATUS RPC_ENTRY
156 I_GetThreadWindowHandle( HWND
* hWnd
);
157 RPCRTAPI RPC_STATUS RPC_ENTRY
158 I_RpcAsyncSendReceive( RPC_MESSAGE
* Message
, void* Context
, HWND hWnd
);
160 typedef RPC_STATUS (*RPC_BLOCKING_FN
)(void* hWnd
, void* Context
, HANDLE hSyncEvent
);
162 RPCRTAPI RPC_STATUS RPC_ENTRY
163 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding
, RPC_BLOCKING_FN BlockingFn
);
165 RPCRTAPI UINT RPC_ENTRY
166 I_RpcWindowProc( void* hWnd
, UINT Message
, UINT wParam
, ULONG lParam
);
168 RPCRTAPI RPC_STATUS RPC_ENTRY
169 I_RpcSetWMsgEndpoint( WCHAR
* Endpoint
);
171 RPCRTAPI RPC_STATUS RPC_ENTRY
172 I_RpcBindingInqTransportType( RPC_BINDING_HANDLE Binding
, unsigned int* Type
);
174 RPCRTAPI LONG RPC_ENTRY
I_RpcMapWin32Status(RPC_STATUS
);
181 RPCRTAPI RPC_STATUS RPC_ENTRY
182 I_RpcServerStartListening( void* hWnd
);
184 RPCRTAPI RPC_STATUS RPC_ENTRY
185 I_RpcServerStopListening( void );
187 typedef RPC_STATUS (*RPC_BLOCKING_FN
)(void* hWnd
, void* Context
, void* hSyncEvent
);
189 RPCRTAPI RPC_STATUS RPC_ENTRY
190 I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding
, RPC_BLOCKING_FN BlockingFn
, unsigned long ServerTid
);
192 RPCRTAPI RPC_STATUS RPC_ENTRY
193 I_RpcSetThreadParams( int fClientFree
, void* Context
, void* hWndClient
);
195 RPCRTAPI UINT RPC_ENTRY
196 I_RpcWindowProc( void* hWnd
, unsigned int Message
, unsigned int wParam
, unsigned long lParam
);
204 #endif /*__WINE_RPCDCEP_H */