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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_RPCNDR_H
20 #define __WINE_RPCNDR_H
22 #ifndef __RPCNDR_H_VERSION__
23 /* FIXME: I'm not sure what version though */
24 #define __RPCNDR_H_VERSION__
25 #endif // __RPCNDR_H_VERSION__
27 typedef unsigned char byte
;
28 typedef __int64 hyper
;
29 typedef __uint64 MIDL_uhyper
;
30 /* 'boolean' tend to conflict, let's call it _wine_boolean */
31 typedef unsigned char _wine_boolean
;
32 /* typedef _wine_boolean boolean; */
40 #define NDRSContextValue(hContext) (&(hContext)->userContext)
41 #define cbNDRContext 20
43 typedef void (__RPC_USER
*NDR_RUNDOWN
)(void *context
);
44 typedef void (__RPC_USER
*NDR_NOTIFY_ROUTINE
)(void);
45 typedef void (__RPC_USER
*NDR_NOTIFY2_ROUTINE
)(_wine_boolean flag
);
47 #define DECLSPEC_UUID(x)
48 #define MIDL_INTERFACE(x) struct
50 struct _MIDL_STUB_MESSAGE
;
51 struct _MIDL_STUB_DESC
;
52 struct _FULL_PTR_XLAT_TABLES
;
54 typedef void (__RPC_USER
*EXPR_EVAL
)(struct _MIDL_STUB_MESSAGE
*);
55 typedef const unsigned char *PFORMAT_STRING
;
60 unsigned long *BufferConformanceMark
;
61 unsigned long *BufferVarianceMark
;
62 unsigned long *MaxCountArray
;
63 unsigned long *OffsetArray
;
64 unsigned long *ActualCountArray
;
65 } ARRAY_INFO
, *PARRAY_INFO
;
67 typedef struct _NDR_PIPE_DESC
*PNDR_PIPE_DESC
;
68 typedef struct _NDR_PIPE_MESSAGE
*PNDR_PIPE_MESSAGE
;
69 typedef struct _NDR_ASYNC_MESSAGE
*PNDR_ASYNC_MESSAGE
;
70 typedef struct _NDR_CORRELATION_INFO
*PNDR_CORRELATION_INFO
;
73 typedef struct _MIDL_STUB_MESSAGE
76 unsigned char *Buffer
;
77 unsigned char *BufferStart
;
78 unsigned char *BufferEnd
;
79 unsigned char *BufferMark
;
80 unsigned long BufferLength
;
81 unsigned long MemorySize
;
82 unsigned char *Memory
;
85 unsigned char *AllocAllNodesMemory
;
86 unsigned char *AllocAllNodesMemoryEnd
;
87 int IgnoreEmbeddedPointers
;
88 unsigned char *PointerBufferMark
;
89 unsigned char fBufferValid
;
93 unsigned long ActualCount
;
94 void * (__RPC_API
*pfnAllocate
)(size_t);
95 void (__RPC_API
*pfnFree
)(void *);
96 unsigned char *StackTop
;
97 unsigned char *pPresentedType
;
98 unsigned char *pTransmitType
;
100 const struct _MIDL_STUB_DESC
*StubDesc
;
101 struct _FULL_PTR_XLAT_TABLES
*FullPtrXlatTables
;
102 unsigned long FullPtrRefId
;
103 unsigned long ulUnused1
;
105 int fDontCallFreeInst
:1;
108 int fHasExtensions
:1;
109 int fHasNewCorrDesc
:1;
111 unsigned long dwDestContext
;
113 NDR_SCONTEXT
*SavedContextHandles
;
115 struct IRpcChannelBuffer
*pRpcChannelBuffer
;
116 PARRAY_INFO pArrayInfo
;
117 unsigned long *SizePtrCountArray
;
118 unsigned long *SizePtrOffsetArray
;
119 unsigned long *SizePtrLengthArray
;
121 unsigned long dwStubPhase
;
122 PNDR_PIPE_DESC pPipeDesc
;
123 PNDR_ASYNC_MESSAGE pAsyncMsg
;
124 PNDR_CORRELATION_INFO pCorrInfo
;
125 unsigned char *pCorrMemory
;
127 ULONG_PTR w2kReserved
[5];
128 } MIDL_STUB_MESSAGE
, *PMIDL_STUB_MESSAGE
;
131 typedef struct _GENERIC_BINDING_ROUTINE_PAIR GENERIC_BINDING_ROUTINE_PAIR
, *PGENERIC_BINDING_ROUTINE_PAIR
;
133 typedef struct __GENERIC_BINDING_INFO GENERIC_BINDING_INFO
, *PGENERIC_BINDING_INFO
;
135 typedef struct _XMIT_ROUTINE_QUINTUPLE XMIT_ROUTINE_QUINTUPLE
, *PXMIT_ROUTINE_QUINTUPLE
;
137 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE USER_MARSHAL_ROUTINE_QUADRUPLE
;
139 typedef struct _MALLOC_FREE_STRUCT MALLOC_FREE_STRUCT
;
141 typedef struct _COMM_FAULT_OFFSETS COMM_FAULT_OFFSETS
;
143 typedef struct _MIDL_STUB_DESC
145 void *RpcInterfaceInformation
;
146 void * (__RPC_API
*pfnAllocate
)(size_t);
147 void (__RPC_API
*pfnFree
)(void *);
149 handle_t
*pAutoHandle
;
150 handle_t
*pPrimitiveHandle
;
151 PGENERIC_BINDING_INFO pGenericBindingInfo
;
152 } IMPLICIT_HANDLE_INFO
;
153 const NDR_RUNDOWN
*apfnNdrRundownRoutines
;
154 const GENERIC_BINDING_ROUTINE_PAIR
*aGenericBindingRoutinePairs
;
155 const EXPR_EVAL
*apfnExprEval
;
156 const XMIT_ROUTINE_QUINTUPLE
*aXmitQuintuple
;
157 const unsigned char *pFormatTypes
;
159 unsigned long Version
;
160 MALLOC_FREE_STRUCT
*pMallocFreeStruct
;
162 const COMM_FAULT_OFFSETS
*CommFaultOffsets
;
163 const USER_MARSHAL_ROUTINE_QUADRUPLE
*aUserMarshalQuadruple
;
164 const NDR_NOTIFY_ROUTINE
*NotifyRoutineTable
;
170 typedef const MIDL_STUB_DESC
*PMIDL_STUB_DESC
;
172 typedef struct _MIDL_FORMAT_STRING
175 #if defined(__GNUC__)
176 unsigned char Format
[0];
178 unsigned char Format
[1];
180 } MIDL_FORMAT_STRING
;
182 typedef void (__RPC_API
*STUB_THUNK
)( PMIDL_STUB_MESSAGE
);
184 typedef long (__RPC_API
*SERVER_ROUTINE
)();
186 typedef struct _MIDL_SERVER_INFO_
188 PMIDL_STUB_DESC pStubDesc
;
189 const SERVER_ROUTINE
*DispatchTable
;
190 PFORMAT_STRING ProcString
;
191 const unsigned short *FmtStringOffset
;
192 const STUB_THUNK
*ThunkTable
;
193 PFORMAT_STRING LocalFormatTypes
;
194 PFORMAT_STRING LocalProcString
;
195 const unsigned short *LocalFmtStringOffset
;
196 } MIDL_SERVER_INFO
, *PMIDL_SERVER_INFO
;
202 STUB_CALL_SERVER_NO_HRESULT
213 struct IRpcStubBuffer
;
215 RPCRTAPI
void RPC_ENTRY
216 NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, unsigned char FormatChar
);
217 RPCRTAPI
void RPC_ENTRY
218 NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
, unsigned char* pMemory
, unsigned char FormatChar
);
220 /* while MS declares each prototype separately, I prefer to use macros for this kind of thing instead */
221 #define TYPE_MARSHAL(type) \
222 RPCRTAPI unsigned char* RPC_ENTRY \
223 Ndr##type##Marshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
224 RPCRTAPI unsigned char* RPC_ENTRY \
225 Ndr##type##Unmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc ); \
226 RPCRTAPI void RPC_ENTRY \
227 Ndr##type##BufferSize( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat ); \
228 RPCRTAPI unsigned long RPC_ENTRY \
229 Ndr##type##MemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat ); \
230 RPCRTAPI void RPC_ENTRY \
231 Ndr##type##Free( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat );
233 TYPE_MARSHAL(Pointer
)
234 TYPE_MARSHAL(SimpleStruct
)
235 TYPE_MARSHAL(ConformantStruct
)
236 TYPE_MARSHAL(ConformantVaryingStruct
)
237 TYPE_MARSHAL(ComplexStruct
)
238 TYPE_MARSHAL(FixedArray
)
239 TYPE_MARSHAL(ConformantArray
)
240 TYPE_MARSHAL(ConformantVaryingArray
)
241 TYPE_MARSHAL(VaryingArray
)
242 TYPE_MARSHAL(ComplexArray
)
243 TYPE_MARSHAL(EncapsulatedUnion
)
244 TYPE_MARSHAL(NonEncapsulatedUnion
)
245 TYPE_MARSHAL(ByteCountPointer
)
246 TYPE_MARSHAL(XmitOrRepAs
)
247 TYPE_MARSHAL(UserMarshal
)
248 TYPE_MARSHAL(InterfacePointer
)
252 RPCRTAPI
void RPC_ENTRY
253 NdrConvert2( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
, long NumberParams
);
254 RPCRTAPI
void RPC_ENTRY
255 NdrConvert( PMIDL_STUB_MESSAGE pStubMsg
, PFORMAT_STRING pFormat
);
257 RPCRTAPI
void* RPC_ENTRY
258 NdrOleAllocate( size_t Size
);
259 RPCRTAPI
void RPC_ENTRY
260 NdrOleFree( void* NodeToFree
);
262 #endif /*__WINE_RPCNDR_H */