Author: hbelusca
Date: Sun Mar 10 02:23:46 2013
New Revision: 58459
URL:
http://svn.reactos.org/svn/reactos?rev=58459&view=rev
Log:
[CONSOLE.DLL-CONSRV]
Fix cursor size.
Modified:
branches/ros-csrss/dll/cpl/console/console.c
branches/ros-csrss/dll/cpl/console/options.c
branches/ros-csrss/win32ss/user/consrv/conoutput.c
branches/ros-csrss/win32ss/user/consrv/guiconsole.c
branches/ros-csrss/win32ss/user/consrv/settings.c
Modified: branches/ros-csrss/dll/cpl/console/console.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/cpl/console/conso…
==============================================================================
--- branches/ros-csrss/dll/cpl/console/console.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/cpl/console/console.c [iso-8859-1] Sun Mar 10 02:23:46 2013
@@ -52,6 +52,8 @@
#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)
+/* Cursor size */
+#define CSR_DEFAULT_CURSOR_SIZE 25
static VOID
InitPropSheetPage(PROPSHEETPAGE *psp,
@@ -84,12 +86,12 @@
pConInfo->ci.FullScreen = FALSE;
pConInfo->ci.QuickEdit = FALSE;
pConInfo->ci.InsertMode = TRUE;
- pConInfo->ci.InputBufferSize;
+ // pConInfo->ci.InputBufferSize;
pConInfo->ci.ScreenBufferSize = (COORD){80, 300};
pConInfo->ci.ConsoleSize = (COORD){80, 25};
pConInfo->ci.CursorBlinkOn = TRUE;
pConInfo->ci.ForceCursorOff = FALSE;
- pConInfo->ci.CursorSize = 0;
+ pConInfo->ci.CursorSize = CSR_DEFAULT_CURSOR_SIZE;
pConInfo->ci.ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
pConInfo->ci.PopupAttrib = DEFAULT_POPUP_ATTRIB;
pConInfo->ci.CodePage = 0;
Modified: branches/ros-csrss/dll/cpl/console/options.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/cpl/console/optio…
==============================================================================
--- branches/ros-csrss/dll/cpl/console/options.c [iso-8859-1] (original)
+++ branches/ros-csrss/dll/cpl/console/options.c [iso-8859-1] Sun Mar 10 02:23:46 2013
@@ -76,7 +76,7 @@
{
case IDC_RADIO_SMALL_CURSOR:
{
- pConInfo->ci.CursorSize = 0;
+ pConInfo->ci.CursorSize = 25;
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
break;
}
@@ -172,7 +172,7 @@
TCHAR szBuffer[MAX_PATH];
/* Update cursor size */
- if (pConInfo->ci.CursorSize == 0)
+ if (pConInfo->ci.CursorSize <= 25)
{
/* Small cursor */
hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR);
@@ -183,7 +183,7 @@
hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR);
SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0);
}
- else if (pConInfo->ci.CursorSize == 50)
+ else if (pConInfo->ci.CursorSize <= 50)
{
hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR);
SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
@@ -193,7 +193,7 @@
hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR);
SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0);
}
- else if (pConInfo->ci.CursorSize == 100)
+ else /* if (pConInfo->ci.CursorSize <= 100) */
{
hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR);
SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Mar 10 02:23:46
2013
@@ -93,8 +93,8 @@
(*Buffer)->ShowY = 0;
(*Buffer)->VirtualY = 0;
- (*Buffer)->CursorInfo.bVisible = (IsCursorVisible && (CursorSize >
0));
- (*Buffer)->CursorInfo.dwSize = min(max(CursorSize, 1), 100);
+ (*Buffer)->CursorInfo.bVisible = (IsCursorVisible && (CursorSize != 0));
+ (*Buffer)->CursorInfo.dwSize = min(max(CursorSize, 0), 100);
(*Buffer)->ScreenDefaultAttrib = ScreenAttrib;
(*Buffer)->PopupDefaultAttrib = PopupAttrib;
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] Sun Mar 10 02:23:46
2013
@@ -464,8 +464,8 @@
memcpy(Console->Colors, pConInfo->ci.Colors, sizeof(s_Colors)); // FIXME:
Possible buffer overflow if s_colors is bigger than pConInfo->Colors.
/* Apply cursor size */
- ActiveBuffer->CursorInfo.bVisible = (pConInfo->ci.CursorSize > 0);
- ActiveBuffer->CursorInfo.dwSize = min(max(pConInfo->ci.CursorSize, 1), 100);
+ ActiveBuffer->CursorInfo.bVisible = (pConInfo->ci.CursorSize != 0);
+ ActiveBuffer->CursorInfo.dwSize = min(max(pConInfo->ci.CursorSize, 0), 100);
if (pConInfo->ci.ConsoleSize.X != Console->Size.X ||
pConInfo->ci.ConsoleSize.Y != Console->Size.Y)
Modified: branches/ros-csrss/win32ss/user/consrv/settings.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/settings.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/settings.c [iso-8859-1] Sun Mar 10 02:23:46
2013
@@ -289,10 +289,7 @@
}
else if (!wcscmp(szValueName, L"CursorSize"))
{
- if ( (Value == 0) || (Value == 50) || (Value == 100) )
- {
- ConsoleInfo->CursorSize = Value;
- }
+ ConsoleInfo->CursorSize = min(max(Value, 0), 100);
}
else if (!wcscmp(szValueName, L"ScreenColors"))
{