urlmon: Check pointer before use.
[wine/wine64.git] / include / rpcndr.h
bloba0968d58ec2e05c764893d6d33f72a1e4e78e28d
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 /* 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 #undef CONST_VTBL
34 #ifdef CONST_VTABLE
35 # define CONST_VTBL const
36 #else
37 # define CONST_VTBL
38 #endif
40 /* stupid #if can't handle casts... this __stupidity
41 is just a workaround for that limitation */
43 #define __NDR_CHAR_REP_MASK 0x000fL
44 #define __NDR_INT_REP_MASK 0x00f0L
45 #define __NDR_FLOAT_REP_MASK 0xff00L
47 #define __NDR_IEEE_FLOAT 0x0000L
48 #define __NDR_VAX_FLOAT 0x0100L
49 #define __NDR_IBM_FLOAT 0x0300L
51 #define __NDR_ASCII_CHAR 0x0000L
52 #define __NDR_EBCDIC_CHAR 0x0001L
54 #define __NDR_LITTLE_ENDIAN 0x0010L
55 #define __NDR_BIG_ENDIAN 0x0000L
57 /* Mac's are special */
58 #if defined(__RPC_MAC__)
59 # define __NDR_LOCAL_DATA_REPRESENTATION \
60 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_BIG_ENDIAN)
61 #else
62 # define __NDR_LOCAL_DATA_REPRESENTATION \
63 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_LITTLE_ENDIAN)
64 #endif
66 #define __NDR_LOCAL_ENDIAN \
67 (__NDR_LOCAL_DATA_REPRESENTATION & __NDR_INT_REP_MASK)
69 /* for convenience, define NDR_LOCAL_IS_BIG_ENDIAN iff it is */
70 #if __NDR_LOCAL_ENDIAN == __NDR_BIG_ENDIAN
71 # define NDR_LOCAL_IS_BIG_ENDIAN
72 #elif __NDR_LOCAL_ENDIAN == __NDR_LITTLE_ENDIAN
73 # undef NDR_LOCAL_IS_BIG_ENDIAN
74 #else
75 # error alien NDR_LOCAL_ENDIAN - Greg botched the defines again, please report
76 #endif
78 /* finally, do the casts like Microsoft */
80 #define NDR_CHAR_REP_MASK ((ULONG) __NDR_CHAR_REP_MASK)
81 #define NDR_INT_REP_MASK ((ULONG) __NDR_INT_REP_MASK)
82 #define NDR_FLOAT_REP_MASK ((ULONG) __NDR_FLOAT_REP_MASK)
83 #define NDR_IEEE_FLOAT ((ULONG) __NDR_IEEE_FLOAT)
84 #define NDR_VAX_FLOAT ((ULONG) __NDR_VAX_FLOAT)
85 #define NDR_IBM_FLOAT ((ULONG) __NDR_IBM_FLOAT)
86 #define NDR_ASCII_CHAR ((ULONG) __NDR_ASCII_CHAR)
87 #define NDR_EBCDIC_CHAR ((ULONG) __NDR_EBCDIC_CHAR)
88 #define NDR_LITTLE_ENDIAN ((ULONG) __NDR_LITTLE_ENDIAN)
89 #define NDR_BIG_ENDIAN ((ULONG) __NDR_BIG_ENDIAN)
90 #define NDR_LOCAL_DATA_REPRESENTATION ((ULONG) __NDR_LOCAL_DATA_REPRESENTATION)
91 #define NDR_LOCAL_ENDIAN ((ULONG) __NDR_LOCAL_ENDIAN)
94 #define TARGET_IS_NT50_OR_LATER 1
95 #define TARGET_IS_NT40_OR_LATER 1
96 #define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
98 #define small char
99 typedef unsigned char byte;
100 #define hyper __int64
101 #define MIDL_uhyper unsigned __int64
102 typedef unsigned char boolean;
104 #define __RPC_CALLEE WINAPI
105 #define RPC_VAR_ENTRY __cdecl
106 #define NDR_SHAREABLE static
108 #define MIDL_ascii_strlen(s) strlen(s)
109 #define MIDL_ascii_strcpy(d,s) strcpy(d,s)
110 #define MIDL_memset(d,v,n) memset(d,v,n)
111 #define midl_user_free MIDL_user_free
112 #define midl_user_allocate MIDL_user_allocate
114 #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
115 #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
116 (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
118 typedef struct
120 void *pad[2];
121 void *userContext;
122 } *NDR_SCONTEXT;
124 #define NDRSContextValue(hContext) (&(hContext)->userContext)
125 #define cbNDRContext 20
127 typedef void (__RPC_USER *NDR_RUNDOWN)(void *context);
128 typedef void (__RPC_USER *NDR_NOTIFY_ROUTINE)(void);
129 typedef void (__RPC_USER *NDR_NOTIFY2_ROUTINE)(boolean flag);
131 #define DECLSPEC_UUID(x)
132 #define MIDL_INTERFACE(x) struct
134 struct _MIDL_STUB_MESSAGE;
135 struct _MIDL_STUB_DESC;
136 struct _FULL_PTR_XLAT_TABLES;
137 struct NDR_ALLOC_ALL_NODES_CONTEXT;
138 struct NDR_POINTER_QUEUE_STATE;
140 typedef unsigned char *RPC_BUFPTR;
141 typedef unsigned long RPC_LENGTH;
142 typedef void (__RPC_USER *EXPR_EVAL)(struct _MIDL_STUB_MESSAGE *);
143 typedef const unsigned char *PFORMAT_STRING;
145 typedef struct
147 LONG Dimension;
148 ULONG *BufferConformanceMark;
149 ULONG *BufferVarianceMark;
150 ULONG *MaxCountArray;
151 ULONG *OffsetArray;
152 ULONG *ActualCountArray;
153 } ARRAY_INFO, *PARRAY_INFO;
155 typedef struct
157 ULONG WireCodeset;
158 ULONG DesiredReceivingCodeset;
159 void *CSArrayInfo;
160 } CS_STUB_INFO;
162 typedef struct _NDR_PIPE_DESC *PNDR_PIPE_DESC;
163 typedef struct _NDR_PIPE_MESSAGE *PNDR_PIPE_MESSAGE;
164 typedef struct _NDR_ASYNC_MESSAGE *PNDR_ASYNC_MESSAGE;
165 typedef struct _NDR_CORRELATION_INFO *PNDR_CORRELATION_INFO;
167 #include <pshpack4.h>
168 typedef struct _MIDL_STUB_MESSAGE
170 PRPC_MESSAGE RpcMsg;
171 unsigned char *Buffer;
172 unsigned char *BufferStart;
173 unsigned char *BufferEnd;
174 unsigned char *BufferMark;
175 ULONG BufferLength;
176 ULONG MemorySize;
177 unsigned char *Memory;
178 unsigned char IsClient;
179 unsigned char Pad;
180 unsigned short uFlags2;
181 int ReuseBuffer;
182 struct NDR_ALLOC_ALL_NODES_CONTEXT *pAllocAllNodesContext;
183 struct NDR_POINTER_QUEUE_STATE *pPointerQueueState;
184 int IgnoreEmbeddedPointers;
185 unsigned char *PointerBufferMark;
186 unsigned char fBufferValid;
187 unsigned char uFlags;
188 unsigned short UniquePtrCount;
189 ULONG_PTR MaxCount;
190 ULONG Offset;
191 ULONG ActualCount;
192 void * (__RPC_API *pfnAllocate)(size_t);
193 void (__RPC_API *pfnFree)(void *);
194 unsigned char *StackTop;
195 unsigned char *pPresentedType;
196 unsigned char *pTransmitType;
197 handle_t SavedHandle;
198 const struct _MIDL_STUB_DESC *StubDesc;
199 struct _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
200 ULONG FullPtrRefId;
201 ULONG PointerLength;
202 int fInDontFree:1;
203 int fDontCallFreeInst:1;
204 int fInOnlyParam:1;
205 int fHasReturn:1;
206 int fHasExtensions:1;
207 int fHasNewCorrDesc:1;
208 int fUnused:10;
209 int fUnused2:16;
210 DWORD dwDestContext;
211 void *pvDestContext;
212 NDR_SCONTEXT *SavedContextHandles;
213 LONG ParamNumber;
214 struct IRpcChannelBuffer *pRpcChannelBuffer;
215 PARRAY_INFO pArrayInfo;
216 ULONG *SizePtrCountArray;
217 ULONG *SizePtrOffsetArray;
218 ULONG *SizePtrLengthArray;
219 void *pArgQueue;
220 DWORD dwStubPhase;
221 void *LowStackMark;
222 PNDR_ASYNC_MESSAGE pAsyncMsg;
223 PNDR_CORRELATION_INFO pCorrInfo;
224 unsigned char *pCorrMemory;
225 void *pMemoryList;
226 CS_STUB_INFO *pCSInfo;
227 unsigned char *ConformanceMark;
228 unsigned char *VarianceMark;
229 INT_PTR Unused; /* BackingStoreLowMark on IA64 */
230 struct _NDR_PROC_CONTEXT *pContext;
231 void* ContextHandleHash;
232 void* pUserMarshalList;
233 INT_PTR Reserved51_3;
234 INT_PTR Reserved51_4;
235 INT_PTR Reserved51_5;
236 } MIDL_STUB_MESSAGE, *PMIDL_STUB_MESSAGE;
237 #include <poppack.h>
239 typedef void * (__RPC_API * GENERIC_BINDING_ROUTINE)(void *);
240 typedef void (__RPC_API * GENERIC_UNBIND_ROUTINE)(void *, unsigned char *);
242 typedef struct _GENERIC_BINDING_ROUTINE_PAIR
244 GENERIC_BINDING_ROUTINE pfnBind;
245 GENERIC_UNBIND_ROUTINE pfnUnbind;
246 } GENERIC_BINDING_ROUTINE_PAIR, *PGENERIC_BINDING_ROUTINE_PAIR;
248 typedef struct __GENERIC_BINDING_INFO
250 void *pObj;
251 unsigned int Size;
252 GENERIC_BINDING_ROUTINE pfnBind;
253 GENERIC_UNBIND_ROUTINE pfnUnbind;
254 } GENERIC_BINDING_INFO, *PGENERIC_BINDING_INFO;
256 typedef void (__RPC_USER *XMIT_HELPER_ROUTINE)(PMIDL_STUB_MESSAGE);
258 typedef struct _XMIT_ROUTINE_QUINTUPLE
260 XMIT_HELPER_ROUTINE pfnTranslateToXmit;
261 XMIT_HELPER_ROUTINE pfnTranslateFromXmit;
262 XMIT_HELPER_ROUTINE pfnFreeXmit;
263 XMIT_HELPER_ROUTINE pfnFreeInst;
264 } XMIT_ROUTINE_QUINTUPLE, *PXMIT_ROUTINE_QUINTUPLE;
266 typedef ULONG (__RPC_USER *USER_MARSHAL_SIZING_ROUTINE)(ULONG *, ULONG, void *);
267 typedef unsigned char * (__RPC_USER *USER_MARSHAL_MARSHALLING_ROUTINE)(ULONG *, unsigned char *, void *);
268 typedef unsigned char * (__RPC_USER *USER_MARSHAL_UNMARSHALLING_ROUTINE)(ULONG *, unsigned char *, void *);
269 typedef void (__RPC_USER *USER_MARSHAL_FREEING_ROUTINE)(ULONG *, void *);
271 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
273 USER_MARSHAL_SIZING_ROUTINE pfnBufferSize;
274 USER_MARSHAL_MARSHALLING_ROUTINE pfnMarshall;
275 USER_MARSHAL_UNMARSHALLING_ROUTINE pfnUnmarshall;
276 USER_MARSHAL_FREEING_ROUTINE pfnFree;
277 } USER_MARSHAL_ROUTINE_QUADRUPLE;
279 /* 'USRC' */
280 #define USER_MARSHAL_CB_SIGNATURE \
281 ( ( (DWORD)'U' << 24 ) | ( (DWORD)'S' << 16 ) | \
282 ( (DWORD)'R' << 8 ) | ( (DWORD)'C' ) )
284 typedef enum
286 USER_MARSHAL_CB_BUFFER_SIZE,
287 USER_MARSHAL_CB_MARSHALL,
288 USER_MARSHAL_CB_UNMARSHALL,
289 USER_MARSHAL_CB_FREE
290 } USER_MARSHAL_CB_TYPE;
292 typedef struct _USER_MARSHAL_CB
294 ULONG Flags;
295 PMIDL_STUB_MESSAGE pStubMsg;
296 PFORMAT_STRING pReserve;
297 ULONG Signature;
298 USER_MARSHAL_CB_TYPE CBType;
299 PFORMAT_STRING pFormat;
300 PFORMAT_STRING pTypeFormat;
301 } USER_MARSHAL_CB;
303 #define USER_CALL_CTXT_MASK(f) ((f) & 0x00ff)
304 #define USER_CALL_AUX_MASK(f) ((f) & 0xff00)
305 #define GET_USER_DATA_REP(f) HIWORD(f)
307 #define USER_CALL_IS_ASYNC 0x0100
308 #define USER_CALL_NEW_CORRELATION_DESC 0x0200
310 typedef struct _MALLOC_FREE_STRUCT
312 void * (__RPC_USER *pfnAllocate)(size_t);
313 void (__RPC_USER *pfnFree)(void *);
314 } MALLOC_FREE_STRUCT;
316 typedef struct _COMM_FAULT_OFFSETS
318 short CommOffset;
319 short FaultOffset;
320 } COMM_FAULT_OFFSETS;
322 typedef struct _MIDL_STUB_DESC
324 void *RpcInterfaceInformation;
325 void * (__RPC_API *pfnAllocate)(size_t);
326 void (__RPC_API *pfnFree)(void *);
327 union {
328 handle_t *pAutoHandle;
329 handle_t *pPrimitiveHandle;
330 PGENERIC_BINDING_INFO pGenericBindingInfo;
331 } IMPLICIT_HANDLE_INFO;
332 const NDR_RUNDOWN *apfnNdrRundownRoutines;
333 const GENERIC_BINDING_ROUTINE_PAIR *aGenericBindingRoutinePairs;
334 const EXPR_EVAL *apfnExprEval;
335 const XMIT_ROUTINE_QUINTUPLE *aXmitQuintuple;
336 const unsigned char *pFormatTypes;
337 int fCheckBounds;
338 ULONG Version;
339 MALLOC_FREE_STRUCT *pMallocFreeStruct;
340 LONG MIDLVersion;
341 const COMM_FAULT_OFFSETS *CommFaultOffsets;
342 const USER_MARSHAL_ROUTINE_QUADRUPLE *aUserMarshalQuadruple;
343 const NDR_NOTIFY_ROUTINE *NotifyRoutineTable;
344 ULONG_PTR mFlags;
345 ULONG_PTR Reserved3;
346 ULONG_PTR Reserved4;
347 ULONG_PTR Reserved5;
348 } MIDL_STUB_DESC;
349 typedef const MIDL_STUB_DESC *PMIDL_STUB_DESC;
351 typedef struct _MIDL_FORMAT_STRING
353 short Pad;
354 #if defined(__GNUC__)
355 unsigned char Format[0];
356 #else
357 unsigned char Format[1];
358 #endif
359 } MIDL_FORMAT_STRING;
361 typedef struct _MIDL_SYNTAX_INFO
363 RPC_SYNTAX_IDENTIFIER TransferSyntax;
364 RPC_DISPATCH_TABLE* DispatchTable;
365 PFORMAT_STRING ProcString;
366 const unsigned short* FmtStringOffset;
367 PFORMAT_STRING TypeString;
368 const void* aUserMarshalQuadruple;
369 ULONG_PTR pReserved1;
370 ULONG_PTR pReserved2;
371 } MIDL_SYNTAX_INFO, *PMIDL_SYNTAX_INFO;
373 typedef void (__RPC_API *STUB_THUNK)( PMIDL_STUB_MESSAGE );
375 typedef LONG (__RPC_API *SERVER_ROUTINE)();
377 typedef struct _MIDL_SERVER_INFO_
379 PMIDL_STUB_DESC pStubDesc;
380 const SERVER_ROUTINE *DispatchTable;
381 PFORMAT_STRING ProcString;
382 const unsigned short *FmtStringOffset;
383 const STUB_THUNK *ThunkTable;
384 PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
385 ULONG_PTR nCount;
386 PMIDL_SYNTAX_INFO pSyntaxInfo;
387 } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
389 typedef struct _MIDL_STUBLESS_PROXY_INFO
391 PMIDL_STUB_DESC pStubDesc;
392 PFORMAT_STRING ProcFormatString;
393 const unsigned short *FormatStringOffset;
394 PRPC_SYNTAX_IDENTIFIER pTransferSyntax;
395 ULONG_PTR nCount;
396 PMIDL_SYNTAX_INFO pSyntaxInfo;
397 } MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO;
399 typedef union _CLIENT_CALL_RETURN
401 void *Pointer;
402 LONG_PTR Simple;
403 } CLIENT_CALL_RETURN;
405 typedef enum {
406 STUB_UNMARSHAL,
407 STUB_CALL_SERVER,
408 STUB_MARSHAL,
409 STUB_CALL_SERVER_NO_HRESULT
410 } STUB_PHASE;
412 typedef enum {
413 PROXY_CALCSIZE,
414 PROXY_GETBUFFER,
415 PROXY_MARSHAL,
416 PROXY_SENDRECEIVE,
417 PROXY_UNMARSHAL
418 } PROXY_PHASE;
420 typedef enum {
421 XLAT_SERVER = 1,
422 XLAT_CLIENT
423 } XLAT_SIDE;
425 typedef struct _FULL_PTR_TO_REFID_ELEMENT {
426 struct _FULL_PTR_TO_REFID_ELEMENT *Next;
427 void *Pointer;
428 ULONG RefId;
429 unsigned char State;
430 } FULL_PTR_TO_REFID_ELEMENT, *PFULL_PTR_TO_REFID_ELEMENT;
432 /* Full pointer translation tables */
433 typedef struct _FULL_PTR_XLAT_TABLES {
434 struct {
435 void **XlatTable;
436 unsigned char *StateTable;
437 ULONG NumberOfEntries;
438 } RefIdToPointer;
440 struct {
441 PFULL_PTR_TO_REFID_ELEMENT *XlatTable;
442 ULONG NumberOfBuckets;
443 ULONG HashMask;
444 } PointerToRefId;
446 ULONG NextRefId;
447 XLAT_SIDE XlatSide;
448 } FULL_PTR_XLAT_TABLES, *PFULL_PTR_XLAT_TABLES;
450 struct IRpcStubBuffer;
452 typedef ULONG error_status_t;
453 typedef void * NDR_CCONTEXT;
455 typedef struct _SCONTEXT_QUEUE {
456 ULONG NumberOfObjects;
457 NDR_SCONTEXT *ArrayOfObjects;
458 } SCONTEXT_QUEUE, *PSCONTEXT_QUEUE;
460 typedef struct _NDR_USER_MARSHAL_INFO_LEVEL1
462 void *Buffer;
463 ULONG BufferSize;
464 void * (__RPC_API *pfnAllocate)(size_t);
465 void (__RPC_API *pfnFree)(void *);
466 struct IRpcChannelBuffer *pRpcChannelBuffer;
467 ULONG_PTR Reserved[5];
468 } NDR_USER_MARSHAL_INFO_LEVEL1;
470 typedef struct _NDR_USER_MARSHAL_INFO
472 ULONG InformationLevel;
473 union
475 NDR_USER_MARSHAL_INFO_LEVEL1 Level1;
476 } DUMMYUNIONNAME1;
477 } NDR_USER_MARSHAL_INFO;
479 /* Context Handles */
481 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
482 NDRCContextBinding( NDR_CCONTEXT CContext );
484 RPCRTAPI void RPC_ENTRY
485 NDRCContextMarshall( NDR_CCONTEXT CContext, void *pBuff );
487 RPCRTAPI void RPC_ENTRY
488 NDRCContextUnmarshall( NDR_CCONTEXT *pCContext, RPC_BINDING_HANDLE hBinding,
489 void *pBuff, ULONG DataRepresentation );
491 RPCRTAPI void RPC_ENTRY
492 NDRSContextMarshall( NDR_SCONTEXT CContext, void *pBuff, NDR_RUNDOWN userRunDownIn );
494 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
495 NDRSContextUnmarshall( void *pBuff, ULONG DataRepresentation );
497 RPCRTAPI void RPC_ENTRY
498 NDRSContextMarshallEx( RPC_BINDING_HANDLE BindingHandle, NDR_SCONTEXT CContext,
499 void *pBuff, NDR_RUNDOWN userRunDownIn );
501 RPCRTAPI void RPC_ENTRY
502 NDRSContextMarshall2( RPC_BINDING_HANDLE BindingHandle, NDR_SCONTEXT CContext,
503 void *pBuff, NDR_RUNDOWN userRunDownIn, void * CtxGuard,
504 ULONG Flags );
506 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
507 NDRSContextUnmarshallEx( RPC_BINDING_HANDLE BindingHandle, void *pBuff,
508 ULONG DataRepresentation );
510 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
511 NDRSContextUnmarshall2( RPC_BINDING_HANDLE BindingHandle, void *pBuff,
512 ULONG DataRepresentation, void *CtxGuard,
513 ULONG Flags );
515 RPCRTAPI void RPC_ENTRY
516 NdrClientContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT ContextHandle, int fCheck );
518 RPCRTAPI void RPC_ENTRY
519 NdrClientContextUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT* pContextHandle,
520 RPC_BINDING_HANDLE BindHandle );
522 RPCRTAPI void RPC_ENTRY
523 NdrServerContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle, NDR_RUNDOWN RundownRoutine );
525 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
526 NdrServerContextUnmarshall( PMIDL_STUB_MESSAGE pStubMsg );
528 RPCRTAPI void RPC_ENTRY
529 NdrContextHandleSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
531 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
532 NdrContextHandleInitialize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
534 RPCRTAPI void RPC_ENTRY
535 NdrServerContextNewMarshall( PMIDL_STUB_MESSAGE pStubMsg, NDR_SCONTEXT ContextHandle,
536 NDR_RUNDOWN RundownRoutine, PFORMAT_STRING pFormat );
538 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
539 NdrServerContextNewUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
541 RPCRTAPI RPC_STATUS RPC_ENTRY
542 RpcSmDestroyClientContext( void **ContextHandle );
544 RPCRTAPI void RPC_ENTRY
545 RpcSsDestroyClientContext( void **ContextHandle );
547 RPCRTAPI void RPC_ENTRY
548 NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
549 RPCRTAPI void RPC_ENTRY
550 NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, unsigned char FormatChar );
552 /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
553 #define SIMPLE_TYPE_MARSHAL(type) \
554 RPCRTAPI unsigned char* RPC_ENTRY \
555 Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
556 RPCRTAPI unsigned char* RPC_ENTRY \
557 Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
558 RPCRTAPI void RPC_ENTRY \
559 Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
560 RPCRTAPI ULONG RPC_ENTRY \
561 Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
563 #define TYPE_MARSHAL(type) \
564 SIMPLE_TYPE_MARSHAL(type) \
565 RPCRTAPI void RPC_ENTRY \
566 Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
568 TYPE_MARSHAL(Pointer)
569 TYPE_MARSHAL(SimpleStruct)
570 TYPE_MARSHAL(ConformantStruct)
571 TYPE_MARSHAL(ConformantVaryingStruct)
572 TYPE_MARSHAL(ComplexStruct)
573 TYPE_MARSHAL(FixedArray)
574 TYPE_MARSHAL(ConformantArray)
575 TYPE_MARSHAL(ConformantVaryingArray)
576 TYPE_MARSHAL(VaryingArray)
577 TYPE_MARSHAL(ComplexArray)
578 TYPE_MARSHAL(EncapsulatedUnion)
579 TYPE_MARSHAL(NonEncapsulatedUnion)
580 TYPE_MARSHAL(ByteCountPointer)
581 TYPE_MARSHAL(XmitOrRepAs)
582 TYPE_MARSHAL(UserMarshal)
583 TYPE_MARSHAL(InterfacePointer)
584 TYPE_MARSHAL(Range)
586 SIMPLE_TYPE_MARSHAL(ConformantString)
587 SIMPLE_TYPE_MARSHAL(NonConformantString)
589 #undef TYPE_MARSHAL
590 #undef SIMPLE_TYPE_MARSHAL
592 RPCRTAPI void RPC_ENTRY
593 NdrCorrelationInitialize( PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG flags );
594 RPCRTAPI void RPC_ENTRY
595 NdrCorrelationPass( PMIDL_STUB_MESSAGE pStubMsg );
596 RPCRTAPI void RPC_ENTRY
597 NdrCorrelationFree( PMIDL_STUB_MESSAGE pStubMsg );
599 RPCRTAPI void RPC_ENTRY
600 NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, LONG NumberParams );
601 RPCRTAPI void RPC_ENTRY
602 NdrConvert( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
604 #define USER_MARSHAL_FC_BYTE 1
605 #define USER_MARSHAL_FC_CHAR 2
606 #define USER_MARSHAL_FC_SMALL 3
607 #define USER_MARSHAL_FC_USMALL 4
608 #define USER_MARSHAL_FC_WCHAR 5
609 #define USER_MARSHAL_FC_SHORT 6
610 #define USER_MARSHAL_FC_USHORT 7
611 #define USER_MARSHAL_FC_LONG 8
612 #define USER_MARSHAL_FC_ULONG 9
613 #define USER_MARSHAL_FC_FLOAT 10
614 #define USER_MARSHAL_FC_HYPER 11
615 #define USER_MARSHAL_FC_DOUBLE 12
617 RPCRTAPI unsigned char* RPC_ENTRY
618 NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar );
620 /* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
621 * returning structures/unions is different between Windows and gcc on i386. */
622 LONG_PTR RPC_VAR_ENTRY
623 NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
624 LONG_PTR RPC_VAR_ENTRY
625 NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
626 LONG_PTR RPC_VAR_ENTRY
627 NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
628 LONG_PTR RPC_VAR_ENTRY
629 NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
631 RPCRTAPI void RPC_ENTRY
632 NdrServerCall2( PRPC_MESSAGE pRpcMsg );
633 RPCRTAPI void RPC_ENTRY
634 NdrServerCall( PRPC_MESSAGE pRpcMsg );
635 RPCRTAPI void RPC_ENTRY
636 NdrAsyncServerCall( PRPC_MESSAGE pRpcMsg );
638 RPCRTAPI LONG RPC_ENTRY
639 NdrStubCall2( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
640 RPCRTAPI LONG RPC_ENTRY
641 NdrStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
642 RPCRTAPI LONG RPC_ENTRY
643 NdrAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
644 RPCRTAPI LONG RPC_ENTRY
645 NdrDcomAsyncStubCall( struct IRpcStubBuffer* pThis, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, DWORD * pdwStubPhase );
647 RPCRTAPI void* RPC_ENTRY
648 NdrAllocate( PMIDL_STUB_MESSAGE pStubMsg, size_t Len );
650 RPCRTAPI void RPC_ENTRY
651 NdrClearOutParameters( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, void *ArgAddr );
653 RPCRTAPI RPC_STATUS RPC_ENTRY
654 NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg, ULONG *pCommStatus,
655 ULONG *pFaultStatus, RPC_STATUS Status_ );
657 RPCRTAPI void* RPC_ENTRY
658 NdrOleAllocate( size_t Size );
659 RPCRTAPI void RPC_ENTRY
660 NdrOleFree( void* NodeToFree );
662 RPCRTAPI void RPC_ENTRY
663 NdrClientInitialize( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg,
664 PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum );
665 RPCRTAPI void RPC_ENTRY
666 NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg,
667 PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum );
668 RPCRTAPI unsigned char* RPC_ENTRY
669 NdrServerInitialize( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
670 RPCRTAPI unsigned char* RPC_ENTRY
671 NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc );
672 RPCRTAPI unsigned char* RPC_ENTRY
673 NdrServerInitializeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, PRPC_MESSAGE pRpcMsg );
674 RPCRTAPI void RPC_ENTRY
675 NdrServerInitializeMarshall( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg );
676 RPCRTAPI void RPC_ENTRY
677 NdrServerMarshall( struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
678 RPCRTAPI void RPC_ENTRY
679 NdrServerUnmarshall( struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg,
680 PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc,
681 PFORMAT_STRING pFormat, void *pParamList );
682 RPCRTAPI unsigned char* RPC_ENTRY
683 NdrGetBuffer( PMIDL_STUB_MESSAGE stubmsg, ULONG buflen, RPC_BINDING_HANDLE handle );
684 RPCRTAPI void RPC_ENTRY
685 NdrFreeBuffer( PMIDL_STUB_MESSAGE pStubMsg );
686 RPCRTAPI unsigned char* RPC_ENTRY
687 NdrSendReceive( PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer );
689 RPCRTAPI unsigned char * RPC_ENTRY
690 NdrNsGetBuffer( PMIDL_STUB_MESSAGE pStubMsg, ULONG BufferLength, RPC_BINDING_HANDLE Handle );
691 RPCRTAPI unsigned char * RPC_ENTRY
692 NdrNsSendReceive( PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pBufferEnd, RPC_BINDING_HANDLE *pAutoHandle );
694 RPCRTAPI RPC_STATUS RPC_ENTRY
695 NdrGetDcomProtocolVersion( PMIDL_STUB_MESSAGE pStubMsg, RPC_VERSION *pVersion );
697 RPCRTAPI PFULL_PTR_XLAT_TABLES RPC_ENTRY
698 NdrFullPointerXlatInit( ULONG NumberOfPointers, XLAT_SIDE XlatSide );
699 RPCRTAPI void RPC_ENTRY
700 NdrFullPointerXlatFree( PFULL_PTR_XLAT_TABLES pXlatTables );
701 RPCRTAPI int RPC_ENTRY
702 NdrFullPointerQueryPointer( PFULL_PTR_XLAT_TABLES pXlatTables, void *pPointer,
703 unsigned char QueryType, ULONG *pRefId );
704 RPCRTAPI int RPC_ENTRY
705 NdrFullPointerQueryRefId( PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId,
706 unsigned char QueryType, void **ppPointer );
707 RPCRTAPI void RPC_ENTRY
708 NdrFullPointerInsertRefId( PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId, void *pPointer );
709 RPCRTAPI int RPC_ENTRY
710 NdrFullPointerFree( PFULL_PTR_XLAT_TABLES pXlatTables, void *Pointer );
712 RPCRTAPI void RPC_ENTRY
713 NdrRpcSsEnableAllocate( PMIDL_STUB_MESSAGE pMessage );
714 RPCRTAPI void RPC_ENTRY
715 NdrRpcSsDisableAllocate( PMIDL_STUB_MESSAGE pMessage );
716 RPCRTAPI void RPC_ENTRY
717 NdrRpcSmSetClientToOsf( PMIDL_STUB_MESSAGE pMessage );
718 RPCRTAPI void * RPC_ENTRY
719 NdrRpcSmClientAllocate( size_t Size );
720 RPCRTAPI void RPC_ENTRY
721 NdrRpcSmClientFree( void *NodeToFree );
722 RPCRTAPI void * RPC_ENTRY
723 NdrRpcSsDefaultAllocate( size_t Size );
724 RPCRTAPI void RPC_ENTRY
725 NdrRpcSsDefaultFree( void *NodeToFree );
727 RPCRTAPI RPC_STATUS RPC_ENTRY
728 NdrGetUserMarshalInfo( ULONG *pFlags, ULONG InformationLevel, NDR_USER_MARSHAL_INFO *pMarshalInfo );
730 #ifdef __cplusplus
732 #endif
733 #endif /*__WINE_RPCNDR_H */