58 references to UnmanagedToManaged
Microsoft.Interop.ComInterfaceGenerator (19)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
85var unmanagedToManagedFactory = ComInterfaceGeneratorHelpers.GetGeneratorResolver(env.EnvironmentFlags, MarshalDirection.UnmanagedToManaged);
ComInterfaceGenerator.cs (1)
431return MarshalDirection.UnmanagedToManaged;
ComInterfaceGeneratorHelpers.cs (4)
14private static readonly IMarshallingGeneratorResolver s_unmanagedToManagedDisabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.UnmanagedToManaged); 16private static readonly IMarshallingGeneratorResolver s_unmanagedToManagedEnabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.None, MarshalDirection.UnmanagedToManaged); 30(true, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedDisabledMarshallingGeneratorResolver, 32(false, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedEnabledMarshallingGeneratorResolver,
ComMethodContext.cs (1)
94if (GenerationContext.VtableIndexData.Direction is not (MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional) || IsHiddenOnDerivedInterface)
Marshallers\ComInterfaceDispatchMarshallingResolver.cs (1)
23return context.Direction == MarshalDirection.UnmanagedToManaged
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (1)
24MarshalDirection.UnmanagedToManaged => new UnmanagedToManagedMarshaller().Bind(info, context),
Marshallers\ObjectUnwrapperResolver.cs (1)
21return context.Direction == MarshalDirection.UnmanagedToManaged
Marshallers\StructAsHResultMarshallerFactory.cs (1)
57if (MarshallerHelpers.GetMarshalDirection(info, codeContext) is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
VirtualMethodPointerStubGenerator.cs (2)
142generatorResolverCreator(methodStub.EnvironmentFlags, MarshalDirection.UnmanagedToManaged)); 269generatorResolverCreator(method.EnvironmentFlags, MarshalDirection.UnmanagedToManaged));
VtableIndexStubGenerator.cs (2)
94.Where(data => data.VtableIndexData.Direction is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional); 265if (!virtualMethodIndexData.ImplicitThisParameter && virtualMethodIndexData.Direction is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
VtableIndexStubGeneratorHelpers.cs (4)
14private static readonly IMarshallingGeneratorResolver s_unmanagedToManagedDisabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.UnmanagedToManaged); 16private static readonly IMarshallingGeneratorResolver s_unmanagedToManagedEnabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.None, MarshalDirection.UnmanagedToManaged); 28(true, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedDisabledMarshallingGeneratorResolver, 30(false, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedEnabledMarshallingGeneratorResolver,
Microsoft.Interop.JavaScript.JSImportGenerator (6)
JSGeneratorFactory.cs (1)
29if (MarshallerHelpers.GetMarshalDirection(info, context) != MarshalDirection.UnmanagedToManaged && info.ManagedIndex == TypePositionInfo.UnsetIndex)
Marshaling\FuncJSGenerator.cs (2)
35if (context.CurrentStage == StubIdentifierContext.Stage.Marshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && TypeInfo.IsManagedReturnPosition) 45if (context.CurrentStage == StubIdentifierContext.Stage.Unmarshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsManagedReturnPosition)
Marshaling\PrimitiveJSGenerator.cs (1)
26if (context.CurrentStage == StubIdentifierContext.Stage.UnmarshalCapture && marshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
Marshaling\TaskJSGenerator.cs (2)
32if (context.CurrentStage == StubIdentifierContext.Stage.Marshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && TypeInfo.IsManagedReturnPosition) 46if (context.CurrentStage == StubIdentifierContext.Stage.Unmarshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsManagedReturnPosition)
Microsoft.Interop.SourceGeneration (33)
GeneratedStatements.cs (1)
59else if (codeContext.Direction == MarshalDirection.UnmanagedToManaged)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (2)
139MarshalDirection.UnmanagedToManaged => marshallers.GetModeOrDefault(Options.UnmanagedToManagedMode), 421if (elementDirection == MarshalDirection.UnmanagedToManaged
Marshalling\BlittableMarshaller.cs (1)
83if (direction is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional && info.IsByRef)
Marshalling\BoolMarshaller.cs (1)
76if (elementMarshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
Marshalling\BreakingChangeDetector.cs (1)
27&& context.Direction == MarshalDirection.UnmanagedToManaged)
Marshalling\CharMarshaller.cs (1)
105if (elementMarshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
Marshalling\CustomTypeMarshallingGenerator.cs (4)
37|| (CodeContext.Direction == MarshalDirection.UnmanagedToManaged && ShouldGenerateByValueOutMarshalling)) 61if (elementMarshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional) 67if (elementMarshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional 74if (elementMarshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional
Marshalling\DelegateMarshaller.cs (1)
58if (elementMarshalDirection is MarshalDirection.UnmanagedToManaged or MarshalDirection.Bidirectional)
Marshalling\ElementsMarshalling.cs (2)
448if (CollectionSource.CodeContext.Direction is MarshalDirection.UnmanagedToManaged && CollectionSource.TypeInfo.ByValueContentsMarshalKind is ByValueContentsMarshalKind.Out) 593bool onlyUnmarshals = MarshallerHelpers.GetMarshalDirection(info, context) == MarshalDirection.UnmanagedToManaged;
Marshalling\MarshallerHelpers.cs (11)
265/// For example, an out parameter is marshalled in the <see cref="MarshalDirection.UnmanagedToManaged"/> direction in a <see cref="MarshalDirection.ManagedToUnmanaged"/> stub, 266/// but from <see cref="MarshalDirection.ManagedToUnmanaged"/> in a <see cref="MarshalDirection.UnmanagedToManaged"/> stub. 273if (context.Direction is not (MarshalDirection.ManagedToUnmanaged or MarshalDirection.UnmanagedToManaged)) 282return MarshalDirection.UnmanagedToManaged; 296return MarshalDirection.UnmanagedToManaged; 308return MarshalDirection.UnmanagedToManaged; 314return MarshalDirection.UnmanagedToManaged; 331if (context.Direction is MarshalDirection.UnmanagedToManaged) 336MarshalDirection.UnmanagedToManaged => StubIdentifierContext.Stage.CleanupCalleeAllocated, 449MarshalDirection.UnmanagedToManaged => info.IsNativeReturnPosition, 464MarshalDirection.UnmanagedToManaged => info.IsManagedReturnPosition,
Marshalling\MarshallingGeneratorExtensions.cs (1)
73else if (generator.CodeContext.Direction == MarshalDirection.UnmanagedToManaged)
Marshalling\StatefulMarshallingStrategy.cs (2)
370if (CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind.HasFlag(ByValueContentsMarshalKind.Out)) 432if (CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind == ByValueContentsMarshalKind.Out)
Marshalling\StatelessMarshallingStrategy.cs (2)
662if (CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind.HasFlag(ByValueContentsMarshalKind.Out)) 708if (CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind == ByValueContentsMarshalKind.Out)
StubCodeContext.cs (1)
39Direction: MarshalDirection.UnmanagedToManaged);
UnmanagedToManagedStubGenerator.cs (2)
34_context = new DefaultIdentifierContext(ReturnIdentifier, $"{ReturnIdentifier}{StubIdentifierContext.GeneratedNativeIdentifierSuffix}", MarshalDirection.UnmanagedToManaged); 38_context = new DefaultIdentifierContext(ReturnIdentifier, ReturnIdentifier, MarshalDirection.UnmanagedToManaged);