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