ReactOS  0.4.15-dev-492-ga1108f6
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:
(Access), (LockConsole), GRAPHICS_BUFFER)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE Handle
Definition: extypes.h:390
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

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)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
_In_ HANDLE Handle
Definition: extypes.h:390
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
base of all file and directory entries
Definition: entries.h:82

Definition at line 22 of file conoutput.h.

◆ ConSrvGetScreenBuffer

#define ConSrvGetScreenBuffer (   ProcessData,
  Handle,
  Ptr,
  Access,
  LockConsole 
)
Value:
(Access), (LockConsole), SCREEN_BUFFER)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE Handle
Definition: extypes.h:390
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

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)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
_In_ HANDLE Handle
Definition: extypes.h:390
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
base of all file and directory entries
Definition: entries.h:82

Definition at line 29 of file conoutput.h.

◆ ConSrvGetTextModeBuffer

#define ConSrvGetTextModeBuffer (   ProcessData,
  Handle,
  Ptr,
  Access,
  LockConsole 
)
Value:
(Access), (LockConsole), TEXTMODE_BUFFER)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE Handle
Definition: extypes.h:390
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

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)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
_In_ HANDLE Handle
Definition: extypes.h:390
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
base of all file and directory entries
Definition: entries.h:82

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 }
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo
Definition: notevil.c:38
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS TEXTMODE_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle, IN PTEXTMODE_BUFFER_INFO TextModeInfo)
Definition: text.c:54
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS GRAPHICS_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle, IN PGRAPHICS_BUFFER_INFO GraphicsInfo)
Definition: graphics.c:33
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
#define CONSOLE_TEXTMODE_BUFFER
Definition: wincon.h:62
#define CONSOLE_GRAPHICS_BUFFER
Definition: wincon.h:63
CConsole Console
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403

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 */
155  ConioSetActiveScreenBuffer(NewBuffer);
156  }
157  else
158  {
159  Console->ActiveBuffer = NULL;
160  // InterlockedExchangePointer(&Console->ActiveBuffer, NULL);
161  }
162  }
163 
165 }
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static VOID ConioSetActiveScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer)
Definition: conoutput.c:168
CConsole Console
VOID CONSOLE_SCREEN_BUFFER_Destroy(IN OUT PCONSOLE_SCREEN_BUFFER Buffer)
Definition: conoutput.c:55
#define TermReleaseScreenBuffer(Console, ScreenBuffer)
Definition: term.h:32

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 }
smooth NULL
Definition: ftsmooth.c:416
CConsole Console

Referenced by GuiSetActiveScreenBuffer().