ReactOS 0.4.15-dev-7942-gd23573b
dummyterm.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: win32ss/user/winsrv/consrv/condrv/dummyterm.c
5 * PURPOSE: Dummy Terminal used when no terminal
6 * is attached to the specified console.
7 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10/* INCLUDES *******************************************************************/
11
12#include <consrv.h>
13
14/* DUMMY TERMINAL INTERFACE ***************************************************/
15
16static NTSTATUS NTAPI
19{
20 return STATUS_SUCCESS;
21}
22
23static VOID NTAPI
25{
26}
27
28
29
30/************ Line discipline ***************/
31
32static NTSTATUS NTAPI
34 IN BOOLEAN Unicode,
39 IN ULONG NumCharsToRead,
40 OUT PULONG NumCharsRead OPTIONAL)
41{
42 /*
43 * We were called because the console was in cooked mode.
44 * There is nothing to read, wait until a real terminal
45 * is plugged into the console.
46 */
47 return STATUS_PENDING;
48}
49
50static NTSTATUS NTAPI
55 BOOL Attrib)
56{
57 /*
58 * We were called because the console was in cooked mode.
59 * There is nothing to write, wait until a real terminal
60 * is plugged into the console.
61 */
62
63 // /* Stop here if the console is paused */
64 // if (Console->ConsolePaused) return STATUS_PENDING;
65
66 return STATUS_PENDING;
67}
68
69/************ Line discipline ***************/
70
71
72
73static VOID NTAPI
76{
77}
78
79static BOOL NTAPI
82{
83 return TRUE;
84}
85
86static BOOL NTAPI
89 SHORT OldCursorX,
90 SHORT OldCursorY)
91{
92 return TRUE;
93}
94
95static VOID NTAPI
97{
98}
99
100static VOID NTAPI
102{
103}
104
105static VOID NTAPI
108{
109}
110
111static VOID NTAPI
113 PCOORD pSize)
114{
115 /* Return a standard size */
116 if (!pSize) return;
117 pSize->X = 80;
118 pSize->Y = 25;
119}
120
121static BOOL NTAPI
123 HPALETTE PaletteHandle,
124 UINT PaletteUsage)
125{
126 return TRUE;
127}
128
129static BOOL NTAPI
131 UINT CodePage)
132{
133 return TRUE;
134}
135
136static INT NTAPI
138 BOOL Show)
139{
140 return 0;
141}
142
144{
147
150
161};
162
163VOID
165{
166 if (!Console) return;
167
168 /* Reinitialize the terminal interface */
169 RtlZeroMemory(&Console->TermIFace, sizeof(Console->TermIFace));
170 Console->TermIFace.Vtbl = &DummyVtbl;
171}
172
173/* EOF */
unsigned char BOOLEAN
CConsole Console
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define TRUE
Definition: types.h:120
static VOID NTAPI DummyGetLargestConsoleWindowSize(IN OUT PTERMINAL This, PCOORD pSize)
Definition: dummyterm.c:112
static NTSTATUS NTAPI DummyInitTerminal(IN OUT PTERMINAL This, IN PCONSOLE Console)
Definition: dummyterm.c:17
static VOID NTAPI DummySetActiveScreenBuffer(IN OUT PTERMINAL This)
Definition: dummyterm.c:101
static VOID NTAPI DummyResizeTerminal(IN OUT PTERMINAL This)
Definition: dummyterm.c:96
static TERMINAL_VTBL DummyVtbl
Definition: dummyterm.c:143
static NTSTATUS NTAPI DummyReadStream(IN OUT PTERMINAL This, IN BOOLEAN Unicode, OUT PVOID Buffer, IN OUT PCONSOLE_READCONSOLE_CONTROL ReadControl, IN PVOID Parameter OPTIONAL, IN ULONG NumCharsToRead, OUT PULONG NumCharsRead OPTIONAL)
Definition: dummyterm.c:33
VOID ResetTerminal(IN PCONSOLE Console)
Definition: dummyterm.c:164
static NTSTATUS NTAPI DummyWriteStream(IN OUT PTERMINAL This, PTEXTMODE_SCREEN_BUFFER Buff, PWCHAR Buffer, DWORD Length, BOOL Attrib)
Definition: dummyterm.c:51
static BOOL NTAPI DummySetScreenInfo(IN OUT PTERMINAL This, PCONSOLE_SCREEN_BUFFER ScreenBuffer, SHORT OldCursorX, SHORT OldCursorY)
Definition: dummyterm.c:87
static VOID NTAPI DummyReleaseScreenBuffer(IN OUT PTERMINAL This, IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
Definition: dummyterm.c:106
static VOID NTAPI DummyDrawRegion(IN OUT PTERMINAL This, SMALL_RECT *Region)
Definition: dummyterm.c:74
static BOOL NTAPI DummySetCodePage(IN OUT PTERMINAL This, UINT CodePage)
Definition: dummyterm.c:130
static BOOL NTAPI DummySetPalette(IN OUT PTERMINAL This, HPALETTE PaletteHandle, UINT PaletteUsage)
Definition: dummyterm.c:122
static VOID NTAPI DummyDeinitTerminal(IN OUT PTERMINAL This)
Definition: dummyterm.c:24
static BOOL NTAPI DummySetCursorInfo(IN OUT PTERMINAL This, PCONSOLE_SCREEN_BUFFER ScreenBuffer)
Definition: dummyterm.c:80
static INT NTAPI DummyShowMouseCursor(IN OUT PTERMINAL This, BOOL Show)
Definition: dummyterm.c:137
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int UINT
Definition: ndis.h:50
HANDLE ScreenBuffer
Definition: notevil.c:37
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_PENDING
Definition: ntstatus.h:82
short SHORT
Definition: pedump.c:59
#define STATUS_SUCCESS
Definition: shellext.h:65
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: bl.h:1338
ULONG Y
Definition: bl.h:1340
ULONG X
Definition: bl.h:1339
static HPALETTE PaletteHandle
Definition: svga.c:215
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:323