locked
CA Exit Module RRS feed

  • Question

  • Is it possible to make a CA Exit Module in .NET?

    I only found a c++ project in Microsoft SDK samples.  I tried to follow the example in:

    http://www.hightechtalks.com/dotnet-framework-interop/creating-exit-module-c-209438.html

    but the module is not found in the available exit modules.

     

    Thanks in advance.

     

    Wednesday, October 19, 2011 1:21 PM

All replies

  • Yes. You can write an exit module in .net. The example looks right to me. But don't forget you need to register your exit module with COM. Once your dll is compiled, I think you can register using: regasm <dll> /codebase

     

    Andrew

    Saturday, October 22, 2011 8:30 PM
  • I tried registering with regasm. I also build a setup project in visual studio which makes an installation for the dll.

    The registration and the installation completes successfully, but there is no module available in the list of exit modules.

    It seems to me like I somehow need to bind the Microsoft dll interfaces to my implementation.

    The documentation specifies something for c++, but I'm not sure what to do for C#:

    DECLARE_REGISTRY(
        CMyCertExitModule,
        L"MyCode.Exit.1",
        L"MyCode.Exit",
        IDS_CERTEXITMODULE_DESC,
        THREADFLAGS_BOTH)
    Monday, October 24, 2011 7:49 AM
  • that looks like COM registration. Did you check your registry to make sure your dll got registered under the correct interface id?

    andrew

    Tuesday, October 25, 2011 2:54 AM
  • I'm not sure.

    There are some registry entries, but I don't know if I have to add some custom entries.

    I assume you mead there should be a connection between the interface I implement and my application id?

    IID_ICertExit is defined as e19ae1a0-7364-11d0-8816-00a0c903b83c

     

     

    Tuesday, October 25, 2011 7:29 AM
  • Your exit module must have a clsid. Do you see it under

    HKEY_CLASSES_ROOT\CLSID\{guid} ?

    Also a type library?

    HKEY_CLASSES_ROOT\TypeLib\{guid} ?

     

    Wednesday, October 26, 2011 12:02 AM
  • I see it only under type library:

    HKEY_CLASSES_ROOT\TypeLib\{guid}

    and not under:

    HKEY_CLASSES_ROOT\CLSID\{guid}

    Do you know what keys I should put under it?
    Maybe I should register the c++ sample from the sdk and check what entries it creates.

     

     

    Wednesday, October 26, 2011 8:39 AM