[KERNEL32]
[reactos.git] / win32ss / user / winsrv / consrv / include / conio_winsrv.h
index cd5c2fc..18cefe2 100644 (file)
@@ -10,6 +10,8 @@
 
 #pragma once
 
+#include "rect.h"
+
 #define CSR_DEFAULT_CURSOR_SIZE 25
 
 typedef struct _FRONTEND FRONTEND, *PFRONTEND;
@@ -46,12 +48,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);
 
     /*
@@ -109,16 +105,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 */
@@ -137,31 +142,30 @@ 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) \
-do {    \
-    ((Rect)->Top) = top;    \
-    ((Rect)->Left) = left;  \
-    ((Rect)->Bottom) = bottom;  \
-    ((Rect)->Right) = right;    \
-} while (0)
-#define ConioIsRectEmpty(Rect) \
-    (((Rect)->Left > (Rect)->Right) || ((Rect)->Top > (Rect)->Bottom))
-#define ConioRectHeight(Rect) \
-    (((Rect)->Top) > ((Rect)->Bottom) ? 0 : ((Rect)->Bottom) - ((Rect)->Top) + 1)
-#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);