IN VA_LIST Marker\r
)\r
{\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
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
IN VA_LIST Marker\r
)\r
{\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
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
EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto;\r
EFI_HANDLE ConsoleHandle;\r
+ UINTN Width;\r
+ UINTN Height;\r
+ UINTN Delta;\r
\r
HorizontalResolution = 0;\r
VerticalResolution = 0;\r
\r
ConsoleHandle = gST->ConsoleOutHandle;\r
\r
+ ASSERT( ConsoleHandle != NULL);\r
+\r
Status = gBS->HandleProtocol (\r
ConsoleHandle,\r
&gEfiGraphicsOutputProtocolGuid,\r
//\r
Status = HiiFont->StringToImage (\r
HiiFont,\r
- EFI_HII_IGNORE_IF_NO_GLYPH,\r
+ EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_OUT_FLAG_CLIP |\r
+ EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |\r
+ EFI_HII_IGNORE_LINE_BREAK,\r
Buffer,\r
&FontInfo,\r
&Blt,\r
if (!EFI_ERROR (Status)) {\r
ASSERT (RowInfoArray != NULL);\r
//\r
- // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will\r
+ // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will\r
// always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.\r
//\r
ASSERT (RowInfoArraySize <= 1);\r
\r
+ if (RowInfoArraySize != 0) {\r
+ Width = RowInfoArray[0].LineWidth;\r
+ Height = RowInfoArray[0].LineHeight;\r
+ Delta = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);\r
+ } else {\r
+ Width = 0;\r
+ Height = 0;\r
+ Delta = 0;\r
+ }\r
Status = UgaDraw->Blt (\r
UgaDraw,\r
(EFI_UGA_PIXEL *) Blt->Image.Bitmap,\r
PointY,\r
PointX,\r
PointY,\r
- RowInfoArray[0].LineWidth,\r
- RowInfoArray[0].LineHeight,\r
- Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
+ Width,\r
+ Height,\r
+ Delta\r
);\r
} else {\r
goto Error;\r
//\r
// Calculate the number of actual printed characters\r
//\r
+ if (RowInfoArraySize != 0) {\r
PrintNum = RowInfoArray[0].EndIndex - RowInfoArray[0].StartIndex + 1;\r
+ } else {\r
+ PrintNum = 0;\r
+ }\r
\r
FreePool (RowInfoArray);\r
FreePool (Blt);\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