summaryrefslogtreecommitdiff
path: root/src/inc/ivalidator.idl
blob: d028d9888eb5a91f035e841a6f6a8ed026294a91 (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
// 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.
/* ------------------------------------------------------------------------- *
 * Common Language Runtime Verifier / Validator Interace
 *
 * Purpose: IValidator is used to staticly validate COR images.
 *
 * Protocol:
 *
 * Client CoCreates CorHost.Validator, 
 *      Calls Validate()
 *          [in/optional] IVEHandler for error callbacks on error
 *          [in/optional] Appdomain to use for validating assemblies
 *
 *      On Error, Validator calls IVEHandler.VEHandler() method. 
 *          (IVEHandler supplied by the client).
 *          VEHandler() could return CONTINUE / STOP ...
 *
 *      VEHandler() can call Validator.FormatEventInfo()  to get a detailed 
 *          error message on any error passed to IVEHandler.
 *
 * ------------------------------------------------------------------------- */

/* ------------------------------------------------------------------------- *
 * Imported types
 * ------------------------------------------------------------------------- */

#ifndef DO_NO_IMPORTS
import "ivehandler.idl";
#endif

#pragma warning(push)
#pragma warning(disable:28718)    //Unable to annotate as this is not a local interface



/* ------------------------------------------------------------------------- *
 * Forward declarations
 * ------------------------------------------------------------------------- */

interface IValidator;
interface ILoader;


/* ------------------------------------------------------------------------- *
 * Flags
 * ------------------------------------------------------------------------- */
enum ValidatorFlags
{
        VALIDATOR_EXTRA_VERBOSE =       0x00000001,
        VALIDATOR_SHOW_SOURCE_LINES =   0x00000002, // RESERVED FOR FUTURE USE
        VALIDATOR_CHECK_ILONLY =        0x00000004,
        VALIDATOR_CHECK_PEFORMAT_ONLY = 0x00000008,
        VALIDATOR_NOCHECK_PEFORMAT =    0x00000010,
        VALIDATOR_TRANSPARENT_ONLY =    0x00000020,
};

/* ------------------------------------------------------------------------- *
 * IValidator interface
 * ------------------------------------------------------------------------- */
[
 object,
 uuid(63DF8730-DC81-4062-84A2-1FF943F59FAC),
 pointer_default(unique)
]
interface IValidator : IUnknown
{
        HRESULT Validate(
                        [in] IVEHandler        *veh,
                        [in] IUnknown          *pAppDomain,
                        [in] unsigned long      ulFlags,
                        [in] unsigned long      ulMaxError,
                        [in] unsigned long      token,
                        [in] LPWSTR             fileName,
                        [in, size_is(ulSize)] BYTE *pe,
                        [in] unsigned long      ulSize);

        HRESULT FormatEventInfo(
                        [in] HRESULT            hVECode,
                        [in] VEContext          Context,
                        [in, out] LPWSTR        msg,
                        [in] unsigned long      ulMaxLength,
                        [in] SAFEARRAY(VARIANT) psa);
};


/* ------------------------------------------------------------------------- *
 * ICLRValidator interface
 * ------------------------------------------------------------------------- */
[
 object,
 uuid(63DF8730-DC81-4062-84A2-1FF943F59FDD),
 pointer_default(unique)
]
interface ICLRValidator : IUnknown
{
        HRESULT Validate(
                        [in] IVEHandler        *veh,
                        [in] unsigned long      ulAppDomainId,
                        [in] unsigned long      ulFlags,
                        [in] unsigned long      ulMaxError,
                        [in] unsigned long      token,
                        [in] LPWSTR             fileName,
                        [in, size_is(ulSize)] BYTE *pe,
                        [in] unsigned long      ulSize);

        HRESULT FormatEventInfo(
                        [in] HRESULT            hVECode,
                        [in] VEContext          Context,
                        [in, out] LPWSTR        msg,
                        [in] unsigned long      ulMaxLength,
                        [in] SAFEARRAY(VARIANT) psa);
};
#pragma warning(pop)