[KERNEL32]

Clean-up IntReadConsoleOutputCode a little bit.

[CONSRV]
Fix a buffer overflow in SrvReadConsoleOutputString, which was translated sometimes into heap corruption and assert, triggered when freeing a remote captured buffer in csrsrv, when executing kernel32_winetest console, just during a call to ReadConsoleOutputCharacterA.
Nevertheless I still keep the culprit code (commented-out now) because it might be useful in the future.

svn path=/branches/ros-csrss/; revision=58229
This commit is contained in:
Hermès Bélusca-Maïto 2013-01-26 19:07:59 +00:00
parent 6d28ec8640
commit 7846f054ff
2 changed files with 28 additions and 35 deletions

View file

@ -862,20 +862,20 @@ CSR_API(SrvReadConsoleOutputString)
}
}
switch (CodeType)
{
case CODE_UNICODE:
*(PWCHAR)ReadBuffer = 0;
break;
// switch (CodeType)
// {
// case CODE_UNICODE:
// *(PWCHAR)ReadBuffer = 0;
// break;
case CODE_ASCII:
*(PCHAR)ReadBuffer = 0;
break;
// case CODE_ASCII:
// *(PCHAR)ReadBuffer = 0;
// break;
case CODE_ATTRIBUTE:
*(PWORD)ReadBuffer = 0;
break;
}
// case CODE_ATTRIBUTE:
// *(PWORD)ReadBuffer = 0;
// break;
// }
ReadOutputCodeRequest->EndCoord.X = Xpos;
ReadOutputCodeRequest->EndCoord.Y = (Ypos - Buff->VirtualY + Buff->MaxY) % Buff->MaxY;