From 36a49fa68045eb93ef1f4c56fabc0d54cecca974 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 7 Mar 2022 10:09:52 -0800 Subject: [PATCH 1/5] Rename GeneratedDllImportAttribute -> LibraryImportAttribute --- eng/generators.targets | 2 +- ...Attribute.cs => LibraryImportAttribute.cs} | 4 +- .../ILLink/ILLink.LinkAttributes.Shared.xml | 4 +- .../ConvertToLibraryImportAnalyzer.cs | 10 +- .../Analyzers/ConvertToLibraryImportFixer.cs | 8 +- .../LibraryImportGenerator.cs | 18 +- .../PInvokeStubCodeGenerator.cs | 4 +- .../Resources.Designer.cs | 166 +++++++++--------- .../gen/LibraryImportGenerator/Resources.resx | 62 +++---- .../MarshallingAttributeInfo.cs | 2 +- .../Resources.Designer.cs | 90 +++++----- .../Resources.resx | 56 +++--- .../TypeNames.cs | 2 +- .../Ancillary.Interop.csproj | 2 +- .../ArrayTests.cs | 38 ++-- .../BlittableStructTests.cs | 16 +- .../BooleanTests.cs | 36 ++-- .../CallingConventionTests.cs | 4 +- .../CharacterTests.cs | 16 +- .../CollectionTests.cs | 24 +-- .../CustomMarshallingTests.cs | 16 +- .../DelegateTests.cs | 4 +- .../LibraryImportGenerator.Tests/EnumTests.cs | 16 +- .../FunctionPointerTests.cs | 12 +- .../PointerTests.cs | 6 +- .../SafeHandleTests.cs | 12 +- .../SetLastErrorTests.cs | 6 +- .../LibraryImportGenerator.Tests/SpanTests.cs | 20 +-- .../StringTests.cs | 104 +++++------ .../AdditionalAttributesOnStub.cs | 18 +- .../AttributeForwarding.cs | 24 +-- .../CodeSnippets.cs | 162 ++++++++--------- .../CompileFails.cs | 2 +- .../Compiles.cs | 10 +- .../ConvertToLibraryImportAnalyzerTests.cs | 4 +- .../ConvertToLibraryImportFixerTests.cs | 58 +++--- .../Diagnostics.cs | 70 ++++---- .../IncrementalGenerationTests.cs | 4 +- .../TestUtils.cs | 6 +- .../LibraryImportGeneratorSample/Program.cs | 6 +- 40 files changed, 562 insertions(+), 562 deletions(-) rename src/libraries/Common/src/System/Runtime/InteropServices/{GeneratedDllImportAttribute.cs => LibraryImportAttribute.cs} (89%) diff --git a/eng/generators.targets b/eng/generators.targets index 7cd7b4ca935e2a..9ca826c5cc7599 100644 --- a/eng/generators.targets +++ b/eng/generators.targets @@ -44,7 +44,7 @@ - + diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs b/src/libraries/Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs similarity index 89% rename from src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs rename to src/libraries/Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs index 2dfd91adc655c2..0bacf3efad5d5f 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs @@ -17,14 +17,14 @@ namespace System.Runtime.InteropServices #else internal #endif - sealed class GeneratedDllImportAttribute : Attribute + sealed class LibraryImportAttribute : Attribute { public string? EntryPoint { get; set; } public bool SetLastError { get; set; } public StringMarshalling StringMarshalling { get; set; } public Type? StringMarshallingCustomType { get; set; } - public GeneratedDllImportAttribute(string dllName) + public LibraryImportAttribute(string dllName) { LibraryName = dllName; } diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml index efd2492becf342..3cf2bcb30e6475 100644 --- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml @@ -130,7 +130,7 @@ @@ -265,7 +265,7 @@ - + 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 1470c03a3736ee..5d2d29be347a9a 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs @@ -47,9 +47,9 @@ public override void Initialize(AnalysisContext context) context.RegisterCompilationStartAction( compilationContext => { - // Nothing to do if the GeneratedDllImportAttribute is not in the compilation - INamedTypeSymbol? generatedDllImportAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.GeneratedDllImportAttribute); - if (generatedDllImportAttrType == null) + // Nothing to do if the LibraryImportAttribute is not in the compilation + INamedTypeSymbol? libraryImportAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.LibraryImportAttribute); + if (libraryImportAttrType == null) return; INamedTypeSymbol? marshalAsAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_MarshalAsAttribute); @@ -77,11 +77,11 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, List ConvertMethodDeclarationToLibraryImport( return methodSyntax; // We wouldn't have offered this code fix if the LibraryImport type isn't available, so we can be sure it isn't null here. - INamedTypeSymbol generatedDllImportAttrType = editor.SemanticModel.Compilation.GetTypeByMetadataName(TypeNames.GeneratedDllImportAttribute)!; + INamedTypeSymbol libraryImportAttrType = editor.SemanticModel.Compilation.GetTypeByMetadataName(TypeNames.LibraryImportAttribute)!; // Make sure the method has the DllImportAttribute if (!TryGetAttribute(methodSymbol, dllImportAttrType, out AttributeData? dllImportAttr)) @@ -215,7 +215,7 @@ private static async Task ConvertMethodDeclarationToLibraryImport( generator, dllImportSyntax, methodSymbol, - generatedDllImportAttrType, + libraryImportAttrType, entryPointSuffix, out SyntaxNode? unmanagedCallConvAttributeMaybe); @@ -436,7 +436,7 @@ private static SyntaxNode GetLibraryImportAttribute( SyntaxGenerator generator, AttributeSyntax dllImportSyntax, IMethodSymbol methodSymbol, - INamedTypeSymbol generatedDllImportAttrType, + INamedTypeSymbol libraryImportAttrType, char? entryPointSuffix, out SyntaxNode? unmanagedCallConvAttributeMaybe) { @@ -448,7 +448,7 @@ private static SyntaxNode GetLibraryImportAttribute( // Create LibraryImport based on the DllImport attribute SyntaxNode libraryImportSyntax = generator.ReplaceNode(dllImportSyntax, dllImportSyntax.Name, - generator.TypeExpression(generatedDllImportAttrType)); + generator.TypeExpression(libraryImportAttrType)); // Update attribute arguments for LibraryImport bool hasEntryPointAttributeArgument = false; diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs index b5c9908ab25f28..1040ca2e450840 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs @@ -61,7 +61,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) { MethodDeclarationSyntax syntax = (MethodDeclarationSyntax)context.Node; if (context.SemanticModel.GetDeclaredSymbol(syntax, ct) is IMethodSymbol methodSymbol - && methodSymbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)) + && methodSymbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == TypeNames.LibraryImportAttribute)) { return new { Syntax = syntax, Symbol = methodSymbol }; } @@ -321,9 +321,9 @@ private static TargetFramework DetermineTargetFramework(Compilation compilation, }; } - private static LibraryImportData? ProcessGeneratedDllImportAttribute(AttributeData attrData) + private static LibraryImportData? ProcessLibraryImportAttribute(AttributeData attrData) { - // Found the GeneratedDllImport, but it has an error so report the error. + // Found the LibraryImport, but it has an error so report the error. // This is most likely an issue with targeting an incorrect TFM. if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error) { @@ -418,7 +418,7 @@ private static IncrementalStubGenerationContext CalculateStubInformation(IMethod foreach (AttributeData attr in symbol.GetAttributes()) { if (attr.AttributeClass is not null - && attr.AttributeClass.ToDisplayString() == TypeNames.GeneratedDllImportAttribute) + && attr.AttributeClass.ToDisplayString() == TypeNames.LibraryImportAttribute) { generatedDllImportAttr = attr; } @@ -444,8 +444,8 @@ private static IncrementalStubGenerationContext CalculateStubInformation(IMethod var generatorDiagnostics = new GeneratorDiagnostics(); - // Process the GeneratedDllImport attribute - LibraryImportData? libraryImportData = ProcessGeneratedDllImportAttribute(generatedDllImportAttr!); + // Process the LibraryImport attribute + LibraryImportData? libraryImportData = ProcessLibraryImportAttribute(generatedDllImportAttr!); if (libraryImportData is null) { @@ -472,7 +472,7 @@ private static IncrementalStubGenerationContext CalculateStubInformation(IMethod if (lcidConversionAttr is not null) { - // Using LCIDConversion with GeneratedDllImport is not supported + // Using LCIDConversion with LibraryImport is not supported generatorDiagnostics.ReportConfigurationNotSupported(lcidConversionAttr, nameof(TypeNames.LCIDConversionAttribute)); } @@ -552,7 +552,7 @@ private static MemberDeclarationSyntax PrintForwarderStub(MethodDeclarationSynta { diagnostics.ReportCannotForwardToDllImport( userDeclaredMethod, - $"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}", + $"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{pinvokeData.StringMarshalling}"); pinvokeData = pinvokeData with { IsUserDefined = pinvokeData.IsUserDefined & ~LibraryImportMember.StringMarshalling }; @@ -562,7 +562,7 @@ private static MemberDeclarationSyntax PrintForwarderStub(MethodDeclarationSynta { diagnostics.ReportCannotForwardToDllImport( userDeclaredMethod, - $"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(LibraryImportMember.StringMarshallingCustomType)}"); + $"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(LibraryImportMember.StringMarshallingCustomType)}"); pinvokeData = pinvokeData with { IsUserDefined = pinvokeData.IsUserDefined & ~LibraryImportMember.StringMarshallingCustomType }; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs index 5da6deb9cc8375..65920dc750d820 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs @@ -19,7 +19,7 @@ namespace Microsoft.Interop /// This type enables multiple code generators for P/Invoke-style marshalling /// to reuse the same basic method body, but with different designs of how to emit the target native method. /// This enables users to write code generators that work with slightly different semantics. - /// For example, the source generator for [GeneratedDllImport] emits the target P/Invoke as + /// For example, the source generator for [LibraryImport] emits the target P/Invoke as /// a local function inside the generated stub body. /// However, other managed-to-native code generators using a P/Invoke style might want to define /// the target DllImport outside of the stub as a static non-local function or as a function pointer field. @@ -143,7 +143,7 @@ public PInvokeStubCodeGenerator( // for our lengths. // Here's an example signature where the dependency shows up: // - // [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")] + // [LibraryImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")] // [return: MarshalUsing(CountElementName = "numColumns")] // [return: MarshalUsing(CountElementName = "numRows", ElementIndirectionLevel = 1)] // public static partial int[][] TransposeMatrix( diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.Designer.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.Designer.cs index 51bca2e3e37970..fcad506c63500c 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.Designer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace Microsoft.Interop { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Microsoft.Interop { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ internal Resources() { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ internal Resources() { resourceCulture = value; } } - + /// /// Looks up a localized string similar to A type marked with 'BlittableTypeAttribute' must be blittable.. /// @@ -68,7 +68,7 @@ internal static string BlittableTypeMustBeBlittableDescription { return ResourceManager.GetString("BlittableTypeMustBeBlittableDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' but is not blittable. /// @@ -77,7 +77,7 @@ internal static string BlittableTypeMustBeBlittableMessage { return ResourceManager.GetString("BlittableTypeMustBeBlittableMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to When a constructor taking a Span<byte> is specified on the native type, the type must also have a public integer constant named BufferSize to provide the size of the caller-allocated buffer.. /// @@ -86,7 +86,7 @@ internal static string CallerAllocConstructorMustHaveBufferSizeConstantDescripti return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must have a 'public const int BufferSize' field that specifies the size of the stack buffer because it has a constructor that takes a caller-allocated Span<byte>. /// @@ -95,7 +95,7 @@ internal static string CallerAllocConstructorMustHaveBufferSizeConstantMessage { return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to A type that supports marshalling from managed to native using a caller-allocated buffer should also support marshalling from managed to native where using a caller-allocated buffer is impossible.. /// @@ -104,7 +104,7 @@ internal static string CallerAllocMarshallingShouldSupportAllocatingMarshallingF return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to Native type '{0}' has a constructor taking a caller-allocated buffer, but does not support marshalling in scenarios where using a caller-allocated buffer is impossible. /// @@ -113,7 +113,7 @@ internal static string CallerAllocMarshallingShouldSupportAllocatingMarshallingF return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The generated 'DllImportAttribute' will not have a value corresponding to '{0}'.. /// @@ -122,7 +122,7 @@ internal static string CannotForwardToDllImportDescription { return ResourceManager.GetString("CannotForwardToDllImportDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to '{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded. /// @@ -131,16 +131,16 @@ internal static string CannotForwardToDllImportMessage { return ResourceManager.GetString("CannotForwardToDllImportMessage", resourceCulture); } } - + /// - /// Looks up a localized string similar to Specified 'GeneratedDllImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'. + /// Looks up a localized string similar to Specified 'LibraryImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'. /// internal static string CannotForwardToDllImportTitle { get { return ResourceManager.GetString("CannotForwardToDllImportTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.. /// @@ -149,7 +149,7 @@ internal static string CannotHaveMultipleMarshallingAttributesDescription { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' and 'NativeMarshallingAttribute'. A type can only have one of these two attributes.. /// @@ -158,7 +158,7 @@ internal static string CannotHaveMultipleMarshallingAttributesMessage { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to A native type with the 'GenericContiguousCollectionMarshallerAttribute' must have at least one of the two marshalling methods as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>' to enable marshalling the managed type.. /// @@ -167,7 +167,7 @@ internal static string CollectionNativeTypeMustHaveRequiredShapeDescription { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes two parameters, one of type '{1}' and an 'int', or have a parameterless instance method named 'ToManaged' that returns '{1}' as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>'. /// @@ -176,7 +176,7 @@ internal static string CollectionNativeTypeMustHaveRequiredShapeMessage { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Source-generated P/Invokes will ignore any configuration that is not supported.. /// @@ -185,7 +185,7 @@ internal static string ConfigurationNotSupportedDescription { return ResourceManager.GetString("ConfigurationNotSupportedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' configuration is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead.. /// @@ -194,7 +194,7 @@ internal static string ConfigurationNotSupportedMessage { return ResourceManager.GetString("ConfigurationNotSupportedMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified marshalling configuration is not supported by source-generated P/Invokes. {0}.. /// @@ -203,7 +203,7 @@ internal static string ConfigurationNotSupportedMessageMarshallingInfo { return ResourceManager.GetString("ConfigurationNotSupportedMessageMarshallingInfo", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified '{0}' configuration for parameter '{1}' is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead.. /// @@ -212,7 +212,7 @@ internal static string ConfigurationNotSupportedMessageParameter { return ResourceManager.GetString("ConfigurationNotSupportedMessageParameter", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified '{0}' configuration for the return value of method '{1}' is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead.. /// @@ -221,7 +221,7 @@ internal static string ConfigurationNotSupportedMessageReturn { return ResourceManager.GetString("ConfigurationNotSupportedMessageReturn", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified value '{0}' for '{1}' is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead.. /// @@ -230,7 +230,7 @@ internal static string ConfigurationNotSupportedMessageValue { return ResourceManager.GetString("ConfigurationNotSupportedMessageValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified configuration is not supported by source-generated P/Invokes.. /// @@ -239,7 +239,7 @@ internal static string ConfigurationNotSupportedTitle { return ResourceManager.GetString("ConfigurationNotSupportedTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to Only one of 'ConstantElementCount' or 'ElementCountInfo' may be used in a 'MarshalUsingAttribute' for a given 'ElementIndirectionLevel'. /// @@ -248,7 +248,7 @@ internal static string ConstantAndElementCountInfoDisallowed { return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture); } } - + /// /// Looks up a localized string similar to Automatically converting a P/Invoke with 'PreserveSig' set to 'false' to a source-generated P/Invoke may produce invalid code. /// @@ -257,7 +257,7 @@ internal static string ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalid return ResourceManager.GetString("ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode", resourceCulture); } } - + /// /// Looks up a localized string similar to Convert to 'LibraryImport'. /// @@ -266,7 +266,7 @@ internal static string ConvertToLibraryImport { return ResourceManager.GetString("ConvertToLibraryImport", resourceCulture); } } - + /// /// Looks up a localized string similar to Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time. /// @@ -275,7 +275,7 @@ internal static string ConvertToLibraryImportDescription { return ResourceManager.GetString("ConvertToLibraryImportDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to Mark the method '{0}' with 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time. /// @@ -284,7 +284,7 @@ internal static string ConvertToLibraryImportMessage { return ResourceManager.GetString("ConvertToLibraryImportMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time. /// @@ -293,7 +293,7 @@ internal static string ConvertToLibraryImportTitle { return ResourceManager.GetString("ConvertToLibraryImportTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to Conversion to 'LibraryImport' may change behavior and compatibility. See {0} for more information.. /// @@ -302,7 +302,7 @@ internal static string ConvertToLibraryImportWarning { return ResourceManager.GetString("ConvertToLibraryImportWarning", resourceCulture); } } - + /// /// Looks up a localized string similar to Convert to 'LibraryImport' with '{0}' suffix. /// @@ -311,7 +311,7 @@ internal static string ConvertToLibraryImportWithSuffix { return ResourceManager.GetString("ConvertToLibraryImportWithSuffix", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified parameter needs to be marshalled from managed to native, but the native type '{0}' does not support it.. /// @@ -320,7 +320,7 @@ internal static string CustomTypeMarshallingManagedToNativeUnsupported { return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified parameter needs to be marshalled from native to managed, but the native type '{0}' does not support it.. /// @@ -329,7 +329,7 @@ internal static string CustomTypeMarshallingNativeToManagedUnsupported { return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The return type of 'GetPinnableReference' (after accounting for 'ref') must be blittable.. /// @@ -338,7 +338,7 @@ internal static string GetPinnableReferenceReturnTypeBlittableDescription { return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The dereferenced type of the return type of the 'GetPinnableReference' method must be blittable. /// @@ -347,7 +347,7 @@ internal static string GetPinnableReferenceReturnTypeBlittableMessage { return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to A type that supports marshalling from managed to native by pinning should also support marshalling from managed to native where pinning is impossible.. /// @@ -356,7 +356,7 @@ internal static string GetPinnableReferenceShouldSupportAllocatingMarshallingFal return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to Type '{0}' has a 'GetPinnableReference' method but its native type does not support marshalling in scenarios where pinning is impossible. /// @@ -365,7 +365,7 @@ internal static string GetPinnableReferenceShouldSupportAllocatingMarshallingFal return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Method '{0}' is contained in a type '{1}' that is not marked 'partial'. P/Invoke source generation will ignore method '{0}'.. /// @@ -374,25 +374,25 @@ internal static string InvalidAttributedMethodContainingTypeMissingModifiersMess return ResourceManager.GetString("InvalidAttributedMethodContainingTypeMissingModifiersMessage", resourceCulture); } } - + /// - /// Looks up a localized string similar to Methods marked with 'GeneratedDllImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic.. + /// Looks up a localized string similar to Methods marked with 'LibraryImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic.. /// internal static string InvalidAttributedMethodDescription { get { return ResourceManager.GetString("InvalidAttributedMethodDescription", resourceCulture); } } - + /// - /// Looks up a localized string similar to Method '{0}' should be 'static', 'partial', and non-generic when marked with 'GeneratedDllImportAttribute'. P/Invoke source generation will ignore method '{0}'.. + /// Looks up a localized string similar to Method '{0}' should be 'static', 'partial', and non-generic when marked with 'LibraryImportAttribute'. P/Invoke source generation will ignore method '{0}'.. /// internal static string InvalidAttributedMethodSignatureMessage { get { return ResourceManager.GetString("InvalidAttributedMethodSignatureMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid 'LibraryImportAttribute' usage. /// @@ -401,7 +401,7 @@ internal static string InvalidLibraryImportAttributeUsageTitle { return ResourceManager.GetString("InvalidLibraryImportAttributeUsageTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to The configuration of 'StringMarshalling' and 'StringMarshallingCustomType' is invalid.. /// @@ -410,7 +410,7 @@ internal static string InvalidStringMarshallingConfigurationDescription { return ResourceManager.GetString("InvalidStringMarshallingConfigurationDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The configuration of 'StringMarshalling' and 'StringMarshallingCustomType' on method '{0}' is invalid. {1}. /// @@ -419,7 +419,7 @@ internal static string InvalidStringMarshallingConfigurationMessage { return ResourceManager.GetString("InvalidStringMarshallingConfigurationMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to 'StringMarshallingCustomType' must be specified when 'StringMarshalling' is set to 'StringMarshalling.Custom'.. /// @@ -428,7 +428,7 @@ internal static string InvalidStringMarshallingConfigurationMissingCustomType { return ResourceManager.GetString("InvalidStringMarshallingConfigurationMissingCustomType", resourceCulture); } } - + /// /// Looks up a localized string similar to 'StringMarshalling' should be set to 'StringMarshalling.Custom' when 'StringMarshallingCustomType' is specified.. /// @@ -437,7 +437,7 @@ internal static string InvalidStringMarshallingConfigurationNotCustom { return ResourceManager.GetString("InvalidStringMarshallingConfigurationNotCustom", resourceCulture); } } - + /// /// Looks up a localized string similar to The use cases for 'GetPinnableReference' are not applicable in any scenarios where a 'Value' property is not also required.. /// @@ -446,7 +446,7 @@ internal static string MarshallerGetPinnableReferenceRequiresValuePropertyDescri return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'GetPinnableReference' method cannot be provided on the native type '{0}' unless a 'Value' property is also provided. /// @@ -455,7 +455,7 @@ internal static string MarshallerGetPinnableReferenceRequiresValuePropertyMessag return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be a closed generic so the emitted code can use a specific instantiation.. /// @@ -464,7 +464,7 @@ internal static string NativeGenericTypeMustBeClosedDescription { return ResourceManager.GetString("NativeGenericTypeMustBeClosedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be a closed generic or have the same number of generic parameters as the managed type so the emitted code can use a specific instantiation.. /// @@ -473,7 +473,7 @@ internal static string NativeGenericTypeMustBeClosedOrMatchArityDescription { return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' for managed type '{1}' must be a closed generic type or have the same arity as the managed type.. /// @@ -482,7 +482,7 @@ internal static string NativeGenericTypeMustBeClosedOrMatchArityMessage { return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to A native type for a given type must be blittable.. /// @@ -491,7 +491,7 @@ internal static string NativeTypeMustBeBlittableDescription { return ResourceManager.GetString("NativeTypeMustBeBlittableDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' for the type '{1}' is not blittable. /// @@ -500,7 +500,7 @@ internal static string NativeTypeMustBeBlittableMessage { return ResourceManager.GetString("NativeTypeMustBeBlittableMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to A native type for a given type must be non-null.. /// @@ -509,7 +509,7 @@ internal static string NativeTypeMustBeNonNullDescription { return ResourceManager.GetString("NativeTypeMustBeNonNullDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type for the type '{0}' is null. /// @@ -518,7 +518,7 @@ internal static string NativeTypeMustBeNonNullMessage { return ResourceManager.GetString("NativeTypeMustBeNonNullMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type must be pointer sized so the pinned result of 'GetPinnableReference' can be cast to the native type.. /// @@ -527,7 +527,7 @@ internal static string NativeTypeMustBePointerSizedDescription { return ResourceManager.GetString("NativeTypeMustBePointerSizedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be pointer sized because the managed type '{1}' has a 'GetPinnableReference' method. /// @@ -536,7 +536,7 @@ internal static string NativeTypeMustBePointerSizedMessage { return ResourceManager.GetString("NativeTypeMustBePointerSizedMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type must have at least one of the two marshalling methods to enable marshalling the managed type.. /// @@ -545,7 +545,7 @@ internal static string NativeTypeMustHaveRequiredShapeDescription { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes one parameter of type '{1}' or a parameterless instance method named 'ToManaged' that returns '{1}'. /// @@ -554,7 +554,7 @@ internal static string NativeTypeMustHaveRequiredShapeMessage { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property must not be a 'ref' or 'readonly ref' property.. /// @@ -563,7 +563,7 @@ internal static string RefValuePropertyUnsupportedDescription { return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must not be a 'ref' or 'readonly ref' property.. /// @@ -572,7 +572,7 @@ internal static string RefValuePropertyUnsupportedMessage { return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to . /// @@ -581,7 +581,7 @@ internal static string RuntimeMarshallingMustBeDisabled { return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture); } } - + /// /// Looks up a localized string similar to An abstract type derived from 'SafeHandle' cannot be marshalled by reference. The provided type must be concrete.. /// @@ -590,7 +590,7 @@ internal static string SafeHandleByRefMustBeConcrete { return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture); } } - + /// /// Looks up a localized string similar to P/Invoke source generation is not supported on unknown target framework v{0}. The generated source will not be compatible with other frameworks.. /// @@ -599,16 +599,16 @@ internal static string TargetFrameworkNotSupportedDescription { return ResourceManager.GetString("TargetFrameworkNotSupportedDescription", resourceCulture); } } - + /// - /// Looks up a localized string similar to 'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.. + /// Looks up a localized string similar to 'LibraryImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.. /// internal static string TargetFrameworkNotSupportedMessage { get { return ResourceManager.GetString("TargetFrameworkNotSupportedMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Current target framework is not supported by source-generated P/Invokes. /// @@ -617,7 +617,7 @@ internal static string TargetFrameworkNotSupportedTitle { return ResourceManager.GetString("TargetFrameworkNotSupportedTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to For types that are not supported by source-generated P/Invokes, the resulting P/Invoke will rely on the underlying runtime to marshal the specified type.. /// @@ -626,7 +626,7 @@ internal static string TypeNotSupportedDescription { return ResourceManager.GetString("TypeNotSupportedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The type '{0}' is not supported by source-generated P/Invokes. The generated source will not handle marshalling of parameter '{1}'.. /// @@ -635,7 +635,7 @@ internal static string TypeNotSupportedMessageParameter { return ResourceManager.GetString("TypeNotSupportedMessageParameter", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} The generated source will not handle marshalling of parameter '{1}'.. /// @@ -644,7 +644,7 @@ internal static string TypeNotSupportedMessageParameterWithDetails { return ResourceManager.GetString("TypeNotSupportedMessageParameterWithDetails", resourceCulture); } } - + /// /// Looks up a localized string similar to The type '{0}' is not supported by source-generated P/Invokes. The generated source will not handle marshalling of the return value of method '{1}'.. /// @@ -653,7 +653,7 @@ internal static string TypeNotSupportedMessageReturn { return ResourceManager.GetString("TypeNotSupportedMessageReturn", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} The generated source will not handle marshalling of the return value of method '{1}'.. /// @@ -662,7 +662,7 @@ internal static string TypeNotSupportedMessageReturnWithDetails { return ResourceManager.GetString("TypeNotSupportedMessageReturnWithDetails", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes. /// @@ -671,7 +671,7 @@ internal static string TypeNotSupportedTitle { return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type's 'Value' property must have a getter to support marshalling from managed to native.. /// @@ -680,7 +680,7 @@ internal static string ValuePropertyMustHaveGetterDescription { return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a getter. /// @@ -689,7 +689,7 @@ internal static string ValuePropertyMustHaveGetterMessage { return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type's 'Value' property must have a setter to support marshalling from native to managed.. /// @@ -698,7 +698,7 @@ internal static string ValuePropertyMustHaveSetterDescription { return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a setter. /// diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx index fbe7c31b263f2d..1d6467f5daae87 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx @@ -1,17 +1,17 @@  - @@ -142,7 +142,7 @@ '{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded - Specified 'GeneratedDllImportAttribute' arguments cannot be forwarded to 'DllImportAttribute' + Specified 'LibraryImportAttribute' arguments cannot be forwarded to 'DllImportAttribute' The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive. @@ -224,10 +224,10 @@ Method '{0}' is contained in a type '{1}' that is not marked 'partial'. P/Invoke source generation will ignore method '{0}'. - Methods marked with 'GeneratedDllImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic. + Methods marked with 'LibraryImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic. - Method '{0}' should be 'static', 'partial', and non-generic when marked with 'GeneratedDllImportAttribute'. P/Invoke source generation will ignore method '{0}'. + Method '{0}' should be 'static', 'partial', and non-generic when marked with 'LibraryImportAttribute'. P/Invoke source generation will ignore method '{0}'. Invalid 'LibraryImportAttribute' usage @@ -301,7 +301,7 @@ {0} is a version number - 'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}. + 'LibraryImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}. {0} is a version number diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs index 4ff500d62ad227..0000772d5442e7 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs @@ -791,7 +791,7 @@ private bool TryCreateTypeBasedMarshallingInfo( if (_defaultInfo.CharEncoding == CharEncoding.Custom && _defaultInfo.StringMarshallingCustomType is not null) { AttributeData attrData = _contextSymbol is IMethodSymbol - ? _contextSymbol.GetAttributes().First(a => a.AttributeClass.ToDisplayString() == TypeNames.GeneratedDllImportAttribute) + ? _contextSymbol.GetAttributes().First(a => a.AttributeClass.ToDisplayString() == TypeNames.LibraryImportAttribute) : default; marshallingInfo = CreateNativeMarshallingInfo(type, _defaultInfo.StringMarshallingCustomType, attrData, true, indirectionLevel, parsedCountInfo, useSiteAttributes, inspectedElements, ref maxIndirectionLevelUsed); return true; diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.Designer.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.Designer.cs index d724a69bcbf5ad..90e95ecef5c6d9 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.Designer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace Microsoft.Interop { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Microsoft.Interop { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ internal Resources() { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ internal Resources() { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Marshalling an array from unmanaged to managed requires either the 'SizeParamIndex' or 'SizeConst' fields to be set on a 'MarshalAsAttribute' or the 'ConstantElementCount' or 'CountElementName' properties to be set on a 'MarshalUsingAttribute'.. /// @@ -68,7 +68,7 @@ internal static string ArraySizeMustBeSpecified { return ResourceManager.GetString("ArraySizeMustBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'SizeParamIndex' value in the 'MarshalAsAttribute' is out of range.. /// @@ -77,7 +77,7 @@ internal static string ArraySizeParamIndexOutOfRange { return ResourceManager.GetString("ArraySizeParamIndexOutOfRange", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.. /// @@ -86,7 +86,7 @@ internal static string CannotHaveMultipleMarshallingAttributesDescription { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' and 'NativeMarshallingAttribute'. A type can only have one of these two attributes.. /// @@ -95,7 +95,7 @@ internal static string CannotHaveMultipleMarshallingAttributesMessage { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to A native type with the 'GenericContiguousCollectionMarshallerAttribute' must have at least one of the two marshalling methods as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>' to enable marshalling the managed type.. /// @@ -104,7 +104,7 @@ internal static string CollectionNativeTypeMustHaveRequiredShapeDescription { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes two parameters, one of type '{1}' and an 'int', or have a parameterless instance method named 'ToManaged' that returns '{1}' as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>'. /// @@ -113,7 +113,7 @@ internal static string CollectionNativeTypeMustHaveRequiredShapeMessage { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified collection size parameter for an collection must be an integer type. If the size information is applied to a nested collection, the size parameter must be a collection of one less level of nesting with an integral element.. /// @@ -122,7 +122,7 @@ internal static string CollectionSizeParamTypeMustBeIntegral { return ResourceManager.GetString("CollectionSizeParamTypeMustBeIntegral", resourceCulture); } } - + /// /// Looks up a localized string similar to Only one of 'ConstantElementCount' or 'ElementCountInfo' may be used in a 'MarshalUsingAttribute' for a given 'ElementIndirectionLevel'. /// @@ -131,7 +131,7 @@ internal static string ConstantAndElementCountInfoDisallowed { return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified parameter needs to be marshalled from managed to native, but the native type '{0}' does not support it.. /// @@ -140,7 +140,7 @@ internal static string CustomTypeMarshallingManagedToNativeUnsupported { return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified parameter needs to be marshalled from native to managed, but the native type '{0}' does not support it.. /// @@ -149,7 +149,7 @@ internal static string CustomTypeMarshallingNativeToManagedUnsupported { return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture); } } - + /// /// Looks up a localized string similar to This element cannot depend on '{0}' for collection size information without creating a dependency cycle. /// @@ -158,7 +158,7 @@ internal static string CyclicalCountInfo { return ResourceManager.GetString("CyclicalCountInfo", resourceCulture); } } - + /// /// Looks up a localized string similar to Count information for a given element at a given indirection level can only be specified once. /// @@ -167,7 +167,7 @@ internal static string DuplicateCountInfo { return ResourceManager.GetString("DuplicateCountInfo", resourceCulture); } } - + /// /// Looks up a localized string similar to Multiple marshalling attributes per element per indirection level is unsupported, but duplicate information was provided for indirection level {0}. /// @@ -176,7 +176,7 @@ internal static string DuplicateMarshallingInfo { return ResourceManager.GetString("DuplicateMarshallingInfo", resourceCulture); } } - + /// /// Looks up a localized string similar to Marshalling info was specified for 'ElementIndirectionLevel' {0}, but marshalling info was only needed for {1} level(s) of indirection. /// @@ -185,7 +185,7 @@ internal static string ExtraneousMarshallingInfo { return ResourceManager.GetString("ExtraneousMarshallingInfo", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided graph has cycles and cannot be topologically sorted.. /// @@ -194,7 +194,7 @@ internal static string GraphHasCycles { return ResourceManager.GetString("GraphHasCycles", resourceCulture); } } - + /// /// Looks up a localized string similar to The '[In]' attribute is not supported unless the '[Out]' attribute is also used. The behavior of the '[In]' attribute without the '[Out]' attribute is the same as the default behavior.. /// @@ -203,7 +203,7 @@ internal static string InAttributeNotSupportedWithoutOut { return ResourceManager.GetString("InAttributeNotSupportedWithoutOut", resourceCulture); } } - + /// /// Looks up a localized string similar to The '[In]' and '[Out]' attributes are unsupported on parameters passed by reference. Use the 'in', 'ref', or 'out' keywords instead.. /// @@ -212,7 +212,7 @@ internal static string InOutAttributeByRefNotSupported { return ResourceManager.GetString("InOutAttributeByRefNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided '[In]' and '[Out]' attributes on this parameter are unsupported on this parameter.. /// @@ -221,7 +221,7 @@ internal static string InOutAttributeMarshalerNotSupported { return ResourceManager.GetString("InOutAttributeMarshalerNotSupported", resourceCulture); } } - + /// /// Marshalling bool without explicit marshalling information is not supported. Specify either 'MarshalUsingAttribute' or 'MarshalAsAttribute'.. /// @@ -229,8 +229,8 @@ internal static string MarshallingBoolAsUndefinedNotSupported { get { return ResourceManager.GetString("MarshallingBoolAsUndefinedNotSupported", resourceCulture); } - } - + } + /// /// Looks up a localized string similar to Marshalling char with 'CharSet.{0}' is not supported. Instead, manually convert the char type to the desired byte representation and pass to the source-generated P/Invoke.. /// @@ -239,16 +239,16 @@ internal static string MarshallingCharAsSpecifiedCharSetNotSupported { return ResourceManager.GetString("MarshallingCharAsSpecifiedCharSetNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Marshalling string or char without explicit marshalling information is not supported. Specify either 'GeneratedDllImportAttribute.CharSet' or 'MarshalAsAttribute'.. + /// Looks up a localized string similar to Marshalling string or char without explicit marshalling information is not supported. Specify either 'LibraryImportAttribute.CharSet' or 'MarshalAsAttribute'.. /// internal static string MarshallingStringOrCharAsUndefinedNotSupported { get { return ResourceManager.GetString("MarshallingStringOrCharAsUndefinedNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' for managed type '{1}' must be a closed generic type or have the same arity as the managed type.. /// @@ -257,7 +257,7 @@ internal static string NativeGenericTypeMustBeClosedOrMatchArityMessage { return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type must have at least one of the two marshalling methods to enable marshalling the managed type.. /// @@ -266,7 +266,7 @@ internal static string NativeTypeMustHaveRequiredShapeDescription { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes one parameter of type '{1}' or a parameterless instance method named 'ToManaged' that returns '{1}'. /// @@ -275,7 +275,7 @@ internal static string NativeTypeMustHaveRequiredShapeMessage { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The '[Out]' attribute is only supported on array parameters.. /// @@ -284,7 +284,7 @@ internal static string OutByValueNotSupportedDescription { return ResourceManager.GetString("OutByValueNotSupportedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The '[Out]' attribute is not supported on the '{0}' parameter.. /// @@ -293,7 +293,7 @@ internal static string OutByValueNotSupportedMessage { return ResourceManager.GetString("OutByValueNotSupportedMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property must not be a 'ref' or 'readonly ref' property.. /// @@ -302,7 +302,7 @@ internal static string RefValuePropertyUnsupportedDescription { return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must not be a 'ref' or 'readonly ref' property.. /// @@ -311,7 +311,7 @@ internal static string RefValuePropertyUnsupportedMessage { return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to Runtime marshalling must be disabled in this project by applying the 'System.Runtime.InteropServices.DisableRuntimeMarshallingAttribute' to the assembly to enable marshalling this type.. /// @@ -320,7 +320,7 @@ internal static string RuntimeMarshallingMustBeDisabled { return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture); } } - + /// /// Looks up a localized string similar to An abstract type derived from 'SafeHandle' cannot be marshalled by reference. The provided type must be concrete.. /// @@ -329,7 +329,7 @@ internal static string SafeHandleByRefMustBeConcrete { return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes. /// @@ -338,7 +338,7 @@ internal static string TypeNotSupportedTitle { return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture); } } - + /// /// Looks up a localized string similar to Marshalling a value between managed and native with a native type with a 'Value' property requires extra state, which is not supported in this context.. /// @@ -347,7 +347,7 @@ internal static string ValuePropertyMarshallingRequiresAdditionalState { return ResourceManager.GetString("ValuePropertyMarshallingRequiresAdditionalState", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type's 'Value' property must have a getter to support marshalling from managed to native.. /// @@ -356,7 +356,7 @@ internal static string ValuePropertyMustHaveGetterDescription { return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a getter. /// @@ -365,7 +365,7 @@ internal static string ValuePropertyMustHaveGetterMessage { return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture); } } - + /// /// Looks up a localized string similar to The native type's 'Value' property must have a setter to support marshalling from native to managed.. /// @@ -374,7 +374,7 @@ internal static string ValuePropertyMustHaveSetterDescription { return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a setter. /// diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.resx b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.resx index f1b937f641bd3c..abac39ff66078c 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.resx +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.resx @@ -1,17 +1,17 @@  - @@ -157,7 +157,7 @@ Marshalling char with 'CharSet.{0}' is not supported. Instead, manually convert the char type to the desired byte representation and pass to the source-generated P/Invoke. - Marshalling string or char without explicit marshalling information is not supported. Specify either 'GeneratedDllImportAttribute.CharSet' or 'MarshalAsAttribute'. + Marshalling string or char without explicit marshalling information is not supported. Specify either 'LibraryImportAttribute.CharSet' or 'MarshalAsAttribute'. The '[Out]' attribute is only supported on array parameters. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs index 6cffa1f9daef97..1a812d49696d30 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs @@ -6,7 +6,7 @@ namespace Microsoft.Interop public static class TypeNames { public const string DllImportAttribute = "System.Runtime.InteropServices.DllImportAttribute"; - public const string GeneratedDllImportAttribute = "System.Runtime.InteropServices.GeneratedDllImportAttribute"; + public const string LibraryImportAttribute = "System.Runtime.InteropServices.LibraryImportAttribute"; public const string StringMarshalling = "System.Runtime.InteropServices.StringMarshalling"; public const string GeneratedMarshallingAttribute = "System.Runtime.InteropServices.GeneratedMarshallingAttribute"; diff --git a/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/Ancillary.Interop.csproj b/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/Ancillary.Interop.csproj index 054016b29c9b29..60e536023fbb3f 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/Ancillary.Interop.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/Ancillary.Interop.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/ArrayTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/ArrayTests.cs index 5e24cae338c12d..8fd114021a4cb7 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/ArrayTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/ArrayTests.cs @@ -16,66 +16,66 @@ partial class NativeExportsNE { public partial class Arrays { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int Sum(int[] values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int Sum(ref int values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")] public static partial int SumInArray(in int[] values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] public static partial void Duplicate([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref int[] values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] [return:MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] public static partial int[] CreateRange(int start, int end, out int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out int[] res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", StringMarshalling = StringMarshalling.Utf16)] public static partial int SumChars(char[] chars, int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", StringMarshalling = StringMarshalling.Utf16)] public static partial void FillChars([Out] char[] chars, int length, ushort start); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", StringMarshalling = StringMarshalling.Utf16)] public static partial void ReverseChars([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref char[] chars, int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] public static partial int SumStringLengths([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")] public static partial void ReverseStrings_Ref([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] ref string[] strArray, out int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")] [return: MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] public static partial string[] ReverseStrings_Return([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray, out int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")] public static partial void ReverseStrings_Out([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray, out int numElements, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] out string[] res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] [return:MarshalAs(UnmanagedType.LPArray, SizeConst = sizeof(long))] public static partial byte[] GetLongBytes(long l); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "append_int_to_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "append_int_to_array")] public static partial void Append([MarshalAs(UnmanagedType.LPArray, SizeConst = 1, SizeParamIndex = 1)] ref int[] values, int numOriginalValues, int newValue); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_range_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "fill_range_array")] [return: MarshalAs(UnmanagedType.U1)] public static partial bool FillRangeArray([Out] IntStructWrapper[] array, int length, int start); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "double_values")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "double_values")] public static partial void DoubleValues([In, Out] IntStructWrapper[] array, int length); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")] [return:MarshalAs(UnmanagedType.U1)] public static partial bool AndAllMembers(BoolStruct[] pArray, int length); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")] [return: MarshalUsing(CountElementName = "numColumns")] [return: MarshalUsing(CountElementName = "numRows", ElementIndirectionLevel = 1)] public static partial int[][] TransposeMatrix(int[][] matrix, int[] numRows, int numColumns); diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BlittableStructTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BlittableStructTests.cs index 1375901563e968..f02379ddcabf2f 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BlittableStructTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BlittableStructTests.cs @@ -11,32 +11,32 @@ namespace LibraryImportGenerator.IntegrationTests { partial class NativeExportsNE { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_return_instance")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_return_instance")] public static partial IntFields DoubleIntFields(IntFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")] public static partial void DoubleIntFieldsByRef(ref IntFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")] public static partial void DoubleIntFieldsByRefIn(in IntFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")] public static partial void DoubleIntFieldsRefReturn( IntFields input, ref IntFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")] public static partial void DoubleIntFieldsOutReturn( IntFields input, out IntFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] public static partial void IncrementInvertPointerFieldsByRef(ref PointerFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] public static partial void IncrementInvertPointerFieldsByRefIn(in PointerFields result); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")] public static partial void IncrementInvertPointerFieldsRefReturn( PointerFields input, ref PointerFields result); diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BooleanTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BooleanTests.cs index 3b66fc69b8aa15..2f820824719db2 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BooleanTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BooleanTests.cs @@ -11,61 +11,61 @@ namespace LibraryImportGenerator.IntegrationTests { partial class NativeExportsNE { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")] public static partial uint ReturnByteBoolAsUInt([MarshalAs(UnmanagedType.U1)] bool input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")] public static partial uint ReturnSByteBoolAsUInt([MarshalAs(UnmanagedType.I1)] bool input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "variantbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "variantbool_return_as_uint")] public static partial uint ReturnVariantBoolAsUInt([MarshalAs(UnmanagedType.VariantBool)] bool input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] public static partial uint ReturnIntBoolAsUInt([MarshalAs(UnmanagedType.I4)] bool input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] public static partial uint ReturnUIntBoolAsUInt([MarshalAs(UnmanagedType.U4)] bool input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] public static partial uint ReturnWinBoolAsUInt([MarshalAs(UnmanagedType.Bool)] bool input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] [return: MarshalAs(UnmanagedType.U1)] public static partial bool ReturnUIntAsByteBool(uint input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] [return: MarshalAs(UnmanagedType.VariantBool)] public static partial bool ReturnUIntAsVariantBool(uint input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool ReturnUIntAsWinBool(uint input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsByteBool_Ref(uint input, [MarshalAs(UnmanagedType.U1)] ref bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsByteBool_Out(uint input, [MarshalAs(UnmanagedType.U1)] out bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsByteBool_In(uint input, [MarshalAs(UnmanagedType.U1)] in bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsVariantBool_Ref(uint input, [MarshalAs(UnmanagedType.VariantBool)] ref bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsVariantBool_Out(uint input, [MarshalAs(UnmanagedType.VariantBool)] out bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsVariantBool_In(uint input, [MarshalAs(UnmanagedType.VariantBool)] in bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsWinBool_Ref(uint input, [MarshalAs(UnmanagedType.Bool)] ref bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsWinBool_Out(uint input, [MarshalAs(UnmanagedType.Bool)] out bool res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")] public static partial void ReturnUIntAsWinBool_In(uint input, [MarshalAs(UnmanagedType.Bool)] in bool res); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CallingConventionTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CallingConventionTests.cs index d58e6cc34cee01..1452fef1656ad9 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CallingConventionTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CallingConventionTests.cs @@ -16,10 +16,10 @@ internal partial class NativeExportsNE { internal partial class CallingConventions { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "add_integers_cdecl")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "add_integers_cdecl")] [UnmanagedCallConv(CallConvs = new[] { typeof(CallConvCdecl) })] public static partial long AddLongsCdecl(long i, long j, long k, long l, long m, long n, long o, long p, long q); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "add_integers_stdcall")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "add_integers_stdcall")] [UnmanagedCallConv(CallConvs = new[] { typeof(CallConvStdcall) })] public static partial long AddLongsStdcall(long i, long j, long k, long l, long m, long n, long o, long p, long q); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CharacterTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CharacterTests.cs index f55902edba9b47..48dcdd175f56a5 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CharacterTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CharacterTests.cs @@ -12,30 +12,30 @@ namespace LibraryImportGenerator.IntegrationTests { partial class NativeExportsNE { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "unicode_return_as_uint", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "unicode_return_as_uint", StringMarshalling = StringMarshalling.Utf16)] public static partial uint ReturnUnicodeAsUInt(char input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf16)] public static partial char ReturnUIntAsUnicode(uint input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)] public static partial void ReturnUIntAsUnicode_Ref(uint input, ref char res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)] public static partial void ReturnUIntAsUnicode_Out(uint input, out char res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)] public static partial void ReturnUIntAsUnicode_In(uint input, in char res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.U2)] public static partial char ReturnU2AsU2IgnoreCharSet([MarshalAs(UnmanagedType.U2)] char input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.I2)] public static partial char ReturnI2AsI2IgnoreCharSet([MarshalAs(UnmanagedType.I2)] char input); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_reverse_buffer_ref", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_reverse_buffer_ref", StringMarshalling = StringMarshalling.Utf16)] public static partial void ReverseBuffer(ref char buffer, int len); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CollectionTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CollectionTests.cs index d33fad2b499e74..f8676d68e26d2a 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CollectionTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CollectionTests.cs @@ -16,46 +16,46 @@ partial class NativeExportsNE { public partial class Collections { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int Sum([MarshalUsing(typeof(ListMarshaller))] List values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int Sum(ref int values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")] public static partial int SumInArray([MarshalUsing(typeof(ListMarshaller))] in List values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] public static partial void Duplicate([MarshalUsing(typeof(ListMarshaller), CountElementName = "numValues")] ref List values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] [return:MarshalUsing(typeof(ListMarshaller), CountElementName = "numValues")] public static partial List CreateRange(int start, int end, out int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalUsing(typeof(ListMarshaller), CountElementName = "numValues")] out List res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] public static partial int SumStringLengths([MarshalUsing(typeof(ListMarshaller)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List strArray); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")] public static partial void ReverseStrings_Ref([MarshalUsing(typeof(ListMarshaller), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] ref List strArray, out int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")] [return: MarshalUsing(typeof(ListMarshaller), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] public static partial List ReverseStrings_Return([MarshalUsing(typeof(ListMarshaller), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List strArray, out int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")] public static partial void ReverseStrings_Out( [MarshalUsing(typeof(ListMarshaller)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List strArray, out int numElements, [MarshalUsing(typeof(ListMarshaller), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] out List res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] [return:MarshalUsing(typeof(ListMarshaller), ConstantElementCount = sizeof(long))] public static partial List GetLongBytes(long l); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")] [return:MarshalAs(UnmanagedType.U1)] public static partial bool AndAllMembers([MarshalUsing(typeof(ListMarshaller))] List pArray, int length); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CustomMarshallingTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CustomMarshallingTests.cs index 0477c6b08ac378..f563b6ff5dd884 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CustomMarshallingTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CustomMarshallingTests.cs @@ -12,31 +12,31 @@ namespace LibraryImportGenerator.IntegrationTests { partial class NativeExportsNE { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_deepduplicate")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_deepduplicate")] public static partial void DeepDuplicateStrings(StringContainer strings, out StringContainer pStringsOut); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_reverse_strings")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_reverse_strings")] public static partial void ReverseStrings(ref StringContainer strings); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes_as_double")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes_as_double")] public static partial double GetLongBytesAsDouble([MarshalUsing(typeof(DoubleToLongMarshaler))] double d); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "negate_bools")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "negate_bools")] public static partial void NegateBools( BoolStruct boolStruct, out BoolStruct pBoolStructOut); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_bools_ref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_bools_ref")] [return: MarshalAs(UnmanagedType.U1)] public static partial bool AndBoolsRef(in BoolStruct boolStruct); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "double_int_ref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "double_int_ref")] public static partial IntWrapper DoubleIntRef(IntWrapper pInt); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_replace_ref_ushort")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_replace_ref_ushort")] public static partial void ReverseReplaceString([MarshalUsing(typeof(Utf16StringMarshaller))] ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "return_length_ushort")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "return_length_ushort")] public static partial int ReturnStringLength([MarshalUsing(typeof(Utf16StringMarshaller))] string s); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/DelegateTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/DelegateTests.cs index b7db86694f157c..639c607b378694 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/DelegateTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/DelegateTests.cs @@ -11,12 +11,12 @@ partial class NativeExportsNE { public delegate void VoidVoid(); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")] public static partial void InvokeAfterGC(VoidVoid cb); public delegate int IntIntInt(int a, int b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")] public static partial int InvokeWithBlittableArgument(IntIntInt cb, int a, int b); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/EnumTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/EnumTests.cs index c5d06dd5ccf388..14585b2ac61b43 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/EnumTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/EnumTests.cs @@ -12,31 +12,31 @@ partial class NativeExportsNE { public partial class IntEnum { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_int")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_int")] public static partial EnumTests.IntEnum Subtract_Return(EnumTests.IntEnum a, EnumTests.IntEnum b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_int")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_int")] public static partial void Subtract_Out(EnumTests.IntEnum a, EnumTests.IntEnum b, out EnumTests.IntEnum c); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")] public static partial void Subtract_Ref(EnumTests.IntEnum a, ref EnumTests.IntEnum b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")] public static partial void Subtract_In(EnumTests.IntEnum a, in EnumTests.IntEnum b); } public partial class ByteEnum { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_byte")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_byte")] public static partial EnumTests.ByteEnum Subtract_Return(EnumTests.ByteEnum a, EnumTests.ByteEnum b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_byte")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_byte")] public static partial void Subtract_Out(EnumTests.ByteEnum a, EnumTests.ByteEnum b, out EnumTests.ByteEnum c); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")] public static partial void Subtract_Ref(EnumTests.ByteEnum a, ref EnumTests.ByteEnum b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")] public static partial void Subtract_In(EnumTests.ByteEnum a, in EnumTests.ByteEnum b); } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/FunctionPointerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/FunctionPointerTests.cs index ce270b6e9cb86e..fde6b235ed4561 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/FunctionPointerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/FunctionPointerTests.cs @@ -13,22 +13,22 @@ partial class NativeExportsNE { public partial class FunctionPointer { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_after_gc")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_after_gc")] public static unsafe partial void InvokeAfterGC(delegate* cb); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")] public static unsafe partial void InvokeAfterGC(delegate* unmanaged cb); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")] public static unsafe partial void InvokeAfterGC(delegate* unmanaged[Stdcall] cb); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_blittable_args")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_blittable_args")] public static unsafe partial int InvokeWithBlittableArgument(delegate* cb, int a, int b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")] public static unsafe partial int InvokeWithBlittableArgument(delegate* unmanaged cb, int a, int b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")] public static unsafe partial int InvokeWithBlittableArgument(delegate* unmanaged[Stdcall] cb, int a, int b); } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/PointerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/PointerTests.cs index dd3cef0cea9b1b..f1b68d8a17b8ac 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/PointerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/PointerTests.cs @@ -11,13 +11,13 @@ namespace LibraryImportGenerator.IntegrationTests { partial class NativeExportsNE { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")] public static unsafe partial void Subtract_Int_Ptr(int a, int* b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")] public static unsafe partial void Subtract_Byte_Ptr(byte a, byte* b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")] public static unsafe partial void DoubleIntFields_Ptr(IntFields* result); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SafeHandleTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SafeHandleTests.cs index 2e5b9af199c704..1ae443c457ee88 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SafeHandleTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SafeHandleTests.cs @@ -25,25 +25,25 @@ protected override bool ReleaseHandle() public static NativeExportsSafeHandle CreateNewHandle() => AllocateHandle(); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")] private static partial NativeExportsSafeHandle AllocateHandle(); } - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")] public static partial NativeExportsSafeHandle AllocateHandle(); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle_out")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle_out")] public static partial void AllocateHandle(out NativeExportsSafeHandle handle); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "release_handle")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "release_handle")] [return:MarshalAs(UnmanagedType.I1)] private static partial bool ReleaseHandle(nint handle); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "is_handle_alive")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "is_handle_alive")] [return:MarshalAs(UnmanagedType.I1)] public static partial bool IsHandleAlive(NativeExportsSafeHandle handle); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "modify_handle")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "modify_handle")] public static partial void ModifyHandle(ref NativeExportsSafeHandle handle, [MarshalAs(UnmanagedType.I1)] bool newHandle); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SetLastErrorTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SetLastErrorTests.cs index 02db0381f7fc57..057bef953c7f50 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SetLastErrorTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SetLastErrorTests.cs @@ -29,14 +29,14 @@ partial class NativeExportsNE { public partial class SetLastError { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)] public static partial int SetError(int error, byte shouldSetError); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)] [return: MarshalUsing(typeof(SetLastErrorMarshaller))] public static partial int SetError_CustomMarshallingSetsError(int error, byte shouldSetError); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error_return_string", SetLastError = true)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error_return_string", SetLastError = true)] [return: MarshalAs(UnmanagedType.LPWStr)] public static partial string SetError_NonBlittableSignature(int error, [MarshalAs(UnmanagedType.U1)] bool shouldSetError, [MarshalAs(UnmanagedType.LPWStr)] string errorString); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SpanTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SpanTests.cs index fc30ca2fea79c5..3b0a91cf26c554 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SpanTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SpanTests.cs @@ -18,36 +18,36 @@ partial class NativeExportsNE { public partial class Span { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int Sum([MarshalUsing(typeof(SpanMarshaller))] Span values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int SumNeverNull([MarshalUsing(typeof(NeverNullSpanMarshaller))] Span values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")] public static partial int SumNeverNull([MarshalUsing(typeof(NeverNullReadOnlySpanMarshaller))] ReadOnlySpan values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")] public static partial int SumInArray([MarshalUsing(typeof(SpanMarshaller))] in Span values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] public static partial void Duplicate([MarshalUsing(typeof(SpanMarshaller), CountElementName = "numValues")] ref Span values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")] public static partial void DuplicateRaw([MarshalUsing(typeof(DirectSpanMarshaller), CountElementName = "numValues")] ref Span values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] [return: MarshalUsing(typeof(SpanMarshaller), CountElementName = "numValues")] public static partial Span CreateRange(int start, int end, out int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalUsing(typeof(SpanMarshaller), CountElementName = "numValues")] out Span res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] [return: MarshalUsing(typeof(SpanMarshaller), ConstantElementCount = sizeof(long))] public static partial Span GetLongBytes(long l); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")] [return: MarshalAs(UnmanagedType.U1)] public static partial bool AndAllMembers([MarshalUsing(typeof(SpanMarshaller))] Span pArray, int length); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/StringTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/StringTests.cs index 29d0922ff50220..73ac84acdfa1cf 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/StringTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/StringTests.cs @@ -44,143 +44,143 @@ public class UShort public partial class Utf16 { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf16)] public static partial int ReturnLength(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshalling = StringMarshalling.Utf16)] public static partial string Reverse_Return(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshalling = StringMarshalling.Utf16)] public static partial void Reverse_Out(string s, out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)] public static partial void Reverse_Ref(ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)] public static partial void Reverse_In(in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshalling = StringMarshalling.Utf16)] public static partial void Reverse_Replace_Ref(ref string s); } public partial class LPTStr { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)] public static partial int ReturnLength([MarshalAs(UnmanagedType.LPTStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)] public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPTStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)] [return: MarshalAs(UnmanagedType.LPTStr)] public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPTStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)] public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPTStr)] string s, [MarshalAs(UnmanagedType.LPTStr)] out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPTStr)] ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] public static partial void Reverse_In([MarshalAs(UnmanagedType.LPTStr)] in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPTStr)] ref string s); } public partial class LPWStr { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)] public static partial int ReturnLength([MarshalAs(UnmanagedType.LPWStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)] public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPWStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)] [return: MarshalAs(UnmanagedType.LPWStr)] public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPWStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)] public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPWStr)] string s, [MarshalAs(UnmanagedType.LPWStr)] out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPWStr)] ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] public static partial void Reverse_In([MarshalAs(UnmanagedType.LPWStr)] in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)] public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPWStr)] ref string s); } public partial class LPUTF8Str { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)] public static partial int ReturnLength([MarshalAs(UnmanagedType.LPUTF8Str)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)] public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPUTF8Str)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)] [return: MarshalAs(UnmanagedType.LPUTF8Str)] public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPUTF8Str)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)] public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPUTF8Str)] string s, [MarshalAs(UnmanagedType.LPUTF8Str)] out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] public static partial void Reverse_In([MarshalAs(UnmanagedType.LPUTF8Str)] in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPUTF8Str)] ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPUTF8Str)] ref string s); } public partial class Utf8 { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf8)] public static partial int ReturnLength(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshalling = StringMarshalling.Utf8)] public static partial string Reverse_Return(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshalling = StringMarshalling.Utf8)] public static partial void Reverse_Out(string s, out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)] public static partial void Reverse_Ref(ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)] public static partial void Reverse_In(in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)] public static partial void Reverse_Replace_Ref(ref string s); } public partial class LPStr { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)] public static partial int ReturnLength([MarshalAs(UnmanagedType.LPStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)] public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)] [return: MarshalAs(UnmanagedType.LPStr)] public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPStr)] string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)] public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPStr)] string s, [MarshalAs(UnmanagedType.LPStr)] out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPStr)] ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] public static partial void Reverse_In([MarshalAs(UnmanagedType.LPStr)] in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)] public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPStr)] ref string s); } @@ -188,43 +188,43 @@ public partial class StringMarshallingCustomType { public partial class Utf16 { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] public static partial int ReturnLength(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] public static partial string Reverse_Return(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] public static partial void Reverse_Out(string s, out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] public static partial void Reverse_Ref(ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] public static partial void Reverse_In(in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))] public static partial void Reverse_Replace_Ref(ref string s); } public partial class Utf8 { - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] public static partial int ReturnLength(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] public static partial string Reverse_Return(string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] public static partial void Reverse_Out(string s, out string ret); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] public static partial void Reverse_Ref(ref string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] public static partial void Reverse_In(in string s); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))] public static partial void Reverse_Replace_Ref(ref string s); } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AdditionalAttributesOnStub.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AdditionalAttributesOnStub.cs index 7894fbe70f772d..748e160f35ed48 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AdditionalAttributesOnStub.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AdditionalAttributesOnStub.cs @@ -22,7 +22,7 @@ public async Task SkipLocalsInitAdded() [assembly:DisableRuntimeMarshalling] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -52,7 +52,7 @@ public async Task SkipLocalsInitNotAddedOnForwardingStub() using System.Runtime.InteropServices; partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial void Method(); }"; Compilation comp = await TestUtils.CreateCompilation(source); @@ -73,7 +73,7 @@ public async Task GeneratedCodeAdded() [assembly:DisableRuntimeMarshalling] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -103,7 +103,7 @@ public async Task GeneratedCodeNotAddedOnForwardingStub() using System.Runtime.InteropServices; partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial void Method(); }"; Compilation comp = await TestUtils.CreateCompilation(source); @@ -131,10 +131,10 @@ public async Task SkipLocalsInitOnDownlevelTargetFrameworks(TestTargetFramework { string source = $@" using System.Runtime.InteropServices; -{CodeSnippets.GeneratedDllImportAttributeDeclaration} +{CodeSnippets.LibraryImportAttributeDeclaration} partial class C {{ - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool Method(); }}"; @@ -163,7 +163,7 @@ public async Task SkipLocalsInitNotAddedWhenDefinedAtModuleLevel() [module:SkipLocalsInit] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -195,7 +195,7 @@ public async Task SkipLocalsInitNotAddedWhenDefinedAtClassLevel() [SkipLocalsInit] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -227,7 +227,7 @@ public async Task SkipLocalsInitNotAddedWhenDefinedOnMethodByUser() partial class C { [SkipLocalsInit] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AttributeForwarding.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AttributeForwarding.cs index 7a7c59a178ae4e..3e24015cfe3eec 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AttributeForwarding.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AttributeForwarding.cs @@ -29,7 +29,7 @@ public async Task KnownParameterlessAttribute(string attributeSourceName, string partial class C {{ [{attributeSourceName}] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); }} @@ -70,7 +70,7 @@ public async Task UnmanagedCallConvAttribute_EmptyCallConvArray() partial class C { [UnmanagedCallConv(CallConvs = new Type[0])] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -113,7 +113,7 @@ public async Task UnmanagedCallConvAttribute_SingleCallConvType() partial class C { [UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall)})] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -160,7 +160,7 @@ public async Task UnmanagedCallConvAttribute_MultipleCallConvTypes() partial class C { [UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall), typeof(CallConvSuppressGCTransition)})] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -211,7 +211,7 @@ public async Task DefaultDllImportSearchPathsAttribute() partial class C {{ [DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.UserDirectories)] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); }} @@ -259,7 +259,7 @@ class OtherAttribute : Attribute {} partial class C { [Other] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -298,11 +298,11 @@ public async Task InOutAttributes_Forwarded_To_ForwardedParameter() using System.Runtime.InteropServices; partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool Method1([In, Out] int[] a); } -" + CodeSnippets.GeneratedDllImportAttributeDeclaration; +" + CodeSnippets.LibraryImportAttributeDeclaration; Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard); Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator()); @@ -341,11 +341,11 @@ public async Task MarshalAsAttribute_Forwarded_To_ForwardedParameter() using System.Runtime.InteropServices; partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool Method1([MarshalAs(UnmanagedType.I2)] int a); } -" + CodeSnippets.GeneratedDllImportAttributeDeclaration; +" + CodeSnippets.LibraryImportAttributeDeclaration; Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard); Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator()); @@ -370,11 +370,11 @@ public async Task MarshalAsAttribute_Forwarded_To_ForwardedParameter_Array() using System.Runtime.InteropServices; partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool Method1([MarshalAs(UnmanagedType.LPArray, SizeConst = 10, SizeParamIndex = 1, ArraySubType = UnmanagedType.I4)] int[] a, int b); } -" + CodeSnippets.GeneratedDllImportAttributeDeclaration; +" + CodeSnippets.LibraryImportAttributeDeclaration; Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard); Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator()); diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs index a1be0baa469835..5ac7012e86a516 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs @@ -10,7 +10,7 @@ internal static class CodeSnippets /// /// Partially define attribute for pre-.NET 6.0 /// - public static readonly string GeneratedDllImportAttributeDeclaration = @" + public static readonly string LibraryImportAttributeDeclaration = @" namespace System.Runtime.InteropServices { internal enum StringMarshalling @@ -20,9 +20,9 @@ internal enum StringMarshalling Utf16, } - sealed class GeneratedDllImportAttribute : System.Attribute + sealed class LibraryImportAttribute : System.Attribute { - public GeneratedDllImportAttribute(string a) { } + public LibraryImportAttribute(string a) { } public StringMarshalling StringMarshalling { get; set; } public Type StringMarshallingCustomType { get; set; } } @@ -30,42 +30,42 @@ public GeneratedDllImportAttribute(string a) { } "; /// - /// Trivial declaration of GeneratedDllImport usage + /// Trivial declaration of LibraryImport usage /// public static readonly string TrivialClassDeclarations = @" using System.Runtime.InteropServices; partial class Basic { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial void Method1(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2(); - [System.Runtime.InteropServices.GeneratedDllImportAttribute(""DoesNotExist"")] + [System.Runtime.InteropServices.LibraryImportAttribute(""DoesNotExist"")] public static partial void Method3(); - [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")] + [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")] public static partial void Method4(); } "; /// - /// Trivial declaration of GeneratedDllImport usage + /// Trivial declaration of LibraryImport usage /// public static readonly string TrivialStructDeclarations = @" using System.Runtime.InteropServices; partial struct Basic { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial void Method1(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2(); - [System.Runtime.InteropServices.GeneratedDllImportAttribute(""DoesNotExist"")] + [System.Runtime.InteropServices.LibraryImportAttribute(""DoesNotExist"")] public static partial void Method3(); - [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")] + [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")] public static partial void Method4(); } "; @@ -90,7 +90,7 @@ public Dummy2Attribute(string input) { } partial class Test { [DummyAttribute] - [GeneratedDllImport(""DoesNotExist""), Dummy2Attribute(""string value"")] + [LibraryImport(""DoesNotExist""), Dummy2Attribute(""string value"")] public static partial void Method(); } "; @@ -106,7 +106,7 @@ namespace InnerNS { partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method1(); } } @@ -115,7 +115,7 @@ namespace NS.InnerNS { partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2(); } } @@ -132,7 +132,7 @@ partial class OuterClass { partial class InnerClass { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -140,7 +140,7 @@ partial struct OuterStruct { partial struct InnerStruct { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -148,7 +148,7 @@ partial class OuterClass { partial struct InnerStruct { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -156,7 +156,7 @@ partial struct OuterStruct { partial class InnerClass { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -170,12 +170,12 @@ partial class InnerClass using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method1(); } unsafe partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int* Method2(); } "; @@ -186,19 +186,19 @@ unsafe partial class Test using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"", EntryPoint=""UserDefinedEntryPoint"")] + [LibraryImport(""DoesNotExist"", EntryPoint=""UserDefinedEntryPoint"")] public static partial void NotAnExport(); } "; /// - /// Declaration with all GeneratedDllImport named arguments. + /// Declaration with all LibraryImport named arguments. /// - public static readonly string AllGeneratedDllImportNamedArguments = @" + public static readonly string AllLibraryImportNamedArguments = @" using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"", + [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf16, EntryPoint = ""UserDefinedEntryPoint"", SetLastError = true)] @@ -219,19 +219,19 @@ partial class Test private const int One = 1; private const int Two = 2; - [GeneratedDllImport(nameof(Test), + [LibraryImport(nameof(Test), StringMarshalling = (StringMarshalling)2, EntryPoint = EntryPointName, SetLastError = IsFalse)] public static partial void Method1(); - [GeneratedDllImport(nameof(Test), + [LibraryImport(nameof(Test), StringMarshalling = (StringMarshalling)Two, EntryPoint = EntryPointName, SetLastError = !IsTrue)] public static partial void Method2(); - [GeneratedDllImport(nameof(Test), + [LibraryImport(nameof(Test), StringMarshalling = (StringMarshalling)2, EntryPoint = EntryPointName, SetLastError = 0 != 1)] @@ -246,7 +246,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(int t = 0); } "; @@ -259,7 +259,7 @@ partial class Test partial class Test { [LCIDConversion(0)] - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } "; @@ -296,11 +296,11 @@ public object MarshalNativeToManaged(IntPtr pNativeData) partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NS.MyCustomMarshaler), MarshalCookie=""COOKIE1"")] public static partial bool Method1([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NS.MyCustomMarshaler), MarshalCookie=""COOKIE2"")]bool t); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = ""NS.MyCustomMarshaler"", MarshalCookie=""COOKIE3"")] public static partial bool Method2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = ""NS.MyCustomMarshaler"", MarshalCookie=""COOKIE4"")]bool t); } @@ -316,21 +316,21 @@ partial class Test namespace System.Runtime.InteropServices { // Prefix with ATTRIBUTE so the lengths will match during check. - sealed class ATTRIBUTEGeneratedDllImportAttribute : Attribute + sealed class ATTRIBUTELibraryImportAttribute : Attribute { - public ATTRIBUTEGeneratedDllImportAttribute(string a) { } + public ATTRIBUTELibraryImportAttribute(string a) { } } } partial class Test { - [ATTRIBUTEGeneratedDllImportAttribute(""DoesNotExist"")] + [ATTRIBUTELibraryImportAttribute(""DoesNotExist"")] public static partial void Method1(); - [ATTRIBUTEGeneratedDllImport(""DoesNotExist"")] + [ATTRIBUTELibraryImport(""DoesNotExist"")] public static partial void Method2(); - [System.Runtime.InteropServices.ATTRIBUTEGeneratedDllImport(""DoesNotExist"")] + [System.Runtime.InteropServices.ATTRIBUTELibraryImport(""DoesNotExist"")] public static partial void Method3(); } "; @@ -345,7 +345,7 @@ public static string BasicParametersAndModifiersWithStringMarshalling(string typ {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.{value})] + [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.{value})] public static partial {typename} Method( {typename} p, in {typename} pIn, @@ -365,7 +365,7 @@ public static string BasicParametersAndModifiersWithStringMarshallingCustomType( {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", StringMarshallingCustomType = typeof({stringMarshallingCustomTypeName}))] + [LibraryImport(""DoesNotExist"", StringMarshallingCustomType = typeof({stringMarshallingCustomTypeName}))] public static partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -397,7 +397,7 @@ public static string BasicParametersAndModifiers(string typeName, string preDecl {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -413,7 +413,7 @@ public static string BasicParametersAndModifiersNoRef(string typeName, string pr {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -428,7 +428,7 @@ public static string BasicParametersAndModifiersUnsafe(string typeName, string p {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static unsafe partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -446,7 +446,7 @@ public static string ByValueParameterWithModifier(string typeName, string attrib {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [{attributeName}] {typeName} p); }}"; @@ -460,7 +460,7 @@ public static string ByValueParameterWithName(string methodName, string paramNam using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void {methodName}( int {paramName}); }}"; @@ -472,7 +472,7 @@ public static string MarshalAsParametersAndModifiers(string typeName, UnmanagedT using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.{unmanagedType})] public static partial {typeName} Method( [MarshalAs(UnmanagedType.{unmanagedType})] {typeName} p, @@ -489,7 +489,7 @@ public static string MarshalAsParametersAndModifiersUnsafe(string typeName, Unma using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.{unmanagedType})] public static unsafe partial {typeName} Method( [MarshalAs(UnmanagedType.{unmanagedType})] {typeName} p, @@ -515,7 +515,7 @@ enum MyEnum {{ A, B, C }} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial MyEnum Method( MyEnum p, in MyEnum pIn, @@ -535,7 +535,7 @@ public static string SetLastErrorTrue(string typeName) => @$" using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", SetLastError = true)] + [LibraryImport(""DoesNotExist"", SetLastError = true)] public static partial {typeName} Method({typeName} p); }}"; @@ -569,7 +569,7 @@ public static string MarshalAsArrayParametersAndModifiers(string elementType, st {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalAs(UnmanagedType.LPArray, SizeConst=10)] public static partial {elementType}[] Method( {elementType}[] p, @@ -588,7 +588,7 @@ public static string MarshalAsArrayParameterWithSizeParam(string sizeParamType, {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( {(isByRef ? "ref" : "")} {sizeParamType} pRefSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref int[] pRef @@ -603,7 +603,7 @@ public static string MarshalAsArrayParameterWithNestedMarshalInfo(string element {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.{nestedMarshalInfo})] {elementType}[] pRef ); @@ -619,7 +619,7 @@ public static string MarshalUsingParametersAndModifiers(string typeName, string {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalUsing(typeof({nativeTypeName}))] public static partial {typeName} Method( [MarshalUsing(typeof({nativeTypeName}))] {typeName} p, @@ -857,7 +857,7 @@ public void FreeNative() partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( S s, in S sIn); @@ -889,7 +889,7 @@ public static string BasicParameterWithByRefModifier(string byRefKind, string ty {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( {byRefKind} {typeName} p); }}"; @@ -899,7 +899,7 @@ public static string BasicParameterByValue(string typeName, string preDeclaratio {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( {typeName} p); }}"; @@ -909,7 +909,7 @@ public static string BasicReturnType(string typeName, string preDeclaration = "" {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial {typeName} Method(); }}"; @@ -1019,7 +1019,7 @@ public static string PreprocessorIfAroundFullFunctionDefinition(string define) = partial class Test {{ #if {define} - [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")] + [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")] public static partial int Method( int p, in int pIn, @@ -1033,7 +1033,7 @@ public static string PreprocessorIfAroundFullFunctionDefinitionWithFollowingFunc partial class Test {{ #if {define} - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int Method( int p, in int pIn, @@ -1048,7 +1048,7 @@ public static string PreprocessorIfAfterAttributeAroundFunction(string define) = using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] #if {define} public static partial int Method( int p, @@ -1067,7 +1067,7 @@ public static string PreprocessorIfAfterAttributeAroundFunctionAdditionalFunctio using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] #if {define} public static partial int Method( int p, @@ -1133,7 +1133,7 @@ public static string MarshalUsingCollectionCountInfoParametersAndModifiers(strin {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalUsing(ConstantElementCount=10)] public static partial {collectionType} Method( {collectionType} p, @@ -1174,7 +1174,7 @@ public static string MarshalUsingCollectionParametersAndModifiers(string collect {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalUsing(typeof({marshallerType}), ConstantElementCount=10)] public static partial {collectionType} Method( [MarshalUsing(typeof({marshallerType}))] {collectionType} p, @@ -1195,7 +1195,7 @@ public static string MarshalUsingCollectionReturnValueLength(string collectionTy {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int Method( [MarshalUsing(typeof({marshallerType}), CountElementName = MarshalUsingAttribute.ReturnsCountValue)] out {collectionType} pOut ); @@ -1210,7 +1210,7 @@ public static string MarshalUsingArrayParameterWithSizeParam(string sizeParamTyp {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( {(isByRef ? "ref" : "")} {sizeParamType} pRefSize, [MarshalUsing(CountElementName = ""pRefSize"")] ref int[] pRef @@ -1224,7 +1224,7 @@ public static partial void Method( {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( int pRefSize, [MarshalUsing(ConstantElementCount = 10, CountElementName = ""pRefSize"")] ref int[] pRef @@ -1236,7 +1236,7 @@ public static partial void Method( {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( int pRefSize, [MarshalUsing(CountElementName = null)] ref int[] pRef @@ -1262,7 +1262,7 @@ public Marshaller(TestCollection managed, int nativeElementSize) : this() {} [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalUsing(ConstantElementCount=10)] [return:MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] public static partial TestCollection Method( @@ -1288,7 +1288,7 @@ public IntWrapper(int i){} [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] TestCollection p); } @@ -1306,7 +1306,7 @@ public IntWrapper(int i){} [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 2)] TestCollection p); } @@ -1324,7 +1324,7 @@ public IntWrapper(int i){} [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalUsing(ConstantElementCount=10)] [return:MarshalAs(UnmanagedType.LPArray, SizeConst=10)] public static partial int[] Method(); @@ -1336,7 +1336,7 @@ partial class Test [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalUsing(CountElementName=MarshalUsingAttribute.ReturnsCountValue)] public static partial int[] Method(); } @@ -1347,7 +1347,7 @@ partial class Test [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalUsing(CountElementName=""arr"")] ref int[] arr ); @@ -1358,7 +1358,7 @@ public static partial void Method( [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalUsing(CountElementName=""arr2"")] ref int[] arr, [MarshalUsing(CountElementName=""arr"")] ref int[] arr2 @@ -1370,7 +1370,7 @@ public static partial void Method( [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ref int[] arr, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref int[] arr2 @@ -1383,7 +1383,7 @@ public static partial void Method( [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalUsing(CountElementName=""arr0"", ElementIndirectionLevel = 0)] [MarshalUsing(CountElementName=""arr1"", ElementIndirectionLevel = 1)] @@ -1460,9 +1460,9 @@ public static string RefReturn(string typeName) => $@" using System.Runtime.InteropServices; partial struct Basic {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial ref {typeName} RefReturn(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial ref readonly {typeName} RefReadonlyReturn(); }}"; @@ -1471,7 +1471,7 @@ partial struct Basic partial struct Basic { - [GeneratedDllImport(""DoesNotExist"", SetLa)] + [LibraryImport(""DoesNotExist"", SetLa)] public static partial void Method(); } "; @@ -1480,7 +1480,7 @@ partial struct Basic partial struct Basic { - [GeneratedDllImport(DoesNotExist)] + [LibraryImport(DoesNotExist)] public static partial void Method(); } "; @@ -1489,7 +1489,7 @@ partial struct Basic partial struct Basic { - [GeneratedDllImport(""DoesNotExist"", SetLastError = ""Foo"")] + [LibraryImport(""DoesNotExist"", SetLastError = ""Foo"")] public static partial void Method(); } "; diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CompileFails.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CompileFails.cs index 686e4787b01b78..eb10a5217c99b9 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CompileFails.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CompileFails.cs @@ -17,7 +17,7 @@ public class CompileFails { public static IEnumerable CodeSnippetsToCompile() { - // Not GeneratedDllImportAttribute + // Not LibraryImportAttribute yield return new object[] { CodeSnippets.UserDefinedPrefixedAttributes, 0, 3 }; // No explicit marshalling for char or string diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Compiles.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Compiles.cs index 0ce0de3f02a7a1..9ee978e98177c6 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Compiles.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Compiles.cs @@ -24,7 +24,7 @@ public static IEnumerable CodeSnippetsToCompile() yield return new[] { CodeSnippets.NestedTypes }; yield return new[] { CodeSnippets.UnsafeContext }; yield return new[] { CodeSnippets.UserDefinedEntryPoint }; - yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments }; + yield return new[] { CodeSnippets.AllLibraryImportNamedArguments }; yield return new[] { CodeSnippets.DefaultParameters }; yield return new[] { CodeSnippets.UseCSharpFeaturesForConstants }; @@ -277,7 +277,7 @@ public static IEnumerable CodeSnippetsToValidateFallbackForwarder() // Confirm that all unsupported target frameworks can be generated. { - string code = CodeSnippets.BasicParametersAndModifiers(CodeSnippets.GeneratedDllImportAttributeDeclaration); + string code = CodeSnippets.BasicParametersAndModifiers(CodeSnippets.LibraryImportAttributeDeclaration); yield return new object[] { code, TestTargetFramework.Net5, false }; yield return new object[] { code, TestTargetFramework.Core, false }; yield return new object[] { code, TestTargetFramework.Standard, false }; @@ -286,7 +286,7 @@ public static IEnumerable CodeSnippetsToValidateFallbackForwarder() // Confirm that all unsupported target frameworks fallback to a forwarder. { - string code = CodeSnippets.BasicParametersAndModifiers(CodeSnippets.GeneratedDllImportAttributeDeclaration); + string code = CodeSnippets.BasicParametersAndModifiers(CodeSnippets.LibraryImportAttributeDeclaration); yield return new object[] { code, TestTargetFramework.Net5, true }; yield return new object[] { code, TestTargetFramework.Core, true }; yield return new object[] { code, TestTargetFramework.Standard, true }; @@ -295,7 +295,7 @@ public static IEnumerable CodeSnippetsToValidateFallbackForwarder() // Confirm that all unsupported target frameworks fallback to a forwarder. { - string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling(StringMarshalling.Utf16, CodeSnippets.GeneratedDllImportAttributeDeclaration); + string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling(StringMarshalling.Utf16, CodeSnippets.LibraryImportAttributeDeclaration); yield return new object[] { code, TestTargetFramework.Net5, true }; yield return new object[] { code, TestTargetFramework.Core, true }; yield return new object[] { code, TestTargetFramework.Standard, true }; @@ -369,7 +369,7 @@ public async Task ValidateSnippetsWithBlittableAutoForwarding(string source) public static IEnumerable SnippetsWithBlittableTypesButNonBlittableDataToCompile() { - yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments }; + yield return new[] { CodeSnippets.AllLibraryImportNamedArguments }; yield return new[] { CodeSnippets.BasicParametersAndModifiers() }; yield return new[] { CodeSnippets.SetLastErrorTrue() }; } diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs index 23c9db0c867afb..fca4e291241ab5 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs @@ -153,13 +153,13 @@ unsafe partial class Test } [ConditionalFact] - public async Task GeneratedDllImport_NoDiagnostic() + public async Task LibraryImport_NoDiagnostic() { string source = @$" using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); }} partial class Test diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs index 8398378555fcc8..890cc95234b7d6 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs @@ -34,7 +34,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {{|CS8795:Method|}}(out int ret); }}"; await VerifyCS.VerifyCodeFixAsync( @@ -64,11 +64,11 @@ partial class Test partial class Test {{ // P/Invoke - [GeneratedDllImport(/*name*/""DoesNotExist"")] // comment + [LibraryImport(/*name*/""DoesNotExist"")] // comment public static partial int {{|CS8795:Method1|}}(out int ret); /** P/Invoke **/ - [GeneratedDllImport(""DoesNotExist"") /*name*/] + [LibraryImport(""DoesNotExist"") /*name*/] // < ... > public static partial int {{|CS8795:Method2|}}(out int ret); }}"; @@ -97,11 +97,11 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [System.ComponentModel.Description(""Test""), GeneratedDllImport(""DoesNotExist"")] + [System.ComponentModel.Description(""Test""), LibraryImport(""DoesNotExist"")] public static partial int {{|CS8795:Method1|}}(out int ret); [System.ComponentModel.Description(""Test"")] - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.I4)] public static partial int {{|CS8795:Method2|}}(out int ret); }}"; @@ -128,10 +128,10 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial int {{|CS8795:Method1|}}(out int ret); - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"", StringMarshalling = StringMarshalling.Utf16)] public static partial string {{|CS8795:Method2|}}(out int ret); }}"; await VerifyCS.VerifyCodeFixAsync( @@ -166,19 +166,19 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial int {{|CS8795:Method|}}(out int ret); - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial int {{|CS8795:Method1|}}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {{|CS8795:Method2|}}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {{|CS8795:Method3|}}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {{|CS8795:Method4|}}(out int ret); }}"; await VerifyCS.VerifyCodeFixAsync( @@ -201,7 +201,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial int {{|CS8795:Method1|}}(out int ret); }}"; await VerifyCS.VerifyCodeFixAsync( @@ -228,7 +228,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] [UnmanagedCallConv(CallConvs = new System.Type[] {{ typeof({callConvType.FullName}) }})] public static partial int {{|CS8795:Method1|}}(out int ret); }}"; @@ -252,7 +252,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial string {{|CS8795:Method|}}(out int ret); }}"; await VerifyCS.VerifyCodeFixAsync( @@ -276,7 +276,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey); @@ -284,7 +284,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithSuffix, $"{ConvertToLibraryImportKey}{suffix}"); @@ -304,7 +304,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey); @@ -312,7 +312,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryA"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A"); @@ -320,7 +320,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryW"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryW"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithWSuffix, $"{ConvertToLibraryImportKey}W"); @@ -340,7 +340,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey); @@ -348,7 +348,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryA"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A"); @@ -370,7 +370,7 @@ partial class Test partial class Test {{ private const string EntryPoint = ""Entry""; - [GeneratedDllImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"")] + [LibraryImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A"); @@ -390,7 +390,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""MethodA"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A"); @@ -412,7 +412,7 @@ partial class Test partial class Test {{ private const string Foo = ""Bar""; - [GeneratedDllImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"")] + [LibraryImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A"); @@ -432,7 +432,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"")] + [LibraryImport(""DoesNotExist"", EntryPoint = ""MethodA"")] public static partial void {{|CS8795:Method|}}(); }}"; await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A"); @@ -463,9 +463,9 @@ public static void Code() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:VoidMethod|}(int param); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method|}(int param, out long @return); public static void Code() @@ -559,7 +559,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool {{|CS8795:Method|}}([MarshalAs(UnmanagedType.Bool)] bool b); }}"; diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Diagnostics.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Diagnostics.cs index 56ad8895a66029..1c7a492b775f3c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Diagnostics.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Diagnostics.cs @@ -25,10 +25,10 @@ public async Task TargetFrameworkNotSupported_NoDiagnostic(TestTargetFramework t { string source = $@" using System.Runtime.InteropServices; -{CodeSnippets.GeneratedDllImportAttributeDeclaration} +{CodeSnippets.LibraryImportAttributeDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); }} "; @@ -47,7 +47,7 @@ partial class Test [InlineData(TestTargetFramework.Core)] [InlineData(TestTargetFramework.Standard)] [InlineData(TestTargetFramework.Net5)] - public async Task TargetFrameworkNotSupported_NoGeneratedDllImport_NoDiagnostic(TestTargetFramework targetFramework) + public async Task TargetFrameworkNotSupported_NoLibraryImport_NoDiagnostic(TestTargetFramework targetFramework) { string source = @" using System.Runtime.InteropServices; @@ -79,10 +79,10 @@ class MyClass { } } partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method1(NS.MyClass c); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2(int i, List list); } "; @@ -117,10 +117,10 @@ class MyClass { } } partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial NS.MyClass Method1(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial List Method2(); } "; @@ -150,7 +150,7 @@ public async Task ParameterTypeNotSupportedWithDetails_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(char c, string s); } "; @@ -178,10 +178,10 @@ public async Task ReturnTypeNotSupportedWithDetails_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial char Method1(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial string Method2(); } "; @@ -209,10 +209,10 @@ public async Task ParameterConfigurationNotSupported_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method1([MarshalAs(UnmanagedType.BStr)] int i1, int i2); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2(int i1, [MarshalAs(UnmanagedType.FunctionPtr)] bool b2); } "; @@ -242,11 +242,11 @@ public async Task ReturnConfigurationNotSupported_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.BStr)] public static partial int Method1(int i); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static partial bool Method2(int i); } @@ -277,11 +277,11 @@ public async Task MarshalAsUnmanagedTypeNotSupported_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(1)] public static partial int Method1(int i); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int Method2([MarshalAs((short)0)] bool b); } "; @@ -317,11 +317,11 @@ public async Task MarshalAsFieldNotSupported_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return: MarshalAs(UnmanagedType.I4, SafeArraySubType=VarEnum.VT_I4)] public static partial int Method1(int i); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int Method2([MarshalAs(UnmanagedType.I1, IidParameterIndex = 1)] bool b); } "; @@ -350,10 +350,10 @@ public async Task StringMarshallingForwardingNotSupported_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8)] public static partial void Method1(string s); - [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(Native))] + [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(Native))] public static partial void Method2(string s); struct Native @@ -362,7 +362,7 @@ public Native(string s) { } public string ToManaged() => default; } } -" + CodeSnippets.GeneratedDllImportAttributeDeclaration; +" + CodeSnippets.LibraryImportAttributeDeclaration; // Compile against Standard so that we generate forwarders Compilation comp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard); @@ -373,13 +373,13 @@ public Native(string s) { } { (new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport)) .WithSpan(6, 32, 6, 39) - .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Utf8)}"), + .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Utf8)}"), (new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport)) .WithSpan(9, 32, 9, 39) - .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"), + .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"), (new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport)) .WithSpan(9, 32, 9, 39) - .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(GeneratedDllImportAttribute.StringMarshallingCustomType)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"), + .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(LibraryImportAttribute.StringMarshallingCustomType)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"), (new DiagnosticResult(GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails)) .WithSpan(9, 47, 9, 48) }; @@ -396,10 +396,10 @@ public async Task InvalidStringMarshallingConfiguration_ReportsDiagnostic() {CodeSnippets.DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom)] + [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom)] public static partial void Method1(out int i); - [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8, StringMarshallingCustomType = typeof(Native))] + [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8, StringMarshallingCustomType = typeof(Native))] public static partial void Method2(out int i); struct Native @@ -417,9 +417,9 @@ public Native(string s) {{ }} DiagnosticResult[] expectedDiags = new DiagnosticResult[] { (new DiagnosticResult(GeneratorDiagnostics.InvalidStringMarshallingConfiguration)) - .WithSpan(6, 6, 6, 86), + .WithSpan(6, 6, 6, 81), (new DiagnosticResult(GeneratorDiagnostics.InvalidStringMarshallingConfiguration)) - .WithSpan(9, 6, 9, 130) + .WithSpan(9, 6, 9, 125) }; VerifyDiagnostics(expectedDiags, GetSortedDiagnostics(generatorDiags)); var newCompDiags = newComp.GetDiagnostics(); @@ -433,10 +433,10 @@ public async Task NonPartialMethod_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static void Method() { } - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static extern void ExternMethod(); } "; @@ -465,7 +465,7 @@ public async Task NonStaticMethod_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public partial void Method(); } "; @@ -492,10 +492,10 @@ public async Task GenericMethod_ReportsDiagnostic() using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method1(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2(); } "; @@ -528,7 +528,7 @@ public async Task NonPartialParentType_Diagnostic(string typeKind) using System.Runtime.InteropServices; {typeKind} Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); }} "; @@ -563,7 +563,7 @@ public async Task NonPartialGrandparentType_Diagnostic(string typeKind) {{ partial class TestInner {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] static partial void Method(); }} }} diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/IncrementalGenerationTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/IncrementalGenerationTests.cs index a5a70734dee8fe..688b24beb3d973 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/IncrementalGenerationTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/IncrementalGenerationTests.cs @@ -76,7 +76,7 @@ public async Task AppendingUnrelatedSource_DoesNotRegenerateSource() } [ConditionalFact] - public async Task AddingFileWithNewGeneratedDllImport_DoesNotRegenerateOriginalMethod() + public async Task AddingFileWithNewLibraryImport_DoesNotRegenerateOriginalMethod() { string source = CodeSnippets.BasicParametersAndModifiers(); @@ -106,7 +106,7 @@ public async Task AddingFileWithNewGeneratedDllImport_DoesNotRegenerateOriginalM } [ConditionalFact] - public async Task ReplacingFileWithNewGeneratedDllImport_DoesNotRegenerateStubsInOtherFiles() + public async Task ReplacingFileWithNewLibraryImport_DoesNotRegenerateStubsInOtherFiles() { Compilation comp1 = await TestUtils.CreateCompilation(new string[] { CodeSnippets.BasicParametersAndModifiers(), CodeSnippets.BasicParametersAndModifiers() }); diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/TestUtils.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/TestUtils.cs index 1864d2ed66f522..cabfb327be4270 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/TestUtils.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/TestUtils.cs @@ -75,8 +75,8 @@ public static void AssertPreSourceGeneratorCompilation(Compilation comp, params var allowedDiagnostics = new HashSet() { "CS8795", // Partial method impl missing - "CS0234", // Missing type or namespace - GeneratedDllImportAttribute - "CS0246", // Missing type or namespace - GeneratedDllImportAttribute + "CS0234", // Missing type or namespace - LibraryImportAttribute + "CS0246", // Missing type or namespace - LibraryImportAttribute "CS8019", // Unnecessary using }; @@ -183,7 +183,7 @@ internal static MetadataReference GetAncillaryReference() { // Include the assembly containing the new attribute and all of its references. // [TODO] Remove once the attribute has been added to the BCL - var attrAssem = typeof(GeneratedDllImportAttribute).GetTypeInfo().Assembly; + var attrAssem = typeof(LibraryImportAttribute).GetTypeInfo().Assembly; return MetadataReference.CreateFromFile(attrAssem.Location); } diff --git a/src/samples/LibraryImportGeneratorSample/Program.cs b/src/samples/LibraryImportGeneratorSample/Program.cs index 4a1c8335bf4180..4d74606fb64ce7 100644 --- a/src/samples/LibraryImportGeneratorSample/Program.cs +++ b/src/samples/LibraryImportGeneratorSample/Program.cs @@ -10,13 +10,13 @@ internal static partial class NativeExportsNE { public const string NativeExportsNE_Binary = "Microsoft.Interop.Tests." + nameof(NativeExportsNE); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumi")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumi")] public static partial int Sum(int a, int b); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumouti")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumouti")] public static partial void Sum(int a, int b, out int c); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumrefi")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumrefi")] public static partial void Sum(int a, ref int b); } From 99aec0174b3f20afecf3c80c9bf4ea8957d8a1c3 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 7 Mar 2022 10:10:42 -0800 Subject: [PATCH 2/5] Update usage in libraries --- .../src/System/Buffer.CoreCLR.cs | 4 +- .../src/System/CLRConfig.cs | 2 +- .../src/System/Diagnostics/Debugger.cs | 4 +- .../Diagnostics/Eventing/EventPipe.CoreCLR.cs | 22 +- ....PortableThreadPool.NativeSinks.CoreCLR.cs | 18 +- .../System/Diagnostics/StackFrame.CoreCLR.cs | 2 +- .../src/System/Enum.CoreCLR.cs | 2 +- .../src/System/Environment.CoreCLR.cs | 4 +- .../src/System/Exception.CoreCLR.cs | 2 +- .../System.Private.CoreLib/src/System/GC.cs | 18 +- .../System/IO/FileLoadException.CoreCLR.cs | 4 +- .../src/System/Reflection/Assembly.CoreCLR.cs | 6 +- .../System/Reflection/Emit/AssemblyBuilder.cs | 2 +- .../System/Reflection/Emit/ModuleBuilder.cs | 18 +- .../src/System/Reflection/Emit/TypeBuilder.cs | 42 +- .../src/System/Reflection/LoaderAllocator.cs | 2 +- .../Reflection/Metadata/AssemblyExtensions.cs | 2 +- .../Reflection/Metadata/MetadataUpdater.cs | 4 +- .../src/System/Reflection/RuntimeAssembly.cs | 40 +- .../src/System/Reflection/RuntimeModule.cs | 6 +- .../RuntimeHelpers.CoreCLR.cs | 12 +- .../Runtime/InteropServices/ComWrappers.cs | 10 +- .../InteropServices/Marshal.CoreCLR.cs | 16 +- .../InteropServices/NativeLibrary.CoreCLR.cs | 8 +- .../ObjectiveCMarshal.CoreCLR.cs | 6 +- .../Runtime/Intrinsics/X86/X86Base.CoreCLR.cs | 2 +- .../Loader/AssemblyLoadContext.CoreCLR.cs | 24 +- .../src/System/RuntimeHandles.cs | 64 +- .../src/System/RuntimeType.CoreCLR.cs | 4 +- .../src/System/StubHelpers.cs | 2 +- .../System/Threading/Interlocked.CoreCLR.cs | 2 +- .../Threading/LowLevelLifoSemaphore.Unix.cs | 2 +- .../src/System/Threading/Monitor.CoreCLR.cs | 2 +- .../src/System/Threading/Thread.CoreCLR.cs | 10 +- .../System/Threading/ThreadPool.CoreCLR.cs | 6 +- .../src/System/Threading/Timer.CoreCLR.cs | 6 +- .../src/System/TypeLoadException.CoreCLR.cs | 2 +- .../src/System/TypeNameParser.cs | 12 +- .../src/System/Runtime/InternalCalls.cs | 24 +- .../src/System/Runtime/RuntimeExports.cs | 2 +- .../src/System/Runtime/RuntimeImports.cs | 30 +- .../src/System/Runtime/RuntimeImports.cs | 2 +- .../Android/Interop.JObjectLifetime.cs | 4 +- .../src/Interop/Android/Interop.Logcat.cs | 2 +- .../Interop.Bignum.cs | 4 +- .../Interop.Cipher.cs | 80 +- .../Interop.Dsa.cs | 16 +- .../Interop.EcDsa.ImportExport.cs | 8 +- .../Interop.EcDsa.cs | 6 +- .../Interop.EcKey.cs | 10 +- .../Interop.Ecdh.cs | 2 +- .../Interop.Err.cs | 12 +- .../Interop.Evp.DigestAlgs.cs | 10 +- .../Interop.Evp.cs | 20 +- .../Interop.Hmac.cs | 14 +- .../Interop.Initialization.cs | 2 +- .../Interop.Random.cs | 2 +- .../Interop.Rsa.cs | 24 +- .../Interop.Ssl.ProtocolSupport.cs | 4 +- .../Interop.Ssl.cs | 36 +- .../Interop.X509.cs | 12 +- .../Interop.X509Chain.cs | 20 +- .../Interop.X509Store.cs | 14 +- .../Interop.ProtocolStatistics.cs | 14 +- .../BSD/System.Native/Interop.Sysctl.cs | 2 +- .../Interop.TcpConnectionInfo.cs | 8 +- .../Common/src/Interop/Interop.Brotli.cs | 22 +- .../Common/src/Interop/Interop.Calendar.cs | 10 +- .../Common/src/Interop/Interop.Casing.cs | 8 +- .../Common/src/Interop/Interop.Collation.cs | 22 +- .../Common/src/Interop/Interop.HostPolicy.cs | 6 +- .../Common/src/Interop/Interop.ICU.cs | 6 +- .../Common/src/Interop/Interop.ICU.iOS.cs | 2 +- .../Common/src/Interop/Interop.Idna.cs | 4 +- .../Common/src/Interop/Interop.Locale.cs | 16 +- .../src/Interop/Interop.Normalization.cs | 4 +- .../Common/src/Interop/Interop.Odbc.cs | 88 +- .../src/Interop/Interop.TimeZoneInfo.cs | 6 +- .../Common/src/Interop/Interop.zlib.cs | 18 +- .../src/Interop/Linux/OpenLdap/Interop.Ber.cs | 48 +- .../Interop/Linux/OpenLdap/Interop.Ldap.cs | 96 +- .../Linux/System.Native/Interop.INotify.cs | 6 +- .../OSX/Interop.CoreFoundation.CFArray.cs | 4 +- .../OSX/Interop.CoreFoundation.CFData.cs | 4 +- .../OSX/Interop.CoreFoundation.CFDate.cs | 2 +- .../Interop.CoreFoundation.CFDictionary.cs | 2 +- .../OSX/Interop.CoreFoundation.CFError.cs | 4 +- .../OSX/Interop.CoreFoundation.CFNumber.cs | 2 +- .../OSX/Interop.CoreFoundation.CFProxy.cs | 8 +- .../OSX/Interop.CoreFoundation.CFString.cs | 4 +- .../OSX/Interop.CoreFoundation.CFUrl.cs | 2 +- .../src/Interop/OSX/Interop.CoreFoundation.cs | 12 +- .../src/Interop/OSX/Interop.EventStream.cs | 16 +- .../Common/src/Interop/OSX/Interop.RunLoop.cs | 16 +- .../OSX/Interop.SystemConfiguration.cs | 8 +- .../Common/src/Interop/OSX/Interop.libc.cs | 2 +- .../Common/src/Interop/OSX/Interop.libobjc.cs | 10 +- .../OSX/Interop.libproc.GetProcessInfoById.cs | 2 +- .../Common/src/Interop/OSX/Interop.libproc.cs | 12 +- .../System.Native/Interop.AutoreleasePool.cs | 4 +- .../OSX/System.Native/Interop.SearchPath.cs | 2 +- .../System.Native/Interop.SearchPath.iOS.cs | 2 +- .../Interop.iOSSupportVersion.cs | 2 +- .../Interop.Digest.cs | 14 +- .../Interop.Ecc.cs | 4 +- .../Interop.Hmac.cs | 14 +- .../Interop.KeyAgree.cs | 2 +- .../Interop.Keychain.iOS.cs | 8 +- .../Interop.Keychain.macOS.cs | 24 +- .../Interop.Pbkdf2.cs | 2 +- .../Interop.RSA.cs | 16 +- .../Interop.Random.cs | 2 +- .../Interop.SecErrMessage.cs | 2 +- .../Interop.SecKeyRef.cs | 8 +- .../Interop.SecKeyRef.macOS.cs | 4 +- .../Interop.SignVerify.cs | 4 +- .../Interop.Ssl.cs | 48 +- .../Interop.Symmetric.cs | 10 +- .../Interop.Trust.cs | 8 +- .../Interop.X509.cs | 14 +- .../Interop.X509.iOS.cs | 4 +- .../Interop.X509.macOS.cs | 10 +- .../Interop.X509Chain.cs | 20 +- ...rop.ProcFsStat.TryReadProcessStatusInfo.cs | 2 +- .../Common/src/Interop/Unix/Interop.Errors.cs | 12 +- .../System.IO.Ports.Native/Interop.Serial.cs | 12 +- .../System.IO.Ports.Native/Interop.Termios.cs | 20 +- .../Unix/System.Native/Interop.Abort.cs | 2 +- .../Unix/System.Native/Interop.Accept.cs | 2 +- .../Unix/System.Native/Interop.Access.cs | 2 +- .../Unix/System.Native/Interop.Bind.cs | 2 +- .../Unix/System.Native/Interop.ChDir.cs | 2 +- .../Unix/System.Native/Interop.ChMod.cs | 2 +- .../Unix/System.Native/Interop.Close.cs | 2 +- ...nterop.ConfigureTerminalForChildProcess.cs | 2 +- .../Unix/System.Native/Interop.Connect.cs | 2 +- .../Unix/System.Native/Interop.CopyFile.cs | 2 +- .../Unix/System.Native/Interop.Disconnect.cs | 2 +- .../Interop/Unix/System.Native/Interop.Dup.cs | 2 +- .../Unix/System.Native/Interop.DynamicLoad.cs | 8 +- .../Interop.EnumerateInterfaceAddresses.cs | 6 +- .../Unix/System.Native/Interop.ErrNo.cs | 4 +- .../Unix/System.Native/Interop.Exit.cs | 2 +- .../Unix/System.Native/Interop.FAllocate.cs | 2 +- .../Unix/System.Native/Interop.FChMod.cs | 2 +- .../Unix/System.Native/Interop.FLock.cs | 4 +- .../Unix/System.Native/Interop.FSync.cs | 2 +- .../Unix/System.Native/Interop.FTruncate.cs | 2 +- .../Unix/System.Native/Interop.Fcntl.Pipe.cs | 6 +- .../Unix/System.Native/Interop.Fcntl.cs | 12 +- .../Interop.ForkAndExecProcess.cs | 2 +- .../Interop.GetBytesAvailable.cs | 4 +- .../Interop.GetControlCharacters.cs | 2 +- .../Interop.GetCpuUtilization.cs | 2 +- .../Unix/System.Native/Interop.GetCwd.cs | 2 +- .../Interop.GetDefaultTimeZone.Android.cs | 2 +- .../System.Native/Interop.GetDomainName.cs | 2 +- .../Interop.GetDomainSocketSizes.cs | 2 +- .../Unix/System.Native/Interop.GetEUid.cs | 2 +- .../Unix/System.Native/Interop.GetEnv.cs | 2 +- .../Unix/System.Native/Interop.GetEnviron.cs | 4 +- .../System.Native/Interop.GetGroupList.cs | 2 +- .../Unix/System.Native/Interop.GetHostName.cs | 2 +- .../Interop.GetMaximumAddressSize.cs | 2 +- .../Unix/System.Native/Interop.GetNameInfo.cs | 2 +- .../Interop.GetOSArchitecture.cs | 2 +- .../Unix/System.Native/Interop.GetPeerID.cs | 2 +- .../Unix/System.Native/Interop.GetPeerName.cs | 2 +- .../System.Native/Interop.GetPeerUserName.cs | 2 +- .../Unix/System.Native/Interop.GetPid.cs | 2 +- .../System.Native/Interop.GetProcessPath.cs | 2 +- .../Unix/System.Native/Interop.GetPwUid.cs | 4 +- .../System.Native/Interop.GetRandomBytes.cs | 4 +- .../System.Native/Interop.GetSetPriority.cs | 4 +- .../Unix/System.Native/Interop.GetSid.cs | 2 +- .../Unix/System.Native/Interop.GetSockName.cs | 2 +- .../Unix/System.Native/Interop.GetSockOpt.cs | 6 +- .../Interop.GetSocketErrorOption.cs | 2 +- .../System.Native/Interop.GetSocketType.cs | 2 +- .../Interop.GetSystemTimeAsTicks.cs | 2 +- .../System.Native/Interop.GetTimestamp.cs | 2 +- .../Unix/System.Native/Interop.GetUnixName.cs | 2 +- .../System.Native/Interop.GetUnixRelease.cs | 2 +- .../System.Native/Interop.GetUnixVersion.cs | 2 +- .../System.Native/Interop.GetWindowWidth.cs | 2 +- .../Unix/System.Native/Interop.HostEntry.cs | 4 +- .../Interop.IPPacketInformation.cs | 4 +- ...rop.InitializeTerminalAndSignalHandling.cs | 4 +- .../Interop.InterfaceNameToIndex.cs | 2 +- .../Unix/System.Native/Interop.IsATty.cs | 2 +- .../System.Native/Interop.IsMemberOfGroup.cs | 4 +- .../Unix/System.Native/Interop.Kill.cs | 2 +- .../Unix/System.Native/Interop.LChflags.cs | 6 +- .../Unix/System.Native/Interop.LSeek.cs | 2 +- .../System.Native/Interop.LingerOption.cs | 6 +- .../Unix/System.Native/Interop.Link.cs | 2 +- .../Unix/System.Native/Interop.Listen.cs | 2 +- .../System.Native/Interop.LockFileRegion.cs | 2 +- .../Interop/Unix/System.Native/Interop.Log.cs | 4 +- .../System.Native/Interop.LowLevelMonitor.cs | 14 +- .../Unix/System.Native/Interop.MAdvise.cs | 2 +- .../Unix/System.Native/Interop.MMap.cs | 2 +- .../Unix/System.Native/Interop.MSync.cs | 2 +- .../Unix/System.Native/Interop.MUnmap.cs | 2 +- .../Unix/System.Native/Interop.MapTcpState.cs | 2 +- .../Unix/System.Native/Interop.MemAlloc.cs | 14 +- .../Unix/System.Native/Interop.MemSet.cs | 2 +- .../Unix/System.Native/Interop.MkDir.cs | 2 +- .../Unix/System.Native/Interop.MksTemps.cs | 2 +- .../Interop.MountPoints.FormatInfo.cs | 4 +- .../Unix/System.Native/Interop.MountPoints.cs | 2 +- .../System.Native/Interop.MulticastOption.cs | 8 +- .../System.Native/Interop.NetworkChange.cs | 4 +- .../Unix/System.Native/Interop.Open.cs | 2 +- .../Unix/System.Native/Interop.PRead.cs | 2 +- .../Unix/System.Native/Interop.PReadV.cs | 2 +- .../Unix/System.Native/Interop.PWrite.cs | 2 +- .../Unix/System.Native/Interop.PWriteV.cs | 2 +- .../Unix/System.Native/Interop.PathConf.cs | 2 +- .../Unix/System.Native/Interop.Pipe.cs | 2 +- .../Interop.PlatformSocketSupport.cs | 2 +- .../Unix/System.Native/Interop.Poll.cs | 2 +- .../System.Native/Interop.PosixFAdvise.cs | 2 +- .../Unix/System.Native/Interop.PosixSignal.cs | 10 +- .../Unix/System.Native/Interop.Read.Pipe.cs | 2 +- .../Unix/System.Native/Interop.Read.cs | 2 +- .../Unix/System.Native/Interop.ReadDir.cs | 8 +- .../Unix/System.Native/Interop.ReadLink.cs | 2 +- .../Interop.ReadStdinUnbuffered.cs | 6 +- .../Unix/System.Native/Interop.RealPath.cs | 2 +- .../Unix/System.Native/Interop.Receive.cs | 2 +- .../System.Native/Interop.ReceiveMessage.cs | 2 +- .../Interop.RegisterForSigChld.cs | 2 +- .../Unix/System.Native/Interop.Rename.cs | 4 +- .../System.Native/Interop.ResourceLimits.cs | 4 +- .../Unix/System.Native/Interop.RmDir.cs | 2 +- .../Unix/System.Native/Interop.SNPrintF.cs | 4 +- .../Unix/System.Native/Interop.SchedGetCpu.cs | 2 +- .../Interop.SchedGetSetAffinity.cs | 4 +- .../Unix/System.Native/Interop.Send.cs | 2 +- .../Unix/System.Native/Interop.SendFile.cs | 2 +- .../Unix/System.Native/Interop.SendMessage.cs | 2 +- ...ayedSigChildConsoleConfigurationHandler.cs | 2 +- .../Unix/System.Native/Interop.SetEUid.cs | 2 +- .../Interop.SetReceiveTimeout.cs | 2 +- .../System.Native/Interop.SetSendTimeout.cs | 2 +- .../Interop.SetSignalForBreak.cs | 4 +- .../Unix/System.Native/Interop.SetSockOpt.cs | 6 +- .../Interop.SetTerminalInvalidationHandler.cs | 2 +- .../Unix/System.Native/Interop.ShmOpen.cs | 4 +- .../Unix/System.Native/Interop.Shutdown.cs | 4 +- .../Unix/System.Native/Interop.Socket.cs | 2 +- .../System.Native/Interop.SocketAddress.cs | 18 +- .../Unix/System.Native/Interop.SocketEvent.cs | 14 +- .../Unix/System.Native/Interop.Stat.Pipe.cs | 2 +- .../Unix/System.Native/Interop.Stat.Span.cs | 4 +- .../Unix/System.Native/Interop.Stat.cs | 6 +- .../Unix/System.Native/Interop.StdinReady.cs | 2 +- .../Unix/System.Native/Interop.SymLink.cs | 2 +- .../Unix/System.Native/Interop.Sync.cs | 2 +- .../Unix/System.Native/Interop.SysConf.cs | 2 +- .../Unix/System.Native/Interop.SysLog.cs | 2 +- .../Unix/System.Native/Interop.Threading.cs | 2 +- .../Unix/System.Native/Interop.UTimensat.cs | 2 +- .../Interop.UnixFileSystemTypes.cs | 2 +- .../Unix/System.Native/Interop.Unlink.cs | 2 +- .../Unix/System.Native/Interop.WaitId.cs | 2 +- .../Unix/System.Native/Interop.WaitPid.cs | 2 +- .../Unix/System.Native/Interop.Write.Pipe.cs | 2 +- .../Unix/System.Native/Interop.Write.cs | 4 +- ...terop.NetSecurityNative.IsNtlmInstalled.cs | 4 +- .../Interop.NetSecurityNative.cs | 34 +- .../Interop.ASN1.GetIntegerBytes.cs | 4 +- .../Interop.ASN1.Nid.cs | 2 +- .../Interop.ASN1.cs | 20 +- .../Interop.BIO.cs | 18 +- .../Interop.Bignum.cs | 8 +- .../Interop.CheckX509Hostname_IntPtr.cs | 2 +- .../Interop.Crypto.cs | 38 +- .../Interop.Dsa.cs | 20 +- .../Interop.ERR.cs | 12 +- .../Interop.EVP.Cipher.cs | 88 +- .../Interop.EVP.DigestAlgs.cs | 10 +- .../Interop.EVP.cs | 20 +- .../Interop.EcDsa.ImportExport.cs | 8 +- .../Interop.EcDsa.cs | 6 +- .../Interop.EcKey.cs | 12 +- .../Interop.EvpPkey.Dsa.cs | 4 +- .../Interop.EvpPkey.EcKey.cs | 4 +- .../Interop.EvpPkey.Ecdh.cs | 6 +- .../Interop.EvpPkey.Rsa.cs | 12 +- .../Interop.EvpPkey.cs | 22 +- .../Interop.Hmac.cs | 14 +- .../Interop.Initialization.cs | 2 +- .../Interop.LegacyAlgorithms.cs | 2 +- .../Interop.LookupFriendlyNameByOid.cs | 2 +- .../Interop.OCSP.cs | 16 +- .../Interop.OpenSslAvailable.cs | 2 +- .../Interop.OpenSslGetProtocolSupport.cs | 2 +- .../Interop.OpenSslVersion.cs | 2 +- .../Interop.Pkcs7.cs | 16 +- .../Interop.RAND.cs | 2 +- .../Interop.SetProtocolOptions.cs | 4 +- .../Interop.Ssl.cs | 88 +- .../Interop.SslCtx.cs | 8 +- .../Interop.SslCtxOptions.cs | 14 +- .../Interop.X509.cs | 92 +- .../Interop.X509Ext.cs | 12 +- .../Interop.X509Name.cs | 6 +- .../Interop.X509Stack.cs | 16 +- .../Interop.X509StoreCtx.cs | 14 +- .../Interop/Unix/libc/Interop.GetParentPid.cs | 2 +- .../Windows/Activeds/Interop.ADsOpenObject.cs | 2 +- .../Advapi32/Interop.AdjustTokenPrivileges.cs | 2 +- .../Interop.AllocateLocallyUniqueId.cs | 2 +- .../Advapi32/Interop.ChangeServiceConfig2.cs | 2 +- .../Advapi32/Interop.CheckTokenMembership.cs | 2 +- .../Windows/Advapi32/Interop.ClearEventLog.cs | 2 +- .../Windows/Advapi32/Interop.CloseEventLog.cs | 2 +- .../Advapi32/Interop.CloseServiceHandle.cs | 2 +- .../Advapi32/Interop.ControlService.cs | 2 +- .../Advapi32/Interop.ConvertSdToStringSd.cs | 2 +- .../Advapi32/Interop.ConvertSidToStringSid.cs | 2 +- .../Advapi32/Interop.ConvertStringSdToSd.cs | 2 +- ...gSecurityDescriptorToSecurityDescriptor.cs | 2 +- .../Advapi32/Interop.ConvertStringSidToSid.cs | 2 +- .../Windows/Advapi32/Interop.CopySid.cs | 2 +- .../Interop.CreateProcessWithLogon.cs | 2 +- .../Windows/Advapi32/Interop.CreateService.cs | 2 +- .../Advapi32/Interop.CreateWellKnownSid.cs | 2 +- .../Advapi32/Interop.CryptAcquireContext.cs | 2 +- .../Interop.CryptAcquireContext_IntPtr.cs | 2 +- .../Advapi32/Interop.CryptCreateHash.cs | 2 +- .../Windows/Advapi32/Interop.CryptDecrypt.cs | 2 +- .../Advapi32/Interop.CryptDeriveKey.cs | 2 +- .../Advapi32/Interop.CryptDestroyHash.cs | 2 +- .../Advapi32/Interop.CryptDestroyKey.cs | 2 +- .../Windows/Advapi32/Interop.CryptEncrypt.cs | 2 +- .../Advapi32/Interop.CryptExportKey.cs | 2 +- .../Windows/Advapi32/Interop.CryptGenKey.cs | 2 +- .../Interop.CryptGetDefaultProvider.cs | 2 +- .../Advapi32/Interop.CryptGetHashParam.cs | 4 +- .../Advapi32/Interop.CryptGetKeyParam.cs | 2 +- .../Advapi32/Interop.CryptGetProvParam.cs | 6 +- .../Advapi32/Interop.CryptGetUserKey.cs | 2 +- .../Windows/Advapi32/Interop.CryptHashData.cs | 2 +- .../Advapi32/Interop.CryptImportKey.cs | 2 +- .../Advapi32/Interop.CryptReleaseContext.cs | 2 +- .../Advapi32/Interop.CryptSetKeyParam.cs | 4 +- .../Windows/Advapi32/Interop.CryptSignHash.cs | 4 +- .../Windows/Advapi32/Interop.DeleteService.cs | 2 +- .../Advapi32/Interop.DeregisterEventSource.cs | 2 +- .../Advapi32/Interop.DuplicateTokenEx.cs | 2 +- ...nterop.DuplicateTokenEx_SafeTokenHandle.cs | 2 +- .../Advapi32/Interop.EncryptDecrypt.cs | 4 +- .../Advapi32/Interop.EnumDependentServices.cs | 2 +- .../Advapi32/Interop.EnumServicesStatusEx.cs | 2 +- .../Advapi32/Interop.EqualDomainSid.cs | 2 +- .../Interop.EventActivityIdControl.cs | 2 +- .../Windows/Advapi32/Interop.EventRegister.cs | 2 +- .../Advapi32/Interop.EventSetInformation.cs | 2 +- .../Advapi32/Interop.EventTraceGuidsEx.cs | 2 +- .../Advapi32/Interop.EventUnregister.cs | 2 +- .../Advapi32/Interop.EventWriteString.cs | 2 +- .../Advapi32/Interop.EventWriteTransfer.cs | 2 +- .../Windows/Advapi32/Interop.GetLengthSid.cs | 2 +- .../Interop.GetNumberOfEventLogRecords.cs | 2 +- .../Interop.GetOldestEventLogRecord.cs | 2 +- .../Interop.GetSecurityDescriptorLength.cs | 2 +- .../Interop.GetSecurityInfoByHandle.cs | 2 +- .../Advapi32/Interop.GetSecurityInfoByName.cs | 2 +- .../Advapi32/Interop.GetServiceDisplayName.cs | 2 +- .../Advapi32/Interop.GetServiceKeyName.cs | 2 +- .../Interop.GetSidIdentifierAuthority.cs | 6 +- .../Advapi32/Interop.GetTokenInformation.cs | 2 +- ...etTokenInformation_SafeLocalAllocHandle.cs | 4 +- .../Interop.GetTokenInformation_void.cs | 2 +- .../Interop.GetWindowsAccountDomainSid.cs | 2 +- .../Interop.ImpersonateLoggedOnUser.cs | 2 +- .../Interop.ImpersonateLoggedOnUser_IntPtr.cs | 2 +- .../Interop.ImpersonateNamedPipeClient.cs | 2 +- .../Advapi32/Interop.IsEqualDomainSid.cs | 2 +- .../Windows/Advapi32/Interop.IsValidSid.cs | 2 +- .../Advapi32/Interop.IsWellKnownSid.cs | 2 +- .../Windows/Advapi32/Interop.LogonUser.cs | 2 +- .../Advapi32/Interop.LookupAccountNameW.cs | 2 +- .../Advapi32/Interop.LookupAccountSid.cs | 2 +- .../Advapi32/Interop.LookupPrivilegeValue.cs | 2 +- .../Windows/Advapi32/Interop.LsaClose.cs | 2 +- .../Windows/Advapi32/Interop.LsaFreeMemory.cs | 2 +- .../Advapi32/Interop.LsaLookupNames2.cs | 2 +- .../Windows/Advapi32/Interop.LsaLookupSids.cs | 2 +- .../Advapi32/Interop.LsaNtStatusToWinError.cs | 2 +- .../Windows/Advapi32/Interop.LsaOpenPolicy.cs | 2 +- .../Interop.LsaQueryInformationPolicy.cs | 2 +- .../Advapi32/Interop.NotifyChangeEventLog.cs | 2 +- .../Windows/Advapi32/Interop.OpenEventLog.cs | 2 +- .../Advapi32/Interop.OpenProcessToken.cs | 2 +- .../Interop.OpenProcessToken_IntPtr.cs | 2 +- ....OpenProcessToken_SafeAccessTokenHandle.cs | 2 +- .../Windows/Advapi32/Interop.OpenSCManager.cs | 2 +- .../Windows/Advapi32/Interop.OpenService.cs | 2 +- .../Advapi32/Interop.OpenThreadToken.cs | 2 +- ...Interop.OpenThreadToken_SafeTokenHandle.cs | 2 +- .../Advapi32/Interop.QueryServiceConfig.cs | 2 +- .../Advapi32/Interop.QueryServiceStatus.cs | 2 +- .../Windows/Advapi32/Interop.ReadEventLog.cs | 2 +- .../Windows/Advapi32/Interop.RegCloseKey.cs | 2 +- .../Advapi32/Interop.RegConnectRegistry.cs | 2 +- .../Advapi32/Interop.RegCreateKeyEx.cs | 2 +- .../Advapi32/Interop.RegDeleteKeyEx.cs | 2 +- .../Advapi32/Interop.RegDeleteValue.cs | 2 +- .../Windows/Advapi32/Interop.RegEnumKeyEx.cs | 2 +- .../Windows/Advapi32/Interop.RegEnumValue.cs | 2 +- .../Windows/Advapi32/Interop.RegFlushKey.cs | 2 +- .../Windows/Advapi32/Interop.RegOpenKeyEx.cs | 4 +- .../Advapi32/Interop.RegQueryInfoKey.cs | 2 +- .../Advapi32/Interop.RegQueryValueEx.cs | 8 +- .../Windows/Advapi32/Interop.RegSetValueEx.cs | 10 +- .../Advapi32/Interop.RegisterEventSource.cs | 2 +- .../Interop.RegisterServiceCtrlHandlerEx.cs | 2 +- .../Windows/Advapi32/Interop.ReportEvent.cs | 2 +- .../Windows/Advapi32/Interop.RevertToSelf.cs | 2 +- .../Interop.SetSecurityInfoByHandle.cs | 2 +- .../Advapi32/Interop.SetSecurityInfoByName.cs | 2 +- .../Advapi32/Interop.SetServiceStatus.cs | 2 +- .../Advapi32/Interop.SetThreadToken.cs | 2 +- .../Windows/Advapi32/Interop.StartService.cs | 2 +- .../Interop.StartServiceCtrlDispatcher.cs | 2 +- .../Interop.AuthzGetInformationFromContext.cs | 2 +- .../Interop.AuthzInitializeContextFromSid.cs | 4 +- .../Interop.AuthzInitializeResourceManager.cs | 4 +- .../Common/src/Interop/Windows/BCrypt/Cng.cs | 10 +- .../Interop.BCryptCloseAlgorithmProvider.cs | 2 +- .../BCrypt/Interop.BCryptCreateHash.cs | 2 +- .../BCrypt/Interop.BCryptDeriveKeyPBKDF2.cs | 2 +- .../BCrypt/Interop.BCryptDestroyHash.cs | 2 +- .../BCrypt/Interop.BCryptDestroyKey.cs | 2 +- .../BCrypt/Interop.BCryptDuplicateHash.cs | 2 +- .../BCrypt/Interop.BCryptEncryptDecrypt.cs | 4 +- .../Windows/BCrypt/Interop.BCryptExportKey.cs | 2 +- .../BCrypt/Interop.BCryptFinishHash.cs | 2 +- .../Windows/BCrypt/Interop.BCryptGenRandom.cs | 2 +- .../Interop.BCryptGenerateSymmetricKey.cs | 4 +- .../BCrypt/Interop.BCryptGetProperty.cs | 2 +- .../Windows/BCrypt/Interop.BCryptHash.cs | 2 +- .../Windows/BCrypt/Interop.BCryptHashData.cs | 2 +- .../Windows/BCrypt/Interop.BCryptImportKey.cs | 2 +- .../BCrypt/Interop.BCryptKeyDerivation.cs | 2 +- .../Interop.BCryptOpenAlgorithmProvider.cs | 2 +- .../Credui/Interop.CredUIParseUserName.cs | 2 +- ...nterop.CertAddCertificateContextToStore.cs | 2 +- .../Interop.CertAddCertificateLinkToStore.cs | 2 +- ...cateLinkToStore_CertStoreAddDisposition.cs | 2 +- .../Windows/Crypt32/Interop.CertCloseStore.cs | 2 +- .../Crypt32/Interop.CertControlStore.cs | 2 +- ...nterop.CertCreateCertificateChainEngine.cs | 2 +- .../Interop.CertCreateCertificateContext.cs | 2 +- .../Interop.CertDeleteCertificateFromStore.cs | 2 +- .../Interop.CertDuplicateCertificateChain.cs | 2 +- ...Interop.CertDuplicateCertificateContext.cs | 2 +- ...tificateContextWithKeyContainerDeletion.cs | 2 +- ....CertDuplicateCertificateContext_IntPtr.cs | 2 +- .../Crypt32/Interop.CertDuplicateStore.cs | 2 +- .../Interop.CertEnumCertificatesInStore.cs | 2 +- ...erop.CertEnumCertificatesInStore_IntPtr.cs | 2 +- ...CertificatesInStore_SafeCertStoreHandle.cs | 2 +- .../Interop.CertFindCertificateInStore.cs | 2 +- .../Crypt32/Interop.CertFindExtension.cs | 2 +- .../Interop.CertFreeCertificateChain.cs | 2 +- .../Interop.CertFreeCertificateChainEngine.cs | 2 +- .../Interop.CertFreeCertificateContext.cs | 2 +- .../Interop.CertGetCertificateChain.cs | 2 +- ...terop.CertGetCertificateContextProperty.cs | 6 +- ...CertGetCertificateContextPropertyString.cs | 2 +- ...tCertificateContextProperty_NO_NULLABLE.cs | 2 +- .../Interop.CertGetIntendedKeyUsage.cs | 2 +- .../Crypt32/Interop.CertGetNameString.cs | 2 +- .../Crypt32/Interop.CertGetPublicKeyLength.cs | 2 +- .../Crypt32/Interop.CertGetValidUsages.cs | 2 +- .../Windows/Crypt32/Interop.CertNameToStr.cs | 2 +- .../Windows/Crypt32/Interop.CertOpenStore.cs | 2 +- .../Crypt32/Interop.CertOpenStore_ENUM.cs | 2 +- .../Windows/Crypt32/Interop.CertSaveStore.cs | 2 +- ...op.CertSerializeCertificateStoreElement.cs | 2 +- ...cateContextProperty_CRYPT_KEY_PROV_INFO.cs | 2 +- ...SetCertificateContextProperty_DATA_BLOB.cs | 2 +- ...cateContextProperty_SafeNCryptKeyHandle.cs | 2 +- .../Windows/Crypt32/Interop.CertStrToName.cs | 2 +- .../Crypt32/Interop.CertVerifyTimeValidity.cs | 2 +- ...terop.CryptAcquireCertificatePrivateKey.cs | 2 +- ...rtificatePrivateKey_SafeNCryptKeyHandle.cs | 2 +- .../Crypt32/Interop.CryptDecodeObject.cs | 2 +- ...Interop.CryptDecodeObjectPointer_IntPtr.cs | 2 +- ...Interop.CryptDecodeObjectPointer_string.cs | 2 +- ...erop.CryptDecodeObject_CertEncodingType.cs | 2 +- .../Crypt32/Interop.CryptEncodeObject.cs | 2 +- ...erop.CryptEncodeObject_CertEncodingType.cs | 4 +- .../Crypt32/Interop.CryptFormatObject.cs | 2 +- .../Crypt32/Interop.CryptHashPublicKeyInfo.cs | 2 +- .../Interop.CryptImportPublicKeyInfoEx2.cs | 2 +- .../Windows/Crypt32/Interop.CryptMsgClose.cs | 2 +- .../Crypt32/Interop.CryptMsgControl.cs | 4 +- .../Crypt32/Interop.CryptMsgGetParam.cs | 8 +- .../Crypt32/Interop.CryptMsgOpenToDecode.cs | 2 +- .../Crypt32/Interop.CryptMsgOpenToEncode.cs | 2 +- .../Windows/Crypt32/Interop.CryptMsgUpdate.cs | 6 +- .../Crypt32/Interop.CryptProtectData.cs | 2 +- .../Crypt32/Interop.CryptProtectMemory.cs | 4 +- .../Crypt32/Interop.CryptQueryObject.cs | 6 +- .../Interop.CryptQueryObject_IntPtr_out.cs | 2 +- .../Crypt32/Interop.CryptUnprotectData.cs | 2 +- .../Windows/Crypt32/Interop.FindOidInfo.cs | 2 +- .../Windows/Crypt32/Interop.HashIdAlg.cs | 2 +- .../Crypt32/Interop.PFXExportCertStore.cs | 2 +- .../Crypt32/Interop.PFXImportCertStore.cs | 2 +- .../Windows/Crypt32/Interop.certificates.cs | 4 +- .../CryptUI/Interop.CryptUIDlgCertificate.cs | 4 +- .../Dsrole/Interop.DsRoleFreeMemory.cs | 2 +- ...terop.DsRoleGetPrimaryDomainInformation.cs | 2 +- .../Interop/Windows/Gdi32/Interop.BitBlt.cs | 2 +- .../Windows/Gdi32/Interop.CombineRgn.cs | 2 +- .../Gdi32/Interop.CreateCompatibleDC.cs | 2 +- .../Interop/Windows/Gdi32/Interop.CreateDC.cs | 2 +- .../Gdi32/Interop.CreateFontIndirect.cs | 2 +- .../Interop/Windows/Gdi32/Interop.CreateIC.cs | 2 +- .../Windows/Gdi32/Interop.CreateRectRgn.cs | 2 +- .../Interop/Windows/Gdi32/Interop.DeleteDC.cs | 2 +- .../Windows/Gdi32/Interop.DeleteObject.cs | 2 +- .../Windows/Gdi32/Interop.GetClipRgn.cs | 2 +- .../Windows/Gdi32/Interop.GetCurrentObject.cs | 2 +- .../Windows/Gdi32/Interop.GetDeviceCaps.cs | 2 +- .../Windows/Gdi32/Interop.GetObjectType.cs | 2 +- .../Windows/Gdi32/Interop.GetRgnBox.cs | 2 +- .../Windows/Gdi32/Interop.GetStockObject.cs | 2 +- .../Gdi32/Interop.OffsetViewportOrgEx.cs | 2 +- .../Windows/Gdi32/Interop.RestoreDC.cs | 2 +- .../Interop/Windows/Gdi32/Interop.SaveDC.cs | 2 +- .../Windows/Gdi32/Interop.SelectClipRgn.cs | 2 +- .../Windows/HttpApi/Interop.HttpApi.cs | 36 +- .../IpHlpApi/Interop.GetNetworkParams.cs | 2 +- .../Interop/Windows/IpHlpApi/Interop.ICMP.cs | 10 +- .../IpHlpApi/Interop.NetworkInformation.cs | 32 +- .../IpHlpApi/Interop.if_nametoindex.cs | 2 +- .../Interop/Windows/Kernel32/Interop.Beep.cs | 2 +- .../Windows/Kernel32/Interop.CancelIoEx.cs | 4 +- .../Interop.CheckTokenMembershipEx.cs | 2 +- .../Kernel32/Interop.ClearCommBreak.cs | 2 +- .../Kernel32/Interop.ClearCommError.cs | 4 +- .../Windows/Kernel32/Interop.CloseHandle.cs | 2 +- .../Kernel32/Interop.CompletionPort.cs | 8 +- .../Kernel32/Interop.ConditionVariable.cs | 6 +- .../Kernel32/Interop.ConnectNamedPipe.cs | 4 +- .../Kernel32/Interop.ConsoleCursorInfo.cs | 4 +- .../Windows/Kernel32/Interop.CopyFileEx.cs | 2 +- .../Kernel32/Interop.CreateDirectory.cs | 2 +- .../Windows/Kernel32/Interop.CreateFile.cs | 2 +- .../Kernel32/Interop.CreateFileMapping.cs | 4 +- .../Kernel32/Interop.CreateFile_IntPtr.cs | 2 +- .../Kernel32/Interop.CreateNamedPipe.cs | 2 +- .../Kernel32/Interop.CreateNamedPipeClient.cs | 2 +- .../Interop.CreatePipe_SafeFileHandle.cs | 2 +- .../Interop.CreatePipe_SafePipeHandle.cs | 2 +- .../Windows/Kernel32/Interop.CreateProcess.cs | 2 +- .../Kernel32/Interop.CreateSymbolicLink.cs | 2 +- .../Interop.CreateToolhelp32Snapshot.cs | 6 +- .../Kernel32/Interop.CriticalSection.cs | 8 +- .../Windows/Kernel32/Interop.DeleteFile.cs | 2 +- .../Interop.DeleteVolumeMountPoint.cs | 2 +- .../Kernel32/Interop.DeviceIoControl.cs | 2 +- .../Kernel32/Interop.DisconnectNamedPipe.cs | 2 +- ...p.DuplicateHandle_SafeAccessTokenHandle.cs | 2 +- .../Interop.DuplicateHandle_SafeFileHandle.cs | 2 +- .../Interop.DuplicateHandle_SafePipeHandle.cs | 2 +- .../Interop.DuplicateHandle_SafeWaitHandle.cs | 2 +- .../Windows/Kernel32/Interop.DynamicLoad.cs | 2 +- .../Kernel32/Interop.EnumProcessModules.cs | 2 +- .../Windows/Kernel32/Interop.EnumProcesses.cs | 2 +- .../Kernel32/Interop.EscapeCommFunction.cs | 2 +- .../Kernel32/Interop.EventWaitHandle.cs | 8 +- .../Windows/Kernel32/Interop.ExitProcess.cs | 2 +- .../Interop.ExpandEnvironmentStrings.cs | 2 +- .../Kernel32/Interop.FileScatterGather.cs | 4 +- .../Kernel32/Interop.FileTimeToSystemTime.cs | 2 +- .../Interop.FillConsoleOutputAttribute.cs | 2 +- .../Interop.FillConsoleOutputCharacter.cs | 2 +- .../Windows/Kernel32/Interop.FindClose.cs | 2 +- .../Kernel32/Interop.FindFirstFileEx.cs | 2 +- .../Windows/Kernel32/Interop.FindNextFile.cs | 2 +- .../Kernel32/Interop.FlushFileBuffers.cs | 2 +- .../Kernel32/Interop.FlushViewOfFile.cs | 2 +- .../Windows/Kernel32/Interop.FormatMessage.cs | 2 +- ...Interop.FormatMessage_SafeLibraryHandle.cs | 2 +- .../Interop.FreeEnvironmentStrings.cs | 2 +- .../Windows/Kernel32/Interop.FreeLibrary.cs | 2 +- .../Windows/Kernel32/Interop.GetCPInfo.cs | 2 +- .../Windows/Kernel32/Interop.GetCPInfoEx.cs | 2 +- .../Kernel32/Interop.GetCommModemStatus.cs | 2 +- .../Kernel32/Interop.GetCommProperties.cs | 2 +- .../Windows/Kernel32/Interop.GetCommState.cs | 2 +- .../Kernel32/Interop.GetComputerName.cs | 2 +- .../Windows/Kernel32/Interop.GetConsoleCP.cs | 2 +- .../Kernel32/Interop.GetConsoleMode.cs | 4 +- .../Kernel32/Interop.GetConsoleOutputCP.cs | 2 +- .../Interop.GetConsoleScreenBufferInfo.cs | 2 +- .../Kernel32/Interop.GetConsoleTitle.cs | 2 +- .../Kernel32/Interop.GetCurrentDirectory.cs | 2 +- .../Kernel32/Interop.GetCurrentProcess.cs | 2 +- .../Kernel32/Interop.GetCurrentProcessId.cs | 2 +- .../Interop.GetCurrentProcessorNumber.cs | 2 +- .../Kernel32/Interop.GetCurrentThread.cs | 2 +- .../Kernel32/Interop.GetCurrentThreadId.cs | 2 +- .../Kernel32/Interop.GetDiskFreeSpaceEx.cs | 2 +- .../Windows/Kernel32/Interop.GetDriveType.cs | 2 +- .../Kernel32/Interop.GetEnvironmentStrings.cs | 2 +- .../Interop.GetEnvironmentVariable.cs | 2 +- .../Kernel32/Interop.GetExitCodeProcess.cs | 2 +- .../Kernel32/Interop.GetFileAttributesEx.cs | 2 +- .../Interop.GetFileInformationByHandleEx.cs | 2 +- .../Kernel32/Interop.GetFileType_IntPtr.cs | 2 +- .../Interop.GetFileType_SafeHandle.cs | 2 +- .../Interop.GetFinalPathNameByHandle.cs | 2 +- .../Kernel32/Interop.GetFullPathNameW.cs | 2 +- .../Interop.GetLargestConsoleWindowSize.cs | 2 +- .../Windows/Kernel32/Interop.GetLastError.cs | 2 +- .../Kernel32/Interop.GetLogicalDrives.cs | 2 +- .../Kernel32/Interop.GetLongPathNameW.cs | 2 +- .../Kernel32/Interop.GetModuleBaseName.cs | 2 +- .../Kernel32/Interop.GetModuleFileName.cs | 2 +- .../Kernel32/Interop.GetModuleFileNameEx.cs | 2 +- .../Kernel32/Interop.GetModuleHandle.cs | 2 +- .../Kernel32/Interop.GetModuleInformation.cs | 2 +- .../Interop.GetNamedPipeHandleState.cs | 2 +- .../Kernel32/Interop.GetNamedPipeInfo.cs | 2 +- .../Kernel32/Interop.GetNativeSystemInfo.cs | 2 +- .../Kernel32/Interop.GetOverlappedResult.cs | 2 +- .../Kernel32/Interop.GetPriorityClass.cs | 2 +- .../Kernel32/Interop.GetProcAddress.cs | 4 +- .../Interop.GetProcessAffinityMask.cs | 2 +- .../Windows/Kernel32/Interop.GetProcessId.cs | 2 +- .../Kernel32/Interop.GetProcessMemoryInfo.cs | 2 +- .../Kernel32/Interop.GetProcessName.cs | 2 +- .../Interop.GetProcessPriorityBoost.cs | 2 +- .../Kernel32/Interop.GetProcessTimes.cs | 2 +- .../Interop.GetProcessTimes_IntPtr.cs | 2 +- .../Interop.GetProcessWorkingSetSizeEx.cs | 2 +- .../Windows/Kernel32/Interop.GetStdHandle.cs | 2 +- .../Kernel32/Interop.GetSystemDirectoryW.cs | 2 +- .../Windows/Kernel32/Interop.GetSystemInfo.cs | 2 +- .../Windows/Kernel32/Interop.GetSystemTime.cs | 2 +- .../Kernel32/Interop.GetSystemTimes.cs | 2 +- .../Kernel32/Interop.GetTempFileNameW.cs | 2 +- .../Windows/Kernel32/Interop.GetTempPathW.cs | 2 +- .../Kernel32/Interop.GetThreadPriority.cs | 2 +- .../Interop.GetThreadPriorityBoost.cs | 2 +- .../Kernel32/Interop.GetThreadTimes.cs | 2 +- .../Kernel32/Interop.GetTickCount64.cs | 2 +- .../Kernel32/Interop.GetUserDefaultLCID.cs | 2 +- .../Kernel32/Interop.GetVolumeInformation.cs | 2 +- .../Windows/Kernel32/Interop.GlobalFree.cs | 2 +- .../Windows/Kernel32/Interop.GlobalLock.cs | 4 +- .../Kernel32/Interop.GlobalMemoryStatusEx.cs | 2 +- .../Windows/Kernel32/Interop.Globalization.cs | 36 +- .../Kernel32/Interop.HandleInformation.cs | 2 +- .../Interop/Windows/Kernel32/Interop.Heap.cs | 6 +- .../Kernel32/Interop.IsDebuggerPresent.cs | 2 +- .../Kernel32/Interop.IsWow64Process_IntPtr.cs | 2 +- ...nterop.IsWow64Process_SafeProcessHandle.cs | 2 +- .../Windows/Kernel32/Interop.LoadLibrary.cs | 2 +- .../Windows/Kernel32/Interop.LoadLibraryEx.cs | 2 +- .../Kernel32/Interop.LoadLibraryEx_IntPtr.cs | 2 +- .../Windows/Kernel32/Interop.LocalAlloc.cs | 6 +- .../Windows/Kernel32/Interop.LockFile.cs | 4 +- .../Windows/Kernel32/Interop.MapViewOfFile.cs | 2 +- .../Windows/Kernel32/Interop.MoveFileEx.cs | 2 +- .../Kernel32/Interop.MultiByteToWideChar.cs | 2 +- .../Interop/Windows/Kernel32/Interop.Mutex.cs | 6 +- .../Kernel32/Interop.OpenFileMapping.cs | 2 +- .../Windows/Kernel32/Interop.OpenProcess.cs | 2 +- .../Windows/Kernel32/Interop.OpenThread.cs | 2 +- .../Kernel32/Interop.OutputDebugString.cs | 2 +- .../Kernel32/Interop.PeekConsoleInput.cs | 2 +- .../Windows/Kernel32/Interop.PurgeComm.cs | 2 +- .../Interop.QueryPerformanceCounter.cs | 2 +- .../Interop.QueryPerformanceFrequency.cs | 2 +- .../Interop.QueryUnbiasedInterruptTime.cs | 2 +- .../Interop.RaiseFailFastException.cs | 2 +- .../Windows/Kernel32/Interop.ReadConsole.cs | 2 +- .../Kernel32/Interop.ReadConsoleInput.cs | 2 +- .../Kernel32/Interop.ReadConsoleOutput.cs | 2 +- .../Kernel32/Interop.ReadDirectoryChangesW.cs | 2 +- .../Kernel32/Interop.ReadFile_IntPtr.cs | 2 +- .../Interop.ReadFile_SafeHandle_IntPtr.cs | 2 +- ...op.ReadFile_SafeHandle_NativeOverlapped.cs | 4 +- .../Kernel32/Interop.RemoveDirectory.cs | 2 +- .../Windows/Kernel32/Interop.ReplaceFile.cs | 2 +- .../Kernel32/Interop.ResolveLocaleName.cs | 2 +- .../Windows/Kernel32/Interop.Semaphore.cs | 6 +- .../Windows/Kernel32/Interop.SetCommBreak.cs | 2 +- .../Windows/Kernel32/Interop.SetCommMask.cs | 2 +- .../Windows/Kernel32/Interop.SetCommState.cs | 2 +- .../Kernel32/Interop.SetCommTimeouts.cs | 2 +- .../Windows/Kernel32/Interop.SetConsoleCP.cs | 2 +- .../Interop.SetConsoleCtrlHandler.Delegate.cs | 2 +- .../Kernel32/Interop.SetConsoleCtrlHandler.cs | 2 +- .../Interop.SetConsoleCursorPosition.cs | 2 +- .../Kernel32/Interop.SetConsoleOutputCP.cs | 2 +- .../Interop.SetConsoleScreenBufferSize.cs | 2 +- .../Interop.SetConsoleTextAttribute.cs | 2 +- .../Kernel32/Interop.SetConsoleTitle.cs | 2 +- .../Kernel32/Interop.SetConsoleWindowInfo.cs | 2 +- .../Kernel32/Interop.SetCurrentDirectory.cs | 2 +- .../Interop.SetEnvironmentVariable.cs | 2 +- .../Kernel32/Interop.SetFileAttributes.cs | 2 +- ...erop.SetFileCompletionNotificationModes.cs | 2 +- .../Interop.SetFileInformationByHandle.cs | 2 +- .../Kernel32/Interop.SetFilePointerEx.cs | 2 +- .../Windows/Kernel32/Interop.SetLastError.cs | 2 +- .../Interop.SetNamedPipeHandleState.cs | 2 +- .../Kernel32/Interop.SetPriorityClass.cs | 2 +- .../Interop.SetProcessAffinityMask.cs | 2 +- .../Interop.SetProcessPriorityBoost.cs | 2 +- .../Interop.SetProcessWorkingSetSizeEx.cs | 2 +- .../Kernel32/Interop.SetThreadAffinityMask.cs | 2 +- .../Kernel32/Interop.SetThreadErrorMode.cs | 2 +- .../Interop.SetThreadIdealProcessor.cs | 2 +- .../Kernel32/Interop.SetThreadPriority.cs | 2 +- .../Interop.SetThreadPriorityBoost.cs | 2 +- .../Kernel32/Interop.SetVolumeLabel.cs | 2 +- .../Windows/Kernel32/Interop.SetupComm.cs | 2 +- .../Kernel32/Interop.SystemTimeToFileTime.cs | 2 +- .../Kernel32/Interop.TerminateProcess.cs | 2 +- .../Windows/Kernel32/Interop.ThreadPool.cs | 14 +- .../Windows/Kernel32/Interop.ThreadPoolIO.cs | 8 +- .../Windows/Kernel32/Interop.Threading.cs | 20 +- .../Windows/Kernel32/Interop.TimeZone.cs | 4 +- .../Interop/Windows/Kernel32/Interop.Timer.cs | 4 +- ...Interop.TzSpecificLocalTimeToSystemTime.cs | 2 +- .../Kernel32/Interop.UnmapViewOfFile.cs | 2 +- .../Kernel32/Interop.VerLanguageName.cs | 2 +- .../Kernel32/Interop.VerSetConditionMask.cs | 2 +- .../Kernel32/Interop.VerifyVersionExW.cs | 2 +- .../Windows/Kernel32/Interop.VirtualAlloc.cs | 2 +- .../Kernel32/Interop.VirtualAlloc_Ptr.cs | 2 +- .../Windows/Kernel32/Interop.VirtualFree.cs | 2 +- .../Windows/Kernel32/Interop.VirtualQuery.cs | 2 +- .../Kernel32/Interop.VirtualQuery_Ptr.cs | 2 +- .../Windows/Kernel32/Interop.WaitCommEvent.cs | 2 +- .../Kernel32/Interop.WaitForSingleObject.cs | 2 +- .../Windows/Kernel32/Interop.WaitNamedPipe.cs | 2 +- .../Kernel32/Interop.WideCharToMultiByte.cs | 2 +- .../Windows/Kernel32/Interop.WriteConsole.cs | 2 +- .../Kernel32/Interop.WriteConsoleOutput.cs | 2 +- .../Kernel32/Interop.WriteFile_IntPtr.cs | 2 +- .../Interop.WriteFile_SafeHandle_IntPtr.cs | 2 +- ...p.WriteFile_SafeHandle_NativeOverlapped.cs | 4 +- .../Windows/Logoncli/Interop.DsGetDcName.cs | 2 +- .../Windows/NCrypt/Interop.EncryptDecrypt.cs | 4 +- .../Interop/Windows/NCrypt/Interop.Keys.cs | 18 +- .../NCrypt/Interop.NCryptDeriveKeyMaterial.cs | 2 +- .../Interop.NCryptDeriveSecretAgreement.cs | 2 +- .../NCrypt/Interop.NCryptFreeObject.cs | 2 +- .../Interop.NCryptOpenStorageProvider.cs | 2 +- .../Windows/NCrypt/Interop.Properties.cs | 4 +- .../Windows/NCrypt/Interop.SignVerify.cs | 4 +- .../Netutils/Interop.NetApiBufferFree.cs | 2 +- .../Interop/Windows/Normaliz/Interop.Idna.cs | 4 +- .../Windows/Normaliz/Interop.Normalization.cs | 4 +- .../Windows/NtDll/Interop.NtCreateFile.cs | 2 +- .../NtDll/Interop.NtQueryDirectoryFile.cs | 2 +- .../NtDll/Interop.NtQueryInformationFile.cs | 2 +- .../Interop.NtQueryInformationProcess.cs | 2 +- .../NtDll/Interop.NtQuerySystemInformation.cs | 2 +- .../Windows/NtDll/Interop.RtlGetVersion.cs | 2 +- .../NtDll/Interop.RtlNtStatusToDosError.cs | 2 +- .../Windows/Ole32/Interop.CLSIDFromProgID.cs | 2 +- .../Windows/Ole32/Interop.CoCreateGuid.cs | 2 +- .../Ole32/Interop.CoGetApartmentType.cs | 2 +- .../Ole32/Interop.CoGetObjectContext.cs | 2 +- .../Ole32/Interop.CoGetStandardMarshal.cs | 2 +- .../Windows/Ole32/Interop.CoInitializeEx.cs | 2 +- .../Windows/Ole32/Interop.CoTaskMemAlloc.cs | 6 +- .../Windows/Ole32/Interop.CoUninitialize.cs | 2 +- .../Windows/Ole32/Interop.PropVariantClear.cs | 2 +- .../Windows/OleAut32/Interop.SetErrorInfo.cs | 2 +- .../OleAut32/Interop.SysAllocStringByteLen.cs | 2 +- .../OleAut32/Interop.SysAllocStringLen.cs | 4 +- .../Windows/OleAut32/Interop.SysFreeString.cs | 2 +- .../Windows/OleAut32/Interop.VariantClear.cs | 2 +- .../Pdh/Interop.PdhFormatFromRawValue.cs | 2 +- .../PerfCounter/Interop.PerformanceData.cs | 12 +- .../Windows/Secur32/Interop.GetUserNameExW.cs | 2 +- .../Shell32/Interop.SHGetKnownFolderPath.cs | 2 +- .../Shell32/Interop.ShellExecuteExW.cs | 2 +- .../SspiCli/Interop.LsaConnectUntrusted.cs | 2 +- .../Interop.LsaDeregisterLogonProcess.cs | 2 +- .../SspiCli/Interop.LsaFreeReturnBuffer.cs | 2 +- .../SspiCli/Interop.LsaGetLogonSessionData.cs | 2 +- .../Windows/SspiCli/Interop.LsaLogonUser.cs | 2 +- .../Interop.LsaLookupAuthenticationPackage.cs | 2 +- .../Interop/Windows/SspiCli/Interop.SSPI.cs | 40 +- .../Windows/Ucrtbase/Interop.MemAlloc.cs | 14 +- .../Windows/User32/Interop.CreateWindowEx.cs | 2 +- .../Windows/User32/Interop.DefWindowProc.cs | 2 +- .../Windows/User32/Interop.DestroyWindow.cs | 2 +- .../Windows/User32/Interop.DispatchMessage.cs | 2 +- .../Windows/User32/Interop.EnumWindows.cs | 2 +- .../Windows/User32/Interop.FindWindow.cs | 2 +- .../Windows/User32/Interop.GetClassInfo.cs | 2 +- .../Interop/Windows/User32/Interop.GetDC.cs | 2 +- .../Windows/User32/Interop.GetKeyState.cs | 2 +- .../Windows/User32/Interop.GetMessage.cs | 2 +- .../User32/Interop.GetProcessWindowStation.cs | 2 +- .../Windows/User32/Interop.GetSysColor.cs | 2 +- .../Interop.GetUserObjectInformation.cs | 2 +- .../Windows/User32/Interop.GetWindow.cs | 2 +- .../Windows/User32/Interop.GetWindowLong.cs | 2 +- .../User32/Interop.GetWindowTextLengthW.cs | 2 +- .../Windows/User32/Interop.GetWindowTextW.cs | 2 +- .../Interop.GetWindowThreadProcessId.cs | 2 +- .../Windows/User32/Interop.IsWindow.cs | 2 +- .../Windows/User32/Interop.IsWindowVisible.cs | 2 +- .../Windows/User32/Interop.KillTimer.cs | 2 +- .../Windows/User32/Interop.LoadString.cs | 2 +- .../Windows/User32/Interop.MessageBeep.cs | 2 +- .../Interop.MsgWaitForMultipleObjectsEx.cs | 2 +- .../Windows/User32/Interop.PostMessage.cs | 2 +- .../Windows/User32/Interop.PostQuitMessage.cs | 2 +- .../Windows/User32/Interop.RegisterClass.cs | 2 +- .../User32/Interop.RegisterWindowMessage.cs | 2 +- .../Windows/User32/Interop.ReleaseDC.cs | 2 +- .../Windows/User32/Interop.SendMessage.cs | 2 +- .../User32/Interop.SendMessageTimeout.cs | 2 +- .../Windows/User32/Interop.SetClassLong.cs | 2 +- .../Windows/User32/Interop.SetClassLongPtr.cs | 2 +- .../Windows/User32/Interop.SetTimer.cs | 2 +- .../Windows/User32/Interop.SetWindowLong.cs | 2 +- .../User32/Interop.SetWindowLongPtr.cs | 2 +- .../User32/Interop.SystemParametersInfo.cs | 2 +- .../User32/Interop.TranslateMessage.cs | 2 +- .../Windows/User32/Interop.UnregisterClass.cs | 2 +- .../User32/Interop.WaitForInputIdle.cs | 2 +- .../Windows/User32/Interop.WindowFromDC.cs | 2 +- .../Version/Interop.GetFileVersionInfoEx.cs | 2 +- .../Interop.GetFileVersionInfoSizeEx.cs | 2 +- .../Windows/Version/Interop.VerQueryValue.cs | 2 +- .../WebSocket/Interop.WebSocketAbortHandle.cs | 2 +- .../Interop.WebSocketBeginClientHandshake.cs | 2 +- .../Interop.WebSocketBeginServerHandshake.cs | 2 +- .../Interop.WebSocketCompleteAction.cs | 2 +- .../Interop.WebSocketCreateClientHandle.cs | 2 +- .../Interop.WebSocketCreateServerHandle.cs | 2 +- .../Interop.WebSocketDeleteHandle.cs | 2 +- .../Interop.WebSocketEndServerHandshake.cs | 2 +- .../WebSocket/Interop.WebSocketGetAction.cs | 2 +- .../WebSocket/Interop.WebSocketReceive.cs | 2 +- .../WebSocket/Interop.WebSocketSend.cs | 4 +- .../Windows/WinHttp/Interop.winhttp.cs | 48 +- .../Windows/WinMm/Interop.PlaySound.cs | 4 +- .../Windows/WinMm/Interop.mmioAscend.cs | 2 +- .../Windows/WinMm/Interop.mmioClose.cs | 2 +- .../Windows/WinMm/Interop.mmioDescend.cs | 2 +- .../Interop/Windows/WinMm/Interop.mmioOpen.cs | 2 +- .../Interop/Windows/WinMm/Interop.mmioRead.cs | 2 +- .../Windows/WinMm/Interop.waveOutClose.cs | 2 +- .../WinMm/Interop.waveOutGetDevCaps.cs | 2 +- .../WinMm/Interop.waveOutGetNumDevs.cs | 2 +- .../Windows/WinMm/Interop.waveOutOpen.cs | 2 +- .../Windows/WinMm/Interop.waveOutPause.cs | 2 +- .../WinMm/Interop.waveOutPrepareHeader.cs | 4 +- .../Windows/WinMm/Interop.waveOutReset.cs | 2 +- .../Windows/WinMm/Interop.waveOutRestart.cs | 2 +- .../Windows/WinMm/Interop.waveOutWrite.cs | 2 +- .../Windows/WinSock/Interop.GetAddrInfoExW.cs | 6 +- .../Windows/WinSock/Interop.GetAddrInfoW.cs | 4 +- .../Windows/WinSock/Interop.GetNameInfoW.cs | 2 +- .../Windows/WinSock/Interop.TransmitFile.cs | 2 +- .../Windows/WinSock/Interop.WSAConnect.cs | 2 +- .../WinSock/Interop.WSADuplicateSocket.cs | 2 +- .../Windows/WinSock/Interop.WSAEventSelect.cs | 2 +- .../WinSock/Interop.WSAGetOverlappedResult.cs | 2 +- .../Windows/WinSock/Interop.WSAIoctl.cs | 4 +- .../Windows/WinSock/Interop.WSARecv.cs | 2 +- .../Windows/WinSock/Interop.WSARecvFrom.cs | 2 +- .../Windows/WinSock/Interop.WSASend.cs | 2 +- .../Windows/WinSock/Interop.WSASendTo.cs | 2 +- .../Interop.WSASocketW.SafeCloseSocket.cs | 2 +- .../Windows/WinSock/Interop.WSASocketW.cs | 2 +- .../Windows/WinSock/Interop.WSAStartup.cs | 4 +- .../Interop/Windows/WinSock/Interop.accept.cs | 2 +- .../Interop/Windows/WinSock/Interop.bind.cs | 2 +- .../Windows/WinSock/Interop.closesocket.cs | 2 +- .../Windows/WinSock/Interop.gethostname.cs | 2 +- .../Windows/WinSock/Interop.getpeername.cs | 2 +- .../Windows/WinSock/Interop.getsockname.cs | 2 +- .../Windows/WinSock/Interop.getsockopt.cs | 8 +- .../Windows/WinSock/Interop.ioctlsocket.cs | 4 +- .../Interop/Windows/WinSock/Interop.listen.cs | 2 +- .../Interop/Windows/WinSock/Interop.recv.cs | 2 +- .../Windows/WinSock/Interop.recvfrom.cs | 2 +- .../Interop/Windows/WinSock/Interop.select.cs | 4 +- .../Interop/Windows/WinSock/Interop.send.cs | 2 +- .../Interop/Windows/WinSock/Interop.sendto.cs | 2 +- .../Windows/WinSock/Interop.setsockopt.cs | 14 +- .../Windows/WinSock/Interop.shutdown.cs | 2 +- .../Windows/Wkscli/Interop.NetWkstaGetInfo.cs | 2 +- .../Interop/Windows/Wldap32/Interop.Ber.cs | 30 +- .../Interop/Windows/Wldap32/Interop.Ldap.cs | 96 +- .../Interop.WTSRegisterSessionNotification.cs | 2 +- ...nterop.WTSUnRegisterSessionNotification.cs | 2 +- .../System/Buffers/BoundedMemory.Windows.cs | 8 +- .../System/PlatformDetection.Unix.cs | 6 +- .../System/PlatformDetection.Windows.cs | 4 +- .../System/WindowsIdentityFixture.cs | 10 +- .../Diagnostics/Tracing/StubEnvironment.cs | 4 +- .../Microsoft.Win32.Registry/tests/Helpers.cs | 6 +- .../tests/CancelKeyPress.Unix.cs | 4 +- .../tests/ConsoleEncoding.Windows.cs | 4 +- .../src/SafeNativeMethods.cs | 6 +- .../src/UnsafeNativeMethods.COMWrappers.cs | 2 +- .../Diagnostics/Reader/UnsafeNativeMethods.cs | 72 +- .../src/Interop/SafeNativeMethods.cs | 8 +- .../ActiveDirectory/NativeMethods.cs | 24 +- .../ActiveDirectory/UnsafeNativeMethods.cs | 38 +- .../src/Interop/Windows/Interop.Comdlg32.cs | 4 +- .../src/Interop/Windows/Interop.Gdi32.cs | 32 +- .../src/Interop/Windows/Interop.Kernel32.cs | 6 +- .../src/Interop/Windows/Interop.Shell32.cs | 2 +- .../src/Interop/Windows/Interop.User32.cs | 14 +- .../src/Interop/Windows/Interop.Winspool.cs | 8 +- .../src/System/Drawing/GdiplusNative.Unix.cs | 208 ++-- .../System/Drawing/GdiplusNative.Windows.cs | 226 ++--- .../src/System/Drawing/GdiplusNative.cs | 906 +++++++++--------- .../Drawing/Icon.Windows.COMWrappers.cs | 2 +- .../Drawing/Icon.Windows.NoCOMWrappers.cs | 2 +- .../src/System/Drawing/LibX11Functions.cs | 24 +- .../System/Drawing/Printing/LibcupsNative.cs | 22 +- .../src/System/Drawing/macFunctions.cs | 72 +- .../tests/ZipFile.Unix.cs | 2 +- ...ileSystemWatcher.Directory.NotifyFilter.cs | 2 +- .../FileSystemWatcher.File.NotifyFilter.cs | 2 +- .../tests/FileSystemTest.Unix.cs | 4 +- .../tests/MemoryMappedFilesTestsBase.Unix.cs | 4 +- .../MemoryMappedFilesTestsBase.Windows.cs | 4 +- .../tests/SafeMemoryMappedViewHandleTests.cs | 2 +- .../Tracing/TraceLogging/XplatEventLogger.cs | 4 +- 946 files changed, 3089 insertions(+), 3089 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs index 002937ff06322b..4131391fd4519a 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs @@ -20,7 +20,7 @@ internal static unsafe void _ZeroMemory(ref byte b, nuint byteLength) } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")] private static unsafe partial void __ZeroMemory(void* b, nuint byteLength); // The maximum block size to for __BulkMoveWithWriteBarrier FCall. This is required to avoid GC starvation. @@ -76,7 +76,7 @@ private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte sou [MethodImpl(MethodImplOptions.InternalCall)] private static extern void __BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")] private static unsafe partial void __Memmove(byte* dest, byte* src, nuint len); // Used by ilmarshalers.cpp diff --git a/src/coreclr/System.Private.CoreLib/src/System/CLRConfig.cs b/src/coreclr/System.Private.CoreLib/src/System/CLRConfig.cs index c94ddbacbfd3d3..31d0d357f93747 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/CLRConfig.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/CLRConfig.cs @@ -15,7 +15,7 @@ internal static bool GetBoolValue(string switchName, out bool exist) return GetConfigBoolValue(switchName, out exist); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ClrConfig_GetConfigBoolValue", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ClrConfig_GetConfigBoolValue", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetConfigBoolValue(string configSwitchName, [MarshalAs(UnmanagedType.Bool)] out bool exist); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs index e5d1c40644a2ce..9a51c47cb020e0 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs @@ -51,7 +51,7 @@ public static void NotifyOfCrossThreadDependency() } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Launch")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Launch")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool LaunchInternal(); @@ -78,7 +78,7 @@ public static extern bool IsAttached // report the message depending on its settings. public static void Log(int level, string? category, string? message) => LogInternal(level, category, message); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Log", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Log", StringMarshalling = StringMarshalling.Utf16)] private static partial void LogInternal(int level, string? category, string? message); // Checks to see if an attached debugger has logging enabled diff --git a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs index 301442568e7476..8269557f6c5869 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs @@ -14,7 +14,7 @@ internal static partial class EventPipeInternal // // These PInvokes are used by the configuration APIs to interact with EventPipe. // - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")] private static unsafe partial ulong Enable( char* outputFile, EventPipeSerializationFormat format, @@ -22,42 +22,42 @@ private static unsafe partial ulong Enable( EventPipeProviderConfigurationNative* providers, uint numProviders); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Disable")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Disable")] internal static partial void Disable(ulong sessionID); // // These PInvokes are used by EventSource to interact with the EventPipe. // - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr CreateProvider(string providerName, Interop.Advapi32.EtwEnableCallback callbackFunc); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")] internal static unsafe partial IntPtr DefineEvent(IntPtr provHandle, uint eventID, long keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr GetProvider(string providerName); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")] internal static partial void DeleteProvider(IntPtr provHandle); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")] internal static partial int EventActivityIdControl(uint controlCode, ref Guid activityId); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")] internal static unsafe partial void WriteEventData(IntPtr eventHandle, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId); // // These PInvokes are used as part of the EventPipeEventDispatcher. // - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetSessionInfo(ulong sessionID, EventPipeSessionInfo* pSessionInfo); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetNextEvent(ulong sessionID, EventPipeEventInstanceData* pInstance); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetWaitHandle")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetWaitHandle")] internal static unsafe partial IntPtr GetWaitHandle(ulong sessionID); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.PortableThreadPool.NativeSinks.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.PortableThreadPool.NativeSinks.CoreCLR.cs index 6c555fd80ae31f..a06aa7950521a9 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.PortableThreadPool.NativeSinks.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.PortableThreadPool.NativeSinks.CoreCLR.cs @@ -13,27 +13,27 @@ namespace System.Diagnostics.Tracing internal sealed partial class NativeRuntimeEventSource : EventSource { [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadStart(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadStop(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadWait(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentSample(double Throughput, ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentAdjustment(double AverageThroughput, uint NewWorkerThreadCount, NativeRuntimeEventSource.ThreadAdjustmentReasonMap Reason, ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentStats( double Duration, double Throughput, @@ -48,7 +48,7 @@ internal static partial void LogThreadPoolWorkerThreadAdjustmentStats( ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolIOEnqueue( IntPtr NativeOverlapped, IntPtr Overlapped, @@ -56,14 +56,14 @@ internal static partial void LogThreadPoolIOEnqueue( ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolIODequeue( IntPtr NativeOverlapped, IntPtr Overlapped, ushort ClrInstanceID); [NonEvent] - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkingThreadCount( uint Count, ushort ClrInstanceID diff --git a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs index 48397813c61265..76f445e12940d1 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs @@ -56,7 +56,7 @@ private void BuildStackFrame(int skipFrames, bool needFileInfo) private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false; #pragma warning restore IDE0060 - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")] private static partial RuntimeMethodHandleInternal GetMethodDescFromNativeIP(IntPtr ip); /// diff --git a/src/coreclr/System.Private.CoreLib/src/System/Enum.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Enum.CoreCLR.cs index 8899b186817acc..b8e41c06c23dbf 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Enum.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Enum.CoreCLR.cs @@ -10,7 +10,7 @@ namespace System { public abstract partial class Enum { - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Enum_GetValuesAndNames")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Enum_GetValuesAndNames")] private static partial void GetEnumValuesAndNames(QCallTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, Interop.BOOL getNames); [MethodImpl(MethodImplOptions.InternalCall)] diff --git a/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs index 531f51e51c0dbf..ce4ab04249aaaa 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs @@ -18,7 +18,7 @@ public static extern int CurrentManagedThreadId } // Terminates this process with the given exit code. - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Environment_Exit")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Environment_Exit")] [DoesNotReturn] private static partial void _Exit(int exitCode); @@ -84,7 +84,7 @@ public static string[] GetCommandLineArgs() GetCommandLineArgsNative(); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Environment_GetProcessorCount")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Environment_GetProcessorCount")] private static partial int GetProcessorCount(); // Used by VM diff --git a/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs index 145e1ff1dc76dc..82250b5a67bd8d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs @@ -248,7 +248,7 @@ internal static string GetMessageFromNativeResources(ExceptionMessageKind kind) return retMesg!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_GetMessageFromNativeResources")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_GetMessageFromNativeResources")] private static partial void GetMessageFromNativeResources(ExceptionMessageKind kind, StringHandleOnStack retMesg); internal readonly struct DispatchState diff --git a/src/coreclr/System.Private.CoreLib/src/System/GC.cs b/src/coreclr/System.Private.CoreLib/src/System/GC.cs index 91e5e7c063b622..4f2fbd89bc29bb 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/GC.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/GC.cs @@ -77,10 +77,10 @@ public static GCMemoryInfo GetGCMemoryInfo(GCKind kind) return new GCMemoryInfo(data); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_StartNoGCRegion")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_StartNoGCRegion")] internal static partial int _StartNoGCRegion(long totalSize, [MarshalAs(UnmanagedType.Bool)] bool lohSizeKnown, long lohSize, [MarshalAs(UnmanagedType.Bool)] bool disallowFullBlockingGC); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EndNoGCRegion")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EndNoGCRegion")] internal static partial int _EndNoGCRegion(); // keep in sync with GC_ALLOC_FLAGS in gcinterface.h @@ -97,10 +97,10 @@ internal enum GC_ALLOC_FLAGS [MethodImpl(MethodImplOptions.InternalCall)] private static extern int GetGenerationWR(IntPtr handle); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetTotalMemory")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetTotalMemory")] private static partial long GetTotalMemory(); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_Collect")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_Collect")] private static partial void _Collect(int generation, int mode); [MethodImpl(MethodImplOptions.InternalCall)] @@ -118,10 +118,10 @@ internal enum GC_ALLOC_FLAGS [MethodImpl(MethodImplOptions.InternalCall)] internal static extern ulong GetGenerationSize(int gen); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_AddMemoryPressure")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_AddMemoryPressure")] private static partial void _AddMemoryPressure(ulong bytesAllocated); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RemoveMemoryPressure")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RemoveMemoryPressure")] private static partial void _RemoveMemoryPressure(ulong bytesAllocated); public static void AddMemoryPressure(long bytesAllocated) @@ -288,7 +288,7 @@ public static int GetGeneration(WeakReference wo) // public static int MaxGeneration => GetMaxGeneration(); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_WaitForPendingFinalizers")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_WaitForPendingFinalizers")] private static partial void _WaitForPendingFinalizers(); public static void WaitForPendingFinalizers() @@ -347,10 +347,10 @@ public static long GetTotalMemory(bool forceFullCollection) return newSize; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RegisterFrozenSegment")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RegisterFrozenSegment")] private static partial IntPtr _RegisterFrozenSegment(IntPtr sectionAddress, nint sectionSize); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_UnregisterFrozenSegment")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_UnregisterFrozenSegment")] private static partial void _UnregisterFrozenSegment(IntPtr segmentHandle); [MethodImpl(MethodImplOptions.InternalCall)] diff --git a/src/coreclr/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs index b41e97975aa2d3..4933f9189f133b 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs @@ -31,10 +31,10 @@ internal static string FormatFileLoadExceptionMessage(string? fileName, int hRes return string.Format(format!, fileName, message); } - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] private static partial void GetFileLoadExceptionMessage(int hResult, StringHandleOnStack retString); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "FileLoadException_GetMessageForHR")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "FileLoadException_GetMessageForHR")] private static partial void GetMessageForHR(int hresult, StringHandleOnStack retString); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs index 651c4aed685f46..8f71f7112ef0d9 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs @@ -48,7 +48,7 @@ public static Assembly Load(AssemblyName assemblyRef!!) return RuntimeAssembly.InternalLoad(assemblyRef, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExecutingAssembly")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExecutingAssembly")] private static partial void GetExecutingAssemblyNative(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retAssembly); internal static RuntimeAssembly GetExecutingAssembly(ref StackCrawlMark stackMark) @@ -76,7 +76,7 @@ public static Assembly GetCallingAssembly() return GetExecutingAssembly(ref stackMark); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryAssembly")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryAssembly")] private static partial void GetEntryAssemblyNative(ObjectHandleOnStack retAssembly); private static Assembly? GetEntryAssemblyInternal() @@ -86,7 +86,7 @@ public static Assembly GetCallingAssembly() return entryAssembly; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetAssemblyCount")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetAssemblyCount")] [SuppressGCTransition] internal static partial uint GetAssemblyCount(); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs index ea1376dd897ec7..880556da1e5db8 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -164,7 +164,7 @@ public static AssemblyBuilder DefineDynamicAssembly( assemblyAttributes); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")] private static partial void CreateDynamicAssembly(ObjectHandleOnStack name, int access, ObjectHandleOnStack assemblyLoadContext, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs index f1731f3d67cc79..aae82ed46b7f2c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -93,10 +93,10 @@ internal void CheckTypeNameConflict(string strTypeName, Type? enclosingType) return SymbolType.FormCompoundType(strFormat, baseType, 0); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTypeRef", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTypeRef", StringMarshalling = StringMarshalling.Utf16)] private static partial int GetTypeRef(QCallModule module, string strFullName, QCallModule refedModule, string? strRefedModuleFileName, int tkResolution); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRef")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRef")] private static partial int GetMemberRef(QCallModule module, QCallModule refedModule, int tr, int defToken); private int GetMemberRef(Module? refedModule, int tr, int defToken) @@ -107,7 +107,7 @@ private int GetMemberRef(Module? refedModule, int tr, int defToken) return GetMemberRef(new QCallModule(ref thisModule), new QCallModule(ref refedRuntimeModule), tr, defToken); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefFromSignature", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefFromSignature", StringMarshalling = StringMarshalling.Utf16)] private static partial int GetMemberRefFromSignature(QCallModule module, int tr, string methodName, byte[] signature, int length); private int GetMemberRefFromSignature(int tr, string methodName, byte[] signature, int length) @@ -116,7 +116,7 @@ private int GetMemberRefFromSignature(int tr, string methodName, byte[] signatur return GetMemberRefFromSignature(new QCallModule(ref thisModule), tr, methodName, signature, length); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfMethodInfo")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfMethodInfo")] private static partial int GetMemberRefOfMethodInfo(QCallModule module, int tr, RuntimeMethodHandleInternal method); private int GetMemberRefOfMethodInfo(int tr, RuntimeMethodInfo method) @@ -139,7 +139,7 @@ private int GetMemberRefOfMethodInfo(int tr, RuntimeConstructorInfo method) return result; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfFieldInfo")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfFieldInfo")] private static partial int GetMemberRefOfFieldInfo(QCallModule module, int tkType, QCallTypeHandle declaringType, int tkField); private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField) @@ -150,7 +150,7 @@ private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, return GetMemberRefOfFieldInfo(new QCallModule(ref thisModule), tkType, new QCallTypeHandle(ref declaringType), runtimeField.MetadataToken); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTokenFromTypeSpec")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTokenFromTypeSpec")] private static partial int GetTokenFromTypeSpec(QCallModule pModule, byte[] signature, int length); private int GetTokenFromTypeSpec(byte[] signature, int length) @@ -159,13 +159,13 @@ private int GetTokenFromTypeSpec(byte[] signature, int length) return GetTokenFromTypeSpec(new QCallModule(ref thisModule), signature, length); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetArrayMethodToken", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetArrayMethodToken", StringMarshalling = StringMarshalling.Utf16)] private static partial int GetArrayMethodToken(QCallModule module, int tkTypeSpec, string methodName, byte[] signature, int sigLength); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetStringConstant", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetStringConstant", StringMarshalling = StringMarshalling.Utf16)] private static partial int GetStringConstant(QCallModule module, string str, int length); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_SetFieldRVAContent")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_SetFieldRVAContent")] internal static partial void SetFieldRVAContent(QCallModule module, int fdToken, byte[]? data, int length); #endregion diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs index ae2c3d40fb0627..2f0bc41b4d3029 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs @@ -140,26 +140,26 @@ public static FieldInfo GetField(Type type, FieldInfo field) #endregion #region Private Static FCalls - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParentType")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParentType")] private static partial void SetParentType(QCallModule module, int tdTypeDef, int tkParent); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_AddInterfaceImpl")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_AddInterfaceImpl")] private static partial void AddInterfaceImpl(QCallModule module, int tdTypeDef, int tkInterface); #endregion #region Internal Static FCalls - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethod", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethod", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DefineMethod(QCallModule module, int tkParent, string name, byte[] signature, int sigLength, MethodAttributes attributes); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSpec")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSpec")] internal static partial int DefineMethodSpec(QCallModule module, int tkParent, byte[] signature, int sigLength); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineField", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineField", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DefineField(QCallModule module, int tkParent, string name, byte[] signature, int sigLength, FieldAttributes attributes); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodIL")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodIL")] private static partial void SetMethodIL(QCallModule module, int tk, [MarshalAs(UnmanagedType.Bool)] bool isInitLocals, byte[]? body, int bodyLength, byte[] LocalSig, int sigLength, @@ -167,7 +167,7 @@ private static partial void SetMethodIL(QCallModule module, int tk, [MarshalAs(U ExceptionHandler[]? exceptions, int numExceptions, int[]? tokenFixups, int numTokenFixups); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineCustomAttribute")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineCustomAttribute")] private static partial void DefineCustomAttribute(QCallModule module, int tkAssociate, int tkConstructor, byte[]? attr, int attrLength); @@ -186,40 +186,40 @@ internal static void DefineCustomAttribute(ModuleBuilder module, int tkAssociate localAttr, (localAttr != null) ? localAttr.Length : 0); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineProperty", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineProperty", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DefineProperty(QCallModule module, int tkParent, string name, PropertyAttributes attributes, byte[] signature, int sigLength); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineEvent", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineEvent", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DefineEvent(QCallModule module, int tkParent, string name, EventAttributes attributes, int tkEventType); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSemantics")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSemantics")] internal static partial void DefineMethodSemantics(QCallModule module, int tkAssociation, MethodSemanticsAttributes semantics, int tkMethod); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodImpl")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodImpl")] internal static partial void DefineMethodImpl(QCallModule module, int tkType, int tkBody, int tkDecl); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodImpl")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodImpl")] internal static partial void SetMethodImpl(QCallModule module, int tkMethod, MethodImplAttributes MethodImplAttributes); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParamInfo", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParamInfo", StringMarshalling = StringMarshalling.Utf16)] internal static partial int SetParamInfo(QCallModule module, int tkMethod, int iSequence, ParameterAttributes iParamAttributes, string? strParamName); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_GetTokenFromSig")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_GetTokenFromSig")] internal static partial int GetTokenFromSig(QCallModule module, byte[] signature, int sigLength); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetFieldLayoutOffset")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetFieldLayoutOffset")] internal static partial void SetFieldLayoutOffset(QCallModule module, int fdToken, int iOffset); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetClassLayout")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetClassLayout")] internal static partial void SetClassLayout(QCallModule module, int tk, PackingSize iPackingSize, int iTypeSize); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")] private static unsafe partial void SetConstantValue(QCallModule module, int tk, int corType, void* pValue); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)] private static partial void SetPInvokeData(QCallModule module, string DllName, string name, int token, int linkFlags); #endregion @@ -635,15 +635,15 @@ public bool IsCreated() #endregion #region FCalls - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineType", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineType", StringMarshalling = StringMarshalling.Utf16)] private static partial int DefineType(QCallModule module, string fullname, int tkParent, TypeAttributes attributes, int tkEnclosingType, int[] interfaceTokens); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineGenericParam", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineGenericParam", StringMarshalling = StringMarshalling.Utf16)] private static partial int DefineGenericParam(QCallModule module, string name, int tkParent, GenericParameterAttributes attributes, int position, int[] constraints); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_TermCreateClass")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_TermCreateClass")] private static partial void TermCreateClass(QCallModule module, int tk, ObjectHandleOnStack type); #endregion diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs index 29fcfa3ed56ec9..08da273763ef39 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs @@ -25,7 +25,7 @@ internal sealed partial class LoaderAllocatorScout // This field is set by the VM to atomically transfer the ownership to the managed loader allocator internal IntPtr m_nativeLoaderAllocator; - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "LoaderAllocator_Destroy")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "LoaderAllocator_Destroy")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool Destroy(IntPtr nativeLoaderAllocator); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs index fa7385a02dfc66..a5b243ae8d6635 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Metadata { public static partial class AssemblyExtensions { - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool InternalTryGetRawMetadata(QCallAssembly assembly, ref byte* blob, ref int length); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs index 50df55a08b3401..26ef9ed252df4e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs @@ -9,10 +9,10 @@ namespace System.Reflection.Metadata { public static partial class MetadataUpdater { - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")] private static unsafe partial void ApplyUpdate(QCallAssembly assembly, byte* metadataDelta, int metadataDeltaLength, byte* ilDelta, int ilDeltaLength, byte* pdbDelta, int pdbDeltaLength); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool IsApplyUpdateSupported(); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index 93912e27851e69..ef226f6eca5d25 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -68,7 +68,7 @@ public override event ModuleResolveEventHandler? ModuleResolve } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetCodeBase")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetCodeBase")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetCodeBase(QCallAssembly assembly, StringHandleOnStack retString); @@ -137,7 +137,7 @@ public override AssemblyName GetName(bool copiedName) return an; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFullName")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFullName")] private static partial void GetFullName(QCallAssembly assembly, StringHandleOnStack retString); public override string? FullName @@ -157,7 +157,7 @@ public override string? FullName } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryPoint")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryPoint")] private static partial void GetEntryPoint(QCallAssembly assembly, ObjectHandleOnStack retMethod); public override MethodInfo? EntryPoint @@ -175,7 +175,7 @@ public override MethodInfo? EntryPoint } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetType", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetType", StringMarshalling = StringMarshalling.Utf16)] private static partial void GetType(QCallAssembly assembly, string name, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, @@ -206,7 +206,7 @@ private static partial void GetType(QCallAssembly assembly, return type; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExportedTypes")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExportedTypes")] private static partial void GetExportedTypes(QCallAssembly assembly, ObjectHandleOnStack retTypes); [RequiresUnreferencedCode("Types might be removed")] @@ -240,7 +240,7 @@ public override IEnumerable DefinedTypes } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")] internal static partial Interop.BOOL GetIsCollectible(QCallAssembly assembly); public override bool IsCollectible @@ -253,7 +253,7 @@ public override bool IsCollectible } // GetResource will return a pointer to the resources in memory. - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial byte* GetResource(QCallAssembly assembly, string resourceName, out uint length); @@ -346,7 +346,7 @@ internal static RuntimeAssembly InternalLoad(AssemblyName assemblyName, return retAssembly!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")] private static partial void InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, @@ -358,7 +358,7 @@ private static partial void InternalLoad(ObjectHandleOnStack assemblyName, // Returns the module in this assembly with name 'name' - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModule", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModule", StringMarshalling = StringMarshalling.Utf16)] private static partial void GetModule(QCallAssembly assembly, string name, ObjectHandleOnStack retModule); public override Module? GetModule(string name) @@ -431,7 +431,7 @@ public override AssemblyName[] GetReferencedAssemblies() return GetReferencedAssemblies(GetNativeHandle()); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetManifestResourceInfo", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetManifestResourceInfo", StringMarshalling = StringMarshalling.Utf16)] private static partial int GetManifestResourceInfo(QCallAssembly assembly, string resourceName, ObjectHandleOnStack assemblyRef, @@ -453,7 +453,7 @@ private static partial int GetManifestResourceInfo(QCallAssembly assembly, (ResourceLocation)location); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocation")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocation")] private static partial void GetLocation(QCallAssembly assembly, StringHandleOnStack retString); public override string Location @@ -469,7 +469,7 @@ public override string Location } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetImageRuntimeVersion")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetImageRuntimeVersion")] private static partial void GetImageRuntimeVersion(QCallAssembly assembly, StringHandleOnStack retString); public override string ImageRuntimeVersion @@ -488,7 +488,7 @@ public override string ImageRuntimeVersion public override long HostContext => 0; - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetVersion")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetVersion")] private static partial void GetVersion(QCallAssembly assembly, out int majVer, out int minVer, @@ -502,7 +502,7 @@ internal Version GetVersion() return new Version(majorVer, minorVer, build, revision); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocale")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocale")] private static partial void GetLocale(QCallAssembly assembly, StringHandleOnStack retString); internal CultureInfo GetLocale() @@ -523,7 +523,7 @@ internal CultureInfo GetLocale() public override bool IsDynamic => FCallIsDynamic(GetNativeHandle()); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")] private static partial void GetSimpleName(QCallAssembly assembly, StringHandleOnStack retSimpleName); internal string? GetSimpleName() @@ -534,7 +534,7 @@ internal CultureInfo GetLocale() return name; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetHashAlgorithm")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetHashAlgorithm")] private static partial AssemblyHashAlgorithm GetHashAlgorithm(QCallAssembly assembly); private AssemblyHashAlgorithm GetHashAlgorithm() @@ -543,7 +543,7 @@ private AssemblyHashAlgorithm GetHashAlgorithm() return GetHashAlgorithm(new QCallAssembly(ref runtimeAssembly)); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFlags")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFlags")] private static partial AssemblyNameFlags GetFlags(QCallAssembly assembly); private AssemblyNameFlags GetFlags() @@ -552,7 +552,7 @@ private AssemblyNameFlags GetFlags() return GetFlags(new QCallAssembly(ref runtimeAssembly)); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetPublicKey")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetPublicKey")] private static partial void GetPublicKey(QCallAssembly assembly, ObjectHandleOnStack retPublicKey); internal byte[]? GetPublicKey() @@ -604,7 +604,7 @@ public override Assembly GetSatelliteAssembly(CultureInfo culture!!, Version? ve return retAssembly; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModules")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModules")] private static partial void GetModules(QCallAssembly assembly, [MarshalAs(UnmanagedType.Bool)] bool loadIfNotFound, [MarshalAs(UnmanagedType.Bool)] bool getResourceModules, @@ -709,7 +709,7 @@ private static void AddPublicNestedTypes(Type type, List types, List PrepareMethod(method, null); @@ -168,7 +168,7 @@ public static object GetUninitializedObject( return obj!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetUninitializedObject")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetUninitializedObject")] private static partial void GetUninitializedObject(QCallTypeHandle type, ObjectHandleOnStack retObject); [MethodImpl(MethodImplOptions.InternalCall)] @@ -300,7 +300,7 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) return AllocateTypeAssociatedMemory(new QCallTypeHandle(ref rt), (uint)size); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_AllocateTypeAssociatedMemory")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_AllocateTypeAssociatedMemory")] private static partial IntPtr AllocateTypeAssociatedMemory(QCallTypeHandle type, uint size); [MethodImpl(MethodImplOptions.InternalCall)] diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index 8e1fc00ac0799b..28558fb5d1dbe7 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -99,7 +99,7 @@ private static bool TryGetOrCreateComInterfaceForObjectInternal(ComWrappers impl return TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack.Create(ref impl), impl.id, ObjectHandleOnStack.Create(ref instance), flags, out retValue); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateComInterfaceForObject")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateComInterfaceForObject")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack comWrappersImpl, long wrapperId, ObjectHandleOnStack instance, CreateComInterfaceFlags flags, out IntPtr retValue); @@ -244,7 +244,7 @@ private static bool TryGetOrCreateObjectForComInstanceInternal( return TryGetOrCreateObjectForComInstanceInternal(ObjectHandleOnStack.Create(ref impl), impl.id, externalComObject, innerMaybe, flags, ObjectHandleOnStack.Create(ref wrapperMaybeLocal), ObjectHandleOnStack.Create(ref retValue)); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateObjectForComInstance")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateObjectForComInstance")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool TryGetOrCreateObjectForComInstanceInternal(ObjectHandleOnStack comWrappersImpl, long wrapperId, IntPtr externalComObject, IntPtr innerMaybe, CreateObjectFlags flags, ObjectHandleOnStack wrapper, ObjectHandleOnStack retValue); @@ -274,7 +274,7 @@ public static void RegisterForTrackerSupport(ComWrappers instance!!) } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForTrackerSupport")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForTrackerSupport")] [SuppressGCTransition] private static partial void SetGlobalInstanceRegisteredForTrackerSupport(long id); @@ -305,7 +305,7 @@ public static void RegisterForMarshalling(ComWrappers instance!!) SetGlobalInstanceRegisteredForMarshalling(instance.id); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForMarshalling")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForMarshalling")] [SuppressGCTransition] private static partial void SetGlobalInstanceRegisteredForMarshalling(long id); @@ -318,7 +318,7 @@ public static void RegisterForMarshalling(ComWrappers instance!!) protected static void GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease) => GetIUnknownImplInternal(out fpQueryInterface, out fpAddRef, out fpRelease); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetIUnknownImpl")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetIUnknownImpl")] private static partial void GetIUnknownImplInternal(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease); internal static int CallICustomQueryInterface(object customQueryInterfaceMaybe, ref Guid iid, out IntPtr ppObject) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs index 52657791fbf655..f96ec9367c1d91 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs @@ -213,7 +213,7 @@ private static void PrelinkCore(MethodInfo m) GC.KeepAlive(rmi); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_Prelink")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_Prelink")] private static partial void InternalPrelink(RuntimeMethodHandleInternal m); [MethodImpl(MethodImplOptions.InternalCall)] @@ -255,7 +255,7 @@ private static void PrelinkCore(MethodInfo m) #if TARGET_WINDOWS internal static bool IsBuiltInComSupported { get; } = IsBuiltInComSupportedInternal(); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_IsBuiltInComSupported")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_IsBuiltInComSupported")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool IsBuiltInComSupportedInternal(); @@ -273,7 +273,7 @@ public static IntPtr GetHINSTANCE(Module m!!) return (IntPtr)(-1); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetHINSTANCE")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetHINSTANCE")] private static partial IntPtr GetHINSTANCE(QCallModule m); #endif // TARGET_WINDOWS @@ -317,7 +317,7 @@ public static string GetTypeInfoName(ITypeInfo typeInfo!!) return type; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetTypeFromCLSID", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetTypeFromCLSID", StringMarshalling = StringMarshalling.Utf16)] private static partial void GetTypeFromCLSID(in Guid clsid, string? server, ObjectHandleOnStack retType); /// @@ -769,17 +769,17 @@ public static object BindToMoniker(string monikerName) // Revist after https://github.com/mono/linker/issues/1989 is fixed [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern", Justification = "The calling method is annotated with RequiresUnreferencedCode")] - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] private static partial int CreateBindCtx(uint reserved, out IntPtr ppbc); [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern", Justification = "The calling method is annotated with RequiresUnreferencedCode")] - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] private static partial int MkParseDisplayName(IntPtr pbc, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out uint pchEaten, out IntPtr ppmk); [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern", Justification = "The calling method is annotated with RequiresUnreferencedCode")] - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] private static partial int BindMoniker(IntPtr pmk, uint grfOpt, ref Guid iidResult, out IntPtr ppvResult); [SupportedOSPlatform("windows")] @@ -794,7 +794,7 @@ public static object BindToMoniker(string monikerName) internal static extern IntPtr GetFunctionPointerForDelegateInternal(Delegate d); #if DEBUG // Used for testing in Checked or Debug - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")] internal static unsafe partial delegate* unmanaged GetIsInCooperativeGCModeFunctionPointer(); #endif } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs index b3c660d0c89d7b..f407b366021f89 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs @@ -20,18 +20,18 @@ internal static IntPtr LoadLibraryByName(string libraryName, Assembly assembly, /// External functions that implement the NativeLibrary interface - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr LoadFromPath(string libraryName, [MarshalAs(UnmanagedType.Bool)] bool throwOnError); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadByName", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadByName", StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr LoadByName(string libraryName, QCallAssembly callingAssembly, [MarshalAs(UnmanagedType.Bool)] bool hasDllImportSearchPathFlag, uint dllImportSearchPathFlag, [MarshalAs(UnmanagedType.Bool)] bool throwOnError); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_FreeLib")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_FreeLib")] internal static partial void FreeLib(IntPtr handle); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_GetSymbol", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_GetSymbol", StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr GetSymbol(IntPtr handle, string symbolName, [MarshalAs(UnmanagedType.Bool)] bool throwOnError); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs index 8b6572f1aaf433..f2435b927e9826 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs @@ -21,20 +21,20 @@ public static void SetMessageSendPendingException(Exception? exception) System.StubHelpers.StubHelpers.SetPendingExceptionObject(exception); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TrySetGlobalMessageSendCallback")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TrySetGlobalMessageSendCallback")] [return:MarshalAs(UnmanagedType.Bool)] private static partial bool TrySetGlobalMessageSendCallback( MessageSendFunction msgSendFunction, IntPtr func); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TryInitializeReferenceTracker")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TryInitializeReferenceTracker")] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool TryInitializeReferenceTracker( delegate* unmanaged beginEndCallback, delegate* unmanaged isReferencedCallback, delegate* unmanaged trackedObjectEnteredFinalization); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_CreateReferenceTrackingHandle")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_CreateReferenceTrackingHandle")] private static partial IntPtr CreateReferenceTrackingHandleInternal( ObjectHandleOnStack obj, out int memInSizeT, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs index 954b7232465ff8..b5e011d8d4081c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Intrinsics.X86 { public abstract partial class X86Base { - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "X86BaseCpuId")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "X86BaseCpuId")] private static unsafe partial void __cpuidex(int* cpuInfo, int functionId, int subFunctionId); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs index 9e78990261a536..735f788dd3ffa6 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs @@ -11,24 +11,24 @@ namespace System.Runtime.Loader { public partial class AssemblyLoadContext { - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InitializeAssemblyLoadContext")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InitializeAssemblyLoadContext")] private static partial IntPtr InitializeAssemblyLoadContext(IntPtr ptrAssemblyLoadContext, [MarshalAs(UnmanagedType.Bool)] bool fRepresentsTPALoadContext, [MarshalAs(UnmanagedType.Bool)] bool isCollectible); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_PrepareForAssemblyLoadContextRelease")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_PrepareForAssemblyLoadContextRelease")] private static partial void PrepareForAssemblyLoadContextRelease(IntPtr ptrNativeAssemblyBinder, IntPtr ptrAssemblyLoadContextStrong); [RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")] - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromStream")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromStream")] private static partial void LoadFromStream(IntPtr ptrNativeAssemblyBinder, IntPtr ptrAssemblyArray, int iAssemblyArrayLen, IntPtr ptrSymbols, int iSymbolArrayLen, ObjectHandleOnStack retAssembly); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalSetProfileRoot", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalSetProfileRoot", StringMarshalling = StringMarshalling.Utf16)] internal static partial void InternalSetProfileRoot(string directoryPath); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalStartProfile", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalStartProfile", StringMarshalling = StringMarshalling.Utf16)] internal static partial void InternalStartProfile(string? profile, IntPtr ptrNativeAssemblyBinder); [RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")] - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)] private static partial void LoadFromPath(IntPtr ptrNativeAssemblyBinder, string? ilPath, string? niPath, ObjectHandleOnStack retAssembly); [MethodImpl(MethodImplOptions.InternalCall)] @@ -37,19 +37,19 @@ public partial class AssemblyLoadContext [MethodImpl(MethodImplOptions.InternalCall)] internal static extern bool IsTracingEnabled(); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceResolvingHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceResolvingHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool TraceResolvingHandlerInvoked(string assemblyName, string handlerName, string? alcName, string? resultAssemblyName, string? resultAssemblyPath); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool TraceAssemblyResolveHandlerInvoked(string assemblyName, string handlerName, string? resultAssemblyName, string? resultAssemblyPath); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool TraceAssemblyLoadFromResolveHandlerInvoked(string assemblyName, [MarshalAs(UnmanagedType.Bool)] bool isTrackedAssembly, string requestingAssemblyPath, string? requestedAssemblyPath); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceSatelliteSubdirectoryPathProbed", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceSatelliteSubdirectoryPathProbed", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool TraceSatelliteSubdirectoryPathProbed(string filePath, int hResult); @@ -76,7 +76,7 @@ internal unsafe Assembly InternalLoad(ReadOnlySpan arrAssembly, ReadOnlySp } #if TARGET_WINDOWS - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromInMemoryModule")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromInMemoryModule")] private static partial IntPtr LoadFromInMemoryModuleInternal(IntPtr ptrNativeAssemblyBinder, IntPtr hModule, ObjectHandleOnStack retAssembly); @@ -136,7 +136,7 @@ private static IntPtr ResolveUnmanagedDllUsingEvent(string unmanagedDllName, Ass return context.ResolveUsingEvent(assemblyName); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLoadContextForAssembly")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLoadContextForAssembly")] private static partial IntPtr GetLoadContextForAssembly(QCallAssembly assembly); // Returns the load context in which the specified assembly has been loaded diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index 7725817620dd75..e82b6318a83c32 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -259,7 +259,7 @@ internal static object CreateInstanceForAnotherGenericParameter( return instantiatedObject!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")] private static partial void CreateInstanceForAnotherGenericParameter( QCallTypeHandle baseType, IntPtr* pTypeHandles, @@ -296,7 +296,7 @@ internal static void GetActivationInfo( ctorIsPublic = fCtorIsPublicTemp != Interop.BOOL.FALSE; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")] private static partial void GetActivationInfo( ObjectHandleOnStack pRuntimeType, delegate** ppfnAllocator, @@ -402,7 +402,7 @@ internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type [MethodImpl(MethodImplOptions.InternalCall)] internal static extern Type[]? GetInterfaces(RuntimeType type); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")] private static partial void GetConstraints(QCallTypeHandle handle, ObjectHandleOnStack types); internal Type[] GetConstraints() @@ -415,7 +415,7 @@ internal Type[] GetConstraints() return types!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "QCall_GetGCHandleForTypeHandle")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "QCall_GetGCHandleForTypeHandle")] private static partial IntPtr GetGCHandle(QCallTypeHandle handle, GCHandleType type); internal IntPtr GetGCHandle(GCHandleType type) @@ -424,7 +424,7 @@ internal IntPtr GetGCHandle(GCHandleType type) return GetGCHandle(new QCallTypeHandle(ref nativeHandle), type); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "QCall_FreeGCHandleForTypeHandle")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "QCall_FreeGCHandleForTypeHandle")] private static partial IntPtr FreeGCHandle(QCallTypeHandle typeHandle, IntPtr objHandle); internal IntPtr FreeGCHandle(IntPtr objHandle) @@ -439,7 +439,7 @@ internal IntPtr FreeGCHandle(IntPtr objHandle) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern int GetNumVirtualsAndStaticVirtuals(RuntimeType type); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_VerifyInterfaceIsImplemented")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_VerifyInterfaceIsImplemented")] private static partial void VerifyInterfaceIsImplemented(QCallTypeHandle handle, QCallTypeHandle interfaceHandle); internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle) @@ -449,7 +449,7 @@ internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle) VerifyInterfaceIsImplemented(new QCallTypeHandle(ref nativeHandle), new QCallTypeHandle(ref nativeInterfaceHandle)); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaceMethodImplementation")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaceMethodImplementation")] private static partial RuntimeMethodHandleInternal GetInterfaceMethodImplementation(QCallTypeHandle handle, QCallTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle); internal RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) @@ -478,7 +478,7 @@ internal static bool IsComObject(RuntimeType type, bool isGenericCOM) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern bool IsByRefLike(RuntimeType type); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsVisible")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsVisible")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool _IsVisible(QCallTypeHandle typeHandle); @@ -490,7 +490,7 @@ internal static bool IsVisible(RuntimeType type) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern bool IsValueType(RuntimeType type); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_ConstructName")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_ConstructName")] private static partial void ConstructName(QCallTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString); internal string ConstructName(TypeNameFormatFlags formatFlags) @@ -518,7 +518,7 @@ internal static MdUtf8String GetUtf8Name(RuntimeType type) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern IRuntimeMethodInfo GetDeclaringMethod(RuntimeType type); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByName", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByName", StringMarshalling = StringMarshalling.Utf16)] private static partial void GetTypeByName(string name, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack type, ObjectHandleOnStack keepalive); @@ -552,7 +552,7 @@ private static partial void GetTypeByName(string name, [MarshalAs(UnmanagedType. return type; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByNameUsingCARules", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByNameUsingCARules", StringMarshalling = StringMarshalling.Utf16)] private static partial void GetTypeByNameUsingCARules(string name, QCallModule scope, ObjectHandleOnStack type); internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule scope) @@ -565,7 +565,7 @@ internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule return type!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInstantiation")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInstantiation")] internal static partial void GetInstantiation(QCallTypeHandle type, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray); internal RuntimeType[] GetInstantiationInternal() @@ -584,7 +584,7 @@ internal Type[] GetInstantiationPublic() return types!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")] private static partial void Instantiate(QCallTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type); internal RuntimeType Instantiate(RuntimeType inst) @@ -612,7 +612,7 @@ internal RuntimeType Instantiate(Type[]? inst) } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeArray")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeArray")] private static partial void MakeArray(QCallTypeHandle handle, int rank, ObjectHandleOnStack type); internal RuntimeType MakeArray(int rank) @@ -623,7 +623,7 @@ internal RuntimeType MakeArray(int rank) return type!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeSZArray")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeSZArray")] private static partial void MakeSZArray(QCallTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakeSZArray() @@ -634,7 +634,7 @@ internal RuntimeType MakeSZArray() return type!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeByRef")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeByRef")] private static partial void MakeByRef(QCallTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakeByRef() @@ -645,7 +645,7 @@ internal RuntimeType MakeByRef() return type!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakePointer")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakePointer")] private static partial void MakePointer(QCallTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakePointer() @@ -656,13 +656,13 @@ internal RuntimeType MakePointer() return type!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsCollectible")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsCollectible")] internal static partial Interop.BOOL IsCollectible(QCallTypeHandle handle); [MethodImpl(MethodImplOptions.InternalCall)] internal static extern bool HasInstantiation(RuntimeType type); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetGenericTypeDefinition")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetGenericTypeDefinition")] private static partial void GetGenericTypeDefinition(QCallTypeHandle type, ObjectHandleOnStack retType); internal static RuntimeType GetGenericTypeDefinition(RuntimeType type) @@ -877,7 +877,7 @@ internal bool IsNullHandle() return m_value == null; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetFunctionPointer")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetFunctionPointer")] internal static partial IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle); public IntPtr GetFunctionPointer() @@ -887,10 +887,10 @@ public IntPtr GetFunctionPointer() return ptr; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetIsCollectible")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetIsCollectible")] internal static partial Interop.BOOL GetIsCollectible(RuntimeMethodHandleInternal handle); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_IsCAVisibleFromDecoratedType")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_IsCAVisibleFromDecoratedType")] internal static partial Interop.BOOL IsCAVisibleFromDecoratedType( QCallTypeHandle attrTypeHandle, RuntimeMethodHandleInternal attrCtor, @@ -917,7 +917,7 @@ internal static MethodAttributes GetAttributes(IRuntimeMethodInfo method) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern MethodImplAttributes GetImplAttributes(IRuntimeMethodInfo method); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_ConstructInstantiation")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_ConstructInstantiation")] private static partial void ConstructInstantiation(RuntimeMethodHandleInternal method, TypeNameFormatFlags format, StringHandleOnStack retString); internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format) @@ -980,7 +980,7 @@ internal static MdUtf8String GetUtf8Name(RuntimeMethodHandleInternal method) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern object? InvokeMethod(object? target, in Span arguments, Signature sig, bool constructor, bool wrapExceptions); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetMethodInstantiation")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetMethodInstantiation")] private static partial void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray); internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method) @@ -1035,7 +1035,7 @@ internal static bool IsGenericMethodDefinition(IRuntimeMethodInfo method) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern bool IsTypicalMethodDefinition(IRuntimeMethodInfo method); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetTypicalMethodDefinition")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetTypicalMethodDefinition")] private static partial void GetTypicalMethodDefinition(RuntimeMethodHandleInternal method, ObjectHandleOnStack outMethod); internal static IRuntimeMethodInfo GetTypicalMethodDefinition(IRuntimeMethodInfo method) @@ -1054,7 +1054,7 @@ internal static IRuntimeMethodInfo GetTypicalMethodDefinition(IRuntimeMethodInfo internal static int GetGenericParameterCount(IRuntimeMethodInfo method) => GetGenericParameterCount(method.Value); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_StripMethodInstantiation")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_StripMethodInstantiation")] private static partial void StripMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack outMethod); internal static IRuntimeMethodInfo StripMethodInstantiation(IRuntimeMethodInfo method) @@ -1070,7 +1070,7 @@ internal static IRuntimeMethodInfo StripMethodInstantiation(IRuntimeMethodInfo m [MethodImpl(MethodImplOptions.InternalCall)] internal static extern bool IsDynamicMethod(RuntimeMethodHandleInternal method); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_Destroy")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_Destroy")] internal static partial void Destroy(RuntimeMethodHandleInternal method); [MethodImpl(MethodImplOptions.InternalCall)] @@ -1360,7 +1360,7 @@ public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[]? t } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")] private static partial void ResolveType(QCallModule module, int typeToken, IntPtr* typeInstArgs, @@ -1412,7 +1412,7 @@ internal static RuntimeMethodHandleInternal ResolveMethodHandleInternal(RuntimeM } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")] private static partial RuntimeMethodHandleInternal ResolveMethod(QCallModule module, int methodToken, IntPtr* typeInstArgs, @@ -1468,7 +1468,7 @@ public RuntimeFieldHandle ResolveFieldHandle(int fieldToken, RuntimeTypeHandle[] } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")] private static partial void ResolveField(QCallModule module, int fieldToken, IntPtr* typeInstArgs, @@ -1477,7 +1477,7 @@ private static partial void ResolveField(QCallModule module, int methodInstCount, ObjectHandleOnStack retField); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetModuleType")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetModuleType")] internal static partial void GetModuleType(QCallModule handle, ObjectHandleOnStack type); internal static RuntimeType GetModuleType(RuntimeModule module) @@ -1487,7 +1487,7 @@ internal static RuntimeType GetModuleType(RuntimeModule module) return type!; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")] private static partial void GetPEKind(QCallModule handle, int* peKind, int* machine); // making this internal, used by Module.GetPEKind diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index 0f0d1158c84b5c..56589cf6b79387 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -3986,11 +3986,11 @@ private enum DispatchWrapperType : int #region Library internal readonly unsafe partial struct MdUtf8String { - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EqualsCaseInsensitive(void* szLhs, void* szRhs, int cSz); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_HashCaseInsensitive")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_HashCaseInsensitive")] private static partial uint HashCaseInsensitive(void* sz, int cSz); private readonly byte* m_pStringHeap; // This is the raw UTF8 string. diff --git a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs index 21f352c9fcbbbf..bf1ac24679664d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs @@ -581,7 +581,7 @@ internal static partial class InterfaceMarshaler [MethodImpl(MethodImplOptions.InternalCall)] internal static extern object ConvertToManaged(ref IntPtr ppUnk, IntPtr itfMT, IntPtr classMT, int flags); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "InterfaceMarshaler__ClearNative")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "InterfaceMarshaler__ClearNative")] internal static partial void ClearNative(IntPtr pUnk); } // class InterfaceMarshaler #endif // FEATURE_COMINTEROP diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs index fb59a54c94f5f4..716c9c2a709361 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs @@ -225,7 +225,7 @@ public static long Read(ref long location) => [MethodImpl(MethodImplOptions.InternalCall)] internal static extern void ReadMemoryBarrier(); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Interlocked_MemoryBarrierProcessWide")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Interlocked_MemoryBarrierProcessWide")] private static partial void _MemoryBarrierProcessWide(); /// Provides a process-wide memory barrier that ensures that reads and writes from any CPU cannot move across the barrier. diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs index 8cc1abde8fa121..8bb43158fdc838 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs @@ -31,7 +31,7 @@ public bool WaitCore(int timeoutMs) return waitResult == WaitHandle.WaitSuccess; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "WaitHandle_CorWaitOnePrioritizedNative")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "WaitHandle_CorWaitOnePrioritizedNative")] private static partial int WaitNative(SafeWaitHandle handle, int timeoutMs); public void ReleaseCore(int count) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs index c514d5ce896ae1..c84f615d219a0f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs @@ -184,7 +184,7 @@ public static void PulseAll(object obj!!) /// public static long LockContentionCount => GetLockContentionCount(); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")] private static partial long GetLockContentionCount(); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs index 90f08b289c3fcf..fda212fdf08227 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs @@ -92,7 +92,7 @@ private unsafe void StartCore() } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")] private static unsafe partial void StartInternal(ThreadHandle t, int stackSize, int priority, char* pThreadName); // Called from the runtime @@ -119,7 +119,7 @@ private void StartCallback() [MethodImpl(MethodImplOptions.InternalCall)] private static extern void SleepInternal(int millisecondsTimeout); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_UninterruptibleSleep0")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_UninterruptibleSleep0")] internal static partial void UninterruptibleSleep0(); /// @@ -132,7 +132,7 @@ private void StartCallback() public static void SpinWait(int iterations) => SpinWaitInternal(iterations); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_YieldThread")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_YieldThread")] private static partial Interop.BOOL YieldInternal(); public static bool Yield() => YieldInternal() != Interop.BOOL.FALSE; @@ -157,7 +157,7 @@ partial void ThreadNameChanged(string? value) InformThreadNameChange(GetNativeHandle(), value, value?.Length ?? 0); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_InformThreadNameChange", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_InformThreadNameChange", StringMarshalling = StringMarshalling.Utf16)] private static partial void InformThreadNameChange(ThreadHandle t, string? name, int len); /// Returns true if the thread has been started and is not dead. @@ -219,7 +219,7 @@ public ThreadPriority Priority [MethodImpl(MethodImplOptions.InternalCall)] private extern void SetPriorityNative(int priority); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_GetCurrentOSThreadId")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_GetCurrentOSThreadId")] private static partial ulong GetCurrentOSThreadId(); /// diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs index 86e37a4ab8f04a..4aff36ffad43de 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs @@ -383,7 +383,7 @@ public static long CompletedWorkItemCount } } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_GetCompletedWorkItemCount")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_GetCompletedWorkItemCount")] private static partial long GetCompletedWorkItemCount(); private static long PendingUnmanagedWorkItemCount => UsePortableThreadPool ? 0 : GetPendingUnmanagedWorkItemCount(); @@ -437,7 +437,7 @@ internal static void RequestWorkerThread() RequestWorkerThreadNative(); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_RequestWorkerThread")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_RequestWorkerThread")] private static partial Interop.BOOL RequestWorkerThreadNative(); // Entry point from unmanaged code @@ -466,7 +466,7 @@ internal static bool PerformRuntimeSpecificGateActivities(int cpuUtilization) return PerformRuntimeSpecificGateActivitiesNative(cpuUtilization) != Interop.BOOL.FALSE; } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_PerformGateActivities")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_PerformGateActivities")] private static partial Interop.BOOL PerformRuntimeSpecificGateActivitiesNative(int cpuUtilization); // Entry point from unmanaged code diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs index 2d5172aa48233a..e91e8966e31e64 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs @@ -59,14 +59,14 @@ internal static void AppDomainTimerCallback(int id) Instances[id].FireNextTimers(); } - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Create")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Create")] private static partial AppDomainTimerSafeHandle CreateAppDomainTimer(uint dueTime, int id); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Change")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Change")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool ChangeAppDomainTimer(AppDomainTimerSafeHandle handle, uint dueTime); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Delete")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Delete")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool DeleteAppDomainTimer(IntPtr handle); diff --git a/src/coreclr/System.Private.CoreLib/src/System/TypeLoadException.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/TypeLoadException.CoreCLR.cs index 7b109f00532c8e..e755ec061a806f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/TypeLoadException.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/TypeLoadException.CoreCLR.cs @@ -46,7 +46,7 @@ private void SetMessageField() } } - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] private static partial void GetTypeLoadExceptionMessage(int resourceId, StringHandleOnStack retString); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/TypeNameParser.cs b/src/coreclr/System.Private.CoreLib/src/System/TypeNameParser.cs index fa922d876db315..318487d2ef4205 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/TypeNameParser.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/TypeNameParser.cs @@ -17,7 +17,7 @@ namespace System internal sealed partial class SafeTypeNameParserHandle : SafeHandleZeroOrMinusOneIsInvalid { #region QCalls - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_ReleaseTypeNameParser")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_ReleaseTypeNameParser")] private static partial void Release(IntPtr pTypeNameParser); #endregion @@ -37,19 +37,19 @@ protected override bool ReleaseHandle() internal sealed partial class TypeNameParser : IDisposable { #region QCalls - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_CreateTypeNameParser", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_CreateTypeNameParser", StringMarshalling = StringMarshalling.Utf16)] private static partial void _CreateTypeNameParser(string typeName, ObjectHandleOnStack retHandle, [MarshalAs(UnmanagedType.Bool)] bool throwOnError); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetNames")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetNames")] private static partial void _GetNames(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetTypeArguments")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetTypeArguments")] private static partial void _GetTypeArguments(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetModifiers")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetModifiers")] private static partial void _GetModifiers(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray); - [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetAssemblyName")] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetAssemblyName")] private static partial void _GetAssemblyName(SafeTypeNameParserHandle pTypeNameParser, StringHandleOnStack retString); #endregion diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InternalCalls.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InternalCalls.cs index 569846d304edbd..e8c53bf15daa55 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InternalCalls.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InternalCalls.cs @@ -59,7 +59,7 @@ internal static void RhCollect(int generation, InternalGCCollectionMode mode) RhpCollect(generation, mode); } - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] private static partial void RhpCollect(int generation, InternalGCCollectionMode mode); @@ -69,7 +69,7 @@ internal static long RhGetGcTotalMemory() return RhpGetGcTotalMemory(); } - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] private static partial long RhpGetGcTotalMemory(); @@ -286,48 +286,48 @@ internal static extern unsafe bool RhpCallFilterFunclet( // Block the current thread until at least one object needs to be finalized (returns true) or // memory is low (returns false and the finalizer thread should initiate a garbage collection). - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial uint RhpWaitForFinalizerRequest(); // Indicate that the current round of finalizations is complete. - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhpSignalFinalizationComplete(); - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhpAcquireCastCacheLock(); - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhpReleaseCastCacheLock(); - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial ulong RhpGetTickCount64(); - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhpAcquireThunkPoolLock(); - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhpReleaseThunkPoolLock(); - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial IntPtr RhAllocateThunksMapping(); // Enters a no GC region, possibly doing a blocking GC if there is not enough // memory available to satisfy the caller's request. - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial int RhpStartNoGCRegion(long totalSize, [MarshalAs(UnmanagedType.Bool)] bool hasLohSize, long lohSize, [MarshalAs(UnmanagedType.Bool)] bool disallowFullBlockingGC); // Exits a no GC region, possibly doing a GC to clean up the garbage that // the caller allocated. - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial int RhpEndNoGCRegion(); } diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/RuntimeExports.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/RuntimeExports.cs index d92c8cc40c933c..c77d833498c2a2 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/RuntimeExports.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/RuntimeExports.cs @@ -300,7 +300,7 @@ public static unsafe int RhGetCurrentThreadStackTrace(IntPtr[] outputBuffer) return RhpGetCurrentThreadStackTrace(pOutputBuffer, (uint)((outputBuffer != null) ? outputBuffer.Length : 0), new UIntPtr(&pOutputBuffer)); } - [GeneratedDllImport(Redhawk.BaseName)] + [LibraryImport(Redhawk.BaseName)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] private static unsafe partial int RhpGetCurrentThreadStackTrace(IntPtr* pOutputBuffer, uint outputBufferLength, UIntPtr addressInCurrentFrame); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs index 1fede6edddb618..b1666d1d7d3d97 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -26,12 +26,12 @@ public static partial class RuntimeImports { private const string RuntimeLibrary = "*"; - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] [SuppressGCTransition] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial ulong RhpGetTickCount64(); - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial IntPtr RhpGetCurrentThread(); @@ -69,7 +69,7 @@ internal static void RhReRegisterForFinalize(object obj) private static extern bool _RhReRegisterForFinalize(object obj); // Wait for all pending finalizers. This must be a p/invoke to avoid starving the GC. - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] private static partial void RhWaitForPendingFinalizers(int allowReentrantWait); // Temporary workaround to unblock shareable assembly bring-up - without shared interop, @@ -82,7 +82,7 @@ internal static void RhWaitForPendingFinalizers(bool allowReentrantWait) RhWaitForPendingFinalizers(allowReentrantWait ? 1 : 0); } - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] internal static partial void RhInitializeFinalizerThread(); // Get maximum GC generation number. @@ -187,7 +187,7 @@ internal static void RhWaitForPendingFinalizers(bool allowReentrantWait) [RuntimeImport(RuntimeLibrary, "RhGetTotalAllocatedBytes")] internal static extern long RhGetTotalAllocatedBytes(); - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial long RhGetTotalAllocatedBytesPrecise(); @@ -195,10 +195,10 @@ internal static void RhWaitForPendingFinalizers(bool allowReentrantWait) [RuntimeImport(RuntimeLibrary, "RhGetMemoryInfo")] internal static extern void RhGetMemoryInfo(ref byte info, GCKind kind); - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] internal static unsafe partial void RhAllocateNewArray(IntPtr pArrayEEType, uint numElements, uint flags, void* pResult); - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult); [MethodImpl(MethodImplOptions.InternalCall)] @@ -368,25 +368,25 @@ internal static unsafe void RhUnbox(object? obj, ref byte data, EETypePtr pUnbox internal static extern object RhMemberwiseClone(object obj); // Busy spin for the given number of iterations. - [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhSpinWait")] + [LibraryImport(RuntimeLibrary, EntryPoint = "RhSpinWait")] [SuppressGCTransition] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhSpinWait(int iterations); // Yield the cpu to another thread ready to process, if one is available. - [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhYield")] + [LibraryImport(RuntimeLibrary, EntryPoint = "RhYield")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] private static partial int _RhYield(); internal static bool RhYield() { return (_RhYield() != 0); } - [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhFlushProcessWriteBuffers")] + [LibraryImport(RuntimeLibrary, EntryPoint = "RhFlushProcessWriteBuffers")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static partial void RhFlushProcessWriteBuffers(); #if !TARGET_UNIX // Wait for any object to be signalled, in a way that's compatible with the CLR's behavior in an STA. // ExactSpelling = 'true' to force MCG to resolve it to default - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] private static unsafe partial int RhCompatibleReentrantWaitAny(int alertable, int timeout, int count, IntPtr* handles); // Temporary workaround to unblock shareable assembly bring-up - without shared interop, @@ -617,7 +617,7 @@ internal static IntPtr RhGetModuleSection(TypeManagerHandle module, ReadyToRunSe internal static extern void RhCallDescrWorker(IntPtr callDescr); // For Managed to Native calls - [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhCallDescrWorker")] + [LibraryImport(RuntimeLibrary, EntryPoint = "RhCallDescrWorker")] internal static partial void RhCallDescrWorkerNative(IntPtr callDescr); // Moves memory from smem to dmem. Size must be a positive value. @@ -935,14 +935,14 @@ internal struct ConservativelyReportedRegionDesc [RuntimeImport(RuntimeLibrary, "modff")] internal static extern unsafe float modff(float x, float* intptr); - [GeneratedDllImport(RuntimeImports.RuntimeLibrary)] + [LibraryImport(RuntimeImports.RuntimeLibrary)] internal static unsafe partial void* memmove(byte* dmem, byte* smem, nuint size); - [GeneratedDllImport(RuntimeImports.RuntimeLibrary)] + [LibraryImport(RuntimeImports.RuntimeLibrary)] internal static unsafe partial void* memset(byte* mem, int value, nuint size); #if TARGET_X86 || TARGET_AMD64 - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })] internal static unsafe partial void RhCpuIdEx(int* cpuInfo, int functionId, int subFunctionId); #endif diff --git a/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs index c0f0dd1acbd30f..015151e3ea13be 100644 --- a/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -85,7 +85,7 @@ internal static unsafe object RhNewObject(EETypePtr pEEType) internal static unsafe Array RhNewArray(EETypePtr pEEType, int length) => RhNewArray(pEEType.ToPointer(), length); - [GeneratedDllImport(RuntimeLibrary)] + [LibraryImport(RuntimeLibrary)] internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult); [MethodImpl(MethodImplOptions.InternalCall)] diff --git a/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs b/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs index 6dc8dee6c26e90..ff83cf7bb1b875 100644 --- a/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs +++ b/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class JObjectLifetime { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")] internal static partial IntPtr NewGlobalReference(IntPtr obj); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")] internal static partial void DeleteGlobalReference(IntPtr obj); internal class SafeJObjectHandle : SafeHandle diff --git a/src/libraries/Common/src/Interop/Android/Interop.Logcat.cs b/src/libraries/Common/src/Interop/Android/Interop.Logcat.cs index 27dd92ad210e89..a8fd8d2e78bc4d 100644 --- a/src/libraries/Common/src/Interop/Android/Interop.Logcat.cs +++ b/src/libraries/Common/src/Interop/Android/Interop.Logcat.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Logcat { - [GeneratedDllImport(Libraries.Liblog, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.Liblog, StringMarshalling = StringMarshalling.Utf8)] private static partial void __android_log_print(LogLevel level, string? tag, string format, string args, IntPtr ptr); internal static void AndroidLogPrint(LogLevel level, string? tag, string message) => diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs index 3bbc00aab0a8b9..9cf78a9d6b1fae 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs @@ -10,10 +10,10 @@ internal static partial class Interop // TODO: [AndroidCrypto] Rename class to AndroidCrypto once all consumers are split in Android vs. Unix internal static partial class Crypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")] private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")] private static partial int GetBigNumBytes(SafeBignumHandle a); internal static unsafe byte[]? ExtractBignum(SafeBignumHandle? bignum, int targetSize) diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs index 8de978aea5df30..8b987ce31ea5c0 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")] internal static partial SafeEvpCipherCtxHandle EvpCipherCreate( IntPtr cipher, ref byte key, @@ -18,11 +18,11 @@ internal static partial SafeEvpCipherCtxHandle EvpCipherCreate( ref byte iv, int enc); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")] internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial( IntPtr cipher); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherSetKeyAndIV( SafeEvpCipherCtxHandle ctx, @@ -46,7 +46,7 @@ ref MemoryMarshal.GetReference(iv), } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool AndroidCryptoNative_CipherSetNonceLength( SafeEvpCipherCtxHandle ctx, int nonceLength); @@ -59,10 +59,10 @@ internal static void CipherSetNonceLength(SafeEvpCipherCtxHandle ctx, int nonceL } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")] internal static partial void EvpCipherDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, byte* pIv, int cIv); @@ -74,11 +74,11 @@ internal static unsafe bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, ReadOnlyS } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherUpdate( SafeEvpCipherCtxHandle ctx, @@ -101,7 +101,7 @@ ref MemoryMarshal.GetReference(input), input.Length); } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CipherUpdateAAD( SafeEvpCipherCtxHandle ctx, @@ -121,7 +121,7 @@ ref MemoryMarshal.GetReference(input), } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherFinalEx( SafeEvpCipherCtxHandle ctx, @@ -136,98 +136,98 @@ internal static bool EvpCipherFinalEx( return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten); } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CipherSetTagLength( SafeEvpCipherCtxHandle ctx, int tagLength); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CipherIsSupported(IntPtr cipher); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")] internal static partial IntPtr EvpAes128Ecb(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")] internal static partial IntPtr EvpAes128Cbc(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")] internal static partial IntPtr EvpAes128Gcm(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")] internal static partial IntPtr EvpAes128Cfb8(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")] internal static partial IntPtr EvpAes128Cfb128(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")] internal static partial IntPtr EvpAes128Ccm(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")] internal static partial IntPtr EvpAes192Ecb(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")] internal static partial IntPtr EvpAes192Cbc(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")] internal static partial IntPtr EvpAes192Gcm(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")] internal static partial IntPtr EvpAes192Cfb8(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")] internal static partial IntPtr EvpAes192Cfb128(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")] internal static partial IntPtr EvpAes192Ccm(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")] internal static partial IntPtr EvpAes256Ecb(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")] internal static partial IntPtr EvpAes256Cbc(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")] internal static partial IntPtr EvpAes256Gcm(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")] internal static partial IntPtr EvpAes256Cfb128(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")] internal static partial IntPtr EvpAes256Cfb8(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")] internal static partial IntPtr EvpAes256Ccm(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")] internal static partial IntPtr EvpDesCbc(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")] internal static partial IntPtr EvpDesEcb(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")] internal static partial IntPtr EvpDesCfb8(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")] internal static partial IntPtr EvpDes3Cbc(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")] internal static partial IntPtr EvpDes3Ecb(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")] internal static partial IntPtr EvpDes3Cfb8(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")] internal static partial IntPtr EvpDes3Cfb64(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")] internal static partial IntPtr EvpRC2Cbc(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")] internal static partial IntPtr EvpRC2Ecb(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")] internal static partial IntPtr EvpChaCha20Poly1305(); internal enum EvpCipherDirection : int diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs index 623b69772d6aa0..e5fa30ca9fd2d1 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs @@ -11,11 +11,11 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")] private static partial int DsaSizeSignature(SafeDsaHandle dsa); /// @@ -27,7 +27,7 @@ internal static int DsaEncodedSignatureSize(SafeDsaHandle dsa) return size; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")] private static partial int AndroidCryptoNative_DsaSignatureFieldSize(SafeDsaHandle dsa); /// @@ -41,7 +41,7 @@ internal static int DsaSignatureFieldSize(SafeDsaHandle dsa) return size; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")] private static partial int DsaSizeP(SafeDsaHandle dsa); /// @@ -59,7 +59,7 @@ internal static int DsaKeySize(SafeDsaHandle dsa) internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan hash, Span refSignature, out int outSignatureLength) => DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength); @@ -80,7 +80,7 @@ ref MemoryMarshal.GetReference(signature), return ret == 1; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")] private static partial int DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength); internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includePrivateParameters) @@ -141,7 +141,7 @@ internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includ } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetDsaParameters( SafeDsaHandle key, @@ -151,7 +151,7 @@ private static partial bool GetDsaParameters( out SafeBignumHandle y, out int y_cb, out SafeBignumHandle x, out int x_cb); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DsaKeyCreateByExplicitParameters( out SafeDsaHandle dsa, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs index 9db42ff3810b3e..369bdae0b6ce5e 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)] private static partial int EcKeyCreateByKeyParameters( out SafeEcKeyHandle key, string oid, @@ -35,7 +35,7 @@ internal static SafeEcKeyHandle EcKeyCreateByKeyParameters( return key; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")] internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters( ECCurve.ECCurveType curveType, byte[]? qx, int qxLength, @@ -91,7 +91,7 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) } - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] private static partial int AndroidCryptoNative_GetECKeyParameters( SafeEcKeyHandle key, [MarshalAs(UnmanagedType.Bool)] bool includePrivate, @@ -149,7 +149,7 @@ internal static ECParameters GetECKeyParameters( return parameters; } - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] private static partial int AndroidCryptoNative_GetECCurveParameters( SafeEcKeyHandle key, [MarshalAs(UnmanagedType.Bool)] bool includePrivate, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs index e81681e958ac84..1c34713271247b 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs @@ -12,7 +12,7 @@ internal static partial class AndroidCrypto internal static bool EcDsaSign(ReadOnlySpan dgst, Span sig, out int siglen, SafeEcKeyHandle ecKey) => EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey); @@ -34,11 +34,11 @@ ref MemoryMarshal.GetReference(sigbuf), * 0: incorrect signature * -1: error */ - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")] private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey); // returns the maximum length of a DER encoded ECDSA signature created with this key. - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")] private static partial int AndroidCryptoNative_EcDsaSize(SafeEcKeyHandle ecKey); internal static int EcDsaSize(SafeEcKeyHandle ecKey) diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs index 178610b0e9a36f..ada183189e172c 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)] private static partial SafeEcKeyHandle AndroidCryptoNative_EcKeyCreateByOid(string oid); internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid) { @@ -19,14 +19,14 @@ internal static partial class AndroidCrypto return handle; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")] internal static partial void EcKeyDestroy(IntPtr a); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EcKeyUpRef(IntPtr r); - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] private static partial int AndroidCryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize); internal static int EcKeyGetSize(SafeEcKeyHandle key) { @@ -39,7 +39,7 @@ internal static int EcKeyGetSize(SafeEcKeyHandle key) throw new CryptographicException(); } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")] private static partial int AndroidCryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out IntPtr curveName); internal static string? EcKeyGetCurveName(SafeEcKeyHandle key) diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs index c5bbd4c9abebd3..20ecb72e3bd3ee 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs @@ -13,7 +13,7 @@ internal static partial class AndroidCrypto internal static bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, Span buffer, out int usedBuffer) => EcdhDeriveKey(ourKey, peerKey, ref MemoryMarshal.GetReference(buffer), buffer.Length, out usedBuffer); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, ref byte buffer, int bufferLength, out int usedBuffer); } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs index 96d983bf701416..42071325b54170 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs @@ -10,22 +10,22 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")] internal static partial ulong ErrClearError(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")] private static partial ulong ErrGetErrorAlloc([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] internal static partial ulong ErrPeekError(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] internal static partial ulong ErrPeekLastError(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] internal static partial IntPtr ErrReasonErrorString(ulong error); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len); private static unsafe string ErrErrorStringN(ulong error) diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs index b233af7d4dcc44..8ba0658735a297 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs @@ -15,31 +15,31 @@ internal static partial class Crypto private static volatile IntPtr s_evpSha384; private static volatile IntPtr s_evpSha512; - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] private static partial IntPtr CryptoNative_EvpMd5(); internal static IntPtr EvpMd5() => s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5()); - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] internal static partial IntPtr CryptoNative_EvpSha1(); internal static IntPtr EvpSha1() => s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1()); - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] internal static partial IntPtr CryptoNative_EvpSha256(); internal static IntPtr EvpSha256() => s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256()); - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] internal static partial IntPtr CryptoNative_EvpSha384(); internal static IntPtr EvpSha384() => s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384()); - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] internal static partial IntPtr CryptoNative_EvpSha512(); internal static IntPtr EvpSha512() => diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs index 251f5bfc22042b..e3bea1970a27f4 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs @@ -10,37 +10,37 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] internal static partial void EvpMdCtxDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type); internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan d, int cnt) => EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")] private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")] internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] internal static partial int EvpMdSize(IntPtr md); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] private static partial int GetMaxMdSize(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] private static unsafe partial int Pbkdf2( byte* pPassword, int passwordLength, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs index 6f9cfefbff4add..f2bec40690bd72 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs @@ -10,28 +10,28 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")] internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] internal static partial void HmacDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")] internal static partial int HmacReset(SafeHmacCtxHandle ctx); internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan data, int len) => HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")] private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")] internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, ref int mdSize); internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan key, ReadOnlySpan source, Span destination) diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs index 9585bafbc576c4..9116ab58a0af3d 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs @@ -48,7 +48,7 @@ internal static void Initialize() // No-op that exists to provide a hook for other static constructors. } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] private static partial int EnsureOpenSslInitialized(); } } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs index fa8e5ff3711b16..c058213b1118ba 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs @@ -15,7 +15,7 @@ internal static unsafe bool GetRandomBytes(byte* pbBuffer, int count) return CryptoNative_GetRandomBytes(pbBuffer, count); } - [GeneratedDllImport(Libraries.AndroidCryptoNative)] + [LibraryImport(Libraries.AndroidCryptoNative)] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool CryptoNative_GetRandomBytes(byte* buf, int num); } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs index 2623cbcdcee137..9aef7f78b94dfa 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs @@ -11,20 +11,20 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")] internal static partial SafeRsaHandle RsaCreate(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool RsaUpRef(IntPtr rsa); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")] internal static partial void RsaDestroy(IntPtr rsa); internal static SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ReadOnlySpan buf) => DecodeRsaSubjectPublicKeyInfo(ref MemoryMarshal.GetReference(buf), buf.Length); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")] private static partial SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ref byte buf, int len); internal static int RsaPublicEncrypt( @@ -35,7 +35,7 @@ internal static int RsaPublicEncrypt( RsaPadding padding) => RsaPublicEncrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")] private static partial int RsaPublicEncrypt( int flen, ref byte from, @@ -51,7 +51,7 @@ internal static int RsaPrivateDecrypt( RsaPadding padding) => RsaPrivateDecrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")] private static partial int RsaPrivateDecrypt( int flen, ref byte from, @@ -65,7 +65,7 @@ internal static int RsaSignPrimitive( SafeRsaHandle rsa) => RsaSignPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")] private static partial int RsaSignPrimitive( int flen, ref byte from, @@ -78,17 +78,17 @@ internal static int RsaVerificationPrimitive( SafeRsaHandle rsa) => RsaVerificationPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")] private static partial int RsaVerificationPrimitive( int flen, ref byte from, ref byte to, SafeRsaHandle rsa); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")] internal static partial int RsaSize(SafeRsaHandle rsa); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")] internal static partial int RsaGenerateKeyEx(SafeRsaHandle rsa, int bits); internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includePrivateParameters) @@ -159,7 +159,7 @@ internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includ } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetRsaParameters( SafeRsaHandle key, @@ -172,7 +172,7 @@ private static partial bool GetRsaParameters( out SafeBignumHandle dmq1, out SafeBignumHandle iqmp); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetRsaParameters( SafeRsaHandle key, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs index f0f7356bbe9f38..5fd3828a319636 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")] internal static partial SslProtocols SSLGetSupportedProtocols(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")] [return:MarshalAs(UnmanagedType.U1)] internal static partial bool SSLSupportsApplicationProtocolsConfiguration(); } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs index 9ae88238278c11..56acba08ad5f99 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs @@ -31,10 +31,10 @@ internal enum PAL_SSLStreamStatus Closed = 4, }; - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")] internal static partial SafeSslHandle SSLStreamCreate(); - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")] private static partial SafeSslHandle SSLStreamCreateWithCertificates( ref byte pkcs8PrivateKey, int pkcs8PrivateKeyLen, @@ -51,7 +51,7 @@ ref MemoryMarshal.GetReference(pkcs8PrivateKey), certificates.Length); } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")] private static partial int SSLStreamInitializeImpl( SafeSslHandle sslHandle, [MarshalAs(UnmanagedType.U1)] bool isServer, @@ -70,7 +70,7 @@ internal static void SSLStreamInitialize( throw new SslException(); } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")] private static partial int SSLStreamSetTargetHostImpl( SafeSslHandle sslHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string targetHost); @@ -85,7 +85,7 @@ internal static void SSLStreamSetTargetHost( throw new SslException(); } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")] internal static partial void SSLStreamRequestClientAuthentication(SafeSslHandle sslHandle); [StructLayout(LayoutKind.Sequential)] @@ -95,7 +95,7 @@ private unsafe struct ApplicationProtocolData public int Length; } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")] private static unsafe partial int SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, ApplicationProtocolData[] protocolData, int count); internal static unsafe void SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, List protocols) { @@ -129,7 +129,7 @@ internal static unsafe void SSLStreamSetApplicationProtocols(SafeSslHandle sslHa } } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")] private static partial int SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ref SslProtocols protocols, int length); internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadOnlySpan protocols) { @@ -138,10 +138,10 @@ internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadO throw new SslException(); } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")] internal static partial PAL_SSLStreamStatus SSLStreamHandshake(SafeSslHandle sslHandle); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")] private static partial int SSLStreamGetApplicationProtocol(SafeSslHandle ssl, byte[]? buf, ref int len); internal static byte[]? SSLStreamGetApplicationProtocol(SafeSslHandle ssl) { @@ -158,7 +158,7 @@ internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadO return bytes; } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")] private static unsafe partial PAL_SSLStreamStatus SSLStreamRead( SafeSslHandle sslHandle, byte* buffer, @@ -175,7 +175,7 @@ internal static unsafe PAL_SSLStreamStatus SSLStreamRead( } } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")] private static unsafe partial PAL_SSLStreamStatus SSLStreamWrite( SafeSslHandle sslHandle, byte* buffer, @@ -190,7 +190,7 @@ internal static unsafe PAL_SSLStreamStatus SSLStreamWrite( } } - [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")] + [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")] internal static partial void SSLStreamRelease(IntPtr ptr); internal sealed class SslException : Exception @@ -205,7 +205,7 @@ internal SslException(int errorCode) } } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")] private static partial int SSLStreamGetProtocol(SafeSslHandle ssl, out IntPtr protocol); internal static string SSLStreamGetProtocol(SafeSslHandle ssl) { @@ -222,10 +222,10 @@ internal static string SSLStreamGetProtocol(SafeSslHandle ssl) return protocol; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")] internal static partial SafeX509Handle SSLStreamGetPeerCertificate(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")] private static partial void SSLStreamGetPeerCertificates( SafeSslHandle ssl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out IntPtr[] certs, @@ -237,7 +237,7 @@ private static partial void SSLStreamGetPeerCertificates( return ptrs; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")] private static partial int SSLStreamGetCipherSuite(SafeSslHandle ssl, out IntPtr cipherSuite); internal static string SSLStreamGetCipherSuite(SafeSslHandle ssl) { @@ -254,11 +254,11 @@ internal static string SSLStreamGetCipherSuite(SafeSslHandle ssl) return cipherSuite; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")] [return: MarshalAs(UnmanagedType.U1)] internal static partial bool SSLStreamShutdown(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")] [return: MarshalAs(UnmanagedType.U1)] internal static partial bool SSLStreamVerifyHostname( SafeSslHandle ssl, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs index ee0bf3c7e552e7..cc3733f271e9b5 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs @@ -13,10 +13,10 @@ internal static partial class AndroidCrypto private const int INSUFFICIENT_BUFFER = -1; private const int SUCCESS = 1; - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")] internal static partial SafeX509Handle X509Decode(ref byte buf, int len); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")] private static partial int X509Encode(SafeX509Handle x, byte[]? buf, ref int len); internal static byte[] X509Encode(SafeX509Handle x) { @@ -33,7 +33,7 @@ internal static byte[] X509Encode(SafeX509Handle x) return encoded; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")] private static partial int X509DecodeCollection(ref byte buf, int bufLen, IntPtr[]? ptrs, ref int handlesLen); internal static SafeX509Handle[] X509DecodeCollection(ReadOnlySpan data) { @@ -60,7 +60,7 @@ internal static SafeX509Handle[] X509DecodeCollection(ReadOnlySpan data) return handles; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")] private static partial int X509ExportPkcs7(IntPtr[] certs, int certsLen, byte[]? buf, ref int len); internal static byte[] X509ExportPkcs7(IntPtr[] certHandles) { @@ -77,7 +77,7 @@ internal static byte[] X509ExportPkcs7(IntPtr[] certHandles) return encoded; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")] private static partial X509ContentType X509GetContentType(ref byte buf, int len); internal static X509ContentType X509GetContentType(ReadOnlySpan data) { @@ -92,7 +92,7 @@ internal enum PAL_KeyAlgorithm UnknownAlgorithm = -1, } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")] internal static partial IntPtr X509GetPublicKey(SafeX509Handle x, PAL_KeyAlgorithm algorithm); } } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Chain.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Chain.cs index c19c68fdfc0820..996b0de5513f59 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Chain.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Chain.cs @@ -12,25 +12,25 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainCreateContext")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainCreateContext")] internal static partial SafeX509ChainContextHandle X509ChainCreateContext( SafeX509Handle cert, IntPtr[] extraStore, int extraStoreLen); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainDestroyContext")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainDestroyContext")] internal static partial void X509ChainDestroyContext(IntPtr ctx); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainBuild")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainBuild")] [return: MarshalAs(UnmanagedType.U1)] internal static partial bool X509ChainBuild( SafeX509ChainContextHandle ctx, long timeInMsFromUnixEpoch); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificateCount")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificateCount")] private static partial int X509ChainGetCertificateCount(SafeX509ChainContextHandle ctx); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificates")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificates")] private static partial int X509ChainGetCertificates( SafeX509ChainContextHandle ctx, IntPtr[] certs, @@ -69,10 +69,10 @@ internal struct ValidationError public int Status; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrorCount")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrorCount")] private static partial int X509ChainGetErrorCount(SafeX509ChainContextHandle ctx); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrors")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrors")] private static unsafe partial int X509ChainGetErrors( SafeX509ChainContextHandle ctx, ValidationError[] errors, @@ -92,17 +92,17 @@ internal static ValidationError[] X509ChainGetErrors(SafeX509ChainContextHandle return errors; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSetCustomTrustStore")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSetCustomTrustStore")] internal static partial int X509ChainSetCustomTrustStore( SafeX509ChainContextHandle ctx, IntPtr[] customTrustStore, int customTrustStoreLen); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSupportsRevocationOptions")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSupportsRevocationOptions")] [return:MarshalAs(UnmanagedType.U1)] internal static partial bool X509ChainSupportsRevocationOptions(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainValidate")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainValidate")] internal static partial int X509ChainValidate( SafeX509ChainContextHandle ctx, X509RevocationMode revocationMode, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Store.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Store.cs index 2dcbd1683b5f38..ec5861ba6e1f42 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Store.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Store.cs @@ -11,14 +11,14 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificate", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificate", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool X509StoreAddCertificate( SafeX509StoreHandle store, SafeX509Handle cert, string hashString); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool X509StoreAddCertificateWithPrivateKey( SafeX509StoreHandle store, @@ -27,31 +27,31 @@ internal static unsafe partial bool X509StoreAddCertificateWithPrivateKey( PAL_KeyAlgorithm algorithm, string hashString); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreContainsCertificate", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreContainsCertificate", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool X509StoreContainsCertificate( SafeX509StoreHandle store, SafeX509Handle cert, string hashString); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateCertificates")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateCertificates")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool X509StoreEnumerateCertificates( SafeX509StoreHandle storeHandle, delegate* unmanaged callback, void *callbackContext); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool X509StoreEnumerateTrustedCertificates( byte systemOnly, delegate* unmanaged callback, void *callbackContext); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreOpenDefault")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreOpenDefault")] internal static unsafe partial SafeX509StoreHandle X509StoreOpenDefault(); - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreRemoveCertificate", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreRemoveCertificate", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool X509StoreRemoveCertificate( SafeX509StoreHandle store, diff --git a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs index 12554a3f2ff6a1..87c060be74f422 100644 --- a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs +++ b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs @@ -33,7 +33,7 @@ public readonly struct TcpGlobalStatistics private readonly int __padding; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")] public static unsafe partial int GetTcpGlobalStatistics(TcpGlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] @@ -55,7 +55,7 @@ public readonly struct IPv4GlobalStatistics public readonly int Forwarding; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")] public static unsafe partial int GetIPv4GlobalStatistics(IPv4GlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] @@ -68,7 +68,7 @@ public readonly struct UdpGlobalStatistics public readonly ulong UdpListeners; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")] public static unsafe partial int GetUdpGlobalStatistics(UdpGlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] @@ -98,7 +98,7 @@ public readonly struct Icmpv4GlobalStatistics public readonly ulong TimestampRequestsSent; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")] public static unsafe partial int GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] @@ -134,7 +134,7 @@ public readonly struct Icmpv6GlobalStatistics public readonly ulong TimeExceededMessagesSent; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")] public static unsafe partial int GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* statistics); public readonly struct NativeIPInterfaceStatistics @@ -155,10 +155,10 @@ public readonly struct NativeIPInterfaceStatistics public readonly ulong Flags; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", StringMarshalling = StringMarshalling.Utf8)] public static partial int GetNativeIPInterfaceStatistics(string name, out NativeIPInterfaceStatistics stats); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")] public static partial int GetNumRoutes(); } } diff --git a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.Sysctl.cs b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.Sysctl.cs index 3c98d2d828d51d..9205bd014fac42 100644 --- a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.Sysctl.cs +++ b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.Sysctl.cs @@ -16,7 +16,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sysctl", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sysctl", SetLastError = true)] private static unsafe partial int Sysctl(int* name, int namelen, void* value, size_t* len); // This is 'raw' sysctl call, only wrapped to allocate memory if needed diff --git a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs index 35a6b9dd5b5452..520d4d10457332 100644 --- a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs +++ b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs @@ -25,16 +25,16 @@ public struct NativeTcpConnectionInformation public TcpState State; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")] public static partial int GetEstimatedTcpConnectionCount(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")] public static unsafe partial int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")] public static partial int GetEstimatedUdpListenerCount(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")] public static unsafe partial int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount); } } diff --git a/src/libraries/Common/src/Interop/Interop.Brotli.cs b/src/libraries/Common/src/Interop/Interop.Brotli.cs index 0ebede8c938300..919240e692e55e 100644 --- a/src/libraries/Common/src/Interop/Interop.Brotli.cs +++ b/src/libraries/Common/src/Interop/Interop.Brotli.cs @@ -10,41 +10,41 @@ internal static partial class Interop { internal static partial class Brotli { - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial SafeBrotliDecoderHandle BrotliDecoderCreateInstance(IntPtr allocFunc, IntPtr freeFunc, IntPtr opaque); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static unsafe partial int BrotliDecoderDecompressStream( SafeBrotliDecoderHandle state, ref nuint availableIn, byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static unsafe partial BOOL BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial void BrotliDecoderDestroyInstance(IntPtr state); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial BOOL BrotliDecoderIsFinished(SafeBrotliDecoderHandle state); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial SafeBrotliEncoderHandle BrotliEncoderCreateInstance(IntPtr allocFunc, IntPtr freeFunc, IntPtr opaque); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial BOOL BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, uint value); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static unsafe partial BOOL BrotliEncoderCompressStream( SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref nuint availableIn, byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial BOOL BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static partial void BrotliEncoderDestroyInstance(IntPtr state); - [GeneratedDllImport(Libraries.CompressionNative)] + [LibraryImport(Libraries.CompressionNative)] internal static unsafe partial BOOL BrotliEncoderCompress(int quality, int window, int v, nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes); } } diff --git a/src/libraries/Common/src/Interop/Interop.Calendar.cs b/src/libraries/Common/src/Interop/Interop.Calendar.cs index 5efe9837327a08..622ecc65220442 100644 --- a/src/libraries/Common/src/Interop/Interop.Calendar.cs +++ b/src/libraries/Common/src/Interop/Interop.Calendar.cs @@ -9,10 +9,10 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetCalendars(string localeName, CalendarId[] calendars, int calendarsCapacity); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity); internal static unsafe bool EnumCalendarInfo(delegate* unmanaged callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context) @@ -20,16 +20,16 @@ internal static unsafe bool EnumCalendarInfo(delegate* unmanaged version, ReadOnlySpan suffix) @@ -20,10 +20,10 @@ internal static void InitICUFunctions(IntPtr icuuc, IntPtr icuin, ReadOnlySpan 0 ? suffix.ToString() : null); } - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", StringMarshalling = StringMarshalling.Utf8)] internal static partial void InitICUFunctions(IntPtr icuuc, IntPtr icuin, string version, string? suffix); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")] internal static partial int GetICUVersion(); } } diff --git a/src/libraries/Common/src/Interop/Interop.ICU.iOS.cs b/src/libraries/Common/src/Interop/Interop.ICU.iOS.cs index 496e5db12941fa..42df7e7f97ceec 100644 --- a/src/libraries/Common/src/Interop/Interop.ICU.iOS.cs +++ b/src/libraries/Common/src/Interop/Interop.ICU.iOS.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICUData", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICUData", StringMarshalling = StringMarshalling.Utf8)] internal static partial int LoadICUData(string path); } } diff --git a/src/libraries/Common/src/Interop/Interop.Idna.cs b/src/libraries/Common/src/Interop/Interop.Idna.cs index 1c720abde79557..f5a8e90adcbeb0 100644 --- a/src/libraries/Common/src/Interop/Interop.Idna.cs +++ b/src/libraries/Common/src/Interop/Interop.Idna.cs @@ -10,10 +10,10 @@ internal static partial class Globalization internal const int AllowUnassigned = 0x1; internal const int UseStd3AsciiRules = 0x2; - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); } } diff --git a/src/libraries/Common/src/Interop/Interop.Locale.cs b/src/libraries/Common/src/Interop/Interop.Locale.cs index 678833566cb1b5..051f2763a11b85 100644 --- a/src/libraries/Common/src/Interop/Interop.Locale.cs +++ b/src/libraries/Common/src/Interop/Interop.Locale.cs @@ -7,35 +7,35 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetLocaleName(string localeName, char* value, int valueLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetLocaleInfoString(string localeName, uint localeStringData, char* value, int valueLength, string? uiLocaleName = null); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetDefaultLocaleName(char* value, int valueLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsPredefinedLocale(string localeName); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetLocaleTimeFormat(string localeName, [MarshalAs(UnmanagedType.Bool)] bool shortFormat, char* value, int valueLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetLocales([Out] char[]? value, int valueLength); } } diff --git a/src/libraries/Common/src/Interop/Interop.Normalization.cs b/src/libraries/Common/src/Interop/Interop.Normalization.cs index 287bc028ead582..633f272f5f51a7 100644 --- a/src/libraries/Common/src/Interop/Interop.Normalization.cs +++ b/src/libraries/Common/src/Interop/Interop.Normalization.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int IsNormalized(NormalizationForm normalizationForm, char* src, int srcLen); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int NormalizeString(NormalizationForm normalizationForm, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); } } diff --git a/src/libraries/Common/src/Interop/Interop.Odbc.cs b/src/libraries/Common/src/Interop/Interop.Odbc.cs index 8e2a09f65c0aed..7e20cba698e7dd 100644 --- a/src/libraries/Common/src/Interop/Interop.Odbc.cs +++ b/src/libraries/Common/src/Interop/Interop.Odbc.cs @@ -20,19 +20,19 @@ internal static partial class Odbc // // ODBC32 // - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLAllocHandle( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/IntPtr InputHandle, /*SQLHANDLE* */out IntPtr OutputHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLAllocHandle( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/OdbcHandle InputHandle, /*SQLHANDLE* */out IntPtr OutputHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindCol( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ColumnNumber, @@ -45,7 +45,7 @@ internal static partial ODBC32.SQLRETURN SQLAllocHandle( /*SQLLEN*/IntPtr BufferLength, /*SQLLEN* */IntPtr StrLen_or_Ind); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLBindCol( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ColumnNumber, @@ -54,7 +54,7 @@ internal static partial ODBC32.SQLRETURN SQLBindCol( /*SQLLEN*/IntPtr BufferLength, /*SQLLEN* */IntPtr StrLen_or_Ind); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindParameter( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ParameterNumber, @@ -75,15 +75,15 @@ internal static partial ODBC32.SQLRETURN SQLBindCol( #endif HandleRef StrLen_or_Ind); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLCancel( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLCloseCursor( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLColAttributeW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/short ColumnNumber, @@ -108,7 +108,7 @@ internal static partial ODBC32.SQLRETURN SQLColAttributeW( // SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute); // #endif - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLColumnsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string CatalogName, @@ -120,11 +120,11 @@ internal static partial ODBC32.SQLRETURN SQLColumnsW( /*SQLCHAR* */string ColumnName, /*SQLSMALLINT*/short NameLen4); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLDisconnect( /*SQLHDBC*/IntPtr ConnectionHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLDriverConnectW( /*SQLHDBC*/OdbcConnectionHandle hdbc, /*SQLHWND*/IntPtr hwnd, @@ -135,37 +135,37 @@ internal static partial ODBC32.SQLRETURN SQLDriverConnectW( /*SQLSMALLINT* */out short cbConnectionstringout, /*SQLUSMALLINT*/short fDriverCompletion); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLEndTran( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/IntPtr Handle, /*SQLSMALLINT*/short CompletionType); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLExecDirectW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string StatementText, /*SQLINTEGER*/int TextLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLExecute( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLFetch( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLFreeHandle( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHSTMT*/IntPtr StatementHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLFreeStmt( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ODBC32.STMT Option); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetConnectAttrW( /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, @@ -173,7 +173,7 @@ internal static partial ODBC32.SQLRETURN SQLGetConnectAttrW( /*SQLINTEGER*/int BufferLength, /*SQLINTEGER* */out int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetData( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ColumnNumber, @@ -182,7 +182,7 @@ internal static partial ODBC32.SQLRETURN SQLGetData( /*SQLLEN*/IntPtr BufferLength, // sql.h differs from MSDN /*SQLLEN* */out IntPtr StrLen_or_Ind); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetDescFieldW( /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle, /*SQLUSMALLINT*/short RecNumber, @@ -191,7 +191,7 @@ internal static partial ODBC32.SQLRETURN SQLGetDescFieldW( /*SQLINTEGER*/int BufferLength, /*SQLINTEGER* */out int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLGetDiagRecW( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/OdbcHandle Handle, @@ -202,7 +202,7 @@ internal static partial ODBC32.SQLRETURN SQLGetDiagRecW( /*SQLSMALLINT*/short BufferLength, /*SQLSMALLINT* */out short TextLength); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLGetDiagFieldW( /*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/ OdbcHandle Handle, @@ -212,13 +212,13 @@ internal static partial ODBC32.SQLRETURN SQLGetDiagFieldW( /*SQLSMALLINT*/ short BufferLength, /*SQLSMALLINT* */ out short StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetFunctions( /*SQLHBDC*/OdbcConnectionHandle hdbc, /*SQLUSMALLINT*/ODBC32.SQL_API fFunction, /*SQLUSMALLINT* */out short pfExists); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetInfoW( /*SQLHBDC*/OdbcConnectionHandle hdbc, /*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, @@ -226,7 +226,7 @@ internal static partial ODBC32.SQLRETURN SQLGetInfoW( /*SQLSMALLINT*/short cbInfoValueMax, /*SQLSMALLINT* */out short pcbInfoValue); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetInfoW( /*SQLHBDC*/OdbcConnectionHandle hdbc, /*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, @@ -234,7 +234,7 @@ internal static partial ODBC32.SQLRETURN SQLGetInfoW( /*SQLSMALLINT*/short cbInfoValueMax, /*SQLSMALLINT* */IntPtr pcbInfoValue); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetStmtAttrW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, @@ -242,27 +242,27 @@ internal static partial ODBC32.SQLRETURN SQLGetStmtAttrW( /*SQLINTEGER*/int BufferLength, /*SQLINTEGER*/out int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLGetTypeInfo( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLSMALLINT*/short fSqlType); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLMoreResults( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLNumResultCols( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLSMALLINT* */out short ColumnCount); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLPrepareW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string StatementText, /*SQLINTEGER*/int TextLength); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLPrimaryKeysW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string? CatalogName, @@ -272,7 +272,7 @@ internal static partial ODBC32.SQLRETURN SQLPrimaryKeysW( /*SQLCHAR* */string TableName, /*SQLSMALLINT*/short NameLen3); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLProcedureColumnsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */ string? CatalogName, @@ -284,7 +284,7 @@ internal static partial ODBC32.SQLRETURN SQLProcedureColumnsW( /*SQLCHAR* */ string? ColumnName, /*SQLSMALLINT*/short NameLen4); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLProceduresW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */ string CatalogName, @@ -294,33 +294,33 @@ internal static partial ODBC32.SQLRETURN SQLProceduresW( /*SQLCHAR* */ string ProcName, /*SQLSMALLINT*/short NameLen3); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLRowCount( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLLEN* */out IntPtr RowCount); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/string Value, /*SQLINTEGER*/int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( // used only for AutoCommitOn /*SQLHBDC*/IntPtr ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLSetDescFieldW( /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle, /*SQLSMALLINT*/short ColumnNumber, @@ -332,7 +332,7 @@ internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( HandleRef CharacterAttribute, /*SQLINTEGER*/int BufferLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLSetDescFieldW( /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle, /*SQLSMALLINT*/short ColumnNumber, @@ -340,7 +340,7 @@ internal static partial ODBC32.SQLRETURN SQLSetDescFieldW( /*SQLPOINTER*/IntPtr CharacterAttribute, /*SQLINTEGER*/int BufferLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] // user can set SQL_ATTR_CONNECTION_POOLING attribute with envHandle = null, this attribute is process-level attribute internal static partial ODBC32.SQLRETURN SQLSetEnvAttr( /*SQLHENV*/OdbcEnvironmentHandle EnvironmentHandle, @@ -348,14 +348,14 @@ internal static partial ODBC32.SQLRETURN SQLSetEnvAttr( /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/ODBC32.SQL_IS StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32)] + [LibraryImport(Interop.Libraries.Odbc32)] internal static partial ODBC32.SQLRETURN SQLSetStmtAttrW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLINTEGER*/int Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/int StringLength); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLSpecialColumnsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType, @@ -368,7 +368,7 @@ internal static partial ODBC32.SQLRETURN SQLSpecialColumnsW( /*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope, /*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLStatisticsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string? CatalogName, @@ -380,7 +380,7 @@ internal static partial ODBC32.SQLRETURN SQLStatisticsW( /*SQLUSMALLINT*/short Unique, /*SQLUSMALLINT*/short Reserved); - [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)] internal static partial ODBC32.SQLRETURN SQLTablesW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string CatalogName, diff --git a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs index 3163a215f2647e..7dc5100a8b094e 100644 --- a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs +++ b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial ResultCode GetTimeZoneDisplayName( string localeName, string timeZoneId, @@ -16,10 +16,10 @@ internal static unsafe partial ResultCode GetTimeZoneDisplayName( char* result, int resultLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int WindowsIdToIanaId(string windowsId, IntPtr region, char* ianaId, int ianaIdLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int IanaIdToWindowsId(string ianaId, char* windowsId, int windowsIdLength); } } diff --git a/src/libraries/Common/src/Interop/Interop.zlib.cs b/src/libraries/Common/src/Interop/Interop.zlib.cs index d764bf865310f8..ba4326dfed0d94 100644 --- a/src/libraries/Common/src/Interop/Interop.zlib.cs +++ b/src/libraries/Common/src/Interop/Interop.zlib.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class ZLib { - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")] internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_( ZLibNative.ZStream* stream, ZLibNative.CompressionLevel level, @@ -17,28 +17,28 @@ internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_( int memLevel, ZLibNative.CompressionStrategy strategy); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")] internal static unsafe partial ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")] internal static unsafe partial ZLibNative.ErrorCode DeflateReset(ZLibNative.ZStream* stream); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")] internal static unsafe partial ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")] internal static unsafe partial ZLibNative.ErrorCode InflateInit2_(ZLibNative.ZStream* stream, int windowBits); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")] internal static unsafe partial ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")] internal static unsafe partial ZLibNative.ErrorCode InflateReset(ZLibNative.ZStream* stream); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")] internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream); - [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")] + [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")] internal static unsafe partial uint crc32(uint crc, byte* buffer, int len); } } diff --git a/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ber.cs b/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ber.cs index 32ce0da44abfa7..20c2f5bb78d88a 100644 --- a/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ber.cs +++ b/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ber.cs @@ -12,13 +12,13 @@ internal static partial class Ldap { public const int ber_default_successful_return_code = 0; - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_alloc_t")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_alloc_t")] public static partial IntPtr ber_alloc(int option); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_init")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_init")] public static partial IntPtr ber_init(BerVal value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_free")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_free")] public static partial IntPtr ber_free(IntPtr berelement, int option); public static int ber_printf_emptyarg(SafeBerHandle berElement, string format, nuint tag) @@ -46,19 +46,19 @@ public static int ber_printf_emptyarg(SafeBerHandle berElement, string format, n } } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_start_seq")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_start_seq")] public static partial int ber_start_seq(SafeBerHandle berElement, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_start_set")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_start_set")] public static partial int ber_start_set(SafeBerHandle berElement, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_seq")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_seq")] public static partial int ber_put_seq(SafeBerHandle berElement, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_set")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_set")] public static partial int ber_put_set(SafeBerHandle berElement, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_null")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_null")] public static partial int ber_put_null(SafeBerHandle berElement, nuint tag); public static int ber_printf_int(SafeBerHandle berElement, string format, int value, nuint tag) @@ -78,13 +78,13 @@ public static int ber_printf_int(SafeBerHandle berElement, string format, int va } } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_int")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_int")] public static partial int ber_put_int(SafeBerHandle berElement, int value, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_enum")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_enum")] public static partial int ber_put_enum(SafeBerHandle berElement, int value, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_boolean")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_boolean")] public static partial int ber_put_boolean(SafeBerHandle berElement, int value, nuint tag); public static int ber_printf_bytearray(SafeBerHandle berElement, string format, HGlobalMemHandle value, nuint length, nuint tag) @@ -104,22 +104,22 @@ public static int ber_printf_bytearray(SafeBerHandle berElement, string format, } } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_ostring")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_ostring")] private static partial int ber_put_ostring(SafeBerHandle berElement, HGlobalMemHandle value, nuint length, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_string")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_string")] private static partial int ber_put_string(SafeBerHandle berElement, HGlobalMemHandle value, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_bitstring")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_bitstring")] private static partial int ber_put_bitstring(SafeBerHandle berElement, HGlobalMemHandle value, nuint length, nuint tag); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_flatten")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_flatten")] public static partial int ber_flatten(SafeBerHandle berElement, ref IntPtr value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_bvfree")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_bvfree")] public static partial int ber_bvfree(IntPtr value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_bvecfree")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_bvecfree")] public static partial int ber_bvecfree(IntPtr value); public static int ber_scanf_emptyarg(SafeBerHandle berElement, string format) @@ -141,10 +141,10 @@ public static int ber_scanf_emptyarg(SafeBerHandle berElement, string format) } } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_skip_tag")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_skip_tag")] private static partial int ber_skip_tag(SafeBerHandle berElement, ref nuint len); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_null")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_null")] private static partial int ber_get_null(SafeBerHandle berElement); public static int ber_scanf_int(SafeBerHandle berElement, string format, ref int value) @@ -164,13 +164,13 @@ public static int ber_scanf_int(SafeBerHandle berElement, string format, ref int } } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_int")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_int")] private static partial int ber_get_int(SafeBerHandle berElement, ref int value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_enum")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_enum")] private static partial int ber_get_enum(SafeBerHandle berElement, ref int value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_boolean")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_boolean")] private static partial int ber_get_boolean(SafeBerHandle berElement, ref int value); public static int ber_scanf_bitstring(SafeBerHandle berElement, string format, ref IntPtr value, ref uint bitLength) @@ -182,7 +182,7 @@ public static int ber_scanf_bitstring(SafeBerHandle berElement, string format, r return res; } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringb")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringb")] private static partial int ber_get_stringb(SafeBerHandle berElement, ref IntPtr value, ref nuint bitLength); public static int ber_scanf_ptr(SafeBerHandle berElement, string format, ref IntPtr value) @@ -191,7 +191,7 @@ public static int ber_scanf_ptr(SafeBerHandle berElement, string format, ref Int return ber_get_stringal(berElement, ref value); } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringal")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringal")] private static partial int ber_get_stringal(SafeBerHandle berElement, ref IntPtr value); public static int ber_printf_berarray(SafeBerHandle berElement, string format, IntPtr value, nuint tag) diff --git a/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs b/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs index 74f423feed0db2..faf43785254ec4 100644 --- a/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs +++ b/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs @@ -76,43 +76,43 @@ static Ldap() ldap_get_option_int(IntPtr.Zero, LdapOption.LDAP_OPT_DEBUG_LEVEL, ref unused); } - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_initialize", SetLastError = true)] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_initialize", SetLastError = true)] public static partial int ldap_initialize(out IntPtr ld, [MarshalAs(UnmanagedType.LPUTF8Str)] string uri); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_unbind_ext_s")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_unbind_ext_s")] public static partial int ldap_unbind_ext_s(IntPtr ld, ref IntPtr serverctrls, ref IntPtr clientctrls); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_dn")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_dn")] public static partial IntPtr ldap_get_dn(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] public static partial int ldap_get_option_bool(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.Bool)] ref bool outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void* outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] private static partial int ldap_get_option_int(IntPtr ldapHandle, LdapOption option, ref int outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] public static partial int ldap_get_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")] public static partial int ldap_get_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_values_len")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_values_len")] public static partial IntPtr ldap_get_values_len(ConnectionHandle ldapHandle, IntPtr result, [MarshalAs(UnmanagedType.LPUTF8Str)] string name); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_result", SetLastError = true)] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_result", SetLastError = true)] public static partial int ldap_result(ConnectionHandle ldapHandle, int messageId, int all, in LDAP_TIMEVAL timeout, ref IntPtr Mesage); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_result2error")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_result2error")] public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_search_ext")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_search_ext")] public static partial int ldap_search( ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, @@ -126,44 +126,44 @@ public static partial int ldap_search( int sizelimit, ref int messageNumber); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)] public static partial int ldap_set_option_bool(ConnectionHandle ld, LdapOption option, [MarshalAs(UnmanagedType.Bool)] bool value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)] public static partial int ldap_set_option_int(ConnectionHandle ld, LdapOption option, ref int inValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] public static partial int ldap_set_option_string(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.LPUTF8Str)] string inValue); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")] public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue); // Note that ldap_start_tls_s has a different signature across Windows LDAP and OpenLDAP - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_start_tls_s")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_start_tls_s")] public static partial int ldap_start_tls(ConnectionHandle ldapHandle, IntPtr serverControls, IntPtr clientControls); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")] public static partial int ldap_parse_result(ConnectionHandle ldapHandle, IntPtr result, ref int serverError, ref IntPtr dn, ref IntPtr message, ref IntPtr referral, ref IntPtr control, byte freeIt); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")] public static partial int ldap_parse_result_referral(ConnectionHandle ldapHandle, IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_extended_result")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_extended_result")] public static partial int ldap_parse_extended_result(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_reference")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_reference")] public static partial int ldap_parse_reference(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr referrals, IntPtr ServerControls, byte freeIt); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_bind_s")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_bind_s")] internal static partial int ldap_sasl_bind( ConnectionHandle ld, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, @@ -173,7 +173,7 @@ internal static partial int ldap_sasl_bind( IntPtr clientctrls, IntPtr servercredp); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_interactive_bind_s")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_interactive_bind_s")] internal static partial int ldap_sasl_interactive_bind( ConnectionHandle ld, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, @@ -184,64 +184,64 @@ internal static partial int ldap_sasl_interactive_bind( LDAP_SASL_INTERACT_PROC proc, IntPtr defaults); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_err2string")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_err2string")] public static partial IntPtr ldap_err2string(int err); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_extended_operation")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_extended_operation")] public static partial int ldap_extended_operation(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string oid, BerVal data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_attribute")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_attribute")] public static partial IntPtr ldap_first_attribute(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr address); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_entry")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_entry")] public static partial IntPtr ldap_first_entry(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_reference")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_reference")] public static partial IntPtr ldap_first_reference(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_create_sort_control")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_create_sort_control")] public static partial int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_control_free")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_control_free")] public static partial int ldap_control_free(IntPtr control); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_controls_free")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_controls_free")] public static partial int ldap_controls_free(IntPtr value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free")] public static partial int ldap_value_free(IntPtr value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free_len")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free_len")] public static partial IntPtr ldap_value_free_len(IntPtr berelement); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree")] public static partial void ldap_memfree(IntPtr value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree")] public static partial void ldap_msgfree(IntPtr value); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext")] public static partial int ldap_modify(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_attribute")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_attribute")] public static partial IntPtr ldap_next_attribute(ConnectionHandle ldapHandle, IntPtr result, IntPtr address); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_entry")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_entry")] public static partial IntPtr ldap_next_entry(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_reference")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_reference")] public static partial IntPtr ldap_next_reference(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_abandon")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_abandon")] public static partial int ldap_abandon(ConnectionHandle ldapHandle, int messagId); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_add_ext")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_add_ext")] public static partial int ldap_add(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_delete_ext")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_delete_ext")] public static partial int ldap_delete_ext(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_rename")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_rename")] public static partial int ldap_rename( ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, @@ -252,7 +252,7 @@ public static partial int ldap_rename( IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_compare_ext")] + [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_compare_ext")] public static partial int ldap_compare( ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, diff --git a/src/libraries/Common/src/Interop/Linux/System.Native/Interop.INotify.cs b/src/libraries/Common/src/Interop/Linux/System.Native/Interop.INotify.cs index 8f0936bf1c3011..446bdb4ada25f6 100644 --- a/src/libraries/Common/src/Interop/Linux/System.Native/Interop.INotify.cs +++ b/src/libraries/Common/src/Interop/Linux/System.Native/Interop.INotify.cs @@ -10,13 +10,13 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyInit", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyInit", SetLastError = true)] internal static partial SafeFileHandle INotifyInit(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyAddWatch", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyAddWatch", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int INotifyAddWatch(SafeFileHandle fd, string pathName, uint mask); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyRemoveWatch", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyRemoveWatch", SetLastError = true)] private static partial int INotifyRemoveWatch_private(SafeFileHandle fd, int wd); internal static int INotifyRemoveWatch(SafeFileHandle fd, int wd) diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFArray.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFArray.cs index aeba90d5bc5467..cb91cdea28b93f 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFArray.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFArray.cs @@ -13,12 +13,12 @@ internal static partial class Interop { internal static partial class CoreFoundation { - [GeneratedDllImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetCount")] + [LibraryImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetCount")] private static partial CFIndex _CFArrayGetCount(SafeCFArrayHandle cfArray); // Follows the "Get" version of the "Create" rule, so needs to return an IntPtr to // prevent CFRelease from being called on the SafeHandle close. - [GeneratedDllImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetValueAtIndex")] + [LibraryImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetValueAtIndex")] private static partial IntPtr CFArrayGetValueAtIndex(SafeCFArrayHandle cfArray, CFIndex index); internal static long CFArrayGetCount(SafeCFArrayHandle cfArray) diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFData.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFData.cs index f0775d72cadf94..482686b038e9a6 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFData.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFData.cs @@ -13,10 +13,10 @@ internal static partial class Interop { internal static partial class CoreFoundation { - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static unsafe partial byte* CFDataGetBytePtr(SafeCFDataHandle cfData); - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial CFIndex CFDataGetLength(SafeCFDataHandle cfData); internal static unsafe Span CFDataDangerousGetSpan(SafeCFDataHandle cfData) diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDate.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDate.cs index e43e20d83f679b..b1100a041f2fc5 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDate.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDate.cs @@ -17,7 +17,7 @@ internal static partial class CoreFoundation // https://developer.apple.com/reference/corefoundation/cfabsolutetime private static readonly DateTime s_cfDateEpoch = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc); - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial SafeCFDateHandle CFDateCreate(IntPtr zero, CFAbsoluteTime at); internal static SafeCFDateHandle CFDateCreate(DateTime date) diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDictionary.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDictionary.cs index 466bd584f46a6a..e8a319e6e6c9df 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDictionary.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDictionary.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class CoreFoundation { - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] internal static partial IntPtr CFDictionaryGetValue(SafeCFDictionaryHandle handle, IntPtr key); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs index 056628a81e6ee7..2e83d9d5ceb6c4 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs @@ -14,10 +14,10 @@ internal static partial class Interop { internal static partial class CoreFoundation { - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial CFIndex CFErrorGetCode(SafeCFErrorHandle cfError); - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial SafeCFStringHandle CFErrorCopyDescription(SafeCFErrorHandle cfError); internal static int GetErrorCode(SafeCFErrorHandle cfError) diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs index 631aa86ce04c87..22d51bdd11cc36 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs @@ -16,7 +16,7 @@ internal enum CFNumberType kCFNumberIntType = 9, } - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static unsafe partial int CFNumberGetValue(IntPtr handle, CFNumberType type, int* value); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs index f31504146348fc..1c0c8ebb6b53bc 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs @@ -13,22 +13,22 @@ internal static partial class Interop { internal static partial class CoreFoundation { - [GeneratedDllImport(Libraries.CFNetworkLibrary)] + [LibraryImport(Libraries.CFNetworkLibrary)] internal static partial SafeCFDictionaryHandle CFNetworkCopySystemProxySettings(); - [GeneratedDllImport(Libraries.CFNetworkLibrary)] + [LibraryImport(Libraries.CFNetworkLibrary)] internal static partial SafeCFArrayHandle CFNetworkCopyProxiesForURL(SafeCreateHandle url, SafeCFDictionaryHandle proxySettings); internal delegate void CFProxyAutoConfigurationResultCallback(IntPtr client, IntPtr proxyList, IntPtr error); - [GeneratedDllImport(Libraries.CFNetworkLibrary)] + [LibraryImport(Libraries.CFNetworkLibrary)] internal static partial CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationURL( IntPtr proxyAutoConfigURL, SafeCreateHandle targetURL, CFProxyAutoConfigurationResultCallback cb, ref CFStreamClientContext clientContext); - [GeneratedDllImport(Libraries.CFNetworkLibrary)] + [LibraryImport(Libraries.CFNetworkLibrary)] internal static partial CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationScript( IntPtr proxyAutoConfigurationScript, SafeCreateHandle targetURL, diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs index 152741605e0863..5350aaa900389f 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs @@ -15,12 +15,12 @@ internal static partial class CoreFoundation /// Returns the interior pointer of the cfString if it has the specified encoding. /// If it has the wrong encoding, or if the interior pointer isn't being shared for some reason, returns NULL /// - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial IntPtr CFStringGetCStringPtr( SafeCFStringHandle cfString, CFStringBuiltInEncodings encoding); - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial SafeCFDataHandle CFStringCreateExternalRepresentation( IntPtr alloc, SafeCFStringHandle theString, diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFUrl.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFUrl.cs index 96632448c113af..390799cd4bda4a 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFUrl.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFUrl.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class CoreFoundation { - [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + [LibraryImport(Libraries.CoreFoundationLibrary)] private static partial SafeCreateHandle CFURLCreateWithString( IntPtr allocator, SafeCreateHandle str, diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs index ea555a816634bc..efd8c3cdf916ac 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs @@ -47,7 +47,7 @@ private enum CFStringBuiltInEncodings : uint /// The encoding type. /// Whether or not a BOM is present. /// A CFStringRef on success, otherwise a SafeCreateHandle(IntPtr.Zero). - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] private static partial SafeCreateHandle CFStringCreateWithBytes( IntPtr alloc, IntPtr bytes, @@ -63,7 +63,7 @@ private static partial SafeCreateHandle CFStringCreateWithBytes( /// The encoding of the str variable. This should be UTF 8 for OS X /// Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero /// For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)] private static partial SafeCreateHandle CFStringCreateWithCString( IntPtr allocator, string str, @@ -77,7 +77,7 @@ private static partial SafeCreateHandle CFStringCreateWithCString( /// The encoding of the str variable. This should be UTF 8 for OS X /// Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero /// For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)] private static partial SafeCreateHandle CFStringCreateWithCString( IntPtr allocator, IntPtr str, @@ -130,7 +130,7 @@ internal static unsafe SafeCreateHandle CFStringCreateFromSpan(ReadOnlySpanThe number of values in the array /// Should be IntPtr.Zero /// Returns a pointer to a CFArray on success; otherwise, returns IntPtr.Zero - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] private static unsafe partial SafeCreateHandle CFArrayCreate( IntPtr allocator, IntPtr* values, @@ -171,14 +171,14 @@ internal static unsafe SafeCreateHandle CFArrayCreate(Span values) /// /// The CFType object to retain. This value must not be NULL /// The input value - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial IntPtr CFRetain(IntPtr ptr); /// /// Decrements the reference count on the specified object and, if the ref count hits 0, cleans up the object. /// /// The pointer on which to decrement the reference count. - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRelease(IntPtr ptr); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs b/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs index 2edb5c45f0a588..96fbdeadf24235 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs @@ -99,7 +99,7 @@ internal struct FSEventStreamContext /// Flags to say what kind of events should be sent through this stream. /// On success, returns a pointer to an FSEventStream object; otherwise, returns IntPtr.Zero /// For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)] internal static unsafe partial SafeEventStreamHandle FSEventStreamCreate( IntPtr allocator, delegate* unmanaged callback, @@ -115,7 +115,7 @@ internal static unsafe partial SafeEventStreamHandle FSEventStreamCreate( /// The stream to attach to the RunLoop /// The RunLoop to attach the stream to /// The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info. - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamScheduleWithRunLoop( SafeEventStreamHandle streamRef, CFRunLoopRef runLoop, @@ -126,7 +126,7 @@ internal static partial void FSEventStreamScheduleWithRunLoop( /// /// The stream to receive events on. /// Returns true if the stream was started; otherwise, returns false and no events will be received. - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FSEventStreamStart(SafeEventStreamHandle streamRef); @@ -134,14 +134,14 @@ internal static partial void FSEventStreamScheduleWithRunLoop( /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events. /// /// The stream to stop receiving events on. - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamStop(SafeEventStreamHandle streamRef); /// /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events. /// /// The stream to stop receiving events on. - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamStop(IntPtr streamRef); /// @@ -149,7 +149,7 @@ internal static partial void FSEventStreamScheduleWithRunLoop( /// /// The FSEventStream to invalidate /// This can only be called after FSEventStreamScheduleWithRunLoop has be called - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamInvalidate(IntPtr streamRef); /// @@ -158,7 +158,7 @@ internal static partial void FSEventStreamScheduleWithRunLoop( /// The stream to remove from the RunLoop /// The RunLoop to remove the stream from. /// The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info. - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamUnscheduleFromRunLoop( SafeEventStreamHandle streamRef, CFRunLoopRef runLoop, @@ -168,7 +168,7 @@ internal static partial void FSEventStreamUnscheduleFromRunLoop( /// Releases a reference count on the specified EventStream and, if necessary, cleans the stream up. /// /// The stream on which to decrement the reference count. - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamRelease(IntPtr streamRef); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs b/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs index ac8812931d056a..d27539e32a957e 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs @@ -30,21 +30,21 @@ internal static partial class RunLoop [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void CFRunLoopRun(); #else - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopRun(); #endif /// /// Runs the current thread's CFRunLoop object in a particular mode. /// - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial int CFRunLoopRunInMode(CFStringRef mode, double seconds, int returnAfterSourceHandled); /// /// Notifies a RunLoop to stop and return control to the execution context that called CFRunLoopRun /// /// The RunLoop to notify to stop - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopStop(CFRunLoopRef rl); /// @@ -52,7 +52,7 @@ internal static partial class RunLoop /// Follows the "Get Rule" where you do not own the object unless you CFRetain it; in which case, you must also CFRelease it as well. /// /// Returns a pointer to a CFRunLoop on success; otherwise, returns IntPtr.Zero - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial CFRunLoopRef CFRunLoopGetCurrent(); /// @@ -61,7 +61,7 @@ internal static partial class RunLoop /// The run loop to modify. /// The run loop source to add. The source is retained by the run loop. /// The run loop mode to which to add source. - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); /// @@ -70,14 +70,14 @@ internal static partial class RunLoop /// The run loop to modify. /// The run loop source to remove. /// The run loop mode of rl from which to remove source. - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); /// /// Invalidates a CFRunLoopSource object, stopping it from ever firing again. /// /// The run loop source to invalidate. - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source); /// @@ -88,7 +88,7 @@ internal static partial class RunLoop /// waiting for a source or timer to become ready to fire; /// false if rl either is not running or is currently processing /// a source, timer, or observer. - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CFRunLoopIsWaiting(CFRunLoopRef rl); } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.SystemConfiguration.cs b/src/libraries/Common/src/Interop/OSX/Interop.SystemConfiguration.cs index 594666dc401718..693d58bcacae46 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.SystemConfiguration.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.SystemConfiguration.cs @@ -34,7 +34,7 @@ internal struct SCDynamicStoreContext /// Pass null if no callouts are desired. /// The context associated with the callout. /// A reference to the new dynamic store session. - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] private static unsafe partial SafeCreateHandle SCDynamicStoreCreate( IntPtr allocator, CFStringRef name, @@ -67,7 +67,7 @@ internal static unsafe SafeCreateHandle SCDynamicStoreCreate( /// The service ID or a regular expression pattern. /// The specific global entity, such as IPv4 or DNS. /// A string containing the formatted key. - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] private static partial SafeCreateHandle SCDynamicStoreKeyCreateNetworkServiceEntity( IntPtr allocator, CFStringRef domain, @@ -99,7 +99,7 @@ internal static SafeCreateHandle SCDynamicStoreKeyCreateNetworkServiceEntity( /// The order in which the sources that are ready to be processed are handled, /// on platforms that support it and for source versions that support it. /// The new run loop source object. - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] private static partial SafeCreateHandle SCDynamicStoreCreateRunLoopSource( IntPtr allocator, SCDynamicStoreRef store, @@ -126,7 +126,7 @@ internal static SafeCreateHandle SCDynamicStoreCreateRunLoopSource(SCDynamicStor /// An array of POSIX regex pattern strings used to match keys to be monitored, /// or IntPtr.Zero if no key patterns are to be monitored. /// Non-zero if the set of notification keys and patterns was successfully updated; zero otherwise. - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SCDynamicStoreSetNotificationKeys(SCDynamicStoreRef store, CFArrayRef keys, CFArrayRef patterns); } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libc.cs b/src/libraries/Common/src/Interop/OSX/Interop.libc.cs index 5e9f0e9e41380e..9b65332570b072 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libc.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libc.cs @@ -23,7 +23,7 @@ internal struct AttrList public const uint ATTR_CMN_CRTIME = 0x00000200; } - [GeneratedDllImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static unsafe partial int setattrlist(string path, AttrList* attrList, void* attrBuf, nint attrBufSize, CULong options); internal const uint FSOPT_NOFOLLOW = 0x00000001; diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs b/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs index 6dbd15a4d290a4..7274cb569051d7 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs @@ -16,11 +16,11 @@ private struct NSOperatingSystemVersion public nint patchVersion; } - [GeneratedDllImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)] private static partial IntPtr objc_getClass(string className); - [GeneratedDllImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)] private static partial IntPtr sel_getUid(string selector); - [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] + [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] private static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector); internal static Version GetOperatingSystemVersion() @@ -58,10 +58,10 @@ internal static Version GetOperatingSystemVersion() return new Version(major, minor, patch); } - [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] + [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] private static partial NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSend(IntPtr basePtr, IntPtr selector); - [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")] + [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")] private static partial void NSOperatingSystemVersion_objc_msgSend_stret(out NSOperatingSystemVersion osVersion, IntPtr basePtr, IntPtr selector); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libproc.GetProcessInfoById.cs b/src/libraries/Common/src/Interop/OSX/Interop.libproc.GetProcessInfoById.cs index ccac9c97439596..f337eb45c9a93a 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libproc.GetProcessInfoById.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libproc.GetProcessInfoById.cs @@ -89,7 +89,7 @@ internal struct proc_taskallinfo /// the data is valid. If the sizes do not match then the data is invalid, most likely due /// to not having enough permissions to query for the data of that specific process /// - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_pidinfo( int pid, int flavor, diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libproc.cs b/src/libraries/Common/src/Interop/OSX/Interop.libproc.cs index 929eb9acca871e..dbb7fcc7e6368a 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libproc.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libproc.cs @@ -110,7 +110,7 @@ internal struct proc_fdinfo /// A pointer to the memory block where the PID array will start /// The length of the block of memory allocated for the PID array /// Returns the number of elements (PIDs) in the buffer - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_listallpids( int* pBuffer, int buffersize); @@ -176,7 +176,7 @@ internal static unsafe int[] proc_listallpids() /// the data is valid. If the sizes do not match then the data is invalid, most likely due /// to not having enough permissions to query for the data of that specific process /// - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_pidinfo( int pid, int flavor, @@ -197,7 +197,7 @@ private static unsafe partial int proc_pidinfo( /// the data is valid. If the sizes do not match then the data is invalid, most likely due /// to not having enough permissions to query for the data of that specific process /// - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_pidinfo( int pid, int flavor, @@ -218,7 +218,7 @@ private static unsafe partial int proc_pidinfo( /// the data is valid. If the sizes do not match then the data is invalid, most likely due /// to not having enough permissions to query for the data of that specific process /// - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_pidinfo( int pid, int flavor, @@ -317,7 +317,7 @@ private static unsafe partial int proc_pidinfo( /// A pointer to an allocated block of memory that will be filled with the process path /// The size of the buffer, should be PROC_PIDPATHINFO_MAXSIZE /// Returns the length of the path returned on success - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_pidpath( int pid, byte* buffer, @@ -356,7 +356,7 @@ internal static unsafe string proc_pidpath(int pid) /// Specifies the type of struct that is passed in to buffer. Should be RUSAGE_INFO_V3 to specify a rusage_info_v3 struct. /// A buffer to be filled with rusage_info data /// Returns 0 on success; on fail, -1 and errno is set with the error code - [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)] + [LibraryImport(Interop.Libraries.libproc, SetLastError = true)] private static unsafe partial int proc_pid_rusage( int pid, int flavor, diff --git a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs index c0e78cb5d152cc..68cf5d686c89bc 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")] internal static partial IntPtr CreateAutoreleasePool(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")] internal static partial void DrainAutoreleasePool(IntPtr ptr); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.cs b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.cs index 580111cbabb932..89681a69c5ed89 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath", StringMarshalling = StringMarshalling.Utf8)] internal static partial string? SearchPath(NSSearchPathDirectory folderId); internal enum NSSearchPathDirectory diff --git a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.iOS.cs b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.iOS.cs index f4afa274687241..9a7cb5b18d8e89 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.iOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.iOS.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath_TempDirectory", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath_TempDirectory", StringMarshalling = StringMarshalling.Utf8)] internal static partial string SearchPathTempDirectory(); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.iOSSupportVersion.cs b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.iOSSupportVersion.cs index d429c27ae871ee..6624fb1926cce2 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.iOSSupportVersion.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.iOSSupportVersion.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_iOSSupportVersion", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_iOSSupportVersion", StringMarshalling = StringMarshalling.Utf8)] internal static partial string iOSSupportVersion(); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs index 5834de129d765d..5798d5ed64b587 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs @@ -9,34 +9,34 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")] internal static partial void DigestFree(IntPtr handle); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")] internal static partial SafeDigestCtxHandle DigestCreate(PAL_HashAlgorithm algorithm, out int cbDigest); internal static int DigestUpdate(SafeDigestCtxHandle ctx, ReadOnlySpan data) => DigestUpdate(ctx, ref MemoryMarshal.GetReference(data), data.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestUpdate")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestUpdate")] private static partial int DigestUpdate(SafeDigestCtxHandle ctx, ref byte pbData, int cbData); internal static int DigestFinal(SafeDigestCtxHandle ctx, Span output) => DigestFinal(ctx, ref MemoryMarshal.GetReference(output), output.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFinal")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFinal")] private static partial int DigestFinal(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput); internal static int DigestCurrent(SafeDigestCtxHandle ctx, Span output) => DigestCurrent(ctx, ref MemoryMarshal.GetReference(output), output.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")] private static partial int DigestCurrent(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")] internal static unsafe partial int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, int* cbDigest); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")] internal static partial int DigestReset(SafeDigestCtxHandle ctx); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ecc.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ecc.cs index d1a27c769eb321..3676fd016a5865 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ecc.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ecc.cs @@ -11,14 +11,14 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_EccGenerateKey( int keySizeInBits, out SafeSecKeyRefHandle pPublicKey, out SafeSecKeyRefHandle pPrivateKey, out SafeCFErrorHandle pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_EccGetKeySizeInBits")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_EccGetKeySizeInBits")] internal static partial long EccGetKeySizeInBits(SafeSecKeyRefHandle publicKey); internal static void EccGenerateKey( diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs index 993d6d42ae7517..1f7a33bef57d96 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")] internal static partial void HmacFree(IntPtr handle); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")] internal static partial SafeHmacHandle HmacCreate(PAL_HashAlgorithm algorithm, ref int cbDigest); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacInit")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacInit")] private static unsafe partial int HmacInit(SafeHmacHandle ctx, byte* pbKey, int cbKey); internal static unsafe int HmacInit(SafeHmacHandle ctx, ReadOnlySpan key) @@ -29,22 +29,22 @@ internal static unsafe int HmacInit(SafeHmacHandle ctx, ReadOnlySpan key) internal static int HmacUpdate(SafeHmacHandle ctx, ReadOnlySpan data) => HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), data.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacUpdate")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacUpdate")] private static partial int HmacUpdate(SafeHmacHandle ctx, ref byte pbData, int cbData); internal static int HmacFinal(SafeHmacHandle ctx, ReadOnlySpan output) => HmacFinal(ctx, ref MemoryMarshal.GetReference(output), output.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFinal")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFinal")] private static partial int HmacFinal(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput); internal static int HmacCurrent(SafeHmacHandle ctx, ReadOnlySpan output) => HmacCurrent(ctx, ref MemoryMarshal.GetReference(output), output.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")] private static partial int HmacCurrent(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")] internal static unsafe partial int HmacOneShot( PAL_HashAlgorithm algorithm, byte* pKey, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs index 703f72b7fafc2a..0623b5e3d86836 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_EcdhKeyAgree( SafeSecKeyRefHandle privateKey, SafeSecKeyRefHandle publicKey, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.iOS.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.iOS.cs index 3122d1a1fe8251..2c6a372f2eac9a 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.iOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.iOS.cs @@ -15,19 +15,19 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainEnumerateCerts( out SafeCFArrayHandle matches); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainEnumerateIdentities( out SafeCFArrayHandle matches); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509StoreAddCertificate( SafeHandle certOrIdentity); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509StoreRemoveCertificate( SafeHandle certOrIdentity, [MarshalAs(UnmanagedType.Bool)] bool isReadOnlyMode); diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs index bdacabd7f197d8..14cfbb9ce3c023 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs @@ -15,64 +15,64 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainItemCopyKeychain( IntPtr item, out SafeKeychainHandle keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeychainCreate", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeychainCreate", StringMarshalling = StringMarshalling.Utf8)] private static unsafe partial int AppleCryptoNative_SecKeychainCreateTemporary( string path, int utf8PassphraseLength, byte* utf8Passphrase, out SafeTemporaryKeychainHandle keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)] private static partial int AppleCryptoNative_SecKeychainCreate( string path, int utf8PassphraseLength, byte[] utf8Passphrase, out SafeKeychainHandle keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainDelete(IntPtr keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainCopyDefault(out SafeKeychainHandle keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)] private static partial int AppleCryptoNative_SecKeychainOpen( string keychainPath, out SafeKeychainHandle keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainUnlock( SafeKeychainHandle keychain, int utf8PassphraseLength, byte[] utf8Passphrase); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SetKeychainNeverLock(SafeKeychainHandle keychain); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainEnumerateCerts( SafeKeychainHandle keychain, out SafeCFArrayHandle matches, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainEnumerateIdentities( SafeKeychainHandle keychain, out SafeCFArrayHandle matches, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509StoreAddCertificate( SafeKeychainItemHandle cert, SafeKeychainHandle keychain, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509StoreRemoveCertificate( SafeKeychainItemHandle cert, SafeKeychainHandle keychain, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs index dac63e66f987e5..fc7884552b25c5 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs @@ -48,7 +48,7 @@ internal static unsafe void Pbkdf2( } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_Pbkdf2( PAL_HashAlgorithm prfAlgorithm, byte* password, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.RSA.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.RSA.cs index e3c68bed82480d..3e27e010e8c1ec 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.RSA.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.RSA.cs @@ -12,14 +12,14 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_RsaGenerateKey( int keySizeInBits, out SafeSecKeyRefHandle pPublicKey, out SafeSecKeyRefHandle pPrivateKey, out SafeCFErrorHandle pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_RsaSignaturePrimitive( SafeSecKeyRefHandle privateKey, ref byte pbData, @@ -27,7 +27,7 @@ private static partial int AppleCryptoNative_RsaSignaturePrimitive( out SafeCFDataHandle pDataOut, out SafeCFErrorHandle pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_RsaVerificationPrimitive( SafeSecKeyRefHandle publicKey, ref byte pbData, @@ -35,7 +35,7 @@ private static partial int AppleCryptoNative_RsaVerificationPrimitive( out SafeCFDataHandle pDataOut, out SafeCFErrorHandle pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_RsaEncryptionPrimitive( SafeSecKeyRefHandle publicKey, ref byte pbData, @@ -52,7 +52,7 @@ private static int RsaEncryptOaep( out SafeCFErrorHandle pErrorOut) => RsaEncryptOaep(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, mgfAlgorithm, out pEncryptedOut, out pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptOaep")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptOaep")] private static partial int RsaEncryptOaep( SafeSecKeyRefHandle publicKey, ref byte pbData, @@ -69,7 +69,7 @@ private static int RsaEncryptPkcs( out SafeCFErrorHandle pErrorOut) => RsaEncryptPkcs(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, out pEncryptedOut, out pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptPkcs")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptPkcs")] private static partial int RsaEncryptPkcs( SafeSecKeyRefHandle publicKey, ref byte pbData, @@ -86,7 +86,7 @@ private static int RsaDecryptOaep( out SafeCFErrorHandle pErrorOut) => RsaDecryptOaep(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, mgfAlgorithm, out pEncryptedOut, out pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptOaep")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptOaep")] private static partial int RsaDecryptOaep( SafeSecKeyRefHandle publicKey, ref byte pbData, @@ -103,7 +103,7 @@ private static int RsaDecryptPkcs( out SafeCFErrorHandle pErrorOut) => RsaDecryptPkcs(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, out pEncryptedOut, out pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptPkcs")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptPkcs")] private static partial int RsaDecryptPkcs( SafeSecKeyRefHandle publicKey, ref byte pbData, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs index 2832aa3d9c0f13..93f1e8d72cef99 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs @@ -27,7 +27,7 @@ internal static unsafe void GetRandomBytes(byte* pbBuffer, int count) } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_GetRandomBytes(byte* buf, int num, int* errorCode); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs index f353c503f8d349..848745770507c1 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial SafeCFStringHandle AppleCryptoNative_SecCopyErrorMessageString(int osStatus); internal static string? GetSecErrorString(int osStatus) diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.cs index a37ecbf9634b2d..ad5a34517b1a52 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.cs @@ -23,7 +23,7 @@ internal enum PAL_KeyAlgorithm : uint RSA = 2, } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial ulong AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SafeSecKeyRefHandle publicKey); private delegate int SecKeyTransform(ReadOnlySpan source, out SafeCFDataHandle outputHandle, out SafeCFErrorHandle errorHandle); @@ -154,7 +154,7 @@ internal static bool TrySecKeyCopyExternalRepresentation( } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_SecKeyCreateWithData( byte* pKey, int cbKey, @@ -163,13 +163,13 @@ private static unsafe partial int AppleCryptoNative_SecKeyCreateWithData( out SafeSecKeyRefHandle pDataKey, out SafeCFErrorHandle pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_SecKeyCopyExternalRepresentation( SafeSecKeyRefHandle key, out SafeCFDataHandle pDataOut, out SafeCFErrorHandle pErrorOut); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeyCopyPublicKey")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeyCopyPublicKey")] internal static unsafe partial SafeSecKeyRefHandle CopyPublicKey(SafeSecKeyRefHandle privateKey); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.macOS.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.macOS.cs index 789415a0d5680c..b6c1abaf362abd 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.macOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.macOS.cs @@ -26,7 +26,7 @@ ref MemoryMarshal.GetReference(pbKeyBlob), out ppKeyOut, out pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeyImportEphemeral( ref byte pbKeyBlob, int cbKeyBlob, @@ -61,7 +61,7 @@ internal static SafeSecKeyRefHandle ImportEphemeralKey(ReadOnlySpan keyBlo throw new CryptographicException(); } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeyExport( SafeSecKeyRefHandle? key, int exportPrivate, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SignVerify.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SignVerify.cs index a612ce0f16c04a..62df5c049a1067 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SignVerify.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SignVerify.cs @@ -47,7 +47,7 @@ private static unsafe int AppleCryptoNative_SecKeyVerifySignature( } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_SecKeyVerifySignature( SafeSecKeyRefHandle publicKey, byte* pbDataHash, @@ -79,7 +79,7 @@ private static unsafe int AppleCryptoNative_SecKeyCreateSignature( } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_SecKeyCreateSignature( SafeSecKeyRefHandle privateKey, byte* pbDataHash, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs index c1cdd4b33dbe71..043308097e5cce 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs @@ -58,110 +58,110 @@ internal enum PAL_TlsIo Renegotiate, } - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslCreateContext")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslCreateContext")] internal static partial System.Net.SafeSslHandle SslCreateContext(int isServer); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetConnection")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetConnection")] internal static partial int SslSetConnection( SafeSslHandle sslHandle, IntPtr sslConnection); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetMinProtocolVersion( SafeSslHandle sslHandle, SslProtocols minProtocolId); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetMaxProtocolVersion( SafeSslHandle sslHandle, SslProtocols maxProtocolId); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslCopyCertChain( SafeSslHandle sslHandle, out SafeX509ChainHandle pTrustOut, out int pOSStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslCopyCADistinguishedNames( SafeSslHandle sslHandle, out SafeCFArrayHandle pArrayOut, out int pOSStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetBreakOnServerAuth( SafeSslHandle sslHandle, int setBreak, out int pOSStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetBreakOnClientAuth( SafeSslHandle sslHandle, int setBreak, out int pOSStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetBreakOnCertRequested( SafeSslHandle sslHandle, int setBreak, out int pOSStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetCertificate( SafeSslHandle sslHandle, SafeCreateHandle cfCertRefs); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)] private static partial int AppleCryptoNative_SslSetTargetName( SafeSslHandle sslHandle, string targetName, int cbTargetName, out int osStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SSLSetALPNProtocols")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SSLSetALPNProtocols")] internal static partial int SSLSetALPNProtocols(SafeSslHandle ctx, SafeCreateHandle cfProtocolsRefs, out int osStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetAlpnSelected")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetAlpnSelected")] internal static partial int SslGetAlpnSelected(SafeSslHandle ssl, out SafeCFDataHandle protocol); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslHandshake")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslHandshake")] internal static partial PAL_TlsHandshakeState SslHandshake(SafeSslHandle sslHandle); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslSetAcceptClientCert(SafeSslHandle sslHandle); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetIoCallbacks")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetIoCallbacks")] internal static unsafe partial int SslSetIoCallbacks( SafeSslHandle sslHandle, delegate* unmanaged readCallback, delegate* unmanaged writeCallback); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslWrite")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslWrite")] internal static unsafe partial PAL_TlsIo SslWrite(SafeSslHandle sslHandle, byte* writeFrom, int count, out int bytesWritten); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslRead")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslRead")] internal static unsafe partial PAL_TlsIo SslRead(SafeSslHandle sslHandle, byte* writeFrom, int count, out int bytesWritten); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)] + [LibraryImport(Interop.Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SslIsHostnameMatch( SafeSslHandle handle, SafeCreateHandle cfHostname, SafeCFDateHandle cfValidTime, out int pOSStatus); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslShutdown")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslShutdown")] internal static partial int SslShutdown(SafeSslHandle sslHandle); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetCipherSuite")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetCipherSuite")] internal static partial int SslGetCipherSuite(SafeSslHandle sslHandle, out TlsCipherSuite cipherSuite); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetProtocolVersion")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetProtocolVersion")] internal static partial int SslGetProtocolVersion(SafeSslHandle sslHandle, out SslProtocols protocol); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetEnabledCipherSuites")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetEnabledCipherSuites")] internal static unsafe partial int SslSetEnabledCipherSuites(SafeSslHandle sslHandle, uint* cipherSuites, int numCipherSuites); - [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetCertificateAuthorities")] + [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetCertificateAuthorities")] internal static partial int SslSetCertificateAuthorities(SafeSslHandle sslHandle, SafeCreateHandle certificateOrArray, int replaceExisting); internal static unsafe void SslSetCertificateAuthorities(SafeSslHandle sslHandle, Span certificates, bool replaceExisting) diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs index 9e6d56e2e7487a..3ba39364f3d065 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs @@ -42,10 +42,10 @@ internal enum PAL_SymmetricOptions None = 0, } - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")] internal static partial void CryptorFree(IntPtr handle); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")] internal static unsafe partial int CryptorCreate( PAL_SymmetricOperation operation, PAL_SymmetricAlgorithm algorithm, @@ -58,7 +58,7 @@ internal static unsafe partial int CryptorCreate( out SafeAppleCryptorHandle cryptor, out int ccStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorUpdate")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorUpdate")] internal static unsafe partial int CryptorUpdate( SafeAppleCryptorHandle cryptor, byte* pbData, @@ -68,7 +68,7 @@ internal static unsafe partial int CryptorUpdate( out int cbWritten, out int ccStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFinal")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFinal")] internal static unsafe partial int CryptorFinal( SafeAppleCryptorHandle cryptor, byte* pbOutput, @@ -76,7 +76,7 @@ internal static unsafe partial int CryptorFinal( out int cbWritten, out int ccStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorReset")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorReset")] internal static unsafe partial int CryptorReset(SafeAppleCryptorHandle cryptor, byte* pbIv, out int ccStatus); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Trust.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Trust.cs index 9a59dd089529bf..4a66436f0d0e08 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Trust.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Trust.cs @@ -11,22 +11,22 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_StoreEnumerateUserRoot( out SafeCFArrayHandle pCertsOut, out int pOSStatusOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_StoreEnumerateMachineRoot( out SafeCFArrayHandle pCertsOut, out int pOSStatusOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_StoreEnumerateUserDisallowed( out SafeCFArrayHandle pCertsOut, out int pOSStatusOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_StoreEnumerateMachineDisallowed( out SafeCFArrayHandle pCertsOut, out int pOSStatusOut); diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.cs index efb189b27662dc..f741d33a730ca9 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.cs @@ -14,37 +14,37 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509GetRawData( SafeSecCertificateHandle cert, out SafeCFDataHandle cfDataOut, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509GetSubjectSummary( SafeSecCertificateHandle cert, out SafeCFStringHandle cfSubjectSummaryOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509GetPublicKey(SafeSecCertificateHandle cert, out SafeSecKeyRefHandle publicKey, out int pOSStatus); internal static X509ContentType X509GetContentType(ReadOnlySpan data) => X509GetContentType(ref MemoryMarshal.GetReference(data), data.Length); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509GetContentType")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509GetContentType")] private static partial X509ContentType X509GetContentType(ref byte pbData, int cbData); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509CopyCertFromIdentity( SafeSecIdentityHandle identity, out SafeSecCertificateHandle cert); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509CopyPrivateKeyFromIdentity( SafeSecIdentityHandle identity, out SafeSecKeyRefHandle key); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509DemuxAndRetainHandle( IntPtr handle, out SafeSecCertificateHandle certHandle, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.iOS.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.iOS.cs index c79a9deb1af453..63fbcac110b36d 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.iOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.iOS.cs @@ -33,7 +33,7 @@ ref MemoryMarshal.GetReference(keyBlob), out pPrivateKeyOut); } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ImportCertificate( ref byte pbKeyBlob, int cbKeyBlob, @@ -42,7 +42,7 @@ private static partial int AppleCryptoNative_X509ImportCertificate( out SafeSecCertificateHandle pCertOut, out SafeSecIdentityHandle pPrivateKeyOut); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ImportCollection( ref byte pbKeyBlob, int cbKeyBlob, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.macOS.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.macOS.cs index 785f9e6ad54aeb..8245a870d782fb 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.macOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.macOS.cs @@ -39,7 +39,7 @@ ref MemoryMarshal.GetReference(keyBlob), out pOSStatus); } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ImportCertificate( ref byte pbKeyBlob, int cbKeyBlob, @@ -51,7 +51,7 @@ private static partial int AppleCryptoNative_X509ImportCertificate( out SafeSecIdentityHandle pPrivateKeyOut, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ImportCollection( ref byte pbKeyBlob, int cbKeyBlob, @@ -62,7 +62,7 @@ private static partial int AppleCryptoNative_X509ImportCollection( out SafeCFArrayHandle pCollectionOut, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ExportData( SafeCreateHandle data, X509ContentType type, @@ -70,7 +70,7 @@ private static partial int AppleCryptoNative_X509ExportData( out SafeCFDataHandle pExportOut, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509CopyWithPrivateKey( SafeSecCertificateHandle certHandle, SafeSecKeyRefHandle privateKeyHandle, @@ -78,7 +78,7 @@ private static partial int AppleCryptoNative_X509CopyWithPrivateKey( out SafeSecIdentityHandle pIdentityHandleOut, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509MoveToKeychain( SafeSecCertificateHandle certHandle, SafeKeychainHandle targetKeychain, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs index c6779b4151e348..713d724206f7ae 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs @@ -11,42 +11,42 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateDefaultPolicy")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateDefaultPolicy")] internal static partial SafeCreateHandle X509ChainCreateDefaultPolicy(); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateRevocationPolicy")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateRevocationPolicy")] internal static partial SafeCreateHandle X509ChainCreateRevocationPolicy(); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] internal static partial int AppleCryptoNative_X509ChainCreate( SafeCreateHandle certs, SafeCreateHandle policies, out SafeX509ChainHandle pTrustOut, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] internal static partial int AppleCryptoNative_X509ChainEvaluate( SafeX509ChainHandle chain, SafeCFDateHandle cfEvaluationTime, [MarshalAs(UnmanagedType.Bool)] bool allowNetwork, out int pOSStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetChainSize")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetChainSize")] internal static partial long X509ChainGetChainSize(SafeX509ChainHandle chain); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetCertificateAtIndex")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetCertificateAtIndex")] internal static partial IntPtr X509ChainGetCertificateAtIndex(SafeX509ChainHandle chain, long index); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetTrustResults")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetTrustResults")] internal static partial SafeCreateHandle X509ChainGetTrustResults(SafeX509ChainHandle chain); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")] internal static partial int X509ChainGetStatusAtIndex(SafeCreateHandle trustResults, long index, out int pdwStatus); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")] internal static partial int GetOSStatusForChainStatus(X509ChainStatusFlags flag); - [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")] + [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")] internal static partial int X509ChainSetTrustAnchorCertificates(SafeX509ChainHandle chain, SafeCreateHandle anchorCertificates); } } diff --git a/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs b/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs index 2a71db0aa82c9c..82f763dfe63717 100644 --- a/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs +++ b/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs @@ -15,7 +15,7 @@ internal static partial class @procfs /// /// true if the process status was read; otherwise, false. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)] private static unsafe partial bool TryReadProcessStatusInfo(int pid, ProcessStatusInfo* processStatus); internal struct ProcessStatusInfo diff --git a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs index 88af774f71912b..75971cc54c7667 100644 --- a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs +++ b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs @@ -183,24 +183,24 @@ internal static unsafe string StrError(int platformErrno) } #if SERIAL_PORTS - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")] internal static partial Error ConvertErrorPlatformToPal(int platformErrno); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")] internal static partial int ConvertErrorPalToPlatform(Error error); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")] private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); #else - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")] [SuppressGCTransition] internal static partial Error ConvertErrorPlatformToPal(int platformErrno); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")] [SuppressGCTransition] internal static partial int ConvertErrorPalToPlatform(Error error); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); #endif } diff --git a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs index e7aa1b1e4db112..8f79130cf7a99b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs +++ b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs @@ -10,13 +10,13 @@ internal static partial class Interop { internal static partial class Serial { - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial SafeSerialDeviceHandle SerialPortOpen(string name); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)] internal static partial int SerialPortClose(IntPtr handle); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")] internal static partial Error Shutdown(IntPtr socket, SocketShutdown how); /// @@ -29,7 +29,7 @@ internal static partial class Serial /// Returns the number of bytes read on success; otherwise, -1 is returned /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)] internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); /// @@ -41,7 +41,7 @@ internal static partial class Serial /// /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)] internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); /// @@ -52,7 +52,7 @@ internal static partial class Serial /// The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds /// The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout. /// An error or Error.SUCCESS. - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")] private static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); /// diff --git a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs index ce98ffa9c856d6..73f9c5196b5940 100644 --- a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs +++ b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs @@ -29,34 +29,34 @@ internal enum Queue SendQueue = 2, } - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)] internal static partial int TermiosReset(SafeSerialDeviceHandle handle, int speed, int data, StopBits stop, Parity parity, Handshake flow); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)] internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)] internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal, int set); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")] internal static partial Signals TermiosGetAllSignals(SafeSerialDeviceHandle handle); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)] internal static partial int TermiosSetSpeed(SafeSerialDeviceHandle handle, int speed); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)] internal static partial int TermiosGetSpeed(SafeSerialDeviceHandle handle); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)] internal static partial int TermiosGetAvailableBytes(SafeSerialDeviceHandle handle, [MarshalAs(UnmanagedType.Bool)]bool fromReadBuffer); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)] internal static partial int TermiosDiscard(SafeSerialDeviceHandle handle, Queue input); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)] internal static partial int TermiosDrain(SafeSerialDeviceHandle handle); - [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)] + [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)] internal static partial int TermiosSendBreak(SafeSerialDeviceHandle handle, int duration); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Abort.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Abort.cs index c8abb85f00b226..568899d612dfb8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Abort.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Abort.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal unsafe partial class Sys { [DoesNotReturn] - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Abort")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Abort")] internal static partial void Abort(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Accept.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Accept.cs index 2385cf98bdbf2a..69d3752b75c623 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Accept.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Accept.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Accept")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Accept")] internal static unsafe partial Error Accept(SafeHandle socket, byte* socketAddress, int* socketAddressLen, IntPtr* acceptedFd); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Access.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Access.cs index 82c32b02cf50d5..5f466b0e9d9fce 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Access.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Access.cs @@ -15,7 +15,7 @@ internal enum AccessMode : int R_OK = 4, /* Check for read */ } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Access", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Access", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int Access(string path, AccessMode mode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Bind.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Bind.cs index 41dac6ff61cde2..f279f45cc4bde9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Bind.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Bind.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Bind")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Bind")] internal static unsafe partial Error Bind(SafeHandle socket, ProtocolType socketProtocolType, byte* socketAddress, int socketAddressLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs index 2184935f742af1..784f8c6fc955e3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int ChDir(string path); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChMod.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChMod.cs index 423aa455022071..940058d28c11ce 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChMod.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChMod.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChMod", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChMod", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int ChMod(string path, int mode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Close.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Close.cs index dcf65c410fc338..4c438dba177799 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Close.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Close.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)] internal static partial int Close(IntPtr fd); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ConfigureTerminalForChildProcess.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ConfigureTerminalForChildProcess.cs index 92a7bf269f3152..8a1f40857bd4da 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ConfigureTerminalForChildProcess.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ConfigureTerminalForChildProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConfigureTerminalForChildProcess")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConfigureTerminalForChildProcess")] internal static partial void ConfigureTerminalForChildProcess([MarshalAs(UnmanagedType.Bool)] bool childUsesTerminal); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Connect.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Connect.cs index 5149052c4ecd54..11d4e8d0da0ff1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Connect.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Connect.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Connect")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Connect")] internal static unsafe partial Error Connect(SafeHandle socket, byte* socketAddress, int socketAddressLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs index 3bdbcf8c4ff80d..154eac7f62b899 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)] internal static partial int CopyFile(SafeFileHandle source, SafeFileHandle destination, long sourceLength); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs index 55c79888f18b02..446f22d020be7a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")] internal static partial Error Disconnect(IntPtr socket); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Dup.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Dup.cs index d61ab47050fee4..2638c2513dd073 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Dup.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Dup.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Dup", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Dup", SetLastError = true)] internal static partial SafeFileHandle Dup(SafeFileHandle oldfd); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.DynamicLoad.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.DynamicLoad.cs index 33f36acfc89178..1bcc468f01f6b3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.DynamicLoad.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.DynamicLoad.cs @@ -8,16 +8,16 @@ internal static partial class Interop { internal unsafe partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr LoadLibrary(string filename); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")] internal static partial IntPtr GetProcAddress(IntPtr handle, byte* symbol); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr GetProcAddress(IntPtr handle, string symbol); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")] internal static partial void FreeLibrary(IntPtr handle); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs index b4896fc0a744f5..52b3653950fed1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs @@ -42,17 +42,17 @@ public unsafe struct NetworkInterfaceInfo private fixed byte __padding[3]; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")] public static unsafe partial int EnumerateInterfaceAddresses( void* context, delegate* unmanaged ipv4Found, delegate* unmanaged ipv6Found, delegate* unmanaged linkLayerFound); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")] public static unsafe partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged onGatewayFound); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")] public static unsafe partial int GetNetworkInterfaces(int* count, NetworkInterfaceInfo** addrs, int* addressCount, IpAddressInfo** aa); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs index b6c4c21a1689a4..197bdd7e220274 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal unsafe partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")] [SuppressGCTransition] internal static partial int GetErrNo(); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")] [SuppressGCTransition] internal static partial void SetErrNo(int errorCode); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Exit.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Exit.cs index 69d57113aeac3d..41b97b47dd1ed5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Exit.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Exit.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal unsafe partial class Sys { [DoesNotReturn] - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Exit")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Exit")] internal static partial void Exit(int exitCode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs index 8c3508ef46c58a..27f802947fcb78 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs @@ -11,7 +11,7 @@ internal static partial class Sys /// /// Returns -1 on error, 0 on success. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)] internal static partial int FAllocate(SafeFileHandle fd, long offset, long length); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FChMod.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FChMod.cs index 57a278cd47a4d7..b2efd516c624e7 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FChMod.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FChMod.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FChMod", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FChMod", SetLastError = true)] internal static partial int FChMod(SafeFileHandle fd, int mode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FLock.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FLock.cs index a2a89fef02681c..0ed3518798ca58 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FLock.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FLock.cs @@ -17,14 +17,14 @@ internal enum LockOperations : int LOCK_UN = 8, /* unlock */ } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)] internal static partial int FLock(SafeFileHandle fd, LockOperations operation); /// /// Exposing this for SafeFileHandle.ReleaseHandle() to call. /// Normal callers should use FLock(SafeFileHandle fd). /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)] internal static partial int FLock(IntPtr fd, LockOperations operation); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs index 531ceb55de73e5..4c902e08285ca5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)] internal static partial int FSync(SafeFileHandle fd); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FTruncate.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FTruncate.cs index b8367261ffdc9f..33e87ced27621b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FTruncate.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FTruncate.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)] internal static partial int FTruncate(SafeFileHandle fd, long length); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs index c44493fa28630c..c8b65c56680abc 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs @@ -13,13 +13,13 @@ internal static partial class Fcntl { internal static readonly bool CanGetSetPipeSz = (FcntlCanGetSetPipeSz() != 0); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetPipeSz", SetLastError=true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetPipeSz", SetLastError=true)] internal static partial int GetPipeSz(SafePipeHandle fd); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)] internal static partial int SetPipeSz(SafePipeHandle fd, int size); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")] [SuppressGCTransition] private static partial int FcntlCanGetSetPipeSz(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.cs index 72290a13be0e8e..d35b40b857bc6e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.cs @@ -10,22 +10,22 @@ internal static partial class Sys { internal static partial class Fcntl { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError = true)] internal static partial int DangerousSetIsNonBlocking(IntPtr fd, int isNonBlocking); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)] internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)] internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)] internal static partial int SetFD(SafeHandle fd, int flags); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)] internal static partial int GetFD(SafeHandle fd); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)] internal static partial int GetFD(IntPtr fd); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ForkAndExecProcess.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ForkAndExecProcess.cs index 9454d42adb71ee..a09d81af5f16ed 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ForkAndExecProcess.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ForkAndExecProcess.cs @@ -40,7 +40,7 @@ internal static unsafe int ForkAndExecProcess( } } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ForkAndExecProcess", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ForkAndExecProcess", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] private static unsafe partial int ForkAndExecProcess( string filename, byte** argv, byte** envp, string? cwd, int redirectStdin, int redirectStdout, int redirectStderr, diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBytesAvailable.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBytesAvailable.cs index 96b5791d13166a..153518fabfe98e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBytesAvailable.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBytesAvailable.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBytesAvailable")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBytesAvailable")] internal static unsafe partial Error GetBytesAvailable(SafeHandle socket, int* available); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAtOutOfBandMark")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAtOutOfBandMark")] internal static unsafe partial Error GetAtOutOfBandMark(SafeHandle socket, int* atMark); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetControlCharacters.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetControlCharacters.cs index be1316a2b17a63..c9d86da6516b23 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetControlCharacters.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetControlCharacters.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlCharacters")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlCharacters")] internal static partial void GetControlCharacters( ControlCharacterNames[] controlCharacterNames, byte[] controlCharacterValues, int controlCharacterLength, out byte posixDisableValue); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs index 6598dbdf55f2c3..da8fca2c75d9a7 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs @@ -15,7 +15,7 @@ internal struct ProcessCpuInformation internal ulong lastRecordedUserTime; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")] internal static partial int GetCpuUtilization(ref ProcessCpuInformation previousCpuInfo); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs index 22fb18f05a9f7b..1831128b242b7c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)] private static unsafe partial byte* GetCwd(byte* buffer, int bufferLength); internal static unsafe string GetCwd() diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDefaultTimeZone.Android.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDefaultTimeZone.Android.cs index 1029cff060c040..2edaca1e8adf4c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDefaultTimeZone.Android.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDefaultTimeZone.Android.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial string? GetDefaultTimeZone(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs index 74946795ca8608..b2357eab38d4bd 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")] private static unsafe partial int GetDomainName(byte* name, int len); internal static unsafe string GetDomainName() diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs index 35263979dc3186..26dabc853ea05c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")] [SuppressGCTransition] internal static unsafe partial void GetDomainSocketSizes(int* pathOffset, int* pathSize, int* addressSize); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs index f11d4efd443e14..228bab397b5c1f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")] internal static partial uint GetEUid(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs index 583288b65b361a..18b3b6df4ed13c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal unsafe partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")] + [LibraryImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")] internal static unsafe partial IntPtr GetEnv(string name); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs index deefc74f3d16b9..3e26d42c73ed74 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal unsafe partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")] internal static unsafe partial IntPtr GetEnviron(); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")] internal static unsafe partial void FreeEnviron(IntPtr environ); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroupList.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroupList.cs index 973a704a7c2ffd..28b474c1c84098 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroupList.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroupList.cs @@ -43,7 +43,7 @@ internal static partial class Sys } while (true); } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroupList", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroupList", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] private static unsafe partial int GetGroupList(string name, uint group, uint* groups, int* ngroups); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs index 72710dcf7e1f8a..4a99113a899023 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)] private static unsafe partial int GetHostName(byte* name, int nameLength); internal static unsafe string GetHostName() diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs index 6ad3e4e3cd669d..6bccdb2f36f5e5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")] [SuppressGCTransition] internal static partial int GetMaximumAddressSize(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs index e962dbddec166c..65e5cdf55947e0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs @@ -15,7 +15,7 @@ internal enum GetNameInfoFlags : int NI_NUMERICHOST = 0x2, } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")] internal static unsafe partial int GetNameInfo( byte* address, uint addressLength, diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs index 50bf35c2d2cd76..023a4c830fcb8a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class Sys { [SuppressGCTransition] - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")] internal static partial int GetOSArchitecture(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs index 23a338a30a7540..bb1aed9cab1bbe 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)] internal static partial int GetPeerID(SafeHandle socket, out uint euid); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerName.cs index a66bcfe3536091..1ed8fd7217cb0f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerName")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerName")] internal static unsafe partial Error GetPeerName(SafeHandle socket, byte* socketAddress, int* socketAddressLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs index b24072f71d6268..e20a12b9cd9b4d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial string GetPeerUserName(SafeHandle socket); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs index 6b26b6064341f1..016c85466c9dad 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")] internal static partial int GetPid(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs index 52fc19fe7723f1..3577765f1bfafe 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs @@ -10,7 +10,7 @@ internal static partial class Sys /// /// Returns the full path to the executable for the current process, resolving symbolic links. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial string? GetProcessPath(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPwUid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPwUid.cs index f30235d87301c3..79b3b4fa396b37 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPwUid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPwUid.cs @@ -20,10 +20,10 @@ internal unsafe struct Passwd internal byte* Shell; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwUidR", SetLastError = false)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwUidR", SetLastError = false)] internal static unsafe partial int GetPwUidR(uint uid, out Passwd pwd, byte* buf, int bufLen); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwNamR", StringMarshalling = StringMarshalling.Utf8, SetLastError = false)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwNamR", StringMarshalling = StringMarshalling.Utf8, SetLastError = false)] internal static unsafe partial int GetPwNamR(string name, out Passwd pwd, byte* buf, int bufLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs index 76c1323761a887..9d80ea4406860e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")] internal static unsafe partial void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")] internal static unsafe partial int GetCryptographicallySecureRandomBytes(byte* buffer, int length); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSetPriority.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSetPriority.cs index 4677fd8f63266d..3c4ab6ff98db63 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSetPriority.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSetPriority.cs @@ -16,10 +16,10 @@ internal enum PriorityWhich : int PRIO_USER = 2, } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPriority", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPriority", SetLastError = true)] private static partial int GetPriority(PriorityWhich which, int who); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPriority", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPriority", SetLastError = true)] internal static partial int SetPriority(PriorityWhich which, int who, int nice); /// diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs index 5b20a8660a6475..1684298e3117ab 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")] internal static partial int GetSid(int pid); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockName.cs index a0a44f2a1792ed..fa347dc12d9242 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockName")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockName")] internal static unsafe partial Error GetSockName(SafeHandle socket, byte* socketAddress, int* socketAddressLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs index 49d4b0d703e37e..fb8ade9a49b68c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] internal static unsafe partial Error GetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] internal static unsafe partial Error GetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")] internal static unsafe partial Error GetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketErrorOption.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketErrorOption.cs index a77fb31b77a3a6..3313c201f571ea 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketErrorOption.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketErrorOption.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketErrorOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketErrorOption")] internal static unsafe partial Error GetSocketErrorOption(SafeHandle socket, Error* socketError); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketType.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketType.cs index 1aab445f842f2d..29c2937f964a5e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketType.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketType.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketType")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketType")] internal static partial Error GetSocketType(SafeSocketHandle socket, out AddressFamily addressFamily, out SocketType socketType, out ProtocolType protocolType, [MarshalAs(UnmanagedType.Bool)] out bool isListening); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs index ca5c01cb61e79f..2fa2d4d496d6de 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")] [SuppressGCTransition] internal static partial long GetSystemTimeAsTicks(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs index 6e0e24a98458d6..00c967896588b8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")] [SuppressGCTransition] internal static partial ulong GetTimestamp(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs index 276f1129112c13..6ee0e2e5364430 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")] private static partial IntPtr GetUnixNamePrivate(); internal static string GetUnixName() diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs index 994e4dcc443346..14e1fff079a5cc 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] public static partial string GetUnixRelease(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixVersion.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixVersion.cs index 35503c185b2268..c58b3beb086f61 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixVersion.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixVersion.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixVersion", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixVersion", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] private static partial int GetUnixVersion(byte[] version, ref int capacity); internal static string GetUnixVersion() diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetWindowWidth.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetWindowWidth.cs index 83410484f60a78..ea3ef66dea4483 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetWindowWidth.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetWindowWidth.cs @@ -17,7 +17,7 @@ internal struct WinSize internal ushort YPixel; }; - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetWindowSize", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetWindowSize", SetLastError = true)] internal static partial int GetWindowSize(out WinSize winSize); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs index 531c5ce82e9694..b8bc38524a59c8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs @@ -32,10 +32,10 @@ internal unsafe struct HostEntry internal int IPAddressCount; // Number of IP addresses in the list } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", StringMarshalling = StringMarshalling.Utf8)] internal static unsafe partial int GetHostEntryForName(string address, AddressFamily family, HostEntry* entry); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")] internal static unsafe partial void FreeHostEntry(HostEntry* entry); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs index d253cb2e6ede78..f165c926076d8d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs @@ -16,11 +16,11 @@ internal struct IPPacketInformation private int _padding; // Pad out to 8-byte alignment } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")] [SuppressGCTransition] internal static partial int GetControlMessageBufferSize(int isIPv4, int isIPv6); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool TryGetIPPacketInformation(MessageHeader* messageHeader, [MarshalAs(UnmanagedType.Bool)] bool isIPv4, IPPacketInformation* packetInfo); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs index e3a50f6bcfa698..81ebf2dafcc0a9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs @@ -7,11 +7,11 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeTerminalAndSignalHandling", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeTerminalAndSignalHandling", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool InitializeTerminalAndSignalHandling(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)] internal static partial void SetKeypadXmit(string terminfoString); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs index 7a6af166ed504d..6dd5bf21e39596 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] public static partial uint InterfaceNameToIndex(string name); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsATty.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsATty.cs index 9ed5b29915ab52..da47ef8eb1b9da 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsATty.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsATty.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_IsATty", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IsATty", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsATty(SafeFileHandle fd); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs index c302dbe3dafa00..76302e8ddf5b0a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs @@ -49,10 +49,10 @@ internal static unsafe bool IsMemberOfGroup(uint gid) while (true); } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")] private static partial uint GetEGid(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)] private static unsafe partial int GetGroups(int ngroups, uint* groups); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Kill.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Kill.cs index 1fb42efc27ec23..d1cec81e8f6005 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Kill.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Kill.cs @@ -15,7 +15,7 @@ internal enum Signals : int SIGSTOP = 19 } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Kill", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Kill", SetLastError = true)] internal static partial int Kill(int pid, Signals signal); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs index 04e18dc0da37ae..941227564a01b9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs @@ -14,18 +14,18 @@ internal enum UserFlags : uint UF_HIDDEN = 0x8000 } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int LChflags(string path, uint flags); internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")] [SuppressGCTransition] private static partial int LChflagsCanSetHiddenFlag(); internal static readonly bool SupportsHiddenFlag = (CanGetHiddenFlag() != 0); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CanGetHiddenFlag")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CanGetHiddenFlag")] [SuppressGCTransition] private static partial int CanGetHiddenFlag(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LSeek.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LSeek.cs index c76231bb193b02..26381e6b8411c8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LSeek.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LSeek.cs @@ -15,7 +15,7 @@ internal enum SeekWhence SEEK_END = 2 } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)] internal static partial long LSeek(SafeFileHandle fd, long offset, SeekWhence whence); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs index ecaae2b40abb9f..76244cf809db84 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs @@ -15,13 +15,13 @@ internal struct LingerOption public int Seconds; // Number of seconds to linger for } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetLingerOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetLingerOption")] internal static unsafe partial Error GetLingerOption(SafeHandle socket, LingerOption* option); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] internal static unsafe partial Error SetLingerOption(SafeHandle socket, LingerOption* option); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] internal static unsafe partial Error SetLingerOption(IntPtr socket, LingerOption* option); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Link.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Link.cs index c09c4e2dfc74d6..35fdb5f78f912d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Link.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Link.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Link", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Link", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int Link(string source, string link); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Listen.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Listen.cs index f630563bd1283a..b5918bb3dbe548 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Listen.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Listen.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Listen")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Listen")] internal static partial Error Listen(SafeHandle socket, int backlog); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs index 0692aa48fff1a1..8a2bd9db075b1d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs @@ -14,7 +14,7 @@ internal enum LockType : short F_UNLCK = 2 // unlock } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)] internal static partial int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs index 474429e1233c43..ea550a531374f3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")] internal static unsafe partial void Log(byte* buffer, int count); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")] internal static unsafe partial void LogError(byte* buffer, int count); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs index 76d6437be86ce8..cab01aba366b8e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs @@ -8,26 +8,26 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")] internal static partial IntPtr LowLevelMonitor_Create(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")] internal static partial void LowLevelMonitor_Destroy(IntPtr monitor); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")] internal static partial void LowLevelMonitor_Acquire(IntPtr monitor); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")] internal static partial void LowLevelMonitor_Release(IntPtr monitor); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")] internal static partial void LowLevelMonitor_Wait(IntPtr monitor); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool LowLevelMonitor_TimedWait(IntPtr monitor, int timeoutMilliseconds); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")] internal static partial void LowLevelMonitor_Signal_Release(IntPtr monitor); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MAdvise.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MAdvise.cs index 5ac7aa1fc4d6a2..0ee855f4018b57 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MAdvise.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MAdvise.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MAdvise", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MAdvise", SetLastError = true)] internal static partial int MAdvise(IntPtr addr, ulong length, MemoryAdvice advice); internal enum MemoryAdvice diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MMap.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MMap.cs index 5789ee734d45e3..8797980a80c1a9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MMap.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MMap.cs @@ -28,7 +28,7 @@ internal enum MemoryMappedFlags } // NOTE: Shim returns null pointer on failure, not non-null MAP_FAILED sentinel. - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)] internal static partial IntPtr MMap( IntPtr addr, ulong len, MemoryMappedProtections prot, MemoryMappedFlags flags, diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MSync.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MSync.cs index 78263cbdd6af60..b147f24111ad01 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MSync.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MSync.cs @@ -16,7 +16,7 @@ internal enum MemoryMappedSyncFlags MS_INVALIDATE = 0x10, } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MSync", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MSync", SetLastError = true)] internal static partial int MSync(IntPtr addr, ulong len, MemoryMappedSyncFlags flags); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MUnmap.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MUnmap.cs index a0ed69251cc006..60bd0bdb36fc21 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MUnmap.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MUnmap.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MUnmap", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MUnmap", SetLastError = true)] internal static partial int MUnmap(IntPtr addr, ulong len); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs index 3d689c57f387ef..323fcff57db492 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")] [SuppressGCTransition] internal static partial TcpState MapTcpState(int nativeState); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs index 9a0a90cd8abc03..23fb2447ef31bf 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs @@ -8,25 +8,25 @@ internal static partial class Interop { internal static unsafe partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")] internal static partial void* AlignedAlloc(nuint alignment, nuint size); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")] internal static partial void AlignedFree(void* ptr); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")] internal static partial void* AlignedRealloc(void* ptr, nuint alignment, nuint new_size); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")] internal static partial void* Calloc(nuint num, nuint size); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")] internal static partial void Free(void* ptr); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")] internal static partial void* Malloc(nuint size); - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")] internal static partial void* Realloc(void* ptr, nuint new_size); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemSet.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemSet.cs index a71c0149d5a5c4..5fb716592e052b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemSet.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemSet.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemSet")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemSet")] internal static extern unsafe void* MemSet(void *s, int c, UIntPtr n); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs index 09a4ae1e3e79ae..a6bb1dc3c0fedb 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)] private static partial int MkDir(ref byte path, int mode); internal static int MkDir(ReadOnlySpan path, int mode) diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs index f697cd93bcdaef..95250e6c27aa0e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)] internal static partial IntPtr MksTemps( byte[] template, int suffixlen); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs index 3a38edcc82ecd2..ad31d402523d6a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs @@ -30,10 +30,10 @@ internal struct MountPointInformation internal ulong TotalSize; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSpaceInfoForMountPoint", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSpaceInfoForMountPoint", SetLastError = true)] internal static partial int GetSpaceInfoForMountPoint([MarshalAs(UnmanagedType.LPStr)]string name, out MountPointInformation mpi); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)] private static unsafe partial int GetFormatInfoForMountPoint( [MarshalAs(UnmanagedType.LPStr)]string name, byte* formatNameBuffer, diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.cs index 1f547971e010f3..6f031a0c45f819 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.cs @@ -11,7 +11,7 @@ internal static partial class Sys [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private unsafe delegate void MountPointFound(byte* name); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAllMountPoints", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAllMountPoints", SetLastError = true)] private static partial int GetAllMountPoints(MountPointFound mpf); internal static string[] GetAllMountPoints() diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MulticastOption.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MulticastOption.cs index f8746833711083..5de715fc3f5510 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MulticastOption.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MulticastOption.cs @@ -31,16 +31,16 @@ internal struct IPv6MulticastOption private int _padding; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4MulticastOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4MulticastOption")] internal static unsafe partial Error GetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4MulticastOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4MulticastOption")] internal static unsafe partial Error SetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6MulticastOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6MulticastOption")] internal static unsafe partial Error GetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6MulticastOption")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6MulticastOption")] internal static unsafe partial Error SetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs index 5f04ee06956e87..d4dd7eed069d0c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs @@ -16,10 +16,10 @@ public enum NetworkChangeKind AvailabilityChanged = 2 } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")] public static unsafe partial Error CreateNetworkChangeListenerSocket(IntPtr* socket); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")] public static unsafe partial Error ReadEvents(SafeHandle socket, delegate* unmanaged onNetworkChange); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Open.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Open.cs index 3daa76c3bfc24c..627296c1ab9ddb 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Open.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Open.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial SafeFileHandle Open(string filename, OpenFlags flags, int mode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs index b48dff07b274be..aa41a2f256e33b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)] internal static unsafe partial int PRead(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs index de0f311e93a9f6..a47036c6947c7b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)] internal static unsafe partial long PReadV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs index d658f4b9be6cf2..742de1b8325a29 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)] internal static unsafe partial int PWrite(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs index baba793575a3af..63c6b271dd001b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)] internal static unsafe partial long PWriteV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PathConf.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PathConf.cs index 6485745c34d835..3b02546fe33065 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PathConf.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PathConf.cs @@ -20,7 +20,7 @@ internal enum PathConfName : int PC_VDISABLE = 9, } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] private static partial int PathConf(string path, PathConfName name); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Pipe.cs index 92587f258f6af9..3574339966880d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Pipe.cs @@ -24,7 +24,7 @@ internal enum PipeFlags /// internal const int WriteEndOfPipe = 1; - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Pipe", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Pipe", SetLastError = true)] internal static unsafe partial int Pipe(int* pipefd, PipeFlags flags = 0); // pipefd is an array of two ints } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs index 550aaff995add6..d250c291bb8f83 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")] [SuppressGCTransition] internal static partial int PlatformSupportsDualModeIPv4PacketInfo(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs index 65d9b711d272e3..08b6915894ad62 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs @@ -17,7 +17,7 @@ internal static partial class Sys /// The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds /// The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout. /// An error or Error.SUCCESS. - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")] internal static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); /// diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs index e2e96df6bfa524..42653ac3d5fa8f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs @@ -29,7 +29,7 @@ internal enum FileAdvice : int /// /// Returns 0 on success; otherwise, the error code is returned /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)] internal static partial int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs index 680bead95d6301..e3025f965df881 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs @@ -7,21 +7,21 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")] [SuppressGCTransition] internal static unsafe partial void SetPosixSignalHandler(delegate* unmanaged handler); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EnablePosixSignalHandling(int signal); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")] internal static partial void DisablePosixSignalHandling(int signal); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")] internal static partial void HandleNonCanceledPosixSignal(int signal); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")] [SuppressGCTransition] internal static partial int GetPlatformSignalNumber(PosixSignal signal); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs index c2ecd36478b588..ef2c39ddbc0656 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs @@ -18,7 +18,7 @@ internal static partial class Sys /// Returns the number of bytes read on success; otherwise, -1 is returned /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] internal static unsafe partial int Read(SafePipeHandle fd, byte* buffer, int count); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs index 7d9988d057eeba..76f21fc80496e0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs @@ -17,7 +17,7 @@ internal static partial class Sys /// Returns the number of bytes read on success; otherwise, -1 is returned /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs index 9bac51a9106de4..9362a84a4c280f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs @@ -53,17 +53,17 @@ internal ReadOnlySpan GetName(Span buffer) } } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial IntPtr OpenDir(string path); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)] [SuppressGCTransition] internal static partial int GetReadDirRBufferSize(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")] internal static unsafe partial int ReadDirR(IntPtr dir, byte* buffer, int bufferSize, DirectoryEntry* outputEntry); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)] internal static partial int CloseDir(IntPtr dir); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs index ce3b0648813717..ae0fc4de4cc0b4 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs @@ -20,7 +20,7 @@ internal static partial class Sys /// /// Returns the number of bytes placed into the buffer on success; bufferSize if the buffer is too small; and -1 on error. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)] private static partial int ReadLink(ref byte path, byte[] buffer, int bufferSize); /// diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs index c751528354b767..844e669682b1a9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs @@ -8,13 +8,13 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)] internal static unsafe partial int ReadStdin(byte* buffer, int bufferSize); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")] internal static partial void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")] internal static partial void UninitializeConsoleAfterRead(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RealPath.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RealPath.cs index fc4c934ead3c0c..963e7072b62282 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RealPath.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RealPath.cs @@ -13,7 +13,7 @@ internal static partial class Sys /// /// The path to the file system object /// Returns the result string on success and null on failure - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RealPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RealPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial string RealPath(string path); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Receive.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Receive.cs index a23bdad54aec74..8c14c0e59359fe 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Receive.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Receive.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Receive")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Receive")] internal static unsafe partial Error Receive(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* received); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReceiveMessage.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReceiveMessage.cs index 5757d46f6cc520..d6e5ab1a066668 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReceiveMessage.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReceiveMessage.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReceiveMessage")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReceiveMessage")] internal static unsafe partial Error ReceiveMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* received); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs index 2bbac8ac392551..c54f34915ea358 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")] internal static unsafe partial void RegisterForSigChld(delegate* unmanaged handler); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Rename.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Rename.cs index 9d5881713c5c10..ccdbbfd35d079e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Rename.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Rename.cs @@ -17,10 +17,10 @@ internal static partial class Sys /// /// Returns 0 on success; otherwise, returns -1 /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int Rename(string oldPath, string newPath); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", SetLastError = true)] internal static partial int Rename(ref byte oldPath, ref byte newPath); internal static int Rename(ReadOnlySpan oldPath, ReadOnlySpan newPath) diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ResourceLimits.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ResourceLimits.cs index 1d25b5c82ade9f..935ccc9041d080 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ResourceLimits.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ResourceLimits.cs @@ -30,10 +30,10 @@ internal struct RLimit internal ulong MaximumLimit; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRLimit", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRLimit", SetLastError = true)] internal static partial int GetRLimit(RlimitResources resourceType, out RLimit limits); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRLimit", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRLimit", SetLastError = true)] internal static partial int SetRLimit(RlimitResources resourceType, ref RLimit limits); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RmDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RmDir.cs index 2fce1f19ed9eb7..3536ff05b8aa63 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RmDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RmDir.cs @@ -15,7 +15,7 @@ internal static partial class Sys /// /// Returns 0 on success; otherwise, returns -1 /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RmDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RmDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int RmDir(string path); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs index 41e403ecf76469..fada5626b317ff 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs @@ -26,7 +26,7 @@ internal static partial class Sys /// success; if the return value is equal to the size then the result may have been truncated. /// On failure, returns a negative value. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static unsafe partial int SNPrintF(byte* str, int size, string format, string arg1); /// @@ -47,7 +47,7 @@ internal static partial class Sys /// success; if the return value is equal to the size then the result may have been truncated. /// On failure, returns a negative value. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static unsafe partial int SNPrintF(byte* str, int size, string format, int arg1); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetCpu.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetCpu.cs index 464dc333e07651..4f3de7c9444776 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetCpu.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetCpu.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal unsafe partial class Sys { - [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")] + [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")] internal static partial int SchedGetCpu(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetSetAffinity.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetSetAffinity.cs index e304cc29d2dc07..955b0fc1aced3c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetSetAffinity.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetSetAffinity.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedSetAffinity", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedSetAffinity", SetLastError = true)] internal static partial int SchedSetAffinity(int pid, ref IntPtr mask); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetAffinity", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetAffinity", SetLastError = true)] internal static partial int SchedGetAffinity(int pid, out IntPtr mask); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Send.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Send.cs index c65b45291709e0..650afa465e3527 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Send.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Send.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Send")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Send")] internal static unsafe partial Error Send(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* sent); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendFile.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendFile.cs index b7310100384f7e..f0a0cc562b2e56 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendFile.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendFile.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendFile", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendFile", SetLastError = true)] internal static partial Error SendFile(SafeHandle out_fd, SafeHandle in_fd, long offset, long count, out long sent); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendMessage.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendMessage.cs index d091c9d29dd82a..9d60674708cc5d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendMessage.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendMessage.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendMessage")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendMessage")] internal static unsafe partial Error SendMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* sent); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs index f9c6b2be289ac3..eed788da941358 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")] [SuppressGCTransition] internal static unsafe partial void SetDelayedSigChildConsoleConfigurationHandler(delegate* unmanaged callback); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs index 2a52122fc51b1e..615e14007a136a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")] internal static partial int SetEUid(uint euid); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetReceiveTimeout.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetReceiveTimeout.cs index 5eae2395836891..e4eb9fca9a98e5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetReceiveTimeout.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetReceiveTimeout.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetReceiveTimeout")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetReceiveTimeout")] internal static partial Error SetReceiveTimeout(SafeHandle socket, int millisecondsTimeout); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSendTimeout.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSendTimeout.cs index 7e2fe7c131d207..18333fbef1cb05 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSendTimeout.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSendTimeout.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSendTimeout")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSendTimeout")] internal static partial Error SetSendTimeout(SafeHandle socket, int millisecondsTimeout); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs index 8a504d7a0b8f5d..a235e8e133a01a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs @@ -7,11 +7,11 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")] [SuppressGCTransition] internal static partial int GetSignalForBreak(); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")] internal static partial int SetSignalForBreak(int signalForBreak); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs index 66048b39bacf43..1d57e7f8a6aaf0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] internal static unsafe partial Error SetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] internal static unsafe partial Error SetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")] internal static unsafe partial Error SetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs index 7661463b7b9cf8..c4b420cee68aad 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")] internal static unsafe partial void SetTerminalInvalidationHandler(delegate* unmanaged handler); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ShmOpen.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ShmOpen.cs index f7f100cda2aede..c01bbe657f4151 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ShmOpen.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ShmOpen.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial SafeFileHandle ShmOpen(string name, OpenFlags flags, int mode); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmUnlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmUnlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int ShmUnlink(string name); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs index 6a04ca805a2868..9a87ee58d6ee0f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs @@ -9,10 +9,10 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] internal static partial Error Shutdown(SafeHandle socket, SocketShutdown how); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] internal static partial Error Shutdown(IntPtr socket, SocketShutdown how); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs index bce422402d8b9a..56d00ccb3a98cd 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")] internal static unsafe partial Error Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, IntPtr* socket); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs index a0c217a8aca2af..4c03a64e1beb3a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs @@ -9,38 +9,38 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")] [SuppressGCTransition] internal static unsafe partial Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")] [SuppressGCTransition] internal static unsafe partial Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")] [SuppressGCTransition] internal static unsafe partial Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")] [SuppressGCTransition] internal static unsafe partial Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")] [SuppressGCTransition] internal static unsafe partial Error SetPort(byte* socketAddress, int socketAddressLen, ushort port); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")] [SuppressGCTransition] internal static unsafe partial Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")] [SuppressGCTransition] internal static unsafe partial Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")] internal static unsafe partial Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")] internal static unsafe partial Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs index 45eb91559c0ab0..ef14ce83a11713 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs @@ -27,25 +27,25 @@ internal struct SocketEvent private int _padding; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")] internal static unsafe partial Error CreateSocketEventPort(IntPtr* port); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")] internal static partial Error CloseSocketEventPort(IntPtr port); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")] internal static unsafe partial Error CreateSocketEventBuffer(int count, SocketEvent** buffer); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")] internal static unsafe partial Error FreeSocketEventBuffer(SocketEvent* buffer); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] internal static partial Error TryChangeSocketEventRegistration(IntPtr port, SafeHandle socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] internal static partial Error TryChangeSocketEventRegistration(IntPtr port, IntPtr socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")] internal static unsafe partial Error WaitForSocketEvents(IntPtr port, SocketEvent* buffer, int* count); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Pipe.cs index ccf6a4197954b2..3fbae1b1e7fb3c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Pipe.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)] internal static partial int FStat(SafePipeHandle fd, out FileStatus output); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Span.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Span.cs index 094fa66a0dfa5c..15f42cddea4554 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Span.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Span.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)] internal static partial int Stat(ref byte path, out FileStatus output); internal static int Stat(ReadOnlySpan path, out FileStatus output) @@ -20,7 +20,7 @@ internal static int Stat(ReadOnlySpan path, out FileStatus output) return result; } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)] internal static partial int LStat(ref byte path, out FileStatus output); internal static int LStat(ReadOnlySpan path, out FileStatus output) diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.cs index 3da48e827fa1e2..395c99dd7fd670 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.cs @@ -53,13 +53,13 @@ internal enum FileStatusFlags HasBirthTime = 1, } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)] internal static partial int FStat(SafeHandle fd, out FileStatus output); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int Stat(string path, out FileStatus output); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int LStat(string path, out FileStatus output); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs index 7a4a697031e448..ea191c81900e57 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool StdinReady(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs index 9e97fd87a97941..02325f26229510 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int SymLink(string target, string linkPath); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs index 3b2246fbe96992..0ee8d166e85acf 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs @@ -11,7 +11,7 @@ internal static partial class Sys /// /// Forces a write of all modified I/O buffers to their storage mediums. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")] internal static partial void Sync(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysConf.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysConf.cs index 5790ad50046de0..a8ea57a4300812 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysConf.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysConf.cs @@ -13,7 +13,7 @@ internal enum SysConfName _SC_PAGESIZE = 2 } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysConf", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysConf", SetLastError = true)] internal static partial long SysConf(SysConfName name); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs index 475767438655a6..c7333093e7872b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs @@ -29,7 +29,7 @@ internal enum SysLogPriority : int /// /// The message to put in the log entry /// Like printf, the argument is passed to the variadic part of the C++ function to wildcards in the message - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", StringMarshalling = StringMarshalling.Utf8)] internal static partial void SysLog(SysLogPriority priority, string message, string arg1); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs index 252ae160cd1a99..9fe84d213e290c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal unsafe partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CreateThread(IntPtr stackSize, delegate* unmanaged startAddress, IntPtr parameter); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UTimensat.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UTimensat.cs index d1788ee81549da..87359ffcbe0dc7 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UTimensat.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UTimensat.cs @@ -22,7 +22,7 @@ internal struct TimeSpec /// /// Returns 0 on success; otherwise, returns -1 /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UTimensat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UTimensat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static unsafe partial int UTimensat(string path, TimeSpec* times); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs index 5e4d7a6aa99dec..984ca44c35c023 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs @@ -145,7 +145,7 @@ internal enum UnixFileSystemTypes : long zfs = 0x2FC12FC1, } - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")] private static partial long GetFileSystemType(SafeFileHandle fd); internal static bool TryGetFileSystemType(SafeFileHandle fd, out UnixFileSystemTypes fileSystemType) diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Unlink.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Unlink.cs index ec2c5444de7444..8e22880e0874d3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Unlink.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Unlink.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] internal static partial int Unlink(string pathname); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitId.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitId.cs index 4701e4729c37ec..a191e4935a50c0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitId.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitId.cs @@ -16,7 +16,7 @@ internal static partial class Sys /// 2) if no children are terminated, 0 is returned /// 3) on error, -1 is returned /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitIdAnyExitedNoHangNoWait", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitIdAnyExitedNoHangNoWait", SetLastError = true)] internal static partial int WaitIdAnyExitedNoHangNoWait(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitPid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitPid.cs index 129ea867cb620b..2f4eae4584c0a9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitPid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitPid.cs @@ -17,7 +17,7 @@ internal static partial class Sys /// 3) if the child has not yet terminated, 0 is returned /// 4) on error, -1 is returned. /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitPidExitedNoHang", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitPidExitedNoHang", SetLastError = true)] internal static partial int WaitPidExitedNoHang(int pid, out int exitCode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs index b71b9c5e3f734c..bd192c24b8edf2 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs @@ -17,7 +17,7 @@ internal static partial class Sys /// /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] internal static unsafe partial int Write(SafePipeHandle fd, byte* buffer, int bufferSize); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs index 278346759d3ebb..749b34b2e0ca72 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs @@ -17,10 +17,10 @@ internal static partial class Sys /// /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] internal static unsafe partial int Write(IntPtr fd, byte* buffer, int bufferSize); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs index 3607e3fe8a56f3..c6a0ecf8793ac1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class NetSecurityNative { - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsNtlmInstalled(); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")] private static partial int EnsureGssInitialized(); static NetSecurityNative() diff --git a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs index f835484d10b469..292523ff7bdd5f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs @@ -11,54 +11,54 @@ internal static partial class Interop { internal static partial class NetSecurityNative { - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")] internal static partial void ReleaseGssBuffer( IntPtr bufferPtr, ulong length); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")] internal static partial Status DisplayMinorStatus( out Status minorStatus, Status statusValue, ref GssBuffer buffer); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMajorStatus")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMajorStatus")] internal static partial Status DisplayMajorStatus( out Status minorStatus, Status statusValue, ref GssBuffer buffer); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportUserName")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportUserName")] internal static partial Status ImportUserName( out Status minorStatus, [MarshalAs(UnmanagedType.LPUTF8Str)] string inputName, int inputNameByteCount, out SafeGssNameHandle outputName); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportPrincipalName")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportPrincipalName")] internal static partial Status ImportPrincipalName( out Status minorStatus, [MarshalAs(UnmanagedType.LPUTF8Str)] string inputName, int inputNameByteCount, out SafeGssNameHandle outputName); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")] internal static partial Status ReleaseName( out Status minorStatus, ref IntPtr inputName); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")] internal static partial Status AcquireAcceptorCred( out Status minorStatus, out SafeGssCredHandle outputCredHandle); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredSpNego")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredSpNego")] internal static partial Status InitiateCredSpNego( out Status minorStatus, SafeGssNameHandle desiredName, out SafeGssCredHandle outputCredHandle); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)] internal static partial Status InitiateCredWithPassword( out Status minorStatus, [MarshalAs(UnmanagedType.Bool)] bool isNtlm, @@ -67,12 +67,12 @@ internal static partial Status InitiateCredWithPassword( int passwordLen, out SafeGssCredHandle outputCredHandle); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")] internal static partial Status ReleaseCred( out Status minorStatus, ref IntPtr credHandle); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")] internal static partial Status InitSecContext( out Status minorStatus, SafeGssCredHandle initiatorCredHandle, @@ -86,7 +86,7 @@ internal static partial Status InitSecContext( out uint retFlags, [MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContextEx")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContextEx")] internal static partial Status InitSecContext( out Status minorStatus, SafeGssCredHandle initiatorCredHandle, @@ -102,7 +102,7 @@ internal static partial Status InitSecContext( out uint retFlags, [MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcceptSecContext")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcceptSecContext")] internal static partial Status AcceptSecContext( out Status minorStatus, SafeGssCredHandle acceptorCredHandle, @@ -113,18 +113,18 @@ internal static partial Status AcceptSecContext( out uint retFlags, [MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")] internal static partial Status DeleteSecContext( out Status minorStatus, ref IntPtr contextHandle); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")] internal static partial Status GetUser( out Status minorStatus, SafeGssContextHandle? acceptContextHandle, ref GssBuffer token); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Wrap")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Wrap")] private static unsafe partial Status Wrap( out Status minorStatus, SafeGssContextHandle? contextHandle, @@ -133,7 +133,7 @@ private static unsafe partial Status Wrap( int count, ref GssBuffer outBuffer); - [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Unwrap")] + [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Unwrap")] private static partial Status Unwrap( out Status minorStatus, SafeGssContextHandle? contextHandle, diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.GetIntegerBytes.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.GetIntegerBytes.cs index e9a78844fd28a5..a5af06c76a940e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.GetIntegerBytes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.GetIntegerBytes.cs @@ -11,10 +11,10 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1IntegerDerSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1IntegerDerSize")] private static partial int GetAsn1IntegerDerSize(SafeSharedAsn1IntegerHandle i); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeAsn1Integer")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeAsn1Integer")] private static partial int EncodeAsn1Integer(SafeSharedAsn1IntegerHandle i, byte[] buf); internal static byte[] GetAsn1IntegerBytes(SafeSharedAsn1IntegerHandle asn1Integer) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.Nid.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.Nid.cs index 4d486460685b04..3de8f890eb8f20 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.Nid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.Nid.cs @@ -15,7 +15,7 @@ internal static partial class Crypto internal const int NID_undef = 0; - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Nid", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Nid", StringMarshalling = StringMarshalling.Utf8)] private static partial int ObjTxt2Nid(string oid); internal static int ResolveRequiredNid(string oid) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs index efbca475dc5515..51a007e0f1a79e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs @@ -12,13 +12,13 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", StringMarshalling = StringMarshalling.Utf8)] internal static partial SafeAsn1ObjectHandle ObjTxt2Obj(string s); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")] private static unsafe partial int ObjObj2Txt(byte* buf, int buf_len, IntPtr a); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", StringMarshalling = StringMarshalling.Utf8)] private static partial IntPtr CryptoNative_GetObjectDefinitionByName(string friendlyName); internal static IntPtr GetObjectDefinitionByName(string friendlyName) { @@ -32,26 +32,26 @@ internal static IntPtr GetObjectDefinitionByName(string friendlyName) } // Returns shared pointers, should not be tracked as a SafeHandle. - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")] internal static partial IntPtr ObjNid2Obj(int nid); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")] internal static partial void Asn1ObjectFree(IntPtr o); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")] internal static partial SafeAsn1BitStringHandle DecodeAsn1BitString(byte[] buf, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")] internal static partial void Asn1BitStringFree(IntPtr o); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")] internal static partial SafeAsn1OctetStringHandle Asn1OctetStringNew(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringSet")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringSet")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool Asn1OctetStringSet(SafeAsn1OctetStringHandle o, byte[] d, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")] internal static partial void Asn1OctetStringFree(IntPtr o); internal static unsafe string GetOidValue(IntPtr asn1ObjectPtr) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.BIO.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.BIO.cs index 159a6ef2dfb892..d007f57e1ef98c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.BIO.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.BIO.cs @@ -9,35 +9,35 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CreateMemoryBio")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CreateMemoryBio")] internal static partial SafeBioHandle CreateMemoryBio(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioNewFile", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioNewFile", StringMarshalling = StringMarshalling.Utf8)] internal static partial SafeBioHandle BioNewFile(string filename, string mode); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioDestroy")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool BioDestroy(IntPtr a); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioGets")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioGets")] internal static partial int BioGets(SafeBioHandle b, byte[] buf, int size); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioRead")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioRead")] internal static partial int BioRead(SafeBioHandle b, byte[] data, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] internal static partial int BioWrite(SafeBioHandle b, byte[] data, int len); internal static int BioWrite(SafeBioHandle b, ReadOnlySpan data) => BioWrite(b, ref MemoryMarshal.GetReference(data), data.Length); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] private static partial int BioWrite(SafeBioHandle b, ref byte data, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryBioSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryBioSize")] internal static partial int GetMemoryBioSize(SafeBioHandle bio); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioCtrlPending")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioCtrlPending")] internal static partial int BioCtrlPending(SafeBioHandle bio); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs index a4ab395987281a..2c2d9235a70e40 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs @@ -10,16 +10,16 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")] internal static partial void BigNumDestroy(IntPtr a); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")] private static unsafe partial IntPtr BigNumFromBinary(byte* s, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")] private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetBigNumBytes")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetBigNumBytes")] private static partial int GetBigNumBytes(SafeBignumHandle a); private static unsafe IntPtr CreateBignumPtr(ReadOnlySpan bigEndianValue) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.CheckX509Hostname_IntPtr.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.CheckX509Hostname_IntPtr.cs index b139a446901590..fc404297d391e2 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.CheckX509Hostname_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.CheckX509Hostname_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)] internal static partial int CheckX509Hostname( IntPtr x509, string hostname, diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs index 019600085757db..50dc4c2478fd00 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs @@ -13,7 +13,7 @@ internal static partial class Crypto { internal delegate int NegativeSizeReadMethod(THandle handle, byte[]? buf, int cBuf); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioTell")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioTell")] internal static partial int CryptoNative_BioTell(SafeBioHandle bio); internal static int BioTell(SafeBioHandle bio) @@ -27,44 +27,44 @@ internal static int BioTell(SafeBioHandle bio) return ret; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioSeek")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioSeek")] internal static partial int BioSeek(SafeBioHandle bio, int pos); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Thumbprint")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Thumbprint")] private static partial int GetX509Thumbprint(SafeX509Handle x509, byte[]? buf, int cBuf); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")] private static partial int GetX509NameRawBytes(IntPtr x509Name, byte[]? buf, int cBuf); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ReadX509AsDerFromBio")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ReadX509AsDerFromBio")] internal static partial SafeX509Handle ReadX509AsDerFromBio(SafeBioHandle bio); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509CrlNextUpdate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509CrlNextUpdate")] internal static partial IntPtr GetX509CrlNextUpdate(SafeX509CrlHandle crl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Version")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Version")] internal static partial int GetX509Version(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes")] private static partial int GetX509PublicKeyParameterBytes(SafeX509Handle x509, byte[]? buf, int cBuf); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuFieldCount")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuFieldCount")] internal static partial int GetX509EkuFieldCount(SafeEkuExtensionHandle eku); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuField")] internal static partial IntPtr GetX509EkuField(SafeEkuExtensionHandle eku, int loc); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameInfo")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameInfo")] internal static partial SafeBioHandle GetX509NameInfo(SafeX509Handle x509, int nameType, [MarshalAs(UnmanagedType.Bool)] bool forIssuer); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1StringBytes")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1StringBytes")] private static partial int GetAsn1StringBytes(IntPtr asn1, byte[]? buf, int cBuf); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PushX509StackField(SafeX509StackHandle stack, SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PushX509StackField(SafeSharedX509StackHandle stack, SafeX509Handle x509); @@ -82,13 +82,13 @@ internal static int BioTell(SafeBioHandle bio) return Marshal.PtrToStringAnsi(GetX509RootStoreFile_private(&unused)); } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")] private static unsafe partial IntPtr GetX509RootStorePath_private(byte* defaultPath); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")] private static unsafe partial IntPtr GetX509RootStoreFile_private(byte* defaultPath); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreSetVerifyTime( SafeX509StoreHandle ctx, int year, @@ -99,10 +99,10 @@ private static partial int CryptoNative_X509StoreSetVerifyTime( int second, [MarshalAs(UnmanagedType.Bool)] bool isDst); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509IpAddress", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509IpAddress", StringMarshalling = StringMarshalling.Utf8)] internal static partial int CheckX509IpAddress(SafeX509Handle x509, byte[] addressBytes, int addressLen, string hostname, int cchHostname); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)] internal static partial int CheckX509Hostname(SafeX509Handle x509, string hostname, int cchHostname); internal static byte[] GetAsn1StringBytes(IntPtr asn1) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs index ebce6ab847a038..923930fd6ef42a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs @@ -11,18 +11,18 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaUpRef")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaUpRef")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DsaUpRef(IntPtr dsa); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")] internal static partial void DsaDestroy(IntPtr dsa); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeSignature")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeSignature")] private static partial int DsaSizeSignature(SafeDsaHandle dsa); /// @@ -34,7 +34,7 @@ internal static int DsaEncodedSignatureSize(SafeDsaHandle dsa) return size; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")] private static partial int DsaSizeQ(SafeDsaHandle dsa); /// @@ -47,7 +47,7 @@ internal static int DsaSignatureFieldSize(SafeDsaHandle dsa) return size; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")] private static partial int DsaSizeP(SafeDsaHandle dsa); /// @@ -65,7 +65,7 @@ internal static int DsaKeySize(SafeDsaHandle dsa) internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan hash, Span refSignature, out int outSignatureLength) => DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSign")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSign")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength); @@ -83,7 +83,7 @@ ref MemoryMarshal.GetReference(signature), return ret; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaVerify")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaVerify")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength); @@ -144,7 +144,7 @@ internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includ } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDsaParameters")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetDsaParameters( SafeDsaHandle key, @@ -154,7 +154,7 @@ private static partial bool GetDsaParameters( out IntPtr y, out int y_cb, out IntPtr x, out int x_cb); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaKeyCreateByExplicitParameters")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaKeyCreateByExplicitParameters")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DsaKeyCreateByExplicitParameters( out SafeDsaHandle dsa, diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs index 66b465b65e808a..ff307db15e3959 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs @@ -11,22 +11,22 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")] internal static partial ulong ErrClearError(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetExceptionError")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetExceptionError")] private static partial ulong ErrGetExceptionError([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] internal static partial ulong ErrPeekError(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] internal static partial ulong ErrPeekLastError(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] internal static partial IntPtr ErrReasonErrorString(ulong error); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len); private static unsafe string ErrErrorStringN(ulong error) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs index b9496982622504..f47bf5d3e1b510 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreate2")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreate2")] internal static partial SafeEvpCipherCtxHandle EvpCipherCreate( IntPtr cipher, ref byte key, @@ -17,11 +17,11 @@ internal static partial SafeEvpCipherCtxHandle EvpCipherCreate( ref byte iv, int enc); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreatePartial")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreatePartial")] internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial( IntPtr cipher); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetKeyAndIV")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetKeyAndIV")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherSetKeyAndIV( SafeEvpCipherCtxHandle ctx, @@ -45,7 +45,7 @@ ref MemoryMarshal.GetReference(iv), } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmNonceLength")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmNonceLength")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CryptoNative_EvpCipherSetGcmNonceLength( SafeEvpCipherCtxHandle ctx, int nonceLength); @@ -58,7 +58,7 @@ internal static void EvpCipherSetGcmNonceLength(SafeEvpCipherCtxHandle ctx, int } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmNonceLength")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmNonceLength")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CryptoNative_EvpCipherSetCcmNonceLength( SafeEvpCipherCtxHandle ctx, int nonceLength); @@ -71,10 +71,10 @@ internal static void EvpCipherSetCcmNonceLength(SafeEvpCipherCtxHandle ctx, int } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")] internal static partial void EvpCipherDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, byte* pIv, int cIv); @@ -86,11 +86,11 @@ internal static unsafe bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, ReadOnlyS } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCtxSetPadding")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCtxSetPadding")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherUpdate( SafeEvpCipherCtxHandle ctx, @@ -122,7 +122,7 @@ internal static void EvpCipherSetInputLength(SafeEvpCipherCtxHandle ctx, int inp } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherFinalEx")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherFinalEx")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherFinalEx( SafeEvpCipherCtxHandle ctx, @@ -137,7 +137,7 @@ internal static bool EvpCipherFinalEx( return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten); } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetGcmTag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetGcmTag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherGetGcmTag( SafeEvpCipherCtxHandle ctx, @@ -152,7 +152,7 @@ internal static void EvpCipherGetGcmTag(SafeEvpCipherCtxHandle ctx, Span t } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetAeadTag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetAeadTag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherGetAeadTag( SafeEvpCipherCtxHandle ctx, @@ -167,7 +167,7 @@ internal static void EvpCipherGetAeadTag(SafeEvpCipherCtxHandle ctx, Span } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmTag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmTag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherSetGcmTag( SafeEvpCipherCtxHandle ctx, @@ -182,7 +182,7 @@ internal static void EvpCipherSetGcmTag(SafeEvpCipherCtxHandle ctx, ReadOnlySpan } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetAeadTag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetAeadTag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherSetAeadTag( SafeEvpCipherCtxHandle ctx, @@ -197,7 +197,7 @@ internal static void EvpCipherSetAeadTag(SafeEvpCipherCtxHandle ctx, ReadOnlySpa } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetCcmTag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetCcmTag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherGetCcmTag( SafeEvpCipherCtxHandle ctx, @@ -212,7 +212,7 @@ internal static void EvpCipherGetCcmTag(SafeEvpCipherCtxHandle ctx, Span t } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmTag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmTag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EvpCipherSetCcmTag( SafeEvpCipherCtxHandle ctx, @@ -236,88 +236,88 @@ internal static void EvpCipherSetCcmTagLength(SafeEvpCipherCtxHandle ctx, int ta } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")] internal static partial IntPtr EvpAes128Ecb(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")] internal static partial IntPtr EvpAes128Cbc(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")] internal static partial IntPtr EvpAes128Gcm(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")] internal static partial IntPtr EvpAes128Cfb8(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")] internal static partial IntPtr EvpAes128Cfb128(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")] internal static partial IntPtr EvpAes128Ccm(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")] internal static partial IntPtr EvpAes192Ecb(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")] internal static partial IntPtr EvpAes192Cbc(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")] internal static partial IntPtr EvpAes192Gcm(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")] internal static partial IntPtr EvpAes192Cfb8(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")] internal static partial IntPtr EvpAes192Cfb128(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")] internal static partial IntPtr EvpAes192Ccm(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")] internal static partial IntPtr EvpAes256Ecb(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")] internal static partial IntPtr EvpAes256Cbc(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")] internal static partial IntPtr EvpAes256Gcm(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")] internal static partial IntPtr EvpAes256Cfb128(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")] internal static partial IntPtr EvpAes256Cfb8(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")] internal static partial IntPtr EvpAes256Ccm(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")] internal static partial IntPtr EvpDesCbc(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")] internal static partial IntPtr EvpDesEcb(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")] internal static partial IntPtr EvpDesCfb8(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")] internal static partial IntPtr EvpDes3Cbc(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")] internal static partial IntPtr EvpDes3Ecb(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")] internal static partial IntPtr EvpDes3Cfb8(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")] internal static partial IntPtr EvpDes3Cfb64(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")] internal static partial IntPtr EvpRC2Cbc(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")] internal static partial IntPtr EvpRC2Ecb(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")] internal static partial IntPtr EvpChaCha20Poly1305(); internal enum EvpCipherDirection : int diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs index 465d67c0eccfef..abaefab1dab6fc 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs @@ -15,31 +15,31 @@ internal static partial class Crypto private static volatile IntPtr s_evpSha384; private static volatile IntPtr s_evpSha512; - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial IntPtr CryptoNative_EvpMd5(); internal static IntPtr EvpMd5() => s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5()); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] internal static partial IntPtr CryptoNative_EvpSha1(); internal static IntPtr EvpSha1() => s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1()); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] internal static partial IntPtr CryptoNative_EvpSha256(); internal static IntPtr EvpSha256() => s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256()); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] internal static partial IntPtr CryptoNative_EvpSha384(); internal static IntPtr EvpSha384() => s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384()); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] internal static partial IntPtr CryptoNative_EvpSha512(); internal static IntPtr EvpSha512() => diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs index 42adb07994d2d3..d729d9bba55c62 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs @@ -10,37 +10,37 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] internal static partial void EvpMdCtxDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type); internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan d, int cnt) => EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")] private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")] internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] internal static partial int EvpMdSize(IntPtr md); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] private static partial int GetMaxMdSize(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] private static unsafe partial int Pbkdf2( byte* pPassword, int passwordLength, diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs index bbcbcd20bf4900..b70935b75cb42e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)] private static partial int EcKeyCreateByKeyParameters( out SafeEcKeyHandle key, string oid, @@ -37,7 +37,7 @@ internal static SafeEcKeyHandle EcKeyCreateByKeyParameters( return key; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")] internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters( ECCurve.ECCurveType curveType, byte[]? qx, int qxLength, @@ -97,7 +97,7 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_GetECKeyParameters( SafeEcKeyHandle key, [MarshalAs(UnmanagedType.Bool)] bool includePrivate, @@ -166,7 +166,7 @@ internal static ECParameters GetECKeyParameters( return parameters; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_GetECCurveParameters( SafeEcKeyHandle key, [MarshalAs(UnmanagedType.Bool)] bool includePrivate, diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.cs index 77d7f78048927e..7d994d96402dd3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.cs @@ -12,7 +12,7 @@ internal static partial class Crypto internal static bool EcDsaSign(ReadOnlySpan dgst, Span sig, out int siglen, SafeEcKeyHandle ecKey) => EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSign")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSign")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey); @@ -39,11 +39,11 @@ ref MemoryMarshal.GetReference(sigbuf), * 0: incorrect signature * -1: error */ - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaVerify")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaVerify")] private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey); // returns the maximum length of a DER encoded ECDSA signature created with this key. - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSize")] private static partial int CryptoNative_EcDsaSize(SafeEcKeyHandle ecKey); internal static int EcDsaSize(SafeEcKeyHandle ecKey) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs index 7ad6d52309983c..c62dfc00cb63eb 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)] private static partial SafeEcKeyHandle CryptoNative_EcKeyCreateByOid(string oid); internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid) { @@ -23,18 +23,18 @@ internal static partial class Crypto return handle; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")] internal static partial void EcKeyDestroy(IntPtr a); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EcKeyGenerateKey(SafeEcKeyHandle eckey); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyUpRef")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyUpRef")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EcKeyUpRef(IntPtr r); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize); internal static int EcKeyGetSize(SafeEcKeyHandle key) { @@ -47,7 +47,7 @@ internal static int EcKeyGetSize(SafeEcKeyHandle key) throw Interop.Crypto.CreateOpenSslCryptographicException(); } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGetCurveName2")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGetCurveName2")] private static partial int CryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out int nid); internal static string EcKeyGetCurveName(SafeEcKeyHandle key) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Dsa.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Dsa.cs index cd25db971e2d44..407d9b2922743c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Dsa.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Dsa.cs @@ -9,10 +9,10 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetDsa")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetDsa")] internal static partial SafeDsaHandle EvpPkeyGetDsa(SafeEvpPKeyHandle pkey); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetDsa")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetDsa")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvpPkeySetDsa(SafeEvpPKeyHandle pkey, SafeDsaHandle key); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.EcKey.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.EcKey.cs index 2d61d8b1cad4c3..6ef629c8e0d6e7 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.EcKey.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.EcKey.cs @@ -9,10 +9,10 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetEcKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetEcKey")] internal static partial SafeEcKeyHandle EvpPkeyGetEcKey(SafeEvpPKeyHandle pkey); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetEcKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetEcKey")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvpPkeySetEcKey(SafeEvpPKeyHandle pkey, SafeEcKeyHandle key); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs index 01e12ffbb55bf5..5308043c8e80ef 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs @@ -11,16 +11,16 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxCreate")] internal static partial SafeEvpPKeyCtxHandle EvpPKeyCtxCreate(SafeEvpPKeyHandle pkey, SafeEvpPKeyHandle peerkey, out uint secretLength); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyDeriveSecretAgreement")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyDeriveSecretAgreement")] private static partial int EvpPKeyDeriveSecretAgreement( ref byte secret, uint secretLength, SafeEvpPKeyCtxHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")] internal static partial void EvpPKeyCtxDestroy(IntPtr ctx); internal static void EvpPKeyDeriveSecretAgreement(SafeEvpPKeyCtxHandle ctx, Span destination) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Rsa.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Rsa.cs index 523d3f33882c4f..9fe32f23e42b02 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Rsa.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Rsa.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyCreateRsa(IntPtr rsa); internal static SafeEvpPKeyHandle EvpPKeyCreateRsa(IntPtr rsa) @@ -29,7 +29,7 @@ internal static SafeEvpPKeyHandle EvpPKeyCreateRsa(IntPtr rsa) return pkey; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeEvpPKeyHandle CryptoNative_RsaGenerateKey(int keySize); internal static SafeEvpPKeyHandle RsaGenerateKey(int keySize) @@ -45,7 +45,7 @@ internal static SafeEvpPKeyHandle RsaGenerateKey(int keySize) return pkey; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaDecrypt( SafeEvpPKeyHandle pkey, ref byte source, @@ -80,7 +80,7 @@ ref MemoryMarshal.GetReference(destination), return written; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaEncrypt( SafeEvpPKeyHandle pkey, ref byte source, @@ -115,7 +115,7 @@ ref MemoryMarshal.GetReference(destination), return written; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaSignHash( SafeEvpPKeyHandle pkey, RSASignaturePaddingMode paddingMode, @@ -150,7 +150,7 @@ ref MemoryMarshal.GetReference(destination), return written; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaVerifyHash( SafeEvpPKeyHandle pkey, RSASignaturePaddingMode paddingMode, diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs index 95e9ab89fc5054..bbb7a67bd2df8e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")] internal static partial SafeEvpPKeyHandle EvpPkeyCreate(); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyDuplicate( SafeEvpPKeyHandle currentKey, EvpAlgorithmId algorithmId); @@ -37,22 +37,22 @@ internal static SafeEvpPKeyHandle EvpPKeyDuplicate( return pkey; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")] internal static partial void EvpPkeyDestroy(IntPtr pkey); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")] internal static partial int EvpPKeySize(SafeEvpPKeyHandle pkey); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_UpRefEvpPkey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_UpRefEvpPkey")] internal static partial int UpRefEvpPkey(SafeEvpPKeyHandle handle); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial SafeEvpPKeyHandle CryptoNative_DecodeSubjectPublicKeyInfo( byte* buf, int len, int algId); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial SafeEvpPKeyHandle CryptoNative_DecodePkcs8PrivateKey( byte* buf, int len, @@ -104,7 +104,7 @@ internal static unsafe SafeEvpPKeyHandle DecodePkcs8PrivateKey( return handle; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_GetPkcs8PrivateKeySize(IntPtr pkey, out int p8size); private static int GetPkcs8PrivateKeySize(IntPtr pkey) @@ -129,7 +129,7 @@ private static int GetPkcs8PrivateKeySize(IntPtr pkey) } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial int CryptoNative_EncodePkcs8PrivateKey(IntPtr pkey, byte* buf); internal static ArraySegment RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle pkey) @@ -165,7 +165,7 @@ internal static ArraySegment RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle p } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_GetSubjectPublicKeyInfoSize(IntPtr pkey); private static int GetSubjectPublicKeyInfoSize(IntPtr pkey) @@ -180,7 +180,7 @@ private static int GetSubjectPublicKeyInfoSize(IntPtr pkey) return ret; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial int CryptoNative_EncodeSubjectPublicKeyInfo(IntPtr pkey, byte* buf); internal static ArraySegment RentEncodeSubjectPublicKeyInfo(SafeEvpPKeyHandle pkey) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs index 88cae2dad5ac17..496324f9976f19 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs @@ -10,28 +10,28 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")] internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] internal static partial void HmacDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")] internal static partial int HmacReset(SafeHmacCtxHandle ctx); internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan data, int len) => HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacUpdate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacUpdate")] private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacFinal")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacFinal")] internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, int* mdSize); internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan key, ReadOnlySpan source, Span destination) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs index e7afaa13620d13..9dabafdd4d6099 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs @@ -48,7 +48,7 @@ internal static void Initialize() // No-op that exists to provide a hook for other static constructors. } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] private static partial int EnsureOpenSslInitialized(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs index d3fada1b91498f..f30c816bc21763 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs @@ -10,7 +10,7 @@ internal static partial class Crypto private static volatile bool s_loadedLegacy; private static readonly object s_legacyLoadLock = new object(); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial void CryptoNative_RegisterLegacyAlgorithms(); internal static void EnsureLegacyAlgorithmsRegistered() diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LookupFriendlyNameByOid.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LookupFriendlyNameByOid.cs index 8d82c6cca2fa5a..118ee48be92a2e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LookupFriendlyNameByOid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LookupFriendlyNameByOid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_LookupFriendlyNameByOid", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_LookupFriendlyNameByOid", StringMarshalling = StringMarshalling.Utf8)] internal static partial int LookupFriendlyNameByOid(string oidValue, ref IntPtr friendlyNamePtr); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs index 81f12a4135cbc7..a4cb8792fb3fc9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs @@ -12,16 +12,16 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")] internal static partial void OcspRequestDestroy(IntPtr ocspReq); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")] internal static partial int GetOcspRequestDerSize(SafeOcspRequestHandle req); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeOcspRequest")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeOcspRequest")] internal static partial int EncodeOcspRequest(SafeOcspRequestHandle req, byte[] buf); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeOcspResponseHandle CryptoNative_DecodeOcspResponse(ref byte buf, int len); internal static SafeOcspResponseHandle DecodeOcspResponse(ReadOnlySpan buf) @@ -31,10 +31,10 @@ ref MemoryMarshal.GetReference(buf), buf.Length); } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")] internal static partial void OcspResponseDestroy(IntPtr ocspReq); - [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)] private static partial int CryptoNative_X509ChainGetCachedOcspStatus( SafeX509StoreCtxHandle ctx, string cachePath, @@ -53,7 +53,7 @@ internal static X509VerifyStatusCode X509ChainGetCachedOcspStatus(SafeX509StoreC return response; } - [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)] private static partial int CryptoNative_X509ChainVerifyOcsp( SafeX509StoreCtxHandle ctx, SafeOcspRequestHandle req, @@ -79,7 +79,7 @@ internal static X509VerifyStatusCode X509ChainVerifyOcsp( return response; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeOcspRequestHandle CryptoNative_X509ChainBuildOcspRequest( SafeX509StoreCtxHandle storeCtx, int chainDepth); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs index 696efb3b209a15..e27f5be751124d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OpenSslNoInit { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")] private static partial int OpenSslAvailable(); private static readonly Lazy s_openSslAvailable = diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslGetProtocolSupport.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslGetProtocolSupport.cs index a4efc28f0da500..469553940986bd 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslGetProtocolSupport.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslGetProtocolSupport.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class OpenSsl { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslGetProtocolSupport")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslGetProtocolSupport")] internal static partial int OpenSslGetProtocolSupport(int protocol); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs index c7b4c22f14aa94..034ca717f7f4ca 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class OpenSsl { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")] internal static partial long OpenSslVersionNumber(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs index a1d5568e42edf5..bf922ca4f6852b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs @@ -9,31 +9,31 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioPkcs7")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioPkcs7")] internal static partial SafePkcs7Handle PemReadBioPkcs7(SafeBioHandle bp); internal static SafePkcs7Handle DecodePkcs7(ReadOnlySpan buf) => DecodePkcs7(ref MemoryMarshal.GetReference(buf), buf.Length); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs7")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs7")] private static partial SafePkcs7Handle DecodePkcs7(ref byte buf, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_D2IPkcs7Bio")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_D2IPkcs7Bio")] internal static partial SafePkcs7Handle D2IPkcs7Bio(SafeBioHandle bp); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")] internal static partial SafePkcs7Handle Pkcs7CreateCertificateCollection(SafeX509StackHandle certs); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")] internal static partial void Pkcs7Destroy(IntPtr p7); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")] private static partial int GetPkcs7Certificates(SafePkcs7Handle p7, out SafeSharedX509StackHandle certs); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7DerSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7DerSize")] internal static partial int GetPkcs7DerSize(SafePkcs7Handle p7); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodePkcs7")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodePkcs7")] internal static partial int EncodePkcs7(SafePkcs7Handle p7, byte[] buf); internal static SafeSharedX509StackHandle GetPkcs7Certificates(SafePkcs7Handle p7) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs index 10e501f7631b04..99373d6eeb50e8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs @@ -15,7 +15,7 @@ internal static unsafe bool GetRandomBytes(byte* pbBuffer, int count) return CryptoNative_GetRandomBytes(pbBuffer, count) != 0; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial int CryptoNative_GetRandomBytes(byte* buf, int num); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs index 66431af192dcac..b671bde648ce41 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Ssl { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] internal static partial void SslCtxSetProtocolOptions(IntPtr ctx, SslProtocols protocols); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] internal static partial void SslCtxSetProtocolOptions(SafeSslContextHandle ctx, SslProtocols protocols); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs index e06ec3910b1536..605a85d2736cf8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs @@ -20,44 +20,44 @@ internal static partial class Ssl internal const int SSL_TLSEXT_ERR_ALERT_FATAL = 2; internal const int SSL_TLSEXT_ERR_NOACK = 3; - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")] internal static partial void EnsureLibSslInitialized(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")] internal static partial IntPtr SslV2_3Method(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")] internal static partial SafeSslHandle SslCreate(SafeSslContextHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] internal static partial SslErrorCode SslGetError(SafeSslHandle ssl, int ret); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] internal static partial SslErrorCode SslGetError(IntPtr ssl, int ret); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")] internal static partial void SslSetQuietShutdown(SafeSslHandle ssl, int mode); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")] internal static partial void SslDestroy(IntPtr ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")] internal static partial void SslSetConnectState(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAcceptState")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAcceptState")] internal static partial void SslSetAcceptState(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAlpnProtos")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAlpnProtos")] internal static unsafe partial int SslSetAlpnProtos(SafeSslHandle ssl, byte* protos, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetVersion")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetVersion")] internal static partial IntPtr SslGetVersion(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetTlsExtHostName", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetTlsExtHostName", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SslSetTlsExtHostName(SafeSslHandle ssl, string host); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGet0AlpnSelected")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGet0AlpnSelected")] internal static partial void SslGetAlpnSelected(SafeSslHandle ssl, out IntPtr protocol, out int len); internal static byte[]? SslGetAlpnSelected(SafeSslHandle ssl) @@ -74,97 +74,97 @@ internal static partial class Ssl return result; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite", SetLastError = true)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite", SetLastError = true)] internal static partial int SslWrite(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead", SetLastError = true)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead", SetLastError = true)] internal static partial int SslRead(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRenegotiate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRenegotiate")] internal static partial int SslRenegotiate(SafeSslHandle ssl, out SslErrorCode error); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslRenegotiatePending")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslRenegotiatePending")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsSslRenegotiatePending(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] internal static partial int SslShutdown(IntPtr ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] internal static partial int SslShutdown(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetBio")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetBio")] internal static partial void SslSetBio(SafeSslHandle ssl, SafeBioHandle rbio, SafeBioHandle wbio); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDoHandshake", SetLastError = true)] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDoHandshake", SetLastError = true)] internal static partial int SslDoHandshake(SafeSslHandle ssl, out SslErrorCode error); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslStateOK")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslStateOK")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsSslStateOK(SafeSslHandle ssl); // NOTE: this is just an (unsafe) overload to the BioWrite method from Interop.Bio.cs. - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] internal static unsafe partial int BioWrite(SafeBioHandle b, byte* data, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] internal static partial int BioWrite(SafeBioHandle b, ref byte data, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")] internal static partial SafeX509Handle SslGetPeerCertificate(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertChain")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertChain")] internal static partial SafeSharedX509StackHandle SslGetPeerCertChain(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerFinished")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerFinished")] internal static partial int SslGetPeerFinished(SafeSslHandle ssl, IntPtr buf, int count); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetFinished")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetFinished")] internal static partial int SslGetFinished(SafeSslHandle ssl, IntPtr buf, int count); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSessionReused")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSessionReused")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SslSessionReused(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetClientCAList")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetClientCAList")] private static partial SafeSharedX509NameStackHandle SslGetClientCAList_private(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetCurrentCipherId")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetCurrentCipherId")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SslGetCurrentCipherId(SafeSslHandle ssl, out int cipherId); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")] private static partial IntPtr GetOpenSslCipherSuiteName(SafeSslHandle ssl, int cipherSuite, out int isTls12OrLower); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SslSetCiphers(SafeSslHandle ssl, byte* cipherList, byte* cipherSuites); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")] internal static partial void SslSetVerifyPeer(SafeSslHandle ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")] internal static partial IntPtr SslGetData(IntPtr ssl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] internal static partial int SslSetData(SafeSslHandle ssl, IntPtr data); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] internal static partial int SslSetData(IntPtr ssl, IntPtr data); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")] internal static partial int SslUseCertificate(SafeSslHandle ssl, SafeX509Handle certPtr); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")] internal static partial int SslUsePrivateKey(SafeSslHandle ssl, SafeEvpPKeyHandle keyPtr); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")] internal static unsafe partial void SslSetClientCertCallback(SafeSslHandle ssl, int set); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetPostHandshakeAuth")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetPostHandshakeAuth")] internal static partial void SslSetPostHandshakeAuth(SafeSslHandle ssl, int value); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")] private static partial int Tls13SupportedImpl(); internal static class Capabilities @@ -219,11 +219,11 @@ internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, Span serial } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddExtraChainCert")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddExtraChainCert")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SslAddExtraChainCert(SafeSslHandle ssl, SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddClientCAs")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddClientCAs")] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool SslAddClientCAs(SafeSslHandle ssl, IntPtr* x509s, int count); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs index 7401389a394f9e..e735e68a1cb238 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs @@ -13,16 +13,16 @@ internal static partial class Interop { internal static partial class Ssl { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCreate")] internal static partial SafeSslContextHandle SslCtxCreate(IntPtr method); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxDestroy")] internal static partial void SslCtxDestroy(IntPtr ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetAlpnSelectCb")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetAlpnSelectCb")] internal static unsafe partial void SslCtxSetAlpnSelectCb(SafeSslContextHandle ctx, delegate* unmanaged callback, IntPtr arg); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")] internal static unsafe partial void SslCtxSetCaching(SafeSslContextHandle ctx, int mode); internal static bool AddExtraChainCertificates(SafeSslContextHandle ctx, X509Certificate2[] chain) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtxOptions.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtxOptions.cs index e52164a526832e..f3412d69cc431e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtxOptions.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtxOptions.cs @@ -11,27 +11,27 @@ internal static partial class Interop { internal static partial class Ssl { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxAddExtraChainCert")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxAddExtraChainCert")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SslCtxAddExtraChainCert(SafeSslContextHandle ctx, SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUseCertificate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUseCertificate")] internal static partial int SslCtxUseCertificate(SafeSslContextHandle ctx, SafeX509Handle certPtr); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUsePrivateKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUsePrivateKey")] internal static partial int SslCtxUsePrivateKey(SafeSslContextHandle ctx, SafeEvpPKeyHandle keyPtr); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCheckPrivateKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCheckPrivateKey")] internal static partial int SslCtxCheckPrivateKey(SafeSslContextHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetQuietShutdown")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetQuietShutdown")] internal static partial void SslCtxSetQuietShutdown(SafeSslContextHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCiphers")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCiphers")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SslCtxSetCiphers(SafeSslContextHandle ctx, byte* cipherList, byte* cipherSuites); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetEncryptionPolicy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetEncryptionPolicy")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetEncryptionPolicy(SafeSslContextHandle ctx, EncryptionPolicy policy); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs index deddc37736c908..ede22911173719 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs @@ -14,75 +14,75 @@ internal static partial class Crypto { internal delegate int X509StoreVerifyCallback(int ok, IntPtr ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotBefore")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotBefore")] internal static partial IntPtr GetX509NotBefore(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotAfter")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotAfter")] internal static partial IntPtr GetX509NotAfter(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SignatureAlgorithm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SignatureAlgorithm")] internal static partial IntPtr GetX509SignatureAlgorithm(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm")] internal static partial IntPtr GetX509PublicKeyAlgorithm(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyBytes")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyBytes")] internal static partial IntPtr GetX509PublicKeyBytes(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EvpPublicKey")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EvpPublicKey")] internal static partial SafeEvpPKeyHandle GetX509EvpPublicKey(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509Crl")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509Crl")] internal static partial SafeX509CrlHandle DecodeX509Crl(byte[] buf, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")] internal static partial SafeX509Handle DecodeX509(ref byte buf, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")] internal static partial SafeX509Handle DecodeX509(IntPtr buf, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509DerSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509DerSize")] internal static partial int GetX509DerSize(SafeX509Handle x); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")] internal static partial int EncodeX509(SafeX509Handle x, byte[] buf); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")] internal static partial void X509Destroy(IntPtr a); /// /// Clone the input certificate into a new object. /// - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] internal static partial SafeX509Handle X509Duplicate(IntPtr handle); /// /// Clone the input certificate into a new object. /// - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] internal static partial SafeX509Handle X509Duplicate(SafeX509Handle handle); /// /// Increment the native reference count of the certificate to protect against /// a free from another pointer-holder. /// - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")] internal static partial SafeX509Handle X509UpRef(IntPtr handle); /// /// Increment the native reference count of the certificate to protect against /// a free from another pointer-holder. /// - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")] internal static partial SafeX509Handle X509UpRef(SafeX509Handle handle); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBio")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBio")] internal static partial SafeX509Handle PemReadX509FromBio(SafeBioHandle bio); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBioAux")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBioAux")] internal static partial SafeX509Handle PemReadX509FromBioAux(SafeBioHandle bio); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSerialNumber")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSerialNumber")] private static partial SafeSharedAsn1IntegerHandle X509GetSerialNumber_private(SafeX509Handle x); internal static SafeSharedAsn1IntegerHandle X509GetSerialNumber(SafeX509Handle x) @@ -94,20 +94,20 @@ internal static SafeSharedAsn1IntegerHandle X509GetSerialNumber(SafeX509Handle x x); } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetIssuerName")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetIssuerName")] internal static partial IntPtr X509GetIssuerName(SafeX509Handle x); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSubjectName")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSubjectName")] internal static partial IntPtr X509GetSubjectName(SafeX509Handle x); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CheckPurpose")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CheckPurpose")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool X509CheckPurpose(SafeX509Handle x, int id, int ca); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509IssuerNameHash")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509IssuerNameHash")] internal static partial ulong X509IssuerNameHash(SafeX509Handle x); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeSharedAsn1OctetStringHandle CryptoNative_X509FindExtensionData( SafeX509Handle x, int extensionNid); @@ -122,27 +122,27 @@ internal static SafeSharedAsn1OctetStringHandle X509FindExtensionData(SafeX509Ha extensionNid); } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExtCount")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExtCount")] internal static partial int X509GetExtCount(SafeX509Handle x); // Returns a pointer already being tracked by the SafeX509Handle, shouldn't be SafeHandle tracked/freed. // Bounds checking is in place for "loc", IntPtr.Zero is returned on violations. - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExt")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExt")] internal static partial IntPtr X509GetExt(SafeX509Handle x, int loc); // Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed. - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")] internal static partial IntPtr X509ExtensionGetOid(IntPtr ex); // Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed. - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")] internal static partial IntPtr X509ExtensionGetData(IntPtr ex); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool X509ExtensionGetCritical(IntPtr ex); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial SafeX509StoreHandle CryptoNative_X509ChainNew(SafeX509StackHandle systemTrust, SafeX509StackHandle userTrust); internal static SafeX509StoreHandle X509ChainNew(SafeX509StackHandle systemTrust, SafeX509StackHandle userTrust) @@ -157,14 +157,14 @@ internal static SafeX509StoreHandle X509ChainNew(SafeX509StackHandle systemTrust return store; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")] internal static partial void X509StoreDestory(IntPtr v); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool X509StoreAddCrl(SafeX509StoreHandle ctx, SafeX509CrlHandle x); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreSetRevocationFlag")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreSetRevocationFlag")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CryptoNative_X509StoreSetRevocationFlag(SafeX509StoreHandle ctx, X509RevocationFlag revocationFlag); @@ -176,7 +176,7 @@ internal static void X509StoreSetRevocationFlag(SafeX509StoreHandle ctx, X509Rev } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxInit")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxInit")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool X509StoreCtxInit( SafeX509StoreCtxHandle ctx, @@ -184,7 +184,7 @@ internal static partial bool X509StoreCtxInit( SafeX509Handle x509, SafeX509StackHandle extraCerts); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509VerifyCert(SafeX509StoreCtxHandle ctx); internal static bool X509VerifyCert(SafeX509StoreCtxHandle ctx) @@ -199,7 +199,7 @@ internal static bool X509VerifyCert(SafeX509StoreCtxHandle ctx) return result != 0; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] internal static partial int CryptoNative_X509StoreCtxGetError(SafeX509StoreCtxHandle ctx); internal static X509VerifyStatusCode X509StoreCtxGetError(SafeX509StoreCtxHandle ctx) @@ -207,7 +207,7 @@ internal static X509VerifyStatusCode X509StoreCtxGetError(SafeX509StoreCtxHandle return (X509VerifyStatusCode)CryptoNative_X509StoreCtxGetError(ctx); } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreCtxReset(SafeX509StoreCtxHandle ctx); internal static void X509StoreCtxReset(SafeX509StoreCtxHandle ctx) @@ -218,7 +218,7 @@ internal static void X509StoreCtxReset(SafeX509StoreCtxHandle ctx) } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx); internal static bool X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx) @@ -233,10 +233,10 @@ internal static bool X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx) return result != 0; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth")] internal static partial int X509StoreCtxGetErrorDepth(SafeX509StoreCtxHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback")] internal static partial void X509StoreCtxSetVerifyCallback(SafeX509StoreCtxHandle ctx, X509StoreVerifyCallback callback); internal static string GetX509VerifyCertErrorString(int n) @@ -244,22 +244,22 @@ internal static string GetX509VerifyCertErrorString(int n) return Marshal.PtrToStringAnsi(X509VerifyCertErrorString(n))!; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")] private static partial IntPtr X509VerifyCertErrorString(int n); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")] internal static partial void X509CrlDestroy(IntPtr a); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")] internal static partial int PemWriteBioX509Crl(SafeBioHandle bio, SafeX509CrlHandle crl); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioX509Crl")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioX509Crl")] internal static partial SafeX509CrlHandle PemReadBioX509Crl(SafeBioHandle bio); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize")] internal static partial int GetX509SubjectPublicKeyInfoDerSize(SafeX509Handle x509); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo")] internal static partial int EncodeX509SubjectPublicKeyInfo(SafeX509Handle x509, byte[] buf); internal enum X509VerifyStatusCodeUniversal diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs index 1d3d385ab991b0..b52e9a517e3e4e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs @@ -9,20 +9,20 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionCreateByObj")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionCreateByObj")] internal static partial SafeX509ExtensionHandle X509ExtensionCreateByObj( SafeAsn1ObjectHandle oid, [MarshalAs(UnmanagedType.Bool)] bool isCritical, SafeAsn1OctetStringHandle data); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")] internal static partial int X509ExtensionDestroy(IntPtr x); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool X509V3ExtPrint(SafeBioHandle buf, SafeX509ExtensionHandle ext); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509BasicConstraints2Extension")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509BasicConstraints2Extension")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DecodeX509BasicConstraints2Extension( byte[] encoded, @@ -31,10 +31,10 @@ internal static partial bool DecodeX509BasicConstraints2Extension( [MarshalAs(UnmanagedType.Bool)] out bool hasPathLengthConstraint, out int pathLengthConstraint); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")] internal static partial SafeEkuExtensionHandle DecodeExtendedKeyUsage(byte[] buf, int len); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")] internal static partial void ExtendedKeyUsageDestory(IntPtr a); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Name.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Name.cs index 17aeb1559a1a46..0bc5e5a821f769 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Name.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Name.cs @@ -10,14 +10,14 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackFieldCount")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackFieldCount")] internal static partial int GetX509NameStackFieldCount(SafeSharedX509NameStackHandle sk); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackField")] private static partial SafeSharedX509NameHandle GetX509NameStackField_private(SafeSharedX509NameStackHandle sk, int loc); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")] private static partial int GetX509NameRawBytes(SafeSharedX509NameHandle x509Name, byte[]? buf, int cBuf); internal static X500DistinguishedName LoadX500Name(SafeSharedX509NameHandle namePtr) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs index 7a75fb46c3cc36..a322b1bf2b9de9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs @@ -9,33 +9,33 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")] internal static partial SafeX509StackHandle NewX509Stack(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")] internal static partial void RecursiveFreeX509Stack(IntPtr stack); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")] internal static partial int GetX509StackFieldCount(SafeX509StackHandle stack); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")] internal static partial int GetX509StackFieldCount(SafeSharedX509StackHandle stack); /// /// Gets a pointer to a certificate within a STACK_OF(X509). This pointer will later /// be freed, so it should be cloned via new X509Certificate2(IntPtr) /// - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")] internal static partial IntPtr GetX509StackField(SafeX509StackHandle stack, int loc); /// /// Gets a pointer to a certificate within a STACK_OF(X509). This pointer will later /// be freed, so it should be cloned via new X509Certificate2(IntPtr) /// - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")] internal static partial IntPtr GetX509StackField(SafeSharedX509StackHandle stack, int loc); - [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)] private static partial int CryptoNative_X509StackAddDirectoryStore(SafeX509StackHandle stack, string storePath); internal static void X509StackAddDirectoryStore(SafeX509StackHandle stack, string storePath) @@ -46,7 +46,7 @@ internal static void X509StackAddDirectoryStore(SafeX509StackHandle stack, strin } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StackAddMultiple(SafeX509StackHandle dest, SafeX509StackHandle src); internal static void X509StackAddMultiple(SafeX509StackHandle dest, SafeX509StackHandle src) diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs index 6ff3dba7e7beb4..08cf5b40b41fb8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs @@ -9,19 +9,19 @@ internal static partial class Interop { internal static partial class Crypto { - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")] internal static partial SafeX509StoreCtxHandle X509StoreCtxCreate(); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")] internal static partial void X509StoreCtxDestroy(IntPtr v); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")] internal static partial SafeX509StackHandle X509StoreCtxGetChain(SafeX509StoreCtxHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert")] internal static partial SafeX509Handle X509StoreCtxGetCurrentCert(SafeX509StoreCtxHandle ctx); - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx); internal static void X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx) @@ -32,7 +32,7 @@ internal static void X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx) } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreCtxResetForSignatureError( SafeX509StoreCtxHandle ctx, out SafeX509StoreHandle newStore); @@ -55,7 +55,7 @@ internal static void X509StoreCtxResetForSignatureError( } } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted")] private static partial SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted_private(SafeX509StoreCtxHandle ctx); internal static SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted(SafeX509StoreCtxHandle ctx) diff --git a/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs b/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs index f43f81fb09c29b..83a338bc3b3810 100644 --- a/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs +++ b/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class @libc { - [GeneratedDllImport(Libraries.libc, EntryPoint = "getppid")] + [LibraryImport(Libraries.libc, EntryPoint = "getppid")] internal static partial int GetParentPid(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs b/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs index 6b99600ee05523..97a275ae9f1099 100644 --- a/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Activeds { - [GeneratedDllImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)] internal static partial int ADsOpenObject(string path, string? userName, string? password, int flags, ref Guid iid, out IntPtr ppObject); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs index 86f22a139aed00..14bb8490059b85 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool AdjustTokenPrivileges( SafeTokenHandle TokenHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AllocateLocallyUniqueId.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AllocateLocallyUniqueId.cs index a1866c345d5843..3fc64c61cca633 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AllocateLocallyUniqueId.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AllocateLocallyUniqueId.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool AllocateLocallyUniqueId(LUID* Luid); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs index e67bc5b82bc32c..90b3d8ae12a583 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool ChangeServiceConfig2(SafeServiceHandle serviceHandle, uint infoLevel, ref SERVICE_DESCRIPTION serviceDesc); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs index ae3b3247f3005f..b10c2ef646868f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CheckTokenMembership( SafeAccessTokenHandle TokenHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs index d1880f48084dd2..d7b80aa25cd97c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool ClearEventLog(SafeEventLogReadHandle hEventLog, string lpBackupFileName); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs index 2874cf13fb50d5..674ebbe3eb145c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CloseEventLog(IntPtr hEventLog); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs index 9796226af14eb8..7c5196c97203fb 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CloseServiceHandle(IntPtr handle); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs index 3fb3fddc4daf22..7b2219794efa67 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool ControlService(SafeServiceHandle serviceHandle, int control, SERVICE_STATUS* pStatus); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSdToStringSd.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSdToStringSd.cs index 8e3cdb625e9f3f..0a7508ad94d774 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSdToStringSd.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSdToStringSd.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW", + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ConvertSdToStringSd( diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs index ece6aad42eb7a2..257e709cd003b9 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial BOOL ConvertSidToStringSid(IntPtr sid, out string stringSid); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSdToSd.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSdToSd.cs index 014e88ad3951fe..9bb721de683500 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSdToSd.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSdToSd.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ConvertStringSdToSd( diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs index 1d65cc7f98e0ac..120fc0e89caff6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ConvertStringSecurityDescriptorToSecurityDescriptor( string StringSecurityDescriptor, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs index f5bba0ba8c0bf4..fe1fd2c8b66465 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial BOOL ConvertStringSidToSid( string stringSid, out IntPtr ByteArray); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs index c34de91b9d7fb1..4a8c468e12baf4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CopySid(int destinationLength, IntPtr pSidDestination, IntPtr pSidSource); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs index c1b97caebebb32..d772679f30178f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CreateProcessWithLogonW( string userName, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateService.cs index 5ee78eb9256433..40d138810e0671 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr CreateService(SafeServiceHandle databaseHandle, string serviceName, string displayName, int access, int serviceType, int startType, int errorControl, string binaryPath, string loadOrderGroup, IntPtr pTagId, string dependencies, string servicesStartName, string password); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs index cc93f468142424..aba754cd2a5e49 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)] internal static partial int CreateWellKnownSid( int sidType, byte[]? domainSid, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs index 355b12b17b22d8..787a9fa849ffeb 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs @@ -20,7 +20,7 @@ internal enum CryptAcquireContextFlags : uint CRYPT_VERIFYCONTEXT = 0xF0000000 // CRYPT_VERIFYCONTEXT } - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptAcquireContext( out SafeProvHandle phProv, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs index 1af84f68a51a6b..22c8f6a14c51de 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptAcquireContext( out IntPtr psafeProvHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.cs index a57449a61c52ed..8657595513c219 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.cs @@ -15,7 +15,7 @@ internal enum CryptCreateHashFlags : int None = 0, } - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptCreateHash( SafeProvHandle hProv, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.cs index cfad767ce8c920..1178b4977aa34f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.cs @@ -14,7 +14,7 @@ internal enum CryptDecryptFlags : int CRYPT_DECRYPT_RSA_NO_PADDING_CHECK = 0x00000020 } - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptDecrypt( SafeCapiKeyHandle hKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDeriveKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDeriveKey.cs index b87c8bbd42de51..abac09ca0604be 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDeriveKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDeriveKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptDeriveKey( SafeProvHandle hProv, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs index a60d88cf6c34ce..57430f472e04a0 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptDestroyHash(IntPtr hHash); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs index b386d608bdc1ef..7a98e16663a126 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptDestroyKey(IntPtr hKey); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs index 2fdf298de2d616..fc35d9cde95c88 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptEncrypt( SafeCapiKeyHandle hKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs index e285fc55a65f6c..ffcc0b0e3a1ee6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptExportKey( SafeCapiKeyHandle hKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGenKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGenKey.cs index ad71af2ace869e..48494bdd7725cb 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGenKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGenKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptGenKey(SafeProvHandle hProv, int Algid, int dwFlags, out SafeCapiKeyHandle phKey); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs index bf893d2da3f0f3..5f1253cf487b9d 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs @@ -15,7 +15,7 @@ internal enum GetDefaultProviderFlags : int CRYPT_USER_DEFAULT = 0x00000002 } - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptGetDefaultProvider( int dwProvType, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetHashParam.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetHashParam.cs index c6df68e1b9f902..cbf469011ba49a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetHashParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetHashParam.cs @@ -18,7 +18,7 @@ internal enum CryptHashProperty : int HP_TLS1PRF_SEED = 0x0007, // seed for TLS1 PRF } - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptGetHashParam( SafeHashHandle hHash, @@ -27,7 +27,7 @@ public static partial bool CryptGetHashParam( ref int pdwDataLen, int dwFlags); - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptSetHashParam(SafeHashHandle hHash, CryptHashProperty dwParam, byte[] buffer, int dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs index 3b3bb0ad2d6146..58a360cbd6ff5e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs @@ -17,7 +17,7 @@ internal enum CryptGetKeyParamFlags : int KP_KEYLEN = 9 } - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptGetKeyParam( SafeCapiKeyHandle hKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs index 79607274689588..79743c8ef39267 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs @@ -22,7 +22,7 @@ internal enum CryptProvParam : int PP_UNIQUE_CONTAINER = 36 } - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptSetProvParam( SafeHandle safeProvHandle, @@ -30,7 +30,7 @@ public static partial bool CryptSetProvParam( IntPtr pbData, int dwFlags); - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptSetProvParam( SafeProvHandle hProv, @@ -38,7 +38,7 @@ public static partial bool CryptSetProvParam( ref IntPtr pbData, int dwFlags); - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptGetProvParam( SafeHandle safeProvHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetUserKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetUserKey.cs index 679f15503e460d..8a4da6805282f8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetUserKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetUserKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptGetUserKey(SafeProvHandle hProv, int dwKeySpec, out SafeCapiKeyHandle phUserKey); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptHashData.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptHashData.cs index e7696bc24cca34..4d120afcc53e97 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptHashData.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptHashData.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptHashData(SafeHashHandle hHash, byte[] pbData, int dwDataLen, int dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptImportKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptImportKey.cs index ee61cd293ac48f..468077f83118c8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptImportKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptImportKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptImportKey( SafeProvHandle hProv, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs index eb9934912677f1..fa8120c294ed4a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptReleaseContext( IntPtr hProv, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSetKeyParam.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSetKeyParam.cs index f43ab4cd5d5a8d..d48acdc9ffb5d9 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSetKeyParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSetKeyParam.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptSetKeyParam(SafeCapiKeyHandle hKey, int dwParam, byte[] pbData, int dwFlags); - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptSetKeyParam(SafeCapiKeyHandle safeKeyHandle, int dwParam, ref int pdw, int dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs index 44c61c950c76c1..13b166560be46e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs @@ -24,7 +24,7 @@ internal enum CryptSignAndVerifyHashFlags : int CRYPT_X931_FORMAT = 0x00000004, // Not supported } - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptSignHashW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptSignHashW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptSignHash( SafeHashHandle hHash, @@ -34,7 +34,7 @@ public static partial bool CryptSignHash( byte[]? pbSignature, ref int pdwSigLen); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptVerifySignatureW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptVerifySignatureW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptVerifySignature( SafeHashHandle hHash, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeleteService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeleteService.cs index b62fd35c8ea3f6..2f15a8743cb037 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeleteService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeleteService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool DeleteService(SafeServiceHandle serviceHandle); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs index 58d70532db67e6..fd5ca0c772c154 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DeregisterEventSource(IntPtr hEventLog); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs index 951d32dcf9010c..98fcb41bb170b9 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateTokenEx( SafeAccessTokenHandle hExistingToken, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs index 4cc73e651c3d09..5213692afe5454 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateTokenEx( SafeTokenHandle ExistingTokenHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs index 0d48bde3c28848..2afd209755907b 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs @@ -11,7 +11,7 @@ internal static partial class Advapi32 /// /// WARNING: This method does not implicitly handle long paths. Use EncryptFile. /// - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EncryptFilePrivate(string lpFileName); @@ -24,7 +24,7 @@ internal static bool EncryptFile(string path) /// /// WARNING: This method does not implicitly handle long paths. Use DecryptFile. /// - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool DecryptFileFilePrivate( string lpFileName, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs index b57eed7fd91eaa..d96c788e063969 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", SetLastError = true)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EnumDependentServices( SafeServiceHandle serviceHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs index a66e136b428b7d..132c775c3f0871 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EnumServicesStatusEx( SafeServiceHandle databaseHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs index b0d856c652cc0b..3f6834880e80d7 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32)] + [LibraryImport(Interop.Libraries.Advapi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool EqualDomainSid(IntPtr pSid1, IntPtr pSid2, [MarshalAs(UnmanagedType.Bool)] ref bool equal); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs index 49c246f7cf0538..f11d25de517505 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs index 96d26c13ecef0b..c1082005eed6c8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static unsafe partial uint EventRegister( in Guid providerId, EtwEnableCallback enableCallback, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs index aa171591254efb..b4461eec5e3087 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static unsafe partial int EventSetInformation( long registrationHandle, EVENT_INFO_CLASS informationClass, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs index f94e895d52db43..483cfe04b23238 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs @@ -45,7 +45,7 @@ internal struct TRACE_ENABLE_INFO public long MatchAllKeyword; } - [GeneratedDllImport(Interop.Libraries.Advapi32)] + [LibraryImport(Interop.Libraries.Advapi32)] internal static unsafe partial int EnumerateTraceGuidsEx( TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, void* InBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs index 9fa6b86d2fee67..946becc9dfb786 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial uint EventUnregister(long registrationHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs index 620cfee6e74fa9..cf80389e3997d8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial int EventWriteString( long registrationHandle, byte level, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs index 6b113733f9ddba..2c732dbeba32bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs @@ -36,7 +36,7 @@ internal static unsafe int EventWriteTransfer( return HResult; } - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")] private static unsafe partial int EventWriteTransfer_PInvoke( long registrationHandle, in EventDescriptor eventDescriptor, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs index 0f97e3842fa7a5..bcaf7293782695 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32)] + [LibraryImport(Interop.Libraries.Advapi32)] internal static partial int GetLengthSid(IntPtr sid); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs index 779a0fb9754a22..608030e847ae17 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool GetNumberOfEventLogRecords(SafeEventLogReadHandle hEventLog, out int NumberOfRecords); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs index 501889ce671520..8fcadbe3bb324a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool GetOldestEventLogRecord(SafeEventLogReadHandle hEventLog, out int OldestRecord); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs index d02e09c3a3a26c..cabd7fe19dea0f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial uint GetSecurityDescriptorLength(IntPtr byteArray); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs index 26c444e1415ff9..1f4b8cdea76cc5 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")] internal static unsafe partial uint GetSecurityInfoByHandle( SafeHandle handle, /*DWORD*/ uint objectType, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs index fa2a4b72073a5e..2898dbbf9f04c8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetSecurityInfoByName( string name, /*DWORD*/ uint objectType, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs index f14057ed6cee5f..e33d0bd550d93f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetServiceDisplayName(SafeServiceHandle? SCMHandle, string serviceName, char* displayName, ref int displayNameLength); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs index fbefdd14e6699d..e51364bd122ab4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetServiceKeyName(SafeServiceHandle? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs index a2843215f4de32..0ef69da601fc8d 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs @@ -19,13 +19,13 @@ internal struct SID_IDENTIFIER_AUTHORITY public byte b6; } - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial IntPtr GetSidIdentifierAuthority(IntPtr sid); - [GeneratedDllImport(Interop.Libraries.Advapi32)] + [LibraryImport(Interop.Libraries.Advapi32)] internal static partial IntPtr GetSidSubAuthority(IntPtr sid, int index); - [GeneratedDllImport(Interop.Libraries.Advapi32)] + [LibraryImport(Interop.Libraries.Advapi32)] internal static partial IntPtr GetSidSubAuthorityCount(IntPtr sid); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs index 3ca68ca01c5713..550b81d737c5f2 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetTokenInformation( IntPtr TokenHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs index ba76202482a801..b8b4133661e664 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetTokenInformation( SafeAccessTokenHandle TokenHandle, @@ -18,7 +18,7 @@ internal static partial bool GetTokenInformation( uint TokenInformationLength, out uint ReturnLength); - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetTokenInformation( IntPtr TokenHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_void.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_void.cs index 72490e9c169a8b..e04e831ebe6678 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_void.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_void.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetTokenInformation( SafeAccessTokenHandle TokenHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs index 48a23007d569d6..5d5bc2b1f78c23 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)] internal static partial int GetWindowsAccountDomainSid( byte[] sid, byte[] resultSid, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs index 32130b301643ce..a26ab17218758f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ImpersonateLoggedOnUser(SafeAccessTokenHandle userToken); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs index 808294866c7074..61b560fcdeb61c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] internal static partial int ImpersonateLoggedOnUser(IntPtr userToken); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateNamedPipeClient.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateNamedPipeClient.cs index 2aef33a6589db0..69177318f371a9 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateNamedPipeClient.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateNamedPipeClient.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ImpersonateNamedPipeClient(SafePipeHandle hNamedPipe); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs index 696e10e9bfc8a5..f7cfc286077896 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)] internal static partial int IsEqualDomainSid( byte[] sid1, byte[] sid2, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs index 398d65b16de624..cf99b269bb6acf 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsValidSid(IntPtr sid); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs index 74e8cd57da3e9c..04c1381f8f2be7 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)] internal static partial int IsWellKnownSid( byte[] sid, int type); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs index 11628880ef7544..f4ced42c9b6a8e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int LogonUser( string username, string? domain, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs index a77ec2aa3f7813..70d994664cd623 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool LookupAccountNameW( string? lpSystemName, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs index 8e932fc1d976e6..8e3b00921ffa7f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static unsafe partial int LookupAccountSid( string lpSystemName, byte[] Sid, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs index f8f2971338bb94..5c17e8ee7025ae 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool LookupPrivilegeValue( [MarshalAs(UnmanagedType.LPTStr)] string? lpSystemName, [MarshalAs(UnmanagedType.LPTStr)] string lpName, out LUID lpLuid); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs index c703eebb53ec4e..addce983f32c9f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial int LsaClose(IntPtr handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs index 5ba8f0302b5688..4a1d6b18fce207 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial int LsaFreeMemory(IntPtr handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs index d79900044c3ad9..50be738d918765 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint LsaLookupNames2( SafeLsaPolicyHandle handle, int flags, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs index 2ed2561cffa10d..ce84a734d480b1 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)] internal static partial uint LsaLookupSids( SafeLsaPolicyHandle handle, int count, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs index 2da367aababc35..fa32ea0886c417 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = false)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = false)] internal static partial uint LsaNtStatusToWinError(uint status); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs index 861d07ef36e3f5..994f78c50f85bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs @@ -27,7 +27,7 @@ internal enum PolicyRights POLICY_NOTIFICATION = 0x00001000, } - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)] private static partial uint LsaOpenPolicy( ref UNICODE_STRING SystemName, ref OBJECT_ATTRIBUTES ObjectAttributes, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs index d38ac1c15d363b..a2e87fcc0f365b 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial uint LsaQueryInformationPolicy( IntPtr policyHandle, int policyInformationClass, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs index 8068ad0f9ea4c8..c40173987bccf1 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool NotifyChangeEventLog(SafeEventLogReadHandle hEventLog, SafeWaitHandle hEvent); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs index b5e69c759bc40f..80fad581e1b36c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeEventLogReadHandle OpenEventLog(string lpUNCServerName, string lpSourceName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken.cs index 5f51453ac1f4f4..ab40e1193a4d45 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool OpenProcessToken(IntPtr ProcessHandle, int DesiredAccess, out SafeTokenHandle TokenHandle); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs index 7db51d0969f970..b4e7f4e87eb57c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool OpenProcessToken( IntPtr ProcessToken, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs index 7f54f0b2245a3c..e8dd8f556cf8de 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool OpenProcessToken( IntPtr ProcessToken, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs index 7dcb9b9f0b6d26..5aebbaf02101ff 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr OpenSCManager(string? machineName, string? databaseName, int access); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs index 027995f5ce9d43..4fac2d301d5d4c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr OpenService(SafeServiceHandle? databaseHandle, string serviceName, int access); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs index faafb6d94a17c4..2fd37e88408d93 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool OpenThreadToken( IntPtr ThreadHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs index e25dc2b61390e4..c5453466e598e1 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool OpenThreadToken( IntPtr ThreadHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs index bfe62f32ebccc4..9a461fd4e1163f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", SetLastError = true)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool QueryServiceConfig(SafeServiceHandle serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs index 1754b657682591..e9a4cf96bd96c4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool QueryServiceStatus(SafeServiceHandle serviceHandle, SERVICE_STATUS* pStatus); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs index de24de23a6bb14..5818fbc5cbf5f5 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs @@ -12,7 +12,7 @@ internal static partial class Advapi32 internal const int FORWARDS_READ = 0x4; internal const int BACKWARDS_READ = 0x8; - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool ReadEventLog( SafeEventLogReadHandle hEventLog, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs index 23bc17bad23ccf..cff472181723cb 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial int RegCloseKey(IntPtr hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs index e7c6a1818db8a6..82fa2302c8a5f4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs @@ -14,7 +14,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegConnectRegistry( string machineName, SafeRegistryHandle key, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs index edf3bc01fbef0a..9e5e420146e191 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs @@ -14,7 +14,7 @@ internal static partial class Advapi32 { // Note: RegCreateKeyEx won't set the last error on failure - it returns // an error code if it fails. - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegCreateKeyEx( SafeRegistryHandle hKey, string lpSubKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs index 8881398a0e1898..0fcd50c2490821 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegDeleteKeyEx( SafeRegistryHandle hKey, string lpSubKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs index 00ae18319d1d21..5d1367d57fe496 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegDeleteValue( SafeRegistryHandle hKey, string? lpValueName); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs index fbfa4afd630ac4..bb154ebf889cc1 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegEnumKeyEx( SafeRegistryHandle hKey, int dwIndex, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs index eb124caf1f7b34..2823ee33abff24 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs @@ -13,7 +13,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegEnumValue( SafeRegistryHandle hKey, int dwIndex, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs index ce43f1ac64031c..04ae6e5a284039 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial int RegFlushKey(SafeRegistryHandle hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs index 31df2772851a07..a0355598530e23 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs @@ -13,7 +13,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegOpenKeyEx( SafeRegistryHandle hKey, string? lpSubKey, @@ -21,7 +21,7 @@ internal static partial int RegOpenKeyEx( int samDesired, out SafeRegistryHandle hkResult); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegOpenKeyEx( IntPtr hKey, string? lpSubKey, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs index 18dd716f63bc83..d0a0eaf75a5aca 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs @@ -14,7 +14,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegQueryInfoKey( SafeRegistryHandle hKey, [Out] char[]? lpClass, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs index 71548822174e01..a0ba6244e7fcc6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs @@ -13,7 +13,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -22,7 +22,7 @@ internal static partial int RegQueryValueEx( byte[]? lpData, ref int lpcbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -31,7 +31,7 @@ internal static partial int RegQueryValueEx( ref int lpData, ref int lpcbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -40,7 +40,7 @@ internal static partial int RegQueryValueEx( ref long lpData, ref int lpcbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs index 031fbc02708cf4..315fd5c6f8a879 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegSetValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -21,7 +21,7 @@ internal static partial int RegSetValueEx( byte[]? lpData, int cbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegSetValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -30,7 +30,7 @@ internal static partial int RegSetValueEx( char[]? lpData, int cbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegSetValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -39,7 +39,7 @@ internal static partial int RegSetValueEx( ref int lpData, int cbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegSetValueEx( SafeRegistryHandle hKey, string? lpValueName, @@ -48,7 +48,7 @@ internal static partial int RegSetValueEx( ref long lpData, int cbData); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int RegSetValueEx( SafeRegistryHandle hKey, string? lpValueName, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs index e995568e9d53e7..e592e819d89847 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeEventLogWriteHandle RegisterEventSource(string lpUNCServerName, string lpSourceName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs index 7428a4a8e3ac9c..c079976e2e8f63 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs @@ -10,7 +10,7 @@ internal static partial class Advapi32 { public delegate int ServiceControlCallbackEx(int control, int eventType, IntPtr eventData, IntPtr eventContext); - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr RegisterServiceCtrlHandlerEx(string? serviceName, ServiceControlCallbackEx? callback, IntPtr userData); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs index 59da4648a49b0a..ee8ad9e93a5643 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool ReportEvent( SafeEventLogWriteHandle hEventLog, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs index e0ac537f1cecf5..f0a026147912e7 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool RevertToSelf(); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByHandle.cs index bfae62dbe5e953..8e6e8aca26aa1f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)] internal static partial uint SetSecurityInfoByHandle( SafeHandle handle, /*DWORD*/ uint objectType, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByName.cs index d7b84c123d26b9..95e9c17074790c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW", + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint SetSecurityInfoByName( string name, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs index 247c8134806e83..02fd6b829c989c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static unsafe partial bool SetServiceStatus(IntPtr serviceStatusHandle, SERVICE_STATUS* status); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs index a0de142ebdebb2..445e61e1d15ae8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + [LibraryImport(Libraries.Advapi32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetThreadToken( IntPtr ThreadHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs index c947f91ce80930..531cd2b42d0f30 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", SetLastError = true)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "StartServiceW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool StartService(SafeServiceHandle serviceHandle, int argNum, IntPtr argPtrs); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs index 010e875c849f8a..a81c21d02538b0 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", SetLastError = true)] + [LibraryImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool StartServiceCtrlDispatcher(IntPtr entry); } diff --git a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs index 40011ea0a4d161..ffba80e5fb1801 100644 --- a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Authz { - [GeneratedDllImport(Libraries.Authz, SetLastError = true)] + [LibraryImport(Libraries.Authz, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool AuthzGetInformationFromContext( IntPtr hAuthzClientContext, diff --git a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs index 414ddb50b6c27e..0a9d61a0fab618 100644 --- a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs @@ -12,7 +12,7 @@ internal static partial class Authz internal const int AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION = 0x2; internal const int AUTHZ_VALID_RM_INIT_FLAGS = (AUTHZ_RM_FLAG_NO_AUDIT | AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION); - [GeneratedDllImport(Interop.Libraries.Authz, SetLastError = true)] + [LibraryImport(Interop.Libraries.Authz, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool AuthzInitializeContextFromSid( int Flags, @@ -23,7 +23,7 @@ internal static partial bool AuthzInitializeContextFromSid( IntPtr DynamicGroupArgs, out IntPtr pAuthzClientContext); - [GeneratedDllImport(Interop.Libraries.Authz)] + [LibraryImport(Interop.Libraries.Authz)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool AuthzFreeContext(IntPtr AuthzClientContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs index 677363a528823d..f80ff3809831f8 100644 --- a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs +++ b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Authz { - [GeneratedDllImport(Libraries.Authz, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Authz, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool AuthzInitializeResourceManager( int flags, @@ -18,7 +18,7 @@ internal static partial bool AuthzInitializeResourceManager( string name, out IntPtr rm); - [GeneratedDllImport(Libraries.Authz)] + [LibraryImport(Libraries.Authz)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool AuthzFreeResourceManager(IntPtr rm); } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs index 407118d61b8ac0..a54507556dd932 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs @@ -121,13 +121,13 @@ internal static partial class Cng { internal static partial class Interop { - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] public static partial NTSTATUS BCryptOpenAlgorithmProvider(out SafeAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, int dwFlags); - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] public static partial NTSTATUS BCryptSetProperty(SafeAlgorithmHandle hObject, string pszProperty, string pbInput, int cbInput, int dwFlags); - [GeneratedDllImport(Libraries.BCrypt, EntryPoint = "BCryptSetProperty", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, EntryPoint = "BCryptSetProperty", StringMarshalling = StringMarshalling.Utf16)] private static partial NTSTATUS BCryptSetIntPropertyPrivate(SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int cbInput, int dwFlags); public static unsafe NTSTATUS BCryptSetIntProperty(SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int dwFlags) @@ -145,7 +145,7 @@ protected sealed override bool ReleaseHandle() return ntStatus == 0; } - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] private static partial uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); } @@ -177,7 +177,7 @@ protected sealed override bool ReleaseHandle() return ntStatus == 0; } - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] private static partial uint BCryptDestroyKey(IntPtr hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs index 8856ae73881b8d..be438c6831e9d0 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static partial NTSTATUS BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCreateHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCreateHash.cs index 06f0707207cbec..128d9ac99f2299 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCreateHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCreateHash.cs @@ -16,7 +16,7 @@ internal static NTSTATUS BCryptCreateHash(SafeBCryptAlgorithmHandle hAlgorithm, return BCryptCreateHash(hAlgorithm, out phHash, pbHashObject, cbHashObject, ref MemoryMarshal.GetReference(secret), cbSecret, dwFlags); } - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] private static partial NTSTATUS BCryptCreateHash(SafeBCryptAlgorithmHandle hAlgorithm, out SafeBCryptHashHandle phHash, IntPtr pbHashObject, int cbHashObject, ref byte pbSecret, int cbSecret, BCryptCreateHashFlags dwFlags); [Flags] diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDeriveKeyPBKDF2.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDeriveKeyPBKDF2.cs index ab67c0d7d3c6f0..ee4407fc8ef777 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDeriveKeyPBKDF2.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDeriveKeyPBKDF2.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial NTSTATUS BCryptDeriveKeyPBKDF2( SafeBCryptAlgorithmHandle hPrf, byte* pbPassword, diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs index 0ed212f3210302..b031af0ce10b86 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static partial NTSTATUS BCryptDestroyHash(IntPtr hHash); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs index a8d29882073415..ff6886a2ea365d 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static partial NTSTATUS BCryptDestroyKey(IntPtr hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.cs index 9658c179f29af0..e122e014236fa4 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.cs @@ -23,7 +23,7 @@ internal static SafeBCryptHashHandle BCryptDuplicateHash(SafeBCryptHashHandle hH return newHash; } - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] private static partial NTSTATUS BCryptDuplicateHash( SafeBCryptHashHandle hHash, out SafeBCryptHashHandle phNewHash, diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs index fa2080f5461c07..45d977995b11a5 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs @@ -53,10 +53,10 @@ internal static int BCryptDecrypt(SafeKeyHandle hKey, ReadOnlySpan input, } } - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] public static unsafe partial NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] public static unsafe partial NTSTATUS BCryptDecrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs index eace8eb2545710..6570c7a79b4eab 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial NTSTATUS BCryptExportKey(SafeBCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinishHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinishHash.cs index 935ed611bd19b0..51a646645202b0 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinishHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinishHash.cs @@ -12,7 +12,7 @@ internal static partial class BCrypt internal static NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, Span pbOutput, int cbOutput, int dwFlags) => BCryptFinishHash(hHash, ref MemoryMarshal.GetReference(pbOutput), cbOutput, dwFlags); - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] private static partial NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, ref byte pbOutput, int cbOutput, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs index e6ce2a9db53063..7470572fb0901e 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs @@ -10,7 +10,7 @@ internal static partial class BCrypt { internal const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002; - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static unsafe partial NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenerateSymmetricKey.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenerateSymmetricKey.cs index f2b00b2df87cd9..14b2a9fbe9a714 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenerateSymmetricKey.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenerateSymmetricKey.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey( SafeBCryptAlgorithmHandle hAlgorithm, out SafeBCryptKeyHandle phKey, @@ -19,7 +19,7 @@ internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey( int cbSecret, uint dwFlags); - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey( nuint hAlgorithm, out SafeBCryptKeyHandle phKey, diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGetProperty.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGetProperty.cs index 8dc018841da902..2e56b42e381af9 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGetProperty.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGetProperty.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial NTSTATUS BCryptGetProperty(SafeBCryptHandle hObject, string pszProperty, void* pbOutput, int cbOutput, out int pcbResult, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs index 4b69c44ba2a355..e1817ce280e3b7 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHashData.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHashData.cs index b8d8ba4c27c17b..ebbcebc6b11545 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHashData.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHashData.cs @@ -13,7 +13,7 @@ internal static partial class BCrypt internal static NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ReadOnlySpan pbInput, int cbInput, int dwFlags) => BCryptHashData(hHash, ref MemoryMarshal.GetReference(pbInput), cbInput, dwFlags); - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] private static partial NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ref byte pbInput, int cbInput, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptImportKey.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptImportKey.cs index 05dac933912e81..0cc2698d786bae 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptImportKey.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptImportKey.cs @@ -61,7 +61,7 @@ internal struct BCRYPT_KEY_DATA_BLOB_HEADER public const uint BCRYPT_KEY_DATA_BLOB_VERSION1 = 0x1; } - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial NTSTATUS BCryptImportKey(SafeAlgorithmHandle hAlgorithm, IntPtr hImportKey, string pszBlobType, out SafeKeyHandle hKey, IntPtr pbKeyObject, int cbKeyObject, byte* pbInput, int cbInput, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptKeyDerivation.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptKeyDerivation.cs index 0be079608da281..afa969a6b9d9dd 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptKeyDerivation.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptKeyDerivation.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] internal static unsafe partial NTSTATUS BCryptKeyDerivation( SafeBCryptKeyHandle hKey, BCryptBufferDesc* pParameterList, diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs index a898fb287bc990..8b73a51291854e 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial NTSTATUS BCryptOpenAlgorithmProvider(out SafeBCryptAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, BCryptOpenAlgorithmProviderFlags dwFlags); [Flags] diff --git a/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs b/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs index 92f3c08320ec92..5f6e8ab5428947 100644 --- a/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs +++ b/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs @@ -12,7 +12,7 @@ internal static partial class Credui internal const int CRED_MAX_USERNAME_LENGTH = 514; internal const int CRED_MAX_DOMAIN_TARGET_LENGTH = 338; - [GeneratedDllImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int CredUIParseUserName( string pszUserName, char* pszUser, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs index 8c8169c18ab0fe..479e43ab488a35 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs index 413ee46677f56f..5430d700b12e64 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs @@ -10,7 +10,7 @@ internal static partial class Crypt32 { internal const uint CERT_STORE_ADD_ALWAYS = 4; - [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, uint dwAddDisposition, SafeCertContextHandle ppStoreContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs index 35a9a97e039c94..2540e19f0d9e24 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs index bffe2b32412dc6..9172d733cf91d5 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertCloseStore(IntPtr hCertStore, uint dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs index d2c07547651a07..707088e5e90e4f 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs index c0bce7da0a425e..5812c362c65062 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG pConfig, out SafeChainEngineHandle hChainEngineHandle); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs index 4b96a878897fd9..cb4ea0c6c4a5dc 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static unsafe partial SafeCertContextHandle CertCreateCertificateContext( MsgEncodingType dwCertEncodingType, void* pbCertEncoded, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs index e4d3face51a203..c0c3a2277ba039 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop internal static partial class Crypt32 { // Note: CertDeleteCertificateFromStore always calls CertFreeCertificateContext on pCertContext, even if an error is encountered. - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertDeleteCertificateFromStore(CERT_CONTEXT* pCertContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs index 07d0ff7be8705f..f99441a7ef3e48 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial SafeX509ChainHandle CertDuplicateCertificateChain(IntPtr pChainContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs index 354aa3b71f889a..f0cbf8ba0bd250 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs index 7f30b7dfeacf91..65c8c552c9bae7 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeCertContextHandleWithKeyContainerDeletion CertDuplicateCertificateContextWithKeyContainerDeletion(IntPtr pCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs index 804d67115e5985..7ec515024661eb 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial IntPtr CertDuplicateCertificateContext(IntPtr pCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs index 847919d10a2de8..2e363a4a891cf7 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial SafeCertStoreHandle CertDuplicateStore(IntPtr hCertStore); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs index a362f7ecea673f..423dd3ec6b2002 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] public static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore( IntPtr hCertStore, CERT_CONTEXT* pPrevCertContext); diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs index e84ba3f3177544..5c4c40ddd1cb73 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)] internal static partial IntPtr CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, IntPtr pPrevCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs index 1170cef3c8dc66..e2898dbe64c5a3 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs index d65f23eeafb807..df22ee4bf7167e 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static unsafe partial SafeCertContextHandle CertFindCertificateInStore( SafeCertStoreHandle hCertStore, CertEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs index f84ced0d962f29..f3628b23ad72d9 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static unsafe partial CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, IntPtr rgExtensions); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs index 576a2bd602e58b..8e70ad5b9cae75 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial void CertFreeCertificateChain(IntPtr pChainContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs index 425dbe78c02908..9198c51f047c54 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32)] + [LibraryImport(Libraries.Crypt32)] internal static partial void CertFreeCertificateChainEngine(IntPtr hChainEngine); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs index 3899b9bc58cff6..603003f240f0aa 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class Crypt32 { // Note: This api always return TRUE, regardless of success. - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertFreeCertificateContext(IntPtr pCertContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs index d57ec7cbe2cec6..96c5d37927ec36 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertGetCertificateChain( IntPtr hChainEngine, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs index 72222c2594d74e..adb049f5e0bf1a 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertGetCertificateContextProperty( SafeCertContextHandle pCertContext, @@ -17,7 +17,7 @@ internal static partial bool CertGetCertificateContextProperty( byte[]? pvData, ref int pcbData); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertGetCertificateContextProperty( SafeCertContextHandle pCertContext, @@ -25,7 +25,7 @@ internal static partial bool CertGetCertificateContextProperty( out IntPtr pvData, ref int pcbData); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertGetCertificateContextProperty( SafeCertContextHandle pCertContext, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs index 8da8e0f1b6b253..f12ac77c73348d 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref uint pcbData); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs index 227a783094952d..28acc687e40b17 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertGetCertificateContextProperty( SafeCertContextHandle pCertContext, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs index 6c00075f1f0d59..fbc96a3ea1ac46 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs @@ -9,7 +9,7 @@ internal static partial class Crypt32 { // Note: It's somewhat unusual to use an API enum as a parameter type to a P/Invoke but in this case, X509KeyUsageFlags was intentionally designed as bit-wise // identical to the wincrypt CERT_*_USAGE values. - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertGetIntendedKeyUsage( CertEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs index e3973c419f8578..160332ddfe046d 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int CertGetNameString(SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, in CertNameStringType pvTypePara, char* pszNameString, int cchNameString); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs index e226085697547f..a1c6b8fd978315 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, ref CERT_PUBLIC_KEY_INFO pPublicKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs index f19926cf2ef09b..744dcae8d0be67 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertGetValidUsages(int cCerts, ref SafeCertContextHandle rghCerts, out int cNumOIDs, void* rghOIDs, ref int pcbOIDs); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs index d9cb7227ab38ee..2a448a7b24b506 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int CertNameToStr( int dwCertEncodingType, void* pName, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs index 0374c231d3cf95..810542a6cf1e9f 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs @@ -13,7 +13,7 @@ internal static partial class Crypt32 internal const uint X509_ASN_ENCODING = 0x00000001; internal const uint CERT_STORE_PROV_MEMORY = 2; - [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)] internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, uint dwMsgAndCertEncodingType, IntPtr hCryptProv, uint dwFlags, IntPtr pvPara); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs index 98bc90b473c648..a4b348f00b332b 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs index 328ab4527dc42c..f5462e116c69d0 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CertSaveStore( SafeCertStoreHandle hCertStore, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs index 3672044b303b59..d97573056ff6ff 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs index c8552f4d2d8ab7..4a0e3735451be6 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs index 7c2a2672ddd1ce..6d9b04d3f90c83 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs index c42c9d2e15c60b..35ceeaffe3b4ec 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs index 14b038a16fc2e1..21ac539091a887 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertStrToName(CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, byte[]? pbEncoded, ref int pcbEncoded, IntPtr ppszError); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs index d3cec8dfe6c2b0..b35548c1d520fc 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static unsafe partial int CertVerifyTimeValidity(ref FILETIME pTimeToVerify, CERT_INFO* pCertInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs index 54ed734d4aa3dc..3cf0ea12c709ae 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptAcquireCertificatePrivateKey( SafeCertContextHandle pCert, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs index 1164c98c233254..0b382cbbe0bc47 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool CryptAcquireCertificatePrivateKey( SafeCertContextHandle pCert, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs index fdade1e96468a7..5a62179d199793 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs @@ -13,7 +13,7 @@ internal static unsafe bool CryptDecodeObject(CryptDecodeObjectStructType lpszSt return CryptDecodeObject(MsgEncodingType.All, (IntPtr)lpszStructType, pbEncoded, cbEncoded, 0, pvStructInfo, ref pcbStructInfo); } - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool CryptDecodeObject( MsgEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs index df1dd34ab2003b..ad3b2cd926e7ae 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptDecodeObjectPointer( CertEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs index 00b69c8ba6776d..658d22c8680825 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptDecodeObjectPointer( CertEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs index b8489a8801b293..7ac987f08d072f 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptDecodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs index 336675e110a5c6..9d346a3c8291ab 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs @@ -13,7 +13,7 @@ internal static unsafe bool CryptEncodeObject(MsgEncodingType dwCertEncodingType return CryptEncodeObject(dwCertEncodingType, (nint)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded); } - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool CryptEncodeObject( MsgEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs index 0c05b6b63c69e0..2d0e9b1b1a3bab 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptFormatObject.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptFormatObject.cs index 6590ac6f5c2b2c..ae5f4e792fde69 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptFormatObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptFormatObject.cs @@ -12,7 +12,7 @@ internal static partial class Crypt32 internal const int CRYPT_FORMAT_STR_MULTI_LINE = 0x00000001; internal const int CRYPT_FORMAT_STR_NO_HEX = 0x00000010; - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptFormatObject( int dwCertEncodingType, // only valid value is X509_ASN_ENCODING diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs index 2901218453f4d8..e2957864f0e570 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptHashPublicKeyInfo( IntPtr hCryptProv, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs index dccb2dcc4fd8cd..0cf1d7e3c34e8a 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptImportPublicKeyInfoEx2( CertEncodingType dwCertEncodingType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs index 2ca3b04b17287f..d89d849c97c53d 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgClose(IntPtr hCryptMsg); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs index a07bdc3c5e2185..0d98c737856584 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgControl( SafeCryptMsgHandle hCryptMsg, @@ -16,7 +16,7 @@ internal static partial bool CryptMsgControl( MsgControlType dwCtrlType, ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgControl( SafeCryptMsgHandle hCryptMsg, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs index e4b5c963334457..4b319dfe970256 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, @@ -18,7 +18,7 @@ internal static partial bool CryptMsgGetParam( out int pvData, ref int pcbData); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, @@ -27,7 +27,7 @@ internal static unsafe partial bool CryptMsgGetParam( byte* pvData, ref int pcbData); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, @@ -36,7 +36,7 @@ internal static partial bool CryptMsgGetParam( out CryptMsgType pvData, ref int pcbData); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs index 35461f94a4c271..02676c31f394f2 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial SafeCryptMsgHandle CryptMsgOpenToDecode( MsgEncodingType dwMsgEncodingType, int dwFlags, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs index d7b6f16963b911..243f2f76368562 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static unsafe partial SafeCryptMsgHandle CryptMsgOpenToEncode( MsgEncodingType dwMsgEncodingType, int dwFlags, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs index 5c9021d237675e..503789f12c6727 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs @@ -9,15 +9,15 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, byte[] pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, IntPtr pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, ref byte pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs index 891b3918e0766a..1b68c739e5057b 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Crypt32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptProtectData( in DATA_BLOB pDataIn, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs index cb2b731a44a4fb..fb01327530a1d5 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs @@ -10,11 +10,11 @@ internal static partial class Crypt32 internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16; internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0; - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject.cs index a9deafc6b88466..f7cf15985b686b 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptQueryObject( CertQueryObjectType dwObjectType, @@ -25,7 +25,7 @@ internal static unsafe partial bool CryptQueryObject( out SafeCertContextHandle ppvContext ); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptQueryObject( CertQueryObjectType dwObjectType, @@ -41,7 +41,7 @@ internal static unsafe partial bool CryptQueryObject( IntPtr ppvContext ); - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptQueryObject( CertQueryObjectType dwObjectType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject_IntPtr_out.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject_IntPtr_out.cs index 773ea2edc312d1..ae36988d047c6b 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject_IntPtr_out.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject_IntPtr_out.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CryptQueryObject( CertQueryObjectType dwObjectType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs index e4f2ba8564b8bb..3d13416507ff79 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptUnprotectData( in DATA_BLOB pDataIn, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs index 761a68fbf8fda9..8733d4190875e1 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs @@ -124,7 +124,7 @@ private static bool OidGroupWillNotUseActiveDirectory(OidGroup group) group == OidGroup.KeyDerivationFunction; } - [GeneratedDllImport(Interop.Libraries.Crypt32)] + [LibraryImport(Interop.Libraries.Crypt32)] private static partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, IntPtr pvKey, OidGroup group); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs index ec136c7c041ce0..4d5110c158487b 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs @@ -12,7 +12,7 @@ internal static partial class Crypt32 /// /// Version used for a buffer containing a scalar integer (not an IntPtr) /// - [GeneratedDllImport(Libraries.Crypt32)] + [LibraryImport(Libraries.Crypt32)] private static unsafe partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, int* pvKey, OidGroup group); public static CRYPT_OID_INFO FindAlgIdOidInfo(Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM algId) diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs index d41daaa1e479a1..74862a7d458ae9 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PFXExportCertStore(SafeCertStoreHandle hStore, ref DATA_BLOB pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs index 0cd88774a7d1e7..7df9fb7e1474f0 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Libraries.Crypt32, SetLastError = true)] internal static partial SafeCertStoreHandle PFXImportCertStore(ref DATA_BLOB pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs index 80fcc4bac2a76d..ef4b92bc1547f1 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs @@ -10,11 +10,11 @@ internal static partial class Interop { internal static partial class Crypt32 { - [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertFreeCertificateContext(IntPtr pCertContext); - [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertVerifyCertificateChainPolicy( IntPtr pszPolicyOID, diff --git a/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs b/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs index e655c2c593a6b6..4bdd0880f52486 100644 --- a/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs +++ b/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs @@ -210,12 +210,12 @@ public CRYPTUI_SELECTCERTIFICATE_STRUCTW ToManaged() #endif } - [GeneratedDllImport(Interop.Libraries.CryptUI, SetLastError = true)] + [LibraryImport(Interop.Libraries.CryptUI, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CryptUIDlgViewCertificateW( in CRYPTUI_VIEWCERTIFICATE_STRUCTW ViewInfo, IntPtr pfPropertiesChanged); - [GeneratedDllImport(Interop.Libraries.CryptUI, SetLastError = true)] + [LibraryImport(Interop.Libraries.CryptUI, SetLastError = true)] internal static partial SafeCertContextHandle CryptUIDlgSelectCertificateW(ref CRYPTUI_SELECTCERTIFICATE_STRUCTW csc); } } diff --git a/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs index 45c8e537e66af7..1954a5e50a54e0 100644 --- a/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs +++ b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Dsrole { - [GeneratedDllImport(Libraries.Dsrole)] + [LibraryImport(Libraries.Dsrole)] public static partial int DsRoleFreeMemory(IntPtr buffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs index 2853d27fc60b9b..211939d207da34 100644 --- a/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs @@ -16,7 +16,7 @@ internal enum DSROLE_PRIMARY_DOMAIN_INFO_LEVEL DsRolePrimaryDomainInfoBasicEx = 4 } - [GeneratedDllImport(Libraries.Dsrole, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Dsrole, StringMarshalling = StringMarshalling.Utf16)] internal static partial int DsRoleGetPrimaryDomainInformation( [MarshalAs(UnmanagedType.LPTStr)] string lpServer, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs index 6ead12e254100c..fb62fb82f72732 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] public static partial int BitBlt(IntPtr hdc, int x, int y, int cx, int cy, IntPtr hdcSrc, int x1, int y1, RasterOp rop); diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs index 1f253821e28f46..4573cfc54de8d0 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs @@ -16,7 +16,7 @@ public enum CombineMode : int RGN_DIFF = 4, } - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] public static partial RegionType CombineRgn(IntPtr hrgnDst, IntPtr hrgnSrc1, IntPtr hrgnSrc2, CombineMode iMode); public static RegionType CombineRgn(HandleRef hrgnDst, HandleRef hrgnSrc1, HandleRef hrgnSrc2, CombineMode iMode) diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs index 11107c5a197b15..3066c33fdf2d41 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial IntPtr CreateCompatibleDC(IntPtr hdc); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs index 768bb63afae504..14744639543163 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr CreateDCW(string pwszDriver, string pwszDevice, string? pszPort, IntPtr pdm); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs index 8536e7c745de5c..2a4b9b7c774120 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial IntPtr CreateFontIndirectW(ref User32.LOGFONT lplf); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs index 5a910510e46302..afbc6ba4409154 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr CreateICW(string pszDriver, string pszDevice, string? pszPort, IntPtr pdm); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs index f54cf7eecd37fe..edf59c56dec6c7 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial IntPtr CreateRectRgn(int x1, int y1, int x2, int y2); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs index cb1057e91f6719..98c0a13552109d 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool DeleteDC(IntPtr hdc); diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs index dec5e677243a12..db9776eae94333 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool DeleteObject(IntPtr ho); diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs index 8d5d4dd19b2338..fc309ed51ee3c3 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial int GetClipRgn(IntPtr hdc, IntPtr hrgn); public static int GetClipRgn(HandleRef hdc, IntPtr hrgn) diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs index 036cefd3bf2970..4ca4eba089ca0b 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial IntPtr GetCurrentObject(IntPtr hdc, ObjectType type); public static IntPtr GetCurrentObject(HandleRef hdc, ObjectType type) diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs index 55cec2b89d0f28..e45e30bee2138d 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs @@ -30,7 +30,7 @@ public static class DeviceTechnology public const int DT_RASPRINTER = 2; } - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial int GetDeviceCaps(IntPtr hdc, DeviceCapability index); public static int GetDeviceCaps(HandleRef hdc, DeviceCapability index) diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs index 5355c10e67bf65..1517e07d7253c5 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial ObjectType GetObjectType(IntPtr h); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs index 30e68bbe212809..58d4d9af1ab598 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial RegionType GetRgnBox(IntPtr hrgn, ref RECT lprc); public static RegionType GetRgnBox(HandleRef hrgn, ref RECT lprc) diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs index a17c3de2ae3412..1c3f5c64dd38f9 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs @@ -13,7 +13,7 @@ public enum StockObject : int DEFAULT_GUI_FONT = 17 } - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial IntPtr GetStockObject(StockObject i); } } diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs index 2750cfe199b082..aae92ce24ebcdd 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool OffsetViewportOrgEx(IntPtr hdc, int x, int y, ref Point lppt); diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs index b0e34b5ca0039c..ac9d431ae7632d 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool RestoreDC(IntPtr hdc, int nSavedDC); diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs index 52aa47a6ca375e..31accb0e1ecd0f 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] public static partial int SaveDC(IntPtr hdc); public static int SaveDC(HandleRef hdc) diff --git a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs index 7aa96a8a0ae731..d528fb8fecc153 100644 --- a/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs +++ b/src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Gdi32 { - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] public static partial RegionType SelectClipRgn(IntPtr hdc, IntPtr hrgn); public static RegionType SelectClipRgn(HandleRef hdc, HandleRef hrgn) diff --git a/src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs b/src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs index 7822f894dcd1d9..4cb72b927cc47d 100644 --- a/src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs +++ b/src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs @@ -455,53 +455,53 @@ internal struct HTTP_BINDING_INFO } - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static partial uint HttpInitialize(HTTPAPI_VERSION version, uint flags, IntPtr pReserved); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static partial uint HttpSetUrlGroupProperty(ulong urlGroupId, HTTP_SERVER_PROPERTY serverProperty, IntPtr pPropertyInfo, uint propertyInfoLength); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpCreateServerSession(HTTPAPI_VERSION version, ulong* serverSessionId, uint reserved); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpCreateUrlGroup(ulong serverSessionId, ulong* urlGroupId, uint reserved); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static partial uint HttpCloseUrlGroup(ulong urlGroupId); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial uint HttpCreateRequestQueue(HTTPAPI_VERSION version, string pName, Interop.Kernel32.SECURITY_ATTRIBUTES* pSecurityAttributes, uint flags, out HttpRequestQueueV2Handle pReqQueueHandle); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint HttpAddUrlToUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, ulong context, uint pReserved); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint HttpRemoveUrlFromUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, uint flags); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpReceiveHttpRequest(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_REQUEST* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, NativeOverlapped* pOverlapped); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpSendHttpResponse(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_RESPONSE* pHttpResponse, void* pCachePolicy, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpWaitForDisconnect(SafeHandle requestQueueHandle, ulong connectionId, NativeOverlapped* pOverlapped); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpReceiveRequestEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, void* pEntityBuffer, uint entityBufferLength, out uint bytesReturned, NativeOverlapped* pOverlapped); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpSendResponseEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static partial uint HttpCloseRequestQueue(IntPtr pReqQueueHandle); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static partial uint HttpCancelHttpRequest(SafeHandle requestQueueHandle, ulong requestId, IntPtr pOverlapped); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static partial uint HttpCloseServerSession(ulong serverSessionId); internal sealed class SafeLocalFreeChannelBinding : ChannelBinding @@ -530,10 +530,10 @@ protected override bool ReleaseHandle() } } - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped); - [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)] + [LibraryImport(Libraries.HttpApi, SetLastError = true)] internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, byte* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped); internal static readonly string?[] HttpVerbs = new string?[] diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs index 992702b89999b5..d5244a56a746b5 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class IpHlpApi { - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetNetworkParams(IntPtr pFixedInfo, uint* pOutBufLen); } } diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs index 38d66f931b03cf..1a56dd11dd0d84 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs @@ -89,21 +89,21 @@ protected override bool ReleaseHandle() } } - [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] + [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)] internal static partial SafeCloseIcmpHandle IcmpCreateFile(); - [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] + [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)] internal static partial SafeCloseIcmpHandle Icmp6CreateFile(); - [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] + [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IcmpCloseHandle(IntPtr handle); - [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] + [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)] internal static partial uint IcmpSendEcho2(SafeCloseIcmpHandle icmpHandle, SafeWaitHandle Event, IntPtr apcRoutine, IntPtr apcContext, uint ipAddress, SafeLocalAllocHandle data, ushort dataSize, ref IPOptions options, SafeLocalAllocHandle replyBuffer, uint replySize, uint timeout); - [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] + [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)] internal static partial uint Icmp6SendEcho2(SafeCloseIcmpHandle icmpHandle, SafeWaitHandle Event, IntPtr apcRoutine, IntPtr apcContext, byte[] sourceSocketAddress, byte[] destSocketAddress, SafeLocalAllocHandle data, ushort dataSize, ref IPOptions options, SafeLocalAllocHandle replyBuffer, uint replySize, uint timeout); } diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs index 483653c69dc5b9..11b32ab4ef4bb9 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs @@ -501,7 +501,7 @@ internal unsafe struct MibUdp6RowOwnerPid internal ReadOnlySpan localAddrAsSpan => MemoryMarshal.CreateSpan(ref localAddr[0], 16); } - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetAdaptersAddresses( AddressFamily family, uint flags, @@ -509,51 +509,51 @@ internal static unsafe partial uint GetAdaptersAddresses( IntPtr adapterAddresses, uint* outBufLen); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetBestInterfaceEx(byte* ipAddress, int* index); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static partial uint GetIfEntry2(ref MibIfRow2 pIfRow); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetIpStatisticsEx(MibIpStats* statistics, AddressFamily family); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetTcpStatisticsEx(MibTcpStats* statistics, AddressFamily family); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetUdpStatisticsEx(MibUdpStats* statistics, AddressFamily family); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetIcmpStatistics(MibIcmpInfo* statistics); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static partial uint GetIcmpStatisticsEx(out MibIcmpInfoEx statistics, AddressFamily family); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetExtendedTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order, uint IPVersion, TcpTableClass tableClass, uint reserved); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetExtendedUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order, uint IPVersion, UdpTableClass tableClass, uint reserved); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetPerAdapterInfo(uint IfIndex, IntPtr pPerAdapterInfo, uint* pOutBufLen); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static partial void FreeMibTable(IntPtr handle); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static partial uint CancelMibChangeNotify2(IntPtr notificationHandle); - [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + [LibraryImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint NotifyStableUnicastIpAddressTable( AddressFamily addressFamily, out SafeFreeMibTable table, diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs index 856a1c56a9b2e1..c17641eab29f85 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class IpHlpApi { - [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] + [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)] internal static partial uint if_nametoindex([MarshalAs(UnmanagedType.LPStr)] string name); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.cs index bf140ef27caa3e..cf6f3e17b3ec48 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool Beep(int frequency, int duration); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CancelIoEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CancelIoEx.cs index 244996291585d5..c86c24ce507049 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CancelIoEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CancelIoEx.cs @@ -9,11 +9,11 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CancelIoEx(IntPtr handle, NativeOverlapped* lpOverlapped); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CheckTokenMembershipEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CheckTokenMembershipEx.cs index dad6a63281115f..b2588e2cba5353 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CheckTokenMembershipEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CheckTokenMembershipEx.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 { internal const uint CTMF_INCLUDE_APPCONTAINER = 0x00000001; - [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)] internal static partial bool CheckTokenMembershipEx(SafeAccessTokenHandle TokenHandle, byte[] SidToCheck, uint Flags, ref bool IsMember); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs index 2061f5075c5d54..b5b597bf0dc103 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ClearCommBreak( SafeFileHandle hFile); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs index 0004b68b42a24c..3a17ea9b96d86f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs @@ -9,14 +9,14 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ClearCommError( SafeFileHandle hFile, ref int lpErrors, ref COMSTAT lpStat); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ClearCommError( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs index eabe864179bd92..165ba343a9d0e5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CloseHandle(IntPtr handle); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs index d187b9ef51cd4a..745ac11b5fb387 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs @@ -9,18 +9,18 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial IntPtr CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, int NumberOfConcurrentThreads); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PostQueuedCompletionStatus(IntPtr CompletionPort, uint dwNumberOfBytesTransferred, UIntPtr CompletionKey, IntPtr lpOverlapped); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetQueuedCompletionStatus(IntPtr CompletionPort, out uint lpNumberOfBytesTransferred, out UIntPtr CompletionKey, out IntPtr lpOverlapped, int dwMilliseconds); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetQueuedCompletionStatusEx( IntPtr CompletionPort, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs index f614013a5377bd..22d3213f22df8c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs @@ -14,13 +14,13 @@ internal struct CONDITION_VARIABLE private IntPtr Ptr; } - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void InitializeConditionVariable(CONDITION_VARIABLE* ConditionVariable); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void WakeConditionVariable(CONDITION_VARIABLE* ConditionVariable); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SleepConditionVariableCS(CONDITION_VARIABLE* ConditionVariable, CRITICAL_SECTION* CriticalSection, int dwMilliseconds); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConnectNamedPipe.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConnectNamedPipe.cs index 1838d726f86bf3..77eabe4950325e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConnectNamedPipe.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConnectNamedPipe.cs @@ -10,11 +10,11 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool ConnectNamedPipe(SafePipeHandle handle, NativeOverlapped* overlapped); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ConnectNamedPipe(SafePipeHandle handle, IntPtr overlapped); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConsoleCursorInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConsoleCursorInfo.cs index c287ba762b2b82..2068b056c98a6b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConsoleCursorInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConsoleCursorInfo.cs @@ -15,11 +15,11 @@ internal struct CONSOLE_CURSOR_INFO internal BOOL bVisible; } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetConsoleCursorInfo(IntPtr hConsoleOutput, out CONSOLE_CURSOR_INFO cci); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleCursorInfo(IntPtr hConsoleOutput, ref CONSOLE_CURSOR_INFO cci); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs index c15eef8ebaf9b6..7760fd8e306acb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CopyFileEx. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CopyFileExPrivate( string src, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs index 14bfbb5c76d938..c679fbbb023dbd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CreateDirectory. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CreateDirectoryPrivate( string path, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs index b598f2e3d3ffe8..cf75397a856982 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CreateFile. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial SafeFileHandle CreateFilePrivate( string lpFileName, int dwDesiredAccess, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs index 8a4cebbbf5952e..e2114679bf3d11 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeMemoryMappedFileHandle CreateFileMapping( SafeFileHandle hFile, ref SECURITY_ATTRIBUTES lpFileMappingAttributes, @@ -19,7 +19,7 @@ internal static partial SafeMemoryMappedFileHandle CreateFileMapping( int dwMaximumSizeLow, string? lpName); - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeMemoryMappedFileHandle CreateFileMapping( IntPtr hFile, ref SECURITY_ATTRIBUTES lpFileMappingAttributes, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs index 37ae80b99ec4d1..3a7d5e0f35208e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CreateFile. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial IntPtr CreateFilePrivate_IntPtr( string lpFileName, int dwDesiredAccess, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipe.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipe.cs index 0e67ae596761f9..761921953664cc 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipe.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipe.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafePipeHandle CreateNamedPipe( string pipeName, int openMode, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs index baca7eae8512d6..00cefe210f3178 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafePipeHandle CreateNamedPipeClient( string? lpFileName, int dwDesiredAccess, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafeFileHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafeFileHandle.cs index 2d0592896df368..d09b9a09d3ccc6 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafeFileHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafeFileHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CreatePipe(out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafePipeHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafePipeHandle.cs index 07f5f638d31704..97ee5e67f77d70 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafePipeHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafePipeHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CreatePipe(out SafePipeHandle hReadPipe, out SafePipeHandle hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs index d5bab344cfbbae..c804e06091df26 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateProcessW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateProcessW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CreateProcess( string? lpApplicationName, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs index 1cdcd169f23f85..b6d79e4bdb44ac 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs @@ -20,7 +20,7 @@ internal static partial class Kernel32 /// internal const int SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE = 0x2; - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool CreateSymbolicLinkPrivate(string lpSymlinkFileName, string lpTargetFileName, int dwFlags); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs index 777b8b2fdd49c6..1e4c296eeb55b9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs @@ -37,16 +37,16 @@ internal unsafe struct PROCESSENTRY32 } // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID); // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32first - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "Process32FirstW", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "Process32FirstW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool Process32First(IntPtr hSnapshot, ref PROCESSENTRY32 lppe); // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32next - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "Process32NextW", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "Process32NextW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool Process32Next(IntPtr hSnapshot, ref PROCESSENTRY32 lppe); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs index 729eb0af7f7db4..bd68847dc59475 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs @@ -19,16 +19,16 @@ internal struct CRITICAL_SECTION private UIntPtr SpinCount; } - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs index 8e455ee9d2f896..2713030dc075a9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use DeleteFile. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool DeleteFilePrivate(string path); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs index e1b97f280ae135..e62fed5d5bc6f9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use DeleteVolumeMountPoint. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DeleteVolumeMountPointPrivate(string mountPoint); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs index 21e1b2be8201eb..1d202087e5de07 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 // https://docs.microsoft.com/windows/win32/api/winioctl/ni-winioctl-fsctl_get_reparse_point internal const int FSCTL_GET_REPARSE_POINT = 0x000900a8; - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DeviceIoControl( SafeHandle hDevice, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DisconnectNamedPipe.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DisconnectNamedPipe.cs index c0d137618c1e7d..0c3d3d535524bd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DisconnectNamedPipe.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DisconnectNamedPipe.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DisconnectNamedPipe(SafePipeHandle hNamedPipe); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs index 20b52d93702f72..b23d9a394b0b7e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateHandle( IntPtr hSourceProcessHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeFileHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeFileHandle.cs index b084c410da8554..b2d2e1643f1a18 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeFileHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeFileHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateHandle( IntPtr hSourceProcessHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafePipeHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafePipeHandle.cs index c33fa95b97d0e9..edcaf54cb2d0f8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafePipeHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafePipeHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateHandle( IntPtr hSourceProcessHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs index 9793f50dca844d..4c600111a6cb0d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateHandle( IntPtr hSourceProcessHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DynamicLoad.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DynamicLoad.cs index 538e5bc43df5ea..e6ce9d5730437f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DynamicLoad.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DynamicLoad.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static unsafe partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr GetProcAddress(IntPtr hModule, byte* lpProcName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcessModules.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcessModules.cs index 486ddb953b731f..7a23e7f89e9979 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcessModules.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcessModules.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32EnumProcessModules", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "K32EnumProcessModules", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EnumProcessModules(SafeProcessHandle handle, IntPtr[]? modules, int size, out int needed); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcesses.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcesses.cs index 0a67cb1dfc3f63..ce0c3f09b3be01 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcesses.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcesses.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32EnumProcesses", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "K32EnumProcesses", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EnumProcesses(int[] processIds, int size, out int needed); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs index 3e6fa6d792e193..881d5f320e896c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs @@ -16,7 +16,7 @@ internal static class CommFunctions internal const int CLRDTR = 6; } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EscapeCommFunction( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs index effacb06ab8135..f265ff1022f08f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs @@ -12,18 +12,18 @@ internal static partial class Kernel32 internal const uint CREATE_EVENT_INITIAL_SET = 0x2; internal const uint CREATE_EVENT_MANUAL_RESET = 0x1; - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetEvent(SafeWaitHandle handle); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ResetEvent(SafeWaitHandle handle); - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess); - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeWaitHandle OpenEvent(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.cs index ff363379595b3c..c7aa1202973ce8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.cs @@ -11,7 +11,7 @@ internal static partial class Interop internal static unsafe partial class Kernel32 { [DoesNotReturn] - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExitProcess")] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ExitProcess")] internal static partial void ExitProcess(int exitCode); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs index 8f8ea391abaf63..20b90d29523373 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs index 42afb969b0ef1a..3ca00bde57bded 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFileScatter( SafeHandle hFile, long* aSegmentArray, @@ -17,7 +17,7 @@ internal static unsafe partial int ReadFileScatter( IntPtr lpReserved, NativeOverlapped* lpOverlapped); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFileGather( SafeHandle hFile, long* aSegmentArray, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs index adab75ec1081f5..0eac8ca5cff91f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static unsafe partial Interop.BOOL FileTimeToSystemTime(ulong* lpFileTime, Interop.Kernel32.SYSTEMTIME* lpSystemTime); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputAttribute.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputAttribute.cs index 48a247ae5c9ea9..b2cba0e19da73e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputAttribute.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputAttribute.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FillConsoleOutputAttribute(IntPtr hConsoleOutput, short wColorAttribute, int numCells, COORD startCoord, out int pNumBytesWritten); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputCharacter.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputCharacter.cs index 11fe930c316dc1..13ec8f6160c3e7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputCharacter.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputCharacter.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FillConsoleOutputCharacterW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "FillConsoleOutputCharacterW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FillConsoleOutputCharacter(IntPtr hConsoleOutput, char character, int nLength, COORD dwWriteCoord, out int pNumCharsWritten); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs index f35fbcc813a491..d2ba6f94e47d4b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FindClose(IntPtr hFindFile); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs index aad022d6f81c38..0095c09cdac3a4 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use FindFirstFile. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static partial SafeFindHandle FindFirstFileExPrivate(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, ref WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags); internal static SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data) diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs index 748de48c53bf33..131384fbad9b17 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindNextFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "FindNextFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FindNextFile(SafeFindHandle hndFindFile, ref WIN32_FIND_DATA lpFindFileData); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs index 689e44321e72ee..0f1edcea359f88 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FlushFileBuffers(SafeHandle hHandle); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushViewOfFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushViewOfFile.cs index 0fa730cad06990..fb492377e6bf13 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushViewOfFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushViewOfFile.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FlushViewOfFile(IntPtr lpBaseAddress, UIntPtr dwNumberOfBytesToFlush); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage.cs index a3340f184f6725..f07214f95d0e49 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 private const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100; private const int ERROR_INSUFFICIENT_BUFFER = 0x7A; - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)] private static unsafe partial int FormatMessage( int dwFlags, IntPtr lpSource, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs index 6c14dad882537d..cc01c8b461b957 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 public const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; public const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial int FormatMessage( int dwFlags, SafeLibraryHandle lpSource, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs index 52fd6194572673..dbc151d2b07a34 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs index dabec6e8f0a648..d55825a6f2f973 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FreeLibrary(IntPtr hModule); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs index 0b5f3cc0703296..7f4558d05ac7f1 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs @@ -16,7 +16,7 @@ internal unsafe struct CPINFO internal fixed byte LeadByte[12 /* MAX_LEADBYTES */]; } - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial Interop.BOOL GetCPInfo(uint codePage, CPINFO* lpCpInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs index e47bb8ab5276a3..76ca4c50c96bbb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial Interop.BOOL GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs index 0552a7a52c86a7..e55bd089169a76 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs @@ -15,7 +15,7 @@ internal static class CommModemState internal const int MS_RLSD_ON = 0x80; } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetCommModemStatus( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs index c19e80f0811306..3d17ae7cd3c8e3 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetCommProperties( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs index 6714e546fce884..1d85a6e7e9f186 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetCommState( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs index fe441839e0be6a..7180888278cf0c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW")] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW")] private static unsafe partial int GetComputerName(char* lpBuffer, uint* nSize); // maximum length of the NETBIOS name (not including NULL) diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs index 33e73f8042b77b..c5348154ccca19 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint GetConsoleCP(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs index b2d211e9390b44..1b2ee78b33ae6a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetConsoleMode(IntPtr handle, out int mode); @@ -17,7 +17,7 @@ internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle) return GetConsoleMode(handle, out _); } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleMode(IntPtr handle, int mode); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs index 3d8c546dce5c18..ba9bafe115fccd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint GetConsoleOutputCP(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleScreenBufferInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleScreenBufferInfo.cs index cbee47a7dc513a..1cb27e4c53fbf5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleScreenBufferInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleScreenBufferInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetConsoleScreenBufferInfo(IntPtr hConsoleOutput, out CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.cs index 955d4973436ad2..656896177d488a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial uint GetConsoleTitleW(char* title, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs index 48608469dbc955..98f484f616748d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs index 89f04ad9ff0806..efa5c564f0d06b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr GetCurrentProcess(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs index be0fd40730358e..bc2b3e81cc70a5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint GetCurrentProcessId(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumber.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumber.cs index 13865d75fe3a37..a726b9704d948c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumber.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumber.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint GetCurrentProcessorNumber(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs index 73d33398d5a0fb..75aea621e7404a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Interop.Libraries.Kernel32)] + [LibraryImport(Interop.Libraries.Kernel32)] internal static partial IntPtr GetCurrentThread(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs index 10b761fb5c54e1..773fd3d386321a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] public static partial int GetCurrentThreadId(); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDiskFreeSpaceEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDiskFreeSpaceEx.cs index cf86b13e035004..d06b21cc95f147 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDiskFreeSpaceEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDiskFreeSpaceEx.cs @@ -9,7 +9,7 @@ internal static partial class Kernel32 { // NOTE: The out parameters are PULARGE_INTEGERs and may require // some byte munging magic. - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetDiskFreeSpaceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetDiskFreeSpaceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetDiskFreeSpaceEx(string drive, out long freeBytesForUser, out long totalBytes, out long freeBytes); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDriveType.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDriveType.cs index 641be553029e86..6efddcd6f65bdb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDriveType.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDriveType.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetDriveTypeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetDriveTypeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetDriveType(string drive); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs index ec02db69f327f9..d92e85ab6773d5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial char* GetEnvironmentStringsW(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs index e3691f6c6dc5c3..ac805034e1d5e7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetEnvironmentVariable(string lpName, ref char lpBuffer, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetExitCodeProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetExitCodeProcess.cs index d2b6fb59e326dc..1789bac255a557 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetExitCodeProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetExitCodeProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetExitCodeProcess(SafeProcessHandle processHandle, out int exitCode); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs index 04daf3418965fb..59f6d4992e89f0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use GetFileAttributesEx. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetFileAttributesExPrivate( string? name, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs index 585306b1cfe481..6f978f9d848a08 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, uint dwBufferSize); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_IntPtr.cs index 1a2e5432e3a6a1..deb355a0528d4d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial uint GetFileType(IntPtr hFile); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs index 76f99ac51b7d77..eeca5b698d0b52 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int GetFileType(SafeHandle hFile); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs index 3d15bf6dedd419..cdc0fcc3e53199 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 internal const uint FILE_NAME_NORMALIZED = 0x0; // https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew (kernel32) - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", SetLastError = true)] internal static unsafe partial uint GetFinalPathNameByHandle( SafeFileHandle hFile, char* lpszFilePath, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs index 687d5bf188a657..7339009e7e3b82 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper. /// - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetFullPathNameW( ref char lpFileName, uint nBufferLength, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLargestConsoleWindowSize.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLargestConsoleWindowSize.cs index ca7bf2b5ef48a0..83fb8406e14426 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLargestConsoleWindowSize.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLargestConsoleWindowSize.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial Interop.Kernel32.COORD GetLargestConsoleWindowSize(IntPtr hConsoleOutput); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs index 55a84179887f5c..e75b4038c09296 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static partial int GetLastError(); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs index f084be9926b40b..1704ee83fd5129 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int GetLogicalDrives(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs index a99a77a2a5105e..6a86e79ef29566 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs @@ -10,7 +10,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper. /// - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetLongPathNameW( ref char lpszShortPath, ref char lpszLongPath, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleBaseName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleBaseName.cs index def7124cbd3cb6..d60af485a03e93 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleBaseName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleBaseName.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleBaseNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleBaseNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetModuleBaseName(SafeProcessHandle processHandle, IntPtr moduleHandle, [Out] char[] baseName, int size); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs index 08b6784c4d293d..095e6a85996455 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetModuleFileName(IntPtr hModule, ref char lpFilename, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileNameEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileNameEx.cs index 1b89788d9f0458..489cc9f4853f9d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileNameEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileNameEx.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleFileNameExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleFileNameExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetModuleFileNameEx(SafeProcessHandle processHandle, IntPtr moduleHandle, [Out] char[] baseName, int size); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs index 710e14fc2efb26..25c7dedc40fa9a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr GetModuleHandle(string? moduleName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleInformation.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleInformation.cs index f2b80ac6762c24..114cd372ee8632 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleInformation.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleInformation", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleInformation", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetModuleInformation(SafeProcessHandle processHandle, IntPtr moduleHandle, out NtModuleInfo ntModuleInfo, int size); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeHandleState.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeHandleState.cs index 2d0b5535282d1e..c663cc2e3b0b19 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeHandleState.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeHandleState.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetNamedPipeHandleStateW( SafePipeHandle hNamedPipe, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeInfo.cs index 3e6f1f188c7a1c..5945fa95c28263 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetNamedPipeInfo( SafePipeHandle hNamedPipe, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs index 076079e0bb393e..7505529e42542e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void GetNativeSystemInfo(SYSTEM_INFO* lpSystemInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs index fa2db0412cdd0c..6ef5b0c3a991a6 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetOverlappedResult( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.cs index fc660806ba9616..8cedaaf88edce2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int GetPriorityClass(SafeProcessHandle handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs index c76bda41ab8d16..4c7723b5539e01 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] public static partial IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] public static partial IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessAffinityMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessAffinityMask.cs index dd7752bf5363a8..c09afa13ce4164 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessAffinityMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessAffinityMask.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetProcessAffinityMask(SafeProcessHandle handle, out IntPtr processMask, out IntPtr systemMask); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.cs index 5261c0d5a065d4..2465c0d1d0a046 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] public static partial int GetProcessId(SafeProcessHandle nativeHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs index 07b94f8fda76eb..15b09ca325353a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs @@ -23,7 +23,7 @@ internal struct PROCESS_MEMORY_COUNTERS public UIntPtr PeakPagefileUsage; } - [GeneratedDllImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")] + [LibraryImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessName.cs index ec1c7736fab14e..871108a7c9a100 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessName.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool QueryFullProcessImageName( SafeHandle hProcess, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessPriorityBoost.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessPriorityBoost.cs index 1b172302564f32..6258f55f22ee7d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessPriorityBoost.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessPriorityBoost.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetProcessPriorityBoost(SafeProcessHandle handle, [MarshalAs(UnmanagedType.Bool)] out bool disabled); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs index 7ceb948c4c4963..64c234ba981d39 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetProcessTimes( SafeProcessHandle handle, out long creation, out long exit, out long kernel, out long user); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs index 79f6a908c92870..3d4eb64b0321be 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetProcessTimes(IntPtr handleProcess, out long creation, out long exit, out long kernel, out long user); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessWorkingSetSizeEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessWorkingSetSizeEx.cs index 3ededb092ef648..859a85ae16e5a6 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessWorkingSetSizeEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessWorkingSetSizeEx.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetProcessWorkingSetSizeEx(SafeProcessHandle handle, out IntPtr min, out IntPtr max, out int flags); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs index 501c25f54e4d7a..e763e01c821964 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] #if !NO_SUPPRESS_GC_TRANSITION [SuppressGCTransition] #endif diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs index 699d4b97f275c8..97d100e3b41152 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetSystemDirectoryW(ref char lpBuffer, uint uSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs index 383a26f280d43e..f4d79faa584a8f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void GetSystemInfo(SYSTEM_INFO* lpSystemInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs index e97c5658df543a..9b80349ca1b609 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static unsafe partial void GetSystemTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs index d273de724048bf..9234cd8b8409ba 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetSystemTimes(out long idle, out long kernel, out long user); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs index a0c39568ee40ed..fba61bf01a1029 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs index bef74a92e154a1..7c30b977c8fb80 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetTempPathW(int bufferLen, ref char buffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.cs index 4a0aef613c8201..bcbd89bb93cf1c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int GetThreadPriority(SafeThreadHandle handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriorityBoost.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriorityBoost.cs index 9a60f83a79f157..97aa81ef2c30af 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriorityBoost.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriorityBoost.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetThreadPriorityBoost(SafeThreadHandle handle, [MarshalAs(UnmanagedType.Bool)] out bool disabled); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadTimes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadTimes.cs index 6054ffdec40a80..d1e72cec336c57 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadTimes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadTimes.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetThreadTimes(SafeThreadHandle handle, out long creation, out long exit, out long kernel, out long user); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.cs index b0b6d90baaeb1e..24ee8eba7876da 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static unsafe partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static partial ulong GetTickCount64(); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs index bfe62ac2f47b33..ad4edf64ea387e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Interop.Libraries.Kernel32)] + [LibraryImport(Interop.Libraries.Kernel32)] internal static partial int GetUserDefaultLCID(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs index af5f7af12423d2..4082bc45677768 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetVolumeInformation( string drive, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalFree.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalFree.cs index f62db377183f7c..9fc80bc5c5d8dd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalFree.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalFree.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] public static partial IntPtr GlobalFree(IntPtr handle); public static IntPtr GlobalFree(HandleRef handle) diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs index c618bac933eaf4..66b2ccb6688d09 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] public static partial IntPtr GlobalLock(IntPtr hMem); public static IntPtr GlobalLock(HandleRef hMem) @@ -18,7 +18,7 @@ public static IntPtr GlobalLock(HandleRef hMem) return result; } - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] public static partial IntPtr GlobalUnlock(IntPtr hMem); public static IntPtr GlobalUnlock(HandleRef hMem) diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs index 9704e1c7379004..7012582820ff43 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial BOOL GlobalMemoryStatusEx(MEMORYSTATUSEX* lpBuffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs index 4c6d51b98e7213..99e18caf50b1c4 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs @@ -47,13 +47,13 @@ internal static partial class Kernel32 internal const string LOCALE_NAME_USER_DEFAULT = null; internal const string LOCALE_NAME_SYSTEM_DEFAULT = "!x-sys-default-locale"; - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int LCIDToLocaleName(int locale, char* pLocaleName, int cchName, uint dwFlags); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] internal static partial int LocaleNameToLCID(string lpName, uint dwFlags); - [GeneratedDllImport("kernel32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int LCMapStringEx( string? lpLocaleName, uint dwMapFlags, @@ -65,7 +65,7 @@ internal static unsafe partial int LCMapStringEx( void* lpReserved, IntPtr sortHandle); - [GeneratedDllImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)] + [LibraryImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)] internal static unsafe partial int FindNLSStringEx( char* lpLocaleName, uint dwFindNLSStringFlags, @@ -78,7 +78,7 @@ internal static unsafe partial int FindNLSStringEx( void* lpReserved, IntPtr sortHandle); - [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringEx")] + [LibraryImport("kernel32.dll", EntryPoint = "CompareStringEx")] internal static unsafe partial int CompareStringEx( char* lpLocaleName, uint dwCmpFlags, @@ -90,7 +90,7 @@ internal static unsafe partial int CompareStringEx( void* lpReserved, IntPtr lParam); - [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")] + [LibraryImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")] internal static unsafe partial int CompareStringOrdinal( char* lpString1, int cchCount1, @@ -98,7 +98,7 @@ internal static unsafe partial int CompareStringOrdinal( int cchCount2, [MarshalAs(UnmanagedType.Bool)] bool bIgnoreCase); - [GeneratedDllImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)] + [LibraryImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)] internal static unsafe partial int FindStringOrdinal( uint dwFindStringOrdinalFlags, char* lpStringSource, @@ -107,7 +107,7 @@ internal static unsafe partial int FindStringOrdinal( int cchValue, BOOL bIgnoreCase); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool IsNLSDefinedString( int Function, @@ -116,33 +116,33 @@ internal static unsafe partial bool IsNLSDefinedString( char* lpString, int cchStr); - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] internal static unsafe partial Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool EnumSystemLocalesEx(delegate* unmanaged lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool EnumTimeFormatsEx(delegate* unmanaged lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue); - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] internal static partial int GetUserGeoID(int geoClass); - [GeneratedDllImport("kernel32.dll", EntryPoint = "GetGeoInfoW")] + [LibraryImport("kernel32.dll", EntryPoint = "GetGeoInfoW")] internal static unsafe partial int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId); - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool EnumCalendarInfoExEx(delegate* unmanaged pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam); @@ -156,7 +156,7 @@ internal struct NlsVersionInfoEx internal Guid guidCustomVersion; } - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.HandleInformation.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.HandleInformation.cs index 979e4b9a4ff1f4..5576bdd3e6cbe0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.HandleInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.HandleInformation.cs @@ -17,7 +17,7 @@ internal enum HandleFlags : uint HANDLE_FLAG_PROTECT_FROM_CLOSE = 2 } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetHandleInformation(SafeHandle hObject, HandleFlags dwMask, HandleFlags dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs index c68b192b77bff0..5de5b8d5957bf1 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr GetProcessHeap(); [Flags] @@ -21,10 +21,10 @@ internal enum HeapAllocFlags : int HEAP_GENERATE_EXCEPTIONS = 0x00000004, } - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, nint dwBytes); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool HeapFree(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr lpMem); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsDebuggerPresent.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsDebuggerPresent.cs index e1fa1091065fb3..8dc6f52bef6415 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsDebuggerPresent.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsDebuggerPresent.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsDebuggerPresent(); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs index 855f904fc32433..bf3560174c2e85 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsWow64Process(IntPtr hProcess, [MarshalAs(UnmanagedType.Bool)] out bool Wow64Process); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_SafeProcessHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_SafeProcessHandle.cs index c6eb6755f01b9c..2be93bc6c111d4 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_SafeProcessHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_SafeProcessHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsWow64Process(SafeProcessHandle hProcess, [MarshalAs(UnmanagedType.Bool)] out bool Wow64Process); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs index eb9e38114e4023..8cc0f4bbf4d883 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr LoadLibrary(string libFilename); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs index 9d1f7a8f815764..d862ab65ce5722 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 public const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002; public const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800; - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial SafeLibraryHandle LoadLibraryExW(string lpwLibFileName, IntPtr hFile, uint dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx_IntPtr.cs index b987f56a022a07..5dea0386cdf19a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx_IntPtr.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 internal const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002; internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800; - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr LoadLibraryEx(string libFilename, IntPtr reserved, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs index 0bcd7e356a9ba9..eb64d0d02af64c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs @@ -12,13 +12,13 @@ internal static partial class Kernel32 internal const uint LMEM_MOVEABLE = 0x0002; internal const uint LMEM_ZEROINIT = 0x0040; - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr LocalAlloc(uint uFlags, nuint uBytes); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr LocalReAlloc(IntPtr hMem, nuint uBytes, uint uFlags); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr LocalFree(IntPtr hMem); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs index ac97866a576f6d..9584a8b997173a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs index 79a3387618a23c..898f47677b2ccf 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeMemoryMappedViewHandle MapViewOfFile( SafeMemoryMappedFileHandle hFileMappingObject, int dwDesiredAccess, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs index dede5057340f8a..da1d8bbdaeb528 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use MoveFile. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool MoveFileExPrivate( string src, string dst, uint flags); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs index dfb7a73c521318..4b2b30b0c8741c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial int MultiByteToWideChar( uint CodePage, uint dwFlags, byte* lpMultiByteStr, int cbMultiByte, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs index b110c47cd68dc6..9b9bfff8202c42 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs @@ -11,13 +11,13 @@ internal static partial class Kernel32 { internal const uint CREATE_MUTEX_INITIAL_OWNER = 0x1; - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeWaitHandle OpenMutex(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name); - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return:MarshalAs(UnmanagedType.Bool)] internal static partial bool ReleaseMutex(SafeWaitHandle handle); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs index 8d8a0c91e8c6d3..347ec7c74b34bd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeMemoryMappedFileHandle OpenFileMapping( int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs index b33a81fcc73a3f..2a1fdd11f41a1c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial SafeProcessHandle OpenProcess( int access, [MarshalAs(UnmanagedType.Bool)] bool inherit, int processId); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenThread.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenThread.cs index f662ea538f21a3..f608aaecd77a67 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenThread.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenThread.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial SafeThreadHandle OpenThread(int access, [MarshalAs(UnmanagedType.Bool)] bool inherit, int threadId); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs index 937999e0cebdea..0012b5de2899d7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", StringMarshalling = StringMarshalling.Utf16)] internal static partial void OutputDebugString(string message); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PeekConsoleInput.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PeekConsoleInput.cs index ff2d562abe8695..23b9e80be3a711 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PeekConsoleInput.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PeekConsoleInput.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "PeekConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "PeekConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PeekConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs index e6b8f1c0192d83..757e72b83c9461 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs @@ -16,7 +16,7 @@ internal static class PurgeFlags internal const uint PURGE_RXCLEAR = 0x0008; // Kill the typeahead buffer if there. } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PurgeComm( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs index f43439a3a33526..506c14accf3059 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 // We take a long* (rather than a out long) to avoid the pinning overhead. // We don't set last error since we don't need the extended error info. - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static unsafe partial BOOL QueryPerformanceCounter(long* lpPerformanceCount); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs index 2ed59d0ade1538..11b3bf7716ea1c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 // We take a long* (rather than a out long) to avoid the pinning overhead. // We don't set last error since we don't need the extended error info. - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial BOOL QueryPerformanceFrequency(long* lpFrequency); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs index 1694738c4f2bd6..fd2cb681088b12 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RaiseFailFastException.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RaiseFailFastException.cs index 004ca3a43763e1..58b48a5b1bda54 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RaiseFailFastException.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RaiseFailFastException.cs @@ -49,7 +49,7 @@ internal static unsafe void RaiseFailFastException(uint faultCode, IntPtr pExAdd pExAddress == IntPtr.Zero ? FAIL_FAST_GENERATE_EXCEPTION_ADDRESS : 0); } - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RaiseFailFastException")] + [LibraryImport(Libraries.Kernel32, EntryPoint = "RaiseFailFastException")] [DoesNotReturn] private static unsafe partial void RaiseFailFastException( EXCEPTION_RECORD* pExceptionRecord, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsole.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsole.cs index 21e161c45ee441..8960bf743d1763 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsole.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsole.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool ReadConsole( IntPtr hConsoleInput, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleInput.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleInput.cs index 2153e7ce39485f..50367574e2edd8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleInput.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleInput.cs @@ -32,7 +32,7 @@ internal struct InputRecord internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ReadConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleOutput.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleOutput.cs index 2e4c002d883d6b..52679d972a42fa 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleOutput.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleOutput.cs @@ -15,7 +15,7 @@ internal struct CHAR_INFO private short attributes; } - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool ReadConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* pBuffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT readRegion); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadDirectoryChangesW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadDirectoryChangesW.cs index f42604055f9962..b5eec92929849c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadDirectoryChangesW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadDirectoryChangesW.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool ReadDirectoryChangesW( SafeFileHandle hDirectory, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.cs index 6e8aa47a7f9ad2..d6482bba79141c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( IntPtr handle, byte* bytes, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs index 00b66c4ccde30a..8ec2b024dac82b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( SafeHandle handle, byte* bytes, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs index ceebb111aab370..bc1c7fd20ce3fb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( SafeHandle handle, byte* bytes, @@ -17,7 +17,7 @@ internal static unsafe partial int ReadFile( IntPtr numBytesRead_mustBeZero, NativeOverlapped* overlapped); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( SafeHandle handle, byte* bytes, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs index e701be68d0a943..7c123d17d81f53 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs @@ -12,7 +12,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use RemoveDirectory. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool RemoveDirectoryPrivate(string path); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs index 531107f6c22b1c..0a0ec60d29189f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool ReplaceFilePrivate( string replacedFileName, string replacementFileName, string? backupFileName, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs index b70c6d8fdf3827..f7502cc7e0f1fb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs @@ -9,7 +9,7 @@ internal static unsafe partial class Kernel32 { internal const int LOCALE_NAME_MAX_LENGTH = 85; - [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)] internal static partial int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs index 8b50d13eb619c9..150df2d5fb9d3b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeWaitHandle OpenSemaphore(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name); - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool ReleaseSemaphore(SafeWaitHandle handle, int releaseCount, out int previousCount); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs index b862c711e0982e..238c96797d0359 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetCommBreak( SafeFileHandle hFile); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs index 898a35947bb666..6179d1a5539edc 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs @@ -15,7 +15,7 @@ internal static class CommEvents internal const int ALL_EVENTS = 0x1fb; } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetCommMask( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs index 558f3e93a99652..1f88b899238532 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetCommState( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs index e1ed76511fb72f..58b3c7a2f00211 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs @@ -10,7 +10,7 @@ internal static partial class Kernel32 { internal const int MAXDWORD = -1; // This is 0xfffffff, or UInt32.MaxValue, here used as an int - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetCommTimeouts( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCP.cs index 88fd242f4d42b2..f1362740d058fc 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCP.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleCP(int codePage); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs index 64d037e4daa58a..3148bcf07f2d9b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 { internal delegate bool ConsoleCtrlHandlerRoutine(int controlType); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleCtrlHandler(ConsoleCtrlHandlerRoutine handler, [MarshalAs(UnmanagedType.Bool)] bool addOrRemove); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs index 1596458fdf59d7..63d2db5a2f0744 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 internal const int CTRL_LOGOFF_EVENT = 5; internal const int CTRL_SHUTDOWN_EVENT = 6; - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SetConsoleCtrlHandler(delegate* unmanaged handler, [MarshalAs(UnmanagedType.Bool)] bool Add); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCursorPosition.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCursorPosition.cs index 30b4276d592260..cde79e4e6db758 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCursorPosition.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCursorPosition.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleCursorPosition(IntPtr hConsoleOutput, COORD cursorPosition); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleOutputCP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleOutputCP.cs index 177fe5f2853921..2db5b5389db5d0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleOutputCP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleOutputCP.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleOutputCP(int codePage); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleScreenBufferSize.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleScreenBufferSize.cs index bc913cf7c3b84b..c7392fa0b202b7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleScreenBufferSize.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleScreenBufferSize.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleScreenBufferSize(IntPtr hConsoleOutput, Interop.Kernel32.COORD size); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTextAttribute.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTextAttribute.cs index 23bd38e24bf2c9..64adfc479e562e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTextAttribute.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTextAttribute.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int SetConsoleTextAttribute(IntPtr hConsoleOutput, short wAttributes); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTitle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTitle.cs index fae0deb64eb20b..20c7a70c917e96 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTitle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTitle.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetConsoleTitleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "SetConsoleTitleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetConsoleTitle(string title); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleWindowInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleWindowInfo.cs index fbe96c541bb453..b8ea92d0ec38cf 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleWindowInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleWindowInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SetConsoleWindowInfo(IntPtr hConsoleOutput, [MarshalAs(UnmanagedType.Bool)] bool absolute, SMALL_RECT* consoleWindow); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs index 3cec4884c8741a..7f19ed21b6fc51 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetCurrentDirectory(string path); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs index 32b2060d3fe832..960ee031e28b81 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetEnvironmentVariable(string lpName, string? lpValue); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs index c2f1912ab3845f..d4215667da5de2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use SetFileAttributes. /// - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool SetFileAttributesPrivate( string name, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileCompletionNotificationModes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileCompletionNotificationModes.cs index f9150e02a0a88d..408c3d6c303f99 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileCompletionNotificationModes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileCompletionNotificationModes.cs @@ -16,7 +16,7 @@ internal enum FileCompletionNotificationModes : byte SkipSetEventOnHandle = 2 } - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetFileCompletionNotificationModes(SafeHandle handle, FileCompletionNotificationModes flags); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs index 15b6fb2133b62a..e80bf32dbb6ea7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SetFileInformationByHandle( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs index b1ee5a8163af89..e7050d1c49ec24 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs index baf852e6be6a08..b04a0dd84547d9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs @@ -7,7 +7,7 @@ internal partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static partial void SetLastError(int errorCode); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetNamedPipeHandleState.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetNamedPipeHandleState.cs index 2ee991183b7604..b618d105d931e4 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetNamedPipeHandleState.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetNamedPipeHandleState.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool SetNamedPipeHandleState( SafePipeHandle hNamedPipe, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetPriorityClass.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetPriorityClass.cs index 12aed4e80d835d..000002efbd5c90 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetPriorityClass.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetPriorityClass.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetPriorityClass(SafeProcessHandle handle, int priorityClass); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessAffinityMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessAffinityMask.cs index ea6222a500ffc1..67edaa145652c7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessAffinityMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessAffinityMask.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetProcessAffinityMask(SafeProcessHandle handle, IntPtr mask); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessPriorityBoost.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessPriorityBoost.cs index 8744b06bc28e65..31ab0f472a0428 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessPriorityBoost.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessPriorityBoost.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetProcessPriorityBoost(SafeProcessHandle handle, [MarshalAs(UnmanagedType.Bool)] bool disabled); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessWorkingSetSizeEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessWorkingSetSizeEx.cs index 8efac8acc946be..02cd318310a734 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessWorkingSetSizeEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessWorkingSetSizeEx.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetProcessWorkingSetSizeEx(SafeProcessHandle handle, IntPtr min, IntPtr max, int flags); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadAffinityMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadAffinityMask.cs index 3831b957c28b19..65e762cac4598d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadAffinityMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadAffinityMask.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial IntPtr SetThreadAffinityMask(SafeThreadHandle handle, IntPtr mask); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs index 98c0ac2e16d6d4..340b75115973f5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs @@ -8,7 +8,7 @@ internal static partial class Interop internal static partial class Kernel32 { [SuppressGCTransition] - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetThreadErrorMode( uint dwNewMode, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadIdealProcessor.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadIdealProcessor.cs index d8cc9a8acdd7cc..f96dfe16484c52 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadIdealProcessor.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadIdealProcessor.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int SetThreadIdealProcessor(SafeThreadHandle handle, int processor); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriority.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriority.cs index a559829b2956f8..5b62e530e13f7e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriority.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriority.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetThreadPriority(SafeThreadHandle handle, int priority); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriorityBoost.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriorityBoost.cs index 3c6d8554dd751a..24f869a56eb0d1 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriorityBoost.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriorityBoost.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetThreadPriorityBoost(SafeThreadHandle handle, [MarshalAs(UnmanagedType.Bool)] bool disabled); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetVolumeLabel.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetVolumeLabel.cs index f891a3416e180c..4cd4109cb740b5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetVolumeLabel.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetVolumeLabel.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetVolumeLabelW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "SetVolumeLabelW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetVolumeLabel(string driveLetter, string? volumeName); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs index e0f1db368a30b2..574d9abc86d468 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetupComm( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs index 10fe4080a00d98..9b267a480126c2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [SuppressGCTransition] internal static unsafe partial Interop.BOOL SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime, ulong* lpFileTime); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TerminateProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TerminateProcess.cs index 4b203868bf64a2..0835d1dfd9951d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TerminateProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TerminateProcess.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool TerminateProcess(SafeProcessHandle processHandle, int exitCode); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPool.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPool.cs index 5a94d5ea6067b1..bb2550642a70a7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPool.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPool.cs @@ -8,25 +8,25 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial IntPtr CreateThreadpoolWork(delegate* unmanaged pfnwk, IntPtr pv, IntPtr pcbe); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial void SubmitThreadpoolWork(IntPtr pwk); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial void CloseThreadpoolWork(IntPtr pwk); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial IntPtr CreateThreadpoolWait(delegate* unmanaged pfnwa, IntPtr pv, IntPtr pcbe); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial void SetThreadpoolWait(IntPtr pwa, IntPtr h, IntPtr pftTimeout); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial void WaitForThreadpoolWaitCallbacks(IntPtr pwa, [MarshalAs(UnmanagedType.Bool)] bool fCancelPendingCallbacks); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial void CloseThreadpoolWait(IntPtr pwa); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPoolIO.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPoolIO.cs index a0dda79bdf270f..ba214356764c08 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPoolIO.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPoolIO.cs @@ -9,16 +9,16 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial SafeThreadPoolIOHandle CreateThreadpoolIo(SafeHandle fl, delegate* unmanaged pfnio, IntPtr context, IntPtr pcbe); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void CloseThreadpoolIo(IntPtr pio); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void StartThreadpoolIo(SafeThreadPoolIOHandle pio); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void CancelThreadpoolIo(SafeThreadPoolIOHandle pio); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Threading.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Threading.cs index 464b7e19ff9535..b1e9ed9a6be6ad 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Threading.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Threading.cs @@ -11,22 +11,22 @@ internal static partial class Kernel32 { internal const int WAIT_FAILED = unchecked((int)0xFFFFFFFF); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, BOOL bWaitAll, uint dwMilliseconds, BOOL bAlertable); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint WaitForSingleObject(IntPtr hHandle, uint dwMilliseconds); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint SignalObjectAndWait(IntPtr hObjectToSignal, IntPtr hObjectToWaitOn, uint dwMilliseconds, BOOL bAlertable); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial void Sleep(uint milliseconds); internal const uint CREATE_SUSPENDED = 0x00000004; internal const uint STACK_SIZE_PARAM_IS_A_RESERVATION = 0x00010000; - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial SafeWaitHandle CreateThread( IntPtr lpThreadAttributes, IntPtr dwStackSize, @@ -35,15 +35,15 @@ internal static unsafe partial SafeWaitHandle CreateThread( uint dwCreationFlags, out uint lpThreadId); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial uint ResumeThread(SafeWaitHandle hThread); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial IntPtr GetCurrentThread(); internal const int DUPLICATE_SAME_ACCESS = 2; - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return:MarshalAs(UnmanagedType.Bool)] internal static partial bool DuplicateHandle( IntPtr hSourceProcessHandle, @@ -67,10 +67,10 @@ internal enum ThreadPriority : int ErrorReturn = 0x7FFFFFFF } - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial ThreadPriority GetThreadPriority(SafeWaitHandle hThread); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return:MarshalAs(UnmanagedType.Bool)] internal static partial bool SetThreadPriority(SafeWaitHandle hThread, int nPriority); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs index 4ecb0f45f7d6f4..705d97ac3f48d2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs @@ -83,10 +83,10 @@ internal string GetDaylightName() internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Timer.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Timer.cs index 1fcf7da5583135..426e57c4b3d8f8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Timer.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Timer.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial IntPtr CreateThreadpoolTimer(delegate* unmanaged pfnti, IntPtr pv, IntPtr pcbe); - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial IntPtr SetThreadpoolTimer(IntPtr pti, long* pftDueTime, uint msPeriod, uint msWindowLength); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs index 7fc3013ae687df..de38b9e0a96c42 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial Interop.BOOL TzSpecificLocalTimeToSystemTime( IntPtr lpTimeZoneInformation, Interop.Kernel32.SYSTEMTIME* lpLocalTime, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs index c3b60fa1ac277e..953f3804ea9fbb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool UnmapViewOfFile(IntPtr lpBaseAddress); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs index 179b07cea8405b..06ed93760d2f34 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")] + [LibraryImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")] internal static unsafe partial int VerLanguageName(uint wLang, char* szLang, uint cchLang); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs index 6ca6d7797a5fb6..791124d11839fe 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static partial ulong VerSetConditionMask(ulong ConditionMask, uint TypeMask, byte Condition); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs index 6d5d9b50562f6f..aa4536511e1b46 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 internal const uint VER_SERVICEPACKMAJOR = 0x0000020; internal const uint VER_SERVICEPACKMINOR = 0x0000010; - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool VerifyVersionInfoW(ref OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs index d734016c52f575..28aa861c2b9b35 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial IntPtr VirtualAlloc(SafeHandle lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs index fb9e9d527ffff8..48d1854b671667 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs index 1b724823c465d0..c50cb304684488 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs index e9ac4eac80e6bd..de2ab38e40c4e2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial UIntPtr VirtualQuery( SafeHandle lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs index 95f175a980ce41..3abedcfa227976 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs index 9b861b819d732a..0a73d3a646b1cb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool WaitCommEvent( SafeFileHandle hFile, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs index fc879c3085dee4..91db5d11f6f6e8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static partial int WaitForSingleObject(SafeWaitHandle handle, int timeout); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs index 1a6562562456fc..529848dd93c283 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WaitNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "WaitNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool WaitNamedPipe(string? name, int timeout); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs index ad2d77e538c921..a41117556240d4 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32)] + [LibraryImport(Libraries.Kernel32)] internal static unsafe partial int WideCharToMultiByte( uint CodePage, uint dwFlags, char* lpWideCharStr, int cchWideChar, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsole.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsole.cs index 34225c68521ca5..b490dd05835a0c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsole.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsole.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WriteConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "WriteConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool WriteConsole( IntPtr hConsoleOutput, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsoleOutput.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsoleOutput.cs index 5a41c078866ede..bcae4c05c195a3 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsoleOutput.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsoleOutput.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WriteConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "WriteConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool WriteConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* buffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT writeRegion); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.cs index 2c4e963dbc59d2..40e18008c70837 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( IntPtr handle, byte* bytes, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs index 0e7cc88f1b49bb..3e2b483e3bb70b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 // struct in a callback (or an EndWrite method called by that callback), // and pass in an address for the numBytesRead parameter. - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( SafeHandle handle, byte* bytes, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs index 3ae10aaab16ed6..b55f050342c887 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 // simultaneously: overlapped IO, free the memory for the overlapped // struct in a callback (or an EndWrite method called by that callback), // and pass in an address for the numBytesRead parameter. - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( SafeHandle handle, byte* bytes, @@ -23,7 +23,7 @@ internal static unsafe partial int WriteFile( IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( SafeHandle handle, byte* bytes, diff --git a/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs b/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs index af7280f949c4f3..c24b2fcf8a2248 100644 --- a/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs +++ b/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Logoncli { - [GeneratedDllImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DsGetDcName( string computerName, string domainName, diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs index 42126dc6faae38..f7583969a74790 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs @@ -12,13 +12,13 @@ internal static partial class NCrypt internal static unsafe ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan pbInput, int cbInput, void* pPaddingInfo, Span pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags) => NCryptEncrypt(hKey, ref MemoryMarshal.GetReference(pbInput), cbInput, pPaddingInfo, ref MemoryMarshal.GetReference(pbOutput), cbOutput, out pcbResult, dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt)] + [LibraryImport(Interop.Libraries.NCrypt)] private static unsafe partial ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ref byte pbInput, int cbInput, void* pPaddingInfo, ref byte pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); internal static unsafe ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan pbInput, int cbInput, void* pPaddingInfo, Span pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags) => NCryptDecrypt(hKey, ref MemoryMarshal.GetReference(pbInput), cbInput, pPaddingInfo, ref MemoryMarshal.GetReference(pbOutput), cbOutput, out pcbResult, dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt)] + [LibraryImport(Interop.Libraries.NCrypt)] private static unsafe partial ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ref byte pbInput, int cbInput, void* pPaddingInfo, ref byte pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs index abd0f171ba3ce0..1b24ea9b4e471c 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs @@ -16,31 +16,31 @@ internal static partial class NCrypt internal const int NCRYPT_CIPHER_KEY_BLOB_MAGIC = 0x52485043; //'CPHR' - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptOpenKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszKeyName, int dwLegacyKeySpec, CngKeyOpenOptions dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, IntPtr pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptDeleteKey(SafeNCryptKeyHandle hKey, int dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptCreatePersistedKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszAlgId, string? pszKeyName, int dwLegacyKeySpec, CngKeyCreationOptions dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptFinalizeKey(SafeNCryptKeyHandle hKey, int dwFlags); [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs index 02298a6a76e29b..93783683b23022 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs @@ -15,7 +15,7 @@ internal static partial class NCrypt /// /// Generate a key from a secret agreement /// - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] private static partial ErrorCode NCryptDeriveKey( SafeNCryptSecretHandle hSharedSecret, string pwszKDF, diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.cs index 78a18d5aa7c0db..6886fe241c0f17 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.cs @@ -21,7 +21,7 @@ internal enum SecretAgreementFlags /// /// Generate a secret agreement for generating shared key material /// - [GeneratedDllImport(Interop.Libraries.NCrypt)] + [LibraryImport(Interop.Libraries.NCrypt)] private static partial ErrorCode NCryptSecretAgreement( SafeNCryptKeyHandle hPrivKey, SafeNCryptKeyHandle hPubKey, diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs index d97f1b1a941350..3639139e14a552 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class NCrypt { - [GeneratedDllImport(Interop.Libraries.NCrypt)] + [LibraryImport(Interop.Libraries.NCrypt)] internal static partial ErrorCode NCryptFreeObject(IntPtr hObject); } } diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.cs index 28adee9d595a38..294612f9e2afc6 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class NCrypt { - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptOpenStorageProvider(out SafeNCryptProviderHandle phProvider, string pszProviderName, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs index a52da43417bdeb..41c079d5ad144e 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs @@ -13,7 +13,7 @@ internal static partial class Interop { internal static partial class NCrypt { - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial ErrorCode NCryptGetProperty( SafeNCryptHandle hObject, string pszProperty, @@ -22,7 +22,7 @@ internal static unsafe partial ErrorCode NCryptGetProperty( out int pcbResult, CngPropertyOptions dwFlags); - [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial ErrorCode NCryptSetProperty( SafeNCryptHandle hObject, string pszProperty, diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs index 723f78e084991e..e3b184c7288558 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs @@ -12,13 +12,13 @@ internal static partial class NCrypt internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan pbHashValue, int cbHashValue, Span pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags) => NCryptSignHash(hKey, pPaddingInfo, ref MemoryMarshal.GetReference(pbHashValue), cbHashValue, ref MemoryMarshal.GetReference(pbSignature), cbSignature, out pcbResult, dwFlags); - [GeneratedDllImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ref byte pbHashValue, int cbHashValue, ref byte pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags); internal static unsafe ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan pbHashValue, int cbHashValue, ReadOnlySpan pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags) => NCryptVerifySignature(hKey, pPaddingInfo, ref MemoryMarshal.GetReference(pbHashValue), cbHashValue, ref MemoryMarshal.GetReference(pbSignature), cbSignature, dwFlags); - [GeneratedDllImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] private static unsafe partial ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ref byte pbHashValue, int cbHashValue, ref byte pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs b/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs index 1f84f9a949b072..40893366393e3a 100644 --- a/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs +++ b/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Netutils { - [GeneratedDllImport(Libraries.Netutils)] + [LibraryImport(Libraries.Netutils)] internal static partial int NetApiBufferFree(IntPtr buffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs index 63104e2d240e5d..b7dd6ed6ceb743 100644 --- a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs +++ b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs @@ -11,7 +11,7 @@ internal static partial class Normaliz // Idn APIs // - [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int IdnToAscii( uint dwFlags, char* lpUnicodeCharStr, @@ -19,7 +19,7 @@ internal static unsafe partial int IdnToAscii( char* lpASCIICharStr, int cchASCIIChar); - [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int IdnToUnicode( uint dwFlags, char* lpASCIICharStr, diff --git a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs index 741380134edd0e..f05fbc08791d8b 100644 --- a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs +++ b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Normaliz { - [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial BOOL IsNormalizedString(NormalizationForm normForm, char* source, int length); - [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int NormalizeString( NormalizationForm normForm, char* source, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs index c72613c21dd711..cc80f325702c3c 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs @@ -12,7 +12,7 @@ internal static partial class NtDll { // https://msdn.microsoft.com/en-us/library/bb432380.aspx // https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424.aspx - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] private static unsafe partial uint NtCreateFile( IntPtr* FileHandle, DesiredAccess DesiredAccess, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs index 3ada672b1b001f..fbbf8b967102c4 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs @@ -10,7 +10,7 @@ internal static partial class NtDll { // https://msdn.microsoft.com/en-us/library/windows/hardware/ff556633.aspx // https://msdn.microsoft.com/en-us/library/windows/hardware/ff567047.aspx - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] public static unsafe partial int NtQueryDirectoryFile( IntPtr FileHandle, IntPtr Event, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs index b3acd8b1024967..b7a845249299d4 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class NtDll { - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] internal static unsafe partial int NtQueryInformationFile( SafeFileHandle FileHandle, out IO_STATUS_BLOCK IoStatusBlock, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.cs index 5d00c441854d45..526530f40a039c 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class NtDll { - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] internal static unsafe partial uint NtQueryInformationProcess(SafeProcessHandle ProcessHandle, int ProcessInformationClass, void* ProcessInformation, uint ProcessInformationLength, out uint ReturnLength); } } diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs index 3a31c397581dd0..858ae9c809f216 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class NtDll { - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] internal static unsafe partial uint NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, uint SystemInformationLength, uint* ReturnLength); internal const uint STATUS_INFO_LENGTH_MISMATCH = 0xC0000004; diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs index a73a7ef720cbc8..3fb9740a7f2490 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class NtDll { - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] private static partial int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation); internal static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi) diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs index d5728833cae760..7492ef118f4bed 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class NtDll { // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680600(v=vs.85).aspx - [GeneratedDllImport(Libraries.NtDll)] + [LibraryImport(Libraries.NtDll)] public static partial uint RtlNtStatusToDosError(int Status); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs index b2af31cab122fa..5a9b58d6bd72de 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [GeneratedDllImport(Interop.Libraries.Ole32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Ole32, StringMarshalling = StringMarshalling.Utf16)] internal static partial int CLSIDFromProgID(string lpszProgID, out Guid lpclsid); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs index e2cc05f757852c..92b36a053dd533 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] internal static partial int CoCreateGuid(out Guid guid); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.cs index be519d9008d9e6..c9fdf3fe7e70c7 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.cs @@ -29,7 +29,7 @@ internal enum APTTYPEQUALIFIER : uint internal static partial class Ole32 { - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] internal static partial int CoGetApartmentType(out APTTYPE pAptType, out APTTYPEQUALIFIER pAptQualifier); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs index af00fce67e3c1b..32527be1adc5c0 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs @@ -17,7 +17,7 @@ internal static unsafe int CoGetObjectContext(in Guid riid, out IntPtr ppv) } } - [GeneratedDllImport(Libraries.Ole32)] + [LibraryImport(Libraries.Ole32)] internal static unsafe partial int CoGetObjectContext(Guid* riid, IntPtr* ppv); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs index 8e9149aba0694d..11d26766d5063c 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] internal static partial int CoGetStandardMarshal(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out IntPtr ppMarshal); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.cs index ecef10206daefa..ee658ac6c383a7 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.cs @@ -12,7 +12,7 @@ internal static partial class Ole32 internal const uint COINIT_APARTMENTTHREADED = 2; internal const uint COINIT_MULTITHREADED = 0; - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] internal static partial int CoInitializeEx(IntPtr reserved, uint dwCoInit); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs index 605360233f1393..9171eb26a459c9 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs @@ -8,13 +8,13 @@ internal static partial class Interop { internal static partial class Ole32 { - [GeneratedDllImport(Libraries.Ole32)] + [LibraryImport(Libraries.Ole32)] internal static partial IntPtr CoTaskMemAlloc(nuint cb); - [GeneratedDllImport(Libraries.Ole32)] + [LibraryImport(Libraries.Ole32)] internal static partial IntPtr CoTaskMemRealloc(IntPtr pv, nuint cb); - [GeneratedDllImport(Libraries.Ole32)] + [LibraryImport(Libraries.Ole32)] internal static partial void CoTaskMemFree(IntPtr ptr); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.cs index 461b28620fde51..f8e83dfd3dbb3f 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] internal static partial int CoUninitialize(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs index d93d595ff35f9a..32acb658bcdb05 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [GeneratedDllImport(Interop.Libraries.Ole32)] + [LibraryImport(Interop.Libraries.Ole32)] internal static partial void PropVariantClear(IntPtr pObject); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs index 87b81e9906d258..93b0fa1ed1fe50 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class OleAut32 { // only using this to clear existing error info with null - [GeneratedDllImport(Interop.Libraries.OleAut32)] + [LibraryImport(Interop.Libraries.OleAut32)] // TLS values are preserved between threads, need to check that we use this API to clear the error state only. internal static partial void SetErrorInfo(int dwReserved, IntPtr pIErrorInfo); } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs index 7da06597f9b4bb..717fb1c3da32ec 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OleAut32 { - [GeneratedDllImport(Libraries.OleAut32)] + [LibraryImport(Libraries.OleAut32)] internal static partial IntPtr SysAllocStringByteLen(byte[]? str, uint len); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs index 4b262a1b824ca7..3fa76bed1a5b43 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class OleAut32 { - [GeneratedDllImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr SysAllocStringLen(IntPtr src, uint len); - [GeneratedDllImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr SysAllocStringLen(string src, uint len); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs index 09b31d14d44eb2..adf400ac7172d1 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OleAut32 { - [GeneratedDllImport(Libraries.OleAut32)] + [LibraryImport(Libraries.OleAut32)] internal static partial void SysFreeString(IntPtr bstr); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs index bc327864c6362f..6e980e6e6e8ccc 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OleAut32 { - [GeneratedDllImport(Libraries.OleAut32)] + [LibraryImport(Libraries.OleAut32)] internal static partial void VariantClear(IntPtr variant); } } diff --git a/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs b/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs index 6c93168c749aaa..4652781c958d10 100644 --- a/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Pdh { - [GeneratedDllImport(Libraries.Pdh)] + [LibraryImport(Libraries.Pdh)] public static partial int PdhFormatFromRawValue( uint dwCounterType, uint dwFormat, diff --git a/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs b/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs index 0019272d3a09c4..24db68ecfeeb07 100644 --- a/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs +++ b/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class PerfCounter { - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial uint PerfStopProvider( IntPtr hProvider ); @@ -53,14 +53,14 @@ internal struct PerfCounterSetInstanceStruct internal uint InstanceNameSize; } - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static partial uint PerfStartProvider( ref Guid ProviderGuid, PERFLIBREQUEST ControlCallback, out SafePerfProviderHandle phProvider ); - [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial PerfCounterSetInstanceStruct* PerfCreateInstance( SafePerfProviderHandle hProvider, ref Guid CounterSetGuid, @@ -68,20 +68,20 @@ out SafePerfProviderHandle phProvider uint dwInstance ); - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static unsafe partial uint PerfSetCounterSetInfo( SafePerfProviderHandle hProvider, PerfCounterSetInfoStruct* pTemplate, uint dwTemplateSize ); - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static unsafe partial uint PerfDeleteInstance( SafePerfProviderHandle hProvider, PerfCounterSetInstanceStruct* InstanceBlock ); - [GeneratedDllImport(Libraries.Advapi32)] + [LibraryImport(Libraries.Advapi32)] internal static unsafe partial uint PerfSetCounterRefValue( SafePerfProviderHandle hProvider, PerfCounterSetInstanceStruct* pInstance, diff --git a/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs b/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs index d0b16e7c6b5ce0..a997bbeec5cfea 100644 --- a/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs +++ b/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Secur32 { - [GeneratedDllImport(Libraries.Secur32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Secur32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize); internal const int NameSamCompatible = 2; diff --git a/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs b/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs index ce96b7ed29e64b..dd8226a6fc9f90 100644 --- a/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs +++ b/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs @@ -11,7 +11,7 @@ internal static partial class Shell32 internal const int COR_E_PLATFORMNOTSUPPORTED = unchecked((int)0x80131539); // https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx - [GeneratedDllImport(Libraries.Shell32, SetLastError = false, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Shell32, SetLastError = false, StringMarshalling = StringMarshalling.Utf16)] internal static partial int SHGetKnownFolderPath( in Guid rfid, uint dwFlags, diff --git a/src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.cs b/src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.cs index 984a1218e0a5c4..b9391bb8b5699e 100644 --- a/src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.cs +++ b/src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.cs @@ -50,7 +50,7 @@ internal unsafe struct SHELLEXECUTEINFO internal const uint SEE_MASK_NOCLOSEPROCESS = 0x00000040; internal const uint SEE_MASK_FLAG_NO_UI = 0x00000400; - [GeneratedDllImport(Libraries.Shell32, SetLastError = true)] + [LibraryImport(Libraries.Shell32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool ShellExecuteExW( SHELLEXECUTEINFO* pExecInfo); diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs index b537e7855593db..1c2444f0f67acb 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [GeneratedDllImport(Interop.Libraries.SspiCli)] + [LibraryImport(Interop.Libraries.SspiCli)] internal static partial int LsaConnectUntrusted(out SafeLsaHandle LsaHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs index 8cc158ef64570d..4d4b9fe8464d55 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [GeneratedDllImport(Interop.Libraries.SspiCli)] + [LibraryImport(Interop.Libraries.SspiCli)] internal static partial int LsaDeregisterLogonProcess(IntPtr LsaHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs index 1c6705ee2d5791..89bef758ddc72f 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int LsaFreeReturnBuffer(IntPtr handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs index 08f1da5b6507ec..ea358a4b5b4faf 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int LsaGetLogonSessionData( ref LUID LogonId, out SafeLsaReturnBufferHandle ppLogonSessionData); diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs index 83efbbaab90e35..390734113cdf61 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [GeneratedDllImport(Libraries.SspiCli)] + [LibraryImport(Libraries.SspiCli)] internal static partial int LsaLogonUser( SafeLsaHandle LsaHandle, in Advapi32.LSA_STRING OriginName, diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs index a6c910ee5ee107..b99810a84a1e28 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [GeneratedDllImport(Libraries.SspiCli)] + [LibraryImport(Libraries.SspiCli)] internal static partial int LsaLookupAuthenticationPackage( SafeLsaHandle LsaHandle, ref Advapi32.LSA_STRING PackageName, diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs index dfc7ac02536aa3..220129431d4976 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs @@ -331,38 +331,38 @@ internal unsafe struct SecPkgCred_ClientCertPolicy public char* pwszSslCtlIdentifier; } - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int EncryptMessage( ref CredHandle contextHandle, uint qualityOfProtection, ref SecBufferDesc inputOutput, uint sequenceNumber); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static unsafe partial int DecryptMessage( ref CredHandle contextHandle, ref SecBufferDesc inputOutput, uint sequenceNumber, uint* qualityOfProtection); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int QuerySecurityContextToken( ref CredHandle phContext, out SecurityContextTokenHandle handle); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int FreeContextBuffer( IntPtr contextBuffer); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int FreeCredentialsHandle( ref CredHandle handlePtr); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int DeleteSecurityContext( ref CredHandle handlePtr); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static unsafe partial int AcceptSecurityContext( ref CredHandle credentialHandle, void* inContextPtr, @@ -374,25 +374,25 @@ internal static unsafe partial int AcceptSecurityContext( ref ContextFlags attributes, out long timeStamp); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static unsafe partial int QueryContextAttributesW( ref CredHandle contextHandle, ContextAttribute attribute, void* buffer); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int SetContextAttributesW( ref CredHandle contextHandle, ContextAttribute attribute, byte[] buffer, int bufferSize); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int EnumerateSecurityPackagesW( out int pkgnum, out SafeFreeContextBuffer_SECURITY handle); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int AcquireCredentialsHandleW( string? principal, string moduleName, @@ -404,7 +404,7 @@ internal static unsafe partial int AcquireCredentialsHandleW( ref CredHandle handlePtr, out long timeStamp); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int AcquireCredentialsHandleW( string? principal, string moduleName, @@ -416,7 +416,7 @@ internal static unsafe partial int AcquireCredentialsHandleW( ref CredHandle handlePtr, out long timeStamp); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int AcquireCredentialsHandleW( string? principal, string moduleName, @@ -428,7 +428,7 @@ internal static unsafe partial int AcquireCredentialsHandleW( ref CredHandle handlePtr, out long timeStamp); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int AcquireCredentialsHandleW( string? principal, string moduleName, @@ -440,7 +440,7 @@ internal static unsafe partial int AcquireCredentialsHandleW( ref CredHandle handlePtr, out long timeStamp); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static unsafe partial int InitializeSecurityContextW( ref CredHandle credentialHandle, void* inContextPtr, @@ -455,28 +455,28 @@ internal static unsafe partial int InitializeSecurityContextW( ref ContextFlags attributes, out long timeStamp); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static unsafe partial int CompleteAuthToken( void* inContextPtr, ref SecBufferDesc inputBuffers); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static unsafe partial int ApplyControlToken( void* inContextPtr, ref SecBufferDesc inputBuffers); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial SECURITY_STATUS SspiFreeAuthIdentity( IntPtr authData); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial SECURITY_STATUS SspiEncodeStringsAsAuthIdentity( string userName, string domainName, string password, out SafeSspiAuthDataHandle authData); - [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] + [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial SECURITY_STATUS SetCredentialsAttributesW( in CredHandle handlePtr, long ulAttribute, diff --git a/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs b/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs index a87db6074cb7b1..89481e2d49256f 100644 --- a/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs @@ -9,31 +9,31 @@ internal static partial class Interop internal static unsafe partial class Ucrtbase { #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void* _aligned_malloc(nuint size, nuint alignment); - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void _aligned_free(void* ptr); - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void* _aligned_realloc(void* ptr, nuint size, nuint alignment); - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void* calloc(nuint num, nuint size); - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void free(void* ptr); - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void* malloc(nuint size); - [GeneratedDllImport(Libraries.Ucrtbase)] + [LibraryImport(Libraries.Ucrtbase)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial void* realloc(void* ptr, nuint new_size); #pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs index 18f69bdeac73cb..b85d0d4d565205 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr CreateWindowExW( int exStyle, string lpszClassName, diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs index b41bcf9082b510..81dfd508a3e7ad 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr DefWindowProcW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs index 17ae9581152ca5..461244ae4f0c79 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool DestroyWindow(IntPtr hWnd); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs index efd057a296fc72..7aedb0ebb41971 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial int DispatchMessageW(ref MSG msg); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs index c5008429fac732..a7e3b0b8ab9377 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static unsafe partial Interop.BOOL EnumWindows(delegate* unmanaged callback, IntPtr extraData); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs index 3cd58188bf65b2..7218439fee206c 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr FindWindowW(string lpClassName, string lpWindowName); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs index b4330750678568..642e305127994b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetDC.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetDC.cs index 597ad6b654ba72..5f6c796c902c65 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetDC.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr GetDC(IntPtr hWnd); public static IntPtr GetDC(HandleRef hWnd) diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs index 9ee51a05404fca..be751199d8edcf 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] internal static partial short GetKeyState(int virtualKeyCode); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.cs index 70caacaedac236..e9033a7dceb936 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial int GetMessageW(ref MSG msg, IntPtr hwnd, int msgMin, int msgMax); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs index a63a0e5a63222d..9d5a4607d817fb 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] internal static partial IntPtr GetProcessWindowStation(); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs index 96f620139d9bb0..618389cead758c 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs @@ -15,7 +15,7 @@ internal static partial class User32 // index that doesn't exist. [SuppressGCTransition] - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] internal static partial uint GetSysColor(int nIndex); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs index e026a50ffa6f06..6095fdf7ee9622 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static unsafe partial bool GetUserObjectInformationW(IntPtr hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs index 3091b5c58e5af8..f4bb6c8b85ad21 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr GetWindow(IntPtr hWnd, int uCmd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs index 9cc34ee12fbcb0..62b267f48c0b70 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, EntryPoint = "GetWindowLongW")] + [LibraryImport(Libraries.User32, EntryPoint = "GetWindowLongW")] public static partial int GetWindowLong(IntPtr hWnd, int uCmd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.cs index c2b4a2cfaa7000..d379b13e58915e 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] public static partial int GetWindowTextLengthW(IntPtr hWnd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.cs index 9eb8c1f116cb00..f7b1fdfbdbff63 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] public static unsafe partial int GetWindowTextW(IntPtr hWnd, char* lpString, int nMaxCount); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs index 0b8fecf83a88aa..03a9fd08c5d464 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static unsafe partial int GetWindowThreadProcessId(IntPtr handle, int* processId); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs index 96ae83dbd9869a..11ae55e9f7817d 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool IsWindow(IntPtr hWnd); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs index c09bfb716fada2..8acaaae75e180b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial BOOL IsWindowVisible(IntPtr hWnd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs index a6b086488caae2..10da9e25ddbb7a 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool KillTimer(IntPtr hwnd, IntPtr idEvent); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs index 639c0b1698ab76..d0e411c74aa5ba 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadStringW", SetLastError = true)] + [LibraryImport(Libraries.User32, EntryPoint = "LoadStringW", SetLastError = true)] internal static unsafe partial int LoadString(IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs index a98afe4a3e78a8..48df4342e4defb 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs @@ -13,7 +13,7 @@ internal static partial class User32 internal const int MB_ICONEXCLAMATION = 0x30; internal const int MB_ICONASTERISK = 0x40; - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool MessageBeep(int type); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs index 0d7e99cea7d2b7..8f2caae358391b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs index 729cedbc1b917a..7d3efed00d0d92 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial int PostMessageW(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.cs index 1b9f80168cf799..78fd2afe6a2135 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial void PostQuitMessage(int exitCode); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs index 5254e3efd5d842..e18c4803c0484c 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] public static partial short RegisterClassW(ref WNDCLASS wc); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs index 1bf0969de74916..60e6527524cc9b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)] public static partial int RegisterWindowMessageW(string msg); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.ReleaseDC.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.ReleaseDC.cs index 0f596aa2997484..c4d1866ebc429b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.ReleaseDC.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.ReleaseDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial int ReleaseDC(IntPtr hWnd, IntPtr hDC); public static int ReleaseDC(HandleRef hWnd, IntPtr hDC) diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs index 72f350af3c262d..cdd78ab64c227b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr SendMessageW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs index d3ebb4a04a4d9d..7d30556693369f 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")] + [LibraryImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")] public static unsafe partial IntPtr SendMessageTimeout(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, int flags, int timeout, IntPtr* pdwResult); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs index 59705ea4408b9d..180e51fd0ee74e 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr SetClassLongW(IntPtr hwnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs index 8a1924e886e355..802ffd5665f404 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr SetClassLongPtrW(IntPtr hwnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs index efc613fbb4eb39..a54cb03e8b4585 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, int uElapse, IntPtr lpTimerProc); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs index b0532f1707349a..8a16532bb0aa0f 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr SetWindowLongW(IntPtr hWnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs index 04f38129aeee5f..d9bbfbf21aa184 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr SetWindowLongPtrW(IntPtr hWnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.cs index fa52581bf53396..5bca617b9b6f97 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.cs @@ -14,7 +14,7 @@ public enum SystemParametersAction : uint SPI_GETNONCLIENTMETRICS = 0x29 } - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] [return: MarshalAs(UnmanagedType.Bool)] public static unsafe partial bool SystemParametersInfoW(SystemParametersAction uiAction, uint uiParam, void* pvParam, uint fWinIni); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs index c26f6693e2c3e8..a1821fa753cbc7 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool TranslateMessage(ref MSG msg); } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs index 3379b063e44a11..77e1b7cc6522c1 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial short UnregisterClassW(string lpClassName, IntPtr hInstance); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.cs index e4f98acb30c55a..ee65f3b0780ea0 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial int WaitForInputIdle(SafeProcessHandle handle, int milliseconds); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.WindowFromDC.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.WindowFromDC.cs index b92572564b8c5a..b88ace7a85a9f4 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.WindowFromDC.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.WindowFromDC.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32)] + [LibraryImport(Libraries.User32)] public static partial IntPtr WindowFromDC(IntPtr hDC); public static IntPtr WindowFromDC(HandleRef hDC) diff --git a/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.cs b/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.cs index a06cefa006ef45..0b2dd9d6cdbf66 100644 --- a/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Version { - [GeneratedDllImport(Libraries.Version, EntryPoint = "GetFileVersionInfoExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Version, EntryPoint = "GetFileVersionInfoExW", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetFileVersionInfoEx( uint dwFlags, diff --git a/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.cs b/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.cs index b59284751c5907..be1e64b3ed2280 100644 --- a/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Version { - [GeneratedDllImport(Libraries.Version, EntryPoint = "GetFileVersionInfoSizeExW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Version, EntryPoint = "GetFileVersionInfoSizeExW", StringMarshalling = StringMarshalling.Utf16)] internal static partial uint GetFileVersionInfoSizeEx(uint dwFlags, string lpwstrFilename, out uint lpdwHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.cs b/src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.cs index 746285fe0bc764..4bd3a4a9fcbf29 100644 --- a/src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Version { - [GeneratedDllImport(Libraries.Version, EntryPoint = "VerQueryValueW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Version, EntryPoint = "VerQueryValueW", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool VerQueryValue(IntPtr pBlock, string lpSubBlock, out IntPtr lplpBuffer, out uint puLen); } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.cs index 9d771af4bcac12..6201d6fb56436d 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial void WebSocketAbortHandle(SafeHandle webSocketHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs index f545dcf7ba56ab..72eba5ed6f846f 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketBeginClientHandshake( SafeHandle webSocketHandle, IntPtr subProtocols, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs index 5d93d76f2638e3..20b0d9c782e1d9 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketBeginServerHandshake( SafeHandle webSocketHandle, IntPtr subProtocol, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.cs index c79f0292000db6..1966bd9ba853c0 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial void WebSocketCompleteAction( SafeHandle webSocketHandle, IntPtr actionContext, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.cs index dac7cc82020043..33c64a7e7e3852 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketCreateClientHandle( Property[] properties, uint propertyCount, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.cs index c90142692877a7..e7f058468075ac 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketCreateServerHandle( Property[] properties, uint propertyCount, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs index d7f9b9d0944170..c8cccbdddd0225 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial void WebSocketDeleteHandle( IntPtr webSocketHandle); } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.cs index 8be9ebe0fdcaa8..e7a43c95ca836a 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketEndServerHandshake(SafeHandle webSocketHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.cs index 567705db9f0ca4..9f4ac61846f994 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketGetAction( SafeHandle webSocketHandle, ActionQueue actionQueue, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.cs index 3d40348d7fa7e1..45980ec36bb139 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket)] + [LibraryImport(Libraries.WebSocket)] internal static partial int WebSocketReceive( SafeHandle webSocketHandle, IntPtr buffers, diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.cs index eb6205f5bf906b..2ebd535519b22e 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.cs @@ -10,14 +10,14 @@ internal static partial class Interop { internal static partial class WebSocket { - [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")] + [LibraryImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")] internal static partial int WebSocketSend_Raw( SafeHandle webSocketHandle, BufferType bufferType, ref Buffer buffer, IntPtr applicationContext); - [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")] + [LibraryImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")] internal static partial int WebSocketSendWithoutBody_Raw( SafeHandle webSocketHandle, BufferType bufferType, diff --git a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs index 8edc9e64e7bb7a..7074ad6cdc01df 100644 --- a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs +++ b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs @@ -9,26 +9,26 @@ internal static partial class Interop { internal static partial class WinHttp { - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial SafeWinHttpHandle WinHttpOpen( IntPtr userAgent, uint accessType, string? proxyName, string? proxyBypass, int flags); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpCloseHandle( IntPtr handle); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial SafeWinHttpHandle WinHttpConnect( SafeWinHttpHandle sessionHandle, string serverName, ushort serverPort, uint reserved); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial SafeWinHttpHandle WinHttpOpenRequest( SafeWinHttpHandle connectHandle, string verb, @@ -38,7 +38,7 @@ public static partial SafeWinHttpHandle WinHttpOpenRequest( string acceptTypes, uint flags); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpAddRequestHeaders( SafeWinHttpHandle requestHandle, @@ -73,7 +73,7 @@ public void FreeNative() } #endif - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpAddRequestHeaders( SafeWinHttpHandle requestHandle, @@ -81,7 +81,7 @@ public static partial bool WinHttpAddRequestHeaders( uint headersLength, uint modifiers); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSendRequest( SafeWinHttpHandle requestHandle, @@ -92,19 +92,19 @@ public static partial bool WinHttpSendRequest( uint totalLength, IntPtr context); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpReceiveResponse( SafeWinHttpHandle requestHandle, IntPtr reserved); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryDataAvailable( SafeWinHttpHandle requestHandle, IntPtr parameterIgnoredAndShouldBeNullForAsync); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpReadData( SafeWinHttpHandle requestHandle, @@ -112,7 +112,7 @@ public static partial bool WinHttpReadData( uint bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryHeaders( SafeWinHttpHandle requestHandle, @@ -122,7 +122,7 @@ public static partial bool WinHttpQueryHeaders( ref uint bufferLength, ref uint index); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryHeaders( SafeWinHttpHandle requestHandle, @@ -132,7 +132,7 @@ public static partial bool WinHttpQueryHeaders( ref uint bufferLength, IntPtr index); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryOption( SafeWinHttpHandle handle, @@ -140,7 +140,7 @@ public static partial bool WinHttpQueryOption( ref IntPtr buffer, ref uint bufferSize); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryOption( SafeWinHttpHandle handle, @@ -148,7 +148,7 @@ public static partial bool WinHttpQueryOption( IntPtr buffer, ref uint bufferSize); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryOption( SafeWinHttpHandle handle, @@ -156,7 +156,7 @@ public static partial bool WinHttpQueryOption( ref uint buffer, ref uint bufferSize); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpWriteData( SafeWinHttpHandle requestHandle, @@ -164,7 +164,7 @@ public static partial bool WinHttpWriteData( uint bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetOption( SafeWinHttpHandle handle, @@ -172,7 +172,7 @@ public static partial bool WinHttpSetOption( ref uint optionData, uint optionLength = sizeof(uint)); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetOption( SafeWinHttpHandle handle, @@ -180,7 +180,7 @@ public static partial bool WinHttpSetOption( IntPtr optionData, uint optionLength); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetCredentials( SafeWinHttpHandle requestHandle, @@ -190,7 +190,7 @@ public static partial bool WinHttpSetCredentials( string? password, IntPtr reserved); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryAuthSchemes( SafeWinHttpHandle requestHandle, @@ -198,7 +198,7 @@ public static partial bool WinHttpQueryAuthSchemes( out uint firstScheme, out uint authTarget); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetTimeouts( SafeWinHttpHandle handle, @@ -207,19 +207,19 @@ public static partial bool WinHttpSetTimeouts( int sendTimeout, int receiveTimeout); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpGetIEProxyConfigForCurrentUser( out WINHTTP_CURRENT_USER_IE_PROXY_CONFIG proxyConfig); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)]public static partial bool WinHttpGetProxyForUrl( SafeWinHttpHandle? sessionHandle, string url, ref WINHTTP_AUTOPROXY_OPTIONS autoProxyOptions, out WINHTTP_PROXY_INFO proxyInfo); - [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] public static partial IntPtr WinHttpSetStatusCallback( SafeWinHttpHandle handle, WINHTTP_STATUS_CALLBACK callback, diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs index 45a8251b1d0a7b..55ca77837ab4aa 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs @@ -17,11 +17,11 @@ internal static partial class WinMM internal const int SND_FILENAME = 0x20000; internal const int SND_NOSTOP = 0x10; - [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.WinMM, EntryPoint = "PlaySoundW", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PlaySound(string soundName, IntPtr hmod, int soundFlags); - [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW")] + [LibraryImport(Libraries.WinMM, EntryPoint = "PlaySoundW")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PlaySound(byte[]? soundName, IntPtr hmod, int soundFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs index 66ca175b0493d0..54dada5368dc48 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WinMM { - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static unsafe partial int mmioAscend(IntPtr hMIO, MMCKINFO* lpck, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs index dc3c9af75f5bef..3117353163c183 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WinMM { - [GeneratedDllImport(Interop.Libraries.WinMM)] + [LibraryImport(Interop.Libraries.WinMM)] internal static partial int mmioClose(IntPtr hMIO, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs index 9b3396350d3b0c..ba4019768dd4cc 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs @@ -10,7 +10,7 @@ internal static partial class WinMM { internal const int MMIO_FINDRIFF = 0x00000020; - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static unsafe partial int mmioDescend( IntPtr hMIO, MMCKINFO* lpck, diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs index 85da9dfc980473..d0f01df354b3ed 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs @@ -11,7 +11,7 @@ internal static partial class WinMM internal const int MMIO_READ = 0x00000000; internal const int MMIO_ALLOCBUF = 0x00010000; - [GeneratedDllImport(Libraries.WinMM, EntryPoint = "mmioOpenW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.WinMM, EntryPoint = "mmioOpenW", StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr mmioOpen(string fileName, IntPtr not_used, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs index 18c4007a5ff88b..ecf8a0e3ca046a 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs @@ -24,7 +24,7 @@ internal sealed class WAVEFORMATEX internal const int WAVE_FORMAT_ADPCM = 0x0002; internal const int WAVE_FORMAT_IEEE_FLOAT = 0x0003; - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial int mmioRead(IntPtr hMIO, [MarshalAs(UnmanagedType.LPArray)] byte[] wf, int cch); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs index ffbd5829d91506..b7b6e4e856eb4b 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs @@ -14,7 +14,7 @@ internal static partial class WinMM /// Handle to the waveform-audio output device. If the function /// succeeds, the handle is no longer valid after this call. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutClose(IntPtr hwo); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs index 31a5a78df9eae7..5a13e91d7bf109 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs @@ -34,7 +34,7 @@ internal struct WAVEOUTCAPS /// information about the capabilities of the device. /// Size, in bytes, of the WAVEOUTCAPS structure. /// MMSYSERR -#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. [DllImport(Libraries.WinMM)] internal static extern MMSYSERR waveOutGetDevCaps(IntPtr uDeviceID, ref WAVEOUTCAPS caps, int cbwoc); diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs index 0878bc92ddfd17..396649ff6c9cf9 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs @@ -14,7 +14,7 @@ internal static partial class WinMM /// /// The number of devices indicates success. Zero indicates that /// no devices are present or that an error occurred. - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial int waveOutGetNumDevs(); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs index 1fbb89c8836dc9..41e46950029329 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs @@ -45,7 +45,7 @@ internal enum MM_MSG /// mechanism. /// Flags for opening the device. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutOpen(ref IntPtr phwo, int uDeviceID, byte[] pwfx, WaveOutProc dwCallback, IntPtr dwInstance, uint fdwOpen); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs index 02b5d5a13d014d..092463dba5138a 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs @@ -15,7 +15,7 @@ internal static partial class WinMM /// /// Handle to the waveform-audio output device. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutPause(IntPtr hwo); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs index a8921127996e06..87cb5528831c71 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs @@ -33,7 +33,7 @@ internal struct WAVEHDR /// respect to the sample size. /// Size, in bytes, of the WaveHeader structure. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutPrepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); /// @@ -46,7 +46,7 @@ internal struct WAVEHDR /// to be cleaned up. /// Size, in bytes, of the WaveHeader structure. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutUnprepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs index 6b98aa846b7991..0920075cd08820 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs @@ -15,7 +15,7 @@ internal static partial class WinMM /// /// Handle to the waveform-audio output device. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutReset(IntPtr hwo); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs index c9282fd393f385..438dedac251dec 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs @@ -13,7 +13,7 @@ internal static partial class WinMM /// /// Handle to the waveform-audio output device. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutRestart(IntPtr hwo); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs index ff37bc6336e564..d6e985152752e6 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs @@ -16,7 +16,7 @@ internal static partial class WinMM /// about the data block. /// Size, in bytes, of the WaveHeader structure. /// MMSYSERR - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutWrite(IntPtr hwo, IntPtr pwh, int cbwh); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs index 4fc9f28c55c407..a0d6906931f3a5 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs @@ -17,7 +17,7 @@ internal static partial class Winsock internal const int NS_ALL = 0; - [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int GetAddrInfoExW( string pName, string? pServiceName, @@ -30,10 +30,10 @@ internal static unsafe partial int GetAddrInfoExW( delegate* unmanaged lpCompletionRoutine, IntPtr* lpNameHandle); - [GeneratedDllImport(Libraries.Ws2_32)] + [LibraryImport(Libraries.Ws2_32)] internal static unsafe partial int GetAddrInfoExCancel(IntPtr* lpHandle); - [GeneratedDllImport(Libraries.Ws2_32)] + [LibraryImport(Libraries.Ws2_32)] internal static unsafe partial void FreeAddrInfoExW(AddressInfoEx* pAddrInfo); [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs index 70be2c9a38e0af..a1f93ba5930014 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs @@ -9,14 +9,14 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int GetAddrInfoW( string pNameName, string? pServiceName, AddressInfo* pHints, AddressInfo** ppResult); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial void FreeAddrInfoW(AddressInfo* info); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetNameInfoW.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetNameInfoW.cs index 2a5882ddae5b44..e98ab74bd318e1 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetNameInfoW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetNameInfoW.cs @@ -19,7 +19,7 @@ internal enum NameInfoFlags NI_DGRAM = 0x10, /* Service is a datagram service */ } - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial SocketError GetNameInfoW( byte* pSockaddr, int SockaddrLength, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.TransmitFile.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.TransmitFile.cs index f3559056b07444..d3f4970615e0f0 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.TransmitFile.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.TransmitFile.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Mswsock { - [GeneratedDllImport(Interop.Libraries.Mswsock, SetLastError = true)] + [LibraryImport(Interop.Libraries.Mswsock, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool TransmitFile( SafeHandle socket, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.cs index 6d827d94e2332a..77c846af58f8d0 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError WSAConnect( SafeSocketHandle socketHandle, byte[] socketAddress, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSADuplicateSocket.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSADuplicateSocket.cs index 1d1254646d552a..99adc78d9ca954 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSADuplicateSocket.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSADuplicateSocket.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", SetLastError = true)] internal static unsafe partial int WSADuplicateSocket( SafeSocketHandle s, uint dwProcessId, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAEventSelect.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAEventSelect.cs index a3903f29c3dbb6..bdd0758cb63d60 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAEventSelect.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAEventSelect.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError WSAEventSelect( SafeSocketHandle socketHandle, SafeHandle Event, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAGetOverlappedResult.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAGetOverlappedResult.cs index daab1205e48f47..da2513498838e3 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAGetOverlappedResult.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAGetOverlappedResult.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool WSAGetOverlappedResult( SafeSocketHandle socketHandle, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs index 67757a5ef6f47a..d7804bc7cbd364 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal static partial class Winsock { // Used with SIOGETEXTENSIONFUNCTIONPOINTER - we're assuming that will never block. - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError WSAIoctl( SafeSocketHandle socketHandle, int ioControlCode, @@ -22,7 +22,7 @@ internal static partial SocketError WSAIoctl( IntPtr shouldBeNull, IntPtr shouldBeNull2); - [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)] internal static partial SocketError WSAIoctl_Blocking( SafeSocketHandle socketHandle, int ioControlCode, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.cs index 1a9f090bd83c38..90afd2f18bcf62 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError WSARecv( SafeHandle socketHandle, WSABuffer* buffer, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecvFrom.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecvFrom.cs index dc200e6c8fd306..7783bb39c6bbb2 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecvFrom.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecvFrom.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] private static unsafe partial SocketError WSARecvFrom( SafeHandle socketHandle, WSABuffer* buffers, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASend.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASend.cs index 583674f8f4aa82..6b10133721f7e9 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASend.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASend.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError WSASend( SafeHandle socketHandle, WSABuffer* buffers, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASendTo.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASendTo.cs index 4896eb8557ad51..997af046ecaba6 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASendTo.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASendTo.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] private static unsafe partial SocketError WSASendTo( SafeHandle socketHandle, WSABuffer* buffers, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.SafeCloseSocket.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.SafeCloseSocket.cs index 9ababac9065061..fe2974dac45311 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.SafeCloseSocket.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.SafeCloseSocket.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr WSASocketW( AddressFamily addressFamily, SocketType socketType, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.cs index f18f7d214f8abc..45f8612ce79532 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial IntPtr WSASocketW( AddressFamily addressFamily, SocketType socketType, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs index 4031576c64f46f..c9f4926a595c11 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs @@ -39,10 +39,10 @@ static unsafe void Initialize() } } - [GeneratedDllImport(Libraries.Ws2_32)] + [LibraryImport(Libraries.Ws2_32)] private static unsafe partial SocketError WSAStartup(short wVersionRequested, WSAData* lpWSAData); - [GeneratedDllImport(Libraries.Ws2_32)] + [LibraryImport(Libraries.Ws2_32)] private static partial SocketError WSACleanup(); [StructLayout(LayoutKind.Sequential, Size = 408)] diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.cs index 2cdc1bb76dc29f..2202c0815ff177 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial IntPtr accept( SafeSocketHandle socketHandle, byte[] socketAddress, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.cs index a5f8d3b6645577..6d5f0d4840c6bc 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError bind( SafeSocketHandle socketHandle, byte[] socketAddress, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.cs index c646d471a289cf..bcf82717ae8527 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError closesocket(IntPtr socketHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.cs index 54b90ef1df81fa..184a369a5eb820 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError gethostname(byte* name, int namelen); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.cs index fa7b34683d5025..67cf50cae11161 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError getpeername( SafeSocketHandle socketHandle, byte* socketAddress, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.cs index d177ac70cacae9..8d1d9d0471f554 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError getsockname( SafeSocketHandle socketHandle, byte* socketAddress, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs index f9885d46f63073..aa06846f8c4e1a 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError getsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -16,7 +16,7 @@ internal static unsafe partial SocketError getsockopt( byte* optionValue, ref int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError getsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -24,7 +24,7 @@ internal static partial SocketError getsockopt( out Linger optionValue, ref int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError getsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -32,7 +32,7 @@ internal static partial SocketError getsockopt( out IPMulticastRequest optionValue, ref int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError getsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.ioctlsocket.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.ioctlsocket.cs index f5397238cb6bdb..c838a109fd509e 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.ioctlsocket.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.ioctlsocket.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError ioctlsocket( IntPtr handle, int cmd, ref int argp); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError ioctlsocket( SafeSocketHandle socketHandle, int cmd, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.cs index a86447206247d6..cc7940e30290d5 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError listen( SafeSocketHandle socketHandle, int backlog); diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.cs index 20f0a6801a4ab4..479d412bc3c4c9 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial int recv( SafeSocketHandle socketHandle, byte* pinnedBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.cs index 14daa97315975f..8c470c30268ef3 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal static partial class Winsock { // This method is always blocking, so it uses an IntPtr. - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial int recvfrom( SafeSocketHandle socketHandle, byte* pinnedBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.select.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.select.cs index 889bdeea2aa84a..2762e4e251a1a4 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.select.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.select.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial int select( int ignoredParameter, IntPtr* readfds, @@ -16,7 +16,7 @@ internal static unsafe partial int select( IntPtr* exceptfds, ref TimeValue timeout); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial int select( int ignoredParameter, IntPtr* readfds, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.cs index 4c75af9669fcff..69dd71fdceebb8 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial int send( SafeSocketHandle socketHandle, byte* pinnedBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.cs index c2dfd4801f7435..01e036664049ec 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial int sendto( SafeSocketHandle socketHandle, byte* pinnedBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs index f980e317470ba0..803748e78db767 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError setsockopt( IntPtr handle, SocketOptionLevel optionLevel, @@ -17,7 +17,7 @@ internal static partial SocketError setsockopt( ref Linger linger, int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError setsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -25,7 +25,7 @@ internal static partial SocketError setsockopt( ref int optionValue, int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static unsafe partial SocketError setsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -33,7 +33,7 @@ internal static unsafe partial SocketError setsockopt( byte* optionValue, int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError setsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -41,7 +41,7 @@ internal static partial SocketError setsockopt( ref IntPtr pointer, int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError setsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -49,7 +49,7 @@ internal static partial SocketError setsockopt( ref Linger linger, int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError setsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, @@ -57,7 +57,7 @@ internal static partial SocketError setsockopt( ref IPMulticastRequest mreq, int optionLength); - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError setsockopt( SafeSocketHandle socketHandle, SocketOptionLevel optionLevel, diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.cs index 870a9c33328335..4fd9231d647113 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Winsock { - [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)] internal static partial SocketError shutdown( SafeSocketHandle socketHandle, int how); diff --git a/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs b/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs index b21852267e1a0a..caef99cb73dcb4 100644 --- a/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Wkscli { - [GeneratedDllImport(Libraries.Wkscli, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wkscli, StringMarshalling = StringMarshalling.Utf16)] internal static partial int NetWkstaGetInfo(string server, int level, ref IntPtr buffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.cs b/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.cs index ea1f38f2f5c23c..9d5d8387883ab0 100644 --- a/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.cs +++ b/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.cs @@ -9,63 +9,63 @@ internal static partial class Interop { internal static partial class Ldap { - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_free", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_free", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ber_free(IntPtr berelement, int option); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_alloc_t", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_alloc_t", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ber_alloc(int option); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_printf(SafeBerHandle berElement, string format, IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_printf(SafeBerHandle berElement, string format, HGlobalMemHandle value, uint length); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_printf(SafeBerHandle berElement, string format); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_printf(SafeBerHandle berElement, string format, int value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_printf(SafeBerHandle berElement, string format, uint tag); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_flatten", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_flatten", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_flatten(SafeBerHandle berElement, ref IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_init", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_init", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ber_init(BerVal value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_scanf(SafeBerHandle berElement, string format); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_scanf(SafeBerHandle berElement, string format, ref IntPtr ptrResult, ref uint bitLength); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_scanf(SafeBerHandle berElement, string format, ref int result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_scanf(SafeBerHandle berElement, string format, ref IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_bvfree", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_bvfree", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_bvfree(IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_bvecfree", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_bvecfree", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ber_bvecfree(IntPtr value); } diff --git a/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.cs b/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.cs index c784fe967d8fcd..7ebc9ace89b851 100644 --- a/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.cs +++ b/src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.cs @@ -9,194 +9,194 @@ internal static partial class Interop { internal static partial class Ldap { - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_bind_sW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_bind_sW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_bind_s(ConnectionHandle ldapHandle, string dn, in SEC_WINNT_AUTH_IDENTITY_EX credentials, BindMethod method); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_initW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_initW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_init(string hostName, int portNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_connect")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_connect")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_connect(ConnectionHandle ldapHandle, in LDAP_TIMEVAL timeout); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_unbind")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_unbind")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_unbind(IntPtr ldapHandle); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_get_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_set_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int inValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_get_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void* outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "LdapGetLastError")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "LdapGetLastError")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int LdapGetLastError(); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "cldap_openW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "cldap_openW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr cldap_open(string hostName, int portNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_simple_bind_sW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_simple_bind_sW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_simple_bind_s(ConnectionHandle ldapHandle, string distinguishedName, string password); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_delete_extW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_delete_extW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_delete_ext(ConnectionHandle ldapHandle, string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_result", SetLastError = true)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result", SetLastError = true)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_result(ConnectionHandle ldapHandle, int messageId, int all, in LDAP_TIMEVAL timeout, ref IntPtr Mesage); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_parse_result(ConnectionHandle ldapHandle, IntPtr result, ref int serverError, ref IntPtr dn, ref IntPtr message, ref IntPtr referral, ref IntPtr control, byte freeIt); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_parse_result_referral(ConnectionHandle ldapHandle, IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_memfreeW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_memfreeW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial void ldap_memfree(IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_value_freeW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_value_freeW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_value_free(IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_controls_freeW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_controls_freeW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_controls_free(IntPtr value); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_abandon")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_abandon")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_abandon(ConnectionHandle ldapHandle, int messagId); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_start_tls_sW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_start_tls_sW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_start_tls(ConnectionHandle ldapHandle, ref int ServerReturnValue, ref IntPtr Message, IntPtr ServerControls, IntPtr ClientControls); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_stop_tls_s")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_stop_tls_s")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial byte ldap_stop_tls(ConnectionHandle ldapHandle); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_rename_extW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_rename_extW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_rename(ConnectionHandle ldapHandle, string dn, string newRdn, string newParentDn, int deleteOldRdn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_compare_extW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_compare_extW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_compare(ConnectionHandle ldapHandle, string dn, string attributeName, string strValue, BerVal binaryValue, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_add_extW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_add_extW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_add(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_modify_extW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_modify_extW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_modify(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_extended_operationW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_extended_operationW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_extended_operation(ConnectionHandle ldapHandle, string oid, BerVal data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_extended_resultW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_extended_resultW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_parse_extended_result(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_msgfree")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_msgfree")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_msgfree(IntPtr result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_search_extW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_search_extW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_search(ConnectionHandle ldapHandle, string dn, int scope, string filter, IntPtr attributes, [MarshalAs(UnmanagedType.Bool)] bool attributeOnly, IntPtr servercontrol, IntPtr clientcontrol, int timelimit, int sizelimit, ref int messageNumber); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_entry")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_entry")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_first_entry(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_entry")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_entry")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_next_entry(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_reference")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_reference")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_first_reference(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_reference")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_reference")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_next_reference(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_dnW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_dnW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_get_dn(ConnectionHandle ldapHandle, IntPtr result); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_attributeW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_attributeW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_first_attribute(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr address); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_attributeW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_attributeW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_next_attribute(ConnectionHandle ldapHandle, IntPtr result, IntPtr address); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_values_lenW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_values_lenW", StringMarshalling = StringMarshalling.Utf16)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_get_values_len(ConnectionHandle ldapHandle, IntPtr result, string name); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_value_free_len")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_value_free_len")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial IntPtr ldap_value_free_len(IntPtr berelement); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_referenceW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_referenceW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_parse_reference(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr referrals); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_create_sort_controlW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_create_sort_controlW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_control_freeW")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_control_freeW")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_control_free(IntPtr control); - [GeneratedDllImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")] + [LibraryImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")] public static partial int CertFreeCRLContext(IntPtr certContext); - [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")] + [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt); } diff --git a/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.cs b/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.cs index e6811b1989fa76..7f1b2f1f7a30be 100644 --- a/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.cs +++ b/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Wtsapi32 { - [GeneratedDllImport(Libraries.Wtsapi32)] + [LibraryImport(Libraries.Wtsapi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WTSRegisterSessionNotification(IntPtr hWnd, int dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.cs b/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.cs index f5a521357f8d73..23d1b34bdef13e 100644 --- a/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.cs +++ b/src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Wtsapi32 { - [GeneratedDllImport(Libraries.Wtsapi32)] + [LibraryImport(Libraries.Wtsapi32)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WTSUnRegisterSessionNotification(IntPtr hWnd); } diff --git a/src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs b/src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs index e3d9021503b895..3b2d8d7dd747ba 100644 --- a/src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs +++ b/src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs @@ -292,7 +292,7 @@ private static partial class UnsafeNativeMethods private const string KERNEL32_LIB = "kernel32.dll"; // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).aspx - [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)] + [LibraryImport(KERNEL32_LIB, SetLastError = true)] public static partial VirtualAllocHandle VirtualAlloc( IntPtr lpAddress, IntPtr dwSize, @@ -300,7 +300,7 @@ public static partial VirtualAllocHandle VirtualAlloc( VirtualAllocProtection flProtect); // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366892(v=vs.85).aspx - [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)] + [LibraryImport(KERNEL32_LIB, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool VirtualFree( IntPtr lpAddress, @@ -308,7 +308,7 @@ public static partial bool VirtualFree( VirtualAllocAllocationType dwFreeType); // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366898(v=vs.85).aspx - [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)] + [LibraryImport(KERNEL32_LIB, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool VirtualProtect( IntPtr lpAddress, @@ -317,7 +317,7 @@ public static partial bool VirtualProtect( out VirtualAllocProtection lpflOldProtect); // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366902(v=vs.85).aspx - [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)] + [LibraryImport(KERNEL32_LIB, SetLastError = true)] public static partial IntPtr VirtualQuery( IntPtr lpAddress, out MEMORY_BASIC_INFORMATION lpBuffer, diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs index 5524fd8266d6b3..16755d5a35243f 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs @@ -326,13 +326,13 @@ private struct DistroInfo private static partial class @libc { - [GeneratedDllImport("libc", SetLastError = true)] + [LibraryImport("libc", SetLastError = true)] public static unsafe partial uint geteuid(); - [GeneratedDllImport("libc")] + [LibraryImport("libc")] public static partial IntPtr gnu_get_libc_release(); - [GeneratedDllImport("libc")] + [LibraryImport("libc")] public static partial IntPtr gnu_get_libc_version(); } } diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs index bd18d0caf7660c..c51437bae4f2cf 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs @@ -145,7 +145,7 @@ private static int GetWindowsProductType() private const int PRODUCT_HOME_PREMIUM = 0x00000003; private const int PRODUCT_HOME_PREMIUM_N = 0x0000001A; - [GeneratedDllImport("kernel32.dll", SetLastError = false)] + [LibraryImport("kernel32.dll", SetLastError = false)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetProductInfo( int dwOSMajorVersion, @@ -155,7 +155,7 @@ private static partial bool GetProductInfo( out int pdwReturnedProductType ); - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] private static partial int GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, byte[] applicationUserModelId); private static volatile Version s_windowsVersionObject; diff --git a/src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs b/src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs index bcb58507884866..371069c18a6a2d 100644 --- a/src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs +++ b/src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs @@ -109,17 +109,17 @@ private void CreateUser() } } - [GeneratedDllImport("advapi32.dll", EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("advapi32.dll", EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool LogonUser(string userName, string domain, string password, int logonType, int logonProvider, out SafeAccessTokenHandle safeAccessTokenHandle); -#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time - // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we add support for non-blittable struct marshalling. +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use LibraryImport once we add support for non-blittable struct marshalling. [DllImport("netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern uint NetUserAdd([MarshalAs(UnmanagedType.LPWStr)]string servername, uint level, ref USER_INFO_1 buf, out uint parm_err); -#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time - [GeneratedDllImport("netapi32.dll")] + [LibraryImport("netapi32.dll")] internal static partial uint NetUserDel([MarshalAs(UnmanagedType.LPWStr)]string servername, [MarshalAs(UnmanagedType.LPWStr)]string username); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] diff --git a/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs b/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs index 3d569d79f5b70a..11bb615d361fdc 100644 --- a/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs +++ b/src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs @@ -65,10 +65,10 @@ internal static partial class Interop [SuppressUnmanagedCodeSecurityAttribute] internal static partial class Kernel32 { - [GeneratedDllImport(nameof(Kernel32))] + [LibraryImport(nameof(Kernel32))] internal static partial int GetCurrentThreadId(); - [GeneratedDllImport(nameof(Kernel32))] + [LibraryImport(nameof(Kernel32))] internal static partial uint GetCurrentProcessId(); } } diff --git a/src/libraries/Microsoft.Win32.Registry/tests/Helpers.cs b/src/libraries/Microsoft.Win32.Registry/tests/Helpers.cs index faee4c9571c71d..2eb0534b2d9de2 100644 --- a/src/libraries/Microsoft.Win32.Registry/tests/Helpers.cs +++ b/src/libraries/Microsoft.Win32.Registry/tests/Helpers.cs @@ -9,7 +9,7 @@ namespace Microsoft.Win32.RegistryTests { internal static partial class Helpers { - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "RegSetValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "RegSetValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static partial int RegSetValue(SafeRegistryHandle handle, string value, int regType, string sb, int sizeIgnored); internal static bool SetDefaultValue(this RegistryKey key, string value) @@ -18,7 +18,7 @@ internal static bool SetDefaultValue(this RegistryKey key, string value) return RegSetValue(key.Handle, null, REG_SZ, value, 0) == 0; } - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "RegQueryValueExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "RegQueryValueExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static partial int RegQueryValueEx(SafeRegistryHandle handle, string valueName, int[] reserved, IntPtr regType, byte[] value, ref int size); internal static bool IsDefaultValueSet(this RegistryKey key) @@ -29,7 +29,7 @@ internal static bool IsDefaultValueSet(this RegistryKey key) return RegQueryValueEx(key.Handle, null, null, IntPtr.Zero, b, ref size) != ERROR_FILE_NOT_FOUND; } - [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool SetEnvironmentVariable(string lpName, string lpValue); } diff --git a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs index 69aa37b679495d..3211c14fec08e4 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs @@ -134,10 +134,10 @@ private unsafe static bool IsSignalIgnored(int signal) } } - [GeneratedDllImport("libc", SetLastError = true)] + [LibraryImport("libc", SetLastError = true)] private static partial int kill(int pid, int sig); - [GeneratedDllImport("libc", SetLastError = true)] + [LibraryImport("libc", SetLastError = true)] private static unsafe partial int sigaction(int signum, struct_sigaction* act, struct_sigaction* oldact); private const int SIGINT = 2; diff --git a/src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs b/src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs index 32363397a71be2..7e19d385d06b4c 100644 --- a/src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs +++ b/src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs @@ -67,9 +67,9 @@ public void OutputEncoding_SetUnicodeEncoding_SilentlyIgnoredInternally() }).Dispose(); } - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] public static partial uint GetConsoleCP(); - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] public static partial uint GetConsoleOutputCP(); } diff --git a/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs b/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs index e92d2cb45a27cc..147bf165f5025c 100644 --- a/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs +++ b/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs @@ -35,13 +35,13 @@ internal static unsafe IntPtr InterlockedExchangePointer( return actualPtr; } - [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)] internal static partial int ReleaseSemaphore(IntPtr handle, int releaseCount, IntPtr previousCount); - [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)] internal static partial int WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, [MarshalAs(UnmanagedType.Bool)] bool bWaitAll, uint dwMilliseconds, [MarshalAs(UnmanagedType.Bool)] bool bAlertable); - [GeneratedDllImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)] + [LibraryImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)] internal static partial int WaitForSingleObjectEx(IntPtr lpHandles, uint dwMilliseconds, [MarshalAs(UnmanagedType.Bool)] bool bAlertable); internal sealed class Wrapper diff --git a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs index d874526e2d97d4..d09e45ba0101aa 100644 --- a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs +++ b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs @@ -12,7 +12,7 @@ internal static partial class UnsafeNativeMethods // Oleaut32 // - [GeneratedDllImport(Interop.Libraries.OleAut32)] + [LibraryImport(Interop.Libraries.OleAut32)] internal static unsafe partial OleDbHResult GetErrorInfo( int dwReserved, System.IntPtr* ppIErrorInfo); diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs index 202abc1eab4060..a9b92a3bca47df 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs @@ -432,7 +432,7 @@ internal enum EvtSeekFlags EvtSeekStrict = 0x10000 } - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtQuery( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)] string path, @@ -440,7 +440,7 @@ internal static partial EventLogHandle EvtQuery( int flags); // SEEK - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtSeek( EventLogHandle resultSet, @@ -449,7 +449,7 @@ internal static partial bool EvtSeek( int timeout, EvtSeekFlags flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtSubscribe( EventLogHandle session, SafeWaitHandle signalEvent, @@ -460,7 +460,7 @@ internal static partial EventLogHandle EvtSubscribe( IntPtr callback, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtNext( EventLogHandle queryHandle, @@ -470,15 +470,15 @@ internal static partial bool EvtNext( int flags, ref int returned); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtCancel(EventLogHandle handle); - [GeneratedDllImport(Interop.Libraries.Wevtapi)] + [LibraryImport(Interop.Libraries.Wevtapi)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtClose(IntPtr handle); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetEventInfo( EventLogHandle eventHandle, @@ -487,7 +487,7 @@ internal static partial bool EvtGetEventInfo( IntPtr bufferPtr, out int bufferUsed); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetQueryInfo( EventLogHandle queryHandle, @@ -497,7 +497,7 @@ internal static partial bool EvtGetQueryInfo( ref int bufferRequired); // PUBLISHER METADATA - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenPublisherMetadata( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)] string publisherId, @@ -505,7 +505,7 @@ internal static partial EventLogHandle EvtOpenPublisherMetadata( int locale, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetPublisherMetadataProperty( EventLogHandle publisherMetadataHandle, @@ -517,13 +517,13 @@ internal static partial bool EvtGetPublisherMetadataProperty( // NEW - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetObjectArraySize( EventLogHandle objectArray, out int objectArraySize); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetObjectArrayProperty( EventLogHandle objectArray, @@ -535,17 +535,17 @@ internal static partial bool EvtGetObjectArrayProperty( out int propertyValueBufferUsed); // NEW 2 - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenEventMetadataEnum( EventLogHandle publisherMetadata, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtNextEventMetadata( EventLogHandle eventMetadataEnum, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetEventMetadataProperty( EventLogHandle eventMetadata, @@ -557,12 +557,12 @@ internal static partial bool EvtGetEventMetadataProperty( // Channel Configuration Native Api - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenChannelEnum( EventLogHandle session, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtNextChannelPath( EventLogHandle channelEnum, @@ -570,12 +570,12 @@ internal static partial bool EvtNextChannelPath( [Out] char[]? channelPathBuffer, out int channelPathBufferUsed); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenPublisherEnum( EventLogHandle session, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtNextPublisherId( EventLogHandle publisherEnum, @@ -583,19 +583,19 @@ internal static partial bool EvtNextPublisherId( [Out] char[]? publisherIdBuffer, out int publisherIdBufferUsed); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenChannelConfig( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)] string channelPath, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtSaveChannelConfig( EventLogHandle channelConfig, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtSetChannelConfigProperty( EventLogHandle channelConfig, @@ -603,7 +603,7 @@ internal static partial bool EvtSetChannelConfigProperty( int flags, ref EvtVariant propertyValue); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetChannelConfigProperty( EventLogHandle channelConfig, @@ -615,13 +615,13 @@ internal static partial bool EvtGetChannelConfigProperty( // Log Information Native Api - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenLog( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)] string path, PathType flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtGetLogInfo( EventLogHandle log, @@ -632,7 +632,7 @@ internal static partial bool EvtGetLogInfo( // LOG MANIPULATION - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtExportLog( EventLogHandle session, @@ -641,7 +641,7 @@ internal static partial bool EvtExportLog( [MarshalAs(UnmanagedType.LPWStr)] string targetFilePath, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtArchiveExportedLog( EventLogHandle session, @@ -649,7 +649,7 @@ internal static partial bool EvtArchiveExportedLog( int locale, int flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtClearLog( EventLogHandle session, @@ -658,14 +658,14 @@ internal static partial bool EvtClearLog( int flags); // RENDERING - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtCreateRenderContext( int valuePathsCount, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] valuePaths, EvtRenderContextFlags flags); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtRender( EventLogHandle context, @@ -676,7 +676,7 @@ internal static partial bool EvtRender( out int buffUsed, out int propCount); - [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtRender( EventLogHandle context, @@ -736,7 +736,7 @@ public void FreeNative() #endif }; - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtFormatMessage( EventLogHandle publisherMetadataHandle, @@ -749,7 +749,7 @@ internal static partial bool EvtFormatMessage( [Out] char[]? buffer, out int bufferUsed); - [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtFormatMessageBuffer( EventLogHandle publisherMetadataHandle, @@ -763,7 +763,7 @@ internal static partial bool EvtFormatMessageBuffer( out int bufferUsed); // SESSION - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static partial EventLogHandle EvtOpenSession( EvtLoginClass loginClass, ref EvtRpcLogin login, @@ -771,11 +771,11 @@ internal static partial EventLogHandle EvtOpenSession( int flags); // BOOKMARK - [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)] internal static partial EventLogHandle EvtCreateBookmark( [MarshalAs(UnmanagedType.LPWStr)] string bookmarkXml); - [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EvtUpdateBookmark( EventLogHandle bookmark, diff --git a/src/libraries/System.DirectoryServices/src/Interop/SafeNativeMethods.cs b/src/libraries/System.DirectoryServices/src/Interop/SafeNativeMethods.cs index 4b25a5d7bc8cc5..65280fe8b70450 100644 --- a/src/libraries/System.DirectoryServices/src/Interop/SafeNativeMethods.cs +++ b/src/libraries/System.DirectoryServices/src/Interop/SafeNativeMethods.cs @@ -9,10 +9,10 @@ namespace System.DirectoryServices.Interop { internal static partial class SafeNativeMethods { - [GeneratedDllImport(global::Interop.Libraries.OleAut32)] + [LibraryImport(global::Interop.Libraries.OleAut32)] public static partial void VariantInit(IntPtr pObject); - [GeneratedDllImport(global::Interop.Libraries.Activeds)] + [LibraryImport(global::Interop.Libraries.Activeds)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool FreeADsMem(IntPtr pVoid); @@ -23,10 +23,10 @@ public const int ERROR_MORE_DATA = 234, ERROR_SUCCESS = 0; - [GeneratedDllImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)] public static unsafe partial int ADsGetLastError(out int error, char* errorBuffer, int errorBufferLength, char* nameBuffer, int nameBufferLength); - [GeneratedDllImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)] public static partial int ADsSetLastError(int error, string? errorString, string? provider); public class EnumVariant diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/NativeMethods.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/NativeMethods.cs index c7fed2bbc69e32..6d7a83a3d3b9e9 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/NativeMethods.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/NativeMethods.cs @@ -309,7 +309,7 @@ private NativeMethods() { } ULONG Flags, PDOMAIN_CONTROLLER_INFO* DomainControllerInfo );*/ - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DsGetDcName( string? computerName, string? domainName, @@ -327,7 +327,7 @@ internal static partial int DsGetDcName( ULONG DcFlags, PHANDLE RetGetDcContext );*/ - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcOpenW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcOpenW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DsGetDcOpen( string? dnsName, int optionFlags, @@ -343,7 +343,7 @@ internal static partial int DsGetDcOpen( LPSOCKET_ADDRESS* SockAddresses, LPTSTR* DnsHostName );*/ - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNextW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNextW", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DsGetDcNext( IntPtr getDcContextHandle, ref IntPtr sockAddressCount, @@ -353,14 +353,14 @@ internal static partial int DsGetDcNext( /*void WINAPI DsGetDcClose( HANDLE GetDcContextHandle );*/ - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcCloseW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcCloseW", StringMarshalling = StringMarshalling.Utf16)] internal static partial void DsGetDcClose( IntPtr getDcContextHandle); /*NET_API_STATUS NetApiBufferFree( LPVOID Buffer );*/ - [GeneratedDllImport(global::Interop.Libraries.Netapi32)] + [LibraryImport(global::Interop.Libraries.Netapi32)] internal static partial int NetApiBufferFree( IntPtr buffer); @@ -380,7 +380,7 @@ internal static partial int NetApiBufferFree( PDNS_RECORD *ppQueryResultsSet, PVOID *pReserved );*/ - [GeneratedDllImport(global::Interop.Libraries.Dnsapi, EntryPoint = "DnsQuery_W", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Dnsapi, EntryPoint = "DnsQuery_W", StringMarshalling = StringMarshalling.Utf16)] internal static partial int DnsQuery( string recordName, short recordType, @@ -393,7 +393,7 @@ internal static partial int DnsQuery( PDNS_RECORD pRecordList, DNS_FREE_TYPE FreeType );*/ - [GeneratedDllImport(global::Interop.Libraries.Dnsapi)] + [LibraryImport(global::Interop.Libraries.Dnsapi)] internal static partial void DnsRecordListFree( IntPtr dnsResultList, [MarshalAs(UnmanagedType.Bool)] bool dnsFreeType); @@ -401,7 +401,7 @@ internal static partial void DnsRecordListFree( /*NTSTATUS LsaConnectUntrusted( PHANDLE LsaHandle );*/ - [GeneratedDllImport(global::Interop.Libraries.Secur32)] + [LibraryImport(global::Interop.Libraries.Secur32)] internal static partial uint LsaConnectUntrusted( out LsaLogonProcessSafeHandle lsaHandle); @@ -416,7 +416,7 @@ internal static partial uint LsaConnectUntrusted( PULONG ReturnBufferLength, PNTSTATUS ProtocolStatus );*/ - [GeneratedDllImport(global::Interop.Libraries.Secur32)] + [LibraryImport(global::Interop.Libraries.Secur32)] internal static partial uint LsaCallAuthenticationPackage( LsaLogonProcessSafeHandle lsaHandle, int authenticationPackage, @@ -429,14 +429,14 @@ internal static partial uint LsaCallAuthenticationPackage( /*NTSTATUS LsaFreeReturnBuffer( PVOID Buffer );*/ - [GeneratedDllImport(global::Interop.Libraries.Secur32)] + [LibraryImport(global::Interop.Libraries.Secur32)] internal static partial uint LsaFreeReturnBuffer( IntPtr buffer); /*NTSTATUS LsaDeregisterLogonProcess( HANDLE LsaHandle );*/ - [GeneratedDllImport(global::Interop.Libraries.Secur32)] + [LibraryImport(global::Interop.Libraries.Secur32)] internal static partial int LsaDeregisterLogonProcess( IntPtr lsaHandle); @@ -447,7 +447,7 @@ internal static partial int LsaDeregisterLogonProcess( DWORD lpString2, DWORD cchCount2 );*/ - [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "CompareStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "CompareStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int CompareString( uint locale, uint dwCmpFlags, diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/UnsafeNativeMethods.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/UnsafeNativeMethods.cs index bbce2d8bcfc146..2b490f41c755b5 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/UnsafeNativeMethods.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/UnsafeNativeMethods.cs @@ -574,53 +574,53 @@ internal struct POLICY_ACCOUNT_DOMAIN_INFO internal static partial class UnsafeNativeMethods { - [GeneratedDllImport(global::Interop.Libraries.Activeds, EntryPoint = "ADsEncodeBinaryData", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Activeds, EntryPoint = "ADsEncodeBinaryData", StringMarshalling = StringMarshalling.Utf16)] public static partial int ADsEncodeBinaryData(byte[] data, int length, ref IntPtr result); - [GeneratedDllImport(global::Interop.Libraries.Activeds, EntryPoint = "FreeADsMem")] + [LibraryImport(global::Interop.Libraries.Activeds, EntryPoint = "FreeADsMem")] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool FreeADsMem(IntPtr pVoid); - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetSiteNameW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetSiteNameW", StringMarshalling = StringMarshalling.Utf16)] public static partial int DsGetSiteName(string? dcName, ref IntPtr ptr); - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsEnumerateDomainTrustsW", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsEnumerateDomainTrustsW", StringMarshalling = StringMarshalling.Utf16)] public static partial int DsEnumerateDomainTrustsW(string serverName, int flags, out IntPtr domains, out int count); - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "NetApiBufferFree")] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "NetApiBufferFree")] public static partial int NetApiBufferFree(IntPtr buffer); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetForestTrustInformation")] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetForestTrustInformation")] public static partial uint LsaSetForestTrustInformation(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING target, IntPtr forestTrustInfo, int checkOnly, out IntPtr collisionInfo); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryForestTrustInformation")] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryForestTrustInformation")] public static partial uint LsaQueryForestTrustInformation(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING target, ref IntPtr ForestTrustInfo); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryTrustedDomainInfoByName")] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryTrustedDomainInfoByName")] public static partial uint LsaQueryTrustedDomainInfoByName(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING trustedDomain, TRUSTED_INFORMATION_CLASS infoClass, ref IntPtr buffer); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetTrustedDomainInfoByName")] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetTrustedDomainInfoByName")] public static partial uint LsaSetTrustedDomainInfoByName(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING trustedDomain, TRUSTED_INFORMATION_CLASS infoClass, IntPtr buffer); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaDeleteTrustedDomain")] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaDeleteTrustedDomain")] public static partial uint LsaDeleteTrustedDomain(SafeLsaPolicyHandle handle, IntPtr pSid); - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "I_NetLogonControl2", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "I_NetLogonControl2", StringMarshalling = StringMarshalling.Utf16)] public static partial int I_NetLogonControl2(string serverName, int FunctionCode, int QueryLevel, IntPtr data, out IntPtr buffer); - [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "GetSystemTimeAsFileTime")] + [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "GetSystemTimeAsFileTime")] public static partial void GetSystemTimeAsFileTime(IntPtr fileTime); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaCreateTrustedDomainEx")] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaCreateTrustedDomainEx")] public static partial uint LsaCreateTrustedDomainEx(SafeLsaPolicyHandle handle, in TRUSTED_DOMAIN_INFORMATION_EX domainEx, in TRUSTED_DOMAIN_AUTH_INFORMATION authInfo, int classInfo, out IntPtr domainHandle); - [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "OpenThread", SetLastError = true)] + [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "OpenThread", SetLastError = true)] public static partial IntPtr OpenThread(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheirted, int threadID); - [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "ImpersonateAnonymousToken", SetLastError = true)] + [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "ImpersonateAnonymousToken", SetLastError = true)] public static partial int ImpersonateAnonymousToken(IntPtr token); - [GeneratedDllImport(global::Interop.Libraries.NtDll, EntryPoint = "RtlInitUnicodeString")] + [LibraryImport(global::Interop.Libraries.NtDll, EntryPoint = "RtlInitUnicodeString")] public static partial int RtlInitUnicodeString(out global::Interop.UNICODE_STRING result, IntPtr s); /* @@ -630,13 +630,13 @@ DWORD DsRoleGetPrimaryDomainInformation( PBYTE* Buffer ); */ - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)] public static partial int DsRoleGetPrimaryDomainInformation( [MarshalAs(UnmanagedType.LPTStr)] string lpServer, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, out IntPtr Buffer); - [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)] public static partial int DsRoleGetPrimaryDomainInformation( IntPtr lpServer, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, @@ -647,7 +647,7 @@ void DsRoleFreeMemory( PVOID Buffer ); */ - [GeneratedDllImport(global::Interop.Libraries.Netapi32)] + [LibraryImport(global::Interop.Libraries.Netapi32)] public static partial int DsRoleFreeMemory( IntPtr buffer); } diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs index a7d651517aa689..8fe0c9b9bd7ef3 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class Comdlg32 { - [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)] + [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PrintDlg(ref PRINTDLG lppd); - [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)] + [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool PrintDlg(ref PRINTDLGX86 lppd); diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs index c1e712a72a2f9e..545856dad969b0 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs @@ -15,14 +15,14 @@ internal static partial class Gdi32 internal const int CHECKJPEGFORMAT = 4119; internal const int CHECKPNGFORMAT = 4120; - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial IntPtr CreateCompatibleBitmap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC, int width, int height); - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] internal static partial int GetDIBits( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -33,56 +33,56 @@ internal static partial int GetDIBits( #endif HandleRef hbm, int arg1, int arg2, IntPtr arg3, ref BITMAPINFO_FLAT bmi, int arg5); - [GeneratedDllImport(Libraries.Gdi32)] + [LibraryImport(Libraries.Gdi32)] internal static partial uint GetPaletteEntries( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hpal, int iStartIndex, int nEntries, byte[] lppe); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial IntPtr CreateDIBSection( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hdc, ref BITMAPINFO_FLAT bmi, int iUsage, ref IntPtr ppvBits, IntPtr hSection, int dwOffset); - [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)] + [LibraryImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)] internal static partial int StartDoc( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC, DOCINFO lpDocInfo); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int StartPage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int EndPage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int AbortDoc( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int EndDoc( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC); - [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)] + [LibraryImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)] internal static partial IntPtr /*HDC*/ ResetDC( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -93,7 +93,7 @@ internal static partial int EndDoc( #endif HandleRef /*DEVMODE*/ lpDevMode); - [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int AddFontResourceEx(string lpszFilename, int fl, IntPtr pdv); internal static int AddFontFile(string fileName) @@ -101,35 +101,35 @@ internal static int AddFontFile(string fileName) return AddFontResourceEx(fileName, /*FR_PRIVATE*/ 0x10, IntPtr.Zero); } - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int ExtEscape( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC, int nEscape, int cbInput, ref int inData, int cbOutput, out int outData); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int ExtEscape( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC, int nEscape, int cbInput, byte[] inData, int cbOutput, out int outData); - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial int IntersectClipRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hDC, int x1, int y1, int x2, int y2); - [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)] + [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)] internal static partial int GetObject( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hObject, int nSize, ref BITMAP bm); - [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GetObject( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Kernel32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Kernel32.cs index 3d2545ea6caf98..4cf179f74a7587 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Kernel32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Kernel32.cs @@ -11,10 +11,10 @@ internal static partial class Interop { internal static partial class Kernel32 { - [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + [LibraryImport(Libraries.Kernel32, SetLastError = true)] public static partial int GetSystemDefaultLCID(); - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GlobalAlloc", SetLastError = true)] + [LibraryImport(Libraries.Kernel32, EntryPoint = "GlobalAlloc", SetLastError = true)] internal static partial IntPtr IntGlobalAlloc(int uFlags, UIntPtr dwBytes); // size should be 32/64bits compatible internal static IntPtr GlobalAlloc(int uFlags, uint dwBytes) @@ -22,7 +22,7 @@ internal static IntPtr GlobalAlloc(int uFlags, uint dwBytes) return IntGlobalAlloc(uFlags, new UIntPtr(dwBytes)); } - [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)] + [LibraryImport(Libraries.Gdi32, SetLastError = true)] internal static partial IntPtr SelectObject( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Shell32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Shell32.cs index 97dbc8417908e2..0f7647555f8c9a 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Shell32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Shell32.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Shell32 { - [GeneratedDllImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW")] + [LibraryImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW")] internal static unsafe partial IntPtr ExtractAssociatedIcon( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.User32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.User32.cs index 0290a653059b78..6c1cdf06295794 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.User32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.User32.cs @@ -11,14 +11,14 @@ internal static partial class Interop { internal static partial class User32 { - [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadIconW", SetLastError = true)] + [LibraryImport(Libraries.User32, EntryPoint = "LoadIconW", SetLastError = true)] internal static partial IntPtr LoadIcon( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hInst, IntPtr iconId); - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DestroyIcon( #if NET7_0_OR_GREATER @@ -26,14 +26,14 @@ internal static partial bool DestroyIcon( #endif HandleRef hIcon); - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] internal static partial IntPtr CopyImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef hImage, int uType, int cxDesired, int cyDesired, int fuFlags); - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetIconInfo( #if NET7_0_OR_GREATER @@ -41,10 +41,10 @@ internal static partial bool GetIconInfo( #endif HandleRef hIcon, ref ICONINFO info); - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] public static partial int GetSystemMetrics(int nIndex); - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DrawIconEx( #if NET7_0_OR_GREATER @@ -60,7 +60,7 @@ internal static partial bool DrawIconEx( #endif HandleRef hBrushFlickerFree, int diFlags); - [GeneratedDllImport(Libraries.User32, SetLastError = true)] + [LibraryImport(Libraries.User32, SetLastError = true)] internal static unsafe partial IntPtr CreateIconFromResourceEx(byte* pbIconBits, uint cbIconBits, [MarshalAs(UnmanagedType.Bool)] bool fIcon, int dwVersion, int csDesired, int cyDesired, int flags); [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs index 715c8cf5634391..5d059b69845d21 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs @@ -11,10 +11,10 @@ internal static partial class Interop { internal static partial class Winspool { - [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int DeviceCapabilities(string pDevice, string pPort, short fwCapabilities, IntPtr pOutput, IntPtr /*DEVMODE*/ pDevMode); - [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int DocumentProperties( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -29,7 +29,7 @@ internal static partial int DocumentProperties( #endif HandleRef /*DEVMODE*/ pDevModeInput, int fMode); - [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int DocumentProperties( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -40,7 +40,7 @@ internal static partial int DocumentProperties( #endif HandleRef hPrinter, string pDeviceName, IntPtr /*DEVMODE*/ pDevModeOutput, IntPtr /*DEVMODE*/ pDevModeInput, int fMode); - [GeneratedDllImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int EnumPrinters(int flags, string? name, int level, IntPtr pPrinterEnum/*buffer*/, int cbBuf, out int pcbNeeded, out int pcReturned); } } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs index 897343555f1238..440fdba1a6518d 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs @@ -69,39 +69,39 @@ private static void PlatformInitialize() } // Imported functions - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdiplusStartup(out IntPtr token, in StartupInputEx input, out StartupOutput output); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial void GdiplusShutdown(ref ulong token); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr GdipAlloc(int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial void GdipFree(IntPtr ptr); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteBrush( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetBrushType(IntPtr brush, out BrushType type); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteGraphics( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRestoreGraphics(IntPtr graphics, uint graphicsState); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipReleaseDC( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -112,310 +112,310 @@ internal static partial int GdipReleaseDC( #endif HandleRef hdc); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipFillPath(IntPtr graphics, IntPtr brush, IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetNearestColor(IntPtr graphics, out int argb); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipAddPathString(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref RectangleF layoutRect, IntPtr format); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipAddPathStringI(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref Rectangle layoutRect, IntPtr format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneImage(IntPtr image, out IntPtr imageclone); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImagePaletteSize(IntPtr image, out int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImagePalette(IntPtr image, IntPtr palette, int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImagePalette(IntPtr image, IntPtr palette); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageBounds(IntPtr image, out RectangleF source, ref GraphicsUnit unit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageThumbnail(IntPtr image, uint width, uint height, out IntPtr thumbImage, IntPtr callback, IntPtr callBackData); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipSaveImageToFile(IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveAdd(IntPtr image, IntPtr encoderParameters); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveAddImage(IntPtr image, IntPtr imagenew, IntPtr encoderParameters); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageGraphicsContext(IntPtr image, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePath(FillMode brushMode, out IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePath2(PointF[] points, byte[] types, int count, FillMode brushMode, out IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePath2I(Point[] points, byte[] types, int count, FillMode brushMode, out IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClonePath(IntPtr path, out IntPtr clonePath); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeletePath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetPath(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPointCount(IntPtr path, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathTypes(IntPtr path, byte[] types, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathPoints(IntPtr path, PointF[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathPointsI(IntPtr path, Point[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathFillMode(IntPtr path, out FillMode fillMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathFillMode(IntPtr path, FillMode fillMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipStartPathFigure(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClosePathFigure(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClosePathFigures(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathMarker(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClearPathMarkers(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipReversePath(IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathLastPoint(IntPtr path, out PointF lastPoint); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLine(IntPtr path, float x1, float y1, float x2, float y2); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLine2(IntPtr path, PointF[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLine2I(IntPtr path, Point[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathArc(IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBezier(IntPtr path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBeziers(IntPtr path, PointF[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve(IntPtr path, PointF[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurveI(IntPtr path, Point[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve2(IntPtr path, PointF[] points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve2I(IntPtr path, Point[] points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve3(IntPtr path, PointF[] points, int count, int offset, int numberOfSegments, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve3I(IntPtr path, Point[] points, int count, int offset, int numberOfSegments, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurve(IntPtr path, PointF[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurveI(IntPtr path, Point[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurve2(IntPtr path, PointF[] points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurve2I(IntPtr path, Point[] points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectangle(IntPtr path, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectangles(IntPtr path, RectangleF[] rects, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathEllipse(IntPtr path, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathEllipseI(IntPtr path, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPie(IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPieI(IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPolygon(IntPtr path, PointF[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPath(IntPtr path, IntPtr addingPath, [MarshalAs(UnmanagedType.Bool)] bool connect); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLineI(IntPtr path, int x1, int y1, int x2, int y2); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathArcI(IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBezierI(IntPtr path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBeziersI(IntPtr path, Point[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPolygonI(IntPtr path, Point[] points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectangleI(IntPtr path, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectanglesI(IntPtr path, Rectangle[] rects, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipFlattenPath(IntPtr path, IntPtr matrix, float floatness); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformPath(IntPtr path, IntPtr matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipWarpPath(IntPtr path, IntPtr matrix, PointF[] points, int count, float srcx, float srcy, float srcwidth, float srcheight, WarpMode mode, float flatness); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipWidenPath(IntPtr path, IntPtr pen, IntPtr matrix, float flatness); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathWorldBounds(IntPtr path, out RectangleF bounds, IntPtr matrix, IntPtr pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathWorldBoundsI(IntPtr path, out Rectangle bounds, IntPtr matrix, IntPtr pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePathPoint(IntPtr path, float x, float y, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePathPointI(IntPtr path, int x, int y, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsOutlineVisiblePathPoint(IntPtr path, float x, float y, IntPtr pen, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsOutlineVisiblePathPointI(IntPtr path, int x, int y, IntPtr pen, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFontFromLogfont(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr ptr); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFontFromHfont(IntPtr hdc, out IntPtr font, ref Interop.User32.LOGFONT lf); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromMetafile(IntPtr metafile, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEmf, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromWmf(IntPtr hWmf, IntPtr wmfPlaceableFileHeader, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetHemfFromMetafile(IntPtr metafile, out IntPtr hEmf); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileDownLevelRasterizationLimit(IntPtr metafile, ref uint metafileRasterizationLimitDpi); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetMetafileDownLevelRasterizationLimit(IntPtr metafile, uint metafileRasterizationLimitDpi); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFromContext_macosx(IntPtr cgref, int width, int height, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetVisibleClip_linux(IntPtr graphics, ref Rectangle rect); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFromXDrawable_linux(IntPtr drawable, IntPtr display, out IntPtr graphics); // Stream functions for non-Win32 (libgdiplus specific) - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipLoadImageFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveImageToDelegate_linux(IntPtr image, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, ref Guid encoderClsID, IntPtr encoderParameters); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMetafileFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr metafile); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, IntPtr header); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileFromDelegateI_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPostScriptGraphicsContext( [MarshalAs(UnmanagedType.LPStr)] string filename, int width, int height, double dpix, double dpiy, ref IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPostScriptSavePage(IntPtr graphics); } } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs index 30f5970bfd187e..e5a1b81cb28fff 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs @@ -22,236 +22,236 @@ private static void PlatformInitialize() } // Imported functions - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] private static partial int GdiplusStartup(out IntPtr token, in StartupInputEx input, out StartupOutput output); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePath(int brushMode, out IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePath2(PointF* points, byte* types, int count, int brushMode, out IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePath2I(Point* points, byte* types, int count, int brushMode, out IntPtr path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClonePath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, out IntPtr clonepath); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeletePath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPointCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathTypes( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, byte[] types, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathFillMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, out FillMode fillmode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathFillMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, FillMode fillmode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathData( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, GpPathData* pathData); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipStartPathFigure( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClosePathFigure( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClosePathFigures( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathMarker( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClearPathMarkers( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipReversePath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathLastPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, out PointF lastPoint); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLine( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, float x1, float y1, float x2, float y2); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLine2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathArc( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBezier( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBeziers( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve3( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count, int offset, int numberOfSegments, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurve( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurve2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectangle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectangles( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, RectangleF* rects, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathEllipse( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPie( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPolygon( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -262,7 +262,7 @@ internal static partial int GdipAddPathPath( #endif HandleRef addingPath, [MarshalAs(UnmanagedType.Bool)] bool connect); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipAddPathString( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -277,7 +277,7 @@ internal static partial int GdipAddPathString( #endif HandleRef format); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipAddPathStringI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -292,112 +292,112 @@ internal static partial int GdipAddPathStringI( #endif HandleRef format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLineI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, int x1, int y1, int x2, int y2); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathLine2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathArcI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBezierI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathBeziersI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurveI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathCurve3I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count, int offset, int numberOfSegments, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurveI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathClosedCurve2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count, float tension); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectangleI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathRectanglesI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Rectangle* rects, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathEllipseI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPieI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipAddPathPolygonI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, Point* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipFlattenPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -408,7 +408,7 @@ internal static partial int GdipFlattenPath( #endif HandleRef matrixfloat, float flatness); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipWidenPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -423,7 +423,7 @@ internal static partial int GdipWidenPath( #endif HandleRef matrix, float flatness); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipWarpPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -434,7 +434,7 @@ internal static partial int GdipWarpPath( #endif HandleRef matrix, PointF* points, int count, float srcX, float srcY, float srcWidth, float srcHeight, WarpMode warpMode, float flatness); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -445,7 +445,7 @@ internal static partial int GdipTransformPath( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathWorldBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -460,7 +460,7 @@ internal static partial int GdipGetPathWorldBounds( #endif HandleRef pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePathPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -471,7 +471,7 @@ internal static partial int GdipIsVisiblePathPoint( #endif HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePathPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -482,7 +482,7 @@ internal static partial int GdipIsVisiblePathPointI( #endif HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsOutlineVisiblePathPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -497,7 +497,7 @@ internal static partial int GdipIsOutlineVisiblePathPoint( #endif HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsOutlineVisiblePathPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -512,27 +512,27 @@ internal static partial int GdipIsOutlineVisiblePathPointI( #endif HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteBrush( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipLoadImageFromStream(IntPtr stream, IntPtr* image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipLoadImageFromStreamICM(IntPtr stream, IntPtr* image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out IntPtr cloneimage); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipSaveImageToFile( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -543,7 +543,7 @@ internal static partial int GdipSaveImageToFile( #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveImageToStream( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -554,7 +554,7 @@ internal static partial int GdipSaveImageToStream( #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveAdd( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -565,7 +565,7 @@ internal static partial int GdipSaveAdd( #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveAddImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -580,82 +580,82 @@ internal static partial int GdipSaveAddImage( #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageGraphicsContext( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out RectangleF gprectf, out GraphicsUnit unit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageThumbnail( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, int thumbWidth, int thumbHeight, out IntPtr thumbImage, Image.GetThumbnailImageAbort? callback, IntPtr callbackdata); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImagePalette( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, IntPtr palette, int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImagePalette( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, IntPtr palette); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImagePaletteSize( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipImageForceValidation(IntPtr image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFromHDC2(IntPtr hdc, IntPtr hdevice, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteGraphics( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipReleaseDC( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, IntPtr hdc); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetNearestColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, ref int color); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr GdipCreateHalftonePalette(); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawBeziers( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -666,7 +666,7 @@ internal static partial int GdipDrawBeziers( #endif HandleRef pen, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawBeziersI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -677,7 +677,7 @@ internal static partial int GdipDrawBeziersI( #endif HandleRef pen, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -692,7 +692,7 @@ internal static partial int GdipFillPath( #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -707,7 +707,7 @@ internal static partial int GdipEnumerateMetafileDestPoint( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -722,7 +722,7 @@ internal static partial int GdipEnumerateMetafileDestPointI( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -737,7 +737,7 @@ internal static partial int GdipEnumerateMetafileDestRect( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -752,7 +752,7 @@ internal static partial int GdipEnumerateMetafileDestRectI( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -767,7 +767,7 @@ internal static partial int GdipEnumerateMetafileDestPoints( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -782,7 +782,7 @@ internal static partial int GdipEnumerateMetafileDestPointsI( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -797,7 +797,7 @@ internal static partial int GdipEnumerateMetafileSrcRectDestPoint( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -812,7 +812,7 @@ internal static partial int GdipEnumerateMetafileSrcRectDestPointI( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -827,7 +827,7 @@ internal static partial int GdipEnumerateMetafileSrcRectDestRect( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -842,7 +842,7 @@ internal static partial int GdipEnumerateMetafileSrcRectDestRectI( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -857,7 +857,7 @@ internal static partial int GdipEnumerateMetafileSrcRectDestPoints( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -872,14 +872,14 @@ internal static partial int GdipEnumerateMetafileSrcRectDestPointsI( #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRestoreGraphics( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int state); - [GeneratedDllImport(LibraryName, EntryPoint = "GdipGetMetafileHeaderFromWmf")] + [LibraryImport(LibraryName, EntryPoint = "GdipGetMetafileHeaderFromWmf")] private static partial int GdipGetMetafileHeaderFromWmf_Internal(IntPtr hMetafile, #if NET7_0_OR_GREATER [MarshalUsing(typeof(WmfPlaceableFileHeader.PinningMarshaller))] @@ -907,55 +907,55 @@ MetafileHeaderWmf metafileHeaderWmf ); } - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEnhMetafile, MetafileHeaderEmf metafileHeaderEmf); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromStream(IntPtr stream, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetMetafileHeaderFromMetafile( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef metafile, IntPtr header); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetHemfFromMetafile( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef metafile, out IntPtr hEnhMetafile); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMetafileFromStream(IntPtr stream, IntPtr* metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, RectangleF* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileStreamI(IntPtr stream, IntPtr referenceHdc, EmfType emfType, Rectangle* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipComment( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int sizeData, byte[] data); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFontFromLogfontW(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr font); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromStream(IntPtr stream, IntPtr* bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromStreamICM(IntPtr stream, IntPtr* bitmap); } } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs index 8919863d7fa4ef..fcc863646d8cc6 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs @@ -18,97 +18,97 @@ internal static partial class SafeNativeMethods internal static unsafe partial class Gdip { // Shared function imports (all platforms) - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBeginContainer( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, ref RectangleF dstRect, ref RectangleF srcRect, GraphicsUnit unit, out int state); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBeginContainer2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out int state); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBeginContainerI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, ref Rectangle dstRect, ref Rectangle srcRect, GraphicsUnit unit, out int state); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEndContainer( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int state); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateAdjustableArrowCap(float height, float width, [MarshalAs(UnmanagedType.Bool)] bool isFilled, out IntPtr adjustableArrowCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetAdjustableArrowCapHeight( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, out float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetAdjustableArrowCapHeight( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetAdjustableArrowCapWidth( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, float width); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetAdjustableArrowCapWidth( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, out float width); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetAdjustableArrowCapMiddleInset( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, float middleInset); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetAdjustableArrowCapMiddleInset( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, out float middleInset); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetAdjustableArrowCapFillState( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, [MarshalAs(UnmanagedType.Bool)] bool fillState); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetAdjustableArrowCapFillState( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef adjustableArrowCap, [MarshalAs(UnmanagedType.Bool)] out bool fillState); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCustomLineCapType(IntPtr customCap, out CustomLineCapType capType); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateCustomLineCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -119,115 +119,115 @@ internal static partial int GdipCreateCustomLineCap( #endif HandleRef strokepath, LineCap baseCap, float baseInset, out IntPtr customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteCustomLineCap(IntPtr customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteCustomLineCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneCustomLineCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, out IntPtr clonedCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCustomLineCapStrokeCaps( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, LineCap startCap, LineCap endCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCustomLineCapStrokeCaps( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, out LineCap startCap, out LineCap endCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCustomLineCapStrokeJoin( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, LineJoin lineJoin); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCustomLineCapStrokeJoin( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, out LineJoin lineJoin); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCustomLineCapBaseCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, LineCap baseCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCustomLineCapBaseCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, out LineCap baseCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCustomLineCapBaseInset( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, float inset); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCustomLineCapBaseInset( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, out float inset); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCustomLineCapWidthScale( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, float widthScale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCustomLineCapWidthScale( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef customCap, out float widthScale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePathIter(out IntPtr pathIter, #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeletePathIter( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterNextSubpath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int resultCount, out int startIndex, out int endIndex, [MarshalAs(UnmanagedType.Bool)] out bool isClosed); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterNextSubpathPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -238,21 +238,21 @@ internal static partial int GdipPathIterNextSubpathPath( #endif HandleRef path, [MarshalAs(UnmanagedType.Bool)] out bool isClosed); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterNextPathType( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int resultCount, out byte pathType, out int startIndex, out int endIndex); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterNextMarker( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int resultCount, out int startIndex, out int endIndex); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterNextMarkerPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -263,210 +263,210 @@ internal static partial int GdipPathIterNextMarkerPath( #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterGetCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterGetSubpathCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterHasCurve( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, [MarshalAs(UnmanagedType.Bool)] out bool hasCurve); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterRewind( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterEnumerate( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int resultCount, PointF* points, byte* types, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPathIterCopyData( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pathIter, out int resultCount, PointF* points, byte* types, int startIndex, int endIndex); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateHatchBrush(int hatchstyle, int forecol, int backcol, out IntPtr brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetHatchStyle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int hatchstyle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetHatchForegroundColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int forecol); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetHatchBackgroundColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int backcol); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneBrush( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out IntPtr clonebrush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateLineBrush(ref PointF point1, ref PointF point2, int color1, int color2, WrapMode wrapMode, out IntPtr lineGradient); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateLineBrushI(ref Point point1, ref Point point2, int color1, int color2, WrapMode wrapMode, out IntPtr lineGradient); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateLineBrushFromRect(ref RectangleF rect, int color1, int color2, LinearGradientMode lineGradientMode, WrapMode wrapMode, out IntPtr lineGradient); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateLineBrushFromRectI(ref Rectangle rect, int color1, int color2, LinearGradientMode lineGradientMode, WrapMode wrapMode, out IntPtr lineGradient); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateLineBrushFromRectWithAngle(ref RectangleF rect, int color1, int color2, float angle, [MarshalAs(UnmanagedType.Bool)] bool isAngleScaleable, WrapMode wrapMode, out IntPtr lineGradient); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateLineBrushFromRectWithAngleI(ref Rectangle rect, int color1, int color2, float angle, [MarshalAs(UnmanagedType.Bool)] bool isAngleScaleable, WrapMode wrapMode, out IntPtr lineGradient); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineColors( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int color1, int color2); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineColors( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int[] colors); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out RectangleF gprectf); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineGammaCorrection( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, [MarshalAs(UnmanagedType.Bool)] out bool useGammaCorrection); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineGammaCorrection( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, [MarshalAs(UnmanagedType.Bool)] bool useGammaCorrection); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineSigmaBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float focus, float scale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineLinearBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float focus, float scale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineBlendCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, IntPtr blend, IntPtr positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, IntPtr blend, IntPtr positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLinePresetBlendCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLinePresetBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, IntPtr blend, IntPtr positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLinePresetBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, IntPtr blend, IntPtr positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int wrapMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int wrapMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipMultiplyLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -477,7 +477,7 @@ internal static partial int GdipMultiplyLineTransform( #endif HandleRef matrix, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -488,7 +488,7 @@ internal static partial int GdipGetLineTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -499,174 +499,174 @@ internal static partial int GdipSetLineTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float dx, float dy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipScaleLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float sx, float sy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRotateLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float angle, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePathGradient(PointF* points, int count, WrapMode wrapMode, out IntPtr brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePathGradientI(Point* points, int count, WrapMode wrapMode, out IntPtr brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePathGradientFromPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, out IntPtr brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientCenterColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int color); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientCenterColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int color); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientSurroundColorsWithCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int[] color, ref int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientSurroundColorsWithCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int[] argb, ref int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientCenterPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out PointF point); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientCenterPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, ref PointF point); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out RectangleF gprectf); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientPointCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientSurroundColorCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientBlendCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float[] blend, float[] positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, IntPtr blend, IntPtr positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientPresetBlendCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientPresetBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int[] blend, float[] positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientPresetBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int[] blend, float[] positions, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientSigmaBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float focus, float scale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientLinearBlend( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float focus, float scale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int wrapmode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int wrapmode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -677,7 +677,7 @@ internal static partial int GdipSetPathGradientTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -688,14 +688,14 @@ internal static partial int GdipGetPathGradientTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetPathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipMultiplyPathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -706,59 +706,59 @@ internal static partial int GdipMultiplyPathGradientTransform( #endif HandleRef matrix, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslatePathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float dx, float dy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipScalePathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float sx, float sy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRotatePathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float angle, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientFocusScales( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float[] xScale, float[] yScale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPathGradientFocusScales( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float xScale, float yScale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateImageAttributes(out IntPtr imageattr); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneImageAttributes( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, out IntPtr cloneImageattr); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDisposeImageAttributes( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesColorMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -773,92 +773,92 @@ internal static partial int GdipSetImageAttributesColorMatrix( #endif ColorMatrix? grayMatrix, ColorMatrixFlag flags); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesThreshold( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, float threshold); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesGamma( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, float gamma); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesNoOp( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesColorKeys( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, int colorLow, int colorHigh); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesOutputChannel( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, ColorChannelFlag flags); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipSetImageAttributesOutputChannelColorProfile( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, string colorProfileFilename); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesRemapTable( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, int mapSize, IntPtr map); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetImageAttributesWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, int wrapmode, int argb, [MarshalAs(UnmanagedType.Bool)] bool clamp); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageAttributesAdjustedPalette( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef imageattr, IntPtr palette, ColorAdjustType type); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageDecodersSize(out int numDecoders, out int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageDecoders(int numDecoders, int size, IntPtr decoders); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageEncodersSize(out int numEncoders, out int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageEncoders(int numEncoders, int size, IntPtr encoders); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateSolidFill(int color, out IntPtr brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetSolidFillColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int color); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetSolidFillColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -866,21 +866,21 @@ internal static partial int GdipGetSolidFillColor( HandleRef brush, out int color); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateTexture( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef bitmap, int wrapmode, out IntPtr texture); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateTexture2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef bitmap, int wrapmode, float x, float y, float width, float height, out IntPtr texture); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateTextureIA( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -891,14 +891,14 @@ internal static partial int GdipCreateTextureIA( #endif HandleRef imageAttrib, float x, float y, float width, float height, out IntPtr texture); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateTexture2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef bitmap, int wrapmode, int x, int y, int width, int height, out IntPtr texture); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateTextureIAI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -909,7 +909,7 @@ internal static partial int GdipCreateTextureIAI( #endif HandleRef imageAttrib, int x, int y, int width, int height, out IntPtr texture); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -920,7 +920,7 @@ internal static partial int GdipSetTextureTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -931,14 +931,14 @@ internal static partial int GdipGetTextureTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipMultiplyTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -949,199 +949,199 @@ internal static partial int GdipMultiplyTextureTransform( #endif HandleRef matrix, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float dx, float dy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipScaleTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float sx, float sy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRotateTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float angle, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetTextureWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, int wrapMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetTextureWrapMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out int wrapMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetTextureImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, out IntPtr image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontCollectionFamilyCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontCollection, out int numFound); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontCollectionFamilyList( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontCollection, int numSought, IntPtr[] gpfamilies, out int numFound); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneFontFamily(IntPtr fontfamily, out IntPtr clonefontfamily); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipCreateFontFamilyFromName(string name, #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontCollection, out IntPtr FontFamily); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetGenericFontFamilySansSerif(out IntPtr fontfamily); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetGenericFontFamilySerif(out IntPtr fontfamily); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetGenericFontFamilyMonospace(out IntPtr fontfamily); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteFontFamily( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontFamily); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipGetFamilyName( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef family, char* name, int language); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsStyleAvailable( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef family, FontStyle style, out int isStyleAvailable); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetEmHeight( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef family, FontStyle style, out int EmHeight); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCellAscent( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef family, FontStyle style, out int CellAscent); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCellDescent( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef family, FontStyle style, out int CellDescent); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLineSpacing( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef family, FontStyle style, out int LineSpaceing); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipNewInstalledFontCollection(out IntPtr fontCollection); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipNewPrivateFontCollection(out IntPtr fontCollection); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeletePrivateFontCollection(ref IntPtr fontCollection); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipPrivateAddFontFile( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontCollection, string filename); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPrivateAddMemoryFont( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontCollection, IntPtr memory, int length); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFont( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFontFromDC(IntPtr hdc, ref IntPtr font); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneFont( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font, out IntPtr cloneFont); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteFont( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFamily( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font, out IntPtr family); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontStyle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font, out FontStyle style); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontSize( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font, out float size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontHeight( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1152,21 +1152,21 @@ internal static partial int GdipGetFontHeight( #endif HandleRef graphics, out float size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontHeightGivenDPI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font, float dpi, out float size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetFontUnit( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef font, out GraphicsUnit unit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetLogFontW( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1177,122 +1177,122 @@ internal static partial int GdipGetLogFontW( #endif HandleRef graphics, ref Interop.User32.LOGFONT lf); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePen1(int argb, float width, int unit, out IntPtr pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreatePen2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float width, int unit, out IntPtr pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipClonePen( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out IntPtr clonepen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeletePen( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef Pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, PenAlignment penAlign); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out PenAlignment penAlign); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenWidth( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float width); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenWidth( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float[] width); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenLineCap197819( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int startCap, int endCap, int dashCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenStartCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int startCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenEndCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int endCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenStartCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int startCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenEndCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int endCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenDashCap197819( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int dashCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenDashCap197819( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int dashCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenLineJoin( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int lineJoin); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenLineJoin( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int lineJoin); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenCustomStartCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1303,14 +1303,14 @@ internal static partial int GdipSetPenCustomStartCap( #endif HandleRef customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenCustomStartCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out IntPtr customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenCustomEndCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1321,28 +1321,28 @@ internal static partial int GdipSetPenCustomEndCap( #endif HandleRef customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenCustomEndCap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out IntPtr customCap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenMiterLimit( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float miterLimit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenMiterLimit( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float[] miterLimit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1353,7 +1353,7 @@ internal static partial int GdipSetPenTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1364,14 +1364,14 @@ internal static partial int GdipGetPenTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetPenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipMultiplyPenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1382,42 +1382,42 @@ internal static partial int GdipMultiplyPenTransform( #endif HandleRef matrix, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslatePenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float dx, float dy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipScalePenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float sx, float sy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRotatePenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef brush, float angle, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int argb); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenColor( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int argb); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenBrushFill( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1428,35 +1428,35 @@ internal static partial int GdipSetPenBrushFill( #endif HandleRef brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenBrushFill( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out IntPtr brush); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenFillType( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int pentype); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenDashStyle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int dashstyle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenDashStyle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, int dashstyle); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenDashArray( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1467,56 +1467,56 @@ internal static partial int GdipSetPenDashArray( #endif HandleRef memorydash, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenDashOffset( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float[] dashoffset); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenDashOffset( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float dashoffset); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenDashCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int dashcount); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenDashArray( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float[] memorydash, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenCompoundCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPenCompoundArray( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float[] array, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenCompoundArray( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef pen, float[] array, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1527,14 +1527,14 @@ internal static partial int GdipSetWorldTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipMultiplyWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1545,28 +1545,28 @@ internal static partial int GdipMultiplyWorldTransform( #endif HandleRef matrix, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float dx, float dy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipScaleWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float sx, float sy, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRotateWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float angle, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetWorldTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1577,194 +1577,194 @@ internal static partial int GdipGetWorldTransform( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCompositingMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, CompositingMode compositingMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetTextRenderingHint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, TextRenderingHint textRenderingHint); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetTextContrast( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int textContrast); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetInterpolationMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, InterpolationMode interpolationMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCompositingMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out CompositingMode compositingMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetRenderingOrigin( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int x, int y); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRenderingOrigin( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out int x, out int y); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetCompositingQuality( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, CompositingQuality quality); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetCompositingQuality( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out CompositingQuality quality); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetSmoothingMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, SmoothingMode smoothingMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetSmoothingMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out SmoothingMode smoothingMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPixelOffsetMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, PixelOffsetMode pixelOffsetMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPixelOffsetMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out PixelOffsetMode pixelOffsetMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetTextRenderingHint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out TextRenderingHint textRenderingHint); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetTextContrast( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out int textContrast); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetInterpolationMode( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out InterpolationMode interpolationMode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPageUnit( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out GraphicsUnit unit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPageScale( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out float scale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPageUnit( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, GraphicsUnit unit); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPageScale( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float scale); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetDpiX( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out float dpi); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetDpiY( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out float dpi); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMatrix(out IntPtr matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMatrix2(float m11, float m12, float m21, float m22, float dx, float dy, out IntPtr matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMatrix3(ref RectangleF rect, PointF* dstplg, out IntPtr matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMatrix3I(ref Rectangle rect, Point* dstplg, out IntPtr matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, out IntPtr cloneMatrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetMatrixElements( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, float m11, float m12, float m21, float m22, float dx, float dy); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipMultiplyMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1775,91 +1775,91 @@ internal static partial int GdipMultiplyMatrix( #endif HandleRef matrix2, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, float offsetX, float offsetY, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipScaleMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, float scaleX, float scaleY, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRotateMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, float angle, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipShearMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, float shearX, float shearY, MatrixOrder order); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipInvertMatrix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformMatrixPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, PointF* pts, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformMatrixPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, Point* pts, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipVectorTransformMatrixPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, PointF* pts, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipVectorTransformMatrixPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, Point* pts, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static unsafe partial int GdipGetMatrixElements( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, float* m); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsMatrixInvertible( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsMatrixIdentity( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef matrix, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsMatrixEqual( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1870,43 +1870,43 @@ internal static partial int GdipIsMatrixEqual( #endif HandleRef matrix2, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateRegion(out IntPtr region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateRegionRect(ref RectangleF gprectf, out IntPtr region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateRegionRectI(ref Rectangle gprect, out IntPtr region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateRegionPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef path, out IntPtr region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateRegionRgnData(byte[] rgndata, int size, out IntPtr region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateRegionHrgn(IntPtr hRgn, out IntPtr region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, out IntPtr cloneregion); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1921,35 +1921,35 @@ internal static partial int GdipFillRegion( #endif HandleRef region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetInfinite( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetEmpty( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCombineRegionRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, ref RectangleF gprectf, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCombineRegionRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, ref Rectangle gprect, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCombineRegionPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1960,7 +1960,7 @@ internal static partial int GdipCombineRegionPath( #endif HandleRef path, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCombineRegionRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1971,21 +1971,21 @@ internal static partial int GdipCombineRegionRegion( #endif HandleRef region2, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, float dx, float dy); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateRegionI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, int dx, int dy); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1996,7 +1996,7 @@ internal static partial int GdipTransformRegion( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2007,7 +2007,7 @@ internal static partial int GdipGetRegionBounds( #endif HandleRef graphics, out RectangleF gprectf); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionHRgn( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2018,7 +2018,7 @@ internal static partial int GdipGetRegionHRgn( #endif HandleRef graphics, out IntPtr hrgn); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsEmptyRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2029,7 +2029,7 @@ internal static partial int GdipIsEmptyRegion( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsInfiniteRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2040,7 +2040,7 @@ internal static partial int GdipIsInfiniteRegion( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsEqualRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2055,21 +2055,21 @@ internal static partial int GdipIsEqualRegion( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionDataSize( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, out int bufferSize); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionData( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef region, byte[] regionData, int bufferSize, out int sizeFilled); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleRegionPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2080,7 +2080,7 @@ internal static partial int GdipIsVisibleRegionPoint( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleRegionPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2091,7 +2091,7 @@ internal static partial int GdipIsVisibleRegionPointI( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleRegionRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2102,7 +2102,7 @@ internal static partial int GdipIsVisibleRegionRect( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleRegionRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2113,7 +2113,7 @@ internal static partial int GdipIsVisibleRegionRectI( #endif HandleRef graphics, out int boolean); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionScansCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2124,7 +2124,7 @@ internal static partial int GdipGetRegionScansCount( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionScans( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2135,10 +2135,10 @@ internal static partial int GdipGetRegionScans( #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateFromHDC(IntPtr hdc, out IntPtr graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetClipGraphics( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2149,21 +2149,21 @@ internal static partial int GdipSetClipGraphics( #endif HandleRef srcgraphics, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetClipRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float x, float y, float width, float height, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetClipRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int x, int y, int width, int height, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetClipPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2174,7 +2174,7 @@ internal static partial int GdipSetClipPath( #endif HandleRef path, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetClipRegion( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2185,21 +2185,21 @@ internal static partial int GdipSetClipRegion( #endif HandleRef region, CombineMode mode); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipResetClip( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTranslateClip( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float dx, float dy); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetClip( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2210,425 +2210,425 @@ internal static partial int GdipGetClip( #endif HandleRef region); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetClipBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out RectangleF rect); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsClipEmpty( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetVisibleClipBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out RectangleF rect); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleClipEmpty( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float x, float y, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int x, int y, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, float x, float y, float width, float height, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisibleRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int x, int y, int width, int height, [MarshalAs(UnmanagedType.Bool)] out bool result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipFlush( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, FlushIntention intention); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetDC( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out IntPtr hdc); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatMeasurableCharacterRanges( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, int rangeCount, CharacterRange[] range); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateStringFormat(StringFormatFlags options, int language, out IntPtr format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipStringFormatGetGenericDefault(out IntPtr format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipStringFormatGetGenericTypographic(out IntPtr format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDeleteStringFormat( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneStringFormat( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out IntPtr newFormat); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatFlags( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, StringFormatFlags options); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatFlags( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out StringFormatFlags result); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatAlign( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, StringAlignment align); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatAlign( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out StringAlignment align); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatLineAlign( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, StringAlignment align); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatLineAlign( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out StringAlignment align); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatHotkeyPrefix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, HotkeyPrefix hotkeyPrefix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatHotkeyPrefix( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out HotkeyPrefix hotkeyPrefix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatTabStops( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, float firstTabOffset, int count, float[] tabStops); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatTabStops( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, int count, out float firstTabOffset, float[] tabStops); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatTabStopCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatMeasurableCharacterRangeCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatTrimming( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, StringTrimming trimming); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatTrimming( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out StringTrimming trimming); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetStringFormatDigitSubstitution( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, int langID, StringDigitSubstitute sds); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetStringFormatDigitSubstitution( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef format, out int langID, out StringDigitSubstitute sds); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageDimension( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out float width, out float height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageWidth( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out int width); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageHeight( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out int height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageHorizontalResolution( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out float horzRes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageVerticalResolution( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out float vertRes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageFlags( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out int flags); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageRawFormat( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, ref Guid format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImagePixelFormat( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out PixelFormat format); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipImageGetFrameCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, ref Guid dimensionID, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipImageSelectActiveFrame( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, ref Guid dimensionID, int frameIndex); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipImageRotateFlip( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, int rotateFlipType); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetAllPropertyItems( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, uint totalBufferSize, uint numProperties, PropertyItemInternal* allItems); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPropertyCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out uint numOfProperty); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPropertyIdList( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, uint numOfProperty, int* list); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPropertyItem( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, int propid, uint propSize, PropertyItemInternal* buffer); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPropertyItemSize( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, int propid, out uint size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPropertySize( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out uint totalBufferSize, out uint numProperties); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipRemovePropertyItem( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, int propid); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetPropertyItem( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, PropertyItemInternal* item); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageType( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out int type); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetImageType(IntPtr image, out int type); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDisposeImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipDisposeImage(IntPtr image); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipCreateBitmapFromFile(string filename, out IntPtr bitmap); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipCreateBitmapFromFileICM(string filename, out IntPtr bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromScan0(int width, int height, int stride, int format, IntPtr scan0, out IntPtr bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromGraphics(int width, int height, #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out IntPtr bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromHBITMAP(IntPtr hbitmap, IntPtr hpalette, out IntPtr bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromHICON(IntPtr hicon, out IntPtr bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateBitmapFromResource(IntPtr hresource, IntPtr name, out IntPtr bitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateHBITMAPFromBitmap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef nativeBitmap, out IntPtr hbitmap, int argbBackground); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateHICONFromBitmap( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef nativeBitmap, out IntPtr hicon); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneBitmapArea(float x, float y, float width, float height, int format, #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef srcbitmap, out IntPtr dstbitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCloneBitmapAreaI(int x, int y, int width, int height, int format, #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef srcbitmap, out IntPtr dstbitmap); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBitmapLockBits( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2639,7 +2639,7 @@ internal static partial int GdipBitmapLockBits( #endif BitmapData lockedBitmapData); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBitmapUnlockBits( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2650,87 +2650,87 @@ internal static partial int GdipBitmapUnlockBits( #endif BitmapData lockedBitmapData); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBitmapGetPixel( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef bitmap, int x, int y, out int argb); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBitmapSetPixel( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef bitmap, int x, int y, int argb); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBitmapSetResolution( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef bitmap, float dpix, float dpiy); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipImageGetFrameDimensionsCount( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, out int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipImageGetFrameDimensionsList( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, Guid* dimensionIDs, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMetafileFromEmf(IntPtr hEnhMetafile, [MarshalAs(UnmanagedType.Bool)] bool deleteEmf, out IntPtr metafile); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipCreateMetafileFromWmf(IntPtr hMetafile, [MarshalAs(UnmanagedType.Bool)] bool deleteWmf, #if NET7_0_OR_GREATER [MarshalUsing(typeof(WmfPlaceableFileHeader.PinningMarshaller))] #endif WmfPlaceableFileHeader wmfplacealbeHeader, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipCreateMetafileFromFile(string file, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileI(IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipRecordMetafileFileNameI(string fileName, IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipPlayMetafileRecord( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef metafile, EmfPlusRecordType recordType, int flags, int dataSize, byte[] data); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveGraphics( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, out int state); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawArc( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2741,7 +2741,7 @@ internal static partial int GdipDrawArc( #endif HandleRef pen, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawArcI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2752,7 +2752,7 @@ internal static partial int GdipDrawArcI( #endif HandleRef pen, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawLinesI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2763,7 +2763,7 @@ internal static partial int GdipDrawLinesI( #endif HandleRef pen, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawBezier( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2774,7 +2774,7 @@ internal static partial int GdipDrawBezier( #endif HandleRef pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawEllipse( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2785,7 +2785,7 @@ internal static partial int GdipDrawEllipse( #endif HandleRef pen, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawEllipseI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2796,7 +2796,7 @@ internal static partial int GdipDrawEllipseI( #endif HandleRef pen, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawLine( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2807,7 +2807,7 @@ internal static partial int GdipDrawLine( #endif HandleRef pen, float x1, float y1, float x2, float y2); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawLineI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2818,7 +2818,7 @@ internal static partial int GdipDrawLineI( #endif HandleRef pen, int x1, int y1, int x2, int y2); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawLines( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2829,7 +2829,7 @@ internal static partial int GdipDrawLines( #endif HandleRef pen, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawPath( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2844,7 +2844,7 @@ internal static partial int GdipDrawPath( #endif HandleRef path); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawPie( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2855,7 +2855,7 @@ internal static partial int GdipDrawPie( #endif HandleRef pen, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawPieI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2866,7 +2866,7 @@ internal static partial int GdipDrawPieI( #endif HandleRef pen, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawPolygon( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2877,7 +2877,7 @@ internal static partial int GdipDrawPolygon( #endif HandleRef pen, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawPolygonI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2888,7 +2888,7 @@ internal static partial int GdipDrawPolygonI( #endif HandleRef pen, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillEllipse( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2899,7 +2899,7 @@ internal static partial int GdipFillEllipse( #endif HandleRef brush, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillEllipseI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2910,7 +2910,7 @@ internal static partial int GdipFillEllipseI( #endif HandleRef brush, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillPolygon( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2921,7 +2921,7 @@ internal static partial int GdipFillPolygon( #endif HandleRef brush, PointF* points, int count, FillMode brushMode); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillPolygonI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2932,7 +2932,7 @@ internal static partial int GdipFillPolygonI( #endif HandleRef brush, Point* points, int count, FillMode brushMode); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillRectangle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2943,7 +2943,7 @@ internal static partial int GdipFillRectangle( #endif HandleRef brush, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillRectangleI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2954,7 +2954,7 @@ internal static partial int GdipFillRectangleI( #endif HandleRef brush, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillRectangles( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2965,7 +2965,7 @@ internal static partial int GdipFillRectangles( #endif HandleRef brush, RectangleF* rects, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillRectanglesI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2976,7 +2976,7 @@ internal static partial int GdipFillRectanglesI( #endif HandleRef brush, Rectangle* rects, int count); - [GeneratedDllImport(LibraryName, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipDrawString( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2995,7 +2995,7 @@ internal static partial int GdipDrawString( #endif HandleRef brush); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImageRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3006,14 +3006,14 @@ internal static partial int GdipDrawImageRectI( #endif HandleRef image, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGraphicsClear( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int argb); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawClosedCurve( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3024,7 +3024,7 @@ internal static partial int GdipDrawClosedCurve( #endif HandleRef pen, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawClosedCurveI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3035,7 +3035,7 @@ internal static partial int GdipDrawClosedCurveI( #endif HandleRef pen, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawClosedCurve2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3046,7 +3046,7 @@ internal static partial int GdipDrawClosedCurve2( #endif HandleRef pen, PointF* points, int count, float tension); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawClosedCurve2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3057,7 +3057,7 @@ internal static partial int GdipDrawClosedCurve2I( #endif HandleRef pen, Point* points, int count, float tension); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawCurve( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3068,7 +3068,7 @@ internal static partial int GdipDrawCurve( #endif HandleRef pen, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawCurveI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3079,7 +3079,7 @@ internal static partial int GdipDrawCurveI( #endif HandleRef pen, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawCurve2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3090,7 +3090,7 @@ internal static partial int GdipDrawCurve2( #endif HandleRef pen, PointF* points, int count, float tension); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawCurve2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3101,7 +3101,7 @@ internal static partial int GdipDrawCurve2I( #endif HandleRef pen, Point* points, int count, float tension); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawCurve3( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3112,7 +3112,7 @@ internal static partial int GdipDrawCurve3( #endif HandleRef pen, PointF* points, int count, int offset, int numberOfSegments, float tension); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawCurve3I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3123,7 +3123,7 @@ internal static partial int GdipDrawCurve3I( #endif HandleRef pen, Point* points, int count, int offset, int numberOfSegments, float tension); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillClosedCurve( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3134,7 +3134,7 @@ internal static partial int GdipFillClosedCurve( #endif HandleRef brush, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillClosedCurveI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3145,7 +3145,7 @@ internal static partial int GdipFillClosedCurveI( #endif HandleRef brush, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillClosedCurve2( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3156,7 +3156,7 @@ internal static partial int GdipFillClosedCurve2( #endif HandleRef brush, PointF* points, int count, float tension, FillMode mode); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillClosedCurve2I( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3167,7 +3167,7 @@ internal static partial int GdipFillClosedCurve2I( #endif HandleRef brush, Point* points, int count, float tension, FillMode mode); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillPie( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3178,7 +3178,7 @@ internal static partial int GdipFillPie( #endif HandleRef brush, float x, float y, float width, float height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipFillPieI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3189,7 +3189,7 @@ internal static partial int GdipFillPieI( #endif HandleRef brush, int x, int y, int width, int height, float startAngle, float sweepAngle); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipMeasureString( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3204,7 +3204,7 @@ internal static partial int GdipMeasureString( #endif HandleRef stringFormat, ref RectangleF boundingBox, out int codepointsFitted, out int linesFilled); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipMeasureCharacterRanges( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3219,7 +3219,7 @@ internal static partial int GdipMeasureCharacterRanges( #endif HandleRef stringFormat, int characterCount, IntPtr[] region); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImageI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3230,7 +3230,7 @@ internal static partial int GdipDrawImageI( #endif HandleRef image, int x, int y); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3241,7 +3241,7 @@ internal static partial int GdipDrawImage( #endif HandleRef image, float x, float y); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImagePoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3252,7 +3252,7 @@ internal static partial int GdipDrawImagePoints( #endif HandleRef image, PointF* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImagePointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3263,7 +3263,7 @@ internal static partial int GdipDrawImagePointsI( #endif HandleRef image, Point* points, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImageRectRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3282,7 +3282,7 @@ internal static partial int GdipDrawImageRectRectI( #endif HandleRef callbackdata); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImagePointsRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3301,7 +3301,7 @@ internal static partial int GdipDrawImagePointsRect( #endif HandleRef callbackdata); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImageRectRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3320,7 +3320,7 @@ internal static partial int GdipDrawImageRectRect( #endif HandleRef callbackdata); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImagePointsRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3339,7 +3339,7 @@ internal static partial int GdipDrawImagePointsRectI( #endif HandleRef callbackdata); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImageRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3350,7 +3350,7 @@ internal static partial int GdipDrawImageRect( #endif HandleRef image, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImagePointRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3361,7 +3361,7 @@ internal static partial int GdipDrawImagePointRect( #endif HandleRef image, float x, float y, float srcx, float srcy, float srcwidth, float srcheight, int srcunit); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawImagePointRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3372,7 +3372,7 @@ internal static partial int GdipDrawImagePointRectI( #endif HandleRef image, int x, int y, int srcx, int srcy, int srcwidth, int srcheight, int srcunit); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawRectangle( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3383,7 +3383,7 @@ internal static partial int GdipDrawRectangle( #endif HandleRef pen, float x, float y, float width, float height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawRectangleI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3394,7 +3394,7 @@ internal static partial int GdipDrawRectangleI( #endif HandleRef pen, int x, int y, int width, int height); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawRectangles( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3405,7 +3405,7 @@ internal static partial int GdipDrawRectangles( #endif HandleRef pen, RectangleF* rects, int count); - [GeneratedDllImport(LibraryName, SetLastError = true)] + [LibraryImport(LibraryName, SetLastError = true)] internal static partial int GdipDrawRectanglesI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -3416,34 +3416,34 @@ internal static partial int GdipDrawRectanglesI( #endif HandleRef pen, Rectangle* rects, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int destSpace, int srcSpace, PointF* points, int count); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipTransformPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef graphics, int destSpace, int srcSpace, Point* points, int count); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipLoadImageFromFileICM(string filename, out IntPtr image); - [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)] internal static partial int GdipLoadImageFromFile(string filename, out IntPtr image); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetEncoderParameterListSize( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] #endif HandleRef image, ref Guid encoder, out int size); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetEncoderParameterList( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.COMWrappers.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.COMWrappers.cs index 0f77c8bdb55ba7..caf7f181c5889d 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.COMWrappers.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.COMWrappers.cs @@ -61,7 +61,7 @@ public unsafe void Save(Stream outputStream) } } - [GeneratedDllImport(Interop.Libraries.Oleaut32)] + [LibraryImport(Interop.Libraries.Oleaut32)] private static unsafe partial int OleCreatePictureIndirect(PICTDESC* pictdesc, Guid* refiid, int fOwn, IntPtr* lplpvObj); [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs index 43effdee1c1b3b..aa78cd03d86213 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs @@ -46,7 +46,7 @@ public void Save(Stream outputStream) } } - [GeneratedDllImport(Interop.Libraries.Oleaut32, PreserveSig = false)] + [LibraryImport(Interop.Libraries.Oleaut32, PreserveSig = false)] internal static partial IntPtr OleCreatePictureIndirect(in PICTDESC pictdesc, in Guid refiid, bool fOwn); [ComImport] diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/LibX11Functions.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/LibX11Functions.cs index 0727247b27c55c..ffd594d014bad1 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/LibX11Functions.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/LibX11Functions.cs @@ -10,40 +10,40 @@ namespace System.Drawing internal static partial class LibX11Functions { // Some special X11 stuff - [GeneratedDllImport("libX11", EntryPoint = "XOpenDisplay")] + [LibraryImport("libX11", EntryPoint = "XOpenDisplay")] internal static partial IntPtr XOpenDisplay(IntPtr display); - [GeneratedDllImport("libX11", EntryPoint = "XCloseDisplay")] + [LibraryImport("libX11", EntryPoint = "XCloseDisplay")] internal static partial int XCloseDisplay(IntPtr display); - [GeneratedDllImport("libX11", EntryPoint = "XRootWindow")] + [LibraryImport("libX11", EntryPoint = "XRootWindow")] internal static partial IntPtr XRootWindow(IntPtr display, int screen); - [GeneratedDllImport("libX11", EntryPoint = "XDefaultScreen")] + [LibraryImport("libX11", EntryPoint = "XDefaultScreen")] internal static partial int XDefaultScreen(IntPtr display); - [GeneratedDllImport("libX11", EntryPoint = "XDefaultDepth")] + [LibraryImport("libX11", EntryPoint = "XDefaultDepth")] internal static partial uint XDefaultDepth(IntPtr display, int screen); - [GeneratedDllImport("libX11", EntryPoint = "XGetImage")] + [LibraryImport("libX11", EntryPoint = "XGetImage")] internal static partial IntPtr XGetImage(IntPtr display, IntPtr drawable, int src_x, int src_y, int width, int height, int pane, int format); - [GeneratedDllImport("libX11", EntryPoint = "XGetPixel")] + [LibraryImport("libX11", EntryPoint = "XGetPixel")] internal static partial int XGetPixel(IntPtr image, int x, int y); - [GeneratedDllImport("libX11", EntryPoint = "XDestroyImage")] + [LibraryImport("libX11", EntryPoint = "XDestroyImage")] internal static partial int XDestroyImage(IntPtr image); - [GeneratedDllImport("libX11", EntryPoint = "XDefaultVisual")] + [LibraryImport("libX11", EntryPoint = "XDefaultVisual")] internal static partial IntPtr XDefaultVisual(IntPtr display, int screen); - [GeneratedDllImport("libX11", EntryPoint = "XGetVisualInfo")] + [LibraryImport("libX11", EntryPoint = "XGetVisualInfo")] internal static partial IntPtr XGetVisualInfo(IntPtr display, int vinfo_mask, ref XVisualInfo vinfo_template, ref int nitems); - [GeneratedDllImport("libX11", EntryPoint = "XVisualIDFromVisual")] + [LibraryImport("libX11", EntryPoint = "XVisualIDFromVisual")] internal static partial IntPtr XVisualIDFromVisual(IntPtr visual); - [GeneratedDllImport("libX11", EntryPoint = "XFree")] + [LibraryImport("libX11", EntryPoint = "XFree")] internal static partial void XFree(IntPtr data); } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs index 6052738d20abdc..463d105735d569 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs @@ -26,19 +26,19 @@ internal static IntPtr LoadLibcups() return lib; } - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int cupsGetDests(ref IntPtr dests); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial void cupsFreeDests(int num_dests, IntPtr dests); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr cupsTempFd(sbyte[] sb, int len); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr cupsGetDefault(); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int cupsPrintFile( [MarshalAs(UnmanagedType.LPUTF8Str)] string printer, [MarshalAs(UnmanagedType.LPUTF8Str)] string filename, @@ -46,22 +46,22 @@ internal static partial int cupsPrintFile( int num_options, IntPtr options); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr cupsGetPPD([MarshalAs(UnmanagedType.LPUTF8Str)] string printer); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr ppdOpenFile([MarshalAs(UnmanagedType.LPUTF8Str)] string filename); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial IntPtr ppdFindOption(IntPtr ppd_file, [MarshalAs(UnmanagedType.LPUTF8Str)] string keyword); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial void ppdClose(IntPtr ppd); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int cupsParseOptions([MarshalAs(UnmanagedType.LPUTF8Str)] string arg, int number_of_options, ref IntPtr options); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial void cupsFreeOptions(int number_options, IntPtr options); } } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs index e7f64052d75cc7..df6a19216d049d 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs @@ -151,83 +151,83 @@ internal static void ReleaseContext(IntPtr port, IntPtr context) } #region Cocoa Methods - [GeneratedDllImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)] public static partial IntPtr objc_getClass(string className); - [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend")] + [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend")] public static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector); - [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend_stret")] + [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend_stret")] public static partial void Rect_objc_msgSend_stret(out Rect arect, IntPtr basePtr, IntPtr selector); - [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend")] + [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend")] [return:MarshalAs(UnmanagedType.U1)] public static partial bool bool_objc_msgSend(IntPtr handle, IntPtr selector); - [GeneratedDllImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)] public static partial IntPtr sel_registerName(string selectorName); #endregion - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial IntPtr CGMainDisplayID(); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial Rect CGDisplayBounds(IntPtr display); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial int HIViewGetBounds(IntPtr vHnd, ref Rect r); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial int HIViewConvertRect(ref Rect r, IntPtr a, IntPtr b); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial IntPtr GetControlOwner(IntPtr aView); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial int GetWindowBounds(IntPtr wHnd, uint reg, ref QDRect rect); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial IntPtr GetWindowPort(IntPtr hWnd); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial IntPtr GetQDGlobalsThePort(); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CreateCGContextForPort(IntPtr port, ref IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CFRelease(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void QDBeginCGContext(IntPtr port, ref IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void QDEndCGContext(IntPtr port, ref IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial int CGContextClipToRect(IntPtr context, Rect clip); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial int CGContextClipToRects(IntPtr context, Rect[] clip_rects, int count); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextTranslateCTM(IntPtr context, float tx, float ty); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextScaleCTM(IntPtr context, float x, float y); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextFlush(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextSynchronize(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial IntPtr CGPathCreateMutable(); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGPathAddRects(IntPtr path, IntPtr _void, Rect[] rects, int count); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGPathAddRect(IntPtr path, IntPtr _void, Rect rect); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextAddRects(IntPtr context, Rect[] rects, int count); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextAddRect(IntPtr context, Rect rect); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextBeginPath(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextClosePath(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextAddPath(IntPtr context, IntPtr path); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextClip(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextEOClip(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextEOFillPath(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextSaveGState(IntPtr context); - [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] + [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")] internal static partial void CGContextRestoreGState(IntPtr context); } diff --git a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs index def9a99cb49870..23f667cdbf31f8 100644 --- a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs +++ b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs @@ -196,7 +196,7 @@ private static string GetExpectedPermissions(string expectedPermissions) return expectedPermissions; } - [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] private static partial int mkfifo(string path, int mode); } } diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs index 9fd5f1d6297e8b..f4d2dd34df4f5c 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs @@ -10,7 +10,7 @@ namespace System.IO.Tests [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public partial class Directory_NotifyFilter_Tests : FileSystemWatcherTest { - [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static partial uint SetSecurityInfoByHandle( string name, uint objectType, uint securityInformation, IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl); diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs index e3f2c95eaad5eb..b70655288f006f 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs @@ -12,7 +12,7 @@ namespace System.IO.Tests [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public partial class File_NotifyFilter_Tests : FileSystemWatcherTest { - [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] private static partial uint SetSecurityInfoByHandle(string name, uint objectType, uint securityInformation, IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl); diff --git a/src/libraries/System.IO.FileSystem/tests/FileSystemTest.Unix.cs b/src/libraries/System.IO.FileSystem/tests/FileSystemTest.Unix.cs index 011e4c188d3433..213f21525d0025 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileSystemTest.Unix.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileSystemTest.Unix.cs @@ -8,10 +8,10 @@ namespace System.IO.Tests { public abstract partial class FileSystemTest { - [GeneratedDllImport("libc", SetLastError = true)] + [LibraryImport("libc", SetLastError = true)] protected static partial int geteuid(); - [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] protected static partial int mkfifo(string path, int mode); } } diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs index cd0c98c44b5f39..8764766e46a87d 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs @@ -31,10 +31,10 @@ public abstract partial class MemoryMappedFilesTestBase : FileCleanupTestBase return pageSize; }); - [GeneratedDllImport("libc", SetLastError = true)] + [LibraryImport("libc", SetLastError = true)] private static partial int sysconf(int name); - [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] + [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)] protected static partial int mkfifo(string path, int mode); /// Asserts that the handle's inheritability matches the specified value. diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs index 018f7e19980c96..d0dd22afb222bc 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs @@ -20,13 +20,13 @@ public abstract partial class MemoryMappedFilesTestBase : FileCleanupTestBase return pageSize; }); - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool GetHandleInformation(IntPtr hObject, out uint lpdwFlags); private const uint HANDLE_FLAG_INHERIT = 0x00000001; - [GeneratedDllImport("kernel32.dll")] + [LibraryImport("kernel32.dll")] private static partial void GetSystemInfo(out SYSTEM_INFO input); [StructLayout(LayoutKind.Sequential)] diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs index c91d0604383fcd..6f75ed908f3716 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs @@ -66,7 +66,7 @@ public void SafeMemoryMappedViewHandle_CanUseInPInvoke_Unix() Assert.NotNull(handle); } - [GeneratedDllImport("libc")] + [LibraryImport("libc")] private static unsafe partial SafeMemoryMappedViewHandle mmap(IntPtr addr, nint lengthint, int prot, int flags, int fd, nuint offset); } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs index f6a1b156c4403b..7de4004383938f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs @@ -38,11 +38,11 @@ public XplatEventLogger() {} return null; } - [GeneratedDllImport(RuntimeHelpers.QCall)] + [LibraryImport(RuntimeHelpers.QCall)] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool IsEventSourceLoggingEnabled(); - [GeneratedDllImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)] private static partial void LogEventSource(int eventID, string? eventName, string eventSourceName, string payload); private static readonly List escape_seq = new List { '\b', '\f', '\n', '\r', '\t', '\"', '\\' }; From 08ea02d12faf96817c6cbdddea1fc3601cd5a692 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 7 Mar 2022 10:42:06 -0800 Subject: [PATCH 3/5] Update docs --- docs/coding-guidelines/interop-guidelines.md | 2 +- docs/design/features/source-generator-com.md | 6 +++--- .../design/features/source-generator-pinvokes.md | 10 +++++----- .../LibraryImportGenerator/Compatibility.md | 16 ++++++++-------- .../libraries/LibraryImportGenerator/Pipeline.md | 16 ++++++++-------- .../LibraryImportGenerator/SpanMarshallers.md | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md index 90d4c16eb78b88..6490cd7865410f 100644 --- a/docs/coding-guidelines/interop-guidelines.md +++ b/docs/coding-guidelines/interop-guidelines.md @@ -166,7 +166,7 @@ Using enums instead of partial, static classes can lead to needing lots of casts When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices). -The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/LibraryImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`. +The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/LibraryImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `LibraryImport` and be `static` and `partial`. If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays: - `System.Memory` diff --git a/docs/design/features/source-generator-com.md b/docs/design/features/source-generator-com.md index 45945f0fdbb4c9..6af31c4d0bb169 100644 --- a/docs/design/features/source-generator-com.md +++ b/docs/design/features/source-generator-com.md @@ -106,7 +106,7 @@ We do not plan on supporting `IDispatch` integration with C# `dynamic`, at least ### Checkpoint 5: .NET 6-compatible output -A very important component of source generators is determining how to trigger them. For the DllImportGenerator, we trigger on a new attribute type, `GeneratedDllImportAttribute`, that is applied in place of the previous `DllImportAttribute`. For the JSON source generator, the team decided to have developers define an empty `JsonSerializerContext`-derived class and add `JsonSerializableAttribute` attribute on that context type that each point to a type that the generated serialization context should support. Below are the potential API designs we considered. All options below would support the `GuidAttribute` attribute to specify an IID, the `InterfaceTypeAttribute` attribute with the `InterfaceIsIUnknown` member (and `InterfaceIsIDispatch` if Checkpoint 4 is achieved), and the `DispIdAttribute` for `IDispatch` scenarios. We selected Option 5 as it gives us the most flexibility to express the switches we want to express to the user without tying us down to legacy requirements or requiring additional metadata in basic scenarios. +A very important component of source generators is determining how to trigger them. For the DllImportGenerator, we trigger on a new attribute type, `LibraryImportAttribute`, that is applied in place of the previous `DllImportAttribute`. For the JSON source generator, the team decided to have developers define an empty `JsonSerializerContext`-derived class and add `JsonSerializableAttribute` attribute on that context type that each point to a type that the generated serialization context should support. Below are the potential API designs we considered. All options below would support the `GuidAttribute` attribute to specify an IID, the `InterfaceTypeAttribute` attribute with the `InterfaceIsIUnknown` member (and `InterfaceIsIDispatch` if Checkpoint 4 is achieved), and the `DispIdAttribute` for `IDispatch` scenarios. We selected Option 5 as it gives us the most flexibility to express the switches we want to express to the user without tying us down to legacy requirements or requiring additional metadata in basic scenarios. #### Option 1: Annotated ComWrappers stub @@ -362,7 +362,7 @@ partial class MyComWrappers : ComWrappers Pros: -- Similar experience to the `GeneratedDllImportAttribute`, where it basically replaces its built-in equivalent as a drop-in. +- Similar experience to the `LibraryImportAttribute`, where it basically replaces its built-in equivalent as a drop-in. - Very easy to automatically hook up generated marshalling and to provide an easy process for other source generators to duplicate to support side-by-side as the policy is very simple. - Since we only generate a single `ComWrappers`-derived type, we could also decide to make the `ComObject` type public for .NET 7+ scenarios and make it private for .NET 6 scenarios as we know there will only ever be one. - The `GeneratedComImportAttribute` and `GeneratedComVisibleAttribute` attributes mirror the existing `ComImportAttribute` and `ComVisibleAttribute`, which will help provide a more intuitive view of the types and how to hook in tools that process C# -> TLB or TLB -> C# into the generator's flow. @@ -480,7 +480,7 @@ partial class MyComWrappers : ComWrappers Pros: -- Similar experience to the `GeneratedDllImportAttribute`, where it basically replaces its built-in equivalent as a drop-in. +- Similar experience to the `LibraryImportAttribute`, where it basically replaces its built-in equivalent as a drop-in. - The `GeneratedComImportAttribute` and `GeneratedComVisibleAttribute` attributes mirror the existing `ComImportAttribute` and `ComVisibleAttribute`, which will help provide a more intuitive view of the types and how to hook in tools that process C# -> TLB or TLB -> C# into the generator's flow. Cons: diff --git a/docs/design/features/source-generator-pinvokes.md b/docs/design/features/source-generator-pinvokes.md index dc2128bfd95709..f3608e09252a3b 100644 --- a/docs/design/features/source-generator-pinvokes.md +++ b/docs/design/features/source-generator-pinvokes.md @@ -80,7 +80,7 @@ An example of how the previous P/Invoke snippet could be transformed is below. T `Program.cs` (User written code) ``` CSharp -/* A */ [GeneratedDllImportAttribute("Kernel32.dll")] +/* A */ [LibraryImportAttribute("Kernel32.dll")] /* B */ partial static bool QueryPerformanceCounter(out long lpPerformanceCount); ... long count; @@ -89,7 +89,7 @@ long count; Observe point (A), the new attribute. This attribute provides an indication to a Source Generator that the following declaration represents a native export that will be called via a generated stub. -During the source generation process the metadata in the `GeneratedDllImportAttribute` (A) would be used to generate a stub and invoke the desired native export. Also note that the method declaration is marked `partial`. The Source Generator would then generate the source for this partial method. The invocation (C) remains unchanged to that of usage involving `DllImportAttribute`. +During the source generation process the metadata in the `LibraryImportAttribute` (A) would be used to generate a stub and invoke the desired native export. Also note that the method declaration is marked `partial`. The Source Generator would then generate the source for this partial method. The invocation (C) remains unchanged to that of usage involving `DllImportAttribute`. `Stubs.g.cs` (Source Generator code) @@ -117,11 +117,11 @@ In this system it is not defined how marshaling of specific types would be perfo In the current Source Generator design modification of any user written code is not permitted. This includes modification of any non-functional metadata (e.g. Attributes). The above design therefore introduces a new attribute and signature for consumption of a native export. In order to consume Source Generators, users would need to update their source and adoption could be stunted by this requirement. -As a mitigation it would be possible to create a [Roslyn Analyzer and Code fix](https://github.com/dotnet/roslyn/blob/master/docs/wiki/Getting-Started-Writing-a-Custom-Analyzer-&-Code-Fix.md) to aid the developer in converting `DllImportAttribute` marked functions to use `GeneratedDllImportAttribute`. Additionally, the function signature would need to be updated to remove the `extern` keyword and add the `partial` keyword to the function and potentially the enclosing class. +As a mitigation it would be possible to create a [Roslyn Analyzer and Code fix](https://github.com/dotnet/roslyn/blob/master/docs/wiki/Getting-Started-Writing-a-Custom-Analyzer-&-Code-Fix.md) to aid the developer in converting `DllImportAttribute` marked functions to use `LibraryImportAttribute`. Additionally, the function signature would need to be updated to remove the `extern` keyword and add the `partial` keyword to the function and potentially the enclosing class. ## Proposed API -Given the Source Generator restrictions and potential confusion about overloaded attribute usage, the new `GeneratedDllImportAttribute` attribute mirrors the existing `DllImportAttribute`. +Given the Source Generator restrictions and potential confusion about overloaded attribute usage, the new `LibraryImportAttribute` attribute mirrors the existing `DllImportAttribute`. ``` CSharp namespace System.Runtime.InteropServices @@ -131,7 +131,7 @@ namespace System.Runtime.InteropServices /// arguments instead of relying on the CLR to generate an IL Stub at runtime. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] - public sealed class GeneratedDllImportAttribute : Attribute + public sealed class LibraryImportAttribute : Attribute { /// /// Enables or disables best-fit mapping behavior when converting Unicode characters diff --git a/docs/design/libraries/LibraryImportGenerator/Compatibility.md b/docs/design/libraries/LibraryImportGenerator/Compatibility.md index 50bc3b5b01dcc3..8e4f8506941592 100644 --- a/docs/design/libraries/LibraryImportGenerator/Compatibility.md +++ b/docs/design/libraries/LibraryImportGenerator/Compatibility.md @@ -8,19 +8,19 @@ The focus of version 1 is to support `NetCoreApp`. This implies that anything no ### Fallback mechanism -In the event a marshaller would generate code that has a specific target framework or version requirement that is not satisfied, the generator will instead produce a normal `DllImportAttribute` declaration. This fallback mechanism enables the use of `GeneratedDllImportAttribute` in most circumstances and permits the conversion from `DllImportAttribute` to `GeneratedDllImportAttribute` to be across most code bases. There are instances where the generator will not be able to handle signatures or configuration. For example, uses of `StringBuilder` are not supported in any form and consumers should retain uses of `DllImportAttribute`. Additionally, `GeneratedDllImportAttribute` cannot represent all settings available on `DllImportAttribute`—see below for details. +In the event a marshaller would generate code that has a specific target framework or version requirement that is not satisfied, the generator will instead produce a normal `DllImportAttribute` declaration. This fallback mechanism enables the use of `LibraryImportAttribute` in most circumstances and permits the conversion from `DllImportAttribute` to `LibraryImportAttribute` to be across most code bases. There are instances where the generator will not be able to handle signatures or configuration. For example, uses of `StringBuilder` are not supported in any form and consumers should retain uses of `DllImportAttribute`. Additionally, `LibraryImportAttribute` cannot represent all settings available on `DllImportAttribute`—see below for details. ### Semantic changes compared to `DllImportAttribute` [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) has been replaced with a new `StringMarshalling` enumeration. `Ansi` and `Auto` are no longer supported as first-class options and `Utf8` has been added. -With `DllImportAttribute`, the default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about `StringMarshalling` if it is not explicitly set on `GeneratedDllImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information. +With `DllImportAttribute`, the default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about `StringMarshalling` if it is not explicitly set on `LibraryImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information. -[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `GeneratedDllImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields. +[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `LibraryImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields. -[`CallingConvention`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) will not be supported for `GeneratedDllImportAttribute`. Users will be required to use the new `UnmanagedCallConvAttribute` attribute instead. This attribute provides support for extensible calling conventions and provides parity with the `UnmanagedCallersOnlyAttribute` attribute and C# function pointer syntax. We will enable our conversion code-fix to automatically convert explicit and known calling convention usage to use the `UnmanagedCallConvAttribute`. +[`CallingConvention`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) will not be supported for `LibraryImportAttribute`. Users will be required to use the new `UnmanagedCallConvAttribute` attribute instead. This attribute provides support for extensible calling conventions and provides parity with the `UnmanagedCallersOnlyAttribute` attribute and C# function pointer syntax. We will enable our conversion code-fix to automatically convert explicit and known calling convention usage to use the `UnmanagedCallConvAttribute`. -[`ExactSpelling`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.exactspelling) will not be supported for `GeneratedDllImportAttribute`. If `ExactSpelling` is used on an existing `DllImport`, the offered code-fix will provide users with additional options for using `A` or `W` suffixed variants depending on the provided `CharSet` so they can explicitly choose which spelling is correct for their scenario. +[`ExactSpelling`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.exactspelling) will not be supported for `LibraryImportAttribute`. If `ExactSpelling` is used on an existing `DllImport`, the offered code-fix will provide users with additional options for using `A` or `W` suffixed variants depending on the provided `CharSet` so they can explicitly choose which spelling is correct for their scenario. ### Required references @@ -36,7 +36,7 @@ These are all part of `NetCoreApp` and will be referenced by default unless [imp Marshalling of `char` will only be supported with `StringMarshalling.Utf16` or as `UnmanagedType.U2` or `UnmanagedType.I2`. It will not be supported when configured with any of the following: - [`UnmanagedType.U1` or `UnmanagedType.I1`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) - `StringMarshalling.Utf8` will not be supported. - - No explicit marshalling information - either `GeneratedDllImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute) + - No explicit marshalling information - either `LibraryImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute) In the built-in system, marshalling with `CharSet.Ansi` and `CharSet.None` used the [system default Windows ANSI code page](https://docs.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte) when on Windows and took the first byte of the UTF-8 encoding on non-Windows platforms. The above reasoning also applies to marshalling of a `char` as `UnmanagedType.U1` and `UnmanagedType.I1`. All approaches are fundamentally flawed and therefore not supported. If a single-byte character is expected to be marshalled it is left to the caller to convert a .NET `char` into a single `byte` prior to calling the native function. @@ -46,7 +46,7 @@ For `CharSet.Auto`, the built-in system relied upon detection at runtime of the Marshalling of `string` will not be supported when configured with any of the following: - [`UnmanagedType.VBByRefStr`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) - - No explicit marshalling information - either `GeneratedDllImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute) + - No explicit marshalling information - either `LibraryImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute) When converting from native to managed, the built-in system would throw a [`MarshalDirectiveException`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshaldirectiveexception) if the string's length is over 0x7ffffff0. The generated marshalling code will no longer perform this check. @@ -86,7 +86,7 @@ For some types - blittable or Unicode `char` - passed by read-only reference via ### `LCIDConversion` support -[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `GeneratedDllImportAttribute`. +[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `LibraryImportAttribute`. ### `[In, Out]` Attributes diff --git a/docs/design/libraries/LibraryImportGenerator/Pipeline.md b/docs/design/libraries/LibraryImportGenerator/Pipeline.md index c2b1844e3ed5c7..7d0d7a54fefb7f 100644 --- a/docs/design/libraries/LibraryImportGenerator/Pipeline.md +++ b/docs/design/libraries/LibraryImportGenerator/Pipeline.md @@ -1,6 +1,6 @@ # P/Invoke Generation Pipeline -The P/Invoke source generator is responsible for finding all methods marked with `GeneratedDllImportAttribute` and generating code for their implementations (stubs) and corresponding P/Invokes that will be called by the stubs. For every method, the steps are: +The P/Invoke source generator is responsible for finding all methods marked with `LibraryImportAttribute` and generating code for their implementations (stubs) and corresponding P/Invokes that will be called by the stubs. For every method, the steps are: 1. [Process the symbols and metadata](#symbols-and-metadata-processing) for the method, its parameters, and its return type. 1. [Determine the marshalling generators](#marshalling-generators) that will be responsible for generating the stub code for each parameter and return @@ -12,7 +12,7 @@ The pipeline uses the Roslyn [Syntax APIs](https://docs.microsoft.com/dotnet/api ## Symbol and metadata processing -The generator processes the method's `GeneratedDllImportAttribute` data, the method's parameter and return types, and the metadata on them (e.g. [`LCIDConversionAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute), [`MarshalAsAttribute`][MarshalAsAttribute], [struct marshalling attributes](StructMarshalling.md)). This information is used to determine the corresponding native type for each managed parameter/return type and how they will be marshalled. +The generator processes the method's `LibraryImportAttribute` data, the method's parameter and return types, and the metadata on them (e.g. [`LCIDConversionAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute), [`MarshalAsAttribute`][MarshalAsAttribute], [struct marshalling attributes](StructMarshalling.md)). This information is used to determine the corresponding native type for each managed parameter/return type and how they will be marshalled. A [`TypePositionInfo`][src-TypePositionInfo] is created for each type that needs to be marshalled. For each parameter and return type, this captures the managed type, managed and native positions (return or index in parameter list), and marshalling information. @@ -25,7 +25,7 @@ The processing step also includes handling any implicit parameter/return types t The below signature indicates that the native function returns an HRESULT, but has no other return value (out parameter). ```C# -[GeneratedDllImport("Lib", PreserveSig = false)] +[LibraryImport("Lib", PreserveSig = false)] static partial void Method(); ``` Processing the above signature would create a `TypePositionInfo` for the HRESULT return type for native call, with properties indicating that it is in the native return position and has no managed position. The actual P/Invoke would be: @@ -38,7 +38,7 @@ static partial int Method__PInvoke__(); The below signature indicates that the native function returns an HRESULT and also has an out parameter to be used as the managed return value. ```C# -[GeneratedDllImport("Lib", PreserveSig = false)] +[LibraryImport("Lib", PreserveSig = false)] [return: MarshalAs(UnmanagedType.U1)] static partial bool MethodWithReturn(); ``` @@ -158,7 +158,7 @@ Clearing the system error (1) is necessary because the native method may not set The P/Invoke called by the stub is created based on the user's original declaration of the stub. The signature is generated using the syntax returned by `AsNativeType` and `AsParameter` of the marshalling generators for the return and parameters. Any marshalling attributes on the return and parameters of the managed method - [`MarshalAsAttribute`][MarshalAsAttribute], [`InAttribute`][InAttribute], [`OutAttribute`][OutAttribute] - are dropped. -The fields of the [`DllImportAttribute`][DllImportAttribute] are set based on the fields of `GeneratedDllImportAttribute` as follows: +The fields of the [`DllImportAttribute`][DllImportAttribute] are set based on the fields of `LibraryImportAttribute` as follows: | Field | Behaviour | | ------------------------------------------------- | --------- | @@ -177,7 +177,7 @@ Explicit `EntryPoint`: ```C# // Original declaration -[GeneratedDllImport("Lib")] +[LibraryImport("Lib")] static partial void Method(out int i); // Generated P/Invoke @@ -189,7 +189,7 @@ Passed through: ```C# // Original declaration -[GeneratedDllImport("Lib", EntryPoint = "EntryPoint", CharSet = CharSet.Unicode)] +[LibraryImport("Lib", EntryPoint = "EntryPoint", CharSet = CharSet.Unicode)] static partial int Method(string s); // Generated P/Invoke @@ -201,7 +201,7 @@ Handled by generated source (dropped from `DllImport`): ```C# // Original declaration -[GeneratedDllImport("Lib", SetLastError = true)] +[LibraryImport("Lib", SetLastError = true)] [return: [MarshalAs(UnmanagedType.U1)] static partial bool Method([In][MarshasAs(UnmanagedType.LPWStr)] string s); diff --git a/docs/design/libraries/LibraryImportGenerator/SpanMarshallers.md b/docs/design/libraries/LibraryImportGenerator/SpanMarshallers.md index a1b3e74f672fe1..eccefc62e8748b 100644 --- a/docs/design/libraries/LibraryImportGenerator/SpanMarshallers.md +++ b/docs/design/libraries/LibraryImportGenerator/SpanMarshallers.md @@ -59,7 +59,7 @@ Introduce a new attribute named `GenericContiguousCollectionMarshallerAttribute` ```csharp namespace System.Runtime.InteropServices -{ +{ [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)] public sealed class GenericContiguousCollectionMarshallerAttribute : Attribute { @@ -99,7 +99,7 @@ public struct GenericContiguousCollectionMarshallerImpl // these constructors are required if marshalling from managed to native is supported. public GenericContiguousCollectionMarshallerImpl(GenericCollection collection, int nativeSizeOfElement); public GenericContiguousCollectionMarshallerImpl(GenericCollection collection, Span stackSpace, int nativeSizeOfElement); // optional - + public const int StackBufferSize = /* */; // required if the span-based constructor is supplied. /// @@ -227,7 +227,7 @@ struct WrappedInt public int ToManaged() => value; } -[GeneratedDllImport("Native")] +[LibraryImport("Native")] [return:MarshalUsing(CountElementName = nameof(length))] public static partial Span DuplicateValues([MarshalUsing(typeof(WrappedInt), ElementIndirectionLevel = 1)] Span values, int length); @@ -271,7 +271,7 @@ public struct GenericContiguousCollectionMarshallerImpl // these constructors are required if marshalling from managed to native is supported. public GenericContiguousCollectionMarshallerImpl(GenericCollection collection, int nativeSizeOfElements); public GenericContiguousCollectionMarshallerImpl(GenericCollection collection, Span stackSpace, int nativeSizeOfElements); // optional - + public const int StackBufferSize = /* */; // required if the span-based constructor is supplied. - public Span ManagedValues { get; } From d2eb353505c341ec0d98677dc2e502b1638c8c8d Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Tue, 8 Mar 2022 14:54:25 -0800 Subject: [PATCH 4/5] Fix test --- .../ConvertToLibraryImportFixerTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs index 890cc95234b7d6..da4793e8594ac0 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs @@ -519,11 +519,11 @@ partial class Enclosing { partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method|}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method2|}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method3|}(out int ret); } } @@ -531,11 +531,11 @@ partial class EnclosingPartial { partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method|}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method2|}(out int ret); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int {|CS8795:Method3|}(out int ret); } }"; From 3425f93079802e9fd1a90d8c04d19f2f6c4f7af9 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Wed, 9 Mar 2022 18:07:20 -0800 Subject: [PATCH 5/5] Update src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs Co-authored-by: Aaron Robinson --- .../tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs index 5ac7012e86a516..93b822d6f7b3df 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs @@ -8,7 +8,7 @@ namespace LibraryImportGenerator.UnitTests internal static class CodeSnippets { /// - /// Partially define attribute for pre-.NET 6.0 + /// Partially define attribute for pre-.NET 7.0 /// public static readonly string LibraryImportAttributeDeclaration = @" namespace System.Runtime.InteropServices