Mde UEFI library API implementation.\r
Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE\r
\r
- Copyright (c) 2007 - 2009, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2007 - 2009, 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
- 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
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
//\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
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
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
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
//\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
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
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
@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
RowInfoArray = NULL;\r
\r
ConsoleHandle = gST->ConsoleOutHandle;\r
+ \r
+ ASSERT( ConsoleHandle != NULL);\r
\r
Status = gBS->HandleProtocol (\r
ConsoleHandle,\r
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
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