mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 04:38:24 -06:00
* Add GUIConsole sample * Remove acrylic native functions, add a title bar * Fix WPF app namespaces * Respond to PR feedback * Removed unused native calls, and fix up some stray spaces * Switch pwsh to powershell * Missed a spot. * Fix typo, add newlines
31 lines
1.0 KiB
C#
31 lines
1.0 KiB
C#
using Microsoft.Win32.SafeHandles;
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace GUIConsole.ConPTY.Native
|
|
{
|
|
/// <summary>
|
|
/// PInvoke signatures for Win32's PseudoConsole API.
|
|
/// </summary>
|
|
static class PseudoConsoleApi
|
|
{
|
|
internal const uint PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE = 0x00020016;
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
internal struct COORD
|
|
{
|
|
public short X;
|
|
public short Y;
|
|
}
|
|
|
|
[DllImport("kernel32.dll", SetLastError = true)]
|
|
internal static extern int CreatePseudoConsole(COORD size, SafeFileHandle hInput, SafeFileHandle hOutput, uint dwFlags, out IntPtr phPC);
|
|
|
|
[DllImport("kernel32.dll", SetLastError = true)]
|
|
internal static extern int ClosePseudoConsole(IntPtr hPC);
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
|
internal static extern bool CreatePipe(out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe, IntPtr lpPipeAttributes, int nSize);
|
|
}
|
|
}
|