]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
IntelFrameworkPkg/UefiLib: Avoid mis-calculate of graphic console size
[mirror_edk2.git] / IntelFrameworkPkg / Library / FrameworkUefiLib / Console.c
index a8ecc27e64d97731703fe2ba7407d1a3dd409ce0..244e532f577e129be60b882828ef3d10efa7a1cb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This module provide help function for displaying unicode string.\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, 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
@@ -314,6 +314,7 @@ CreatePopUp (
   ...\r
   )\r
 {\r
+  EFI_STATUS                       Status;\r
   VA_LIST                          Args;\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *ConOut;\r
   EFI_SIMPLE_TEXT_OUTPUT_MODE      SavedConsoleMode;\r
@@ -457,7 +458,19 @@ CreatePopUp (
   // Wait for a keystroke\r
   //\r
   if (Key != NULL) {\r
-    gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
-    gST->ConIn->ReadKeyStroke (gST->ConIn, Key);\r
+    while (TRUE) {\r
+      Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);\r
+      if (!EFI_ERROR (Status)) {\r
+        break;\r
+      }\r
+\r
+      //\r
+      // If we encounter error, continue to read another key in.\r
+      //\r
+      if (Status != EFI_NOT_READY) {\r
+        continue;\r
+      }\r
+      gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
+    }\r
   }\r
 }\r