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
|
// 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.
#ifndef __WELLKNOWNATTRIBUTES_H_
#define __WELLKNOWNATTRIBUTES_H_
enum class WellKnownAttribute : DWORD
{
ParamArray,
DefaultMember,
DisablePrivateReflectionType,
FixedAddressValueType,
UnsafeValueType,
BestFitMapping,
ClassInterface,
CoClass,
ComCompatibleVersion,
ComDefaultInterface,
ComEventInterface,
ComSourceInterfaces,
ComVisible,
DefaultDllImportSearchPaths,
Guid,
LCIDConversion,
IDispatchImpl,
ImportedFromTypeLib,
Intrinsic,
IsByRefLike,
PrimaryInteropAssembly,
ManagedToNativeComInteropStub,
NativeCallable,
TypeIdentifier,
UnmanagedFunctionPointer,
ThreadStatic,
WinRTMarshalingBehaviorAttribute,
CountOfWellKnownAttributes
};
inline const char *GetWellKnownAttributeName(WellKnownAttribute attribute)
{
switch (attribute)
{
case WellKnownAttribute::ParamArray:
return "System.ParamArrayAttribute";
case WellKnownAttribute::DefaultMember:
return "System.Reflection.DefaultMemberAttribute";
case WellKnownAttribute::DisablePrivateReflectionType:
return "System.Runtime.CompilerServices.DisablePrivateReflectionAttribute";
case WellKnownAttribute::FixedAddressValueType:
return "System.Runtime.CompilerServices.FixedAddressValueTypeAttribute";
case WellKnownAttribute::UnsafeValueType:
return "System.Runtime.CompilerServices.UnsafeValueTypeAttribute";
case WellKnownAttribute::BestFitMapping:
return "System.Runtime.InteropServices.BestFitMappingAttribute";
case WellKnownAttribute::ClassInterface:
return "System.Runtime.InteropServices.ClassInterfaceAttribute";
case WellKnownAttribute::CoClass:
return "System.Runtime.InteropServices.CoClassAttribute";
case WellKnownAttribute::ComCompatibleVersion:
return "System.Runtime.InteropServices.ComCompatibleVersionAttribute";
case WellKnownAttribute::ComDefaultInterface:
return "System.Runtime.InteropServices.ComDefaultInterfaceAttribute";
case WellKnownAttribute::ComEventInterface:
return "System.Runtime.InteropServices.ComEventInterfaceAttribute";
case WellKnownAttribute::ComSourceInterfaces:
return "System.Runtime.InteropServices.ComSourceInterfacesAttribute";
case WellKnownAttribute::ComVisible:
return "System.Runtime.InteropServices.ComVisibleAttribute";
case WellKnownAttribute::DefaultDllImportSearchPaths:
return "System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute";
case WellKnownAttribute::Guid:
return "System.Runtime.InteropServices.GuidAttribute";
case WellKnownAttribute::LCIDConversion:
return "System.Runtime.InteropServices.LCIDConversionAttribute";
case WellKnownAttribute::IDispatchImpl:
return "System.Runtime.InteropServices.IDispatchImplAttribute";
case WellKnownAttribute::ImportedFromTypeLib:
return "System.Runtime.InteropServices.ImportedFromTypeLibAttribute";
case WellKnownAttribute::Intrinsic:
return "System.Runtime.CompilerServices.IntrinsicAttribute";
case WellKnownAttribute::IsByRefLike:
return "System.Runtime.CompilerServices.IsByRefLikeAttribute";
case WellKnownAttribute::PrimaryInteropAssembly:
return "System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute";
case WellKnownAttribute::ManagedToNativeComInteropStub:
return "System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute";
case WellKnownAttribute::NativeCallable:
return "System.Runtime.InteropServices.NativeCallableAttribute";
case WellKnownAttribute::TypeIdentifier:
return "System.Runtime.InteropServices.TypeIdentifierAttribute";
case WellKnownAttribute::UnmanagedFunctionPointer:
return "System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute";
case WellKnownAttribute::ThreadStatic:
return "System.ThreadStaticAttribute";
case WellKnownAttribute::WinRTMarshalingBehaviorAttribute:
return "Windows.Foundation.Metadata.MarshalingBehaviorAttribute";
case WellKnownAttribute::CountOfWellKnownAttributes:
default:
break; // Silence compiler warnings
}
_ASSERTE(false); // Should not be possible
return nullptr;
}
#endif // __WELLKNOWNATTRIBUTES_H_
|