oleaut32: Fix default parameter variant leak (Valgrind).
[wine.git] / include / rpcndr.h
blobcd93d8e49942bbc7d4d25fb39ab8678ba91042ac
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __RPCNDR_H_VERSION__
20 #define __RPCNDR_H_VERSION__ ( 500 )
21 #endif
23 #ifndef __WINE_RPCNDR_H
24 #define __WINE_RPCNDR_H
26 #include <basetsd.h>
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 #undef CONST_VTBL
33 #ifdef CONST_VTABLE
34 # define CONST_VTBL const
35 #else
36 # define CONST_VTBL
37 #endif
39 /* stupid #if can't handle casts... this __stupidity
40 is just a workaround for that limitation */
42 #define __NDR_CHAR_REP_MASK 0x000fL
43 #define __NDR_INT_REP_MASK 0x00f0L
44 #define __NDR_FLOAT_REP_MASK 0xff00L
46 #define __NDR_IEEE_FLOAT 0x0000L
47 #define __NDR_VAX_FLOAT 0x0100L
48 #define __NDR_IBM_FLOAT 0x0300L
50 #define __NDR_ASCII_CHAR 0x0000L
51 #define __NDR_EBCDIC_CHAR 0x0001L
53 #define __NDR_LITTLE_ENDIAN 0x0010L
54 #define __NDR_BIG_ENDIAN 0x0000L
56 /* Mac's are special */
57 #if defined(__RPC_MAC__)
58 # define __NDR_LOCAL_DATA_REPRESENTATION \
59 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_BIG_ENDIAN)
60 #else
61 # define __NDR_LOCAL_DATA_REPRESENTATION \
62 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_LITTLE_ENDIAN)
63 #endif
65 #define __NDR_LOCAL_ENDIAN \
66 (__NDR_LOCAL_DATA_REPRESENTATION & __NDR_INT_REP_MASK)
68 /* for convenience, define NDR_LOCAL_IS_BIG_ENDIAN iff it is */
69 #if __NDR_LOCAL_ENDIAN == __NDR_BIG_ENDIAN
70 # define NDR_LOCAL_IS_BIG_ENDIAN
71 #elif __NDR_LOCAL_ENDIAN == __NDR_LITTLE_ENDIAN
72 # undef NDR_LOCAL_IS_BIG_ENDIAN
73 #else
74 # error alien NDR_LOCAL_ENDIAN - Greg botched the defines again, please report
75 #endif
77 /* finally, do the casts like Microsoft */
79 #define NDR_CHAR_REP_MASK ((ULONG) __NDR_CHAR_REP_MASK)
80 #define NDR_INT_REP_MASK ((ULONG) __NDR_INT_REP_MASK)
81 #define NDR_FLOAT_REP_MASK ((ULONG) __NDR_FLOAT_REP_MASK)
82 #define NDR_IEEE_FLOAT ((ULONG) __NDR_IEEE_FLOAT)
83 #define NDR_VAX_FLOAT ((ULONG) __NDR_VAX_FLOAT)
84 #define NDR_IBM_FLOAT ((ULONG) __NDR_IBM_FLOAT)
85 #define NDR_ASCII_CHAR ((ULONG) __NDR_ASCII_CHAR)
86 #define NDR_EBCDIC_CHAR ((ULONG) __NDR_EBCDIC_CHAR)
87 #define NDR_LITTLE_ENDIAN ((ULONG) __NDR_LITTLE_ENDIAN)
88 #define NDR_BIG_ENDIAN ((ULONG) __NDR_BIG_ENDIAN)
89 #define NDR_LOCAL_DATA_REPRESENTATION ((ULONG) __NDR_LOCAL_DATA_REPRESENTATION)
90 #define NDR_LOCAL_ENDIAN ((ULONG) __NDR_LOCAL_ENDIAN)
93 #define TARGET_IS_NT50_OR_LATER 1
94 #define TARGET_IS_NT40_OR_LATER 1
95 #define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
97 #define small char
98 typedef unsigned char byte;
99 typedef INT64 hyper;
100 typedef UINT64 MIDL_uhyper;
101 typedef unsigned char boolean;
103 #define __RPC_CALLEE WINAPI
104 #define RPC_VAR_ENTRY __cdecl
105 #define NDR_SHAREABLE static
107 #define MIDL_ascii_strlen(s) strlen(s)
108 #define MIDL_ascii_strcpy(d,s) strcpy(d,s)
109 #define MIDL_memset(d,v,n) memset(d,v,n)
110 #define midl_user_free MIDL_user_free
111 #define midl_user_allocate MIDL_user_allocate
113 void * __RPC_USER MIDL_user_allocate(SIZE_T);
114 void __RPC_USER MIDL_user_free(void *);
116 #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
117 #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
118 (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
120 #define RPC_BAD_STUB_DATA_EXCEPTION_FILTER \
121 ((RpcExceptionCode() == STATUS_ACCESS_VIOLATION) || \
122 (RpcExceptionCode() == STATUS_DATATYPE_MISALIGNMENT) || \
123 (RpcExceptionCode() == RPC_X_BAD_STUB_DATA) || \
124 (RpcExceptionCode() == RPC_S_INVALID_BOUND))
126 typedef struct
128 void *pad[2];
129 void *userContext;
130 } *NDR_SCONTEXT;
132 #define NDRSContextValue(hContext) (&(hContext)->userContext)
133 #define cbNDRContext 20
135 typedef void (__RPC_USER *NDR_RUNDOWN)(void *context);
136 typedef void (__RPC_USER *NDR_NOTIFY_ROUTINE)(void);
137 typedef void (__RPC_USER *NDR_NOTIFY2_ROUTINE)(boolean flag);
139 #define DECLSPEC_UUID(x)
140 #define MIDL_INTERFACE(x) struct
142 struct _MIDL_STUB_MESSAGE;
143 struct _MIDL_STUB_DESC;
144 struct _FULL_PTR_XLAT_TABLES;
145 struct NDR_ALLOC_ALL_NODES_CONTEXT;
146 struct NDR_POINTER_QUEUE_STATE;
148 typedef unsigned char *RPC_BUFPTR;
149 typedef ULONG RPC_LENGTH;
150 typedef void (__RPC_USER *EXPR_EVAL)(struct _MIDL_STUB_MESSAGE *);
151 typedef const unsigned char *PFORMAT_STRING;
153 typedef struct
155 LONG Dimension;
156 ULONG *BufferConformanceMark;
157 ULONG *BufferVarianceMark;
158 ULONG *MaxCountArray;
159 ULONG *OffsetArray;
160 ULONG *ActualCountArray;
161 } ARRAY_INFO, *PARRAY_INFO;
163 typedef struct
165 ULONG WireCodeset;
166 ULONG DesiredReceivingCodeset;
167 void *CSArrayInfo;
168 } CS_STUB_INFO;
170 typedef struct _NDR_PIPE_DESC *PNDR_PIPE_DESC;
171 typedef struct _NDR_PIPE_MESSAGE *PNDR_PIPE_MESSAGE;
172 typedef struct _NDR_ASYNC_MESSAGE *PNDR_ASYNC_MESSAGE;
173 typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
175 typedef struct _MIDL_STUB_MESSAGE
177 PRPC_MESSAGE RpcMsg;
178 unsigned char *Buffer;
179 unsigned char *BufferStart;
180 unsigned char *BufferEnd;
181 unsigned char *BufferMark;
182 ULONG BufferLength;
183 ULONG MemorySize;
184 unsigned char *Memory;
185 unsigned char IsClient;
186 unsigned char Pad;
187 unsigned short uFlags2;
188 int ReuseBuffer;
189 struct NDR_ALLOC_ALL_NODES_CONTEXT *pAllocAllNodesContext;
190 struct NDR_POINTER_QUEUE_STATE *pPointerQueueState;
191 int IgnoreEmbeddedPointers;
192 unsigned char *PointerBufferMark;
193 unsigned char CorrDespIncrement;
194 unsigned char uFlags;
195 unsigned short UniquePtrCount;
196 ULONG_PTR MaxCount;
197 ULONG Offset;
198 ULONG ActualCount;
199 void * (__WINE_ALLOC_SIZE(1) __RPC_API *pfnAllocate)(SIZE_T);
200 void (__RPC_API *pfnFree)(void *);
201 unsigned char *StackTop;
202 unsigned char *pPresentedType;
203 unsigned char *pTransmitType;
204 handle_t SavedHandle;
205 const struct _MIDL_STUB_DESC *StubDesc;
206 struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
207 ULONG FullPtrRefId;
208 ULONG PointerLength;
209 unsigned int fInDontFree:1;
210 unsigned int fDontCallFreeInst:1;
211 unsigned int fInOnlyParam:1;
212 unsigned int fHasReturn:1;
213 unsigned int fHasExtensions:1;
214 unsigned int fHasNewCorrDesc:1;
215 unsigned int fIsIn:1;
216 unsigned int fIsOut:1;
217 unsigned int fIsOicf:1;
218 unsigned int fBufferValid:1;
219 unsigned int fHasMemoryValidateCallback:1;
220 unsigned int fInFree:1;
221 unsigned int fNeedMCCP:1;
222 int fUnused:3;
223 int fUnused2:16;
224 DWORD dwDestContext;
225 void *pvDestContext;
226 NDR_SCONTEXT *SavedContextHandles;
227 LONG ParamNumber;
228 struct IRpcChannelBuffer *pRpcChannelBuffer;
229 PARRAY_INFO pArrayInfo;
230 ULONG *SizePtrCountArray;
231 ULONG *SizePtrOffsetArray;
232 ULONG *SizePtrLengthArray;
233 void *pArgQueue;
234 DWORD dwStubPhase;
235 void *LowStackMark;
236 PNDR_ASYNC_MESSAGE pAsyncMsg;
237 PNDR_CORRELATION_INFO pCorrInfo;
238 unsigned char *pCorrMemory;
239 void *pMemoryList;
240 CS_STUB_INFO *pCSInfo;
241 unsigned char *ConformanceMark;
242 unsigned char *VarianceMark;
243 INT_PTR Unused; /* BackingStoreLowMark on IA64 */
244 struct _NDR_PROC_CONTEXT *pContext;
245 void* ContextHandleHash;
246 void* pUserMarshalList;
247 INT_PTR Reserved51_3;
248 INT_PTR Reserved51_4;
249 INT_PTR Reserved51_5;
250 } MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
252 typedef void * (__RPC_API * GENERIC_BINDING_ROUTINE)(void *);
253 typedef void (__RPC_API * GENERIC_UNBIND_ROUTINE)(void *, unsigned char *);
255 typedef struct _GENERIC_BINDING_ROUTINE_PAIR
257 GENERIC_BINDING_ROUTINE pfnBind;
258 GENERIC_UNBIND_ROUTINE pfnUnbind;
259 } GENERIC_BINDING_ROUTINE_PAIR, *PGENERIC_BINDING_ROUTINE_PAIR;
261 typedef struct __GENERIC_BINDING_INFO
263 void *pObj;
264 unsigned int Size;
265 GENERIC_BINDING_ROUTINE pfnBind;
266 GENERIC_UNBIND_ROUTINE pfnUnbind;
267 } GENERIC_BINDING_INFO, *PGENERIC_BINDING_INFO;
269 typedef void (__RPC_USER *XMIT_HELPER_ROUTINE)(PMIDL_STUB_MESSAGE);
271 typedef struct _XMIT_ROUTINE_QUINTUPLE
273 XMIT_HELPER_ROUTINE pfnTranslateToXmit;
274 XMIT_HELPER_ROUTINE pfnTranslateFromXmit;
275 XMIT_HELPER_ROUTINE pfnFreeXmit;
276 XMIT_HELPER_ROUTINE pfnFreeInst;
277 } XMIT_ROUTINE_QUINTUPLE, *PXMIT_ROUTINE_QUINTUPLE;
279 typedef ULONG (__RPC_USER *USER_MARSHAL_SIZING_ROUTINE)(ULONG *, ULONG, void *);
280 typedef unsigned char * (__RPC_USER *USER_MARSHAL_MARSHALLING_ROUTINE)(ULONG *, unsigned char *, void *);
281 typedef unsigned char * (__RPC_USER *USER_MARSHAL_UNMARSHALLING_ROUTINE)(ULONG *, unsigned char *, void *);
282 typedef void (__RPC_USER *USER_MARSHAL_FREEING_ROUTINE)(ULONG *, void *);
284 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
286 USER_MARSHAL_SIZING_ROUTINE pfnBufferSize;
287 USER_MARSHAL_MARSHALLING_ROUTINE pfnMarshall;
288 USER_MARSHAL_UNMARSHALLING_ROUTINE pfnUnmarshall;
289 USER_MARSHAL_FREEING_ROUTINE pfnFree;
290 } USER_MARSHAL_ROUTINE_QUADRUPLE;
292 /* 'USRC' */
293 #define USER_MARSHAL_CB_SIGNATURE \
294 ( ( (DWORD)'U' << 24 ) | ( (DWORD)'S' << 16 ) | \
295 ( (DWORD)'R' << 8 ) | ( (DWORD)'C' ) )
297 typedef enum
299 USER_MARSHAL_CB_BUFFER_SIZE,
300 USER_MARSHAL_CB_MARSHALL,
301 USER_MARSHAL_CB_UNMARSHALL,
302 USER_MARSHAL_CB_FREE
303 } USER_MARSHAL_CB_TYPE;
305 typedef struct _USER_MARSHAL_CB
307 ULONG Flags;
308 PMIDL_STUB_MESSAGE pStubMsg;
309 PFORMAT_STRING pReserve;
310 ULONG Signature;
311 USER_MARSHAL_CB_TYPE CBType;
312 PFORMAT_STRING pFormat;
313 PFORMAT_STRING pTypeFormat;
314 } USER_MARSHAL_CB;
316 #define USER_CALL_CTXT_MASK(f) ((f) & 0x00ff)
317 #define USER_CALL_AUX_MASK(f) ((f) & 0xff00)
318 #define GET_USER_DATA_REP(f) HIWORD(f)
320 #define USER_CALL_IS_ASYNC 0x0100
321 #define USER_CALL_NEW_CORRELATION_DESC 0x0200
323 typedef struct _MALLOC_FREE_STRUCT
325 void * (__WINE_ALLOC_SIZE(1) __RPC_USER *pfnAllocate)(SIZE_T);
326 void (__RPC_USER *pfnFree)(void *);
327 } MALLOC_FREE_STRUCT;
329 typedef struct _COMM_FAULT_OFFSETS
331 short CommOffset;
332 short FaultOffset;
333 } COMM_FAULT_OFFSETS;
335 typedef struct _MIDL_STUB_DESC
337 void *RpcInterfaceInformation;
338 void * (__WINE_ALLOC_SIZE(1) __RPC_API *pfnAllocate)(SIZE_T);
339 void (__RPC_API *pfnFree)(void *);
340 union {
341 handle_t *pAutoHandle;
342 handle_t *pPrimitiveHandle;
343 PGENERIC_BINDING_INFO pGenericBindingInfo;
344 } IMPLICIT_HANDLE_INFO;
345 const NDR_RUNDOWN *apfnNdrRundownRoutines;
346 const GENERIC_BINDING_ROUTINE_PAIR *aGenericBindingRoutinePairs;
347 const EXPR_EVAL *apfnExprEval;
348 const XMIT_ROUTINE_QUINTUPLE *aXmitQuintuple;
349 const unsigned char *pFormatTypes;
350 int fCheckBounds;
351 ULONG Version;
352 MALLOC_FREE_STRUCT *pMallocFreeStruct;
353 LONG MIDLVersion;
354 const COMM_FAULT_OFFSETS *CommFaultOffsets;
355 const USER_MARSHAL_ROUTINE_QUADRUPLE *aUserMarshalQuadruple;
356 const NDR_NOTIFY_ROUTINE *NotifyRoutineTable;
357 ULONG_PTR mFlags;
358 ULONG_PTR Reserved3;
359 ULONG_PTR Reserved4;
360 ULONG_PTR Reserved5;
361 } MIDL_STUB_DESC;
362 typedef const MIDL_STUB_DESC *PMIDL_STUB_DESC;
364 typedef struct _MIDL_FORMAT_STRING
366 short Pad;
367 #if defined(__GNUC__)
368 unsigned char Format[0];
369 #else
370 unsigned char Format[1];
371 #endif
372 } MIDL_FORMAT_STRING;
374 typedef struct _MIDL_SYNTAX_INFO
376 RPC_SYNTAX_IDENTIFIER TransferSyntax;
377 RPC_DISPATCH_TABLE* DispatchTable;
378 PFORMAT_STRING ProcString;
379 const unsigned short* FmtStringOffset;
380 PFORMAT_STRING TypeString;
381 const void* aUserMarshalQuadruple;
382 ULONG_PTR pReserved1;
383 ULONG_PTR pReserved2;
384 } MIDL_SYNTAX_INFO, *PMIDL_SYNTAX_INFO;
386 typedef void (__RPC_API *STUB_THUNK)( PMIDL_STUB_MESSAGE );
388 #ifdef WINE_STRICT_PROTOTYPES
389 typedef LONG (__RPC_API *SERVER_ROUTINE)(void);
390 #else
391 typedef LONG (__RPC_API *SERVER_ROUTINE)();
392 #endif
394 typedef struct _MIDL_SERVER_INFO_
396 PMIDL_STUB_DESC pStubDesc;
397 const SERVER_ROUTINE *DispatchTable;
398 PFORMAT_STRING ProcString;
399 const unsigned short *FmtStringOffset;
400 const STUB_THUNK *ThunkTable;
401 PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
402 ULONG_PTR nCount;
403 PMIDL_SYNTAX_INFO pSyntaxInfo;
404 } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
406 typedef struct _MIDL_STUBLESS_PROXY_INFO
408 PMIDL_STUB_DESC pStubDesc;
409 PFORMAT_STRING ProcFormatString;
410 const unsigned short *FormatStringOffset;
411 PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
412 ULONG_PTR nCount;
413 PMIDL_SYNTAX_INFO pSyntaxInfo;
414 } MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO;
416 typedef union _CLIENT_CALL_RETURN
418 void *Pointer;
419 LONG_PTR Simple;
420 } CLIENT_CALL_RETURN;
422 typedef enum {
423 STUB_UNMARSHAL,
424 STUB_CALL_SERVER,
425 STUB_MARSHAL,
426 STUB_CALL_SERVER_NO_HRESULT
427 } STUB_PHASE;
429 typedef enum {
430 PROXY_CALCSIZE,
431 PROXY_GETBUFFER,
432 PROXY_MARSHAL,
433 PROXY_SENDRECEIVE,
434 PROXY_UNMARSHAL
435 } PROXY_PHASE;
437 typedef enum {
438 XLAT_SERVER = 1,
439 XLAT_CLIENT
440 } XLAT_SIDE;
442 typedef struct _FULL_PTR_TO_REFID_ELEMENT {
443 struct _FULL_PTR_TO_REFID_ELEMENT *Next;
444 void *Pointer;
445 ULONG RefId;
446 unsigned char State;
447 } FULL_PTR_TO_REFID_ELEMENT, *PFULL_PTR_TO_REFID_ELEMENT;
449 /* Full pointer translation tables */
450 typedef struct _FULL_PTR_XLAT_TABLES {
451 struct {
452 void **XlatTable;
453 unsigned char *StateTable;
454 ULONG NumberOfEntries;
455 } RefIdToPointer;
457 struct {
458 PFULL_PTR_TO_REFID_ELEMENT *XlatTable;
459 ULONG NumberOfBuckets;
460 ULONG HashMask;
461 } PointerToRefId;
463 ULONG NextRefId;
464 XLAT_SIDE XlatSide;
465 } FULL_PTR_XLAT_TABLES, *PFULL_PTR_XLAT_TABLES;
467 struct IRpcStubBuffer;
469 typedef ULONG error_status_t;
470 typedef void * NDR_CCONTEXT;
472 typedef struct _SCONTEXT_QUEUE {
473 ULONG NumberOfObjects;
474 NDR_SCONTEXT *ArrayOfObjects;
475 } SCONTEXT_QUEUE, *PSCONTEXT_QUEUE;
477 typedef struct _NDR_USER_MARSHAL_INFO_LEVEL1
479 void *Buffer;
480 ULONG BufferSize;
481 void * (__WINE_ALLOC_SIZE(1) __RPC_API *pfnAllocate)(SIZE_T);
482 void (__RPC_API *pfnFree)(void *);
483 struct IRpcChannelBuffer *pRpcChannelBuffer;
484 ULONG_PTR Reserved[5];
485 } NDR_USER_MARSHAL_INFO_LEVEL1;
487 typedef struct _NDR_USER_MARSHAL_INFO
489 ULONG InformationLevel;
490 union
492 NDR_USER_MARSHAL_INFO_LEVEL1 Level1;
493 } DUMMYUNIONNAME1;
494 } NDR_USER_MARSHAL_INFO;
496 /* Context Handles */
498 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
499 NDRCContextBinding( NDR_CCONTEXT CContext );
501 RPCRTAPI void RPC_ENTRY
502 NDRCContextMarshall( NDR_CCONTEXT CContext, void *pBuff );
504 RPCRTAPI void RPC_ENTRY
505 NDRCContextUnmarshall( NDR_CCONTEXT *pCContext, RPC_BINDING_HANDLE hBinding,
506 void *pBuff, ULONG DataRepresentation );
508 RPCRTAPI void RPC_ENTRY
509 NDRSContextMarshall( NDR_SCONTEXT CContext, void *pBuff, NDR_RUNDOWN userRunDownIn );
511 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
512 NDRSContextUnmarshall( void *pBuff, ULONG DataRepresentation );
514 RPCRTAPI void RPC_ENTRY
515 NDRSContextMarshallEx( RPC_BINDING_HANDLE BindingHandle, NDR_SCONTEXT CContext,
516 void *pBuff, NDR_RUNDOWN userRunDownIn );
518 RPCRTAPI void RPC_ENTRY
519 NDRSContextMarshall2( RPC_BINDING_HANDLE BindingHandle, NDR_SCONTEXT CContext,
520 void *pBuff, NDR_RUNDOWN userRunDownIn, void * CtxGuard,
521 ULONG Flags );
523 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
524 NDRSContextUnmarshallEx( RPC_BINDING_HANDLE BindingHandle, void *pBuff,
525 ULONG DataRepresentation );
527 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
528 NDRSContextUnmarshall2( RPC_BINDING_HANDLE BindingHandle, void *pBuff,
529 ULONG DataRepresentation, void *CtxGuard,
530 ULONG Flags );
532 RPCRTAPI void RPC_ENTRY
533 NdrClientContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT ContextHandle, int fCheck );
535 RPCRTAPI void RPC_ENTRY
536 NdrClientContextUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT* pContextHandle,
537 RPC_BINDING_HANDLE BindHandle );
539 RPCRTAPI void RPC_ENTRY
540 NdrServerContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle, NDR_RUNDOWN RundownRoutine );
542 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
543 NdrServerContextUnmarshall( PMIDL_STUB_MESSAGE pStubMsg );
545 RPCRTAPI void RPC_ENTRY
546 NdrContextHandleSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
548 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
549 NdrContextHandleInitialize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
551 RPCRTAPI void RPC_ENTRY
552 NdrServerContextNewMarshall( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle,
553 NDR_RUNDOWN RundownRoutine, PFORMAT_STRING pFormat );
555 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
556 NdrServerContextNewUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
558 RPCRTAPI RPC_STATUS RPC_ENTRY
559 RpcSmDestroyClientContext( void **ContextHandle );
561 RPCRTAPI void RPC_ENTRY
562 RpcSsDestroyClientContext( void **ContextHandle );
564 RPCRTAPI void RPC_ENTRY
565 NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
566 RPCRTAPI void RPC_ENTRY
567 NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
569 RPCRTAPI unsigned char* RPC_ENTRY
570 NdrByteCountPointerMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
571 RPCRTAPI unsigned char* RPC_ENTRY
572 NdrByteCountPointerUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc );
573 RPCRTAPI void RPC_ENTRY
574 NdrByteCountPointerBufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
575 RPCRTAPI void RPC_ENTRY
576 NdrByteCountPointerFree( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
578 RPCRTAPI unsigned char* RPC_ENTRY
579 NdrRangeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc );
581 /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
582 #define SIMPLE_TYPE_MARSHAL(type) \
583 RPCRTAPI unsigned char* RPC_ENTRY \
584 Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
585 RPCRTAPI unsigned char* RPC_ENTRY \
586 Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
587 RPCRTAPI void RPC_ENTRY \
588 Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
589 RPCRTAPI ULONG RPC_ENTRY \
590 Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
592 #define TYPE_MARSHAL(type) \
593 SIMPLE_TYPE_MARSHAL(type) \
594 RPCRTAPI void RPC_ENTRY \
595 Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
597 TYPE_MARSHAL(Pointer)
598 TYPE_MARSHAL(SimpleStruct)
599 TYPE_MARSHAL(ConformantStruct)
600 TYPE_MARSHAL(ConformantVaryingStruct)
601 TYPE_MARSHAL(ComplexStruct)
602 TYPE_MARSHAL(FixedArray)
603 TYPE_MARSHAL(ConformantArray)
604 TYPE_MARSHAL(ConformantVaryingArray)
605 TYPE_MARSHAL(VaryingArray)
606 TYPE_MARSHAL(ComplexArray)
607 TYPE_MARSHAL(EncapsulatedUnion)
608 TYPE_MARSHAL(NonEncapsulatedUnion)
609 TYPE_MARSHAL(XmitOrRepAs)
610 TYPE_MARSHAL(UserMarshal)
611 TYPE_MARSHAL(InterfacePointer)
613 SIMPLE_TYPE_MARSHAL(ConformantString)
614 SIMPLE_TYPE_MARSHAL(NonConformantString)
616 #undef TYPE_MARSHAL
617 #undef SIMPLE_TYPE_MARSHAL
619 RPCRTAPI void RPC_ENTRY
620 NdrCorrelationInitialize( PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG flags );
621 RPCRTAPI void RPC_ENTRY
622 NdrCorrelationPass( PMIDL_STUB_MESSAGE pStubMsg );
623 RPCRTAPI void RPC_ENTRY
624 NdrCorrelationFree( PMIDL_STUB_MESSAGE pStubMsg );
626 RPCRTAPI void RPC_ENTRY
627 NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, LONG NumberParams );
628 RPCRTAPI void RPC_ENTRY
629 NdrConvert( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
631 #define USER_MARSHAL_FC_BYTE 1
632 #define USER_MARSHAL_FC_CHAR 2
633 #define USER_MARSHAL_FC_SMALL 3
634 #define USER_MARSHAL_FC_USMALL 4
635 #define USER_MARSHAL_FC_WCHAR 5
636 #define USER_MARSHAL_FC_SHORT 6
637 #define USER_MARSHAL_FC_USHORT 7
638 #define USER_MARSHAL_FC_LONG 8
639 #define USER_MARSHAL_FC_ULONG 9
640 #define USER_MARSHAL_FC_FLOAT 10
641 #define USER_MARSHAL_FC_HYPER 11
642 #define USER_MARSHAL_FC_DOUBLE 12
644 RPCRTAPI unsigned char* RPC_ENTRY
645 NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar );
647 /* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
648 * returning structures/unions is different between Windows and gcc on i386. */
649 LONG_PTR RPC_VAR_ENTRY
650 NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
651 LONG_PTR RPC_VAR_ENTRY
652 NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
653 LONG_PTR RPC_VAR_ENTRY
654 NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
655 LONG_PTR RPC_VAR_ENTRY
656 NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
658 RPCRTAPI void RPC_ENTRY
659 NdrServerCall2( PRPC_MESSAGE pRpcMsg );
660 RPCRTAPI void RPC_ENTRY
661 NdrServerCall( PRPC_MESSAGE pRpcMsg );
662 RPCRTAPI void RPC_ENTRY
663 NdrAsyncServerCall( PRPC_MESSAGE pRpcMsg );
665 RPCRTAPI LONG RPC_ENTRY
666 NdrStubCall2( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
667 RPCRTAPI LONG RPC_ENTRY
668 NdrStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
669 RPCRTAPI LONG RPC_ENTRY
670 NdrAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
671 RPCRTAPI LONG RPC_ENTRY
672 NdrDcomAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
674 RPCRTAPI void* RPC_ENTRY
675 NdrAllocate( PMIDL_STUB_MESSAGE pStubMsg, SIZE_T Len ) __WINE_ALLOC_SIZE(2);
677 RPCRTAPI void RPC_ENTRY
678 NdrClearOutParameters( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, void *ArgAddr );
680 RPCRTAPI RPC_STATUS RPC_ENTRY
681 NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg, ULONG *pCommStatus,
682 ULONG *pFaultStatus, RPC_STATUS Status_ );
684 RPCRTAPI void* RPC_ENTRY
685 NdrOleAllocate( SIZE_T Size ) __WINE_ALLOC_SIZE(1);
686 RPCRTAPI void RPC_ENTRY
687 NdrOleFree( void* NodeToFree );
689 RPCRTAPI void RPC_ENTRY
690 NdrClientInitialize( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg,
691 PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum );
692 RPCRTAPI void RPC_ENTRY
693 NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg,
694 PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum );
695 RPCRTAPI unsigned char* RPC_ENTRY
696 NdrServerInitialize( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
697 RPCRTAPI unsigned char* RPC_ENTRY
698 NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
699 RPCRTAPI unsigned char* RPC_ENTRY
700 NdrServerInitializeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, PRPC_MESSAGE pRpcMsg );
701 RPCRTAPI void RPC_ENTRY
702 NdrServerInitializeMarshall( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg );
703 RPCRTAPI void RPC_ENTRY
704 NdrServerMarshall( struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
705 RPCRTAPI void RPC_ENTRY
706 NdrServerUnmarshall( struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg,
707 PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc,
708 PFORMAT_STRING pFormat, void *pParamList );
709 RPCRTAPI unsigned char* RPC_ENTRY
710 NdrGetBuffer( PMIDL_STUB_MESSAGE stubmsg, ULONG buflen, RPC_BINDING_HANDLE handle );
711 RPCRTAPI void RPC_ENTRY
712 NdrFreeBuffer( PMIDL_STUB_MESSAGE pStubMsg );
713 RPCRTAPI unsigned char* RPC_ENTRY
714 NdrSendReceive( PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer );
716 RPCRTAPI unsigned char * RPC_ENTRY
717 NdrNsGetBuffer( PMIDL_STUB_MESSAGE pStubMsg, ULONG BufferLength, RPC_BINDING_HANDLE Handle );
718 RPCRTAPI unsigned char * RPC_ENTRY
719 NdrNsSendReceive( PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pBufferEnd, RPC_BINDING_HANDLE *pAutoHandle );
721 RPCRTAPI RPC_STATUS RPC_ENTRY
722 NdrGetDcomProtocolVersion( PMIDL_STUB_MESSAGE pStubMsg, RPC_VERSION *pVersion );
724 RPCRTAPI PFULL_PTR_XLAT_TABLES RPC_ENTRY
725 NdrFullPointerXlatInit( ULONG NumberOfPointers, XLAT_SIDE XlatSide );
726 RPCRTAPI void RPC_ENTRY
727 NdrFullPointerXlatFree( PFULL_PTR_XLAT_TABLES pXlatTables );
728 RPCRTAPI int RPC_ENTRY
729 NdrFullPointerQueryPointer( PFULL_PTR_XLAT_TABLES pXlatTables, void *pPointer,
730 unsigned char QueryType, ULONG *pRefId );
731 RPCRTAPI int RPC_ENTRY
732 NdrFullPointerQueryRefId( PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId,
733 unsigned char QueryType, void **ppPointer );
734 RPCRTAPI void RPC_ENTRY
735 NdrFullPointerInsertRefId( PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId, void *pPointer );
736 RPCRTAPI int RPC_ENTRY
737 NdrFullPointerFree( PFULL_PTR_XLAT_TABLES pXlatTables, void *Pointer );
739 RPCRTAPI void RPC_ENTRY
740 NdrRpcSsEnableAllocate( PMIDL_STUB_MESSAGE pMessage );
741 RPCRTAPI void RPC_ENTRY
742 NdrRpcSsDisableAllocate( PMIDL_STUB_MESSAGE pMessage );
743 RPCRTAPI void RPC_ENTRY
744 NdrRpcSmSetClientToOsf( PMIDL_STUB_MESSAGE pMessage );
745 RPCRTAPI void * RPC_ENTRY
746 NdrRpcSmClientAllocate( SIZE_T Size ) __WINE_ALLOC_SIZE(1);
747 RPCRTAPI void RPC_ENTRY
748 NdrRpcSmClientFree( void *NodeToFree );
749 RPCRTAPI void * RPC_ENTRY
750 NdrRpcSsDefaultAllocate( SIZE_T Size ) __WINE_ALLOC_SIZE(1);
751 RPCRTAPI void RPC_ENTRY
752 NdrRpcSsDefaultFree( void *NodeToFree );
754 RPCRTAPI RPC_STATUS RPC_ENTRY
755 NdrGetUserMarshalInfo( ULONG *pFlags, ULONG InformationLevel, NDR_USER_MARSHAL_INFO *pMarshalInfo );
757 #ifdef __cplusplus
759 #endif
760 #endif /*__WINE_RPCNDR_H */