Differences From Artifact [8b8a4b41425c59e6]:
- File
src/win32/rpcndr.d
- 2015-04-21 10:46:55 - part of checkin [4e2933c620] on branch trunk - Rebased to the latest verson dmd 2.067. Not yet verified the outcome. (user: kinaba) [annotate]
To Artifact [a54264ccdca8c643]:
- File
src/win32/rpcndr.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
4 * Windows API header module * 4 * Windows API header module *
5 * * 5 * *
6 * Translated from MinGW Windows headers * 6 * Translated from MinGW Windows headers *
7 * * 7 * *
8 * Placed into public domain * 8 * Placed into public domain *
9 \***********************************************************************/ 9 \***********************************************************************/
10 module win32.rpcndr; 10 module win32.rpcndr;
11 pragma(lib, "rpcrt4.lib"); | 11 pragma(lib, "rpcrt4");
12 12
13 /* Translation notes: 13 /* Translation notes:
14 RPC_CLIENT_ALLOC*, RPC_CLIENT_FREE* were replaced with PRPC_CLIENT_ALLOC, PRPC_ 14 RPC_CLIENT_ALLOC*, RPC_CLIENT_FREE* were replaced with PRPC_CLIENT_ALLOC, PRPC_
15 */ 15 */
16 16
17 // TODO: Bitfields in MIDL_STUB_MESSAGE. 17 // TODO: Bitfields in MIDL_STUB_MESSAGE.
18 // Macros need to be converted. 18 // Macros need to be converted.
................................................................................................................................................................................
95 //MACRO #define NdrFieldOffset(s,f) (long)(& (((s *)0)->f)) 95 //MACRO #define NdrFieldOffset(s,f) (long)(& (((s *)0)->f))
96 //MACRO #define NdrFieldPad(s,f,p,t) (NdrFieldOffset(s,f) - NdrFieldOffset(s,p) 96 //MACRO #define NdrFieldPad(s,f,p,t) (NdrFieldOffset(s,f) - NdrFieldOffset(s,p)
97 //MACRO #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8) 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 & 0x0 98 //MACRO #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0
99 99
100 alias void * NDR_CCONTEXT; 100 alias void * NDR_CCONTEXT;
101 struct tagNDR_SCONTEXT { 101 struct tagNDR_SCONTEXT {
102 void *pad[2]; | 102 void*[2] pad;
103 void *userContext; 103 void *userContext;
104 } 104 }
105 alias tagNDR_SCONTEXT * NDR_SCONTEXT; 105 alias tagNDR_SCONTEXT * NDR_SCONTEXT;
106 106
107 struct SCONTEXT_QUEUE { 107 struct SCONTEXT_QUEUE {
108 uint NumberOfObjects; 108 uint NumberOfObjects;
109 NDR_SCONTEXT *ArrayOfObjects; 109 NDR_SCONTEXT *ArrayOfObjects;
................................................................................................................................................................................
113 struct _MIDL_STUB_MESSAGE; 113 struct _MIDL_STUB_MESSAGE;
114 struct _MIDL_STUB_DESC; 114 struct _MIDL_STUB_DESC;
115 struct _FULL_PTR_XLAT_TABLES; 115 struct _FULL_PTR_XLAT_TABLES;
116 116
117 alias ubyte *RPC_BUFPTR; 117 alias ubyte *RPC_BUFPTR;
118 alias uint RPC_LENGTH; 118 alias uint RPC_LENGTH;
119 119
120 alias CPtr!(char) PFORMAT_STRING; | 120 alias const(char)* PFORMAT_STRING;
121 121
122 struct ARRAY_INFO { 122 struct ARRAY_INFO {
123 int Dimension; 123 int Dimension;
124 uint *BufferConformanceMark; 124 uint *BufferConformanceMark;
125 uint *BufferVarianceMark; 125 uint *BufferVarianceMark;
126 uint *MaxCountArray; 126 uint *MaxCountArray;
127 uint *OffsetArray; 127 uint *OffsetArray;
................................................................................................................................................................................
185 uint ActualCount; 185 uint ActualCount;
186 void* function (uint) pfnAllocate; 186 void* function (uint) pfnAllocate;
187 void function (void*) pfnFree; 187 void function (void*) pfnFree;
188 ubyte * StackTop; 188 ubyte * StackTop;
189 ubyte * pPresentedType; 189 ubyte * pPresentedType;
190 ubyte * pTransmitType; 190 ubyte * pTransmitType;
191 handle_t SavedHandle; 191 handle_t SavedHandle;
192 CPtr!(_MIDL_STUB_DESC) StubDesc; | 192 const(_MIDL_STUB_DESC)* StubDesc;
193 _FULL_PTR_XLAT_TABLES *FullPtrXlatTables; 193 _FULL_PTR_XLAT_TABLES *FullPtrXlatTables;
194 uint FullPtrRefId; 194 uint FullPtrRefId;
195 int fCheckBounds; 195 int fCheckBounds;
196 // FIXME: 196 // FIXME:
197 byte bit_fields_for_D; // FIXME: Bitfields 197 byte bit_fields_for_D; // FIXME: Bitfields
198 // int fInDontFree :1; 198 // int fInDontFree :1;
199 // int fDontCallFreeInst :1; 199 // int fDontCallFreeInst :1;
200 // int fInOnlyParam :1; 200 // int fInOnlyParam :1;
201 // int fHasReturn :1; 201 // int fHasReturn :1;
202 uint dwDestContext; 202 uint dwDestContext;
203 void* pvDestContext; 203 void* pvDestContext;
204 NDR_SCONTEXT * SavedContextHandles; 204 NDR_SCONTEXT * SavedContextHandles;
205 int ParamNumber; 205 int ParamNumber;
206 IRpcChannelBuffer * pRpcChannelBuffer; | 206 IRpcChannelBuffer pRpcChannelBuffer;
207 PARRAY_INFO pArrayInfo; 207 PARRAY_INFO pArrayInfo;
208 uint * SizePtrCountArray; 208 uint * SizePtrCountArray;
209 uint * SizePtrOffsetArray; 209 uint * SizePtrOffsetArray;
210 uint * SizePtrLengthArray; 210 uint * SizePtrLengthArray;
211 void* pArgQueue; 211 void* pArgQueue;
212 uint dwStubPhase; 212 uint dwStubPhase;
213 uint w2kReserved[5]; | 213 uint[5] w2kReserved;
214 } 214 }
215 alias MIDL_STUB_MESSAGE * PMIDL_STUB_MESSAGE; 215 alias MIDL_STUB_MESSAGE * PMIDL_STUB_MESSAGE;
216 216
217 extern (Windows) { 217 extern (Windows) {
218 alias void* function (void*) GENERIC_BINDING_ROUTINE; 218 alias void* function (void*) GENERIC_BINDING_ROUTINE;
219 alias void function (void*,ubyte*) GENERIC_UNBIND_ROUTINE; 219 alias void function (void*,ubyte*) GENERIC_UNBIND_ROUTINE;
220 alias uint function (uint *,uint,void *) USER_MARSHAL_SIZING_ROUTINE; 220 alias uint function (uint *,uint,void *) USER_MARSHAL_SIZING_ROUTINE;
................................................................................................................................................................................
289 void function (void*) pfnFree; 289 void function (void*) pfnFree;
290 union _IMPLICIT_HANDLE_INFO { 290 union _IMPLICIT_HANDLE_INFO {
291 handle_t *pAutoHandle; 291 handle_t *pAutoHandle;
292 handle_t *pPrimitiveHandle; 292 handle_t *pPrimitiveHandle;
293 PGENERIC_BINDING_INFO pGenericBindingInfo; 293 PGENERIC_BINDING_INFO pGenericBindingInfo;
294 } 294 }
295 _IMPLICIT_HANDLE_INFO IMPLICIT_HANDLE_INFO; 295 _IMPLICIT_HANDLE_INFO IMPLICIT_HANDLE_INFO;
296 CPtr!(NDR_RUNDOWN) apfnNdrRundownRoutines; | 296 const(NDR_RUNDOWN)* apfnNdrRundownRoutines;
297 CPtr!(GENERIC_BINDING_ROUTINE_PAIR) aGenericBindingRoutinePairs; | 297 const(GENERIC_BINDING_ROUTINE_PAIR)* aGenericBindingRoutinePairs;
298 CPtr!(EXPR_EVAL) apfnExprEval; | 298 const(EXPR_EVAL)* apfnExprEval;
299 CPtr!(XMIT_ROUTINE_QUINTUPLE) aXmitQuintuple; | 299 const(XMIT_ROUTINE_QUINTUPLE)* aXmitQuintuple;
300 CPtr!(char) *pFormatTypes; | 300 const(char)* *pFormatTypes;
301 int fCheckBounds; 301 int fCheckBounds;
302 uint Version; 302 uint Version;
303 MALLOC_FREE_STRUCT *pMallocFreeStruct; 303 MALLOC_FREE_STRUCT *pMallocFreeStruct;
304 int MIDLVersion; 304 int MIDLVersion;
305 CPtr!(COMM_FAULT_OFFSETS) CommFaultOffsets; | 305 const(COMM_FAULT_OFFSETS)* CommFaultOffsets;
306 CPtr!(USER_MARSHAL_ROUTINE_QUADRUPLE) aUserMarshalQuadruple; | 306 const(USER_MARSHAL_ROUTINE_QUADRUPLE)* aUserMarshalQuadruple;
307 CPtr!(NDR_NOTIFY_ROUTINE) NotifyRoutineTable; | 307 const(NDR_NOTIFY_ROUTINE)* NotifyRoutineTable;
308 ULONG_PTR mFlags; 308 ULONG_PTR mFlags;
309 CPtr!(NDR_CS_ROUTINES) CsRoutineTables; | 309 const(NDR_CS_ROUTINES)* CsRoutineTables;
310 void *Reserved4; 310 void *Reserved4;
311 ULONG_PTR Reserved5; 311 ULONG_PTR Reserved5;
312 } 312 }
313 alias CPtr!(MIDL_STUB_DESC) PMIDL_STUB_DESC; | 313 alias const(MIDL_STUB_DESC)* PMIDL_STUB_DESC;
314 314
315 alias void * PMIDL_XMIT_TYPE; 315 alias void * PMIDL_XMIT_TYPE;
316 316
317 struct MIDL_FORMAT_STRING { 317 struct MIDL_FORMAT_STRING {
318 short Pad; 318 short Pad;
319 ubyte Format[1]; | 319 ubyte[1] Format;
320 } 320 }
321 321
322 struct MIDL_SERVER_INFO { 322 struct MIDL_SERVER_INFO {
323 PMIDL_STUB_DESC pStubDesc; 323 PMIDL_STUB_DESC pStubDesc;
324 CPtr!(SERVER_ROUTINE) DispatchTable; | 324 const(SERVER_ROUTINE)* DispatchTable;
325 PFORMAT_STRING ProcString; 325 PFORMAT_STRING ProcString;
326 CPtr!(ushort) FmtStringOffset; | 326 const(ushort)* FmtStringOffset;
327 CPtr!(STUB_THUNK) ThunkTable; | 327 const(STUB_THUNK)* ThunkTable;
328 } 328 }
329 alias MIDL_SERVER_INFO * PMIDL_SERVER_INFO; 329 alias MIDL_SERVER_INFO * PMIDL_SERVER_INFO;
330 330
331 struct MIDL_STUBLESS_PROXY_INFO { 331 struct MIDL_STUBLESS_PROXY_INFO {
332 PMIDL_STUB_DESC pStubDesc; 332 PMIDL_STUB_DESC pStubDesc;
333 PFORMAT_STRING ProcFormatString; 333 PFORMAT_STRING ProcFormatString;
334 CPtr!(ushort) FormatStringOffset; | 334 const(ushort)* FormatStringOffset;
335 } 335 }
336 alias MIDL_STUBLESS_PROXY_INFO *PMIDL_STUBLESS_PROXY_INFO; 336 alias MIDL_STUBLESS_PROXY_INFO *PMIDL_STUBLESS_PROXY_INFO;
337 337
338 union CLIENT_CALL_RETURN { 338 union CLIENT_CALL_RETURN {
339 void *Pointer; 339 void *Pointer;
340 int Simple; 340 int Simple;
341 } 341 }
................................................................................................................................................................................
380 PROXY_CALCSIZE, 380 PROXY_CALCSIZE,
381 PROXY_GETBUFFER, 381 PROXY_GETBUFFER,
382 PROXY_MARSHAL, 382 PROXY_MARSHAL,
383 PROXY_SENDRECEIVE, 383 PROXY_SENDRECEIVE,
384 PROXY_UNMARSHAL 384 PROXY_UNMARSHAL
385 } 385 }
386 386
387 alias void * RPC_SS_THREAD_HANDLE; | 387 alias TypeDef!(void *) RPC_SS_THREAD_HANDLE;
388 388
389 extern (Windows) { 389 extern (Windows) {
390 alias void function (void*) NDR_RUNDOWN; 390 alias void function (void*) NDR_RUNDOWN;
391 alias void function (_MIDL_STUB_MESSAGE*) EXPR_EVAL; 391 alias void function (_MIDL_STUB_MESSAGE*) EXPR_EVAL;
392 alias void function(PMIDL_STUB_MESSAGE) XMIT_HELPER_ROUTINE; 392 alias void function(PMIDL_STUB_MESSAGE) XMIT_HELPER_ROUTINE;
393 alias void function (RPC_BINDING_HANDLE,uint,uint,IDL_CS_CONVERT*,uint*,error_st 393 alias void function (RPC_BINDING_HANDLE,uint,uint,IDL_CS_CONVERT*,uint*,error_st
394 alias void function (RPC_BINDING_HANDLE,uint,uint,IDL_CS_CONVERT*,uint*,error_st 394 alias void function (RPC_BINDING_HANDLE,uint,uint,IDL_CS_CONVERT*,uint*,error_st
................................................................................................................................................................................
510 ubyte * NdrNsGetBuffer(PMIDL_STUB_MESSAGE,uint,RPC_BINDING_HANDLE); 510 ubyte * NdrNsGetBuffer(PMIDL_STUB_MESSAGE,uint,RPC_BINDING_HANDLE);
511 ubyte * NdrSendReceive(PMIDL_STUB_MESSAGE,ubyte*); 511 ubyte * NdrSendReceive(PMIDL_STUB_MESSAGE,ubyte*);
512 ubyte * NdrNsSendReceive(PMIDL_STUB_MESSAGE,ubyte*,RPC_BINDING_HANDLE*); 512 ubyte * NdrNsSendReceive(PMIDL_STUB_MESSAGE,ubyte*,RPC_BINDING_HANDLE*);
513 void NdrFreeBuffer(PMIDL_STUB_MESSAGE); 513 void NdrFreeBuffer(PMIDL_STUB_MESSAGE);
514 514
515 CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC,PFORMAT_STRING,...); 515 CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC,PFORMAT_STRING,...);
516 516
517 int NdrStubCall(IRpcStubBuffer*, IRpcChannelBuffer*,PRPC_MESSAGE,uint*); | 517 int NdrStubCall(IRpcStubBuffer, IRpcChannelBuffer,PRPC_MESSAGE,uint*);
518 void NdrServerCall(PRPC_MESSAGE); 518 void NdrServerCall(PRPC_MESSAGE);
519 int NdrServerUnmarshall(IRpcChannelBuffer*, PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMI | 519 int NdrServerUnmarshall(IRpcChannelBuffer, PRPC_MESSAGE,PMIDL_STUB_MESSAGE,PMID
520 void NdrServerMarshall(IRpcStubBuffer*, IRpcChannelBuffer*,PMIDL_STUB_MESSAGE,P | 520 void NdrServerMarshall(IRpcStubBuffer, IRpcChannelBuffer,PMIDL_STUB_MESSAGE,PFO
521 RPC_STATUS NdrMapCommAndFaultStatus(PMIDL_STUB_MESSAGE,uint*,uint*,RPC_STATUS); 521 RPC_STATUS NdrMapCommAndFaultStatus(PMIDL_STUB_MESSAGE,uint*,uint*,RPC_STATUS);
522 int NdrSH_UPDecision(PMIDL_STUB_MESSAGE,ubyte**,RPC_BUFPTR); 522 int NdrSH_UPDecision(PMIDL_STUB_MESSAGE,ubyte**,RPC_BUFPTR);
523 int NdrSH_TLUPDecision(PMIDL_STUB_MESSAGE,ubyte**); 523 int NdrSH_TLUPDecision(PMIDL_STUB_MESSAGE,ubyte**);
524 int NdrSH_TLUPDecisionBuffer(PMIDL_STUB_MESSAGE,ubyte**); 524 int NdrSH_TLUPDecisionBuffer(PMIDL_STUB_MESSAGE,ubyte**);
525 int NdrSH_IfAlloc(PMIDL_STUB_MESSAGE,ubyte**,uint); 525 int NdrSH_IfAlloc(PMIDL_STUB_MESSAGE,ubyte**,uint);
526 int NdrSH_IfAllocRef(PMIDL_STUB_MESSAGE,ubyte**,uint); 526 int NdrSH_IfAllocRef(PMIDL_STUB_MESSAGE,ubyte**,uint);
527 int NdrSH_IfAllocSet(PMIDL_STUB_MESSAGE,ubyte**,uint); 527 int NdrSH_IfAllocSet(PMIDL_STUB_MESSAGE,ubyte**,uint);