80 references to MarshallerShape
Microsoft.Interop.LibraryImportGenerator (15)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (14)
747if (shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) && mode == MarshalMode.ManagedToUnmanagedIn) 762if (!(shape.HasFlag(MarshallerShape.ToUnmanaged) || (mode == MarshalMode.ManagedToUnmanagedIn && shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)))) 820if ((shape & (MarshallerShape.ToManaged | MarshallerShape.GuaranteedUnmarshal)) == 0) 900if (shape.HasFlag(MarshallerShape.ToUnmanaged | MarshallerShape.CallerAllocatedBuffer)) 931if (shape.HasFlag(MarshallerShape.ToManaged | MarshallerShape.GuaranteedUnmarshal)) 1041if (shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) && mode == MarshalMode.ManagedToUnmanagedIn) 1056if (!(shape.HasFlag(MarshallerShape.ToUnmanaged) || (mode == MarshalMode.ManagedToUnmanagedIn && shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)))) 1117if ((shape & (MarshallerShape.ToManaged | MarshallerShape.GuaranteedUnmarshal)) == 0)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
46(MarshallerShape _, StatefulMarshallerShapeHelper.MarshallerMethods methods) = StatefulMarshallerShapeHelper.GetShapeForType(diagnosedSymbol.ContainingType, managedType, isLinearCollectionMarshaller, context.Compilation);
Microsoft.Interop.SourceGeneration (65)
ManualTypeMarshallingHelper.cs (13)
18MarshallerShape Shape, 455(MarshallerShape shape, StatelessMarshallerShapeHelper.MarshallerMethods methods) = StatelessMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, compilation); 461if (!ModeOptionallyMatchesShape(mode) && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) && !shape.HasFlag(MarshallerShape.ToUnmanaged)) 484if (!ModeOptionallyMatchesShape(mode) && !shape.HasFlag(MarshallerShape.GuaranteedUnmarshal) && !shape.HasFlag(MarshallerShape.ToManaged)) 516if (!ModeOptionallyMatchesShape(mode) && ModeUsesManagedToUnmanagedShape(mode) && ModeUsesUnmanagedToManagedShape(mode) && !shape.HasFlag(MarshallerShape.ToUnmanaged)) 555(MarshallerShape shape, StatefulMarshallerShapeHelper.MarshallerMethods methods) = StatefulMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, compilation); 562if (mode != MarshalMode.Default && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) && !shape.HasFlag(MarshallerShape.ToUnmanaged)) 580if (mode != MarshalMode.Default && !shape.HasFlag(MarshallerShape.GuaranteedUnmarshal) && !shape.HasFlag(MarshallerShape.ToManaged)) 596if (mode != MarshalMode.Default && ModeUsesManagedToUnmanagedShape(mode) && ModeUsesUnmanagedToManagedShape(mode) && !shape.HasFlag(MarshallerShape.ToUnmanaged))
MarshallerShape.cs (24)
111public static (MarshallerShape, MarshallerMethods) GetShapeForType(ITypeSymbol marshallerType, ITypeSymbol managedType, bool isLinearCollectionMarshaller, Compilation compilation) 113MarshallerShape shape = MarshallerShape.None; 130shape |= MarshallerShape.ToUnmanaged; 133shape |= MarshallerShape.CallerAllocatedBuffer; 154shape |= MarshallerShape.ToManaged; 157shape |= MarshallerShape.GuaranteedUnmarshal; 172shape |= MarshallerShape.ToUnmanaged; 176shape |= MarshallerShape.CallerAllocatedBuffer; 180shape |= MarshallerShape.ToManaged; 184shape |= MarshallerShape.GuaranteedUnmarshal; 196shape |= MarshallerShape.StatelessPinnableReference; 199shape |= MarshallerShape.Free; 446public static (MarshallerShape shape, MarshallerMethods methods) GetShapeForType(ITypeSymbol marshallerType, ITypeSymbol managedType, bool isLinearCollectionMarshaller, Compilation compilation) 448MarshallerShape shape = MarshallerShape.None; 477shape |= MarshallerShape.CallerAllocatedBuffer; 481shape |= MarshallerShape.ToUnmanaged; 511shape |= MarshallerShape.GuaranteedUnmarshal; 515shape |= MarshallerShape.ToManaged; 530shape |= MarshallerShape.Free; 536shape |= MarshallerShape.OnInvoked; 542shape |= MarshallerShape.StatelessPinnableReference; 548shape |= MarshallerShape.StatefulPinnableReference;
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (10)
169if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 175if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 185if (freeStrategy != FreeStrategy.NoFree && marshallerData.Shape.HasFlag(MarshallerShape.Free)) 196IBoundMarshallingGenerator marshallingGenerator = new CustomTypeMarshallingGenerator(marshallingStrategy, ByValueMarshalKindSupportDescriptor.Default, marshallerData.Shape.HasFlag(MarshallerShape.StatelessPinnableReference)); 198if (marshallerData.Shape.HasFlag(MarshallerShape.StatelessPinnableReference)) 263if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 288if (marshallerData.Shape.HasFlag(MarshallerShape.Free)) 309if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 318if (freeStrategy != FreeStrategy.NoFree && marshallerData.Shape.HasFlag(MarshallerShape.Free)) 341bool isPinned = marshallerData.Shape.HasFlag(MarshallerShape.StatelessPinnableReference) && elementIsBlittable;
Marshalling\StatefulMarshallingStrategy.cs (12)
13internal sealed class StatefulValueMarshalling(TypePositionInfo info, StubCodeContext stubContext, ManagedTypeInfo marshallerType, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 30if (!shape.HasFlag(MarshallerShape.Free)) 44if (!shape.HasFlag(MarshallerShape.Free)) 55if (!shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 70if (!shape.HasFlag(MarshallerShape.ToUnmanaged)) 84if (!shape.HasFlag(MarshallerShape.ToUnmanaged) && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 99if (!shape.HasFlag(MarshallerShape.ToManaged)) 114if (!shape.HasFlag(MarshallerShape.ToManaged) && !shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 150if (!shape.HasFlag(MarshallerShape.StatefulPinnableReference)) 166if (!shape.HasFlag(MarshallerShape.OnInvoked))
Marshalling\StatelessMarshallingStrategy.cs (5)
17internal sealed class StatelessValueMarshalling(TypePositionInfo info, StubCodeContext codeContext, TypeSyntax marshallerTypeSyntax, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 33if (!shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 53if (!shape.HasFlag(MarshallerShape.ToUnmanaged) && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 105if (!shape.HasFlag(MarshallerShape.ToManaged))
MarshallingAttributeInfo.cs (1)
149MarshallerShape.ToUnmanaged,