21 #include "SharedMem.h" 36 terminate_handler m_prevTerm;
37 unexpected_handler m_prevUnexp;
38 void (__cdecl *m_prevSigFPE)(int);
39 void (__cdecl *m_prevSigILL)(int);
40 void (__cdecl *m_prevSigSEGV)(int);
44 int crSetErrorMsg(PTSTR pszErrorMsg);
52 m_bAllowDelete = FALSE;
55 CString m_sSrcFilePath;
56 CString m_sDstFileName;
57 CString m_sDescription;
70 m_bAllowDelete =
false;
73 CString m_sDstFileName;
91 __in_opt LPCTSTR lpcszAppName = NULL,
92 __in_opt LPCTSTR lpcszAppVersion = NULL,
93 __in_opt LPCTSTR lpcszCrashSenderPath = NULL,
95 __in_opt LPCTSTR lpcszTo = NULL,
96 __in_opt LPCTSTR lpcszSubject = NULL,
97 __in_opt LPCTSTR lpcszUrl = NULL,
98 __in_opt UINT (*puPriorities)[5] = NULL,
100 __in_opt LPCTSTR lpcszPrivacyPolicyURL = NULL,
101 __in_opt LPCTSTR lpcszDebugHelpDLLPath = NULL,
102 MINIDUMP_TYPE MiniDumpType = MiniDumpNormal,
103 __in_opt LPCTSTR lpcszErrorReportSaveDir = NULL,
104 __in_opt LPCTSTR lpcszRestartCmdLine = NULL,
105 __in_opt LPCTSTR lpcszLangFilePath = NULL,
106 __in_opt LPCTSTR lpcszEmailText = NULL,
107 __in_opt LPCTSTR lpcszSmtpProxy = NULL,
108 __in_opt LPCTSTR lpcszCustomSenderIcon = NULL,
109 __in_opt LPCTSTR lpcszSmtpLogin = NULL,
110 __in_opt LPCTSTR lpcszSmtpPassword = NULL,
111 __in_opt
int nRestartTimeout = 0);
114 BOOL IsInitialized();
126 int AddFile(__in_z LPCTSTR lpFile, __in_opt LPCTSTR lpDestFile,
127 __in_opt LPCTSTR lpDesc, DWORD dwFlags);
130 int AddProperty(CString sPropName, CString sPropValue);
133 int AddScreenshot(DWORD dwFlags,
int nJpegQuality);
137 int AddVideo(DWORD dwFlags,
int nDuration,
int nFrameInterval, SIZE* pDesiredFrameSize, HWND hWndParent);
140 int AddRegKey(__in_z LPCTSTR szRegKey, __in_z LPCTSTR szDstFileName, DWORD dwFlags);
146 int SetProcessExceptionHandlers(DWORD dwFlags);
147 int UnSetProcessExceptionHandlers();
150 int SetThreadExceptionHandlers(DWORD dwFlags);
151 int UnSetThreadExceptionHandlers();
160 static void ReleaseCurrentProcessCrashHandler();
165 static LONG WINAPI SehHandler(__in PEXCEPTION_POINTERS pExceptionPtrs);
166 static DWORD WINAPI StackOverflowThreadFunction(LPVOID threadParameter);
168 static void __cdecl TerminateHandler();
170 static void __cdecl UnexpectedHandler();
174 static void __cdecl PureCallHandler();
177 #if _MSC_VER>=1300 && _MSC_VER<1400 179 static void __cdecl SecurityHandler(
int code,
void *x);
184 static void __cdecl InvalidParameterHandler(
const wchar_t* expression,
185 const wchar_t*
function,
const wchar_t* file,
unsigned int line, uintptr_t pReserved);
190 static int __cdecl NewHandler(
size_t);
194 static void SigabrtHandler(
int);
195 static void SigfpeHandler(
int ,
int subcode);
196 static void SigintHandler(
int);
197 static void SigillHandler(
int);
198 static void SigsegvHandler(
int);
199 static void SigtermHandler(
int);
204 void GetExceptionPointers(
205 DWORD dwExceptionCode,
206 EXCEPTION_POINTERS* pExceptionPointers);
211 DWORD PackString(CString str);
215 DWORD PackProperty(CString sName, CString sValue);
217 DWORD PackRegKey(CString sKeyName,
RegKeyInfo& rki);
220 int LaunchCrashSender(
221 LPCTSTR szCmdLineParams,
223 __out_opt HANDLE* phProcess);
226 BOOL IsSenderProcessAlive();
229 void InitPrevExceptionHandlerPointers();
238 void UpdateEmailSubject(LPCWSTR pszSubject);
241 void CrashLock(BOOL bLock);
252 LPTOP_LEVEL_EXCEPTION_FILTER m_oldSehHandler;
255 _purecall_handler m_prevPurec;
256 _PNH m_prevNewHandler;
260 _invalid_parameter_handler m_prevInvpar;
263 #if _MSC_VER>=1300 && _MSC_VER<1400 264 _secerr_handler_func m_prevSec;
267 void (__cdecl *m_prevSigABRT)(int);
268 void (__cdecl *m_prevSigINT)(int);
269 void (__cdecl *m_prevSigTERM)(int);
272 std::map<DWORD, ThreadExceptionHandlers> m_ThreadExceptionHandlers;
273 CCritSec m_csThreadExceptionHandlers;
277 CString m_sAppVersion;
278 CString m_sCrashGUID;
279 CString m_sImageName;
281 MINIDUMP_TYPE m_MinidumpType;
282 CString m_sRestartCmdLine;
283 int m_nRestartTimeout;
287 CString m_sSmtpProxyServer;
288 int m_nSmtpProxyPort;
289 CString m_sSmtpLogin;
290 CString m_sSmtpPassword;
291 CString m_sEmailSubject;
292 CString m_sEmailText;
293 UINT m_uPriorities[3];
294 CString m_sPrivacyPolicyURL;
295 CString m_sPathToCrashSender;
296 CString m_sLangFileName;
297 CString m_sPathToDebugHelpDll;
298 CString m_sUnsentCrashReportsFolder;
300 BOOL m_bAddScreenshot;
301 DWORD m_dwScreenshotFlags;
304 DWORD m_dwVideoFlags;
305 int m_nVideoDuration;
306 int m_nVideoFrameInterval;
307 SIZE m_DesiredFrameSize;
308 HWND m_hWndVideoParent;
309 CString m_sCustomSenderIcon;
310 std::map<CString, FileItem> m_files;
311 std::map<CString, CString> m_props;
312 std::map<CString, RegKeyInfo> m_RegKeys;
320 HANDLE m_hSenderProcess;
323 LPVOID m_pCallbackParam;
324 std::string m_sErrorReportDirA;
325 std::wstring m_sErrorReportDirW;
326 int m_nCallbackRetCode;
327 BOOL m_bContinueExecution;
Defines the interface for the CrashRpt.DLL.
Definition: SharedMem.h:127
BOOL(CALLBACK * LPGETLOGFILE)(__reserved LPVOID lpvState)
Client crash callback function prototype.
Definition: CrashRpt.h:93
int(CALLBACK * PFNCRASHCALLBACKW)(CR_CRASH_CALLBACK_INFOW *pInfo)
Client crash callback function prototype.
Definition: CrashRpt.h:382
Definition: CrashHandler.h:66
Definition: CrashHandler.h:25
Definition: CrashHandler.h:79
This structure contains information about the crash.
Definition: CrashRpt.h:179
Definition: CrashHandler.h:47
Definition: inftrees.h:24
int(CALLBACK * PFNCRASHCALLBACKA)(CR_CRASH_CALLBACK_INFOA *pInfo)
Client crash callback function prototype.
Definition: CrashRpt.h:387
Definition: SharedMem.h:67