ReactOS 0.4.16-dev-91-g764881a
conoutput.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ConSrvGetTextModeBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
 
#define ConSrvGetTextModeBufferAndHandleEntry(ProcessData, Handle, Ptr, Entry, Access, LockConsole)
 
#define ConSrvGetGraphicsBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
 
#define ConSrvGetGraphicsBufferAndHandleEntry(ProcessData, Handle, Ptr, Entry, Access, LockConsole)
 
#define ConSrvGetScreenBuffer(ProcessData, Handle, Ptr, Access, LockConsole)
 
#define ConSrvGetScreenBufferAndHandleEntry(ProcessData, Handle, Ptr, Entry, Access, LockConsole)
 
#define ConSrvReleaseScreenBuffer(Buff, IsConsoleLocked)    ConSrvReleaseObject(&(Buff)->Header, (IsConsoleLocked))
 

Functions

NTSTATUS ConDrvCreateScreenBuffer (OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle OPTIONAL, IN ULONG BufferType, IN PVOID ScreenBufferInfo)
 
VOID NTAPI ConDrvDeleteScreenBuffer (PCONSOLE_SCREEN_BUFFER Buffer)
 
PCONSOLE_SCREEN_BUFFER ConDrvGetActiveScreenBuffer (IN PCONSOLE Console)
 

Macro Definition Documentation

◆ ConSrvGetGraphicsBuffer

#define ConSrvGetGraphicsBuffer (   ProcessData,
  Handle,
  Ptr,
  Access,
  LockConsole 
)
Value:
ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), NULL, \
(Access), (LockConsole), GRAPHICS_BUFFER)
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
ULONG Handle
Definition: gdb_input.c:15
NTSTATUS ConSrvGetObject(IN PCONSOLE_PROCESS_DATA ProcessData, IN HANDLE Handle, OUT PCONSOLE_IO_OBJECT *Object, OUT PVOID *Entry OPTIONAL, IN ULONG Access, IN BOOLEAN LockConsole, IN CONSOLE_IO_OBJECT_TYPE Type)
Definition: handle.c:318
@ GRAPHICS_BUFFER
Definition: conio.h:26

Definition at line 19 of file conoutput.h.

◆ ConSrvGetGraphicsBufferAndHandleEntry

#define ConSrvGetGraphicsBufferAndHandleEntry (   ProcessData,
  Handle,
  Ptr,
  Entry,
  Access,
  LockConsole 
)
Value:
ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), (Entry), \
(Access), (LockConsole), GRAPHICS_BUFFER)
base of all file and directory entries
Definition: entries.h:83

Definition at line 22 of file conoutput.h.

◆ ConSrvGetScreenBuffer

#define ConSrvGetScreenBuffer (   ProcessData,
  Handle,
  Ptr,
  Access,
  LockConsole 
)
Value:
ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), NULL, \
(Access), (LockConsole), SCREEN_BUFFER)
@ SCREEN_BUFFER
Definition: conio.h:27

Definition at line 26 of file conoutput.h.

◆ ConSrvGetScreenBufferAndHandleEntry

#define ConSrvGetScreenBufferAndHandleEntry (   ProcessData,
  Handle,
  Ptr,
  Entry,
  Access,
  LockConsole 
)
Value:
ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), (Entry), \
(Access), (LockConsole), SCREEN_BUFFER)

Definition at line 29 of file conoutput.h.

◆ ConSrvGetTextModeBuffer

#define ConSrvGetTextModeBuffer (   ProcessData,
  Handle,
  Ptr,
  Access,
  LockConsole 
)
Value:
ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), NULL, \
(Access), (LockConsole), TEXTMODE_BUFFER)
#define TEXTMODE_BUFFER
Definition: pccons.c:21

Definition at line 12 of file conoutput.h.

◆ ConSrvGetTextModeBufferAndHandleEntry

#define ConSrvGetTextModeBufferAndHandleEntry (   ProcessData,
  Handle,
  Ptr,
  Entry,
  Access,
  LockConsole 
)
Value:
ConSrvGetObject((ProcessData), (Handle), (PCONSOLE_IO_OBJECT*)(Ptr), (Entry), \
(Access), (LockConsole), TEXTMODE_BUFFER)

Definition at line 15 of file conoutput.h.

◆ ConSrvReleaseScreenBuffer

#define ConSrvReleaseScreenBuffer (   Buff,
  IsConsoleLocked 
)     ConSrvReleaseObject(&(Buff)->Header, (IsConsoleLocked))

Definition at line 33 of file conoutput.h.

Function Documentation

◆ ConDrvCreateScreenBuffer()

NTSTATUS ConDrvCreateScreenBuffer ( OUT PCONSOLE_SCREEN_BUFFER Buffer,
IN PCONSOLE  Console,
IN HANDLE ProcessHandle  OPTIONAL,
IN ULONG  BufferType,
IN PVOID  ScreenBufferInfo 
)

Definition at line 85 of file conoutput.c.

90{
92
93 if ( Console == NULL || Buffer == NULL ||
94 (BufferType != CONSOLE_TEXTMODE_BUFFER && BufferType != CONSOLE_GRAPHICS_BUFFER) )
95 {
97 }
98
99 /* Use the current process if ProcessHandle is NULL */
100 if (ProcessHandle == NULL)
102
103 switch (BufferType)
104 {
108 break;
109
113 break;
114
115 default:
116 /* Never ever go there!! */
117 ASSERT(FALSE);
118 }
119
120 /* Insert the newly created screen buffer into the list, if succeeded */
121 if (NT_SUCCESS(Status)) InsertHeadList(&Console->BufferList, &(*Buffer)->ListEntry);
122
123 return Status;
124}
CConsole Console
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
NTSTATUS TEXTMODE_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle, IN PTEXTMODE_BUFFER_INFO TextModeInfo)
Definition: text.c:54
NTSTATUS GRAPHICS_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle, IN PGRAPHICS_BUFFER_INFO GraphicsInfo)
Definition: graphics.c:33
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define InsertHeadList(ListHead, Entry)
Status
Definition: gdiplustypes.h:25
#define ASSERT(a)
Definition: mode.c:44
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo
Definition: notevil.c:38
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define CONSOLE_TEXTMODE_BUFFER
Definition: wincon.h:62
#define CONSOLE_GRAPHICS_BUFFER
Definition: wincon.h:63

Referenced by CON_API(), and ConDrvInitConsole().

◆ ConDrvDeleteScreenBuffer()

VOID NTAPI ConDrvDeleteScreenBuffer ( PCONSOLE_SCREEN_BUFFER  Buffer)

Definition at line 130 of file conoutput.c.

131{
132 PCONSOLE Console = Buffer->Header.Console;
133 PCONSOLE_SCREEN_BUFFER NewBuffer;
134
135 /*
136 * We should notify temporarily the frontend because we are susceptible
137 * to delete the screen buffer it is using (which may be different from
138 * the active screen buffer in some cases), and because, if it actually
139 * uses the active screen buffer, we are going to nullify its pointer to
140 * change it.
141 */
143
144 RemoveEntryList(&Buffer->ListEntry);
145 if (Buffer == Console->ActiveBuffer)
146 {
147 /* Delete active buffer; switch to most recently created */
148 if (!IsListEmpty(&Console->BufferList))
149 {
150 NewBuffer = CONTAINING_RECORD(Console->BufferList.Flink,
152 ListEntry);
153
154 /* Tie console to new buffer and signal the change to the frontend */
156 }
157 else
158 {
159 Console->ActiveBuffer = NULL;
160 // InterlockedExchangePointer(&Console->ActiveBuffer, NULL);
161 }
162 }
163
165}
static VOID ConioSetActiveScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer)
Definition: conoutput.c:168
VOID CONSOLE_SCREEN_BUFFER_Destroy(IN OUT PCONSOLE_SCREEN_BUFFER Buffer)
Definition: conoutput.c:55
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define TermReleaseScreenBuffer(Console, ScreenBuffer)
Definition: term.h:32
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by CON_API(), ConDrvDeleteConsole(), ConDrvSetConsoleActiveScreenBuffer(), and ConSrvCloseHandle().

◆ ConDrvGetActiveScreenBuffer()

PCONSOLE_SCREEN_BUFFER ConDrvGetActiveScreenBuffer ( IN PCONSOLE  Console)

Definition at line 201 of file conoutput.c.

202{
203 return (Console ? Console->ActiveBuffer : NULL);
204}

Referenced by GuiSetActiveScreenBuffer().