mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 03:44:43 +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
8 changed files with 151 additions and 118 deletions
|
@ -776,7 +776,7 @@ GetStdHandle(DWORD nStdHandle)
|
||||||
return Ppb->StandardError;
|
return Ppb->StandardError;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1050,14 +1050,10 @@ GetNumberOfConsoleInputEvents(HANDLE hConsoleInput,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
CONSOLE_API_MESSAGE ApiMessage;
|
CONSOLE_API_MESSAGE ApiMessage;
|
||||||
|
PCONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest = &ApiMessage.Data.GetNumInputEventsRequest;
|
||||||
|
|
||||||
if (lpNumberOfEvents == NULL)
|
GetNumInputEventsRequest->InputHandle = hConsoleInput;
|
||||||
{
|
GetNumInputEventsRequest->NumInputEvents = 0;
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ApiMessage.Data.GetNumInputEventsRequest.InputHandle = hConsoleInput;
|
|
||||||
|
|
||||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1069,7 +1065,13 @@ GetNumberOfConsoleInputEvents(HANDLE hConsoleInput,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
*lpNumberOfEvents = ApiMessage.Data.GetNumInputEventsRequest.NumInputEvents;
|
if (lpNumberOfEvents == NULL)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_ACCESS);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*lpNumberOfEvents = GetNumInputEventsRequest->NumInputEvents;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ IntReadConsoleOutput(HANDLE hConsoleOutput,
|
||||||
sizeof(CONSOLE_READOUTPUT));
|
sizeof(CONSOLE_READOUTPUT));
|
||||||
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success */
|
||||||
if (NT_SUCCESS(ApiMessage.Status))
|
if (NT_SUCCESS(ApiMessage.Status))
|
||||||
{
|
{
|
||||||
/* Copy into the buffer */
|
/* Copy into the buffer */
|
||||||
|
@ -305,6 +305,7 @@ IntReadConsoleOutputCode(HANDLE hConsoleOutput,
|
||||||
LPDWORD lpNumberOfCodesRead)
|
LPDWORD lpNumberOfCodesRead)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
BOOL bRet = TRUE;
|
||||||
CONSOLE_API_MESSAGE ApiMessage;
|
CONSOLE_API_MESSAGE ApiMessage;
|
||||||
PCONSOLE_READOUTPUTCODE ReadOutputCodeRequest = &ApiMessage.Data.ReadOutputCodeRequest;
|
PCONSOLE_READOUTPUTCODE ReadOutputCodeRequest = &ApiMessage.Data.ReadOutputCodeRequest;
|
||||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
|
@ -353,28 +354,38 @@ IntReadConsoleOutputCode(HANDLE hConsoleOutput,
|
||||||
|
|
||||||
ReadOutputCodeRequest->NumCodesToRead = nLength;
|
ReadOutputCodeRequest->NumCodesToRead = nLength;
|
||||||
|
|
||||||
|
/* Call the server */
|
||||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepReadConsoleOutputString),
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepReadConsoleOutputString),
|
||||||
sizeof(CONSOLE_READOUTPUTCODE));
|
sizeof(CONSOLE_READOUTPUTCODE));
|
||||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
|
||||||
{
|
|
||||||
BaseSetLastNTError(Status);
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Check for success */
|
||||||
|
if (NT_SUCCESS(Status) || NT_SUCCESS(Status = ApiMessage.Status))
|
||||||
|
{
|
||||||
BytesRead = ReadOutputCodeRequest->CodesRead * CodeSize;
|
BytesRead = ReadOutputCodeRequest->CodesRead * CodeSize;
|
||||||
memcpy(pCode, ReadOutputCodeRequest->pCode.pCode, BytesRead);
|
memcpy(pCode, ReadOutputCodeRequest->pCode.pCode, BytesRead);
|
||||||
|
|
||||||
ReadOutputCodeRequest->ReadCoord = ReadOutputCodeRequest->EndCoord;
|
// ReadOutputCodeRequest->ReadCoord = ReadOutputCodeRequest->EndCoord;
|
||||||
|
|
||||||
if (lpNumberOfCodesRead != NULL)
|
if (lpNumberOfCodesRead != NULL)
|
||||||
*lpNumberOfCodesRead = ReadOutputCodeRequest->CodesRead;
|
*lpNumberOfCodesRead = ReadOutputCodeRequest->CodesRead;
|
||||||
|
|
||||||
|
bRet = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (lpNumberOfCodesRead != NULL)
|
||||||
|
*lpNumberOfCodesRead = 0;
|
||||||
|
|
||||||
|
/* Error out */
|
||||||
|
BaseSetLastNTError(Status /* ApiMessage.Status */);
|
||||||
|
bRet = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
return TRUE;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -392,6 +403,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
||||||
BOOL bUnicode)
|
BOOL bUnicode)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
BOOL bRet = TRUE;
|
||||||
CONSOLE_API_MESSAGE ApiMessage;
|
CONSOLE_API_MESSAGE ApiMessage;
|
||||||
PCONSOLE_WRITECONSOLE WriteConsoleRequest = &ApiMessage.Data.WriteConsoleRequest;
|
PCONSOLE_WRITECONSOLE WriteConsoleRequest = &ApiMessage.Data.WriteConsoleRequest;
|
||||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
|
@ -423,8 +435,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
||||||
WriteConsoleRequest->OutputHandle = hConsoleOutput;
|
WriteConsoleRequest->OutputHandle = hConsoleOutput;
|
||||||
WriteConsoleRequest->Unicode = bUnicode;
|
WriteConsoleRequest->Unicode = bUnicode;
|
||||||
|
|
||||||
// while (nNumberOfCharsToWrite > 0)
|
// while (nNumberOfCharsToWrite > 0) {
|
||||||
{
|
|
||||||
//// nChars = (USHORT)min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
|
//// nChars = (USHORT)min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
|
||||||
// nChars = nNumberOfCharsToWrite;
|
// nChars = nNumberOfCharsToWrite;
|
||||||
// WriteConsoleRequest->NrCharactersToWrite = nChars;
|
// WriteConsoleRequest->NrCharactersToWrite = nChars;
|
||||||
|
@ -433,6 +444,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
||||||
|
|
||||||
// memcpy(WriteConsoleRequest->Buffer, lpBuffer, SizeBytes);
|
// memcpy(WriteConsoleRequest->Buffer, lpBuffer, SizeBytes);
|
||||||
|
|
||||||
|
/* Call the server */
|
||||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsole),
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsole),
|
||||||
|
@ -446,25 +458,33 @@ IntWriteConsole(HANDLE hConsoleOutput,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
/* Check for success */
|
||||||
|
if (NT_SUCCESS(Status) || NT_SUCCESS(Status = ApiMessage.Status))
|
||||||
{
|
{
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
|
||||||
BaseSetLastNTError(Status);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// nNumberOfCharsToWrite -= nChars;
|
// nNumberOfCharsToWrite -= nChars;
|
||||||
// lpBuffer = (PVOID)((ULONG_PTR)lpBuffer + (ULONG_PTR)SizeBytes);
|
// lpBuffer = (PVOID)((ULONG_PTR)lpBuffer + (ULONG_PTR)SizeBytes);
|
||||||
// Written += WriteConsoleRequest->NrCharactersWritten;
|
// Written += WriteConsoleRequest->NrCharactersWritten;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (lpNumberOfCharsWritten != NULL)
|
if (lpNumberOfCharsWritten != NULL)
|
||||||
// *lpNumberOfCharsWritten = Written;
|
// *lpNumberOfCharsWritten = Written;
|
||||||
*lpNumberOfCharsWritten = WriteConsoleRequest->NrCharactersWritten;
|
*lpNumberOfCharsWritten = WriteConsoleRequest->NrCharactersWritten;
|
||||||
|
|
||||||
|
bRet = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (lpNumberOfCharsWritten != NULL)
|
||||||
|
*lpNumberOfCharsWritten = 0;
|
||||||
|
|
||||||
|
/* Error out */
|
||||||
|
BaseSetLastNTError(Status /* ApiMessage.Status */);
|
||||||
|
bRet = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
return TRUE;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -518,7 +538,7 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
|
||||||
sizeof(CONSOLE_WRITEINPUT));
|
sizeof(CONSOLE_WRITEINPUT));
|
||||||
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success */
|
||||||
if (NT_SUCCESS(ApiMessage.Status))
|
if (NT_SUCCESS(ApiMessage.Status))
|
||||||
{
|
{
|
||||||
/* Return the number of events read */
|
/* Return the number of events read */
|
||||||
|
@ -597,7 +617,7 @@ IntWriteConsoleOutput(HANDLE hConsoleOutput,
|
||||||
sizeof(CONSOLE_WRITEOUTPUT));
|
sizeof(CONSOLE_WRITEOUTPUT));
|
||||||
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
DPRINT("Server returned: %x\n", ApiMessage.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success */
|
||||||
if (!NT_SUCCESS(ApiMessage.Status))
|
if (!NT_SUCCESS(ApiMessage.Status))
|
||||||
{
|
{
|
||||||
/* Error out */
|
/* Error out */
|
||||||
|
@ -626,6 +646,7 @@ IntWriteConsoleOutputCode(HANDLE hConsoleOutput,
|
||||||
LPDWORD lpNumberOfCodesWritten)
|
LPDWORD lpNumberOfCodesWritten)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
BOOL bRet = TRUE;
|
||||||
CONSOLE_API_MESSAGE ApiMessage;
|
CONSOLE_API_MESSAGE ApiMessage;
|
||||||
PCONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest = &ApiMessage.Data.WriteOutputCodeRequest;
|
PCONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest = &ApiMessage.Data.WriteOutputCodeRequest;
|
||||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
|
@ -685,44 +706,46 @@ IntWriteConsoleOutputCode(HANDLE hConsoleOutput,
|
||||||
WriteOutputCodeRequest->CodeType = CodeType;
|
WriteOutputCodeRequest->CodeType = CodeType;
|
||||||
WriteOutputCodeRequest->Coord = dwWriteCoord;
|
WriteOutputCodeRequest->Coord = dwWriteCoord;
|
||||||
|
|
||||||
/**
|
|
||||||
** TODO: HACK: Surely it has to go into CONSRV !!
|
|
||||||
**/
|
|
||||||
// while (nLength > 0)
|
|
||||||
{
|
|
||||||
// DWORD BytesWrite;
|
|
||||||
|
|
||||||
WriteOutputCodeRequest->Length = nLength; // (WORD)min(nLength, nChars);
|
WriteOutputCodeRequest->Length = nLength; // (WORD)min(nLength, nChars);
|
||||||
// BytesWrite = WriteOutputCodeRequest->Length * CodeSize;
|
// BytesWrite = WriteOutputCodeRequest->Length * CodeSize;
|
||||||
|
|
||||||
// memcpy(WriteOutputCodeRequest->pCode.pCode, pCode, BytesWrite);
|
// memcpy(WriteOutputCodeRequest->pCode.pCode, pCode, BytesWrite);
|
||||||
|
|
||||||
|
/* Call the server */
|
||||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutputString),
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutputString),
|
||||||
sizeof(CONSOLE_WRITEOUTPUTCODE));
|
sizeof(CONSOLE_WRITEOUTPUTCODE));
|
||||||
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))
|
||||||
|
{
|
||||||
// nLength -= WriteOutputCodeRequest->NrCharactersWritten;
|
// nLength -= WriteOutputCodeRequest->NrCharactersWritten;
|
||||||
// pCode = (PVOID)((ULONG_PTR)pCode + /*(ULONG_PTR)(*/WriteOutputCodeRequest->NrCharactersWritten * CodeSize/*)*/);
|
// pCode = (PVOID)((ULONG_PTR)pCode + /*(ULONG_PTR)(*/WriteOutputCodeRequest->NrCharactersWritten * CodeSize/*)*/);
|
||||||
// Written += WriteOutputCodeRequest->NrCharactersWritten;
|
// Written += WriteOutputCodeRequest->NrCharactersWritten;
|
||||||
|
|
||||||
WriteOutputCodeRequest->Coord = WriteOutputCodeRequest->EndCoord;
|
// WriteOutputCodeRequest->Coord = WriteOutputCodeRequest->EndCoord;
|
||||||
}
|
|
||||||
|
|
||||||
if (lpNumberOfCodesWritten != NULL)
|
if (lpNumberOfCodesWritten != NULL)
|
||||||
// *lpNumberOfCodesWritten = Written;
|
// *lpNumberOfCodesWritten = Written;
|
||||||
// *lpNumberOfCodesWritten = WriteOutputCodeRequest->NrCharactersWritten;
|
// *lpNumberOfCodesWritten = WriteOutputCodeRequest->NrCharactersWritten;
|
||||||
*lpNumberOfCodesWritten = WriteOutputCodeRequest->Length;
|
*lpNumberOfCodesWritten = WriteOutputCodeRequest->Length;
|
||||||
|
|
||||||
|
bRet = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (lpNumberOfCodesWritten != NULL)
|
||||||
|
*lpNumberOfCodesWritten = 0;
|
||||||
|
|
||||||
|
/* Error out */
|
||||||
|
BaseSetLastNTError(Status /* ApiMessage.Status */);
|
||||||
|
bRet = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
return TRUE;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -761,24 +784,33 @@ IntFillConsoleOutputCode(HANDLE hConsoleOutput,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set up the data to send to the Console Server */
|
||||||
FillOutputRequest->Coord = dwWriteCoord;
|
FillOutputRequest->Coord = dwWriteCoord;
|
||||||
FillOutputRequest->Length = nLength;
|
FillOutputRequest->Length = nLength;
|
||||||
|
|
||||||
|
/* Call the server */
|
||||||
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
|
||||||
NULL,
|
NULL,
|
||||||
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFillConsoleOutput),
|
CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFillConsoleOutput),
|
||||||
sizeof(CONSOLE_FILLOUTPUTCODE));
|
sizeof(CONSOLE_FILLOUTPUTCODE));
|
||||||
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status))
|
|
||||||
{
|
|
||||||
BaseSetLastNTError(Status);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lpNumberOfCodesWritten)
|
/* Check for success */
|
||||||
|
if (NT_SUCCESS(ApiMessage.Status))
|
||||||
|
{
|
||||||
|
if (lpNumberOfCodesWritten != NULL)
|
||||||
*lpNumberOfCodesWritten = FillOutputRequest->Length;
|
*lpNumberOfCodesWritten = FillOutputRequest->Length;
|
||||||
// *lpNumberOfCodesWritten = Request.Data.FillOutputRequest.NrCharactersWritten;
|
// *lpNumberOfCodesWritten = Request.Data.FillOutputRequest.NrCharactersWritten;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (lpNumberOfCodesWritten != NULL)
|
||||||
|
*lpNumberOfCodesWritten = 0;
|
||||||
|
|
||||||
|
BaseSetLastNTError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -857,7 +857,7 @@ CSR_API(SrvGetConsoleNumberOfInputEvents)
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
CurrentInput = InputBuffer->InputEvents.Flink;
|
CurrentInput = InputBuffer->InputEvents.Flink;
|
||||||
NumEvents = 0;
|
/* GetNumInputEventsRequest->NumInputEvents = */ NumEvents = 0;
|
||||||
|
|
||||||
/* If there are any events ... */
|
/* If there are any events ... */
|
||||||
while (CurrentInput != &InputBuffer->InputEvents)
|
while (CurrentInput != &InputBuffer->InputEvents)
|
||||||
|
|
|
@ -275,7 +275,9 @@ NTSTATUS FASTCALL ConSrvCreateScreenBuffer(IN OUT PCONSOLE Console,
|
||||||
OUT PCONSOLE_SCREEN_BUFFER* Buffer,
|
OUT PCONSOLE_SCREEN_BUFFER* Buffer,
|
||||||
IN COORD ScreenBufferSize,
|
IN COORD ScreenBufferSize,
|
||||||
IN USHORT ScreenAttrib,
|
IN USHORT ScreenAttrib,
|
||||||
IN USHORT PopupAttrib);
|
IN USHORT PopupAttrib,
|
||||||
|
IN BOOLEAN IsCursorVisible,
|
||||||
|
IN ULONG CursorSize);
|
||||||
VOID WINAPI ConioDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer);
|
VOID WINAPI ConioDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer);
|
||||||
DWORD FASTCALL ConioEffectiveCursorSize(PCONSOLE Console, DWORD Scale);
|
DWORD FASTCALL ConioEffectiveCursorSize(PCONSOLE Console, DWORD Scale);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,9 @@ ConSrvCreateScreenBuffer(IN OUT PCONSOLE Console,
|
||||||
OUT PCONSOLE_SCREEN_BUFFER* Buffer,
|
OUT PCONSOLE_SCREEN_BUFFER* Buffer,
|
||||||
IN COORD ScreenBufferSize,
|
IN COORD ScreenBufferSize,
|
||||||
IN USHORT ScreenAttrib,
|
IN USHORT ScreenAttrib,
|
||||||
IN USHORT PopupAttrib)
|
IN USHORT PopupAttrib,
|
||||||
|
IN BOOLEAN IsCursorVisible,
|
||||||
|
IN ULONG CursorSize)
|
||||||
{
|
{
|
||||||
if (Console == NULL || Buffer == NULL)
|
if (Console == NULL || Buffer == NULL)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
@ -91,9 +93,8 @@ ConSrvCreateScreenBuffer(IN OUT PCONSOLE Console,
|
||||||
(*Buffer)->ShowY = 0;
|
(*Buffer)->ShowY = 0;
|
||||||
(*Buffer)->VirtualY = 0;
|
(*Buffer)->VirtualY = 0;
|
||||||
|
|
||||||
// FIXME: !!
|
(*Buffer)->CursorInfo.bVisible = (IsCursorVisible && (CursorSize > 0));
|
||||||
(*Buffer)->CursorInfo.bVisible = TRUE;
|
(*Buffer)->CursorInfo.dwSize = min(max(CursorSize, 1), 100);
|
||||||
// (*Buffer)->CursorInfo.dwSize = ConsoleInfo->CursorSize;
|
|
||||||
|
|
||||||
(*Buffer)->ScreenDefaultAttrib = ScreenAttrib;
|
(*Buffer)->ScreenDefaultAttrib = ScreenAttrib;
|
||||||
(*Buffer)->PopupDefaultAttrib = PopupAttrib;
|
(*Buffer)->PopupDefaultAttrib = PopupAttrib;
|
||||||
|
@ -1035,8 +1036,8 @@ CSR_API(SrvWriteConsoleOutputString)
|
||||||
ConioDrawRegion(Console, &UpdateRect);
|
ConioDrawRegion(Console, &UpdateRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteOutputCodeRequest->EndCoord.X = X;
|
// WriteOutputCodeRequest->EndCoord.X = X;
|
||||||
WriteOutputCodeRequest->EndCoord.Y = (Y + Buff->ScreenBufferSize.Y - Buff->VirtualY) % Buff->ScreenBufferSize.Y;
|
// WriteOutputCodeRequest->EndCoord.Y = (Y + Buff->ScreenBufferSize.Y - Buff->VirtualY) % Buff->ScreenBufferSize.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmpString)
|
if (tmpString)
|
||||||
|
@ -1272,6 +1273,8 @@ CSR_API(SrvCreateConsoleScreenBuffer)
|
||||||
COORD ScreenBufferSize = (COORD){80, 25};
|
COORD ScreenBufferSize = (COORD){80, 25};
|
||||||
USHORT ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
|
USHORT ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
|
||||||
USHORT PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
USHORT PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
||||||
|
BOOLEAN IsCursorVisible = TRUE;
|
||||||
|
ULONG CursorSize = CSR_DEFAULT_CURSOR_SIZE;
|
||||||
|
|
||||||
DPRINT("SrvCreateConsoleScreenBuffer\n");
|
DPRINT("SrvCreateConsoleScreenBuffer\n");
|
||||||
|
|
||||||
|
@ -1292,20 +1295,18 @@ CSR_API(SrvCreateConsoleScreenBuffer)
|
||||||
|
|
||||||
ScreenAttrib = Console->ActiveBuffer->ScreenDefaultAttrib;
|
ScreenAttrib = Console->ActiveBuffer->ScreenDefaultAttrib;
|
||||||
PopupAttrib = Console->ActiveBuffer->PopupDefaultAttrib;
|
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,
|
Status = ConSrvCreateScreenBuffer(Console,
|
||||||
&Buff,
|
&Buff,
|
||||||
ScreenBufferSize,
|
ScreenBufferSize,
|
||||||
ScreenAttrib,
|
ScreenAttrib,
|
||||||
PopupAttrib);
|
PopupAttrib,
|
||||||
|
IsCursorVisible,
|
||||||
|
CursorSize);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
Status = ConSrvInsertObject(ProcessData,
|
Status = ConSrvInsertObject(ProcessData,
|
||||||
|
|
|
@ -365,7 +365,9 @@ ConSrvInitConsole(OUT PCONSOLE* NewConsole,
|
||||||
&NewBuffer,
|
&NewBuffer,
|
||||||
ConsoleInfo.ScreenBufferSize,
|
ConsoleInfo.ScreenBufferSize,
|
||||||
ConsoleInfo.ScreenAttrib,
|
ConsoleInfo.ScreenAttrib,
|
||||||
ConsoleInfo.PopupAttrib);
|
ConsoleInfo.PopupAttrib,
|
||||||
|
TRUE,
|
||||||
|
ConsoleInfo.CursorSize);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("ConSrvCreateScreenBuffer: failed, Status = 0x%08lx\n", Status);
|
DPRINT1("ConSrvCreateScreenBuffer: failed, Status = 0x%08lx\n", Status);
|
||||||
|
|
|
@ -464,6 +464,7 @@ 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.
|
memcpy(Console->Colors, pConInfo->ci.Colors, sizeof(s_Colors)); // FIXME: Possible buffer overflow if s_colors is bigger than pConInfo->Colors.
|
||||||
|
|
||||||
/* Apply cursor size */
|
/* Apply cursor size */
|
||||||
|
ActiveBuffer->CursorInfo.bVisible = (pConInfo->ci.CursorSize > 0);
|
||||||
ActiveBuffer->CursorInfo.dwSize = min(max(pConInfo->ci.CursorSize, 1), 100);
|
ActiveBuffer->CursorInfo.dwSize = min(max(pConInfo->ci.CursorSize, 1), 100);
|
||||||
|
|
||||||
if (pConInfo->ci.ConsoleSize.X != Console->Size.X ||
|
if (pConInfo->ci.ConsoleSize.X != Console->Size.X ||
|
||||||
|
|
|
@ -446,7 +446,7 @@ ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
|
||||||
|
|
||||||
ConsoleInfo->CursorBlinkOn;
|
ConsoleInfo->CursorBlinkOn;
|
||||||
ConsoleInfo->ForceCursorOff;
|
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->ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
|
||||||
ConsoleInfo->PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
ConsoleInfo->PopupAttrib = DEFAULT_POPUP_ATTRIB;
|
||||||
|
@ -473,13 +473,6 @@ ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
|
||||||
ConsoleInfo->u.GuiInfo.AutoPosition = TRUE;
|
ConsoleInfo->u.GuiInfo.AutoPosition = TRUE;
|
||||||
ConsoleInfo->u.GuiInfo.WindowOrigin = (POINT){0, 0};
|
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.
|
* 2. Overwrite them with the ones stored in HKCU\Console.
|
||||||
* If the HKCU\Console key doesn't exist, create it
|
* If the HKCU\Console key doesn't exist, create it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue