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