Author: hbelusca
Date: Mon Aug 11 20:28:40 2014
New Revision: 63866
URL:
http://svn.reactos.org/svn/reactos?rev=63866&view=rev
Log:
[CONSRV]: Code refactoring 1/X (and move VDM support to where it belongs).
Modified:
branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] Mon Aug 11
20:28:40 2014
@@ -102,7 +102,7 @@
/* PRIVATE FUNCTIONS **********************************************************/
static PALIAS_HEADER
-IntFindAliasHeader(PCONSOLE Console,
+IntFindAliasHeader(PCONSRV_CONSOLE Console,
PVOID ExeName,
USHORT ExeLength,
BOOLEAN UnicodeExe)
@@ -149,7 +149,7 @@
}
static PALIAS_HEADER
-IntCreateAliasHeader(PCONSOLE Console,
+IntCreateAliasHeader(PCONSRV_CONSOLE Console,
PVOID ExeName,
USHORT ExeLength,
BOOLEAN UnicodeExe)
@@ -217,7 +217,7 @@
}
static PALIAS_ENTRY
-IntGetAliasEntry(PCONSOLE Console,
+IntGetAliasEntry(PCONSRV_CONSOLE Console,
PALIAS_HEADER Header,
PVOID Source,
USHORT SourceLength,
@@ -266,7 +266,7 @@
}
static PALIAS_ENTRY
-IntCreateAliasEntry(PCONSOLE Console,
+IntCreateAliasEntry(PCONSRV_CONSOLE Console,
PVOID Source,
USHORT SourceLength,
PVOID Target,
@@ -425,7 +425,7 @@
}
VOID
-IntDeleteAllAliases(PCONSOLE Console)
+IntDeleteAllAliases(PCONSRV_CONSOLE Console)
{
PALIAS_HEADER Header, NextHeader;
PALIAS_ENTRY Entry, NextEntry;
@@ -449,7 +449,7 @@
{
NTSTATUS Status;
PCONSOLE_ADDGETALIAS ConsoleAliasRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleAliasRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PALIAS_HEADER Header;
PALIAS_ENTRY Entry;
PVOID lpTarget;
@@ -538,7 +538,7 @@
{
NTSTATUS Status;
PCONSOLE_ADDGETALIAS ConsoleAliasRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleAliasRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PALIAS_HEADER Header;
PALIAS_ENTRY Entry;
UINT Length;
@@ -629,7 +629,7 @@
{
NTSTATUS Status;
PCONSOLE_GETALLALIASES GetAllAliasesRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAllAliasesRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
ULONG BytesWritten = 0;
PALIAS_HEADER Header;
@@ -734,7 +734,7 @@
{
NTSTATUS Status;
PCONSOLE_GETALLALIASESLENGTH GetAllAliasesLengthRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAllAliasesLengthRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PALIAS_HEADER Header;
DPRINT1("SrvGetConsoleAliasesLength entered ApiMessage %p\n", ApiMessage);
@@ -774,7 +774,7 @@
{
NTSTATUS Status;
PCONSOLE_GETALIASESEXES GetAliasesExesRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAliasesExesRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
UINT BytesWritten = 0;
DPRINT1("SrvGetConsoleAliasExes entered\n");
@@ -860,7 +860,7 @@
{
NTSTATUS Status;
PCONSOLE_GETALIASESEXESLENGTH GetAliasesExesLengthRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetAliasesExesLengthRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
DPRINT1("SrvGetConsoleAliasExesLength entered ApiMessage %p\n",
ApiMessage);
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.h [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.h [iso-8859-1] Mon Aug 11
20:28:40 2014
@@ -9,4 +9,4 @@
#pragma once
-VOID IntDeleteAllAliases(PCONSOLE Console);
+VOID IntDeleteAllAliases(PCONSRV_CONSOLE Console);
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1]
Mon Aug 11 20:28:40 2014
@@ -233,7 +233,6 @@
/* Initialize the terminal interface */
ResetTerminal(Console);
- memcpy(Console->Colors, ConsoleInfo->Colors, sizeof(ConsoleInfo->Colors));
Console->ConsoleSize = ConsoleInfo->ConsoleSize;
Console->FixedSize = FALSE; // Value by default; is reseted by the terminals if
needed.
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c [iso-8859-1] Mon Aug
11 20:28:40 2014
@@ -210,14 +210,14 @@
/* PRIVATE FUNCTIONS **********************************************************/
VOID
-ConioPause(PCONSOLE Console, UINT Flags)
+ConioPause(PCONSRV_CONSOLE Console, UINT Flags)
{
Console->PauseFlags |= Flags;
ConDrvPause(Console);
}
VOID
-ConioUnpause(PCONSOLE Console, UINT Flags)
+ConioUnpause(PCONSRV_CONSOLE Console, UINT Flags)
{
Console->PauseFlags &= ~Flags;
@@ -428,6 +428,9 @@
Console->HistoryNoDup = ConsoleInfo.HistoryNoDup;
Console->QuickEdit = ConsoleInfo.QuickEdit;
+
+ /* Colour table */
+ memcpy(Console->Colors, ConsoleInfo.Colors, sizeof(ConsoleInfo.Colors));
/* Attach the ConSrv terminal to the console */
Status = ConDrvRegisterTerminal(Console, &Terminal);
@@ -528,7 +531,7 @@
}
PCONSOLE_PROCESS_DATA NTAPI
-ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console)
+ConSrvGetConsoleLeaderProcess(IN PCONSRV_CONSOLE Console)
{
if (Console == NULL) return NULL;
@@ -567,7 +570,7 @@
// ConSrvGenerateConsoleCtrlEvent
NTSTATUS NTAPI
-ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console,
+ConSrvConsoleProcessCtrlEvent(IN PCONSRV_CONSOLE Console,
IN ULONG ProcessGroupId,
IN ULONG CtrlEvent)
{
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] Mon Aug
11 20:28:40 2014
@@ -67,6 +67,7 @@
} CONSOLE_PROCESS_DATA, *PCONSOLE_PROCESS_DATA;
#include "include/conio.h"
+// #include "include/conio_winsrv.h"
#include "include/console.h"
#include "include/settings.h"
#include "include/term.h"
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1]
Mon Aug 11 20:28:40 2014
@@ -126,7 +126,7 @@
}
VOID NTAPI
-ConioProcessKey(PCONSOLE Console, MSG* msg)
+ConioProcessKey(PCONSRV_CONSOLE Console, MSG* msg)
{
static BYTE KeyState[256] = { 0 };
/* MSDN mentions that you should use the last virtual key code received
@@ -205,7 +205,7 @@
}
DWORD
-ConioEffectiveCursorSize(PCONSOLE Console, DWORD Scale)
+ConioEffectiveCursorSize(PCONSRV_CONSOLE Console, DWORD Scale)
{
DWORD Size = (Console->ActiveBuffer->CursorInfo.dwSize * Scale + 99) / 100;
/* If line input in progress, perhaps adjust for insert toggle */
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1]
Mon Aug 11 20:28:40 2014
@@ -272,7 +272,6 @@
// HACK!!
struct _CONSOLE;
-struct _WINSRV_CONSOLE;
/* HACK: */ typedef struct _CONSOLE *PCONSOLE;
#include "conio_winsrv.h"
@@ -294,7 +293,7 @@
CONSOLE_INPUT_BUFFER InputBuffer; /* Input buffer of the console */
UINT InputCodePage;
- /** Put those things in CONSOLE_INPUT_BUFFER ?? **/
+ /** Put those things in CONSOLE_INPUT_BUFFER in PWINSRV_CONSOLE ?? **/
PWCHAR LineBuffer; /* Current line being input, in line buffered
mode */
ULONG LineMaxSize; /* Maximum size of line in characters
(including CR+LF) */
ULONG LineSize; /* Current size of line */
@@ -303,26 +302,16 @@
BOOLEAN LineUpPressed;
BOOLEAN LineInsertToggle; /* Replace character over cursor instead of
inserting */
ULONG LineWakeupMask; /* Bitmap of which control characters will
end line input */
+
+ /** In PWINSRV_CONSOLE ?? **/
+ BOOLEAN InsertMode;
/*************************************************/
-
- BOOLEAN InsertMode;
/******************************* Screen buffers *******************************/
LIST_ENTRY BufferList; /* List of all screen buffers for this
console */
PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to currently active screen buffer
*/
UINT OutputCodePage;
- /**** Per-console Virtual DOS Machine Text-mode Buffer ****/
- COORD VDMBufferSize; /* Real size of the VDM buffer, in units of ???
*/
- HANDLE VDMBufferSection; /* Handle to the memory shared section for the VDM
buffer */
- PVOID VDMBuffer; /* Our VDM buffer */
- PVOID ClientVDMBuffer; /* A copy of the client view of our VDM buffer */
- HANDLE VDMClientProcess; /* Handle to the client process who opened the
buffer, to unmap the view */
-
- HANDLE StartHardwareEvent;
- HANDLE EndHardwareEvent;
- HANDLE ErrorHardwareEvent;
-
/****************************** Other properties ******************************/
UNICODE_STRING OriginalTitle; /* Original title of console, the one defined
when the console leader is launched; it never changes. Always NULL-terminated */
UNICODE_STRING Title; /* Title of console. Always NULL-terminated
*/
@@ -331,8 +320,6 @@
COORD ConsoleSize; /* The current size of the console, for
text-mode only */
BOOLEAN FixedSize; /* TRUE if the console is of fixed size */
-
- COLORREF Colors[16]; /* Colour palette */
} CONSOLE; // , *PCONSOLE;
@@ -344,18 +331,11 @@
VOID NTAPI
ConDrvUnpause(PCONSOLE Console);
-PCONSOLE_PROCESS_DATA NTAPI
-ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console);
NTSTATUS
ConSrvConsoleCtrlEvent(IN ULONG CtrlEvent,
IN PCONSOLE_PROCESS_DATA ProcessData);
-NTSTATUS NTAPI
-ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console,
- IN ULONG ProcessGroupId,
- IN ULONG CtrlEvent);
/* coninput.c */
-VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg);
NTSTATUS
ConioAddInputEvents(PCONSOLE Console,
PINPUT_RECORD InputRecords,
@@ -392,7 +372,5 @@
PWCHAR Buffer,
DWORD Length,
BOOL Attrib);
-DWORD ConioEffectiveCursorSize(PCONSOLE Console,
- DWORD Scale);
/* EOF */
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
---
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1]
(original)
+++
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1]
Mon Aug 11 20:28:40 2014
@@ -12,6 +12,13 @@
#include "rect.h"
+// This is ALMOST a HACK!!!!!!!
+// Helpers for code refactoring
+#define _CONSRV_CONSOLE _CONSOLE
+#define CONSRV_CONSOLE CONSOLE
+#define PCONSRV_CONSOLE PCONSOLE
+
+
#define CSR_DEFAULT_CURSOR_SIZE 25
typedef struct _FRONTEND FRONTEND, *PFRONTEND;
@@ -24,7 +31,7 @@
* Internal interface (functions called by the console server only)
*/
NTSTATUS (NTAPI *InitFrontEnd)(IN OUT PFRONTEND This,
- IN struct _CONSOLE* Console);
+ IN struct _CONSRV_CONSOLE* Console);
VOID (NTAPI *DeinitFrontEnd)(IN OUT PFRONTEND This);
/* Interface used for both text-mode and graphics screen buffers */
@@ -84,7 +91,7 @@
NTSTATUS (NTAPI *UnloadFrontEnd)(IN OUT PFRONTEND This);
// struct _WINSRV_CONSOLE*
- struct _CONSOLE* Console; /* Console to which the frontend is attached to */
+ struct _CONSRV_CONSOLE* Console; /* Console to which the frontend is attached to
*/
PVOID Data; /* Private data */
PVOID OldData; /* Reserved */
};
@@ -125,35 +132,49 @@
ULONG NumberOfHistoryBuffers; /* Maximum number of history buffers allowed
*/
BOOLEAN HistoryNoDup; /* Remove old duplicate history entries */
+/************************ Virtual DOS Machine support *************************/
+ COORD VDMBufferSize; /* Real size of the VDM buffer, in units of ???
*/
+ HANDLE VDMBufferSection; /* Handle to the memory shared section for the VDM
buffer */
+ PVOID VDMBuffer; /* Our VDM buffer */
+ PVOID ClientVDMBuffer; /* A copy of the client view of our VDM buffer */
+ HANDLE VDMClientProcess; /* Handle to the client process who opened the
buffer, to unmap the view */
+
+ HANDLE StartHardwareEvent;
+ HANDLE EndHardwareEvent;
+ HANDLE ErrorHardwareEvent;
+
+/****************************** Other properties ******************************/
+ COLORREF Colors[16]; /* Colour palette */
+
} WINSRV_CONSOLE, *PWINSRV_CONSOLE;
/* console.c */
-VOID ConioPause(PCONSOLE Console, UINT Flags);
-VOID ConioUnpause(PCONSOLE Console, UINT Flags);
+VOID ConioPause(PCONSRV_CONSOLE Console, UINT Flags);
+VOID ConioUnpause(PCONSRV_CONSOLE Console, UINT Flags);
PCONSOLE_PROCESS_DATA NTAPI
-ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console);
+ConSrvGetConsoleLeaderProcess(IN PCONSRV_CONSOLE Console);
NTSTATUS
ConSrvConsoleCtrlEvent(IN ULONG CtrlEvent,
IN PCONSOLE_PROCESS_DATA ProcessData);
NTSTATUS NTAPI
-ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console,
+ConSrvConsoleProcessCtrlEvent(IN PCONSRV_CONSOLE Console,
IN ULONG ProcessGroupId,
IN ULONG CtrlEvent);
/* coninput.c */
-VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg);
-DWORD ConioEffectiveCursorSize(PCONSOLE Console,
+VOID NTAPI ConioProcessKey(PCONSRV_CONSOLE Console, MSG* msg);
+DWORD ConioEffectiveCursorSize(PCONSRV_CONSOLE Console,
DWORD Scale);
NTSTATUS
-ConioAddInputEvents(PCONSOLE Console,
+ConioAddInputEvents(PCONSRV_CONSOLE Console,
PINPUT_RECORD InputRecords,
ULONG NumEventsToWrite,
PULONG NumEventsWritten,
BOOLEAN AppendToEnd);
NTSTATUS
-ConioProcessInputEvent(PCONSOLE Console,
+ConioProcessInputEvent(PCONSRV_CONSOLE Console,
PINPUT_RECORD InputEvent);
/* conoutput.c */
@@ -173,11 +194,11 @@
MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y);
-VOID ConioDrawConsole(PCONSOLE Console);
-NTSTATUS ConioResizeBuffer(PCONSOLE Console,
+VOID ConioDrawConsole(PCONSRV_CONSOLE Console);
+NTSTATUS ConioResizeBuffer(PCONSRV_CONSOLE Console,
PTEXTMODE_SCREEN_BUFFER ScreenBuffer,
COORD Size);
-NTSTATUS ConioWriteConsole(PCONSOLE Console,
+NTSTATUS ConioWriteConsole(PCONSRV_CONSOLE Console,
PTEXTMODE_SCREEN_BUFFER Buff,
PWCHAR Buffer,
DWORD Length,