Calling m_pMsg->GetRecipientTable() sometimes crashes Outlook
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 00007ff8
244bcbfc ntdll!NtWaitForMultipleObjects+0x14
01 00000003ddcf9d60 00007ff8
244bc1fe ntdll!WerpWaitForCrashReporting+0xa8
02 00000003ddcf9de0 00007ff8
244bb9bb ntdll!RtlReportExceptionHelper+0x33e
03 00000003ddcf9eb0 00007ff8
23b3c3e9 ntdll!RtlReportException+0x9b
04 00000003ddcf9f30 00007ff8
23b3be72 combase!ServerExceptionFilter(struct _EXCEPTION_POINTERS * lpep = 0x00000003ddcfa040)+0x75 [onecore\com\combase\dcomrem\excepn.cxx @ 192] 05 00000003
ddcf9f80 00007ff823ac36d7 combase!AppInvokeExceptionFilterWithMethodAddress(struct _EXCEPTION_POINTERS * lpep = 0x00000003
ddcfa040, void * pvObject = 0x0000010a88ae8cf8, struct _GUID * riid = <Value unavailable error>, unsigned long dwMethod = <Value unavailable error>, void * pvVtableAddress = 0x00007fff
fc1d68c8, char * szPossibleCause = 0x00007ff823c11c70 "External Server component threw an exception")+0x66 [onecore\com\combase\dcomrem\excepn.cxx @ 476] 06 00000003
ddcf9fd0 00007ff8214ed360 combase!
ObjectMethodExceptionHandlingAction<<lambda_c9f3956a20c9da92a64affc24fdd69ec> >'::1'::filt$0+0x77 [onecore\com\combase\dcomrem\excepn.hxx @ 89] 07 00000003
ddcfa010 00007ff82448184f ucrtbase!_C_specific_handler+0xa0 08 00000003
ddcfa080 00007ff82444a889 ntdll!RtlpExecuteHandlerForException+0xf 09 00000003
ddcfa0b0 00007ff8244804be ntdll!RtlDispatchException+0x219 0a 00000003
ddcfa7c0 00007fffeda4c830 ntdll!KiUserExceptionDispatch+0x2e 0b 00000003
ddcfaef0 00007ffffc1b42e7 EXSEC32!HrExsec32Initialize+0x6420 0c 00000003
ddcfaf20 00007ffffc1bf8ce DMOLHelper!CMessageInfo::GetRecipients(long lType = 0n1, class ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > * strRecipients = 0x00000003
ddcfb098 "")+0x57 [e:\edext1672f\edocs5.client.ext\16.7.2-branch\pkg\edocs5_client_ext\src\dmext\dmol\dmolhelper\messageinfo.cpp @ 373]
Regards,
Phong Nguyen