mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[BLUE] IOCTL_CONSOLE_DRAW: Fix ConsoleDraw.SizeX/Y boundary checks. Always set the cursor position before possibly refreshing screen.
This commit is contained in:
parent
f6de3342bf
commit
4ab49bc276
1 changed files with 10 additions and 9 deletions
|
@ -1455,6 +1455,14 @@ ScrIoControl(
|
|||
break;
|
||||
}
|
||||
|
||||
Irp->IoStatus.Information = 0;
|
||||
|
||||
/* Set the cursor position, clipping it to the screen */
|
||||
DeviceExtension->CursorX = min(max(ConsoleDraw.CursorX, 0), DeviceExtension->Columns - 1);
|
||||
DeviceExtension->CursorY = min(max(ConsoleDraw.CursorY, 0), DeviceExtension->Rows - 1);
|
||||
if (DeviceExtension->Enabled)
|
||||
ScrSetCursor(DeviceExtension);
|
||||
|
||||
// TODO: For the moment if the ConsoleDraw rectangle has borders
|
||||
// out of the screen-buffer we just bail out. Would it be better
|
||||
// to actually clip the rectangle within its borders instead?
|
||||
|
@ -1464,8 +1472,8 @@ ScrIoControl(
|
|||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
if ( ConsoleDraw.SizeX >= DeviceExtension->Columns - ConsoleDraw.X ||
|
||||
ConsoleDraw.SizeY >= DeviceExtension->Rows - ConsoleDraw.Y )
|
||||
if ( ConsoleDraw.SizeX > DeviceExtension->Columns - ConsoleDraw.X ||
|
||||
ConsoleDraw.SizeY > DeviceExtension->Rows - ConsoleDraw.Y )
|
||||
{
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
|
@ -1489,13 +1497,6 @@ ScrIoControl(
|
|||
}
|
||||
}
|
||||
|
||||
/* Set the cursor position, clipping it to the screen */
|
||||
DeviceExtension->CursorX = min(max(ConsoleDraw.CursorX, 0), DeviceExtension->Columns - 1);
|
||||
DeviceExtension->CursorY = min(max(ConsoleDraw.CursorY, 0), DeviceExtension->Rows - 1);
|
||||
if (DeviceExtension->Enabled)
|
||||
ScrSetCursor(DeviceExtension);
|
||||
|
||||
Irp->IoStatus.Information = 0;
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue