175 else if (
handle.IsInvalid)
256 handle.EnsureThreadPoolBindingInitialized();
280 if (num == 38 || num == 109)
329 handle.EnsureThreadPoolBindingInitialized();
394 handle.EnsureThreadPoolBindingInitialized();
426 if (num != 997 && num != 0)
455 handle.EnsureThreadPoolBindingInitialized();
485 if (num != 997 && num != 0)
498 for (
int i = 0; i <
count; i++)
515 for (
int i = 0; i <
count; i++)
545 for (
int i = 0; i <
count; i++)
625 handle.EnsureThreadPoolBindingInitialized();
702 handle.EnsureThreadPoolBindingInitialized();
743 ptr->EventHandle =
resetEvent.SafeWaitHandle.DangerousGetHandle();
static unsafe int ReadFile(IntPtr handle, byte *bytes, int numBytesToRead, out int numBytesRead, IntPtr mustBeZero)
static unsafe int WriteFileGather(SafeHandle hFile, long *aSegmentArray, int nNumberOfBytesToWrite, IntPtr lpReserved, NativeOverlapped *lpOverlapped)
static unsafe int WriteFile(IntPtr handle, byte *bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero)
static unsafe int ReadFileScatter(SafeHandle hFile, long *aSegmentArray, int nNumberOfBytesToRead, IntPtr lpReserved, NativeOverlapped *lpOverlapped)
static unsafe bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void *lpFileInformation, uint dwBufferSize)
static unsafe bool GetOverlappedResult(SafeFileHandle hFile, NativeOverlapped *lpOverlapped, ref int lpNumberOfBytesTransferred, bool bWait)
static Exception GetIOError(int errorCode, string path)
static int SystemPageSize
unsafe void FreeNativeOverlapped(NativeOverlapped *pOverlapped)
CallbackResetEvent(ThreadPoolBoundHandle threadPoolBoundHandle)
readonly ThreadPoolBoundHandle _threadPoolBoundHandle
static unsafe void CleanupScatterGatherBuffers(MemoryHandle[] handlesToDispose, IntPtr segmentsPtr)
static Memory< byte > buffer
static async ValueTask WriteGatherAtOffsetMultipleSyscallsAsync(SafeFileHandle handle, IReadOnlyList< ReadOnlyMemory< byte > > buffers, long fileOffset, CancellationToken cancellationToken)
static unsafe void WriteAtOffset(SafeFileHandle handle, ReadOnlySpan< byte > buffer, long fileOffset)
static unsafe int ReadAtOffset(SafeFileHandle handle, Span< byte > buffer, long fileOffset)
static unsafe void WriteSyncUsingAsyncHandle(SafeFileHandle handle, ReadOnlySpan< byte > buffer, long fileOffset)
static async ValueTask WriteGatherAtOffsetSingleSyscallAsync(SafeFileHandle handle, MemoryHandle[] handlesToDispose, IntPtr segmentsPtr, long fileOffset, int totalBytes, CancellationToken cancellationToken)
static unsafe(SafeFileHandle.OverlappedValueTaskSource vts, int errorCode) QueueAsyncReadFile(SafeFileHandle handle
static unsafe int ReadSyncUsingAsyncHandle(SafeFileHandle handle, Span< byte > buffer, long fileOffset)
static async ValueTask< long > ReadScatterAtOffsetMultipleSyscallsAsync(SafeFileHandle handle, IReadOnlyList< Memory< byte > > buffers, long fileOffset, CancellationToken cancellationToken)
static ValueTask ScheduleSyncWriteGatherAtOffsetAsync(SafeFileHandle handle, IReadOnlyList< ReadOnlyMemory< byte > > buffers, long fileOffset, CancellationToken cancellationToken)
static ValueTask< long > ScheduleSyncReadScatterAtOffsetAsync(SafeFileHandle handle, IReadOnlyList< Memory< byte > > buffers, long fileOffset, CancellationToken cancellationToken)
static NativeOverlapped GetNativeOverlappedForSyncHandle(SafeFileHandle handle, long fileOffset)
static async ValueTask< long > ReadScatterAtOffsetSingleSyscallAsync(SafeFileHandle handle, MemoryHandle[] handlesToDispose, IntPtr segmentsPtr, long fileOffset, int totalBytes, CancellationToken cancellationToken)
static unsafe NativeOverlapped * GetNativeOverlappedForAsyncHandle(ThreadPoolBoundHandle threadPoolBinding, long fileOffset, CallbackResetEvent resetEvent)
static ValueTask< long > ReadAsync(SafeFileHandle handle, IReadOnlyList< Memory< byte > > buffers, long fileOffset, CancellationToken cancellationToken=default(CancellationToken))
static Memory< byte > long CancellationToken OSFileStreamStrategy strategy
static unsafe ValueTask WriteFileGatherAsync(SafeFileHandle handle, IntPtr segmentsPtr, int bytesToWrite, long fileOffset, CancellationToken cancellationToken)
static ValueTask WriteAtOffsetAsync(SafeFileHandle handle, ReadOnlyMemory< byte > buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy strategy=null)
static ValueTask WriteAsync(SafeFileHandle handle, ReadOnlyMemory< byte > buffer, long fileOffset, CancellationToken cancellationToken=default(CancellationToken))
static void Write(SafeFileHandle handle, IReadOnlyList< ReadOnlyMemory< byte > > buffers, long fileOffset)
static ValueTask WriteAsync(SafeFileHandle handle, IReadOnlyList< ReadOnlyMemory< byte > > buffers, long fileOffset, CancellationToken cancellationToken=default(CancellationToken))
static ValueTask< int > ReadAsync(SafeFileHandle handle, Memory< byte > buffer, long fileOffset, CancellationToken cancellationToken=default(CancellationToken))
static unsafe bool TryPrepareScatterGatherBuffers< T, THandler >(IReadOnlyList< T > buffers, THandler handler, [NotNullWhen(true)] out MemoryHandle[] handlesToDispose, out IntPtr segmentsPtr, out int totalBytes)
static void ValidateInput(SafeFileHandle handle, long fileOffset)
static unsafe long GetFileLength(SafeFileHandle handle)
static ValueTask< long > ReadScatterAtOffsetAsync(SafeFileHandle handle, IReadOnlyList< Memory< byte > > buffers, long fileOffset, CancellationToken cancellationToken)
static void ValidateBuffers< T >(IReadOnlyList< T > buffers)
static ValueTask< int > ReadAtOffsetAsync(SafeFileHandle handle, Memory< byte > buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy strategy=null)
static bool CanUseScatterGatherWindowsAPIs(SafeFileHandle handle)
static readonly IOCompletionCallback s_callback
static unsafe IOCompletionCallback AllocateCallback()
static int Read(SafeFileHandle handle, Span< byte > buffer, long fileOffset)
static long GetLength(SafeFileHandle handle)
static void WriteGatherAtOffset(SafeFileHandle handle, IReadOnlyList< ReadOnlyMemory< byte > > buffers, long fileOffset)
static void Write(SafeFileHandle handle, ReadOnlySpan< byte > buffer, long fileOffset)
static long Read(SafeFileHandle handle, IReadOnlyList< Memory< byte > > buffers, long fileOffset)
static Memory< byte > long CancellationToken cancellationToken
static long ReadScatterAtOffset(SafeFileHandle handle, IReadOnlyList< Memory< byte > > buffers, long fileOffset)
static ValueTask WriteGatherAtOffsetAsync(SafeFileHandle handle, IReadOnlyList< ReadOnlyMemory< byte > > buffers, long fileOffset, CancellationToken cancellationToken)
static Memory< byte > long fileOffset
static unsafe ValueTask< int > ReadFileScatterAsync(SafeFileHandle handle, IntPtr segmentsPtr, int bytesToRead, long fileOffset, CancellationToken cancellationToken)
static ValueTask< int > ScheduleSyncReadAtOffsetAsync(SafeFileHandle handle, Memory< byte > buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy strategy)
static ValueTask ScheduleSyncWriteAtOffsetAsync(SafeFileHandle handle, ReadOnlyMemory< byte > buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy strategy)
static readonly int s_cachedPageSize
static int GetLastWin32ErrorAndDisposeHandleIfInvalid(SafeFileHandle handle)
static Exception GetExceptionForLastWin32Error(string path="")
static Exception GetExceptionForWin32Error(int errorCode, string path="")
static unsafe void Free(void *ptr)
static unsafe void * Alloc(nuint elementCount, nuint elementSize)
static string IO_FileTooLong
static int Decrement(ref int location)
unsafe void FreeNativeOverlapped(NativeOverlapped *overlapped)
static unsafe? object GetNativeOverlappedState(NativeOverlapped *overlapped)
static void ThrowArgumentException_InvalidHandle(string paramName)
static void ThrowArgumentOutOfRangeException_NeedNonNegNum(string paramName)
static void ThrowNotSupportedException_UnseekableStream()
static void ThrowArgumentNullException(string name)
static void ThrowObjectDisposedException_FileClosed()
int GetLength(in T memory)
MemoryHandle Pin(in T memory)
unsafe delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped *pOVERLAP)
int GetLength(in Memory< byte > memory)
MemoryHandle Pin(in Memory< byte > memory)
int GetLength(in ReadOnlyMemory< byte > memory)
MemoryHandle Pin(in ReadOnlyMemory< byte > memory)
static readonly IntPtr Zero
static ValueTask CompletedTask
static ValueTask FromCanceled(CancellationToken cancellationToken)
static ValueTask FromException(Exception exception)