MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / ensureConsole

Method ensureConsole

src/Update/Program.cs:782–794  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

780
781 static int consoleCreated = 0;
782 static void ensureConsole()
783 {
784 if (Environment.OSVersion.Platform != PlatformID.Win32NT) return;
785
786 if (Interlocked.CompareExchange(ref consoleCreated, 1, 0) == 1) return;
787
788 if (!NativeMethods.AttachConsole(-1)) {
789 NativeMethods.AllocConsole();
790 }
791
792 NativeMethods.GetStdHandle(StandardHandles.STD_ERROR_HANDLE);
793 NativeMethods.GetStdHandle(StandardHandles.STD_OUTPUT_HANDLE);
794 }
795 }
796
797 public class ProgressSource

Callers

nothing calls this directly

Calls 3

AttachConsoleMethod · 0.80
AllocConsoleMethod · 0.80
GetStdHandleMethod · 0.80

Tested by

no test coverage detected