Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteAtOffset()

static unsafe void System.IO.RandomAccess.WriteAtOffset ( SafeFileHandle handle,
ReadOnlySpan< byte > buffer,
long fileOffset )
inlinestaticpackage

Definition at line 298 of file RandomAccess.cs.

299 {
300 if (buffer.IsEmpty)
301 {
302 return;
303 }
304 if (handle.IsAsync)
305 {
307 return;
308 }
310 fixed (byte* bytes = &MemoryMarshal.GetReference(buffer))
311 {
313 {
316 {
317 throw Win32Marshal.GetExceptionForWin32Error(lastWin32ErrorAndDisposeHandleIfInvalid, handle.Path);
318 }
319 }
320 }
321 }
static unsafe int WriteFile(IntPtr handle, byte *bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero)
static Memory< byte > buffer
static unsafe void WriteSyncUsingAsyncHandle(SafeFileHandle handle, ReadOnlySpan< byte > buffer, long fileOffset)
static NativeOverlapped GetNativeOverlappedForSyncHandle(SafeFileHandle handle, long fileOffset)
static Memory< byte > long fileOffset
static int GetLastWin32ErrorAndDisposeHandleIfInvalid(SafeFileHandle handle)

References System.IO.RandomAccess.buffer, System.bytes, System.IO.RandomAccess.fileOffset, System.IO.Win32Marshal.GetExceptionForWin32Error(), System.IO.Strategies.FileStreamHelpers.GetLastWin32ErrorAndDisposeHandleIfInvalid(), System.IO.RandomAccess.GetNativeOverlappedForSyncHandle(), System.handle, Interop.Kernel32.WriteFile(), and System.IO.RandomAccess.WriteSyncUsingAsyncHandle().

Referenced by Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal(), System.IO.Strategies.OSFileStreamStrategy.Write(), System.IO.RandomAccess.Write(), System.IO.File.WriteAllBytes(), and System.IO.RandomAccess.WriteGatherAtOffset().