DoctorDumpSDK
CrashRpt.h
Go to the documentation of this file.
1 // Copyright (c) 2018, Idol Software, Inc.
2 // All rights reserved.
3 //
4 // This file is part of Doctor Dump SDK.
5 //
6 // Redistribution and use in source and binary forms without modification, are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9 //
10 // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the distribution.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
15 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
18 // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 //
20 // Project web site https://drdump.com
21 
22 #ifndef __CRASH_RPT_H__
23 #define __CRASH_RPT_H__
24 
25 #include <windows.h>
26 #include <signal.h>
27 #include <stdlib.h>
28 #include <exception>
29 
32 #if !(defined CRASHRPT_ENABLE_RELEASE_ASSERTS)
33 # define CRASHRPT_ENABLE_RELEASE_ASSERTS 1
45 # undef CRASHRPT_ENABLE_RELEASE_ASSERTS // this is to make doxygen document CRASHRPT_ENABLE_RELEASE_ASSERTS macro
46 #elif CRASHRPT_ENABLE_RELEASE_ASSERTS == 1
47 # include <assert.h>
48 # ifndef _DEBUG
49 # undef assert
50 # define assert(expr) ((void) (!(expr) && (crash_rpt::SkipDoctorDump_ReportAssertionViolation<__COUNTER__>(__FUNCTION__ ": "#expr " is false" ), true)))
51 # endif // !_DEBUG
52 #endif // CRASHRPT_ENABLE_RELEASE_ASSERTS
53 
55 namespace crash_rpt {
56 
57 namespace {
58 
59  // This template should be in anonymous namespace since __COUNTER__ is unique only for a single translation unit (as anonymous namespace items)
60  template<unsigned uniqueAssertId>
61  __forceinline static void SkipDoctorDump_ReportAssertionViolation(LPCSTR dumpGroup)
62  {
63  static LONG volatile isAlreadyReported = FALSE;
64  if (TRUE == InterlockedCompareExchange(&isAlreadyReported, TRUE, FALSE))
65  return;
66  ::RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 1, reinterpret_cast<ULONG_PTR*>(&dumpGroup));
67  }
68 
69 } // namespace {
70 
73 {
76  PEXCEPTION_POINTERS ExceptionPointers;
77  DWORD ThreadId;
78 };
79 
82 {
85 };
86 
89 {
95 };
96 
100  ExceptionInfo* exceptionInfo,
101  LPVOID userData
102  );
103 
104 
106 namespace custom_data_collection {
107 
109  enum Result
110  {
114  };
115 
118  {
120  LPBYTE UserData;
121  DWORD UserDataSize;
122  HANDLE Process;
123  DWORD ProcessId;
124  LPVOID ExceptInfo;
125  BOOL WasAssert;
126  LPCSTR DumpGroup;
127  int DumpID;
129  int ProblemID;
130  };
131 
133  struct IDataBag
134  {
138  virtual bool AddFileToReport(
139  LPCWSTR path,
140  LPCWSTR reportFileName /* = NULL */
141  ) = 0;
142 
145  virtual bool RemoveFileFromReport(
146  LPCWSTR path
147  ) = 0;
148 
151  virtual bool AddUserInfoToReport(
152  LPCWSTR key,
153  LPCWSTR value
154  ) = 0;
155 
158  virtual bool RemoveUserInfoFromReport(
159  LPCWSTR key
160  ) = 0;
161  };
162 
165  const ExceptionInfo& exceptionInfo,
166  IDataBag* dataBag
167  );
168 
170  struct Settings
171  {
172  DWORD SettingsSize;
175  LPBYTE UserData;
176  DWORD UserDataSize;
177  };
178 
179 } // namespace custom_data_collection
180 
182 namespace crt_error_handlers {
183 
184  typedef void(__cdecl *_crt_signal_t)(int);
185  typedef _crt_signal_t(__cdecl *pfn_signal)(int sig, _crt_signal_t func);
186  typedef void(__cdecl* terminate_function)();
187  typedef terminate_function(__cdecl *pfn_set_terminate)(terminate_function);
188  typedef void(__cdecl* _invalid_parameter_handler)(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t);
189  typedef _invalid_parameter_handler(__cdecl *pfn_set_invalid_parameter_handler)(_invalid_parameter_handler);
190  typedef void(__cdecl* _purecall_handler)(void);
191  typedef _purecall_handler(__cdecl *pfn_set_purecall_handler)(_purecall_handler);
192 
194  struct Settings
195  {
196  DWORD SettingsSize;
197  pfn_signal Signal;
198  pfn_set_terminate SetTerminate;
199  pfn_set_invalid_parameter_handler SetInvalidParameterHandler;
200  pfn_set_purecall_handler SetPureCallHandler;
201  };
202 
203 } // namespace crt_error_handlers
204 
207 {
210  LPCSTR Prefix;
211  LPCWSTR AppName;
212  LPCWSTR Company;
213  USHORT V[4];
214  USHORT Hotfix;
216 };
217 
222 {
226  BOOL UseWER;
227  DWORD SubmitterID;
230  DWORD FullDumpType;
231  LPCWSTR LangFilePath;
232  LPCWSTR SendRptPath;
233  LPCWSTR DbgHelpPath;
234  PFNCRASHPROCESSINGCALLBACK CrashProcessingCallback;
241 };
242 
247 class CrashRpt
248 {
249 public:
252 
256  LPCSTR applicationGUID,
257  LPCWSTR appName,
258  LPCWSTR company
259  ) throw()
260  {
261  if (!LoadDll())
262  return;
263 
264  InitCrashRpt(applicationGUID, NULL, appName, company, TRUE);
265  }
266 
270  LPCSTR applicationGUID,
271  LPCSTR prefix,
272  LPCWSTR appName,
273  LPCWSTR company,
274  BOOL ownProcess = TRUE
275  ) throw()
278  {
279  if (!LoadDll())
280  return;
281 
282  InitCrashRpt(applicationGUID, prefix, appName, company, ownProcess);
283  }
284 
288  LPCWSTR crashrptPath,
289  LPCSTR applicationGUID,
290  LPCSTR prefix,
291  LPCWSTR appName,
292  LPCWSTR company,
293  BOOL ownProcess = TRUE
294  ) throw()
297  {
298  if (!LoadDll(crashrptPath))
299  return;
300 
301  InitCrashRpt(applicationGUID, prefix, appName, company, ownProcess);
302  }
303 
307  ApplicationInfo* applicationInfo,
308  HandlerSettings* handlerSettings,
309  BOOL ownProcess = TRUE
310  ) throw()
313  {
314  if (!LoadDll())
315  return;
316 
317  InitCrashRpt(applicationInfo, handlerSettings, ownProcess);
318  }
319 
323  LPCWSTR crashrptPath,
324  ApplicationInfo* applicationInfo,
325  HandlerSettings* handlerSettings,
326  BOOL ownProcess = TRUE
327  ) throw()
330  {
331  if (!LoadDll(crashrptPath))
332  return;
333 
334  InitCrashRpt(applicationInfo, handlerSettings, ownProcess);
335  }
336 
337 
341  LPCWSTR crashrptPath = NULL
342  ) throw()
343  {
344  LoadDll(crashrptPath);
345  }
346 
351  {
352  if (!m_IsReadyToExit)
353  return;
354 
355  // If crash has happen not in main thread we should wait here until report will be sent
356  // or else program will be terminated after return from main() and report sending will be halted.
357  while (!m_IsReadyToExit())
358  ::Sleep(100);
359 
360 #if _WIN32_WINNT >= 0x0501 /*_WIN32_WINNT_WINXP*/
361  if (m_bSkipAssertsAdded)
362  RemoveVectoredExceptionHandler(SkipAsserts);
363 #endif
364  }
365 
369  {
370  return m_bWorking;
371  }
372 
377  ApplicationInfo* applicationInfo,
378  HandlerSettings* handlerSettings,
379  BOOL ownProcess = TRUE
380  ) throw()
383  {
384  if (!m_InitCrashRpt)
385  return false;
386 
387  crt_error_handlers::Settings crtErrorHandlersSettings;
388  memset(&crtErrorHandlersSettings, 0, sizeof(crtErrorHandlersSettings));
389  crtErrorHandlersSettings.SettingsSize = sizeof(crtErrorHandlersSettings);
390  crtErrorHandlersSettings.Signal = signal;
391  crtErrorHandlersSettings.SetTerminate = set_terminate;
392 #if defined(_MSC_VER)
393  crtErrorHandlersSettings.SetInvalidParameterHandler = _set_invalid_parameter_handler;
394  crtErrorHandlersSettings.SetPureCallHandler = _set_purecall_handler;
395 #endif
396 
397  HandlerSettings defHandlerSettings;
398  memset(&defHandlerSettings, 0, sizeof(defHandlerSettings));
399  defHandlerSettings.HandlerSettingsSize = sizeof(defHandlerSettings);
400  defHandlerSettings.OpenProblemInBrowser = TRUE;
401  defHandlerSettings.CrtErrorHandlersSettings = &crtErrorHandlersSettings;
402 
403  if (handlerSettings == NULL)
404  {
405  handlerSettings = &defHandlerSettings;
406  }
407  else if (handlerSettings->CrtErrorHandlersSettings == NULL)
408  {
409  handlerSettings->CrtErrorHandlersSettings = &crtErrorHandlersSettings;
410  }
411 
412  m_bWorking = m_InitCrashRpt(applicationInfo, handlerSettings, ownProcess) != FALSE;
413 
414  return m_bWorking;
415  }
416 
421  LPCSTR applicationGUID,
422  LPCSTR prefix,
423  LPCWSTR appName,
424  LPCWSTR company,
425  BOOL ownProcess = TRUE
426  ) throw()
429  {
430  if (!m_GetVersionFromApp)
431  return false;
432 
433  ApplicationInfo appInfo;
434  memset(&appInfo, 0, sizeof(appInfo));
435  appInfo.ApplicationInfoSize = sizeof(appInfo);
436  appInfo.ApplicationGUID = applicationGUID;
437  appInfo.Prefix = prefix;
438  appInfo.AppName = appName;
439  appInfo.Company = company;
440  if (!m_GetVersionFromApp(&appInfo))
441  appInfo.V[0] = 1;
442 
443  return InitCrashRpt(&appInfo, NULL, ownProcess);
444  }
445 
452  LPCWSTR text
453  )
454  {
455  if (!m_SetCustomInfo)
456  return false;
457  m_SetCustomInfo(text);
458  return true;
459  }
460 
465  LPCWSTR key,
466  LPCWSTR value
467  ) throw()
468  {
469  if (!m_AddUserInfoToReport)
470  return false;
471  m_AddUserInfoToReport(key, value);
472  return true;
473  }
474 
479  LPCWSTR key
480  )
481  {
482  if (!m_RemoveUserInfoFromReport)
483  return false;
484  m_RemoveUserInfoFromReport(key);
485  return true;
486  }
487 
496  LPCWSTR path,
497  LPCWSTR reportFileName /* = NULL */
498  ) throw()
499  {
500  if (!m_AddFileToReport)
501  return false;
502  m_AddFileToReport(path, reportFileName);
503  return true;
504  }
505 
510  LPCWSTR path
511  ) throw()
512  {
513  if (!m_RemoveFileFromReport)
514  return false;
515  m_RemoveFileFromReport(path);
516  return true;
517  }
518 
523  ApplicationInfo* appInfo
524  ) throw()
525  {
526  if (!m_GetVersionFromApp)
527  return false;
528  return m_GetVersionFromApp(appInfo) != FALSE;
529  }
530 
534  LPCWSTR path,
535  ApplicationInfo* appInfo
536  ) throw()
537  {
538  if (!m_GetVersionFromFile)
539  return false;
540  return m_GetVersionFromFile(path, appInfo) != FALSE;
541  }
542 
562  EXCEPTION_POINTERS* exceptionPointers
563  )
565  {
566  if (!m_SendReport)
567  {
568  // There is no crash handler but asserts should not crash application anyway, so let's continue
569  if (exceptionPointers->ExceptionRecord->ExceptionCode == ExceptionAssertionViolated)
570  return EXCEPTION_CONTINUE_EXECUTION;
571  return EXCEPTION_CONTINUE_SEARCH;
572  }
573  return m_SendReport(exceptionPointers);
574  }
575 
584  static const DWORD ExceptionAssertionViolated = ((DWORD)0xCCE17000);
585 
587  static const DWORD ExceptionCppTerminate = ((DWORD)0xCCE17001);
588 
590  static const DWORD ExceptionPureCall = ((DWORD)0xCCE17002);
591 
593  static const DWORD ExceptionInvalidParameter = ((DWORD)0xCCE17003);
594 
600  LPCSTR dumpGroup = NULL
601  ) const
602  {
603  if (!m_bWorking)
604  return;
605  if (dumpGroup)
606  ::RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 1, reinterpret_cast<ULONG_PTR*>(&dumpGroup));
607  else
608  ::RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 0, NULL);
609  }
610 
611 private:
612  bool LoadDll(LPCWSTR crashrptPath = NULL) throw()
613  {
614  m_bLoaded = false;
615  m_bWorking = false;
616  m_bSkipAssertsAdded = false;
617  m_InitCrashRpt = NULL;
618  m_SendReport = NULL;
619  m_IsReadyToExit = NULL;
620  m_SetCustomInfo = NULL;
621  m_AddUserInfoToReport = NULL;
622  m_RemoveUserInfoFromReport = NULL;
623  m_AddFileToReport = NULL;
624  m_RemoveFileFromReport = NULL;
625  m_GetVersionFromApp = NULL;
626  m_GetVersionFromFile = NULL;
627 
628  // hCrashrptDll should not be unloaded, crash may appear even after return from main().
629  // So hCrashrptDll is not saved after construction.
630  HMODULE hCrashrptDll = ::LoadLibraryW(crashrptPath ? crashrptPath : L"crashrpt.dll");
631  if (hCrashrptDll != NULL)
632  {
633  m_InitCrashRpt = (pfnInitCrashRpt) GetProcAddress(hCrashrptDll, "InitCrashRpt");
634  m_SendReport = (pfnSendReport) GetProcAddress(hCrashrptDll, "SendReport");
635  m_IsReadyToExit = (pfnIsReadyToExit) GetProcAddress(hCrashrptDll, "IsReadyToExit");
636  m_SetCustomInfo = (pfnSetCustomInfo) GetProcAddress(hCrashrptDll, "SetCustomInfo");
637  m_AddUserInfoToReport = (pfnAddUserInfoToReport) GetProcAddress(hCrashrptDll, "AddUserInfoToReport");
638  m_RemoveUserInfoFromReport = (pfnRemoveUserInfoFromReport) GetProcAddress(hCrashrptDll, "RemoveUserInfoFromReport");
639  m_AddFileToReport = (pfnAddFileToReport) GetProcAddress(hCrashrptDll, "AddFileToReport");
640  m_RemoveFileFromReport = (pfnRemoveFileFromReport) GetProcAddress(hCrashrptDll, "RemoveFileFromReport");
641  m_GetVersionFromApp = (pfnGetVersionFromApp) GetProcAddress(hCrashrptDll, "GetVersionFromApp");
642  m_GetVersionFromFile = (pfnGetVersionFromFile) GetProcAddress(hCrashrptDll, "GetVersionFromFile");
643 
644  m_bLoaded = m_InitCrashRpt
645  && m_SendReport
646  && m_IsReadyToExit
647  && m_SetCustomInfo
648  && m_AddUserInfoToReport
649  && m_RemoveUserInfoFromReport
650  && m_AddFileToReport
651  && m_RemoveFileFromReport
652  && m_GetVersionFromApp
653  && m_GetVersionFromFile;
654  }
655 
656 #if _WIN32_WINNT >= 0x0501 /*_WIN32_WINNT_WINXP*/
657  // if no crash processing was started, we need to ignore ExceptionAssertionViolated exceptions.
658  if (!m_bLoaded)
659  {
660  ::AddVectoredExceptionHandler(TRUE, SkipAsserts);
661  m_bSkipAssertsAdded = true;
662  }
663 #endif
664 
665  return m_bLoaded;
666  }
667 
668  static LONG CALLBACK SkipAsserts(EXCEPTION_POINTERS* pExceptionInfo)
669  {
670  if (pExceptionInfo->ExceptionRecord->ExceptionCode == ExceptionAssertionViolated)
671  return EXCEPTION_CONTINUE_EXECUTION;
672  return EXCEPTION_CONTINUE_SEARCH;
673  }
674 
675  bool m_bLoaded;
676  bool m_bWorking;
677  bool m_bSkipAssertsAdded;
678 
679  typedef BOOL (__cdecl *pfnInitCrashRpt)(ApplicationInfo* applicationInfo, HandlerSettings* handlerSettings, BOOL ownProcess);
680  typedef LONG (__cdecl *pfnSendReport)(EXCEPTION_POINTERS* exceptionPointers);
681  typedef BOOL (__cdecl *pfnIsReadyToExit)();
682  typedef void (__cdecl *pfnSetCustomInfo)(LPCWSTR text);
683  typedef void (__cdecl *pfnAddUserInfoToReport)(LPCWSTR key, LPCWSTR value);
684  typedef void (__cdecl *pfnRemoveUserInfoFromReport)(LPCWSTR key);
685  typedef void (__cdecl *pfnAddFileToReport)(LPCWSTR path, LPCWSTR reportFileName /* = NULL */);
686  typedef void (__cdecl *pfnRemoveFileFromReport)(LPCWSTR path);
687  typedef BOOL (__cdecl *pfnGetVersionFromApp)(ApplicationInfo* appInfo);
688  typedef BOOL (__cdecl *pfnGetVersionFromFile)(LPCWSTR path, ApplicationInfo* appInfo);
689 
690  pfnInitCrashRpt m_InitCrashRpt;
691  pfnSendReport m_SendReport;
692  pfnIsReadyToExit m_IsReadyToExit;
693  pfnSetCustomInfo m_SetCustomInfo;
694  pfnAddUserInfoToReport m_AddUserInfoToReport;
695  pfnRemoveUserInfoFromReport m_RemoveUserInfoFromReport;
696  pfnAddFileToReport m_AddFileToReport;
697  pfnRemoveFileFromReport m_RemoveFileFromReport;
698  pfnGetVersionFromApp m_GetVersionFromApp;
699  pfnGetVersionFromFile m_GetVersionFromFile;
700 };
701 
702 } // namespace crash_rpt
703 
704 #endif // __CRASH_RPT_H__
static const DWORD ExceptionAssertionViolated
Definition: CrashRpt.h:584
Cancel upload.
Definition: CrashRpt.h:113
Setters for CRT error handlers.
Definition: CrashRpt.h:194
BOOL OpenProblemInBrowser
To open Web-page belonging to the uploaded report after it was uploaded set this member to TRUE...
Definition: CrashRpt.h:225
int DumpID
Dump ID of this crash in DrDump service.
Definition: CrashRpt.h:127
CrashProcessingCallbackStage
Stages when crash processing callback called.
Definition: CrashRpt.h:81
bool AddFileToReport(LPCWSTR path, LPCWSTR reportFileName)
Definition: CrashRpt.h:495
Callback is called before report send.
Definition: CrashRpt.h:83
HANDLE Process
Handle to the crashed process.
Definition: CrashRpt.h:122
bool SetCustomInfo(LPCWSTR text)
Definition: CrashRpt.h:451
bool AddUserInfoToReport(LPCWSTR key, LPCWSTR value)
Definition: CrashRpt.h:464
LPCSTR ApplicationGUID
GUID assigned to this application in form 00000000-0000-0000-0000-000000000000.
Definition: CrashRpt.h:209
LPBYTE UserData
Pointer to user-defined data buffer.
Definition: CrashRpt.h:120
LPCWSTR PrivacyPolicyUrl
URL to privacy policy. If NULL default privacy policy is used.
Definition: CrashRpt.h:215
int DumpGroupID
DumpGroup ID of this crash in DrDump service.
Definition: CrashRpt.h:128
BOOL OverrideDefaultFullDumpType
To override default type of data gathered by the library set this member to TRUE and set required typ...
Definition: CrashRpt.h:229
CrashRpt(LPCWSTR crashrptPath, LPCSTR applicationGUID, LPCSTR prefix, LPCWSTR appName, LPCWSTR company, BOOL ownProcess=TRUE)
Definition: CrashRpt.h:287
bool GetVersionFromApp(ApplicationInfo *appInfo)
Definition: CrashRpt.h:522
CrashRpt(LPCSTR applicationGUID, LPCSTR prefix, LPCWSTR appName, LPCWSTR company, BOOL ownProcess=TRUE)
Definition: CrashRpt.h:269
LPBYTE UserData
Pointer to user-defined data buffer.
Definition: CrashRpt.h:175
Default result. Crash handler continues its default processing.
Definition: CrashRpt.h:90
bool RemoveUserInfoFromReport(LPCWSTR key)
Definition: CrashRpt.h:478
DWORD ExceptionInfoSize
Size of this structure. Should be set to sizeof(ExceptionInfo).
Definition: CrashRpt.h:74
int ProblemID
Problem ID of this crash in DrDump service.
Definition: CrashRpt.h:129
DWORD UserDataSize
Size of UserData buffer.
Definition: CrashRpt.h:176
Skip upload confirm dialog and proceed to upload stage.
Definition: CrashRpt.h:112
LPCSTR CollectionFunctionName
Name of collection function exported from CollectionLibraryPath. It should have crash_rpt::custom_dat...
Definition: CrashRpt.h:174
LPCWSTR Company
Company name that will be shown in message box.
Definition: CrashRpt.h:212
This is namespace crash_rpt.
Definition: CrashRpt.h:55
CrashRpt(LPCWSTR crashrptPath, ApplicationInfo *applicationInfo, HandlerSettings *handlerSettings, BOOL ownProcess=TRUE)
Definition: CrashRpt.h:322
Result(CALLBACK * PFNCUSTOMDATACOLLECTIONCALLBACK)(const ExceptionInfo &exceptionInfo, IDataBag *dataBag)
Client crash callback function prototype.
Definition: CrashRpt.h:164
This interface used to add custom data to crash report.
Definition: CrashRpt.h:133
PEXCEPTION_POINTERS ExceptionPointers
Exception pointers. ExceptionPointers->ExceptionRecord->ExceptionCode contains SEH code or ExceptionA...
Definition: CrashRpt.h:76
Callback is called after the report has been sent.
Definition: CrashRpt.h:84
crt_error_handlers::Settings * CrtErrorHandlersSettings
Contains setters for CRT error handlers. Set to NULL to use default handlers.
Definition: CrashRpt.h:239
pfn_set_invalid_parameter_handler SetInvalidParameterHandler
Address of _set_invalid_parameter_handler function.
Definition: CrashRpt.h:199
pfn_signal Signal
Address of signal function.
Definition: CrashRpt.h:197
custom_data_collection::Settings * CustomDataCollectionSettings
Contains data for optional custom data collection after the crash in context of sendrpt.exe process.
Definition: CrashRpt.h:237
~CrashRpt()
Definition: CrashRpt.h:350
LPVOID ExceptInfo
Pointer to MINIDUMP_EXCEPTION_INFORMATION structure.
Definition: CrashRpt.h:124
LPCWSTR SendRptPath
Set this member to NULL to use default behavior when SendRpt is named sendrpt.exe and exist in same f...
Definition: CrashRpt.h:232
BOOL WasAssert
Is it assert? (see crash_rpt::CrashRpt::SkipDoctorDump_SendAssertionViolated).
Definition: CrashRpt.h:125
Result
Result of custom data collection.
Definition: CrashRpt.h:109
Proceed to upload confirm dialog stage.
Definition: CrashRpt.h:111
DWORD SettingsSize
Size of this structure. Should be set to sizeof(crash_rpt::crt_error_handlers::Settings).
Definition: CrashRpt.h:196
Explicitly force crash handler to return EXCEPTION_EXECUTE_HANDLER.
Definition: CrashRpt.h:94
CrashRpt(LPCSTR applicationGUID, LPCWSTR appName, LPCWSTR company)
Definition: CrashRpt.h:255
bool InitCrashRpt(ApplicationInfo *applicationInfo, HandlerSettings *handlerSettings, BOOL ownProcess=TRUE)
Definition: CrashRpt.h:376
DWORD ThreadId
Thread identifier of the crashed thread.
Definition: CrashRpt.h:77
DWORD FullDumpType
The type of information to be generated when full dump is requested by Doctor Dump. This parameter can be one or more of the values from the MINIDUMP_TYPE enumeration.
Definition: CrashRpt.h:230
To enable crash processing you should create an instance of this class.
Definition: CrashRpt.h:247
void SkipDoctorDump_SendAssertionViolated(LPCSTR dumpGroup=NULL) const
Definition: CrashRpt.h:599
DWORD ExceptionInfoSize
Size of this structure. Should be set to sizeof(ExceptionInfo).
Definition: CrashRpt.h:119
Explicitly force crash handler to return EXCEPTION_CONTINUE_EXECUTION.
Definition: CrashRpt.h:92
CrashRpt(ApplicationInfo *applicationInfo, HandlerSettings *handlerSettings, BOOL ownProcess=TRUE)
Definition: CrashRpt.h:306
LPCSTR Prefix
Prefix that will be used with the dump name: YourPrefix_v1.v2.v3.v4_YYYYMMDD_HHMMSS.mini.dmp.
Definition: CrashRpt.h:210
DWORD SubmitterID
Doctor Dump user ID. Uploaded report will be marked as uploaded by this user. This is useful for Doct...
Definition: CrashRpt.h:227
bool RemoveFileFromReport(LPCWSTR path)
Definition: CrashRpt.h:509
bool GetVersionFromFile(LPCWSTR path, ApplicationInfo *appInfo)
Definition: CrashRpt.h:533
USHORT V[4]
Version of this application.
Definition: CrashRpt.h:213
DWORD SettingsSize
Size of this structure. Should be set to sizeof(crash_rpt::custom_data_collection::Settings).
Definition: CrashRpt.h:172
CrashRpt(LPCWSTR crashrptPath=NULL)
Definition: CrashRpt.h:340
Contains data for optional custom data collection after the crash in context of sendrpt.exe process.
Definition: CrashRpt.h:170
bool IsCrashHandlingEnabled() const
Definition: CrashRpt.h:368
bool InitCrashRpt(LPCSTR applicationGUID, LPCSTR prefix, LPCWSTR appName, LPCWSTR company, BOOL ownProcess=TRUE)
Definition: CrashRpt.h:420
CrashProcessingCallbackResult(CALLBACK * PFNCRASHPROCESSINGCALLBACK)(CrashProcessingCallbackStage stage, ExceptionInfo *exceptionInfo, LPVOID userData)
Client crash callback function prototype.
Definition: CrashRpt.h:98
Contains crash handling behavior customization parameters.
Definition: CrashRpt.h:221
pfn_set_purecall_handler SetPureCallHandler
Address of _set_purecall_handler function.
Definition: CrashRpt.h:200
Explicitly force crash handler to return EXCEPTION_CONTINUE_SEARCH.
Definition: CrashRpt.h:93
BOOL FromSendReport
Indicates is exception processed using CrashRpt::SendReport() call.
Definition: CrashRpt.h:75
BOOL UseWER
To continue use Microsoft Windows Error Reporting (WER) set this member to TRUE. In that case after D...
Definition: CrashRpt.h:226
USHORT Hotfix
Version of hotfix for this application (reserved for future use, should be 0).
Definition: CrashRpt.h:214
DWORD UserDataSize
Size of userData buffer.
Definition: CrashRpt.h:121
LPCSTR DumpGroup
Used-defined dump group (see crash_rpt::CrashRpt::SkipDoctorDump_SendAssertionViolated).
Definition: CrashRpt.h:126
LONG SendReport(EXCEPTION_POINTERS *exceptionPointers)
Definition: CrashRpt.h:561
BOOL SendAdditionalDataWithoutApproval
To automatically accepted the question "Do you want to send more information about the problem...
Definition: CrashRpt.h:228
CrashProcessingCallbackResult
Result code for crash processing callback.
Definition: CrashRpt.h:88
BOOL LeaveDumpFilesInTempFolder
To leave error reports in temp folder you should set this member to TRUE. Your support or test lab te...
Definition: CrashRpt.h:224
DWORD ApplicationInfoSize
Size of this structure. Should be set to sizeof(ApplicationInfo).
Definition: CrashRpt.h:208
Crash handler doesn&#39;t send the report and returns its default result.
Definition: CrashRpt.h:91
Information about the exception.
Definition: CrashRpt.h:117
DWORD ProcessId
Process ID of the crashed process.
Definition: CrashRpt.h:123
LPCWSTR LangFilePath
To customize localization set this member to the path to the language file (including file name)...
Definition: CrashRpt.h:231
LPVOID CrashProcessingCallbackUserData
User defined parameter for CrashProcessingCallback. Optional.
Definition: CrashRpt.h:236
Information about exception being processed.
Definition: CrashRpt.h:72
pfn_set_terminate SetTerminate
Address of set_terminate function.
Definition: CrashRpt.h:198
Contains data that identifies your application.
Definition: CrashRpt.h:206
LPCWSTR DbgHelpPath
Definition: CrashRpt.h:233
DWORD HandlerSettingsSize
Size of this structure. Should be set to sizeof(HandlerSettings).
Definition: CrashRpt.h:223
LPCWSTR CollectionLibraryPath
Path to dll where collection function exported from.
Definition: CrashRpt.h:173
LPCWSTR AppName
Application name that will be shown in message box.
Definition: CrashRpt.h:211