2 Mde UEFI library API implementation.
3 Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "UefiLibInternal.h"
12 GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors
[16] = {
13 { 0x00, 0x00, 0x00, 0x00 },
14 { 0x98, 0x00, 0x00, 0x00 },
15 { 0x00, 0x98, 0x00, 0x00 },
16 { 0x98, 0x98, 0x00, 0x00 },
17 { 0x00, 0x00, 0x98, 0x00 },
18 { 0x98, 0x00, 0x98, 0x00 },
19 { 0x00, 0x98, 0x98, 0x00 },
20 { 0x98, 0x98, 0x98, 0x00 },
21 { 0x10, 0x10, 0x10, 0x00 },
22 { 0xff, 0x10, 0x10, 0x00 },
23 { 0x10, 0xff, 0x10, 0x00 },
24 { 0xff, 0xff, 0x10, 0x00 },
25 { 0x10, 0x10, 0xff, 0x00 },
26 { 0xf0, 0x10, 0xff, 0x00 },
27 { 0x10, 0xff, 0xff, 0x00 },
28 { 0xff, 0xff, 0xff, 0x00 }
32 Internal function which prints a formatted Unicode string to the console output device
35 This function prints a formatted Unicode string to the console output device
36 specified by Console and returns the number of Unicode characters that printed
37 to it. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,
38 then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
39 If Format is NULL, then ASSERT().
40 If Format is not aligned on a 16-bit boundary, then ASSERT().
42 @param Format A Null-terminated Unicode format string.
43 @param Console The output console.
44 @param Marker A VA_LIST marker for the variable argument list.
46 @return The number of Unicode characters in the produced
47 output buffer, not including the Null-terminator.
51 IN CONST CHAR16
*Format
,
52 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*Console
,
61 ASSERT (Format
!= NULL
);
62 ASSERT (((UINTN
) Format
& BIT0
) == 0);
63 ASSERT (Console
!= NULL
);
65 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
67 Buffer
= (CHAR16
*) AllocatePool(BufferSize
);
68 ASSERT (Buffer
!= NULL
);
70 Return
= UnicodeVSPrint (Buffer
, BufferSize
, Format
, Marker
);
72 if (Console
!= NULL
&& Return
> 0) {
74 // To be extra safe make sure Console has been initialized
76 Status
= Console
->OutputString (Console
, Buffer
);
77 if (EFI_ERROR (Status
)) {
88 Prints a formatted Unicode string to the console output device specified by
89 ConOut defined in the EFI_SYSTEM_TABLE.
91 This function prints a formatted Unicode string to the console output device
92 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
93 characters that printed to ConOut. If the length of the formatted Unicode
94 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
95 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
96 If Format is NULL, then ASSERT().
97 If Format is not aligned on a 16-bit boundary, then ASSERT().
98 If gST->ConOut is NULL, then ASSERT().
100 @param Format A Null-terminated Unicode format string.
101 @param ... A Variable argument list whose contents are accessed based
102 on the format string specified by Format.
104 @return The number of Unicode characters printed to ConOut.
110 IN CONST CHAR16
*Format
,
117 VA_START (Marker
, Format
);
119 Return
= InternalPrint (Format
, gST
->ConOut
, Marker
);
127 Prints a formatted Unicode string to the console output device specified by
128 StdErr defined in the EFI_SYSTEM_TABLE.
130 This function prints a formatted Unicode string to the console output device
131 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
132 characters that printed to StdErr. If the length of the formatted Unicode
133 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
134 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
135 If Format is NULL, then ASSERT().
136 If Format is not aligned on a 16-bit boundary, then ASSERT().
137 If gST->StdErr is NULL, then ASSERT().
139 @param Format A Null-terminated Unicode format string.
140 @param ... Variable argument list whose contents are accessed based
141 on the format string specified by Format.
143 @return The number of Unicode characters printed to StdErr.
149 IN CONST CHAR16
*Format
,
156 VA_START (Marker
, Format
);
158 Return
= InternalPrint( Format
, gST
->StdErr
, Marker
);
167 Internal function which prints a formatted ASCII string to the console output device
170 This function prints a formatted ASCII string to the console output device
171 specified by Console and returns the number of ASCII characters that printed
172 to it. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,
173 then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
175 If Format is NULL, then ASSERT().
177 @param Format A Null-terminated ASCII format string.
178 @param Console The output console.
179 @param Marker VA_LIST marker for the variable argument list.
181 @return The number of Unicode characters in the produced
182 output buffer not including the Null-terminator.
187 IN CONST CHAR8
*Format
,
188 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*Console
,
197 ASSERT (Format
!= NULL
);
198 ASSERT (Console
!= NULL
);
200 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
202 Buffer
= (CHAR16
*) AllocatePool(BufferSize
);
203 ASSERT (Buffer
!= NULL
);
205 Return
= UnicodeVSPrintAsciiFormat (Buffer
, BufferSize
, Format
, Marker
);
207 if (Console
!= NULL
) {
209 // To be extra safe make sure Console has been initialized
211 Status
= Console
->OutputString (Console
, Buffer
);
212 if (EFI_ERROR (Status
)) {
223 Prints a formatted ASCII string to the console output device specified by
224 ConOut defined in the EFI_SYSTEM_TABLE.
226 This function prints a formatted ASCII string to the console output device
227 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
228 characters that printed to ConOut. If the length of the formatted ASCII
229 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
230 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
231 If Format is NULL, then ASSERT().
232 If gST->ConOut is NULL, then ASSERT().
234 @param Format A Null-terminated ASCII format string.
235 @param ... Variable argument list whose contents are accessed based
236 on the format string specified by Format.
238 @return The number of ASCII characters printed to ConOut.
244 IN CONST CHAR8
*Format
,
250 ASSERT (Format
!= NULL
);
252 VA_START (Marker
, Format
);
254 Return
= AsciiInternalPrint( Format
, gST
->ConOut
, Marker
);
262 Prints a formatted ASCII string to the console output device specified by
263 StdErr defined in the EFI_SYSTEM_TABLE.
265 This function prints a formatted ASCII string to the console output device
266 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
267 characters that printed to StdErr. If the length of the formatted ASCII
268 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
269 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
270 If Format is NULL, then ASSERT().
271 If gST->StdErr is NULL, then ASSERT().
273 @param Format A Null-terminated ASCII format string.
274 @param ... Variable argument list whose contents are accessed based
275 on the format string specified by Format.
277 @return The number of ASCII characters printed to ConErr.
283 IN CONST CHAR8
*Format
,
290 ASSERT (Format
!= NULL
);
292 VA_START (Marker
, Format
);
294 Return
= AsciiInternalPrint( Format
, gST
->StdErr
, Marker
);
302 Internal function to print a formatted Unicode string to a graphics console device specified by
303 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
305 This function prints a formatted Unicode string to the graphics console device
306 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
307 Unicode characters printed. The EFI_HII_FONT_PROTOCOL is used to convert the
308 string to a bitmap using the glyphs registered with the
309 HII database. No wrapping is performed, so any portions of the string the fall
310 outside the active display region will not be displayed.
312 If a graphics console device is not associated with the ConsoleOutputHandle
313 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
314 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
315 string is printed, and 0 is returned.
317 @param PointX An X coordinate to print the string.
318 @param PointY A Y coordinate to print the string.
319 @param Foreground The foreground color of the string being printed. This is
320 an optional parameter that may be NULL. If it is NULL,
321 then the foreground color of the current ConOut device
322 in the EFI_SYSTEM_TABLE is used.
323 @param Background The background color of the string being printed. This is
324 an optional parameter that may be NULL. If it is NULL,
325 then the background color of the current ConOut device
326 in the EFI_SYSTEM_TABLE is used.
327 @param Buffer A Null-terminated Unicode formatted string.
328 @param PrintNum The number of Unicode formatted string to be printed.
330 @return The number of Unicode Characters printed. Zero means no any character
331 displayed successfully.
335 InternalPrintGraphic (
338 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Foreground
,
339 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Background
,
345 UINT32 HorizontalResolution
;
346 UINT32 VerticalResolution
;
349 EFI_HII_FONT_PROTOCOL
*HiiFont
;
350 EFI_IMAGE_OUTPUT
*Blt
;
351 EFI_FONT_DISPLAY_INFO FontInfo
;
352 EFI_HII_ROW_INFO
*RowInfoArray
;
353 UINTN RowInfoArraySize
;
354 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
355 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
356 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*Sto
;
357 EFI_HANDLE ConsoleHandle
;
362 HorizontalResolution
= 0;
363 VerticalResolution
= 0;
367 ConsoleHandle
= gST
->ConsoleOutHandle
;
369 ASSERT( ConsoleHandle
!= NULL
);
371 Status
= gBS
->HandleProtocol (
373 &gEfiGraphicsOutputProtocolGuid
,
374 (VOID
**) &GraphicsOutput
378 if (EFI_ERROR (Status
) && FeaturePcdGet (PcdUgaConsumeSupport
)) {
380 // If no GOP available, try to open UGA Draw protocol if supported.
382 GraphicsOutput
= NULL
;
384 Status
= gBS
->HandleProtocol (
386 &gEfiUgaDrawProtocolGuid
,
390 if (EFI_ERROR (Status
)) {
394 Status
= gBS
->HandleProtocol (
396 &gEfiSimpleTextOutProtocolGuid
,
400 if (EFI_ERROR (Status
)) {
404 if (GraphicsOutput
!= NULL
) {
405 HorizontalResolution
= GraphicsOutput
->Mode
->Info
->HorizontalResolution
;
406 VerticalResolution
= GraphicsOutput
->Mode
->Info
->VerticalResolution
;
407 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
408 UgaDraw
->GetMode (UgaDraw
, &HorizontalResolution
, &VerticalResolution
, &ColorDepth
, &RefreshRate
);
413 ASSERT ((HorizontalResolution
!= 0) && (VerticalResolution
!=0));
415 Status
= gBS
->LocateProtocol (&gEfiHiiFontProtocolGuid
, NULL
, (VOID
**) &HiiFont
);
416 if (EFI_ERROR (Status
)) {
420 Blt
= (EFI_IMAGE_OUTPUT
*) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT
));
421 ASSERT (Blt
!= NULL
);
423 Blt
->Width
= (UINT16
) (HorizontalResolution
);
424 Blt
->Height
= (UINT16
) (VerticalResolution
);
426 ZeroMem (&FontInfo
, sizeof (EFI_FONT_DISPLAY_INFO
));
428 if (Foreground
!= NULL
) {
429 CopyMem (&FontInfo
.ForegroundColor
, Foreground
, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
432 &FontInfo
.ForegroundColor
,
433 &mEfiColors
[Sto
->Mode
->Attribute
& 0x0f],
434 sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
437 if (Background
!= NULL
) {
438 CopyMem (&FontInfo
.BackgroundColor
, Background
, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
441 &FontInfo
.BackgroundColor
,
442 &mEfiColors
[Sto
->Mode
->Attribute
>> 4],
443 sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
447 if (GraphicsOutput
!= NULL
) {
448 Blt
->Image
.Screen
= GraphicsOutput
;
450 Status
= HiiFont
->StringToImage (
452 EFI_HII_IGNORE_IF_NO_GLYPH
| EFI_HII_OUT_FLAG_CLIP
|
453 EFI_HII_OUT_FLAG_CLIP_CLEAN_X
| EFI_HII_OUT_FLAG_CLIP_CLEAN_Y
|
454 EFI_HII_IGNORE_LINE_BREAK
| EFI_HII_DIRECT_TO_SCREEN
,
464 if (EFI_ERROR (Status
)) {
468 } else if (FeaturePcdGet (PcdUgaConsumeSupport
)) {
469 ASSERT (UgaDraw
!= NULL
);
472 // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow.
474 if (Blt
->Width
> DivU64x32 (MAX_UINTN
, Blt
->Height
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
))) {
478 Blt
->Image
.Bitmap
= AllocateZeroPool ((UINT32
) Blt
->Width
* Blt
->Height
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
479 ASSERT (Blt
->Image
.Bitmap
!= NULL
);
482 // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
483 // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
485 Status
= HiiFont
->StringToImage (
487 EFI_HII_IGNORE_IF_NO_GLYPH
| EFI_HII_OUT_FLAG_CLIP
|
488 EFI_HII_OUT_FLAG_CLIP_CLEAN_X
| EFI_HII_OUT_FLAG_CLIP_CLEAN_Y
|
489 EFI_HII_IGNORE_LINE_BREAK
,
500 if (!EFI_ERROR (Status
)) {
501 ASSERT (RowInfoArray
!= NULL
);
503 // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will
504 // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
506 ASSERT (RowInfoArraySize
<= 1);
508 if (RowInfoArraySize
!= 0) {
509 Width
= RowInfoArray
[0].LineWidth
;
510 Height
= RowInfoArray
[0].LineHeight
;
511 Delta
= Blt
->Width
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
);
517 Status
= UgaDraw
->Blt (
519 (EFI_UGA_PIXEL
*) Blt
->Image
.Bitmap
,
520 EfiUgaBltBufferToVideo
,
532 FreePool (Blt
->Image
.Bitmap
);
537 // Calculate the number of actual printed characters
539 if (RowInfoArraySize
!= 0) {
540 PrintNum
= RowInfoArray
[0].EndIndex
- RowInfoArray
[0].StartIndex
+ 1;
545 FreePool (RowInfoArray
);
557 Prints a formatted Unicode string to a graphics console device specified by
558 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
560 This function prints a formatted Unicode string to the graphics console device
561 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
562 Unicode characters displayed, not including partial characters that may be clipped
563 by the right edge of the display. If the length of the formatted Unicode string is
564 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
565 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL
566 StringToImage() service is used to convert the string to a bitmap using the glyphs
567 registered with the HII database. No wrapping is performed, so any portions of the
568 string the fall outside the active display region will not be displayed. Please see
569 Section 27.2.6 of the UEFI Specification for a description of the supported string
570 format including the set of control codes supported by the StringToImage() service.
572 If a graphics console device is not associated with the ConsoleOutputHandle
573 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
574 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
575 string is printed, and 0 is returned.
576 If Format is NULL, then ASSERT().
577 If Format is not aligned on a 16-bit boundary, then ASSERT().
578 If gST->ConsoleOutputHandle is NULL, then ASSERT().
580 @param PointX An X coordinate to print the string.
581 @param PointY A Y coordinate to print the string.
582 @param ForeGround The foreground color of the string being printed. This is
583 an optional parameter that may be NULL. If it is NULL,
584 then the foreground color of the current ConOut device
585 in the EFI_SYSTEM_TABLE is used.
586 @param BackGround The background color of the string being printed. This is
587 an optional parameter that may be NULL. If it is NULL,
588 then the background color of the current ConOut device
589 in the EFI_SYSTEM_TABLE is used.
590 @param Format A Null-terminated Unicode format string. See Print Library
591 for the supported format string syntax.
592 @param ... A Variable argument list whose contents are accessed based on
593 the format string specified by Format.
595 @return The number of Unicode characters printed.
603 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
604 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
605 IN CONST CHAR16
*Format
,
615 ASSERT (Format
!= NULL
);
616 ASSERT (((UINTN
) Format
& BIT0
) == 0);
618 VA_START (Marker
, Format
);
620 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
622 Buffer
= (CHAR16
*) AllocatePool (BufferSize
);
623 ASSERT (Buffer
!= NULL
);
625 PrintNum
= UnicodeVSPrint (Buffer
, BufferSize
, Format
, Marker
);
629 ReturnNum
= InternalPrintGraphic (PointX
, PointY
, ForeGround
, BackGround
, Buffer
, PrintNum
);
637 Prints a formatted ASCII string to a graphics console device specified by
638 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
640 This function prints a formatted ASCII string to the graphics console device
641 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
642 ASCII characters displayed, not including partial characters that may be clipped
643 by the right edge of the display. If the length of the formatted ASCII string is
644 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
645 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL
646 StringToImage() service is used to convert the string to a bitmap using the glyphs
647 registered with the HII database. No wrapping is performed, so any portions of the
648 string the fall outside the active display region will not be displayed. Please see
649 Section 27.2.6 of the UEFI Specification for a description of the supported string
650 format including the set of control codes supported by the StringToImage() service.
652 If a graphics console device is not associated with the ConsoleOutputHandle
653 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
654 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
655 string is printed, and 0 is returned.
656 If Format is NULL, then ASSERT().
657 If gST->ConsoleOutputHandle is NULL, then ASSERT().
659 @param PointX An X coordinate to print the string.
660 @param PointY A Y coordinate to print the string.
661 @param ForeGround The foreground color of the string being printed. This is
662 an optional parameter that may be NULL. If it is NULL,
663 then the foreground color of the current ConOut device
664 in the EFI_SYSTEM_TABLE is used.
665 @param BackGround The background color of the string being printed. This is
666 an optional parameter that may be NULL. If it is NULL,
667 then the background color of the current ConOut device
668 in the EFI_SYSTEM_TABLE is used.
669 @param Format A Null-terminated ASCII format string. See Print Library
670 for the supported format string syntax.
671 @param ... Variable argument list whose contents are accessed based on
672 the format string specified by Format.
674 @return The number of ASCII characters printed.
682 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
683 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
684 IN CONST CHAR8
*Format
,
694 ASSERT (Format
!= NULL
);
696 VA_START (Marker
, Format
);
698 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
700 Buffer
= (CHAR16
*) AllocatePool (BufferSize
);
701 ASSERT (Buffer
!= NULL
);
703 PrintNum
= UnicodeSPrintAsciiFormat (Buffer
, BufferSize
, Format
, Marker
);
707 ReturnNum
= InternalPrintGraphic (PointX
, PointY
, ForeGround
, BackGround
, Buffer
, PrintNum
);
715 Appends a formatted Unicode string to a Null-terminated Unicode string
717 This function appends a formatted Unicode string to the Null-terminated
718 Unicode string specified by String. String is optional and may be NULL.
719 Storage for the formatted Unicode string returned is allocated using
720 AllocatePool(). The pointer to the appended string is returned. The caller
721 is responsible for freeing the returned string.
723 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
724 If FormatString is NULL, then ASSERT().
725 If FormatString is not aligned on a 16-bit boundary, then ASSERT().
727 @param[in] String A Null-terminated Unicode string.
728 @param[in] FormatString A Null-terminated Unicode format string.
729 @param[in] Marker VA_LIST marker for the variable argument list.
731 @retval NULL There was not enough available memory.
732 @return Null-terminated Unicode string is that is the formatted
733 string appended to String.
738 IN CHAR16
*String
, OPTIONAL
739 IN CONST CHAR16
*FormatString
,
743 UINTN CharactersRequired
;
745 CHAR16
*BufferToReturn
;
748 VA_COPY (ExtraMarker
, Marker
);
749 CharactersRequired
= SPrintLength(FormatString
, ExtraMarker
);
750 VA_END (ExtraMarker
);
752 if (String
!= NULL
) {
753 SizeRequired
= StrSize(String
) + (CharactersRequired
* sizeof(CHAR16
));
755 SizeRequired
= sizeof(CHAR16
) + (CharactersRequired
* sizeof(CHAR16
));
758 BufferToReturn
= AllocatePool(SizeRequired
);
760 if (BufferToReturn
== NULL
) {
763 BufferToReturn
[0] = L
'\0';
766 if (String
!= NULL
) {
767 StrCpyS(BufferToReturn
, SizeRequired
/ sizeof(CHAR16
), String
);
770 UnicodeVSPrint(BufferToReturn
+ StrLen(BufferToReturn
), (CharactersRequired
+1) * sizeof(CHAR16
), FormatString
, Marker
);
772 ASSERT(StrSize(BufferToReturn
)==SizeRequired
);
774 return (BufferToReturn
);
778 Appends a formatted Unicode string to a Null-terminated Unicode string
780 This function appends a formatted Unicode string to the Null-terminated
781 Unicode string specified by String. String is optional and may be NULL.
782 Storage for the formatted Unicode string returned is allocated using
783 AllocatePool(). The pointer to the appended string is returned. The caller
784 is responsible for freeing the returned string.
786 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
787 If FormatString is NULL, then ASSERT().
788 If FormatString is not aligned on a 16-bit boundary, then ASSERT().
790 @param[in] String A Null-terminated Unicode string.
791 @param[in] FormatString A Null-terminated Unicode format string.
792 @param[in] ... The variable argument list whose contents are
793 accessed based on the format string specified by
796 @retval NULL There was not enough available memory.
797 @return Null-terminated Unicode string is that is the formatted
798 string appended to String.
803 IN CHAR16
*String
, OPTIONAL
804 IN CONST CHAR16
*FormatString
,
811 VA_START (Marker
, FormatString
);
812 NewString
= CatVSPrint(String
, FormatString
, Marker
);