93 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 (78)
ManualTypeMarshallingHelper.cs (13)
19MarshallerShape Shape, 530(MarshallerShape shape, StatelessMarshallerShapeHelper.MarshallerMethods methods) = StatelessMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, compilation); 536if (!ModeOptionallyMatchesShape(mode) && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) && !shape.HasFlag(MarshallerShape.ToUnmanaged)) 559if (!ModeOptionallyMatchesShape(mode) && !shape.HasFlag(MarshallerShape.GuaranteedUnmarshal) && !shape.HasFlag(MarshallerShape.ToManaged)) 591if (!ModeOptionallyMatchesShape(mode) && ModeUsesManagedToUnmanagedShape(mode) && ModeUsesUnmanagedToManagedShape(mode) && !shape.HasFlag(MarshallerShape.ToUnmanaged)) 638(MarshallerShape shape, StatefulMarshallerShapeHelper.MarshallerMethods methods) = StatefulMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, compilation); 645if (mode != MarshalMode.Default && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) && !shape.HasFlag(MarshallerShape.ToUnmanaged)) 663if (mode != MarshalMode.Default && !shape.HasFlag(MarshallerShape.GuaranteedUnmarshal) && !shape.HasFlag(MarshallerShape.ToManaged)) 679if (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)
153if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 159if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 169if (freeStrategy != FreeStrategy.NoFree && marshallerData.Shape.HasFlag(MarshallerShape.Free)) 180IBoundMarshallingGenerator marshallingGenerator = new CustomTypeMarshallingGenerator(marshallingStrategy, ByValueMarshalKindSupportDescriptor.Default, marshallerData.Shape.HasFlag(MarshallerShape.StatelessPinnableReference)); 182if (marshallerData.Shape.HasFlag(MarshallerShape.StatelessPinnableReference)) 238if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 259if (marshallerData.Shape.HasFlag(MarshallerShape.Free)) 280if (marshallerData.Shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 285if (freeStrategy != FreeStrategy.NoFree && marshallerData.Shape.HasFlag(MarshallerShape.Free)) 308bool isPinned = marshallerData.Shape.HasFlag(MarshallerShape.StatelessPinnableReference) && elementIsBlittable;
Marshalling\StatefulMarshallingStrategy.cs (16)
6internal sealed class StatefulValueMarshalling(TypePositionInfo info, StubCodeContext stubContext, ManagedTypeInfo marshallerType, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 18&& shape.HasFlag(MarshallerShape.Free)) 27&& shape.HasFlag(MarshallerShape.Free)) 35if (shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 43if (shape.HasFlag(MarshallerShape.ToUnmanaged)) 51if (shape.HasFlag(MarshallerShape.ToUnmanaged) || shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 59if (shape.HasFlag(MarshallerShape.ToManaged)) 67if (shape.HasFlag(MarshallerShape.ToManaged) || shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 82if (shape.HasFlag(MarshallerShape.StatefulPinnableReference)) 91if (shape.HasFlag(MarshallerShape.OnInvoked)) 175MarshallerShape shape, 220if (shape.HasFlag(MarshallerShape.ToUnmanaged) || shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 262if (!shape.HasFlag(MarshallerShape.ToManaged))
Marshalling\StatelessMarshallingStrategy.cs (14)
9internal sealed class StatelessValueMarshalling(TypePositionInfo info, StubCodeContext codeContext, string marshallerType, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 26if (shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 35if (!shape.HasFlag(MarshallerShape.ToUnmanaged) && !shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 60if (shape.HasFlag(MarshallerShape.ToManaged)) 172internal sealed class StatelessLinearCollectionSpaceAllocator(TypePositionInfo info, StubCodeContext codeContext, string marshallerType, ManagedTypeInfo unmanagedType, MarshallerShape shape, CountInfo countInfo, bool countInfoRequiresCast) : ICustomTypeMarshallingStrategy 201if (!shape.HasFlag(MarshallerShape.GuaranteedUnmarshal)) 214if (shape.HasFlag(MarshallerShape.ToUnmanaged) 215&& !(shape.HasFlag(MarshallerShape.CallerAllocatedBuffer) 257if (!shape.HasFlag(MarshallerShape.ToManaged)) 308MarshallerShape shape, 393if (shape.HasFlag(MarshallerShape.ToUnmanaged) || shape.HasFlag(MarshallerShape.CallerAllocatedBuffer)) 426if (!shape.HasFlag(MarshallerShape.ToManaged))
MarshallingAttributeInfo.cs (1)
191MarshallerShape.ToUnmanaged,