locked
Outlook 2016 mapi.MAPIUninitialize() crashes RRS feed

  • Question

  • Hi,

    In my multi threaded application where multiple threads do mapi initialize by
    mapi.MAPIInitialize((0, mapi.MAPI_MULTITHREAD_NOTIFICATIONS))

    mapi.MAPIUninitialize() crashes.

    I got the following call stack from windbg.

    mso30win32client!Ordinal250+0x32423
    mso30win32client!Ordinal126+0x5b
    mso30win32client!Ordinal1337+0x39d
    mso30win32client!Ordinal1470+0x17e
    mso30win32client!Ordinal1470+0xe
    mso40uiwin32client!Ordinal2408+0x19
    olmapi32!LINKEDLIST_RemoveKey+0x4e6
    olmapi32!HrUninitMso+0x36
    olmapi32!MAPIUninitialize+0x9
    MSMAPI32!MAPIUninitialize+0x42
    MAPI32!MAPIUninitialize+0x5b
    mapi+0x11d9 

    Each thread does only following mapi calls in sequence :
    1 MAPIInitialize,
    2 MAPIAdminProfiles,
    3 HrQueryAllRows,
    4 session=MAPILogonEx,
    5 session.logoff,
    6 MAPIUninitialize

    Observation:
    If there are two threads T1 and T2 .
    T1 logs in to session prior to T2 and T1 does MAPIUninitialize after T2 it dont lead to crash, 
    But if T1 logs in to session prior to T2 and T1 does MAPIUninitialize before T2 then call to MAPIUninitialize leads to crash with above stack.

    PS : Crash occurs with Outlook 2016 only and works fine with Outlook 2013 and prior.
    Tuesday, December 1, 2015 5:56 AM

Answers