From the cursor position!
| 1619 | |
| 1620 | // From the cursor position! |
| 1621 | BOOL ExtScrollLine(ExtScrollScreenParm* Info) |
| 1622 | { |
| 1623 | ORIGINALCALLCOUNT_(ExtScrollLine,-1); |
| 1624 | |
| 1625 | int nDir = (int)Info->Dir; |
| 1626 | if (nDir == 0) |
| 1627 | { |
| 1628 | _ASSERTE(FALSE && "Nothing to do"); |
| 1629 | return FALSE; |
| 1630 | } |
| 1631 | |
| 1632 | HANDLE h = Info->ConsoleOutput; |
| 1633 | BOOL lbTrueColor = ExtCheckBuffers(h); |
| 1634 | UNREFERENCED_PARAMETER(lbTrueColor); |
| 1635 | |
| 1636 | CONSOLE_SCREEN_BUFFER_INFO csbi = {}; |
| 1637 | SMALL_RECT srWork = {}; |
| 1638 | if (!ExtGetBufferInfo(h, csbi, srWork)) |
| 1639 | return FALSE; |
| 1640 | |
| 1641 | |
| 1642 | SHORT nWindowWidth = srWork.Right - srWork.Left + 1; |
| 1643 | SHORT nWindowHeight = srWork.Bottom - srWork.Top + 1; |
| 1644 | |
| 1645 | int nMaxCell = std::min(nWindowWidth * nWindowHeight, gpTrueColor->bufferSize); |
| 1646 | int nMaxRows = nMaxCell / nWindowWidth; |
| 1647 | int nY1 = (csbi.dwCursorPosition.Y - srWork.Top); |
| 1648 | |
| 1649 | AnnotationInfo* pTrueColorStart = (AnnotationInfo*)(gpTrueColor ? (((LPBYTE)gpTrueColor) + gpTrueColor->struct_size) : NULL); //-V104 |
| 1650 | AnnotationInfo* pTrueColorEnd = pTrueColorStart ? (pTrueColorStart + gpTrueColor->bufferSize) : NULL; //-V104 |
| 1651 | |
| 1652 | ORIGINAL_KRNL(ScrollConsoleScreenBufferW); |
| 1653 | |
| 1654 | if (Info->Flags & essf_Current) |
| 1655 | { |
| 1656 | ExtAttributesParm DefClr = {sizeof(DefClr), h}; |
| 1657 | ExtGetAttributes(&DefClr); |
| 1658 | Info->FillAttr = DefClr.Attributes; |
| 1659 | } |
| 1660 | |
| 1661 | if (csbi.dwCursorPosition.X >= (csbi.dwSize.X-1)) |
| 1662 | { |
| 1663 | _ASSERTE((csbi.dwCursorPosition.X >= (csbi.dwSize.X - 1)) && "Nothing to scroll?") |
| 1664 | } |
| 1665 | else if (_abs(nDir) >= (csbi.dwSize.X - csbi.dwCursorPosition.X)) |
| 1666 | { |
| 1667 | COORD crf = csbi.dwCursorPosition; |
| 1668 | ExtFillOutputParm f0 = {sizeof(f0), efof_Attribute|efof_Character, h, |
| 1669 | Info->FillAttr, Info->FillChar, crf, (csbi.dwSize.X - csbi.dwCursorPosition.X)}; |
| 1670 | ExtFillOutput(&f0); |
| 1671 | |
| 1672 | } |
| 1673 | else |
| 1674 | { |
| 1675 | INT_PTR ccCellsTotal = (csbi.dwSize.X - csbi.dwCursorPosition.X); |
| 1676 | INT_PTR ccCellsMove = ccCellsTotal - _abs(nDir); |
| 1677 | INT_PTR ccCellsClear = _abs(nDir); |
| 1678 | COORD crf = csbi.dwCursorPosition; |
no test coverage detected