84 references to Stage
Microsoft.Interop.ComInterfaceGenerator (7)
Marshallers\ComInterfaceDispatchMarshallingResolver.cs (1)
42if (context.CurrentStage != StubIdentifierContext.Stage.Unmarshal)
Marshallers\KeepAliveThisMarshaller.cs (1)
20if (context.CurrentStage != StubIdentifierContext.Stage.NotifyForSuccessfulInvoke)
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (2)
42if (context.CurrentStage != StubIdentifierContext.Stage.NotifyForSuccessfulInvoke) 70if (context.CurrentStage != StubIdentifierContext.Stage.NotifyForSuccessfulInvoke)
Marshallers\ObjectUnwrapperResolver.cs (1)
38if (context.CurrentStage != StubIdentifierContext.Stage.Unmarshal)
Marshallers\StructAsHResultMarshallerFactory.cs (2)
38case StubIdentifierContext.Stage.Marshal: 56case StubIdentifierContext.Stage.Unmarshal:
Microsoft.Interop.JavaScript.JSImportGenerator (13)
Marshaling\BaseJSGenerator.cs (1)
48if (context.CurrentStage == StubIdentifierContext.Stage.Setup)
Marshaling\FuncJSGenerator.cs (4)
48if (context.CurrentStage == StubIdentifierContext.Stage.UnmarshalCapture && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && TypeInfo.IsManagedReturnPosition) 53if (context.CurrentStage == StubIdentifierContext.Stage.Marshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && TypeInfo.IsManagedReturnPosition) 63if (context.CurrentStage == StubIdentifierContext.Stage.PinnedMarshal && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsManagedReturnPosition) 68if (context.CurrentStage == StubIdentifierContext.Stage.Unmarshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsManagedReturnPosition)
Marshaling\PrimitiveJSGenerator.cs (4)
36if (context.CurrentStage == StubIdentifierContext.Stage.UnmarshalCapture && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && TypeInfo.IsManagedReturnPosition) 41if (context.CurrentStage == StubIdentifierContext.Stage.Marshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && TypeInfo.IsManagedReturnPosition) 51if (context.CurrentStage == StubIdentifierContext.Stage.PinnedMarshal && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsManagedReturnPosition) 56if (context.CurrentStage == StubIdentifierContext.Stage.Unmarshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsManagedReturnPosition)
Marshaling\TaskJSGenerator.cs (4)
49if (context.CurrentStage == StubIdentifierContext.Stage.UnmarshalCapture && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && TypeInfo.IsManagedReturnPosition) 56if (context.CurrentStage == StubIdentifierContext.Stage.Marshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && TypeInfo.IsManagedReturnPosition) 68if (context.CurrentStage == StubIdentifierContext.Stage.PinnedMarshal && CodeContext.Direction == MarshalDirection.ManagedToUnmanaged && !TypeInfo.IsManagedReturnPosition) 75if (context.CurrentStage == StubIdentifierContext.Stage.Unmarshal && CodeContext.Direction == MarshalDirection.UnmanagedToManaged && !TypeInfo.IsManagedReturnPosition)
Microsoft.Interop.SourceGeneration (64)
GeneratedStatements.cs (28)
33Setup = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Setup }), 34Marshal = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Marshal }), 35Pin = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Pin }).Cast<FixedStatementSyntax>().ToImmutableArray(), 36PinnedMarshal = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.PinnedMarshal }), 38Unmarshal = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.UnmarshalCapture }) 39.AddRange(GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Unmarshal })), 40NotifyForSuccessfulInvoke = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.NotifyForSuccessfulInvoke }), 41GuaranteedUnmarshal = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.GuaranteedUnmarshal }), 42CleanupCallerAllocated = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.CleanupCallerAllocated }), 43CleanupCalleeAllocated = GenerateStatementsForStubContext(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.CleanupCalleeAllocated }), 56InvokeStatement = GenerateStatementForNativeInvoke(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Invoke }, expressionToInvoke) 63InvokeStatement = GenerateStatementForManagedInvoke(marshallers, context with { CurrentStage = StubIdentifierContext.Stage.Invoke }, expressionToInvoke) 93if (context.CurrentStage != StubIdentifierContext.Stage.Invoke) 127if (context.CurrentStage != StubIdentifierContext.Stage.Invoke) 165managedExceptionMarshaller.Generate(context with { CurrentStage = StubIdentifierContext.Stage.Marshal })); 167managedExceptionMarshaller.Generate(context with { CurrentStage = StubIdentifierContext.Stage.PinnedMarshal })); 175private static SyntaxTriviaList GenerateStageTrivia(StubIdentifierContext.Stage stage) 179StubIdentifierContext.Stage.Setup => "Perform required setup.", 180StubIdentifierContext.Stage.Marshal => "Convert managed data to native data.", 181StubIdentifierContext.Stage.Pin => "Pin data in preparation for calling the P/Invoke.", 182StubIdentifierContext.Stage.PinnedMarshal => "Convert managed data to native data that requires the managed data to be pinned.", 183StubIdentifierContext.Stage.Invoke => "Call the P/Invoke.", 184StubIdentifierContext.Stage.UnmarshalCapture => "Capture the native data into marshaller instances in case conversion to managed data throws an exception.", 185StubIdentifierContext.Stage.Unmarshal => "Convert native data to managed data.", 186StubIdentifierContext.Stage.CleanupCallerAllocated => "Perform cleanup of caller allocated resources.", 187StubIdentifierContext.Stage.CleanupCalleeAllocated => "Perform cleanup of callee allocated resources.", 188StubIdentifierContext.Stage.NotifyForSuccessfulInvoke => "Keep alive any managed objects that need to stay alive across the call.", 189StubIdentifierContext.Stage.GuaranteedUnmarshal => "Convert native data to managed data even in the case of an exception during the non-cleanup phases.",
Marshalling\BlittableMarshaller.cs (4)
46if (context.CurrentStage == StubIdentifierContext.Stage.Pin) 69case StubIdentifierContext.Stage.Setup: 71case StubIdentifierContext.Stage.Marshal: 82case StubIdentifierContext.Stage.Unmarshal:
Marshalling\BoolMarshaller.cs (3)
56case StubIdentifierContext.Stage.Setup: 58case StubIdentifierContext.Stage.Marshal: 75case StubIdentifierContext.Stage.Unmarshal:
Marshalling\CharMarshaller.cs (4)
53if (context.CurrentStage == StubIdentifierContext.Stage.Pin) 86case StubIdentifierContext.Stage.Setup: 88case StubIdentifierContext.Stage.Marshal: 104case StubIdentifierContext.Stage.Unmarshal:
Marshalling\CustomTypeMarshallingGenerator.cs (10)
33case StubIdentifierContext.Stage.Setup: 35case StubIdentifierContext.Stage.Marshal: 42case StubIdentifierContext.Stage.Pin: 48case StubIdentifierContext.Stage.PinnedMarshal: 54case StubIdentifierContext.Stage.NotifyForSuccessfulInvoke: 60case StubIdentifierContext.Stage.UnmarshalCapture: 66case StubIdentifierContext.Stage.Unmarshal: 73case StubIdentifierContext.Stage.GuaranteedUnmarshal: 80case StubIdentifierContext.Stage.CleanupCallerAllocated: 82case StubIdentifierContext.Stage.CleanupCalleeAllocated:
Marshalling\DelegateMarshaller.cs (4)
36case StubIdentifierContext.Stage.Setup: 38case StubIdentifierContext.Stage.Marshal: 57case StubIdentifierContext.Stage.Unmarshal: 79case StubIdentifierContext.Stage.NotifyForSuccessfulInvoke:
Marshalling\MarshallerHelpers.cs (5)
353public static StubIdentifierContext.Stage GetCleanupStage(TypePositionInfo info, StubCodeContext context) 359return StubIdentifierContext.Stage.CleanupCallerAllocated; 363MarshalDirection.UnmanagedToManaged => StubIdentifierContext.Stage.CleanupCalleeAllocated, 364MarshalDirection.ManagedToUnmanaged => StubIdentifierContext.Stage.CleanupCallerAllocated, 365MarshalDirection.Bidirectional => StubIdentifierContext.Stage.CleanupCallerAllocated,
Marshalling\MarshallingGenerator.cs (1)
120/// For <see cref="StubIdentifierContext.Stage.Pin"/>, any statements not of type
Marshalling\StatefulMarshallingStrategy.cs (2)
27if (MarshallerHelpers.GetCleanupStage(info, stubContext) is not StubIdentifierContext.Stage.CleanupCallerAllocated) 41if (MarshallerHelpers.GetCleanupStage(info, stubContext) is not StubIdentifierContext.Stage.CleanupCalleeAllocated)
Marshalling\StaticPinnableManagedValueMarshaller.cs (1)
74if (context.CurrentStage == StubIdentifierContext.Stage.Pin)
StubIdentifierContext.cs (2)
86public Stage CurrentStage { get; init; } = Stage.Invalid;