Author: hbelusca
Date: Sat May 3 01:59:28 2014
New Revision: 63123
URL:
http://svn.reactos.org/svn/reactos?rev=63123&view=rev
Log:
[CONSRV]
Terminals are for consoles, and frontends for a given win32 terminal.
Start to clarify this situation in the code. Work in progress.
Modified:
branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/dummyterm.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/console.h
branches/condrv_restructure/win32ss/user/winsrv/consrv/include/term.h
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]
Sat May 3 01:59:28 2014
@@ -187,11 +187,10 @@
}
-/* For resetting the frontend - defined in dummyfrontend.c */
-VOID ResetFrontEnd(IN PCONSOLE Console);
-
-
/* PRIVATE FUNCTIONS **********************************************************/
+
+/* For resetting the terminal - defined in dummyterm.c */
+VOID ResetTerminal(IN PCONSOLE Console);
VOID NTAPI
ConDrvPause(PCONSOLE Console)
@@ -417,12 +416,12 @@
Console->ReferenceCount = 0;
InitializeCriticalSection(&Console->Lock);
- /* Initialize the frontend interface */
- ResetFrontEnd(Console);
+ /* 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 front-ends if
needed.
+ Console->FixedSize = FALSE; // Value by default; is reseted by the terminals if
needed.
/*
* Initialize the input buffer
@@ -538,63 +537,63 @@
}
NTSTATUS NTAPI
-ConDrvRegisterFrontEnd(IN PCONSOLE Console,
- IN PFRONTEND FrontEnd)
+ConDrvRegisterTerminal(IN PCONSOLE Console,
+ IN PTERMINAL Terminal)
{
NTSTATUS Status;
- if (Console == NULL || FrontEnd == NULL)
+ if (Console == NULL || Terminal == NULL)
return STATUS_INVALID_PARAMETER;
/* FIXME: Lock the console before ?? */
/*
- * Attach the frontend to the console. Use now the FrontEndIFace of the console,
- * and not the user-defined temporary FrontEnd pointer.
- */
- Console->FrontEndIFace = *FrontEnd;
- Console->FrontEndIFace.Console = Console;
-
- /* Initialize the frontend AFTER having attached it to the console */
- DPRINT("Finish initialization of frontend\n");
- Status =
Console->FrontEndIFace.Vtbl->InitFrontEnd(&Console->FrontEndIFace, Console);
+ * Attach the terminal to the console. Use now the TermIFace of the console,
+ * and not the user-defined temporary Terminal pointer.
+ */
+ Console->TermIFace = *Terminal;
+ Console->TermIFace.Console = Console;
+
+ /* Initialize the terminal AFTER having attached it to the console */
+ DPRINT("Finish initialization of terminal\n");
+ Status = Console->TermIFace.Vtbl->InitTerminal(&Console->TermIFace,
Console);
if (!NT_SUCCESS(Status))
{
- DPRINT1("FrontEnd initialization failed, Status = 0x%08lx\n", Status);
-
- /* We failed, detach the frontend from the console */
- FrontEnd->Console = NULL; // For the caller
- ResetFrontEnd(Console);
+ DPRINT1("Terminal initialization failed, Status = 0x%08lx\n", Status);
+
+ /* We failed, detach the terminal from the console */
+ Terminal->Console = NULL; // For the caller
+ ResetTerminal(Console);
return Status;
}
/* Copy buffer contents to screen */
- // FrontEnd.Draw();
+ // Terminal.Draw();
// ConioDrawConsole(Console);
DPRINT("Console drawn\n");
- DPRINT("Terminal FrontEnd initialization done\n");
+ DPRINT("Terminal initialization done\n");
return STATUS_SUCCESS;
}
NTSTATUS NTAPI
-ConDrvDeregisterFrontEnd(IN PCONSOLE Console)
+ConDrvDeregisterTerminal(IN PCONSOLE Console)
{
if (Console == NULL) return STATUS_INVALID_PARAMETER;
/* FIXME: Lock the console before ?? */
- /* Deinitialize the frontend BEFORE detaching it from the console */
- Console->FrontEndIFace.Vtbl->DeinitFrontEnd(&Console->FrontEndIFace/*,
Console*/);
-
- /*
- * Detach the frontend from the console:
- * reinitialize the frontend interface.
- */
- ResetFrontEnd(Console);
-
- DPRINT("Terminal FrontEnd unregistered\n");
+ /* Deinitialize the terminal BEFORE detaching it from the console */
+ Console->TermIFace.Vtbl->DeinitTerminal(&Console->TermIFace/*,
Console*/);
+
+ /*
+ * Detach the terminal from the console:
+ * reinitialize the terminal interface.
+ */
+ ResetTerminal(Console);
+
+ DPRINT("Terminal unregistered\n");
return STATUS_SUCCESS;
}
@@ -643,7 +642,7 @@
/* Cleanup the UI-oriented part */
DPRINT("Deregister console\n");
- ConDrvDeregisterFrontEnd(Console);
+ ConDrvDeregisterTerminal(Console);
DPRINT("Console deregistered\n");
/***
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/dummyterm.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/dummyterm.c [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/dummyterm.c [iso-8859-1]
Sat May 3 01:59:28 2014
@@ -14,27 +14,25 @@
/* DUMMY TERMINAL INTERFACE ***************************************************/
static NTSTATUS NTAPI
-DummyInitFrontEnd(IN OUT PFRONTEND This,
+DummyInitTerminal(IN OUT PTERMINAL This,
IN PCONSOLE Console)
{
- /* Load some settings ?? */
return STATUS_SUCCESS;
}
static VOID NTAPI
-DummyDeinitFrontEnd(IN OUT PFRONTEND This)
+DummyDeinitTerminal(IN OUT PTERMINAL This)
{
- /* Free some settings ?? */
}
static VOID NTAPI
-DummyDrawRegion(IN OUT PFRONTEND This,
+DummyDrawRegion(IN OUT PTERMINAL This,
SMALL_RECT* Region)
{
}
static VOID NTAPI
-DummyWriteStream(IN OUT PFRONTEND This,
+DummyWriteStream(IN OUT PTERMINAL This,
SMALL_RECT* Region,
SHORT CursorStartX,
SHORT CursorStartY,
@@ -45,15 +43,15 @@
}
static BOOL NTAPI
-DummySetCursorInfo(IN OUT PFRONTEND This,
- PCONSOLE_SCREEN_BUFFER Buff)
+DummySetCursorInfo(IN OUT PTERMINAL This,
+ PCONSOLE_SCREEN_BUFFER ScreenBuffer)
{
return TRUE;
}
static BOOL NTAPI
-DummySetScreenInfo(IN OUT PFRONTEND This,
- PCONSOLE_SCREEN_BUFFER Buff,
+DummySetScreenInfo(IN OUT PTERMINAL This,
+ PCONSOLE_SCREEN_BUFFER ScreenBuffer,
SHORT OldCursorX,
SHORT OldCursorY)
{
@@ -61,122 +59,60 @@
}
static VOID NTAPI
-DummyResizeTerminal(IN OUT PFRONTEND This)
+DummyResizeTerminal(IN OUT PTERMINAL This)
{
}
static VOID NTAPI
-DummySetActiveScreenBuffer(IN OUT PFRONTEND This)
+DummySetActiveScreenBuffer(IN OUT PTERMINAL This)
{
}
static VOID NTAPI
-DummyReleaseScreenBuffer(IN OUT PFRONTEND This,
+DummyReleaseScreenBuffer(IN OUT PTERMINAL This,
IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
{
}
-static BOOL NTAPI
-DummyProcessKeyCallback(IN OUT PFRONTEND This,
- MSG* msg,
- BYTE KeyStateMenu,
- DWORD ShiftState,
- UINT VirtualKeyCode,
- BOOL Down)
-{
- return FALSE;
-}
-
static VOID NTAPI
-DummyRefreshInternalInfo(IN OUT PFRONTEND This)
+DummyChangeTitle(IN OUT PTERMINAL This)
{
}
static VOID NTAPI
-DummyChangeTitle(IN OUT PFRONTEND This)
-{
-}
-
-static BOOL NTAPI
-DummyChangeIcon(IN OUT PFRONTEND This,
- HICON IconHandle)
-{
- return TRUE;
-}
-
-static HWND NTAPI
-DummyGetConsoleWindowHandle(IN OUT PFRONTEND This)
-{
- return NULL;
-}
-
-static VOID NTAPI
-DummyGetLargestConsoleWindowSize(IN OUT PFRONTEND This,
+DummyGetLargestConsoleWindowSize(IN OUT PTERMINAL This,
PCOORD pSize)
{
}
+/*
static BOOL NTAPI
-DummyGetSelectionInfo(IN OUT PFRONTEND This,
+DummyGetSelectionInfo(IN OUT PTERMINAL This,
PCONSOLE_SELECTION_INFO pSelectionInfo)
{
return TRUE;
}
+*/
static BOOL NTAPI
-DummySetPalette(IN OUT PFRONTEND This,
+DummySetPalette(IN OUT PTERMINAL This,
HPALETTE PaletteHandle,
UINT PaletteUsage)
{
return TRUE;
}
-static ULONG NTAPI
-DummyGetDisplayMode(IN OUT PFRONTEND This)
-{
- return 0;
-}
-
-static BOOL NTAPI
-DummySetDisplayMode(IN OUT PFRONTEND This,
- ULONG NewMode)
-{
- return TRUE;
-}
-
static INT NTAPI
-DummyShowMouseCursor(IN OUT PFRONTEND This,
+DummyShowMouseCursor(IN OUT PTERMINAL This,
BOOL Show)
{
return 0;
}
-static BOOL NTAPI
-DummySetMouseCursor(IN OUT PFRONTEND This,
- HCURSOR CursorHandle)
+static TERMINAL_VTBL DummyVtbl =
{
- return TRUE;
-}
-
-static HMENU NTAPI
-DummyMenuControl(IN OUT PFRONTEND This,
- UINT CmdIdLow,
- UINT CmdIdHigh)
-{
- return NULL;
-}
-
-static BOOL NTAPI
-DummySetMenuClose(IN OUT PFRONTEND This,
- BOOL Enable)
-{
- return TRUE;
-}
-
-static FRONTEND_VTBL DummyVtbl =
-{
- DummyInitFrontEnd,
- DummyDeinitFrontEnd,
+ DummyInitTerminal,
+ DummyDeinitTerminal,
DummyDrawRegion,
DummyWriteStream,
DummySetCursorInfo,
@@ -184,30 +120,21 @@
DummyResizeTerminal,
DummySetActiveScreenBuffer,
DummyReleaseScreenBuffer,
- DummyProcessKeyCallback,
- DummyRefreshInternalInfo,
DummyChangeTitle,
- DummyChangeIcon,
- DummyGetConsoleWindowHandle,
DummyGetLargestConsoleWindowSize,
- DummyGetSelectionInfo,
+ // DummyGetSelectionInfo,
DummySetPalette,
- DummyGetDisplayMode,
- DummySetDisplayMode,
DummyShowMouseCursor,
- DummySetMouseCursor,
- DummyMenuControl,
- DummySetMenuClose,
};
VOID
-ResetFrontEnd(IN PCONSOLE Console)
+ResetTerminal(IN PCONSOLE Console)
{
if (!Console) return;
- /* Reinitialize the frontend interface */
- RtlZeroMemory(&Console->FrontEndIFace, sizeof(Console->FrontEndIFace));
- Console->FrontEndIFace.Vtbl = &DummyVtbl;
+ /* Reinitialize the terminal interface */
+ RtlZeroMemory(&Console->TermIFace, sizeof(Console->TermIFace));
+ Console->TermIFace.Vtbl = &DummyVtbl;
}
/* EOF */
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] Sat May
3 01:59:28 2014
@@ -82,13 +82,13 @@
}
-/* static */ NTSTATUS
-ConSrvLoadFrontEnd(IN OUT PFRONTEND FrontEnd,
+NTSTATUS NTAPI
+ConSrvInitTerminal(IN OUT PTERMINAL Terminal,
IN OUT PCONSOLE_INFO ConsoleInfo,
IN OUT PVOID ExtraConsoleInfo,
IN ULONG ProcessId);
-/* static */ NTSTATUS
-ConSrvUnloadFrontEnd(IN PFRONTEND FrontEnd);
+NTSTATUS NTAPI
+ConSrvDeinitTerminal(IN OUT PTERMINAL Terminal);
NTSTATUS NTAPI
ConSrvInitConsole(OUT PHANDLE NewConsoleHandle,
@@ -102,7 +102,7 @@
CONSOLE_INFO ConsoleInfo;
SIZE_T Length = 0;
- FRONTEND FrontEnd;
+ TERMINAL Terminal; /* The ConSrv terminal for this console */
if (NewConsole == NULL || ConsoleStartInfo == NULL)
return STATUS_INVALID_PARAMETER;
@@ -122,7 +122,6 @@
wcsncpy(ConsoleInfo.ConsoleTitle, ConsoleStartInfo->ConsoleTitle, Length);
ConsoleInfo.ConsoleTitle[Length] = L'\0';
-#if 0
/* 3. Initialize the ConSrv terminal */
Status = ConSrvInitTerminal(&Terminal,
&ConsoleInfo,
@@ -134,18 +133,6 @@
return Status;
}
DPRINT("CONSRV: Terminal initialized\n");
-#else
- Status = ConSrvLoadFrontEnd(&FrontEnd,
- &ConsoleInfo,
- ConsoleStartInfo,
- ConsoleLeaderProcessId);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("CONSRV: Failed to initialize a frontend, Status = 0x%08lx\n",
Status);
- return Status;
- }
- DPRINT("CONSRV: Frontend initialized\n");
-#endif
/*
* 4. Load the remaining console settings via the registry.
@@ -190,7 +177,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT1("Creating a new console failed, Status = 0x%08lx\n", Status);
- ConSrvUnloadFrontEnd(&FrontEnd);
+ ConSrvDeinitTerminal(&Terminal);
return Status;
}
@@ -212,15 +199,15 @@
Console->QuickEdit = ConsoleInfo.QuickEdit;
/* Attach the ConSrv terminal to the console */
- Status = ConDrvRegisterFrontEnd(Console, &FrontEnd);
+ Status = ConDrvRegisterTerminal(Console, &Terminal);
if (!NT_SUCCESS(Status))
{
- DPRINT1("Failed to register frontend to the given console, Status =
0x%08lx\n", Status);
+ DPRINT1("Failed to register terminal to the given console, Status =
0x%08lx\n", Status);
ConDrvDeleteConsole(Console);
- ConSrvUnloadFrontEnd(&FrontEnd);
+ ConSrvDeinitTerminal(&Terminal);
return Status;
}
- DPRINT("FrontEnd registered\n");
+ DPRINT("Terminal registered\n");
/* Return the newly created console to the caller and a success code too */
*NewConsoleHandle = ConsoleHandle;
@@ -233,7 +220,7 @@
{
DPRINT("ConSrvDeleteConsole\n");
- /* Just call the driver. ConSrvDeregisterFrontEnd is called on-demand. */
+ /* Just call the driver. ConDrvDeregisterTerminal is called on-demand. */
ConDrvDeleteConsole(Console);
}
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
---
branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c [iso-8859-1]
(original)
+++
branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c [iso-8859-1]
Sat May 3 01:59:28 2014
@@ -10,6 +10,7 @@
#include <consrv.h>
+// #include "frontends/gui/guiterm.h"
#ifdef TUITERM_COMPILE
#include "frontends/tui/tuiterm.h"
#endif
@@ -81,8 +82,7 @@
// {"Not found", 0, NULL}
};
-
-/* static */ NTSTATUS
+static NTSTATUS
ConSrvLoadFrontEnd(IN OUT PFRONTEND FrontEnd,
IN OUT PCONSOLE_INFO ConsoleInfo,
IN OUT PVOID ExtraConsoleInfo,
@@ -121,7 +121,7 @@
return Status;
}
-/* static */ NTSTATUS
+static NTSTATUS
ConSrvUnloadFrontEnd(IN PFRONTEND FrontEnd)
{
if (FrontEnd == NULL) return STATUS_INVALID_PARAMETER;
@@ -129,33 +129,105 @@
return FrontEnd->UnloadFrontEnd(FrontEnd);
}
-
-/* DUMMY FRONTEND INTERFACE ***************************************************/
-
-#if 0
+// See after...
+static TERMINAL_VTBL ConSrvTermVtbl;
+
+NTSTATUS NTAPI
+ConSrvInitTerminal(IN OUT PTERMINAL Terminal,
+ IN OUT PCONSOLE_INFO ConsoleInfo,
+ IN OUT PVOID ExtraConsoleInfo,
+ IN ULONG ProcessId)
+{
+ NTSTATUS Status;
+ PFRONTEND FrontEnd;
+
+ /* Load a suitable frontend for the ConSrv terminal */
+ FrontEnd = ConsoleAllocHeap(HEAP_ZERO_MEMORY, sizeof(*FrontEnd));
+ if (!FrontEnd) return STATUS_NO_MEMORY;
+
+ Status = ConSrvLoadFrontEnd(FrontEnd,
+ ConsoleInfo,
+ ExtraConsoleInfo,
+ ProcessId);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("CONSRV: Failed to initialize a frontend, Status = 0x%08lx\n",
Status);
+ ConsoleFreeHeap(FrontEnd);
+ return Status;
+ }
+ DPRINT("CONSRV: Frontend initialized\n");
+
+ /* Initialize the ConSrv terminal */
+ Terminal->Vtbl = &ConSrvTermVtbl;
+ // Terminal->Console will be initialized by ConDrvRegisterTerminal
+ Terminal->Data = FrontEnd; /* We store the frontend pointer in the terminal
private data */
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS NTAPI
+ConSrvDeinitTerminal(IN OUT PTERMINAL Terminal)
+{
+ NTSTATUS Status = STATUS_SUCCESS;
+ PFRONTEND FrontEnd = Terminal->Data;
+
+ /* Reset the ConSrv terminal */
+ Terminal->Data = NULL;
+ Terminal->Vtbl = NULL;
+
+ /* Unload the frontend */
+ if (FrontEnd != NULL)
+ {
+ Status = ConSrvUnloadFrontEnd(FrontEnd);
+ ConsoleFreeHeap(FrontEnd);
+ }
+
+ return Status;
+}
+
+
+/* CONSRV TERMINAL INTERFACE **************************************************/
static NTSTATUS NTAPI
-DummyInitFrontEnd(IN OUT PFRONTEND This,
+ConSrvTermInitTerminal(IN OUT PTERMINAL This,
IN PCONSOLE Console)
{
- /* Load some settings ?? */
- return STATUS_SUCCESS;
-}
-
-static VOID NTAPI
-DummyDeinitFrontEnd(IN OUT PFRONTEND This)
-{
- /* Free some settings ?? */
-}
-
-static VOID NTAPI
-DummyDrawRegion(IN OUT PFRONTEND This,
+ NTSTATUS Status;
+ PFRONTEND FrontEnd = This->Data;
+
+ /* Initialize the console pointer for our frontend */
+ FrontEnd->Console = Console;
+
+ /** HACK HACK!! Copy FrontEnd into the console!! **/
+ DPRINT1("Using FrontEndIFace HACK(1), should be removed after proper
implementation!\n");
+ Console->FrontEndIFace = *FrontEnd;
+
+ Status = FrontEnd->Vtbl->InitFrontEnd(FrontEnd, FrontEnd->Console);
+
+ /** HACK HACK!! Be sure FrontEndIFace is correctly updated in the console!! **/
+ DPRINT1("Using FrontEndIFace HACK(2), should be removed after proper
implementation!\n");
+ Console->FrontEndIFace = *FrontEnd;
+
+ return Status;
+}
+
+static VOID NTAPI
+ConSrvTermDeinitTerminal(IN OUT PTERMINAL This)
+{
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->DeinitFrontEnd(FrontEnd);
+}
+
+static VOID NTAPI
+ConSrvTermDrawRegion(IN OUT PTERMINAL This,
SMALL_RECT* Region)
{
-}
-
-static VOID NTAPI
-DummyWriteStream(IN OUT PFRONTEND This,
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->DrawRegion(FrontEnd, Region);
+}
+
+static VOID NTAPI
+ConSrvTermWriteStream(IN OUT PTERMINAL This,
SMALL_RECT* Region,
SHORT CursorStartX,
SHORT CursorStartY,
@@ -163,164 +235,120 @@
PWCHAR Buffer,
UINT Length)
{
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->WriteStream(FrontEnd,
+ Region,
+ CursorStartX,
+ CursorStartY,
+ ScrolledLines,
+ Buffer,
+ Length);
}
static BOOL NTAPI
-DummySetCursorInfo(IN OUT PFRONTEND This,
- PCONSOLE_SCREEN_BUFFER Buff)
-{
- return TRUE;
+ConSrvTermSetCursorInfo(IN OUT PTERMINAL This,
+ PCONSOLE_SCREEN_BUFFER ScreenBuffer)
+{
+ PFRONTEND FrontEnd = This->Data;
+ return FrontEnd->Vtbl->SetCursorInfo(FrontEnd, ScreenBuffer);
}
static BOOL NTAPI
-DummySetScreenInfo(IN OUT PFRONTEND This,
- PCONSOLE_SCREEN_BUFFER Buff,
+ConSrvTermSetScreenInfo(IN OUT PTERMINAL This,
+ PCONSOLE_SCREEN_BUFFER ScreenBuffer,
SHORT OldCursorX,
SHORT OldCursorY)
{
- return TRUE;
-}
-
-static VOID NTAPI
-DummyResizeTerminal(IN OUT PFRONTEND This)
-{
-}
-
-static VOID NTAPI
-DummySetActiveScreenBuffer(IN OUT PFRONTEND This)
-{
-}
-
-static VOID NTAPI
-DummyReleaseScreenBuffer(IN OUT PFRONTEND This,
+ PFRONTEND FrontEnd = This->Data;
+ return FrontEnd->Vtbl->SetScreenInfo(FrontEnd,
+ ScreenBuffer,
+ OldCursorX,
+ OldCursorY);
+}
+
+static VOID NTAPI
+ConSrvTermResizeTerminal(IN OUT PTERMINAL This)
+{
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->ResizeTerminal(FrontEnd);
+}
+
+static VOID NTAPI
+ConSrvTermSetActiveScreenBuffer(IN OUT PTERMINAL This)
+{
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->SetActiveScreenBuffer(FrontEnd);
+}
+
+static VOID NTAPI
+ConSrvTermReleaseScreenBuffer(IN OUT PTERMINAL This,
IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
{
-}
-
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->ReleaseScreenBuffer(FrontEnd, ScreenBuffer);
+}
+
+static VOID NTAPI
+ConSrvTermChangeTitle(IN OUT PTERMINAL This)
+{
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->ChangeTitle(FrontEnd);
+}
+
+static VOID NTAPI
+ConSrvTermGetLargestConsoleWindowSize(IN OUT PTERMINAL This,
+ PCOORD pSize)
+{
+ PFRONTEND FrontEnd = This->Data;
+ FrontEnd->Vtbl->GetLargestConsoleWindowSize(FrontEnd, pSize);
+}
+
+/*
static BOOL NTAPI
-DummyProcessKeyCallback(IN OUT PFRONTEND This,
- MSG* msg,
- BYTE KeyStateMenu,
- DWORD ShiftState,
- UINT VirtualKeyCode,
- BOOL Down)
-{
- return FALSE;
-}
-
-static VOID NTAPI
-DummyRefreshInternalInfo(IN OUT PFRONTEND This)
-{
-}
-
-static VOID NTAPI
-DummyChangeTitle(IN OUT PFRONTEND This)
-{
-}
+ConSrvTermGetSelectionInfo(IN OUT PTERMINAL This,
+ PCONSOLE_SELECTION_INFO pSelectionInfo)
+{
+ PFRONTEND FrontEnd = This->Data;
+ return FrontEnd->Vtbl->GetSelectionInfo(FrontEnd, pSelectionInfo);
+}
+*/
static BOOL NTAPI
-DummyChangeIcon(IN OUT PFRONTEND This,
- HICON IconHandle)
-{
- return TRUE;
-}
-
-static HWND NTAPI
-DummyGetConsoleWindowHandle(IN OUT PFRONTEND This)
-{
- return NULL;
-}
-
-static VOID NTAPI
-DummyGetLargestConsoleWindowSize(IN OUT PFRONTEND This,
- PCOORD pSize)
-{
-}
-
-static BOOL NTAPI
-DummyGetSelectionInfo(IN OUT PFRONTEND This,
- PCONSOLE_SELECTION_INFO pSelectionInfo)
-{
- return TRUE;
-}
-
-static BOOL NTAPI
-DummySetPalette(IN OUT PFRONTEND This,
+ConSrvTermSetPalette(IN OUT PTERMINAL This,
HPALETTE PaletteHandle,
UINT PaletteUsage)
{
- return TRUE;
-}
-
-static ULONG NTAPI
-DummyGetDisplayMode(IN OUT PFRONTEND This)
-{
- return 0;
-}
-
-static BOOL NTAPI
-DummySetDisplayMode(IN OUT PFRONTEND This,
- ULONG NewMode)
-{
- return TRUE;
+ PFRONTEND FrontEnd = This->Data;
+ return FrontEnd->Vtbl->SetPalette(FrontEnd, PaletteHandle, PaletteUsage);
}
static INT NTAPI
-DummyShowMouseCursor(IN OUT PFRONTEND This,
+ConSrvTermShowMouseCursor(IN OUT PTERMINAL This,
BOOL Show)
{
- return 0;
-}
-
-static BOOL NTAPI
-DummySetMouseCursor(IN OUT PFRONTEND This,
- HCURSOR CursorHandle)
-{
- return TRUE;
-}
-
-static HMENU NTAPI
-DummyMenuControl(IN OUT PFRONTEND This,
- UINT CmdIdLow,
- UINT CmdIdHigh)
-{
- return NULL;
-}
-
-static BOOL NTAPI
-DummySetMenuClose(IN OUT PFRONTEND This,
- BOOL Enable)
-{
- return TRUE;
-}
-
-static FRONTEND_VTBL DummyVtbl =
-{
- DummyInitFrontEnd,
- DummyDeinitFrontEnd,
- DummyDrawRegion,
- DummyWriteStream,
- DummySetCursorInfo,
- DummySetScreenInfo,
- DummyResizeTerminal,
- DummySetActiveScreenBuffer,
- DummyReleaseScreenBuffer,
- DummyProcessKeyCallback,
- DummyRefreshInternalInfo,
- DummyChangeTitle,
- DummyChangeIcon,
- DummyGetConsoleWindowHandle,
- DummyGetLargestConsoleWindowSize,
- DummyGetSelectionInfo,
- DummySetPalette,
- DummyGetDisplayMode,
- DummySetDisplayMode,
- DummyShowMouseCursor,
- DummySetMouseCursor,
- DummyMenuControl,
- DummySetMenuClose,
+ PFRONTEND FrontEnd = This->Data;
+ return FrontEnd->Vtbl->ShowMouseCursor(FrontEnd, Show);
+}
+
+static TERMINAL_VTBL ConSrvTermVtbl =
+{
+ ConSrvTermInitTerminal,
+ ConSrvTermDeinitTerminal,
+ ConSrvTermDrawRegion,
+ ConSrvTermWriteStream,
+ ConSrvTermSetCursorInfo,
+ ConSrvTermSetScreenInfo,
+ ConSrvTermResizeTerminal,
+ ConSrvTermSetActiveScreenBuffer,
+ ConSrvTermReleaseScreenBuffer,
+ ConSrvTermChangeTitle,
+ ConSrvTermGetLargestConsoleWindowSize,
+ // ConSrvTermGetSelectionInfo,
+ ConSrvTermSetPalette,
+ ConSrvTermShowMouseCursor,
};
+#if 0
VOID
ResetFrontEnd(IN PCONSOLE Console)
{
@@ -328,9 +356,8 @@
/* Reinitialize the frontend interface */
RtlZeroMemory(&Console->FrontEndIFace, sizeof(Console->FrontEndIFace));
- Console->FrontEndIFace.Vtbl = &DummyVtbl;
-}
-
+ Console->FrontEndIFace.Vtbl = &ConSrvTermVtbl;
+}
#endif
/* EOF */
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]
Sat May 3 01:59:28 2014
@@ -186,16 +186,16 @@
/*
* Internal interface (functions called by the console server only)
*/
- NTSTATUS (NTAPI *InitFrontEnd)(IN OUT PTERMINAL This,
+ NTSTATUS (NTAPI *InitTerminal)(IN OUT PTERMINAL This,
IN struct _CONSOLE* Console);
- VOID (NTAPI *DeinitFrontEnd)(IN OUT PTERMINAL This);
+ VOID (NTAPI *DeinitTerminal)(IN OUT PTERMINAL This);
/* Interface used for both text-mode and graphics screen buffers */
VOID (NTAPI *DrawRegion)(IN OUT PTERMINAL This,
SMALL_RECT* Region);
/* Interface used only for text-mode screen buffers */
VOID (NTAPI *WriteStream)(IN OUT PTERMINAL This,
- SMALL_RECT* Block,
+ SMALL_RECT* Region,
SHORT CursorStartX,
SHORT CursorStartY,
UINT ScrolledLines,
@@ -211,47 +211,27 @@
VOID (NTAPI *SetActiveScreenBuffer)(IN OUT PTERMINAL This);
VOID (NTAPI *ReleaseScreenBuffer)(IN OUT PTERMINAL This,
IN PCONSOLE_SCREEN_BUFFER ScreenBuffer);
- BOOL (NTAPI *ProcessKeyCallback)(IN OUT PTERMINAL This,
- MSG* msg,
- BYTE KeyStateMenu,
- DWORD ShiftState,
- UINT VirtualKeyCode,
- BOOL Down);
- VOID (NTAPI *RefreshInternalInfo)(IN OUT PTERMINAL This);
/*
* External interface (functions corresponding to the Console API)
*/
VOID (NTAPI *ChangeTitle)(IN OUT PTERMINAL This);
- BOOL (NTAPI *ChangeIcon)(IN OUT PTERMINAL This,
- HICON IconHandle);
- HWND (NTAPI *GetConsoleWindowHandle)(IN OUT PTERMINAL This);
VOID (NTAPI *GetLargestConsoleWindowSize)(IN OUT PTERMINAL This,
PCOORD pSize);
- BOOL (NTAPI *GetSelectionInfo)(IN OUT PTERMINAL This,
- PCONSOLE_SELECTION_INFO pSelectionInfo);
+ // BOOL (NTAPI *GetSelectionInfo)(IN OUT PTERMINAL This,
+ // PCONSOLE_SELECTION_INFO pSelectionInfo);
BOOL (NTAPI *SetPalette)(IN OUT PTERMINAL This,
HPALETTE PaletteHandle,
UINT PaletteUsage);
- ULONG (NTAPI *GetDisplayMode)(IN OUT PTERMINAL This);
- BOOL (NTAPI *SetDisplayMode)(IN OUT PTERMINAL This,
- ULONG NewMode);
INT (NTAPI *ShowMouseCursor)(IN OUT PTERMINAL This,
BOOL Show);
- BOOL (NTAPI *SetMouseCursor)(IN OUT PTERMINAL This,
- HCURSOR CursorHandle);
- HMENU (NTAPI *MenuControl)(IN OUT PTERMINAL This,
- UINT CmdIdLow,
- UINT CmdIdHigh);
- BOOL (NTAPI *SetMenuClose)(IN OUT PTERMINAL This,
- BOOL Enable);
#if 0 // Possible future front-end interface
- BOOL (NTAPI *GetFrontEndProperty)(IN OUT PTERMINAL This,
+ BOOL (NTAPI *GetTerminalProperty)(IN OUT PTERMINAL This,
ULONG Flag,
PVOID Info,
ULONG Size);
- BOOL (NTAPI *SetFrontEndProperty)(IN OUT PTERMINAL This,
+ BOOL (NTAPI *SetTerminalProperty)(IN OUT PTERMINAL This,
ULONG Flag,
PVOID Info /*,
ULONG Size */);
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]
Sat May 3 01:59:28 2014
@@ -30,7 +30,7 @@
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,
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/console.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/console.h [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/console.h [iso-8859-1]
Sat May 3 01:59:28 2014
@@ -17,10 +17,10 @@
IN PCONSOLE_INFO ConsoleInfo,
IN ULONG ConsoleLeaderProcessId);
NTSTATUS NTAPI
-ConDrvRegisterFrontEnd(IN PCONSOLE Console,
- IN PFRONTEND FrontEnd);
+ConDrvRegisterTerminal(IN PCONSOLE Console,
+ IN PTERMINAL Terminal);
NTSTATUS NTAPI
-ConDrvDeregisterFrontEnd(IN PCONSOLE Console);
+ConDrvDeregisterTerminal(IN PCONSOLE Console);
VOID NTAPI
ConDrvDeleteConsole(IN PCONSOLE Console);
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/term.h
URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/term.h [iso-8859-1]
(original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/term.h [iso-8859-1] Sat
May 3 01:59:28 2014
@@ -11,43 +11,43 @@
/* Macros used to call functions in the FRONTEND_VTBL virtual table */
#define TermDrawRegion(Console, Region) \
- (Console)->FrontEndIFace.Vtbl->DrawRegion(&(Console)->FrontEndIFace,
(Region))
-#define TermWriteStream(Console, Block, CurStartX, CurStartY, ScrolledLines, Buffer,
Length) \
- (Console)->FrontEndIFace.Vtbl->WriteStream(&(Console)->FrontEndIFace,
(Block), (CurStartX), (CurStartY), \
+ (Console)->TermIFace.Vtbl->DrawRegion(&(Console)->TermIFace, (Region))
+#define TermWriteStream(Console, Region, CurStartX, CurStartY, ScrolledLines, Buffer,
Length) \
+ (Console)->TermIFace.Vtbl->WriteStream(&(Console)->TermIFace, (Region),
(CurStartX), (CurStartY), \
(ScrolledLines), (Buffer), (Length))
#define TermSetCursorInfo(Console, ScreenBuffer) \
- (Console)->FrontEndIFace.Vtbl->SetCursorInfo(&(Console)->FrontEndIFace,
(ScreenBuffer))
+ (Console)->TermIFace.Vtbl->SetCursorInfo(&(Console)->TermIFace,
(ScreenBuffer))
#define TermSetScreenInfo(Console, ScreenBuffer, OldCursorX, OldCursorY) \
- (Console)->FrontEndIFace.Vtbl->SetScreenInfo(&(Console)->FrontEndIFace,
(ScreenBuffer), (OldCursorX), (OldCursorY))
+ (Console)->TermIFace.Vtbl->SetScreenInfo(&(Console)->TermIFace,
(ScreenBuffer), (OldCursorX), (OldCursorY))
#define TermResizeTerminal(Console) \
-
(Console)->FrontEndIFace.Vtbl->ResizeTerminal(&(Console)->FrontEndIFace)
+ (Console)->TermIFace.Vtbl->ResizeTerminal(&(Console)->TermIFace)
#define TermSetActiveScreenBuffer(Console) \
-
(Console)->FrontEndIFace.Vtbl->SetActiveScreenBuffer(&(Console)->FrontEndIFace)
+ (Console)->TermIFace.Vtbl->SetActiveScreenBuffer(&(Console)->TermIFace)
#define TermReleaseScreenBuffer(Console, ScreenBuffer) \
-
(Console)->FrontEndIFace.Vtbl->ReleaseScreenBuffer(&(Console)->FrontEndIFace,
(ScreenBuffer))
+ (Console)->TermIFace.Vtbl->ReleaseScreenBuffer(&(Console)->TermIFace,
(ScreenBuffer))
#define TermProcessKeyCallback(Console, Msg, KeyStateMenu, ShiftState, VirtualKeyCode,
Down) \
(Console)->FrontEndIFace.Vtbl->ProcessKeyCallback(&(Console)->FrontEndIFace,
(Msg), (KeyStateMenu), (ShiftState), (VirtualKeyCode), (Down))
#define TermRefreshInternalInfo(Console) \
(Console)->FrontEndIFace.Vtbl->RefreshInternalInfo(&(Console)->FrontEndIFace)
#define TermChangeTitle(Console) \
- (Console)->FrontEndIFace.Vtbl->ChangeTitle(&(Console)->FrontEndIFace)
+ (Console)->TermIFace.Vtbl->ChangeTitle(&(Console)->TermIFace)
#define TermChangeIcon(Console, IconHandle) \
(Console)->FrontEndIFace.Vtbl->ChangeIcon(&(Console)->FrontEndIFace,
(IconHandle))
#define TermGetConsoleWindowHandle(Console) \
(Console)->FrontEndIFace.Vtbl->GetConsoleWindowHandle(&(Console)->FrontEndIFace)
#define TermGetLargestConsoleWindowSize(Console, pSize) \
-
(Console)->FrontEndIFace.Vtbl->GetLargestConsoleWindowSize(&(Console)->FrontEndIFace,
(pSize))
+
(Console)->TermIFace.Vtbl->GetLargestConsoleWindowSize(&(Console)->TermIFace,
(pSize))
#define TermGetSelectionInfo(Console, pSelectionInfo) \
(Console)->FrontEndIFace.Vtbl->GetSelectionInfo(&(Console)->FrontEndIFace,
(pSelectionInfo))
#define TermSetPalette(Console, PaletteHandle, PaletteUsage) \
- (Console)->FrontEndIFace.Vtbl->SetPalette(&(Console)->FrontEndIFace,
(PaletteHandle), (PaletteUsage))
+ (Console)->TermIFace.Vtbl->SetPalette(&(Console)->TermIFace,
(PaletteHandle), (PaletteUsage))
#define TermGetDisplayMode(Console) \
(Console)->FrontEndIFace.Vtbl->GetDisplayMode(&(Console)->FrontEndIFace)
#define TermSetDisplayMode(Console, NewMode) \
(Console)->FrontEndIFace.Vtbl->SetDisplayMode(&(Console)->FrontEndIFace,
(NewMode))
#define TermShowMouseCursor(Console, Show) \
-
(Console)->FrontEndIFace.Vtbl->ShowMouseCursor(&(Console)->FrontEndIFace,
(Show))
+ (Console)->TermIFace.Vtbl->ShowMouseCursor(&(Console)->TermIFace,
(Show))
#define TermSetMouseCursor(Console, CursorHandle) \
(Console)->FrontEndIFace.Vtbl->SetMouseCursor(&(Console)->FrontEndIFace,
(CursorHandle))
#define TermMenuControl(Console, CmdIdLow, CmdIdHigh) \