Compile the ttydrv dll with -DSTRICT.
[wine/multimedia.git] / include / rpcndr.h
blob2ee8cc84617806e94f603b3d397b6652bd6ec114
1 /*
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __RPCNDR_H_VERSION__
20 /* FIXME: What version? Perhaps something is better than nothing, however incorrect */
21 #define __RPCNDR_H_VERSION__ ( 399 )
22 #endif
24 #ifndef __WINE_RPCNDR_H
25 #define __WINE_RPCNDR_H
27 #define TARGET_IS_NT40_OR_LATER 1
28 #define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
30 typedef unsigned char byte;
31 #define hyper __int64
32 #define MIDL_uhyper unsigned __int64
33 /* 'boolean' tend to conflict, let's call it _wine_boolean */
34 typedef unsigned char _wine_boolean;
35 /* typedef _wine_boolean boolean; */
37 #define __RPC_CALLEE WINAPI
38 #define RPC_VAR_ENTRY WINAPIV
40 typedef struct
42 void *pad[2];
43 void *userContext;
44 } *NDR_SCONTEXT;
46 #define NDRSContextValue(hContext) (&(hContext)->userContext)
47 #define cbNDRContext 20
49 typedef void (__RPC_USER *NDR_RUNDOWN)(void *context);
50 typedef void (__RPC_USER *NDR_NOTIFY_ROUTINE)(void);
51 typedef void (__RPC_USER *NDR_NOTIFY2_ROUTINE)(_wine_boolean flag);
53 #define DECLSPEC_UUID(x)
54 #define MIDL_INTERFACE(x) struct
56 struct _MIDL_STUB_MESSAGE;
57 struct _MIDL_STUB_DESC;
58 struct _FULL_PTR_XLAT_TABLES;
60 typedef void (__RPC_USER *EXPR_EVAL)(struct _MIDL_STUB_MESSAGE *);
61 typedef const unsigned char *PFORMAT_STRING;
63 typedef struct
65 long Dimension;
66 unsigned long *BufferConformanceMark;
67 unsigned long *BufferVarianceMark;
68 unsigned long *MaxCountArray;
69 unsigned long *OffsetArray;
70 unsigned long *ActualCountArray;
71 } ARRAY_INFO, *PARRAY_INFO;
73 typedef struct _NDR_PIPE_DESC *PNDR_PIPE_DESC;
74 typedef struct _NDR_PIPE_MESSAGE *PNDR_PIPE_MESSAGE;
75 typedef struct _NDR_ASYNC_MESSAGE *PNDR_ASYNC_MESSAGE;
76 typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
78 #include "pshpack4.h"
79 typedef struct _MIDL_STUB_MESSAGE
81 PRPC_MESSAGE RpcMsg;
82 unsigned char *Buffer;
83 unsigned char *BufferStart;
84 unsigned char *BufferEnd;
85 unsigned char *BufferMark;
86 unsigned long BufferLength;
87 unsigned long MemorySize;
88 unsigned char *Memory;
89 int IsClient;
90 int ReuseBuffer;
91 unsigned char *AllocAllNodesMemory;
92 unsigned char *AllocAllNodesMemoryEnd;
93 int IgnoreEmbeddedPointers;
94 unsigned char *PointerBufferMark;
95 unsigned char fBufferValid;
96 unsigned char uFlags;
97 ULONG_PTR MaxCount;
98 unsigned long Offset;
99 unsigned long ActualCount;
100 void * (__RPC_API *pfnAllocate)(size_t);
101 void (__RPC_API *pfnFree)(void *);
102 unsigned char *StackTop;
103 unsigned char *pPresentedType;
104 unsigned char *pTransmitType;
105 handle_t SavedHandle;
106 const struct _MIDL_STUB_DESC *StubDesc;
107 struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
108 unsigned long FullPtrRefId;
109 unsigned long ulUnused1;
110 int fInDontFree:1;
111 int fDontCallFreeInst:1;
112 int fInOnlyParam:1;
113 int fHasReturn:1;
114 int fHasExtensions:1;
115 int fHasNewCorrDesc:1;
116 int fUnused:10;
117 unsigned long dwDestContext;
118 void *pvDestContext;
119 NDR_SCONTEXT *SavedContextHandles;
120 long ParamNumber;
121 struct IRpcChannelBuffer *pRpcChannelBuffer;
122 PARRAY_INFO pArrayInfo;
123 unsigned long *SizePtrCountArray;
124 unsigned long *SizePtrOffsetArray;
125 unsigned long *SizePtrLengthArray;
126 void *pArgQueue;
127 unsigned long dwStubPhase;
128 PNDR_PIPE_DESC pPipeDesc;
129 PNDR_ASYNC_MESSAGE pAsyncMsg;
130 PNDR_CORRELATION_INFO pCorrInfo;
131 unsigned char *pCorrMemory;
132 void *pMemoryList;
133 ULONG_PTR w2kReserved[5];
134 } MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
135 #include "poppack.h"
137 typedef struct _GENERIC_BINDING_ROUTINE_PAIR GENERIC_BINDING_ROUTINE_PAIR, *PGENERIC_BINDING_ROUTINE_PAIR;
139 typedef struct __GENERIC_BINDING_INFO GENERIC_BINDING_INFO, *PGENERIC_BINDING_INFO;
141 typedef struct _XMIT_ROUTINE_QUINTUPLE XMIT_ROUTINE_QUINTUPLE, *PXMIT_ROUTINE_QUINTUPLE;
143 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE USER_MARSHAL_ROUTINE_QUADRUPLE;
145 typedef struct _MALLOC_FREE_STRUCT MALLOC_FREE_STRUCT;
147 typedef struct _COMM_FAULT_OFFSETS COMM_FAULT_OFFSETS;
149 typedef struct _MIDL_STUB_DESC
151 void *RpcInterfaceInformation;
152 void * (__RPC_API *pfnAllocate)(size_t);
153 void (__RPC_API *pfnFree)(void *);
154 union {
155 handle_t *pAutoHandle;
156 handle_t *pPrimitiveHandle;
157 PGENERIC_BINDING_INFO pGenericBindingInfo;
158 } IMPLICIT_HANDLE_INFO;
159 const NDR_RUNDOWN *apfnNdrRundownRoutines;
160 const GENERIC_BINDING_ROUTINE_PAIR *aGenericBindingRoutinePairs;
161 const EXPR_EVAL *apfnExprEval;
162 const XMIT_ROUTINE_QUINTUPLE *aXmitQuintuple;
163 const unsigned char *pFormatTypes;
164 int fCheckBounds;
165 unsigned long Version;
166 MALLOC_FREE_STRUCT *pMallocFreeStruct;
167 long MIDLVersion;
168 const COMM_FAULT_OFFSETS *CommFaultOffsets;
169 const USER_MARSHAL_ROUTINE_QUADRUPLE *aUserMarshalQuadruple;
170 const NDR_NOTIFY_ROUTINE *NotifyRoutineTable;
171 ULONG_PTR mFlags;
172 ULONG_PTR Reserved3;
173 ULONG_PTR Reserved4;
174 ULONG_PTR Reserved5;
175 } MIDL_STUB_DESC;
176 typedef const MIDL_STUB_DESC *PMIDL_STUB_DESC;
178 typedef struct _MIDL_FORMAT_STRING
180 short Pad;
181 #if defined(__GNUC__)
182 unsigned char Format[0];
183 #else
184 unsigned char Format[1];
185 #endif
186 } MIDL_FORMAT_STRING;
188 typedef void (__RPC_API *STUB_THUNK)( PMIDL_STUB_MESSAGE );
190 typedef long (__RPC_API *SERVER_ROUTINE)();
192 typedef struct _MIDL_SERVER_INFO_
194 PMIDL_STUB_DESC pStubDesc;
195 const SERVER_ROUTINE *DispatchTable;
196 PFORMAT_STRING ProcString;
197 const unsigned short *FmtStringOffset;
198 const STUB_THUNK *ThunkTable;
199 PFORMAT_STRING LocalFormatTypes;
200 PFORMAT_STRING LocalProcString;
201 const unsigned short *LocalFmtStringOffset;
202 } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
204 typedef struct _MIDL_STUBLESS_PROXY_INFO
206 PMIDL_STUB_DESC pStubDesc;
207 PFORMAT_STRING ProcFormatString;
208 const unsigned short *FormatStringOffset;
209 PFORMAT_STRING LocalFormatTypes;
210 PFORMAT_STRING LocalProcStrings;
211 const unsigned short *LocalFmtStringOffset;
212 } MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO;
214 typedef union _CLIENT_CALL_RETURN
216 void *Pointer;
217 LONG_PTR Simple;
218 } CLIENT_CALL_RETURN;
220 typedef enum {
221 STUB_UNMARSHAL,
222 STUB_CALL_SERVER,
223 STUB_MARSHAL,
224 STUB_CALL_SERVER_NO_HRESULT
225 } STUB_PHASE;
227 typedef enum {
228 PROXY_CALCSIZE,
229 PROXY_GETBUFFER,
230 PROXY_MARSHAL,
231 PROXY_SENDRECEIVE,
232 PROXY_UNMARSHAL
233 } PROXY_PHASE;
235 struct IRpcStubBuffer;
237 RPCRTAPI void RPC_ENTRY
238 NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
239 RPCRTAPI void RPC_ENTRY
240 NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
242 /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
243 #define SIMPLE_TYPE_MARSHAL(type) \
244 RPCRTAPI unsigned char* RPC_ENTRY \
245 Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
246 RPCRTAPI unsigned char* RPC_ENTRY \
247 Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
248 RPCRTAPI void RPC_ENTRY \
249 Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
250 RPCRTAPI unsigned long RPC_ENTRY \
251 Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
253 #define TYPE_MARSHAL(type) \
254 SIMPLE_TYPE_MARSHAL(type) \
255 RPCRTAPI void RPC_ENTRY \
256 Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
258 TYPE_MARSHAL(Pointer)
259 TYPE_MARSHAL(SimpleStruct)
260 TYPE_MARSHAL(ConformantStruct)
261 TYPE_MARSHAL(ConformantVaryingStruct)
262 TYPE_MARSHAL(ComplexStruct)
263 TYPE_MARSHAL(FixedArray)
264 TYPE_MARSHAL(ConformantArray)
265 TYPE_MARSHAL(ConformantVaryingArray)
266 TYPE_MARSHAL(VaryingArray)
267 TYPE_MARSHAL(ComplexArray)
268 TYPE_MARSHAL(EncapsulatedUnion)
269 TYPE_MARSHAL(NonEncapsulatedUnion)
270 TYPE_MARSHAL(ByteCountPointer)
271 TYPE_MARSHAL(XmitOrRepAs)
272 TYPE_MARSHAL(UserMarshal)
273 TYPE_MARSHAL(InterfacePointer)
275 SIMPLE_TYPE_MARSHAL(ConformantString)
276 SIMPLE_TYPE_MARSHAL(NonConformantString)
278 #undef TYPE_MARSHAL
279 #undef SIMPLE_TYPE_MARSHAL
281 RPCRTAPI void RPC_ENTRY
282 NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, long NumberParams );
283 RPCRTAPI void RPC_ENTRY
284 NdrConvert( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
286 LONG_PTR /* CLIENT_CALL_RETURN */ RPC_VAR_ENTRY
287 NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
288 LONG_PTR /* CLIENT_CALL_RETURN */ RPC_VAR_ENTRY
289 NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
291 RPCRTAPI void RPC_ENTRY
292 NdrServerCall2( PRPC_MESSAGE pRpcMsg );
293 RPCRTAPI void RPC_ENTRY
294 NdrServerCall( PRPC_MESSAGE pRpcMsg );
296 RPCRTAPI long RPC_ENTRY
297 NdrStubCall2( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, LPDWORD pdwStubPhase );
298 RPCRTAPI long RPC_ENTRY
299 NdrStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, LPDWORD pdwStubPhase );
301 RPCRTAPI void* RPC_ENTRY
302 NdrOleAllocate( size_t Size );
303 RPCRTAPI void RPC_ENTRY
304 NdrOleFree( void* NodeToFree );
306 RPCRTAPI void RPC_ENTRY
307 NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg,
308 PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum );
309 RPCRTAPI unsigned char* RPC_ENTRY
310 NdrGetBuffer( MIDL_STUB_MESSAGE *stubmsg, unsigned long buflen, RPC_BINDING_HANDLE handle );
311 RPCRTAPI void RPC_ENTRY
312 NdrFreeBuffer( MIDL_STUB_MESSAGE *pStubMsg );
313 RPCRTAPI unsigned char* RPC_ENTRY
314 NdrSendReceive( MIDL_STUB_MESSAGE *stubmsg, unsigned char *buffer );
316 #endif /*__WINE_RPCNDR_H */