diff options
author | Elinor Fung <elfung@microsoft.com> | 2022-03-10 05:07:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 05:07:52 +0300 |
commit | c2ec86b1c552ac8a1749f9f98e012f707e325660 (patch) | |
tree | fef23a383576f9a71ac11345d7259a6e0b05d9a5 /src/libraries | |
parent | b71eba8b3a74fa6282dc1526e68abbd26f3e385f (diff) |
Rename `GeneratedDllImportAttribute` -> `LibraryImportAttribute` (#66307)
Diffstat (limited to 'src/libraries')
942 files changed, 3428 insertions, 3428 deletions
diff --git a/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs b/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs index 6dc8dee6c26..ff83cf7bb1b 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 27dd92ad210..a8fd8d2e78b 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 3bbc00aab0a..9cf78a9d6b1 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 8de978aea5d..8b987ce31ea 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 class Interop 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 @@ internal static partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 @@ internal static partial class Interop 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 @@ internal static partial class Interop } } - [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 partial class Interop 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 623b69772d6..e5fa30ca9fd 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); /// <summary> @@ -27,7 +27,7 @@ internal static partial class Interop return size; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")] private static partial int AndroidCryptoNative_DsaSignatureFieldSize(SafeDsaHandle dsa); /// <summary> @@ -41,7 +41,7 @@ internal static partial class Interop return size; } - [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")] + [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")] private static partial int DsaSizeP(SafeDsaHandle dsa); /// <summary> @@ -59,7 +59,7 @@ internal static partial class Interop internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> 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 @@ internal static partial class Interop 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 partial class Interop } } - [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 @@ internal static partial class Interop 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 9db42ff3810..369bdae0b6c 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 partial class Interop 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 partial class Interop } - [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 partial class Interop 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 e81681e958a..1c347132712 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 Interop internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> 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 @@ internal static partial class Interop * 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 178610b0e9a..ada183189e1 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 Interop 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 partial class Interop 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 c5bbd4c9abe..20ecb72e3bd 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 Interop internal static bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, Span<byte> 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 96d983bf701..42071325b54 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 b233af7d4dc..8ba0658735a 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 Interop 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 251f5bfc220..e3bea1970a2 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<byte> 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 6f9cfefbff4..f2bec40690b 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<byte> 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<byte> key, ReadOnlySpan<byte> source, Span<byte> 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 9585bafbc57..9116ab58a0a 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 partial class Interop // 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 fa8e5ff3711..c058213b111 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 partial class Interop 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 2623cbcdcee..9aef7f78b94 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<byte> 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop } } - [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 @@ internal static partial class Interop 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 f0f7356bbe9..5fd3828a319 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 9ae88238278..56acba08ad5 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 static partial class Interop 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 @@ internal static partial class Interop 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 partial class Interop 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 partial class Interop 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 @@ internal static partial class Interop 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<SslApplicationProtocol> protocols) { @@ -129,7 +129,7 @@ internal static partial class Interop } } - [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<SslProtocols> protocols) { @@ -138,10 +138,10 @@ internal static partial class Interop 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 partial class Interop 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 partial class Interop } } - [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 partial class Interop } } - [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 static partial class Interop } } - [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 partial class Interop 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 @@ internal static partial class Interop 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 partial class Interop 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 ee0bf3c7e55..cc3733f271e 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 Interop 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 partial class Interop 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<byte> data) { @@ -60,7 +60,7 @@ internal static partial class Interop 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 partial class Interop 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<byte> data) { @@ -92,7 +92,7 @@ internal static partial class Interop 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 c19c68fdfc0..996b0de5513 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 static partial class Interop 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 partial class Interop 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 2dcbd1683b5..ec5861ba6e1 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 partial class Interop 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<void*, void*, Interop.AndroidCrypto.PAL_KeyAlgorithm, void*, void> 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<void*, void*, void> 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 12554a3f2ff..87c060be74f 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 3c98d2d828d..9205bd014fa 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 35a6b9dd5b5..520d4d10457 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 @@ internal static partial class Interop 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 0ebede8c938..919240e692e 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 5efe9837327..622ecc65220 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<char*, IntPtr, void> callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context) @@ -20,16 +20,16 @@ internal static partial class Interop return EnumCalendarInfo((IntPtr)callback, localeName, calendarId, calendarDataType, context); } - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] // We skip the following DllImport because of 'Parsing function pointer types in signatures is not supported.' for some targeted // platforms (for example, WASM build). private static unsafe partial bool EnumCalendarInfo(IntPtr callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")] internal static partial int GetLatestJapaneseEra(); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetJapaneseEraStartDate(int era, out int startYear, out int startMonth, out int startDay); } diff --git a/src/libraries/Common/src/Interop/Interop.Casing.cs b/src/libraries/Common/src/Interop/Interop.Casing.cs index 466482601fc..62743b2c6ab 100644 --- a/src/libraries/Common/src/Interop/Interop.Casing.cs +++ b/src/libraries/Common/src/Interop/Interop.Casing.cs @@ -7,19 +7,19 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial void InitOrdinalCasingPage(int pageNumber, char* pTarget); } } diff --git a/src/libraries/Common/src/Interop/Interop.Collation.cs b/src/libraries/Common/src/Interop/Interop.Collation.cs index cb43ca14ce2..11fa2de6280 100644 --- a/src/libraries/Common/src/Interop/Interop.Collation.cs +++ b/src/libraries/Common/src/Interop/Interop.Collation.cs @@ -10,43 +10,43 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", StringMarshalling = StringMarshalling.Utf8)] internal static unsafe partial ResultCode GetSortHandle(string localeName, out IntPtr sortHandle); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")] internal static partial void CloseSortHandle(IntPtr handle); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int CompareString(IntPtr sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int IndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)] [MethodImpl(MethodImplOptions.NoInlining)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool StartsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)] [MethodImpl(MethodImplOptions.NoInlining)] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool EndsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool StartsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool EndsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", StringMarshalling = StringMarshalling.Utf16)] internal static unsafe partial int GetSortKey(IntPtr sortHandle, char* str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")] internal static partial int GetSortVersion(IntPtr sortHandle); } } diff --git a/src/libraries/Common/src/Interop/Interop.HostPolicy.cs b/src/libraries/Common/src/Interop/Interop.HostPolicy.cs index f41a18dad89..60ca3b979c8 100644 --- a/src/libraries/Common/src/Interop/Interop.HostPolicy.cs +++ b/src/libraries/Common/src/Interop/Interop.HostPolicy.cs @@ -17,15 +17,15 @@ internal static partial class Interop #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant #if TARGET_WINDOWS - [GeneratedDllImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf16)] + [LibraryImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf16)] #else - [GeneratedDllImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf8)] #endif [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial int corehost_resolve_component_dependencies(string componentMainAssemblyPath, corehost_resolve_component_dependencies_result_fn result); - [GeneratedDllImport(Libraries.HostPolicy)] + [LibraryImport(Libraries.HostPolicy)] [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] internal static partial IntPtr corehost_set_error_writer(IntPtr errorWriter); #pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant diff --git a/src/libraries/Common/src/Interop/Interop.ICU.cs b/src/libraries/Common/src/Interop/Interop.ICU.cs index de80c0a5425..99fcbe0d663 100644 --- a/src/libraries/Common/src/Interop/Interop.ICU.cs +++ b/src/libraries/Common/src/Interop/Interop.ICU.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Globalization { - [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")] + [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")] internal static partial int LoadICU(); internal static void InitICUFunctions(IntPtr icuuc, IntPtr icuin, ReadOnlySpan<char> version, ReadOnlySpan<char> suffix) @@ -20,10 +20,10 @@ internal static partial class Interop InitICUFunctions(icuuc, icuin, version.ToString(), suffix.Length > 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 496e5db1294..42df7e7f97c 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 1c720abde79..f5a8e90adcb 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 Interop 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 678833566cb..051f2763a11 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 287bc028ead..633f272f5f5 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 8e2a09f65c0..7e20cba698e 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 Interop // // 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 class Interop /*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 class Interop /*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 class Interop #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 class Interop // 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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop 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 class Interop /*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 class Interop /*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 class Interop /*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 class Interop /*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 3163a215f26..7dc5100a8b0 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 partial class Interop 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 d764bf86531..ba4326dfed0 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 partial class Interop 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 32ce0da44ab..20c2f5bb78d 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 Interop { 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 @@ internal static partial class Interop } } - [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 @@ internal static partial class Interop } } - [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 @@ internal static partial class Interop } } - [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 @@ internal static partial class Interop } } - [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 @@ internal static partial class Interop } } - [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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 74f423feed0..faf43785254 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 class Interop 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 class Interop 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 @@ internal static partial class Interop 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 8f0936bf1c3..446bdb4ada2 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 aeba90d5bc5..cb91cdea28b 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 f0775d72cad..482686b038e 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<byte> 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 e43e20d83f6..b1100a041f2 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 Interop // 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 466bd584f46..e8a319e6e6c 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 056628a81e6..2e83d9d5ceb 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 631aa86ce04..22d51bdd11c 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 static partial class Interop 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 f3150414634..1c0c8ebb6b5 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 152741605e0..5350aaa9003 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 Interop /// 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 /// </summary> - [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 96632448c11..390799cd4bd 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 ea555a81663..efd8c3cdf91 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 @@ internal static partial class Interop /// <param name="encoding">The encoding type.</param> /// <param name="isExternalRepresentation">Whether or not a BOM is present.</param> /// <returns>A CFStringRef on success, otherwise a SafeCreateHandle(IntPtr.Zero).</returns> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] private static partial SafeCreateHandle CFStringCreateWithBytes( IntPtr alloc, IntPtr bytes, @@ -63,7 +63,7 @@ internal static partial class Interop /// <param name="encoding">The encoding of the str variable. This should be UTF 8 for OS X</param> /// <returns>Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero</returns> /// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks> - [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 @@ internal static partial class Interop /// <param name="encoding">The encoding of the str variable. This should be UTF 8 for OS X</param> /// <returns>Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero</returns> /// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks> - [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 partial class Interop /// <param name="numValues">The number of values in the array</param> /// <param name="callbacks">Should be IntPtr.Zero</param> /// <returns>Returns a pointer to a CFArray on success; otherwise, returns IntPtr.Zero</returns> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] private static unsafe partial SafeCreateHandle CFArrayCreate( IntPtr allocator, IntPtr* values, @@ -171,14 +171,14 @@ internal static partial class Interop /// </summary> /// <param name="ptr">The CFType object to retain. This value must not be NULL</param> /// <returns>The input value</returns> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial IntPtr CFRetain(IntPtr ptr); /// <summary> /// Decrements the reference count on the specified object and, if the ref count hits 0, cleans up the object. /// </summary> /// <param name="ptr">The pointer on which to decrement the reference count.</param> - [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 2edb5c45f0a..96fbdeadf24 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 static partial class Interop /// <param name="flags">Flags to say what kind of events should be sent through this stream.</param> /// <returns>On success, returns a pointer to an FSEventStream object; otherwise, returns IntPtr.Zero</returns> /// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks> - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)] internal static unsafe partial SafeEventStreamHandle FSEventStreamCreate( IntPtr allocator, delegate* unmanaged<FSEventStreamRef, IntPtr, size_t, byte**, FSEventStreamEventFlags*, FSEventStreamEventId*, void> callback, @@ -115,7 +115,7 @@ internal static partial class Interop /// <param name="streamRef">The stream to attach to the RunLoop</param> /// <param name="runLoop">The RunLoop to attach the stream to</param> /// <param name="runLoopMode">The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info.</param> - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamScheduleWithRunLoop( SafeEventStreamHandle streamRef, CFRunLoopRef runLoop, @@ -126,7 +126,7 @@ internal static partial class Interop /// </summary> /// <param name="streamRef">The stream to receive events on.</param> /// <returns>Returns true if the stream was started; otherwise, returns false and no events will be received.</returns> - [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 class Interop /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events. /// </summary> /// <param name="streamRef">The stream to stop receiving events on.</param> - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamStop(SafeEventStreamHandle streamRef); /// <summary> /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events. /// </summary> /// <param name="streamRef">The stream to stop receiving events on.</param> - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamStop(IntPtr streamRef); /// <summary> @@ -149,7 +149,7 @@ internal static partial class Interop /// </summary> /// <param name="streamRef">The FSEventStream to invalidate</param> /// <remarks>This can only be called after FSEventStreamScheduleWithRunLoop has be called</remarks> - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamInvalidate(IntPtr streamRef); /// <summary> @@ -158,7 +158,7 @@ internal static partial class Interop /// <param name="streamRef">The stream to remove from the RunLoop</param> /// <param name="runLoop">The RunLoop to remove the stream from.</param> /// <param name="runLoopMode">The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info.</param> - [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + [LibraryImport(Interop.Libraries.CoreServicesLibrary)] internal static partial void FSEventStreamUnscheduleFromRunLoop( SafeEventStreamHandle streamRef, CFRunLoopRef runLoop, @@ -168,7 +168,7 @@ internal static partial class Interop /// Releases a reference count on the specified EventStream and, if necessary, cleans the stream up. /// </summary> /// <param name="streamRef">The stream on which to decrement the reference count.</param> - [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 ac8812931d0..d27539e32a9 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 Interop [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void CFRunLoopRun(); #else - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopRun(); #endif /// <summary> /// Runs the current thread's CFRunLoop object in a particular mode. /// </summary> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial int CFRunLoopRunInMode(CFStringRef mode, double seconds, int returnAfterSourceHandled); /// <summary> /// Notifies a RunLoop to stop and return control to the execution context that called CFRunLoopRun /// </summary> /// <param name="rl">The RunLoop to notify to stop</param> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopStop(CFRunLoopRef rl); /// <summary> @@ -52,7 +52,7 @@ internal static partial class Interop /// 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. /// </summary> /// <returns>Returns a pointer to a CFRunLoop on success; otherwise, returns IntPtr.Zero</returns> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial CFRunLoopRef CFRunLoopGetCurrent(); /// <summary> @@ -61,7 +61,7 @@ internal static partial class Interop /// <param name="rl">The run loop to modify.</param> /// <param name="source">The run loop source to add. The source is retained by the run loop.</param> /// <param name="mode">The run loop mode to which to add source.</param> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); /// <summary> @@ -70,14 +70,14 @@ internal static partial class Interop /// <param name="rl">The run loop to modify.</param> /// <param name="source">The run loop source to remove.</param> /// <param name="mode">The run loop mode of rl from which to remove source.</param> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); /// <summary> /// Invalidates a CFRunLoopSource object, stopping it from ever firing again. /// </summary> /// <param name="source">The run loop source to invalidate.</param> - [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + [LibraryImport(Interop.Libraries.CoreFoundationLibrary)] internal static partial void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source); /// <summary> @@ -88,7 +88,7 @@ internal static partial class Interop /// 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.</returns> - [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 594666dc401..693d58bcaca 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 static partial class Interop /// Pass null if no callouts are desired.</param> /// <param name="context">The context associated with the callout.</param> /// <returns>A reference to the new dynamic store session.</returns> - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] private static unsafe partial SafeCreateHandle SCDynamicStoreCreate( IntPtr allocator, CFStringRef name, @@ -67,7 +67,7 @@ internal static partial class Interop /// <param name="serviceID">The service ID or a regular expression pattern.</param> /// <param name="entity">The specific global entity, such as IPv4 or DNS.</param> /// <returns>A string containing the formatted key.</returns> - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] private static partial SafeCreateHandle SCDynamicStoreKeyCreateNetworkServiceEntity( IntPtr allocator, CFStringRef domain, @@ -99,7 +99,7 @@ internal static partial class Interop /// <param name="order">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.</param> /// <returns>The new run loop source object.</returns> - [GeneratedDllImport(Libraries.SystemConfigurationLibrary)] + [LibraryImport(Libraries.SystemConfigurationLibrary)] private static partial SafeCreateHandle SCDynamicStoreCreateRunLoopSource( IntPtr allocator, SCDynamicStoreRef store, @@ -126,7 +126,7 @@ internal static partial class Interop /// <param name="patterns">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.</param> /// <returns>Non-zero if the set of notification keys and patterns was successfully updated; zero otherwise.</returns> - [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 5e9f0e9e413..9b65332570b 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 static partial class Interop 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 6dbd15a4d29..7274cb56905 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 @@ internal static partial class Interop 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 partial class Interop 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 ccac9c97439..f337eb45c9a 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 static partial class Interop /// 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 /// </returns> - [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 929eb9acca8..dbb7fcc7e63 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 static partial class Interop /// <param name="pBuffer">A pointer to the memory block where the PID array will start</param> /// <param name="buffersize">The length of the block of memory allocated for the PID array</param> /// <returns>Returns the number of elements (PIDs) in the buffer</returns> - [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 partial class Interop /// 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 /// </returns> - [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 @@ internal static partial class Interop /// 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 /// </returns> - [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 @@ internal static partial class Interop /// 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 /// </returns> - [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 @@ internal static partial class Interop /// <param name="buffer">A pointer to an allocated block of memory that will be filled with the process path</param> /// <param name="bufferSize">The size of the buffer, should be PROC_PIDPATHINFO_MAXSIZE</param> /// <returns>Returns the length of the path returned on success</returns> - [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 partial class Interop /// <param name="flavor">Specifies the type of struct that is passed in to <paramref>buffer</paramref>. Should be RUSAGE_INFO_V3 to specify a rusage_info_v3 struct.</param> /// <param name="buffer">A buffer to be filled with rusage_info data</param> /// <returns>Returns 0 on success; on fail, -1 and errno is set with the error code</returns> - [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 c0e78cb5d15..68cf5d686c8 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 580111cbabb..89681a69c5e 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 f4afa274687..9a7cb5b18d8 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 d429c27ae87..6624fb1926c 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 5834de129d7..5798d5ed64b 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<byte> 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<byte> 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<byte> 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 d1a27c769eb..3676fd016a5 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 993d6d42ae7..1f7a33bef57 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<byte> key) @@ -29,22 +29,22 @@ internal static partial class Interop internal static int HmacUpdate(SafeHmacHandle ctx, ReadOnlySpan<byte> 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<byte> 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<byte> 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 703f72b7faf..0623b5e3d86 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 3122d1a1fe8..2c6a372f2ea 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 bdacabd7f19..14cfbb9ce3c 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 dac63e66f98..fc7884552b2 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 partial class Interop } } - [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 e3c68bed824..3e27e010e8c 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 2832aa3d9c0..93f1e8d72ce 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 partial class Interop } } - [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 f353c503f8d..84874577050 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 a37ecbf9634..ad5a34517b1 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 static partial class Interop RSA = 2, } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial ulong AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SafeSecKeyRefHandle publicKey); private delegate int SecKeyTransform(ReadOnlySpan<byte> source, out SafeCFDataHandle outputHandle, out SafeCFErrorHandle errorHandle); @@ -154,7 +154,7 @@ internal static partial class Interop } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_SecKeyCreateWithData( byte* pKey, int cbKey, @@ -163,13 +163,13 @@ internal static partial class Interop 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 789415a0d56..b6c1abaf362 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 @@ internal static partial class Interop 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 partial class Interop 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 a612ce0f16c..62df5c049a1 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 @@ internal static partial class Interop } } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static unsafe partial int AppleCryptoNative_SecKeyVerifySignature( SafeSecKeyRefHandle publicKey, byte* pbDataHash, @@ -79,7 +79,7 @@ internal static partial class Interop } } - [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 c1cdd4b33db..043308097e5 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 static partial class Interop 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<IntPtr, byte*, void**, int> readCallback, delegate* unmanaged<IntPtr, byte*, void**, int> 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<IntPtr> 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 9e6d56e2e74..3ba39364f3d 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 static partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 9a59dd08952..4a66436f0d0 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 efb189b2766..f741d33a730 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<byte> 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 c79a9deb1af..63fbcac110b 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 @@ internal static partial class Interop out pPrivateKeyOut); } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ImportCertificate( ref byte pbKeyBlob, int cbKeyBlob, @@ -42,7 +42,7 @@ internal static partial class Interop 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 785f9e6ad54..8245a870d78 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 @@ internal static partial class Interop out pOSStatus); } - [GeneratedDllImport(Libraries.AppleCryptoNative)] + [LibraryImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_X509ImportCertificate( ref byte pbKeyBlob, int cbKeyBlob, @@ -51,7 +51,7 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 c6779b4151e..713d724206f 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 2a71db0aa82..82f763dfe63 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 Interop /// <returns> /// true if the process status was read; otherwise, false. /// </returns> - [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 88af774f719..75971cc54c7 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 partial class Interop } #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 e7aa1b1e4db..8f79130cf7a 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); /// <summary> @@ -29,7 +29,7 @@ internal static partial class Interop /// 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 /// </returns> - [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); /// <summary> @@ -41,7 +41,7 @@ internal static partial class Interop /// <returns> /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// </returns> - [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); /// <summary> @@ -52,7 +52,7 @@ internal static partial class Interop /// <param name="timeout">The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds</param> /// <param name="triggered">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.</param> /// <returns>An error or Error.SUCCESS.</returns> - [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); /// <summary> 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 ce98ffa9c85..73f9c5196b5 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 static partial class Interop 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 c8abb85f00b..568899d612d 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 2385cf98bdb..69d3752b75c 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 82c32b02cf5..5f466b0e9d9 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 static partial class Interop 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 41dac6ff61c..f279f45cc4b 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 2184935f742..784f8c6fc95 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 423aa455022..940058d28c1 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 dcf65c410fc..4c438dba177 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 92a7bf269f3..8a1f40857bd 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 5149052c4ec..11d4e8d0da0 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 3bdbcf8c4ff..154eac7f62b 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 55c79888f18..446f22d020b 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 d61ab47050f..2638c2513dd 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 33f36acfc89..1bcc468f01f 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 b4896fc0a74..52b3653950f 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 @@ internal static partial class Interop 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<void*, byte*, IpAddressInfo*, void> ipv4Found, delegate* unmanaged<void*, byte*, IpAddressInfo*, uint*, void> ipv6Found, delegate* unmanaged<void*, byte*, LinkLayerAddressInfo*, void> 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<void*, IpAddressInfo*, void> 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 b6c4c21a168..197bdd7e220 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 69d57113aea..41b97b47dd1 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 8c3508ef46c..27f802947fc 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 Interop /// <summary> /// Returns -1 on error, 0 on success. /// </summary> - [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 57a278cd47a..b2efd516c62 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 a2a89fef026..0ed3518798c 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 static partial class Interop 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); /// <summary> /// Exposing this for SafeFileHandle.ReleaseHandle() to call. /// Normal callers should use FLock(SafeFileHandle fd). /// </summary> - [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 531ceb55de7..4c902e08285 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 b8367261ffd..33e87ced276 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 c44493fa286..c8b65c56680 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 Interop { 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 72290a13be0..d35b40b857b 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 Interop { 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 9454d42adb7..a09d81af5f1 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 partial class Interop } } - [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 96b5791d131..153518fabfe 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 be1316a2b17..c9d86da6516 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 6598dbdf55f..da8fca2c75d 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 static partial class Interop 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 22fb18f05a9..1831128b242 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 1029cff060c..2edaca1e8ad 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 74946795ca8..b2357eab38d 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 35263979dc3..26dabc853ea 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 f11d4efd443..228bab397b5 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 583288b65b3..18b3b6df4ed 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 deefc74f3d1..3e26d42c73e 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 973a704a7c2..28b474c1c84 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 Interop } 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 72710dcf7e1..4a99113a899 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 6ad3e4e3cd6..6bccdb2f36f 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 e962dbddec1..65e5cdf5594 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 static partial class Interop 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 50bf35c2d2c..023a4c830fc 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 23a338a30a7..bb1aed9cab1 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 a66bcfe3536..1ed8fd7217c 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 b24072f71d6..e20a12b9cd9 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 6b26b606434..016c85466c9 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 52fc19fe772..3577765f1bf 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 Interop /// <summary> /// Returns the full path to the executable for the current process, resolving symbolic links. /// </summary> - [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 f30235d8730..79b3b4fa396 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 static partial class Interop 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 76c1323761a..9d80ea44068 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 4677fd8f632..3c4ab6ff98d 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 static partial class Interop 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); /// <summary> 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 5b20a8660a6..1684298e311 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 a0a44f2a179..fa347dc12d9 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 49d4b0d703e..fb8ade9a49b 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 a77fb31b77a..3313c201f57 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 1aab445f842..29c2937f964 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 ca5c01cb61e..2fa2d4d496d 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 6e0e24a9845..00c96789658 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 276f1129112..6ee0e2e5364 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 994e4dcc443..14e1fff079a 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 35503c185b2..c58b3beb086 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 83410484f60..ea3ef66dea4 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 static partial class Interop 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 531c5ce82e9..b8bc38524a5 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 static partial class Interop 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 d253cb2e6ed..f165c926076 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 static partial class Interop 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 e3a50f6bcfa..81ebf2dafcc 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 7a6af166ed5..6dd5bf21e39 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 9ed5b29915a..da47ef8eb1b 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 c302dbe3daf..76302e8ddf5 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 partial class Interop 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 1fb42efc27e..d1cec81e8f6 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 static partial class Interop 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 04e18dc0da3..941227564a0 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 static partial class Interop 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 c76231bb193..26381e6b841 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 static partial class Interop 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 ecaae2b40ab..76244cf809d 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 static partial class Interop 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 c09c4e2dfc7..35fdb5f78f9 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 f630563bd12..b5918bb3dbe 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 0692aa48fff..8a2bd9db075 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 static partial class Interop 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 474429e1233..ea550a53137 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 76d6437be86..cab01aba366 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 5ac7aa1fc4d..0ee855f4018 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 5789ee734d4..8797980a80c 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 static partial class Interop } // 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 78263cbdd6a..b147f24111a 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 static partial class Interop 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 a0ed69251cc..60bd0bdb36f 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 3d689c57f38..323fcff57db 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 9a0a90cd8ab..23fb2447ef3 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 a71c0149d5a..5fb716592e0 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 09a4ae1e3e7..a6bb1dc3c0f 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<char> 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 f697cd93bcd..95250e6c27a 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 3a38edcc82e..ad31d402523 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 static partial class Interop 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 1f547971e01..6f031a0c45f 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 Interop [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 f8746833711..5de715fc3f5 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 static partial class Interop 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 5f04ee06956..d4dd7eed069 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 @@ internal static partial class Interop 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<IntPtr, NetworkChangeKind, void> 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 3daa76c3bfc..627296c1ab9 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 b48dff07b27..aa41a2f256e 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 de0f311e93a..a47036c6947 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 d658f4b9be6..742de1b8325 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 baba793575a..63c6b271dd0 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 6485745c34d..3b02546fe33 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 static partial class Interop 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 92587f258f6..35743399668 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 static partial class Interop /// </summary> 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 550aaff995a..d250c291bb8 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 65d9b711d27..08b6915894a 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 Interop /// <param name="timeout">The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds</param> /// <param name="triggered">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.</param> /// <returns>An error or Error.SUCCESS.</returns> - [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); /// <summary> 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 e2e96df6bfa..42653ac3d5f 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 static partial class Interop /// <returns> /// Returns 0 on success; otherwise, the error code is returned /// </returns> - [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 680bead95d6..e3025f965df 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<int, PosixSignal, int> 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 c2ecd36478b..ef2c39ddbc0 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 Interop /// 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 /// </returns> - [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 7d9988d057e..76f21fc8049 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 Interop /// 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 /// </returns> - [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 9bac51a9106..9362a84a4c2 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 static partial class Interop } } - [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 ce3b0648813..ae0fc4de4cc 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 Interop /// <returns> /// Returns the number of bytes placed into the buffer on success; bufferSize if the buffer is too small; and -1 on error. /// </returns> - [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); /// <summary> 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 c751528354b..844e669682b 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 fc4c934ead3..963e7072b62 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 Interop /// </summary> /// <param name="path">The path to the file system object</param> /// <returns>Returns the result string on success and null on failure</returns> - [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 a23bdad54ae..8c14c0e5935 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 5757d46f6cc..d6e5ab1a066 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 2bbac8ac392..c54f34915ea 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<int, int, int> 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 9d5881713c5..ccdbbfd35d0 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 Interop /// <returns> /// Returns 0 on success; otherwise, returns -1 /// </returns> - [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<char> oldPath, ReadOnlySpan<char> 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 1d25b5c82ad..935ccc9041d 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 static partial class Interop 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 2fce1f19ed9..3536ff05b8a 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 Interop /// <returns> /// Returns 0 on success; otherwise, returns -1 /// </returns> - [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 41e403ecf76..fada5626b31 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 Interop /// success; if the return value is equal to the size then the result may have been truncated. /// On failure, returns a negative value. /// </returns> - [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); /// <summary> @@ -47,7 +47,7 @@ internal static partial class Interop /// success; if the return value is equal to the size then the result may have been truncated. /// On failure, returns a negative value. /// </returns> - [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 464dc333e07..4f3de7c9444 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 e304cc29d2d..955b0fc1ace 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 c65b4529170..650afa465e3 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 b7310100384..f0a0cc562b2 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 d091c9d29dd..9d60674708c 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 f9c6b2be289..eed788da941 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<void> 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 2a52122fc51..615e14007a1 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 5eae2395836..e4eb9fca9a9 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 7e2fe7c131d..18333fbef1c 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 8a504d7a0b8..a235e8e133a 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 66048b39bac..1d57e7f8a6a 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 7661463b7b9..c4b420cee68 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<void> 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 f7f100cda2a..c01bbe657f4 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 6a04ca805a2..9a87ee58d6e 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 bce422402d8..56d00ccb3a9 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 a0c217a8aca..4c03a64e1be 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 45eb91559c0..ef14ce83a11 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 static partial class Interop 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 ccf6a419795..3fbae1b1e7f 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 094fa66a0df..15f42cddea4 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<char> path, out FileStatus output) @@ -20,7 +20,7 @@ internal static partial class Interop 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<char> 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 3da48e827fa..395c99dd7fd 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 static partial class Interop 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 7a4a697031e..ea191c81900 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 9e97fd87a97..02325f26229 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 3b2246fbe96..0ee8d166e85 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 Interop /// <summary> /// Forces a write of all modified I/O buffers to their storage mediums. /// </summary> - [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 5790ad50046..a8ea57a4300 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 static partial class Interop _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 47576743865..c7333093e78 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 static partial class Interop /// </param> /// <param name="message">The message to put in the log entry</param> /// <param name="arg1">Like printf, the argument is passed to the variadic part of the C++ function to wildcards in the message</param> - [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 252ae160cd1..9fe84d213e2 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<IntPtr, IntPtr> 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 d1788ee8154..87359ffcbe0 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 static partial class Interop /// <returns> /// Returns 0 on success; otherwise, returns -1 /// </returns> - [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 5e4d7a6aa99..984ca44c35c 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 static partial class Interop 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 ec2c5444de7..8e22880e087 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 4701e4729c3..a191e4935a5 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 Interop /// 2) if no children are terminated, 0 is returned /// 3) on error, -1 is returned /// </returns> - [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 129ea867cb6..2f4eae4584c 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 Interop /// 3) if the child has not yet terminated, 0 is returned /// 4) on error, -1 is returned. /// </returns> - [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 b71b9c5e3f7..bd192c24b8e 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 Interop /// <returns> /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// </returns> - [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 278346759d3..749b34b2e0c 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 Interop /// <returns> /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// </returns> - [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 3607e3fe8a5..c6a0ecf8793 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 f835484d10b..292523ff7bd 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 class Interop 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 class Interop 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 class Interop 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 class Interop 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 @@ internal static partial class Interop 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 e9a78844fd2..a5af06c76a9 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 4d486460685..3de8f890eb8 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 Interop 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 efbca475dc5..51a007e0f1a 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 partial class Interop } // 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 159a6ef2dfb..d007f57e1ef 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<byte> 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 a4ab3959872..2c2d9235a70 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<byte> 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 b139a446901..fc404297d39 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 01960008575..50dc4c2478f 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 Interop { internal delegate int NegativeSizeReadMethod<in THandle>(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 partial class Interop 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 partial class Interop 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 @@ internal static partial class Interop 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 ebce6ab847a..923930fd6ef 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); /// <summary> @@ -34,7 +34,7 @@ internal static partial class Interop return size; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")] private static partial int DsaSizeQ(SafeDsaHandle dsa); /// <summary> @@ -47,7 +47,7 @@ internal static partial class Interop return size; } - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")] private static partial int DsaSizeP(SafeDsaHandle dsa); /// <summary> @@ -65,7 +65,7 @@ internal static partial class Interop internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> 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 @@ internal static partial class Interop 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 partial class Interop } } - [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 @@ internal static partial class Interop 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 66b465b65e8..ff307db15e3 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 b9496982622..f47bf5d3e1b 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 class Interop 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 @@ internal static partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop 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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 partial class Interop } } - [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 465d67c0ecc..abaefab1dab 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 Interop 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 42adb07994d..d729d9bba55 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<byte> 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 bbcbcd20bf4..b70935b75cb 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 partial class Interop 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 partial class Interop } - [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 partial class Interop 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 77d7f780489..7d994d96402 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 Interop internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> 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 @@ internal static partial class Interop * 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 7ad6d523099..c62dfc00cb6 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 Interop 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 partial class Interop 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 cd25db971e2..407d9b29227 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 2d61d8b1cad..6ef629c8e0d 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 01e12ffbb55..5308043c8e8 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<byte> 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 523d3f33882..9fe32f23e42 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 partial class Interop 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 partial class Interop return pkey; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaDecrypt( SafeEvpPKeyHandle pkey, ref byte source, @@ -80,7 +80,7 @@ internal static partial class Interop return written; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaEncrypt( SafeEvpPKeyHandle pkey, ref byte source, @@ -115,7 +115,7 @@ internal static partial class Interop return written; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_RsaSignHash( SafeEvpPKeyHandle pkey, RSASignaturePaddingMode paddingMode, @@ -150,7 +150,7 @@ internal static partial class Interop 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 95e9ab89fc5..bbb7a67bd2d 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 partial class Interop 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 partial class Interop 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 @@ internal static partial class Interop } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial int CryptoNative_EncodePkcs8PrivateKey(IntPtr pkey, byte* buf); internal static ArraySegment<byte> RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle pkey) @@ -165,7 +165,7 @@ internal static partial class Interop } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_GetSubjectPublicKeyInfoSize(IntPtr pkey); private static int GetSubjectPublicKeyInfoSize(IntPtr pkey) @@ -180,7 +180,7 @@ internal static partial class Interop return ret; } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static unsafe partial int CryptoNative_EncodeSubjectPublicKeyInfo(IntPtr pkey, byte* buf); internal static ArraySegment<byte> 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 88cae2dad5a..496324f9976 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<byte> 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<byte> key, ReadOnlySpan<byte> source, Span<byte> 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 e7afaa13620..9dabafdd4d6 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 partial class Interop // 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 d3fada1b914..f30c816bc21 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 Interop 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 8d82c6cca2f..118ee48be92 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 81f12a4135c..a4cb8792fb3 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<byte> buf) @@ -31,10 +31,10 @@ internal static partial class Interop 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 partial class Interop 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 partial class Interop 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 696efb3b209..e27f5be7511 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<bool> 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 a4efc28f0da..46955394098 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 c7b4c22f14a..034ca717f7f 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 a1d5568e42e..bf922ca4f68 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<byte> 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 10e501f7631..99373d6eeb5 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 partial class Interop 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 66431af192d..b671bde648c 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 e06ec3910b1..605a85d2736 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 Interop 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 Interop 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 partial class Interop } } - [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 7401389a394..e735e68a1cb 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<IntPtr, byte**, byte*, byte*, uint, IntPtr, int> 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 e52164a5268..f3412d69cc4 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 deddc37736c..ede22911173 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 Interop { 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); /// <summary> /// Clone the input certificate into a new object. /// </summary> - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] internal static partial SafeX509Handle X509Duplicate(IntPtr handle); /// <summary> /// Clone the input certificate into a new object. /// </summary> - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")] internal static partial SafeX509Handle X509Duplicate(SafeX509Handle handle); /// <summary> /// Increment the native reference count of the certificate to protect against /// a free from another pointer-holder. /// </summary> - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")] internal static partial SafeX509Handle X509UpRef(IntPtr handle); /// <summary> /// Increment the native reference count of the certificate to protect against /// a free from another pointer-holder. /// </summary> - [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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop } } - [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 class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop } } - [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 partial class Interop 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 partial class Interop 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 1d3d385ab99..b52e9a517e3 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 class Interop [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 17aeb1559a1..0bc5e5a821f 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 7a75fb46c3c..a322b1bf2b9 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); /// <summary> /// 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) /// </summary> - [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")] + [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")] internal static partial IntPtr GetX509StackField(SafeX509StackHandle stack, int loc); /// <summary> /// 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) /// </summary> - [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 partial class Interop } } - [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 6ff3dba7e7b..08cf5b40b41 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 partial class Interop } } - [GeneratedDllImport(Libraries.CryptoNative)] + [LibraryImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreCtxResetForSignatureError( SafeX509StoreCtxHandle ctx, out SafeX509StoreHandle newStore); @@ -55,7 +55,7 @@ internal static partial class Interop } } - [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 f43f81fb09c..83a338bc3b3 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 6b99600ee05..97a275ae9f1 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 86f22a139ae..14bb8490059 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 a1866c345d5..3fc64c61cca 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 e67bc5b82bc..90b3d8ae12a 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 ae3b3247f30..b10c2ef6468 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 d1880f48084..d7b80aa25cd 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 2874cf13fb5..674ebbe3eb1 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 9796226af14..7c5196c9720 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 3fb3fddc4da..7b2219794ef 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 8e3cdb625e9..0a7508ad94d 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 ece6aad42eb..257e709cd00 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 014e88ad395..9bb721de683 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 1d65cc7f98e..120fc0e89ca 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 f5bba0ba8c0..fe1fd2c8b66 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 c34de91b9d7..4a8c468e12b 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 c1b97caebeb..d772679f301 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 5ee78eb9256..40d138810e0 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 cc93f468142..aba754cd2a5 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 355b12b17b2..787a9fa849f 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 static partial class Interop 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 1af84f68a51..22c8f6a14c5 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 a57449a61c5..8657595513c 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 static partial class Interop 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 cfad767ce8c..1178b4977aa 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 static partial class Interop 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 b87c8bbd42d..abac09ca060 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 a60d88cf6c3..57430f472e0 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 b386d608bdc..7a98e16663a 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 2fdf298de2d..fc35d9cde95 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 e285fc55a65..ffcc0b0e3a1 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 ad71af2ace8..48494bdd772 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 bf893d2da3f..5f1253cf487 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 static partial class Interop 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 c6df68e1b9f..cbf469011ba 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 static partial class Interop 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 @@ internal static partial class Interop 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 3b3bb0ad2d6..58a360cbd6f 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 static partial class Interop 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 79607274689..79743c8ef39 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 static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 679f15503e4..8a4da680528 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 e7696bc24cc..4d120afcc53 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 ee61cd293ac..468077f8311 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 eb993491267..fa8120c294e 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 f43ab4cd5d5..d48acdc9ffb 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 44c61c950c7..13b166560be 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 static partial class Interop 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 @@ internal static partial class Interop 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 b62fd35c8ea..2f15a8743cb 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 58d70532db6..fd5ca0c772c 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 951d32dcf90..98fcb41bb17 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 4cc73e651c3..5213692afe5 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 0d48bde3c28..2afd2097559 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use EncryptFile. /// </summary> - [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 partial class Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use DecryptFile. /// </summary> - [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 b57eed7fd91..d96c788e063 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 a66e136b428..132c775c3f0 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 b0d856c652c..3f6834880e8 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 49c246f7cf0..f11d25de517 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 96d26c13ece..c1082005eed 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 aa171591254..b4461eec5e3 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 f94e895d52d..483cfe04b23 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 static partial class Interop 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 9fa6b86d2fe..946becc9dfb 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 620cfee6e74..cf80389e399 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 6b113733f9d..2c732dbeba3 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 partial class Interop 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 0f97e3842fa..bcaf7293782 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 779a0fb9754..608030e847a 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 501889ce671..8fcadbe3bb3 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 d02e09c3a3a..cabd7fe19de 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 26c444e1415..1f4b8cdea76 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 fa2a4b72073..2898dbbf9f0 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 f14057ed6ce..e33d0bd550d 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 fbefdd14e66..e51364bd122 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 a2843215f4d..0ef69da601f 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 static partial class Interop 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 3ca68ca01c5..550b81d737c 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 ba76202482a..b8b4133661e 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 class Interop 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 72490e9c169..e04e831ebe6 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 48a23007d56..5d5bc2b1f78 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 32130b30164..a26ab172187 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 808294866c7..61b560fcdeb 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 2aef33a6589..69177318f37 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 696e10e9bfc..f7cfc286077 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 398d65b16de..cf99b269bb6 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 74e8cd57da3..04c1381f8f2 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 11628880ef7..f4ced42c9b6 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 a77ec2aa3f7..70d994664cd 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 8e932fc1d97..8e3b00921ff 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 f8f2971338b..5c17e8ee702 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 c703eebb53e..addce983f32 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 5ba8f0302b5..4a1d6b18fce 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 d79900044c3..50be738d918 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 2ed2561cffa..ce84a734d48 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 2da367aabab..fa32ea0886c 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 861d07ef36e..994f78c50f8 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 static partial class Interop 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 d38ac1c15d3..a2e87fcc0f3 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 8068ad0f9ea..c40173987bc 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 b5e69c759bc..80fad581e1b 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 5f51453ac1f..ab40e1193a4 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 7db51d0969f..b4e7f4e87eb 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 7f54f0b2245..e8dd8f556cf 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 7dcb9b9f0b6..5aebbaf0210 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 027995f5ce9..4fac2d301d5 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 faafb6d94a1..2fd37e88408 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 e25dc2b6139..c5453466e59 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 bfe62f32ebc..9a461fd4e11 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 1754b657682..e9a4cf96bd9 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 de24de23a6b..5818fbc5cbf 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 Interop 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 23bc17bad23..cff47218172 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 e7c6a1818db..82fa2302c8a 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 edf3bc01fbe..9e5e420146e 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 Interop { // 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 8881398a0e1..0fcd50c2490 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 00ae18319d1..5d1367d57fe 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 fbfa4afd630..bb154ebf889 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 eb124caf1f7..2823ee33abf 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 ce43f1ac640..04ae6e5a284 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 31df2772851..a0355598530 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 class Interop 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 18dd716f63b..d0a0eaf75a5 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 71548822174..a0ba6244e7f 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 class Interop 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 class Interop 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 class Interop 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 031fbc02708..315fd5c6f8a 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 class Interop 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 class Interop 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 class Interop 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 class Interop 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 e995568e9d5..e592e819d89 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 7428a4a8e3a..c079976e2e8 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 Interop { 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 59da4648a49..ee8ad9e93a5 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 e0ac537f1ce..f0a02614791 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 bfae62dbe5e..8e6e8aca26a 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 d7b84c123d2..95e9c170747 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 247c8134806..02fd6b829c9 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 a0de142ebde..445e61e1d15 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 c947f91ce80..531cd2b42d0 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 010e875c849..a81c21d0253 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 40011ea0a4d..ffba80e5fb1 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 414ddb50b6c..0a9d61a0fab 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 Interop 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 class Interop 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 677363a5288..f80ff380983 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 class Interop 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 407118d61b8..a54507556dd 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 @@ namespace Internal.NativeCrypto { 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 @@ namespace Internal.NativeCrypto return ntStatus == 0; } - [GeneratedDllImport(Libraries.BCrypt)] + [LibraryImport(Libraries.BCrypt)] private static partial uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); } @@ -177,7 +177,7 @@ namespace Internal.NativeCrypto 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 8856ae73881..be438c6831e 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 06f0707207c..128d9ac99f2 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 partial class Interop 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 ab67c0d7d3c..ee4407fc8ef 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 0ed212f3210..b031af0ce10 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 a8d29882073..ff6886a2ea3 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 9658c179f29..e122e014236 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 partial class Interop 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 fa2080f5461..45d977995b1 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 partial class Interop } } - [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 eace8eb2545..6570c7a79b4 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 935ed611bd1..51a64664520 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 Interop internal static NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, Span<byte> 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 e6ce2a9db53..7470572fb09 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 Interop { 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 f2b00b2df87..14b2a9fbe9a 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 partial class Interop 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 8dc018841da..2e56b42e381 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 4b69c44ba2a..e1817ce280e 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 b8d8ba4c27c..ebbcebc6b11 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 Interop internal static NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ReadOnlySpan<byte> 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 05dac933912..0cc2698d786 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 static partial class Interop 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 0be079608da..afa969a6b9d 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 a898fb287bc..8b73a512918 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 92f3c08320e..5f6e8ab5428 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 Interop 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 8c8169c18ab..479e43ab488 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 413ee46677f..5430d700b12 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 Interop { 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 35a9a97e039..2540e19f0d9 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 bffe2b32412..9172d733cf9 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 d2c07547651..707088e5e90 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 c0bce7da0a4..5812c362c65 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 4b96a878897..cb4ea0c6c4a 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 e4d3face51a..c0c3a2277ba 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 07d0ff7be87..f99441a7ef3 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 354aa3b71f8..f0cbf8ba0bd 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 7f30b7dfeac..65c8c552c9b 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 804d67115e5..7ec51502466 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 847919d10a2..2e363a4a891 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 a362f7ecea6..423dd3ec6b2 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 e84ba3f3177..5c4c40ddd1c 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 1170cef3c8d..e2898dbe64c 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 d65f23eeafb..df22ee4bf71 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 f84ced0d962..f3628b23ad7 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 576a2bd602e..8e70ad5b9ca 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 425dbe78c02..9198c51f047 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 3899b9bc58c..603003f240f 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 d57ec7cbe2c..96c5d37927e 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 72222c2594d..adb049f5e0b 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 class Interop 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 class Interop 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 8da8e0f1b6b..f12ac77c733 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 227a7830949..28acc687e40 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 6c00075f1f0..fbc96a3ea1a 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 Interop { // 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 e3973c419f8..160332ddfe0 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 e2260856975..a1c6b8fd978 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 f19926cf2ef..744dcae8d0b 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 d9cb7227ab3..2a448a7b24b 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 0374c231d3c..810542a6cf1 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 Interop 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 98bc90b473c..a4b348f00b3 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 328ab4527dc..f5462e116c6 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 3672044b303..d97573056ff 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 c8552f4d2d8..4a0e3735451 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 7c2a2672ddd..6d9b04d3f90 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 c42c9d2e15c..35ceeaffe3b 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 14b038a16fc..21ac539091a 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 d3cec8dfe6c..b35548c1d52 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 54ed734d4aa..3cf0ea12c70 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 1164c98c233..0b382cbbe0b 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 fdade1e9646..5a62179d199 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 partial class Interop 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 df1dd34ab20..ad3b2cd926e 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 00b69c8ba67..658d22c8680 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 b8489a8801b..7ac987f08d0 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 336675e110a..9d346a3c829 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 partial class Interop 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 0c05b6b63c6..2d0e9b1b1a3 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 6590ac6f5c2..ae5f4e792fd 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 Interop 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 2901218453f..e2957864f0e 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 dccb2dcc4fd..0cf1d7e3c34 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 2ca3b04b172..d89d849c97c 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 a07bdc3c5e2..0d98c737856 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 class Interop 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 e4b5c963334..4b319dfe970 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 class Interop 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 partial class Interop 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 class Interop 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 35461f94a4c..02676c31f39 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 d7b6f16963b..243f2f76368 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 5c9021d2376..503789f12c6 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 891b3918e07..1b68c739e50 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 cb2b731a44a..fb01327530a 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 Interop 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 a9deafc6b88..f7cf15985b6 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 partial class Interop 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 partial class Interop 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 773ea2edc31..ae36988d047 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 e4f2ba8564b..3d13416507f 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 761a68fbf8f..8733d419087 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 @@ internal static partial class Interop 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 ec136c7c041..4d5110c1584 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 Interop /// <summary> /// Version used for a buffer containing a scalar integer (not an IntPtr) /// </summary> - [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 d41daaa1e47..74862a7d458 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 0cd88774a7d..7df9fb7e147 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 80fcc4bac2a..ef4b92bc154 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 e655c2c593a..4bdd0880f52 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 @@ internal static partial class Interop #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 45c8e537e66..1954a5e50a5 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 2853d27fc60..211939d207d 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 static partial class Interop 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 6ead12e2541..fb62fb82f72 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 1f253821e28..4573cfc54de 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 @@ internal static partial class Interop 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 11107c5a197..3066c33fdf2 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 768bb63afae..14744639543 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 8536e7c745d..2a4b9b7c774 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 5a910510e46..afbc6ba4409 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 f54cf7eecd3..edf59c56dec 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 cb1057e91f6..98c0a135521 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 dec5e677243..db9776eae94 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 8d5d4dd19b2..fc309ed51ee 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 036cefd3bf2..4ca4eba089c 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 55cec2b89d0..e45e30bee21 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 @@ internal static partial class Interop 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 5355c10e67b..1517e07d725 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 30e68bbe212..58d4d9af1ab 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 a17c3de2ae3..1c3f5c64dd3 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 @@ internal static partial class Interop 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 2750cfe199b..aae92ce24eb 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 b0e34b5ca00..ac9d431ae76 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 52aa47a6ca3..31accb0e1ec 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 7aa96a8a0ae..d528fb8fecc 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 7822f894dcd..4cb72b927cc 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 static partial class Interop } - [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 @@ internal static partial class Interop } } - [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 992702b8999..d5244a56a74 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 38d66f931b0..1a56dd11dd0 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 @@ internal static partial class Interop } } - [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 483653c69dc..11b32ab4ef4 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 static partial class Interop internal ReadOnlySpan<byte> 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 partial class Interop 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 856a1c56a9b..c17641eab29 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 bf140ef27ca..cf6f3e17b3e 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 24499629158..c86c24ce507 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 dad6a632811..b2588e2cba5 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 Interop { 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 2061f5075c5..b5b597bf0dc 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 0004b68b42a..3a17ea9b96d 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 eabe864179b..165ba343a9d 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 d187b9ef51c..745ac11b5fb 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 f614013a537..22d3213f22d 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 static partial class Interop 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 1838d726f86..77eabe49503 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 c287ba762b2..2068b056c98 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 static partial class Interop 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 c15eef8ebaf..7760fd8e306 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use CopyFileEx. /// </summary> - [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 14bfbb5c76d..c679fbbb023 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use CreateDirectory. /// </summary> - [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 b598f2e3d3f..cf75397a856 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use CreateFile. /// </summary> - [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 8a4cebbbf59..e2114679bf3 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 class Interop 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 37ae80b99ec..3a7d5e0f352 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use CreateFile. /// </summary> - [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 0e67ae59676..76192195366 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 baca7eae851..00cefe210f3 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 2d0592896df..d09b9a09d3c 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 07f5f638d31..97ee5e67f77 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 d5bab344cfb..c804e06091d 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 1cdcd169f23..b6d79e4bdb4 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 Interop /// </summary> 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 777b8b2fdd4..1e4c296eeb5 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 static partial class Interop } // 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 729eb0af7f7..bd68847dc59 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 static partial class Interop 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 8e455ee9d2f..2713030dc07 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use DeleteFile. /// </summary> - [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 e1b97f280ae..e62fed5d5bc 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use DeleteVolumeMountPoint. /// </summary> - [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 21e1b2be820..1d202087e5d 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 Interop // 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 c0d137618c1..0c3d3d53552 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 20b52d93702..b23d9a394b0 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 b084c410da8..b2d2e1643f1 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 c33fa95b97d..edcaf54cb2d 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 9793f50dca8..4c600111a6c 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 538e5bc43df..e6ce9d57304 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 486ddb953b7..7a23e7f89e9 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 0a67cb1dfc3..ce0c3f09b3b 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 3e6fa6d792e..881d5f320e8 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 partial class Interop 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 effacb06ab8..f265ff1022f 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 Interop 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 ff363379595..c7aa1202973 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 8f8ea391aba..20b90d29523 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 42afb969b0e..3ca00bde57b 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 partial class Interop 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 adab75ec108..0eac8ca5cff 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 48a247ae5c9..b2cba0e19da 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 11fe930c316..13ec8f6160c 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 f35fbcc813a..d2ba6f94e47 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 aad022d6f81..0095c09cdac 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use FindFirstFile. /// </summary> - [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 748de48c53b..131384fbad9 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 689e44321e7..0f1edcea359 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 0fa730cad06..fb492377e6b 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 a3340f184f6..f07214f95d0 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 Interop 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 6c14dad8825..cc01c8b461b 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 Interop 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 52fd6194572..dbc151d2b07 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 dabec6e8f0a..d55825a6f2f 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 0b5f3cc0703..7f4558d05ac 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 static partial class Interop 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 e47bb8ab527..76ca4c50c96 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 0552a7a52c8..e55bd089169 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 partial class Interop 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 c19e80f0811..3d17ae7cd3c 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 6714e546fce..1d85a6e7e9f 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 fe441839e0b..7180888278c 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 33e73f8042b..c5348154ccc 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 b2d211e9390..1b2ee78b33a 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 partial class Interop 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 3d8c546dce5..ba9bafe115f 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 cbee47a7dc5..1cb27e4c53f 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 955d4973436..656896177d4 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 48608469dbc..98f484f6167 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 89f04ad9ff0..efa5c564f0d 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 be0fd407303..bc2b3e81cc7 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 13865d75fe3..a726b9704d9 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 73d33398d5a..75aea621e74 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 10b761fb5c5..773fd3d3863 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 cf86b13e035..d06b21cc95f 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 Interop { // 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 641be553029..6efddcd6f65 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 ec02db69f32..d92e85ab677 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 e3691f6c6dc..ac805034e1d 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 d2b6fb59e32..1789bac255a 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 04daf341896..59f6d4992e8 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use GetFileAttributesEx. /// </summary> - [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 585306b1cfe..6f978f9d848 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 1a2e5432e3a..deb355a0528 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 76f99ac51b7..eeca5b698d0 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 3d15bf6dedd..cdc0fcc3e53 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 Interop 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 687d5bf188a..7339009e7e3 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper. /// </summary> - [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 ca7bf2b5ef4..83fb8406e14 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 55a84179887..e75b4038c09 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 f084be9926b..1704ee83fd5 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 a99a77a2a51..6a86e79ef29 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper. /// </summary> - [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 def7124cbd3..d60af485a03 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 08b6784c4d2..095e6a85996 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 1b89788d9f0..489cc9f4853 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 710e14fc2ef..25c7dedc40f 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 f2b80ac6762..114cd372ee8 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 2d0b5535282..c663cc2e3b0 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 3e6f1f188c7..5945fa95c28 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 076079e0bb3..7505529e425 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 fa2db0412cd..6ef5b0c3a99 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 fc660806ba9..8cedaaf88ed 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 c76bda41ab8..4c7723b5539 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 dd7752bf536..c09afa13ce4 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 5261c0d5a06..2465c0d1d0a 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 07b94f8fda7..15b09ca3253 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 static partial class Interop 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 ec1c7736fab..871108a7c9a 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 1b172302564..6258f55f22e 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 7ceb948c4c4..64c234ba981 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 79f6a908c92..3d4eb64b032 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 3ededb092ef..859a85ae16e 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 501c25f54e4..e763e01c821 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 699d4b97f27..97d100e3b41 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 383a26f280d..f4d79faa584 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 e97c5658df5..9b80349ca1b 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 d273de72404..9234cd8b840 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 a0c39568ee4..fba61bf01a1 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 bef74a92e15..7c30b977c8f 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 4a0aef613c8..bcbd89bb93c 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 9a60f83a79f..97aa81ef2c3 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 6054ffdec40..d1e72cec336 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 b0b6d90baae..24ee8eba787 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 bfe62ac2f47..ad4edf64ea3 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 af5f7af1242..4082bc45677 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 f62db377183..9fc80bc5c5d 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 c618bac933e..66b2ccb6688 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 @@ internal static partial class Interop 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 9704e1c7379..7012582820f 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 4c6d51b98e7..99e18caf50b 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 Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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<char*, uint, void*, BOOL> 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<char*, void*, BOOL> 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<char*, uint, IntPtr, void*, BOOL> pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam); @@ -156,7 +156,7 @@ internal static partial class Interop 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 979e4b9a4ff..5576bdd3e6c 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 static partial class Interop 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 c68b192b77b..5de5b8d5957 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 static partial class Interop 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 e1fa1091065..8dc6f52bef6 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 855f904fc32..bf3560174c2 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 c6eb6755f01..2be93bc6c11 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 eb9e38114e4..8cc0f4bbf4d 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 9d1f7a8f815..d862ab65ce5 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 Interop 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 b987f56a022..5dea0386cdf 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 Interop 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 0bcd7e356a9..eb64d0d02af 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 Interop 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 ac97866a576..9584a8b9971 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 79a3387618a..898f47677b2 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 dede5057340..da1d8bbdaeb 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use MoveFile. /// </summary> - [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 dfb7a73c521..4b2b30b0c87 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 b110c47cd68..9b9bfff8202 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 Interop { 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 8d8a0c91e8c..347ec7c74b3 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 b33a81fcc73..2a1fdd11f41 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 f662ea538f2..f608aaecd77 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 937999e0ceb..0012b5de289 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 ff2d562abe8..23b9e80be3a 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 e6b8f1c0192..757e72b83c9 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 partial class Interop 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 f43439a3a33..506c14accf3 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 Interop // 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 2ed59d0ade1..11b3bf7716e 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 Interop // 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 1694738c4f2..fd2cb681088 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 004ca3a4376..58b48a5b1bd 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 partial class Interop 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 21e161c45ee..8960bf743d1 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 2153e7ce394..50367574e2e 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 static partial class Interop 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 2e4c002d883..52679d972a4 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 static partial class Interop 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 f42604055f9..b5eec929298 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 6e8aa47a7f9..d6482bba791 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 00b66c4ccde..8ec2b024dac 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 ceebb111aab..bc1c7fd20ce 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 partial class Interop 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 e701be68d0a..7c123d17d81 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use RemoveDirectory. /// </summary> - [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 531107f6c22..0a0ec60d291 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 b70c6d8fdf3..f7502cc7e0f 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 partial class Interop { 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 8b50d13eb61..150df2d5fb9 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 b862c711e09..238c96797d0 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 898a35947bb..6179d1a5539 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 partial class Interop 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 558f3e93a99..1f88b899238 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 e1ed76511fb..58b3c7a2f00 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 Interop { 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 88fd242f4d4..f1362740d05 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 64d037e4daa..3148bcf07f2 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 Interop { 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 1596458fdf5..63d2db5a2f0 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 Interop 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<int, BOOL> 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 30b4276d592..cde79e4e6db 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 177fe5f2853..2db5b5389db 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 bc913cf7c3b..c7392fa0b20 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 23bd38e24bf..64adfc479e5 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 fae0deb64eb..20c7a70c917 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 fbe96c541bb..b8ea92d0ec3 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 3cec4884c87..7f19ed21b6f 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 32b2060d3fe..960ee031e28 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 c2f1912ab38..d4215667da5 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 Interop /// <summary> /// WARNING: This method does not implicitly handle long paths. Use SetFileAttributes. /// </summary> - [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 f9150e02a0a..408c3d6c303 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 static partial class Interop 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 15b6fb2133b..e80bf32dbb6 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 b1ee5a8163a..e7050d1c49e 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 baf852e6be6..b04a0dd8454 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 2ee991183b7..b618d105d93 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 12aed4e80d8..000002efbd5 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 ea6222a500f..67edaa14565 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 8744b06bc28..31ab0f472a0 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 8efac8acc94..02cd318310a 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 3831b957c28..65e762cac45 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 98c0ac2e16d..340b7511597 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 d8cc9a8acdd..f96dfe16484 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 a559829b295..5b62e530e13 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 3c6d8554dd7..24f869a56eb 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 f891a3416e1..4cd4109cb74 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 e0f1db368a3..574d9abc86d 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 10fe4080a00..9b267a48012 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 4b203868bf6..0835d1dfd99 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 5a94d5ea606..bb2550642a7 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<IntPtr, IntPtr, IntPtr, void> 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<IntPtr, IntPtr, IntPtr, uint, void> 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 a0dda79bdf2..ba214356764 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<IntPtr, IntPtr, IntPtr, uint, UIntPtr, IntPtr, void> 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 464b7e19ff9..b1e9ed9a6be 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 Interop { 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 partial class Interop 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 static partial class Interop 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 4ecb0f45f7d..705d97ac3f4 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 static partial class Interop 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 1fcf7da5583..426e57c4b3d 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<IntPtr, IntPtr, IntPtr, void> 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 7fc3013ae68..de38b9e0a96 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 c3b60fa1ac2..953f3804ea9 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 179b07cea84..06ed93760d2 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 6ca6d7797a5..791124d1183 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 6d5d9b50562..aa4536511e1 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 Interop 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 d734016c52f..28aa861c2b9 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 fb9e9d527ff..48d1854b671 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 1b724823c46..c50cb304684 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 e9ac4eac80e..de2ab38e40c 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 95f175a980c..3abedcfa227 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 9b861b819d7..0a73d3a646b 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 fc879c3085d..91db5d11f6f 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 1a656256245..529848dd93c 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 ad2d77e538c..a4111755624 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 34225c68521..b490dd05835 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 5a41c078866..bcae4c05c19 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 2c4e963dbc5..40e18008c70 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 0e7cc88f1b4..3e2b483e3bb 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 Interop // 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 3ae10aaab16..b55f050342c 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 Interop // 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 partial class Interop 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 af7280f949c..c24b2fcf8a2 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 42126dc6faa..f7583969a74 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 Interop internal static unsafe ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> 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<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> 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 abd0f171ba3..1b24ea9b4e4 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 Interop 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 02298a6a76e..93783683b23 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 Interop /// <summary> /// Generate a key from a secret agreement /// </summary> - [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 78a18d5aa7c..6886fe241c0 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 static partial class Interop /// <summary> /// Generate a secret agreement for generating shared key material /// </summary> - [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 d97f1b1a941..3639139e14a 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 28adee9d595..294612f9e2a 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 a52da43417b..41c079d5ad1 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 partial class Interop 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 723f78e0849..e3b184c7288 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 Interop internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, Span<byte> 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<byte> pbHashValue, int cbHashValue, ReadOnlySpan<byte> 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 1f84f9a949b..40893366393 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 63104e2d240..b7dd6ed6ceb 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 Interop // 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 partial class Interop 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 741380134ed..f05fbc08791 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 c72613c21dd..cc80f325702 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 Interop { // 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 3ada672b1b0..fbbf8b96710 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 Interop { // 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 b3acd8b1024..b7a84524929 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 5d00c441854..526530f40a0 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 3a31c397581..858ae9c809f 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 a73a7ef720c..3fb9740a7f2 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 d5728833cae..7492ef118f4 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 b2af31cab12..5a9b58d6bd7 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 e2cc05f7578..92b36a053dd 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 be519d9008d..c9fdf3fe7e7 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 static partial class Interop 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 af00fce67e3..32527be1adc 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 partial class Interop } } - [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 8e9149aba06..11d26766d50 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 ecef10206da..ee658ac6c38 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 Interop 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 605360233f1..9171eb26a45 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 461b28620fd..f8e83dfd3db 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 d93d595ff35..32acb658bcd 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 87b81e9906d..93b0fa1ed1f 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 7da06597f9b..717fb1c3da3 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 4b262a1b824..3fa76bed1a5 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 09b31d14d44..adf400ac717 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 bc327864c63..6e980e6e6e8 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 6c93168c749..4652781c958 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 0019272d3a0..24db68ecfee 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 static partial class Interop 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 @@ internal static partial class Interop 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 d0b16e7c6b5..a997bbeec5c 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 ce96b7ed29e..dd8226a6fc9 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 Interop 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 984a1218e0a..b9391bb8b56 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 static partial class Interop 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 b537e785559..1c2444f0f67 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 8cc158ef645..4d4b9fe8464 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 1c6705ee2d5..89bef758ddc 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 08f1da5b650..ea358a4b5b4 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 83efbbaab90..390734113cd 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 a6c910ee5ee..b99810a84a1 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 dfc7ac02536..220129431d4 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 static partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 partial class Interop 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 a87db6074cb..89481e2d492 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 18f69bdeac7..b85d0d4d565 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 b41bcf9082b..81dfd508a3e 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 17ae9581152..461244ae4f0 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 efd057a296f..7aedb0ebb41 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 c5008429fac..a7e3b0b8ab9 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<IntPtr, IntPtr, Interop.BOOL> 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 3cd58188bf6..7218439fee2 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 b4330750678..642e3051279 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 597ad6b654b..5f6c796c902 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 9ee51a05404..be751199d8e 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 70caacaedac..e9033a7dceb 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 a63a0e5a632..9d5a4607d81 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 96f620139d9..618389cead7 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 Interop // 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 e026a50ffa6..6095fdf7ee9 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 3091b5c58e5..f4bb6c8b85a 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 9cc34ee12fb..62b267f48c0 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 c2b4a2cfaa7..d379b13e589 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 9eb8c1f116c..f7b1fdfbdbf 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 0b8fecf83a8..03a9fd08c5d 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 96ae83dbd98..11ae55e9f78 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 c09bfb716fa..8acaaae75e1 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 a6b086488ca..10da9e25ddb 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 639c0b1698a..d0e411c74aa 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 a98afe4a3e7..48df4342e4d 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 Interop 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 0d7e99cea7d..8f2caae3583 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 729cedbc1b9..7d3efed00d0 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 1b9f80168cf..78fd2afe6a2 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 5254e3efd5d..e18c4803c04 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 1bf0969de74..60e6527524c 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 0f596aa2997..c4d1866ebc4 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 72f350af3c2..cdd78ab64c2 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 d3ebb4a04a4..7d305566933 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 59705ea4408..180e51fd0ee 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 8a1924e886e..802ffd5665f 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 efc613fbb4e..a54cb03e8b4 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 b0532f17073..8a16532bb0a 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 04f38129aee..d9bbfbf21aa 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 fa52581bf53..5bca617b9b6 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 @@ internal static partial class Interop 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 c26f6693e2c..a1821fa753c 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 3379b063e44..77e1b7cc652 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 e4f98acb30c..ee65f3b0780 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 b92572564b8..b88ace7a85a 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 a06cefa006e..0b2dd9d6cdb 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 b59284751c5..be1e64b3ed2 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 746285fe0bc..4bd3a4a9fcb 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 9d771af4bca..6201d6fb564 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 f545dcf7ba5..72eba5ed6f8 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 5d93d76f263..20b0d9c782e 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 c79f0292000..1966bd9ba85 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 dac7cc82020..33c64a7e7e3 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 c9014269287..e7f05846807 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 d7f9b9d0944..c8cccbdddd0 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 8be9ebe0fdc..e7a43c95ca8 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 567705db9f0..9f4ac61846f 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 3d40348d7fa..45980ec36bb 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 eb6205f5bf9..2ebd535519b 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 8edc9e64e7b..7074ad6cdc0 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop } #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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 @@ internal static partial class Interop 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 45a8251b1d0..55ca77837ab 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 Interop 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 66ca175b049..54dada5368d 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 dc3c9af75f5..3117353163c 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 9b3396350d3..ba4019768dd 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 Interop { 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 85da9dfc980..d0f01df354b 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 Interop 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 18c4007a5ff..ecf8a0e3ca0 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 static partial class Interop 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 ffbd5829d91..b7b6e4e856e 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 Interop /// <param name="hwo">Handle to the waveform-audio output device. If the function /// succeeds, the handle is no longer valid after this call.</param> /// <returns>MMSYSERR</returns> - [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 31a5a78df9e..5a13e91d7bf 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 static partial class Interop /// information about the capabilities of the device.</param> /// <param name="cbwoc">Size, in bytes, of the WAVEOUTCAPS structure.</param> /// <returns>MMSYSERR</returns> -#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 0878bc92ddf..396649ff6c9 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 Interop /// </summary> /// <returns>The number of devices indicates success. Zero indicates that /// no devices are present or that an error occurred.</returns> - [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 1fbb89c8836..41e46950029 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 static partial class Interop /// mechanism.</param> /// <param name="fdwOpen">Flags for opening the device.</param> /// <returns>MMSYSERR</returns> - [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 02b5d5a13d0..092463dba51 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 Interop /// </summary> /// <param name="hwo">Handle to the waveform-audio output device.</param> /// <returns>MMSYSERR</returns> - [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 a8921127996..87cb5528831 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 static partial class Interop /// respect to the sample size.</param> /// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param> /// <returns>MMSYSERR</returns> - [GeneratedDllImport(Libraries.WinMM)] + [LibraryImport(Libraries.WinMM)] internal static partial MMSYSERR waveOutPrepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); /// <summary> @@ -46,7 +46,7 @@ internal static partial class Interop /// to be cleaned up.</param> /// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param> /// <returns>MMSYSERR</returns> - [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 6b98aa846b7..0920075cd08 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 Interop /// </summary> /// <param name="hwo">Handle to the waveform-audio output device.</param> /// <returns>MMSYSERR</returns> - [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 c9282fd393f..438dedac251 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 Interop /// </summary> /// <param name="hwo">Handle to the waveform-audio output device.</param> /// <returns>MMSYSERR</returns> - [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 ff37bc6336e..d6e98515275 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 Interop /// about the data block.</param> /// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param> /// <returns>MMSYSERR</returns> - [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 4fc9f28c55c..a0d6906931f 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 Interop 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 partial class Interop delegate* unmanaged<int, int, NativeOverlapped*, void> 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 70be2c9a38e..a1f93ba5930 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 2a5882ddae5..e98ab74bd31 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 static partial class Interop 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 f3559056b07..d3f4970615e 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 6d827d94e23..77c846af58f 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 1d1254646d5..99adc78d9ca 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 a3903f29c3d..bdd0758cb63 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 daab1205e48..da251349883 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 67757a5ef6f..d7804bc7cbd 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 class Interop 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 1a9f090bd83..90afd2f18bc 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 dc200e6c8fd..7783bb39c6b 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 583674f8f4a..6b10133721f 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 4896eb8557a..997af046eca 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 9ababac9065..fe2974dac45 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 f18f7d214f8..45f8612ce79 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 4031576c64f..c9f4926a595 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 @@ internal static partial class Interop } } - [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 2cdc1bb76dc..2202c0815ff 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 a5f8d3b6645..6d5f0d4840c 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 c646d471a28..bcf82717ae8 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 54b90ef1df8..184a369a5eb 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 fa7b34683d5..67cf50cae11 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 d177ac70cac..8d1d9d0471f 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 f9885d46f63..aa06846f8c4 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 partial class Interop 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 class Interop 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 class Interop 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 f5397238cb6..c838a109fd5 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 a8644720624..cc7940e3029 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 20f0a6801a4..479d412bc3c 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 14daa973159..8c470c30268 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 889bdeea2aa..2762e4e251a 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 partial class Interop 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 4c75af9669f..69dd71fdcee 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 c2dfd4801f7..01e03666404 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 f980e317470..803748e78db 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 class Interop 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 class Interop 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 partial class Interop 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 class Interop 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 class Interop 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 class Interop 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 870a9c33328..4fd9231d647 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 b21852267e1..caef99cb73d 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 ea1f38f2f5c..9d5d8387883 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 c784fe967d8..7ebc9ace89b 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 e6811b1989f..7f1b2f1f7a3 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 f5a521357f8..23d1b34bdef 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/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs b/src/libraries/Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs index 2dfd91adc65..0bacf3efad5 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/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs b/src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs index e3d9021503b..3b2d8d7dd74 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 @@ namespace System.Buffers 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 @@ namespace System.Buffers 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 @@ namespace System.Buffers 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 @@ namespace System.Buffers 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 5524fd8266d..16755d5a352 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 @@ namespace System 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 bd18d0caf76..c51437bae4f 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 @@ namespace System 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 @@ namespace System 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 bcb58507884..371069c18a6 100644 --- a/src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs +++ b/src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs @@ -109,17 +109,17 @@ namespace System } } - [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 3d569d79f5b..11bb615d361 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 faee4c9571c..2eb0534b2d9 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 @@ namespace Microsoft.Win32.RegistryTests 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 @@ namespace Microsoft.Win32.RegistryTests 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 69aa37b6794..3211c14fec0 100644 --- a/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs +++ b/src/libraries/System.Console/tests/CancelKeyPress.Unix.cs @@ -134,10 +134,10 @@ public partial class CancelKeyPressTests } } - [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 32363397a71..7e19d385d06 100644 --- a/src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs +++ b/src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs @@ -67,9 +67,9 @@ public partial class ConsoleEncoding }).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 e92d2cb45a2..147bf165f50 100644 --- a/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs +++ b/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs @@ -35,13 +35,13 @@ namespace System.Data.Common 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 d874526e2d9..d09e45ba010 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 @@ namespace System.Data.Common // 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 202abc1eab4..a9b92a3bca4 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 // 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 // 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 @@ namespace Microsoft.Win32 [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 @@ namespace Microsoft.Win32 [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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 // 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 @@ namespace Microsoft.Win32 // 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 @@ namespace Microsoft.Win32 [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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 #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 @@ namespace Microsoft.Win32 [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 @@ namespace Microsoft.Win32 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 @@ namespace Microsoft.Win32 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 4b25a5d7bc8..65280fe8b70 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 @@ namespace System.DirectoryServices.Interop 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 c7fed2bbc69..6d7a83a3d3b 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory /*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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory /*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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory /*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 @@ namespace System.DirectoryServices.ActiveDirectory 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 bbce2d8bcfc..2b490f41c75 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 @@ namespace System.DirectoryServices.ActiveDirectory 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 a7d651517aa..8fe0c9b9bd7 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 c1e712a72a2..545856dad96 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 Interop 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 class Interop #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 class Interop #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 partial class Interop 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 3d2545ea6ca..4cf179f74a7 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 partial class Interop 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 97dbc841790..0f7647555f8 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 0290a653059..6c1cdf06295 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 class Interop #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 class Interop #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 class Interop #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 715c8cf5634..5d059b69845 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 class Interop #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 class Interop #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 897343555f1..440fdba1a65 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 @@ namespace System.Drawing } // 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 @@ namespace System.Drawing #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 30f5970bfd1..e5a1b81cb28 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 @@ namespace System.Drawing } // 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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathWorldBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -460,7 +460,7 @@ namespace System.Drawing #endif HandleRef pen); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipIsVisiblePathPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -471,7 +471,7 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveImageToStream( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -554,7 +554,7 @@ namespace System.Drawing #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveAdd( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -565,7 +565,7 @@ namespace System.Drawing #endif HandleRef encoderParams); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSaveAddImage( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -580,82 +580,82 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef path); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -707,7 +707,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -722,7 +722,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -737,7 +737,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -752,7 +752,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -767,7 +767,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileDestPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -782,7 +782,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPoint( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -797,7 +797,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPointI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -812,7 +812,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestRect( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -827,7 +827,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestRectI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -842,7 +842,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPoints( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -857,7 +857,7 @@ namespace System.Drawing #endif HandleRef imageattributes); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipEnumerateMetafileSrcRectDestPointsI( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -872,14 +872,14 @@ namespace System.Drawing #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 @@ namespace System.Drawing ); } - [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 8919863d7fa..fcc863646d8 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 @@ namespace System.Drawing 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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipSetLineTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -499,174 +499,174 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPathGradientTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -688,14 +688,14 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing 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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetTextureTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -931,14 +931,14 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetPenTransform( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -1364,14 +1364,14 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionBounds( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2007,7 +2007,7 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif HandleRef matrix); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipGetRegionScans( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2135,10 +2135,10 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #endif BitmapData lockedBitmapData); - [GeneratedDllImport(LibraryName)] + [LibraryImport(LibraryName)] internal static partial int GdipBitmapUnlockBits( #if NET7_0_OR_GREATER [MarshalUsing(typeof(HandleRefMarshaller))] @@ -2650,87 +2650,87 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 @@ namespace System.Drawing #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 0f77c8bdb55..caf7f181c58 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 @@ namespace System.Drawing } } - [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 43effdee1c1..aa78cd03d86 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 @@ namespace System.Drawing } } - [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 0727247b27c..ffd594d014b 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 6052738d20a..463d105735d 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 @@ namespace System.Drawing.Printing 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 @@ namespace System.Drawing.Printing 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 e7f64052d75..df6a19216d0 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 @@ namespace System.Drawing } #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 def9a99cb49..23f667cdbf3 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 @@ namespace System.IO.Compression.Tests 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 9fd5f1d6297..f4d2dd34df4 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 e3f2c95eaad..b70655288f0 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 011e4c188d3..213f21525d0 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 cd0c98c44b5..8764766e46a 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 @@ namespace System.IO.MemoryMappedFiles.Tests 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); /// <summary>Asserts that the handle's inheritability matches the specified value.</summary> diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs index 018f7e19980..d0dd22afb22 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 @@ namespace System.IO.MemoryMappedFiles.Tests 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 c91d0604383..6f75ed908f3 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs @@ -66,7 +66,7 @@ namespace System.IO.MemoryMappedFiles.Tests 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/ILLink/ILLink.LinkAttributes.Shared.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml index efd2492becf..3cf2bcb30e6 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 @@ <!-- Note that removing this attribute can change runtime behavior. For example, System.Xml.Serialization will behave differently if a ctor is Obsolete. - This is low enough risk on when 'System.AggressiveAttributeTrimming' is enabled to justify + This is low enough risk on when 'System.AggressiveAttributeTrimming' is enabled to justify removing the attribute for size savings. The app developer can override this setting to keep all ObsoleteAttributes. --> @@ -265,7 +265,7 @@ <type fullname="System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute"> <attribute internal="RemoveAttributeInstances" /> </type> - <type fullname="System.Runtime.InteropServices.GeneratedDllImportAttribute"> + <type fullname="System.Runtime.InteropServices.LibraryImportAttribute"> <attribute internal="RemoveAttributeInstances" /> </type> <type fullname="System.CodeDom.Compiler.GeneratedCodeAttribute"> 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 f6a1b156c44..7de40043839 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 @@ namespace System.Diagnostics.Tracing 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<char> escape_seq = new List<char> { '\b', '\f', '\n', '\r', '\t', '\"', '\\' }; 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 1470c03a373..5d2d29be347 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 @@ namespace Microsoft.Interop.Analyzers 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 @@ namespace Microsoft.Interop.Analyzers if (dllImportData == null) return; - // Ignore methods already marked GeneratedDllImport + // Ignore methods already marked LibraryImport // This can be the case when the generator creates an extern partial function for blittable signatures. foreach (AttributeData attr in method.GetAttributes()) { - if (attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedDllImportAttribute) + if (attr.AttributeClass?.ToDisplayString() == TypeNames.LibraryImportAttribute) { return; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs index cb21c8d199b..4a15fb9cd17 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs @@ -201,7 +201,7 @@ namespace Microsoft.Interop.Analyzers 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 @@ namespace Microsoft.Interop.Analyzers generator, dllImportSyntax, methodSymbol, - generatedDllImportAttrType, + libraryImportAttrType, entryPointSuffix, out SyntaxNode? unmanagedCallConvAttributeMaybe); @@ -436,7 +436,7 @@ namespace Microsoft.Interop.Analyzers SyntaxGenerator generator, AttributeSyntax dllImportSyntax, IMethodSymbol methodSymbol, - INamedTypeSymbol generatedDllImportAttrType, + INamedTypeSymbol libraryImportAttrType, char? entryPointSuffix, out SyntaxNode? unmanagedCallConvAttributeMaybe) { @@ -448,7 +448,7 @@ namespace Microsoft.Interop.Analyzers // 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 b5c9908ab25..1040ca2e450 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 @@ namespace Microsoft.Interop { 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 @@ namespace Microsoft.Interop }; } - 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 @@ namespace Microsoft.Interop 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 @@ namespace Microsoft.Interop 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 @@ namespace Microsoft.Interop 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 @@ namespace Microsoft.Interop { 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 @@ namespace Microsoft.Interop { 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 5da6deb9cc8..65920dc750d 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 @@ namespace Microsoft.Interop // 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 51bca2e3e37..fcad506c635 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; - - + + /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> @@ -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() { } - + /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> @@ -45,7 +45,7 @@ namespace Microsoft.Interop { return resourceMan; } } - + /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Microsoft.Interop { resourceCulture = value; } } - + /// <summary> /// Looks up a localized string similar to A type marked with 'BlittableTypeAttribute' must be blittable.. /// </summary> @@ -68,7 +68,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("BlittableTypeMustBeBlittableDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' but is not blittable. /// </summary> @@ -77,7 +77,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("BlittableTypeMustBeBlittableMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -86,7 +86,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantDescription", resourceCulture); } } - + /// <summary> /// 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>. /// </summary> @@ -95,7 +95,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -104,7 +104,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture); } } - + /// <summary> /// 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. /// </summary> @@ -113,7 +113,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The generated 'DllImportAttribute' will not have a value corresponding to '{0}'.. /// </summary> @@ -122,7 +122,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CannotForwardToDllImportDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to '{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded. /// </summary> @@ -131,16 +131,16 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CannotForwardToDllImportMessage", resourceCulture); } } - + /// <summary> - /// 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'. /// </summary> internal static string CannotForwardToDllImportTitle { get { return ResourceManager.GetString("CannotForwardToDllImportTitle", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.. /// </summary> @@ -149,7 +149,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -158,7 +158,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -167,7 +167,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// <summary> /// 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>'. /// </summary> @@ -176,7 +176,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Source-generated P/Invokes will ignore any configuration that is not supported.. /// </summary> @@ -185,7 +185,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedDescription", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -194,7 +194,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The specified marshalling configuration is not supported by source-generated P/Invokes. {0}.. /// </summary> @@ -203,7 +203,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedMessageMarshallingInfo", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -212,7 +212,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedMessageParameter", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -221,7 +221,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedMessageReturn", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -230,7 +230,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedMessageValue", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Specified configuration is not supported by source-generated P/Invokes.. /// </summary> @@ -239,7 +239,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConfigurationNotSupportedTitle", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Only one of 'ConstantElementCount' or 'ElementCountInfo' may be used in a 'MarshalUsingAttribute' for a given 'ElementIndirectionLevel'. /// </summary> @@ -248,7 +248,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture); } } - + /// <summary> /// 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. /// </summary> @@ -257,7 +257,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Convert to 'LibraryImport'. /// </summary> @@ -266,7 +266,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertToLibraryImport", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time. /// </summary> @@ -275,7 +275,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertToLibraryImportDescription", resourceCulture); } } - + /// <summary> /// 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. /// </summary> @@ -284,7 +284,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertToLibraryImportMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time. /// </summary> @@ -293,7 +293,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertToLibraryImportTitle", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Conversion to 'LibraryImport' may change behavior and compatibility. See {0} for more information.. /// </summary> @@ -302,7 +302,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertToLibraryImportWarning", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Convert to 'LibraryImport' with '{0}' suffix. /// </summary> @@ -311,7 +311,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConvertToLibraryImportWithSuffix", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -320,7 +320,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -329,7 +329,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The return type of 'GetPinnableReference' (after accounting for 'ref') must be blittable.. /// </summary> @@ -338,7 +338,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The dereferenced type of the return type of the 'GetPinnableReference' method must be blittable. /// </summary> @@ -347,7 +347,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -356,7 +356,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture); } } - + /// <summary> /// 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. /// </summary> @@ -365,7 +365,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture); } } - + /// <summary> /// 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}'.. /// </summary> @@ -374,25 +374,25 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InvalidAttributedMethodContainingTypeMissingModifiersMessage", resourceCulture); } } - + /// <summary> - /// 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.. /// </summary> internal static string InvalidAttributedMethodDescription { get { return ResourceManager.GetString("InvalidAttributedMethodDescription", resourceCulture); } } - + /// <summary> - /// 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}'.. /// </summary> internal static string InvalidAttributedMethodSignatureMessage { get { return ResourceManager.GetString("InvalidAttributedMethodSignatureMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Invalid 'LibraryImportAttribute' usage. /// </summary> @@ -401,7 +401,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InvalidLibraryImportAttributeUsageTitle", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The configuration of 'StringMarshalling' and 'StringMarshallingCustomType' is invalid.. /// </summary> @@ -410,7 +410,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InvalidStringMarshallingConfigurationDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The configuration of 'StringMarshalling' and 'StringMarshallingCustomType' on method '{0}' is invalid. {1}. /// </summary> @@ -419,7 +419,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InvalidStringMarshallingConfigurationMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to 'StringMarshallingCustomType' must be specified when 'StringMarshalling' is set to 'StringMarshalling.Custom'.. /// </summary> @@ -428,7 +428,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InvalidStringMarshallingConfigurationMissingCustomType", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to 'StringMarshalling' should be set to 'StringMarshalling.Custom' when 'StringMarshallingCustomType' is specified.. /// </summary> @@ -437,7 +437,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InvalidStringMarshallingConfigurationNotCustom", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -446,7 +446,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyDescription", resourceCulture); } } - + /// <summary> /// 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. /// </summary> @@ -455,7 +455,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -464,7 +464,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeGenericTypeMustBeClosedDescription", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -473,7 +473,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityDescription", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -482,7 +482,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to A native type for a given type must be blittable.. /// </summary> @@ -491,7 +491,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustBeBlittableDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type '{0}' for the type '{1}' is not blittable. /// </summary> @@ -500,7 +500,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustBeBlittableMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to A native type for a given type must be non-null.. /// </summary> @@ -509,7 +509,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustBeNonNullDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type for the type '{0}' is null. /// </summary> @@ -518,7 +518,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustBeNonNullMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -527,7 +527,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustBePointerSizedDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type '{0}' must be pointer sized because the managed type '{1}' has a 'GetPinnableReference' method. /// </summary> @@ -536,7 +536,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustBePointerSizedMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -545,7 +545,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// <summary> /// 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}'. /// </summary> @@ -554,7 +554,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property must not be a 'ref' or 'readonly ref' property.. /// </summary> @@ -563,7 +563,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must not be a 'ref' or 'readonly ref' property.. /// </summary> @@ -572,7 +572,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to . /// </summary> @@ -581,7 +581,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to An abstract type derived from 'SafeHandle' cannot be marshalled by reference. The provided type must be concrete.. /// </summary> @@ -590,7 +590,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -599,16 +599,16 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TargetFrameworkNotSupportedDescription", resourceCulture); } } - + /// <summary> - /// 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}.. /// </summary> internal static string TargetFrameworkNotSupportedMessage { get { return ResourceManager.GetString("TargetFrameworkNotSupportedMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Current target framework is not supported by source-generated P/Invokes. /// </summary> @@ -617,7 +617,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TargetFrameworkNotSupportedTitle", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -626,7 +626,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedDescription", resourceCulture); } } - + /// <summary> /// 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}'.. /// </summary> @@ -635,7 +635,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedMessageParameter", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to {0} The generated source will not handle marshalling of parameter '{1}'.. /// </summary> @@ -644,7 +644,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedMessageParameterWithDetails", resourceCulture); } } - + /// <summary> /// 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}'.. /// </summary> @@ -653,7 +653,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedMessageReturn", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to {0} The generated source will not handle marshalling of the return value of method '{1}'.. /// </summary> @@ -662,7 +662,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedMessageReturnWithDetails", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes. /// </summary> @@ -671,7 +671,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type's 'Value' property must have a getter to support marshalling from managed to native.. /// </summary> @@ -680,7 +680,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a getter. /// </summary> @@ -689,7 +689,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type's 'Value' property must have a setter to support marshalling from native to managed.. /// </summary> @@ -698,7 +698,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a setter. /// </summary> diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx index fbe7c31b263..1d6467f5daa 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 @@ <?xml version="1.0" encoding="utf-8"?> <root> - <!-- - Microsoft ResX Schema - + <!-- + Microsoft ResX Schema + Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes associated with the data types. - + Example: - + ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> @@ -26,36 +26,36 @@ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> - - There are any number of "resheader" rows that contain simple + + There are any number of "resheader" rows that contain simple name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. - + mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with + value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. - + mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with + value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array + value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> @@ -142,7 +142,7 @@ <value>'{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded</value> </data> <data name="CannotForwardToDllImportTitle" xml:space="preserve"> - <value>Specified 'GeneratedDllImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'</value> + <value>Specified 'LibraryImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'</value> </data> <data name="CannotHaveMultipleMarshallingAttributesDescription" xml:space="preserve"> <value>The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.</value> @@ -224,10 +224,10 @@ <value>Method '{0}' is contained in a type '{1}' that is not marked 'partial'. P/Invoke source generation will ignore method '{0}'.</value> </data> <data name="InvalidAttributedMethodDescription" xml:space="preserve"> - <value>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.</value> + <value>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.</value> </data> <data name="InvalidAttributedMethodSignatureMessage" xml:space="preserve"> - <value>Method '{0}' should be 'static', 'partial', and non-generic when marked with 'GeneratedDllImportAttribute'. P/Invoke source generation will ignore method '{0}'.</value> + <value>Method '{0}' should be 'static', 'partial', and non-generic when marked with 'LibraryImportAttribute'. P/Invoke source generation will ignore method '{0}'.</value> </data> <data name="InvalidLibraryImportAttributeUsageTitle" xml:space="preserve"> <value>Invalid 'LibraryImportAttribute' usage</value> @@ -301,7 +301,7 @@ <comment>{0} is a version number</comment> </data> <data name="TargetFrameworkNotSupportedMessage" xml:space="preserve"> - <value>'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.</value> + <value>'LibraryImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.</value> <comment>{0} is a version number</comment> </data> <data name="TargetFrameworkNotSupportedTitle" xml:space="preserve"> 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 4ff500d62ad..0000772d544 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 @@ namespace Microsoft.Interop 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 d724a69bcbf..90e95ecef5c 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; - - + + /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> @@ -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() { } - + /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> @@ -45,7 +45,7 @@ namespace Microsoft.Interop { return resourceMan; } } - + /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Microsoft.Interop { resourceCulture = value; } } - + /// <summary> /// 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'.. /// </summary> @@ -68,7 +68,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ArraySizeMustBeSpecified", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'SizeParamIndex' value in the 'MarshalAsAttribute' is out of range.. /// </summary> @@ -77,7 +77,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ArraySizeParamIndexOutOfRange", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.. /// </summary> @@ -86,7 +86,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -95,7 +95,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -104,7 +104,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// <summary> /// 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>'. /// </summary> @@ -113,7 +113,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -122,7 +122,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CollectionSizeParamTypeMustBeIntegral", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Only one of 'ConstantElementCount' or 'ElementCountInfo' may be used in a 'MarshalUsingAttribute' for a given 'ElementIndirectionLevel'. /// </summary> @@ -131,7 +131,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -140,7 +140,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -149,7 +149,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to This element cannot depend on '{0}' for collection size information without creating a dependency cycle. /// </summary> @@ -158,7 +158,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("CyclicalCountInfo", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Count information for a given element at a given indirection level can only be specified once. /// </summary> @@ -167,7 +167,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("DuplicateCountInfo", resourceCulture); } } - + /// <summary> /// 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}. /// </summary> @@ -176,7 +176,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("DuplicateMarshallingInfo", resourceCulture); } } - + /// <summary> /// 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. /// </summary> @@ -185,7 +185,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ExtraneousMarshallingInfo", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The provided graph has cycles and cannot be topologically sorted.. /// </summary> @@ -194,7 +194,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("GraphHasCycles", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -203,7 +203,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InAttributeNotSupportedWithoutOut", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -212,7 +212,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InOutAttributeByRefNotSupported", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The provided '[In]' and '[Out]' attributes on this parameter are unsupported on this parameter.. /// </summary> @@ -221,7 +221,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("InOutAttributeMarshalerNotSupported", resourceCulture); } } - + /// <summary> /// Marshalling bool without explicit marshalling information is not supported. Specify either 'MarshalUsingAttribute' or 'MarshalAsAttribute'.. /// </summary> @@ -229,8 +229,8 @@ namespace Microsoft.Interop { get { return ResourceManager.GetString("MarshallingBoolAsUndefinedNotSupported", resourceCulture); } - } - + } + /// <summary> /// 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.. /// </summary> @@ -239,16 +239,16 @@ namespace Microsoft.Interop { return ResourceManager.GetString("MarshallingCharAsSpecifiedCharSetNotSupported", resourceCulture); } } - + /// <summary> - /// 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'.. /// </summary> internal static string MarshallingStringOrCharAsUndefinedNotSupported { get { return ResourceManager.GetString("MarshallingStringOrCharAsUndefinedNotSupported", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -257,7 +257,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -266,7 +266,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture); } } - + /// <summary> /// 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}'. /// </summary> @@ -275,7 +275,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The '[Out]' attribute is only supported on array parameters.. /// </summary> @@ -284,7 +284,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("OutByValueNotSupportedDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The '[Out]' attribute is not supported on the '{0}' parameter.. /// </summary> @@ -293,7 +293,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("OutByValueNotSupportedMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property must not be a 'ref' or 'readonly ref' property.. /// </summary> @@ -302,7 +302,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must not be a 'ref' or 'readonly ref' property.. /// </summary> @@ -311,7 +311,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -320,7 +320,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to An abstract type derived from 'SafeHandle' cannot be marshalled by reference. The provided type must be concrete.. /// </summary> @@ -329,7 +329,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes. /// </summary> @@ -338,7 +338,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture); } } - + /// <summary> /// 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.. /// </summary> @@ -347,7 +347,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMarshallingRequiresAdditionalState", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type's 'Value' property must have a getter to support marshalling from managed to native.. /// </summary> @@ -356,7 +356,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a getter. /// </summary> @@ -365,7 +365,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The native type's 'Value' property must have a setter to support marshalling from native to managed.. /// </summary> @@ -374,7 +374,7 @@ namespace Microsoft.Interop { return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture); } } - + /// <summary> /// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a setter. /// </summary> 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 f1b937f641b..abac39ff660 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 @@ <?xml version="1.0" encoding="utf-8"?> <root> - <!-- - Microsoft ResX Schema - + <!-- + Microsoft ResX Schema + Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes associated with the data types. - + Example: - + ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> @@ -26,36 +26,36 @@ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> - - There are any number of "resheader" rows that contain simple + + There are any number of "resheader" rows that contain simple name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. - + mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with + value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. - + mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with + value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array + value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> @@ -157,7 +157,7 @@ <value>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.</value> </data> <data name="MarshallingStringOrCharAsUndefinedNotSupported" xml:space="preserve"> - <value>Marshalling string or char without explicit marshalling information is not supported. Specify either 'GeneratedDllImportAttribute.CharSet' or 'MarshalAsAttribute'.</value> + <value>Marshalling string or char without explicit marshalling information is not supported. Specify either 'LibraryImportAttribute.CharSet' or 'MarshalAsAttribute'.</value> </data> <data name="OutByValueNotSupportedDescription" xml:space="preserve"> <value>The '[Out]' attribute is only supported on array parameters.</value> 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 6cffa1f9dae..1a812d49696 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 054016b29c9..60e536023fb 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 @@ </PropertyGroup> <ItemGroup> - <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs" Link="GeneratedDllImportAttribute.cs" /> + <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs" Link="LibraryImportAttribute.cs" /> <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs" Link="GeneratedMarshallingAttribute.cs" /> <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs" Link="ArrayMarshaller.cs" /> <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/StringMarshalling.cs" Link="StringMarshalling.cs" /> 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 5e24cae338c..8fd114021a4 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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 1375901563e..f02379ddcab 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 3b66fc69b8a..2f820824719 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 d58e6cc34ce..1452fef1656 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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 f55902edba9..48dcdd175f5 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 d33fad2b499..f8676d68e26 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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<int>))] List<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([MarshalUsing(typeof(ListMarshaller<int>))] in List<int> 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<int>), CountElementName = "numValues")] ref List<int> values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] [return:MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")] public static partial List<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, [MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")] out List<int> res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] public static partial int SumStringLengths([MarshalUsing(typeof(ListMarshaller<string>)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")] public static partial void ReverseStrings_Ref([MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] ref List<string> strArray, out int numElements); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")] [return: MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] public static partial List<string> ReverseStrings_Return([MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<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( [MarshalUsing(typeof(ListMarshaller<string>)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray, out int numElements, [MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] out List<string> res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] [return:MarshalUsing(typeof(ListMarshaller<byte>), ConstantElementCount = sizeof(long))] public static partial List<byte> 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<BoolStruct>))] List<BoolStruct> 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 0477c6b08ac..f563b6ff5dd 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 b7db86694f1..639c607b378 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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 c5d06dd5ccf..14585b2ac61 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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 ce270b6e9cb..fde6b235ed4 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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* <void> 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<void> 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]<void> 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* <int, int, int> 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<int, int, int> 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]<int, int, int> 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 dd3cef0cea9..f1b68d8a17b 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 2e5b9af199c..1ae443c457e 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 @@ namespace LibraryImportGenerator.IntegrationTests 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 02db0381f7f..057bef953c7 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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 fc30ca2fea7..3b0a91cf26c 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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<int>))] Span<int> 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<int>))] Span<int> 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<int>))] ReadOnlySpan<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(SpanMarshaller<int>))] in Span<int> 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<int>), CountElementName = "numValues")] ref Span<int> 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<int>), CountElementName = "numValues")] ref Span<int> values, int numValues); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")] [return: MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")] public static partial Span<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, [MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")] out Span<int> res); - [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")] [return: MarshalUsing(typeof(SpanMarshaller<byte>), ConstantElementCount = sizeof(long))] public static partial Span<byte> 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<BoolStruct>))] Span<BoolStruct> 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 29d0922ff50..73ac84acdfa 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 @@ namespace LibraryImportGenerator.IntegrationTests 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 @@ namespace LibraryImportGenerator.IntegrationTests { 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 7894fbe70f7..748e160f35e 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 @@ using System.Runtime.InteropServices; [assembly:DisableRuntimeMarshalling] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -52,7 +52,7 @@ struct Native 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 @@ using System.Runtime.InteropServices; [assembly:DisableRuntimeMarshalling] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -103,7 +103,7 @@ struct Native 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 @@ partial class C { 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 @@ using System.Runtime.CompilerServices; [module:SkipLocalsInit] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -195,7 +195,7 @@ using System.Runtime.CompilerServices; [SkipLocalsInit] partial class C { - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method(); } @@ -227,7 +227,7 @@ using System.Runtime.CompilerServices; 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 7a7c59a178a..3e24015cfe3 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 @@ using System.Runtime.InteropServices; partial class C {{ [{attributeSourceName}] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); }} @@ -70,7 +70,7 @@ using System.Runtime.InteropServices; partial class C { [UnmanagedCallConv(CallConvs = new Type[0])] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -113,7 +113,7 @@ using System.Runtime.InteropServices; partial class C { [UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall)})] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -160,7 +160,7 @@ using System.Runtime.InteropServices; partial class C { [UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall), typeof(CallConvSuppressGCTransition)})] - [GeneratedDllImportAttribute(""DoesNotExist"")] + [LibraryImportAttribute(""DoesNotExist"")] public static partial S Method1(); } @@ -211,7 +211,7 @@ using System.Runtime.InteropServices; 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 @@ using System.Runtime.CompilerServices; 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 @@ using System.Runtime.CompilerServices; 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 @@ using System.Runtime.CompilerServices; 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 a1be0baa469..93b822d6f7b 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs @@ -8,9 +8,9 @@ namespace LibraryImportGenerator.UnitTests internal static class CodeSnippets { /// <summary> - /// Partially define attribute for pre-.NET 6.0 + /// Partially define attribute for pre-.NET 7.0 /// </summary> - public static readonly string GeneratedDllImportAttributeDeclaration = @" + public static readonly string LibraryImportAttributeDeclaration = @" namespace System.Runtime.InteropServices { internal enum StringMarshalling @@ -20,9 +20,9 @@ namespace System.Runtime.InteropServices 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 @@ namespace System.Runtime.InteropServices "; /// <summary> - /// Trivial declaration of GeneratedDllImport usage + /// Trivial declaration of LibraryImport usage /// </summary> 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(); } "; /// <summary> - /// Trivial declaration of GeneratedDllImport usage + /// Trivial declaration of LibraryImport usage /// </summary> 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 @@ sealed class Dummy2Attribute : Attribute partial class Test { [DummyAttribute] - [GeneratedDllImport(""DoesNotExist""), Dummy2Attribute(""string value"")] + [LibraryImport(""DoesNotExist""), Dummy2Attribute(""string value"")] public static partial void Method(); } "; @@ -106,7 +106,7 @@ namespace NS { 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 @@ namespace NS { partial class InnerClass { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -140,7 +140,7 @@ namespace NS { partial struct InnerStruct { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -148,7 +148,7 @@ namespace NS { partial struct InnerStruct { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -156,7 +156,7 @@ namespace NS { partial class InnerClass { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } } @@ -170,12 +170,12 @@ namespace NS 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(); } "; /// <summary> - /// Declaration with all GeneratedDllImport named arguments. + /// Declaration with all LibraryImport named arguments. /// </summary> - 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 @@ using System.Runtime.InteropServices; partial class Test { [LCIDConversion(0)] - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); } "; @@ -296,11 +296,11 @@ namespace NS 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 @@ using System.Runtime.InteropServices; 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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -413,7 +413,7 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -428,7 +428,7 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static unsafe partial {typeName} Method( {typeName} p, in {typeName} pIn, @@ -446,7 +446,7 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [{attributeName}] {typeName} p); }}"; @@ -460,7 +460,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void {methodName}( int {paramName}); }}"; @@ -472,7 +472,7 @@ partial class Test 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 @@ partial class Test 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 @@ namespace NS partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial MyEnum Method( MyEnum p, in MyEnum pIn, @@ -535,7 +535,7 @@ partial class Test 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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ unsafe ref struct Native partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( S s, in S sIn); @@ -889,7 +889,7 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( {byRefKind} {typeName} p); }}"; @@ -899,7 +899,7 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( {typeName} p); }}"; @@ -909,7 +909,7 @@ using System.Runtime.InteropServices; {preDeclaration} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial {typeName} Method(); }}"; @@ -1019,7 +1019,7 @@ class MySafeHandle : SafeHandle 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 @@ using System.Runtime.InteropServices; partial class Test {{ #if {define} - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial int Method( int p, in int pIn, @@ -1048,7 +1048,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] #if {define} public static partial int Method( int p, @@ -1067,7 +1067,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] #if {define} public static partial int Method( int p, @@ -1133,7 +1133,7 @@ using System.Runtime.InteropServices; {DisableRuntimeMarshalling} partial class Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] [return:MarshalUsing(ConstantElementCount=10)] public static partial {collectionType} Method( {collectionType} p, @@ -1174,7 +1174,7 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; {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 @@ using System.Runtime.InteropServices; [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<int> Method( @@ -1288,7 +1288,7 @@ using System.Runtime.InteropServices; [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<int> p); } @@ -1306,7 +1306,7 @@ using System.Runtime.InteropServices; [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling] partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method( [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 2)] TestCollection<int> p); } @@ -1324,7 +1324,7 @@ using System.Runtime.InteropServices; [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 @@ using System.Runtime.InteropServices; [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 @@ using System.Runtime.InteropServices; [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 @@ using System.Runtime.InteropServices; [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 @@ using System.Runtime.InteropServices; [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 @@ using System.Runtime.InteropServices; [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 @@ partial class Test 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 @@ using System.Runtime.InteropServices; partial struct Basic { - [GeneratedDllImport(""DoesNotExist"", SetLa)] + [LibraryImport(""DoesNotExist"", SetLa)] public static partial void Method(); } "; @@ -1480,7 +1480,7 @@ using System.Runtime.InteropServices; partial struct Basic { - [GeneratedDllImport(DoesNotExist)] + [LibraryImport(DoesNotExist)] public static partial void Method(); } "; @@ -1489,7 +1489,7 @@ using System.Runtime.InteropServices; 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 686e4787b01..eb10a5217c9 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 @@ namespace LibraryImportGenerator.UnitTests { public static IEnumerable<object[]> 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 0ce0de3f02a..9ee978e9817 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 @@ namespace LibraryImportGenerator.UnitTests 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 @@ namespace LibraryImportGenerator.UnitTests // Confirm that all unsupported target frameworks can be generated. { - string code = CodeSnippets.BasicParametersAndModifiers<byte>(CodeSnippets.GeneratedDllImportAttributeDeclaration); + string code = CodeSnippets.BasicParametersAndModifiers<byte>(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 @@ namespace LibraryImportGenerator.UnitTests // Confirm that all unsupported target frameworks fallback to a forwarder. { - string code = CodeSnippets.BasicParametersAndModifiers<byte[]>(CodeSnippets.GeneratedDllImportAttributeDeclaration); + string code = CodeSnippets.BasicParametersAndModifiers<byte[]>(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 @@ namespace LibraryImportGenerator.UnitTests // Confirm that all unsupported target frameworks fallback to a forwarder. { - string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling<string>(StringMarshalling.Utf16, CodeSnippets.GeneratedDllImportAttributeDeclaration); + string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling<string>(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 @@ namespace LibraryImportGenerator.UnitTests public static IEnumerable<object[]> SnippetsWithBlittableTypesButNonBlittableDataToCompile() { - yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments }; + yield return new[] { CodeSnippets.AllLibraryImportNamedArguments }; yield return new[] { CodeSnippets.BasicParametersAndModifiers<int>() }; yield return new[] { CodeSnippets.SetLastErrorTrue<int>() }; } 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 23c9db0c867..fca4e291241 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 8398378555f..da4793e8594 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 @@ using System.Runtime.InteropServices; 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 @@ using System.Runtime.InteropServices; 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 @@ using System.Runtime.InteropServices; 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 @@ partial class Test 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() @@ -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); } }"; @@ -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 56ad8895a66..1c7a492b775 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 @@ namespace LibraryImportGenerator.UnitTests { 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 @@ namespace NS } 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<int> list); } "; @@ -117,10 +117,10 @@ namespace NS } partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial NS.MyClass Method1(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial List<int> Method2(); } "; @@ -150,7 +150,7 @@ partial class Test using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(char c, string s); } "; @@ -178,10 +178,10 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test { (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 @@ using System.Runtime.InteropServices; {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 @@ partial class Test 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 @@ partial class Test 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 @@ partial class Test using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public partial void Method(); } "; @@ -492,10 +492,10 @@ partial class Test using System.Runtime.InteropServices; partial class Test { - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method1<T>(); - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method2<T, U>(); } "; @@ -528,7 +528,7 @@ partial class Test using System.Runtime.InteropServices; {typeKind} Test {{ - [GeneratedDllImport(""DoesNotExist"")] + [LibraryImport(""DoesNotExist"")] public static partial void Method(); }} "; @@ -563,7 +563,7 @@ using System.Runtime.InteropServices; {{ 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 a5a70734dee..688b24beb3d 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 @@ namespace LibraryImportGenerator.UnitTests } [ConditionalFact] - public async Task AddingFileWithNewGeneratedDllImport_DoesNotRegenerateOriginalMethod() + public async Task AddingFileWithNewLibraryImport_DoesNotRegenerateOriginalMethod() { string source = CodeSnippets.BasicParametersAndModifiers<int>(); @@ -106,7 +106,7 @@ namespace LibraryImportGenerator.UnitTests } [ConditionalFact] - public async Task ReplacingFileWithNewGeneratedDllImport_DoesNotRegenerateStubsInOtherFiles() + public async Task ReplacingFileWithNewLibraryImport_DoesNotRegenerateStubsInOtherFiles() { Compilation comp1 = await TestUtils.CreateCompilation(new string[] { CodeSnippets.BasicParametersAndModifiers<int>(), CodeSnippets.BasicParametersAndModifiers<bool>() }); 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 1864d2ed66f..cabfb327be4 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 @@ namespace LibraryImportGenerator.UnitTests var allowedDiagnostics = new HashSet<string>() { "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 @@ namespace LibraryImportGenerator.UnitTests { // 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); } |