1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
// FILE: dwreport.h
//
// This file contains declarations for functions used to report errors occuring
// in a process running managed code.
//
//
//
// ============================================================================
#ifndef __DWREPORT_H__
#define __DWREPORT_H__
// return values for DoFaultReport
enum FaultReportResult
{
FaultReportResultAbort,
FaultReportResultDebug,
FaultReportResultQuit
};
void* GetBucketParametersForManagedException(UINT_PTR ip, TypeOfReportedError tore, Thread * pThread, OBJECTREF * exception);
void FreeBucketParametersForManagedException(void *pgmb);
HRESULT GetBucketParametersForCurrentException(BucketParameters *pParams);
//------------------------------------------------------------------------------
// DoFaultReport
//
// Description
//
// Parameters
// pExceptionInfo -- information about the exception that caused the error.
// If the error is not the result of an exception, pass NULL for this
// parameter
// Returns
// FaultReportResult -- enumeration indicating the
// FaultReportResultAbort -- if Watson could not execute normally
// FaultReportResultDebug -- if Watson executed normally, and the user
// chose to debug the process
// FaultReportResultQuit -- if Watson executed normally, and the user
// chose to end the process (e.g. pressed "Send Error Report" or
// "Don't Send").
//
//------------------------------------------------------------------------------
FaultReportResult DoFaultReport( // Was Watson attempted, successful? Run debugger?
EXCEPTION_POINTERS *pExceptionInfo, // Information about the fault.
TypeOfReportedError tore); // What sort of error is reported.
BOOL InitializeWatson(COINITIEE fFlags);
BOOL InitializeWatsonVersionInfo(LPCSTR pVer);
BOOL IsWatsonEnabled();
BOOL RegisterOutOfProcessWatsonCallbacks();
int DwGetAssemblyVersion( // Number of characters written.
__in_z LPCWSTR wszFilePath, // Path to the executable.
__inout_ecount(cchBuf) WCHAR *pBuf, // Put description here.
int cchBuf);
HRESULT DwGetFileVersionInfo( // S_OK or error
__in_z LPCWSTR wszFilePath, // Path to the executable.
USHORT& major,
USHORT& minor,
USHORT& build,
USHORT& revision);
BOOL ContainsUnicodeChars(__in_z LPCWSTR wsz);
// Proxy parameters for Resetting Watson buckets
struct ResetWatsonBucketsParams
{
Thread * m_pThread;
EXCEPTION_RECORD * pExceptionRecord;
};
void ResetWatsonBucketsFavorWorker(void * pParam);
extern LONG g_watsonAlreadyLaunched;
#if !defined(FEATURE_UEF_CHAINMANAGER)
extern HandleHolder g_hWatsonCompletionEvent;
#endif // FEATURE_UEF_CHAINMANAGER
//----------------------------------------------------------------------------
// Passes data between DoFaultReport and DoFaultReportCallback
//----------------------------------------------------------------------------
typedef enum tagEFaultRepRetVal EFaultRepRetVal;
struct FaultReportInfo
{
BOOL /*in*/ m_fDoReportFault;
EXCEPTION_POINTERS /*in*/ *m_pExceptionInfo;
DWORD /*in*/ m_threadid;
FaultReportResult /*out*/ m_faultReportResult;
EFaultRepRetVal /*out*/ m_faultRepRetValResult;
};
VOID WINAPI DoFaultReportDoFavorCallback(LPVOID pFaultReportInfoAsVoid);
ContractFailureKind GetContractFailureKind(OBJECTREF obj);
#endif // __DWREPORT_H__
|