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