From 80aa8a08c87a917d1c68658b57020eebe2f7c5c7 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 9 Jan 2024 19:22:00 -0800 Subject: [PATCH] Change IMarshallingGenerator resolution to use a sequential design instead of recursive (#96632) * Make generator factories non-nested (instead using a sequential search model similar to how we parse attribute info) and rename to a better name based on the return type. * Use empty instead of default * Include all core resolvers in element marshalling resolution, not just CustomMarshaller marshallers. * Run the attributed marshalling model (which handles UnmanagedBlittable marshalling info) before char marshalling to ensure that char marshalling works as expected. * Rename all references to GeneratorFactory to GeneratorResolver --- .../JSExportCodeGenerator.cs | 4 +- .../JSImportGenerator/JSExportGenerator.cs | 2 +- .../JSImportGenerator/JSGeneratorFactory.cs | 2 +- .../JSImportCodeGenerator.cs | 4 +- .../JSImportGenerator/JSImportGenerator.cs | 2 +- .../System.Runtime.InteropServices.sln | 383 +++++++++--------- ...omImportToGeneratedComInterfaceAnalyzer.cs | 10 +- .../ComInterfaceGenerator.cs | 2 +- .../ComInterfaceGenerator.csproj | 1 - .../ComInterfaceGeneratorHelpers.cs | 79 +--- .../ComInterfaceGenerator/ComMethodContext.cs | 4 +- .../ManagedToNativeVTableMethodGenerator.cs | 4 +- ...omInterfaceDispatchMarshallingResolver.cs} | 10 +- ...nagedHResultExceptionGeneratorResolver.cs} | 8 +- ...rFactory.cs => ObjectUnwrapperResolver.cs} | 10 +- .../StructAsHResultMarshallerFactory.cs | 11 +- .../UnmanagedToManagedStubGenerator.cs | 4 +- .../VirtualMethodPointerStubGenerator.cs | 16 +- .../VtableIndexStubGenerator.cs | 6 +- .../VtableIndexStubGeneratorHelpers.cs | 73 +--- .../ConvertToLibraryImportAnalyzer.cs | 8 +- ...neratorFactory.cs => ForwarderResolver.cs} | 2 +- .../LibraryImportGenerator.cs | 2 +- .../LibraryImportGenerator.csproj | 1 - .../LibraryImportGeneratorHelpers.cs | 88 ++-- .../PInvokeStubCodeGenerator.cs | 4 +- .../BoundGenerators.cs | 20 +- .../DefaultMarshallingInfoParser.cs | 24 +- ...butedMarshallingModelGeneratorResolver.cs} | 43 +- .../Marshalling/BreakingChangeDetector.cs | 6 +- .../ByValueContentsMarshalKindValidator.cs | 10 +- ...cs => CharMarshallingGeneratorResolver.cs} | 8 +- .../CompositeMarshallingGeneratorResolver.cs | 39 ++ .../DefaultMarshallingGeneratorResolver.cs | 82 ++++ ...ry.cs => IMarshallingGeneratorResolver.cs} | 2 +- ... MarshalAsMarshallingGeneratorResolver.cs} | 8 +- ...y.cs => NoMarshallingInfoErrorResolver.cs} | 13 +- ...lingFactory.cs => NotSupportedResolver.cs} | 2 +- .../Marshalling/ResolvedGenerator.cs | 11 +- 39 files changed, 529 insertions(+), 479 deletions(-) rename src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/{ComInterfaceDispatchMarshallerFactory.cs => ComInterfaceDispatchMarshallingResolver.cs} (90%) rename src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/{ManagedHResultExceptionMarshallerFactory.cs => ManagedHResultExceptionGeneratorResolver.cs} (93%) rename src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/{ObjectUnwrapperMarshallerFactory.cs => ObjectUnwrapperResolver.cs} (89%) rename src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/{ForwarderMarshallingGeneratorFactory.cs => ForwarderResolver.cs} (83%) rename src/libraries/System.Runtime.InteropServices/gen/{Common => Microsoft.Interop.SourceGeneration}/DefaultMarshallingInfoParser.cs (69%) rename src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/{AttributedMarshallingModelGeneratorFactory.cs => AttributedMarshallingModelGeneratorResolver.cs} (95%) rename src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/{CharMarshallingGeneratorFactory.cs => CharMarshallingGeneratorResolver.cs} (89%) create mode 100644 src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CompositeMarshallingGeneratorResolver.cs create mode 100644 src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/DefaultMarshallingGeneratorResolver.cs rename src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/{IMarshallingGeneratorFactory.cs => IMarshallingGeneratorResolver.cs} (93%) rename src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/{MarshalAsMarshallingGeneratorFactory.cs => MarshalAsMarshallingGeneratorResolver.cs} (94%) rename src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/{NoMarshallingInfoErrorMarshallingFactory.cs => NoMarshallingInfoErrorResolver.cs} (70%) rename src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/{UnsupportedMarshallingFactory.cs => NotSupportedResolver.cs} (79%) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportCodeGenerator.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportCodeGenerator.cs index f83e3e8501e2e..c370849700555 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportCodeGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportCodeGenerator.cs @@ -24,7 +24,7 @@ public JSExportCodeGenerator( JSExportData attributeData, JSSignatureContext signatureContext, GeneratorDiagnosticsBag diagnosticsBag, - IMarshallingGeneratorFactory generatorFactory) + IMarshallingGeneratorResolver generatorResolver) { _signatureContext = signatureContext; NativeToManagedStubCodeContext innerContext = new NativeToManagedStubCodeContext(ReturnIdentifier, ReturnIdentifier) @@ -33,7 +33,7 @@ public JSExportCodeGenerator( }; _context = new JSExportCodeContext(attributeData, innerContext); - _marshallers = BoundGenerators.Create(argTypes, generatorFactory, _context, new EmptyJSGenerator(), out var bindingFailures); + _marshallers = BoundGenerators.Create(argTypes, generatorResolver, _context, new EmptyJSGenerator(), out var bindingFailures); diagnosticsBag.ReportGeneratorDiagnostics(bindingFailures); diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs index 8db3bc343edb0..ffe0fe6a0f995 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs @@ -283,7 +283,7 @@ private static (MemberDeclarationSyntax, StatementSyntax, AttributeListSyntax, I incrementalContext.JSExportData, incrementalContext.SignatureContext, diagnostics, - new JSGeneratorFactory()); + new JSGeneratorResolver()); var wrapperName = "__Wrapper_" + incrementalContext.StubMethodSyntaxTemplate.Identifier + "_" + incrementalContext.SignatureContext.TypesHash; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs index b6e529f4dd5b3..a1cbebb3fda5a 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs @@ -11,7 +11,7 @@ namespace Microsoft.Interop.JavaScript { - internal sealed class JSGeneratorFactory : IMarshallingGeneratorFactory + internal sealed class JSGeneratorResolver : IMarshallingGeneratorResolver { public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) { diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportCodeGenerator.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportCodeGenerator.cs index 007647126c02e..80a9a2338b993 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportCodeGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportCodeGenerator.cs @@ -31,7 +31,7 @@ public JSImportCodeGenerator( JSImportData attributeData, JSSignatureContext signatureContext, GeneratorDiagnosticsBag diagnosticsBag, - IMarshallingGeneratorFactory generatorFactory) + IMarshallingGeneratorResolver generatorResolver) { _signatureContext = signatureContext; ManagedToNativeStubCodeContext innerContext = new ManagedToNativeStubCodeContext(ReturnIdentifier, ReturnIdentifier) @@ -39,7 +39,7 @@ public JSImportCodeGenerator( CodeEmitOptions = new(SkipInit: true) }; _context = new JSImportCodeContext(attributeData, innerContext); - _marshallers = BoundGenerators.Create(argTypes, generatorFactory, _context, new EmptyJSGenerator(), out var bindingFailures); + _marshallers = BoundGenerators.Create(argTypes, generatorResolver, _context, new EmptyJSGenerator(), out var bindingFailures); diagnosticsBag.ReportGeneratorDiagnostics(bindingFailures); diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs index bf2c4bd3da32c..c97f6998de9e6 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs @@ -204,7 +204,7 @@ private static (MemberDeclarationSyntax, ImmutableArray) Generat incrementalContext.JSImportData, incrementalContext.SignatureContext, diagnostics, - new JSGeneratorFactory()); + new JSGeneratorResolver()); BlockSyntax code = stubGenerator.GenerateJSImportBody(); diff --git a/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln b/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln index bf5acb02867e8..f5fbe8b482fdd 100644 --- a/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln +++ b/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34320.234 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib", "..\..\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj", "{94B59BA0-491F-4B59-ADFF-A057EC3EC835}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}" @@ -71,16 +75,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{5114BD7E-849 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "tools\gen", "{0522E1B2-BF32-4B3A-A74C-1CBF642E85E4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{0522E1B2-BF32-4B3A-A74C-1CBF642E85E4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "tools\src", "{9DA56ADF-7AA4-4752-BD91-330F674AAF18}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9DA56ADF-7AA4-4752-BD91-330F674AAF18}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{97B027E5-35BC-4B07-A030-F5C5085C281C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{97B027E5-35BC-4B07-A030-F5C5085C281C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{8FA3249B-3567-4C76-BA32-9488FC92994D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Checked|Any CPU = Checked|Any CPU + Checked|arm = Checked|arm + Checked|arm64 = Checked|arm64 + Checked|x64 = Checked|x64 + Checked|x86 = Checked|x86 Debug|Any CPU = Debug|Any CPU Debug|arm = Debug|arm Debug|arm64 = Debug|arm64 @@ -91,13 +100,18 @@ Global Release|arm64 = Release|arm64 Release|x64 = Release|x64 Release|x86 = Release|x86 - Checked|Any CPU = Checked|Any CPU - Checked|arm = Checked|arm - Checked|arm64 = Checked|arm64 - Checked|x64 = Checked|x64 - Checked|x86 = Checked|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.ActiveCfg = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.Build.0 = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.ActiveCfg = Checked|arm + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.Build.0 = Checked|arm + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.ActiveCfg = Checked|arm64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.Build.0 = Checked|arm64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.ActiveCfg = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.Build.0 = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.ActiveCfg = Checked|x86 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.Build.0 = Checked|x86 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|Any CPU.ActiveCfg = Debug|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|Any CPU.Build.0 = Debug|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|arm.ActiveCfg = Debug|arm @@ -118,16 +132,11 @@ Global {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x64.Build.0 = Release|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x86.ActiveCfg = Release|x86 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x86.Build.0 = Release|x86 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.ActiveCfg = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.Build.0 = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.ActiveCfg = Checked|arm - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.Build.0 = Checked|arm - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.ActiveCfg = Checked|arm64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.Build.0 = Checked|arm64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.ActiveCfg = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.Build.0 = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.ActiveCfg = Checked|x86 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.Build.0 = Checked|x86 + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.ActiveCfg = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -144,11 +153,11 @@ Global {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x64.Build.0 = Release|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x86.ActiveCfg = Release|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x86.Build.0 = Release|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm64.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x64.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x86.ActiveCfg = Debug|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -165,11 +174,11 @@ Global {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Release|x64.Build.0 = Release|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Release|x86.ActiveCfg = Release|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Release|x86.Build.0 = Release|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm64.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x64.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x86.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm64.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x64.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x86.ActiveCfg = Debug|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Debug|Any CPU.Build.0 = Debug|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -186,11 +195,11 @@ Global {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Release|x64.Build.0 = Release|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Release|x86.ActiveCfg = Release|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Release|x86.Build.0 = Release|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm64.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x64.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x86.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm64.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x64.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x86.ActiveCfg = Debug|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Debug|Any CPU.Build.0 = Debug|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -207,11 +216,11 @@ Global {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Release|x64.Build.0 = Release|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Release|x86.ActiveCfg = Release|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Release|x86.Build.0 = Release|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm64.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x64.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x86.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x64.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x86.ActiveCfg = Debug|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -228,11 +237,11 @@ Global {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Release|x64.Build.0 = Release|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Release|x86.ActiveCfg = Release|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Release|x86.Build.0 = Release|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x64.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x86.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm64.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x64.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x86.ActiveCfg = Debug|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Debug|Any CPU.Build.0 = Debug|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -249,11 +258,11 @@ Global {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Release|x64.Build.0 = Release|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Release|x86.ActiveCfg = Release|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Release|x86.Build.0 = Release|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm64.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x64.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x86.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm64.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x64.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x86.ActiveCfg = Debug|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Debug|Any CPU.Build.0 = Debug|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -270,11 +279,11 @@ Global {716ED44B-37C8-4776-BE70-285952D2B30D}.Release|x64.Build.0 = Release|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Release|x86.ActiveCfg = Release|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Release|x86.Build.0 = Release|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm64.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x64.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x86.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.ActiveCfg = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|Any CPU.Build.0 = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -291,11 +300,11 @@ Global {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x64.Build.0 = Release|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x86.ActiveCfg = Release|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x86.Build.0 = Release|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm64.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x64.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x86.ActiveCfg = Debug|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Debug|Any CPU.Build.0 = Debug|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -312,11 +321,11 @@ Global {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Release|x64.Build.0 = Release|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Release|x86.ActiveCfg = Release|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Release|x86.Build.0 = Release|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm64.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x64.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x86.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x64.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x86.ActiveCfg = Debug|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -333,11 +342,11 @@ Global {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Release|x64.Build.0 = Release|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Release|x86.ActiveCfg = Release|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Release|x86.Build.0 = Release|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x64.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x86.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm64.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x64.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x86.ActiveCfg = Debug|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Debug|Any CPU.Build.0 = Debug|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -354,11 +363,11 @@ Global {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Release|x64.Build.0 = Release|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Release|x86.ActiveCfg = Release|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Release|x86.Build.0 = Release|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm64.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x64.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x86.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm64.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.ActiveCfg = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|Any CPU.Build.0 = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -375,11 +384,11 @@ Global {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x64.Build.0 = Release|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x86.ActiveCfg = Release|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x86.Build.0 = Release|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm64.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm64.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.ActiveCfg = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|Any CPU.Build.0 = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -396,11 +405,11 @@ Global {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x64.Build.0 = Release|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x86.ActiveCfg = Release|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x86.Build.0 = Release|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm64.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm64.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.ActiveCfg = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -417,11 +426,11 @@ Global {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x64.Build.0 = Release|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x86.ActiveCfg = Release|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x86.Build.0 = Release|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm64.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm64.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.ActiveCfg = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|Any CPU.Build.0 = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -438,11 +447,11 @@ Global {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x64.Build.0 = Release|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x86.ActiveCfg = Release|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x86.Build.0 = Release|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm64.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm64.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x64.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x86.ActiveCfg = Debug|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -459,11 +468,11 @@ Global {3741C833-C364-4269-9B1D-D442055DA7CE}.Release|x64.Build.0 = Release|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Release|x86.ActiveCfg = Release|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Release|x86.Build.0 = Release|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm64.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x64.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x86.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x64.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x86.ActiveCfg = Debug|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Debug|Any CPU.Build.0 = Debug|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -480,11 +489,11 @@ Global {1D771995-D475-429B-AC31-2B1F618AA45F}.Release|x64.Build.0 = Release|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Release|x86.ActiveCfg = Release|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Release|x86.Build.0 = Release|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x64.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x86.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm64.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x64.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x86.ActiveCfg = Debug|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Debug|Any CPU.Build.0 = Debug|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -501,11 +510,11 @@ Global {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Release|x64.Build.0 = Release|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Release|x86.ActiveCfg = Release|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Release|x86.Build.0 = Release|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm64.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x64.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x86.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm64.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x64.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x86.ActiveCfg = Debug|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Debug|Any CPU.Build.0 = Debug|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -522,11 +531,11 @@ Global {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Release|x64.Build.0 = Release|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Release|x86.ActiveCfg = Release|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Release|x86.Build.0 = Release|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm64.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x64.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x86.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm64.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.ActiveCfg = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -543,11 +552,11 @@ Global {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x64.Build.0 = Release|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x86.ActiveCfg = Release|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x86.Build.0 = Release|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm64.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm64.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.ActiveCfg = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|Any CPU.Build.0 = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -564,11 +573,11 @@ Global {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x64.Build.0 = Release|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x86.ActiveCfg = Release|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x86.Build.0 = Release|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm64.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|arm.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|arm64.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.ActiveCfg = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|Any CPU.Build.0 = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -585,11 +594,11 @@ Global {866D295E-424A-4747-9417-CD7746936138}.Release|x64.Build.0 = Release|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Release|x86.ActiveCfg = Release|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Release|x86.Build.0 = Release|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|arm.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|arm64.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.ActiveCfg = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -606,11 +615,11 @@ Global {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x64.Build.0 = Release|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x86.ActiveCfg = Release|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x86.Build.0 = Release|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm64.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x64.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x86.ActiveCfg = Debug|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Debug|Any CPU.Build.0 = Debug|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -627,11 +636,11 @@ Global {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Release|x64.Build.0 = Release|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Release|x86.ActiveCfg = Release|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Release|x86.Build.0 = Release|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm64.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x64.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x86.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x64.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x86.ActiveCfg = Debug|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -648,11 +657,11 @@ Global {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Release|x64.Build.0 = Release|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Release|x86.ActiveCfg = Release|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Release|x86.Build.0 = Release|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x64.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x86.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x64.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x86.ActiveCfg = Debug|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -669,11 +678,11 @@ Global {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Release|x64.Build.0 = Release|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Release|x86.ActiveCfg = Release|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Release|x86.Build.0 = Release|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x64.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x86.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm64.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x64.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x86.ActiveCfg = Debug|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Debug|Any CPU.Build.0 = Debug|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -690,11 +699,11 @@ Global {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Release|x64.Build.0 = Release|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Release|x86.ActiveCfg = Release|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Release|x86.Build.0 = Release|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm64.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x64.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x86.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm64.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x64.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x86.ActiveCfg = Debug|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Debug|Any CPU.Build.0 = Debug|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -711,11 +720,11 @@ Global {169B126B-48DF-425C-B902-D376A689D9FB}.Release|x64.Build.0 = Release|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Release|x86.ActiveCfg = Release|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Release|x86.Build.0 = Release|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm64.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x64.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x86.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm64.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x64.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x86.ActiveCfg = Debug|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -732,11 +741,11 @@ Global {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Release|x64.Build.0 = Release|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Release|x86.ActiveCfg = Release|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Release|x86.Build.0 = Release|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm64.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x64.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x86.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x64.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x86.ActiveCfg = Debug|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Debug|Any CPU.Build.0 = Debug|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -753,11 +762,11 @@ Global {1347FE73-506C-4C44-A469-979F6ADB78BE}.Release|x64.Build.0 = Release|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Release|x86.ActiveCfg = Release|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Release|x86.Build.0 = Release|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x64.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x86.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm64.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x64.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x86.ActiveCfg = Debug|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Debug|Any CPU.Build.0 = Debug|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -774,23 +783,26 @@ Global {B36C9254-0C55-414E-8403-03B4F18D5F35}.Release|x64.Build.0 = Release|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Release|x86.ActiveCfg = Release|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Release|x86.Build.0 = Release|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm64.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x64.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x86.ActiveCfg = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {94B59BA0-491F-4B59-ADFF-A057EC3EC835} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} {C4B641C3-3317-4913-91DA-0DA3B64BABED} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} {716ED44B-37C8-4776-BE70-285952D2B30D} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} + {1B248B4C-7584-4C04-850A-A50EB592052C} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} + {768B77B0-EA45-469D-B39E-545EB72F5A43} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} + {8671F164-F78C-44FA-93B7-A310F67890FE} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {3741C833-C364-4269-9B1D-D442055DA7CE} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {1D771995-D475-429B-AC31-2B1F618AA45F} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} @@ -800,27 +812,24 @@ Global {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {866D295E-424A-4747-9417-CD7746936138} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} - {8671F164-F78C-44FA-93B7-A310F67890FE} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} {0B5FD0C2-367D-4AD6-8001-80AD79B2441C} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} {C7DAC270-CC93-4C97-9A8D-6E724A10727D} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} - {1B248B4C-7584-4C04-850A-A50EB592052C} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} - {768B77B0-EA45-469D-B39E-545EB72F5A43} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} {5600CDE1-139F-461B-8DD9-86FCC499DCC2} = {0522E1B2-BF32-4B3A-A74C-1CBF642E85E4} {169B126B-48DF-425C-B902-D376A689D9FB} = {0522E1B2-BF32-4B3A-A74C-1CBF642E85E4} - {0522E1B2-BF32-4B3A-A74C-1CBF642E85E4} = {8FA3249B-3567-4C76-BA32-9488FC92994D} {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB} = {9DA56ADF-7AA4-4752-BD91-330F674AAF18} {1347FE73-506C-4C44-A469-979F6ADB78BE} = {9DA56ADF-7AA4-4752-BD91-330F674AAF18} - {9DA56ADF-7AA4-4752-BD91-330F674AAF18} = {8FA3249B-3567-4C76-BA32-9488FC92994D} {B36C9254-0C55-414E-8403-03B4F18D5F35} = {97B027E5-35BC-4B07-A030-F5C5085C281C} + {0522E1B2-BF32-4B3A-A74C-1CBF642E85E4} = {8FA3249B-3567-4C76-BA32-9488FC92994D} + {9DA56ADF-7AA4-4752-BD91-330F674AAF18} = {8FA3249B-3567-4C76-BA32-9488FC92994D} {97B027E5-35BC-4B07-A030-F5C5085C281C} = {8FA3249B-3567-4C76-BA32-9488FC92994D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4031401-FEB5-4CCF-91C1-38F5646B2BFD} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{1347fe73-506c-4c44-a469-979f6adb78be}*SharedItemsImports = 5 + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{169b126b-48df-425c-b902-d376a689d9fb}*SharedItemsImports = 5 + ..\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{94b59ba0-491f-4b59-adff-a057ec3ec835}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Analyzers/ConvertComImportToGeneratedComInterfaceAnalyzer.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Analyzers/ConvertComImportToGeneratedComInterfaceAnalyzer.cs index 9c0e81dd48095..3035552c59dd8 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Analyzers/ConvertComImportToGeneratedComInterfaceAnalyzer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Analyzers/ConvertComImportToGeneratedComInterfaceAnalyzer.cs @@ -81,8 +81,8 @@ public override void Initialize(AnalysisContext context) new CodeEmitOptions(SkipInit: true), typeof(ConvertComImportToGeneratedComInterfaceAnalyzer).Assembly); - var managedToUnmanagedFactory = ComInterfaceGeneratorHelpers.GetGeneratorFactory(env.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged); - var unmanagedToManagedFactory = ComInterfaceGeneratorHelpers.GetGeneratorFactory(env.EnvironmentFlags, MarshalDirection.UnmanagedToManaged); + var managedToUnmanagedFactory = ComInterfaceGeneratorHelpers.GetGeneratorResolver(env.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged); + var unmanagedToManagedFactory = ComInterfaceGeneratorHelpers.GetGeneratorResolver(env.EnvironmentFlags, MarshalDirection.UnmanagedToManaged); mayRequireAdditionalWork = diagnostics.Diagnostics.Any(); bool anyExplicitlyUnsupportedInfo = false; @@ -92,7 +92,7 @@ public override void Initialize(AnalysisContext context) var forwarder = new Forwarder(); // We don't actually need the bound generators. We just need them to be attempted to be bound to determine if the generator will be able to bind them. - BoundGenerators generators = BoundGenerators.Create(targetSignatureContext.ElementTypeInformation, new CallbackGeneratorFactory((info, context) => + BoundGenerators generators = BoundGenerators.Create(targetSignatureContext.ElementTypeInformation, new CallbackGeneratorResolver((info, context) => { if (s_unsupportedTypeNames.Contains(info.ManagedType.FullTypeName)) { @@ -186,11 +186,11 @@ private static bool HasUnsupportedMarshalAsInfo(TypePositionInfo info) || unmanagedType == UnmanagedType.SafeArray; } - private sealed class CallbackGeneratorFactory : IMarshallingGeneratorFactory + private sealed class CallbackGeneratorResolver : IMarshallingGeneratorResolver { private readonly Func _func; - public CallbackGeneratorFactory(Func func) + public CallbackGeneratorResolver(Func func) { _func = func; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.cs index 540b6089c5b38..b319aac03586e 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.cs @@ -569,7 +569,7 @@ private static InterfaceDeclarationSyntax GenerateImplementationVTable(ComInterf .Where(context => context.UnmanagedToManagedStub.Diagnostics.All(diag => diag.Descriptor.DefaultSeverity != DiagnosticSeverity.Error)) .Select(context => context.GenerationContext), vtableLocalName, - ComInterfaceGeneratorHelpers.GetGeneratorFactory); + ComInterfaceGeneratorHelpers.GetGeneratorResolver); return ImplementationInterfaceTemplate .AddMembers( diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.csproj b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.csproj index 76c56f653f979..8d187cfa8b38a 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.csproj +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.csproj @@ -20,7 +20,6 @@ - diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs index 5bd5e1b893bc9..2527ffb9e282a 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; @@ -9,68 +10,26 @@ namespace Microsoft.Interop { internal static class ComInterfaceGeneratorHelpers { - private static readonly IMarshallingGeneratorFactory s_managedToUnmanagedDisabledMarshallingGeneratorFactory = CreateGeneratorFactory(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.ManagedToUnmanaged); - private static readonly IMarshallingGeneratorFactory s_unmanagedToManagedDisabledMarshallingGeneratorFactory = CreateGeneratorFactory(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.UnmanagedToManaged); - private static readonly IMarshallingGeneratorFactory s_managedToUnmanagedEnabledMarshallingGeneratorFactory = CreateGeneratorFactory(EnvironmentFlags.None, MarshalDirection.ManagedToUnmanaged); - private static readonly IMarshallingGeneratorFactory s_unmanagedToManagedEnabledMarshallingGeneratorFactory = CreateGeneratorFactory(EnvironmentFlags.None, MarshalDirection.UnmanagedToManaged); - - private static IMarshallingGeneratorFactory CreateGeneratorFactory(EnvironmentFlags env, MarshalDirection direction) - { - IMarshallingGeneratorFactory generatorFactory; - - // If we're in a "supported" scenario, then emit a diagnostic as our final fallback. - generatorFactory = new UnsupportedMarshallingFactory(); - - generatorFactory = new NoMarshallingInfoErrorMarshallingFactory(generatorFactory, TypeNames.GeneratedComInterfaceAttribute_ShortName); - - // Since the char type can go into the P/Invoke signature here, we can only use it when - // runtime marshalling is disabled. - generatorFactory = new CharMarshallingGeneratorFactory(generatorFactory, useBlittableMarshallerForUtf16: env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), TypeNames.GeneratedComInterfaceAttribute_ShortName); - - InteropGenerationOptions interopGenerationOptions = new(UseMarshalType: true); - generatorFactory = new MarshalAsMarshallingGeneratorFactory(interopGenerationOptions, generatorFactory); - - generatorFactory = new StructAsHResultMarshallerFactory(generatorFactory); - - IMarshallingGeneratorFactory elementFactory = new AttributedMarshallingModelGeneratorFactory( - // Since the char type in an array will not be part of the P/Invoke signature, we can - // use the regular blittable marshaller in all cases. - new CharMarshallingGeneratorFactory(generatorFactory, useBlittableMarshallerForUtf16: true, TypeNames.GeneratedComInterfaceAttribute_ShortName), - new AttributedMarshallingModelOptions(env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), MarshalMode.ElementIn, MarshalMode.ElementRef, MarshalMode.ElementOut)); - // We don't need to include the later generator factories for collection elements - // as the later generator factories only apply to parameters. - generatorFactory = new AttributedMarshallingModelGeneratorFactory( - generatorFactory, - elementFactory, - new AttributedMarshallingModelOptions( - env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), - direction == MarshalDirection.ManagedToUnmanaged - ? MarshalMode.ManagedToUnmanagedIn - : MarshalMode.UnmanagedToManagedOut, - direction == MarshalDirection.ManagedToUnmanaged - ? MarshalMode.ManagedToUnmanagedRef - : MarshalMode.UnmanagedToManagedRef, - direction == MarshalDirection.ManagedToUnmanaged - ? MarshalMode.ManagedToUnmanagedOut - : MarshalMode.UnmanagedToManagedIn)); - - generatorFactory = new ManagedHResultExceptionMarshallerFactory(generatorFactory, direction); - - generatorFactory = new ComInterfaceDispatchMarshallerFactory(generatorFactory); - - generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory); - generatorFactory = new BreakingChangeDetector(generatorFactory); - - return generatorFactory; - } - - public static IMarshallingGeneratorFactory GetGeneratorFactory(EnvironmentFlags env, MarshalDirection direction) + private static readonly IMarshallingGeneratorResolver s_managedToUnmanagedDisabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.ManagedToUnmanaged); + private static readonly IMarshallingGeneratorResolver s_unmanagedToManagedDisabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.DisableRuntimeMarshalling, MarshalDirection.UnmanagedToManaged); + private static readonly IMarshallingGeneratorResolver s_managedToUnmanagedEnabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.None, MarshalDirection.ManagedToUnmanaged); + private static readonly IMarshallingGeneratorResolver s_unmanagedToManagedEnabledMarshallingGeneratorResolver = CreateGeneratorResolver(EnvironmentFlags.None, MarshalDirection.UnmanagedToManaged); + + private static IMarshallingGeneratorResolver CreateGeneratorResolver(EnvironmentFlags env, MarshalDirection direction) + => DefaultMarshallingGeneratorResolver.Create(env, direction, TypeNames.GeneratedComInterfaceAttribute_ShortName, + [ + new StructAsHResultMarshallerFactory(), + new ManagedHResultExceptionGeneratorResolver(direction), + new ComInterfaceDispatchMarshallingResolver(), + ]); + + public static IMarshallingGeneratorResolver GetGeneratorResolver(EnvironmentFlags env, MarshalDirection direction) => (env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), direction) switch { - (true, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedDisabledMarshallingGeneratorFactory, - (true, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedDisabledMarshallingGeneratorFactory, - (false, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedEnabledMarshallingGeneratorFactory, - (false, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedEnabledMarshallingGeneratorFactory, + (true, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedDisabledMarshallingGeneratorResolver, + (true, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedDisabledMarshallingGeneratorResolver, + (false, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedEnabledMarshallingGeneratorResolver, + (false, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedEnabledMarshallingGeneratorResolver, _ => throw new UnreachableException(), }; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComMethodContext.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComMethodContext.cs index f849757acdd6e..c67b5029ee756 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComMethodContext.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComMethodContext.cs @@ -79,7 +79,7 @@ private GeneratedMethodContextBase CreateManagedToUnmanagedStub() { return new SkippedStubContext(OriginalDeclaringInterface.Info.Type); } - var (methodStub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateManagedToNativeStub(GenerationContext, ComInterfaceGeneratorHelpers.GetGeneratorFactory); + var (methodStub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateManagedToNativeStub(GenerationContext, ComInterfaceGeneratorHelpers.GetGeneratorResolver); return new GeneratedStubCodeContext(GenerationContext.TypeKeyOwner, GenerationContext.ContainingSyntaxContext, new(methodStub), new(diagnostics)); } @@ -93,7 +93,7 @@ private GeneratedMethodContextBase CreateUnmanagedToManagedStub() { return new SkippedStubContext(GenerationContext.OriginalDefiningType); } - var (methodStub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateNativeToManagedStub(GenerationContext, ComInterfaceGeneratorHelpers.GetGeneratorFactory); + var (methodStub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateNativeToManagedStub(GenerationContext, ComInterfaceGeneratorHelpers.GetGeneratorResolver); return new GeneratedStubCodeContext(GenerationContext.OriginalDefiningType, GenerationContext.ContainingSyntaxContext, new(methodStub), new(diagnostics)); } diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ManagedToNativeVTableMethodGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ManagedToNativeVTableMethodGenerator.cs index b0af2c538f895..81183b32b9e70 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ManagedToNativeVTableMethodGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ManagedToNativeVTableMethodGenerator.cs @@ -47,7 +47,7 @@ public ManagedToNativeVTableMethodGenerator( bool setLastError, bool implicitThis, GeneratorDiagnosticsBag diagnosticsBag, - IMarshallingGeneratorFactory generatorFactory) + IMarshallingGeneratorResolver generatorResolver) { _setLastError = setLastError; if (implicitThis) @@ -73,7 +73,7 @@ public ManagedToNativeVTableMethodGenerator( } _context = new ManagedToNativeStubCodeContext(ReturnIdentifier, ReturnIdentifier); - _marshallers = BoundGenerators.Create(argTypes, generatorFactory, _context, new Forwarder(), out var bindingFailures); + _marshallers = BoundGenerators.Create(argTypes, generatorResolver, _context, new Forwarder(), out var bindingFailures); diagnosticsBag.ReportGeneratorDiagnostics(bindingFailures); diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ComInterfaceDispatchMarshallerFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ComInterfaceDispatchMarshallingResolver.cs similarity index 90% rename from src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ComInterfaceDispatchMarshallerFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ComInterfaceDispatchMarshallingResolver.cs index 86c67cbd4dadc..f93be2ed9931b 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ComInterfaceDispatchMarshallerFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ComInterfaceDispatchMarshallingResolver.cs @@ -14,16 +14,10 @@ internal sealed record ComInterfaceDispatchMarshallingInfo : MarshallingInfo public static readonly ComInterfaceDispatchMarshallingInfo Instance = new(); } - internal sealed class ComInterfaceDispatchMarshallerFactory : IMarshallingGeneratorFactory + internal sealed class ComInterfaceDispatchMarshallingResolver : IMarshallingGeneratorResolver { - private readonly IMarshallingGeneratorFactory _inner; - public ComInterfaceDispatchMarshallerFactory(IMarshallingGeneratorFactory inner) - { - _inner = inner; - } - public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) - => info.MarshallingAttributeInfo is ComInterfaceDispatchMarshallingInfo ? ResolvedGenerator.Resolved(new Marshaller()) : _inner.Create(info, context); + => info.MarshallingAttributeInfo is ComInterfaceDispatchMarshallingInfo ? ResolvedGenerator.Resolved(new Marshaller()) : ResolvedGenerator.UnresolvedGenerator; private sealed class Marshaller : IMarshallingGenerator { diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ManagedHResultExceptionMarshallerFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ManagedHResultExceptionGeneratorResolver.cs similarity index 93% rename from src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ManagedHResultExceptionMarshallerFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ManagedHResultExceptionGeneratorResolver.cs index c2f02efffeac1..5812392631655 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ManagedHResultExceptionMarshallerFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ManagedHResultExceptionGeneratorResolver.cs @@ -13,18 +13,16 @@ namespace Microsoft.Interop { internal sealed record ManagedHResultExceptionMarshallingInfo : MarshallingInfo; - internal sealed class ManagedHResultExceptionMarshallerFactory : IMarshallingGeneratorFactory + internal sealed class ManagedHResultExceptionGeneratorResolver : IMarshallingGeneratorResolver { - private readonly IMarshallingGeneratorFactory _inner; private readonly MarshalDirection _direction; - public ManagedHResultExceptionMarshallerFactory(IMarshallingGeneratorFactory inner, MarshalDirection direction) + public ManagedHResultExceptionGeneratorResolver(MarshalDirection direction) { if (direction is not (MarshalDirection.ManagedToUnmanaged or MarshalDirection.UnmanagedToManaged)) { throw new ArgumentOutOfRangeException(nameof(direction)); } - _inner = inner; _direction = direction; } @@ -41,7 +39,7 @@ public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) } else { - return _inner.Create(info, context); + return ResolvedGenerator.UnresolvedGenerator; } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ObjectUnwrapperMarshallerFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ObjectUnwrapperResolver.cs similarity index 89% rename from src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ObjectUnwrapperMarshallerFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ObjectUnwrapperResolver.cs index 2ca351cf53827..9f76b8bf19d92 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ObjectUnwrapperMarshallerFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/ObjectUnwrapperResolver.cs @@ -12,16 +12,10 @@ namespace Microsoft.Interop { internal sealed record ObjectUnwrapperInfo(TypeSyntax UnwrapperType) : MarshallingInfo; - internal sealed class ObjectUnwrapperMarshallerFactory : IMarshallingGeneratorFactory + internal sealed class ObjectUnwrapperResolver : IMarshallingGeneratorResolver { - private readonly IMarshallingGeneratorFactory _inner; - public ObjectUnwrapperMarshallerFactory(IMarshallingGeneratorFactory inner) - { - _inner = inner; - } - public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) - => info.MarshallingAttributeInfo is ObjectUnwrapperInfo ? ResolvedGenerator.Resolved(new Marshaller()) : _inner.Create(info, context); + => info.MarshallingAttributeInfo is ObjectUnwrapperInfo ? ResolvedGenerator.Resolved(new Marshaller()) : ResolvedGenerator.UnresolvedGenerator; private sealed class Marshaller : IMarshallingGenerator { diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/StructAsHResultMarshallerFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/StructAsHResultMarshallerFactory.cs index d8b41ca6e3732..89b297b4e3578 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/StructAsHResultMarshallerFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/Marshallers/StructAsHResultMarshallerFactory.cs @@ -10,17 +10,10 @@ namespace Microsoft.Interop { - internal sealed class StructAsHResultMarshallerFactory : IMarshallingGeneratorFactory + internal sealed class StructAsHResultMarshallerFactory : IMarshallingGeneratorResolver { private static readonly Marshaller s_marshaller = new(); - private readonly IMarshallingGeneratorFactory _inner; - - public StructAsHResultMarshallerFactory(IMarshallingGeneratorFactory inner) - { - _inner = inner; - } - public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) { // Value type with MarshalAs(UnmanagedType.Error), to be marshalled as an unmanaged HRESULT. @@ -29,7 +22,7 @@ public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) return ResolvedGenerator.Resolved(s_marshaller); } - return _inner.Create(info, context); + return ResolvedGenerator.UnresolvedGenerator; } private sealed class Marshaller : IMarshallingGenerator diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/UnmanagedToManagedStubGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/UnmanagedToManagedStubGenerator.cs index b806c8be3f87c..ed94e5d127ad3 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/UnmanagedToManagedStubGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/UnmanagedToManagedStubGenerator.cs @@ -22,10 +22,10 @@ internal sealed class UnmanagedToManagedStubGenerator public UnmanagedToManagedStubGenerator( ImmutableArray argTypes, GeneratorDiagnosticsBag diagnosticsBag, - IMarshallingGeneratorFactory generatorFactory) + IMarshallingGeneratorResolver generatorResolver) { _context = new NativeToManagedStubCodeContext(ReturnIdentifier, ReturnIdentifier); - _marshallers = BoundGenerators.Create(argTypes, generatorFactory, _context, new Forwarder(), out var bindingDiagnostics); + _marshallers = BoundGenerators.Create(argTypes, generatorResolver, _context, new Forwarder(), out var bindingDiagnostics); diagnosticsBag.ReportGeneratorDiagnostics(bindingDiagnostics); diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs index e0fb5046630d1..84a838ac148f6 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs @@ -17,7 +17,7 @@ internal static class VirtualMethodPointerStubGenerator { public static (MethodDeclarationSyntax, ImmutableArray) GenerateManagedToNativeStub( IncrementalMethodStubGenerationContext methodStub, - Func generatorFactoryCreator) + Func generatorResolverCreator) { var diagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), methodStub.DiagnosticLocation, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.ComInterfaceGenerator.SR)); @@ -27,7 +27,7 @@ public static (MethodDeclarationSyntax, ImmutableArray) Generate methodStub.VtableIndexData.SetLastError, methodStub.VtableIndexData.ImplicitThisParameter, diagnostics, - generatorFactoryCreator(methodStub.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged)); + generatorResolverCreator(methodStub.EnvironmentFlags, MarshalDirection.ManagedToUnmanaged)); BlockSyntax code = stubGenerator.GenerateStubBody( methodStub.VtableIndexData.Index, @@ -63,7 +63,7 @@ private static MethodDeclarationSyntax PrintGeneratedSource( public static (MethodDeclarationSyntax, ImmutableArray) GenerateNativeToManagedStub( IncrementalMethodStubGenerationContext methodStub, - Func generatorFactoryCreator) + Func generatorResolverCreator) { var diagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), methodStub.DiagnosticLocation, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.ComInterfaceGenerator.SR)); @@ -73,7 +73,7 @@ public static (MethodDeclarationSyntax, ImmutableArray) Generate var stubGenerator = new UnmanagedToManagedStubGenerator( elements, diagnostics, - generatorFactoryCreator(methodStub.EnvironmentFlags, MarshalDirection.UnmanagedToManaged)); + generatorResolverCreator(methodStub.EnvironmentFlags, MarshalDirection.UnmanagedToManaged)); BlockSyntax code = stubGenerator.GenerateStubBody( MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, @@ -145,12 +145,12 @@ private static ImmutableArray AddImplicitElementInfos(Incremen public static BlockSyntax GenerateVirtualMethodTableSlotAssignments( IEnumerable vtableMethods, string vtableIdentifier, - Func generatorFactoryCreator) + Func generatorResolverCreator) { List statements = new(); foreach (var method in vtableMethods) { - FunctionPointerTypeSyntax functionPointerType = GenerateUnmanagedFunctionPointerTypeForMethod(method, generatorFactoryCreator); + FunctionPointerTypeSyntax functionPointerType = GenerateUnmanagedFunctionPointerTypeForMethod(method, generatorResolverCreator); // [] = (void*)()&ABI_; statements.Add( @@ -170,14 +170,14 @@ public static BlockSyntax GenerateVirtualMethodTableSlotAssignments( private static FunctionPointerTypeSyntax GenerateUnmanagedFunctionPointerTypeForMethod( IncrementalMethodStubGenerationContext method, - Func generatorFactoryCreator) + Func generatorResolverCreator) { var diagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), method.DiagnosticLocation, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.ComInterfaceGenerator.SR)); var stubGenerator = new UnmanagedToManagedStubGenerator( AddImplicitElementInfos(method), diagnostics, - generatorFactoryCreator(method.EnvironmentFlags, MarshalDirection.UnmanagedToManaged)); + generatorResolverCreator(method.EnvironmentFlags, MarshalDirection.UnmanagedToManaged)); List functionPointerParameters = new(); var (paramList, retType, _) = stubGenerator.GenerateAbiMethodSignatureData(); diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGenerator.cs index ab0c984b08b1b..9328c0e7d6e56 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGenerator.cs @@ -365,7 +365,7 @@ private static MarshallingInfo CreateExceptionMarshallingInfo(AttributeData virt private static (MemberDeclarationSyntax, ImmutableArray) GenerateManagedToNativeStub( IncrementalMethodStubGenerationContext methodStub) { - var (stub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateManagedToNativeStub(methodStub, VtableIndexStubGeneratorHelpers.GetGeneratorFactory); + var (stub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateManagedToNativeStub(methodStub, VtableIndexStubGeneratorHelpers.GetGeneratorResolver); return ( methodStub.ContainingSyntaxContext.AddContainingSyntax( @@ -378,7 +378,7 @@ private static (MemberDeclarationSyntax, ImmutableArray) Generat private static (MemberDeclarationSyntax, ImmutableArray) GenerateNativeToManagedStub( IncrementalMethodStubGenerationContext methodStub) { - var (stub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateNativeToManagedStub(methodStub, VtableIndexStubGeneratorHelpers.GetGeneratorFactory); + var (stub, diagnostics) = VirtualMethodPointerStubGenerator.GenerateNativeToManagedStub(methodStub, VtableIndexStubGeneratorHelpers.GetGeneratorResolver); return ( methodStub.ContainingSyntaxContext.AddContainingSyntax( @@ -446,7 +446,7 @@ private static MemberDeclarationSyntax GeneratePopulateVTableMethod(IGrouping DefaultMarshallingGeneratorResolver.Create(env, direction, TypeNames.VirtualMethodIndexAttribute_ShortName, + [ + new ObjectUnwrapperResolver() + ]); + + public static IMarshallingGeneratorResolver GetGeneratorResolver(EnvironmentFlags env, MarshalDirection direction) => (env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), direction) switch { - (true, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedDisabledMarshallingGeneratorFactory, - (true, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedDisabledMarshallingGeneratorFactory, - (false, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedEnabledMarshallingGeneratorFactory, - (false, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedEnabledMarshallingGeneratorFactory, + (true, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedDisabledMarshallingGeneratorResolver, + (true, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedDisabledMarshallingGeneratorResolver, + (false, MarshalDirection.ManagedToUnmanaged) => s_managedToUnmanagedEnabledMarshallingGeneratorResolver, + (false, MarshalDirection.UnmanagedToManaged) => s_unmanagedToManagedEnabledMarshallingGeneratorResolver, _ => throw new UnreachableException(), }; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs index 4bc294632a00c..609cdf26746df 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs @@ -119,7 +119,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo new CodeEmitOptions(SkipInit: tf.TargetFramework == TargetFramework.Net), typeof(ConvertToLibraryImportAnalyzer).Assembly); - var factory = LibraryImportGeneratorHelpers.CreateGeneratorFactory(tf, new LibraryImportGeneratorOptions(context.Options.AnalyzerConfigOptionsProvider.GlobalOptions), env.EnvironmentFlags); + var factory = LibraryImportGeneratorHelpers.CreateGeneratorResolver(tf, new LibraryImportGeneratorOptions(context.Options.AnalyzerConfigOptionsProvider.GlobalOptions), env.EnvironmentFlags); bool mayRequireAdditionalWork = diagnostics.Diagnostics.Any(); bool anyExplicitlyUnsupportedInfo = false; @@ -128,7 +128,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo var forwarder = new Forwarder(); // We don't actually need the bound generators. We just need them to be attempted to be bound to determine if the generator will be able to bind them. - BoundGenerators generators = BoundGenerators.Create(targetSignatureContext.ElementTypeInformation, new CallbackGeneratorFactory((info, context) => + BoundGenerators generators = BoundGenerators.Create(targetSignatureContext.ElementTypeInformation, new CallbackGeneratorResolver((info, context) => { if (s_unsupportedTypeNames.Contains(info.ManagedType.FullTypeName)) { @@ -212,11 +212,11 @@ private static InteropAttributeCompilationData CreateInteropAttributeDataFromDll return interopData; } - private sealed class CallbackGeneratorFactory : IMarshallingGeneratorFactory + private sealed class CallbackGeneratorResolver : IMarshallingGeneratorResolver { private readonly Func _func; - public CallbackGeneratorFactory(Func func) + public CallbackGeneratorResolver(Func func) { _func = func; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/ForwarderMarshallingGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/ForwarderResolver.cs similarity index 83% rename from src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/ForwarderMarshallingGeneratorFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/ForwarderResolver.cs index 4247d5eb021e7..5570372bd31d0 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/ForwarderMarshallingGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/ForwarderResolver.cs @@ -7,7 +7,7 @@ namespace Microsoft.Interop { - internal sealed class ForwarderMarshallingGeneratorFactory : IMarshallingGeneratorFactory + internal sealed class ForwarderResolver : IMarshallingGeneratorResolver { private static readonly Forwarder s_forwarder = new Forwarder(); diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs index aba86cf2a13af..8b4c4de4d7f04 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs @@ -344,7 +344,7 @@ private static (MemberDeclarationSyntax, ImmutableArray) Generat pinvokeStub.SignatureContext.ElementTypeInformation, pinvokeStub.LibraryImportData.SetLastError && !options.GenerateForwarders, diagnostics, - LibraryImportGeneratorHelpers.CreateGeneratorFactory(pinvokeStub.TargetFramework, pinvokeStub.Options, pinvokeStub.EnvironmentFlags), + LibraryImportGeneratorHelpers.CreateGeneratorResolver(pinvokeStub.TargetFramework, pinvokeStub.Options, pinvokeStub.EnvironmentFlags), new CodeEmitOptions(SkipInit: pinvokeStub.TargetFramework is (TargetFramework.Net, _))); // Check if the generator should produce a forwarder stub - regular DllImport. diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.csproj b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.csproj index 8fae82f5b846e..fd0512ebaec25 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.csproj +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.csproj @@ -24,7 +24,6 @@ - diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs index 49a5e8ac5edf5..bacaa8c74b701 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; -using System.Text; using Microsoft.CodeAnalysis; namespace Microsoft.Interop @@ -64,56 +61,69 @@ public static MarshallingInfoParser CreateMarshallingInfoParser(StubEnvironment new BlittableTypeMarshallingInfoProvider(env.Compilation))); } - public static IMarshallingGeneratorFactory CreateGeneratorFactory(TargetFrameworkSettings tf, LibraryImportGeneratorOptions options, EnvironmentFlags env) + public static IMarshallingGeneratorResolver CreateGeneratorResolver(TargetFrameworkSettings tf, LibraryImportGeneratorOptions options, EnvironmentFlags env) { - IMarshallingGeneratorFactory generatorFactory; + IMarshallingGeneratorResolver generatorResolver; if (options.GenerateForwarders) { - generatorFactory = new ForwarderMarshallingGeneratorFactory(); + generatorResolver = new ForwarderResolver(); } else { - if (tf.TargetFramework != TargetFramework.Net || tf.Version.Major < 7) - { - // If we're using our downstream support, fall back to the Forwarder marshaller when the TypePositionInfo is unhandled. - generatorFactory = new ForwarderMarshallingGeneratorFactory(); - } - else - { - // If we're in a "supported" scenario, then emit a diagnostic as our final fallback. - generatorFactory = new UnsupportedMarshallingFactory(); - } - - generatorFactory = new NoMarshallingInfoErrorMarshallingFactory(generatorFactory, TypeNames.LibraryImportAttribute_ShortName); - - // Since the char type can go into the P/Invoke signature here, we can only use it when - // runtime marshalling is disabled. - generatorFactory = new CharMarshallingGeneratorFactory(generatorFactory, useBlittableMarshallerForUtf16: env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), TypeNames.LibraryImportAttribute_ShortName); - - InteropGenerationOptions interopGenerationOptions = new(options.UseMarshalType); - generatorFactory = new MarshalAsMarshallingGeneratorFactory(interopGenerationOptions, generatorFactory); + bool isDownstreamScenario = tf.TargetFramework != TargetFramework.Net || tf.Version.Major < 7; + // If we're using our downstream support, fall back to the Forwarder marshaller when the TypePositionInfo is unhandled. + // If we're in a "supported" scenario, then emit a diagnostic as our final fallback. + IMarshallingGeneratorResolver fallbackResolver = isDownstreamScenario ? new ForwarderResolver() : new NotSupportedResolver(); + List coreResolvers = + [ + new MarshalAsMarshallingGeneratorResolver(new InteropGenerationOptions(options.UseMarshalType)), + new NoMarshallingInfoErrorResolver(TypeNames.LibraryImportAttribute_ShortName), + ]; if (tf.TargetFramework == TargetFramework.Net || tf.Version.Major >= 7) { - IMarshallingGeneratorFactory elementFactory = new AttributedMarshallingModelGeneratorFactory( - // Since the char type in an array will not be part of the P/Invoke signature, we can - // use the regular blittable marshaller in all cases. - new CharMarshallingGeneratorFactory(generatorFactory, useBlittableMarshallerForUtf16: true, TypeNames.LibraryImportAttribute_ShortName), - new AttributedMarshallingModelOptions(env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), MarshalMode.ElementIn, MarshalMode.ElementRef, MarshalMode.ElementOut)); - // We don't need to include the later generator factories for collection elements - // as the later generator factories only apply to parameters. - generatorFactory = new AttributedMarshallingModelGeneratorFactory( - generatorFactory, - elementFactory, - new AttributedMarshallingModelOptions(env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), MarshalMode.ManagedToUnmanagedIn, MarshalMode.ManagedToUnmanagedRef, MarshalMode.ManagedToUnmanagedOut)); + // Since the char type in an array will not be part of the P/Invoke signature, we can + // use the regular blittable marshaller in all cases. + var charElementMarshaller = new CharMarshallingGeneratorResolver(useBlittableMarshallerForUtf16: true, TypeNames.LibraryImportAttribute_ShortName); + IMarshallingGeneratorResolver elementFactory = new AttributedMarshallingModelGeneratorResolver( + new CompositeMarshallingGeneratorResolver([ + charElementMarshaller, + .. coreResolvers, + fallbackResolver + ]), + new AttributedMarshallingModelOptions( + env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), + MarshalMode.ElementIn, + MarshalMode.ElementRef, + MarshalMode.ElementOut, + ResolveElementsFromSelf: true)); + coreResolvers.Add( + new AttributedMarshallingModelGeneratorResolver( + new CompositeMarshallingGeneratorResolver([ + elementFactory, + charElementMarshaller, + .. coreResolvers, + fallbackResolver]), + new AttributedMarshallingModelOptions( + env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), + MarshalMode.ManagedToUnmanagedIn, + MarshalMode.ManagedToUnmanagedRef, + MarshalMode.ManagedToUnmanagedOut, + ResolveElementsFromSelf: false))); } - generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory); - generatorFactory = new BreakingChangeDetector(generatorFactory); + generatorResolver = new ByValueContentsMarshalKindValidator(new CompositeMarshallingGeneratorResolver([ + .. coreResolvers, + // Since the char type can go into the P/Invoke signature here, we can only use it when + // runtime marshalling is disabled. + new CharMarshallingGeneratorResolver(useBlittableMarshallerForUtf16: env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), TypeNames.LibraryImportAttribute_ShortName), + fallbackResolver + ])); + generatorResolver = new BreakingChangeDetector(generatorResolver); } - return generatorFactory; + return generatorResolver; } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs index 8722d25b20c88..bd2d5cb73075d 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs @@ -49,13 +49,13 @@ public PInvokeStubCodeGenerator( ImmutableArray argTypes, bool setLastError, GeneratorDiagnosticsBag diagnosticsBag, - IMarshallingGeneratorFactory generatorFactory, + IMarshallingGeneratorResolver generatorResolver, CodeEmitOptions codeEmitOptions) { _setLastError = setLastError; _context = new ManagedToNativeStubCodeContext(ReturnIdentifier, ReturnIdentifier); - _marshallers = BoundGenerators.Create(argTypes, generatorFactory, _context, new Forwarder(), out var bindingDiagnostics); + _marshallers = BoundGenerators.Create(argTypes, generatorResolver, _context, new Forwarder(), out var bindingDiagnostics); diagnosticsBag.ReportGeneratorDiagnostics(bindingDiagnostics); diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/BoundGenerators.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/BoundGenerators.cs index d1516be7dab30..99e15793754b2 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/BoundGenerators.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/BoundGenerators.cs @@ -20,7 +20,7 @@ public sealed class BoundGenerators { private BoundGenerators() { } - public static BoundGenerators Create(ImmutableArray elementTypeInfo, IMarshallingGeneratorFactory generatorFactory, StubCodeContext context, IMarshallingGenerator fallbackGenerator, out ImmutableArray generatorBindingDiagnostics) + public static BoundGenerators Create(ImmutableArray elementTypeInfo, IMarshallingGeneratorResolver generatorResolver, StubCodeContext context, IMarshallingGenerator fallbackGenerator, out ImmutableArray generatorBindingDiagnostics) { BoundGenerator defaultBoundGenerator = new BoundGenerator(new TypePositionInfo(SpecialTypeInfo.Void, NoMarshallingInfo.Instance), fallbackGenerator); BoundGenerators result = new(); @@ -45,7 +45,7 @@ public static BoundGenerators Create(ImmutableArray elementTyp continue; } - BoundGenerator generator = new BoundGenerator(argType, CreateGenerator(argType, generatorFactory)); + BoundGenerator generator = new BoundGenerator(argType, CreateGenerator(argType, generatorResolver)); signatureMarshallers.Add(generator); if (argType.IsManagedReturnPosition) @@ -84,11 +84,11 @@ public static BoundGenerators Create(ImmutableArray elementTyp }; } - IMarshallingGeneratorFactory exceptionHandlerFactory = new ExtendedInvariantsValidator(nativeReturnMarshaller.Generator.AsNativeType(nativeReturnMarshaller.TypeInfo), generatorFactory); + IMarshallingGeneratorResolver exceptionHandlerFactory = new ExtendedInvariantsValidator(nativeReturnMarshaller.Generator.AsNativeType(nativeReturnMarshaller.TypeInfo), generatorResolver); // We explicitly don't include exceptionMarshaller in the signatureMarshallers collection // as it needs to be specially emitted. - managedExceptionMarshaller = new(managedExceptionInfo, CreateGenerator(managedExceptionInfo, generatorFactory)); + managedExceptionMarshaller = new(managedExceptionInfo, CreateGenerator(managedExceptionInfo, generatorResolver)); } generatorBindingDiagnostics = generatorDiagnostics.ToImmutable(); @@ -153,11 +153,11 @@ public static BoundGenerators Create(ImmutableArray elementTyp return (false, info.NativeIndex); } - IMarshallingGenerator CreateGenerator(TypePositionInfo p, IMarshallingGeneratorFactory factory) + IMarshallingGenerator CreateGenerator(TypePositionInfo p, IMarshallingGeneratorResolver factory) { ResolvedGenerator generator = factory.Create(p, context); generatorDiagnostics.AddRange(generator.Diagnostics); - return generator.ResolvedSuccessfully ? generator.Generator : fallbackGenerator; + return generator.IsResolvedWithoutErrors ? generator.Generator : fallbackGenerator; } } @@ -192,12 +192,12 @@ IMarshallingGenerator CreateGenerator(TypePositionInfo p, IMarshallingGeneratorF public bool HasManagedExceptionMarshaller => ManagedExceptionMarshaller.Generator is not Forwarder; - private sealed class ExtendedInvariantsValidator : IMarshallingGeneratorFactory + private sealed class ExtendedInvariantsValidator : IMarshallingGeneratorResolver { private readonly ManagedTypeInfo _nativeReturnType; - private readonly IMarshallingGeneratorFactory _inner; + private readonly IMarshallingGeneratorResolver _inner; - public ExtendedInvariantsValidator(ManagedTypeInfo nativeReturnType, IMarshallingGeneratorFactory inner) + public ExtendedInvariantsValidator(ManagedTypeInfo nativeReturnType, IMarshallingGeneratorResolver inner) { _nativeReturnType = nativeReturnType; _inner = inner; @@ -206,7 +206,7 @@ public ExtendedInvariantsValidator(ManagedTypeInfo nativeReturnType, IMarshallin public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) { ResolvedGenerator generator = _inner.Create(info, context); - if (!generator.ResolvedSuccessfully) + if (!generator.IsResolvedWithoutErrors) { return generator; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/DefaultMarshallingInfoParser.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/DefaultMarshallingInfoParser.cs similarity index 69% rename from src/libraries/System.Runtime.InteropServices/gen/Common/DefaultMarshallingInfoParser.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/DefaultMarshallingInfoParser.cs index 83da7a8ff4db8..7a587c58d8083 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/DefaultMarshallingInfoParser.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/DefaultMarshallingInfoParser.cs @@ -6,11 +6,31 @@ namespace Microsoft.Interop { - internal static class DefaultMarshallingInfoParser + /// + /// Factory class for creating a instance that can parse marshalling information supported by .NET interop source generators. + /// + public static class DefaultMarshallingInfoParser { + /// + /// Creates a instance for parsing marshalling information from attributes + /// with support for the marshalling support that is common to all SDK-provided source generators. + /// + /// + /// Includes support for: + /// + /// System.Runtime.InteropServices.MarshalAsAttribute + /// System.Runtime.InteropServices.Marshalling.MarshalUsingAttribute + /// System.Runtime.InteropServices.Marshallling.NativeMarshallingAttribute-attributed types + /// System.Runtime.InteropServices.Marshalling.GeneratedComInterfaceAttribute-attributed types + /// System.Runtime.InteropServices.SafeHandle-derived types + /// Arrays + /// System.String + /// Primitive types + /// User-defined unmanaged types. + /// + /// public static MarshallingInfoParser Create(StubEnvironment env, GeneratorDiagnosticsBag diagnostics, IMethodSymbol method, InteropAttributeCompilationData interopAttributeData, AttributeData unparsedAttributeData) { - // Compute the current default string encoding value. CharEncoding defaultEncoding = CharEncoding.Undefined; if (interopAttributeData.IsUserDefined.HasFlag(InteropAttributeMember.StringMarshalling)) diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorResolver.cs similarity index 95% rename from src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorResolver.cs index 69180eca11c19..3aeb0c282dc24 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorResolver.cs @@ -12,9 +12,14 @@ namespace Microsoft.Interop { - public readonly record struct AttributedMarshallingModelOptions(bool RuntimeMarshallingDisabled, MarshalMode ManagedToUnmanagedMode, MarshalMode BidirectionalMode, MarshalMode UnmanagedToManagedMode); - - public class AttributedMarshallingModelGeneratorFactory : IMarshallingGeneratorFactory + public readonly record struct AttributedMarshallingModelOptions( + bool RuntimeMarshallingDisabled, + MarshalMode ManagedToUnmanagedMode, + MarshalMode BidirectionalMode, + MarshalMode UnmanagedToManagedMode, + bool ResolveElementsFromSelf); + + public class AttributedMarshallingModelGeneratorResolver : IMarshallingGeneratorResolver { private static readonly ImmutableDictionary AddDisableRuntimeMarshallingAttributeProperties = ImmutableDictionary.Empty.Add(GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute, GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute); @@ -22,28 +27,18 @@ public class AttributedMarshallingModelGeneratorFactory : IMarshallingGeneratorF private static readonly BlittableMarshaller s_blittable = new BlittableMarshaller(); private static readonly Forwarder s_forwarder = new Forwarder(); - private readonly IMarshallingGeneratorFactory _innerMarshallingGenerator; - private readonly IMarshallingGeneratorFactory _elementMarshallingGenerator; + private readonly IMarshallingGeneratorResolver _elementGeneratorResolver; - public AttributedMarshallingModelGeneratorFactory( - IMarshallingGeneratorFactory innerMarshallingGenerator, + public AttributedMarshallingModelGeneratorResolver( + IMarshallingGeneratorResolver elementGeneratorResolver, AttributedMarshallingModelOptions options) { Options = options; - _innerMarshallingGenerator = innerMarshallingGenerator; - // Unless overridden, default to using this generator factory for creating generators for collection elements. - _elementMarshallingGenerator = this; - } - - public AttributedMarshallingModelGeneratorFactory( - IMarshallingGeneratorFactory innerMarshallingGenerator, - IMarshallingGeneratorFactory elementMarshallingGenerator, - AttributedMarshallingModelOptions options) - { - Options = options; - _innerMarshallingGenerator = innerMarshallingGenerator; - - _elementMarshallingGenerator = elementMarshallingGenerator; + _elementGeneratorResolver = elementGeneratorResolver; + if (options.ResolveElementsFromSelf) + { + _elementGeneratorResolver = new CompositeMarshallingGeneratorResolver(this, _elementGeneratorResolver); + } } private AttributedMarshallingModelOptions Options { get; } @@ -75,7 +70,7 @@ public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) return ResolvedGenerator.Resolved(s_forwarder); } - return _innerMarshallingGenerator.Create(info, context); + return ResolvedGenerator.UnresolvedGenerator; } private record struct ExpressionOrNotSupported(ExpressionSyntax? Expression, GeneratorDiagnostic.NotSupported? NotSupported) @@ -316,11 +311,11 @@ private ResolvedGenerator CreateNativeCollectionMarshaller( ManagedIndex = info.ManagedIndex, RefKind = CreateElementRefKind(info.RefKind, info.ByValueContentsMarshalKind) }; - ResolvedGenerator resolvedElementMarshaller = _elementMarshallingGenerator.Create( + ResolvedGenerator resolvedElementMarshaller = _elementGeneratorResolver.Create( elementInfo, new LinearCollectionElementMarshallingCodeContext(StubCodeContext.Stage.Setup, string.Empty, string.Empty, context)); - if (!resolvedElementMarshaller.ResolvedSuccessfully) + if (!resolvedElementMarshaller.IsResolvedWithoutErrors) { return resolvedElementMarshaller; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs index 43f6e850d9a4b..f17a2b013bbd0 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs @@ -9,15 +9,15 @@ namespace Microsoft.Interop { /// - /// An that adds diagnostics to warn users about breaking changes in the interop generators, + /// An that adds diagnostics to warn users about breaking changes in the interop generators, /// whether from built-in to source-generated interop or between versions of interop source-generation. /// - public sealed class BreakingChangeDetector(IMarshallingGeneratorFactory inner) : IMarshallingGeneratorFactory + public sealed class BreakingChangeDetector(IMarshallingGeneratorResolver inner) : IMarshallingGeneratorResolver { public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) { ResolvedGenerator gen = inner.Create(info, context); - if (!gen.ResolvedSuccessfully) + if (!gen.IsResolvedWithoutErrors) { return gen; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ByValueContentsMarshalKindValidator.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ByValueContentsMarshalKindValidator.cs index dd7a40fb8c90e..9878cbdbc58ab 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ByValueContentsMarshalKindValidator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ByValueContentsMarshalKindValidator.cs @@ -6,15 +6,15 @@ namespace Microsoft.Interop { /// - /// An implementation that wraps an inner instance and validates that the on the provided is valid in the current marshalling scenario. + /// An implementation that wraps an inner instance and validates that the on the provided is valid in the current marshalling scenario. /// - public class ByValueContentsMarshalKindValidator : IMarshallingGeneratorFactory + public sealed class ByValueContentsMarshalKindValidator : IMarshallingGeneratorResolver { private static readonly Forwarder s_forwarder = new(); - private readonly IMarshallingGeneratorFactory _inner; + private readonly IMarshallingGeneratorResolver _inner; - public ByValueContentsMarshalKindValidator(IMarshallingGeneratorFactory inner) + public ByValueContentsMarshalKindValidator(IMarshallingGeneratorResolver inner) { _inner = inner; } @@ -22,7 +22,7 @@ public ByValueContentsMarshalKindValidator(IMarshallingGeneratorFactory inner) public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) { ResolvedGenerator generator = _inner.Create(info, context); - return generator.ResolvedSuccessfully ? ValidateByValueMarshalKind(info, context, generator) : generator; + return generator.IsResolvedWithoutErrors ? ValidateByValueMarshalKind(info, context, generator) : generator; } private static ResolvedGenerator ValidateByValueMarshalKind(TypePositionInfo info, StubCodeContext context, ResolvedGenerator generator) diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorResolver.cs similarity index 89% rename from src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorResolver.cs index 1b40fc13da59a..303f4a40a4c52 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorResolver.cs @@ -7,18 +7,16 @@ namespace Microsoft.Interop { - public sealed class CharMarshallingGeneratorFactory : IMarshallingGeneratorFactory + public sealed class CharMarshallingGeneratorResolver : IMarshallingGeneratorResolver { private static readonly IMarshallingGenerator s_blittable = new BlittableMarshaller(); private static readonly IMarshallingGenerator s_utf16Char = new Utf16CharMarshaller(); - private readonly IMarshallingGeneratorFactory _inner; private readonly bool _useBlittableMarshallerForUtf16; private readonly string _stringMarshallingAttribute; - public CharMarshallingGeneratorFactory(IMarshallingGeneratorFactory inner, bool useBlittableMarshallerForUtf16, string stringMarshallingAttribute) + public CharMarshallingGeneratorResolver(bool useBlittableMarshallerForUtf16, string stringMarshallingAttribute) { - _inner = inner; _useBlittableMarshallerForUtf16 = useBlittableMarshallerForUtf16; _stringMarshallingAttribute = stringMarshallingAttribute; } @@ -30,7 +28,7 @@ public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) return CreateCharMarshaller(info, context); } - return _inner.Create(info, context); + return ResolvedGenerator.UnresolvedGenerator; } private ResolvedGenerator CreateCharMarshaller(TypePositionInfo info, StubCodeContext context) diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CompositeMarshallingGeneratorResolver.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CompositeMarshallingGeneratorResolver.cs new file mode 100644 index 0000000000000..649e9cbed9875 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CompositeMarshallingGeneratorResolver.cs @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; + +namespace Microsoft.Interop +{ + /// + /// A resolver that will try each of the supplied resolvers in order until one returns a resolved generator. + /// This resolver will return the first resolved generator, even if the generator is resolved with errors. + /// + /// The list of resolvers to try in order. + public sealed class CompositeMarshallingGeneratorResolver(IEnumerable resolvers) : IMarshallingGeneratorResolver + { + /// + /// A resolver that will try each of the supplied resolvers in order until one returns a resolved generator. + /// This resolver will return the first resolved generator, even if the generator is resolved with errors. + /// + /// The list of resolvers to try in order. + public CompositeMarshallingGeneratorResolver(params IMarshallingGeneratorResolver[] resolvers) + : this((IEnumerable)resolvers) + { + } + + /// + public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) + { + foreach (IMarshallingGeneratorResolver resolver in resolvers) + { + ResolvedGenerator generator = resolver.Create(info, context); + if (generator.IsResolved) + { + return generator; + } + } + return ResolvedGenerator.UnresolvedGenerator; + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/DefaultMarshallingGeneratorResolver.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/DefaultMarshallingGeneratorResolver.cs new file mode 100644 index 0000000000000..005e9b79ed2b5 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/DefaultMarshallingGeneratorResolver.cs @@ -0,0 +1,82 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; + +namespace Microsoft.Interop +{ + /// + /// Default resolver for marshalling generators. + /// + public static class DefaultMarshallingGeneratorResolver + { + /// + /// Creates a marshalling generator resolver with support for all marshalling information generated by . + /// + /// Flags about the compilation environment for emitted code. + /// The direction of marshalling. + /// The name of the attribute type where the marshalling data is specified by the user. + /// Additional resolvers for resolving generators for any custom marshalling information. + /// A marshalling generator with support for marshalling types supported by as well as any types supported by the additional resolvers. + public static IMarshallingGeneratorResolver Create( + EnvironmentFlags env, + MarshalDirection direction, + string stringMarshallingAttribute, + IEnumerable additionalResolvers) + { + IMarshallingGeneratorResolver fallbackResolver = new NotSupportedResolver(); + List coreResolvers = [ + .. additionalResolvers, + new MarshalAsMarshallingGeneratorResolver(new InteropGenerationOptions(UseMarshalType: true)), + new NoMarshallingInfoErrorResolver(TypeNames.GeneratedComInterfaceAttribute_ShortName), + ]; + + // Since the char type in an array will not be part of the P/Invoke signature, we can + // use the regular blittable marshaller in all cases. + var charElementMarshaller = new CharMarshallingGeneratorResolver(useBlittableMarshallerForUtf16: true, stringMarshallingAttribute); + + IMarshallingGeneratorResolver elementFactory = new AttributedMarshallingModelGeneratorResolver( + new CompositeMarshallingGeneratorResolver([ + .. coreResolvers, + // Since the char type in an array will not be part of the P/Invoke signature, we can + // use the regular blittable marshaller in all cases. + charElementMarshaller, + fallbackResolver, + ]), + new AttributedMarshallingModelOptions( + env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), + MarshalMode.ElementIn, + MarshalMode.ElementRef, + MarshalMode.ElementOut, + ResolveElementsFromSelf: true)); + + IMarshallingGeneratorResolver generatorResolver = new ByValueContentsMarshalKindValidator( + new CompositeMarshallingGeneratorResolver( + [ + .. coreResolvers, + new AttributedMarshallingModelGeneratorResolver( + new CompositeMarshallingGeneratorResolver( + [elementFactory, .. coreResolvers, charElementMarshaller, fallbackResolver]), + new AttributedMarshallingModelOptions( + env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), + direction == MarshalDirection.ManagedToUnmanaged + ? MarshalMode.ManagedToUnmanagedIn + : MarshalMode.UnmanagedToManagedOut, + direction == MarshalDirection.ManagedToUnmanaged + ? MarshalMode.ManagedToUnmanagedRef + : MarshalMode.UnmanagedToManagedRef, + direction == MarshalDirection.ManagedToUnmanaged + ? MarshalMode.ManagedToUnmanagedOut + : MarshalMode.UnmanagedToManagedIn, + ResolveElementsFromSelf: false)), + // Since the char type can go into the P/Invoke signature here, we can only use it when + // runtime marshalling is disabled. + new CharMarshallingGeneratorResolver(useBlittableMarshallerForUtf16: env.HasFlag(EnvironmentFlags.DisableRuntimeMarshalling), stringMarshallingAttribute), + fallbackResolver + ])); + generatorResolver = new BreakingChangeDetector(generatorResolver); + + return generatorResolver; + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/IMarshallingGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/IMarshallingGeneratorResolver.cs similarity index 93% rename from src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/IMarshallingGeneratorFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/IMarshallingGeneratorResolver.cs index 53e6b5d7c05a1..1a66935fda9bb 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/IMarshallingGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/IMarshallingGeneratorResolver.cs @@ -5,7 +5,7 @@ namespace Microsoft.Interop { - public interface IMarshallingGeneratorFactory + public interface IMarshallingGeneratorResolver { /// /// Create an instance for marshalling the supplied type in the given position and collect any diagnostics from generator resolution. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshalAsMarshallingGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshalAsMarshallingGeneratorResolver.cs similarity index 94% rename from src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshalAsMarshallingGeneratorFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshalAsMarshallingGeneratorResolver.cs index a79f14c02ed12..f8c1efdb71860 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshalAsMarshallingGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshalAsMarshallingGeneratorResolver.cs @@ -7,7 +7,7 @@ namespace Microsoft.Interop { - public sealed class MarshalAsMarshallingGeneratorFactory : IMarshallingGeneratorFactory + public sealed class MarshalAsMarshallingGeneratorResolver : IMarshallingGeneratorResolver { private static readonly ByteBoolMarshaller s_byteBool = new(signed: false); private static readonly ByteBoolMarshaller s_signed_byteBool = new(signed: true); @@ -19,12 +19,10 @@ public sealed class MarshalAsMarshallingGeneratorFactory : IMarshallingGenerator private static readonly BlittableMarshaller s_blittable = new(); private static readonly DelegateMarshaller s_delegate = new(); private InteropGenerationOptions Options { get; } - private IMarshallingGeneratorFactory InnerFactory { get; } - public MarshalAsMarshallingGeneratorFactory(InteropGenerationOptions options, IMarshallingGeneratorFactory inner) + public MarshalAsMarshallingGeneratorResolver(InteropGenerationOptions options) { Options = options; - InnerFactory = inner; } /// @@ -94,7 +92,7 @@ public ResolvedGenerator Create( return ResolvedGenerator.Resolved(s_forwarder); default: - return InnerFactory.Create(info, context); + return ResolvedGenerator.UnresolvedGenerator; } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NoMarshallingInfoErrorMarshallingFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NoMarshallingInfoErrorResolver.cs similarity index 70% rename from src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NoMarshallingInfoErrorMarshallingFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NoMarshallingInfoErrorResolver.cs index fd0ab1d1c706d..4b57fb6c9ce5c 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NoMarshallingInfoErrorMarshallingFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NoMarshallingInfoErrorResolver.cs @@ -9,10 +9,8 @@ namespace Microsoft.Interop { - public sealed class NoMarshallingInfoErrorMarshallingFactory : IMarshallingGeneratorFactory + public sealed class NoMarshallingInfoErrorResolver : IMarshallingGeneratorResolver { - private readonly IMarshallingGeneratorFactory _inner; - public ResolvedGenerator Create( TypePositionInfo info, StubCodeContext context) @@ -24,17 +22,16 @@ public ResolvedGenerator Create( NotSupportedDetails = errorMessage }); } - return _inner.Create(info, context); + return ResolvedGenerator.UnresolvedGenerator; } - public NoMarshallingInfoErrorMarshallingFactory(IMarshallingGeneratorFactory inner, string stringMarshallingAttribute) - : this(inner, DefaultTypeToErrorMessageMap(stringMarshallingAttribute)) + public NoMarshallingInfoErrorResolver(string stringMarshallingAttribute) + : this(DefaultTypeToErrorMessageMap(stringMarshallingAttribute)) { } - private NoMarshallingInfoErrorMarshallingFactory(IMarshallingGeneratorFactory inner, ImmutableDictionary customTypeToErrorMessageMap) + private NoMarshallingInfoErrorResolver(ImmutableDictionary customTypeToErrorMessageMap) { - _inner = inner; CustomTypeToErrorMessageMap = customTypeToErrorMessageMap; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/UnsupportedMarshallingFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NotSupportedResolver.cs similarity index 79% rename from src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/UnsupportedMarshallingFactory.cs rename to src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NotSupportedResolver.cs index 109c36a2e8ad3..9b3d5e308858b 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/UnsupportedMarshallingFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/NotSupportedResolver.cs @@ -3,7 +3,7 @@ namespace Microsoft.Interop { - public sealed class UnsupportedMarshallingFactory : IMarshallingGeneratorFactory + public sealed class NotSupportedResolver : IMarshallingGeneratorResolver { public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) => ResolvedGenerator.NotSupported(new(info, context)); diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ResolvedGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ResolvedGenerator.cs index b2fdeb39e63da..496a89e42853f 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ResolvedGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ResolvedGenerator.cs @@ -2,17 +2,20 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Microsoft.Interop { - public record struct ResolvedGenerator(IMarshallingGenerator Generator, ImmutableArray Diagnostics) + public record struct ResolvedGenerator([property: MemberNotNullWhen(true, nameof(ResolvedGenerator.IsResolved), nameof(ResolvedGenerator.IsResolvedWithoutErrors))] IMarshallingGenerator? Generator, ImmutableArray Diagnostics) { private static readonly Forwarder s_forwarder = new(); - private bool? _resolvedSuccessfully; + private bool? _resolvedWithoutErrors; - public bool ResolvedSuccessfully => _resolvedSuccessfully ??= Diagnostics.All(d => !d.IsFatal); + public bool IsResolvedWithoutErrors => _resolvedWithoutErrors ??= IsResolved && Diagnostics.All(d => !d.IsFatal); + + public readonly bool IsResolved => Generator is not null; public static ResolvedGenerator Resolved(IMarshallingGenerator generator) { @@ -28,5 +31,7 @@ public static ResolvedGenerator ResolvedWithDiagnostics(IMarshallingGenerator ge { return new(generator, diagnostics); } + + public static ResolvedGenerator UnresolvedGenerator { get; } = new(null, ImmutableArray.Empty); } }