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