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