From 8a163271baed0bd362bc869d8aadf9b84c5ed38e Mon Sep 17 00:00:00 2001 From: Youssef Victor <31348972+Youssef1313@users.noreply.github.com> Date: Fri, 6 Dec 2019 21:13:31 +0200 Subject: [PATCH] Remove duplicates of Interop.Kernel32.GenericOperations.GENERIC_READ and GENERIC_WRITE (#292) Remove duplicates of Interop.Kernel32.GenericOperations.GENERIC_READ and GENERIC_WRITE --- src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj | 2 +- .../src/System.IO.FileSystem.AccessControl.csproj | 2 +- src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj | 2 +- .../System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj | 2 +- .../src/System.IO.MemoryMappedFiles.csproj | 4 ++-- src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj | 2 +- src/libraries/System.IO.Ports/src/System.IO.Ports.csproj | 4 ++-- .../src/Interop/Windows/Kernel32/Interop.GenericOperations.cs | 0 .../src/System.Private.CoreLib.Shared.projitems | 1 + .../System.Private.CoreLib/src/System/IO/FileStream.Win32.cs | 4 ++-- .../System.Private.CoreLib/src/System/IO/FileStream.Windows.cs | 5 ----- 11 files changed, 12 insertions(+), 16 deletions(-) rename src/libraries/{Common => System.Private.CoreLib}/src/Interop/Windows/Kernel32/Interop.GenericOperations.cs (100%) diff --git a/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj b/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj index 1e3cdb4..c6c01b0 100644 --- a/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj +++ b/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj @@ -44,6 +44,7 @@ + @@ -80,7 +81,6 @@ - diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj index 439331a..263e491 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj @@ -29,6 +29,7 @@ + @@ -47,7 +48,6 @@ - diff --git a/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj b/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj index ea88c0d..744b94a 100644 --- a/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj +++ b/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj @@ -65,6 +65,7 @@ + @@ -93,7 +94,6 @@ - diff --git a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj index 3b7540f..abd5c83 100644 --- a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj +++ b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj @@ -161,7 +161,7 @@ - + Common\System\Buffers\NativeMemoryManager.cs 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 dabd960..351c959 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj @@ -57,8 +57,8 @@ Common\Interop\Windows\Interop.FlushViewOfFile.cs - - Common\Interop\Windows\Interop.GenericOperations.cs + + Interop\Windows\Interop.GenericOperations.cs Common\Interop\Windows\Interop.GetSystemInfo.cs diff --git a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj index 58efb92..c8b6fdd 100644 --- a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj +++ b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj @@ -27,11 +27,11 @@ + - diff --git a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj index cd78752..dc94ef4 100644 --- a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj +++ b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj @@ -96,8 +96,8 @@ Interop\Windows\Kernel32\Interop.FlushFileBuffers.cs - - Common\Interop\Windows\Kernel32\Interop.GenericOperations.cs + + Interop\Windows\Kernel32\Interop.GenericOperations.cs Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GenericOperations.cs b/src/libraries/System.Private.CoreLib/src/Interop/Windows/Kernel32/Interop.GenericOperations.cs similarity index 100% rename from src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GenericOperations.cs rename to src/libraries/System.Private.CoreLib/src/Interop/Windows/Kernel32/Interop.GenericOperations.cs diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 613fb87..98d2382 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -1045,6 +1045,7 @@ + diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Win32.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Win32.cs index 6266359..71c6d70 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Win32.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Win32.cs @@ -19,8 +19,8 @@ namespace System.IO Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = GetSecAttrs(share); int fAccess = - ((_access & FileAccess.Read) == FileAccess.Read ? GENERIC_READ : 0) | - ((_access & FileAccess.Write) == FileAccess.Write ? GENERIC_WRITE : 0); + ((_access & FileAccess.Read) == FileAccess.Read ? Interop.Kernel32.GenericOperations.GENERIC_READ : 0) | + ((_access & FileAccess.Write) == FileAccess.Write ? Interop.Kernel32.GenericOperations.GENERIC_WRITE : 0); // Our Inheritable bit was stolen from Windows, but should be set in // the security attributes class. Don't leave this bit set. diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs index 03900a1..2e3c412 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs @@ -1148,11 +1148,6 @@ namespace System.IO return completionSource.Task; } - // Windows API definitions, from winbase.h and others - - internal const int GENERIC_READ = unchecked((int)0x80000000); - private const int GENERIC_WRITE = 0x40000000; - // Error codes (not HRESULTS), from winerror.h internal const int ERROR_BROKEN_PIPE = 109; internal const int ERROR_NO_DATA = 232; -- 2.7.4