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// NSENUMS.H -
5//
6
7//
8// Defines NStruct-related enums
9//
10
11// NStruct Field Type's
12//
13// Columns:
14// Name - name of enum
15// Size - the native size (in bytes) of the field.
16// for some fields, this value cannot be computed
17// without more information. if so, put a zero here
18// and make sure CollectNStructFieldMetadata()
19// has code to compute the size.
20// WinRTSupported - true if the field type is supported in WinRT
21// scenarios.
22//
23// PS - Append new entries only at the end of the enum to avoid phone versioning break.
24// Name (COM+ - Native) Size
25
26DEFINE_NFT(NFT_NONE, 0, false)
27
28DEFINE_NFT(NFT_STRINGUNI, sizeof(LPVOID), false)
29DEFINE_NFT(NFT_STRINGANSI, sizeof(LPVOID), false)
30DEFINE_NFT(NFT_FIXEDSTRINGUNI, 0, false)
31DEFINE_NFT(NFT_FIXEDSTRINGANSI, 0, false)
32
33DEFINE_NFT(NFT_FIXEDCHARARRAYANSI, 0, false)
34DEFINE_NFT(NFT_FIXEDARRAY, 0, false)
35
36DEFINE_NFT(NFT_DELEGATE, sizeof(LPVOID), false)
37
38DEFINE_NFT(NFT_COPY1, 1, true)
39DEFINE_NFT(NFT_COPY2, 2, true)
40DEFINE_NFT(NFT_COPY4, 4, true)
41DEFINE_NFT(NFT_COPY8, 8, true)
42
43DEFINE_NFT(NFT_ANSICHAR, 1, false)
44DEFINE_NFT(NFT_WINBOOL, sizeof(BOOL), false)
45
46DEFINE_NFT(NFT_NESTEDLAYOUTCLASS, 0, false)
47DEFINE_NFT(NFT_NESTEDVALUECLASS, 0, true)
48
49DEFINE_NFT(NFT_CBOOL, 1, true)
50
51DEFINE_NFT(NFT_DATE, sizeof(DATE), false)
52DEFINE_NFT(NFT_DECIMAL, sizeof(DECIMAL), false)
53DEFINE_NFT(NFT_INTERFACE, sizeof(IUnknown*), false)
54
55DEFINE_NFT(NFT_SAFEHANDLE, sizeof(LPVOID), false)
56DEFINE_NFT(NFT_CRITICALHANDLE, sizeof(LPVOID), false)
57DEFINE_NFT(NFT_BSTR, sizeof(BSTR), false)
58
59#ifdef FEATURE_COMINTEROP
60DEFINE_NFT(NFT_SAFEARRAY, 0, false)
61DEFINE_NFT(NFT_HSTRING, sizeof(HSTRING), true)
62DEFINE_NFT(NFT_VARIANT, sizeof(VARIANT), false)
63DEFINE_NFT(NFT_VARIANTBOOL, sizeof(VARIANT_BOOL), false)
64DEFINE_NFT(NFT_CURRENCY, sizeof(CURRENCY), false)
65DEFINE_NFT(NFT_DATETIMEOFFSET, sizeof(INT64), true)
66DEFINE_NFT(NFT_SYSTEMTYPE, sizeof(TypeNameNative), true) // System.Type -> Windows.UI.Xaml.Interop.TypeName
67DEFINE_NFT(NFT_WINDOWSFOUNDATIONHRESULT, sizeof(int), true) // Windows.Foundation.HResult is marshaled to System.Exception.
68#endif // FEATURE_COMINTEROP
69DEFINE_NFT(NFT_STRINGUTF8, sizeof(LPVOID), false)
70DEFINE_NFT(NFT_ILLEGAL, 1, true)
71
72#ifdef FEATURE_COMINTEROP
73DEFINE_NFT(NFT_WINDOWSFOUNDATIONIREFERENCE, sizeof(IUnknown*), true) // Windows.Foundation.IReference`1 is marshaled to System.Nullable`1.
74#endif // FEATURE_COMINTEROP
75
76// Append new entries only at the end of the enum to avoid phone versioning break.
77