mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
As VS 2022 doesn't seem to store files with UTF-8 BOM as often anymore, we've been getting more and more pull requests which seemingly randomly change files. This cleans the situation up by removing the BOM from all files that have one. Additionally, `Host.Tests.Feature.rc` was converted from UTF-16 to UTF-8.
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using Microsoft.Win32.SafeHandles;
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace MiniTerm.Native
|
|
{
|
|
/// <summary>
|
|
/// PInvoke signatures for win32 pseudo console 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 ResizePseudoConsole(IntPtr hPC, COORD size);
|
|
|
|
[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);
|
|
}
|
|
}
|