]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
ShellPkg: Fix calls to SimpleTextOut->SetAttribute to not use reserved bits
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / EditInputBar.c
index 58d3477f5fdac052c4c8467e14154cb76ae348f2..5c43ffcd9d8aabd1cb9af792250bc86ee27912ea 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implements inputbar interface functions.\r
 \r
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -103,7 +103,7 @@ InputBarPrintInput (
 \r
 typedef struct {\r
   UINT32  Foreground : 4;\r
-  UINT32  Background : 4;\r
+  UINT32  Background : 3;\r
 } INPUT_BAR_COLOR_ATTRIBUTES;\r
 \r
 typedef union {\r
@@ -150,10 +150,10 @@ InputBarRefresh (
   CursorRow             = gST->ConOut->Mode->CursorRow;\r
   Orig.Data             = gST->ConOut->Mode->Attribute;\r
   New.Data              = 0;\r
-  New.Colors.Foreground = Orig.Colors.Background;\r
-  New.Colors.Background = Orig.Colors.Foreground;\r
+  New.Colors.Foreground = Orig.Colors.Background & 0xF;\r
+  New.Colors.Background = Orig.Colors.Foreground & 0x7;\r
 \r
-  gST->ConOut->SetAttribute (gST->ConOut, New.Data);\r
+  gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);\r
 \r
   //\r
   // clear input bar\r