From d33e87f540055c6a4ec9a9428fba2259e119afb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 5 Feb 2020 17:27:56 +0100
Subject: [PATCH] I/O [NT]: Added dynamic lookup of symbols needed for pty
 handling.

---
 src/ntlibfuncs.h | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/src/ntlibfuncs.h b/src/ntlibfuncs.h
index ce34a53533..101764dcea 100644
--- a/src/ntlibfuncs.h
+++ b/src/ntlibfuncs.h
@@ -21,4 +21,46 @@ NTLIBFUNC(kernel32, BOOL, MoveFileExW, (
   DWORD dwFlags                /* move options  */
 ));
 
+/* The following are needed for pty handling,
+ * and taken from <consoleapi.h> and <processthreadsapi.h>.
+ */
+
+NTLIBFUNC(kernel32, HRESULT, CreatePseudoConsole, (
+  COORD size,
+  HANDLE hInput,
+  HANDLE hOutput,
+  DWORD dwFlags,
+  HPCON *phPC
+));
+
+NTLIBFUNC(kernel32, HRESULT, ResizePseudoConsole, (
+  HPCON hPC,
+  COORD size
+));
+
+NTLIBFUNC(kernel32, VOID, ClosePseudoConsole, (
+  HPCON hPC
+));
+
+NTLIBFUNC(kernel32, BOOL, InitializeProcThreadAttributeList, (
+  LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
+  DWORD dwAttributeCount,
+  DWORD dwFlags,
+  PSIZE_T lpSize
+));
+
+NTLIBFUNC(kernel32, VOID, DeleteProcThreadAttributeList, (
+  LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList
+));
+
+NTLIBFUNC(kernel32, BOOL, UpdateProcThreadAttribute, (
+  LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
+  DWORD dwFlags,
+  DWORD_PTR Attribute,
+  PVOID lpValue,
+  SIZE_T cbSize,
+  PVOID lpPreviousValue,
+  PSIZE_T lpReturnSize
+));
+
 #endif /* __NT__ */
-- 
GitLab