diff --git a/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs b/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs
index b0d312ff824f49..db2675f73a58d1 100644
--- a/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs
+++ b/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs
@@ -140,16 +140,16 @@ internal static partial void FSEventStreamScheduleWithRunLoop(
/// Stops receiving events on the specified stream. The stream can be restarted and not miss any events.
///
/// The stream to stop receiving events on.
- [DllImport(Interop.Libraries.CoreServicesLibrary)]
- internal static extern void FSEventStreamStop(IntPtr streamRef);
+ [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ internal static partial void FSEventStreamStop(IntPtr streamRef);
///
/// Invalidates an EventStream and removes it from any RunLoops.
///
/// The FSEventStream to invalidate
/// This can only be called after FSEventStreamScheduleWithRunLoop has be called
- [DllImport(Interop.Libraries.CoreServicesLibrary)]
- internal static extern void FSEventStreamInvalidate(IntPtr streamRef);
+ [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ internal static partial void FSEventStreamInvalidate(IntPtr streamRef);
///
/// Removes the event stream from the RunLoop.
@@ -167,7 +167,7 @@ internal static partial void FSEventStreamUnscheduleFromRunLoop(
/// Releases a reference count on the specified EventStream and, if necessary, cleans the stream up.
///
/// The stream on which to decrement the reference count.
- [DllImport(Interop.Libraries.CoreServicesLibrary)]
- internal static extern void FSEventStreamRelease(IntPtr streamRef);
+ [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ internal static partial void FSEventStreamRelease(IntPtr streamRef);
}
}
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 8898f400ada6b9..ebe9e3af8d2eb8 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
@@ -34,8 +34,8 @@ private static partial int AppleCryptoNative_SecKeychainCreate(
byte[] utf8Passphrase,
out SafeKeychainHandle keychain);
- [DllImport(Libraries.AppleCryptoNative)]
- private static extern int AppleCryptoNative_SecKeychainDelete(IntPtr keychain);
+ [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ private static partial int AppleCryptoNative_SecKeychainDelete(IntPtr keychain);
[GeneratedDllImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainCopyDefault(out SafeKeychainHandle keychain);
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 6361f87fc0ee4f..c44493fa28630c 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
@@ -19,9 +19,9 @@ internal static partial class Fcntl
[GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)]
internal static partial int SetPipeSz(SafePipeHandle fd, int size);
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
[SuppressGCTransition]
- private static extern int FcntlCanGetSetPipeSz();
+ private static partial int FcntlCanGetSetPipeSz();
}
}
}
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 03565b1dd17472..c751528354b767 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
@@ -11,10 +11,10 @@ internal static partial class Sys
[GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)]
internal static unsafe partial int ReadStdin(byte* buffer, int bufferSize);
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")]
- internal static extern void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0);
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")]
+ internal static partial void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0);
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")]
- internal static extern void UninitializeConsoleAfterRead();
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")]
+ internal static partial void UninitializeConsoleAfterRead();
}
}
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 6a40f17c6deade..2a52122fc51b1e 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
{
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")]
- internal static extern int SetEUid(uint euid);
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")]
+ internal static partial int SetEUid(uint euid);
}
}
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 51603d6d1e4a45..8a504d7a0b8f5d 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
{
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
[SuppressGCTransition]
- internal static extern int GetSignalForBreak();
+ internal static partial int GetSignalForBreak();
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
- internal static extern int SetSignalForBreak(int signalForBreak);
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
+ internal static partial int SetSignalForBreak(int signalForBreak);
}
}
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 3082cb96b71834..7661463b7b9cf8 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
{
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
- internal static extern unsafe void SetTerminalInvalidationHandler(delegate* unmanaged handler);
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
+ internal static unsafe partial void SetTerminalInvalidationHandler(delegate* unmanaged handler);
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs
index e51680db75089f..3b2246fbe96992 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs
@@ -11,7 +11,7 @@ internal static partial class Sys
///
/// Forces a write of all modified I/O buffers to their storage mediums.
///
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")]
- internal static extern void Sync();
+ [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")]
+ internal static partial void Sync();
}
}
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 c052f5a4c5fe55..86ec6c33191e00 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,8 +12,8 @@ internal static partial class Interop
{
internal static partial class Crypto
{
- [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")]
- internal static extern void OcspRequestDestroy(IntPtr ocspReq);
+ [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")]
+ internal static partial void OcspRequestDestroy(IntPtr ocspReq);
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")]
internal static partial int GetOcspRequestDerSize(SafeOcspRequestHandle req);
@@ -31,8 +31,8 @@ ref MemoryMarshal.GetReference(buf),
buf.Length);
}
- [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")]
- internal static extern void OcspResponseDestroy(IntPtr ocspReq);
+ [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")]
+ internal static partial void OcspResponseDestroy(IntPtr ocspReq);
[GeneratedDllImport(Libraries.CryptoNative, CharSet = CharSet.Ansi)]
private static partial int CryptoNative_X509ChainGetCachedOcspStatus(
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 657e7cbcda4b9e..a1d5568e42edf5 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
@@ -24,8 +24,8 @@ internal static SafePkcs7Handle DecodePkcs7(ReadOnlySpan buf) =>
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")]
internal static partial SafePkcs7Handle Pkcs7CreateCertificateCollection(SafeX509StackHandle certs);
- [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")]
- internal static extern void Pkcs7Destroy(IntPtr p7);
+ [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")]
+ internal static partial void Pkcs7Destroy(IntPtr p7);
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")]
private static partial int GetPkcs7Certificates(SafePkcs7Handle p7, out SafeSharedX509StackHandle certs);