1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW Windows headers
5  *
6  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
7  * Source: $(DRUNTIMESRC core/sys/windows/_rpcndr.d)
8  */
9 module core.sys.windows.rpcndr;
10 version (Windows):
11 pragma(lib, "rpcrt4");
12 
13 /* Translation notes:
14  RPC_CLIENT_ALLOC*, RPC_CLIENT_FREE* were replaced with PRPC_CLIENT_ALLOC, PRPC_CLIENT_FREE
15 */
16 
17 // TODO: Bitfields in MIDL_STUB_MESSAGE.
18 //       Macros need to be converted.
19 enum __RPCNDR_H_VERSION__= 450;
20 
21 import core.sys.windows.rpcnsip;
22 import core.sys.windows.rpc, core.sys.windows.rpcdce, core.sys.windows.unknwn, core.sys.windows.windef;
23 import core.sys.windows.objidl; // for IRpcChannelBuffer, IRpcStubBuffer
24 import core.sys.windows.basetyps;
25 
26 extern (Windows):
27 
28 enum uint NDR_CHAR_REP_MASK      = 0xF,
29     NDR_INT_REP_MASK              = 0xF0,
30     NDR_FLOAT_REP_MASK            = 0xFF00,
31     NDR_LITTLE_ENDIAN             = 0x10,
32     NDR_BIG_ENDIAN                = 0,
33     NDR_IEEE_FLOAT                = 0,
34     NDR_VAX_FLOAT                 = 0x100,
35     NDR_ASCII_CHAR                = 0,
36     NDR_EBCDIC_CHAR               = 1,
37     NDR_LOCAL_DATA_REPRESENTATION = 0x10,
38     NDR_LOCAL_ENDIAN              = NDR_LITTLE_ENDIAN;
39 
40 alias MIDL_user_allocate midl_user_allocate;
41 alias MIDL_user_free midl_user_free;
42 
43 alias long hyper;
44 alias ulong MIDL_uhyper;
45 alias char small;
46 
47 enum cbNDRContext=20;
48 //MACRO #define NDRSContextValue(hContext) (&(hContext)->userContext)
49 //MACRO #define byte_from_ndr(source, target) { *(target) = *(*(char**)&(source)->Buffer)++; }
50 
51 //MACRO #define byte_array_from_ndr(Source, LowerIndex, UpperIndex, Target) { NDRcopy ((((char *)(Target))+(LowerIndex)), (Source)->Buffer, (unsigned int)((UpperIndex)-(LowerIndex))); *(unsigned long *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); }
52 
53 //MACRO #define boolean_from_ndr(source, target) { *(target) = *(*(char**)&(source)->Buffer)++; }
54 
55 //MACRO #define boolean_array_from_ndr(Source, LowerIndex, UpperIndex, Target) { NDRcopy ((((char *)(Target))+(LowerIndex)), (Source)->Buffer, (unsigned int)((UpperIndex)-(LowerIndex))); *(unsigned long *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); }
56 
57 //MACRO #define small_from_ndr(source, target) { *(target) = *(*(char**)&(source)->Buffer)++; }
58 
59 //MACRO #define small_from_ndr_temp(source, target, format) { *(target) = *(*(char**)(source))++; }
60 
61 //MACRO #define small_array_from_ndr(Source, LowerIndex, UpperIndex, Target) { NDRcopy ((((char *)(Target))+(LowerIndex)), (Source)->Buffer, (unsigned int)((UpperIndex)-(LowerIndex))); *(unsigned long *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); }
62 
63 //MACRO #define MIDL_ascii_strlen(string) strlen(string)
64 
65 //MACRO #define MIDL_ascii_strcpy(target,source) strcpy(target,source)
66 
67 //MACRO #define MIDL_memset(s,c,n) memset(s,c,n)
68 
69 //MACRO #define _midl_ma1( p, cast ) *(*( cast **)&p)++
70 //MACRO #define _midl_ma2( p, cast ) *(*( cast **)&p)++
71 //MACRO #define _midl_ma4( p, cast ) *(*( cast **)&p)++
72 //MACRO #define _midl_ma8( p, cast ) *(*( cast **)&p)++
73 //MACRO #define _midl_unma1( p, cast ) *(( cast *)p)++
74 //MACRO #define _midl_unma2( p, cast ) *(( cast *)p)++
75 //MACRO #define _midl_unma3( p, cast ) *(( cast *)p)++
76 //MACRO #define _midl_unma4( p, cast ) *(( cast *)p)++
77 //MACRO #define _midl_fa2( p ) (p = (RPC_BUFPTR )((LONG_PTR)(p+1) & 0xffffffff_fffffffe))
78 //MACRO #define _midl_fa4( p ) (p = (RPC_BUFPTR )((LONG_PTR)(p+3) & 0xffffffff_fffffffc))
79 //MACRO #define _midl_fa8( p ) (p = (RPC_BUFPTR )((LONG_PTR)(p+7) & 0xffffffff_fffffff8))
80 //MACRO #define _midl_addp( p, n ) (p += n)
81 //MACRO #define _midl_marsh_lhs( p, cast ) *(*( cast **)&p)++
82 //MACRO #define _midl_marsh_up( mp, p ) *(*(unsigned long **)&mp)++ = (unsigned long)p
83 //MACRO #define _midl_advmp( mp ) *(*(unsigned long **)&mp)++
84 //MACRO #define _midl_unmarsh_up( p ) (*(*(unsigned long **)&p)++)
85 
86 //MACRO #define NdrMarshConfStringHdr( p, s, l ) (_midl_ma4( p, unsigned long) = s, _midl_ma4( p, unsigned long) = 0, _midl_ma4( p, unsigned long) = l)
87 
88 //MACRO #define NdrUnMarshConfStringHdr(p, s, l) ((s=_midl_unma4(p,unsigned long), (_midl_addp(p,4)), (l=_midl_unma4(p,unsigned long))
89 
90 //MACRO #define NdrMarshCCtxtHdl(pc,p) (NDRCContextMarshall( (NDR_CCONTEXT)pc, p ),p+20)
91 //MACRO #define NdrUnMarshCCtxtHdl(pc,p,h,drep) (NDRCContextUnmarshall((NDR_CONTEXT)pc,h,p,drep), p+20)
92 //MACRO #define NdrUnMarshSCtxtHdl(pc, p,drep) (pc = NdrSContextUnMarshall(p,drep ))
93 //MACRO #define NdrMarshSCtxtHdl(pc,p,rd) (NdrSContextMarshall((NDR_SCONTEXT)pc,p, (NDR_RUNDOWN)rd)
94 
95 //MACRO #define NdrFieldOffset(s,f) (LONG_PTR)(& (((s *)0)->f))
96 //MACRO #define NdrFieldPad(s,f,p,t) (NdrFieldOffset(s,f) - NdrFieldOffset(s,p) - sizeof(t))
97 //MACRO #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
98 //MACRO #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
99 
100 alias void * NDR_CCONTEXT;
101 struct tagNDR_SCONTEXT {
102     void*[2] pad;
103     void *userContext;
104 }
105 alias tagNDR_SCONTEXT * NDR_SCONTEXT;
106 
107 struct SCONTEXT_QUEUE {
108     uint NumberOfObjects;
109     NDR_SCONTEXT *ArrayOfObjects;
110 }
111 alias SCONTEXT_QUEUE * PSCONTEXT_QUEUE;
112 
113 struct _MIDL_STUB_MESSAGE;
114 struct _MIDL_STUB_DESC;
115 struct _FULL_PTR_XLAT_TABLES;
116 
117 alias ubyte *RPC_BUFPTR;
118 alias uint RPC_LENGTH;
119 
120 alias const(char)* PFORMAT_STRING;
121 
122 struct ARRAY_INFO {
123     int Dimension;
124     uint *BufferConformanceMark;
125     uint *BufferVarianceMark;
126     uint *MaxCountArray;
127     uint *OffsetArray;
128     uint *ActualCountArray;
129 }
130 alias ARRAY_INFO * PARRAY_INFO;
131 
132 RPC_BINDING_HANDLE  NDRCContextBinding(NDR_CCONTEXT);
133 void  NDRCContextMarshall(NDR_CCONTEXT,void*);
134 void  NDRCContextUnmarshall(NDR_CCONTEXT*,RPC_BINDING_HANDLE,void*,uint);
135 void  NDRSContextMarshall(NDR_SCONTEXT,void*,NDR_RUNDOWN);
136 NDR_SCONTEXT  NDRSContextUnmarshall(void*pBuff,uint);
137 void  RpcSsDestroyClientContext(void**);
138 void  NDRcopy(void*,void*,uint);
139 uint  MIDL_wchar_strlen(wchar *);
140 void  MIDL_wchar_strcpy(void*,wchar *);
141 void  char_from_ndr(PRPC_MESSAGE,ubyte*);
142 void  char_array_from_ndr(PRPC_MESSAGE,uint,uint,ubyte*);
143 void  short_from_ndr(PRPC_MESSAGE,ushort*);
144 void  short_array_from_ndr(PRPC_MESSAGE,uint,uint,ushort*);
145 void  short_from_ndr_temp(ubyte**,ushort*,uint);
146 void  int_from_ndr(PRPC_MESSAGE,uint*);
147 void  int_array_from_ndr(PRPC_MESSAGE,uint,uint,uint*);
148 void  int_from_ndr_temp(ubyte**,uint*,uint);
149 void  enum_from_ndr(PRPC_MESSAGE,uint*);
150 void  float_from_ndr(PRPC_MESSAGE,void*);
151 void  float_array_from_ndr(PRPC_MESSAGE,uint,uint,void*);
152 void  double_from_ndr(PRPC_MESSAGE,void*);
153 void  double_array_from_ndr(PRPC_MESSAGE,uint,uint,void*);
154 void  hyper_from_ndr(PRPC_MESSAGE,hyper*);
155 void  hyper_array_from_ndr(PRPC_MESSAGE,uint,uint,hyper*);
156 void  hyper_from_ndr_temp(ubyte**,hyper*,uint);
157 void  data_from_ndr(PRPC_MESSAGE,void*,char*,ubyte);
158 void  data_into_ndr(void*,PRPC_MESSAGE,char*,ubyte);
159 void  tree_into_ndr(void*,PRPC_MESSAGE,char*,ubyte);
160 void  data_size_ndr(void*,PRPC_MESSAGE,char*,ubyte);
161 void  tree_size_ndr(void*,PRPC_MESSAGE,char*,ubyte);
162 void  tree_peek_ndr(PRPC_MESSAGE,ubyte**,char*,ubyte);
163 void * midl_allocate(int);
164 
165 align(4):
166 struct MIDL_STUB_MESSAGE {
167     PRPC_MESSAGE RpcMsg;
168     ubyte *Buffer;
169     ubyte *BufferStart;
170     ubyte *BufferEnd;
171     ubyte *BufferMark;
172     uint BufferLength;
173     uint MemorySize;
174     ubyte *Memory;
175     int IsClient;
176     int ReuseBuffer;
177     ubyte *AllocAllNodesMemory;
178     ubyte *AllocAllNodesMemoryEnd;
179     int IgnoreEmbeddedPointers;
180     ubyte *PointerBufferMark;
181     ubyte fBufferValid;
182     ubyte Unused;
183     ULONG_PTR MaxCount;
184     uint Offset;
185     uint ActualCount;
186     void* function (uint) pfnAllocate;
187     void function (void*) pfnFree;
188     ubyte * StackTop;
189     ubyte * pPresentedType;
190     ubyte * pTransmitType;
191     handle_t SavedHandle;
192 const(_MIDL_STUB_DESC)* StubDesc;
193     _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
194     uint FullPtrRefId;
195     int fCheckBounds;
196     // FIXME:
197     byte bit_fields_for_D; // FIXME: Bitfields
198 //  int fInDontFree :1;
199 //  int fDontCallFreeInst :1;
200 //  int fInOnlyParam :1;
201 //  int fHasReturn :1;
202     uint dwDestContext;
203     void* pvDestContext;
204     NDR_SCONTEXT * SavedContextHandles;
205     int ParamNumber;
206     IRpcChannelBuffer  pRpcChannelBuffer;
207     PARRAY_INFO pArrayInfo;
208     uint * SizePtrCountArray;
209     uint * SizePtrOffsetArray;
210     uint * SizePtrLengthArray;
211     void* pArgQueue;
212     uint dwStubPhase;
213     INT_PTR[5] w2kReserved;
214 }
215 alias MIDL_STUB_MESSAGE * PMIDL_STUB_MESSAGE;
216 
217 extern (Windows) {
218     alias void* function (void*) GENERIC_BINDING_ROUTINE;
219     alias void function (void*,ubyte*) GENERIC_UNBIND_ROUTINE;
220     alias uint function (uint *,uint,void *) USER_MARSHAL_SIZING_ROUTINE;
221     alias ubyte * function (uint *,ubyte *,void *) USER_MARSHAL_MARSHALLING_ROUTINE;
222     alias ubyte * function (uint *,ubyte *,void *) USER_MARSHAL_UNMARSHALLING_ROUTINE;
223     alias void function (uint *,void *) USER_MARSHAL_FREEING_ROUTINE;
224     alias void function () NDR_NOTIFY_ROUTINE;
225 }
226 
227 align:
228 struct GENERIC_BINDING_ROUTINE_PAIR {
229     GENERIC_BINDING_ROUTINE pfnBind;
230     GENERIC_UNBIND_ROUTINE pfnUnbind;
231 }
232 alias GENERIC_BINDING_ROUTINE_PAIR * PGENERIC_BINDING_ROUTINE_PAIR;
233 
234 struct GENERIC_BINDING_INFO {
235     void *pObj;
236     uint Size;
237     GENERIC_BINDING_ROUTINE pfnBind;
238     GENERIC_UNBIND_ROUTINE pfnUnbind;
239 }
240 alias GENERIC_BINDING_INFO * PGENERIC_BINDING_INFO;
241 
242 
243 struct XMIT_ROUTINE_QUINTUPLE {
244     XMIT_HELPER_ROUTINE pfnTranslateToXmit;
245     XMIT_HELPER_ROUTINE pfnTranslateFromXmit;
246     XMIT_HELPER_ROUTINE pfnFreeXmit;
247     XMIT_HELPER_ROUTINE pfnFreeInst;
248 }
249 alias XMIT_ROUTINE_QUINTUPLE * PXMIT_ROUTINE_QUINTUPLE;
250 
251 struct MALLOC_FREE_STRUCT {
252     void* function (uint) pfnAllocate;
253     void function (void*) pfnFree;
254 }
255 
256 struct COMM_FAULT_OFFSETS {
257     short CommOffset;
258     short FaultOffset;
259 }
260 
261 struct USER_MARSHAL_ROUTINE_QUADRUPLE {
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 }
267 
268 enum IDL_CS_CONVERT {
269     IDL_CS_NO_CONVERT,
270     IDL_CS_IN_PLACE_CONVERT,
271     IDL_CS_NEW_BUFFER_CONVERT
272 }
273 
274 struct NDR_CS_SIZE_CONVERT_ROUTINES {
275     CS_TYPE_NET_SIZE_ROUTINE pfnNetSize;
276     CS_TYPE_TO_NETCS_ROUTINE pfnToNetCs;
277     CS_TYPE_LOCAL_SIZE_ROUTINE pfnLocalSize;
278     CS_TYPE_FROM_NETCS_ROUTINE pfnFromNetCs;
279 }
280 
281 struct NDR_CS_ROUTINES {
282     NDR_CS_SIZE_CONVERT_ROUTINES *pSizeConvertRoutines;
283     CS_TAG_GETTING_ROUTINE *pTagGettingRoutines;
284 }
285 
286 struct MIDL_STUB_DESC {
287     void* RpcInterfaceInformation;
288     void* function(uint) pfnAllocate;
289     void function (void*) pfnFree;
290     union _IMPLICIT_HANDLE_INFO {
291         handle_t *pAutoHandle;
292         handle_t *pPrimitiveHandle;
293         PGENERIC_BINDING_INFO pGenericBindingInfo;
294     }
295     _IMPLICIT_HANDLE_INFO IMPLICIT_HANDLE_INFO;
296 const(NDR_RUNDOWN)* apfnNdrRundownRoutines;
297 const(GENERIC_BINDING_ROUTINE_PAIR)* aGenericBindingRoutinePairs;
298 const(EXPR_EVAL)* apfnExprEval;
299 const(XMIT_ROUTINE_QUINTUPLE)* aXmitQuintuple;
300 const(char)* *pFormatTypes;
301     int fCheckBounds;
302     uint Version;
303     MALLOC_FREE_STRUCT *pMallocFreeStruct;
304     int MIDLVersion;
305 const(COMM_FAULT_OFFSETS)* CommFaultOffsets;
306 const(USER_MARSHAL_ROUTINE_QUADRUPLE)* aUserMarshalQuadruple;
307 const(NDR_NOTIFY_ROUTINE)* NotifyRoutineTable;
308     ULONG_PTR mFlags;
309 const(NDR_CS_ROUTINES)* CsRoutineTables;
310     void *Reserved4;
311     ULONG_PTR Reserved5;
312 }
313 alias const(MIDL_STUB_DESC)* PMIDL_STUB_DESC;
314 
315 alias void * PMIDL_XMIT_TYPE;
316 
317 struct MIDL_FORMAT_STRING {
318     short Pad;
319     ubyte[1] Format;
320 }
321 
322 struct MIDL_SERVER_INFO {
323     PMIDL_STUB_DESC pStubDesc;
324 const(SERVER_ROUTINE)* DispatchTable;
325     PFORMAT_STRING ProcString;
326 const(ushort)* FmtStringOffset;
327 const(STUB_THUNK)* ThunkTable;
328 }
329 alias MIDL_SERVER_INFO * PMIDL_SERVER_INFO;
330 
331 struct MIDL_STUBLESS_PROXY_INFO {
332     PMIDL_STUB_DESC pStubDesc;
333     PFORMAT_STRING ProcFormatString;
334 const(ushort)* FormatStringOffset;
335 }
336 alias MIDL_STUBLESS_PROXY_INFO *PMIDL_STUBLESS_PROXY_INFO;
337 
338 union CLIENT_CALL_RETURN {
339     void *Pointer;
340     LONG_PTR Simple;
341 }
342 
343 enum XLAT_SIDE {
344     XLAT_SERVER = 1,
345     XLAT_CLIENT
346 }
347 struct FULL_PTR_TO_REFID_ELEMENT {
348     FULL_PTR_TO_REFID_ELEMENT * Next;
349     void* Pointer;
350     uint RefId;
351     ubyte State;
352 }
353 alias FULL_PTR_TO_REFID_ELEMENT * PFULL_PTR_TO_REFID_ELEMENT;
354 
355 struct FULL_PTR_XLAT_TABLES {
356     struct _RefIdToPointer {
357         void **XlatTable;
358         ubyte *StateTable;
359         uint NumberOfEntries;
360     }
361     void* RefIdToPointer;
362     struct _PointerToRefId {
363         PFULL_PTR_TO_REFID_ELEMENT *XlatTable;
364         uint NumberOfBuckets;
365         uint HashMask;
366     }
367     void* PointerToRefId;
368 
369     uint NextRefId;
370     XLAT_SIDE XlatSide;
371 }
372 alias FULL_PTR_XLAT_TABLES * PFULL_PTR_XLAT_TABLES;
373 
374 
375 enum STUB_PHASE {
376     STUB_UNMARSHAL,
377     STUB_CALL_SERVER,
378     STUB_MARSHAL,
379     STUB_CALL_SERVER_NO_HRESULT
380 }
381 
382 enum PROXY_PHASE {
383     PROXY_CALCSIZE,
384     PROXY_GETBUFFER,
385     PROXY_MARSHAL,
386     PROXY_SENDRECEIVE,
387     PROXY_UNMARSHAL
388 }
389 
390 alias TypeDef!(void *) RPC_SS_THREAD_HANDLE;
391 
392 extern (Windows) {
393 alias void function (void*) NDR_RUNDOWN;
394 alias void function (_MIDL_STUB_MESSAGE*) EXPR_EVAL;
395 alias void function(PMIDL_STUB_MESSAGE) XMIT_HELPER_ROUTINE;
396 alias void function (RPC_BINDING_HANDLE,uint,uint,IDL_CS_CONVERT*,uint*,error_status_t*) CS_TYPE_NET_SIZE_ROUTINE;
397 alias void function (RPC_BINDING_HANDLE,uint,uint,IDL_CS_CONVERT*,uint*,error_status_t*) CS_TYPE_LOCAL_SIZE_ROUTINE;
398 alias void function (RPC_BINDING_HANDLE,uint,void*,uint,byte*,uint*,error_status_t*) CS_TYPE_TO_NETCS_ROUTINE;
399 alias void function (RPC_BINDING_HANDLE,uint,byte*,uint,uint,void*,uint*,error_status_t*) CS_TYPE_FROM_NETCS_ROUTINE;
400 alias void function (RPC_BINDING_HANDLE,int,uint*,uint*,uint*,error_status_t*) CS_TAG_GETTING_ROUTINE;
401 
402 //alias void* RPC_CLIENT_ALLOC(uint);
403 //alias void RPC_CLIENT_FREE(void*);
404 alias void* function(uint) PRPC_CLIENT_ALLOC;
405 alias void function(void*) PRPC_CLIENT_FREE;
406 
407     alias void function (PMIDL_STUB_MESSAGE) STUB_THUNK;
408     alias int function() SERVER_ROUTINE;
409 }
410 
411 void  NdrSimpleTypeMarshall(PMIDL_STUB_MESSAGE,ubyte*,ubyte);
412 ubyte * NdrPointerMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING pFormat);
413 ubyte * NdrSimpleStructMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
414 ubyte * NdrConformantStructMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
415 ubyte * NdrConformantVaryingStructMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
416 ubyte * NdrHardStructMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
417 ubyte * NdrComplexStructMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
418 ubyte * NdrFixedArrayMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
419 ubyte * NdrConformantArrayMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
420 ubyte * NdrConformantVaryingArrayMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
421 ubyte * NdrVaryingArrayMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
422 ubyte * NdrComplexArrayMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
423 ubyte * NdrNonConformantStringMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
424 ubyte * NdrConformantStringMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
425 ubyte * NdrEncapsulatedUnionMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
426 ubyte * NdrNonEncapsulatedUnionMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
427 ubyte * NdrByteCountPointerMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
428 ubyte * NdrXmitOrRepAsMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
429 ubyte * NdrInterfacePointerMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
430 void  NdrClientContextMarshall(PMIDL_STUB_MESSAGE,NDR_CCONTEXT,int);
431 void  NdrServerContextMarshall(PMIDL_STUB_MESSAGE,NDR_SCONTEXT,NDR_RUNDOWN);
432 void  NdrSimpleTypeUnmarshall(PMIDL_STUB_MESSAGE,ubyte*,ubyte);
433 ubyte * NdrPointerUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
434 ubyte * NdrSimpleStructUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
435 ubyte * NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
436 ubyte * NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
437 ubyte * NdrHardStructUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
438 ubyte * NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
439 ubyte * NdrFixedArrayUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
440 ubyte * NdrConformantArrayUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
441 ubyte * NdrConformantVaryingArrayUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
442 ubyte * NdrVaryingArrayUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
443 ubyte * NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
444 ubyte * NdrNonConformantStringUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
445 ubyte * NdrConformantStringUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
446 ubyte * NdrEncapsulatedUnionUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
447 ubyte * NdrNonEncapsulatedUnionUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
448 ubyte * NdrByteCountPointerUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
449 ubyte * NdrXmitOrRepAsUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
450 ubyte * NdrInterfacePointerUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
451 void  NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE,NDR_CCONTEXT*,RPC_BINDING_HANDLE);
452 NDR_SCONTEXT  NdrServerContextUnmarshall(PMIDL_STUB_MESSAGE);
453 void  NdrPointerBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
454 void  NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
455 void  NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
456 void  NdrConformantVaryingStructBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
457 void  NdrHardStructBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
458 void  NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
459 void  NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
460 void  NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
461 void  NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
462 void  NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
463 void  NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
464 void  NdrConformantStringBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
465 void  NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
466 void  NdrEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
467 void  NdrNonEncapsulatedUnionBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
468 void  NdrByteCountPointerBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
469 void  NdrXmitOrRepAsBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
470 void  NdrInterfacePointerBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
471 void  NdrContextHandleSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
472 uint  NdrPointerMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
473 uint  NdrSimpleStructMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
474 uint  NdrConformantStructMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
475 uint  NdrConformantVaryingStructMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
476 uint  NdrHardStructMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
477 uint  NdrComplexStructMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
478 uint  NdrFixedArrayMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
479 uint  NdrConformantArrayMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
480 uint  NdrConformantVaryingArrayMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
481 uint  NdrVaryingArrayMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
482 uint  NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
483 uint  NdrConformantStringMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
484 uint  NdrNonConformantStringMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
485 uint  NdrEncapsulatedUnionMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
486 uint  NdrNonEncapsulatedUnionMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
487 uint  NdrXmitOrRepAsMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
488 uint  NdrInterfacePointerMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
489 void  NdrPointerFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
490 void  NdrSimpleStructFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
491 void  NdrConformantStructFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
492 void  NdrConformantVaryingStructFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
493 void  NdrHardStructFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
494 void  NdrComplexStructFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
495 void  NdrFixedArrayFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
496 void  NdrConformantArrayFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
497 void  NdrConformantVaryingArrayFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
498 void  NdrVaryingArrayFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
499 void  NdrComplexArrayFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
500 void  NdrEncapsulatedUnionFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
501 void  NdrNonEncapsulatedUnionFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
502 void  NdrByteCountPointerFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
503 void  NdrXmitOrRepAsFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
504 void  NdrInterfacePointerFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
505 void  NdrConvert(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
506 void  NdrClientInitializeNew(PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMIDL_STUB_DESC,uint);
507 ubyte * NdrServerInitializeNew(PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMIDL_STUB_DESC);
508 void  NdrClientInitialize(PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMIDL_STUB_DESC,uint);
509 ubyte * NdrServerInitialize(PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMIDL_STUB_DESC);
510 ubyte * NdrServerInitializeUnmarshall(PMIDL_STUB_MESSAGE,PMIDL_STUB_DESC,PRPC_MESSAGE);
511 void  NdrServerInitializeMarshall(PRPC_MESSAGE,PMIDL_STUB_MESSAGE);
512 ubyte * NdrGetBuffer(PMIDL_STUB_MESSAGE,uint,RPC_BINDING_HANDLE);
513 ubyte * NdrNsGetBuffer(PMIDL_STUB_MESSAGE,uint,RPC_BINDING_HANDLE);
514 ubyte * NdrSendReceive(PMIDL_STUB_MESSAGE,ubyte*);
515 ubyte * NdrNsSendReceive(PMIDL_STUB_MESSAGE,ubyte*,RPC_BINDING_HANDLE*);
516 void  NdrFreeBuffer(PMIDL_STUB_MESSAGE);
517 
518 CLIENT_CALL_RETURN  NdrClientCall(PMIDL_STUB_DESC,PFORMAT_STRING,...);
519 
520 int  NdrStubCall(IRpcStubBuffer, IRpcChannelBuffer,PRPC_MESSAGE,uint*);
521 void  NdrServerCall(PRPC_MESSAGE);
522 int  NdrServerUnmarshall(IRpcChannelBuffer, PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMIDL_STUB_DESC,PFORMAT_STRING,void*);
523 void  NdrServerMarshall(IRpcStubBuffer, IRpcChannelBuffer,PMIDL_STUB_MESSAGE,PFORMAT_STRING);
524 RPC_STATUS  NdrMapCommAndFaultStatus(PMIDL_STUB_MESSAGE,uint*,uint*,RPC_STATUS);
525 int  NdrSH_UPDecision(PMIDL_STUB_MESSAGE,ubyte**,RPC_BUFPTR);
526 int  NdrSH_TLUPDecision(PMIDL_STUB_MESSAGE,ubyte**);
527 int  NdrSH_TLUPDecisionBuffer(PMIDL_STUB_MESSAGE,ubyte**);
528 int  NdrSH_IfAlloc(PMIDL_STUB_MESSAGE,ubyte**,uint);
529 int  NdrSH_IfAllocRef(PMIDL_STUB_MESSAGE,ubyte**,uint);
530 int  NdrSH_IfAllocSet(PMIDL_STUB_MESSAGE,ubyte**,uint);
531 RPC_BUFPTR  NdrSH_IfCopy(PMIDL_STUB_MESSAGE,ubyte**,uint);
532 RPC_BUFPTR  NdrSH_IfAllocCopy(PMIDL_STUB_MESSAGE,ubyte**,uint);
533 uint  NdrSH_Copy(ubyte*,ubyte*,uint);
534 void  NdrSH_IfFree(PMIDL_STUB_MESSAGE,ubyte*);
535 RPC_BUFPTR  NdrSH_StringMarshall(PMIDL_STUB_MESSAGE,ubyte*,uint,int);
536 RPC_BUFPTR  NdrSH_StringUnMarshall(PMIDL_STUB_MESSAGE,ubyte**,int);
537 void* RpcSsAllocate(uint);
538 void  RpcSsDisableAllocate();
539 void  RpcSsEnableAllocate();
540 void  RpcSsFree(void*);
541 RPC_SS_THREAD_HANDLE  RpcSsGetThreadHandle();
542 void  RpcSsSetClientAllocFree(PRPC_CLIENT_ALLOC,PRPC_CLIENT_FREE);
543 void  RpcSsSetThreadHandle(RPC_SS_THREAD_HANDLE);
544 void  RpcSsSwapClientAllocFree(PRPC_CLIENT_ALLOC,PRPC_CLIENT_FREE,PRPC_CLIENT_ALLOC*,PRPC_CLIENT_FREE*);
545 void* RpcSmAllocate(uint,RPC_STATUS*);
546 RPC_STATUS  RpcSmClientFree(void*);
547 RPC_STATUS  RpcSmDestroyClientContext(void**);
548 RPC_STATUS  RpcSmDisableAllocate();
549 RPC_STATUS  RpcSmEnableAllocate();
550 RPC_STATUS  RpcSmFree(void*);
551 RPC_SS_THREAD_HANDLE  RpcSmGetThreadHandle(RPC_STATUS*);
552 RPC_STATUS  RpcSmSetClientAllocFree(PRPC_CLIENT_ALLOC,PRPC_CLIENT_FREE);
553 RPC_STATUS  RpcSmSetThreadHandle(RPC_SS_THREAD_HANDLE);
554 RPC_STATUS  RpcSmSwapClientAllocFree(PRPC_CLIENT_ALLOC,PRPC_CLIENT_FREE,PRPC_CLIENT_ALLOC*,PRPC_CLIENT_FREE*);
555 void  NdrRpcSsEnableAllocate(PMIDL_STUB_MESSAGE);
556 void  NdrRpcSsDisableAllocate(PMIDL_STUB_MESSAGE);
557 void  NdrRpcSmSetClientToOsf(PMIDL_STUB_MESSAGE);
558 void* NdrRpcSmClientAllocate(uint);
559 void  NdrRpcSmClientFree(void*);
560 void* NdrRpcSsDefaultAllocate(uint);
561 void  NdrRpcSsDefaultFree(void*);
562 PFULL_PTR_XLAT_TABLES  NdrFullPointerXlatInit(uint,XLAT_SIDE);
563 void  NdrFullPointerXlatFree(PFULL_PTR_XLAT_TABLES);
564 int  NdrFullPointerQueryPointer(PFULL_PTR_XLAT_TABLES,void*,ubyte,uint*);
565 int  NdrFullPointerQueryRefId(PFULL_PTR_XLAT_TABLES,uint,ubyte,void**);
566 void  NdrFullPointerInsertRefId(PFULL_PTR_XLAT_TABLES,uint,void*);
567 int  NdrFullPointerFree(PFULL_PTR_XLAT_TABLES,void*);
568 void* NdrAllocate(PMIDL_STUB_MESSAGE,uint);
569 void  NdrClearOutParameters(PMIDL_STUB_MESSAGE,PFORMAT_STRING,void*);
570 void* NdrOleAllocate(uint);
571 void  NdrOleFree(void*);
572 ubyte* NdrUserMarshalMarshall(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
573 ubyte* NdrUserMarshalUnmarshall(PMIDL_STUB_MESSAGE,ubyte**,PFORMAT_STRING,ubyte);
574 void  NdrUserMarshalBufferSize(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);
575 uint  NdrUserMarshalMemorySize(PMIDL_STUB_MESSAGE,PFORMAT_STRING);
576 void  NdrUserMarshalFree(PMIDL_STUB_MESSAGE,ubyte*,PFORMAT_STRING);