werapi.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_WERAPI
  7. #define _INC_WERAPI
  8. #if (_WIN32_WINNT >= 0x0600)
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef enum _WER_FILE_TYPE {
  13. WerFileTypeMicrodump = 1,
  14. WerFileTypeMinidump,
  15. WerFileTypeHeapdump,
  16. WerFileTypeUserDocument,
  17. WerFileTypeOther,
  18. WerFileTypeMax
  19. } WER_FILE_TYPE;
  20. typedef enum _WER_REGISTER_FILE_TYPE {
  21. WerRegFileTypeUserDocument = 1,
  22. WerRegFileTypeOther,
  23. WerRegFileTypeMax
  24. } WER_REGISTER_FILE_TYPE;
  25. typedef enum _WER_DUMP_TYPE {
  26. WerDumpTypeMicroDump = 1,
  27. WerDumpTypeMiniDump,
  28. WerDumpTypeHeapDump,
  29. WerDumpTypeMax
  30. } WER_DUMP_TYPE;
  31. typedef enum _WER_REPORT_UI {
  32. WerUIAdditionalDataDlgHeader = 1,
  33. WerUIIconFilePath,
  34. WerUIConsentDlgHeader,
  35. WerUIConsentDlgBody,
  36. WerUIOnlineSolutionCheckText,
  37. WerUIOfflineSolutionCheckText,
  38. WerUICloseText,
  39. WerUICloseDlgHeader,
  40. WerUICloseDlgBody,
  41. WerUICloseDlgButtonText,
  42. WerUICustomActionButtonText,
  43. WerUIMax
  44. } WER_REPORT_UI;
  45. typedef enum _WER_CONSENT {
  46. WerConsentNotAsked = 1,
  47. WerConsentApproved,
  48. WerConsentDenied,
  49. WerConsentAlwaysPrompt,
  50. WerConsentMax
  51. } WER_CONSENT;
  52. typedef enum _WER_SUBMIT_RESULT {
  53. WerReportQueued = 1,
  54. WerReportUploaded,
  55. WerReportDebug,
  56. WerReportFailed,
  57. WerDisabled,
  58. WerReportCancelled,
  59. WerDisabledQueue,
  60. WerReportAsync,
  61. WerCustomAction
  62. } WER_SUBMIT_RESULT;
  63. typedef enum _WER_REPORT_TYPE {
  64. WerReportNonCritical = 0,
  65. WerReportCritical,
  66. WerReportApplicationCrash,
  67. WerReportApplicationHang,
  68. WerReportKernel,
  69. WerReportInvalid
  70. } WER_REPORT_TYPE;
  71. typedef struct _WER_DUMP_CUSTOM_OPTIONS {
  72. DWORD dwSize;
  73. DWORD dwMask;
  74. DWORD dwDumpFlags;
  75. WINBOOL bOnlyThisThread;
  76. DWORD dwExceptionThreadFlags;
  77. DWORD dwOtherThreadFlags;
  78. DWORD dwExceptionThreadExFlags;
  79. DWORD dwOtherThreadExFlags;
  80. DWORD dwPreferredModuleFlags;
  81. DWORD dwOtherModuleFlags;
  82. WCHAR wzPreferredModuleList[WER_MAX_PREFERRED_MODULES_BUFFER];
  83. } WER_DUMP_CUSTOM_OPTIONS, *PWER_DUMP_CUSTOM_OPTIONS;
  84. typedef struct _WER_EXCEPTION_INFORMATION {
  85. PEXCEPTION_POINTERS pExceptionPointers;
  86. WINBOOL bClientPointers;
  87. } WER_EXCEPTION_INFORMATION, *PWER_EXCEPTION_INFORMATION;
  88. typedef struct _WER_REPORT_INFORMATION {
  89. DWORD dwSize;
  90. HANDLE hProcess;
  91. WCHAR wzConsentKey[64];
  92. WCHAR wzFriendlyEventName[128];
  93. WCHAR wzApplicationName[128];
  94. WCHAR wzApplicationPath[MAX_PATH];
  95. WCHAR wzDescription[512];
  96. HWND hwndParent;
  97. } WER_REPORT_INFORMATION, *PWER_REPORT_INFORMATION;
  98. HRESULT WINAPI WerAddExcludedApplication(PCWSTR pwzExeName,WINBOOL bAllUsers);
  99. HRESULT WINAPI WerGetFlags(HANDLE hProcess,PDWORD pdwFlags);
  100. HRESULT WINAPI WerRegisterFile(PCWSTR pwzFile,WER_REGISTER_FILE_TYPE regFileType,DWORD dwFlags);
  101. HRESULT WINAPI WerRegisterMemoryBlock(PVOID pvAddress,DWORD dwSize);
  102. HRESULT WINAPI WerRemoveExcludedApplication(PCWSTR pwzExeName,WINBOOL bAllUsers);
  103. HRESULT WINAPI WerReportAddDump(HREPORT hReportHandle,HANDLE hProcess,HANDLE hThread,WER_DUMP_TYPE dumpType,PWER_EXCEPTION_INFORMATION pExceptionParam,PWER_DUMP_CUSTOM_OPTIONS pDumpCustomOptions,DWORD dwFlags);
  104. HRESULT WINAPI WerReportAddFile(HREPORT hReportHandle,PCWSTR pwzPath,WER_FILE_TYPE repFileType,DWORD dwFileFlags);
  105. HRESULT WINAPI WerReportCloseHandle(HREPORT hReportHandle);
  106. HRESULT WINAPI WerReportCreate(PCWSTR pwzEventType,WER_REPORT_TYPE repType,PWER_REPORT_INFORMATION pReportInformation,HREPORT *phReportHandle);
  107. HRESULT WINAPI WerReportHang(HWND hwndHungWindow,PCWSTR wszHungApplicationName);
  108. HRESULT WINAPI WerReportSetParameter(HREPORT hReportHandle,DWORD dwparamID,PCWSTR pwzName,PCWSTR pwzValue);
  109. HRESULT WINAPI WerReportSetUIOption(HREPORT hReportHandle,WER_REPORT_UI repUITypeID,PCWSTR pwzValue);
  110. HRESULT WINAPI WerReportSubmit(HREPORT hReportHandle,WER_CONSENT consent,DWORD dwFlags,PWER_SUBMIT_RESULT pSubmitResult);
  111. HRESULT WINAPI WerSetFlags(DWORD dwFlags);
  112. HRESULT WINAPI WerUnregisterFile(PCWSTR pwzFilePath);
  113. HRESULT WINAPI WerUnregisterMemoryBlock(PVOID pvAddress);
  114. #if (_WIN32_WINNT >= 0x0601)
  115. typedef struct _WER_RUNTIME_EXCEPTION_INFORMATION {
  116. DWORD dwSize;
  117. HANDLE hProcess;
  118. HANDLE hThread;
  119. EXCEPTION_RECORD exceptionRecord;
  120. CONTEXT context;
  121. PCWSTR pwszReportId;
  122. } WER_RUNTIME_EXCEPTION_INFORMATION, *PWER_RUNTIME_EXCEPTION_INFORMATION;
  123. typedef HRESULT (WINAPI *PFN_WER_RUNTIME_EXCEPTION_EVENT)(
  124. PVOID pContext,
  125. const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
  126. WINBOOL *pbOwnershipClaimed,
  127. PWSTR pwszEventName,
  128. PDWORD pchSize,
  129. PDWORD pdwSignatureCount
  130. );
  131. typedef HRESULT (WINAPI *PFN_WER_RUNTIME_EXCEPTION_DEBUGGER_LAUNCH)(
  132. PVOID pContext,
  133. const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
  134. PBOOL pbIsCustomDebugger,
  135. PWSTR pwszDebuggerLaunch,
  136. PDWORD pchDebuggerLaunch,
  137. PBOOL pbIsDebuggerAutolaunch
  138. );
  139. typedef HRESULT (WINAPI *PFN_WER_RUNTIME_EXCEPTION_EVENT_SIGNATURE)(
  140. PVOID pContext,
  141. const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
  142. DWORD dwIndex,
  143. PWSTR pwszName,
  144. PDWORD pchName,
  145. PWSTR pwszValue,
  146. PDWORD pchValue
  147. );
  148. HRESULT WINAPI WerRegisterRuntimeExceptionModule(
  149. PCWSTR pwszOutOfProcessCallbackDll,
  150. PVOID pContext
  151. );
  152. HRESULT WINAPI WerUnregisterRuntimeExceptionModule(
  153. PCWSTR pwszOutOfProcessCallbackDll,
  154. PVOID pContext
  155. );
  156. #endif /*(_WIN32_WINNT >= 0x0601)*/
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #endif /*(_WIN32_WINNT >= 0x0600)*/
  161. #endif /*_INC_WERAPI*/