Author: hbelusca
Date: Thu Aug 14 20:23:03 2014
New Revision: 63886
URL:
http://svn.reactos.org/svn/reactos?rev=63886&view=rev
Log:
Fourth partial merge of the condrv_restructure branch, with fonts improvements.
CORE-8439 #resolve #comment r63885 merged to trunk in r63886.
Modified:
trunk/reactos/ (props changed)
trunk/reactos/dll/cpl/console/console.c
trunk/reactos/dll/cpl/console/layout.c
trunk/reactos/dll/win32/kernel32/client/console/console.c
trunk/reactos/win32ss/user/winsrv/consrv/alias.c
trunk/reactos/win32ss/user/winsrv/consrv/alias.h
trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c
trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
trunk/reactos/win32ss/user/winsrv/consrv/console.c
trunk/reactos/win32ss/user/winsrv/consrv/consrv.h
trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h
trunk/reactos/win32ss/user/winsrv/consrv/handle.c
trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h
trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c
trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h
trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c
Propchange: trunk/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 14 20:23:03 2014
@@ -3,7 +3,7 @@
/branches/GSoC_2011/TcpIpDriver:51551-53074,53076-53119
/branches/GSoC_Network:51545-51546
/branches/cmake-bringup:50484,50693,50719,51544-52564
-/branches/condrv_restructure:63104-63865
+/branches/condrv_restructure:63104-63885
/branches/header-work:45691-47721
/branches/kd++:58883-58973
/branches/ntvdm:59241-63176
Modified: trunk/reactos/dll/cpl/console/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.c?…
==============================================================================
--- trunk/reactos/dll/cpl/console/console.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/console/console.c [iso-8859-1] Thu Aug 14 20:23:03 2014
@@ -117,7 +117,8 @@
GuiInfo->FontFamily = FF_DONTCARE;
GuiInfo->FontSize.X = 0;
GuiInfo->FontSize.Y = 0;
- GuiInfo->FontWeight = FW_DONTCARE;
+ GuiInfo->FontWeight = FW_NORMAL; // HACK: !!
+ // GuiInfo->FontWeight = FW_DONTCARE;
GuiInfo->FullScreen = FALSE;
GuiInfo->ShowWindow = SW_SHOWNORMAL;
Modified: trunk/reactos/dll/cpl/console/layout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/layout.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] Thu Aug 14 20:23:03 2014
@@ -121,7 +121,7 @@
if (!hBrush) return FALSE;
Font = CreateFontW(GuiInfo->FontSize.Y,
- 0, // GuiInfo->FontSize.X,
+ GuiInfo->FontSize.X,
0,
TA_BASELINE,
GuiInfo->FontWeight,
@@ -131,8 +131,8 @@
OEM_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
- NONANTIALIASED_QUALITY,
- FIXED_PITCH | GuiInfo->FontFamily /* FF_DONTCARE */,
+ DEFAULT_QUALITY, // NONANTIALIASED_QUALITY ; ANTIALIASED_QUALITY
+ FIXED_PITCH | GuiInfo->FontFamily,
GuiInfo->FaceName);
if (Font == NULL)
{
Modified: trunk/reactos/dll/win32/kernel32/client/console/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] Thu Aug 14
20:23:03 2014
@@ -561,7 +561,7 @@
/*
- * @unimplemented (Undocumented)
+ * @implemented (Undocumented)
*/
HANDLE
WINAPI
Modified: trunk/reactos/win32ss/user/winsrv/consrv/alias.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] Thu Aug 14 20:23:03
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: trunk/reactos/win32ss/user/winsrv/consrv/alias.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/alias.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/alias.h [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -9,4 +9,4 @@
#pragma once
-VOID IntDeleteAllAliases(PCONSOLE Console);
+VOID IntDeleteAllAliases(PCONSRV_CONSOLE Console);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] Thu Aug 14
20:23:03 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: trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -40,7 +40,7 @@
* This pre-processing code MUST be IN consrv ONLY
*/
/* static */ ULONG
-PreprocessInput(PCONSOLE Console,
+PreprocessInput(PCONSRV_CONSOLE Console,
PINPUT_RECORD InputEvent,
ULONG NumEventsToWrite)
{
@@ -102,7 +102,7 @@
* This post-processing code MUST be IN consrv ONLY
*/
/* static */ VOID
-PostprocessInput(PCONSOLE Console)
+PostprocessInput(PCONSRV_CONSOLE Console)
{
CsrNotifyWait(&Console->ReadWaitQueue,
FALSE,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -170,7 +170,7 @@
NTSTATUS Status = STATUS_INVALID_PARAMETER;
PCONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CreateScreenBufferRequest;
PCONSOLE_PROCESS_DATA ProcessData =
ConsoleGetPerProcessData(CsrGetClientThread()->Process);
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PCONSOLE_SCREEN_BUFFER Buff;
PVOID ScreenBufferInfo = NULL;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -26,7 +26,7 @@
/* GLOBALS ********************************************************************/
static ULONG ConsoleListSize;
-static PCONSOLE* ConsoleList; /* The list of the ConSrv consoles */
+static PCONSRV_CONSOLE* ConsoleList; /* The list of the ConSrv consoles */
static RTL_RESOURCE ListLock;
#define ConSrvLockConsoleListExclusive() \
@@ -41,13 +41,13 @@
static NTSTATUS
InsertConsole(OUT PHANDLE Handle,
- IN PCONSOLE Console)
+ IN PCONSRV_CONSOLE Console)
{
#define CONSOLE_HANDLES_INCREMENT 2 * 3
NTSTATUS Status = STATUS_SUCCESS;
ULONG i = 0;
- PCONSOLE* Block;
+ PCONSRV_CONSOLE* Block;
ASSERT( (ConsoleList == NULL && ConsoleListSize == 0) ||
(ConsoleList != NULL && ConsoleListSize != 0) );
@@ -70,7 +70,7 @@
/* Allocate a new handles table */
Block = ConsoleAllocHeap(HEAP_ZERO_MEMORY,
(ConsoleListSize +
- CONSOLE_HANDLES_INCREMENT) * sizeof(PCONSOLE));
+ CONSOLE_HANDLES_INCREMENT) *
sizeof(PCONSRV_CONSOLE));
if (Block == NULL)
{
Status = STATUS_UNSUCCESSFUL;
@@ -83,7 +83,7 @@
/* Copy the handles from the old table to the new one */
RtlCopyMemory(Block,
ConsoleList,
- ConsoleListSize * sizeof(PCONSOLE));
+ ConsoleListSize * sizeof(PCONSRV_CONSOLE));
ConsoleFreeHeap(ConsoleList);
}
ConsoleList = Block;
@@ -105,7 +105,7 @@
RemoveConsoleByHandle(IN HANDLE Handle)
{
NTSTATUS Status = STATUS_SUCCESS;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
BOOLEAN ValidHandle = ((HandleToULong(Handle) & 0x3) == 0x3);
ULONG Index = HandleToULong(Handle) >> 2;
@@ -135,7 +135,7 @@
#endif
static NTSTATUS
-RemoveConsoleByPointer(IN PCONSOLE Console)
+RemoveConsoleByPointer(IN PCONSRV_CONSOLE Console)
{
ULONG i = 0;
@@ -162,13 +162,13 @@
}
BOOLEAN NTAPI
-ConSrvValidateConsole(OUT PCONSOLE* Console,
+ConSrvValidateConsole(OUT PCONSRV_CONSOLE* Console,
IN HANDLE ConsoleHandle,
IN CONSOLE_STATE ExpectedState,
IN BOOLEAN LockConsole)
{
BOOLEAN RetVal = FALSE;
- PCONSOLE ValidatedConsole;
+ PCONSRV_CONSOLE ValidatedConsole;
BOOLEAN ValidHandle = ((HandleToULong(ConsoleHandle) & 0x3) == 0x3);
ULONG Index = HandleToULong(ConsoleHandle) >> 2;
@@ -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;
@@ -239,11 +239,11 @@
NTSTATUS
ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData,
- OUT PCONSOLE* Console,
+ OUT PCONSRV_CONSOLE* Console,
IN BOOLEAN LockConsole)
{
NTSTATUS Status = STATUS_INVALID_HANDLE;
- PCONSOLE GrabConsole;
+ PCONSRV_CONSOLE GrabConsole;
// if (Console == NULL) return STATUS_INVALID_PARAMETER;
ASSERT(Console);
@@ -266,7 +266,7 @@
}
VOID
-ConSrvReleaseConsole(IN PCONSOLE Console,
+ConSrvReleaseConsole(IN PCONSRV_CONSOLE Console,
IN BOOLEAN WasConsoleLocked)
{
LONG RefCount = 0;
@@ -319,13 +319,13 @@
NTSTATUS NTAPI
ConSrvInitConsole(OUT PHANDLE NewConsoleHandle,
- OUT PCONSOLE* NewConsole,
+ OUT PCONSRV_CONSOLE* NewConsole,
IN OUT PCONSOLE_START_INFO ConsoleStartInfo,
IN ULONG ConsoleLeaderProcessId)
{
NTSTATUS Status;
HANDLE ConsoleHandle;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
CONSOLE_INFO ConsoleInfo;
SIZE_T Length = 0;
@@ -429,6 +429,9 @@
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);
if (!NT_SUCCESS(Status))
@@ -450,7 +453,7 @@
}
VOID NTAPI
-ConSrvDeleteConsole(PCONSOLE Console)
+ConSrvDeleteConsole(PCONSRV_CONSOLE Console)
{
DPRINT("ConSrvDeleteConsole\n");
@@ -528,7 +531,7 @@
}
PCONSOLE_PROCESS_DATA NTAPI
-ConSrvGetConsoleLeaderProcess(IN PCONSOLE Console)
+ConSrvGetConsoleLeaderProcess(IN PCONSRV_CONSOLE Console)
{
if (Console == NULL) return NULL;
@@ -538,7 +541,7 @@
}
NTSTATUS NTAPI
-ConSrvGetConsoleProcessList(IN PCONSOLE Console,
+ConSrvGetConsoleProcessList(IN PCONSRV_CONSOLE Console,
IN OUT PULONG ProcessIdsList,
IN ULONG MaxIdListItems,
OUT PULONG ProcessIdsTotal)
@@ -567,7 +570,7 @@
// ConSrvGenerateConsoleCtrlEvent
NTSTATUS NTAPI
-ConSrvConsoleProcessCtrlEvent(IN PCONSOLE Console,
+ConSrvConsoleProcessCtrlEvent(IN PCONSRV_CONSOLE Console,
IN ULONG ProcessGroupId,
IN ULONG CtrlEvent)
{
@@ -795,7 +798,7 @@
{
NTSTATUS Status;
PCONSOLE_GETSETCONSOLETITLE TitleRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.TitleRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
if (!CsrValidateMessageBuffer(ApiMessage,
(PVOID)&TitleRequest->Title,
@@ -830,7 +833,7 @@
{
NTSTATUS Status;
PCONSOLE_GETSETCONSOLETITLE TitleRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.TitleRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
if (!CsrValidateMessageBuffer(ApiMessage,
(PVOID)&TitleRequest->Title,
@@ -865,7 +868,7 @@
{
NTSTATUS Status;
PCONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleCPRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
DPRINT("SrvGetConsoleCP, getting %s Code Page\n",
GetConsoleCPRequest->OutputCP ? "Output" : "Input");
@@ -889,7 +892,7 @@
{
NTSTATUS Status = STATUS_INVALID_PARAMETER;
PCONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetConsoleCPRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
DPRINT("SrvSetConsoleCP, setting %s Code Page\n",
SetConsoleCPRequest->OutputCP ? "Output" : "Input");
@@ -909,7 +912,7 @@
{
NTSTATUS Status;
PCONSOLE_GETPROCESSLIST GetProcessListRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetProcessListRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
if (!CsrValidateMessageBuffer(ApiMessage,
(PVOID)&GetProcessListRequest->ProcessIdsList,
@@ -935,7 +938,7 @@
{
NTSTATUS Status;
PCONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GenerateCtrlEventRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
@@ -952,7 +955,7 @@
{
NTSTATUS Status;
PCONSOLE_PROCESS_DATA ProcessData =
ConsoleGetPerProcessData(CsrGetClientThread()->Process);
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ProcessData, &Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
@@ -979,7 +982,7 @@
{
NTSTATUS Status;
PCONSOLE_GETMOUSEINFO GetMouseInfoRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetMouseInfoRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
@@ -1001,7 +1004,7 @@
{
NTSTATUS Status;
PCONSOLE_GETKBDLAYOUTNAME GetKbdLayoutNameRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetKbdLayoutNameRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/consrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] Thu Aug 14 20:23:03
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: trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] Thu Aug 14
20:23:03 2014
@@ -31,7 +31,7 @@
*/
#if 0
static NTSTATUS
-SetConsoleHardwareState(PCONSOLE Console, ULONG ConsoleHwState)
+SetConsoleHardwareState(PCONSRV_CONSOLE Console, ULONG ConsoleHwState)
{
DPRINT1("Console Hardware State: %d\n", ConsoleHwState);
@@ -58,7 +58,7 @@
NTSTATUS Status;
PCONSOLE_GETSETHWSTATE HardwareStateRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HardwareStateRequest;
PCONSOLE_SCREEN_BUFFER Buff;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status =
ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
HardwareStateRequest->OutputHandle,
@@ -88,7 +88,7 @@
NTSTATUS Status;
PCONSOLE_GETSETHWSTATE HardwareStateRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HardwareStateRequest;
PCONSOLE_SCREEN_BUFFER Buff;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status =
ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
HardwareStateRequest->OutputHandle,
@@ -117,7 +117,7 @@
{
NTSTATUS Status;
PCONSOLE_GETDISPLAYMODE GetDisplayModeRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetDisplayModeRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status =
ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
@@ -133,7 +133,7 @@
{
NTSTATUS Status;
PCONSOLE_SETDISPLAYMODE SetDisplayModeRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetDisplayModeRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PCONSOLE_SCREEN_BUFFER Buff;
Status =
ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
@@ -164,7 +164,7 @@
NTSTATUS Status;
PCONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetLargestWindowSizeRequest;
PCONSOLE_SCREEN_BUFFER Buff;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status =
ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
GetLargestWindowSizeRequest->OutputHandle,
@@ -184,7 +184,7 @@
{
NTSTATUS Status;
PCONSOLE_SHOWCURSOR ShowCursorRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ShowCursorRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PCONSOLE_SCREEN_BUFFER Buff;
Status =
ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
@@ -207,7 +207,7 @@
NTSTATUS Status;
BOOL Success;
PCONSOLE_SETCURSOR SetCursorRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetCursorRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PCONSOLE_SCREEN_BUFFER Buff;
// FIXME: Tests show that this function is used only for graphics screen buffers
@@ -232,7 +232,7 @@
{
NTSTATUS Status;
PCONSOLE_MENUCONTROL MenuControlRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.MenuControlRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PCONSOLE_SCREEN_BUFFER Buff;
Status =
ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
@@ -257,7 +257,7 @@
NTSTATUS Status;
BOOL Success;
PCONSOLE_SETMENUCLOSE SetMenuCloseRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetMenuCloseRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status =
ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
@@ -273,7 +273,7 @@
{
NTSTATUS Status;
PCONSOLE_GETWINDOW GetWindowRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetWindowRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
@@ -288,7 +288,7 @@
{
NTSTATUS Status;
PCONSOLE_SETICON SetIconRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetIconRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
@@ -305,7 +305,7 @@
{
NTSTATUS Status;
PCONSOLE_GETSELECTIONINFO GetSelectionInfoRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetSelectionInfoRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -282,7 +282,7 @@
}
static VOID
-SendMenuEvent(PCONSOLE Console, UINT CmdId)
+SendMenuEvent(PCONSRV_CONSOLE Console, UINT CmdId)
{
INPUT_RECORD er;
@@ -366,7 +366,7 @@
OnCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam)
{
LRESULT Ret = TRUE;
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
/*
* In case the selected menu item belongs to the user-reserved menu id range,
@@ -486,15 +486,166 @@
// to: InvalidateRect(GuiData->hWindow, NULL, TRUE);
}
+
+VOID
+DeleteFonts(PGUI_CONSOLE_DATA GuiData)
+{
+ ULONG i;
+ for (i = 0; i < sizeof(GuiData->Font) / sizeof(GuiData->Font[0]); ++i)
+ {
+ if (GuiData->Font[i] != NULL) DeleteObject(GuiData->Font[i]);
+ GuiData->Font[i] = NULL;
+ }
+}
+
+static HFONT
+CreateDerivedFont(HFONT OrgFont,
+ // COORD FontSize,
+ ULONG FontWeight,
+ // BOOLEAN bItalic,
+ BOOLEAN bUnderline,
+ BOOLEAN bStrikeOut)
+{
+ LOGFONT lf;
+
+ /* Initialize the LOGFONT structure */
+ RtlZeroMemory(&lf, sizeof(lf));
+
+ /* Retrieve the details of the current font */
+ if (GetObject(OrgFont, sizeof(lf), &lf) == 0)
+ return NULL;
+
+ /* Change the font attributes */
+ // lf.lfHeight = FontSize.Y;
+ // lf.lfWidth = FontSize.X;
+ lf.lfWeight = FontWeight;
+ // lf.lfItalic = bItalic;
+ lf.lfUnderline = bUnderline;
+ lf.lfStrikeOut = bStrikeOut;
+
+ /* Build a new font */
+ return CreateFontIndirect(&lf);
+}
+
+BOOL
+InitFonts(PGUI_CONSOLE_DATA GuiData,
+ LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements.
+ ULONG FontFamily,
+ COORD FontSize,
+ ULONG FontWeight)
+{
+ HDC hDC;
+ HFONT OldFont, NewFont;
+ TEXTMETRICW Metrics;
+ SIZE CharSize;
+
+ /*
+ * Initialize a new NORMAL font and get its metrics.
+ */
+
+ NewFont = CreateFontW(FontSize.Y,
+ FontSize.X,
+ 0,
+ TA_BASELINE,
+ FontWeight,
+ FALSE,
+ FALSE,
+ FALSE,
+ OEM_CHARSET,
+ OUT_DEFAULT_PRECIS,
+ CLIP_DEFAULT_PRECIS,
+ DEFAULT_QUALITY, // NONANTIALIASED_QUALITY ;
ANTIALIASED_QUALITY
+ FIXED_PITCH | FontFamily,
+ FaceName);
+ if (NewFont == NULL)
+ {
+ DPRINT1("InitFonts: CreateFontW failed\n");
+ return FALSE;
+ }
+
+ hDC = GetDC(GuiData->hWindow);
+ if (hDC == NULL)
+ {
+ DPRINT1("InitFonts: GetDC failed\n");
+ DeleteObject(NewFont);
+ return FALSE;
+ }
+
+ OldFont = SelectObject(hDC, NewFont);
+ if (OldFont == NULL)
+ {
+ DPRINT1("InitFonts: SelectObject failed\n");
+ ReleaseDC(GuiData->hWindow, hDC);
+ DeleteObject(NewFont);
+ return FALSE;
+ }
+
+ if (!GetTextMetricsW(hDC, &Metrics))
+ {
+ DPRINT1("InitFonts: GetTextMetrics failed\n");
+ SelectObject(hDC, OldFont);
+ ReleaseDC(GuiData->hWindow, hDC);
+ DeleteObject(NewFont);
+ return FALSE;
+ }
+ GuiData->CharWidth = Metrics.tmMaxCharWidth;
+ GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading;
+
+ /* Measure real char width more precisely if possible. */
+ if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize))
+ GuiData->CharWidth = CharSize.cx;
+
+ SelectObject(hDC, OldFont);
+ ReleaseDC(GuiData->hWindow, hDC);
+
+ /*
+ * Initialization succeeded.
+ */
+ // Delete all the old fonts first.
+ DeleteFonts(GuiData);
+ GuiData->Font[FONT_NORMAL] = NewFont;
+
+ /*
+ * Now build the other fonts (bold, underlined, mixed).
+ */
+ GuiData->Font[FONT_BOLD] =
+ CreateDerivedFont(GuiData->Font[FONT_NORMAL],
+ FontWeight < FW_BOLD ? FW_BOLD : FontWeight,
+ FALSE,
+ FALSE);
+ GuiData->Font[FONT_UNDERLINE] =
+ CreateDerivedFont(GuiData->Font[FONT_NORMAL],
+ FontWeight,
+ TRUE,
+ FALSE);
+ GuiData->Font[FONT_BOLD | FONT_UNDERLINE] =
+ CreateDerivedFont(GuiData->Font[FONT_NORMAL],
+ FontWeight < FW_BOLD ? FW_BOLD : FontWeight,
+ TRUE,
+ FALSE);
+
+ /*
+ * Save the settings.
+ */
+ if (FaceName != GuiData->GuiInfo.FaceName)
+ {
+ SIZE_T Length = min(wcslen(FaceName) + 1, LF_FACESIZE); // wcsnlen
+ wcsncpy(GuiData->GuiInfo.FaceName, FaceName, LF_FACESIZE);
+ GuiData->GuiInfo.FaceName[Length] = L'\0'; // NULL-terminate
+ }
+ GuiData->GuiInfo.FontFamily = FontFamily;
+ GuiData->GuiInfo.FontSize = FontSize;
+ GuiData->GuiInfo.FontWeight = FontWeight;
+
+ return TRUE;
+}
+
+
static BOOL
OnNcCreate(HWND hWnd, LPCREATESTRUCTW Create)
{
PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)Create->lpCreateParams;
- PCONSOLE Console;
- HDC hDC;
- HFONT OldFont;
- TEXTMETRICW Metrics;
- SIZE CharSize;
+ PCONSRV_CONSOLE Console;
if (NULL == GuiData)
{
@@ -506,67 +657,18 @@
GuiData->hWindow = hWnd;
- GuiData->Font = CreateFontW(GuiData->GuiInfo.FontSize.Y,
- 0, // GuiData->GuiInfo.FontSize.X,
- 0,
- TA_BASELINE,
- GuiData->GuiInfo.FontWeight,
- FALSE,
- FALSE,
- FALSE,
- OEM_CHARSET,
- OUT_DEFAULT_PRECIS,
- CLIP_DEFAULT_PRECIS,
- NONANTIALIASED_QUALITY,
- FIXED_PITCH | GuiData->GuiInfo.FontFamily /*
FF_DONTCARE */,
- GuiData->GuiInfo.FaceName);
-
- if (NULL == GuiData->Font)
- {
- DPRINT1("GuiConsoleNcCreate: CreateFont failed\n");
+ /* Initialize the fonts */
+ if (!InitFonts(GuiData,
+ GuiData->GuiInfo.FaceName,
+ GuiData->GuiInfo.FontFamily,
+ GuiData->GuiInfo.FontSize,
+ GuiData->GuiInfo.FontWeight))
+ {
+ DPRINT1("GuiConsoleNcCreate: InitFonts failed\n");
GuiData->hWindow = NULL;
SetEvent(GuiData->hGuiInitEvent);
return FALSE;
}
- hDC = GetDC(GuiData->hWindow);
- if (NULL == hDC)
- {
- DPRINT1("GuiConsoleNcCreate: GetDC failed\n");
- DeleteObject(GuiData->Font);
- GuiData->hWindow = NULL;
- SetEvent(GuiData->hGuiInitEvent);
- return FALSE;
- }
- OldFont = SelectObject(hDC, GuiData->Font);
- if (NULL == OldFont)
- {
- DPRINT1("GuiConsoleNcCreate: SelectObject failed\n");
- ReleaseDC(GuiData->hWindow, hDC);
- DeleteObject(GuiData->Font);
- GuiData->hWindow = NULL;
- SetEvent(GuiData->hGuiInitEvent);
- return FALSE;
- }
- if (!GetTextMetricsW(hDC, &Metrics))
- {
- DPRINT1("GuiConsoleNcCreate: GetTextMetrics failed\n");
- SelectObject(hDC, OldFont);
- ReleaseDC(GuiData->hWindow, hDC);
- DeleteObject(GuiData->Font);
- GuiData->hWindow = NULL;
- SetEvent(GuiData->hGuiInitEvent);
- return FALSE;
- }
- GuiData->CharWidth = Metrics.tmMaxCharWidth;
- GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading;
-
- /* Measure real char width more precisely if possible. */
- if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize))
- GuiData->CharWidth = CharSize.cx;
-
- SelectObject(hDC, OldFont);
-
- ReleaseDC(GuiData->hWindow, hDC);
/* Initialize the terminal framebuffer */
GuiData->hMemDC = CreateCompatibleDC(NULL);
@@ -647,7 +749,7 @@
static VOID
OnFocus(PGUI_CONSOLE_DATA GuiData, BOOL SetFocus)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
INPUT_RECORD er;
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
@@ -814,7 +916,7 @@
PCOORD SelectionAnchor OPTIONAL,
PCOORD coord)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
HRGN oldRgn = CreateSelectionRgn(GuiData, GuiData->LineSelection,
&GuiData->Selection.dwSelectionAnchor,
&GuiData->Selection.srSelection);
@@ -1039,7 +1141,7 @@
static VOID
OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER ActiveBuffer;
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
@@ -1204,7 +1306,7 @@
static VOID
OnTimer(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER Buff;
SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CURSOR_BLINK_TIME, NULL);
@@ -1309,7 +1411,7 @@
static BOOL
OnClose(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
return TRUE;
@@ -1341,7 +1443,7 @@
if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC);
if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap);
// if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette);
- if (GuiData->Font) DeleteObject(GuiData->Font);
+ DeleteFonts(GuiData);
}
/* Free the GuiData registration */
@@ -1380,7 +1482,7 @@
OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL Err = FALSE;
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
// FIXME: It's here that we need to check whether we has focus or not
// and whether we are in edit mode or not, to know if we need to deal
@@ -1735,7 +1837,7 @@
static VOID
OnGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER ActiveBuffer;
DWORD windx, windy;
UINT WidthUnit, HeightUnit;
@@ -1767,7 +1869,7 @@
static VOID
OnSize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
@@ -1872,7 +1974,7 @@
static LRESULT
OnScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER Buff;
SCROLLINFO sInfo;
int fnBar;
@@ -1983,7 +2085,7 @@
{
LRESULT Result = 0;
PGUI_CONSOLE_DATA GuiData = NULL;
- PCONSOLE Console = NULL;
+ PCONSRV_CONSOLE Console = NULL;
/*
* - If it's the first time we create a window for the terminal,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -21,6 +21,17 @@
#define PM_CONSOLE_BEEP (WM_APP + 4)
#define PM_CONSOLE_SET_TITLE (WM_APP + 5)
+/*
+typedef struct _CONSOLE_FONT
+{
+ HFONT Font;
+ ULONG Flag;
+} CONSOLE_FONT, *PCONSOLE_FONT;
+*/
+#define FONT_NORMAL 0x00
+#define FONT_BOLD 0x01
+#define FONT_UNDERLINE 0x02
+#define FONT_MAXNO 0x04
typedef struct _GUI_CONSOLE_DATA
{
@@ -56,12 +67,12 @@
// PVOID ScreenBuffer; /* Hardware screen buffer */
- HFONT Font;
- UINT CharWidth;
- UINT CharHeight;
+ HFONT Font[FONT_MAXNO];
+ UINT CharWidth; /* The character width and height should be the same for */
+ UINT CharHeight; /* both normal and bold/underlined fonts... */
/*****************************************************/
- PCONSOLE Console; /* Pointer to the owned console */
+ PCONSRV_CONSOLE Console; /* Pointer to the owned console */
PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then
maybe the previous Console member is redundant?? Or not...) */
CONSOLE_SELECTION_INFO Selection; /* Contains information about the selection
*/
COORD dwSelectionCursor; /* Selection cursor position, most of the
time different from Selection.dwSelectionAnchor */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c [iso-8859-1] Thu
Aug 14 20:23:03 2014
@@ -48,7 +48,7 @@
VOID
SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
/*
* See:
@@ -174,7 +174,7 @@
VOID
GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
BOOL FullScreen;
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -115,7 +115,7 @@
* This function supposes that the system clipboard was opened.
*/
- // PCONSOLE Console = Buffer->Header.Console;
+ // PCONSRV_CONSOLE Console = Buffer->Header.Console;
UNIMPLEMENTED;
}
@@ -126,7 +126,7 @@
PRECT rcView,
PRECT rcFramebuffer)
{
- PCONSOLE Console = Buffer->Header.Console;
+ PCONSRV_CONSOLE Console = Buffer->Header.Console;
// ASSERT(Console == GuiData->Console);
if (Buffer->BitMap == NULL) return;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] Thu
Aug 14 20:23:03 2014
@@ -16,9 +16,6 @@
#include "guiterm.h"
#include "guisettings.h"
-
-VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData);
-VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen);
/* FUNCTIONS ******************************************************************/
@@ -199,14 +196,14 @@
// wcsncpy(TermInfo->FaceName, L"DejaVu Sans Mono", LF_FACESIZE);
// TermInfo->FontSize = MAKELONG(8, 12); // 0x000C0008; // font is 8x12
// TermInfo->FontSize = MAKELONG(16, 16); // font is 16x16
- // TermInfo->FontWeight = FW_NORMAL;
wcsncpy(TermInfo->FaceName, L"VGA", LF_FACESIZE); // HACK: !!
// TermInfo->FaceName[0] = L'\0';
TermInfo->FontFamily = FF_DONTCARE;
TermInfo->FontSize.X = 0;
TermInfo->FontSize.Y = 0;
- TermInfo->FontWeight = FW_DONTCARE;
+ TermInfo->FontWeight = FW_NORMAL; // HACK: !!
+ // TermInfo->FontWeight = FW_DONTCARE;
TermInfo->FullScreen = FALSE;
TermInfo->ShowWindow = SW_SHOWNORMAL;
@@ -230,7 +227,7 @@
BOOL Defaults)
{
NTSTATUS Status;
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer;
PCONSOLE_PROCESS_DATA ProcessData;
HANDLE hSection = NULL, hClientSection = NULL;
@@ -418,99 +415,13 @@
return;
}
-
-
-
-BOOL
-ChangeFont(PGUI_CONSOLE_DATA GuiData,
- LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements.
- ULONG FontFamily,
- COORD FontSize,
- ULONG FontWeight)
-{
- HDC hDC;
- HFONT OldFont, NewFont;
- TEXTMETRICW Metrics;
- SIZE CharSize;
- SIZE_T Length;
-
- NewFont = CreateFontW(FontSize.Y,
- 0, // FontSize.X,
- 0,
- TA_BASELINE,
- FontWeight,
- FALSE,
- FALSE,
- FALSE,
- OEM_CHARSET,
- OUT_DEFAULT_PRECIS,
- CLIP_DEFAULT_PRECIS,
- NONANTIALIASED_QUALITY,
- FIXED_PITCH | FontFamily /* FF_DONTCARE */,
- FaceName);
- if (NewFont == NULL)
- {
- DPRINT1("ChangeFont: CreateFont failed\n");
- return FALSE;
- }
-
- hDC = GetDC(GuiData->hWindow);
- if (hDC == NULL)
- {
- DPRINT1("ChangeFont: GetDC failed\n");
- DeleteObject(NewFont);
- return FALSE;
- }
-
- OldFont = SelectObject(hDC, NewFont);
- if (OldFont == NULL)
- {
- DPRINT1("ChangeFont: SelectObject failed\n");
- ReleaseDC(GuiData->hWindow, hDC);
- DeleteObject(NewFont);
- return FALSE;
- }
-
- if (!GetTextMetricsW(hDC, &Metrics))
- {
- DPRINT1("ChangeFont: GetTextMetrics failed\n");
- SelectObject(hDC, OldFont);
- ReleaseDC(GuiData->hWindow, hDC);
- DeleteObject(NewFont);
- return FALSE;
- }
- GuiData->CharWidth = Metrics.tmMaxCharWidth;
- GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading;
-
- /* Measure real char width more precisely if possible. */
- if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize))
- GuiData->CharWidth = CharSize.cx;
-
- SelectObject(hDC, OldFont);
- ReleaseDC(GuiData->hWindow, hDC);
-
- if (GuiData->Font != NULL) DeleteObject(GuiData->Font);
- GuiData->Font = NewFont;
-
- Length = min(wcslen(FaceName) + 1, LF_FACESIZE); // wcsnlen
- wcsncpy(GuiData->GuiInfo.FaceName, FaceName, LF_FACESIZE);
- GuiData->GuiInfo.FaceName[Length] = L'\0'; // NULL-terminate
- GuiData->GuiInfo.FontFamily = FontFamily;
- GuiData->GuiInfo.FontSize = FontSize;
- GuiData->GuiInfo.FontWeight = FontWeight;
-
- return TRUE;
-}
-
-
-
VOID
GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData,
HANDLE hClientSection,
BOOL SaveSettings)
{
NTSTATUS Status = STATUS_SUCCESS;
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_PROCESS_DATA ProcessData;
HANDLE hSection = NULL;
ULONG ViewSize = 0;
@@ -586,11 +497,11 @@
// memcpy(&GuiData->GuiInfo, GuiInfo, sizeof(GUI_CONSOLE_INFO));
/* Change the font */
- ChangeFont(GuiData,
- GuiInfo->FaceName,
- GuiInfo->FontFamily,
- GuiInfo->FontSize,
- GuiInfo->FontWeight);
+ InitFonts(GuiData,
+ GuiInfo->FaceName,
+ GuiInfo->FontFamily,
+ GuiInfo->FontSize,
+ GuiInfo->FontWeight);
// HACK, needed because changing font may change the size of the window
/**/TermResizeTerminal(Console);/**/
@@ -654,7 +565,7 @@
HANDLE hClientSection)
{
NTSTATUS Status = STATUS_SUCCESS;
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_PROCESS_DATA ProcessData;
HANDLE hSection = NULL;
ULONG ViewSize = 0;
@@ -768,11 +679,11 @@
// memcpy(&GuiData->GuiInfo, &GuiInfo, sizeof(GUI_CONSOLE_INFO));
/* Change the font */
- ChangeFont(GuiData,
- GuiInfo.FaceName,
- GuiInfo.FontFamily,
- GuiInfo.FontSize,
- GuiInfo.FontWeight);
+ InitFonts(GuiData,
+ GuiInfo.FaceName,
+ GuiInfo.FontFamily,
+ GuiInfo.FontSize,
+ GuiInfo.FontWeight);
// HACK, needed because changing font may change the size of the window
/**/TermResizeTerminal(Console);/**/
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] Thu
Aug 14 20:23:03 2014
@@ -29,7 +29,6 @@
typedef struct _GUI_CONSOLE_INFO
{
- // FONTSIGNATURE FontSignature;
WCHAR FaceName[LF_FACESIZE];
ULONG FontFamily;
COORD FontSize;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -160,7 +160,7 @@
case PM_CREATE_CONSOLE:
{
PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)lParam;
- PCONSOLE Console = GuiData->Console;
+ PCONSRV_CONSOLE Console = GuiData->Console;
RECT rcWnd;
DPRINT("PM_CREATE_CONSOLE -- creating window\n");
@@ -394,9 +394,9 @@
static VOID NTAPI
GuiDeinitFrontEnd(IN OUT PFRONTEND This);
-NTSTATUS NTAPI
+static NTSTATUS NTAPI
GuiInitFrontEnd(IN OUT PFRONTEND This,
- IN PCONSOLE Console)
+ IN PCONSRV_CONSOLE Console)
{
PGUI_INIT_INFO GuiInitInfo;
PCONSOLE_INFO ConsoleInfo;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -15,8 +15,23 @@
#include "conwnd.h"
NTSTATUS GuiInitConsole(PCONSOLE Console,
- /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo,
- PCONSOLE_INFO ConsoleInfo,
- DWORD ProcessId,
- LPCWSTR IconPath,
- INT IconIndex);
+ /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo,
+ PCONSOLE_INFO ConsoleInfo,
+ DWORD ProcessId,
+ LPCWSTR IconPath,
+ INT IconIndex);
+
+VOID
+GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData);
+
+VOID
+SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen);
+
+BOOL
+InitFonts(PGUI_CONSOLE_DATA GuiData,
+ LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements.
+ ULONG FontFamily,
+ COORD FontSize,
+ ULONG FontWeight);
+VOID
+DeleteFonts(PGUI_CONSOLE_DATA GuiData);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Thu Aug 14
20:23:03 2014
@@ -25,7 +25,7 @@
/* FUNCTIONS ******************************************************************/
static COLORREF
-PaletteRGBFromAttrib(PCONSOLE Console, WORD Attribute)
+PaletteRGBFromAttrib(PCONSRV_CONSOLE Console, WORD Attribute)
{
HPALETTE hPalette = Console->ActiveBuffer->PaletteHandle;
PALETTEENTRY pe;
@@ -34,44 +34,6 @@
GetPaletteEntries(hPalette, Attribute, 1, &pe);
return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue);
-}
-
-static HFONT
-ChangeFontAttributes(PGUI_CONSOLE_DATA GuiData,
- // COORD FontSize,
- ULONG FontWeight,
- BOOLEAN bItalic,
- BOOLEAN bUnderline,
- BOOLEAN bStrikeOut)
-{
- HFONT NewFont;
- LOGFONT lf;
-
- /* Initialize the LOGFONT structure */
- RtlZeroMemory(&lf, sizeof(lf));
-
- /* Retrieve the details of the current font */
- if (GetObject(GuiData->Font, sizeof(lf), &lf) == 0)
- return NULL; // GuiData->Font;
-
- /* Change the font attributes */
- // lf.lfHeight = FontSize.Y;
- // lf.lfWidth = FontSize.X;
- lf.lfWeight = FontWeight;
- lf.lfItalic = bItalic;
- lf.lfUnderline = bUnderline;
- lf.lfStrikeOut = bStrikeOut;
-
- /* Build a new font */
- NewFont = CreateFontIndirect(&lf);
- if (NewFont == NULL)
- return NULL; // GuiData->Font;
-
- // FIXME: Do we need to update GuiData->CharWidth and GuiData->CharHeight ??
-
- /* Select it (return the old font) */
- // return SelectObject(GuiData->hMemDC, NewFont);
- return NewFont;
}
static VOID
@@ -309,7 +271,7 @@
* This function supposes that the system clipboard was opened.
*/
- PCONSOLE Console = Buffer->Header.Console;
+ PCONSRV_CONSOLE Console = Buffer->Header.Console;
HANDLE hData;
LPWSTR str;
@@ -377,7 +339,7 @@
PRECT rcView,
PRECT rcFramebuffer)
{
- PCONSOLE Console = Buffer->Header.Console;
+ PCONSRV_CONSOLE Console = Buffer->Header.Console;
// ASSERT(Console == GuiData->Console);
ULONG TopLine, BottomLine, LeftChar, RightChar;
@@ -388,7 +350,7 @@
ULONG CursorX, CursorY, CursorHeight;
HBRUSH CursorBrush, OldBrush;
HFONT OldFont, NewFont;
- BOOLEAN IsUnderscore;
+ BOOLEAN IsUnderline;
if (Buffer->Buffer == NULL) return;
@@ -412,17 +374,10 @@
SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console,
TextAttribFromAttrib(LastAttribute)));
SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console,
BkgdAttribFromAttrib(LastAttribute)));
- // OldFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight,
FALSE, FALSE, FALSE);
- IsUnderscore = !!(LastAttribute & COMMON_LVB_UNDERSCORE);
- NewFont = ChangeFontAttributes(GuiData, /* {0}, */ GuiData->GuiInfo.FontWeight,
- FALSE,
- IsUnderscore,
- FALSE);
- if (NewFont == NULL)
- {
- DPRINT1("ChangeFontAttributes failed, use the original font\n");
- NewFont = GuiData->Font;
- }
+ /* We use the underscore flag as a underline flag */
+ IsUnderline = !!(LastAttribute & COMMON_LVB_UNDERSCORE);
+ /* Select the new font */
+ NewFont = GuiData->Font[IsUnderline ? FONT_BOLD : FONT_NORMAL];
OldFont = SelectObject(GuiData->hMemDC, NewFont);
for (Line = TopLine; Line <= BottomLine; Line++)
@@ -454,25 +409,12 @@
SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console,
TextAttribFromAttrib(LastAttribute)));
SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console,
BkgdAttribFromAttrib(LastAttribute)));
- /* Change underscore state if needed */
- if (!!(LastAttribute & COMMON_LVB_UNDERSCORE) != IsUnderscore)
+ /* Change underline state if needed */
+ if (!!(LastAttribute & COMMON_LVB_UNDERSCORE) != IsUnderline)
{
- IsUnderscore = !!(LastAttribute & COMMON_LVB_UNDERSCORE);
-
- /* Delete the font we used up to now */
- // SelectObject(GuiData->hMemDC, OldFont);
- if (NewFont != GuiData->Font) DeleteObject(NewFont);
- /* Recreate it */
- NewFont = ChangeFontAttributes(GuiData, /* {0}, */
GuiData->GuiInfo.FontWeight,
- FALSE,
- IsUnderscore,
- FALSE);
- if (NewFont == NULL)
- {
- DPRINT1("ChangeFontAttributes failed, use the original
font\n");
- NewFont = GuiData->Font;
- }
- /* Select it */
+ IsUnderline = !!(LastAttribute & COMMON_LVB_UNDERSCORE);
+ /* Select the new font */
+ NewFont = GuiData->Font[IsUnderline ? FONT_BOLD :
FONT_NORMAL];
/* OldFont = */ SelectObject(GuiData->hMemDC, NewFont);
}
}
@@ -487,6 +429,9 @@
LineBuffer,
RightChar - Start + 1);
}
+
+ /* Restore the old font */
+ SelectObject(GuiData->hMemDC, OldFont);
/*
* Draw the caret
@@ -520,10 +465,6 @@
}
}
- /* Restore the old font and delete the font we used up to now */
- SelectObject(GuiData->hMemDC, OldFont);
- if (NewFont != GuiData->Font) DeleteObject(NewFont);
-
LeaveCriticalSection(&Console->Lock);
}
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] Thu Aug 14
20:23:03 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: trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -35,7 +35,7 @@
HWND hWindow; /* Handle to the console's window (used for the
window's procedure */
- PCONSOLE Console; /* Pointer to the owned console */
+ PCONSRV_CONSOLE Console; /* Pointer to the owned console */
// TUI_CONSOLE_INFO TuiInfo; /* TUI terminal settings */
} TUI_CONSOLE_DATA, *PTUI_CONSOLE_DATA;
@@ -261,7 +261,7 @@
{
/*
PTUI_CONSOLE_DATA TuiData = NULL;
- PCONSOLE Console = NULL;
+ PCONSRV_CONSOLE Console = NULL;
TuiData = TuiGetGuiData(hWnd);
if (TuiData == NULL) return 0;
@@ -330,7 +330,7 @@
TuiConsoleThread(PVOID Data)
{
PTUI_CONSOLE_DATA TuiData = (PTUI_CONSOLE_DATA)Data;
- PCONSOLE Console = TuiData->Console;
+ PCONSRV_CONSOLE Console = TuiData->Console;
HWND NewWindow;
MSG msg;
@@ -458,11 +458,11 @@
static VOID NTAPI
TuiDeinitFrontEnd(IN OUT PFRONTEND This /*,
- IN PCONSOLE Console */);
-
-NTSTATUS NTAPI
+ IN PCONSRV_CONSOLE Console */);
+
+static NTSTATUS NTAPI
TuiInitFrontEnd(IN OUT PFRONTEND This,
- IN PCONSOLE Console)
+ IN PCONSRV_CONSOLE Console)
{
PTUI_CONSOLE_DATA TuiData;
HANDLE ThreadHandle;
@@ -539,7 +539,7 @@
static VOID NTAPI
TuiDeinitFrontEnd(IN OUT PFRONTEND This)
{
- // PCONSOLE Console = This->Console;
+ // PCONSRV_CONSOLE Console = This->Console;
PTUI_CONSOLE_DATA TuiData = This->Data; // Console->FrontEndIFace.Data;
/* Close the notification window */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.h [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -12,8 +12,8 @@
#pragma once
NTSTATUS TuiInitConsole(PCONSOLE Console,
- /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo,
- PCONSOLE_INFO ConsoleInfo,
- DWORD ProcessId);
+ /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo,
+ PCONSOLE_INFO ConsoleInfo,
+ DWORD ProcessId);
/* EOF */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -482,7 +482,7 @@
{
NTSTATUS Status = STATUS_SUCCESS;
HANDLE ConsoleHandle;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
/*
* We are about to create a new console. However when ConSrvNewProcess
Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Thu Aug 14
20:23:03 2014
@@ -12,20 +12,10 @@
#include "rect.h"
-#define CSR_DEFAULT_CURSOR_SIZE 25
-
/* Default attributes */
#define DEFAULT_SCREEN_ATTRIB (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
#define DEFAULT_POPUP_ATTRIB (FOREGROUND_BLUE | FOREGROUND_RED | \
BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED |
BACKGROUND_INTENSITY)
-
-/* VGA character cell */
-typedef struct _CHAR_CELL
-{
- CHAR Char;
- BYTE Attributes;
-} CHAR_CELL, *PCHAR_CELL;
-C_ASSERT(sizeof(CHAR_CELL) == 2);
/* Object type magic numbers */
@@ -272,7 +262,6 @@
// HACK!!
struct _CONSOLE;
-struct _WINSRV_CONSOLE;
/* HACK: */ typedef struct _CONSOLE *PCONSOLE;
#include "conio_winsrv.h"
@@ -294,7 +283,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 +292,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
*/
@@ -332,11 +311,7 @@
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;
-
-// #include "conio_winsrv.h"
/* console.c */
VOID NTAPI
@@ -344,18 +319,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 +360,5 @@
PWCHAR Buffer,
DWORD Length,
BOOL Attrib);
-DWORD ConioEffectiveCursorSize(PCONSOLE Console,
- DWORD Scale);
/* EOF */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] Thu Aug
14 20:23:03 2014
@@ -12,7 +12,27 @@
#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 _CONSRV_CONSOLE _WINSRV_CONSOLE
+// #define CONSRV_CONSOLE WINSRV_CONSOLE
+// #define PCONSRV_CONSOLE PWINSRV_CONSOLE
+
+
#define CSR_DEFAULT_CURSOR_SIZE 25
+
+/* VGA character cell */
+typedef struct _CHAR_CELL
+{
+ CHAR Char;
+ BYTE Attributes;
+} CHAR_CELL, *PCHAR_CELL;
+C_ASSERT(sizeof(CHAR_CELL) == 2);
+
typedef struct _FRONTEND FRONTEND, *PFRONTEND;
/* HACK: */ typedef struct _CONSOLE_INFO *PCONSOLE_INFO;
@@ -24,7 +44,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 */
@@ -83,8 +103,7 @@
PFRONTEND_VTBL Vtbl; /* Virtual table */
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 */
};
@@ -99,6 +118,7 @@
/******************************* Console Set-up *******************************/
/* This **MUST** be FIRST!! */
// CONSOLE;
+ // PCONSOLE Console;
// LONG ReferenceCount; /* Is incremented each time a handle to
something in the console (a screen-buffer or the input buffer of this console) gets
referenced */
// CRITICAL_SECTION Lock;
@@ -125,35 +145,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 +207,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,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -43,7 +43,7 @@
/* PRIVATE FUNCTIONS **********************************************************/
static PHISTORY_BUFFER
-HistoryCurrentBuffer(PCONSOLE Console,
+HistoryCurrentBuffer(PCONSRV_CONSOLE Console,
PUNICODE_STRING ExeName)
{
PLIST_ENTRY Entry = Console->HistoryBuffers.Flink;
@@ -75,7 +75,7 @@
}
static VOID
-HistoryAddEntry(PCONSOLE Console,
+HistoryAddEntry(PCONSRV_CONSOLE Console,
PUNICODE_STRING ExeName)
{
UNICODE_STRING NewEntry;
@@ -127,7 +127,7 @@
}
static VOID
-HistoryGetCurrentEntry(PCONSOLE Console,
+HistoryGetCurrentEntry(PCONSRV_CONSOLE Console,
PUNICODE_STRING ExeName,
PUNICODE_STRING Entry)
{
@@ -140,7 +140,7 @@
}
static PHISTORY_BUFFER
-HistoryFindBuffer(PCONSOLE Console,
+HistoryFindBuffer(PCONSRV_CONSOLE Console,
PVOID ExeName,
USHORT ExeLength,
BOOLEAN UnicodeExe)
@@ -202,7 +202,7 @@
}
VOID
-HistoryDeleteBuffers(PCONSOLE Console)
+HistoryDeleteBuffers(PCONSRV_CONSOLE Console)
{
PLIST_ENTRY CurrentEntry;
PHISTORY_BUFFER HistoryBuffer;
@@ -216,7 +216,7 @@
}
static VOID
-LineInputSetPos(PCONSOLE Console, UINT Pos)
+LineInputSetPos(PCONSRV_CONSOLE Console, UINT Pos)
{
if (Pos != Console->LinePos && Console->InputBuffer.Mode &
ENABLE_ECHO_INPUT)
{
@@ -240,7 +240,7 @@
}
static VOID
-LineInputEdit(PCONSOLE Console, UINT NumToDelete, UINT NumToInsert, PWCHAR Insertion)
+LineInputEdit(PCONSRV_CONSOLE Console, UINT NumToDelete, UINT NumToInsert, PWCHAR
Insertion)
{
PTEXTMODE_SCREEN_BUFFER ActiveBuffer;
UINT Pos = Console->LinePos;
@@ -277,7 +277,7 @@
}
static VOID
-LineInputRecallHistory(PCONSOLE Console,
+LineInputRecallHistory(PCONSRV_CONSOLE Console,
PUNICODE_STRING ExeName,
INT Offset)
{
@@ -297,7 +297,7 @@
}
VOID
-LineInputKeyDown(PCONSOLE Console,
+LineInputKeyDown(PCONSRV_CONSOLE Console,
PUNICODE_STRING ExeName,
KEY_EVENT_RECORD *KeyEvent)
{
@@ -511,7 +511,7 @@
{
NTSTATUS Status;
PCONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCommandHistoryRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
ULONG BytesWritten = 0;
PHISTORY_BUFFER Hist;
@@ -599,7 +599,7 @@
{
NTSTATUS Status;
PCONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetCommandHistoryLengthRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PHISTORY_BUFFER Hist;
ULONG Length = 0;
UINT i;
@@ -641,7 +641,7 @@
{
NTSTATUS Status;
PCONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ExpungeCommandHistoryRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PHISTORY_BUFFER Hist;
if (!CsrValidateMessageBuffer(ApiMessage,
@@ -669,7 +669,7 @@
{
NTSTATUS Status;
PCONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHistoryNumberCommandsRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
PHISTORY_BUFFER Hist;
if (!CsrValidateMessageBuffer(ApiMessage,
@@ -720,7 +720,7 @@
{
#if 0 // Vista+
PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HistoryInfoRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
NTSTATUS Status =
ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console,
TRUE);
if (NT_SUCCESS(Status))
{
@@ -740,7 +740,7 @@
{
#if 0 // Vista+
PCONSOLE_GETSETHISTORYINFO HistoryInfoRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.HistoryInfoRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
NTSTATUS Status =
ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console,
TRUE);
if (NT_SUCCESS(Status))
{
@@ -760,7 +760,7 @@
{
NTSTATUS Status;
PCONSOLE_SETHISTORYMODE SetHistoryModeRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHistoryModeRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
DPRINT1("SrvSetConsoleCommandHistoryMode(Mode = %d) is not yet
implemented\n",
SetHistoryModeRequest->Mode);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/lineinput.h [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -8,9 +8,9 @@
#pragma once
-VOID HistoryDeleteBuffers(PCONSOLE Console);
+VOID HistoryDeleteBuffers(PCONSRV_CONSOLE Console);
VOID
-LineInputKeyDown(PCONSOLE Console,
+LineInputKeyDown(PCONSRV_CONSOLE Console,
PUNICODE_STRING ExeName,
KEY_EVENT_RECORD *KeyEvent);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/subsysreg.c [iso-8859-1] Thu Aug 14 20:23:03
2014
@@ -23,7 +23,7 @@
{
NTSTATUS Status;
PCONSOLE_REGISTERVDM RegisterVDMRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.RegisterVDMRequest;
- PCONSOLE Console;
+ PCONSRV_CONSOLE Console;
DPRINT1("SrvRegisterConsoleVDM(%d)\n",
RegisterVDMRequest->RegisterFlags);