Calling m_pMsg->GetRecipientTable() sometimes crashes Outlook

Phong Nguyen 1 Reputation point
2021-06-15T20:31:04.2+00:00

We have an Outlook add-in that intercepts new email when it is about to send to save it in our document management system.
In some systems (not in my system so it is hard to debug to figure why?) , it crashes Outlook, and by look at the dump we could see that it crashes when this code is called
CComPtr<IMessage> m_pMsg;
CComPtr<IMAPITable> pRecipTable;
HRESULT hr = m_pMsg->GetRecipientTable(0, &pRecipTable); <----- crash here see line 373 in the dump below

Below is a part of the Outlook.exe dump that related to our code:
00 00000003ddcf9d58 00007ff8244bcbfc ntdll!NtWaitForMultipleObjects+0x14
01 00000003ddcf9d60 00007ff8244bc1fe ntdll!WerpWaitForCrashReporting+0xa8
02 00000003ddcf9de0 00007ff8244bb9bb ntdll!RtlReportExceptionHelper+0x33e
03 00000003ddcf9eb0 00007ff823b3c3e9 ntdll!RtlReportException+0x9b
04 00000003ddcf9f30 00007ff823b3be72 combase!ServerExceptionFilter(struct _EXCEPTION_POINTERS * lpep = 0x00000003ddcfa040)+0x75 [onecore\com\combase\dcomrem\excepn.cxx @ 192] 05 00000003ddcf9f80 00007ff823ac36d7 combase!AppInvokeExceptionFilterWithMethodAddress(struct _EXCEPTION_POINTERS * lpep = 0x00000003ddcfa040, void * pvObject = 0x0000010a88ae8cf8, struct _GUID * riid = <Value unavailable error>, unsigned long dwMethod = <Value unavailable error>, void * pvVtableAddress = 0x00007ffffc1d68c8, char * szPossibleCause = 0x00007ff823c11c70 "External Server component threw an exception")+0x66 [onecore\com\combase\dcomrem\excepn.cxx @ 476] 06 00000003ddcf9fd0 00007ff8214ed360 combase!ObjectMethodExceptionHandlingAction<<lambda_c9f3956a20c9da92a64affc24fdd69ec> >'::1'::filt$0+0x77 [onecore\com\combase\dcomrem\excepn.hxx @ 89] 07 00000003ddcfa010 00007ff82448184f ucrtbase!_C_specific_handler+0xa0 08 00000003ddcfa080 00007ff82444a889 ntdll!RtlpExecuteHandlerForException+0xf 09 00000003ddcfa0b0 00007ff8244804be ntdll!RtlDispatchException+0x219 0a 00000003ddcfa7c0 00007fffeda4c830 ntdll!KiUserExceptionDispatch+0x2e 0b 00000003ddcfaef0 00007ffffc1b42e7 EXSEC32!HrExsec32Initialize+0x6420 0c 00000003ddcfaf20 00007ffffc1bf8ce DMOLHelper!CMessageInfo::GetRecipients(long lType = 0n1, class ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > * strRecipients = 0x00000003ddcfb098 "")+0x57 [e:\edext1672f\edocs5.client.ext\16.7.2-branch\pkg\edocs5_client_ext\src\dmext\dmol\dmolhelper\messageinfo.cpp @ 373]

Regards,

Phong Nguyen

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,532 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
4,912 questions
{count} votes