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