none
IMAPISession::Release appears to hang when running as a windows service (Outlook 2016) RRS feed

  • Question

  • IMAPISession::Release() is hanging when running as a service application, the call never returns and no exception is thrown.

    This is only occurring with MAPI dlls distributed with Outlook 2016 - all prior versions of outlook do not appear to exhibit this behavior.

    The following steps will cause IMapiSession::Release to hang when executing as a windows service

    MAPIINIT_0 init = { MAPI_INIT_VERSION, 0 };
    init.ulFlags = MAPI_NT_SERVICE;
    //call to MAPIInitialize with this init object

    DWORD dwFlags = = MAPI_EXTENDED | MAPI_NEW_SESSION | MAPI_USE_DEFAULT;
    dwFlags |= MAPI_NT_SERVICE | MAPI_NO_MAIL;
    //call to MAPILogonEx with these flags

    now that we have a mapi session call
    MAPISession::Logoff(0,0,0)
    MAPISession::Release() //this call hangs and never returns
    Friday, March 31, 2017 7:34 PM

All replies

  • Hi Ben,

    Here we mainly focus on Office client related question, I'm moving your question to the following dedicated development forum, there you should get more professional responses:

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,

    Ethan Hua


    Please remember to mark the replies as answers if they helped.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, April 3, 2017 9:39 AM
  • What is in the profile returned by MAPILogonEx? IMAP4 provider can be very problematic.

    Have you tried to create a crash dump of your process and look at the call stack in windbg.exe?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, April 4, 2017 3:14 AM