93 references to MarshallerHelpers
Microsoft.Interop.ComInterfaceGenerator (5)
ComInterfaceGenerator.cs (3)
276MarshallerHelpers.ValidateCountInfoAvailableAtCall( 809indexArgList = string.Join(", ", managedParams.Take(indexCount).Select(mp => $"{(mp.IsByRef ? $"{MarshallerHelpers.GetManagedArgumentRefKindKeyword(mp)} " : "")}{mp.InstanceIdentifier}")); 869+ $"({string.Join(", ", sigContext.ManagedParameters.Select(mp => $"{(mp.IsByRef ? $"{MarshallerHelpers.GetManagedArgumentRefKindKeyword(mp)} " : "")}{mp.InstanceIdentifier}"))})";
Marshallers\StructAsHResultMarshallerFactory.cs (2)
34if (MarshallerHelpers.GetMarshalDirection(info, codeContext) is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional) 40if (MarshallerHelpers.GetMarshalDirection(info, codeContext) is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
Microsoft.Interop.JavaScript.JSImportGenerator (6)
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)
32MarshalDirection marshalDirection = MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext);
Marshaling\FuncJSGenerator.cs (1)
15MarshalDirection marshalDirection = MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext);
Marshaling\PrimitiveJSGenerator.cs (1)
17MarshalDirection marshalDirection = MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext);
Marshaling\TaskJSGenerator.cs (1)
14MarshalDirection marshalDirection = MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext);
Microsoft.Interop.SourceGeneration (82)
BoundGenerators.cs (1)
168SignatureMarshallers = MarshallerHelpers.GetTopologicallySortedElements(
DefaultIdentifierContext.cs (2)
44if (MarshallerHelpers.IsInStubReturnPosition(info, _direction)) 60else if (MarshallerHelpers.IsInInvocationReturnPosition(info, _direction))
LinearCollectionElementIdentifierContext.cs (1)
17public string IndexerIdentifier => MarshallerHelpers.GetIndexerIdentifier(_elementIndirectionLevel - 1);
ManagedToNativeStubGenerator.cs (4)
179writer.WriteLine(MarshallerHelpers.CreateSetLastPInvokeErrorStatement(LastErrorIdentifier)); 195writer.WriteLine(MarshallerHelpers.CreateClearLastSystemErrorStatement(SuccessErrorCode)); 200writer.WriteLine(MarshallerHelpers.CreateGetLastSystemErrorStatement(LastErrorIdentifier)); 207writer.WriteLine(MarshallerHelpers.CreateSetLastPInvokeErrorStatement(LastErrorIdentifier));
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (3)
117MarshalDirection elementDirection = MarshallerHelpers.GetMarshalDirection(info, context); 215if (MarshallerHelpers.GetMarshalDirection(info, context) != MarshalDirection.ManagedToUnmanaged) 378MarshalDirection elementDirection = MarshallerHelpers.GetMarshalDirection(info, context);
Marshalling\BlittableMarshaller.cs (1)
47MarshalDirection direction = MarshallerHelpers.GetMarshalDirection(info, codeContext);
Marshalling\BoolMarshaller.cs (1)
47MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, codeContext);
Marshalling\CharMarshaller.cs (2)
61MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, codeContext); 93MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, context);
Marshalling\CustomTypeMarshallingGenerator.cs (1)
24MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext);
Marshalling\DelegateMarshaller.cs (1)
25MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, codeContext);
Marshalling\ElementsMarshalling.cs (21)
67=> MarshallerHelpers.GetIndexedManagedElementExpression(paramInfo, codeContext, context); 82string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(info, context); 88string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(info, context); 154string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context); 155string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context); 174string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context); 175string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context); 189string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(CollectionSource.TypeInfo, context); 190string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context); 191string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context); 205string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context); 208? MarshallerHelpers.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context) 224string source = MarshallerHelpers.GetMarshalDirection(CollectionSource.TypeInfo, CollectionSource.CodeContext) == MarshalDirection.ManagedToUnmanaged 235string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(CollectionSource.TypeInfo, context); 236string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context); 237string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context); 267string managedSpanIdentifier = MarshallerHelpers.GetManagedSpanIdentifier(CollectionSource.TypeInfo, context); 268string nativeSpanIdentifier = MarshallerHelpers.GetNativeSpanIdentifier(CollectionSource.TypeInfo, context); 337incrementors += $", ++{MarshallerHelpers.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context)}"; 350&& MarshallerHelpers.GetMarshalDirection(info, context) != MarshalDirection.UnmanagedToManaged; 363writer.WriteLine($"int {MarshallerHelpers.GetLastIndexMarshalledIdentifier(CollectionSource.TypeInfo, context)} = 0;");
Marshalling\IidParameterIndexMarshallerResolver.cs (1)
44string iidExpression = MarshallerHelpers.GetIndexedManagedElementExpression(iidParameterIndexInfo, codeContext, context);
Marshalling\MarshallingGeneratorExtensions.cs (3)
112MarshallerHelpers.GetManagedParameterModifiers(info), 126ValueBoundaryBehavior.ManagedIdentifier => $"{MarshallerHelpers.GetManagedArgumentRefKindKeyword(info)} {managedIdentifier}", 139? $"{MarshallerHelpers.GetManagedArgumentRefKindKeyword(info)} {managedIdentifier}"
Marshalling\StatefulMarshallingStrategy.cs (11)
17if (MarshallerHelpers.GetCleanupStage(info, stubContext) is StubIdentifierContext.Stage.CleanupCallerAllocated 26if (MarshallerHelpers.GetCleanupStage(info, stubContext) is StubIdentifierContext.Stage.CleanupCalleeAllocated 118if (MarshallerHelpers.CanUseCallerAllocatedBuffer(TypeInfo, CodeContext)) 158string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(info, context); 165string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(info, context); 235if (MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) is not MarshalDirection.ManagedToUnmanaged 238string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 240writer.WriteLine(MarshallerHelpers.SkipInitOrDefaultInit( 267string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 289if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCallerAllocated) 298if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCalleeAllocated)
Marshalling\StatelessMarshallingStrategy.cs (23)
100if (!MarshallerHelpers.CanUseCallerAllocatedBuffer(TypeInfo, CodeContext)) 112string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 139if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated) 150if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated) 181if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCallerAllocated 182&& MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) != MarshalDirection.ManagedToUnmanaged) 184string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 191if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCalleeAllocated 192&& MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) != MarshalDirection.ManagedToUnmanaged) 194string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 207string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 216&& MarshallerHelpers.CanUseCallerAllocatedBuffer(TypeInfo, CodeContext))) 219string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 238string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 240writer.WriteLine(MarshallerHelpers.SkipInitOrDefaultInit( 263string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 276string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(info, context); 289string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(info, context); 331string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 332if (countInfo is NoCountInfo && MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) == MarshalDirection.ManagedToUnmanaged) 346if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCallerAllocated) 365string numElementsIdentifier = MarshallerHelpers.GetNumElementsIdentifier(TypeInfo, context); 371if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is StubIdentifierContext.Stage.CleanupCallerAllocated)
Marshalling\UnmanagedToManagedOwnershipTrackingStrategy.cs (2)
55if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated) 69if (MarshallerHelpers.GetCleanupStage(TypeInfo, CodeContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
MarshallingAttributeInfo.cs (1)
178_ => CreateWellKnownComExceptionMarshallingData($"{TypeNames.ExceptionAsDefaultMarshaller}<{MarshallerHelpers.GetCompatibleGenericTypeParameter(unmanagedReturnType)}>", unmanagedReturnType),
SignatureContext.cs (1)
45MarshallerHelpers.GetManagedParameterModifiers(typeInfo));
StubCodeContext.cs (1)
61return MarshallerHelpers.IsInStubReturnPosition(info, Direction);
VariableDeclarations.cs (1)
22initializations.WriteLine(MarshallerHelpers.DefaultInit(info, context));