floatingfrisbee
floatingfrisbee

Reputation: 938

AccessViolationException when logging onto a MAPI Profile

Part of our application is a windows process that logs onto MAPI and indexes email in the background. It works well with many different versions of Outlook, and up to a few days ago, used to work with Outlook 2016. Now it gives an AccessViolationException when logging on to a MAPI profile.

This is the exception message:

Exception thrown at 0x00007FFDA7716BB9 (Mso20win32client.dll) in Tray.exe: 0xC0000005: Access violation writing location 0x0000000000000000.

We haven't yet been able to figure out why it is trying to access that location. As far as we can tell, all arguments are valid.

The call stack looks like this (we don't have symbols for Outlook dlls):

 Mso20win32client.dll!00007ffda7716bb9()    Unknown
 OLMAPI32.DLL!00007ffda48e325e()    Unknown
 OLMAPI32.DLL!00007ffda48274e1()    Unknown
 OLMAPI32.DLL!00007ffda4827466()    Unknown
 OLMAPI32.DLL!00007ffda4827408()    Unknown
 OLMAPI32.DLL!00007ffda4827317()    Unknown
 CONTAB32.DLL!00007ffdee6a14f6()    Unknown
 OLMAPI32.DLL!00007ffda482670c()    Unknown
 OLMAPI32.DLL!00007ffda48261cd()    Unknown
 OLMAPI32.DLL!00007ffda48253c6()    Unknown
 OLMAPI32.DLL!00007ffda481653c()    Unknown
 OLMAPI32.DLL!00007ffda4815dc8()    Unknown
 MSMAPI32.DLL!00007ffdef225ee6()    Unknown
 [External Code] 

There are some posts out there which talk about similar issues, one in particular which seems relevant is this one on Experts Exchange, but we still haven't been able to identify the root cause or the fix.

Interestingly spikes (test programs) created to narrow down the issue do not exhibit the problem. Also MFCMAPI which is a tool for visualizing MAPI information works well, i.e. we are able to log on to the same profiles using it.

Has anyone else seen a similar issue? Any ideas on how to debug futher?

Upvotes: 1

Views: 795

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66316

You are loading olmapi32.dll. Do not do that - load msmapi32.dll.

Upvotes: 1

Related Questions