ReactOS  0.4.13-dev-482-ge57f103
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:401

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:401
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:401

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:401
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
#define TEXTMODE_BUFFER
Definition: pccons.c:21
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:401

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
#define TEXTMODE_BUFFER
Definition: pccons.c:21
_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:401
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 79 of file conoutput.c.

84 {
86 
87  if ( Console == NULL || Buffer == NULL ||
88  (BufferType != CONSOLE_TEXTMODE_BUFFER && BufferType != CONSOLE_GRAPHICS_BUFFER) )
89  {
91  }
92 
93  /* Use the current process if ProcessHandle is NULL */
94  if (ProcessHandle == NULL)
96 
97  if (BufferType == CONSOLE_TEXTMODE_BUFFER)
98  {
101  }
102  else if (BufferType == CONSOLE_GRAPHICS_BUFFER)
103  {
106  }
107  else
108  {
109  /* Never ever go there!! */
110  ASSERT(FALSE);
111  }
112 
113  /* Insert the newly created screen buffer into the list, if succeeded */
114  if (NT_SUCCESS(Status)) InsertHeadList(&Console->BufferList, &(*Buffer)->ListEntry);
115 
116  return Status;
117 }
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:62
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:44
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Status
Definition: gdiplustypes.h:24
#define CONSOLE_TEXTMODE_BUFFER
Definition: wincon.h:59
#define CONSOLE_GRAPHICS_BUFFER
Definition: wincon.h:60
CConsole Console
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
return STATUS_SUCCESS
Definition: btrfs.c:2777

Referenced by ConDrvInitConsole(), and CSR_API().

◆ ConDrvDeleteScreenBuffer()

VOID NTAPI ConDrvDeleteScreenBuffer ( PCONSOLE_SCREEN_BUFFER  Buffer)

Definition at line 123 of file conoutput.c.

124 {
125  PCONSOLE Console = Buffer->Header.Console;
126  PCONSOLE_SCREEN_BUFFER NewBuffer;
127 
128  /*
129  * We should notify temporarily the frontend because we are susceptible
130  * to delete the screen buffer it is using (which may be different from
131  * the active screen buffer in some cases), and because, if it actually
132  * uses the active screen buffer, we are going to nullify its pointer to
133  * change it.
134  */
136 
137  RemoveEntryList(&Buffer->ListEntry);
138  if (Buffer == Console->ActiveBuffer)
139  {
140  /* Delete active buffer; switch to most recently created */
141  if (!IsListEmpty(&Console->BufferList))
142  {
143  NewBuffer = CONTAINING_RECORD(Console->BufferList.Flink,
145  ListEntry);
146 
147  /* Tie console to new buffer and signal the change to the frontend */
148  ConioSetActiveScreenBuffer(NewBuffer);
149  }
150  else
151  {
152  Console->ActiveBuffer = NULL;
153  // InterlockedExchangePointer(&Console->ActiveBuffer, NULL);
154  }
155  }
156 
158 }
_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:161
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 ConDrvDeleteConsole(), ConDrvSetConsoleActiveScreenBuffer(), and ConSrvCloseHandle().

◆ ConDrvGetActiveScreenBuffer()

PCONSOLE_SCREEN_BUFFER ConDrvGetActiveScreenBuffer ( IN PCONSOLE  Console)

Definition at line 194 of file conoutput.c.

195 {
196  return (Console ? Console->ActiveBuffer : NULL);
197 }
smooth NULL
Definition: ftsmooth.c:416
CConsole Console