ReactOS  0.4.13-dev-464-g6b95727
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 
16 static NTSTATUS NTAPI
19 {
20  return STATUS_SUCCESS;
21 }
22 
23 static VOID NTAPI
25 {
26 }
27 
28 
29 
30 /************ Line discipline ***************/
31 
32 static 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 
50 static NTSTATUS NTAPI
53  PWCHAR Buffer,
54  DWORD Length,
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->UnpauseEvent != NULL) return STATUS_PENDING;
65 
66  return STATUS_PENDING;
67 }
68 
69 /************ Line discipline ***************/
70 
71 
72 
73 static VOID NTAPI
76 {
77 }
78 
79 static BOOL NTAPI
82 {
83  return TRUE;
84 }
85 
86 static BOOL NTAPI
89  SHORT OldCursorX,
90  SHORT OldCursorY)
91 {
92  return TRUE;
93 }
94 
95 static VOID NTAPI
97 {
98 }
99 
100 static VOID NTAPI
102 {
103 }
104 
105 static VOID NTAPI
108 {
109 }
110 
111 static 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 
121 static BOOL NTAPI
123  HPALETTE PaletteHandle,
124  UINT PaletteUsage)
125 {
126  return TRUE;
127 }
128 
129 static INT NTAPI
131  BOOL Show)
132 {
133  return 0;
134 }
135 
137 {
140 
143 
153 };
154 
155 VOID
157 {
158  if (!Console) return;
159 
160  /* Reinitialize the terminal interface */
161  RtlZeroMemory(&Console->TermIFace, sizeof(Console->TermIFace));
162  Console->TermIFace.Vtbl = &DummyVtbl;
163 }
164 
165 /* EOF */
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
static BOOL NTAPI DummySetCursorInfo(IN OUT PTERMINAL This, PCONSOLE_SCREEN_BUFFER ScreenBuffer)
Definition: dummyterm.c:80
static BOOL NTAPI DummySetScreenInfo(IN OUT PTERMINAL This, PCONSOLE_SCREEN_BUFFER ScreenBuffer, SHORT OldCursorX, SHORT OldCursorY)
Definition: dummyterm.c:87
static NTSTATUS NTAPI DummyWriteStream(IN OUT PTERMINAL This, PTEXTMODE_SCREEN_BUFFER Buff, PWCHAR Buffer, DWORD Length, BOOL Attrib)
Definition: dummyterm.c:51
LONG NTSTATUS
Definition: precomp.h:26
static VOID NTAPI DummyGetLargestConsoleWindowSize(IN OUT PTERMINAL This, PCOORD pSize)
Definition: dummyterm.c:112
uint16_t * PWCHAR
Definition: typedefs.h:54
static HPALETTE PaletteHandle
Definition: svga.c:215
_In_ PVOID Parameter
Definition: ldrtypes.h:240
int32_t INT
Definition: typedefs.h:56
VOID ResetTerminal(IN PCONSOLE Console)
Definition: dummyterm.c:156
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
short SHORT
Definition: pedump.c:59
static VOID NTAPI DummyReleaseScreenBuffer(IN OUT PTERMINAL This, IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
Definition: dummyterm.c:106
unsigned char BOOLEAN
static BOOL NTAPI DummySetPalette(IN OUT PTERMINAL This, HPALETTE PaletteHandle, UINT PaletteUsage)
Definition: dummyterm.c:122
Definition: bufpool.h:45
ULONG X
Definition: bl.h:1340
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
#define STATUS_PENDING
Definition: ntstatus.h:82
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static VOID NTAPI DummyDrawRegion(IN OUT PTERMINAL This, SMALL_RECT *Region)
Definition: dummyterm.c:74
static VOID NTAPI DummySetActiveScreenBuffer(IN OUT PTERMINAL This)
Definition: dummyterm.c:101
Definition: bl.h:1338
static TERMINAL_VTBL DummyVtbl
Definition: dummyterm.c:136
static NTSTATUS NTAPI DummyInitTerminal(IN OUT PTERMINAL This, IN PCONSOLE Console)
Definition: dummyterm.c:17
static INT NTAPI DummyShowMouseCursor(IN OUT PTERMINAL This, BOOL Show)
Definition: dummyterm.c:130
static VOID NTAPI DummyResizeTerminal(IN OUT PTERMINAL This)
Definition: dummyterm.c:96
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
CConsole Console
HANDLE ScreenBuffer
Definition: notevil.c:37
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
return STATUS_SUCCESS
Definition: btrfs.c:2777
ULONG Y
Definition: bl.h:1341
static VOID NTAPI DummyDeinitTerminal(IN OUT PTERMINAL This)
Definition: dummyterm.c:24
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68