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