@@ -4,13 +4,62 @@ import (
44 "time"
55)
66
7- type WerCrashReport struct {
8- Type string `json:"-" textlog:"-"`
9- Exe string `json:"exe" textlog:"exe"`
10- Date time.Time `json:"date" textlog:"date"`
11- AppPath string `json:"app_path" textlog:"apppath"`
12- Error string `json:"error" textlog:"error"`
13- FaultModule string `json:"fault_in_module" textlog:"fault_in_module"`
7+ // WERCrashReport represents a crash report generated by Windows Error
8+ // Reporting (WER).
9+ //
10+ // For details consult the official documentation [1] and in particular the
11+ // werapi.h reference [2].
12+ //
13+ // There are plenty of fields to consider in the WER report, but the focus is
14+ // on the WER_REPORT_INFORMATION structure required to create a report
15+ // (WerReportCreate()) and the WER_REPORT_UI enumeration that holds additional
16+ // error details if present.
17+ //
18+ // [1] https://learn.microsoft.com/en-us/windows/win32/api/werapi/ns-werapi-wer_report_information
19+ // [2] https://learn.microsoft.com/en-us/windows/win32/api/werapi/ .
20+ type WERCrashReport struct {
21+ ReportType WERReportType `json:"type" textlog:"reporttype"`
22+ // Event name as used in the file name of the WER report (which seems to be deduced from Sig[0].Value), e.g., "evilservice.exe", "Update;", "10.0.19041.1371_", etc.
23+ EventName string `json:"event_name" textlog:"eventname"`
24+ // Event type, e.g., "WindowsWcpOtherFailure3", "StoreAgentScanForUpdatesFailure0", etc.
25+ EventType string `json:"event_type" textlog:"eventtype"`
26+ Date time.Time `json:"date" textlog:"date"`
27+ AppPath string `json:"app_path" textlog:"apppath"`
28+ AppName string `json:"app_name" textlog:"appname"`
29+ // Name of executable from field OriginalFilename
30+ Exe string `json:"exe,omitempty" textlog:"exe,omitempty"`
31+ // Specific error details from UI block: "UI[2] / UI[8]" or "UI[8]" if present.
32+ Error string `json:"error,omitempty" textlog:"error,omitempty"`
33+ // Fault module name from Sig block if present.
34+ FaultModule string `json:"fault_in_module,omitempty" textlog:"fault_in_module,omitempty"`
35+ }
36+
37+ // WERReportType represents the type of a WER report.
38+ //
39+ // From WerApi.h:
40+ // typedef enum _WER_REPORT_TYPE
41+ //
42+ // {
43+ // WerReportNonCritical = 0,
44+ // WerReportCritical = 1,
45+ // WerReportApplicationCrash = 2,
46+ // WerReportApplicationHang = 3,
47+ // WerReportKernel = 4,
48+ // WerReportInvalid
49+ // } WER_REPORT_TYPE;
50+ type WERReportType string
51+
52+ const (
53+ WERReportNonCritical WERReportType = "NonCritical"
54+ WERReportCritical WERReportType = "Critical"
55+ WERReportApplicationCrash WERReportType = "AppCrash"
56+ WERReportApplicationHang WERReportType = "AppHang"
57+ WERReportKernel WERReportType = "Kernel"
58+ WERReportInvalid WERReportType = "Invalid"
59+ )
60+
61+ func (r WERReportType ) String () string {
62+ return string (r )
1463}
1564
1665type AnalysisResult struct {
0 commit comments