[KERNEL32][CONSRV]
[reactos.git] / win32ss / user / winsrv / consrv / include / conio_winsrv.h
index 8d37953..d239db7 100644 (file)
@@ -30,7 +30,7 @@ typedef struct _FRONTEND_VTBL
                              SMALL_RECT* Region);
     /* Interface used only for text-mode screen buffers */
     VOID (NTAPI *WriteStream)(IN OUT PFRONTEND This,
-                              SMALL_RECT* Block,
+                              SMALL_RECT* Region,
                               SHORT CursorStartX,
                               SHORT CursorStartY,
                               UINT ScrolledLines,
@@ -46,12 +46,6 @@ typedef struct _FRONTEND_VTBL
     VOID (NTAPI *SetActiveScreenBuffer)(IN OUT PFRONTEND This);
     VOID (NTAPI *ReleaseScreenBuffer)(IN OUT PFRONTEND This,
                                       IN PCONSOLE_SCREEN_BUFFER ScreenBuffer);
-    BOOL (NTAPI *ProcessKeyCallback)(IN OUT PFRONTEND This,
-                                     MSG* msg,
-                                     BYTE KeyStateMenu,
-                                     DWORD ShiftState,
-                                     UINT VirtualKeyCode,
-                                     BOOL Down);
     VOID (NTAPI *RefreshInternalInfo)(IN OUT PFRONTEND This);
 
     /*
@@ -85,6 +79,8 @@ typedef struct _FRONTEND_VTBL
 struct _FRONTEND
 {
     PFRONTEND_VTBL Vtbl;        /* Virtual table */
+    NTSTATUS (NTAPI *UnloadFrontEnd)(IN OUT PFRONTEND This);
+
     struct _CONSOLE* Console;   /* Console to which the frontend is attached to */
     PVOID Data;                 /* Private data  */
     PVOID OldData;              /* Reserved      */
@@ -107,16 +103,25 @@ typedef struct _WINSRV_CONSOLE
 
     FRONTEND FrontEndIFace;                     /* Frontend-specific interface */
 
+/******************************* Process support ******************************/
     LIST_ENTRY ProcessList;         /* List of processes owning the console. The first one is the so-called "Console Leader Process" */
     PCONSOLE_PROCESS_DATA NotifiedLastCloseProcess; /* Pointer to the unique process that needs to be notified when the console leader process is killed */
     BOOLEAN NotifyLastClose;        /* TRUE if the console should send a control event when the console leader process is killed */
 
     BOOLEAN QuickEdit;
 
+/******************************* Pausing support ******************************/
     BYTE PauseFlags;
     LIST_ENTRY  ReadWaitQueue;      /* List head for the queue of unique input buffer read wait blocks */
     LIST_ENTRY WriteWaitQueue;      /* List head for the queue of current screen-buffer write wait blocks */
 
+/**************************** Aliases and Histories ***************************/
+    struct _ALIAS_HEADER *Aliases;
+    LIST_ENTRY HistoryBuffers;
+    ULONG HistoryBufferSize;                /* Size for newly created history buffers */
+    ULONG NumberOfHistoryBuffers;           /* Maximum number of history buffers allowed */
+    BOOLEAN HistoryNoDup;                   /* Remove old duplicate history entries */
+
 } WINSRV_CONSOLE, *PWINSRV_CONSOLE;
 
 /* console.c */
@@ -135,11 +140,15 @@ ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console,
 
 /* coninput.c */
 VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg);
-NTSTATUS ConioAddInputEvent(PCONSOLE Console,
-                                     PINPUT_RECORD InputEvent,
-                                     BOOLEAN AppendToEnd);
-NTSTATUS ConioProcessInputEvent(PCONSOLE Console,
-                                         PINPUT_RECORD InputEvent);
+NTSTATUS
+ConioAddInputEvents(PCONSOLE Console,
+                    PINPUT_RECORD InputRecords,
+                    ULONG NumEventsToWrite,
+                    PULONG NumEventsWritten,
+                    BOOLEAN AppendToEnd);
+NTSTATUS
+ConioProcessInputEvent(PCONSOLE Console,
+                       PINPUT_RECORD InputEvent);
 
 /* conoutput.c */
 #define ConioInitRect(Rect, top, left, bottom, right) \
@@ -156,10 +165,18 @@ do {    \
 #define ConioRectWidth(Rect) \
     (((Rect)->Left) > ((Rect)->Right) ? 0 : ((Rect)->Right) - ((Rect)->Left) + 1)
 
+/*
+ * From MSDN:
+ * "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
+ *  If they are the same, the function fails, and GetLastError returns
+ *  ERROR_INVALID_PARAMETER."
+ */
 #define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
+    ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
     WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
 
 #define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \
+    ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
     MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
 
 PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y);