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