diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs index 5b0543bede4657..39156643e4bb8b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +#nullable enable using Microsoft.Win32.SafeHandles; using System; using System.Runtime.InteropServices; @@ -17,7 +18,7 @@ internal static extern SafeMemoryMappedFileHandle CreateFileMapping( int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, - string lpName); + string? lpName); [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] internal static extern SafeMemoryMappedFileHandle CreateFileMapping( @@ -26,6 +27,6 @@ internal static extern SafeMemoryMappedFileHandle CreateFileMapping( int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, - string lpName); + string? lpName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFO.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFO.cs index 6852465d16bb90..b3991d666b28a8 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFO.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFO.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.Win32.SafeHandles; using System; using System.Runtime.InteropServices; diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs index d9edfdac51228b..ceab698f923a05 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Microsoft.Win32.SafeHandles; -using System; using System.Runtime.InteropServices; internal partial class Interop diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs index fd7d76e6246493..7788a87282ce44 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.Win32.SafeHandles; using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs index fbfa21a74e3ae5..d6aef9ae8ba75d 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs @@ -25,15 +25,15 @@ public partial class MemoryMappedFile : System.IDisposable { internal MemoryMappedFile() { } public Microsoft.Win32.SafeHandles.SafeMemoryMappedFileHandle SafeMemoryMappedFileHandle { get { throw null; } } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(System.IO.FileStream fileStream, string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.HandleInheritability inheritability, bool leaveOpen) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(System.IO.FileStream fileStream, string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.HandleInheritability inheritability, bool leaveOpen) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode) { throw null; } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string mapName) { throw null; } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string mapName, long capacity) { throw null; } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string mapName, long capacity) { throw null; } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } - public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string? mapName) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string? mapName, long capacity) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } + public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; } diff --git a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.csproj b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.csproj index 57602e1cc0509d..75999332a37347 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.csproj +++ b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.csproj @@ -1,5 +1,6 @@ + enable netcoreapp-Debug;netcoreapp-Release diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs index 54a074ef9336f0..c206df9fc5a38a 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs @@ -6,8 +6,6 @@ using System.Diagnostics; using System.IO; using System.IO.MemoryMappedFiles; -using System.Runtime.InteropServices; -using System.Security; using System.Threading; namespace Microsoft.Win32.SafeHandles @@ -22,7 +20,7 @@ public sealed partial class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOn /// onto the underlying handle to ensure that logic associated with disposing the stream /// (e.g. deleting the file for DeleteOnClose) happens at the appropriate time. /// - internal readonly FileStream _fileStream; + internal readonly FileStream? _fileStream; /// Whether this SafeHandle owns the _fileStream and should Dispose it when disposed. internal readonly bool _ownsFileStream; @@ -47,7 +45,7 @@ public sealed partial class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOn /// The options for the memory-mapped file. /// The capacity of the memory-mapped file. internal SafeMemoryMappedFileHandle( - FileStream fileStream, bool ownsFileStream, HandleInheritability inheritability, + FileStream? fileStream, bool ownsFileStream, HandleInheritability inheritability, MemoryMappedFileAccess access, MemoryMappedFileOptions options, long capacity) : base(ownsHandle: true) @@ -72,7 +70,7 @@ protected override void Dispose(bool disposing) if (disposing && _ownsFileStream) { // Clean up the file descriptor (either for a file on disk or a shared memory object) if we created it - _fileStream.Dispose(); + _fileStream!.Dispose(); } base.Dispose(disposing); } diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Windows.cs index 87c1cb7c955ff4..8abb4b15654a55 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Windows.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Runtime.InteropServices; -using System.Security; - namespace Microsoft.Win32.SafeHandles { public sealed partial class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOneIsInvalid diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.Windows.cs index 6095bd6e22045e..ca8e0ea28474d5 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.Windows.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; -using System.Runtime.InteropServices; namespace Microsoft.Win32.SafeHandles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.cs b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.cs index 8feed3c1938f40..05ed0f4a0c57a7 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedViewHandle.cs @@ -2,9 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Runtime.InteropServices; -using System.Security; namespace Microsoft.Win32.SafeHandles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj index bf5e90dbb83514..dabd9605b3dce0 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj @@ -2,6 +2,7 @@ System.IO.MemoryMappedFiles true + enable netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.cs index c5c930da468f6c..84ae8fb865a460 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/Interop.Windows.cs @@ -27,7 +27,7 @@ public static SafeMemoryMappedFileHandle CreateFileMapping( ref Kernel32.SECURITY_ATTRIBUTES securityAttributes, int pageProtection, long maximumSize, - string name) + string? name) { // split the long into two ints int capacityHigh, capacityLow; @@ -41,7 +41,7 @@ public static SafeMemoryMappedFileHandle CreateFileMapping( ref Kernel32.SECURITY_ATTRIBUTES securityAttributes, int pageProtection, long maximumSize, - string name) + string? name) { // split the long into two ints int capacityHigh, capacityLow; diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs index 13c8b44717613c..da7fbb0795dd85 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Microsoft.Win32.SafeHandles; -using System.Security; namespace System.IO.MemoryMappedFiles { @@ -15,7 +14,7 @@ public partial class MemoryMappedFile /// out empty). /// private static unsafe SafeMemoryMappedFileHandle CreateCore( - FileStream fileStream, string mapName, + FileStream? fileStream, string? mapName, HandleInheritability inheritability, MemoryMappedFileAccess access, MemoryMappedFileOptions options, long capacity) { @@ -138,7 +137,7 @@ private static FileStream CreateSharedBackingObject(Interop.Sys.MemoryMappedProt // ---- PAL layer ends here ---- // ----------------------------- - private static FileStream CreateSharedBackingObjectUsingMemory( + private static FileStream? CreateSharedBackingObjectUsingMemory( Interop.Sys.MemoryMappedProtections protections, long capacity, HandleInheritability inheritability) { // The POSIX shared memory object name must begin with '/'. After that we just want something short and unique. diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs index b60d81eb1ecfef..c2399181c5a562 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs @@ -5,7 +5,6 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; using System.Runtime.InteropServices; -using System.Security; using System.Threading; namespace System.IO.MemoryMappedFiles @@ -19,10 +18,10 @@ public partial class MemoryMappedFile /// private static SafeMemoryMappedFileHandle CreateCore( - FileStream fileStream, string mapName, HandleInheritability inheritability, + FileStream? fileStream, string? mapName, HandleInheritability inheritability, MemoryMappedFileAccess access, MemoryMappedFileOptions options, long capacity) { - SafeFileHandle fileHandle = fileStream != null ? fileStream.SafeFileHandle : null; + SafeFileHandle? fileHandle = fileStream != null ? fileStream.SafeFileHandle : null; Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = GetSecAttrs(inheritability); @@ -89,7 +88,7 @@ private static SafeMemoryMappedFileHandle CreateOrOpenCore( Debug.Assert(access != MemoryMappedFileAccess.Write, "Callers requesting write access shouldn't try to create a mmf"); - SafeMemoryMappedFileHandle handle = null; + SafeMemoryMappedFileHandle? handle = null; Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = GetSecAttrs(inheritability); int waitRetries = 14; //((2^13)-1)*10ms == approximately 1.4mins diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs index 3bc78030a51c68..f743f1c49d6e0d 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs @@ -4,7 +4,6 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; -using System.Security; namespace System.IO.MemoryMappedFiles { @@ -12,7 +11,7 @@ public partial class MemoryMappedFile : IDisposable { private readonly SafeMemoryMappedFileHandle _handle; private readonly bool _leaveOpen; - private readonly FileStream _fileStream; + private readonly FileStream? _fileStream; internal const int DefaultSize = 0; // Private constructors to be used by the factory methods. @@ -99,17 +98,17 @@ public static MemoryMappedFile CreateFromFile(string path, FileMode mode) return CreateFromFile(path, mode, null, DefaultSize, MemoryMappedFileAccess.ReadWrite); } - public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string mapName) + public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string? mapName) { return CreateFromFile(path, mode, mapName, DefaultSize, MemoryMappedFileAccess.ReadWrite); } - public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string mapName, long capacity) + public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string? mapName, long capacity) { return CreateFromFile(path, mode, mapName, capacity, MemoryMappedFileAccess.ReadWrite); } - public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string mapName, long capacity, + public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string? mapName, long capacity, MemoryMappedFileAccess access) { if (path == null) @@ -173,7 +172,7 @@ public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_CapacityGEFileSizeRequired); } - SafeMemoryMappedFileHandle handle = null; + SafeMemoryMappedFileHandle? handle = null; try { handle = CreateCore(fileStream, mapName, HandleInheritability.None, @@ -190,7 +189,7 @@ public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string return new MemoryMappedFile(handle, fileStream, false); } - public static MemoryMappedFile CreateFromFile(FileStream fileStream, string mapName, long capacity, + public static MemoryMappedFile CreateFromFile(FileStream fileStream, string? mapName, long capacity, MemoryMappedFileAccess access, HandleInheritability inheritability, bool leaveOpen) { @@ -257,19 +256,19 @@ public static MemoryMappedFile CreateFromFile(FileStream fileStream, string mapN // Factory Method Group #3: Creates a new empty memory mapped file. Such memory mapped files are ideal // for IPC, when mapName != null. - public static MemoryMappedFile CreateNew(string mapName, long capacity) + public static MemoryMappedFile CreateNew(string? mapName, long capacity) { return CreateNew(mapName, capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, HandleInheritability.None); } - public static MemoryMappedFile CreateNew(string mapName, long capacity, MemoryMappedFileAccess access) + public static MemoryMappedFile CreateNew(string? mapName, long capacity, MemoryMappedFileAccess access) { return CreateNew(mapName, capacity, access, MemoryMappedFileOptions.None, HandleInheritability.None); } - public static MemoryMappedFile CreateNew(string mapName, long capacity, MemoryMappedFileAccess access, + public static MemoryMappedFile CreateNew(string? mapName, long capacity, MemoryMappedFileAccess access, MemoryMappedFileOptions options, HandleInheritability inheritability) { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs index 1aee1ddb45e579..ba53ece3e476da 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs @@ -4,8 +4,6 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Security; namespace System.IO.MemoryMappedFiles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs index 46c0da405c9acd..4d418f5e420ac3 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs @@ -5,9 +5,7 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; using System.Runtime.InteropServices; -using System.Security; using System.Threading; -using System.Threading.Tasks; namespace System.IO.MemoryMappedFiles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs index a7962912b67085..41f73846f4cc65 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs @@ -4,7 +4,6 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; -using System.Security; namespace System.IO.MemoryMappedFiles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs index 2a62e3d52e085c..6a19f5a537cce4 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs @@ -4,7 +4,6 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; -using System.Security; namespace System.IO.MemoryMappedFiles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs index a67fdd582aa604..3d6d3bc8efccbb 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs @@ -4,7 +4,6 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; -using System.Security; namespace System.IO.MemoryMappedFiles { diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs index 07836fa467ea9e..9ee7d0e7e332ac 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Diagnostics; using Microsoft.DotNet.RemoteExecutor; using Xunit; diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs index a599b935ed5f09..2d8958bf0ba782 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Collections.Generic; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Xunit; diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs index 093796164efb1c..5a799f243c65d3 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Text; using Xunit; namespace System.IO.MemoryMappedFiles.Tests diff --git a/src/libraries/System.Private.CoreLib/src/Interop/Unix/Interop.IOErrors.cs b/src/libraries/System.Private.CoreLib/src/Interop/Unix/Interop.IOErrors.cs index 666220ea19477a..fe3c34a3407182 100644 --- a/src/libraries/System.Private.CoreLib/src/Interop/Unix/Interop.IOErrors.cs +++ b/src/libraries/System.Private.CoreLib/src/Interop/Unix/Interop.IOErrors.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; internal static partial class Interop { diff --git a/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Unlink.cs b/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Unlink.cs index 829210fa7e03fa..9395428de02a92 100644 --- a/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Unlink.cs +++ b/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Unlink.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Runtime.InteropServices; internal static partial class Interop