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