mirror of
https://github.com/reactos/reactos.git
synced 2024-07-28 23:29:19 +00:00
[CONSRV]
Fix the initialization of screen buffers (concerning the cursor size). [KERNEL32] Fix almost all of the console winetests. Only 26 tests remain to be fixed, concerning principally WriteConsoleInputA/W and GetNumberOfConsoleInputEvents. svn path=/branches/ros-csrss/; revision=58448
This commit is contained in:
parent
818ee21a07
commit
7268b8776a
|
@ -776,7 +776,7 @@ GetStdHandle(DWORD nStdHandle)
|
|||
return Ppb->StandardError;
|
||||
}
|
||||
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
|
@ -1050,14 +1050,10 @@ GetNumberOfConsoleInputEvents(HANDLE hConsoleInput,
|
|||
{
|
||||
NTSTATUS Status;
|
||||
CONSOLE_API_MESSAGE ApiMessage;
|
||||
PCONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest = &ApiMessage.Data.GetNumInputEventsRequest;
|
||||
|
||||
if (lpNumberOfEvents == NULL)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ApiMessage.Data.GetNumInputEventsRequest.InputHandle = hConsoleInput;
|
||||
GetNumInputEventsRequest->InputHandle = hConsoleInput;
|
||||
GetNumInputEventsRequest->NumInputEvents = 0;
|
||||
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
NULL,
|
||||
|
@ -1069,7 +1065,13 @@ GetNumberOfConsoleInputEvents(HANDLE hConsoleInput,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
*lpNumberOfEvents = ApiMessage.Data.GetNumInputEventsRequest.NumInputEvents;
|
||||
if (lpNumberOfEvents == NULL)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_ACCESS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*lpNumberOfEvents = GetNumInputEventsRequest->NumInputEvents;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ IntReadConsoleOutput(HANDLE hConsoleOutput,
|
|||
sizeof(CONSOLE_READOUTPUT));
|
||||
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
||||
|
||||
/* Check for success*/
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(ApiMessage.Status))
|
||||
{
|
||||
/* Copy into the buffer */
|
||||
|
@ -305,6 +305,7 @@ IntReadConsoleOutputCode(HANDLE hConsoleOutput,
|
|||
LPDWORD lpNumberOfCodesRead)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
BOOL bRet = TRUE;
|
||||
CONSOLE_API_MESSAGE ApiMessage;
|
||||
PCONSOLE_READOUTPUTCODE ReadOutputCodeRequest = &ApiMessage.Data.ReadOutputCodeRequest;
|
||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||
|
@ -353,28 +354,38 @@ IntReadConsoleOutputCode(HANDLE hConsoleOutput,
|
|||
|
||||
ReadOutputCodeRequest->NumCodesToRead = nLength;
|
||||
|
||||
/* Call the server */
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
CaptureBuffer,
|
||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepReadConsoleOutputString),
|
||||
sizeof(CONSOLE_READOUTPUTCODE));
|
||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
||||
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(Status) || NT_SUCCESS(Status = ApiMessage.Status))
|
||||
{
|
||||
BaseSetLastNTError(Status);
|
||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||
return FALSE;
|
||||
BytesRead = ReadOutputCodeRequest->CodesRead * CodeSize;
|
||||
memcpy(pCode, ReadOutputCodeRequest->pCode.pCode, BytesRead);
|
||||
|
||||
// ReadOutputCodeRequest->ReadCoord = ReadOutputCodeRequest->EndCoord;
|
||||
|
||||
if (lpNumberOfCodesRead != NULL)
|
||||
*lpNumberOfCodesRead = ReadOutputCodeRequest->CodesRead;
|
||||
|
||||
bRet = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpNumberOfCodesRead != NULL)
|
||||
*lpNumberOfCodesRead = 0;
|
||||
|
||||
BytesRead = ReadOutputCodeRequest->CodesRead * CodeSize;
|
||||
memcpy(pCode, ReadOutputCodeRequest->pCode.pCode, BytesRead);
|
||||
|
||||
ReadOutputCodeRequest->ReadCoord = ReadOutputCodeRequest->EndCoord;
|
||||
|
||||
if (lpNumberOfCodesRead != NULL)
|
||||
*lpNumberOfCodesRead = ReadOutputCodeRequest->CodesRead;
|
||||
/* Error out */
|
||||
BaseSetLastNTError(Status /* ApiMessage.Status */);
|
||||
bRet = FALSE;
|
||||
}
|
||||
|
||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||
|
||||
return TRUE;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
|
@ -392,6 +403,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
|||
BOOL bUnicode)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
BOOL bRet = TRUE;
|
||||
CONSOLE_API_MESSAGE ApiMessage;
|
||||
PCONSOLE_WRITECONSOLE WriteConsoleRequest = &ApiMessage.Data.WriteConsoleRequest;
|
||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||
|
@ -423,48 +435,56 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
|||
WriteConsoleRequest->OutputHandle = hConsoleOutput;
|
||||
WriteConsoleRequest->Unicode = bUnicode;
|
||||
|
||||
// while (nNumberOfCharsToWrite > 0)
|
||||
{
|
||||
//// nChars = (USHORT)min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
|
||||
// nChars = nNumberOfCharsToWrite;
|
||||
// WriteConsoleRequest->NrCharactersToWrite = nChars;
|
||||
// while (nNumberOfCharsToWrite > 0) {
|
||||
//// nChars = (USHORT)min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
|
||||
// nChars = nNumberOfCharsToWrite;
|
||||
// WriteConsoleRequest->NrCharactersToWrite = nChars;
|
||||
|
||||
// SizeBytes = nChars * CharSize;
|
||||
// SizeBytes = nChars * CharSize;
|
||||
|
||||
// memcpy(WriteConsoleRequest->Buffer, lpBuffer, SizeBytes);
|
||||
// memcpy(WriteConsoleRequest->Buffer, lpBuffer, SizeBytes);
|
||||
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
CaptureBuffer,
|
||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsole),
|
||||
sizeof(CONSOLE_WRITECONSOLE));
|
||||
/* Call the server */
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
CaptureBuffer,
|
||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsole),
|
||||
sizeof(CONSOLE_WRITECONSOLE));
|
||||
/** FIXME: Added in 47359 for pausing
|
||||
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
WaitForSingleObject(WriteConsoleRequest->UnpauseEvent, INFINITE);
|
||||
CloseHandle(WriteConsoleRequest->UnpauseEvent);
|
||||
continue;
|
||||
}
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
WaitForSingleObject(WriteConsoleRequest->UnpauseEvent, INFINITE);
|
||||
CloseHandle(WriteConsoleRequest->UnpauseEvent);
|
||||
continue;
|
||||
}
|
||||
**/
|
||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
||||
{
|
||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||
BaseSetLastNTError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(Status) || NT_SUCCESS(Status = ApiMessage.Status))
|
||||
{
|
||||
// nNumberOfCharsToWrite -= nChars;
|
||||
// lpBuffer = (PVOID)((ULONG_PTR)lpBuffer + (ULONG_PTR)SizeBytes);
|
||||
// Written += WriteConsoleRequest->NrCharactersWritten;
|
||||
}
|
||||
// }
|
||||
|
||||
if (lpNumberOfCharsWritten != NULL)
|
||||
// *lpNumberOfCharsWritten = Written;
|
||||
*lpNumberOfCharsWritten = WriteConsoleRequest->NrCharactersWritten;
|
||||
if (lpNumberOfCharsWritten != NULL)
|
||||
// *lpNumberOfCharsWritten = Written;
|
||||
*lpNumberOfCharsWritten = WriteConsoleRequest->NrCharactersWritten;
|
||||
|
||||
bRet = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpNumberOfCharsWritten != NULL)
|
||||
*lpNumberOfCharsWritten = 0;
|
||||
|
||||
/* Error out */
|
||||
BaseSetLastNTError(Status /* ApiMessage.Status */);
|
||||
bRet = FALSE;
|
||||
}
|
||||
|
||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||
|
||||
return TRUE;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
|
@ -518,7 +538,7 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
|
|||
sizeof(CONSOLE_WRITEINPUT));
|
||||
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
||||
|
||||
/* Check for success*/
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(ApiMessage.Status))
|
||||
{
|
||||
/* Return the number of events read */
|
||||
|
@ -597,7 +617,7 @@ IntWriteConsoleOutput(HANDLE hConsoleOutput,
|
|||
sizeof(CONSOLE_WRITEOUTPUT));
|
||||
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
||||
|
||||
/* Check for success*/
|
||||
/* Check for success */
|
||||
if (!NT_SUCCESS(ApiMessage.Status))
|
||||
{
|
||||
/* Error out */
|
||||
|
@ -626,6 +646,7 @@ IntWriteConsoleOutputCode(HANDLE hConsoleOutput,
|
|||
LPDWORD lpNumberOfCodesWritten)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
BOOL bRet = TRUE;
|
||||
CONSOLE_API_MESSAGE ApiMessage;
|
||||
PCONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest = &ApiMessage.Data.WriteOutputCodeRequest;
|
||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||
|
@ -685,44 +706,46 @@ IntWriteConsoleOutputCode(HANDLE hConsoleOutput,
|
|||
WriteOutputCodeRequest->CodeType = CodeType;
|
||||
WriteOutputCodeRequest->Coord = dwWriteCoord;
|
||||
|
||||
/**
|
||||
** TODO: HACK: Surely it has to go into CONSRV !!
|
||||
**/
|
||||
// while (nLength > 0)
|
||||
WriteOutputCodeRequest->Length = nLength; // (WORD)min(nLength, nChars);
|
||||
// BytesWrite = WriteOutputCodeRequest->Length * CodeSize;
|
||||
|
||||
// memcpy(WriteOutputCodeRequest->pCode.pCode, pCode, BytesWrite);
|
||||
|
||||
/* Call the server */
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
CaptureBuffer,
|
||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutputString),
|
||||
sizeof(CONSOLE_WRITEOUTPUTCODE));
|
||||
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(Status) || NT_SUCCESS(Status = ApiMessage.Status))
|
||||
{
|
||||
// DWORD BytesWrite;
|
||||
|
||||
WriteOutputCodeRequest->Length = nLength; // (WORD)min(nLength, nChars);
|
||||
// BytesWrite = WriteOutputCodeRequest->Length * CodeSize;
|
||||
|
||||
// memcpy(WriteOutputCodeRequest->pCode.pCode, pCode, BytesWrite);
|
||||
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
CaptureBuffer,
|
||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutputString),
|
||||
sizeof(CONSOLE_WRITEOUTPUTCODE));
|
||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
||||
{
|
||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||
BaseSetLastNTError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// nLength -= WriteOutputCodeRequest->NrCharactersWritten;
|
||||
// pCode = (PVOID)((ULONG_PTR)pCode + /*(ULONG_PTR)(*/WriteOutputCodeRequest->NrCharactersWritten * CodeSize/*)*/);
|
||||
// Written += WriteOutputCodeRequest->NrCharactersWritten;
|
||||
|
||||
WriteOutputCodeRequest->Coord = WriteOutputCodeRequest->EndCoord;
|
||||
}
|
||||
// WriteOutputCodeRequest->Coord = WriteOutputCodeRequest->EndCoord;
|
||||
|
||||
if (lpNumberOfCodesWritten != NULL)
|
||||
// *lpNumberOfCodesWritten = Written;
|
||||
// *lpNumberOfCodesWritten = WriteOutputCodeRequest->NrCharactersWritten;
|
||||
*lpNumberOfCodesWritten = WriteOutputCodeRequest->Length;
|
||||
if (lpNumberOfCodesWritten != NULL)
|
||||
// *lpNumberOfCodesWritten = Written;
|
||||
// *lpNumberOfCodesWritten = WriteOutputCodeRequest->NrCharactersWritten;
|
||||
*lpNumberOfCodesWritten = WriteOutputCodeRequest->Length;
|
||||
|
||||
bRet = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpNumberOfCodesWritten != NULL)
|
||||
*lpNumberOfCodesWritten = 0;
|
||||
|
||||
/* Error out */
|
||||
BaseSetLastNTError(Status /* ApiMessage.Status */);
|
||||
bRet = FALSE;
|
||||
}
|
||||
|
||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||
|
||||
return TRUE;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
|
@ -761,24 +784,33 @@ IntFillConsoleOutputCode(HANDLE hConsoleOutput,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* Set up the data to send to the Console Server */
|
||||
FillOutputRequest->Coord = dwWriteCoord;
|
||||
FillOutputRequest->Length = nLength;
|
||||
|
||||
/* Call the server */
|
||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||
NULL,
|
||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFillConsoleOutput),
|
||||
sizeof(CONSOLE_FILLOUTPUTCODE));
|
||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
||||
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(ApiMessage.Status))
|
||||
{
|
||||
if (lpNumberOfCodesWritten != NULL)
|
||||
*lpNumberOfCodesWritten = FillOutputRequest->Length;
|
||||
// *lpNumberOfCodesWritten = Request.Data.FillOutputRequest.NrCharactersWritten;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpNumberOfCodesWritten != NULL)
|
||||
*lpNumberOfCodesWritten = 0;
|
||||
|
||||
BaseSetLastNTError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (lpNumberOfCodesWritten)
|
||||
*lpNumberOfCodesWritten = FillOutputRequest->Length;
|
||||
// *lpNumberOfCodesWritten = Request.Data.FillOutputRequest.NrCharactersWritten;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -857,7 +857,7 @@ CSR_API(SrvGetConsoleNumberOfInputEvents)
|
|||
if (!NT_SUCCESS(Status)) return Status;
|
||||
|
||||
CurrentInput = InputBuffer->InputEvents.Flink;
|
||||
NumEvents = 0;
|
||||
/* GetNumInputEventsRequest->NumInputEvents = */ NumEvents = 0;
|
||||
|
||||
/* If there are any events ... */
|
||||
while (CurrentInput != &InputBuffer->InputEvents)
|
||||
|
|
|
@ -275,7 +275,9 @@ NTSTATUS FASTCALL ConSrvCreateScreenBuffer(IN OUT PCONSOLE Console,
|
|||
OUT PCONSOLE_SCREEN_BUFFER* Buffer,
|
||||
IN COORD ScreenBufferSize,
|
||||
IN USHORT ScreenAttrib,
|
||||
IN USHORT PopupAttrib);
|
||||
IN USHORT PopupAttrib,
|
||||
IN BOOLEAN IsCursorVisible,
|
||||
IN ULONG CursorSize);
|
||||
VOID WINAPI ConioDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer);
|
||||
DWORD FASTCALL ConioEffectiveCursorSize(PCONSOLE Console, DWORD Scale);
|
||||
|
||||
|
|
|
@ -64,7 +64,9 @@ ConSrvCreateScreenBuffer(IN OUT PCONSOLE Console,
|
|||
OUT PCONSOLE_SCREEN_BUFFER* Buffer,
|
||||
IN COORD ScreenBufferSize,
|
||||
IN USHORT ScreenAttrib,
|
||||
IN USHORT PopupAttrib)
|
||||
IN USHORT PopupAttrib,
|
||||
IN BOOLEAN IsCursorVisible,
|
||||
IN ULONG CursorSize)
|
||||
{
|
||||
if (Console == NULL || Buffer == NULL)
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
@ -91,9 +93,8 @@ ConSrvCreateScreenBuffer(IN OUT PCONSOLE Console,
|
|||
(*Buffer)->ShowY = 0;
|
||||
(*Buffer)->VirtualY = 0;
|
||||
|
||||
// FIXME: !!
|
||||
(*Buffer)->CursorInfo.bVisible = TRUE;
|
||||
// (*Buffer)->CursorInfo.dwSize = ConsoleInfo->CursorSize;
|
||||
(*Buffer)->CursorInfo.bVisible = (IsCursorVisible && (CursorSize > 0));
|
||||
(*Buffer)->CursorInfo.dwSize = min(max(CursorSize, 1), 100);
|
||||
|
||||
(*Buffer)->ScreenDefaultAttrib = ScreenAttrib;
|
||||
(*Buffer)->PopupDefaultAttrib = PopupAttrib;
|
||||
|
@ -1035,8 +1036,8 @@ CSR_API(SrvWriteConsoleOutputString)
|
|||
ConioDrawRegion(Console, &UpdateRect);
|
||||
}
|
||||
|
||||
WriteOutputCodeRequest->EndCoord.X = X;
|
||||
WriteOutputCodeRequest->EndCoord.Y = (Y + Buff->ScreenBufferSize.Y - Buff->VirtualY) % Buff->ScreenBufferSize.Y;
|
||||
// WriteOutputCodeRequest->EndCoord.X = X;
|
||||
// WriteOutputCodeRequest->EndCoord.Y = (Y + Buff->ScreenBufferSize.Y - Buff->VirtualY) % Buff->ScreenBufferSize.Y;
|
||||
}
|
||||
|
||||
if (tmpString)
|
||||
|
@ -1269,9 +1270,11 @@ CSR_API(SrvCreateConsoleScreenBuffer)
|
|||
PCONSOLE Console;
|
||||
PCONSOLE_SCREEN_BUFFER Buff;
|
||||
|
||||
COORD ScreenBufferSize = (COORD){80, 25};
|
||||
USHORT ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
|
||||
USHORT PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
||||
COORD ScreenBufferSize = (COORD){80, 25};
|
||||
USHORT ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
|
||||
USHORT PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
||||
BOOLEAN IsCursorVisible = TRUE;
|
||||
ULONG CursorSize = CSR_DEFAULT_CURSOR_SIZE;
|
||||
|
||||
DPRINT("SrvCreateConsoleScreenBuffer\n");
|
||||
|
||||
|
@ -1292,20 +1295,18 @@ CSR_API(SrvCreateConsoleScreenBuffer)
|
|||
|
||||
ScreenAttrib = Console->ActiveBuffer->ScreenDefaultAttrib;
|
||||
PopupAttrib = Console->ActiveBuffer->PopupDefaultAttrib;
|
||||
// Buff->CursorInfo.bVisible = Console->ActiveBuffer->CursorInfo.bVisible;
|
||||
// Buff->CursorInfo.dwSize = Console->ActiveBuffer->CursorInfo.dwSize;
|
||||
|
||||
IsCursorVisible = Console->ActiveBuffer->CursorInfo.bVisible;
|
||||
CursorSize = Console->ActiveBuffer->CursorInfo.dwSize;
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// Buff->CursorInfo.bVisible = TRUE;
|
||||
// Buff->CursorInfo.dwSize = CSR_DEFAULT_CURSOR_SIZE;
|
||||
// }
|
||||
|
||||
Status = ConSrvCreateScreenBuffer(Console,
|
||||
&Buff,
|
||||
ScreenBufferSize,
|
||||
ScreenAttrib,
|
||||
PopupAttrib);
|
||||
PopupAttrib,
|
||||
IsCursorVisible,
|
||||
CursorSize);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Status = ConSrvInsertObject(ProcessData,
|
||||
|
|
|
@ -365,7 +365,9 @@ ConSrvInitConsole(OUT PCONSOLE* NewConsole,
|
|||
&NewBuffer,
|
||||
ConsoleInfo.ScreenBufferSize,
|
||||
ConsoleInfo.ScreenAttrib,
|
||||
ConsoleInfo.PopupAttrib);
|
||||
ConsoleInfo.PopupAttrib,
|
||||
TRUE,
|
||||
ConsoleInfo.CursorSize);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("ConSrvCreateScreenBuffer: failed, Status = 0x%08lx\n", Status);
|
||||
|
|
|
@ -464,7 +464,8 @@ GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData,
|
|||
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.dwSize = min(max(pConInfo->ci.CursorSize, 1), 100);
|
||||
ActiveBuffer->CursorInfo.bVisible = (pConInfo->ci.CursorSize > 0);
|
||||
ActiveBuffer->CursorInfo.dwSize = min(max(pConInfo->ci.CursorSize, 1), 100);
|
||||
|
||||
if (pConInfo->ci.ConsoleSize.X != Console->Size.X ||
|
||||
pConInfo->ci.ConsoleSize.Y != Console->Size.Y)
|
||||
|
|
|
@ -446,7 +446,7 @@ ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
|
|||
|
||||
ConsoleInfo->CursorBlinkOn;
|
||||
ConsoleInfo->ForceCursorOff;
|
||||
ConsoleInfo->CursorSize = CSR_DEFAULT_CURSOR_SIZE; // 0; #define SMALL_SIZE 25 // large enough to be one pixel on a six pixel font
|
||||
ConsoleInfo->CursorSize = CSR_DEFAULT_CURSOR_SIZE; // #define SMALL_SIZE 25
|
||||
|
||||
ConsoleInfo->ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
|
||||
ConsoleInfo->PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
||||
|
@ -473,13 +473,6 @@ ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
|
|||
ConsoleInfo->u.GuiInfo.AutoPosition = TRUE;
|
||||
ConsoleInfo->u.GuiInfo.WindowOrigin = (POINT){0, 0};
|
||||
|
||||
// if (Console->ActiveBuffer)
|
||||
// {
|
||||
// Console->ActiveBuffer->ScreenBufferSize.X = 80;
|
||||
// Console->ActiveBuffer->ScreenBufferSize.Y = 300;
|
||||
// Console->ActiveBuffer->CursorInfo.bVisible = TRUE;
|
||||
// }
|
||||
|
||||
/*
|
||||
* 2. Overwrite them with the ones stored in HKCU\Console.
|
||||
* If the HKCU\Console key doesn't exist, create it
|
||||
|
|
Loading…
Reference in a new issue