ReactOS  0.4.13-dev-563-g0561610
frontendctl.c File Reference
#include "consrv.h"
#include <debug.h>
Include dependency graph for frontendctl.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

 CSR_API (SrvGetConsoleHardwareState)
 
 CSR_API (SrvSetConsoleHardwareState)
 
 CSR_API (SrvGetConsoleDisplayMode)
 
 CSR_API (SrvSetConsoleDisplayMode)
 
 CSR_API (SrvGetLargestConsoleWindowSize)
 
 CSR_API (SrvShowConsoleCursor)
 
 CSR_API (SrvSetConsoleCursor)
 
 CSR_API (SrvConsoleMenuControl)
 
 CSR_API (SrvSetConsoleMenuClose)
 
NTSTATUS NTAPI GetThreadConsoleDesktop (IN ULONG_PTR ThreadId, OUT HDESK *ConsoleDesktop)
 
 CSR_API (SrvGetConsoleWindow)
 
 CSR_API (SrvSetConsoleIcon)
 
 CSR_API (SrvGetConsoleSelectionInfo)
 
 CSR_API (SrvGetConsoleNumberOfFonts)
 
 CSR_API (SrvGetConsoleFontInfo)
 
 CSR_API (SrvGetConsoleFontSize)
 
 CSR_API (SrvGetConsoleCurrentFont)
 
 CSR_API (SrvSetConsoleFont)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file frontendctl.c.

Function Documentation

◆ CSR_API() [1/17]

CSR_API ( SrvGetConsoleHardwareState  )

Definition at line 55 of file frontendctl.c.

56 {
57 #if 0
59  PCONSOLE_GETSETHWSTATE HardwareStateRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HardwareStateRequest;
62 
64  HardwareStateRequest->OutputHandle,
65  &Buff,
67  TRUE);
68  if (!NT_SUCCESS(Status))
69  {
70  DPRINT1("Failed to get console handle in SrvGetConsoleHardwareState\n");
71  return Status;
72  }
73 
74  Console = Buff->Header.Console;
75  HardwareStateRequest->State = Console->HardwareState;
76 
78  return Status;
79 #else
82 #endif
83 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
CConsole Console
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define UNIMPLEMENTED
Definition: debug.h:114

◆ CSR_API() [2/17]

CSR_API ( SrvSetConsoleHardwareState  )

Definition at line 85 of file frontendctl.c.

86 {
87 #if 0
89  PCONSOLE_GETSETHWSTATE HardwareStateRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HardwareStateRequest;
92 
94  HardwareStateRequest->OutputHandle,
95  &Buff,
97  TRUE);
98  if (!NT_SUCCESS(Status))
99  {
100  DPRINT1("Failed to get console handle in SrvSetConsoleHardwareState\n");
101  return Status;
102  }
103 
104  DPRINT("Setting console hardware state.\n");
105  Console = Buff->Header.Console;
106  Status = SetConsoleHardwareState(Console, HardwareStateRequest->State);
107 
109  return Status;
110 #else
112  return STATUS_NOT_IMPLEMENTED;
113 #endif
114 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
#define GENERIC_WRITE
Definition: nt_native.h:90
BOOL WINAPI SetConsoleHardwareState(HANDLE hConsoleOutput, DWORD Flags, DWORD State)
Definition: console.c:944
void DPRINT(...)
Definition: polytest.cpp:61
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
Status
Definition: gdiplustypes.h:24
CConsole Console
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define UNIMPLEMENTED
Definition: debug.h:114

◆ CSR_API() [3/17]

CSR_API ( SrvGetConsoleDisplayMode  )

Definition at line 116 of file frontendctl.c.

117 {
119  PCONSOLE_GETDISPLAYMODE GetDisplayModeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetDisplayModeRequest;
121 
123  &Console, TRUE);
124  if (!NT_SUCCESS(Status)) return Status;
125 
126  GetDisplayModeRequest->DisplayMode = TermGetDisplayMode(Console);
127 
129  return STATUS_SUCCESS;
130 }
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define TermGetDisplayMode(Console)
Definition: term.h:56
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [4/17]

CSR_API ( SrvSetConsoleDisplayMode  )

Definition at line 132 of file frontendctl.c.

133 {
135  PCONSOLE_SETDISPLAYMODE SetDisplayModeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetDisplayModeRequest;
138 
140  SetDisplayModeRequest->OutputHandle,
141  &Buff,
143  TRUE);
144  if (!NT_SUCCESS(Status)) return Status;
145 
147 
148  if (TermSetDisplayMode(Console, SetDisplayModeRequest->DisplayMode))
149  {
150  SetDisplayModeRequest->NewSBDim = Buff->ScreenBufferSize;
152  }
153  else
154  {
156  }
157 
159  return Status;
160 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define TermSetDisplayMode(Console, NewMode)
Definition: term.h:58
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
COORD ScreenBufferSize
Definition: conio.h:87
#define GENERIC_WRITE
Definition: nt_native.h:90
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define ConSrvGetScreenBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:26
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [5/17]

CSR_API ( SrvGetLargestConsoleWindowSize  )

Definition at line 162 of file frontendctl.c.

163 {
165  PCONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetLargestWindowSizeRequest;
166  PCONSOLE /*PCONSRV_CONSOLE*/ Console;
168 
170  GetLargestWindowSizeRequest->OutputHandle,
171  &Buff,
172  GENERIC_READ,
173  TRUE);
174  if (!NT_SUCCESS(Status)) return Status;
175 
176  Console = Buff->Header.Console;
177 
178  /*
179  * Retrieve the largest possible console window size, without
180  * taking into account the size of the console screen buffer
181  * (thus differs from ConDrvGetConsoleScreenBufferInfo).
182  */
183  TermGetLargestConsoleWindowSize(Console, &GetLargestWindowSizeRequest->Size);
184 
186  return STATUS_SUCCESS;
187 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define TermGetLargestConsoleWindowSize(Console, pSize)
Definition: term.h:34
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [6/17]

CSR_API ( SrvShowConsoleCursor  )

Definition at line 189 of file frontendctl.c.

190 {
192  PCONSOLE_SHOWCURSOR ShowCursorRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ShowCursorRequest;
193  PCONSOLE /*PCONSRV_CONSOLE*/ Console;
195 
197  ShowCursorRequest->OutputHandle,
198  &Buff,
200  TRUE);
201  if (!NT_SUCCESS(Status)) return Status;
202 
203  Console = Buff->Header.Console;
204 
205  ShowCursorRequest->RefCount = TermShowMouseCursor(Console, ShowCursorRequest->Show);
206 
208  return STATUS_SUCCESS;
209 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
#define GENERIC_WRITE
Definition: nt_native.h:90
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define TermShowMouseCursor(Console, Show)
Definition: term.h:38
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define ConSrvGetScreenBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:26
Status
Definition: gdiplustypes.h:24
HANDLE OutputHandle
Definition: conmsg.h:330
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [7/17]

CSR_API ( SrvSetConsoleCursor  )

Definition at line 211 of file frontendctl.c.

212 {
214  BOOL Success;
215  PCONSOLE_SETCURSOR SetCursorRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetCursorRequest;
218 
219  // NOTE: Tests show that this function is used only for graphics screen buffers
220  // and otherwise it returns FALSE and sets last error to ERROR_INVALID_HANDLE.
221  // I find that behaviour is ridiculous but ok, let's accept it at the moment...
223  SetCursorRequest->OutputHandle,
224  &Buff,
226  TRUE);
227  if (!NT_SUCCESS(Status)) return Status;
228 
230 
231  Success = TermSetMouseCursor(Console, SetCursorRequest->CursorHandle);
232 
235 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
HCURSOR CursorHandle
Definition: conmsg.h:339
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_WRITE
Definition: nt_native.h:90
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
HANDLE OutputHandle
Definition: conmsg.h:338
Status
Definition: gdiplustypes.h:24
#define ConSrvGetGraphicsBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:19
#define TermSetMouseCursor(Console, CursorHandle)
Definition: term.h:60
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [8/17]

CSR_API ( SrvConsoleMenuControl  )

Definition at line 237 of file frontendctl.c.

238 {
240  PCONSOLE_MENUCONTROL MenuControlRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.MenuControlRequest;
243 
245  MenuControlRequest->OutputHandle,
246  &Buff,
248  TRUE);
249  if (!NT_SUCCESS(Status)) return Status;
250 
252 
253  MenuControlRequest->MenuHandle = TermMenuControl(Console,
254  MenuControlRequest->CmdIdLow,
255  MenuControlRequest->CmdIdHigh);
256 
258  return STATUS_SUCCESS;
259 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE * Console
Definition: conio.h:52
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
HANDLE OutputHandle
Definition: conmsg.h:693
#define PCONSRV_CONSOLE
Definition: conio.h:27
CONSOLE_IO_OBJECT Header
Definition: conio.h:82
#define GENERIC_WRITE
Definition: nt_native.h:90
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define ConSrvGetScreenBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:26
Status
Definition: gdiplustypes.h:24
#define TermMenuControl(Console, CmdIdLow, CmdIdHigh)
Definition: term.h:62
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [9/17]

CSR_API ( SrvSetConsoleMenuClose  )

Definition at line 261 of file frontendctl.c.

262 {
264  BOOL Success;
265  PCONSOLE_SETMENUCLOSE SetMenuCloseRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetMenuCloseRequest;
267 
269  &Console, TRUE);
270  if (!NT_SUCCESS(Status)) return Status;
271 
272  Success = TermSetMenuClose(Console, SetMenuCloseRequest->Enable);
273 
276 }
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define TermSetMenuClose(Console, Enable)
Definition: term.h:64
#define PCONSRV_CONSOLE
Definition: conio.h:27
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
unsigned int BOOL
Definition: ntddk_ex.h:94
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [10/17]

CSR_API ( SrvGetConsoleWindow  )

Definition at line 314 of file frontendctl.c.

315 {
317  PCONSOLE_GETWINDOW GetWindowRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetWindowRequest;
319 
321  &Console, TRUE);
322  if (!NT_SUCCESS(Status)) return Status;
323 
324  GetWindowRequest->WindowHandle = TermGetConsoleWindowHandle(Console);
325 
327  return STATUS_SUCCESS;
328 }
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
#define TermGetConsoleWindowHandle(Console)
Definition: term.h:52
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [11/17]

CSR_API ( SrvSetConsoleIcon  )

Definition at line 330 of file frontendctl.c.

331 {
333  PCONSOLE_SETICON SetIconRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetIconRequest;
335 
337  &Console, TRUE);
338  if (!NT_SUCCESS(Status)) return Status;
339 
340  Status = (TermChangeIcon(Console, SetIconRequest->IconHandle)
343 
345  return Status;
346 }
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777
HICON IconHandle
Definition: conmsg.h:723
#define TermChangeIcon(Console, IconHandle)
Definition: term.h:48

◆ CSR_API() [12/17]

CSR_API ( SrvGetConsoleSelectionInfo  )

Definition at line 348 of file frontendctl.c.

349 {
351  PCONSOLE_GETSELECTIONINFO GetSelectionInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetSelectionInfoRequest;
353 
355  &Console, TRUE);
356  if (!NT_SUCCESS(Status)) return Status;
357 
358  Status = (TermGetSelectionInfo(Console, &GetSelectionInfoRequest->Info)
361 
363  return Status;
364 }
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define TermGetSelectionInfo(Console, pSelectionInfo)
Definition: term.h:54
CONSOLE_SELECTION_INFO Info
Definition: conmsg.h:844
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
CConsole Console
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ CSR_API() [13/17]

CSR_API ( SrvGetConsoleNumberOfFonts  )

Definition at line 368 of file frontendctl.c.

369 {
371  PCONSOLE_GETNUMFONTS GetNumFontsRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetNumFontsRequest;
372  PCONSOLE /*PCONSRV_CONSOLE*/ Console;
373 
375  &Console, TRUE);
376  if (!NT_SUCCESS(Status)) return Status;
377 
378  // FIXME!
379  // TermGetNumberOfFonts(Console, ...);
380  DPRINT1("%s not yet implemented\n", __FUNCTION__);
381  GetNumFontsRequest->NumFonts = 0;
382 
384  return STATUS_SUCCESS;
385 }
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
Status
Definition: gdiplustypes.h:24
CConsole Console
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define __FUNCTION__
Definition: types.h:112

◆ CSR_API() [14/17]

CSR_API ( SrvGetConsoleFontInfo  )

Definition at line 387 of file frontendctl.c.

388 {
390  PCONSOLE_GETFONTINFO GetFontInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetFontInfoRequest;
391  // PCONSOLE /*PCONSRV_CONSOLE*/ Console;
393 
395  GetFontInfoRequest->OutputHandle,
396  &Buff,
397  GENERIC_READ,
398  TRUE);
399  if (!NT_SUCCESS(Status)) return Status;
400 
401  // FIXME!
402  // Console = Buff->Header.Console;
403  // TermGetFontInfo(Console, ...);
404  DPRINT1("%s not yet implemented\n", __FUNCTION__);
405  GetFontInfoRequest->NumFonts = 0;
406 
408  return STATUS_SUCCESS;
409 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define __FUNCTION__
Definition: types.h:112
HANDLE OutputHandle
Definition: conmsg.h:412

◆ CSR_API() [15/17]

CSR_API ( SrvGetConsoleFontSize  )

Definition at line 411 of file frontendctl.c.

412 {
414  PCONSOLE_GETFONTSIZE GetFontSizeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetFontSizeRequest;
415  // PCONSOLE /*PCONSRV_CONSOLE*/ Console;
417 
419  GetFontSizeRequest->OutputHandle,
420  &Buff,
421  GENERIC_READ,
422  TRUE);
423  if (!NT_SUCCESS(Status)) return Status;
424 
425  // FIXME!
426  // Console = Buff->Header.Console;
427  // TermGetFontSize(Console, ...);
428  DPRINT1("%s not yet implemented\n", __FUNCTION__);
429 
431  return STATUS_SUCCESS;
432 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
HANDLE OutputHandle
Definition: conmsg.h:421
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define __FUNCTION__
Definition: types.h:112

◆ CSR_API() [16/17]

CSR_API ( SrvGetConsoleCurrentFont  )

Definition at line 434 of file frontendctl.c.

435 {
437  PCONSOLE_GETCURRENTFONT GetCurrentFontRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCurrentFontRequest;
438  // PCONSOLE /*PCONSRV_CONSOLE*/ Console;
440 
442  GetCurrentFontRequest->OutputHandle,
443  &Buff,
444  GENERIC_READ,
445  TRUE);
446  if (!NT_SUCCESS(Status)) return Status;
447 
448  // FIXME!
449  // Console = Buff->Header.Console;
450  // TermGetCurrentFont(Console, ...);
451  DPRINT1("%s not yet implemented\n", __FUNCTION__);
452  GetCurrentFontRequest->FontIndex = 0;
453 
455  return STATUS_SUCCESS;
456 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
#define GENERIC_READ
Definition: compat.h:124
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define __FUNCTION__
Definition: types.h:112

◆ CSR_API() [17/17]

CSR_API ( SrvSetConsoleFont  )

Definition at line 458 of file frontendctl.c.

459 {
461  PCONSOLE_SETFONT SetFontRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetFontRequest;
462  // PCONSOLE /*PCONSRV_CONSOLE*/ Console;
464 
466  SetFontRequest->OutputHandle,
467  &Buff,
469  TRUE);
470  if (!NT_SUCCESS(Status)) return Status;
471 
472  // FIXME!
473  // Console = Buff->Header.Console;
474  // TermSetFont(Console, ...);
475  DPRINT1("%s not yet implemented\n", __FUNCTION__);
476 
478  return STATUS_SUCCESS;
479 }
#define CsrGetClientThread()
Definition: csrsrv.h:77
#define TRUE
Definition: types.h:120
HANDLE OutputHandle
Definition: conmsg.h:438
struct _CONSOLE_API_MESSAGE * PCONSOLE_API_MESSAGE
LONG NTSTATUS
Definition: precomp.h:26
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
Definition: conoutput.h:12
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)
Definition: conoutput.h:33
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define __FUNCTION__
Definition: types.h:112

◆ GetThreadConsoleDesktop()

NTSTATUS NTAPI GetThreadConsoleDesktop ( IN ULONG_PTR  ThreadId,
OUT HDESK *  ConsoleDesktop 
)

Definition at line 281 of file frontendctl.c.

284 {
286  PCSR_THREAD CsrThread;
288 
289  /* No console desktop handle by default */
290  *ConsoleDesktop = NULL;
291 
292  /* Retrieve and lock the thread */
293  Status = CsrLockThreadByClientId(ULongToHandle(ThreadId), &CsrThread);
294  if (!NT_SUCCESS(Status))
295  return Status;
296 
297  ASSERT(CsrThread->Process);
298 
299  /* Retrieve the console to which the process is attached, and unlock the thread */
301  &Console, TRUE);
302  CsrUnlockThread(CsrThread);
303 
304  if (!NT_SUCCESS(Status))
305  return Status;
306 
307  /* Retrieve the console desktop handle, and release the console */
308  *ConsoleDesktop = TermGetThreadConsoleDesktop(Console);
310 
311  return STATUS_SUCCESS;
312 }
#define ULongToHandle(h)
Definition: basetsd.h:81
NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, OUT PCONSRV_CONSOLE *Console, IN BOOLEAN LockConsole)
Definition: console.c:271
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define PCONSRV_CONSOLE
Definition: conio.h:27
VOID ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console, IN BOOLEAN IsConsoleLocked)
Definition: console.c:296
PCSR_PROCESS Process
Definition: csrsrv.h:69
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI CsrUnlockThread(IN PCSR_THREAD CsrThread)
Definition: thredsup.c:1074
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ConsoleGetPerProcessData(Process)
Definition: consrv.h:37
NTSTATUS NTAPI CsrLockThreadByClientId(IN HANDLE Tid, OUT PCSR_THREAD *CsrThread)
Definition: thredsup.c:964
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Status
Definition: gdiplustypes.h:24
#define TermGetThreadConsoleDesktop(Console)
Definition: term.h:50
CConsole Console
return STATUS_SUCCESS
Definition: btrfs.c:2777

Referenced by CSR_API().