91 references to MarshallerHelpers
Microsoft.Interop.ComInterfaceGenerator (4)
ComInterfaceGenerator.cs (1)
381
MarshallerHelpers
.ValidateCountInfoAvailableAtCall(
ComMethodContext.cs (1)
149
? Argument(IdentifierName(info.InstanceIdentifier)).WithRefKindKeyword(
MarshallerHelpers
.GetManagedArgumentRefKindKeyword(info))
Marshallers\StructAsHResultMarshallerFactory.cs (2)
39
if (
MarshallerHelpers
.GetMarshalDirection(info, codeContext) is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
57
if (
MarshallerHelpers
.GetMarshalDirection(info, codeContext) is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
Microsoft.Interop.JavaScript.JSImportGenerator (4)
JSGeneratorFactory.cs (2)
29
if (
MarshallerHelpers
.GetMarshalDirection(info, context) != MarshalDirection.UnmanagedToManaged && info.ManagedIndex == TypePositionInfo.UnsetIndex)
48
bool isToJs =
MarshallerHelpers
.GetMarshalDirection(info, context) == MarshalDirection.ManagedToUnmanaged;
Marshaling\BaseJSGenerator.cs (1)
39
MarshalDirection marshalDirection =
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext);
Marshaling\PrimitiveJSGenerator.cs (1)
24
MarshalDirection marshalDirection =
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext);
Microsoft.Interop.SourceGeneration (83)
BoundGenerators.cs (1)
149
SignatureMarshallers =
MarshallerHelpers
.GetTopologicallySortedElements(
DefaultIdentifierContext.cs (2)
30
if (
MarshallerHelpers
.IsInStubReturnPosition(info, _direction))
45
else if (
MarshallerHelpers
.IsInInvocationReturnPosition(info, _direction))
LinearCollectionElementIdentifierContext.cs (1)
17
public string IndexerIdentifier =>
MarshallerHelpers
.GetIndexerIdentifier(_elementIndirectionLevel - 1);
ManagedToNativeStubGenerator.cs (3)
140
StatementSyntax clearLastError =
MarshallerHelpers
.CreateClearLastSystemErrorStatement(SuccessErrorCode);
142
StatementSyntax getLastError =
MarshallerHelpers
.CreateGetLastSystemErrorStatement(LastErrorIdentifier);
186
allStatements.Add(
MarshallerHelpers
.CreateSetLastPInvokeErrorStatement(LastErrorIdentifier));
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (3)
133
MarshalDirection elementDirection =
MarshallerHelpers
.GetMarshalDirection(info, context);
231
if (
MarshallerHelpers
.GetMarshalDirection(info, context) != MarshalDirection.ManagedToUnmanaged)
419
MarshalDirection elementDirection =
MarshallerHelpers
.GetMarshalDirection(info, context);
Marshalling\BlittableMarshaller.cs (1)
65
MarshalDirection direction =
MarshallerHelpers
.GetMarshalDirection(info, codeContext);
Marshalling\BoolMarshaller.cs (1)
52
MarshalDirection elementMarshalDirection =
MarshallerHelpers
.GetMarshalDirection(info, codeContext);
Marshalling\CharMarshaller.cs (2)
82
MarshalDirection elementMarshalDirection =
MarshallerHelpers
.GetMarshalDirection(info, codeContext);
125
MarshalDirection elementMarshalDirection =
MarshallerHelpers
.GetMarshalDirection(info, context);
Marshalling\CustomTypeMarshallingGenerator.cs (1)
28
MarshalDirection elementMarshalDirection =
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext);
Marshalling\DelegateMarshaller.cs (1)
32
MarshalDirection elementMarshalDirection =
MarshallerHelpers
.GetMarshalDirection(info, codeContext);
Marshalling\ElementsMarshalling.cs (24)
98
return
MarshallerHelpers
.GetIndexedManagedElementExpression(paramInfo, codeContext, context);
115
var numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(info, context);
129
var numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(info, context);
258
string managedSpanIdentifier =
MarshallerHelpers
.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context);
259
string nativeSpanIdentifier =
MarshallerHelpers
.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context);
287
IdentifierName(
MarshallerHelpers
.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context)),
296
string managedSpanIdentifier =
MarshallerHelpers
.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context);
297
string nativeSpanIdentifier =
MarshallerHelpers
.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context);
298
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(CollectionSource.TypeInfo, context);
325
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(CollectionSource.TypeInfo, context);
326
string managedSpanIdentifier =
MarshallerHelpers
.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context);
347
string nativeSpanIdentifier =
MarshallerHelpers
.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context);
366
string nativeSpanIdentifier =
MarshallerHelpers
.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context);
376
indexConstraintName = IdentifierName(
MarshallerHelpers
.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context));
390
IdentifierName(
MarshallerHelpers
.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context)));
399
MarshallerHelpers
.GetMarshalDirection(CollectionSource.TypeInfo, CollectionSource.CodeContext) == MarshalDirection.ManagedToUnmanaged
411
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(CollectionSource.TypeInfo, context);
412
string managedSpanIdentifier =
MarshallerHelpers
.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context);
413
string nativeSpanIdentifier =
MarshallerHelpers
.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context);
474
string managedSpanIdentifier =
MarshallerHelpers
.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context);
475
string nativeSpanIdentifier =
MarshallerHelpers
.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context);
578
IdentifierName(
MarshallerHelpers
.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context))));
593
bool onlyUnmarshals =
MarshallerHelpers
.GetMarshalDirection(info, context) == MarshalDirection.UnmanagedToManaged;
615
Identifier(
MarshallerHelpers
.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context)),
Marshalling\MarshallingGeneratorExtensions.cs (3)
107
.WithModifiers(
MarshallerHelpers
.GetManagedParameterModifiers(info))
146
ValueBoundaryBehavior.ManagedIdentifier when info.IsByRef => Argument(IdentifierName(managedIdentifier)).WithRefKindKeyword(
MarshallerHelpers
.GetManagedArgumentRefKindKeyword(info)),
160
return Argument(IdentifierName(managedIdentifier)).WithRefKindKeyword(
MarshallerHelpers
.GetManagedArgumentRefKindKeyword(info));
Marshalling\StatefulMarshallingStrategy.cs (11)
27
if (
MarshallerHelpers
.GetCleanupStage(info, stubContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated)
41
if (
MarshallerHelpers
.GetCleanupStage(info, stubContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
200
if (
MarshallerHelpers
.CanUseCallerAllocatedBuffer(TypeInfo, CodeContext))
290
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(info, context);
302
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(info, context);
396
if (
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext) is not MarshalDirection.ManagedToUnmanaged
399
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
408
yield return
MarshallerHelpers
.SkipInitOrDefaultInit(
445
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
481
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated)
498
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
Marshalling\StatelessMarshallingStrategy.cs (23)
158
if (
MarshallerHelpers
.CanUseCallerAllocatedBuffer(TypeInfo, CodeContext))
192
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
259
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated)
278
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
319
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated)
322
if (
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext) != MarshalDirection.ManagedToUnmanaged)
325
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
337
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
340
if (
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext) == MarshalDirection.ManagedToUnmanaged)
346
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
361
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
392
&&
MarshallerHelpers
.CanUseCallerAllocatedBuffer(TypeInfo, CodeContext)))
395
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
421
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
429
yield return
MarshallerHelpers
.SkipInitOrDefaultInit(
449
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
484
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(info, context);
515
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(info, context);
580
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
581
if (countInfo is NoCountInfo &&
MarshallerHelpers
.GetMarshalDirection(TypeInfo, CodeContext) == MarshalDirection.ManagedToUnmanaged)
607
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCallerAllocated)
630
string numElementsIdentifier =
MarshallerHelpers
.GetNumElementsIdentifier(TypeInfo, context);
640
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCallerAllocated)
Marshalling\UnmanagedToManagedOwnershipTrackingStrategy.cs (2)
94
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated)
107
if (
MarshallerHelpers
.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
MarshallingAttributeInfo.cs (1)
172
_ => CreateWellKnownComExceptionMarshallingData($"{TypeNames.ExceptionAsDefaultMarshaller}<{
MarshallerHelpers
.GetCompatibleGenericTypeParameterSyntax(SyntaxFactory.ParseTypeName(unmanagedReturnType.FullTypeName))}>", unmanagedReturnType),
SignatureContext.cs (1)
47
.WithModifiers(
MarshallerHelpers
.GetManagedParameterModifiers(typeInfo));
StubCodeContext.cs (1)
61
return
MarshallerHelpers
.IsInStubReturnPosition(info, Direction);
VariableDeclarations.cs (1)
29
initializations.Add(
MarshallerHelpers
.DefaultInit(info, context));