2 * Copyright (C) 2000 Francois Gouget
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.
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.
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
19 #ifndef __RPCNDR_H_VERSION__
20 /* FIXME: What version? Perhaps something is better than nothing, however incorrect */
21 #define __RPCNDR_H_VERSION__ ( 399 )
24 #ifndef __WINE_RPCNDR_H
25 #define __WINE_RPCNDR_H
35 #pragma warning(disable:4201)
36 #pragma warning(disable:4255)
37 #pragma warning(disable:4820)
42 # define CONST_VTBL const
47 /* stupid #if can't handle casts... this __stupidity
48 is just a workaround for that limitation */
50 #define __NDR_CHAR_REP_MASK 0x000fL
51 #define __NDR_INT_REP_MASK 0x00f0L
52 #define __NDR_FLOAT_REP_MASK 0xff00L
54 #define __NDR_IEEE_FLOAT 0x0000L
55 #define __NDR_VAX_FLOAT 0x0100L
56 #define __NDR_IBM_FLOAT 0x0300L
58 #define __NDR_ASCII_CHAR 0x0000L
59 #define __NDR_EBCDIC_CHAR 0x0001L
61 #define __NDR_LITTLE_ENDIAN 0x0010L
62 #define __NDR_BIG_ENDIAN 0x0000L
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)
69 # define __NDR_LOCAL_DATA_REPRESENTATION \
70 (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_LITTLE_ENDIAN)
73 #define __NDR_LOCAL_ENDIAN \
74 (__NDR_LOCAL_DATA_REPRESENTATION & __NDR_INT_REP_MASK)
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
82 # error alien NDR_LOCAL_ENDIAN - Greg botched the defines again, please report
85 /* finally, do the casts like Microsoft */
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)
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
106 typedef unsigned char byte
;
108 typedef UINT64 MIDL_uhyper
;
109 typedef unsigned char boolean
;
111 #define __RPC_CALLEE WINAPI
112 #define RPC_VAR_ENTRY __cdecl
113 #define NDR_SHAREABLE static
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
121 void * __RPC_USER
MIDL_user_allocate(size_t size
);
122 void __RPC_USER
MIDL_user_free( void * );
124 #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
125 #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
126 (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
128 #define RPC_BAD_STUB_DATA_EXCEPTION_FILTER \
129 ((RpcExceptionCode() == STATUS_ACCESS_VIOLATION) || \
130 (RpcExceptionCode() == STATUS_DATATYPE_MISALIGNMENT) || \
131 (RpcExceptionCode() == RPC_X_BAD_STUB_DATA) || \
132 (RpcExceptionCode() == RPC_S_INVALID_BOUND))
134 typedef struct tagNDR_SCONTEXT
140 #define NDRSContextValue(hContext) (&(hContext)->userContext)
141 #define cbNDRContext 20
143 typedef void (__RPC_USER
*NDR_RUNDOWN
)(void *context
);
144 typedef void (__RPC_USER
*NDR_NOTIFY_ROUTINE
)(void);
145 typedef void (__RPC_USER
*NDR_NOTIFY2_ROUTINE
)(boolean flag
);
147 #define DECLSPEC_UUID(x)
148 #define MIDL_INTERFACE(x) struct
150 struct _MIDL_STUB_MESSAGE
;
151 struct _MIDL_STUB_DESC
;
152 struct _FULL_PTR_XLAT_TABLES
;
153 struct NDR_ALLOC_ALL_NODES_CONTEXT
;
154 struct NDR_POINTER_QUEUE_STATE
;
156 typedef unsigned char *RPC_BUFPTR
;
157 typedef ULONG RPC_LENGTH
;
158 typedef void (__RPC_USER
*EXPR_EVAL
)(struct _MIDL_STUB_MESSAGE
*);
159 typedef const unsigned char *PFORMAT_STRING
;
164 ULONG
*BufferConformanceMark
;
165 ULONG
*BufferVarianceMark
;
166 ULONG
*MaxCountArray
;
168 ULONG
*ActualCountArray
;
169 } ARRAY_INFO
, *PARRAY_INFO
;
174 ULONG DesiredReceivingCodeset
;
178 typedef struct _NDR_PIPE_DESC
*PNDR_PIPE_DESC
;
179 typedef struct _NDR_PIPE_MESSAGE
*PNDR_PIPE_MESSAGE
;
180 typedef struct _NDR_ASYNC_MESSAGE
*PNDR_ASYNC_MESSAGE
;
181 typedef struct _NDR_CORRELATION_INFO
*PNDR_CORRELATION_INFO
;
183 typedef struct _MIDL_STUB_MESSAGE
186 unsigned char *Buffer
;
187 unsigned char *BufferStart
;
188 unsigned char *BufferEnd
;
189 unsigned char *BufferMark
;
192 unsigned char *Memory
;
193 unsigned char IsClient
;
195 unsigned short uFlags2
;
197 struct NDR_ALLOC_ALL_NODES_CONTEXT
*pAllocAllNodesContext
;
198 struct NDR_POINTER_QUEUE_STATE
*pPointerQueueState
;
199 int IgnoreEmbeddedPointers
;
200 unsigned char *PointerBufferMark
;
201 unsigned char CorrDespIncrement
;
202 unsigned char uFlags
;
203 unsigned short UniquePtrCount
;
207 void * (__WINE_ALLOC_SIZE(1) __RPC_API
*pfnAllocate
)(SIZE_T
);
208 void (__RPC_API
*pfnFree
)(void *);
209 unsigned char *StackTop
;
210 unsigned char *pPresentedType
;
211 unsigned char *pTransmitType
;
212 handle_t SavedHandle
;
213 const struct _MIDL_STUB_DESC
*StubDesc
;
214 struct _FULL_PTR_XLAT_TABLES
*FullPtrXlatTables
;
217 unsigned int fInDontFree
:1;
218 unsigned int fDontCallFreeInst
:1;
219 unsigned int fInOnlyParam
:1;
220 unsigned int fHasReturn
:1;
221 unsigned int fHasExtensions
:1;
222 unsigned int fHasNewCorrDesc
:1;
223 unsigned int fIsIn
:1;
224 unsigned int fIsOut
:1;
225 unsigned int fIsOicf
:1;
226 unsigned int fBufferValid
:1;
227 unsigned int fHasMemoryValidateCallback
:1;
228 unsigned int fInFree
:1;
229 unsigned int fNeedMCCP
:1;
234 NDR_SCONTEXT
*SavedContextHandles
;
236 struct IRpcChannelBuffer
*pRpcChannelBuffer
;
237 PARRAY_INFO pArrayInfo
;
238 ULONG
*SizePtrCountArray
;
239 ULONG
*SizePtrOffsetArray
;
240 ULONG
*SizePtrLengthArray
;
244 PNDR_ASYNC_MESSAGE pAsyncMsg
;
245 PNDR_CORRELATION_INFO pCorrInfo
;
246 unsigned char *pCorrMemory
;
248 CS_STUB_INFO
*pCSInfo
;
249 unsigned char *ConformanceMark
;
250 unsigned char *VarianceMark
;
251 INT_PTR Unused
; /* BackingStoreLowMark on IA64 */
252 struct _NDR_PROC_CONTEXT
*pContext
;
253 void* ContextHandleHash
;
254 void* pUserMarshalList
;
255 INT_PTR Reserved51_3
;
256 INT_PTR Reserved51_4
;
257 INT_PTR Reserved51_5
;
258 } MIDL_STUB_MESSAGE
, *PMIDL_STUB_MESSAGE
;
260 typedef void * (__RPC_API
* GENERIC_BINDING_ROUTINE
)(void *);
261 typedef void (__RPC_API
* GENERIC_UNBIND_ROUTINE
)(void *, unsigned char *);
263 typedef struct _GENERIC_BINDING_ROUTINE_PAIR
265 GENERIC_BINDING_ROUTINE pfnBind
;
266 GENERIC_UNBIND_ROUTINE pfnUnbind
;
267 } GENERIC_BINDING_ROUTINE_PAIR
, *PGENERIC_BINDING_ROUTINE_PAIR
;
269 typedef struct __GENERIC_BINDING_INFO
273 GENERIC_BINDING_ROUTINE pfnBind
;
274 GENERIC_UNBIND_ROUTINE pfnUnbind
;
275 } GENERIC_BINDING_INFO
, *PGENERIC_BINDING_INFO
;
277 typedef void (__RPC_USER
*XMIT_HELPER_ROUTINE
)(PMIDL_STUB_MESSAGE
);
279 typedef struct _XMIT_ROUTINE_QUINTUPLE
281 XMIT_HELPER_ROUTINE pfnTranslateToXmit
;
282 XMIT_HELPER_ROUTINE pfnTranslateFromXmit
;
283 XMIT_HELPER_ROUTINE pfnFreeXmit
;
284 XMIT_HELPER_ROUTINE pfnFreeInst
;
285 } XMIT_ROUTINE_QUINTUPLE
, *PXMIT_ROUTINE_QUINTUPLE
;
287 typedef ULONG (__RPC_USER
*USER_MARSHAL_SIZING_ROUTINE
)(ULONG
*, ULONG
, void *);
288 typedef unsigned char * (__RPC_USER
*USER_MARSHAL_MARSHALLING_ROUTINE
)(ULONG
*, unsigned char *, void *);
289 typedef unsigned char * (__RPC_USER
*USER_MARSHAL_UNMARSHALLING_ROUTINE
)(ULONG
*, unsigned char *, void *);
290 typedef void (__RPC_USER
*USER_MARSHAL_FREEING_ROUTINE
)(ULONG
*, void *);
292 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
294 USER_MARSHAL_SIZING_ROUTINE pfnBufferSize
;
295 USER_MARSHAL_MARSHALLING_ROUTINE pfnMarshall
;
296 USER_MARSHAL_UNMARSHALLING_ROUTINE pfnUnmarshall
;
297 USER_MARSHAL_FREEING_ROUTINE pfnFree
;
298 } USER_MARSHAL_ROUTINE_QUADRUPLE
;
301 #define USER_MARSHAL_CB_SIGNATURE \
302 ( ( (DWORD)'U' << 24 ) | ( (DWORD)'S' << 16 ) | \
303 ( (DWORD)'R' << 8 ) | ( (DWORD)'C' ) )
307 USER_MARSHAL_CB_BUFFER_SIZE
,
308 USER_MARSHAL_CB_MARSHALL
,
309 USER_MARSHAL_CB_UNMARSHALL
,
311 } USER_MARSHAL_CB_TYPE
;
313 typedef struct _USER_MARSHAL_CB
316 PMIDL_STUB_MESSAGE pStubMsg
;
317 PFORMAT_STRING pReserve
;
319 USER_MARSHAL_CB_TYPE CBType
;
320 PFORMAT_STRING pFormat
;
321 PFORMAT_STRING pTypeFormat
;
324 #define USER_CALL_CTXT_MASK(f) ((f) & 0x00ff)
325 #define USER_CALL_AUX_MASK(f) ((f) & 0xff00)
326 #define GET_USER_DATA_REP(f) HIWORD(f)
328 #define USER_CALL_IS_ASYNC 0x0100
329 #define USER_CALL_NEW_CORRELATION_DESC 0x0200
331 typedef struct _MALLOC_FREE_STRUCT
333 void * (__WINE_ALLOC_SIZE(1) __RPC_USER
*pfnAllocate
)(SIZE_T
);
334 void (__RPC_USER
*pfnFree
)(void *);
335 } MALLOC_FREE_STRUCT
;
337 typedef struct _COMM_FAULT_OFFSETS
341 } COMM_FAULT_OFFSETS
;
343 typedef struct _MIDL_STUB_DESC
345 void *RpcInterfaceInformation
;
346 void * (__WINE_ALLOC_SIZE(1) __RPC_API
*pfnAllocate
)(SIZE_T
);
347 void (__RPC_API
*pfnFree
)(void *);
349 handle_t
*pAutoHandle
;
350 handle_t
*pPrimitiveHandle
;
351 PGENERIC_BINDING_INFO pGenericBindingInfo
;
352 } IMPLICIT_HANDLE_INFO
;
353 const NDR_RUNDOWN
*apfnNdrRundownRoutines
;
354 const GENERIC_BINDING_ROUTINE_PAIR
*aGenericBindingRoutinePairs
;
355 const EXPR_EVAL
*apfnExprEval
;
356 const XMIT_ROUTINE_QUINTUPLE
*aXmitQuintuple
;
357 const unsigned char *pFormatTypes
;
360 MALLOC_FREE_STRUCT
*pMallocFreeStruct
;
362 const COMM_FAULT_OFFSETS
*CommFaultOffsets
;
363 const USER_MARSHAL_ROUTINE_QUADRUPLE
*aUserMarshalQuadruple
;
364 const NDR_NOTIFY_ROUTINE
*NotifyRoutineTable
;
370 typedef const MIDL_STUB_DESC
*PMIDL_STUB_DESC
;
372 typedef struct _MIDL_FORMAT_STRING
375 #if defined(__GNUC__)
376 unsigned char Format
[0];
378 unsigned char Format
[1];
380 } MIDL_FORMAT_STRING
;
382 typedef struct _MIDL_SYNTAX_INFO
384 RPC_SYNTAX_IDENTIFIER TransferSyntax
;
385 RPC_DISPATCH_TABLE
* DispatchTable
;
386 PFORMAT_STRING ProcString
;
387 const unsigned short* FmtStringOffset
;
388 PFORMAT_STRING TypeString
;
389 const void* aUserMarshalQuadruple
;
390 ULONG_PTR pReserved1
;
391 ULONG_PTR pReserved2
;
392 } MIDL_SYNTAX_INFO
, *PMIDL_SYNTAX_INFO
;
394 typedef void (__RPC_API
*STUB_THUNK
)( PMIDL_STUB_MESSAGE
);
396 #ifdef WINE_STRICT_PROTOTYPES
397 typedef LONG (__RPC_API
*SERVER_ROUTINE
)(void);
399 typedef LONG (__RPC_API
*SERVER_ROUTINE
)();
402 typedef struct _MIDL_SERVER_INFO_
404 PMIDL_STUB_DESC pStubDesc
;
405 const SERVER_ROUTINE
*DispatchTable
;
406 PFORMAT_STRING ProcString
;
407 const unsigned short *FmtStringOffset
;
408 const STUB_THUNK
*ThunkTable
;
409 PRPC_SYNTAX_IDENTIFIER pTransferSyntax
;
411 PMIDL_SYNTAX_INFO pSyntaxInfo
;
412 } MIDL_SERVER_INFO
, *PMIDL_SERVER_INFO
;
414 typedef struct _MIDL_STUBLESS_PROXY_INFO
416 PMIDL_STUB_DESC pStubDesc
;
417 PFORMAT_STRING ProcFormatString
;
418 const unsigned short *FormatStringOffset
;
419 PRPC_SYNTAX_IDENTIFIER pTransferSyntax
;
421 PMIDL_SYNTAX_INFO pSyntaxInfo
;
422 } MIDL_STUBLESS_PROXY_INFO
, *PMIDL_STUBLESS_PROXY_INFO
;
424 typedef union _CLIENT_CALL_RETURN
428 } CLIENT_CALL_RETURN
;
434 STUB_CALL_SERVER_NO_HRESULT
450 typedef struct _FULL_PTR_TO_REFID_ELEMENT
{
451 struct _FULL_PTR_TO_REFID_ELEMENT
*Next
;
455 } FULL_PTR_TO_REFID_ELEMENT
, *PFULL_PTR_TO_REFID_ELEMENT
;
457 /* Full pointer translation tables */
458 typedef struct _FULL_PTR_XLAT_TABLES
{
461 unsigned char *StateTable
;
462 ULONG NumberOfEntries
;
466 PFULL_PTR_TO_REFID_ELEMENT
*XlatTable
;
467 ULONG NumberOfBuckets
;
473 } FULL_PTR_XLAT_TABLES
, *PFULL_PTR_XLAT_TABLES
;
475 struct IRpcStubBuffer
;
477 typedef ULONG error_status_t
;
478 typedef void * NDR_CCONTEXT
;
480 typedef struct _SCONTEXT_QUEUE
{
481 ULONG NumberOfObjects
;
482 NDR_SCONTEXT
*ArrayOfObjects
;
483 } SCONTEXT_QUEUE
, *PSCONTEXT_QUEUE
;
485 typedef struct _NDR_USER_MARSHAL_INFO_LEVEL1
489 void * (__WINE_ALLOC_SIZE(1) __RPC_API
*pfnAllocate
)(SIZE_T
);
490 void (__RPC_API
*pfnFree
)(void *);
491 struct IRpcChannelBuffer
*pRpcChannelBuffer
;
492 ULONG_PTR Reserved
[5];
493 } NDR_USER_MARSHAL_INFO_LEVEL1
;
495 typedef struct _NDR_USER_MARSHAL_INFO
497 ULONG InformationLevel
;
500 NDR_USER_MARSHAL_INFO_LEVEL1 Level1
;
502 } NDR_USER_MARSHAL_INFO
;
504 /* Context Handles */
506 RPCRTAPI RPC_BINDING_HANDLE RPC_ENTRY
507 NDRCContextBinding( NDR_CCONTEXT CContext
);
509 RPCRTAPI
void RPC_ENTRY
510 NDRCContextMarshall( NDR_CCONTEXT CContext
, void *pBuff
);
512 RPCRTAPI
void RPC_ENTRY
513 NDRCContextUnmarshall( NDR_CCONTEXT
*pCContext
, RPC_BINDING_HANDLE hBinding
,
514 void *pBuff
, ULONG DataRepresentation
);
516 RPCRTAPI
void RPC_ENTRY
517 NDRSContextMarshall( NDR_SCONTEXT CContext
, void *pBuff
, NDR_RUNDOWN userRunDownIn
);
519 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
520 NDRSContextUnmarshall( void *pBuff
, ULONG DataRepresentation
);
522 RPCRTAPI
void RPC_ENTRY
523 NDRSContextMarshallEx( RPC_BINDING_HANDLE BindingHandle
, NDR_SCONTEXT CContext
,
524 void *pBuff
, NDR_RUNDOWN userRunDownIn
);
526 RPCRTAPI
void RPC_ENTRY
527 NDRSContextMarshall2( RPC_BINDING_HANDLE BindingHandle
, NDR_SCONTEXT CContext
,
528 void *pBuff
, NDR_RUNDOWN userRunDownIn
, void * CtxGuard
,
531 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
532 NDRSContextUnmarshallEx( RPC_BINDING_HANDLE BindingHandle
, void *pBuff
,
533 ULONG DataRepresentation
);
535 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
536 NDRSContextUnmarshall2( RPC_BINDING_HANDLE BindingHandle
, void *pBuff
,
537 ULONG DataRepresentation
, void *CtxGuard
,
540 RPCRTAPI
void RPC_ENTRY
541 NdrClientContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg
, NDR_CCONTEXT ContextHandle
, int fCheck
);
543 RPCRTAPI
void RPC_ENTRY
544 NdrClientContextUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, NDR_CCONTEXT
* pContextHandle
,
545 RPC_BINDING_HANDLE BindHandle
);
547 RPCRTAPI
void RPC_ENTRY
548 NdrServerContextMarshall ( PMIDL_STUB_MESSAGE pStubMsg
, NDR_SCONTEXT ContextHandle
, NDR_RUNDOWN RundownRoutine
);
550 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
551 NdrServerContextUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
);
553 RPCRTAPI
void RPC_ENTRY
554 NdrContextHandleSize( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, PFORMAT_STRING pFormat
);
556 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
557 NdrContextHandleInitialize( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
);
559 RPCRTAPI
void RPC_ENTRY
560 NdrServerContextNewMarshall( PMIDL_STUB_MESSAGE pStubMsg
, NDR_SCONTEXT ContextHandle
,
561 NDR_RUNDOWN RundownRoutine
, PFORMAT_STRING pFormat
);
563 RPCRTAPI NDR_SCONTEXT RPC_ENTRY
564 NdrServerContextNewUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
);
566 RPCRTAPI RPC_STATUS RPC_ENTRY
567 RpcSmDestroyClientContext( void **ContextHandle
);
569 RPCRTAPI
void RPC_ENTRY
570 RpcSsDestroyClientContext( void **ContextHandle
);
572 RPCRTAPI
void RPC_ENTRY
573 NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, unsigned char FormatChar
);
574 RPCRTAPI
void RPC_ENTRY
575 NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, unsigned char FormatChar
);
577 RPCRTAPI
unsigned char* RPC_ENTRY
578 NdrByteCountPointerMarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, PFORMAT_STRING pFormat
);
579 RPCRTAPI
unsigned char* RPC_ENTRY
580 NdrByteCountPointerUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char** ppMemory
, PFORMAT_STRING pFormat
, unsigned char fMustAlloc
);
581 RPCRTAPI
void RPC_ENTRY
582 NdrByteCountPointerBufferSize( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, PFORMAT_STRING pFormat
);
583 RPCRTAPI
void RPC_ENTRY
584 NdrByteCountPointerFree( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, PFORMAT_STRING pFormat
);
586 RPCRTAPI
unsigned char* RPC_ENTRY
587 NdrRangeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char** ppMemory
, PFORMAT_STRING pFormat
, unsigned char fMustAlloc
);
589 /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
590 #define SIMPLE_TYPE_MARSHAL(type) \
591 RPCRTAPI unsigned char* RPC_ENTRY \
592 Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
593 RPCRTAPI unsigned char* RPC_ENTRY \
594 Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
595 RPCRTAPI void RPC_ENTRY \
596 Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
597 RPCRTAPI ULONG RPC_ENTRY \
598 Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat );
600 #define TYPE_MARSHAL(type) \
601 SIMPLE_TYPE_MARSHAL(type) \
602 RPCRTAPI void RPC_ENTRY \
603 Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
605 TYPE_MARSHAL(Pointer
)
606 TYPE_MARSHAL(SimpleStruct
)
607 TYPE_MARSHAL(ConformantStruct
)
608 TYPE_MARSHAL(ConformantVaryingStruct
)
609 TYPE_MARSHAL(ComplexStruct
)
610 TYPE_MARSHAL(FixedArray
)
611 TYPE_MARSHAL(ConformantArray
)
612 TYPE_MARSHAL(ConformantVaryingArray
)
613 TYPE_MARSHAL(VaryingArray
)
614 TYPE_MARSHAL(ComplexArray
)
615 TYPE_MARSHAL(EncapsulatedUnion
)
616 TYPE_MARSHAL(NonEncapsulatedUnion
)
617 TYPE_MARSHAL(XmitOrRepAs
)
618 TYPE_MARSHAL(UserMarshal
)
619 TYPE_MARSHAL(InterfacePointer
)
621 SIMPLE_TYPE_MARSHAL(ConformantString
)
622 SIMPLE_TYPE_MARSHAL(NonConformantString
)
625 #undef SIMPLE_TYPE_MARSHAL
627 RPCRTAPI
void RPC_ENTRY
628 NdrCorrelationInitialize( PMIDL_STUB_MESSAGE pStubMsg
, void *pMemory
, ULONG CacheSize
, ULONG flags
);
629 RPCRTAPI
void RPC_ENTRY
630 NdrCorrelationPass( PMIDL_STUB_MESSAGE pStubMsg
);
631 RPCRTAPI
void RPC_ENTRY
632 NdrCorrelationFree( PMIDL_STUB_MESSAGE pStubMsg
);
634 RPCRTAPI
void RPC_ENTRY
635 NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
, LONG NumberParams
);
636 RPCRTAPI
void RPC_ENTRY
637 NdrConvert( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
);
639 #define USER_MARSHAL_FC_BYTE 1
640 #define USER_MARSHAL_FC_CHAR 2
641 #define USER_MARSHAL_FC_SMALL 3
642 #define USER_MARSHAL_FC_USMALL 4
643 #define USER_MARSHAL_FC_WCHAR 5
644 #define USER_MARSHAL_FC_SHORT 6
645 #define USER_MARSHAL_FC_USHORT 7
646 #define USER_MARSHAL_FC_LONG 8
647 #define USER_MARSHAL_FC_ULONG 9
648 #define USER_MARSHAL_FC_FLOAT 10
649 #define USER_MARSHAL_FC_HYPER 11
650 #define USER_MARSHAL_FC_DOUBLE 12
652 RPCRTAPI
unsigned char* RPC_ENTRY
653 NdrUserMarshalSimpleTypeConvert( ULONG
*pFlags
, unsigned char *pBuffer
, unsigned char FormatChar
);
656 /* Note: this should return a CLIENT_CALL_RETURN, but calling convention for
657 * returning structures/unions is different between Windows and gcc on i386. */
658 LONG_PTR RPC_VAR_ENTRY
659 NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor
, PFORMAT_STRING pFormat
, ... );
660 LONG_PTR RPC_VAR_ENTRY
661 NdrClientCall( PMIDL_STUB_DESC pStubDescriptor
, PFORMAT_STRING pFormat
, ... );
662 LONG_PTR RPC_VAR_ENTRY
663 NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor
, PFORMAT_STRING pFormat
, ... );
664 LONG_PTR RPC_VAR_ENTRY
665 NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor
, PFORMAT_STRING pFormat
, ... );
667 CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrClientCall2(
668 PMIDL_STUB_DESC pStubDescriptor
,
669 PFORMAT_STRING pFormat
,
674 RPCRTAPI
void RPC_ENTRY
675 NdrServerCall2( PRPC_MESSAGE pRpcMsg
);
676 RPCRTAPI
void RPC_ENTRY
677 NdrServerCall( PRPC_MESSAGE pRpcMsg
);
678 RPCRTAPI
void RPC_ENTRY
679 NdrAsyncServerCall( PRPC_MESSAGE pRpcMsg
);
681 RPCRTAPI LONG RPC_ENTRY
682 NdrStubCall2( struct IRpcStubBuffer
* pThis
, struct IRpcChannelBuffer
* pChannel
, PRPC_MESSAGE pRpcMsg
, DWORD
* pdwStubPhase
);
683 RPCRTAPI LONG RPC_ENTRY
684 NdrStubCall( struct IRpcStubBuffer
* pThis
, struct IRpcChannelBuffer
* pChannel
, PRPC_MESSAGE pRpcMsg
, DWORD
* pdwStubPhase
);
685 RPCRTAPI LONG RPC_ENTRY
686 NdrAsyncStubCall( struct IRpcStubBuffer
* pThis
, struct IRpcChannelBuffer
* pChannel
, PRPC_MESSAGE pRpcMsg
, DWORD
* pdwStubPhase
);
687 RPCRTAPI LONG RPC_ENTRY
688 NdrDcomAsyncStubCall( struct IRpcStubBuffer
* pThis
, struct IRpcChannelBuffer
* pChannel
, PRPC_MESSAGE pRpcMsg
, DWORD
* pdwStubPhase
);
690 RPCRTAPI
void* RPC_ENTRY
691 NdrAllocate( PMIDL_STUB_MESSAGE pStubMsg
, SIZE_T Len
) __WINE_ALLOC_SIZE(2);
693 RPCRTAPI
void RPC_ENTRY
694 NdrClearOutParameters( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
, void *ArgAddr
);
696 RPCRTAPI RPC_STATUS RPC_ENTRY
697 NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg
, ULONG
*pCommStatus
,
698 ULONG
*pFaultStatus
, RPC_STATUS Status_
);
700 RPCRTAPI
void* RPC_ENTRY
701 NdrOleAllocate( SIZE_T Size
) __WINE_ALLOC_SIZE(1);
702 RPCRTAPI
void RPC_ENTRY
703 NdrOleFree( void* NodeToFree
);
705 RPCRTAPI
void RPC_ENTRY
706 NdrClientInitialize( PRPC_MESSAGE pRpcMessage
, PMIDL_STUB_MESSAGE pStubMsg
,
707 PMIDL_STUB_DESC pStubDesc
, unsigned int ProcNum
);
708 RPCRTAPI
void RPC_ENTRY
709 NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage
, PMIDL_STUB_MESSAGE pStubMsg
,
710 PMIDL_STUB_DESC pStubDesc
, unsigned int ProcNum
);
711 RPCRTAPI
unsigned char* RPC_ENTRY
712 NdrServerInitialize( PRPC_MESSAGE pRpcMsg
, PMIDL_STUB_MESSAGE pStubMsg
, PMIDL_STUB_DESC pStubDesc
);
713 RPCRTAPI
unsigned char* RPC_ENTRY
714 NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg
, PMIDL_STUB_MESSAGE pStubMsg
, PMIDL_STUB_DESC pStubDesc
);
715 RPCRTAPI
unsigned char* RPC_ENTRY
716 NdrServerInitializeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, PMIDL_STUB_DESC pStubDesc
, PRPC_MESSAGE pRpcMsg
);
717 RPCRTAPI
void RPC_ENTRY
718 NdrServerInitializeMarshall( PRPC_MESSAGE pRpcMsg
, PMIDL_STUB_MESSAGE pStubMsg
);
719 RPCRTAPI
void RPC_ENTRY
720 NdrServerMarshall( struct IRpcStubBuffer
*pThis
, struct IRpcChannelBuffer
*pChannel
, PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
);
721 RPCRTAPI
void RPC_ENTRY
722 NdrServerUnmarshall( struct IRpcChannelBuffer
*pChannel
, PRPC_MESSAGE pRpcMsg
,
723 PMIDL_STUB_MESSAGE pStubMsg
, PMIDL_STUB_DESC pStubDesc
,
724 PFORMAT_STRING pFormat
, void *pParamList
);
725 RPCRTAPI
unsigned char* RPC_ENTRY
726 NdrGetBuffer( PMIDL_STUB_MESSAGE stubmsg
, ULONG buflen
, RPC_BINDING_HANDLE handle
);
727 RPCRTAPI
void RPC_ENTRY
728 NdrFreeBuffer( PMIDL_STUB_MESSAGE pStubMsg
);
729 RPCRTAPI
unsigned char* RPC_ENTRY
730 NdrSendReceive( PMIDL_STUB_MESSAGE stubmsg
, unsigned char *buffer
);
732 RPCRTAPI
unsigned char * RPC_ENTRY
733 NdrNsGetBuffer( PMIDL_STUB_MESSAGE pStubMsg
, ULONG BufferLength
, RPC_BINDING_HANDLE Handle
);
734 RPCRTAPI
unsigned char * RPC_ENTRY
735 NdrNsSendReceive( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char *pBufferEnd
, RPC_BINDING_HANDLE
*pAutoHandle
);
737 RPCRTAPI RPC_STATUS RPC_ENTRY
738 NdrGetDcomProtocolVersion( PMIDL_STUB_MESSAGE pStubMsg
, RPC_VERSION
*pVersion
);
740 RPCRTAPI PFULL_PTR_XLAT_TABLES RPC_ENTRY
741 NdrFullPointerXlatInit( ULONG NumberOfPointers
, XLAT_SIDE XlatSide
);
742 RPCRTAPI
void RPC_ENTRY
743 NdrFullPointerXlatFree( PFULL_PTR_XLAT_TABLES pXlatTables
);
744 RPCRTAPI
int RPC_ENTRY
745 NdrFullPointerQueryPointer( PFULL_PTR_XLAT_TABLES pXlatTables
, void *pPointer
,
746 unsigned char QueryType
, ULONG
*pRefId
);
747 RPCRTAPI
int RPC_ENTRY
748 NdrFullPointerQueryRefId( PFULL_PTR_XLAT_TABLES pXlatTables
, ULONG RefId
,
749 unsigned char QueryType
, void **ppPointer
);
750 RPCRTAPI
void RPC_ENTRY
751 NdrFullPointerInsertRefId( PFULL_PTR_XLAT_TABLES pXlatTables
, ULONG RefId
, void *pPointer
);
752 RPCRTAPI
int RPC_ENTRY
753 NdrFullPointerFree( PFULL_PTR_XLAT_TABLES pXlatTables
, void *Pointer
);
755 RPCRTAPI
void RPC_ENTRY
756 NdrRpcSsEnableAllocate( PMIDL_STUB_MESSAGE pMessage
);
757 RPCRTAPI
void RPC_ENTRY
758 NdrRpcSsDisableAllocate( PMIDL_STUB_MESSAGE pMessage
);
759 RPCRTAPI
void RPC_ENTRY
760 NdrRpcSmSetClientToOsf( PMIDL_STUB_MESSAGE pMessage
);
761 RPCRTAPI
void * RPC_ENTRY
762 NdrRpcSmClientAllocate( SIZE_T Size
) __WINE_ALLOC_SIZE(1);
763 RPCRTAPI
void RPC_ENTRY
764 NdrRpcSmClientFree( void *NodeToFree
);
765 RPCRTAPI
void * RPC_ENTRY
766 NdrRpcSsDefaultAllocate( SIZE_T Size
) __WINE_ALLOC_SIZE(1);
767 RPCRTAPI
void RPC_ENTRY
768 NdrRpcSsDefaultFree( void *NodeToFree
);
770 RPCRTAPI RPC_STATUS RPC_ENTRY
771 NdrGetUserMarshalInfo( ULONG
*pFlags
, ULONG InformationLevel
, NDR_USER_MARSHAL_INFO
*pMarshalInfo
);
780 #endif /*__WINE_RPCNDR_H */