@@ -23,9 +23,9 @@ public import stdext.com;
2323import sdk.win32.oleauto;
2424import sdk.win32.objbase;
2525
26- debug debug = COM ;
27- // debug(COM) debug = COM_DTOR; // causes crashes because logCall needs GC, but finalizer called from within GC
28- // debug(COM) debug = COM_ADDREL;
26+ // debug debug = COM;
27+ // debug(COM) debug = COM_DTOR; // causes crashes because logCall needs GC, but finalizer called from within GC
28+ // debug(COM) debug = COM_ADDREL;
2929
3030import core.runtime ;
3131// debug(COM_ADDREL) debug static import rsgc.gc;
@@ -103,8 +103,8 @@ debug
103103 // logCall needs GC, but finalizer called from within GC
104104 void * vthis = cast (void * ) this ;
105105 debug (COM_DTOR ) logCall(" dtor %s this = %s" , this , vthis);
106- debug (COM_ADDREL )
107- synchronized (DComObject.classinfo)
106+ debug (COM_ADDREL )
107+ synchronized (DComObject.classinfo)
108108 if (auto p = (cast (size_t )vthis^ WEAK_PTR_XOR ) in sReferencedObjects)
109109 * p = - 1 ;
110110 InterlockedDecrement(&sCountInstances);
@@ -118,7 +118,7 @@ debug
118118 sprintf(sbuf.ptr, " %d COM objects created\n " , sCountCreated); ods(sbuf.ptr);
119119 sprintf(sbuf.ptr, " %d COM objects never destroyed (no final collection run yet!)\n " , sCountInstances); ods(sbuf.ptr);
120120 sprintf(sbuf.ptr, " %d COM objects not fully dereferenced\n " , sCountReferenced); ods(sbuf.ptr);
121- debug (COM_ADDREL )
121+ debug (COM_ADDREL )
122122 foreach (p, b; sReferencedObjects)
123123 {
124124 void * q = cast (void * )(p^ WEAK_PTR_XOR );
@@ -175,14 +175,14 @@ version(none) // copy for debugging
175175 {
176176 LONG lRef = super .AddRef();
177177 debug (COM_ADDREL ) logCall(" addref %s this = %s ref = %d" , this , cast (void * )this , lRef);
178-
178+
179179 if (lRef == 1 )
180180 {
181181 debug InterlockedIncrement(&sCountReferenced);
182182 // uint sz = this.classinfo.init.length;
183183 debug void * vthis = cast (void * ) this ;
184184 debug (COM ) logCall(" addroot %s this = %s" , this , vthis);
185- debug (COM_ADDREL )
185+ debug (COM_ADDREL )
186186 synchronized (DComObject.classinfo) sReferencedObjects[cast (size_t )vthis^ WEAK_PTR_XOR ] = 1 ;
187187 }
188188 return lRef;
@@ -193,13 +193,13 @@ version(none) // copy for debugging
193193 ULONG lRef = super .Release();
194194
195195 debug (COM_ADDREL ) logCall(" release %s this = %s ref = %d" , this , cast (void * )this , lRef);
196-
196+
197197 if (lRef == 0 )
198198 {
199199 debug void * vthis = cast (void * ) this ;
200200 debug (COM ) logCall(" delroot %s this = %s" , this , vthis);
201201 debug InterlockedDecrement(&sCountReferenced);
202- debug (COM_ADDREL )
202+ debug (COM_ADDREL )
203203 synchronized (DComObject.classinfo) sReferencedObjects[cast (size_t )vthis^ WEAK_PTR_XOR ] = 0 ;
204204 }
205205 return lRef;
@@ -227,13 +227,13 @@ class DisposingComObject : DComObject
227227}
228228
229229/+
230- struct PARAMDATA
230+ struct PARAMDATA
231231{
232232 OLECHAR* szName;
233233 VARTYPE vtReturn;
234234}
235235
236- struct METHODDATA
236+ struct METHODDATA
237237{
238238 OLECHAR* zName;
239239 PARAMDATA* ppData;
@@ -248,7 +248,7 @@ struct METHODDATA
248248struct INTERFACEDATA
249249{
250250 METHODDATA* pmethdata; // Pointer to an array of METHODDATAs.
251- uint cMembers; // Count of
251+ uint cMembers; // Count of
252252}
253253+/
254254
@@ -262,15 +262,15 @@ class DisposingDispatchObject : DisposingComObject, IDispatch
262262 }
263263
264264 // IDispatch
265- override int GetTypeInfoCount (
265+ override int GetTypeInfoCount (
266266 /* [out] */ UINT * pctinfo)
267267 {
268268// mixin(LogCallMix);
269269 * pctinfo = 1 ;
270270 return S_OK ;
271271 }
272272
273- override int GetTypeInfo (
273+ override int GetTypeInfo (
274274 /* [in] */ in UINT iTInfo,
275275 /* [in] */ in LCID lcid,
276276 /* [out] */ ITypeInfo * ppTInfo)
@@ -283,7 +283,7 @@ class DisposingDispatchObject : DisposingComObject, IDispatch
283283 return S_OK ;
284284 }
285285
286- override int GetIDsOfNames (
286+ override int GetIDsOfNames (
287287 /* [in] */ in IID * riid,
288288 /* [size_is][in] */ in LPOLESTR * rgszNames,
289289 /* [range][in] */ in UINT cNames,
@@ -294,7 +294,7 @@ class DisposingDispatchObject : DisposingComObject, IDispatch
294294 return getTypeHolder ().GetIDsOfNames(rgszNames, cNames, rgDispId);
295295 }
296296
297- override int Invoke (
297+ override int Invoke (
298298 /* [in] */ in DISPID dispIdMember,
299299 /* [in] */ in IID * riid,
300300 /* [in] */ in LCID lcid,
@@ -334,37 +334,37 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
334334 return super .QueryInterface(riid, pvObject);
335335 }
336336
337- override int GetTypeAttr (
337+ override int GetTypeAttr (
338338 /* [out] */ TYPEATTR ** ppTypeAttr)
339339 {
340340 mixin (LogCallMix);
341341 return returnError (E_NOTIMPL );
342342 }
343343
344- override int GetTypeComp (
344+ override int GetTypeComp (
345345 /* [out] */ ITypeComp* ppTComp)
346346 {
347347 mixin (LogCallMix);
348348 return returnError (E_NOTIMPL );
349349 }
350350
351- override int GetFuncDesc (
351+ override int GetFuncDesc (
352352 /* [in] */ in UINT index,
353353 /* [out] */ FUNCDESC ** ppFuncDesc)
354354 {
355355 mixin (LogCallMix);
356356 return returnError (E_NOTIMPL );
357357 }
358358
359- override int GetVarDesc (
359+ override int GetVarDesc (
360360 /* [in] */ in UINT index,
361361 /* [out] */ VARDESC ** ppVarDesc)
362362 {
363363 mixin (LogCallMix);
364364 return returnError (E_NOTIMPL );
365365 }
366366
367- override int GetNames (
367+ override int GetNames (
368368 /* [in] */ in MEMBERID memid,
369369 /* [length_is][size_is][out] */ BSTR * rgBstrNames,
370370 /* [in] */ in UINT cMaxNames,
@@ -374,23 +374,23 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
374374 return returnError (E_NOTIMPL );
375375 }
376376
377- override int GetRefTypeOfImplType (
377+ override int GetRefTypeOfImplType (
378378 /* [in] */ in UINT index,
379379 /* [out] */ HREFTYPE * pRefType)
380380 {
381381 mixin (LogCallMix);
382382 return returnError (E_NOTIMPL );
383383 }
384384
385- override int GetImplTypeFlags (
385+ override int GetImplTypeFlags (
386386 /* [in] */ in UINT index,
387387 /* [out] */ INT * pImplTypeFlags)
388388 {
389389 mixin (LogCallMix);
390390 return returnError (E_NOTIMPL );
391391 }
392392
393- override int GetIDsOfNames (
393+ override int GetIDsOfNames (
394394 /* [size_is][in] */ in LPOLESTR * rgszNames,
395395 /* [in] */ in UINT cNames,
396396 /* [size_is][out] */ MEMBERID * pMemId)
@@ -399,7 +399,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
399399 return returnError (E_NOTIMPL );
400400 }
401401
402- override int Invoke (
402+ override int Invoke (
403403 /* [in] */ in PVOID pvInstance,
404404 /* [in] */ in MEMBERID memid,
405405 /* [in] */ in WORD wFlags,
@@ -412,7 +412,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
412412 return returnError (E_NOTIMPL );
413413 }
414414
415- override int GetDocumentation (
415+ override int GetDocumentation (
416416 /* [in] */ in MEMBERID memid,
417417 /* [out] */ BSTR * pBstrName,
418418 /* [out] */ BSTR * pBstrDocString,
@@ -423,7 +423,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
423423 return returnError (E_NOTIMPL );
424424 }
425425
426- override int GetDllEntry (
426+ override int GetDllEntry (
427427 /* [in] */ in MEMBERID memid,
428428 /* [in] */ in INVOKEKIND invKind,
429429 /* [out] */ BSTR * pBstrDllName,
@@ -434,15 +434,15 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
434434 return returnError (E_NOTIMPL );
435435 }
436436
437- override int GetRefTypeInfo (
437+ override int GetRefTypeInfo (
438438 /* [in] */ in HREFTYPE hRefType,
439439 /* [out] */ ITypeInfo* ppTInfo)
440440 {
441441 mixin (LogCallMix);
442442 return returnError (E_NOTIMPL );
443443 }
444444
445- override int AddressOfMember (
445+ override int AddressOfMember (
446446 /* [in] */ in MEMBERID memid,
447447 /* [in] */ in INVOKEKIND invKind,
448448 /* [out] */ PVOID * ppv)
@@ -451,7 +451,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
451451 return returnError (E_NOTIMPL );
452452 }
453453
454- override int CreateInstance (
454+ override int CreateInstance (
455455 /* [in] */ IUnknown pUnkOuter,
456456 /* [in] */ in IID * riid,
457457 /* [iid_is][out] */ PVOID * ppvObj)
@@ -460,37 +460,37 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
460460 return returnError (E_NOTIMPL );
461461 }
462462
463- override int GetMops (
463+ override int GetMops (
464464 /* [in] */ in MEMBERID memid,
465465 /* [out] */ BSTR * pBstrMops)
466466 {
467467 mixin (LogCallMix2);
468468 return returnError (E_NOTIMPL );
469469 }
470470
471- override int GetContainingTypeLib (
471+ override int GetContainingTypeLib (
472472 /* [out] */ ITypeLib * ppTLib,
473473 /* [out] */ UINT * pIndex)
474474 {
475475 mixin (LogCallMix2);
476476 return returnError (E_NOTIMPL );
477477 }
478478
479- /* [local] */ void ReleaseTypeAttr(
479+ /* [local] */ void ReleaseTypeAttr(
480480 /* [in] */ in TYPEATTR * pTypeAttr)
481481 {
482482 mixin (LogCallMix);
483483 // return returnError(E_NOTIMPL);
484484 }
485485
486- /* [local] */ void ReleaseFuncDesc(
486+ /* [local] */ void ReleaseFuncDesc(
487487 /* [in] */ in FUNCDESC * pFuncDesc)
488488 {
489489 mixin (LogCallMix);
490490 // return returnError(E_NOTIMPL);
491491 }
492492
493- /* [local] */ void ReleaseVarDesc(
493+ /* [local] */ void ReleaseVarDesc(
494494 /* [in] */ in VARDESC * pVarDesc)
495495 {
496496 mixin (LogCallMix);
0 commit comments