ReactOS  0.4.13-dev-249-gcba1a2f
guiterm.c File Reference
#include <consrv.h>
#include <debug.h>
#include "concfg/font.h"
#include "guiterm.h"
#include "resource.h"
Include dependency graph for guiterm.c:

Go to the source code of this file.

Classes

struct  _GUI_INIT_INFO
 

Macros

#define NDEBUG
 
#define CONGUI_UPDATE_TIME   0
 
#define CONGUI_UPDATE_TIMER   1
 
#define PM_CREATE_CONSOLE   (WM_APP + 1)
 
#define PM_DESTROY_CONSOLE   (WM_APP + 2)
 

Typedefs

typedef struct _GUI_INIT_INFO GUI_INIT_INFO
 
typedef struct _GUI_INIT_INFOPGUI_INIT_INFO
 

Functions

VOID SetConWndConsoleLeaderCID (IN PGUI_CONSOLE_DATA GuiData)
 
BOOLEAN RegisterConWndClass (IN HINSTANCE hInstance)
 
BOOLEAN UnRegisterConWndClass (HINSTANCE hInstance)
 
VOID GuiConsoleMoveWindow (PGUI_CONSOLE_DATA GuiData)
 
static VOID DrawRegion (PGUI_CONSOLE_DATA GuiData, SMALL_RECT *Region)
 
VOID InvalidateCell (PGUI_CONSOLE_DATA GuiData, SHORT x, SHORT y)
 
VOID CreateSysMenu (HWND hWnd)
 
static ULONG NTAPI GuiConsoleInputThread (PVOID Param)
 
static BOOL GuiInit (IN PCONSOLE_INIT_INFO ConsoleInitInfo, IN HANDLE ConsoleLeaderProcessHandle, IN OUT PGUI_INIT_INFO GuiInitInfo)
 
static VOID NTAPI GuiDeinitFrontEnd (IN OUT PFRONTEND This)
 
static NTSTATUS NTAPI GuiInitFrontEnd (IN OUT PFRONTEND This, IN PCONSRV_CONSOLE Console)
 
static VOID NTAPI GuiDrawRegion (IN OUT PFRONTEND This, SMALL_RECT *Region)
 
static VOID NTAPI GuiWriteStream (IN OUT PFRONTEND This, SMALL_RECT *Region, SHORT CursorStartX, SHORT CursorStartY, UINT ScrolledLines, PWCHAR Buffer, UINT Length)
 
VOID NTAPI GuiRingBell (IN OUT PFRONTEND This)
 
static BOOL NTAPI GuiSetCursorInfo (IN OUT PFRONTEND This, PCONSOLE_SCREEN_BUFFER Buff)
 
static BOOL NTAPI GuiSetScreenInfo (IN OUT PFRONTEND This, PCONSOLE_SCREEN_BUFFER Buff, SHORT OldCursorX, SHORT OldCursorY)
 
static VOID NTAPI GuiResizeTerminal (IN OUT PFRONTEND This)
 
static VOID NTAPI GuiSetActiveScreenBuffer (IN OUT PFRONTEND This)
 
static VOID NTAPI GuiReleaseScreenBuffer (IN OUT PFRONTEND This, IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
 
static BOOL NTAPI GuiSetMouseCursor (IN OUT PFRONTEND This, HCURSOR CursorHandle)
 
static VOID NTAPI GuiRefreshInternalInfo (IN OUT PFRONTEND This)
 
static VOID NTAPI GuiChangeTitle (IN OUT PFRONTEND This)
 
static BOOL NTAPI GuiChangeIcon (IN OUT PFRONTEND This, HICON IconHandle)
 
static HDESK NTAPI GuiGetThreadConsoleDesktop (IN OUT PFRONTEND This)
 
static HWND NTAPI GuiGetConsoleWindowHandle (IN OUT PFRONTEND This)
 
static VOID NTAPI GuiGetLargestConsoleWindowSize (IN OUT PFRONTEND This, PCOORD pSize)
 
static BOOL NTAPI GuiGetSelectionInfo (IN OUT PFRONTEND This, PCONSOLE_SELECTION_INFO pSelectionInfo)
 
static BOOL NTAPI GuiSetPalette (IN OUT PFRONTEND This, HPALETTE PaletteHandle, UINT PaletteUsage)
 
static ULONG NTAPI GuiGetDisplayMode (IN OUT PFRONTEND This)
 
static BOOL NTAPI GuiSetDisplayMode (IN OUT PFRONTEND This, ULONG NewMode)
 
static INT NTAPI GuiShowMouseCursor (IN OUT PFRONTEND This, BOOL Show)
 
static HMENU NTAPI GuiMenuControl (IN OUT PFRONTEND This, UINT CmdIdLow, UINT CmdIdHigh)
 
static BOOL NTAPI GuiSetMenuClose (IN OUT PFRONTEND This, BOOL Enable)
 
NTSTATUS NTAPI GuiLoadFrontEnd (IN OUT PFRONTEND FrontEnd, IN OUT PCONSOLE_STATE_INFO ConsoleInfo, IN OUT PCONSOLE_INIT_INFO ConsoleInitInfo, IN HANDLE ConsoleLeaderProcessHandle)
 
NTSTATUS NTAPI GuiUnloadFrontEnd (IN OUT PFRONTEND FrontEnd)
 

Variables

static BOOL ConsInitialized = FALSE
 
HICON ghDefaultIcon
 
HICON ghDefaultIconSm
 
HCURSOR ghDefaultCursor
 
static FRONTEND_VTBL GuiVtbl
 

Macro Definition Documentation

◆ CONGUI_UPDATE_TIME

#define CONGUI_UPDATE_TIME   0

Definition at line 24 of file guiterm.c.

◆ CONGUI_UPDATE_TIMER

#define CONGUI_UPDATE_TIMER   1

Definition at line 25 of file guiterm.c.

◆ NDEBUG

#define NDEBUG

Definition at line 16 of file guiterm.c.

◆ PM_CREATE_CONSOLE

#define PM_CREATE_CONSOLE   (WM_APP + 1)

Definition at line 27 of file guiterm.c.

◆ PM_DESTROY_CONSOLE

#define PM_DESTROY_CONSOLE   (WM_APP + 2)

Definition at line 28 of file guiterm.c.

Typedef Documentation

◆ GUI_INIT_INFO

◆ PGUI_INIT_INFO

Function Documentation

◆ CreateSysMenu()

VOID CreateSysMenu ( HWND  hWnd)

Definition at line 231 of file conwnd.c.

232 {
233  MENUITEMINFOW mii;
234  HMENU hMenu;
235  PWCHAR ptrTab;
236  WCHAR szMenuStringBack[255];
237 
238  hMenu = GetSystemMenu(hWnd, FALSE);
239  if (hMenu == NULL)
240  return;
241 
242  mii.cbSize = sizeof(mii);
243  mii.fMask = MIIM_STRING;
244  mii.dwTypeData = szMenuStringBack;
245  mii.cch = ARRAYSIZE(szMenuStringBack);
246 
247  GetMenuItemInfoW(hMenu, SC_CLOSE, FALSE, &mii);
248 
249  ptrTab = wcschr(szMenuStringBack, L'\t');
250  if (ptrTab)
251  {
252  *ptrTab = L'\0';
253  mii.cch = wcslen(szMenuStringBack);
254 
255  SetMenuItemInfoW(hMenu, SC_CLOSE, FALSE, &mii);
256  }
257 
259  DrawMenuBar(hWnd);
260 }
BOOL WINAPI DrawMenuBar(_In_ HWND)
HWND hWnd
Definition: settings.c:17
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LPWSTR dwTypeData
Definition: winuser.h:3211
uint16_t * PWCHAR
Definition: typedefs.h:54
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const GUICONSOLE_MENUITEM GuiConsoleMainMenuItems[]
Definition: conwnd.c:85
static const WCHAR L[]
Definition: oid.c:1250
#define MIIM_STRING
Definition: winuser.h:722
#define SC_CLOSE
Definition: winuser.h:2546
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static VOID AppendMenuItems(HMENU hMenu, const GUICONSOLE_MENUITEM *Items)
Definition: conwnd.c:177

Referenced by GuiConsoleInputThread().

◆ DrawRegion()

static VOID DrawRegion ( PGUI_CONSOLE_DATA  GuiData,
SMALL_RECT Region 
)
static

UpdateWindow(GuiData->hWindow);

Definition at line 76 of file guiterm.c.

78 {
79  RECT RegionRect;
80 
81  SmallRectToRect(GuiData, &RegionRect, Region);
82  /* Do not erase the background: it speeds up redrawing and reduce flickering */
83  InvalidateRect(GuiData->hWindow, &RegionRect, FALSE);
85 }
FORCEINLINE VOID SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect)
Definition: guiterm.h:43
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by GuiDrawRegion(), GuiWriteStream(), and InvalidateCell().

◆ GuiChangeIcon()

static BOOL NTAPI GuiChangeIcon ( IN OUT PFRONTEND  This,
HICON  IconHandle 
)
static

Definition at line 877 of file guiterm.c.

879 {
880  PGUI_CONSOLE_DATA GuiData = This->Context;
882 
883  if (IconHandle == NULL)
884  {
887  }
888  else
889  {
890  hIcon = CopyIcon(IconHandle);
891  hIconSm = CopyIcon(IconHandle);
892  }
893 
894  if (hIcon == NULL)
895  return FALSE;
896 
897  if (hIcon != GuiData->hIcon)
898  {
899  if (GuiData->hIcon != NULL && GuiData->hIcon != ghDefaultIcon)
900  {
901  DestroyIcon(GuiData->hIcon);
902  }
903  if (GuiData->hIconSm != NULL && GuiData->hIconSm != ghDefaultIconSm)
904  {
905  DestroyIcon(GuiData->hIconSm);
906  }
907 
908  GuiData->hIcon = hIcon;
909  GuiData->hIconSm = hIconSm;
910 
911  DPRINT("Set icons in GuiChangeIcon\n");
912  PostMessageW(GuiData->hWindow, WM_SETICON, ICON_BIG , (LPARAM)GuiData->hIcon );
913  PostMessageW(GuiData->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)GuiData->hIconSm);
914  }
915 
916  return TRUE;
917 }
HICON ghDefaultIcon
Definition: conwnd.c:62
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
HICON ghDefaultIconSm
Definition: conwnd.c:63
#define ICON_SMALL
Definition: tnclass.cpp:48
HICON hIconSm
Definition: conwnd.h:67
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
HICON WINAPI CopyIcon(_In_ HICON)
Definition: cursoricon.c:1980
HICON hIcon
Definition: msconfig.c:44
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON hIconSm
Definition: msconfig.c:44
#define ICON_BIG
Definition: tnclass.cpp:51

◆ GuiChangeTitle()

static VOID NTAPI GuiChangeTitle ( IN OUT PFRONTEND  This)
static

Definition at line 870 of file guiterm.c.

871 {
872  PGUI_CONSOLE_DATA GuiData = This->Context;
873  PostMessageW(GuiData->hWindow, PM_CONSOLE_SET_TITLE, 0, 0);
874 }
#define PM_CONSOLE_SET_TITLE
Definition: guiterm.c:44
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GuiConsoleInputThread()

static ULONG NTAPI GuiConsoleInputThread ( PVOID  Param)
static

Definition at line 105 of file guiterm.c.

106 {
108  PCSR_THREAD pcsrt = NULL;
109  PGUI_INIT_INFO GuiInitInfo = (PGUI_INIT_INFO)Param;
110  DESKTOP_CONSOLE_THREAD DesktopConsoleThreadInfo;
112  HANDLE hThread = NULL;
113 
114  LONG WindowCount = 0;
115  MSG msg;
116 
117  /*
118  * This thread dispatches all the console notifications to the
119  * notification window. It is common for all the console windows
120  * in a given desktop in a window station.
121  */
122 
123  /* Assign this console input thread to this desktop */
124  DesktopConsoleThreadInfo.DesktopHandle = GuiInitInfo->Desktop; // Duplicated desktop handle
125  DesktopConsoleThreadInfo.ThreadId = InputThreadId;
127  &DesktopConsoleThreadInfo,
128  sizeof(DesktopConsoleThreadInfo));
129  if (!NT_SUCCESS(Status)) goto Quit;
130 
131  /* Connect this CSR thread to the USER subsystem */
132  pcsrt = CsrConnectToUser();
133  if (pcsrt == NULL) goto Quit;
134  hThread = pcsrt->ThreadHandle;
135 
136  /* Assign the desktop to this thread */
137  if (!SetThreadDesktop(DesktopConsoleThreadInfo.DesktopHandle)) goto Quit;
138 
139  /* The thread has been initialized, set the event */
140  NtSetEvent(GuiInitInfo->GuiThreadStartupEvent, NULL);
142 
143  while (GetMessageW(&msg, NULL, 0, 0))
144  {
145  switch (msg.message)
146  {
147  case PM_CREATE_CONSOLE:
148  {
149  PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)msg.lParam;
150  PCONSRV_CONSOLE Console = GuiData->Console;
151  HWND NewWindow;
152  RECT rcWnd;
153 
154  DPRINT("PM_CREATE_CONSOLE -- creating window\n");
155 
156  NewWindow = CreateWindowExW(WS_EX_CLIENTEDGE,
158  Console->Title.Buffer,
165  NULL,
167  (PVOID)GuiData);
168  if (NewWindow == NULL)
169  {
170  DPRINT1("Failed to create a new console window\n");
171  continue;
172  }
173 
174  ASSERT(NewWindow == GuiData->hWindow);
175 
177 
178  //
179  // FIXME: TODO: Move everything there into conwnd.c!OnNcCreate()
180  //
181 
182  /* Retrieve our real position */
183  // See conwnd.c!OnMove()
184  GetWindowRect(GuiData->hWindow, &rcWnd);
185  GuiData->GuiInfo.WindowOrigin.x = rcWnd.left;
186  GuiData->GuiInfo.WindowOrigin.y = rcWnd.top;
187 
188  if (GuiData->IsWindowVisible)
189  {
190  /* Move and resize the window to the user's values */
191  /* CAN WE DEADLOCK ?? */
192  GuiConsoleMoveWindow(GuiData); // FIXME: This MUST be done via the CreateWindowExW call.
193  SendMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0);
194  }
195 
196  // FIXME: HACK: Potential HACK for CORE-8129; see revision 63595.
197  CreateSysMenu(GuiData->hWindow);
198 
199  if (GuiData->IsWindowVisible)
200  {
201  /* Switch to full-screen mode if necessary */
202  // FIXME: Move elsewhere, it cause misdrawings of the window.
203  if (GuiData->GuiInfo.FullScreen) SwitchFullScreen(GuiData, TRUE);
204 
205  DPRINT("PM_CREATE_CONSOLE -- showing window\n");
206  ShowWindowAsync(NewWindow, (int)GuiData->GuiInfo.ShowWindow);
207  }
208  else
209  {
210  DPRINT("PM_CREATE_CONSOLE -- hidden window\n");
211  ShowWindowAsync(NewWindow, SW_HIDE);
212  }
213 
214  continue;
215  }
216 
217  case PM_DESTROY_CONSOLE:
218  {
219  PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)msg.lParam;
220  MSG TempMsg;
221 
222  /* Exit the full screen mode if it was already set */
223  // LeaveFullScreen(GuiData);
224 
225  /*
226  * Window creation is done using a PostMessage(), so it's possible
227  * that the window that we want to destroy doesn't exist yet.
228  * So first empty the message queue.
229  */
230  while (PeekMessageW(&TempMsg, NULL, 0, 0, PM_REMOVE))
231  {
232  DispatchMessageW(&TempMsg);
233  }
234 
235  if (GuiData->hWindow == NULL) continue;
236 
237  DestroyWindow(GuiData->hWindow);
238 
239  NtSetEvent(GuiData->hGuiTermEvent, NULL);
240 
242  {
243  DPRINT("CONSRV: Going to quit the Input Thread 0x%p\n", InputThreadId);
244  goto Quit;
245  }
246 
247  continue;
248  }
249  }
250 
253  }
254 
255 Quit:
256  DPRINT("CONSRV: Quit the Input Thread 0x%p, Status = 0x%08lx\n", InputThreadId, Status);
257 
258  /* Remove this console input thread from this desktop */
259  // DesktopConsoleThreadInfo.DesktopHandle;
260  DesktopConsoleThreadInfo.ThreadId = 0;
262  &DesktopConsoleThreadInfo,
263  sizeof(DesktopConsoleThreadInfo));
264 
265  /* Close the duplicated desktop handle */
266  CloseDesktop(DesktopConsoleThreadInfo.DesktopHandle); // NtUserCloseDesktop
267 
268  /* Cleanup CSR thread */
269  if (pcsrt)
270  {
271  if (hThread != pcsrt->ThreadHandle)
272  DPRINT1("WARNING!! hThread (0x%p) != pcsrt->ThreadHandle (0x%p), you may expect crashes soon!!\n", hThread, pcsrt->ThreadHandle);
273 
274  CsrDereferenceThread(pcsrt);
275  }
276 
277  /* Exit the thread */
279  return 0;
280 }
HANDLE hGuiTermEvent
Definition: conwnd.h:45
VOID CreateSysMenu(HWND hWnd)
Definition: conwnd.c:231
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
#define PM_DESTROY_CONSOLE
Definition: guiterm.c:28
long x
Definition: polytest.cpp:48
NTSYSAPI VOID NTAPI RtlExitUserThread(_In_ NTSTATUS Status)
#define SW_HIDE
Definition: winuser.h:762
struct _GUI_CONSOLE_DATA * PGUI_CONSOLE_DATA
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
LONG NTSTATUS
Definition: precomp.h:26
#define HandleToUlong(h)
Definition: basetsd.h:79
HDESK Desktop
Definition: guiterm.c:38
static UINT WindowCount
Definition: multiwin.c:4
#define HWND_MESSAGE
Definition: winuser.h:1196
VOID NTAPI CsrDereferenceThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:775
#define PCONSRV_CONSOLE
Definition: conio.h:27
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_CREATE_CONSOLE
Definition: guiterm.c:27
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
uint32_t ULONG_PTR
Definition: typedefs.h:63
while(1)
Definition: macro.lex.yy.c:740
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
long LONG
Definition: pedump.c:60
NTSTATUS APIENTRY NtUserConsoleControl(IN CONSOLECONTROL ConsoleCtrl, IN PVOID ConsoleCtrlInfo, IN ULONG ConsoleCtrlInfoLength)
Definition: console.c:14
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen)
Definition: fullscreen.c:49
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1176
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
Definition: event.c:458
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
struct _GUI_INIT_INFO * PGUI_INIT_INFO
#define GUI_CONWND_CLASS
Definition: conwnd.h:15
HANDLE UniqueThread
Definition: compat.h:475
HANDLE ThreadHandle
Definition: csrsrv.h:71
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define InterlockedDecrement
Definition: armddk.h:52
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
HANDLE GuiThreadStartupEvent
Definition: guiterm.c:35
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
Status
Definition: gdiplustypes.h:24
PCSR_THREAD NTAPI CsrConnectToUser(VOID)
Definition: api.c:1003
#define InterlockedIncrement
Definition: armddk.h:53
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define PM_RESIZE_TERMINAL
Definition: guiterm.c:42
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData)
Definition: guiterm.c:61
#define HWND_DESKTOP
Definition: winuser.h:1195
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HANDLE hThread
Definition: wizard.c:27
CConsole Console
#define DPRINT1
Definition: precomp.h:8
GUI_CONSOLE_INFO GuiInfo
Definition: conwnd.h:96
HINSTANCE ConSrvDllInstance
Definition: init.c:21
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI CloseDesktop(_In_ HDESK)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
PCONSRV_CONSOLE Console
Definition: conwnd.h:90
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by GuiInit().

◆ GuiConsoleMoveWindow()

VOID GuiConsoleMoveWindow ( PGUI_CONSOLE_DATA  GuiData)

Definition at line 61 of file guiterm.c.

62 {
63  /* Move the window if needed (not positioned by the system) */
64  if (!GuiData->GuiInfo.AutoPosition)
65  {
66  SetWindowPos(GuiData->hWindow,
67  NULL,
68  GuiData->GuiInfo.WindowOrigin.x,
69  GuiData->GuiInfo.WindowOrigin.y,
70  0, 0,
72  }
73 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define SWP_NOZORDER
Definition: winuser.h:1232
smooth NULL
Definition: ftsmooth.c:416
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define SWP_NOSIZE
Definition: winuser.h:1230
GUI_CONSOLE_INFO GuiInfo
Definition: conwnd.h:96
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by GuiConsoleInputThread(), and GuiConsoleNotifyWndProc().

◆ GuiDeinitFrontEnd()

static VOID NTAPI GuiDeinitFrontEnd ( IN OUT PFRONTEND  This)
static

Definition at line 594 of file guiterm.c.

595 {
596  PGUI_CONSOLE_DATA GuiData = This->Context;
597 
598  DPRINT("Send PM_DESTROY_CONSOLE message and wait on hGuiTermEvent...\n");
601  DPRINT("hGuiTermEvent set\n");
602  NtClose(GuiData->hGuiTermEvent);
603  GuiData->hGuiTermEvent = NULL;
604 
605  CloseDesktop(GuiData->Desktop); // NtUserCloseDesktop
606  CloseWindowStation(GuiData->WinSta); // NtUserCloseWindowStation
607 
608  DPRINT("Destroying icons !! - GuiData->hIcon = 0x%p ; ghDefaultIcon = 0x%p ; GuiData->hIconSm = 0x%p ; ghDefaultIconSm = 0x%p\n",
609  GuiData->hIcon, ghDefaultIcon, GuiData->hIconSm, ghDefaultIconSm);
610  if (GuiData->hIcon != NULL && GuiData->hIcon != ghDefaultIcon)
611  {
612  DPRINT("Destroy hIcon\n");
613  DestroyIcon(GuiData->hIcon);
614  }
615  if (GuiData->hIconSm != NULL && GuiData->hIconSm != ghDefaultIconSm)
616  {
617  DPRINT("Destroy hIconSm\n");
618  DestroyIcon(GuiData->hIconSm);
619  }
620 
621  This->Context = NULL;
622  DeleteCriticalSection(&GuiData->Lock);
623  ConsoleFreeHeap(GuiData);
624 
625  DPRINT("Quit GuiDeinitFrontEnd\n");
626 }
HICON ghDefaultIcon
Definition: conwnd.c:62
HANDLE hGuiTermEvent
Definition: conwnd.h:45
#define PM_DESTROY_CONSOLE
Definition: guiterm.c:28
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
HWINSTA WinSta
Definition: conwnd.h:49
HICON ghDefaultIconSm
Definition: conwnd.c:63
HDESK Desktop
Definition: conwnd.h:50
HICON hIconSm
Definition: conwnd.h:67
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
CRITICAL_SECTION Lock
Definition: conwnd.h:42
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
BOOL WINAPI CloseDesktop(_In_ HDESK)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
ULONG_PTR InputThreadId
Definition: conwnd.h:48
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)

Referenced by GuiInitFrontEnd(), and GuiUnloadFrontEnd().

◆ GuiDrawRegion()

static VOID NTAPI GuiDrawRegion ( IN OUT PFRONTEND  This,
SMALL_RECT Region 
)
static

Definition at line 629 of file guiterm.c.

631 {
632  PGUI_CONSOLE_DATA GuiData = This->Context;
633 
634  /* Do nothing if the window is hidden */
635  if (!GuiData->IsWindowVisible) return;
636 
637  DrawRegion(GuiData, Region);
638 }
static VOID DrawRegion(PGUI_CONSOLE_DATA GuiData, SMALL_RECT *Region)
Definition: guiterm.c:76
BOOLEAN IsWindowVisible
Definition: conwnd.h:52

◆ GuiGetConsoleWindowHandle()

static HWND NTAPI GuiGetConsoleWindowHandle ( IN OUT PFRONTEND  This)
static

Definition at line 927 of file guiterm.c.

928 {
929  PGUI_CONSOLE_DATA GuiData = This->Context;
930  return GuiData->hWindow;
931 }

◆ GuiGetDisplayMode()

static ULONG NTAPI GuiGetDisplayMode ( IN OUT PFRONTEND  This)
static

Definition at line 1038 of file guiterm.c.

1039 {
1040  PGUI_CONSOLE_DATA GuiData = This->Context;
1041  ULONG DisplayMode = 0;
1042 
1043  if (GuiData->GuiInfo.FullScreen)
1044  DisplayMode |= CONSOLE_FULLSCREEN_HARDWARE; // CONSOLE_FULLSCREEN
1045  else
1047 
1048  return DisplayMode;
1049 }
#define CONSOLE_FULLSCREEN_HARDWARE
Definition: wincon.h:30
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:116
#define CONSOLE_WINDOWED
Definition: wincon.h:28
GUI_CONSOLE_INFO GuiInfo
Definition: conwnd.h:96
unsigned int ULONG
Definition: retypes.h:1

◆ GuiGetLargestConsoleWindowSize()

static VOID NTAPI GuiGetLargestConsoleWindowSize ( IN OUT PFRONTEND  This,
PCOORD  pSize 
)
static

Definition at line 934 of file guiterm.c.

936 {
937  PGUI_CONSOLE_DATA GuiData = This->Context;
938  PCONSOLE_SCREEN_BUFFER ActiveBuffer;
939  HMONITOR hMonitor;
940  MONITORINFO MonitorInfo;
941  LONG Width, Height;
942  UINT WidthUnit, HeightUnit;
943 
944  if (!pSize) return;
945 
946  /*
947  * Retrieve the monitor that is mostly covered by the current console window;
948  * default to primary monitor otherwise.
949  */
950  MonitorInfo.cbSize = sizeof(MonitorInfo);
951  hMonitor = MonitorFromWindow(GuiData->hWindow, MONITOR_DEFAULTTOPRIMARY);
952  if (hMonitor && GetMonitorInfoW(hMonitor, &MonitorInfo))
953  {
954  /* Retrieve the width and height of the client area of this monitor */
955  Width = MonitorInfo.rcWork.right - MonitorInfo.rcWork.left;
956  Height = MonitorInfo.rcWork.bottom - MonitorInfo.rcWork.top;
957  }
958  else
959  {
960  /*
961  * Retrieve the width and height of the client area for a full-screen
962  * window on the primary display monitor.
963  */
966 
967  // RECT WorkArea;
968  // SystemParametersInfoW(SPI_GETWORKAREA, 0, &WorkArea, 0);
969  // Width = WorkArea.right;
970  // Height = WorkArea.bottom;
971  }
972 
973  ActiveBuffer = GuiData->ActiveBuffer;
974 #if 0
975  // NOTE: This would be surprising if we wouldn't have an associated buffer...
976  if (ActiveBuffer)
977 #endif
978  GetScreenBufferSizeUnits(ActiveBuffer, GuiData, &WidthUnit, &HeightUnit);
979 #if 0
980  else
981  /* Default: graphics mode */
982  WidthUnit = HeightUnit = 1;
983 #endif
984 
987 
988  if (Width < 0) Width = 0;
989  if (Height < 0) Height = 0;
990 
991  pSize->X = (SHORT)(Width / (int)WidthUnit ) /* HACK */ + 2;
992  pSize->Y = (SHORT)(Height / (int)HeightUnit) /* HACK */ + 1;
993 }
LONG top
Definition: windef.h:292
#define SM_CXEDGE
Definition: winuser.h:998
LONG left
Definition: windef.h:291
#define SM_CYFRAME
Definition: winuser.h:986
#define SM_CXFRAME
Definition: winuser.h:984
LONG right
Definition: windef.h:293
long LONG
Definition: pedump.c:60
short SHORT
Definition: pedump.c:59
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
#define SM_CYEDGE
Definition: winuser.h:999
ULONG X
Definition: bl.h:1340
#define SM_CYCAPTION
Definition: winuser.h:953
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
int WINAPI GetSystemMetrics(_In_ int)
FORCEINLINE VOID GetScreenBufferSizeUnits(IN PCONSOLE_SCREEN_BUFFER Buffer, IN PGUI_CONSOLE_DATA GuiData, OUT PUINT WidthUnit, OUT PUINT HeightUnit)
Definition: guiterm.h:22
DWORD cbSize
Definition: winuser.h:3726
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
unsigned int UINT
Definition: ndis.h:50
#define SM_CYFULLSCREEN
Definition: winuser.h:968
LONG bottom
Definition: windef.h:294
#define SM_CXFULLSCREEN
Definition: winuser.h:967
ULONG Y
Definition: bl.h:1341

◆ GuiGetSelectionInfo()

static BOOL NTAPI GuiGetSelectionInfo ( IN OUT PFRONTEND  This,
PCONSOLE_SELECTION_INFO  pSelectionInfo 
)
static

Definition at line 996 of file guiterm.c.

998 {
999  PGUI_CONSOLE_DATA GuiData = This->Context;
1000 
1001  if (pSelectionInfo == NULL) return FALSE;
1002 
1003  ZeroMemory(pSelectionInfo, sizeof(*pSelectionInfo));
1004  if (GuiData->Selection.dwFlags != CONSOLE_NO_SELECTION)
1005  RtlCopyMemory(pSelectionInfo, &GuiData->Selection, sizeof(*pSelectionInfo));
1006 
1007  return TRUE;
1008 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define ZeroMemory
Definition: winbase.h:1635
#define CONSOLE_NO_SELECTION
Definition: wincon.h:96
CONSOLE_SELECTION_INFO Selection
Definition: conwnd.h:92
smooth NULL
Definition: ftsmooth.c:416

◆ GuiGetThreadConsoleDesktop()

static HDESK NTAPI GuiGetThreadConsoleDesktop ( IN OUT PFRONTEND  This)
static

Definition at line 920 of file guiterm.c.

921 {
922  PGUI_CONSOLE_DATA GuiData = This->Context;
923  return GuiData->Desktop;
924 }
HDESK Desktop
Definition: conwnd.h:50

◆ GuiInit()

static BOOL GuiInit ( IN PCONSOLE_INIT_INFO  ConsoleInitInfo,
IN HANDLE  ConsoleLeaderProcessHandle,
IN OUT PGUI_INIT_INFO  GuiInitInfo 
)
static

Definition at line 284 of file guiterm.c.

287 {
288  BOOL Success = TRUE;
289  UNICODE_STRING DesktopPath;
290  DESKTOP_CONSOLE_THREAD DesktopConsoleThreadInfo;
291  HWINSTA hWinSta;
292  HDESK hDesk;
293 
295  HANDLE hInputThread;
297 
298  /* Perform one-time initialization */
299  if (!ConsInitialized)
300  {
301  /* Initialize and register the console window class */
303 
304  /* Initialize the font support -- additional TrueType fonts cache */
305  InitTTFontCache();
306 
308  }
309 
310  /*
311  * Set-up the console input thread. We have
312  * one console input thread per desktop.
313  */
314 
316  // return STATUS_BAD_IMPERSONATION_LEVEL;
317  return FALSE;
318 
319  if (ConsoleInitInfo->DesktopLength)
320  {
321  DesktopPath.MaximumLength = ConsoleInitInfo->DesktopLength;
322  DesktopPath.Length = DesktopPath.MaximumLength - sizeof(UNICODE_NULL);
323  DesktopPath.Buffer = ConsoleInitInfo->Desktop;
324  }
325  else
326  {
327  RtlInitUnicodeString(&DesktopPath, L"Default");
328  }
329 
330  hDesk = NtUserResolveDesktop(ConsoleLeaderProcessHandle,
331  &DesktopPath,
332  FALSE,
333  &hWinSta);
334  DPRINT("NtUserResolveDesktop(DesktopPath = '%wZ') returned hDesk = 0x%p; hWinSta = 0x%p\n",
335  &DesktopPath, hDesk, hWinSta);
336 
337  CsrRevertToSelf();
338 
339  if (hDesk == NULL) return FALSE;
340 
341  /*
342  * We need to see whether we need to create a
343  * new console input thread for this desktop.
344  */
345  DesktopConsoleThreadInfo.DesktopHandle = hDesk;
346  DesktopConsoleThreadInfo.ThreadId = (ULONG_PTR)INVALID_HANDLE_VALUE; // Special value to say we just want to retrieve the thread ID.
348  &DesktopConsoleThreadInfo,
349  sizeof(DesktopConsoleThreadInfo));
350  DPRINT("NtUserConsoleControl returned ThreadId = 0x%p\n", DesktopConsoleThreadInfo.ThreadId);
351 
352  /*
353  * Save the opened window station and desktop handles in the initialization
354  * structure. They will be used later on, and released, by the GUI frontend.
355  */
356  GuiInitInfo->WinSta = hWinSta;
357  GuiInitInfo->Desktop = hDesk;
358 
359  /* Here GuiInitInfo contains original handles */
360 
361  /* If we already have a console input thread on this desktop... */
362  if (DesktopConsoleThreadInfo.ThreadId != 0)
363  {
364  /* ... just use it... */
365  DPRINT("Using input thread InputThreadId = 0x%p\n", DesktopConsoleThreadInfo.ThreadId);
366  GuiInitInfo->InputThreadId = DesktopConsoleThreadInfo.ThreadId;
367  goto Quit;
368  }
369 
370  /* ... otherwise create a new one. */
371 
372  /* Initialize a startup event for the thread to signal it */
373  Status = NtCreateEvent(&GuiInitInfo->GuiThreadStartupEvent, EVENT_ALL_ACCESS,
375  if (!NT_SUCCESS(Status))
376  {
377  Success = FALSE;
378  goto Quit;
379  }
380 
381  /*
382  * Duplicate the desktop handle for the console input thread internal needs.
383  * If it happens to need also a window station handle in the future, then
384  * it is there that you also need to duplicate the window station handle!
385  *
386  * Note also that we are going to temporarily overwrite the stored handles
387  * in GuiInitInfo because it happens that we use also this structure to give
388  * the duplicated handles to the input thread that is going to initialize.
389  * After the input thread finishes its initialization, we restore the handles
390  * in GuiInitInfo to their old values.
391  */
393  hDesk,
395  (PHANDLE)&GuiInitInfo->Desktop,
396  0, 0, DUPLICATE_SAME_ACCESS);
397  if (!NT_SUCCESS(Status))
398  {
399  Success = FALSE;
400  goto Quit;
401  }
402 
403  /* Here GuiInitInfo contains duplicated handles */
404 
406  NULL,
407  TRUE, // Start the thread in suspended state
408  0,
409  0,
410  0,
412  (PVOID)GuiInitInfo,
413  &hInputThread,
414  &ClientId);
415  if (NT_SUCCESS(Status))
416  {
417  /* Add it as a static server thread and resume it */
418  CsrAddStaticServerThread(hInputThread, &ClientId, 0);
419  Status = NtResumeThread(hInputThread, NULL);
420  }
421  DPRINT("Thread creation hInputThread = 0x%p, InputThreadId = 0x%p, Status = 0x%08lx\n",
422  hInputThread, ClientId.UniqueThread, Status);
423 
424  if (!NT_SUCCESS(Status) || hInputThread == NULL)
425  {
426  /* Close the thread's handle */
427  if (hInputThread) NtClose(hInputThread);
428 
429  /* We need to close here the duplicated desktop handle */
430  CloseDesktop(GuiInitInfo->Desktop); // NtUserCloseDesktop
431 
432  /* Close the startup event and bail out */
433  NtClose(GuiInitInfo->GuiThreadStartupEvent);
434 
435  DPRINT1("CONSRV: Failed to create graphics console thread.\n");
436  Success = FALSE;
437  goto Quit;
438  }
439 
440  /* No need to close hInputThread, this is done by CSR automatically */
441 
442  /* Wait for the thread to finish its initialization, and close the startup event */
443  NtWaitForSingleObject(GuiInitInfo->GuiThreadStartupEvent, FALSE, NULL);
444  NtClose(GuiInitInfo->GuiThreadStartupEvent);
445 
446  /*
447  * Save the input thread ID for later use, and restore the original handles.
448  * The copies are held by the console input thread.
449  */
450  GuiInitInfo->InputThreadId = (ULONG_PTR)ClientId.UniqueThread;
451  GuiInitInfo->WinSta = hWinSta;
452  GuiInitInfo->Desktop = hDesk;
453 
454  /* Here GuiInitInfo contains again original handles */
455 
456 Quit:
457  if (!Success)
458  {
459  /*
460  * Close the original handles. Do not use the copies in GuiInitInfo
461  * because we may have failed in the middle of the duplicate operation
462  * and the handles stored in GuiInitInfo may have changed.
463  */
464  CloseDesktop(hDesk); // NtUserCloseDesktop
465  CloseWindowStation(hWinSta); // NtUserCloseWindowStation
466  }
467 
468  return Success;
469 }
#define TRUE
Definition: types.h:120
USHORT MaximumLength
Definition: env_spec_w32.h:370
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI CsrRevertToSelf(VOID)
Definition: procsup.c:1048
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
Definition: event.c:100
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
VOID InitTTFontCache(VOID)
Definition: font.c:391
PCSR_THREAD NTAPI CsrAddStaticServerThread(IN HANDLE hThread, IN PCLIENT_ID ClientId, IN ULONG ThreadFlags)
Definition: thredsup.c:511
#define DUPLICATE_SAME_ACCESS
#define UNICODE_NULL
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
NTSTATUS APIENTRY NtUserConsoleControl(IN CONSOLECONTROL ConsoleCtrl, IN PVOID ConsoleCtrlInfo, IN ULONG ConsoleCtrlInfoLength)
Definition: console.c:14
smooth NULL
Definition: ftsmooth.c:416
HDESK NTAPI NtUserResolveDesktop(IN HANDLE ProcessHandle, IN PUNICODE_STRING DesktopPath, IN BOOL bInherit, OUT HWINSTA *phWinSta)
Definition: desktop.c:2781
void DPRINT(...)
Definition: polytest.cpp:61
#define NtCurrentProcess()
Definition: nt_native.h:1657
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
Definition: state.c:290
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1176
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static ULONG NTAPI GuiConsoleInputThread(PVOID Param)
Definition: guiterm.c:105
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
HANDLE UniqueThread
Definition: compat.h:475
static const WCHAR L[]
Definition: oid.c:1250
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
static BOOL ConsInitialized
Definition: guiterm.c:45
NTSYSAPI NTSTATUS NTAPI RtlCreateUserThread(_In_ PVOID ThreadContext, _Out_ HANDLE *OutThreadHandle, _Reserved_ PVOID Reserved1, _Reserved_ PVOID Reserved2, _Reserved_ PVOID Reserved3, _Reserved_ PVOID Reserved4, _Reserved_ PVOID Reserved5, _Reserved_ PVOID Reserved6, _Reserved_ PVOID Reserved7, _Reserved_ PVOID Reserved8)
Status
Definition: gdiplustypes.h:24
BOOLEAN RegisterConWndClass(IN HINSTANCE hInstance)
Definition: conwnd.c:125
#define DPRINT1
Definition: precomp.h:8
HINSTANCE ConSrvDllInstance
Definition: init.c:21
NTSTATUS NTAPI NtDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)
Definition: obhandle.c:3407
BOOL WINAPI CloseDesktop(_In_ HDESK)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
BOOLEAN NTAPI CsrImpersonateClient(IN PCSR_THREAD CsrThread)
Definition: procsup.c:925
#define ULONG_PTR
Definition: config.h:101
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)

Referenced by GuiLoadFrontEnd().

◆ GuiInitFrontEnd()

static NTSTATUS NTAPI GuiInitFrontEnd ( IN OUT PFRONTEND  This,
IN PCONSRV_CONSOLE  Console 
)
static

/* HACK */ Console->FrontEndIFace.Context = (PVOID)GuiData; /* HACK */

Definition at line 480 of file guiterm.c.

482 {
483  PGUI_INIT_INFO GuiInitInfo;
484  PGUI_CONSOLE_DATA GuiData;
485 
486  if (This == NULL || Console == NULL || This->Context2 == NULL)
488 
489  ASSERT(This->Console == Console);
490 
491  GuiInitInfo = This->Context2;
492 
493  /* Terminal data allocation */
494  GuiData = ConsoleAllocHeap(HEAP_ZERO_MEMORY, sizeof(*GuiData));
495  if (!GuiData)
496  {
497  DPRINT1("CONSRV: Failed to create GUI_CONSOLE_DATA\n");
498  return STATUS_UNSUCCESSFUL;
499  }
501  GuiData->Console = Console;
502  GuiData->ActiveBuffer = Console->ActiveBuffer;
503  GuiData->hWindow = NULL;
504  GuiData->IsWindowVisible = GuiInitInfo->IsWindowVisible;
505 
506  /* The console can be resized */
507  Console->FixedSize = FALSE;
508 
509  InitializeCriticalSection(&GuiData->Lock);
510 
511  /*
512  * Set up GUI data
513  */
514  RtlCopyMemory(&GuiData->GuiInfo, &GuiInitInfo->TermInfo, sizeof(GuiInitInfo->TermInfo));
515 
516  /* Initialize the icon handles */
517  if (GuiInitInfo->hIcon != NULL)
518  GuiData->hIcon = GuiInitInfo->hIcon;
519  else
520  GuiData->hIcon = ghDefaultIcon;
521 
522  if (GuiInitInfo->hIconSm != NULL)
523  GuiData->hIconSm = GuiInitInfo->hIconSm;
524  else
525  GuiData->hIconSm = ghDefaultIconSm;
526 
527  ASSERT(GuiData->hIcon && GuiData->hIconSm);
528 
529  /* Mouse is shown by default with its default cursor shape */
530  GuiData->hCursor = ghDefaultCursor;
531  GuiData->MouseCursorRefCount = 0;
532 
533  /* A priori don't ignore mouse signals */
534  GuiData->IgnoreNextMouseSignal = FALSE;
535  /* Initialize HACK FOR CORE-8394. See conwnd.c!OnMouse for more details. */
537 
538  /* Close button and the corresponding system menu item are enabled by default */
539  GuiData->IsCloseButtonEnabled = TRUE;
540 
541  /* There is no user-reserved menu id range by default */
542  GuiData->CmdIdLow = GuiData->CmdIdHigh = 0;
543 
544  /* Initialize the selection */
545  RtlZeroMemory(&GuiData->Selection, sizeof(GuiData->Selection));
547  RtlZeroMemory(&GuiData->dwSelectionCursor, sizeof(GuiData->dwSelectionCursor));
548  GuiData->LineSelection = FALSE; // Default to block selection
549  // TODO: Retrieve the selection mode via the registry.
550 
551  GuiData->InputThreadId = GuiInitInfo->InputThreadId;
552  GuiData->WinSta = GuiInitInfo->WinSta;
553  GuiData->Desktop = GuiInitInfo->Desktop;
554 
555  /* Finally, finish to initialize the frontend structure */
556  This->Context = GuiData;
557  ConsoleFreeHeap(This->Context2);
558  This->Context2 = NULL;
559 
560  /*
561  * We need to wait until the GUI has been fully initialized
562  * to retrieve custom settings i.e. WindowSize etc...
563  * Ideally we could use SendNotifyMessage for this but its not
564  * yet implemented.
565  */
570 
571  DPRINT("GUI - Checkpoint\n");
572 
573  /* Create the terminal window */
575 
576  /* Wait until initialization has finished */
578  DPRINT("OK we created the console window\n");
579  NtClose(GuiData->hGuiInitEvent);
580  GuiData->hGuiInitEvent = NULL;
581 
582  /* Check whether we really succeeded in initializing the terminal window */
583  if (GuiData->hWindow == NULL)
584  {
585  DPRINT("GuiInitConsole - We failed at creating a new terminal window\n");
587  return STATUS_UNSUCCESSFUL;
588  }
589 
590  return STATUS_SUCCESS;
591 }
COORD dwSelectionCursor
Definition: conwnd.h:93
HICON ghDefaultIcon
Definition: conwnd.c:62
HANDLE hGuiTermEvent
Definition: conwnd.h:45
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
INT MouseCursorRefCount
Definition: conwnd.h:71
HANDLE hGuiInitEvent
Definition: conwnd.h:44
BOOL IsCloseButtonEnabled
Definition: conwnd.h:77
HICON hIcon
Definition: guiterm.c:39
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
HWINSTA WinSta
Definition: conwnd.h:49
#define ConsoleAllocHeap(Flags, Size)
Definition: heap.h:14
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
Definition: event.c:100
HDESK Desktop
Definition: guiterm.c:38
#define CONSOLE_NO_SELECTION
Definition: wincon.h:96
BOOL IgnoreNextMouseSignal
Definition: conwnd.h:72
HICON ghDefaultIconSm
Definition: conwnd.c:63
CONSOLE_SELECTION_INFO Selection
Definition: conwnd.h:92
BOOLEAN IsWindowVisible
Definition: guiterm.c:41
#define PM_CREATE_CONSOLE
Definition: guiterm.c:27
HICON hIconSm
Definition: guiterm.c:40
ULONG_PTR InputThreadId
Definition: guiterm.c:36
HDESK Desktop
Definition: conwnd.h:50
GUI_CONSOLE_INFO TermInfo
Definition: guiterm.c:42
BOOL HackCORE8394IgnoreNextMove
Definition: conwnd.h:74
HWINSTA WinSta
Definition: guiterm.c:37
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
HICON hIconSm
Definition: conwnd.h:67
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
BOOL LineSelection
Definition: conwnd.h:94
UINT CmdIdHigh
Definition: conwnd.h:79
CRITICAL_SECTION Lock
Definition: conwnd.h:42
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
HCURSOR ghDefaultCursor
Definition: conwnd.c:64
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HCURSOR hCursor
Definition: conwnd.h:70
CConsole Console
#define DPRINT1
Definition: precomp.h:8
GUI_CONSOLE_INFO GuiInfo
Definition: conwnd.h:96
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static VOID NTAPI GuiDeinitFrontEnd(IN OUT PFRONTEND This)
Definition: guiterm.c:594
PCONSRV_CONSOLE Console
Definition: conwnd.h:90
return STATUS_SUCCESS
Definition: btrfs.c:2745
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
ULONG_PTR InputThreadId
Definition: conwnd.h:48
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)

◆ GuiLoadFrontEnd()

NTSTATUS NTAPI GuiLoadFrontEnd ( IN OUT PFRONTEND  FrontEnd,
IN OUT PCONSOLE_STATE_INFO  ConsoleInfo,
IN OUT PCONSOLE_INIT_INFO  ConsoleInitInfo,
IN HANDLE  ConsoleLeaderProcessHandle 
)

Definition at line 1177 of file guiterm.c.

1181 {
1182  PCONSOLE_START_INFO ConsoleStartInfo;
1183  PGUI_INIT_INFO GuiInitInfo;
1184  USEROBJECTFLAGS UserObjectFlags;
1185 
1186  if (FrontEnd == NULL || ConsoleInfo == NULL || ConsoleInitInfo == NULL)
1187  return STATUS_INVALID_PARAMETER;
1188 
1189  ConsoleStartInfo = ConsoleInitInfo->ConsoleStartInfo;
1190 
1191  /*
1192  * Initialize a private initialization info structure for later use.
1193  * It must be freed by a call to GuiUnloadFrontEnd or GuiInitFrontEnd.
1194  */
1195  GuiInitInfo = ConsoleAllocHeap(HEAP_ZERO_MEMORY, sizeof(*GuiInitInfo));
1196  if (GuiInitInfo == NULL) return STATUS_NO_MEMORY;
1197 
1198  /* Initialize GUI terminal emulator common functionalities */
1199  if (!GuiInit(ConsoleInitInfo, ConsoleLeaderProcessHandle, GuiInitInfo))
1200  {
1201  ConsoleFreeHeap(GuiInitInfo);
1202  return STATUS_UNSUCCESSFUL;
1203  }
1204 
1205  GuiInitInfo->IsWindowVisible = ConsoleInitInfo->IsWindowVisible;
1206  if (GuiInitInfo->IsWindowVisible)
1207  {
1208  /* Don't show the console if the window station is not interactive */
1209  if (GetUserObjectInformationW(GuiInitInfo->WinSta,
1210  UOI_FLAGS,
1211  &UserObjectFlags,
1212  sizeof(UserObjectFlags),
1213  NULL))
1214  {
1215  if (!(UserObjectFlags.dwFlags & WSF_VISIBLE))
1216  GuiInitInfo->IsWindowVisible = FALSE;
1217  }
1218  }
1219 
1220  /*
1221  * Load terminal settings
1222  */
1223 #if 0
1224  /* Impersonate the caller in order to retrieve settings in its context */
1225  // if (!CsrImpersonateClient(NULL))
1226  // return STATUS_UNSUCCESSFUL;
1228 
1229  /* 1. Load the default settings */
1230  GuiConsoleGetDefaultSettings(&GuiInitInfo->TermInfo);
1231 #endif
1232 
1233  GuiInitInfo->TermInfo.ShowWindow = SW_SHOWNORMAL;
1234 
1235  if (GuiInitInfo->IsWindowVisible)
1236  {
1237  /* 2. Load the remaining console settings via the registry */
1238  if ((ConsoleStartInfo->dwStartupFlags & STARTF_TITLEISLINKNAME) == 0)
1239  {
1240 #if 0
1241  /* Load the terminal infos from the registry */
1242  GuiConsoleReadUserSettings(&GuiInitInfo->TermInfo);
1243 #endif
1244 
1245  /*
1246  * Now, update them with the properties the user might gave to us
1247  * via the STARTUPINFO structure before calling CreateProcess
1248  * (and which was transmitted via the ConsoleStartInfo structure).
1249  * We therefore overwrite the values read in the registry.
1250  */
1251  if (ConsoleStartInfo->dwStartupFlags & STARTF_USESHOWWINDOW)
1252  {
1253  GuiInitInfo->TermInfo.ShowWindow = ConsoleStartInfo->wShowWindow;
1254  }
1255  if (ConsoleStartInfo->dwStartupFlags & STARTF_USEPOSITION)
1256  {
1257  ConsoleInfo->AutoPosition = FALSE;
1258  ConsoleInfo->WindowPosition.x = ConsoleStartInfo->dwWindowOrigin.X;
1259  ConsoleInfo->WindowPosition.y = ConsoleStartInfo->dwWindowOrigin.Y;
1260  }
1261  if (ConsoleStartInfo->dwStartupFlags & STARTF_RUNFULLSCREEN)
1262  {
1263  ConsoleInfo->FullScreen = TRUE;
1264  }
1265  }
1266  }
1267 
1268 #if 0
1269  /* Revert impersonation */
1270  CsrRevertToSelf();
1271 #endif
1272 
1273  // Font data
1274  StringCchCopyNW(GuiInitInfo->TermInfo.FaceName, ARRAYSIZE(GuiInitInfo->TermInfo.FaceName),
1275  ConsoleInfo->FaceName, ARRAYSIZE(ConsoleInfo->FaceName));
1276  GuiInitInfo->TermInfo.FontFamily = ConsoleInfo->FontFamily;
1277  GuiInitInfo->TermInfo.FontSize = ConsoleInfo->FontSize;
1278  GuiInitInfo->TermInfo.FontWeight = ConsoleInfo->FontWeight;
1279 
1280  // Display
1281  GuiInitInfo->TermInfo.FullScreen = ConsoleInfo->FullScreen;
1282  GuiInitInfo->TermInfo.AutoPosition = ConsoleInfo->AutoPosition;
1283  GuiInitInfo->TermInfo.WindowOrigin = ConsoleInfo->WindowPosition;
1284 
1285  /* Initialize the icon handles */
1286  // if (ConsoleStartInfo->hIcon != NULL)
1287  GuiInitInfo->hIcon = ConsoleStartInfo->hIcon;
1288  // else
1289  // GuiInitInfo->hIcon = ghDefaultIcon;
1290 
1291  // if (ConsoleStartInfo->hIconSm != NULL)
1292  GuiInitInfo->hIconSm = ConsoleStartInfo->hIconSm;
1293  // else
1294  // GuiInitInfo->hIconSm = ghDefaultIconSm;
1295 
1296  // ASSERT(GuiInitInfo->hIcon && GuiInitInfo->hIconSm);
1297 
1298  /* Finally, initialize the frontend structure */
1299  FrontEnd->Vtbl = &GuiVtbl;
1300  FrontEnd->Context = NULL;
1301  FrontEnd->Context2 = GuiInitInfo;
1302 
1303  return STATUS_SUCCESS;
1304 }
#define STARTF_RUNFULLSCREEN
Definition: winbase.h:477
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
#define TRUE
Definition: types.h:120
BOOL WINAPI GetUserObjectInformationW(_In_ HANDLE hObj, _In_ int nIndex, _Out_writes_bytes_opt_(nLength) PVOID pvInfo, _In_ DWORD nLength, _Out_opt_ LPDWORD lpnLengthNeeded)
HICON hIcon
Definition: guiterm.c:39
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define ConsoleAllocHeap(Flags, Size)
Definition: heap.h:14
BOOLEAN NTAPI CsrRevertToSelf(VOID)
Definition: procsup.c:1048
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define STARTF_USEPOSITION
Definition: winbase.h:474
BOOLEAN IsWindowVisible
Definition: guiterm.c:41
HICON hIconSm
Definition: guiterm.c:40
GUI_CONSOLE_INFO TermInfo
Definition: guiterm.c:42
HWINSTA WinSta
Definition: guiterm.c:37
smooth NULL
Definition: ftsmooth.c:416
#define STARTF_USESHOWWINDOW
Definition: winbase.h:472
#define WSF_VISIBLE
Definition: winuser.h:2406
static FRONTEND_VTBL GuiVtbl
Definition: guiterm.c:1147
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static BOOL GuiInit(IN PCONSOLE_INIT_INFO ConsoleInitInfo, IN HANDLE ConsoleLeaderProcessHandle, IN OUT PGUI_INIT_INFO GuiInitInfo)
Definition: guiterm.c:284
#define SW_SHOWNORMAL
Definition: winuser.h:764
static CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo
Definition: video.c:47
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define UOI_FLAGS
Definition: winuser.h:1073
WCHAR FaceName[LF_FACESIZE]
Definition: guisettings.h:18
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
BOOLEAN NTAPI CsrImpersonateClient(IN PCSR_THREAD CsrThread)
Definition: procsup.c:925
return STATUS_SUCCESS
Definition: btrfs.c:2745
BOOL GuiConsoleReadUserSettings(IN OUT PGUI_CONSOLE_INFO TermInfo)
Definition: guisettings.c:24
VOID GuiConsoleGetDefaultSettings(IN OUT PGUI_CONSOLE_INFO TermInfo)
Definition: guisettings.c:38

◆ GuiMenuControl()

static HMENU NTAPI GuiMenuControl ( IN OUT PFRONTEND  This,
UINT  CmdIdLow,
UINT  CmdIdHigh 
)
static

Definition at line 1115 of file guiterm.c.

1118 {
1119  PGUI_CONSOLE_DATA GuiData = This->Context;
1120 
1121  GuiData->CmdIdLow = CmdIdLow ;
1122  GuiData->CmdIdHigh = CmdIdHigh;
1123 
1124  return GuiData->hSysMenu;
1125 }
HMENU hSysMenu
Definition: conwnd.h:76
UINT CmdIdHigh
Definition: conwnd.h:79

◆ GuiRefreshInternalInfo()

static VOID NTAPI GuiRefreshInternalInfo ( IN OUT PFRONTEND  This)
static

Definition at line 848 of file guiterm.c.

849 {
850  PGUI_CONSOLE_DATA GuiData = This->Context;
851 
852  /* Update the console leader information held by the window */
853  SetConWndConsoleLeaderCID(GuiData);
854 
855  /*
856  * HACK:
857  * We reset the cursor here so that, when a console app quits, we reset
858  * the cursor to the default one. It's quite a hack since it doesn't proceed
859  * per - console process... This must be fixed.
860  *
861  * See GuiInitConsole(...) for more information.
862  */
863 
864  /* Mouse is shown by default with its default cursor shape */
865  GuiData->MouseCursorRefCount = 0; // Reinitialize the reference counter
867 }
static BOOL NTAPI GuiSetMouseCursor(IN OUT PFRONTEND This, HCURSOR CursorHandle)
Definition: guiterm.c:1094
INT MouseCursorRefCount
Definition: conwnd.h:71
VOID SetConWndConsoleLeaderCID(IN PGUI_CONSOLE_DATA GuiData)
Definition: conwnd.c:48
smooth NULL
Definition: ftsmooth.c:416

◆ GuiReleaseScreenBuffer()

static VOID NTAPI GuiReleaseScreenBuffer ( IN OUT PFRONTEND  This,
IN PCONSOLE_SCREEN_BUFFER  ScreenBuffer 
)
static

Definition at line 800 of file guiterm.c.

802 {
803  PGUI_CONSOLE_DATA GuiData = This->Context;
804 
805  /*
806  * If we were notified to release a screen buffer that is not actually
807  * ours, then just ignore the notification...
808  */
809  if (ScreenBuffer != GuiData->ActiveBuffer) return;
810 
811  /*
812  * ... else, we must release our active buffer. Two cases are present:
813  * - If ScreenBuffer (== GuiData->ActiveBuffer) IS NOT the console
814  * active screen buffer, then we can safely switch to it.
815  * - If ScreenBuffer IS the console active screen buffer, we must release
816  * it ONLY.
817  */
818 
819  /* Release the old active palette and set the default one */
820  if (GetCurrentObject(GuiData->hMemDC, OBJ_PAL) == ScreenBuffer->PaletteHandle)
821  {
822  /* Set the new palette */
823  SelectPalette(GuiData->hMemDC, GuiData->hSysPalette, FALSE);
824  }
825 
826  /* Set the adequate active screen buffer */
827  if (ScreenBuffer != GuiData->Console->ActiveBuffer)
828  {
830  }
831  else
832  {
833  EnterCriticalSection(&GuiData->Lock);
834  GuiData->WindowSizeLock = TRUE;
835 
837 
838  GuiData->WindowSizeLock = FALSE;
839  LeaveCriticalSection(&GuiData->Lock);
840  }
841 }
#define TRUE
Definition: types.h:120
static VOID NTAPI GuiSetActiveScreenBuffer(IN OUT PFRONTEND This)
Definition: guiterm.c:761
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WindowSizeLock
Definition: conwnd.h:43
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
CRITICAL_SECTION Lock
Definition: conwnd.h:42
#define OBJ_PAL
Definition: objidl.idl:1413
HPALETTE hSysPalette
Definition: conwnd.h:64
HANDLE ScreenBuffer
Definition: notevil.c:37
PCONSRV_CONSOLE Console
Definition: conwnd.h:90
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439

◆ GuiResizeTerminal()

static VOID NTAPI GuiResizeTerminal ( IN OUT PFRONTEND  This)
static

Definition at line 752 of file guiterm.c.

753 {
754  PGUI_CONSOLE_DATA GuiData = This->Context;
755 
756  /* Resize the window to the user's values */
757  PostMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0);
758 }
#define PM_RESIZE_TERMINAL
Definition: guiterm.c:42
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by GuiSetActiveScreenBuffer().

◆ GuiRingBell()

VOID NTAPI GuiRingBell ( IN OUT PFRONTEND  This)

Definition at line 704 of file guiterm.c.

705 {
706  PGUI_CONSOLE_DATA GuiData = This->Context;
707 
708  /* Emit an error beep sound */
709  SendNotifyMessage(GuiData->hWindow, PM_CONSOLE_BEEP, 0, 0);
710 }
#define PM_CONSOLE_BEEP
Definition: guiterm.c:43
#define SendNotifyMessage
Definition: winuser.h:5712

◆ GuiSetActiveScreenBuffer()

static VOID NTAPI GuiSetActiveScreenBuffer ( IN OUT PFRONTEND  This)
static

Definition at line 761 of file guiterm.c.

762 {
763  PGUI_CONSOLE_DATA GuiData = This->Context;
764  PCONSOLE_SCREEN_BUFFER ActiveBuffer;
765  HPALETTE hPalette;
766 
767  EnterCriticalSection(&GuiData->Lock);
768  GuiData->WindowSizeLock = TRUE;
769 
772 
773  GuiData->WindowSizeLock = FALSE;
774  LeaveCriticalSection(&GuiData->Lock);
775 
776  ActiveBuffer = GuiData->ActiveBuffer;
777 
778  /* Change the current palette */
779  if (ActiveBuffer->PaletteHandle == NULL)
780  hPalette = GuiData->hSysPalette;
781  else
782  hPalette = ActiveBuffer->PaletteHandle;
783 
784  DPRINT("GuiSetActiveScreenBuffer using palette 0x%p\n", hPalette);
785 
786  /* Set the new palette for the framebuffer */
787  SelectPalette(GuiData->hMemDC, hPalette, FALSE);
788 
789  /* Specify the use of the system palette for the framebuffer */
790  SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage);
791 
792  /* Realize the (logical) palette */
793  RealizePalette(GuiData->hMemDC);
794 
796  // ConioDrawConsole(Console);
797 }
#define TRUE
Definition: types.h:120
UINT WINAPI SetSystemPaletteUse(_In_ HDC, _In_ UINT)
PCONSOLE_SCREEN_BUFFER ConDrvGetActiveScreenBuffer(IN PCONSOLE Console)
Definition: conoutput.c:194
static VOID NTAPI GuiResizeTerminal(IN OUT PFRONTEND This)
Definition: guiterm.c:752
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WindowSizeLock
Definition: conwnd.h:43
HPALETTE PaletteHandle
Definition: conio.h:105
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
CRITICAL_SECTION Lock
Definition: conwnd.h:42
HPALETTE hSysPalette
Definition: conwnd.h:64
PCONSRV_CONSOLE Console
Definition: conwnd.h:90
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
UINT WINAPI RealizePalette(_In_ HDC)
Definition: palette.c:138

Referenced by GuiReleaseScreenBuffer().

◆ GuiSetCursorInfo()

static BOOL NTAPI GuiSetCursorInfo ( IN OUT PFRONTEND  This,
PCONSOLE_SCREEN_BUFFER  Buff 
)
static

Definition at line 713 of file guiterm.c.

715 {
716  PGUI_CONSOLE_DATA GuiData = This->Context;
717 
718  /* Do nothing if the window is hidden */
719  if (!GuiData->IsWindowVisible) return TRUE;
720 
721  if (GuiData->ActiveBuffer == Buff)
722  {
723  InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y);
724  }
725 
726  return TRUE;
727 }
#define TRUE
Definition: types.h:120
COORD CursorPosition
Definition: conio.h:98
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
VOID InvalidateCell(PGUI_CONSOLE_DATA GuiData, SHORT x, SHORT y)
Definition: guiterm.c:88
ULONG X
Definition: bl.h:1340
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
ULONG Y
Definition: bl.h:1341

◆ GuiSetDisplayMode()

static BOOL NTAPI GuiSetDisplayMode ( IN OUT PFRONTEND  This,
ULONG  NewMode 
)
static

Definition at line 1052 of file guiterm.c.

1054 {
1055  PGUI_CONSOLE_DATA GuiData = This->Context;
1056  BOOL FullScreen;
1057 
1059  return FALSE;
1060 
1061  /* Do nothing if the window is hidden */
1062  if (!GuiData->IsWindowVisible) return TRUE;
1063 
1064  FullScreen = ((NewMode & CONSOLE_FULLSCREEN_MODE) != 0);
1065 
1066  if (FullScreen != GuiData->GuiInfo.FullScreen)
1067  {
1068  SwitchFullScreen(GuiData, FullScreen);
1069  }
1070 
1071  return TRUE;
1072 }
#define CONSOLE_WINDOWED_MODE
Definition: wincon.h:34
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen)
Definition: fullscreen.c:49
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
#define CONSOLE_FULLSCREEN_MODE
Definition: wincon.h:33
GUI_CONSOLE_INFO GuiInfo
Definition: conwnd.h:96

◆ GuiSetMenuClose()

static BOOL NTAPI GuiSetMenuClose ( IN OUT PFRONTEND  This,
BOOL  Enable 
)
static

Definition at line 1128 of file guiterm.c.

1130 {
1131  /*
1132  * NOTE: See http://www.mail-archive.com/harbour@harbour-project.org/msg27509.html
1133  * or http://harbour-devel.1590103.n2.nabble.com/Question-about-hb-gt-win-CtrlHandler-usage-td4670862i20.html
1134  * for more information.
1135  */
1136 
1137  PGUI_CONSOLE_DATA GuiData = This->Context;
1138 
1139  if (GuiData->hSysMenu == NULL) return FALSE;
1140 
1141  GuiData->IsCloseButtonEnabled = Enable;
1143 
1144  return TRUE;
1145 }
#define TRUE
Definition: types.h:120
BOOL IsCloseButtonEnabled
Definition: conwnd.h:77
#define MF_BYCOMMAND
Definition: winuser.h:202
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
smooth NULL
Definition: ftsmooth.c:416
HMENU hSysMenu
Definition: conwnd.h:76
#define MF_ENABLED
Definition: winuser.h:128
#define SC_CLOSE
Definition: winuser.h:2546
#define MF_GRAYED
Definition: winuser.h:129

◆ GuiSetMouseCursor()

static BOOL NTAPI GuiSetMouseCursor ( IN OUT PFRONTEND  This,
HCURSOR  CursorHandle 
)
static

Definition at line 1094 of file guiterm.c.

1096 {
1097  PGUI_CONSOLE_DATA GuiData = This->Context;
1098 
1099  /* Do nothing if the window is hidden */
1100  if (!GuiData->IsWindowVisible) return TRUE;
1101 
1102  /*
1103  * Set the cursor's handle. If the given handle is NULL,
1104  * then restore the default cursor.
1105  */
1106  GuiData->hCursor = (CursorHandle ? CursorHandle : ghDefaultCursor);
1107 
1108  /* Effectively modify the shape of the cursor (use special values for (w|l)Param) */
1109  PostMessageW(GuiData->hWindow, WM_SETCURSOR, -1, -1);
1110 
1111  return TRUE;
1112 }
#define TRUE
Definition: types.h:120
#define WM_SETCURSOR
Definition: winuser.h:1618
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
HCURSOR ghDefaultCursor
Definition: conwnd.c:64
HCURSOR hCursor
Definition: conwnd.h:70
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by GuiRefreshInternalInfo().

◆ GuiSetPalette()

static BOOL NTAPI GuiSetPalette ( IN OUT PFRONTEND  This,
HPALETTE  PaletteHandle,
UINT  PaletteUsage 
)
static

Definition at line 1011 of file guiterm.c.

1014 {
1015  PGUI_CONSOLE_DATA GuiData = This->Context;
1016  HPALETTE OldPalette;
1017 
1018  // if (GetType(GuiData->ActiveBuffer) != GRAPHICS_BUFFER) return FALSE;
1019  if (PaletteHandle == NULL) return FALSE;
1020 
1021  /* Set the new palette for the framebuffer */
1022  OldPalette = SelectPalette(GuiData->hMemDC, PaletteHandle, FALSE);
1023  if (OldPalette == NULL) return FALSE;
1024 
1025  /* Specify the use of the system palette for the framebuffer */
1026  SetSystemPaletteUse(GuiData->hMemDC, PaletteUsage);
1027 
1028  /* Realize the (logical) palette */
1029  RealizePalette(GuiData->hMemDC);
1030 
1031  /* Save the original system palette handle */
1032  if (GuiData->hSysPalette == NULL) GuiData->hSysPalette = OldPalette;
1033 
1034  return TRUE;
1035 }
#define TRUE
Definition: types.h:120
UINT WINAPI SetSystemPaletteUse(_In_ HDC, _In_ UINT)
static HPALETTE PaletteHandle
Definition: svga.c:215
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
HPALETTE hSysPalette
Definition: conwnd.h:64
UINT WINAPI RealizePalette(_In_ HDC)
Definition: palette.c:138

◆ GuiSetScreenInfo()

static BOOL NTAPI GuiSetScreenInfo ( IN OUT PFRONTEND  This,
PCONSOLE_SCREEN_BUFFER  Buff,
SHORT  OldCursorX,
SHORT  OldCursorY 
)
static

Definition at line 730 of file guiterm.c.

734 {
735  PGUI_CONSOLE_DATA GuiData = This->Context;
736 
737  /* Do nothing if the window is hidden */
738  if (!GuiData->IsWindowVisible) return TRUE;
739 
740  if (GuiData->ActiveBuffer == Buff)
741  {
742  /* Redraw char at old position (remove cursor) */
743  InvalidateCell(GuiData, OldCursorX, OldCursorY);
744  /* Redraw char at new position (show cursor) */
745  InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y);
746  }
747 
748  return TRUE;
749 }
#define TRUE
Definition: types.h:120
COORD CursorPosition
Definition: conio.h:98
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
VOID InvalidateCell(PGUI_CONSOLE_DATA GuiData, SHORT x, SHORT y)
Definition: guiterm.c:88
ULONG X
Definition: bl.h:1340
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
ULONG Y
Definition: bl.h:1341

◆ GuiShowMouseCursor()

static INT NTAPI GuiShowMouseCursor ( IN OUT PFRONTEND  This,
BOOL  Show 
)
static

Definition at line 1075 of file guiterm.c.

1077 {
1078  PGUI_CONSOLE_DATA GuiData = This->Context;
1079 
1080  if (GuiData->IsWindowVisible)
1081  {
1082  /* Set the reference count */
1083  if (Show) ++GuiData->MouseCursorRefCount;
1084  else --GuiData->MouseCursorRefCount;
1085 
1086  /* Effectively show (or hide) the cursor (use special values for (w|l)Param) */
1087  PostMessageW(GuiData->hWindow, WM_SETCURSOR, -1, -1);
1088  }
1089 
1090  return GuiData->MouseCursorRefCount;
1091 }
INT MouseCursorRefCount
Definition: conwnd.h:71
#define WM_SETCURSOR
Definition: winuser.h:1618
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GuiUnloadFrontEnd()

NTSTATUS NTAPI GuiUnloadFrontEnd ( IN OUT PFRONTEND  FrontEnd)

Definition at line 1307 of file guiterm.c.

1308 {
1309  if (FrontEnd == NULL) return STATUS_INVALID_PARAMETER;
1310 
1311  if (FrontEnd->Context ) GuiDeinitFrontEnd(FrontEnd);
1312  if (FrontEnd->Context2) ConsoleFreeHeap(FrontEnd->Context2);
1313 
1314  return STATUS_SUCCESS;
1315 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
smooth NULL
Definition: ftsmooth.c:416
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
static VOID NTAPI GuiDeinitFrontEnd(IN OUT PFRONTEND This)
Definition: guiterm.c:594
return STATUS_SUCCESS
Definition: btrfs.c:2745

◆ GuiWriteStream()

static VOID NTAPI GuiWriteStream ( IN OUT PFRONTEND  This,
SMALL_RECT Region,
SHORT  CursorStartX,
SHORT  CursorStartY,
UINT  ScrolledLines,
PWCHAR  Buffer,
UINT  Length 
)
static

Definition at line 641 of file guiterm.c.

648 {
649  PGUI_CONSOLE_DATA GuiData = This->Context;
651  SHORT CursorEndX, CursorEndY;
652  RECT ScrollRect;
653 
654  if (NULL == GuiData || NULL == GuiData->hWindow) return;
655 
656  /* Do nothing if the window is hidden */
657  if (!GuiData->IsWindowVisible) return;
658 
659  Buff = GuiData->ActiveBuffer;
660  if (GetType(Buff) != TEXTMODE_BUFFER) return;
661 
662  if (0 != ScrolledLines)
663  {
664  ScrollRect.left = 0;
665  ScrollRect.top = 0;
666  ScrollRect.right = Buff->ViewSize.X * GuiData->CharWidth;
667  ScrollRect.bottom = Region->Top * GuiData->CharHeight;
668 
669  ScrollWindowEx(GuiData->hWindow,
670  0,
671  -(int)(ScrolledLines * GuiData->CharHeight),
672  &ScrollRect,
673  NULL,
674  NULL,
675  NULL,
676  SW_INVALIDATE);
677  }
678 
679  DrawRegion(GuiData, Region);
680 
681  if (CursorStartX < Region->Left || Region->Right < CursorStartX
682  || CursorStartY < Region->Top || Region->Bottom < CursorStartY)
683  {
684  InvalidateCell(GuiData, CursorStartX, CursorStartY);
685  }
686 
687  CursorEndX = Buff->CursorPosition.X;
688  CursorEndY = Buff->CursorPosition.Y;
689  if ((CursorEndX < Region->Left || Region->Right < CursorEndX
690  || CursorEndY < Region->Top || Region->Bottom < CursorEndY)
691  && (CursorEndX != CursorStartX || CursorEndY != CursorStartY))
692  {
693  InvalidateCell(GuiData, CursorEndX, CursorEndY);
694  }
695 
696  // HACK!!
697  // Set up the update timer (very short interval) - this is a "hack" for getting the OS to
698  // repaint the window without having it just freeze up and stay on the screen permanently.
699  Buff->CursorBlinkOn = TRUE;
701 }
#define TRUE
Definition: types.h:120
BOOLEAN CursorBlinkOn
Definition: conio.h:99
COORD CursorPosition
Definition: conio.h:98
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
#define TEXTMODE_BUFFER
Definition: pccons.c:21
LONG right
Definition: windef.h:293
UINT CharHeight
Definition: conwnd.h:87
static VOID DrawRegion(PGUI_CONSOLE_DATA GuiData, SMALL_RECT *Region)
Definition: guiterm.c:76
short SHORT
Definition: pedump.c:59
#define CONGUI_UPDATE_TIMER
Definition: guiterm.c:25
PCONSOLE_SCREEN_BUFFER ActiveBuffer
Definition: conwnd.h:91
VOID InvalidateCell(PGUI_CONSOLE_DATA GuiData, SHORT x, SHORT y)
Definition: guiterm.c:88
smooth NULL
Definition: ftsmooth.c:416
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
ULONG X
Definition: bl.h:1340
#define CONGUI_UPDATE_TIME
Definition: guiterm.c:24
INT GetType(BOOL bLocal, LPOSVERSIONINFOEX osvi, LPSERVER_INFO_102 pBuf102)
Definition: gettype.c:129
BOOLEAN IsWindowVisible
Definition: conwnd.h:52
#define SW_INVALIDATE
Definition: winuser.h:2533
UINT CharWidth
Definition: conwnd.h:86
LONG bottom
Definition: windef.h:294
ULONG Y
Definition: bl.h:1341
static LPHIST_ENTRY Top
Definition: history.c:53

◆ InvalidateCell()

VOID InvalidateCell ( PGUI_CONSOLE_DATA  GuiData,
SHORT  x,
SHORT  y 
)

Definition at line 88 of file guiterm.c.

90 {
91  SMALL_RECT CellRect = { x, y, x, y };
92  DrawRegion(GuiData, &CellRect);
93 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static VOID DrawRegion(PGUI_CONSOLE_DATA GuiData, SMALL_RECT *Region)
Definition: guiterm.c:76
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by GuiSetCursorInfo(), GuiSetScreenInfo(), GuiWriteStream(), and OnTimer().

◆ RegisterConWndClass()

BOOLEAN RegisterConWndClass ( IN HINSTANCE  hInstance)

Definition at line 125 of file conwnd.c.

126 {
128  ATOM WndClassAtom;
129 
132  IMAGE_ICON,
135  LR_SHARED);
138  IMAGE_ICON,
141  LR_SHARED);
143 
144  WndClass.cbSize = sizeof(WNDCLASSEXW);
145  WndClass.lpszClassName = GUI_CONWND_CLASS;
146  WndClass.lpfnWndProc = ConWndProc;
147  WndClass.style = CS_DBLCLKS /* | CS_HREDRAW | CS_VREDRAW */;
148  WndClass.hInstance = hInstance;
149  WndClass.hIcon = ghDefaultIcon;
150  WndClass.hIconSm = ghDefaultIconSm;
151  WndClass.hCursor = ghDefaultCursor;
152  WndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // The color of a terminal when it is switched off.
153  WndClass.lpszMenuName = NULL;
154  WndClass.cbClsExtra = 0;
155  WndClass.cbWndExtra = GWLP_CONWND_ALLOC;
156 
157  WndClassAtom = RegisterClassExW(&WndClass);
158  if (WndClassAtom == 0)
159  {
160  DPRINT1("Failed to register GUI console class\n");
161  }
162  else
163  {
164  NtUserConsoleControl(GuiConsoleWndClassAtom, &WndClassAtom, sizeof(ATOM));
165  }
166 
167  return (WndClassAtom != 0);
168 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
WORD ATOM
Definition: dimm.idl:113
#define GWLP_CONWND_ALLOC
Definition: conwnd.c:43
#define SM_CYSMICON
Definition: winuser.h:1003
struct _WNDCLASSEXW WNDCLASSEXW
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
HINSTANCE hInstance
Definition: charmap.c:20
HICON ghDefaultIcon
Definition: conwnd.c:62
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
NTSTATUS APIENTRY NtUserConsoleControl(IN CONSOLECONTROL ConsoleCtrl, IN PVOID ConsoleCtrlInfo, IN ULONG ConsoleCtrlInfoLength)
Definition: console.c:14
#define SM_CXICON
Definition: winuser.h:962
static LRESULT CALLBACK ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: conwnd.c:2165
smooth NULL
Definition: ftsmooth.c:416
#define IDI_TERMINAL
Definition: resource.h:44
#define BLACK_BRUSH
Definition: wingdi.h:895
int WINAPI GetSystemMetrics(_In_ int)
#define GUI_CONWND_CLASS
Definition: conwnd.h:15
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define SM_CXSMICON
Definition: winuser.h:1002
#define SM_CYICON
Definition: winuser.h:963
HICON ghDefaultIconSm
Definition: conwnd.c:63
HCURSOR ghDefaultCursor
Definition: conwnd.c:64
#define CS_DBLCLKS
Definition: winuser.h:646
#define DPRINT1
Definition: precomp.h:8
#define IDC_ARROW
Definition: winuser.h:682
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR WndClass[]
Definition: capicon.c:23

Referenced by GuiInit().

◆ SetConWndConsoleLeaderCID()

VOID SetConWndConsoleLeaderCID ( IN PGUI_CONSOLE_DATA  GuiData)

Definition at line 48 of file conwnd.c.

49 {
50  PCONSOLE_PROCESS_DATA ProcessData;
51  CLIENT_ID ConsoleLeaderCID;
52 
53  ProcessData = ConSrvGetConsoleLeaderProcess(GuiData->Console);
54  ConsoleLeaderCID = ProcessData->Process->ClientId;
56  (LONG_PTR)(ConsoleLeaderCID.UniqueProcess));
58  (LONG_PTR)(ConsoleLeaderCID.UniqueThread));
59 }
PCONSOLE_PROCESS_DATA NTAPI ConSrvGetConsoleLeaderProcess(IN PCONSRV_CONSOLE Console)
Definition: console.c:867
HANDLE UniqueProcess
Definition: compat.h:474
#define GWLP_CONSOLE_LEADER_TID
Definition: conwnd.c:45
#define GWLP_CONSOLE_LEADER_PID
Definition: conwnd.c:44
CLIENT_ID ClientId
Definition: csrsrv.h:38
PCSR_PROCESS Process
Definition: consrv.h:43
HANDLE UniqueThread
Definition: compat.h:475
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SetWindowLongPtrW
Definition: winuser.h:5215

Referenced by GuiRefreshInternalInfo().

◆ UnRegisterConWndClass()

BOOLEAN UnRegisterConWndClass ( HINSTANCE  hInstance)

Definition at line 171 of file conwnd.c.

172 {
174 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
HINSTANCE hInstance
Definition: charmap.c:20
#define GUI_CONWND_CLASS
Definition: conwnd.h:15

Variable Documentation

◆ ConsInitialized

BOOL ConsInitialized = FALSE
static

Definition at line 45 of file guiterm.c.

Referenced by GuiInit().

◆ ghDefaultCursor

HCURSOR ghDefaultCursor

Definition at line 64 of file conwnd.c.

Referenced by GuiInit(), GuiInitFrontEnd(), GuiSetMouseCursor(), and RegisterConWndClass().

◆ ghDefaultIcon

◆ ghDefaultIconSm

◆ GuiVtbl

FRONTEND_VTBL GuiVtbl
static
Initial value:
=
{
}
static BOOL NTAPI GuiSetMouseCursor(IN OUT PFRONTEND This, HCURSOR CursorHandle)
Definition: guiterm.c:1094
static BOOL NTAPI GuiSetCursorInfo(IN OUT PFRONTEND This, PCONSOLE_SCREEN_BUFFER Buff)
Definition: guiterm.c:713
static HDESK NTAPI GuiGetThreadConsoleDesktop(IN OUT PFRONTEND This)
Definition: guiterm.c:920
static VOID NTAPI GuiSetActiveScreenBuffer(IN OUT PFRONTEND This)
Definition: guiterm.c:761
static BOOL NTAPI GuiSetDisplayMode(IN OUT PFRONTEND This, ULONG NewMode)
Definition: guiterm.c:1052
static VOID NTAPI GuiResizeTerminal(IN OUT PFRONTEND This)
Definition: guiterm.c:752
VOID NTAPI GuiRingBell(IN OUT PFRONTEND This)
Definition: guiterm.c:704
static HMENU NTAPI GuiMenuControl(IN OUT PFRONTEND This, UINT CmdIdLow, UINT CmdIdHigh)
Definition: guiterm.c:1115
static BOOL NTAPI GuiChangeIcon(IN OUT PFRONTEND This, HICON IconHandle)
Definition: guiterm.c:877
static BOOL NTAPI GuiGetSelectionInfo(IN OUT PFRONTEND This, PCONSOLE_SELECTION_INFO pSelectionInfo)
Definition: guiterm.c:996
static ULONG NTAPI GuiGetDisplayMode(IN OUT PFRONTEND This)
Definition: guiterm.c:1038
static VOID NTAPI GuiRefreshInternalInfo(IN OUT PFRONTEND This)
Definition: guiterm.c:848
static INT NTAPI GuiShowMouseCursor(IN OUT PFRONTEND This, BOOL Show)
Definition: guiterm.c:1075
static VOID NTAPI GuiWriteStream(IN OUT PFRONTEND This, SMALL_RECT *Region, SHORT CursorStartX, SHORT CursorStartY, UINT ScrolledLines, PWCHAR Buffer, UINT Length)
Definition: guiterm.c:641
static VOID NTAPI GuiGetLargestConsoleWindowSize(IN OUT PFRONTEND This, PCOORD pSize)
Definition: guiterm.c:934
static BOOL NTAPI GuiSetScreenInfo(IN OUT PFRONTEND This, PCONSOLE_SCREEN_BUFFER Buff, SHORT OldCursorX, SHORT OldCursorY)
Definition: guiterm.c:730
static HWND NTAPI GuiGetConsoleWindowHandle(IN OUT PFRONTEND This)
Definition: guiterm.c:927
static VOID NTAPI GuiChangeTitle(IN OUT PFRONTEND This)
Definition: guiterm.c:870
static BOOL NTAPI GuiSetMenuClose(IN OUT PFRONTEND This, BOOL Enable)
Definition: guiterm.c:1128
static VOID NTAPI GuiDrawRegion(IN OUT PFRONTEND This, SMALL_RECT *Region)
Definition: guiterm.c:629
static VOID NTAPI GuiReleaseScreenBuffer(IN OUT PFRONTEND This, IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
Definition: guiterm.c:800
static VOID NTAPI GuiDeinitFrontEnd(IN OUT PFRONTEND This)
Definition: guiterm.c:594
static NTSTATUS NTAPI GuiInitFrontEnd(IN OUT PFRONTEND This, IN PCONSRV_CONSOLE Console)
Definition: guiterm.c:480
static BOOL NTAPI GuiSetPalette(IN OUT PFRONTEND This, HPALETTE PaletteHandle, UINT PaletteUsage)
Definition: guiterm.c:1011

Definition at line 1147 of file guiterm.c.

Referenced by GuiLoadFrontEnd().