diff options
author | Stephen Toub <stoub@microsoft.com> | 2016-12-09 18:21:32 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2016-12-09 18:27:50 +0300 |
commit | 9c06da6a34fcefa6fb37776ac57b80730e37387c (patch) | |
tree | 8a6db8ac1190ba1d80668847f329c0c3bbd5c0a6 | |
parent | e0ea439770509b0702f2db589cbb5dc8a06ee1f4 (diff) |
More ordering consistency
- "static unsafe" instead of "unsafe static"
- "extern unsafe" instead of "unsafe extern"
- "protected internal" instead of "internal protected"
180 files changed, 448 insertions, 448 deletions
diff --git a/src/Common/src/Interop/OSX/Interop.CommonCrypto.cs b/src/Common/src/Interop/OSX/Interop.CommonCrypto.cs index 74f6cc5628..7f4111d613 100644 --- a/src/Common/src/Interop/OSX/Interop.CommonCrypto.cs +++ b/src/Common/src/Interop/OSX/Interop.CommonCrypto.cs @@ -13,6 +13,6 @@ internal static partial class Interop internal static partial class CommonCrypto { [DllImport(Libraries.LibSystemCommonCrypto)] - internal static unsafe extern int CCRandomGenerateBytes(byte* bytes, int byteCount); + internal static extern unsafe int CCRandomGenerateBytes(byte* bytes, int byteCount); } }
\ No newline at end of file diff --git a/src/Common/src/Interop/OSX/Interop.SystemConfiguration.cs b/src/Common/src/Interop/OSX/Interop.SystemConfiguration.cs index a25caa0f68..7fc727c441 100644 --- a/src/Common/src/Interop/OSX/Interop.SystemConfiguration.cs +++ b/src/Common/src/Interop/OSX/Interop.SystemConfiguration.cs @@ -41,7 +41,7 @@ internal static partial class Interop /// <param name="context">The context associated with the callout.</param> /// <returns>A reference to the new dynamic store session.</returns> [DllImport(Libraries.SystemConfigurationLibrary)] - private static unsafe extern SafeCreateHandle SCDynamicStoreCreate( + private static extern unsafe SafeCreateHandle SCDynamicStoreCreate( IntPtr allocator, CFStringRef name, SCDynamicStoreCallBack callout, diff --git a/src/Common/src/Interop/OSX/Interop.libproc.cs b/src/Common/src/Interop/OSX/Interop.libproc.cs index c3af54e07f..eefed75860 100644 --- a/src/Common/src/Interop/OSX/Interop.libproc.cs +++ b/src/Common/src/Interop/OSX/Interop.libproc.cs @@ -171,7 +171,7 @@ internal static partial class Interop /// <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> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_listallpids( + private static extern unsafe int proc_listallpids( int* pBuffer, int buffersize); @@ -230,7 +230,7 @@ internal static partial class Interop /// to not having enough permissions to query for the data of that specific process /// </returns> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_pidinfo( + private static extern unsafe int proc_pidinfo( int pid, int flavor, ulong arg, @@ -251,7 +251,7 @@ internal static partial class Interop /// to not having enough permissions to query for the data of that specific process /// </returns> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_pidinfo( + private static extern unsafe int proc_pidinfo( int pid, int flavor, ulong arg, @@ -272,7 +272,7 @@ internal static partial class Interop /// to not having enough permissions to query for the data of that specific process /// </returns> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_pidinfo( + private static extern unsafe int proc_pidinfo( int pid, int flavor, ulong arg, @@ -293,7 +293,7 @@ internal static partial class Interop /// to not having enough permissions to query for the data of that specific process /// </returns> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_pidinfo( + private static extern unsafe int proc_pidinfo( int pid, int flavor, ulong arg, @@ -414,7 +414,7 @@ internal static partial class Interop /// <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> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_pidpath( + private static extern unsafe int proc_pidpath( int pid, byte* buffer, uint bufferSize); @@ -457,7 +457,7 @@ internal static partial class Interop /// void* and not a strong type even though it returns a rusage_info struct /// </remarks> [DllImport(Interop.Libraries.libproc, SetLastError = true)] - private static unsafe extern int proc_pid_rusage( + private static extern unsafe int proc_pid_rusage( int pid, int flavor, rusage_info_v3* rusage_info_t); diff --git a/src/Common/src/Interop/OSX/System.Native/Interop.ProtocolStatistics.cs b/src/Common/src/Interop/OSX/System.Native/Interop.ProtocolStatistics.cs index a1a9f6e03c..b1b9b6d873 100644 --- a/src/Common/src/Interop/OSX/System.Native/Interop.ProtocolStatistics.cs +++ b/src/Common/src/Interop/OSX/System.Native/Interop.ProtocolStatistics.cs @@ -24,7 +24,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")] - public static unsafe extern int GetTcpGlobalStatistics(out TcpGlobalStatistics statistics); + public static extern unsafe int GetTcpGlobalStatistics(out TcpGlobalStatistics statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public unsafe struct IPv4GlobalStatistics @@ -46,7 +46,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")] - public static unsafe extern int GetIPv4GlobalStatistics(out IPv4GlobalStatistics statistics); + public static extern unsafe int GetIPv4GlobalStatistics(out IPv4GlobalStatistics statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public unsafe struct UdpGlobalStatistics @@ -59,7 +59,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")] - public static unsafe extern int GetUdpGlobalStatistics(out UdpGlobalStatistics statistics); + public static extern unsafe int GetUdpGlobalStatistics(out UdpGlobalStatistics statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public unsafe struct Icmpv4GlobalStatistics @@ -89,7 +89,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")] - public static unsafe extern int GetIcmpv4GlobalStatistics(out Icmpv4GlobalStatistics statistics); + public static extern unsafe int GetIcmpv4GlobalStatistics(out Icmpv4GlobalStatistics statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public unsafe struct Icmpv6GlobalStatistics @@ -125,7 +125,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")] - public static unsafe extern int GetIcmpv6GlobalStatistics(out Icmpv6GlobalStatistics statistics); + public static extern unsafe int GetIcmpv6GlobalStatistics(out Icmpv6GlobalStatistics statistics); public struct NativeIPInterfaceStatistics { @@ -145,7 +145,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics")] - public static unsafe extern int GetNativeIPInterfaceStatistics(string name, out NativeIPInterfaceStatistics stats); + public static extern unsafe int GetNativeIPInterfaceStatistics(string name, out NativeIPInterfaceStatistics stats); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")] public static extern int GetNumRoutes(); diff --git a/src/Common/src/Interop/OSX/System.Native/Interop.TcpConnectionInfo.cs b/src/Common/src/Interop/OSX/System.Native/Interop.TcpConnectionInfo.cs index 6738f694cf..5312c6a98f 100644 --- a/src/Common/src/Interop/OSX/System.Native/Interop.TcpConnectionInfo.cs +++ b/src/Common/src/Interop/OSX/System.Native/Interop.TcpConnectionInfo.cs @@ -27,15 +27,15 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")] - public unsafe static extern int GetEstimatedTcpConnectionCount(); + public static extern unsafe int GetEstimatedTcpConnectionCount(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")] - public unsafe static extern int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount); + public static extern unsafe int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")] - public unsafe static extern int GetEstimatedUdpListenerCount(); + public static extern unsafe int GetEstimatedUdpListenerCount(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")] - public unsafe static extern int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount); + public static extern unsafe int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount); } } diff --git a/src/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs b/src/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs index 3a2ae9136e..68b9501fcc 100644 --- a/src/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs +++ b/src/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs @@ -30,6 +30,6 @@ internal static partial class Interop } [DllImport(Libraries.AppleCryptoNative)] - private static unsafe extern int AppleCryptoNative_GetRandomBytes(byte* buf, int num, out int errorCode); + private static extern unsafe int AppleCryptoNative_GetRandomBytes(byte* buf, int num, out int errorCode); } } diff --git a/src/Common/src/Interop/Unix/Interop.Errors.cs b/src/Common/src/Interop/Unix/Interop.Errors.cs index 4248434db3..e8aef9903f 100644 --- a/src/Common/src/Interop/Unix/Interop.Errors.cs +++ b/src/Common/src/Interop/Unix/Interop.Errors.cs @@ -186,7 +186,7 @@ internal static partial class Interop internal static extern int ConvertErrorPalToPlatform(Error error); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] - private static unsafe extern byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); + private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); } } diff --git a/src/Common/src/Interop/Unix/System.Globalization.Native/Interop.Idna.cs b/src/Common/src/Interop/Unix/System.Globalization.Native/Interop.Idna.cs index 02f64aa0f8..0331c2a9f1 100644 --- a/src/Common/src/Interop/Unix/System.Globalization.Native/Interop.Idna.cs +++ b/src/Common/src/Interop/Unix/System.Globalization.Native/Interop.Idna.cs @@ -13,9 +13,9 @@ internal static partial class Interop internal const int UseStd3AsciiRules = 0x2; [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToAscii")] - internal static unsafe extern int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + internal static extern unsafe int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToUnicode")] - internal static unsafe extern int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + internal static extern unsafe int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs b/src/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs index 724e342342..b4ee81fe09 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)] - private static unsafe extern byte* GetCwd(byte* buffer, int bufferLength); + private static extern unsafe byte* GetCwd(byte* buffer, int bufferLength); internal static unsafe string GetCwd() { diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs b/src/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs index 25faaa38b8..65737caa3f 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs @@ -11,6 +11,6 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron", SetLastError = true)] - internal static unsafe extern byte** GetEnviron(); + internal static extern unsafe byte** GetEnviron(); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs b/src/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs index fd610141d2..3858b495a1 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs @@ -11,7 +11,7 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)] - private unsafe static extern int GetHostName(byte* name, int nameLength); + private static extern unsafe int GetHostName(byte* name, int nameLength); internal static unsafe string GetHostName() { diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs b/src/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs index 275abffa3a..a3b672c44f 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs @@ -17,7 +17,7 @@ internal static partial class Interop } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")] - internal static unsafe extern int GetNameInfo( + internal static extern unsafe int GetNameInfo( byte* address, uint addressLength, bool isIpv6, diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs b/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs index cdefe3c490..9ebb48ec39 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs @@ -10,6 +10,6 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)] - internal unsafe static extern int GetPeerID(SafeHandle socket, out uint euid); + internal static extern unsafe int GetPeerID(SafeHandle socket, out uint euid); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs b/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs index 450b1e11b4..8effc8883e 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs @@ -11,6 +11,6 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", SetLastError = true)] - internal unsafe static extern string GetPeerUserName(SafeHandle socket); + internal static extern unsafe string GetPeerUserName(SafeHandle socket); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.IPAddress.cs b/src/Common/src/Interop/Unix/System.Native/Interop.IPAddress.cs index 2660d8b090..31875417b9 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.IPAddress.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.IPAddress.cs @@ -82,9 +82,9 @@ internal static partial class Interop internal static extern int IPv4StringToAddress(string address, byte[] buffer, int bufferLength, out ushort port); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_IPAddressToString")] - internal unsafe static extern int IPAddressToString(byte* address, int addressLength, bool isIPv6, byte* str, int stringLength, uint scope = 0); + internal static extern unsafe int IPAddressToString(byte* address, int addressLength, bool isIPv6, byte* str, int stringLength, uint scope = 0); - internal unsafe static uint IPAddressToString(byte[] address, bool isIPv6, StringBuilder addressString, uint scope = 0) + internal static unsafe uint IPAddressToString(byte[] address, bool isIPv6, StringBuilder addressString, uint scope = 0) { Debug.Assert(address != null, "address was null"); Debug.Assert((address.Length == IPv4AddressBytes) || (address.Length == IPv6AddressBytes), $"Unexpected address length: {address.Length}"); diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs b/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs index 3a0a829a89..f2da069017 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs @@ -80,7 +80,7 @@ internal static partial class Interop internal static extern int GetSpaceInfoForMountPoint([MarshalAs(UnmanagedType.LPStr)]string name, out MountPointInformation mpi); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)] - private unsafe static extern int GetFormatInfoForMountPoint( + private static extern unsafe int GetFormatInfoForMountPoint( [MarshalAs(UnmanagedType.LPStr)]string name, byte* formatNameBuffer, int bufferLength, diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.Poll.cs b/src/Common/src/Interop/Unix/System.Native/Interop.Poll.cs index ee926b83be..255cd55291 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.Poll.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.Poll.cs @@ -38,7 +38,7 @@ internal static partial class Interop /// <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> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")] - internal static unsafe extern Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); + internal static extern unsafe Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); /// <summary> /// Polls a File Descriptor for the passed in flags. diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs b/src/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs index f1c6616f37..f41f6eefab 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs @@ -20,6 +20,6 @@ internal static partial class Interop /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] - internal static unsafe extern int Read(SafePipeHandle fd, byte* buffer, int count); + internal static extern unsafe int Read(SafePipeHandle fd, byte* buffer, int count); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.Read.cs b/src/Common/src/Interop/Unix/System.Native/Interop.Read.cs index 812ae348dc..1be5e789c2 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.Read.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.Read.cs @@ -20,6 +20,6 @@ internal static partial class Interop /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] - internal static unsafe extern int Read(SafeFileHandle fd, byte* buffer, int count); + internal static extern unsafe int Read(SafeFileHandle fd, byte* buffer, int count); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs b/src/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs index d43b6b76bd..bcd29bc2da 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs @@ -46,7 +46,7 @@ internal static partial class Interop internal static extern int GetDirentSize(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR", SetLastError = false)] - private static unsafe extern int ReadDirR(SafeDirectoryHandle dir, byte* buffer, int bufferSize, out InternalDirectoryEntry outputEntry); + private static extern unsafe int ReadDirR(SafeDirectoryHandle dir, byte* buffer, int bufferSize, out InternalDirectoryEntry outputEntry); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)] internal static extern int CloseDir(IntPtr dir); diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs b/src/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs index 31547269ae..a39650fd83 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs @@ -19,6 +19,6 @@ internal static partial class Interop /// Returns the number of bytes placed into the buffer on success; otherwise, -1 is returned /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)] - internal static unsafe extern int ReadLink(string path, byte[] buffer, int bufferSize); + internal static extern unsafe int ReadLink(string path, byte[] buffer, int bufferSize); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs b/src/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs index 5aefc4fd52..1b3b0ac7ea 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs @@ -10,12 +10,12 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)] - internal unsafe static extern int ReadStdin(byte* buffer, int bufferSize); + internal static extern unsafe int ReadStdin(byte* buffer, int bufferSize); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")] - internal unsafe static extern void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0); + internal static extern unsafe void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")] - internal unsafe static extern void UninitializeConsoleAfterRead(); + internal static extern unsafe void UninitializeConsoleAfterRead(); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs b/src/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs index bc265ebf8b..61fa8d60a0 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs @@ -28,7 +28,7 @@ internal static partial class Interop /// On failure, returns a negative value. /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", SetLastError = true)] - internal static unsafe extern int SNPrintF(byte* str, int size, string format, string arg1); + internal static extern unsafe int SNPrintF(byte* str, int size, string format, string arg1); /// <summary> /// Takes a string and applies a formatting to it to transform @@ -49,6 +49,6 @@ internal static partial class Interop /// On failure, returns a negative value. /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", SetLastError = true)] - internal static unsafe extern int SNPrintF(byte* str, int size, string format, int arg1); + internal static extern unsafe int SNPrintF(byte* str, int size, string format, int arg1); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs b/src/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs index fa4cf8627d..7a19512c66 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs @@ -9,6 +9,6 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")] - internal unsafe static extern bool StdinReady(); + internal static extern unsafe bool StdinReady(); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs b/src/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs index 675fcd47fc..89bf8c3383 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs @@ -19,6 +19,6 @@ internal static partial class Interop /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(SafePipeHandle fd, byte* buffer, int bufferSize); + internal static extern unsafe int Write(SafePipeHandle fd, byte* buffer, int bufferSize); } } diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.Write.cs b/src/Common/src/Interop/Unix/System.Native/Interop.Write.cs index c14fc26263..0636615a8b 100644 --- a/src/Common/src/Interop/Unix/System.Native/Interop.Write.cs +++ b/src/Common/src/Interop/Unix/System.Native/Interop.Write.cs @@ -19,9 +19,9 @@ internal static partial class Interop /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// </returns> [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(SafeFileHandle fd, byte* buffer, int bufferSize); + internal static extern unsafe int Write(SafeFileHandle fd, byte* buffer, int bufferSize); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(int fd, byte* buffer, int bufferSize); + internal static extern unsafe int Write(int fd, byte* buffer, int bufferSize); } } diff --git a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs index b2d04383e2..fab6ea2a81 100644 --- a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs +++ b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs @@ -17,7 +17,7 @@ internal static partial class Interop internal static extern SafeAsn1ObjectHandle ObjTxt2Obj(string s); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")] - private static unsafe extern int ObjObj2Txt(byte* buf, int buf_len, IntPtr a); + private static extern unsafe int ObjObj2Txt(byte* buf, int buf_len, IntPtr a); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", CharSet = CharSet.Ansi)] internal static extern IntPtr GetObjectDefinitionByName(string friendlyName); diff --git a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs index d381b6181b..9e8c6d8457 100644 --- a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs +++ b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs @@ -25,7 +25,7 @@ internal static partial class Interop internal static extern IntPtr ErrReasonErrorString(ulong error); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] - private static unsafe extern void ErrErrorStringN(ulong e, byte* buf, int len); + private static extern unsafe void ErrErrorStringN(ulong e, byte* buf, int len); private static unsafe string ErrErrorStringN(ulong error) { diff --git a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs index 5172edab93..44cbc146b1 100644 --- a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs +++ b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs @@ -32,7 +32,7 @@ internal static partial class Interop [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")] [return: MarshalAs(UnmanagedType.Bool)] - internal static unsafe extern bool EvpCipherUpdate( + internal static extern unsafe bool EvpCipherUpdate( SafeEvpCipherCtxHandle ctx, byte* @out, out int outl, diff --git a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs12.cs b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs12.cs index 0ea5c8fb9e..1be561006f 100644 --- a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs12.cs +++ b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs12.cs @@ -12,7 +12,7 @@ internal static partial class Interop internal static partial class Crypto { [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs12")] - internal static unsafe extern SafePkcs12Handle DecodePkcs12(byte[] buf, int len); + internal static extern unsafe SafePkcs12Handle DecodePkcs12(byte[] buf, int len); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs12FromBio")] internal static extern SafePkcs12Handle DecodePkcs12FromBio(SafeBioHandle bio); diff --git a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs index 3fcd2334c6..d179fd7373 100644 --- a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs +++ b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs @@ -19,6 +19,6 @@ internal static partial class Interop [DllImport(Libraries.CryptoNative)] [return: MarshalAs(UnmanagedType.Bool)] - private static unsafe extern bool CryptoNative_GetRandomBytes(byte* buf, int num); + private static extern unsafe bool CryptoNative_GetRandomBytes(byte* buf, int num); } } diff --git a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs index e3611685bf..19ab1ddc4a 100644 --- a/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs +++ b/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs @@ -73,7 +73,7 @@ internal static partial class Interop out int hashKeySize); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite")] - internal static unsafe extern int SslWrite(SafeSslHandle ssl, byte* buf, int num); + internal static extern unsafe int SslWrite(SafeSslHandle ssl, byte* buf, int num); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead")] internal static extern int SslRead(SafeSslHandle ssl, byte[] buf, int num); @@ -97,7 +97,7 @@ internal static partial class Interop // NOTE: this is just an (unsafe) overload to the BioWrite method from Interop.Bio.cs. [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")] - internal static unsafe extern int BioWrite(SafeBioHandle b, byte* data, int len); + internal static extern unsafe int BioWrite(SafeBioHandle b, byte* data, int len); [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")] internal static extern SafeX509Handle SslGetPeerCertificate(SafeSslHandle ssl); diff --git a/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs index d2ce4131b0..2431265e41 100644 --- a/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs +++ b/src/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs @@ -21,6 +21,6 @@ internal partial class Interop private const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002; [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - private static unsafe extern NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); + private static extern unsafe NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); } } diff --git a/src/Common/src/Interop/Windows/BCrypt/Interop.Blobs.cs b/src/Common/src/Interop/Windows/BCrypt/Interop.Blobs.cs index 5ab59edce9..b81a6527f1 100644 --- a/src/Common/src/Interop/Windows/BCrypt/Interop.Blobs.cs +++ b/src/Common/src/Interop/Windows/BCrypt/Interop.Blobs.cs @@ -142,7 +142,7 @@ internal partial class Interop /// The BCRYPT_DSA_KEY_BLOB structure is used as a v1 header for a DSA public key or private key BLOB in memory. /// </summary> [StructLayout(LayoutKind.Sequential)] - unsafe internal struct BCRYPT_DSA_KEY_BLOB + internal unsafe struct BCRYPT_DSA_KEY_BLOB { internal KeyBlobMagicNumber Magic; internal int cbKey; @@ -155,7 +155,7 @@ internal partial class Interop /// The BCRYPT_DSA_KEY_BLOB structure is used as a v2 header for a DSA public key or private key BLOB in memory. /// </summary> [StructLayout(LayoutKind.Sequential)] - unsafe internal struct BCRYPT_DSA_KEY_BLOB_V2 + internal unsafe struct BCRYPT_DSA_KEY_BLOB_V2 { internal KeyBlobMagicNumber Magic; internal int cbKey; diff --git a/src/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs b/src/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs index a984ea7a5d..797de1cc84 100644 --- a/src/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs +++ b/src/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs @@ -22,7 +22,7 @@ internal static partial class Interop internal const int IPv4AddressSize = 16; internal const int IPv6AddressSize = 28; - private unsafe static bool InitHttpApi(HTTPAPI_VERSION version) + private static unsafe bool InitHttpApi(HTTPAPI_VERSION version) { uint statusCode = HttpInitialize(version, (uint)HTTP_FLAGS.HTTP_INITIALIZE_SERVER, null); return statusCode == ERROR_SUCCESS; @@ -517,16 +517,16 @@ internal static partial class Interop [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpInitialize(HTTPAPI_VERSION version, uint flags, void* pReserved); + internal static extern unsafe uint HttpInitialize(HTTPAPI_VERSION version, uint flags, void* pReserved); [DllImport(Libraries.HttpApi, SetLastError = true)] internal static extern uint HttpSetUrlGroupProperty(ulong urlGroupId, HTTP_SERVER_PROPERTY serverProperty, IntPtr pPropertyInfo, uint propertyInfoLength); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpCreateServerSession(HTTPAPI_VERSION version, ulong* serverSessionId, uint reserved); + internal static extern unsafe uint HttpCreateServerSession(HTTPAPI_VERSION version, ulong* serverSessionId, uint reserved); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpCreateUrlGroup(ulong serverSessionId, ulong* urlGroupId, uint reserved); + internal static extern unsafe uint HttpCreateUrlGroup(ulong serverSessionId, ulong* urlGroupId, uint reserved); [DllImport(Libraries.HttpApi, SetLastError = true)] internal static extern uint HttpCloseUrlGroup(ulong urlGroupId); @@ -542,19 +542,19 @@ internal static partial class Interop internal static extern uint HttpRemoveUrlFromUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, uint flags); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpReceiveHttpRequest(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_REQUEST* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, NativeOverlapped* pOverlapped); + internal static extern unsafe uint HttpReceiveHttpRequest(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_REQUEST* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, NativeOverlapped* pOverlapped); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpSendHttpResponse(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_RESPONSE* pHttpResponse, void* pCachePolicy, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData); + internal static extern unsafe uint HttpSendHttpResponse(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_RESPONSE* pHttpResponse, void* pCachePolicy, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpWaitForDisconnect(SafeHandle requestQueueHandle, ulong connectionId, NativeOverlapped* pOverlapped); + internal static extern unsafe uint HttpWaitForDisconnect(SafeHandle requestQueueHandle, ulong connectionId, NativeOverlapped* pOverlapped); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpReceiveRequestEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, void* pEntityBuffer, uint entityBufferLength, out uint bytesReturned, NativeOverlapped* pOverlapped); + internal static extern unsafe uint HttpReceiveRequestEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, void* pEntityBuffer, uint entityBufferLength, out uint bytesReturned, NativeOverlapped* pOverlapped); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpSendResponseEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData); + internal static extern unsafe uint HttpSendResponseEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData); [DllImport(Libraries.HttpApi, SetLastError = true)] internal static extern unsafe uint HttpCloseRequestQueue(IntPtr pReqQueueHandle); @@ -600,10 +600,10 @@ internal static partial class Interop internal static extern SafeLocalFreeChannelBinding LocalAlloc(int uFlags, UIntPtr sizetdwBytes); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped); + internal static extern unsafe uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped); [DllImport(Libraries.HttpApi, SetLastError = true)] - internal unsafe static extern uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, byte* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped); + internal static extern unsafe uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, byte* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped); [Flags] internal enum FileCompletionNotificationModes : byte @@ -614,7 +614,7 @@ internal static partial class Interop } [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern bool SetFileCompletionNotificationModes(SafeHandle handle, FileCompletionNotificationModes modes); + internal static extern unsafe bool SetFileCompletionNotificationModes(SafeHandle handle, FileCompletionNotificationModes modes); internal static readonly string[] HttpVerbs = new string[] { @@ -746,7 +746,7 @@ internal static partial class Interop } } - private unsafe static string GetKnownHeader(HTTP_REQUEST* request, long fixup, int headerIndex) + private static unsafe string GetKnownHeader(HTTP_REQUEST* request, long fixup, int headerIndex) { if (NetEventSource.IsEnabled) { NetEventSource.Enter(null); } @@ -771,12 +771,12 @@ internal static partial class Interop return header; } - internal unsafe static string GetKnownHeader(HTTP_REQUEST* request, int headerIndex) + internal static unsafe string GetKnownHeader(HTTP_REQUEST* request, int headerIndex) { return GetKnownHeader(request, 0, headerIndex); } - internal unsafe static string GetKnownHeader(byte[] memoryBlob, IntPtr originalAddress, int headerIndex) + internal static unsafe string GetKnownHeader(byte[] memoryBlob, IntPtr originalAddress, int headerIndex) { fixed (byte* pMemoryBlob = memoryBlob) { @@ -784,7 +784,7 @@ internal static partial class Interop } } - private unsafe static string GetVerb(HTTP_REQUEST* request, long fixup) + private static unsafe string GetVerb(HTTP_REQUEST* request, long fixup) { string verb = null; @@ -800,12 +800,12 @@ internal static partial class Interop return verb; } - internal unsafe static string GetVerb(HTTP_REQUEST* request) + internal static unsafe string GetVerb(HTTP_REQUEST* request) { return GetVerb(request, 0); } - internal unsafe static string GetVerb(byte[] memoryBlob, IntPtr originalAddress) + internal static unsafe string GetVerb(byte[] memoryBlob, IntPtr originalAddress) { fixed (byte* pMemoryBlob = memoryBlob) { @@ -815,7 +815,7 @@ internal static partial class Interop // Server API - internal unsafe static WebHeaderCollection GetHeaders(byte[] memoryBlob, IntPtr originalAddress) + internal static unsafe WebHeaderCollection GetHeaders(byte[] memoryBlob, IntPtr originalAddress) { NetEventSource.Enter(null); @@ -873,7 +873,7 @@ internal static partial class Interop } - internal unsafe static uint GetChunks(byte[] memoryBlob, IntPtr originalAddress, ref int dataChunkIndex, ref uint dataChunkOffset, byte[] buffer, int offset, int size) + internal static unsafe uint GetChunks(byte[] memoryBlob, IntPtr originalAddress, ref int dataChunkIndex, ref uint dataChunkOffset, byte[] buffer, int offset, int size) { if (NetEventSource.IsEnabled) { @@ -936,7 +936,7 @@ internal static partial class Interop return dataRead; } - internal unsafe static HTTP_VERB GetKnownVerb(byte[] memoryBlob, IntPtr originalAddress) + internal static unsafe HTTP_VERB GetKnownVerb(byte[] memoryBlob, IntPtr originalAddress) { NetEventSource.Enter(null); @@ -955,7 +955,7 @@ internal static partial class Interop return verb; } - internal unsafe static IPEndPoint GetRemoteEndPoint(byte[] memoryBlob, IntPtr originalAddress) + internal static unsafe IPEndPoint GetRemoteEndPoint(byte[] memoryBlob, IntPtr originalAddress) { if (NetEventSource.IsEnabled) NetEventSource.Enter(null); @@ -983,7 +983,7 @@ internal static partial class Interop return endpoint; } - internal unsafe static IPEndPoint GetLocalEndPoint(byte[] memoryBlob, IntPtr originalAddress) + internal static unsafe IPEndPoint GetLocalEndPoint(byte[] memoryBlob, IntPtr originalAddress) { if (NetEventSource.IsEnabled) NetEventSource.Enter(null); @@ -1011,7 +1011,7 @@ internal static partial class Interop return endpoint; } - private unsafe static void CopyOutAddress(IntPtr address, ref SocketAddress v4address, ref SocketAddress v6address) + private static unsafe void CopyOutAddress(IntPtr address, ref SocketAddress v4address, ref SocketAddress v6address) { if (address != IntPtr.Zero) { diff --git a/src/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs b/src/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs index cbe54828f0..673b392af4 100644 --- a/src/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs +++ b/src/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs @@ -11,15 +11,15 @@ internal static partial class Interop { [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, [In] byte[] pbInput, int cbInput, void* pPaddingInfo, [Out] byte[] pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); + internal static extern unsafe ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, [In] byte[] pbInput, int cbInput, void* pPaddingInfo, [Out] byte[] pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, byte* pbInput, int cbInput, void* pPaddingInfo, byte* pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); + internal static extern unsafe ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, byte* pbInput, int cbInput, void* pPaddingInfo, byte* pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, [In] byte[] pbInput, int cbInput, void* pPaddingInfo, [Out] byte[] pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); + internal static extern unsafe ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, [In] byte[] pbInput, int cbInput, void* pPaddingInfo, [Out] byte[] pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, byte* pbInput, int cbInput, void* pPaddingInfo, byte* pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); + internal static extern unsafe ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, byte* pbInput, int cbInput, void* pPaddingInfo, byte* pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); } } diff --git a/src/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs b/src/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs index 266fceb7f2..8a56d24995 100644 --- a/src/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs +++ b/src/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs @@ -10,9 +10,9 @@ internal static partial class Interop internal static partial class NCrypt { [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, [In] byte[] pbHashValue, int cbHashValue, [Out] byte[] pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags); + internal static extern unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, [In] byte[] pbHashValue, int cbHashValue, [Out] byte[] pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags); [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void *pPaddingInfo, [In] byte[] pbHashValue, int cbHashValue, [In] byte[] pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags); + internal static extern unsafe ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void *pPaddingInfo, [In] byte[] pbHashValue, int cbHashValue, [In] byte[] pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags); } } diff --git a/src/Common/src/Interop/Windows/SChannel/UnmanagedCertificateContext.cs b/src/Common/src/Interop/Windows/SChannel/UnmanagedCertificateContext.cs index a64928f333..66c4a60c5d 100644 --- a/src/Common/src/Interop/Windows/SChannel/UnmanagedCertificateContext.cs +++ b/src/Common/src/Interop/Windows/SChannel/UnmanagedCertificateContext.cs @@ -9,7 +9,7 @@ using System.Security.Cryptography.X509Certificates; namespace System.Net { - internal unsafe static class UnmanagedCertificateContext + internal static unsafe class UnmanagedCertificateContext { internal static X509Certificate2Collection GetRemoteCertificatesFromStoreContext(SafeFreeCertContext certContext) { diff --git a/src/Common/src/Interop/Windows/Winsock/Interop.WSASocketW.SafeCloseSocket.cs b/src/Common/src/Interop/Windows/Winsock/Interop.WSASocketW.SafeCloseSocket.cs index 32af456e70..e18aa106fd 100644 --- a/src/Common/src/Interop/Windows/Winsock/Interop.WSASocketW.SafeCloseSocket.cs +++ b/src/Common/src/Interop/Windows/Winsock/Interop.WSASocketW.SafeCloseSocket.cs @@ -31,7 +31,7 @@ internal static partial class Interop [In] SocketConstructorFlags flags); [DllImport(Interop.Libraries.Ws2_32, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern SafeCloseSocket.InnerSafeCloseSocket WSASocketW( + internal static extern unsafe SafeCloseSocket.InnerSafeCloseSocket WSASocketW( [In] AddressFamily addressFamily, [In] SocketType socketType, [In] ProtocolType protocolType, diff --git a/src/Common/src/Interop/Windows/Winsock/Interop.recv.cs b/src/Common/src/Interop/Windows/Winsock/Interop.recv.cs index ffcf16889c..7cb21edb4c 100644 --- a/src/Common/src/Interop/Windows/Winsock/Interop.recv.cs +++ b/src/Common/src/Interop/Windows/Winsock/Interop.recv.cs @@ -12,7 +12,7 @@ internal static partial class Interop { // This method is always blocking, so it uses an IntPtr. [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] - internal unsafe static extern int recv( + internal static extern unsafe int recv( [In] IntPtr socketHandle, [In] byte* pinnedBuffer, [In] int len, diff --git a/src/Common/src/Interop/Windows/Winsock/Interop.recvfrom.cs b/src/Common/src/Interop/Windows/Winsock/Interop.recvfrom.cs index 2e02323340..ba8757f9ce 100644 --- a/src/Common/src/Interop/Windows/Winsock/Interop.recvfrom.cs +++ b/src/Common/src/Interop/Windows/Winsock/Interop.recvfrom.cs @@ -12,7 +12,7 @@ internal static partial class Interop { // This method is always blocking, so it uses an IntPtr. [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] - internal unsafe static extern int recvfrom( + internal static extern unsafe int recvfrom( [In] IntPtr socketHandle, [In] byte* pinnedBuffer, [In] int len, diff --git a/src/Common/src/Interop/Windows/Winsock/Interop.send.cs b/src/Common/src/Interop/Windows/Winsock/Interop.send.cs index aa101a04a9..473c6d1eca 100644 --- a/src/Common/src/Interop/Windows/Winsock/Interop.send.cs +++ b/src/Common/src/Interop/Windows/Winsock/Interop.send.cs @@ -12,7 +12,7 @@ internal static partial class Interop { // This method is always blocking, so it uses an IntPtr. [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] - internal unsafe static extern int send( + internal static extern unsafe int send( [In] IntPtr socketHandle, [In] byte* pinnedBuffer, [In] int len, diff --git a/src/Common/src/Interop/Windows/Winsock/Interop.sendto.cs b/src/Common/src/Interop/Windows/Winsock/Interop.sendto.cs index c0691880c4..dd0ea1ba8c 100644 --- a/src/Common/src/Interop/Windows/Winsock/Interop.sendto.cs +++ b/src/Common/src/Interop/Windows/Winsock/Interop.sendto.cs @@ -12,7 +12,7 @@ internal static partial class Interop { // This method is always blocking, so it uses an IntPtr. [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] - internal unsafe static extern int sendto( + internal static extern unsafe int sendto( [In] IntPtr socketHandle, [In] byte* pinnedBuffer, [In] int len, diff --git a/src/Common/src/Interop/Windows/advapi32/Interop.ControlService.cs b/src/Common/src/Interop/Windows/advapi32/Interop.ControlService.cs index 1d276f6131..94cda1257b 100644 --- a/src/Common/src/Interop/Windows/advapi32/Interop.ControlService.cs +++ b/src/Common/src/Interop/Windows/advapi32/Interop.ControlService.cs @@ -10,7 +10,7 @@ internal partial class Interop internal partial class Advapi32 { [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe extern static bool ControlService(IntPtr serviceHandle, int control, SERVICE_STATUS* pStatus); + internal extern unsafe static bool ControlService(IntPtr serviceHandle, int control, SERVICE_STATUS* pStatus); } } diff --git a/src/Common/src/Interop/Windows/advapi32/Interop.EventWriteTransfer.cs b/src/Common/src/Interop/Windows/advapi32/Interop.EventWriteTransfer.cs index b6f0591cc7..42b5ee6361 100644 --- a/src/Common/src/Interop/Windows/advapi32/Interop.EventWriteTransfer.cs +++ b/src/Common/src/Interop/Windows/advapi32/Interop.EventWriteTransfer.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal static partial class Advapi32 { [DllImport(Interop.Libraries.Advapi32)] - internal unsafe static extern int EventWriteTransfer( + internal static extern unsafe int EventWriteTransfer( ulong registrationHandle, void* eventDescriptor, Guid* activityId, diff --git a/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumKeyEx.cs b/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumKeyEx.cs index 79fbf9f806..8469e3242a 100644 --- a/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumKeyEx.cs +++ b/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumKeyEx.cs @@ -12,7 +12,7 @@ internal partial class Interop internal partial class Advapi32 { [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegEnumKeyExW")] - internal unsafe static extern int RegEnumKeyEx( + internal static extern unsafe int RegEnumKeyEx( SafeRegistryHandle hKey, int dwIndex, char* lpName, diff --git a/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumValue.cs b/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumValue.cs index 83cb8251b1..696723bafe 100644 --- a/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumValue.cs +++ b/src/Common/src/Interop/Windows/advapi32/Interop.RegEnumValue.cs @@ -11,7 +11,7 @@ internal partial class Interop internal partial class Advapi32 { [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegEnumValueW")] - internal unsafe static extern int RegEnumValue( + internal static extern unsafe int RegEnumValue( SafeRegistryHandle hKey, int dwIndex, char* lpValueName, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.CancelIoEx.cs b/src/Common/src/Interop/Windows/kernel32/Interop.CancelIoEx.cs index ae253fe1c3..fc99e3052f 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.CancelIoEx.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.CancelIoEx.cs @@ -11,6 +11,6 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped); + internal static extern unsafe bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped); } } diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ConnectNamedPipe.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ConnectNamedPipe.cs index dde659c14c..0a0b7d0df3 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ConnectNamedPipe.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ConnectNamedPipe.cs @@ -13,7 +13,7 @@ internal partial class Interop { [DllImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - unsafe internal static extern bool ConnectNamedPipe(SafePipeHandle handle, NativeOverlapped* overlapped); + internal static extern unsafe bool ConnectNamedPipe(SafePipeHandle handle, NativeOverlapped* overlapped); [DllImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.GetCPInfoEx.cs b/src/Common/src/Interop/Windows/kernel32/Interop.GetCPInfoEx.cs index 1497a02482..01c66f77dd 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.GetCPInfoEx.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.GetCPInfoEx.cs @@ -11,7 +11,7 @@ internal partial class Interop private const uint CP_ACP = 0x0u; [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "GetCPInfoExW")] - private extern unsafe static int GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx); + private extern static unsafe int GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private unsafe struct CPINFOEXW diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs b/src/Common/src/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs index 9dc5e6695c..d7b164923e 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs @@ -13,6 +13,6 @@ internal partial class Interop /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper. /// </summary> [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - unsafe internal static extern uint GetFullPathNameW(char* path, uint numBufferChars, SafeHandle buffer, IntPtr mustBeZero); + internal static extern unsafe uint GetFullPathNameW(char* path, uint numBufferChars, SafeHandle buffer, IntPtr mustBeZero); } } diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsole.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsole.cs index 21a1424e5b..4c5f2719c7 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsole.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsole.cs @@ -10,7 +10,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, EntryPoint = "ReadConsoleW")] - internal static unsafe extern bool ReadConsole( + internal static extern unsafe bool ReadConsole( IntPtr hConsoleInput, Byte* lpBuffer, Int32 nNumberOfCharsToRead, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsoleOutput.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsoleOutput.cs index c944de5abd..31acf26fae 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsoleOutput.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ReadConsoleOutput.cs @@ -17,6 +17,6 @@ internal partial class Interop } [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "ReadConsoleOutputW")] - internal static unsafe extern bool ReadConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* pBuffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT readRegion); + internal static extern unsafe bool ReadConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* pBuffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT readRegion); } } diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ReadDirectoryChangesW.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ReadDirectoryChangesW.cs index a355554817..84cd715e57 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ReadDirectoryChangesW.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ReadDirectoryChangesW.cs @@ -12,7 +12,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW", CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern bool ReadDirectoryChangesW( + internal static extern unsafe bool ReadDirectoryChangesW( SafeFileHandle hDirectory, byte[] lpBuffer, int nBufferLength, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_IntPtr.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_IntPtr.cs index 971c72f759..a018551262 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_IntPtr.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_IntPtr.cs @@ -10,7 +10,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - unsafe internal static extern int ReadFile( + internal static extern unsafe int ReadFile( IntPtr handle, byte* bytes, int numBytesToRead, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs index 08b6bde1d3..076f7f136f 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs @@ -11,7 +11,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - unsafe internal static extern int ReadFile( + internal static extern unsafe int ReadFile( SafeHandle handle, byte* bytes, int numBytesToRead, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs index 8f34d2bf7b..3ae65a8806 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs @@ -12,7 +12,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - unsafe internal static extern int ReadFile( + internal static extern unsafe int ReadFile( SafeHandle handle, byte* bytes, int numBytesToRead, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.SetConsoleWindowInfo.cs b/src/Common/src/Interop/Windows/kernel32/Interop.SetConsoleWindowInfo.cs index 22129427af..17bb3008bf 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.SetConsoleWindowInfo.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.SetConsoleWindowInfo.cs @@ -10,6 +10,6 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern bool SetConsoleWindowInfo(IntPtr hConsoleOutput, bool absolute, SMALL_RECT* consoleWindow); + internal static extern unsafe bool SetConsoleWindowInfo(IntPtr hConsoleOutput, bool absolute, SMALL_RECT* consoleWindow); } } diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs b/src/Common/src/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs index 5ad8308131..e7e0ef0d9b 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs @@ -14,7 +14,7 @@ internal partial class Interop internal static extern bool SetFileInformationByHandle(SafeFileHandle hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ref FILE_BASIC_INFO lpFileInformation, uint dwBufferSize); // Default values indicate "no change". Use defaults so that we don't force callsites to be aware of the default values - internal unsafe static bool SetFileTime( + internal static unsafe bool SetFileTime( SafeFileHandle hFile, long creationTime = -1, long lastAccessTime = -1, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.SetNamedPipeHandleState.cs b/src/Common/src/Interop/Windows/kernel32/Interop.SetNamedPipeHandleState.cs index 641d79c2ff..6a35f5930e 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.SetNamedPipeHandleState.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.SetNamedPipeHandleState.cs @@ -12,7 +12,7 @@ internal partial class Interop { [DllImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal static unsafe extern bool SetNamedPipeHandleState( + internal static extern unsafe bool SetNamedPipeHandleState( SafePipeHandle hNamedPipe, int* lpMode, IntPtr lpMaxCollectionCount, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.ThreadPoolIO.cs b/src/Common/src/Interop/Windows/kernel32/Interop.ThreadPoolIO.cs index 99db906e93..bc79d31bb4 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.ThreadPoolIO.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.ThreadPoolIO.cs @@ -11,16 +11,16 @@ internal static partial class Interop internal static partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern SafeThreadPoolIOHandle CreateThreadpoolIo(SafeHandle fl, [MarshalAs(UnmanagedType.FunctionPtr)] NativeIoCompletionCallback pfnio, IntPtr context, IntPtr pcbe); + internal static extern unsafe SafeThreadPoolIOHandle CreateThreadpoolIo(SafeHandle fl, [MarshalAs(UnmanagedType.FunctionPtr)] NativeIoCompletionCallback pfnio, IntPtr context, IntPtr pcbe); [DllImport(Libraries.Kernel32)] - internal static unsafe extern void CloseThreadpoolIo(IntPtr pio); + internal static extern unsafe void CloseThreadpoolIo(IntPtr pio); [DllImport(Libraries.Kernel32)] - internal static unsafe extern void StartThreadpoolIo(SafeThreadPoolIOHandle pio); + internal static extern unsafe void StartThreadpoolIo(SafeThreadPoolIOHandle pio); [DllImport(Libraries.Kernel32)] - internal static unsafe extern void CancelThreadpoolIo(SafeThreadPoolIOHandle pio); + internal static extern unsafe void CancelThreadpoolIo(SafeThreadPoolIOHandle pio); } internal delegate void NativeIoCompletionCallback(IntPtr instance, IntPtr context, IntPtr overlapped, uint ioResult, UIntPtr numberOfBytesTransferred, IntPtr io); diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsole.cs b/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsole.cs index b5fc70d4d4..629d92f21d 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsole.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsole.cs @@ -10,7 +10,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, EntryPoint = "WriteConsoleW")] - internal static unsafe extern bool WriteConsole( + internal static extern unsafe bool WriteConsole( IntPtr hConsoleOutput, Byte* lpBuffer, Int32 nNumberOfCharsToWrite, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsoleOutput.cs b/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsoleOutput.cs index 834e22c573..5e777bb52c 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsoleOutput.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.WriteConsoleOutput.cs @@ -10,6 +10,6 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "WriteConsoleOutputW")] - internal static unsafe extern bool WriteConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* buffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT writeRegion); + internal static extern unsafe bool WriteConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* buffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT writeRegion); } } diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_IntPtr.cs b/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_IntPtr.cs index 331a618f3f..2e18dc3ba2 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_IntPtr.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_IntPtr.cs @@ -9,7 +9,7 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern int WriteFile( + internal static extern unsafe int WriteFile( IntPtr handle, byte* bytes, int numBytesToWrite, diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs b/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs index 4c74c57def..e7e868e142 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs @@ -18,7 +18,7 @@ internal partial class Interop // and pass in an address for the numBytesRead parameter. [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero); + internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero); } } diff --git a/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs b/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs index 86adae10a8..dc1e97555b 100644 --- a/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs +++ b/src/Common/src/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs @@ -17,6 +17,6 @@ internal partial class Interop // struct in a callback (or an EndWrite method called by that callback), // and pass in an address for the numBytesRead parameter. [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); + internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); } } diff --git a/src/Common/src/Interop/Windows/sspicli/Interop.SSPI.cs b/src/Common/src/Interop/Windows/sspicli/Interop.SSPI.cs index 37313998c0..a08b49dba7 100644 --- a/src/Common/src/Interop/Windows/sspicli/Interop.SSPI.cs +++ b/src/Common/src/Interop/Windows/sspicli/Interop.SSPI.cs @@ -263,7 +263,7 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal static unsafe extern int DecryptMessage( + internal static extern unsafe int DecryptMessage( [In] ref CredHandle contextHandle, [In, Out] ref SecBufferDesc inputOutput, [In] uint sequenceNumber, @@ -290,7 +290,7 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern int AcceptSecurityContext( + internal static extern unsafe int AcceptSecurityContext( ref CredHandle credentialHandle, [In] void* inContextPtr, [In] SecBufferDesc* inputBuffer, @@ -303,13 +303,13 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern int QueryContextAttributesW( + internal static extern unsafe int QueryContextAttributesW( ref CredHandle contextHandle, [In] ContextAttribute attribute, [In] void* buffer); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern int SetContextAttributesW( + internal static extern unsafe int SetContextAttributesW( ref CredHandle contextHandle, [In] ContextAttribute attribute, [In] byte[] buffer, @@ -321,7 +321,7 @@ internal static partial class Interop [Out] out SafeFreeContextBuffer_SECURITY handle); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern int AcquireCredentialsHandleW( + internal static extern unsafe int AcquireCredentialsHandleW( [In] string principal, [In] string moduleName, [In] int usage, @@ -334,7 +334,7 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern int AcquireCredentialsHandleW( + internal static extern unsafe int AcquireCredentialsHandleW( [In] string principal, [In] string moduleName, [In] int usage, @@ -347,7 +347,7 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern int AcquireCredentialsHandleW( + internal static extern unsafe int AcquireCredentialsHandleW( [In] string principal, [In] string moduleName, [In] int usage, @@ -360,7 +360,7 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern int AcquireCredentialsHandleW( + internal static extern unsafe int AcquireCredentialsHandleW( [In] string principal, [In] string moduleName, [In] int usage, @@ -373,7 +373,7 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern int InitializeSecurityContextW( + internal static extern unsafe int InitializeSecurityContextW( ref CredHandle credentialHandle, [In] void* inContextPtr, [In] byte* targetName, @@ -389,23 +389,23 @@ internal static partial class Interop ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern int CompleteAuthToken( + internal static extern unsafe int CompleteAuthToken( [In] void* inContextPtr, [In, Out] ref SecBufferDesc inputBuffers ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern int ApplyControlToken( + internal static extern unsafe int ApplyControlToken( [In] void* inContextPtr, [In, Out] ref SecBufferDesc inputBuffers ); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] - internal unsafe static extern SECURITY_STATUS SspiFreeAuthIdentity( + internal static extern unsafe SECURITY_STATUS SspiFreeAuthIdentity( [In] IntPtr authData); [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] - internal unsafe static extern SECURITY_STATUS SspiEncodeStringsAsAuthIdentity( + internal static extern unsafe SECURITY_STATUS SspiEncodeStringsAsAuthIdentity( [In] string userName, [In] string domainName, [In] string password, diff --git a/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs b/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs index bc39991e0d..9f299de98a 100644 --- a/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs +++ b/src/Common/src/Interop/Windows/sspicli/SSPIWrapper.cs @@ -266,7 +266,7 @@ namespace System.Net VerifySignature } - private unsafe static int EncryptDecryptHelper(OP op, SSPIInterface secModule, SafeDeleteContext context, SecurityBuffer[] input, uint sequenceNumber) + private static unsafe int EncryptDecryptHelper(OP op, SSPIInterface secModule, SafeDeleteContext context, SecurityBuffer[] input, uint sequenceNumber) { Interop.SspiCli.SecBufferDesc sdcInOut = new Interop.SspiCli.SecBufferDesc(input.Length); var unmanagedBuffer = new Interop.SspiCli.SecBuffer[input.Length]; diff --git a/src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs b/src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs index 6d02e0a003..417024ef40 100644 --- a/src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs +++ b/src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs @@ -75,12 +75,12 @@ namespace System.Net.Security // This method switches between three non-interruptible helper methods. (This method can't be both non-interruptible and // reference imports from all three DLLs - doing so would cause all three DLLs to try to be bound to.) // - public unsafe static int QueryContextAttributes(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, byte* buffer, SafeHandle refHandle) + public static unsafe int QueryContextAttributes(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, byte* buffer, SafeHandle refHandle) { return QueryContextAttributes_SECURITY(phContext, contextAttribute, buffer, refHandle); } - private unsafe static int QueryContextAttributes_SECURITY( + private static unsafe int QueryContextAttributes_SECURITY( SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, byte* buffer, @@ -220,7 +220,7 @@ namespace System.Net.Security } #endif - public unsafe static int AcquireCredentialsHandle( + public static unsafe int AcquireCredentialsHandle( string package, Interop.SspiCli.CredentialUse intent, ref Interop.SspiCli.SEC_WINNT_AUTH_IDENTITY_W authdata, @@ -255,7 +255,7 @@ namespace System.Net.Security return errorCode; } - public unsafe static int AcquireDefaultCredential( + public static unsafe int AcquireDefaultCredential( string package, Interop.SspiCli.CredentialUse intent, out SafeFreeCredentials outCredential) @@ -290,7 +290,7 @@ namespace System.Net.Security return errorCode; } - public unsafe static int AcquireCredentialsHandle( + public static unsafe int AcquireCredentialsHandle( string package, Interop.SspiCli.CredentialUse intent, ref SafeSspiAuthDataHandle authdata, @@ -319,7 +319,7 @@ namespace System.Net.Security return errorCode; } - public unsafe static int AcquireCredentialsHandle( + public static unsafe int AcquireCredentialsHandle( string package, Interop.SspiCli.CredentialUse intent, ref Interop.SspiCli.SCHANNEL_CRED authdata, @@ -448,7 +448,7 @@ namespace System.Net.Security protected SafeFreeCredentials _EffectiveCredential; //------------------------------------------------------------------- - internal unsafe static int InitializeSecurityContext( + internal static unsafe int InitializeSecurityContext( ref SafeFreeCredentials inCredentials, ref SafeDeleteContext refContext, string targetName, @@ -740,7 +740,7 @@ namespace System.Net.Security } //------------------------------------------------------------------- - internal unsafe static int AcceptSecurityContext( + internal static unsafe int AcceptSecurityContext( ref SafeFreeCredentials inCredentials, ref SafeDeleteContext refContext, Interop.SspiCli.ContextFlags inFlags, @@ -1021,7 +1021,7 @@ namespace System.Net.Security return errorCode; } - internal unsafe static int CompleteAuthToken( + internal static unsafe int CompleteAuthToken( ref SafeDeleteContext refContext, SecurityBuffer[] inSecBuffers) { @@ -1120,7 +1120,7 @@ namespace System.Net.Security return errorCode; } - internal unsafe static int ApplyControlToken( + internal static unsafe int ApplyControlToken( ref SafeDeleteContext refContext, SecurityBuffer[] inSecBuffers) { @@ -1264,12 +1264,12 @@ namespace System.Net.Security return new SafeFreeContextBufferChannelBinding_SECURITY(); } - public unsafe static int QueryContextChannelBinding(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, SecPkgContext_Bindings* buffer, SafeFreeContextBufferChannelBinding refHandle) + public static unsafe int QueryContextChannelBinding(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, SecPkgContext_Bindings* buffer, SafeFreeContextBufferChannelBinding refHandle) { return QueryContextChannelBinding_SECURITY(phContext, contextAttribute, buffer, refHandle); } - private unsafe static int QueryContextChannelBinding_SECURITY(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, SecPkgContext_Bindings* buffer, SafeFreeContextBufferChannelBinding refHandle) + private static unsafe int QueryContextChannelBinding_SECURITY(SafeDeleteContext phContext, Interop.SspiCli.ContextAttribute contextAttribute, SecPkgContext_Bindings* buffer, SafeFreeContextBufferChannelBinding refHandle) { int status = (int)Interop.SECURITY_STATUS.InvalidHandle; diff --git a/src/Common/src/System/Globalization/FormatProvider.Number.cs b/src/Common/src/System/Globalization/FormatProvider.Number.cs index e4fc5ea6f7..969d4793ab 100644 --- a/src/Common/src/System/Globalization/FormatProvider.Number.cs +++ b/src/Common/src/System/Globalization/FormatProvider.Number.cs @@ -296,7 +296,7 @@ namespace System.Globalization return (((ch) == 0x20) || ((ch) >= 0x09 && (ch) <= 0x0D)); } - private unsafe static char* MatchChars(char* p, string str) + private static unsafe char* MatchChars(char* p, string str) { fixed (char* stringPointer = str) { @@ -304,7 +304,7 @@ namespace System.Globalization } } - private unsafe static char* MatchChars(char* p, char* str) + private static unsafe char* MatchChars(char* p, char* str) { Debug.Assert(p != null && str != null); @@ -325,7 +325,7 @@ namespace System.Globalization return null; } - private unsafe static bool ParseNumber(ref char* str, NumberStyles options, ref NumberBuffer number, StringBuilder sb, NumberFormatInfo numfmt, bool parseDecimal) + private static unsafe bool ParseNumber(ref char* str, NumberStyles options, ref NumberBuffer number, StringBuilder sb, NumberFormatInfo numfmt, bool parseDecimal) { const int StateSign = 0x0001; const int StateParens = 0x0002; @@ -555,7 +555,7 @@ namespace System.Globalization return true; } - internal unsafe static bool TryStringToNumber(string str, NumberStyles options, ref NumberBuffer number, StringBuilder sb, NumberFormatInfo numfmt, bool parseDecimal) + internal static unsafe bool TryStringToNumber(string str, NumberStyles options, ref NumberBuffer number, StringBuilder sb, NumberFormatInfo numfmt, bool parseDecimal) { if (str == null) { @@ -622,7 +622,7 @@ namespace System.Globalization private static string s_posNumberFormat = "#"; - internal unsafe static void Int32ToDecChars(char* buffer, ref int index, uint value, int digits) + internal static unsafe void Int32ToDecChars(char* buffer, ref int index, uint value, int digits) { while (--digits >= 0 || value != 0) { diff --git a/src/Common/src/System/IO/PathInternal.Windows.StringBuffer.cs b/src/Common/src/System/IO/PathInternal.Windows.StringBuffer.cs index fec2218844..2d7a0c1ec5 100644 --- a/src/Common/src/System/IO/PathInternal.Windows.StringBuffer.cs +++ b/src/Common/src/System/IO/PathInternal.Windows.StringBuffer.cs @@ -27,7 +27,7 @@ namespace System.IO /// <summary> /// Gets the length of the root of the path (drive, share, etc.). /// </summary> - internal unsafe static uint GetRootLength(StringBuffer path) + internal static unsafe uint GetRootLength(StringBuffer path) { if (path.Length == 0) return 0; return GetRootLength(path.CharPointer, path.Length); diff --git a/src/Common/src/System/IO/PathInternal.Windows.cs b/src/Common/src/System/IO/PathInternal.Windows.cs index e14b0526b0..f98062bb45 100644 --- a/src/Common/src/System/IO/PathInternal.Windows.cs +++ b/src/Common/src/System/IO/PathInternal.Windows.cs @@ -207,7 +207,7 @@ namespace System.IO /// Check for known wildcard characters. '*' and '?' are the most common ones. /// </summary> [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe static bool HasWildCardCharacters(string path) + internal static unsafe bool HasWildCardCharacters(string path) { // Question mark is part of dos device syntax so we have to skip if we are int startIndex = PathInternal.IsDevice(path) ? ExtendedPathPrefix.Length : 0; @@ -218,7 +218,7 @@ namespace System.IO /// <summary> /// Gets the length of the root of the path (drive, share, etc.). /// </summary> - internal unsafe static int GetRootLength(string path) + internal static unsafe int GetRootLength(string path) { fixed(char* value = path) { @@ -226,7 +226,7 @@ namespace System.IO } } - private unsafe static uint GetRootLength(char* path, uint pathLength) + private static unsafe uint GetRootLength(char* path, uint pathLength) { uint i = 0; uint volumeSeparatorLength = 2; // Length to the colon "C:" @@ -273,7 +273,7 @@ namespace System.IO return i; } - private unsafe static bool StartsWithOrdinal(char* source, uint sourceLength, string value) + private static unsafe bool StartsWithOrdinal(char* source, uint sourceLength, string value) { if (sourceLength < (uint)value.Length) return false; for (int i = 0; i < value.Length; i++) diff --git a/src/Common/src/System/IO/PathInternal.cs b/src/Common/src/System/IO/PathInternal.cs index ee68750224..59e8aeb7b1 100644 --- a/src/Common/src/System/IO/PathInternal.cs +++ b/src/Common/src/System/IO/PathInternal.cs @@ -145,7 +145,7 @@ namespace System.IO /// <summary> /// Gets the count of common characters from the left optionally ignoring case /// </summary> - unsafe internal static int EqualStartingCharacterCount(string first, string second, bool ignoreCase) + internal static unsafe int EqualStartingCharacterCount(string first, string second, bool ignoreCase) { if (string.IsNullOrEmpty(first) || string.IsNullOrEmpty(second)) return 0; diff --git a/src/Common/src/System/Net/HttpKnownHeaderNames.TryGetHeaderName.cs b/src/Common/src/System/Net/HttpKnownHeaderNames.TryGetHeaderName.cs index adfc3dddf4..2b50a69d5e 100644 --- a/src/Common/src/System/Net/HttpKnownHeaderNames.TryGetHeaderName.cs +++ b/src/Common/src/System/Net/HttpKnownHeaderNames.TryGetHeaderName.cs @@ -27,7 +27,7 @@ namespace System.Net /// Gets a known header name string from a matching IntPtr buffer, using a case-sensitive /// ordinal comparison. Used to avoid allocating new strings for known header names. /// </summary> - public unsafe static bool TryGetHeaderName(IntPtr buffer, int length, out string name) + public static unsafe bool TryGetHeaderName(IntPtr buffer, int length, out string name) { Debug.Assert(length >= 0); @@ -328,7 +328,7 @@ namespace System.Net return false; } - private unsafe static bool EqualsOrdinal(string left, IntPtr right, int rightLength) + private static unsafe bool EqualsOrdinal(string left, IntPtr right, int rightLength) { Debug.Assert(left != null); Debug.Assert(right != IntPtr.Zero); diff --git a/src/Common/src/System/Net/SafeCloseSocket.Unix.cs b/src/Common/src/System/Net/SafeCloseSocket.Unix.cs index 2722d03c42..5c1fa75890 100644 --- a/src/Common/src/System/Net/SafeCloseSocket.Unix.cs +++ b/src/Common/src/System/Net/SafeCloseSocket.Unix.cs @@ -85,19 +85,19 @@ namespace System.Net.Sockets } } - public unsafe static SafeCloseSocket CreateSocket(IntPtr fileDescriptor) + public static unsafe SafeCloseSocket CreateSocket(IntPtr fileDescriptor) { return CreateSocket(InnerSafeCloseSocket.CreateSocket(fileDescriptor)); } - public unsafe static SocketError CreateSocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, out SafeCloseSocket socket) + public static unsafe SocketError CreateSocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, out SafeCloseSocket socket) { SocketError errorCode; socket = CreateSocket(InnerSafeCloseSocket.CreateSocket(addressFamily, socketType, protocolType, out errorCode)); return errorCode; } - public unsafe static SocketError Accept(SafeCloseSocket socketHandle, byte[] socketAddress, ref int socketAddressSize, out SafeCloseSocket socket) + public static unsafe SocketError Accept(SafeCloseSocket socketHandle, byte[] socketAddress, ref int socketAddressSize, out SafeCloseSocket socket) { SocketError errorCode; socket = CreateSocket(InnerSafeCloseSocket.Accept(socketHandle, socketAddress, ref socketAddressSize, out errorCode)); diff --git a/src/Common/src/System/Net/SafeCloseSocket.Windows.cs b/src/Common/src/System/Net/SafeCloseSocket.Windows.cs index 85565268d4..f90789fc19 100644 --- a/src/Common/src/System/Net/SafeCloseSocket.Windows.cs +++ b/src/Common/src/System/Net/SafeCloseSocket.Windows.cs @@ -69,7 +69,7 @@ namespace System.Net.Sockets return _iocpBoundHandle; } - internal unsafe static SafeCloseSocket CreateWSASocket(byte* pinnedBuffer) + internal static unsafe SafeCloseSocket CreateWSASocket(byte* pinnedBuffer) { return CreateSocket(InnerSafeCloseSocket.CreateWSASocket(pinnedBuffer)); } @@ -208,7 +208,7 @@ namespace System.Net.Sockets return errorCode; } - internal unsafe static InnerSafeCloseSocket CreateWSASocket(byte* pinnedBuffer) + internal static unsafe InnerSafeCloseSocket CreateWSASocket(byte* pinnedBuffer) { // NOTE: -1 is the value for FROM_PROTOCOL_INFO. InnerSafeCloseSocket result = Interop.Winsock.WSASocketW((AddressFamily)(-1), (SocketType)(-1), (ProtocolType)(-1), pinnedBuffer, 0, Interop.Winsock.SocketConstructorFlags.WSA_FLAG_OVERLAPPED); diff --git a/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs b/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs index 380fed81b7..85185004c1 100644 --- a/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs +++ b/src/Common/src/System/Net/Security/NegotiateStreamPal.Windows.cs @@ -28,7 +28,7 @@ namespace System.Net.Security (isServer ? Interop.SspiCli.CredentialUse.SECPKG_CRED_INBOUND : Interop.SspiCli.CredentialUse.SECPKG_CRED_OUTBOUND)); } - internal unsafe static SafeFreeCredentials AcquireCredentialsHandle(string package, bool isServer, NetworkCredential credential) + internal static unsafe SafeFreeCredentials AcquireCredentialsHandle(string package, bool isServer, NetworkCredential credential) { SafeSspiAuthDataHandle authData = null; try diff --git a/src/Common/src/System/Net/WebHeaderEncoding.cs b/src/Common/src/System/Net/WebHeaderEncoding.cs index 433931d0b6..b00a7ca09b 100644 --- a/src/Common/src/System/Net/WebHeaderEncoding.cs +++ b/src/Common/src/System/Net/WebHeaderEncoding.cs @@ -59,7 +59,7 @@ namespace System.Net { return myString.Length; } - internal unsafe static void GetBytes(string myString, int charIndex, int charCount, byte[] bytes, int byteIndex) + internal static unsafe void GetBytes(string myString, int charIndex, int charCount, byte[] bytes, int byteIndex) { if (myString.Length == 0) { @@ -75,7 +75,7 @@ namespace System.Net } } } - internal unsafe static byte[] GetBytes(string myString) + internal static unsafe byte[] GetBytes(string myString) { byte[] bytes = new byte[myString.Length]; if (myString.Length != 0) diff --git a/src/Common/src/System/Runtime/InteropServices/Marshal.Unix.cs b/src/Common/src/System/Runtime/InteropServices/Marshal.Unix.cs index 4f6c19b54e..0ed38ff1de 100644 --- a/src/Common/src/System/Runtime/InteropServices/Marshal.Unix.cs +++ b/src/Common/src/System/Runtime/InteropServices/Marshal.Unix.cs @@ -14,7 +14,7 @@ namespace System.Runtime.InteropServices return 0; } - unsafe public static String PtrToStringAnsi(IntPtr ptr) + public static unsafe String PtrToStringAnsi(IntPtr ptr) { if (IntPtr.Zero == ptr) { diff --git a/src/Common/src/System/Xml/XmlCharType.cs b/src/Common/src/System/Xml/XmlCharType.cs index f519f95474..95a5f3b8c4 100644 --- a/src/Common/src/System/Xml/XmlCharType.cs +++ b/src/Common/src/System/Xml/XmlCharType.cs @@ -26,7 +26,7 @@ namespace System.Xml /// </devdoc> #if XMLCHARTYPE_USE_RESOURCE - unsafe internal struct XmlCharType { + internal unsafe struct XmlCharType { #else internal struct XmlCharType { diff --git a/src/System.Collections/src/System/Collections/Generic/BitHelper.cs b/src/System.Collections/src/System/Collections/Generic/BitHelper.cs index 5075bfb7be..53853fdcf3 100644 --- a/src/System.Collections/src/System/Collections/Generic/BitHelper.cs +++ b/src/System.Collections/src/System/Collections/Generic/BitHelper.cs @@ -41,7 +41,7 @@ namespace System.Collections.Generic /// on a bit array and then need to loop over it. In particular, if it avoided visiting /// every bit, it would allow good perf improvements when the bit array is sparse. /// </summary> - unsafe internal sealed class BitHelper + internal unsafe sealed class BitHelper { // should not be serialized private const byte MarkedBitFlag = 1; private const byte IntSize = 32; diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs index 5757732ab8..2a1ab92ed1 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs @@ -26,7 +26,7 @@ namespace System.ComponentModel private static object s_contextLockHolder; private static volatile Hashtable s_providers; private static volatile Hashtable s_providerInstances; - private static readonly object s_internalSyncObject = new object(); + private static readonly object s_internalSyncObject = new object(); // not creatable... // diff --git a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs index e0111de416..cda6d7ef36 100644 --- a/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs +++ b/src/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs @@ -470,7 +470,7 @@ namespace System.ComponentModel /// component, in the form of a combined multicast event handler. /// Returns null if no event handlers currently assigned to component. /// </summary> - internal protected EventHandler GetValueChangedHandler(object component) + protected internal EventHandler GetValueChangedHandler(object component) { if (component != null && _valueChangedHandlers != null) { diff --git a/src/System.Console/src/System/ConsolePal.Windows.cs b/src/System.Console/src/System/ConsolePal.Windows.cs index 08017ec58e..ee6c10ab4f 100644 --- a/src/System.Console/src/System/ConsolePal.Windows.cs +++ b/src/System.Console/src/System/ConsolePal.Windows.cs @@ -668,7 +668,7 @@ namespace System Interop.Kernel32.Beep(frequency, duration); } - public unsafe static void MoveBufferArea(int sourceLeft, int sourceTop, + public static unsafe void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor) @@ -1170,7 +1170,7 @@ namespace System // world working set and to avoid requiring a reference to the // System.IO.FileSystem contract. - private unsafe static int ReadFileNative(IntPtr hFile, byte[] bytes, int offset, int count, bool isPipe, out int bytesRead, bool useFileAPIs) + private static unsafe int ReadFileNative(IntPtr hFile, byte[] bytes, int offset, int count, bool isPipe, out int bytesRead, bool useFileAPIs) { Debug.Assert(offset >= 0, "offset >= 0"); Debug.Assert(count >= 0, "count >= 0"); diff --git a/src/System.Data.Common/src/System/Data/DataColumn.cs b/src/System.Data.Common/src/System/Data/DataColumn.cs index 14d0a2d49d..eddc9c027c 100644 --- a/src/System.Data.Common/src/System/Data/DataColumn.cs +++ b/src/System.Data.Common/src/System/Data/DataColumn.cs @@ -1398,7 +1398,7 @@ namespace System.Data } } - internal protected void CheckNotAllowNull() + protected internal void CheckNotAllowNull() { if (_storage == null) { diff --git a/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Windows.cs b/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Windows.cs index 103e3015a7..23cd8aa548 100644 --- a/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Windows.cs +++ b/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Windows.cs @@ -268,10 +268,10 @@ namespace System.Data.SqlClient private static extern uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize); [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] - private static unsafe extern void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf); + private static extern unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf); [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] - private static unsafe extern uint SNISecGenClientContextWrapper( + private static extern unsafe uint SNISecGenClientContextWrapper( [In] SNIHandle pConn, [In, Out] byte[] pIn, uint cbIn, diff --git a/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs b/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs index 31e9fbf7ef..3e3eecea6f 100644 --- a/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs +++ b/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlCommand.cs @@ -1792,7 +1792,7 @@ namespace System.Data.SqlClient } // Yukon- column ordinals (this array indexed by ProcParamsColIndex - static readonly internal string[] PreKatmaiProcParamsNames = new string[] { + internal static readonly string[] PreKatmaiProcParamsNames = new string[] { "PARAMETER_NAME", // ParameterName, "PARAMETER_TYPE", // ParameterType, "DATA_TYPE", // DataType @@ -1811,7 +1811,7 @@ namespace System.Data.SqlClient }; // Katmai+ column ordinals (this array indexed by ProcParamsColIndex - static readonly internal string[] KatmaiProcParamsNames = new string[] { + internal static readonly string[] KatmaiProcParamsNames = new string[] { "PARAMETER_NAME", // ParameterName, "PARAMETER_TYPE", // ParameterType, null, // DataType, removed from Katmai+ diff --git a/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.CoreCLR.cs b/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.CoreCLR.cs index afaed63fcc..6f6686300c 100644 --- a/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.CoreCLR.cs +++ b/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.CoreCLR.cs @@ -141,7 +141,7 @@ namespace System.Diagnostics return provider.GetMetadataReader(); } - private unsafe static MetadataReaderProvider TryOpenReaderForInMemoryPdb(IntPtr inMemoryPdbAddress, int inMemoryPdbSize) + private static unsafe MetadataReaderProvider TryOpenReaderForInMemoryPdb(IntPtr inMemoryPdbAddress, int inMemoryPdbSize) { Debug.Assert(inMemoryPdbAddress != IntPtr.Zero); @@ -167,7 +167,7 @@ namespace System.Diagnostics } } - private unsafe static PEReader TryGetPEReader(string assemblyPath, IntPtr loadedPeAddress, int loadedPeSize) + private static unsafe PEReader TryGetPEReader(string assemblyPath, IntPtr loadedPeAddress, int loadedPeSize) { // TODO: https://github.com/dotnet/corefx/issues/11406 //if (loadedPeAddress != IntPtr.Zero && loadedPeSize > 0) diff --git a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventProvider.cs b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventProvider.cs index 6f9c2e15d1..ce12178b35 100644 --- a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventProvider.cs @@ -1132,7 +1132,7 @@ namespace System.Diagnostics.Tracing // </SecurityKernel> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] [System.Security.SecurityCritical] - internal unsafe protected bool WriteEvent(ref EventDescriptor eventDescriptor, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data) + protected internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data) { if (childActivityID != null) { diff --git a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventSource.cs b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventSource.cs index cf5841d424..f5e8059137 100644 --- a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/EventSource.cs @@ -2060,7 +2060,7 @@ namespace System.Diagnostics.Tracing } [SecurityCritical] - unsafe private object[] SerializeEventArgs(int eventId, object[] args) + private unsafe object[] SerializeEventArgs(int eventId, object[] args) { TraceLoggingEventTypes eventTypes = m_eventData[eventId].TraceLoggingEventTypes; if (eventTypes == null) @@ -2136,7 +2136,7 @@ namespace System.Diagnostics.Tracing } [SecurityCritical] - unsafe private void WriteToAllListeners(int eventId, Guid* childActivityID, int eventDataCount, EventSource.EventData* data) + private unsafe void WriteToAllListeners(int eventId, Guid* childActivityID, int eventDataCount, EventSource.EventData* data) { // We represent a byte[] as a integer denoting the length and then a blob of bytes in the data pointer. This causes a spurious // warning because eventDataCount is off by one for the byte[] case since a byte[] has 2 items associated it. So we want to check @@ -2160,7 +2160,7 @@ namespace System.Diagnostics.Tracing // helper for writing to all EventListeners attached the current eventSource. [SecurityCritical] - unsafe private void WriteToAllListeners(int eventId, Guid* childActivityID, params object[] args) + private unsafe void WriteToAllListeners(int eventId, Guid* childActivityID, params object[] args) { EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this); eventCallbackArgs.EventId = eventId; @@ -2311,7 +2311,7 @@ namespace System.Diagnostics.Tracing #if FEATURE_ACTIVITYSAMPLING [SecurityCritical] - unsafe private SessionMask GetEtwSessionMask(int eventId, Guid* childActivityID) + private unsafe SessionMask GetEtwSessionMask(int eventId, Guid* childActivityID) { SessionMask etwSessions = new SessionMask(); @@ -4395,7 +4395,7 @@ namespace System.Diagnostics.Tracing /// for a particular eventSource to occur BEFORE the OnEventSourceCreated is issued. /// </summary> /// <param name="eventSource"></param> - internal protected virtual void OnEventSourceCreated(EventSource eventSource) + protected internal virtual void OnEventSourceCreated(EventSource eventSource) { EventHandler<EventSourceCreatedEventArgs> callBack = this._EventSourceCreated; if(callBack != null) @@ -4411,7 +4411,7 @@ namespace System.Diagnostics.Tracing /// the EventListener has enabled events. /// </summary> /// <param name="eventData"></param> - internal protected virtual void OnEventWritten(EventWrittenEventArgs eventData) + protected internal virtual void OnEventWritten(EventWrittenEventArgs eventData) { EventHandler<EventWrittenEventArgs> callBack = this.EventWritten; if (callBack != null) @@ -5434,7 +5434,7 @@ namespace System.Diagnostics.Tracing /// current activity is active. /// </summary> [SecurityCritical] - unsafe public static bool PassesActivityFilter( + public static unsafe bool PassesActivityFilter( ActivityFilter filterList, Guid* childActivityID, bool triggeringEvent, @@ -5532,7 +5532,7 @@ namespace System.Diagnostics.Tracing /// that the current activity is active. /// </summary> [SecurityCritical] - unsafe public static void FlowActivityIfNeeded(ActivityFilter filterList, Guid* currentActivityId, Guid* childActivityID) + public static unsafe void FlowActivityIfNeeded(ActivityFilter filterList, Guid* currentActivityId, Guid* childActivityID) { Contract.Assert(childActivityID != null); diff --git a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs index e51aff0380..24d7c100ed 100644 --- a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs +++ b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs @@ -135,7 +135,7 @@ namespace System.Diagnostics.Tracing public static TraceLoggingTypeInfo UIntPtr() { return new ScalarArrayTypeInfo(typeof(UIntPtr[]), Statics.FormatPtr, Statics.UIntPtrType, System.IntPtr.Size); } public static TraceLoggingTypeInfo Single() { return new ScalarArrayTypeInfo(typeof(Single[]), Statics.Format32, TraceLoggingDataType.Float, sizeof(Single)); } public static TraceLoggingTypeInfo Double() { return new ScalarArrayTypeInfo(typeof(Double[]), Statics.Format64, TraceLoggingDataType.Double, sizeof(Double)); } - public unsafe static TraceLoggingTypeInfo Guid() { return new ScalarArrayTypeInfo(typeof(Guid), (f, t) => Statics.MakeDataType(TraceLoggingDataType.Guid, f), TraceLoggingDataType.Guid, sizeof(Guid)); } + public static unsafe TraceLoggingTypeInfo Guid() { return new ScalarArrayTypeInfo(typeof(Guid), (f, t) => Statics.MakeDataType(TraceLoggingDataType.Guid, f), TraceLoggingDataType.Guid, sizeof(Guid)); } } /// <summary> diff --git a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/UnsafeNativeMethods.cs b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/UnsafeNativeMethods.cs index 83a51f545e..fe3ae9d854 100644 --- a/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/UnsafeNativeMethods.cs +++ b/src/System.Diagnostics.Tracing/src/System/Diagnostics/Tracing/UnsafeNativeMethods.cs @@ -100,7 +100,7 @@ namespace Microsoft.Win32 [StructLayout(LayoutKind.Sequential)] - unsafe internal struct EVENT_FILTER_DESCRIPTOR + internal unsafe struct EVENT_FILTER_DESCRIPTOR { public long Ptr; public int Size; diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs index 5bbff01690..9757329e4b 100644 --- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs +++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs @@ -76,7 +76,7 @@ namespace SdtEventSources public void StartTrackingActivity() { WriteEvent(15); } [Event(17, Keywords = Keywords.Transfer | Keywords.HasStringArgs, Opcode = EventOpcode.Send, Task = Tasks.WorkItem)] - unsafe public void LogTaskScheduled(Guid RelatedActivityId, string message) + public unsafe void LogTaskScheduled(Guid RelatedActivityId, string message) { unsafe { diff --git a/src/System.Diagnostics.Tracing/tests/EvtSrcForReflection/EventSourceForReflection.cs b/src/System.Diagnostics.Tracing/tests/EvtSrcForReflection/EventSourceForReflection.cs index f64273b3b4..67aabe71ae 100644 --- a/src/System.Diagnostics.Tracing/tests/EvtSrcForReflection/EventSourceForReflection.cs +++ b/src/System.Diagnostics.Tracing/tests/EvtSrcForReflection/EventSourceForReflection.cs @@ -88,7 +88,7 @@ namespace EvtSrcForReflection public void StartTrackingActivity() { WriteEvent(15); } [Event(16, Keywords = Keywords.Transfer | Keywords.HasStringArgs, Opcode = EventOpcode.Send, Task = Tasks.WorkItem)] - unsafe public void LogTaskScheduled(Guid RelatedActivityId, string message) + public unsafe void LogTaskScheduled(Guid RelatedActivityId, string message) { unsafe { diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.method.regmethod.regclass.cs b/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.method.regmethod.regclass.cs index 942e13c90a..55a9e075ed 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.method.regmethod.regclass.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.method.regmethod.regclass.cs @@ -1564,7 +1564,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.context.method.regmetho namespace ManagedTests.DynamicCSharp.Conformance.dynamic.context.method.regmethod.regclass.regclass057.regclass057 { using ManagedTests.DynamicCSharp.Conformance.dynamic.context.method.regmethod.regclass.regclassregmeth.regclassregmeth; - // <Title> Tests regular class regular method used in unsafe static method body.</Title> + // <Title> Tests regular class regular method used in static unsafe method body.</Title> // <Description> // </Description> // <RelatedBugs></RelatedBugs> diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs b/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs index f7d9efaa29..eaddcc3175 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs @@ -5483,7 +5483,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.basic.unsfe // <Code> //class B //{ - //[Test][Priority(Priority.Priority2)]public void DynamicCSharpRunTest(){Assert.AreEqual(0, MainMethod());} public unsafe static int MainMethod() + //[Test][Priority(Priority.Priority2)]public void DynamicCSharpRunTest(){Assert.AreEqual(0, MainMethod());} public static unsafe int MainMethod() //{ ////basic alloc //dynamic y = 1; diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.overloadResolution.method.1class.2param.cs b/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.overloadResolution.method.1class.2param.cs index 7bf91038ba..9eef34e620 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.overloadResolution.method.1class.2param.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.overloadResolution.method.1class.2param.cs @@ -19,7 +19,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.overloadRes s_status = 1; } - internal protected void Method(long x, object o) + protected internal void Method(long x, object o) { s_status = 2; } @@ -66,7 +66,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.overloadRes s_status = 1; } - internal protected void Method(long x, object o) + protected internal void Method(long x, object o) { s_status = 2; } @@ -437,7 +437,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.overloadRes { } - internal protected void Method(long x, object o) + protected internal void Method(long x, object o) { } diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.Other/Conformance.dynamic.ClsCompliance.cs b/src/System.Dynamic.Runtime/tests/Dynamic.Other/Conformance.dynamic.ClsCompliance.cs index f4a6f0a994..8afc8b7d19 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.Other/Conformance.dynamic.ClsCompliance.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.Other/Conformance.dynamic.ClsCompliance.cs @@ -433,7 +433,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.ClsCompliance.namingchr public class MyClass2 : MyClass { - //static public dynamic[,,,] array1; //cube array + //public static dynamic[,,,] array1; //cube array private dynamic _classIdentifier; private dynamic MEthod01(int n, ref dynamic d) { @@ -460,7 +460,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.ClsCompliance.namingchr return default(object); } - internal protected dynamic method03(U x, ref V y, params dynamic[] ary) + protected internal dynamic method03(U x, ref V y, params dynamic[] ary) { return default(object); } diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.PointerOperator.cs b/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.PointerOperator.cs index 0eeb89a043..5be1c4415a 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.PointerOperator.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.PointerOperator.cs @@ -21,7 +21,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.PointegeregererOp [TestClass] - unsafe public class Test + public unsafe class Test { [Test] [Priority(Priority.Priority0)] @@ -65,7 +65,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.PointegeregererOp [TestClass] - unsafe public class Test + public unsafe class Test { [Test] [Priority(Priority.Priority0)] @@ -122,7 +122,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.PointegeregererOp // <Code> [TestClass] - unsafe public class Test + public unsafe class Test { [Test] [Priority(Priority.Priority1)] @@ -153,7 +153,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.PointegeregererOp // <Code> [TestClass] - unsafe public class Test + public unsafe class Test { [Test] [Priority(Priority.Priority1)] diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.basic.cs b/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.basic.cs index 9277bfdb10..9197e673a8 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.basic.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/Conformance.dynamic.unsafe.basic.cs @@ -146,7 +146,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.attribute01 } [MyAttr] - unsafe public class US + public unsafe class US { public int* p; } @@ -184,7 +184,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.collection0 //<Expects Status=warning>\(14,17\).*CS0649</Expects> using System.Collections.Generic; - unsafe public class US + public unsafe class US { public int* p; } @@ -225,7 +225,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.collection0 //<Expects Status=warning>\(14,17\).*CS0649</Expects> using System.Collections.Generic; - unsafe public class US + public unsafe class US { public int* p; } @@ -271,7 +271,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.collection0 using System.Collections.Generic; using Microsoft.CSharp.RuntimeBinder; - unsafe public class US + public unsafe class US { public int* p; } @@ -445,7 +445,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.dlgate01.dl //<Expects Status=success></Expects> // <Code> internal unsafe delegate void Foo(int* p); - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() @@ -518,7 +518,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.evnt01.evnt //<Expects Status=success></Expects> // <Code> internal unsafe delegate void Foo(int* p); - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() @@ -610,7 +610,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.expressiont public int* p; } - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() @@ -645,7 +645,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.field01.fie public class C { public unsafe int* p; - public unsafe static char* q; + public static unsafe char* q; } public unsafe class Test @@ -765,7 +765,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.indexer02.i public class C { public const int field = 10; - unsafe public int* this[int[] index] + public unsafe int* this[int[] index] { get { @@ -821,7 +821,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.indexer04.i // <Code> public class Unsafe { - unsafe public int* this[int index] + public unsafe int* this[int index] { get { @@ -882,14 +882,14 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.integereger void Foo(dynamic p); } - unsafe public class C : IF + public unsafe class C : IF { public void Foo(dynamic p) { } } - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() @@ -923,12 +923,12 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.lambda01.la //<Expects Status=warning>\(14,17\).*CS0649</Expects> using System; - unsafe public class UC + public unsafe class UC { public int* p; } - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() @@ -963,12 +963,12 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.lambda02.la //<Expects Status=warning>\(14,17\).*CS0649</Expects> using System; - unsafe public class UC + public unsafe class UC { public int* p; } - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() @@ -1010,12 +1010,12 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.method02.me // <Code> public class C { - unsafe public int Foo(dynamic p) + public unsafe int Foo(dynamic p) { return 1; } - unsafe public static int Bar(dynamic p) + public static unsafe int Bar(dynamic p) { return 2; } @@ -1057,12 +1057,12 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.method05.me public class C { public static int field = 10; - unsafe public dynamic Foo() + public unsafe dynamic Foo() { return 1; } - unsafe public static dynamic Bar() + public static unsafe dynamic Bar() { return 2; } @@ -1193,12 +1193,12 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.unsfe.basic.objinit01.o // <Code> using System.Collections.Generic; - unsafe public class US + public unsafe class US { public int* p; } - unsafe public class Test + public unsafe class Test { [Fact] public static void DynamicCSharpRunTest() diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/conformance.dynamic.unsafe.context.cs b/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/conformance.dynamic.unsafe.context.cs index a237f6b78f..18eac9d2ff 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/conformance.dynamic.unsafe.context.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.Unsafe/conformance.dynamic.unsafe.context.cs @@ -176,7 +176,7 @@ namespace ManagedTests.DynamicCSharp.conformance.dynamic.unsfe.context.freach03. //} //[TestClass]public class Test //{ - //[Test][Priority(Priority.Priority2)]public void DynamicCSharpRunTest(){Assert.AreEqual(0, MainMethod(null));} public unsafe static int MainMethod(string[] args) + //[Test][Priority(Priority.Priority2)]public void DynamicCSharpRunTest(){Assert.AreEqual(0, MainMethod(null));} public static unsafe int MainMethod(string[] args) //{ //int a = 1, b = 2, c = 3; //dynamic arrayp = new int*[] { &a, &b, &c }; diff --git a/src/System.IO.Compression/src/Interop/Interop.zlib.Unix.cs b/src/System.IO.Compression/src/Interop/Interop.zlib.Unix.cs index 94f3927338..fb6bfc3c17 100644 --- a/src/System.IO.Compression/src/Interop/Interop.zlib.Unix.cs +++ b/src/System.IO.Compression/src/Interop/Interop.zlib.Unix.cs @@ -40,6 +40,6 @@ internal static partial class Interop } [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")] - private static unsafe extern uint Crc32(uint crc, byte* buffer, int len); + private static extern unsafe uint Crc32(uint crc, byte* buffer, int len); } } diff --git a/src/System.IO.Compression/src/Interop/Interop.zlib.Windows.cs b/src/System.IO.Compression/src/Interop/Interop.zlib.Windows.cs index 23c5561801..15bcf21469 100644 --- a/src/System.IO.Compression/src/Interop/Interop.zlib.Windows.cs +++ b/src/System.IO.Compression/src/Interop/Interop.zlib.Windows.cs @@ -16,26 +16,26 @@ internal static partial class Interop private static readonly byte[] ZLibVersion = new byte[] { (byte)'1', (byte)'.', (byte)'2', (byte)'.', (byte)'3', 0 }; [DllImport(Libraries.Zlib)] - private extern unsafe static int deflateInit2_(byte* stream, int level, int method, int windowBits, int memLevel, int strategy, + private extern static unsafe int deflateInit2_(byte* stream, int level, int method, int windowBits, int memLevel, int strategy, byte* version, int stream_size); [DllImport(Libraries.Zlib)] - private extern unsafe static int deflate(byte* stream, int flush); + private extern static unsafe int deflate(byte* stream, int flush); [DllImport(Libraries.Zlib)] - private extern unsafe static int deflateEnd(byte* strm); + private extern static unsafe int deflateEnd(byte* strm); [DllImport(Libraries.Zlib)] - internal extern unsafe static uint crc32(uint crc, byte* buffer, int len); + internal extern static unsafe uint crc32(uint crc, byte* buffer, int len); [DllImport(Libraries.Zlib)] - private extern unsafe static int inflateInit2_(byte* stream, int windowBits, byte* version, int stream_size); + private extern static unsafe int inflateInit2_(byte* stream, int windowBits, byte* version, int stream_size); [DllImport(Libraries.Zlib)] - private extern unsafe static int inflate(byte* stream, int flush); + private extern static unsafe int inflate(byte* stream, int flush); [DllImport(Libraries.Zlib)] - private extern unsafe static int inflateEnd(byte* stream); + private extern static unsafe int inflateEnd(byte* stream); internal static unsafe ZLibNative.ErrorCode DeflateInit2_( ref ZLibNative.ZStream stream, diff --git a/src/System.IO.FileSystem/src/System/IO/FileStream.Win32.cs b/src/System.IO.FileSystem/src/System/IO/FileStream.Win32.cs index 09172a37b9..70a49d21bb 100644 --- a/src/System.IO.FileSystem/src/System/IO/FileStream.Win32.cs +++ b/src/System.IO.FileSystem/src/System/IO/FileStream.Win32.cs @@ -211,7 +211,7 @@ namespace System.IO return handle.IsAsync.HasValue ? handle.IsAsync.Value : false; } - private unsafe static Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(FileShare share) + private static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(FileShare share) { Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = default(Interop.Kernel32.SECURITY_ATTRIBUTES); if ((share & FileShare.Inheritable) != 0) @@ -895,7 +895,7 @@ namespace System.IO } } - unsafe private Task<int> ReadNativeAsync(byte[] bytes, int offset, int numBytes, int numBufferedBytesRead, CancellationToken cancellationToken) + private unsafe Task<int> ReadNativeAsync(byte[] bytes, int offset, int numBytes, int numBufferedBytesRead, CancellationToken cancellationToken) { AssertCanRead(bytes, offset, numBytes); Debug.Assert(_useAsyncIO, "ReadNativeAsync doesn't work on synchronous file streams!"); @@ -1648,7 +1648,7 @@ namespace System.IO } /// <summary>Overlapped callback: store the results, then invoke the continuation delegate.</summary> - internal unsafe static void IOCallback(uint errorCode, uint numBytes, NativeOverlapped* pOVERLAP) + internal static unsafe void IOCallback(uint errorCode, uint numBytes, NativeOverlapped* pOVERLAP) { var awaitable = (AsyncCopyToAwaitable)ThreadPoolBoundHandle.GetNativeOverlappedState(pOVERLAP); diff --git a/src/System.IO.FileSystem/src/System/IO/FileStreamCompletionSource.Win32.cs b/src/System.IO.FileSystem/src/System/IO/FileStreamCompletionSource.Win32.cs index db5f582d69..8aa1dd08a3 100644 --- a/src/System.IO.FileSystem/src/System/IO/FileStreamCompletionSource.Win32.cs +++ b/src/System.IO.FileSystem/src/System/IO/FileStreamCompletionSource.Win32.cs @@ -15,7 +15,7 @@ namespace System.IO // This is an internal object extending TaskCompletionSource with fields // for all of the relevant data necessary to complete the IO operation. // This is used by IOCallback and all of the async methods. - unsafe private sealed class FileStreamCompletionSource : TaskCompletionSource<int> + private unsafe sealed class FileStreamCompletionSource : TaskCompletionSource<int> { private const long NoResult = 0; private const long ResultSuccess = (long)1 << 32; diff --git a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs index 53141fbbf5..38d4d411ac 100644 --- a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs +++ b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs @@ -245,7 +245,7 @@ namespace System.IO.MemoryMappedFiles /// type. If pinningHandle is not null, caller must free it AFTER the call to CreateFile has returned. /// </summary> [SecurityCritical] - private unsafe static Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleInheritability inheritability) + private static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleInheritability inheritability) { Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = default(Interop.Kernel32.SECURITY_ATTRIBUTES); if ((inheritability & HandleInheritability.Inheritable) != 0) diff --git a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs index 5d2ca8c8dc..12207ff2c0 100644 --- a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs +++ b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs @@ -12,7 +12,7 @@ namespace System.IO.MemoryMappedFiles internal partial class MemoryMappedView { [SecurityCritical] - public unsafe static MemoryMappedView CreateView( + public static unsafe MemoryMappedView CreateView( SafeMemoryMappedFileHandle memMappedFileHandle, MemoryMappedFileAccess access, long requestedOffset, long requestedSize) { diff --git a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs index 0c27a8ac4d..711b40a0eb 100644 --- a/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs +++ b/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs @@ -18,7 +18,7 @@ namespace System.IO.MemoryMappedFiles private const int MaxFlushRetriesPerWait = 20; [SecurityCritical] - public unsafe static MemoryMappedView CreateView(SafeMemoryMappedFileHandle memMappedFileHandle, + public static unsafe MemoryMappedView CreateView(SafeMemoryMappedFileHandle memMappedFileHandle, MemoryMappedFileAccess access, long offset, long size) { // MapViewOfFile can only create views that start at a multiple of the system memory allocation diff --git a/src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs b/src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs index 6e39ec85de..840ba11513 100644 --- a/src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs +++ b/src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs @@ -429,7 +429,7 @@ namespace System.IO.Pipes } [SecurityCritical] - internal unsafe static Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleInheritability inheritability) + internal static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleInheritability inheritability) { Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = default(Interop.Kernel32.SECURITY_ATTRIBUTES); if ((inheritability & HandleInheritability.Inheritable) != 0) diff --git a/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseParser.cs b/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseParser.cs index 26dd7be98d..570ade6666 100644 --- a/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseParser.cs +++ b/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseParser.cs @@ -133,7 +133,7 @@ namespace System.Net.Http return result; } - public unsafe static bool GetResponseHeader( + public static unsafe bool GetResponseHeader( SafeWinHttpHandle requestHandle, uint infoLevel, ref char[] buffer, @@ -195,7 +195,7 @@ namespace System.Net.Http /// <summary> /// Fills the buffer with the header value and returns the length, or returns 0 if the header isn't found. /// </summary> - private unsafe static int GetResponseHeader(SafeWinHttpHandle requestHandle, uint infoLevel, char[] buffer) + private static unsafe int GetResponseHeader(SafeWinHttpHandle requestHandle, uint infoLevel, char[] buffer) { Debug.Assert(buffer != null, "buffer must not be null."); Debug.Assert(buffer.Length > 0, "buffer must not be empty."); @@ -226,7 +226,7 @@ namespace System.Net.Http /// <summary> /// Returns the size of the char array buffer. /// </summary> - private unsafe static int GetResponseHeaderCharBufferLength(SafeWinHttpHandle requestHandle, uint infoLevel) + private static unsafe int GetResponseHeaderCharBufferLength(SafeWinHttpHandle requestHandle, uint infoLevel) { char* buffer = null; int bufferLength = 0; @@ -247,7 +247,7 @@ namespace System.Net.Http return bufferLength; } - private unsafe static bool QueryHeaders( + private static unsafe bool QueryHeaders( SafeWinHttpHandle requestHandle, uint infoLevel, char* buffer, diff --git a/src/System.Net.HttpListener/src/System/Net/HttpListener.Windows.cs b/src/System.Net.HttpListener/src/System/Net/HttpListener.Windows.cs index 2b1d5c25e0..115e279cc8 100644 --- a/src/System.Net.HttpListener/src/System/Net/HttpListener.Windows.cs +++ b/src/System.Net.HttpListener/src/System/Net/HttpListener.Windows.cs @@ -1716,7 +1716,7 @@ namespace System.Net } } - private unsafe static int GetTokenOffsetFromBlob(IntPtr blob) + private static unsafe int GetTokenOffsetFromBlob(IntPtr blob) { Debug.Assert(blob != IntPtr.Zero); IntPtr tokenPointer = Marshal.ReadIntPtr((IntPtr)blob, (int)Marshal.OffsetOf(s_channelBindingStatusType, "ChannelToken")); @@ -1725,7 +1725,7 @@ namespace System.Net return (int)((long)tokenPointer - (long)blob); } - private unsafe static int GetTokenSizeFromBlob(IntPtr blob) + private static unsafe int GetTokenSizeFromBlob(IntPtr blob) { Debug.Assert(blob != IntPtr.Zero); return Marshal.ReadInt32(blob, (int)Marshal.OffsetOf(s_channelBindingStatusType, "ChannelTokenSize")); diff --git a/src/System.Net.HttpListener/src/System/Net/ListenerClientCertAsyncResult.cs b/src/System.Net.HttpListener/src/System/Net/ListenerClientCertAsyncResult.cs index 6a0624750a..82a32627a3 100644 --- a/src/System.Net.HttpListener/src/System/Net/ListenerClientCertAsyncResult.cs +++ b/src/System.Net.HttpListener/src/System/Net/ListenerClientCertAsyncResult.cs @@ -10,7 +10,7 @@ using System.Threading; namespace System.Net { - unsafe internal class ListenerClientCertAsyncResult : LazyAsyncResult + internal unsafe class ListenerClientCertAsyncResult : LazyAsyncResult { private ThreadPoolBoundHandle _boundHandle; private NativeOverlapped* _pOverlapped; diff --git a/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs b/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs index c93b49acab..406cfd0624 100644 --- a/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs +++ b/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs @@ -26,7 +26,7 @@ namespace System.Net.NetworkInformation _ipProperties = new LinuxIPInterfaceProperties(this); } - public unsafe static NetworkInterface[] GetLinuxNetworkInterfaces() + public static unsafe NetworkInterface[] GetLinuxNetworkInterfaces() { Dictionary<string, LinuxNetworkInterface> interfacesByName = new Dictionary<string, LinuxNetworkInterface>(); List<Exception> exceptions = null; diff --git a/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Windows.cs b/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Windows.cs index 041bcf2fd0..772b6b0fce 100644 --- a/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Windows.cs +++ b/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Windows.cs @@ -122,7 +122,7 @@ namespace System.Net.NetworkInformation } // Helper class for detecting address change events. - internal unsafe static class AddressChangeListener + internal static unsafe class AddressChangeListener { private static readonly Dictionary<NetworkAddressChangedEventHandler, ExecutionContext> s_callerArray = new Dictionary<NetworkAddressChangedEventHandler, ExecutionContext>(); diff --git a/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/OsxNetworkInterface.cs b/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/OsxNetworkInterface.cs index 492cf3dd02..3597744960 100644 --- a/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/OsxNetworkInterface.cs +++ b/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/OsxNetworkInterface.cs @@ -24,7 +24,7 @@ namespace System.Net.NetworkInformation _ipProperties = new OsxIpInterfaceProperties(this, (int)nativeStats.Mtu); } - public unsafe static NetworkInterface[] GetOsxNetworkInterfaces() + public static unsafe NetworkInterface[] GetOsxNetworkInterfaces() { Dictionary<string, OsxNetworkInterface> interfacesByName = new Dictionary<string, OsxNetworkInterface>(); List<Exception> exceptions = null; diff --git a/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs b/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs index 198fd270da..0015de2e03 100644 --- a/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs +++ b/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs @@ -290,7 +290,7 @@ namespace System.Net.Security return SecurityStatusAdapterPal.GetSecurityStatusPalFromInterop(errorCode, attachException:true); } - public unsafe static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(SafeDeleteContext securityContext, ChannelBindingKind attribute) + public static unsafe SafeFreeContextBufferChannelBinding QueryContextChannelBinding(SafeDeleteContext securityContext, ChannelBindingKind attribute) { return SSPIWrapper.QueryContextChannelBinding(GlobalSSPI.SSPISecureChannel, securityContext, (Interop.SspiCli.ContextAttribute)attribute); } diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/BaseOverlappedAsyncResult.Windows.cs b/src/System.Net.Sockets/src/System/Net/Sockets/BaseOverlappedAsyncResult.Windows.cs index ad44d26620..c51a5ca1c7 100644 --- a/src/System.Net.Sockets/src/System/Net/Sockets/BaseOverlappedAsyncResult.Windows.cs +++ b/src/System.Net.Sockets/src/System/Net/Sockets/BaseOverlappedAsyncResult.Windows.cs @@ -21,7 +21,7 @@ namespace System.Net.Sockets private SafeNativeOverlapped _nativeOverlapped; // The WinNT Completion Port callback. - private unsafe static readonly IOCompletionCallback s_ioCallback = new IOCompletionCallback(CompletionPortCallback); + private static unsafe readonly IOCompletionCallback s_ioCallback = new IOCompletionCallback(CompletionPortCallback); internal BaseOverlappedAsyncResult(Socket socket, Object asyncState, AsyncCallback asyncCallback) : base(socket, asyncState, asyncCallback) @@ -69,7 +69,7 @@ namespace System.Net.Sockets } } - private unsafe static void CompletionPortCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) + private static unsafe void CompletionPortCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) { #if DEBUG DebugThreadTracking.SetThreadSource(ThreadKinds.CompletionPort); diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Unix.cs b/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Unix.cs index 6af19ad1fc..45f44b9f1f 100644 --- a/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Unix.cs +++ b/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Unix.cs @@ -6,7 +6,7 @@ using System.Diagnostics; namespace System.Net.Sockets { - unsafe internal sealed partial class ReceiveMessageOverlappedAsyncResult : BaseOverlappedAsyncResult + internal unsafe sealed partial class ReceiveMessageOverlappedAsyncResult : BaseOverlappedAsyncResult { private int _socketAddressSize; diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Windows.cs b/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Windows.cs index 321b07e8d1..eb6fb632d7 100644 --- a/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Windows.cs +++ b/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.Windows.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; namespace System.Net.Sockets { - unsafe internal sealed partial class ReceiveMessageOverlappedAsyncResult : BaseOverlappedAsyncResult + internal unsafe sealed partial class ReceiveMessageOverlappedAsyncResult : BaseOverlappedAsyncResult { private Interop.Winsock.WSAMsg* _message; private WSABuffer* _wsaBuffer; @@ -99,7 +99,7 @@ namespace System.Net.Sockets _message->flags = socketFlags; } - unsafe private void InitIPPacketInformation() + private unsafe void InitIPPacketInformation() { IPAddress address = null; diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.cs b/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.cs index 11d95ade05..8a5298f96c 100644 --- a/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.cs +++ b/src/System.Net.Sockets/src/System/Net/Sockets/ReceiveMessageOverlappedAsyncResult.cs @@ -11,7 +11,7 @@ using System.Collections.Generic; namespace System.Net.Sockets { - unsafe internal sealed partial class ReceiveMessageOverlappedAsyncResult : BaseOverlappedAsyncResult + internal unsafe sealed partial class ReceiveMessageOverlappedAsyncResult : BaseOverlappedAsyncResult { private Internals.SocketAddress _socketAddressOriginal; private Internals.SocketAddress _socketAddress; diff --git a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs b/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs index c0c5ef6cfd..d8c3ef787c 100644 --- a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs +++ b/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs @@ -882,7 +882,7 @@ namespace System.Net.Sockets } // Sets up an Overlapped object with either _buffer or _acceptBuffer pinned. - unsafe private void SetupOverlappedSingle(bool pinSingleBuffer) + private unsafe void SetupOverlappedSingle(bool pinSingleBuffer) { // Pin buffer, get native pointers, and fill in WSABuffer descriptor. if (pinSingleBuffer) @@ -929,7 +929,7 @@ namespace System.Net.Sockets } // Sets up an Overlapped object with multiple buffers pinned. - unsafe private void SetupOverlappedMultiple() + private unsafe void SetupOverlappedMultiple() { ArraySegment<byte>[] tempList = new ArraySegment<byte>[_bufferList.Count]; _bufferList.CopyTo(tempList, 0); @@ -967,7 +967,7 @@ namespace System.Net.Sockets } // Sets up an Overlapped object for SendPacketsAsync. - unsafe private void SetupOverlappedSendPackets() + private unsafe void SetupOverlappedSendPackets() { int index; diff --git a/src/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs b/src/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs index fdc11d1921..c01c2a71e1 100644 --- a/src/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs +++ b/src/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs @@ -53,7 +53,7 @@ namespace System.Text return !(v3 == 64 && v4 != 64); } - unsafe public override int GetByteCount(char[] chars, int index, int count) + public unsafe override int GetByteCount(char[] chars, int index, int count) { if (chars == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(chars))); @@ -107,7 +107,7 @@ namespace System.Text } } - unsafe public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + public unsafe override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { if (chars == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(chars))); @@ -186,7 +186,7 @@ namespace System.Text } } - unsafe public virtual int GetBytes(byte[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + public unsafe virtual int GetBytes(byte[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { if (chars == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(chars))); @@ -274,7 +274,7 @@ namespace System.Text return GetMaxCharCount(count); } - unsafe public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) + public unsafe override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { if (bytes == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(bytes))); @@ -363,7 +363,7 @@ namespace System.Text return charCount; } - unsafe public int GetChars(byte[] bytes, int byteIndex, int byteCount, byte[] chars, int charIndex) + public unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, byte[] chars, int charIndex) { if (bytes == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(bytes))); diff --git a/src/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs b/src/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs index 4e43450060..c89012898e 100644 --- a/src/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs +++ b/src/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs @@ -45,7 +45,7 @@ namespace System.Text return GetMaxByteCount(count); } - unsafe public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + public unsafe override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { if (chars == null) throw new ArgumentNullException(nameof(chars)); @@ -115,7 +115,7 @@ namespace System.Text return GetMaxCharCount(count); } - unsafe public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) + public unsafe override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { if (bytes == null) throw new ArgumentNullException(nameof(bytes)); diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/UniqueId.cs b/src/System.Private.DataContractSerialization/src/System/Xml/UniqueId.cs index 07b1523cf1..0c2a6a8ed7 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/UniqueId.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/UniqueId.cs @@ -63,7 +63,7 @@ namespace System.Xml { } - unsafe public UniqueId(byte[] guid, int offset) + public unsafe UniqueId(byte[] guid, int offset) { if (guid == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(guid))); @@ -80,7 +80,7 @@ namespace System.Xml } } - unsafe public UniqueId(string value) + public unsafe UniqueId(string value) { if (value == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); @@ -93,7 +93,7 @@ namespace System.Xml _s = value; } - unsafe public UniqueId(char[] chars, int offset, int count) + public unsafe UniqueId(char[] chars, int offset, int count) { if (chars == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(chars))); @@ -199,7 +199,7 @@ namespace System.Xml } } - unsafe public int ToCharArray(char[] chars, int offset) + public unsafe int ToCharArray(char[] chars, int offset) { int count = CharArrayLength; @@ -280,7 +280,7 @@ namespace System.Xml return true; } - unsafe public bool TryGetGuid(byte[] buffer, int offset) + public unsafe bool TryGetGuid(byte[] buffer, int offset) { if (!IsGuid) return false; @@ -305,7 +305,7 @@ namespace System.Xml return true; } - unsafe public override string ToString() + public unsafe override string ToString() { if (_s == null) { diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs index 82e3224245..17d6baa8b4 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs @@ -603,7 +603,7 @@ namespace System.Xml } } - unsafe public override void WriteText(string value) + public unsafe override void WriteText(string value) { if (_inAttribute) { @@ -625,7 +625,7 @@ namespace System.Xml } } - unsafe public override void WriteText(char[] chars, int offset, int count) + public unsafe override void WriteText(char[] chars, int offset, int count) { if (_inAttribute) { @@ -747,7 +747,7 @@ namespace System.Xml } } - unsafe public override void WriteFloatText(float f) + public unsafe override void WriteFloatText(float f) { long l; if (f >= long.MinValue && f <= long.MaxValue && (l = (long)f) == f) @@ -768,7 +768,7 @@ namespace System.Xml } } - unsafe public override void WriteDoubleText(double d) + public unsafe override void WriteDoubleText(double d) { float f; if (d >= float.MinValue && d <= float.MaxValue && (f = (float)d) == d) @@ -793,7 +793,7 @@ namespace System.Xml } } - unsafe public override void WriteDecimalText(decimal d) + public unsafe override void WriteDecimalText(decimal d) { int offset; byte[] buffer = GetTextNodeBuffer(1 + sizeof(decimal), out offset); @@ -891,7 +891,7 @@ namespace System.Xml WriteMultiByteInt32(count); } - unsafe public void UnsafeWriteArray(XmlBinaryNodeType nodeType, int count, byte* array, byte* arrayMax) + public unsafe void UnsafeWriteArray(XmlBinaryNodeType nodeType, int count, byte* array, byte* arrayMax) { WriteArrayInfo(nodeType, count); UnsafeWriteArray(array, (int)(arrayMax - array)); @@ -1220,7 +1220,7 @@ namespace System.Xml throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset))); } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, bool[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, bool[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1234,7 +1234,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1248,7 +1248,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, Int16[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, Int16[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1262,7 +1262,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Int16[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Int16[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1276,7 +1276,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, Int32[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, Int32[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1290,7 +1290,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Int32[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Int32[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1304,7 +1304,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, Int64[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, Int64[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1318,7 +1318,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Int64[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Int64[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1332,7 +1332,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, float[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, float[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1346,7 +1346,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1360,7 +1360,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, double[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, double[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1374,7 +1374,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1388,7 +1388,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, string localName, string namespaceUri, decimal[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, string localName, string namespaceUri, decimal[] array, int offset, int count) { { CheckArray(array, offset, count); @@ -1402,7 +1402,7 @@ namespace System.Xml } } - unsafe public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal[] array, int offset, int count) + public unsafe override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal[] array, int offset, int count) { { CheckArray(array, offset, count); diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs index d8b77b702b..1891fcf49f 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs @@ -389,7 +389,7 @@ namespace System.Xml return (hi << 32) + lo; } - unsafe public float ReadSingle() + public unsafe float ReadSingle() { int offset; byte[] buffer = GetBuffer(ValueHandleLength.Single, out offset); @@ -404,7 +404,7 @@ namespace System.Xml return value; } - unsafe public double ReadDouble() + public unsafe double ReadDouble() { int offset; byte[] buffer = GetBuffer(ValueHandleLength.Double, out offset); @@ -423,7 +423,7 @@ namespace System.Xml return value; } - unsafe public decimal ReadDecimal() + public unsafe decimal ReadDecimal() { int offset; byte[] buffer = GetBuffer(ValueHandleLength.Decimal, out offset); @@ -508,7 +508,7 @@ namespace System.Xml return value; } - unsafe public void UnsafeReadArray(byte* dst, byte* dstMax) + public unsafe void UnsafeReadArray(byte* dst, byte* dstMax) { UnsafeReadArray(dst, (int)(dstMax - dst)); } @@ -921,7 +921,7 @@ namespace System.Xml return true; } - unsafe public bool Equals2(int offset1, int length1, string s2) + public unsafe bool Equals2(int offset1, int length1, string s2) { int byteLength = length1; int charLength = s2.Length; @@ -1039,7 +1039,7 @@ namespace System.Xml return (ulong)GetInt64(offset); } - unsafe public float GetSingle(int offset) + public unsafe float GetSingle(int offset) { byte[] buffer = _buffer; float value; @@ -1052,7 +1052,7 @@ namespace System.Xml return value; } - unsafe public double GetDouble(int offset) + public unsafe double GetDouble(int offset) { byte[] buffer = _buffer; double value; diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlStreamNodeWriter.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlStreamNodeWriter.cs index 6d8ea6c2e7..ea071160d5 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlStreamNodeWriter.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlStreamNodeWriter.cs @@ -243,7 +243,7 @@ namespace System.Xml } } - unsafe protected void UnsafeWriteBytes(byte* bytes, int byteCount) + protected unsafe void UnsafeWriteBytes(byte* bytes, int byteCount) { FlushBuffer(); byte[] buffer = _buffer; @@ -262,7 +262,7 @@ namespace System.Xml } } - unsafe protected void WriteUTF8Char(int ch) + protected unsafe void WriteUTF8Char(int ch) { if (ch < 0x80) { @@ -300,7 +300,7 @@ namespace System.Xml } } - unsafe protected void WriteUTF8Chars(string value) + protected unsafe void WriteUTF8Chars(string value) { int count = value.Length; if (count > 0) @@ -312,7 +312,7 @@ namespace System.Xml } } - unsafe protected void UnsafeWriteUTF8Chars(char* chars, int charCount) + protected unsafe void UnsafeWriteUTF8Chars(char* chars, int charCount) { const int charChunkSize = bufferLength / maxBytesPerChar; while (charCount > charChunkSize) @@ -334,7 +334,7 @@ namespace System.Xml } } - unsafe protected void UnsafeWriteUnicodeChars(char* chars, int charCount) + protected unsafe void UnsafeWriteUnicodeChars(char* chars, int charCount) { const int charChunkSize = bufferLength / 2; while (charCount > charChunkSize) @@ -356,7 +356,7 @@ namespace System.Xml } } - unsafe protected int UnsafeGetUnicodeChars(char* chars, int charCount, byte[] buffer, int offset) + protected unsafe int UnsafeGetUnicodeChars(char* chars, int charCount, byte[] buffer, int offset) { char* charsMax = chars + charCount; while (chars < charsMax) @@ -369,7 +369,7 @@ namespace System.Xml return charCount * 2; } - unsafe protected int UnsafeGetUTF8Length(char* chars, int charCount) + protected unsafe int UnsafeGetUTF8Length(char* chars, int charCount) { char* charsMax = chars + charCount; while (chars < charsMax) @@ -391,7 +391,7 @@ namespace System.Xml return (int)(chars - (charsMax - charCount)) + GetByteCount(chArray); } - unsafe protected int UnsafeGetUTF8Chars(char* chars, int charCount, byte[] buffer, int offset) + protected unsafe int UnsafeGetUTF8Chars(char* chars, int charCount, byte[] buffer, int offset) { if (charCount > 0) { diff --git a/src/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs b/src/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs index b2f20a6360..d5300c0a42 100644 --- a/src/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs +++ b/src/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs @@ -435,7 +435,7 @@ namespace System.Xml WriteEscapedText(s.Value); } - unsafe public override void WriteEscapedText(string s) + public unsafe override void WriteEscapedText(string s) { int count = s.Length; if (count > 0) @@ -447,7 +447,7 @@ namespace System.Xml } } - unsafe public override void WriteEscapedText(char[] s, int offset, int count) + public unsafe override void WriteEscapedText(char[] s, int offset, int count) { if (count > 0) { @@ -518,7 +518,7 @@ namespace System.Xml WriteUTF8Chars(chars, offset, count); } - unsafe public override void WriteText(char[] chars, int offset, int count) + public unsafe override void WriteText(char[] chars, int offset, int count) { if (count > 0) { diff --git a/src/System.Private.Uri/src/System/DomainNameHelper.cs b/src/System.Private.Uri/src/System/DomainNameHelper.cs index 0231c3a9c3..cfc31d61f1 100644 --- a/src/System.Private.Uri/src/System/DomainNameHelper.cs +++ b/src/System.Private.Uri/src/System/DomainNameHelper.cs @@ -67,7 +67,7 @@ namespace System // MUST NOT be used unless all input indexes are verified and trusted. // - internal unsafe static bool IsValid(char* name, ushort pos, ref int returnedEnd, ref bool notCanonical, bool notImplicitFile) + internal static unsafe bool IsValid(char* name, ushort pos, ref int returnedEnd, ref bool notCanonical, bool notImplicitFile) { char* curPos = name + pos; char* newPos = curPos; @@ -130,7 +130,7 @@ namespace System // There are pretty much no restrictions and we effectively return the end of the // domain name. // - internal unsafe static bool IsValidByIri(char* name, ushort pos, ref int returnedEnd, ref bool notCanonical, bool notImplicitFile) + internal static unsafe bool IsValidByIri(char* name, ushort pos, ref int returnedEnd, ref bool notCanonical, bool notImplicitFile) { char* curPos = name + pos; char* newPos = curPos; @@ -217,7 +217,7 @@ namespace System // // Will convert a host name into its idn equivalent + tell you if it had a valid idn label // - internal unsafe static string IdnEquivalent(char* hostname, int start, int end, ref bool allAscii, ref bool atLeastOneValidIdn) + internal static unsafe string IdnEquivalent(char* hostname, int start, int end, ref bool allAscii, ref bool atLeastOneValidIdn) { string bidiStrippedHost = null; string idnEquivalent = IdnEquivalent(hostname, start, end, ref allAscii, ref bidiStrippedHost); @@ -297,7 +297,7 @@ namespace System // // Will convert a host name into its idn equivalent // - internal unsafe static string IdnEquivalent(char* hostname, int start, int end, ref bool allAscii, ref string bidiStrippedHost) + internal static unsafe string IdnEquivalent(char* hostname, int start, int end, ref bool allAscii, ref string bidiStrippedHost) { string idn = null; if (end <= start) @@ -343,7 +343,7 @@ namespace System } } - private unsafe static bool IsIdnAce(string input, int index) + private static unsafe bool IsIdnAce(string input, int index) { if ((input[index] == 'x') && (input[index + 1] == 'n') && @@ -354,7 +354,7 @@ namespace System return false; } - private unsafe static bool IsIdnAce(char* input, int index) + private static unsafe bool IsIdnAce(char* input, int index) { if ((input[index] == 'x') && (input[index + 1] == 'n') && @@ -368,7 +368,7 @@ namespace System // // Will convert a host name into its unicode equivalent expanding any existing idn names present // - internal unsafe static string UnicodeEquivalent(string idnHost, char* hostname, int start, int end) + internal static unsafe string UnicodeEquivalent(string idnHost, char* hostname, int start, int end) { IdnMapping map = new IdnMapping(); @@ -388,7 +388,7 @@ namespace System return UnicodeEquivalent(hostname, start, end, ref dummy, ref dummy); } - internal unsafe static string UnicodeEquivalent(char* hostname, int start, int end, ref bool allAscii, ref bool atLeastOneValidIdn) + internal static unsafe string UnicodeEquivalent(char* hostname, int start, int end, ref bool allAscii, ref bool atLeastOneValidIdn) { IdnMapping map = new IdnMapping(); diff --git a/src/System.Private.Uri/src/System/IPv4AddressHelper.cs b/src/System.Private.Uri/src/System/IPv4AddressHelper.cs index 3f4410ba6f..3d4cbcd216 100644 --- a/src/System.Private.Uri/src/System/IPv4AddressHelper.cs +++ b/src/System.Private.Uri/src/System/IPv4AddressHelper.cs @@ -84,7 +84,7 @@ namespace System // //Remark: MUST NOT be used unless all input indexes are verified and trusted. - internal unsafe static bool IsValid(char* name, int start, ref int end, bool allowIPv6, bool notImplicitFile, bool unknownScheme) + internal static unsafe bool IsValid(char* name, int start, ref int end, bool allowIPv6, bool notImplicitFile, bool unknownScheme) { // IPv6 can only have canonical IPv4 embedded. Unknown schemes will not attempt parsing of non-canonical IPv4 addresses. if (allowIPv6 || unknownScheme) @@ -110,7 +110,7 @@ namespace System // / "2" %x30-34 DIGIT ; 200-249 // / "25" %x30-35 ; 250-255 // - internal unsafe static bool IsValidCanonical(char* name, int start, ref int end, bool allowIPv6, bool notImplicitFile) + internal static unsafe bool IsValidCanonical(char* name, int start, ref int end, bool allowIPv6, bool notImplicitFile) { int dots = 0; int number = 0; @@ -180,7 +180,7 @@ namespace System // Return Invalid (-1) for failures. // If the address has less than three dots, only the rightmost section is assumed to contain the combined value for // the missing sections: 0xFF00FFFF == 0xFF.0x00.0xFF.0xFF == 0xFF.0xFFFF - internal unsafe static long ParseNonCanonical(char* name, int start, ref int end, bool notImplicitFile) + internal static unsafe long ParseNonCanonical(char* name, int start, ref int end, bool notImplicitFile) { int numberBase = Decimal; char ch; @@ -328,7 +328,7 @@ namespace System // // Convert this IPv4 address into a sequence of 4 8-bit numbers // - unsafe private static bool Parse(string name, byte* numbers, int start, int end) + private static unsafe bool Parse(string name, byte* numbers, int start, int end) { fixed (char* ipString = name) { @@ -351,7 +351,7 @@ namespace System // of 8-bit numbers and the characters '.' // Address may terminate with ':' or with the end of the string // - unsafe private static bool ParseCanonical(string name, byte* numbers, int start, int end) + private static unsafe bool ParseCanonical(string name, byte* numbers, int start, int end) { for (int i = 0; i < NumberOfLabels; ++i) { diff --git a/src/System.Private.Uri/src/System/IPv6AddressHelper.cs b/src/System.Private.Uri/src/System/IPv6AddressHelper.cs index 86ecf79f86..991b977e62 100644 --- a/src/System.Private.Uri/src/System/IPv6AddressHelper.cs +++ b/src/System.Private.Uri/src/System/IPv6AddressHelper.cs @@ -35,7 +35,7 @@ namespace System } } - internal unsafe static string CreateCanonicalName(ushort* numbers) + internal static unsafe string CreateCanonicalName(ushort* numbers) { // RFC 5952 Sections 4 & 5 - Compressed, lower case, with possible embedded IPv4 addresses. @@ -83,7 +83,7 @@ namespace System // Longest consecutive sequence of zero segments, minimum 2. // On equal, first sequence wins. // <-1, -1> for no compression. - private unsafe static KeyValuePair<int, int> FindCompressionRange(ushort* numbers) + private static unsafe KeyValuePair<int, int> FindCompressionRange(ushort* numbers) { int longestSequenceLength = 0; int longestSequenceStart = -1; @@ -117,7 +117,7 @@ namespace System // Returns true if the IPv6 address should be formated with an embedded IPv4 address: // ::192.168.1.1 - private unsafe static bool ShouldHaveIpv4Embedded(ushort* numbers) + private static unsafe bool ShouldHaveIpv4Embedded(ushort* numbers) { // 0:0 : 0:0 : x:x : x.x.x.x if (numbers[0] == 0 && numbers[1] == 0 && numbers[2] == 0 && numbers[3] == 0 && numbers[6] != 0) @@ -175,7 +175,7 @@ namespace System // Remarks: MUST NOT be used unless all input indexes are verified and trusted. // start must be next to '[' position, or error is reported - unsafe private static bool InternalIsValid(char* name, int start, ref int end, bool validateStrictAddress) + private static unsafe bool InternalIsValid(char* name, int start, ref int end, bool validateStrictAddress) { int sequenceCount = 0; int sequenceLength = 0; @@ -346,7 +346,7 @@ namespace System // Remarks: MUST NOT be used unless all input indexes are verified and trusted. // start must be next to '[' position, or error is reported - internal unsafe static bool IsValid(char* name, int start, ref int end) + internal static unsafe bool IsValid(char* name, int start, ref int end) { return InternalIsValid(name, start, ref end, false); } @@ -383,7 +383,7 @@ namespace System // Remarks: MUST NOT be used unless all input indexes are verified and trusted. // start must be next to '[' position, or error is reported - internal unsafe static bool IsValidStrict(char* name, int start, ref int end) + internal static unsafe bool IsValidStrict(char* name, int start, ref int end) { return InternalIsValid(name, start, ref end, true); } @@ -416,7 +416,7 @@ namespace System // Nothing // - unsafe internal static bool Parse(string address, ushort* numbers, int start, ref string scopeId) + internal static unsafe bool Parse(string address, ushort* numbers, int start, ref string scopeId) { int number = 0; int index = 0; diff --git a/src/System.Private.Uri/src/System/UncNameHelper.cs b/src/System.Private.Uri/src/System/UncNameHelper.cs index b3dfab2802..26cec9d303 100644 --- a/src/System.Private.Uri/src/System/UncNameHelper.cs +++ b/src/System.Private.Uri/src/System/UncNameHelper.cs @@ -49,7 +49,7 @@ namespace System // // Assumption is the caller will check on the resulting name length // Remarks: MUST NOT be used unless all input indexes are verified and trusted. - internal unsafe static bool IsValid(char* name, ushort start, ref int returnedEnd, bool notImplicitFile) + internal static unsafe bool IsValid(char* name, ushort start, ref int returnedEnd, bool notImplicitFile) { ushort end = (ushort)returnedEnd; diff --git a/src/System.Private.Uri/src/System/Uri.cs b/src/System.Private.Uri/src/System/Uri.cs index e61b5b9337..0b49658d66 100644 --- a/src/System.Private.Uri/src/System/Uri.cs +++ b/src/System.Private.Uri/src/System/Uri.cs @@ -538,7 +538,7 @@ namespace System // The assumptions: // - baseUri is a valid absolute Uri // - relative part is not null and not empty - private unsafe static ParsingError GetCombinedString(Uri baseUri, string relativeStr, + private static unsafe ParsingError GetCombinedString(Uri baseUri, string relativeStr, bool dontEscape, ref string result) { // NB: This is not RFC2396 compliant although it is inline with w3c.org recommendations @@ -1944,7 +1944,7 @@ namespace System return (index >= 0 && uriString[index] == ':'); } - internal unsafe static string InternalEscapeString(string rawString) + internal static unsafe string InternalEscapeString(string rawString) { if ((object)rawString == null) return string.Empty; @@ -3615,7 +3615,7 @@ namespace System // returns the start of the next component position // throws UriFormatException if invalid scheme // - unsafe private static ushort ParseSchemeCheckImplicitFile(char* uriString, ushort length, + private static unsafe ushort ParseSchemeCheckImplicitFile(char* uriString, ushort length, ref ParsingError err, ref Flags flags, ref UriParser syntax) { ushort idx = 0; @@ -3730,7 +3730,7 @@ namespace System // // Quickly parses well known schemes. // nChars does not include the last ':'. Assuming there is one at the end of passed buffer - unsafe private static bool CheckKnownSchemes(long* lptr, ushort nChars, ref UriParser syntax) + private static unsafe bool CheckKnownSchemes(long* lptr, ushort nChars, ref UriParser syntax) { //NOTE beware of too short input buffers! @@ -3885,7 +3885,7 @@ namespace System // // This will check whether a scheme string follows the rules // - unsafe private static ParsingError CheckSchemeSyntax(char* ptr, ushort length, ref UriParser syntax) + private static unsafe ParsingError CheckSchemeSyntax(char* ptr, ushort length, ref UriParser syntax) { //First character must be an alpha { @@ -4830,7 +4830,7 @@ namespace System } // works only with ASCII characters, used to partially unescape path before compressing - private unsafe static void UnescapeOnly(char* pch, int start, ref int end, char ch1, char ch2, char ch3) + private static unsafe void UnescapeOnly(char* pch, int start, ref int end, char ch1, char ch2, char ch3) { if (end - start < 3) { diff --git a/src/System.Private.Uri/src/System/UriHelper.cs b/src/System.Private.Uri/src/System/UriHelper.cs index ce0039efe8..6a7715c718 100644 --- a/src/System.Private.Uri/src/System/UriHelper.cs +++ b/src/System.Private.Uri/src/System/UriHelper.cs @@ -125,7 +125,7 @@ namespace System private const short c_MaxUnicodeCharsReallocate = 40; private const short c_MaxUTF_8BytesPerUnicodeChar = 4; private const short c_EncodedCharsPerByte = 3; - internal unsafe static char[] EscapeString(string input, int start, int end, char[] dest, ref int destPos, + internal static unsafe char[] EscapeString(string input, int start, int end, char[] dest, ref int destPos, bool isUriString, char force1, char force2, char rsvd) { if (end - start >= Uri.c_MaxUriBufferSize) @@ -229,7 +229,7 @@ namespace System // // ensure destination array has enough space and contains all the needed input stuff // - private unsafe static char[] EnsureDestinationSize(char* pStr, char[] dest, int currentInputPos, + private static unsafe char[] EnsureDestinationSize(char* pStr, char[] dest, int currentInputPos, short charsToAdd, short minReallocateChars, ref int destPos, int prevInputPos) { if ((object)dest == null || dest.Length < destPos + (currentInputPos - prevInputPos) + charsToAdd) @@ -259,7 +259,7 @@ namespace System // - It is a RARE case when Unescape actually needs escaping some characters mentioned above. // For this reason it returns a char[] that is usually the same ref as the input "dest" value. // - internal unsafe static char[] UnescapeString(string input, int start, int end, char[] dest, + internal static unsafe char[] UnescapeString(string input, int start, int end, char[] dest, ref int destPosition, char rsvd1, char rsvd2, char rsvd3, UnescapeMode unescapeMode, UriParser syntax, bool isQuery) { @@ -269,7 +269,7 @@ namespace System syntax, isQuery); } } - internal unsafe static char[] UnescapeString(char* pStr, int start, int end, char[] dest, ref int destPosition, + internal static unsafe char[] UnescapeString(char* pStr, int start, int end, char[] dest, ref int destPosition, char rsvd1, char rsvd2, char rsvd3, UnescapeMode unescapeMode, UriParser syntax, bool isQuery) { byte[] bytes = null; diff --git a/src/System.Private.Xml/src/System/Xml/Dom/XmlDocument.cs b/src/System.Private.Xml/src/System/Xml/Dom/XmlDocument.cs index 62c6a3869b..ff866e734b 100644 --- a/src/System.Private.Xml/src/System/Xml/Dom/XmlDocument.cs +++ b/src/System.Private.Xml/src/System/Xml/Dom/XmlDocument.cs @@ -692,7 +692,7 @@ namespace System.Xml return CreateNavigator(this); } - internal protected virtual XPathNavigator CreateNavigator(XmlNode node) + protected internal virtual XPathNavigator CreateNavigator(XmlNode node) { XmlNodeType nodeType = node.NodeType; XmlNode parent; diff --git a/src/System.Private.Xml/src/System/Xml/XmlCharType.cs b/src/System.Private.Xml/src/System/Xml/XmlCharType.cs index 39b60d79e2..e02c40c1db 100644 --- a/src/System.Private.Xml/src/System/Xml/XmlCharType.cs +++ b/src/System.Private.Xml/src/System/Xml/XmlCharType.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; namespace System.Xml { - unsafe internal struct XmlCharType + internal unsafe struct XmlCharType { // Surrogate constants internal const int SurHighStart = 0xd800; // 1101 10xx diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs index 8ca7619649..792fb478d4 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/BlobUtilities.cs @@ -11,7 +11,7 @@ using System.Runtime.InteropServices; namespace System.Reflection { - internal unsafe static class BlobUtilities + internal static unsafe class BlobUtilities { public static byte[] ReadBytes(byte* buffer, int byteCount) { @@ -226,7 +226,7 @@ namespace System.Reflection } } - internal unsafe static int GetUTF8ByteCount(string str) + internal static unsafe int GetUTF8ByteCount(string str) { fixed (char* ptr = str) { @@ -234,7 +234,7 @@ namespace System.Reflection } } - internal unsafe static int GetUTF8ByteCount(char* str, int charCount) + internal static unsafe int GetUTF8ByteCount(char* str, int charCount) { char* remainder; return GetUTF8ByteCount(str, charCount, int.MaxValue, out remainder); diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/EncodingHelper.cs b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/EncodingHelper.cs index 62c27fa3ae..06371b7a81 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/EncodingHelper.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/EncodingHelper.cs @@ -46,7 +46,7 @@ namespace System.Reflection.Internal /// (lightUpAttemptFailed || prefix != null), we give up and allocate a temporary array, /// copy to it, decode, and throw it away. /// </summary> - internal unsafe static class EncodingHelper + internal static unsafe class EncodingHelper { // Size of pooled buffers. Input larger than that is prefixed or given to us on a // platform that doesn't have unsafe Encoding.GetString, will cause us to diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableByteArrayInterop.cs b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableByteArrayInterop.cs index 0ae25437a1..0b6c7d10d2 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableByteArrayInterop.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableByteArrayInterop.cs @@ -37,7 +37,7 @@ namespace System.Reflection.Internal /// characteristics and therefore something we (Microsoft) are comfortable defining as a contract that /// can be depended upon as below. /// </remarks> - internal unsafe static class ImmutableByteArrayInterop + internal static unsafe class ImmutableByteArrayInterop { /// <summary> /// Creates a new instance of <see cref="ImmutableArray{Byte}"/> using a given mutable array as the backing diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/MemoryMapLightUp.cs b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/MemoryMapLightUp.cs index 93263a901c..9a4afa6bc8 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/MemoryMapLightUp.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/MemoryMapLightUp.cs @@ -228,7 +228,7 @@ namespace System.Reflection.Internal } } - internal unsafe static byte* AcquirePointer(object accessor, out SafeBuffer safeBuffer) + internal static unsafe byte* AcquirePointer(object accessor, out SafeBuffer safeBuffer) { Debug.Assert(s_lazyIsAvailable.GetValueOrDefault()); diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobBuilder.cs b/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobBuilder.cs index b14470f05f..63e023acf9 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobBuilder.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobBuilder.cs @@ -169,7 +169,7 @@ namespace System.Reflection.Metadata protected int FreeBytes => _buffer.Length - Length; // internal for testing - internal protected int ChunkCapacity => _buffer.Length; + protected internal int ChunkCapacity => _buffer.Length; // internal for testing internal Chunks GetChunks() diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobContentId.cs b/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobContentId.cs index eec0a2cfdb..191adf641d 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobContentId.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobContentId.cs @@ -53,7 +53,7 @@ namespace System.Reflection.Metadata return FromHash(ImmutableByteArrayInterop.DangerousGetUnderlyingArray(hashCode)); } - public unsafe static BlobContentId FromHash(byte[] hashCode) + public static unsafe BlobContentId FromHash(byte[] hashCode) { const int minHashSize = 20; diff --git a/src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs b/src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs index 413a82aa48..8dc287dde0 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs @@ -87,7 +87,7 @@ namespace System.Reflection.PortableExecutable protected abstract BlobBuilder SerializeSection(string name, SectionLocation location); - internal protected abstract PEDirectoriesBuilder GetDirectories(); + protected internal abstract PEDirectoriesBuilder GetDirectories(); public BlobContentId Serialize(BlobBuilder builder) { @@ -515,7 +515,7 @@ namespace System.Reflection.PortableExecutable return CalculateChecksum(GetContentToChecksum(peImage, checksumFixup)) + (uint)peImage.Count; } - private unsafe static uint CalculateChecksum(IEnumerable<Blob> blobs) + private static unsafe uint CalculateChecksum(IEnumerable<Blob> blobs) { uint checksum = 0; int pendingByte = -1; diff --git a/src/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataAggregatorTests.cs b/src/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataAggregatorTests.cs index 30eb7d79a2..b457efb632 100644 --- a/src/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataAggregatorTests.cs +++ b/src/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataAggregatorTests.cs @@ -11,7 +11,7 @@ namespace System.Reflection.Metadata.Ecma335.Tests { public class MetadataAggregatorTests { - private unsafe static EnCMapTableReader CreateEncMapTable(int[] tokens) + private static unsafe EnCMapTableReader CreateEncMapTable(int[] tokens) { GCHandle handle = GCHandle.Alloc(tokens, GCHandleType.Pinned); var block = new MemoryBlock((byte*)handle.AddrOfPinnedObject(), tokens.Length * sizeof(uint)); diff --git a/src/System.Reflection.Metadata/tests/Metadata/PortablePdb/StandalonePortablePdbStreamTests.cs b/src/System.Reflection.Metadata/tests/Metadata/PortablePdb/StandalonePortablePdbStreamTests.cs index b5dc4895e1..558d3be48f 100644 --- a/src/System.Reflection.Metadata/tests/Metadata/PortablePdb/StandalonePortablePdbStreamTests.cs +++ b/src/System.Reflection.Metadata/tests/Metadata/PortablePdb/StandalonePortablePdbStreamTests.cs @@ -10,7 +10,7 @@ namespace System.Reflection.Metadata.Tests { public class StandalonePortablePdbStreamTests { - private unsafe static void ReadHeader(out DebugMetadataHeader header, out int[] externalRowCounts, byte[] buffer) + private static unsafe void ReadHeader(out DebugMetadataHeader header, out int[] externalRowCounts, byte[] buffer) { fixed (byte* bufferPtr = &buffer[0]) { diff --git a/src/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs b/src/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs index 9414a7015e..6873d3b529 100644 --- a/src/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs +++ b/src/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs @@ -35,7 +35,7 @@ namespace System.Reflection.PortableExecutable.Tests } } - private unsafe static void VerifyStrongNameSignatureDirectory(PEReader peReader, byte[] expectedSignature) + private static unsafe void VerifyStrongNameSignatureDirectory(PEReader peReader, byte[] expectedSignature) { var headers = peReader.PEHeaders; int rva = headers.CorHeader.StrongNameSignatureDirectory.RelativeVirtualAddress; @@ -464,7 +464,7 @@ namespace System.Reflection.PortableExecutable.Tests { } - internal protected override void Serialize(BlobBuilder builder, SectionLocation location) + protected internal override void Serialize(BlobBuilder builder, SectionLocation location) { builder.WriteInt32(0x12345678); builder.WriteInt32(location.PointerToRawData); @@ -510,7 +510,7 @@ namespace System.Reflection.PortableExecutable.Tests { } - internal protected override void Serialize(BlobBuilder builder, SectionLocation location) + protected internal override void Serialize(BlobBuilder builder, SectionLocation location) { throw new NotImplementedException(); } diff --git a/src/System.Reflection.Metadata/tests/TestUtilities/LoaderUtilities.cs b/src/System.Reflection.Metadata/tests/TestUtilities/LoaderUtilities.cs index eb9fe12bcd..731b6fd3f0 100644 --- a/src/System.Reflection.Metadata/tests/TestUtilities/LoaderUtilities.cs +++ b/src/System.Reflection.Metadata/tests/TestUtilities/LoaderUtilities.cs @@ -10,7 +10,7 @@ using System.Reflection.Internal; namespace System.Reflection.Metadata.Tests { - internal unsafe static class LoaderUtilities + internal static unsafe class LoaderUtilities { public static void LoadPEAndValidate(byte[] peImage, Action<PEReader> validator, bool useStream = false) { diff --git a/src/System.Runtime.CompilerServices.Unsafe/tests/UnsafeTests.cs b/src/System.Runtime.CompilerServices.Unsafe/tests/UnsafeTests.cs index ba6ecb1737..84455780e9 100644 --- a/src/System.Runtime.CompilerServices.Unsafe/tests/UnsafeTests.cs +++ b/src/System.Runtime.CompilerServices.Unsafe/tests/UnsafeTests.cs @@ -419,7 +419,7 @@ namespace System.Runtime.CompilerServices } [Fact] - public unsafe static void AsRef() + public static unsafe void AsRef() { byte[] b = new byte[4] { 0x42, 0x42, 0x42, 0x42 }; fixed (byte * p = b) diff --git a/src/System.Runtime.Extensions/src/System/BitConverter.cs b/src/System.Runtime.Extensions/src/System/BitConverter.cs index 62475d582d..f9542af45e 100644 --- a/src/System.Runtime.Extensions/src/System/BitConverter.cs +++ b/src/System.Runtime.Extensions/src/System/BitConverter.cs @@ -45,7 +45,7 @@ namespace System // Converts a short into an array of bytes with length // two. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static byte[] GetBytes(short value) + public static unsafe byte[] GetBytes(short value) { Contract.Ensures(Contract.Result<byte[]>() != null); Contract.Ensures(Contract.Result<byte[]>().Length == 2); @@ -59,7 +59,7 @@ namespace System // Converts an int into an array of bytes with length // four. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static byte[] GetBytes(int value) + public static unsafe byte[] GetBytes(int value) { Contract.Ensures(Contract.Result<byte[]>() != null); Contract.Ensures(Contract.Result<byte[]>().Length == 4); @@ -73,7 +73,7 @@ namespace System // Converts a long into an array of bytes with length // eight. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static byte[] GetBytes(long value) + public static unsafe byte[] GetBytes(long value) { Contract.Ensures(Contract.Result<byte[]>() != null); Contract.Ensures(Contract.Result<byte[]>().Length == 8); @@ -120,7 +120,7 @@ namespace System // Converts a float into an array of bytes with length // four. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static byte[] GetBytes(float value) + public static unsafe byte[] GetBytes(float value) { Contract.Ensures(Contract.Result<byte[]>() != null); Contract.Ensures(Contract.Result<byte[]>().Length == 4); @@ -131,7 +131,7 @@ namespace System // Converts a double into an array of bytes with length // eight. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static byte[] GetBytes(double value) + public static unsafe byte[] GetBytes(double value) { Contract.Ensures(Contract.Result<byte[]>() != null); Contract.Ensures(Contract.Result<byte[]>().Length == 8); @@ -298,7 +298,7 @@ namespace System // Converts an array of bytes into a float. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static float ToSingle(byte[] value, int startIndex) + public static unsafe float ToSingle(byte[] value, int startIndex) { if (value == null) ThrowValueArgumentNull(); @@ -314,7 +314,7 @@ namespace System // Converts an array of bytes into a double. [System.Security.SecuritySafeCritical] // auto-generated - public unsafe static double ToDouble(byte[] value, int startIndex) + public static unsafe double ToDouble(byte[] value, int startIndex) { if (value == null) ThrowValueArgumentNull(); diff --git a/src/System.Runtime.Extensions/src/System/Environment.Win32.cs b/src/System.Runtime.Extensions/src/System/Environment.Win32.cs index 4f357039e9..b653a7cb41 100644 --- a/src/System.Runtime.Extensions/src/System/Environment.Win32.cs +++ b/src/System.Runtime.Extensions/src/System/Environment.Win32.cs @@ -179,7 +179,7 @@ namespace System } } - private unsafe static char[] GetEnvironmentCharArray() + private static unsafe char[] GetEnvironmentCharArray() { // Format for GetEnvironmentStrings is: // [=HiddenVar=value\0]* [Variable=value\0]* \0 diff --git a/src/System.Runtime.Extensions/src/System/IO/BinaryReader.cs b/src/System.Runtime.Extensions/src/System/IO/BinaryReader.cs index 8070ccc643..4ca3a76482 100644 --- a/src/System.Runtime.Extensions/src/System/IO/BinaryReader.cs +++ b/src/System.Runtime.Extensions/src/System/IO/BinaryReader.cs @@ -654,7 +654,7 @@ namespace System.IO } while (bytesRead < numBytes); } - internal protected int Read7BitEncodedInt() + protected internal int Read7BitEncodedInt() { // Read out an Int32 7 bits at a time. The high bit // of the byte when on means to continue reading more bytes. diff --git a/src/System.Runtime.Extensions/src/System/IO/PathHelper.Windows.cs b/src/System.Runtime.Extensions/src/System/IO/PathHelper.Windows.cs index f03f15c6a5..4ef4d5cddf 100644 --- a/src/System.Runtime.Extensions/src/System/IO/PathHelper.Windows.cs +++ b/src/System.Runtime.Extensions/src/System/IO/PathHelper.Windows.cs @@ -11,7 +11,7 @@ namespace System.IO /// <summary> /// Wrapper to help with path normalization. /// </summary> - unsafe internal class PathHelper + internal unsafe class PathHelper { // Can't be over 8.3 and be a short name private const int MaxShortName = 12; diff --git a/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index 86ed3a434b..51561a2ad3 100644 --- a/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -349,7 +349,7 @@ namespace System.Tests internal static extern int GetLogicalDrives(); [DllImport("shell32.dll", SetLastError = false, BestFitMapping = false, ExactSpelling = true)] - internal unsafe static extern int SHGetFolderPathW( + internal static extern unsafe int SHGetFolderPathW( IntPtr hwndOwner, int nFolder, IntPtr hToken, diff --git a/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs b/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs index 062a17fa66..19360f71da 100644 --- a/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs +++ b/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs @@ -11,7 +11,7 @@ namespace System.Reflection.Metadata public static partial class AssemblyExtensions { [CLSCompliant(false)] // out byte* blob - public unsafe static bool TryGetRawMetadata(this System.Reflection.Assembly assembly, out byte* blob, out int length) { throw null; } + public static unsafe bool TryGetRawMetadata(this System.Reflection.Assembly assembly, out byte* blob, out int length) { throw null; } } } namespace System.Runtime.Loader diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs index d872c48bcb..29cb11ccf1 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs @@ -36,7 +36,7 @@ namespace System.Numerics } [SecuritySafeCritical] - public unsafe static uint[] Add(uint[] left, uint[] right) + public static unsafe uint[] Add(uint[] left, uint[] right) { Debug.Assert(left != null); Debug.Assert(right != null); @@ -58,7 +58,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static void Add(uint* left, int leftLength, + private static unsafe void Add(uint* left, int leftLength, uint* right, int rightLength, uint* bits, int bitsLength) { @@ -91,7 +91,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static void AddSelf(uint* left, int leftLength, + private static unsafe void AddSelf(uint* left, int leftLength, uint* right, int rightLength) { Debug.Assert(leftLength >= 0); @@ -148,7 +148,7 @@ namespace System.Numerics } [SecuritySafeCritical] - public unsafe static uint[] Subtract(uint[] left, uint[] right) + public static unsafe uint[] Subtract(uint[] left, uint[] right) { Debug.Assert(left != null); Debug.Assert(right != null); @@ -171,7 +171,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static void Subtract(uint* left, int leftLength, + private static unsafe void Subtract(uint* left, int leftLength, uint* right, int rightLength, uint* bits, int bitsLength) { @@ -206,7 +206,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static void SubtractSelf(uint* left, int leftLength, + private static unsafe void SubtractSelf(uint* left, int leftLength, uint* right, int rightLength) { Debug.Assert(leftLength >= 0); @@ -259,7 +259,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static int Compare(uint* left, int leftLength, + private static unsafe int Compare(uint* left, int leftLength, uint* right, int rightLength) { Debug.Assert(leftLength >= 0); diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs index 89bc8b05f7..c3a4ab3a51 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs @@ -71,7 +71,7 @@ namespace System.Numerics } [SecuritySafeCritical] - public unsafe static uint[] Divide(uint[] left, uint[] right, + public static unsafe uint[] Divide(uint[] left, uint[] right, out uint[] remainder) { Debug.Assert(left != null); @@ -101,7 +101,7 @@ namespace System.Numerics } [SecuritySafeCritical] - public unsafe static uint[] Divide(uint[] left, uint[] right) + public static unsafe uint[] Divide(uint[] left, uint[] right) { Debug.Assert(left != null); Debug.Assert(right != null); @@ -125,7 +125,7 @@ namespace System.Numerics } [SecuritySafeCritical] - public unsafe static uint[] Remainder(uint[] left, uint[] right) + public static unsafe uint[] Remainder(uint[] left, uint[] right) { Debug.Assert(left != null); Debug.Assert(right != null); @@ -148,7 +148,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static void Divide(uint* left, int leftLength, + private static unsafe void Divide(uint* left, int leftLength, uint* right, int rightLength, uint* bits, int bitsLength) { @@ -235,7 +235,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static uint AddDivisor(uint* left, int leftLength, + private static unsafe uint AddDivisor(uint* left, int leftLength, uint* right, int rightLength) { Debug.Assert(leftLength >= 0); @@ -256,7 +256,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static uint SubtractDivisor(uint* left, int leftLength, + private static unsafe uint SubtractDivisor(uint* left, int leftLength, uint* right, int rightLength, ulong q) { diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.FastReducer.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.FastReducer.cs index 7e9accd436..b19d4f543a 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.FastReducer.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.FastReducer.cs @@ -67,7 +67,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static int DivMul(uint[] left, int leftLength, + private static unsafe int DivMul(uint[] left, int leftLength, uint[] right, int rightLength, uint[] bits, int k) { @@ -112,7 +112,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static int SubMod(uint[] left, int leftLength, + private static unsafe int SubMod(uint[] left, int leftLength, uint[] right, int rightLength, uint[] modulus, int k) { diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs index a74aba06f0..01015d30bd 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs @@ -10,7 +10,7 @@ namespace System.Numerics internal static partial class BigIntegerCalculator { [SecuritySafeCritical] - public unsafe static uint[] Square(uint[] value) + public static unsafe uint[] Square(uint[] value) { Debug.Assert(value != null); @@ -33,7 +33,7 @@ namespace System.Numerics private static int AllocationThreshold = 256; [SecuritySafeCritical] - private unsafe static void Square(uint* value, int valueLength, + private static unsafe void Square(uint* value, int valueLength, uint* bits, int bitsLength) { Debug.Assert(valueLength >= 0); @@ -186,7 +186,7 @@ namespace System.Numerics } [SecuritySafeCritical] - public unsafe static uint[] Multiply(uint[] left, uint[] right) + public static unsafe uint[] Multiply(uint[] left, uint[] right) { Debug.Assert(left != null); Debug.Assert(right != null); @@ -211,7 +211,7 @@ namespace System.Numerics private static int MultiplyThreshold = 32; [SecuritySafeCritical] - private unsafe static void Multiply(uint* left, int leftLength, + private static unsafe void Multiply(uint* left, int leftLength, uint* right, int rightLength, uint* bits, int bitsLength) { @@ -359,7 +359,7 @@ namespace System.Numerics } [SecuritySafeCritical] - private unsafe static void SubtractCore(uint* left, int leftLength, + private static unsafe void SubtractCore(uint* left, int leftLength, uint* right, int rightLength, uint* core, int coreLength) { diff --git a/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs b/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs index 9ebe0fc0b3..ebc1a92686 100644 --- a/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs +++ b/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs @@ -371,7 +371,7 @@ namespace System.Numerics return result; } - private unsafe static bool HexNumberToBigInteger(ref BigNumberBuffer number, ref BigInteger value) + private static unsafe bool HexNumberToBigInteger(ref BigNumberBuffer number, ref BigInteger value) { if (number.digits == null || number.digits.Length == 0) return false; @@ -425,7 +425,7 @@ namespace System.Numerics return true; } - private unsafe static bool NumberToBigInteger(ref BigNumberBuffer number, ref BigInteger value) + private static unsafe bool NumberToBigInteger(ref BigNumberBuffer number, ref BigInteger value) { int i = number.scale; int cur = 0; diff --git a/src/System.Runtime.WindowsRuntime/src/System/InternalHelpers.cs b/src/System.Runtime.WindowsRuntime/src/System/InternalHelpers.cs index 27e5220dc7..b28a9cb163 100644 --- a/src/System.Runtime.WindowsRuntime/src/System/InternalHelpers.cs +++ b/src/System.Runtime.WindowsRuntime/src/System/InternalHelpers.cs @@ -42,7 +42,7 @@ namespace System.Runtime.WindowsRuntime.Internal internal class Helpers { - internal unsafe static void ZeroMemory(byte* src, long len) + internal static unsafe void ZeroMemory(byte* src, long len) { while (len-- > 0) *(src + len) = 0; diff --git a/src/System.Runtime/ref/System.Runtime.cs b/src/System.Runtime/ref/System.Runtime.cs index 75a84c6acf..38246359f3 100644 --- a/src/System.Runtime/ref/System.Runtime.cs +++ b/src/System.Runtime/ref/System.Runtime.cs @@ -482,10 +482,10 @@ namespace System public static byte GetByte(System.Array array, int index) { throw null; } [System.CLSCompliantAttribute(false)] [System.Security.SecurityCriticalAttribute] - public unsafe static void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { } + public static unsafe void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { } [System.CLSCompliantAttribute(false)] [System.Security.SecurityCriticalAttribute] - public unsafe static void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { } + public static unsafe void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { } public static void SetByte(System.Array array, int index, byte value) { } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -1513,10 +1513,10 @@ namespace System public static explicit operator int (System.IntPtr value) { throw null; } public static explicit operator long (System.IntPtr value) { throw null; } [System.CLSCompliantAttribute(false)] - public unsafe static explicit operator void* (System.IntPtr value) { throw null; } + public static unsafe explicit operator void* (System.IntPtr value) { throw null; } [System.CLSCompliantAttribute(false)] [System.Security.SecurityCriticalAttribute] - public unsafe static explicit operator System.IntPtr(void* value) { throw null; } + public static unsafe explicit operator System.IntPtr(void* value) { throw null; } public static bool operator !=(System.IntPtr value1, System.IntPtr value2) { throw null; } public static System.IntPtr operator -(System.IntPtr pointer, int offset) { throw null; } public static System.IntPtr Subtract(System.IntPtr pointer, int offset) { throw null; } @@ -2846,10 +2846,10 @@ namespace System public static explicit operator ulong (System.UIntPtr value) { throw null; } [System.CLSCompliantAttribute(false)] [System.Security.SecurityCriticalAttribute] - public unsafe static explicit operator void* (System.UIntPtr value) { throw null; } + public static unsafe explicit operator void* (System.UIntPtr value) { throw null; } [System.CLSCompliantAttribute(false)] [System.Security.SecurityCriticalAttribute] - public unsafe static explicit operator System.UIntPtr(void* value) { throw null; } + public static unsafe explicit operator System.UIntPtr(void* value) { throw null; } public static bool operator !=(System.UIntPtr value1, System.UIntPtr value2) { throw null; } public static System.UIntPtr operator -(System.UIntPtr pointer, int offset) { throw null; } public static System.UIntPtr Subtract(System.UIntPtr pointer, int offset) { throw null; } diff --git a/src/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs b/src/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs index 01047c42eb..619e48bce5 100644 --- a/src/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs +++ b/src/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs @@ -40,7 +40,7 @@ namespace System.Security.AccessControl #region Delegates - internal protected delegate System.Exception ExceptionFromErrorCode(int errorCode, string name, SafeHandle handle, object context); + protected internal delegate System.Exception ExceptionFromErrorCode(int errorCode, string name, SafeHandle handle, object context); #endregion diff --git a/src/System.Security.AccessControl/src/System/Security/AccessControl/Rules.cs b/src/System.Security.AccessControl/src/System/Security/AccessControl/Rules.cs index 9475428122..44fc3e9855 100644 --- a/src/System.Security.AccessControl/src/System/Security/AccessControl/Rules.cs +++ b/src/System.Security.AccessControl/src/System/Security/AccessControl/Rules.cs @@ -32,7 +32,7 @@ namespace System.Security.AccessControl #region Constructors - internal protected AuthorizationRule( + protected internal AuthorizationRule( IdentityReference identity, int accessMask, bool isInherited, @@ -97,7 +97,7 @@ nameof(identity)); get { return _identity; } } - internal protected int AccessMask + protected internal int AccessMask { get { return _accessMask; } } diff --git a/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs b/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs index 838ebb404c..ccb11353ce 100644 --- a/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs +++ b/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs @@ -146,7 +146,7 @@ namespace Internal.Cryptography.Pal.Windows return hCertContext; } - public unsafe static byte[] GetSubjectKeyIdentifer(this SafeCertContextHandle hCertContext) + public static unsafe byte[] GetSubjectKeyIdentifer(this SafeCertContextHandle hCertContext) { int cbData = 0; if (!Interop.Crypt32.CertGetCertificateContextProperty(hCertContext, CertContextPropId.CERT_KEY_IDENTIFIER_PROP_ID, null, ref cbData)) diff --git a/src/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs b/src/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs index 4be1abb24c..61b9b6dc32 100644 --- a/src/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs +++ b/src/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs @@ -14,7 +14,7 @@ internal static partial class Interop internal static partial class Crypt32 { [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static unsafe extern SafeCryptMsgHandle CryptMsgOpenToEncode(MsgEncodingType dwMsgEncodingType, int dwFlags, CryptMsgType dwMsgType, CMSG_ENVELOPED_ENCODE_INFO* pvMsgEncodeInfo, [MarshalAs(UnmanagedType.LPStr)] string pszInnerContentObjID, IntPtr pStreamInfo); + internal static extern unsafe SafeCryptMsgHandle CryptMsgOpenToEncode(MsgEncodingType dwMsgEncodingType, int dwFlags, CryptMsgType dwMsgType, CMSG_ENVELOPED_ENCODE_INFO* pvMsgEncodeInfo, [MarshalAs(UnmanagedType.LPStr)] string pszInnerContentObjID, IntPtr pStreamInfo); } } diff --git a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs index 2a65582c65..d3b5c8953f 100644 --- a/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs +++ b/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs @@ -23,7 +23,7 @@ internal static partial class Interop public static partial class crypt32 { [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern bool CryptQueryObject( + public static extern unsafe bool CryptQueryObject( CertQueryObjectType dwObjectType, void* pvObject, ExpectedContentTypeFlags dwExpectedContentTypeFlags, @@ -38,7 +38,7 @@ internal static partial class Interop ); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern bool CryptQueryObject( + public static extern unsafe bool CryptQueryObject( CertQueryObjectType dwObjectType, void* pvObject, ExpectedContentTypeFlags dwExpectedContentTypeFlags, @@ -53,7 +53,7 @@ internal static partial class Interop ); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern bool CryptQueryObject( + public static extern unsafe bool CryptQueryObject( CertQueryObjectType dwObjectType, void* pvObject, ExpectedContentTypeFlags dwExpectedContentTypeFlags, @@ -252,21 +252,21 @@ internal static partial class Interop } [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static unsafe extern SafeCertContextHandle CertFindCertificateInStore(SafeCertStoreHandle hCertStore, CertEncodingType dwCertEncodingType, CertFindFlags dwFindFlags, CertFindType dwFindType, void* pvFindPara, CERT_CONTEXT* pPrevCertContext); + private static extern unsafe SafeCertContextHandle CertFindCertificateInStore(SafeCertStoreHandle hCertStore, CertEncodingType dwCertEncodingType, CertFindFlags dwFindFlags, CertFindType dwFindType, void* pvFindPara, CERT_CONTEXT* pPrevCertContext); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern int CertVerifyTimeValidity([In] ref FILETIME pTimeToVerify, [In] CERT_INFO* pCertInfo); + public static extern unsafe int CertVerifyTimeValidity([In] ref FILETIME pTimeToVerify, [In] CERT_INFO* pCertInfo); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, CERT_EXTENSION* rgExtensions); + public static extern unsafe CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, CERT_EXTENSION* rgExtensions); // 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. [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern bool CertGetIntendedKeyUsage(CertEncodingType dwCertEncodingType, CERT_INFO* pCertInfo, out X509KeyUsageFlags pbKeyUsage, int cbKeyUsage); + public static extern unsafe bool CertGetIntendedKeyUsage(CertEncodingType dwCertEncodingType, CERT_INFO* pCertInfo, out X509KeyUsageFlags pbKeyUsage, int cbKeyUsage); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern bool CertGetValidUsages(int cCerts, [In] ref SafeCertContextHandle rghCerts, out int cNumOIDs, [Out] void* rghOIDs, [In, Out] ref int pcbOIDs); + public static extern unsafe bool CertGetValidUsages(int cCerts, [In] ref SafeCertContextHandle rghCerts, out int cNumOIDs, [Out] void* rghOIDs, [In, Out] ref int pcbOIDs); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] public static extern bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara); diff --git a/src/System.Text.Encoding.CodePages/src/System/Text/GB18030Encoding.cs b/src/System.Text.Encoding.CodePages/src/System/Text/GB18030Encoding.cs index 07599d6c21..e4654cd2b5 100644 --- a/src/System.Text.Encoding.CodePages/src/System/Text/GB18030Encoding.cs +++ b/src/System.Text.Encoding.CodePages/src/System/Text/GB18030Encoding.cs @@ -106,8 +106,8 @@ namespace System.Text { // This is the table of 4 byte conversions. private const int GBLast4ByteCode = 0x99FB; - unsafe internal char* map4BytesToUnicode = null; // new char[GBLast4ByteCode + 1]; // Need to map all 4 byte sequences to Unicode - unsafe internal byte* mapUnicodeTo4BytesFlags = null; // new byte[0x10000 / 8]; // Need 1 bit for each code point to say if its 4 byte or not + internal unsafe char* map4BytesToUnicode = null; // new char[GBLast4ByteCode + 1]; // Need to map all 4 byte sequences to Unicode + internal unsafe byte* mapUnicodeTo4BytesFlags = null; // new byte[0x10000 / 8]; // Need 1 bit for each code point to say if its 4 byte or not private const int GB18030 = 54936; diff --git a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BufferInternal.cs b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BufferInternal.cs index 5159f0c970..f9e3235630 100644 --- a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BufferInternal.cs +++ b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BufferInternal.cs @@ -15,7 +15,7 @@ namespace System { { // This method has different signature for x64 and other platforms and is done for performance reasons. [System.Security.SecurityCritical] - private unsafe static void Memmove(byte* dest, byte* src, uint len) + private static unsafe void Memmove(byte* dest, byte* src, uint len) { if (AreOverlapping(dest, src, len)) { diff --git a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/HtmlEncoder.cs b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/HtmlEncoder.cs index 0ce1525cd6..1a0079b047 100644 --- a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/HtmlEncoder.cs +++ b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/HtmlEncoder.cs @@ -117,7 +117,7 @@ namespace System.Text.Encodings.Web else { return TryWriteEncodedScalarAsNumericEntity(unicodeScalar, buffer, bufferLength, out numberOfCharactersWritten); } } - private unsafe static bool TryWriteEncodedScalarAsNumericEntity(int unicodeScalar, char* buffer, int bufferLength, out int numberOfCharactersWritten) + private static unsafe bool TryWriteEncodedScalarAsNumericEntity(int unicodeScalar, char* buffer, int bufferLength, out int numberOfCharactersWritten) { Debug.Assert(buffer != null && bufferLength >= 0); diff --git a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/JavaScriptEncoder.cs b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/JavaScriptEncoder.cs index 2a58604e65..cfa099d745 100644 --- a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/JavaScriptEncoder.cs +++ b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/JavaScriptEncoder.cs @@ -148,7 +148,7 @@ namespace System.Text.Encodings.Web return TryCopyCharacters(toCopy, buffer, bufferLength, out numberOfCharactersWritten); } - private unsafe static bool TryWriteEncodedScalarAsNumericEntity(int unicodeScalar, char* buffer, int length, out int numberOfCharactersWritten) + private static unsafe bool TryWriteEncodedScalarAsNumericEntity(int unicodeScalar, char* buffer, int length, out int numberOfCharactersWritten) { Debug.Assert(buffer != null && length >= 0); @@ -179,7 +179,7 @@ namespace System.Text.Encodings.Web } // Writes an encoded scalar value (in the BMP) as a JavaScript-escaped character. - private unsafe static bool TryWriteEncodedSingleCharacter(int unicodeScalar, char* buffer, int length, out int numberOfCharactersWritten) + private static unsafe bool TryWriteEncodedSingleCharacter(int unicodeScalar, char* buffer, int length, out int numberOfCharactersWritten) { Debug.Assert(buffer != null && length >= 0); Debug.Assert(!UnicodeHelpers.IsSupplementaryCodePoint(unicodeScalar), "The incoming value should've been in the BMP."); diff --git a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs index ad813c42bc..62b26b92bc 100644 --- a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs +++ b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs @@ -377,7 +377,7 @@ namespace System.Text.Encodings.Web } } - internal unsafe static bool TryCopyCharacters(char[] source, char* destination, int destinationLength, out int numberOfCharactersWritten) + internal static unsafe bool TryCopyCharacters(char[] source, char* destination, int destinationLength, out int numberOfCharactersWritten) { Debug.Assert(source != null && destination != null && destinationLength >= 0); @@ -397,7 +397,7 @@ namespace System.Text.Encodings.Web } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe static bool TryWriteScalarAsChar(int unicodeScalar, char* destination, int destinationLength, out int numberOfCharactersWritten) + internal static unsafe bool TryWriteScalarAsChar(int unicodeScalar, char* destination, int destinationLength, out int numberOfCharactersWritten) { Debug.Assert(destination != null && destinationLength >= 0); diff --git a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnicodeHelpers.cs b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnicodeHelpers.cs index b3a73d6b06..f335beb3e4 100644 --- a/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnicodeHelpers.cs +++ b/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnicodeHelpers.cs @@ -13,7 +13,7 @@ namespace System.Text.Unicode /// <summary> /// Contains helpers for dealing with Unicode code points. /// </summary> - internal unsafe static class UnicodeHelpers + internal static unsafe class UnicodeHelpers { /// <summary> /// Used for invalid Unicode sequences or other unrepresentable values. diff --git a/src/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs b/src/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs index 72ae0b6b7d..37728114f1 100644 --- a/src/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs +++ b/src/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs @@ -39,7 +39,7 @@ namespace System.Threading [System.CLSCompliantAttribute(false)] public unsafe void FreeNativeOverlapped(System.Threading.NativeOverlapped* overlapped) { } [System.CLSCompliantAttribute(false)] - public unsafe static object GetNativeOverlappedState(System.Threading.NativeOverlapped* overlapped) { throw null; } + public static unsafe object GetNativeOverlappedState(System.Threading.NativeOverlapped* overlapped) { throw null; } } public partial class Overlapped { @@ -54,14 +54,14 @@ namespace System.Threading public int OffsetHigh { get { throw null; } set { } } public int OffsetLow { get { throw null; } set { } } [System.CLSCompliantAttribute(false)] - public unsafe static void Free(System.Threading.NativeOverlapped* nativeOverlappedPtr) { } + public static unsafe void Free(System.Threading.NativeOverlapped* nativeOverlappedPtr) { } [System.CLSCompliantAttribute(false)] [System.ObsoleteAttribute("This method is not safe. Use Pack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")] public unsafe System.Threading.NativeOverlapped* Pack(System.Threading.IOCompletionCallback iocb) { throw null; } [System.CLSCompliantAttribute(false)] public unsafe System.Threading.NativeOverlapped* Pack(System.Threading.IOCompletionCallback iocb, object userData) { throw null; } [System.CLSCompliantAttribute(false)] - public unsafe static System.Threading.Overlapped Unpack(System.Threading.NativeOverlapped* nativeOverlappedPtr) { throw null; } + public static unsafe System.Threading.Overlapped Unpack(System.Threading.NativeOverlapped* nativeOverlappedPtr) { throw null; } [System.CLSCompliantAttribute(false)] [System.ObsoleteAttribute("This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")] public unsafe System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb) { throw null; } diff --git a/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandle.cs b/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandle.cs index d0cc5afbae..3242835b81 100644 --- a/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandle.cs +++ b/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandle.cs @@ -275,7 +275,7 @@ namespace System.Threading /// <paramref name="overlapped"/> is <see langword="null"/>. /// </exception> [CLSCompliant(false)] - public unsafe static object GetNativeOverlappedState(NativeOverlapped* overlapped) + public static unsafe object GetNativeOverlappedState(NativeOverlapped* overlapped) { if (overlapped == null) throw new ArgumentNullException(nameof(overlapped)); diff --git a/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs b/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs index 1aea2a294b..7ce8936bf7 100644 --- a/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs +++ b/src/System.Threading.Overlapped/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs @@ -29,7 +29,7 @@ namespace System.Threading _nativeOverlapped->OffsetHigh = 0; } - private unsafe static void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) + private static unsafe void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) { ThreadPoolBoundHandleOverlapped overlapped = (ThreadPoolBoundHandleOverlapped)Overlapped.Unpack(nativeOverlapped); diff --git a/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolBoundHandle.cs b/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolBoundHandle.cs index 401cbb624a..ab21d1c13e 100644 --- a/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolBoundHandle.cs +++ b/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolBoundHandle.cs @@ -141,7 +141,7 @@ namespace System.Threading } [CLSCompliant(false)] - public unsafe static object GetNativeOverlappedState(NativeOverlapped* overlapped) + public static unsafe object GetNativeOverlappedState(NativeOverlapped* overlapped) { if (overlapped == null) throw new ArgumentNullException(nameof(overlapped)); diff --git a/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs b/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs index 9551a580d6..93f46d4f6b 100644 --- a/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs +++ b/src/System.Threading.Overlapped/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs @@ -30,7 +30,7 @@ namespace System.Threading get { return s_dataArray[_dataIndex]; } } - internal unsafe static Win32ThreadPoolNativeOverlapped* Allocate(IOCompletionCallback callback, object state, object pinData, PreAllocatedOverlapped preAllocated) + internal static unsafe Win32ThreadPoolNativeOverlapped* Allocate(IOCompletionCallback callback, object state, object pinData, PreAllocatedOverlapped preAllocated) { Win32ThreadPoolNativeOverlapped* overlapped = AllocateNew(); try @@ -45,7 +45,7 @@ namespace System.Threading return overlapped; } - private unsafe static Win32ThreadPoolNativeOverlapped* AllocateNew() + private static unsafe Win32ThreadPoolNativeOverlapped* AllocateNew() { IntPtr freePtr; Win32ThreadPoolNativeOverlapped* overlapped; @@ -158,7 +158,7 @@ namespace System.Threading } } - internal unsafe static void Free(Win32ThreadPoolNativeOverlapped* overlapped) + internal static unsafe void Free(Win32ThreadPoolNativeOverlapped* overlapped) { // Reset all data. overlapped->Data.Reset(); @@ -175,17 +175,17 @@ namespace System.Threading } } - internal unsafe static NativeOverlapped* ToNativeOverlapped(Win32ThreadPoolNativeOverlapped* overlapped) + internal static unsafe NativeOverlapped* ToNativeOverlapped(Win32ThreadPoolNativeOverlapped* overlapped) { return (NativeOverlapped*)overlapped; } - internal unsafe static Win32ThreadPoolNativeOverlapped* FromNativeOverlapped(NativeOverlapped* overlapped) + internal static unsafe Win32ThreadPoolNativeOverlapped* FromNativeOverlapped(NativeOverlapped* overlapped) { return (Win32ThreadPoolNativeOverlapped*)overlapped; } - internal unsafe static void CompleteWithCallback(uint errorCode, uint bytesWritten, Win32ThreadPoolNativeOverlapped* overlapped) + internal static unsafe void CompleteWithCallback(uint errorCode, uint bytesWritten, Win32ThreadPoolNativeOverlapped* overlapped) { OverlappedData data = overlapped->Data; @@ -211,7 +211,7 @@ namespace System.Threading ExecutionContext.Run(data._executionContext, callback, args); } - private unsafe static void OnExecutionContextCallback(object state) + private static unsafe void OnExecutionContextCallback(object state) { ExecutionContextCallbackArgs args = (ExecutionContextCallbackArgs)state; diff --git a/src/System.Threading.Overlapped/tests/DllImport.cs b/src/System.Threading.Overlapped/tests/DllImport.cs index c4f3f92379..c6fc73a8f6 100644 --- a/src/System.Threading.Overlapped/tests/DllImport.cs +++ b/src/System.Threading.Overlapped/tests/DllImport.cs @@ -15,7 +15,7 @@ internal static class DllImport FileAttributes dwFlagsAndAttributes, IntPtr hTemplateFile); [DllImport("api-ms-win-core-file-l1-1-0.dll", SetLastError = true)] - internal static unsafe extern int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); + internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); [DllImport("api-ms-win-core-handle-l1-1-0.dll", SetLastError = true)] diff --git a/src/System.Threading.Overlapped/tests/OverlappedTests.cs b/src/System.Threading.Overlapped/tests/OverlappedTests.cs index 2697b80ef8..9ec0bed8ca 100644 --- a/src/System.Threading.Overlapped/tests/OverlappedTests.cs +++ b/src/System.Threading.Overlapped/tests/OverlappedTests.cs @@ -77,7 +77,7 @@ public static partial class OverlappedTests Assert.Equal(obj.OffsetLow, 1); } [Fact] - public unsafe static void PackNegTest() + public static unsafe void PackNegTest() { var helper = new AsyncHelper(); IOCompletionCallback callback = MyCallback(helper); @@ -99,7 +99,7 @@ public static partial class OverlappedTests [Fact] - public unsafe static void PackNegTest1() + public static unsafe void PackNegTest1() { #pragma warning disable 618 var helper = new AsyncHelper(); @@ -122,7 +122,7 @@ public static partial class OverlappedTests } [Fact] - public unsafe static void UnPackTest() + public static unsafe void UnPackTest() { Assert.Throws<ArgumentNullException>(() => Overlapped.Unpack(null)); @@ -144,7 +144,7 @@ public static partial class OverlappedTests } [Fact] - public unsafe static void PackPosTest() + public static unsafe void PackPosTest() { #pragma warning disable 618 Overlapped ov = new Overlapped(); @@ -167,7 +167,7 @@ public static partial class OverlappedTests #pragma warning restore 618 } [Fact] - public unsafe static void PackPosTest1() + public static unsafe void PackPosTest1() { Overlapped ov = new Overlapped(); var helper = new AsyncHelper(); @@ -188,7 +188,7 @@ public static partial class OverlappedTests } } - unsafe internal static IOCompletionCallback MyCallback(AsyncHelper helper) + internal static unsafe IOCompletionCallback MyCallback(AsyncHelper helper) { IOCompletionCallback del = delegate (uint param1, uint param2, NativeOverlapped* overlapped) { @@ -216,7 +216,7 @@ internal class AsyncHelper { return this._event.WaitOne(); } - unsafe internal void Callback(uint errorCode, uint numBytes, NativeOverlapped* _overlapped) + internal unsafe void Callback(uint errorCode, uint numBytes, NativeOverlapped* _overlapped) { try { diff --git a/src/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs b/src/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs index f615cd2879..e74a38807e 100644 --- a/src/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs +++ b/src/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs @@ -32,7 +32,7 @@ namespace System.Threading public static bool SetMaxThreads(int workerThreads, int completionPortThreads) { throw null; } public static bool SetMinThreads(int workerThreads, int completionPortThreads) { throw null; } [System.CLSCompliantAttribute(false)] - public unsafe static bool UnsafeQueueNativeOverlapped(System.Threading.NativeOverlapped* overlapped) { throw null; } + public static unsafe bool UnsafeQueueNativeOverlapped(System.Threading.NativeOverlapped* overlapped) { throw null; } public static bool UnsafeQueueUserWorkItem(System.Threading.WaitCallback callBack, object state) { throw null; } public static System.Threading.RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object state, int millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } public static System.Threading.RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle waitObject, System.Threading.WaitOrTimerCallback callBack, object state, long millisecondsTimeOutInterval, bool executeOnlyOnce) { throw null; } |