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

◆ ReadFileNative()

static unsafe int System.IO.Strategies.FileStreamHelpers.ReadFileNative ( SafeFileHandle handle,
Span< byte > bytes,
NativeOverlapped * overlapped,
out int errorCode )
inlinestaticpackage

Definition at line 308 of file FileStreamHelpers.cs.

309 {
310 int numBytesRead = 0;
311 int num;
312 fixed (byte* bytes2 = &MemoryMarshal.GetReference(bytes))
313 {
315 }
316 if (num == 0)
317 {
319 return -1;
320 }
321 errorCode = 0;
322 return numBytesRead;
323 }
static unsafe int ReadFile(IntPtr handle, byte *bytes, int numBytesToRead, out int numBytesRead, IntPtr mustBeZero)
static int GetLastWin32ErrorAndDisposeHandleIfInvalid(SafeFileHandle handle)

References System.bytes, System.Runtime.Serialization.Dictionary, System.IO.Strategies.FileStreamHelpers.GetLastWin32ErrorAndDisposeHandleIfInvalid(), System.handle, Interop.Kernel32.ReadFile(), and System.IntPtr.Zero.

Referenced by System.IO.Strategies.FileStreamHelpers.AsyncModeCopyToAsync(), and System.IO.Strategies.Net5CompatFileStreamStrategy.ReadFileNative().