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