]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiLib/UefiLibPrint.c
Minor grammatical work--mostly adding periods. Items with ONLY period added did...
[mirror_edk2.git] / MdePkg / Library / UefiLib / UefiLibPrint.c
index 81d9b7b5144de34acb260ddf7af04af90a86fca2..e663e8d2b24e25ce5a1b9a121e97ce5f95871584 100644 (file)
@@ -6,7 +6,7 @@
   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
-  http://opensource.org/licenses/bsd-license.php\r
+  http://opensource.org/licenses/bsd-license.php.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
@@ -59,12 +59,14 @@ InternalPrint (
   IN  VA_LIST                          Marker\r
   )\r
 {\r
-  UINTN   Return;\r
-  CHAR16  *Buffer;\r
-  UINTN   BufferSize;\r
+  EFI_STATUS  Status;\r
+  UINTN       Return;\r
+  CHAR16      *Buffer;\r
+  UINTN       BufferSize;\r
 \r
   ASSERT (Format != NULL);\r
   ASSERT (((UINTN) Format & BIT0) == 0);\r
+  ASSERT (Console != NULL);\r
 \r
   BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
 \r
@@ -77,7 +79,10 @@ InternalPrint (
     //\r
     // To be extra safe make sure Console has been initialized\r
     //\r
-    Console->OutputString (Console, Buffer);\r
+    Status = Console->OutputString (Console, Buffer);\r
+    if (EFI_ERROR (Status)) {\r
+      Return = 0;\r
+    }\r
   }\r
 \r
   FreePool (Buffer);\r
@@ -96,12 +101,13 @@ InternalPrint (
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->ConOut is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated Unicode format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
-  @return Number of Unicode characters printed to ConOut.\r
+  @return The number of Unicode characters printed to ConOut.\r
 \r
 **/\r
 UINTN\r
@@ -134,12 +140,13 @@ Print (
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->StdErr is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated Unicode format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
-  @return Number of Unicode characters printed to StdErr.\r
+  @return The number of Unicode characters printed to StdErr.\r
 \r
 **/\r
 UINTN\r
@@ -188,11 +195,13 @@ AsciiInternalPrint (
   IN  VA_LIST                          Marker\r
   )\r
 {\r
-  UINTN   Return;\r
-  CHAR16  *Buffer;\r
-  UINTN   BufferSize;\r
+  EFI_STATUS  Status;\r
+  UINTN       Return;\r
+  CHAR16      *Buffer;\r
+  UINTN       BufferSize;\r
 \r
   ASSERT (Format != NULL);\r
+  ASSERT (Console != NULL);\r
 \r
   BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
 \r
@@ -205,7 +214,10 @@ AsciiInternalPrint (
     //\r
     // To be extra safe make sure Console has been initialized\r
     //\r
-    Console->OutputString (Console, Buffer);\r
+    Status = Console->OutputString (Console, Buffer);\r
+    if (EFI_ERROR (Status)) {\r
+      Return = 0;\r
+    }\r
   }\r
 \r
   FreePool (Buffer);\r
@@ -223,12 +235,13 @@ AsciiInternalPrint (
   string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
+  If gST->ConOut is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
-  @return Number of ASCII characters printed to ConOut.\r
+  @return The number of ASCII characters printed to ConOut.\r
 \r
 **/\r
 UINTN\r
@@ -261,12 +274,13 @@ AsciiPrint (
   string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
+  If gST->StdErr is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
-  @return Number of ASCII characters printed to ConErr.\r
+  @return The number of ASCII characters printed to ConErr.\r
 \r
 **/\r
 UINTN\r
@@ -319,7 +333,7 @@ AsciiErrorPrint (
   @param  Buffer       Null-terminated Unicode formatted string.\r
   @param  PrintNum     The number of Unicode formatted string to be printed.\r
 \r
-  @return  Number of Unicode Characters printed. Zero means no any character\r
+  @return  The number of Unicode Characters printed. Zero means no any character\r
            displayed successfully.\r
 \r
 **/\r
@@ -357,6 +371,8 @@ InternalPrintGraphic (
   RowInfoArray          = NULL;\r
 \r
   ConsoleHandle = gST->ConsoleOutHandle;\r
+  \r
+  ASSERT( ConsoleHandle != NULL);\r
 \r
   Status = gBS->HandleProtocol (\r
                   ConsoleHandle,\r
@@ -558,6 +574,7 @@ Error:
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->ConsoleOutputHandle is NULL, then ASSERT().\r
 \r
   @param  PointX       X coordinate to print the string.\r
   @param  PointY       Y coordinate to print the string.\r
@@ -634,6 +651,7 @@ PrintXY (
   If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
+  If gST->ConsoleOutputHandle is NULL, then ASSERT().\r
 \r
   @param  PointX       X coordinate to print the string.\r
   @param  PointY       Y coordinate to print the string.\r