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

◆ GetStandardFile()

static Stream System.ConsolePal.GetStandardFile ( int handleType,
FileAccess access,
bool useFileAPIs )
inlinestaticprivate

Definition at line 516 of file ConsolePal.cs.

517 {
518 IntPtr stdHandle = global::Interop.Kernel32.GetStdHandle(handleType);
519 if (stdHandle == IntPtr.Zero || stdHandle == InvalidHandleValue || (access != FileAccess.Read && !ConsoleHandleIsWritable(stdHandle)))
520 {
521 return Stream.Null;
522 }
523 return new WindowsConsoleStream(stdHandle, access, useFileAPIs);
524 }
static IntPtr InvalidHandleValue
static unsafe bool ConsoleHandleIsWritable(IntPtr outErrHandle)
static readonly Stream Null
Definition Stream.cs:488

References System.ConsolePal.ConsoleHandleIsWritable(), System.ConsolePal.InvalidHandleValue, System.IO.Stream.Null, and System.IntPtr.Zero.

Referenced by System.ConsolePal.OpenStandardError(), System.ConsolePal.OpenStandardInput(), and System.ConsolePal.OpenStandardOutput().