11 instantiations of SpecialTypeInfo
Microsoft.Interop.SourceGeneration (11)
ManagedTypeInfo.cs (11)
46
return new
SpecialTypeInfo
(typeName, diagnosticFormattedName, type.SpecialType);
82
public static readonly SpecialTypeInfo Byte =
new
("byte", "byte", SpecialType.System_Byte);
83
public static readonly SpecialTypeInfo SByte =
new
("sbyte", "sbyte", SpecialType.System_SByte);
84
public static readonly SpecialTypeInfo Int16 =
new
("short", "short", SpecialType.System_Int16);
85
public static readonly SpecialTypeInfo UInt16 =
new
("ushort", "ushort", SpecialType.System_UInt16);
86
public static readonly SpecialTypeInfo Int32 =
new
("int", "int", SpecialType.System_Int32);
87
public static readonly SpecialTypeInfo UInt32 =
new
("uint", "uint", SpecialType.System_UInt32);
88
public static readonly SpecialTypeInfo Void =
new
("void", "void", SpecialType.System_Void);
89
public static readonly SpecialTypeInfo String =
new
("string", "string", SpecialType.System_String);
90
public static readonly SpecialTypeInfo Boolean =
new
("bool", "bool", SpecialType.System_Boolean);
91
public static readonly SpecialTypeInfo IntPtr =
new
("nint", "nint", SpecialType.System_IntPtr);
57 references to SpecialTypeInfo
Microsoft.Interop.ComInterfaceGenerator (4)
ComInterfaceGenerator.cs (3)
296
if (returnSwappedSignatureElements[i].ManagedType ==
SpecialTypeInfo
.Void)
304
if ((returnSwappedSignatureElements[i].ManagedType is
SpecialTypeInfo
{ SpecialType: SpecialType.System_Int32 or SpecialType.System_Enum } or EnumTypeInfo
329
new TypePositionInfo(
SpecialTypeInfo
.Int32, new ManagedHResultExceptionMarshallingInfo())
Marshallers\StructAsHResultMarshallerFactory.cs (1)
30
public ManagedTypeInfo AsNativeType(TypePositionInfo info) =>
SpecialTypeInfo
.Int32;
Microsoft.Interop.SourceGeneration (53)
BoundGenerators.cs (3)
23
IBoundMarshallingGenerator defaultBoundGenerator = fallbackGenerator.Bind(new TypePositionInfo(
SpecialTypeInfo
.Void, NoMarshallingInfo.Instance), context);
187
public bool IsManagedVoidReturn => ManagedReturnMarshaller.TypeInfo.ManagedType ==
SpecialTypeInfo
.Void;
189
public bool IsUnmanagedVoidReturn => NativeReturnMarshaller.TypeInfo.ManagedType ==
SpecialTypeInfo
.Void;
GeneratedStatements.cs (2)
106
if (marshallers.NativeReturnMarshaller.TypeInfo.ManagedType ==
SpecialTypeInfo
.Void)
140
if (marshallers.ManagedReturnMarshaller.TypeInfo.ManagedType ==
SpecialTypeInfo
.Void)
ManagedToNativeStubGenerator.cs (1)
88
HasForwardedTypes |= generator.IsForwarder() && generator is { TypeInfo.ManagedType: not
SpecialTypeInfo
{ SpecialType: Microsoft.CodeAnalysis.SpecialType.System_Void } };
ManagedTypeInfo.cs (11)
82
public static readonly
SpecialTypeInfo
Byte = new("byte", "byte", SpecialType.System_Byte);
83
public static readonly
SpecialTypeInfo
SByte = new("sbyte", "sbyte", SpecialType.System_SByte);
84
public static readonly
SpecialTypeInfo
Int16 = new("short", "short", SpecialType.System_Int16);
85
public static readonly
SpecialTypeInfo
UInt16 = new("ushort", "ushort", SpecialType.System_UInt16);
86
public static readonly
SpecialTypeInfo
Int32 = new("int", "int", SpecialType.System_Int32);
87
public static readonly
SpecialTypeInfo
UInt32 = new("uint", "uint", SpecialType.System_UInt32);
88
public static readonly
SpecialTypeInfo
Void = new("void", "void", SpecialType.System_Void);
89
public static readonly
SpecialTypeInfo
String = new("string", "string", SpecialType.System_String);
90
public static readonly
SpecialTypeInfo
Boolean = new("bool", "bool", SpecialType.System_Boolean);
91
public static readonly
SpecialTypeInfo
IntPtr = new("nint", "nint", SpecialType.System_IntPtr);
93
public bool Equals(
SpecialTypeInfo
? other)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (2)
103
if (type is not
SpecialTypeInfo
specialType || !specialType.SpecialType.IsIntegralType())
122
if (marshallerData.NativeType is
SpecialTypeInfo
specialType && specialType.SpecialType.IsAlwaysBlittable())
Marshalling\BoolMarshaller.cs (6)
31
Debug.Assert(info.ManagedType is
SpecialTypeInfo
{ SpecialType: SpecialType.System_Boolean });
121
: base(signed ?
SpecialTypeInfo
.SByte :
SpecialTypeInfo
.Byte, trueValue: 1, falseValue: 0, compareToTrue: false)
139
: base(signed ?
SpecialTypeInfo
.Int32 :
SpecialTypeInfo
.UInt32, trueValue: 1, falseValue: 0, compareToTrue: false)
152
: base(
SpecialTypeInfo
.Int16, trueValue: VARIANT_TRUE, falseValue: VARIANT_FALSE, compareToTrue: true)
Marshalling\CharMarshaller.cs (2)
16
private static readonly ManagedTypeInfo s_nativeType =
SpecialTypeInfo
.UInt16;
38
Debug.Assert(info.ManagedType is
SpecialTypeInfo
{SpecialType: SpecialType.System_Char });
Marshalling\CharMarshallingGeneratorResolver.cs (1)
26
if (info.ManagedType is
SpecialTypeInfo
{ SpecialType: SpecialType.System_Char })
Marshalling\DelegateMarshaller.cs (1)
17
return
SpecialTypeInfo
.IntPtr;
Marshalling\MarshalAsMarshallingGeneratorResolver.cs (18)
41
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_SByte }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I1, _) }
42
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Byte }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U1, _) }
43
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Int16 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I2, _) }
44
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_UInt16 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U2, _) }
45
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Int32 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I4 or UnmanagedType.Error, _) }
46
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_UInt32 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U4 or UnmanagedType.Error, _) }
47
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Int64 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.I8, _) }
48
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_UInt64 }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.U8, _) }
49
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_IntPtr }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.SysInt, _) }
50
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_UIntPtr }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.SysUInt, _) }
51
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Single }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.R4, _) }
52
or { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Double }, MarshallingAttributeInfo: NoMarshallingInfo or MarshalAsInfo(UnmanagedType.R8, _) }:
75
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.U1, _) }:
77
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.I1, _) }:
79
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.U4, _) }:
81
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.I4 or UnmanagedType.Bool, _) }:
83
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Boolean }, MarshallingAttributeInfo: MarshalAsInfo(UnmanagedType.VariantBool, _) }:
91
case { ManagedType:
SpecialTypeInfo
{ SpecialType: SpecialType.System_Void } }:
Marshalling\NoMarshallingInfoErrorResolver.cs (2)
43
{
SpecialTypeInfo
.String, string.Format(SR.MarshallingStringOrCharAsUndefinedNotSupported, stringMarshallingAttribute) },
44
{
SpecialTypeInfo
.Boolean, SR.MarshallingBoolAsUndefinedNotSupported },
Marshalling\StatelessMarshallingStrategy.cs (1)
66
if (unmanagedType ==
SpecialTypeInfo
.Void)
MarshallingAttributeInfo.cs (1)
129
return (unmanagedReturnType as
SpecialTypeInfo
)?.SpecialType switch
MarshallingInfoParser.cs (2)
316
info = new TypePositionInfo(
SpecialTypeInfo
.Void, NoMarshallingInfo.Instance);
345
info = new TypePositionInfo(
SpecialTypeInfo
.Void, NoMarshallingInfo.Instance);