Copy CoreFX FileStream to CoreLib
authorJeremy Kuhne <jeremy.kuhne@microsoft.com>
Wed, 26 Oct 2016 04:52:41 +0000 (21:52 -0700)
committerJeremy Kuhne <jeremy.kuhne@microsoft.com>
Fri, 28 Oct 2016 18:52:18 +0000 (11:52 -0700)
commitdcf8e061063044d7ad1218d4aaccdad5d54e39e3
tree1bfba125e5377430fcc727b90e3ce81e49d686bf
parent5a9b55db90c8f90aaa7da6e69e6f2d169e00e430
Copy CoreFX FileStream to CoreLib

This copies FileStream to CoreLib and uses it in place of the legacy
FileStream. Code is mostly a direct copy with the addition of a few
internal constructor overloads.

Adds a simple Debug wrapper for BCLDebug to allow keeping the code
the same. Also follows the same pattern for SR wrapping.

Needed to bring down PreAllocatedOverlapped.

- Expose FileStream in model.xml
- Remove native usage of FileStreamAsyncResult
- #ifdef SafeFileHandle creation in existing code (to avoid mismatched
  PAL/CoreFX usage)

Commit migrated from https://github.com/dotnet/coreclr/commit/5a7fb90eb479450cd5671e4531336dea7c072492
78 files changed:
src/coreclr/clr.coreclr.props
src/coreclr/src/inc/dacvars.h
src/coreclr/src/mscorlib/corefx/Debug.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/Interop.Errors.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/Interop.IOErrors.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/Interop.BOOL.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.CancelIoEx.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.CloseHandle.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.CreateFile.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.Errors.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.FileOperations.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.FileTypes.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.FlushFileBuffers.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.FormatMessage.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.GetFileInformationByHandleEx.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.GetFileType_SafeHandle.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.LockFile.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.ReadFile_SafeHandle_IntPtr.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.ReadFile_SafeHandle_NativeOverlapped.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SECURITY_ATTRIBUTES.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SafeCreateFile.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SecurityOptions.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SetEndOfFile.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SetErrorMode.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SetFileInformationByHandle.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.SetFilePointerEx.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.ThreadPoolIO.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.UnsafeCreateFile.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.WriteFile_SafeHandle_IntPtr.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Interop/Windows/mincore/Interop.WriteFile_SafeHandle_NativeOverlapped.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/SR.cs
src/coreclr/src/mscorlib/corefx/System/HResults.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/Error.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/FileStream.NetStandard17.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/FileStream.Unix.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/FileStream.Win32.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/FileStream.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/FileStreamCompletionSource.Win32.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/StreamHelpers.ArrayPoolCopy.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/IO/Win32Marshal.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/Threading/ClrThreadPoolBoundHandle.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/Threading/ClrThreadPoolPreAllocatedOverlapped.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/corefx/System/Threading/DeferredDisposableLifetime.cs [new file with mode: 0644]
src/coreclr/src/mscorlib/model.xml
src/coreclr/src/mscorlib/mscorlib.shared.sources.props
src/coreclr/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs
src/coreclr/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
src/coreclr/src/mscorlib/src/System.Private.CoreLib.txt
src/coreclr/src/mscorlib/src/System/IO/Directory.cs
src/coreclr/src/mscorlib/src/System/IO/File.cs
src/coreclr/src/mscorlib/src/System/IO/FileSystemInfo.cs
src/coreclr/src/mscorlib/src/System/IO/PathInternal.cs
src/coreclr/src/vm/comthreadpool.cpp
src/coreclr/src/vm/microsoft.comservices_i.c
src/coreclr/src/vm/mscorlib.h
src/coreclr/src/vm/nativeoverlapped.cpp
src/coreclr/src/vm/nativeoverlapped.h
src/coreclr/src/vm/vars.cpp
src/coreclr/src/vm/vars.hpp