76 references to ManagedToUnmanaged
Microsoft.Interop.ComInterfaceGenerator (17)
Analyzers\ComInterfaceGeneratorDiagnosticsAnalyzer.cs (1)
190if (srcCtx.VtableIndexData.Direction is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
88var managedToUnmanagedFactory = new ByValueContentsMarshalKindValidator(ComInterfaceGeneratorHelpers.GetGeneratorResolver(env.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged));
Analyzers\VtableIndexStubDiagnosticsAnalyzer.cs (1)
92if (stubContext.VtableIndexData.Direction is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
ComInterfaceGenerator.cs (1)
435return MarshalDirection.ManagedToUnmanaged;
ComInterfaceGeneratorHelpers.cs (4)
11private static readonly IMarshallingGeneratorResolver s_managedToUnmanagedDisabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.ManagedToUnmanaged); 13private static readonly IMarshallingGeneratorResolver s_managedToUnmanagedEnabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.None, MarshalDirection.ManagedToUnmanaged); 27(true, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedDisabledMarshallingGeneratorResolver, 29(false, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedEnabledMarshallingGeneratorResolver,
ComMethodContext.cs (1)
78if (GenerationContext.VtableIndexData.Direction is not (MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (1)
20MarshalDirection.ManagedToUnmanaged => new ManagedToUnmanagedMarshaller().Bind(info, context),
Marshallers\StructAsHResultMarshallerFactory.cs (1)
34if (MarshallerHelpers.GetMarshalDirection(info, codeContext) is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
VirtualMethodPointerStubGenerator.cs (1)
34generatorResolverCreator(methodStub.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged),
VtableIndexStubGenerator.cs (1)
48.Where(data => data.VtableIndexData.Direction is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional);
VtableIndexStubGeneratorHelpers.cs (4)
13private static readonly IMarshallingGeneratorResolver s_managedToUnmanagedDisabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.ManagedToUnmanaged); 15private static readonly IMarshallingGeneratorResolver s_managedToUnmanagedEnabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.None, MarshalDirection.ManagedToUnmanaged); 27(true, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedDisabledMarshallingGeneratorResolver, 29(false, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedEnabledMarshallingGeneratorResolver,
Microsoft.Interop.JavaScript.JSImportGenerator (9)
JSGeneratorFactory.cs (1)
48bool isToJs = MarshallerHelpers.GetMarshalDirection(info, context) == MarshalDirection.ManagedToUnmanaged;
Marshaling\BaseJSGenerator.cs (1)
34&& marshalDirection == MarshalDirection.ManagedToUnmanaged
Marshaling\FuncJSGenerator.cs (3)
18&& ((context.CurrentStage == StubIdentifierContext.Stage.UnmarshalCapture && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged) 24if (marshalDirection == MarshalDirection.ManagedToUnmanaged 26|| (context.CurrentStage == StubIdentifierContext.Stage.PinnedMarshal && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged)))
Marshaling\PrimitiveJSGenerator.cs (1)
24if (context.CurrentStage == StubIdentifierContext.Stage.Marshal && marshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
Marshaling\TaskJSGenerator.cs (3)
17&& ((context.CurrentStage == StubIdentifierContext.Stage.UnmarshalCapture && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged) 23if (marshalDirection == MarshalDirection.ManagedToUnmanaged 25|| (context.CurrentStage == StubIdentifierContext.Stage.PinnedMarshal && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged)))
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
150var factory = new ByValueContentsMarshalKindValidator(DefaultMarshallingGeneratorResolver.Create(env.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged, TypeNames.LibraryImportAttribute_ShortName, []));
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
305MarshalDirection.ManagedToUnmanaged,
LibraryImportGenerator.cs (1)
306: DefaultMarshallingGeneratorResolver.Create(pinvokeStub.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged, TypeNames.LibraryImportAttribute_ShortName, []);
Microsoft.Interop.SourceGeneration (47)
BoundGenerators.cs (1)
68if (errorHandlingInfo is not null && context.Direction == MarshalDirection.ManagedToUnmanaged)
DefaultIdentifierContext.cs (2)
36&& _direction == MarshalDirection.ManagedToUnmanaged 76&& _direction == MarshalDirection.ManagedToUnmanaged
GeneratedStatements.cs (1)
78MarshalDirection.ManagedToUnmanaged => GenerateStatementForNativeInvoke(marshallers, invokeContext, expressionToInvoke),
ManagedToNativeStubGenerator.cs (2)
53MarshalDirection.ManagedToUnmanaged, 64MarshalDirection.ManagedToUnmanaged,
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (4)
121MarshalDirection.ManagedToUnmanaged => marshallers.GetModeOrDefault(Options.ManagedToUnmanagedMode), 215if (MarshallerHelpers.GetMarshalDirection(info, context) != MarshalDirection.ManagedToUnmanaged) 336if (context.Direction == MarshalDirection.ManagedToUnmanaged) 401if (elementDirection == MarshalDirection.ManagedToUnmanaged
Marshalling\BlittableMarshaller.cs (1)
54if (direction is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional && info.IsByRef)
Marshalling\BoolMarshaller.cs (1)
55if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
Marshalling\CharMarshaller.cs (2)
68if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional) 94return !IsPinningPathSupported(info, context) && (elementMarshalDirection != MarshalDirection.ManagedToUnmanaged || info.IsByRef);
Marshalling\CustomTypeMarshallingGenerator.cs (6)
33if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional 40if (CodeContext.SingleFrameSpansNativeContext && elementMarshalDirection is MarshalDirection.ManagedToUnmanaged) 46if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional) 52if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional) 65|| (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && ShouldGenerateByValueOutMarshalling)) 72|| (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && ShouldGenerateByValueOutMarshalling))
Marshalling\DefaultMarshallingGeneratorResolver.cs (3)
63direction == MarshalDirection.ManagedToUnmanaged 66direction == MarshalDirection.ManagedToUnmanaged 69direction == MarshalDirection.ManagedToUnmanaged
Marshalling\DelegateMarshaller.cs (2)
32if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional) 46if (elementMarshalDirection is MarshalDirection.ManagedToUnmanaged or MarshalDirection.Bidirectional)
Marshalling\ElementsMarshalling.cs (1)
224string source = MarshallerHelpers.GetMarshalDirection(CollectionSource.TypeInfo, CollectionSource.CodeContext) == MarshalDirection.ManagedToUnmanaged
Marshalling\MarshallerHelpers.cs (10)
252if (context.Direction is not (MarshalDirection.ManagedToUnmanaged or MarshalDirection.UnmanagedToManaged)) 257if (context.Direction == MarshalDirection.ManagedToUnmanaged) 272return MarshalDirection.ManagedToUnmanaged; 278return MarshalDirection.ManagedToUnmanaged; 290return MarshalDirection.ManagedToUnmanaged; 304return MarshalDirection.ManagedToUnmanaged; 323MarshalDirection.ManagedToUnmanaged => StubIdentifierContext.Stage.CleanupCallerAllocated, 338if (stubDirection is MarshalDirection.ManagedToUnmanaged) 433MarshalDirection.ManagedToUnmanaged => info.IsManagedReturnPosition, 448MarshalDirection.ManagedToUnmanaged => info.IsNativeReturnPosition,
Marshalling\MarshallingGeneratorExtensions.cs (1)
54if (generator.CodeContext.Direction == MarshalDirection.ManagedToUnmanaged)
Marshalling\StatefulMarshallingStrategy.cs (3)
209if (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind == ByValueContentsMarshalKind.Out) 235if (MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) is not MarshalDirection.ManagedToUnmanaged 252if (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind.HasFlag(ByValueContentsMarshalKind.Out))
Marshalling\StatelessMarshallingStrategy.cs (6)
182&& MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) != MarshalDirection.ManagedToUnmanaged) 192&& MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) != MarshalDirection.ManagedToUnmanaged) 253if (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind.HasFlag(ByValueContentsMarshalKind.Out)) 332if (countInfo is NoCountInfo && MarshallerHelpers.GetMarshalDirection(TypeInfo, CodeContext) == MarshalDirection.ManagedToUnmanaged) 381if (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind == ByValueContentsMarshalKind.Out) 415if (CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsByRef && TypeInfo.ByValueContentsMarshalKind.HasFlag(ByValueContentsMarshalKind.Out))
StubCodeContext.cs (1)
34Direction: MarshalDirection.ManagedToUnmanaged);