From: Hermès Bélusca-Maïto Date: Sat, 30 Aug 2014 16:18:07 +0000 (+0000) Subject: [CONDRV] X-Git-Tag: backups/0.3.17@66124~619^2~16 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=a55a2fbbc4b53a33b881bed4b6cc08db2d9630c3;hp=ccaa07fecf52528972d748c1ca2445fe0b7f06aa [CONDRV] - In ConDrvChangeScreenBufferAttributes, change also the popup attributes. - In some functions we need to check validity of Read/WriteCoord parameters, add fixme for now, that need to be fixed later on. svn path=/branches/condrv_restructure/; revision=63991 --- diff --git a/win32ss/user/winsrv/consrv/condrv/text.c b/win32ss/user/winsrv/consrv/condrv/text.c index 921df4da2fe..e41a92b2fe1 100644 --- a/win32ss/user/winsrv/consrv/condrv/text.c +++ b/win32ss/user/winsrv/consrv/condrv/text.c @@ -363,7 +363,7 @@ ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, COORD TopLeft = {0}; ULONG NumCodesToWrite; - USHORT OldScreenAttrib; + USHORT OldScreenAttrib, OldPopupAttrib; if (Console == NULL || Buffer == NULL) { @@ -375,6 +375,7 @@ ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, NumCodesToWrite = Buffer->ScreenBufferSize.X * Buffer->ScreenBufferSize.Y; OldScreenAttrib = Buffer->ScreenDefaultAttrib; + OldPopupAttrib = Buffer->PopupDefaultAttrib; X = TopLeft.X; Y = (TopLeft.Y + Buffer->VirtualY) % Buffer->ScreenBufferSize.Y; @@ -395,10 +396,14 @@ ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, /* Foreground color */ if ((Ptr->Attributes & 0x0F) == (OldScreenAttrib & 0x0F)) Ptr->Attributes = (Ptr->Attributes & 0xFFF0) | (NewScreenAttrib & 0x0F); + if ((Ptr->Attributes & 0x0F) == (OldPopupAttrib & 0x0F)) + Ptr->Attributes = (Ptr->Attributes & 0xFFF0) | (NewPopupAttrib & 0x0F); /* Background color */ if ((Ptr->Attributes & 0xF0) == (OldScreenAttrib & 0xF0)) Ptr->Attributes = (Ptr->Attributes & 0xFF0F) | (NewScreenAttrib & 0xF0); + if ((Ptr->Attributes & 0xF0) == (OldPopupAttrib & 0xF0)) + Ptr->Attributes = (Ptr->Attributes & 0xFF0F) | (NewPopupAttrib & 0xF0); // ++Ptr; @@ -716,6 +721,10 @@ ConDrvReadConsoleOutputString(IN PCONSOLE Console, ASSERT(Console == Buffer->Header.Console); ASSERT((StringBuffer != NULL) || (StringBuffer == NULL && NumCodesToRead == 0)); + // + // FIXME: Make overflow checks on ReadCoord !!!!!! + // + if (NumCodesRead) *NumCodesRead = 0; switch (CodeType) @@ -826,6 +835,10 @@ ConDrvWriteConsoleOutputString(IN PCONSOLE Console, ASSERT(Console == Buffer->Header.Console); ASSERT((StringBuffer != NULL) || (StringBuffer == NULL && NumCodesToWrite == 0)); + // + // FIXME: Make overflow checks on WriteCoord !!!!!! + // + if (NumCodesWritten) *NumCodesWritten = 0; switch (CodeType) @@ -954,6 +967,10 @@ ConDrvFillConsoleOutput(IN PCONSOLE Console, /* Validity check */ ASSERT(Console == Buffer->Header.Console); + // + // FIXME: Make overflow checks on WriteCoord !!!!!! + // + if (NumCodesWritten) *NumCodesWritten = 0; if (CodeType == CODE_ASCII)