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