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