winetest: Added dnsapi tests.
[wine/multimedia.git] / include / rpcndr.h
blobeca899aea0b7a74a85e228dee2d6bc47ab231e5c
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 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 #include <basetsd.h>
33 /* stupid #if can't handle casts... this __stupidity
34 is just a workaround for that limitation */
36 #define __NDR_CHAR_REP_MASK 0x000fL
37 #define __NDR_INT_REP_MASK 0x00f0L
38 #define __NDR_FLOAT_REP_MASK 0xff00L
40 #define __NDR_IEEE_FLOAT 0x0000L
41 #define __NDR_VAX_FLOAT 0x0100L
42 #define __NDR_IBM_FLOAT 0x0300L
44 #define __NDR_ASCII_CHAR 0x0000L
45 #define __NDR_EBCDIC_CHAR 0x0001L
47 #define __NDR_LITTLE_ENDIAN 0x0010L
48 #define __NDR_BIG_ENDIAN 0x0000L
50 /* Mac's are special */
51 #if defined(__RPC_MAC__)
52 # define __NDR_LOCAL_DATA_REPRESENTATION \
53 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_BIG_ENDIAN)
54 #else
55 # define __NDR_LOCAL_DATA_REPRESENTATION \
56 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_LITTLE_ENDIAN)
57 #endif
59 #define __NDR_LOCAL_ENDIAN \
60 (__NDR_LOCAL_DATA_REPRESENTATION & __NDR_INT_REP_MASK)
62 /* for convenience, define NDR_LOCAL_IS_BIG_ENDIAN iff it is */
63 #if __NDR_LOCAL_ENDIAN == __NDR_BIG_ENDIAN
64 # define NDR_LOCAL_IS_BIG_ENDIAN
65 #elif __NDR_LOCAL_ENDIAN == __NDR_LITTLE_ENDIAN
66 # undef NDR_LOCAL_IS_BIG_ENDIAN
67 #else
68 # error alien NDR_LOCAL_ENDIAN - Greg botched the defines again, please report
69 #endif
71 /* finally, do the casts like Microsoft */
73 #define NDR_CHAR_REP_MASK ((unsigned long) __NDR_CHAR_REP_MASK)
74 #define NDR_INT_REP_MASK ((unsigned long) __NDR_INT_REP_MASK)
75 #define NDR_FLOAT_REP_MASK ((unsigned long) __NDR_FLOAT_REP_MASK)
76 #define NDR_IEEE_FLOAT ((unsigned long) __NDR_IEEE_FLOAT)
77 #define NDR_VAX_FLOAT ((unsigned long) __NDR_VAX_FLOAT)
78 #define NDR_IBM_FLOAT ((unsigned long) __NDR_IBM_FLOAT)
79 #define NDR_ASCII_CHAR ((unsigned long) __NDR_ASCII_CHAR)
80 #define NDR_EBCDIC_CHAR ((unsigned long) __NDR_EBCDIC_CHAR)
81 #define NDR_LITTLE_ENDIAN ((unsigned long) __NDR_LITTLE_ENDIAN)
82 #define NDR_BIG_ENDIAN ((unsigned long) __NDR_BIG_ENDIAN)
83 #define NDR_LOCAL_DATA_REPRESENTATION ((unsigned long) __NDR_LOCAL_DATA_REPRESENTATION)
84 #define NDR_LOCAL_ENDIAN ((unsigned long) __NDR_LOCAL_ENDIAN)
87 #define TARGET_IS_NT50_OR_LATER 1
88 #define TARGET_IS_NT40_OR_LATER 1
89 #define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
91 #define small char
92 typedef unsigned char byte;
93 #define hyper __int64
94 #define MIDL_uhyper unsigned __int64
95 /* 'boolean' tend to conflict, let's call it _wine_boolean */
96 typedef unsigned char _wine_boolean;
97 /* typedef _wine_boolean boolean; */
99 #define __RPC_CALLEE WINAPI
100 #define RPC_VAR_ENTRY __cdecl
101 #define NDR_SHAREABLE static
103 #define MIDL_ascii_strlen(s) strlen(s)
104 #define MIDL_ascii_strcpy(d,s) strcpy(d,s)
105 #define MIDL_memset(d,v,n) memset(d,v,n)
106 #define midl_user_free MIDL_user_free
107 #define midl_user_allocate MIDL_user_allocate
109 #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
110 #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
111 (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
113 typedef struct
115 void *pad[2];
116 void *userContext;
117 } *NDR_SCONTEXT;
119 #define NDRSContextValue(hContext) (&(hContext)->userContext)
120 #define cbNDRContext 20
122 typedef void (__RPC_USER *NDR_RUNDOWN)(void *context);
123 typedef void (__RPC_USER *NDR_NOTIFY_ROUTINE)(void);
124 typedef void (__RPC_USER *NDR_NOTIFY2_ROUTINE)(_wine_boolean flag);
126 #define DECLSPEC_UUID(x)
127 #define MIDL_INTERFACE(x) struct
129 struct _MIDL_STUB_MESSAGE;
130 struct _MIDL_STUB_DESC;
131 struct _FULL_PTR_XLAT_TABLES;
132 struct NDR_ALLOC_ALL_NODES_CONTEXT;
133 struct NDR_POINTER_QUEUE_STATE;
135 typedef void (__RPC_USER *EXPR_EVAL)(struct _MIDL_STUB_MESSAGE *);
136 typedef const unsigned char *PFORMAT_STRING;
138 typedef struct
140 long Dimension;
141 unsigned long *BufferConformanceMark;
142 unsigned long *BufferVarianceMark;
143 unsigned long *MaxCountArray;
144 unsigned long *OffsetArray;
145 unsigned long *ActualCountArray;
146 } ARRAY_INFO, *PARRAY_INFO;
148 typedef struct
150 unsigned long WireCodeset;
151 unsigned long DesiredReceivingCodeset;
152 void *CSArrayInfo;
153 } CS_STUB_INFO;
155 typedef struct _NDR_PIPE_DESC *PNDR_PIPE_DESC;
156 typedef struct _NDR_PIPE_MESSAGE *PNDR_PIPE_MESSAGE;
157 typedef struct _NDR_ASYNC_MESSAGE *PNDR_ASYNC_MESSAGE;
158 typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
160 #include <pshpack4.h>
161 typedef struct _MIDL_STUB_MESSAGE
163 PRPC_MESSAGE RpcMsg;
164 unsigned char *Buffer;
165 unsigned char *BufferStart;
166 unsigned char *BufferEnd;
167 unsigned char *BufferMark;
168 unsigned long BufferLength;
169 unsigned long MemorySize;
170 unsigned char *Memory;
171 int IsClient;
172 int ReuseBuffer;
173 struct NDR_ALLOC_ALL_NODES_CONTEXT *pAllocAllNodesContext;
174 struct NDR_POINTER_QUEUE_STATE *pPointerQueueState;
175 int IgnoreEmbeddedPointers;
176 unsigned char *PointerBufferMark;
177 unsigned char fBufferValid;
178 unsigned char uFlags;
179 unsigned short UniquePtrCount;
180 ULONG_PTR MaxCount;
181 unsigned long Offset;
182 unsigned long ActualCount;
183 void * (__RPC_API *pfnAllocate)(size_t);
184 void (__RPC_API *pfnFree)(void *);
185 unsigned char *StackTop;
186 unsigned char *pPresentedType;
187 unsigned char *pTransmitType;
188 handle_t SavedHandle;
189 const struct _MIDL_STUB_DESC *StubDesc;
190 struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
191 unsigned long FullPtrRefId;
192 unsigned long PointerLength;
193 int fInDontFree:1;
194 int fDontCallFreeInst:1;
195 int fInOnlyParam:1;
196 int fHasReturn:1;
197 int fHasExtensions:1;
198 int fHasNewCorrDesc:1;
199 int fUnused:10;
200 int fUnused2:16;
201 unsigned long dwDestContext;
202 void *pvDestContext;
203 NDR_SCONTEXT *SavedContextHandles;
204 long ParamNumber;
205 struct IRpcChannelBuffer *pRpcChannelBuffer;
206 PARRAY_INFO pArrayInfo;
207 unsigned long *SizePtrCountArray;
208 unsigned long *SizePtrOffsetArray;
209 unsigned long *SizePtrLengthArray;
210 void *pArgQueue;
211 unsigned long dwStubPhase;
212 void *LowStackMark;
213 PNDR_ASYNC_MESSAGE pAsyncMsg;
214 PNDR_CORRELATION_INFO pCorrInfo;
215 unsigned char *pCorrMemory;
216 void *pMemoryList;
217 CS_STUB_INFO *pCSInfo;
218 unsigned char *ConformanceMark;
219 unsigned char *VarianceMark;
220 INT_PTR Unused;
221 struct _NDR_PROC_CONTEXT *pContext;
222 INT_PTR Reserved51_1;
223 INT_PTR Reserved51_2;
224 INT_PTR Reserved51_3;
225 INT_PTR Reserved51_4;
226 INT_PTR Reserved51_5;
227 } MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
228 #include <poppack.h>
230 typedef struct _GENERIC_BINDING_ROUTINE_PAIR GENERIC_BINDING_ROUTINE_PAIR, *PGENERIC_BINDING_ROUTINE_PAIR;
232 typedef struct __GENERIC_BINDING_INFO GENERIC_BINDING_INFO, *PGENERIC_BINDING_INFO;
234 typedef void (__RPC_USER *XMIT_HELPER_ROUTINE)(PMIDL_STUB_MESSAGE);
236 typedef struct _XMIT_ROUTINE_QUINTUPLE
238 XMIT_HELPER_ROUTINE pfnTranslateToXmit;
239 XMIT_HELPER_ROUTINE pfnTranslateFromXmit;
240 XMIT_HELPER_ROUTINE pfnFreeXmit;
241 XMIT_HELPER_ROUTINE pfnFreeInst;
242 } XMIT_ROUTINE_QUINTUPLE, *PXMIT_ROUTINE_QUINTUPLE;
244 typedef unsigned long (__RPC_USER *USER_MARSHAL_SIZING_ROUTINE)(unsigned long *, unsigned long, void *);
245 typedef unsigned char * (__RPC_USER *USER_MARSHAL_MARSHALLING_ROUTINE)(unsigned long *, unsigned char *, void *);
246 typedef unsigned char * (__RPC_USER *USER_MARSHAL_UNMARSHALLING_ROUTINE)(unsigned long *, unsigned char *, void *);
247 typedef void (__RPC_USER *USER_MARSHAL_FREEING_ROUTINE)(unsigned long *, void *);
249 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
251 USER_MARSHAL_SIZING_ROUTINE pfnBufferSize;
252 USER_MARSHAL_MARSHALLING_ROUTINE pfnMarshall;
253 USER_MARSHAL_UNMARSHALLING_ROUTINE pfnUnmarshall;
254 USER_MARSHAL_FREEING_ROUTINE pfnFree;
255 } USER_MARSHAL_ROUTINE_QUADRUPLE;
257 /* 'USRC' */
258 #define USER_MARSHAL_CB_SIGNATURE \
259 ( (DWORD)'U' | ( (DWORD)'S' << 8 ) | \
260 ( (DWORD)'R' << 16 ) | ( (DWORD)'C' << 24 ) )
262 typedef enum
264 USER_MARSHAL_CB_BUFFER_SIZE,
265 USER_MARSHAL_CB_MARSHALL,
266 USER_MARSHAL_CB_UNMARSHALL,
267 USER_MARSHAL_CB_FREE
268 } USER_MARSHAL_CB_TYPE;
270 typedef struct _USER_MARSHAL_CB
272 unsigned long Flags;
273 PMIDL_STUB_MESSAGE pStubMsg;
274 PFORMAT_STRING pReserve;
275 unsigned long Signature;
276 USER_MARSHAL_CB_TYPE CBType;
277 PFORMAT_STRING pFormat;
278 PFORMAT_STRING pTypeFormat;
279 } USER_MARSHAL_CB;
281 #define USER_CALL_CTXT_MASK(f) ((f) & 0x00ff)
282 #define USER_CALL_AUX_MASK(f) ((f) & 0xff00)
283 #define GET_USER_DATA_REP(f) HIWORD(f)
285 #define USER_CALL_IS_ASYNC 0x0100
286 #define USER_CALL_NEW_CORRELATION_DESC 0x0200
288 typedef struct _MALLOC_FREE_STRUCT
290 void * (__RPC_USER *pfnAllocate)(size_t);
291 void (__RPC_USER *pfnFree)(void *);
292 } MALLOC_FREE_STRUCT;
294 typedef struct _COMM_FAULT_OFFSETS
296 short CommOffset;
297 short FaultOffset;
298 } COMM_FAULT_OFFSETS;
300 typedef struct _MIDL_STUB_DESC
302 void *RpcInterfaceInformation;
303 void * (__RPC_API *pfnAllocate)(size_t);
304 void (__RPC_API *pfnFree)(void *);
305 union {
306 handle_t *pAutoHandle;
307 handle_t *pPrimitiveHandle;
308 PGENERIC_BINDING_INFO pGenericBindingInfo;
309 } IMPLICIT_HANDLE_INFO;
310 const NDR_RUNDOWN *apfnNdrRundownRoutines;
311 const GENERIC_BINDING_ROUTINE_PAIR *aGenericBindingRoutinePairs;
312 const EXPR_EVAL *apfnExprEval;
313 const XMIT_ROUTINE_QUINTUPLE *aXmitQuintuple;
314 const unsigned char *pFormatTypes;
315 int fCheckBounds;
316 unsigned long Version;
317 MALLOC_FREE_STRUCT *pMallocFreeStruct;
318 long MIDLVersion;
319 const COMM_FAULT_OFFSETS *CommFaultOffsets;
320 const USER_MARSHAL_ROUTINE_QUADRUPLE *aUserMarshalQuadruple;
321 const NDR_NOTIFY_ROUTINE *NotifyRoutineTable;
322 ULONG_PTR mFlags;
323 ULONG_PTR Reserved3;
324 ULONG_PTR Reserved4;
325 ULONG_PTR Reserved5;
326 } MIDL_STUB_DESC;
327 typedef const MIDL_STUB_DESC *PMIDL_STUB_DESC;
329 typedef struct _MIDL_FORMAT_STRING
331 short Pad;
332 #if defined(__GNUC__)
333 unsigned char Format[0];
334 #else
335 unsigned char Format[1];
336 #endif
337 } MIDL_FORMAT_STRING;
339 typedef struct _MIDL_SYNTAX_INFO
341 RPC_SYNTAX_IDENTIFIER TransferSyntax;
342 RPC_DISPATCH_TABLE* DispatchTable;
343 PFORMAT_STRING ProcString;
344 const unsigned short* FmtStringOffset;
345 PFORMAT_STRING TypeString;
346 const void* aUserMarshalQuadruple;
347 ULONG_PTR pReserved1;
348 ULONG_PTR pReserved2;
349 } MIDL_SYNTAX_INFO, *PMIDL_SYNTAX_INFO;
351 typedef void (__RPC_API *STUB_THUNK)( PMIDL_STUB_MESSAGE );
353 typedef long (__RPC_API *SERVER_ROUTINE)();
355 typedef struct _MIDL_SERVER_INFO_
357 PMIDL_STUB_DESC pStubDesc;
358 const SERVER_ROUTINE *DispatchTable;
359 PFORMAT_STRING ProcString;
360 const unsigned short *FmtStringOffset;
361 const STUB_THUNK *ThunkTable;
362 PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
363 ULONG_PTR nCount;
364 PMIDL_SYNTAX_INFO pSyntaxInfo;
365 } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
367 typedef struct _MIDL_STUBLESS_PROXY_INFO
369 PMIDL_STUB_DESC pStubDesc;
370 PFORMAT_STRING ProcFormatString;
371 const unsigned short *FormatStringOffset;
372 PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
373 ULONG_PTR nCount;
374 PMIDL_SYNTAX_INFO pSyntaxInfo;
375 } MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO;
377 typedef union _CLIENT_CALL_RETURN
379 void *Pointer;
380 LONG_PTR Simple;
381 } CLIENT_CALL_RETURN;
383 typedef enum {
384 STUB_UNMARSHAL,
385 STUB_CALL_SERVER,
386 STUB_MARSHAL,
387 STUB_CALL_SERVER_NO_HRESULT
388 } STUB_PHASE;
390 typedef enum {
391 PROXY_CALCSIZE,
392 PROXY_GETBUFFER,
393 PROXY_MARSHAL,
394 PROXY_SENDRECEIVE,
395 PROXY_UNMARSHAL
396 } PROXY_PHASE;
398 typedef enum {
399 XLAT_SERVER = 1,
400 XLAT_CLIENT
401 } XLAT_SIDE;
403 typedef struct _FULL_PTR_TO_REFID_ELEMENT {
404 struct _FULL_PTR_TO_REFID_ELEMENT *Next;
405 void *Pointer;
406 unsigned long RefId;
407 unsigned char State;
408 } FULL_PTR_TO_REFID_ELEMENT, *PFULL_PTR_TO_REFID_ELEMENT;
410 /* Full pointer translation tables */
411 typedef struct _FULL_PTR_XLAT_TABLES {
412 struct {
413 void **XlatTable;
414 unsigned char *StateTable;
415 unsigned long NumberOfEntries;
416 } RefIdToPointer;
418 struct {
419 PFULL_PTR_TO_REFID_ELEMENT *XlatTable;
420 unsigned long NumberOfBuckets;
421 unsigned long HashMask;
422 } PointerToRefId;
424 unsigned long NextRefId;
425 XLAT_SIDE XlatSide;
426 } FULL_PTR_XLAT_TABLES, *PFULL_PTR_XLAT_TABLES;
428 struct IRpcStubBuffer;
430 typedef unsigned long error_status_t;
431 typedef void * NDR_CCONTEXT;
433 typedef struct _SCONTEXT_QUEUE {
434 unsigned long NumberOfObjects;
435 NDR_SCONTEXT *ArrayOfObjects;
436 } SCONTEXT_QUEUE, *PSCONTEXT_QUEUE;
438 /* Context Handles */
440 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
441 NDRCContextBinding( IN NDR_CCONTEXT CContext );
443 RPCRTAPI void RPC_ENTRY
444 NDRCContextMarshall( IN NDR_CCONTEXT CContext, OUT void *pBuff );
446 RPCRTAPI void RPC_ENTRY
447 NDRCContextUnmarshall( OUT NDR_CCONTEXT *pCContext, IN RPC_BINDING_HANDLE hBinding,
448 IN void *pBuff, IN unsigned long DataRepresentation );
450 RPCRTAPI void RPC_ENTRY
451 NDRSContextMarshall( IN NDR_SCONTEXT CContext, OUT void *pBuff, IN NDR_RUNDOWN userRunDownIn );
453 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
454 NDRSContextUnmarshall( IN void *pBuff, IN unsigned long DataRepresentation );
456 RPCRTAPI void RPC_ENTRY
457 NDRSContextMarshallEx( IN RPC_BINDING_HANDLE BindingHandle, IN NDR_SCONTEXT CContext,
458 OUT void *pBuff, IN NDR_RUNDOWN userRunDownIn );
460 RPCRTAPI void RPC_ENTRY
461 NDRSContextMarshall2( IN RPC_BINDING_HANDLE BindingHandle, IN NDR_SCONTEXT CContext,
462 OUT void *pBuff, IN NDR_RUNDOWN userRunDownIn, IN void * CtxGuard,
463 IN unsigned long Flags );
465 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
466 NDRSContextUnmarshallEx( IN RPC_BINDING_HANDLE BindingHandle, IN void *pBuff,
467 IN unsigned long DataRepresentation );
469 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
470 NDRSContextUnmarshall2( IN RPC_BINDING_HANDLE BindingHandle, IN void *pBuff,
471 IN unsigned long DataRepresentation, IN void *CtxGuard,
472 IN unsigned long Flags );
474 RPCRTAPI void RPC_ENTRY
475 NdrClientContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT ContextHandle, int fCheck );
477 RPCRTAPI void RPC_ENTRY
478 NdrClientContextUnmarshall( IN PMIDL_STUB_MESSAGE pStubMsg, OUT NDR_CCONTEXT* pContextHandle,
479 IN RPC_BINDING_HANDLE BindHandle );
481 RPCRTAPI void RPC_ENTRY
482 NdrServerContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle, NDR_RUNDOWN RundownRoutine );
484 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
485 NdrServerContextUnmarshall( IN PMIDL_STUB_MESSAGE pStubMsg );
487 RPCRTAPI void RPC_ENTRY
488 NdrContextHandleSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
490 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
491 NdrContextHandleInitialize( IN PMIDL_STUB_MESSAGE pStubMsg, IN PFORMAT_STRING pFormat );
493 RPCRTAPI void RPC_ENTRY
494 NdrServerContextNewMarshall( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle,
495 NDR_RUNDOWN RundownRoutine, PFORMAT_STRING pFormat );
497 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
498 NdrServerContextNewUnmarshall( IN PMIDL_STUB_MESSAGE pStubMsg, IN PFORMAT_STRING pFormat );
500 RPCRTAPI void RPC_ENTRY
501 RpcSsDestroyClientContext( IN void **ContextHandle );
503 RPCRTAPI void RPC_ENTRY
504 NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
505 RPCRTAPI void RPC_ENTRY
506 NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
508 /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
509 #define SIMPLE_TYPE_MARSHAL(type) \
510 RPCRTAPI unsigned char* RPC_ENTRY \
511 Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
512 RPCRTAPI unsigned char* RPC_ENTRY \
513 Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
514 RPCRTAPI void RPC_ENTRY \
515 Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
516 RPCRTAPI unsigned long RPC_ENTRY \
517 Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
519 #define TYPE_MARSHAL(type) \
520 SIMPLE_TYPE_MARSHAL(type) \
521 RPCRTAPI void RPC_ENTRY \
522 Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
524 TYPE_MARSHAL(Pointer)
525 TYPE_MARSHAL(SimpleStruct)
526 TYPE_MARSHAL(ConformantStruct)
527 TYPE_MARSHAL(ConformantVaryingStruct)
528 TYPE_MARSHAL(ComplexStruct)
529 TYPE_MARSHAL(FixedArray)
530 TYPE_MARSHAL(ConformantArray)
531 TYPE_MARSHAL(ConformantVaryingArray)
532 TYPE_MARSHAL(VaryingArray)
533 TYPE_MARSHAL(ComplexArray)
534 TYPE_MARSHAL(EncapsulatedUnion)
535 TYPE_MARSHAL(NonEncapsulatedUnion)
536 TYPE_MARSHAL(ByteCountPointer)
537 TYPE_MARSHAL(XmitOrRepAs)
538 TYPE_MARSHAL(UserMarshal)
539 TYPE_MARSHAL(InterfacePointer)
540 TYPE_MARSHAL(Range)
542 SIMPLE_TYPE_MARSHAL(ConformantString)
543 SIMPLE_TYPE_MARSHAL(NonConformantString)
545 #undef TYPE_MARSHAL
546 #undef SIMPLE_TYPE_MARSHAL
548 RPCRTAPI void RPC_ENTRY
549 NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, long NumberParams );
550 RPCRTAPI void RPC_ENTRY
551 NdrConvert( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
553 /* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
554 * returning structures/unions is different between Windows and gcc on i386. */
555 LONG_PTR RPC_VAR_ENTRY
556 NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
557 LONG_PTR RPC_VAR_ENTRY
558 NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
559 LONG_PTR RPC_VAR_ENTRY
560 NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
562 RPCRTAPI void RPC_ENTRY
563 NdrServerCall2( PRPC_MESSAGE pRpcMsg );
564 RPCRTAPI void RPC_ENTRY
565 NdrServerCall( PRPC_MESSAGE pRpcMsg );
567 RPCRTAPI long RPC_ENTRY
568 NdrStubCall2( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, unsigned long * pdwStubPhase );
569 RPCRTAPI long RPC_ENTRY
570 NdrStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, unsigned long * pdwStubPhase );
571 RPCRTAPI long RPC_ENTRY
572 NdrAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, unsigned long * pdwStubPhase );
574 RPCRTAPI void* RPC_ENTRY
575 NdrAllocate( PMIDL_STUB_MESSAGE pStubMsg, size_t Len );
577 RPCRTAPI void RPC_ENTRY
578 NdrClearOutParameters( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, void *ArgAddr );
580 RPCRTAPI RPC_STATUS RPC_ENTRY
581 NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg, unsigned long *pCommStatus,
582 unsigned long *pFaultStatus, RPC_STATUS Status_ );
584 RPCRTAPI void* RPC_ENTRY
585 NdrOleAllocate( size_t Size );
586 RPCRTAPI void RPC_ENTRY
587 NdrOleFree( void* NodeToFree );
589 RPCRTAPI void RPC_ENTRY
590 NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg,
591 PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum );
592 RPCRTAPI unsigned char* RPC_ENTRY
593 NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
594 RPCRTAPI unsigned char* RPC_ENTRY
595 NdrGetBuffer( MIDL_STUB_MESSAGE *stubmsg, unsigned long buflen, RPC_BINDING_HANDLE handle );
596 RPCRTAPI void RPC_ENTRY
597 NdrFreeBuffer( MIDL_STUB_MESSAGE *pStubMsg );
598 RPCRTAPI unsigned char* RPC_ENTRY
599 NdrSendReceive( MIDL_STUB_MESSAGE *stubmsg, unsigned char *buffer );
601 RPCRTAPI unsigned char * RPC_ENTRY
602 NdrNsGetBuffer( PMIDL_STUB_MESSAGE pStubMsg, unsigned long BufferLength, RPC_BINDING_HANDLE Handle );
603 RPCRTAPI unsigned char * RPC_ENTRY
604 NdrNsSendReceive( PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pBufferEnd, RPC_BINDING_HANDLE *pAutoHandle );
606 RPCRTAPI PFULL_PTR_XLAT_TABLES RPC_ENTRY
607 NdrFullPointerXlatInit( unsigned long NumberOfPointers, XLAT_SIDE XlatSide );
608 RPCRTAPI void RPC_ENTRY
609 NdrFullPointerXlatFree( PFULL_PTR_XLAT_TABLES pXlatTables );
610 RPCRTAPI int RPC_ENTRY
611 NdrFullPointerQueryPointer( PFULL_PTR_XLAT_TABLES pXlatTables, void *pPointer,
612 unsigned char QueryType, unsigned long *pRefId );
613 RPCRTAPI int RPC_ENTRY
614 NdrFullPointerQueryRefId( PFULL_PTR_XLAT_TABLES pXlatTables, unsigned long RefId,
615 unsigned char QueryType, void **ppPointer );
616 RPCRTAPI void RPC_ENTRY
617 NdrFullPointerInsertRefId( PFULL_PTR_XLAT_TABLES pXlatTables, unsigned long RefId, void *pPointer );
618 RPCRTAPI int RPC_ENTRY
619 NdrFullPointerFree( PFULL_PTR_XLAT_TABLES pXlatTables, void *Pointer );
621 RPCRTAPI void RPC_ENTRY
622 NdrRpcSsEnableAllocate( PMIDL_STUB_MESSAGE pMessage );
623 RPCRTAPI void RPC_ENTRY
624 NdrRpcSsDisableAllocate( PMIDL_STUB_MESSAGE pMessage );
625 RPCRTAPI void RPC_ENTRY
626 NdrRpcSmSetClientToOsf( PMIDL_STUB_MESSAGE pMessage );
627 RPCRTAPI void * RPC_ENTRY
628 NdrRpcSmClientAllocate( IN size_t Size );
629 RPCRTAPI void RPC_ENTRY
630 NdrRpcSmClientFree( IN void *NodeToFree );
631 RPCRTAPI void * RPC_ENTRY
632 NdrRpcSsDefaultAllocate( IN size_t Size );
633 RPCRTAPI void RPC_ENTRY
634 NdrRpcSsDefaultFree( IN void *NodeToFree );
636 #ifdef __cplusplus
638 #endif
639 #endif /*__WINE_RPCNDR_H */