Is it possible to intercept (or be aware of) COM Reference counting on CLR objects exposed to COM

前端 未结 10 1035
礼貌的吻别
礼貌的吻别 2020-12-08 02:56

I have rephrased this question.

When .net objects are exposed to COM Clients through COM iterop, a CCW (COM Callable Wrapper) is created, this sits between

10条回答
  •  囚心锁ツ
    2020-12-08 03:57

    .Net framework works differently, see:
    The .NET Framework provides memory management techniques that differ from the way memory management worked in a COM-based world. The memory management in COM was through reference counting. .NET provides an automatic memory management technique that involves reference tracing. In this article, we'll take a look at the garbage collection technique used by the Common Language Runtime CLR.

    nothing to be done

    [EDITED] more one round...

    Take a look at this alternative Importing a Type Library as an Assembly
    As you yourself said using CCW you can access reference-counte in traditional COM fashion.

    [EDITED] Persistence is a virtue
    You know WinAPIOverride32? With it you can capture and study how it works. Another tool that can help is Deviare COM Spy Console.
    This will not be easy.
    Good luck.

提交回复
热议问题