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