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