summaryrefslogtreecommitdiff
path: root/src/inc/mscoruef.idl
blob: 4ed554f5442114ecb75bd82c791428f60761a94b (plain)
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
106
107
108
109
110
111
112
113
114
115
116
117
// 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.
//

//
/**************************************************************************************
 **                                                                                  **
 ** Mscoruef.idl - interface definitions for internal UEF chain management.          **
 **                                                                                  **
 **************************************************************************************/

//
// Interface descriptions
//
import "unknwn.idl";

cpp_quote("#ifdef FEATURE_UEF_CHAINMANAGER")

// IID IUEFManager :     uuid(F4D25DF3-E9B3-439c-8B2B-C814E36F9404)
cpp_quote("EXTERN_GUID(IID_IUEFManager, 0xf4d25df3, 0xe9b3, 0x439c, 0x8b, 0x2b, 0xc8, 0x14, 0xe3, 0x6f, 0x94, 0x4);")

// IID IWatsonSxSManager :uuid(A269593A-51E2-46bf-B914-8DCC5C39B5A5)
cpp_quote("EXTERN_GUID(IID_IWatsonSxSManager, 0xa269593a, 0x51e2, 0x46bf, 0xb9, 0x14, 0x8d, 0xcc, 0x5c, 0x39, 0xb5, 0xa5);")

cpp_quote("#ifdef __midl")

#define EXCEPTION_MAXIMUM_PARAMETERS 15

typedef struct _EXCEPTION_RECORD {
    DWORD ExceptionCode;
    DWORD ExceptionFlags;
    struct _EXCEPTION_RECORD *ExceptionRecord;
    PVOID ExceptionAddress;
    DWORD NumberParameters;
    ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
} EXCEPTION_RECORD, *PEXCEPTION_RECORD;

typedef struct _EXCEPTION_POINTERS {
    PEXCEPTION_RECORD ExceptionRecord;
    PVOID ContextRecord; // not using PCONTEXT here to avoid pulling extra definitions into this file
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS;

typedef LONG (__stdcall *PTOP_LEVEL_EXCEPTION_FILTER)(
    struct _EXCEPTION_POINTERS * pExceptionPointers);

typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;

cpp_quote("#endif // __midl")

typedef BOOL (__stdcall * IsExceptionFromManagedCodeFnPtr)(EXCEPTION_RECORD * pExceptionRecord);

//*****************************************************************************
// Interface for Watson SxS management to the VM.
//*****************************************************************************
[
    uuid(A269593A-51E2-46bf-B914-8DCC5C39B5A5),
    helpstring("CLR Watson SxS Management Interface"),
    pointer_default(unique),
    local
]
interface IWatsonSxSManager : IUnknown
{
    // Used to register an exception claiming callback
    BOOL RegisterExceptionClaimingCallback(
        [in] IsExceptionFromManagedCodeFnPtr pCallback);

    // Used to unregister an exception claiming callback
    BOOL UnregisterExceptionClaimingCallback(
        [in] IsExceptionFromManagedCodeFnPtr pCallback);

    // Used to determine if the exception pointed by pExceptionRecord was thrown by a registered runtime
    BOOL IsExceptionClaimed(
        [in] EXCEPTION_RECORD * pExceptionRecord);

    // Used to check if Watson has been triggered
    BOOL HasWatsonBeenTriggered(void);

    // Used to bestow the permission to report Watson to only one of its callers
    BOOL IsCurrentRuntimeAllowedToReportWatson(void);

    // Used to wait for the Watson SxS completion event
    BOOL WaitForWatsonSxSCompletionEvent(void);

    // Used to signal Watson SxS completion event
    BOOL SignalWatsonSxSCompletionEvent(void);
};

//*****************************************************************************
// Interface for UEF chain management to the VM.
//*****************************************************************************
[
    uuid(F4D25DF3-E9B3-439c-8B2B-C814E36F9404),
    helpstring("CLR UEF Chain Management Interface"),
    pointer_default(unique),
    local
]
interface IUEFManager : IUnknown
{
    // Used to register the function to be invoked upon unhandled exception
    // notification from the OS
    BOOL AddUnhandledExceptionFilter(
        [in] LPTOP_LEVEL_EXCEPTION_FILTER uefCallbackFunc,
        [in] BOOL firstHandler);

    // Used to unregister a previously registered UEF callback 
    BOOL RemoveUnhandledExceptionFilter(
        [in] LPTOP_LEVEL_EXCEPTION_FILTER uefCallbackFunc);

    // Used to explicitly invoke the registered UEF callbacks
    LONG InvokeUEFCallbacks(LPEXCEPTION_POINTERS pExceptionInfo);

    // Used to return the WatsonSxSManager singleton instance
    IWatsonSxSManager * GetWastonSxSManagerInstance(void);
};

cpp_quote("#endif // FEATURE_UEF_CHAINMANAGER")