2 Mde UEFI library API implementation.
3 Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
5 Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "UefiLibInternal.h"
18 GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors
[16] = {
19 { 0x00, 0x00, 0x00, 0x00 },
20 { 0x98, 0x00, 0x00, 0x00 },
21 { 0x00, 0x98, 0x00, 0x00 },
22 { 0x98, 0x98, 0x00, 0x00 },
23 { 0x00, 0x00, 0x98, 0x00 },
24 { 0x98, 0x00, 0x98, 0x00 },
25 { 0x00, 0x98, 0x98, 0x00 },
26 { 0x98, 0x98, 0x98, 0x00 },
27 { 0x10, 0x10, 0x10, 0x00 },
28 { 0xff, 0x10, 0x10, 0x00 },
29 { 0x10, 0xff, 0x10, 0x00 },
30 { 0xff, 0xff, 0x10, 0x00 },
31 { 0x10, 0x10, 0xff, 0x00 },
32 { 0xf0, 0x10, 0xff, 0x00 },
33 { 0x10, 0xff, 0xff, 0x00 },
34 { 0xff, 0xff, 0xff, 0x00 }
38 Internal function which prints a formatted Unicode string to the console output device
41 This function prints a formatted Unicode string to the console output device
42 specified by Console and returns the number of Unicode characters that printed
43 to it. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,
44 then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
45 If Format is NULL, then ASSERT().
46 If Format is not aligned on a 16-bit boundary, then ASSERT().
48 @param Format A Null-terminated Unicode format string.
49 @param Console The output console.
50 @param Marker A VA_LIST marker for the variable argument list.
52 @return The number of Unicode characters in the produced
53 output buffer, not including the Null-terminator.
57 IN CONST CHAR16
*Format
,
58 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*Console
,
67 ASSERT (Format
!= NULL
);
68 ASSERT (((UINTN
) Format
& BIT0
) == 0);
69 ASSERT (Console
!= NULL
);
71 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
73 Buffer
= (CHAR16
*) AllocatePool(BufferSize
);
74 ASSERT (Buffer
!= NULL
);
76 Return
= UnicodeVSPrint (Buffer
, BufferSize
, Format
, Marker
);
78 if (Console
!= NULL
&& Return
> 0) {
80 // To be extra safe make sure Console has been initialized
82 Status
= Console
->OutputString (Console
, Buffer
);
83 if (EFI_ERROR (Status
)) {
94 Prints a formatted Unicode string to the console output device specified by
95 ConOut defined in the EFI_SYSTEM_TABLE.
97 This function prints a formatted Unicode string to the console output device
98 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
99 characters that printed to ConOut. If the length of the formatted Unicode
100 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
101 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
102 If Format is NULL, then ASSERT().
103 If Format is not aligned on a 16-bit boundary, then ASSERT().
104 If gST->ConOut is NULL, then ASSERT().
106 @param Format A Null-terminated Unicode format string.
107 @param ... A Variable argument list whose contents are accessed based
108 on the format string specified by Format.
110 @return The number of Unicode characters printed to ConOut.
116 IN CONST CHAR16
*Format
,
123 VA_START (Marker
, Format
);
125 Return
= InternalPrint (Format
, gST
->ConOut
, Marker
);
133 Prints a formatted Unicode string to the console output device specified by
134 StdErr defined in the EFI_SYSTEM_TABLE.
136 This function prints a formatted Unicode string to the console output device
137 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
138 characters that printed to StdErr. If the length of the formatted Unicode
139 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
140 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
141 If Format is NULL, then ASSERT().
142 If Format is not aligned on a 16-bit boundary, then ASSERT().
143 If gST->StdErr is NULL, then ASSERT().
145 @param Format A Null-terminated Unicode format string.
146 @param ... Variable argument list whose contents are accessed based
147 on the format string specified by Format.
149 @return The number of Unicode characters printed to StdErr.
155 IN CONST CHAR16
*Format
,
162 VA_START (Marker
, Format
);
164 Return
= InternalPrint( Format
, gST
->StdErr
, Marker
);
173 Internal function which prints a formatted ASCII string to the console output device
176 This function prints a formatted ASCII string to the console output device
177 specified by Console and returns the number of ASCII characters that printed
178 to it. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,
179 then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.
181 If Format is NULL, then ASSERT().
183 @param Format A Null-terminated ASCII format string.
184 @param Console The output console.
185 @param Marker VA_LIST marker for the variable argument list.
187 @return The number of Unicode characters in the produced
188 output buffer not including the Null-terminator.
193 IN CONST CHAR8
*Format
,
194 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*Console
,
203 ASSERT (Format
!= NULL
);
204 ASSERT (Console
!= NULL
);
206 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
208 Buffer
= (CHAR16
*) AllocatePool(BufferSize
);
209 ASSERT (Buffer
!= NULL
);
211 Return
= UnicodeVSPrintAsciiFormat (Buffer
, BufferSize
, Format
, Marker
);
213 if (Console
!= NULL
) {
215 // To be extra safe make sure Console has been initialized
217 Status
= Console
->OutputString (Console
, Buffer
);
218 if (EFI_ERROR (Status
)) {
229 Prints a formatted ASCII string to the console output device specified by
230 ConOut defined in the EFI_SYSTEM_TABLE.
232 This function prints a formatted ASCII string to the console output device
233 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
234 characters that printed to ConOut. If the length of the formatted ASCII
235 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
236 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
237 If Format is NULL, then ASSERT().
238 If gST->ConOut is NULL, then ASSERT().
240 @param Format A Null-terminated ASCII format string.
241 @param ... Variable argument list whose contents are accessed based
242 on the format string specified by Format.
244 @return The number of ASCII characters printed to ConOut.
250 IN CONST CHAR8
*Format
,
256 ASSERT (Format
!= NULL
);
258 VA_START (Marker
, Format
);
260 Return
= AsciiInternalPrint( Format
, gST
->ConOut
, Marker
);
268 Prints a formatted ASCII string to the console output device specified by
269 StdErr defined in the EFI_SYSTEM_TABLE.
271 This function prints a formatted ASCII string to the console output device
272 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
273 characters that printed to StdErr. If the length of the formatted ASCII
274 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
275 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
276 If Format is NULL, then ASSERT().
277 If gST->StdErr is NULL, then ASSERT().
279 @param Format A Null-terminated ASCII format string.
280 @param ... Variable argument list whose contents are accessed based
281 on the format string specified by Format.
283 @return The number of ASCII characters printed to ConErr.
289 IN CONST CHAR8
*Format
,
296 ASSERT (Format
!= NULL
);
298 VA_START (Marker
, Format
);
300 Return
= AsciiInternalPrint( Format
, gST
->StdErr
, Marker
);
308 Internal function to print a formatted Unicode string to a graphics console device specified by
309 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
311 This function prints a formatted Unicode string to the graphics console device
312 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
313 Unicode characters printed. The EFI_HII_FONT_PROTOCOL is used to convert the
314 string to a bitmap using the glyphs registered with the
315 HII database. No wrapping is performed, so any portions of the string the fall
316 outside the active display region will not be displayed.
318 If a graphics console device is not associated with the ConsoleOutputHandle
319 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
320 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
321 string is printed, and 0 is returned.
323 @param PointX An X coordinate to print the string.
324 @param PointY A Y coordinate to print the string.
325 @param Foreground The foreground color of the string being printed. This is
326 an optional parameter that may be NULL. If it is NULL,
327 then the foreground color of the current ConOut device
328 in the EFI_SYSTEM_TABLE is used.
329 @param Background The background color of the string being printed. This is
330 an optional parameter that may be NULL. If it is NULL,
331 then the background color of the current ConOut device
332 in the EFI_SYSTEM_TABLE is used.
333 @param Buffer A Null-terminated Unicode formatted string.
334 @param PrintNum The number of Unicode formatted string to be printed.
336 @return The number of Unicode Characters printed. Zero means no any character
337 displayed successfully.
341 InternalPrintGraphic (
344 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Foreground
,
345 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Background
,
351 UINT32 HorizontalResolution
;
352 UINT32 VerticalResolution
;
355 EFI_HII_FONT_PROTOCOL
*HiiFont
;
356 EFI_IMAGE_OUTPUT
*Blt
;
357 EFI_FONT_DISPLAY_INFO FontInfo
;
358 EFI_HII_ROW_INFO
*RowInfoArray
;
359 UINTN RowInfoArraySize
;
360 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
361 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
362 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*Sto
;
363 EFI_HANDLE ConsoleHandle
;
368 HorizontalResolution
= 0;
369 VerticalResolution
= 0;
373 ConsoleHandle
= gST
->ConsoleOutHandle
;
375 ASSERT( ConsoleHandle
!= NULL
);
377 Status
= gBS
->HandleProtocol (
379 &gEfiGraphicsOutputProtocolGuid
,
380 (VOID
**) &GraphicsOutput
384 if (EFI_ERROR (Status
) && FeaturePcdGet (PcdUgaConsumeSupport
)) {
386 // If no GOP available, try to open UGA Draw protocol if supported.
388 GraphicsOutput
= NULL
;
390 Status
= gBS
->HandleProtocol (
392 &gEfiUgaDrawProtocolGuid
,
396 if (EFI_ERROR (Status
)) {
400 Status
= gBS
->HandleProtocol (
402 &gEfiSimpleTextOutProtocolGuid
,
406 if (EFI_ERROR (Status
)) {
410 if (GraphicsOutput
!= NULL
) {
411 HorizontalResolution
= GraphicsOutput
->Mode
->Info
->HorizontalResolution
;
412 VerticalResolution
= GraphicsOutput
->Mode
->Info
->VerticalResolution
;
413 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
414 UgaDraw
->GetMode (UgaDraw
, &HorizontalResolution
, &VerticalResolution
, &ColorDepth
, &RefreshRate
);
419 ASSERT ((HorizontalResolution
!= 0) && (VerticalResolution
!=0));
421 Status
= gBS
->LocateProtocol (&gEfiHiiFontProtocolGuid
, NULL
, (VOID
**) &HiiFont
);
422 if (EFI_ERROR (Status
)) {
426 Blt
= (EFI_IMAGE_OUTPUT
*) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT
));
427 ASSERT (Blt
!= NULL
);
429 Blt
->Width
= (UINT16
) (HorizontalResolution
);
430 Blt
->Height
= (UINT16
) (VerticalResolution
);
432 ZeroMem (&FontInfo
, sizeof (EFI_FONT_DISPLAY_INFO
));
434 if (Foreground
!= NULL
) {
435 CopyMem (&FontInfo
.ForegroundColor
, Foreground
, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
438 &FontInfo
.ForegroundColor
,
439 &mEfiColors
[Sto
->Mode
->Attribute
& 0x0f],
440 sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
443 if (Background
!= NULL
) {
444 CopyMem (&FontInfo
.BackgroundColor
, Background
, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
447 &FontInfo
.BackgroundColor
,
448 &mEfiColors
[Sto
->Mode
->Attribute
>> 4],
449 sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
453 if (GraphicsOutput
!= NULL
) {
454 Blt
->Image
.Screen
= GraphicsOutput
;
456 Status
= HiiFont
->StringToImage (
458 EFI_HII_IGNORE_IF_NO_GLYPH
| EFI_HII_OUT_FLAG_CLIP
|
459 EFI_HII_OUT_FLAG_CLIP_CLEAN_X
| EFI_HII_OUT_FLAG_CLIP_CLEAN_Y
|
460 EFI_HII_IGNORE_LINE_BREAK
| EFI_HII_DIRECT_TO_SCREEN
,
470 if (EFI_ERROR (Status
)) {
474 } else if (FeaturePcdGet (PcdUgaConsumeSupport
)) {
475 ASSERT (UgaDraw
!= NULL
);
477 Blt
->Image
.Bitmap
= AllocateZeroPool (Blt
->Width
* Blt
->Height
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
478 ASSERT (Blt
->Image
.Bitmap
!= NULL
);
481 // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
482 // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
484 Status
= HiiFont
->StringToImage (
486 EFI_HII_IGNORE_IF_NO_GLYPH
| EFI_HII_OUT_FLAG_CLIP
|
487 EFI_HII_OUT_FLAG_CLIP_CLEAN_X
| EFI_HII_OUT_FLAG_CLIP_CLEAN_Y
|
488 EFI_HII_IGNORE_LINE_BREAK
,
499 if (!EFI_ERROR (Status
)) {
500 ASSERT (RowInfoArray
!= NULL
);
502 // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will
503 // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
505 ASSERT (RowInfoArraySize
<= 1);
507 if (RowInfoArraySize
!= 0) {
508 Width
= RowInfoArray
[0].LineWidth
;
509 Height
= RowInfoArray
[0].LineHeight
;
510 Delta
= Blt
->Width
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
);
516 Status
= UgaDraw
->Blt (
518 (EFI_UGA_PIXEL
*) Blt
->Image
.Bitmap
,
519 EfiUgaBltBufferToVideo
,
531 FreePool (Blt
->Image
.Bitmap
);
536 // Calculate the number of actual printed characters
538 if (RowInfoArraySize
!= 0) {
539 PrintNum
= RowInfoArray
[0].EndIndex
- RowInfoArray
[0].StartIndex
+ 1;
544 FreePool (RowInfoArray
);
556 Prints a formatted Unicode string to a graphics console device specified by
557 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
559 This function prints a formatted Unicode string to the graphics console device
560 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
561 Unicode characters displayed, not including partial characters that may be clipped
562 by the right edge of the display. If the length of the formatted Unicode string is
563 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
564 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL
565 StringToImage() service is used to convert the string to a bitmap using the glyphs
566 registered with the HII database. No wrapping is performed, so any portions of the
567 string the fall outside the active display region will not be displayed. Please see
568 Section 27.2.6 of the UEFI Specification for a description of the supported string
569 format including the set of control codes supported by the StringToImage() service.
571 If a graphics console device is not associated with the ConsoleOutputHandle
572 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
573 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
574 string is printed, and 0 is returned.
575 If Format is NULL, then ASSERT().
576 If Format is not aligned on a 16-bit boundary, then ASSERT().
577 If gST->ConsoleOutputHandle is NULL, then ASSERT().
579 @param PointX An X coordinate to print the string.
580 @param PointY A Y coordinate to print the string.
581 @param ForeGround The foreground color of the string being printed. This is
582 an optional parameter that may be NULL. If it is NULL,
583 then the foreground color of the current ConOut device
584 in the EFI_SYSTEM_TABLE is used.
585 @param BackGround The background color of the string being printed. This is
586 an optional parameter that may be NULL. If it is NULL,
587 then the background color of the current ConOut device
588 in the EFI_SYSTEM_TABLE is used.
589 @param Format A Null-terminated Unicode format string. See Print Library
590 for the supported format string syntax.
591 @param ... A Variable argument list whose contents are accessed based on
592 the format string specified by Format.
594 @return The number of Unicode characters printed.
602 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
603 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
604 IN CONST CHAR16
*Format
,
614 ASSERT (Format
!= NULL
);
615 ASSERT (((UINTN
) Format
& BIT0
) == 0);
617 VA_START (Marker
, Format
);
619 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
621 Buffer
= (CHAR16
*) AllocatePool (BufferSize
);
622 ASSERT (Buffer
!= NULL
);
624 PrintNum
= UnicodeVSPrint (Buffer
, BufferSize
, Format
, Marker
);
628 ReturnNum
= InternalPrintGraphic (PointX
, PointY
, ForeGround
, BackGround
, Buffer
, PrintNum
);
636 Prints a formatted ASCII string to a graphics console device specified by
637 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
639 This function prints a formatted ASCII string to the graphics console device
640 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
641 ASCII characters displayed, not including partial characters that may be clipped
642 by the right edge of the display. If the length of the formatted ASCII string is
643 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
644 PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL
645 StringToImage() service is used to convert the string to a bitmap using the glyphs
646 registered with the HII database. No wrapping is performed, so any portions of the
647 string the fall outside the active display region will not be displayed. Please see
648 Section 27.2.6 of the UEFI Specification for a description of the supported string
649 format including the set of control codes supported by the StringToImage() service.
651 If a graphics console device is not associated with the ConsoleOutputHandle
652 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
653 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
654 string is printed, and 0 is returned.
655 If Format is NULL, then ASSERT().
656 If gST->ConsoleOutputHandle is NULL, then ASSERT().
658 @param PointX An X coordinate to print the string.
659 @param PointY A Y coordinate to print the string.
660 @param ForeGround The foreground color of the string being printed. This is
661 an optional parameter that may be NULL. If it is NULL,
662 then the foreground color of the current ConOut device
663 in the EFI_SYSTEM_TABLE is used.
664 @param BackGround The background color of the string being printed. This is
665 an optional parameter that may be NULL. If it is NULL,
666 then the background color of the current ConOut device
667 in the EFI_SYSTEM_TABLE is used.
668 @param Format A Null-terminated ASCII format string. See Print Library
669 for the supported format string syntax.
670 @param ... Variable argument list whose contents are accessed based on
671 the format string specified by Format.
673 @return The number of ASCII characters printed.
681 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
682 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
683 IN CONST CHAR8
*Format
,
693 ASSERT (Format
!= NULL
);
695 VA_START (Marker
, Format
);
697 BufferSize
= (PcdGet32 (PcdUefiLibMaxPrintBufferSize
) + 1) * sizeof (CHAR16
);
699 Buffer
= (CHAR16
*) AllocatePool (BufferSize
);
700 ASSERT (Buffer
!= NULL
);
702 PrintNum
= UnicodeSPrintAsciiFormat (Buffer
, BufferSize
, Format
, Marker
);
706 ReturnNum
= InternalPrintGraphic (PointX
, PointY
, ForeGround
, BackGround
, Buffer
, PrintNum
);
714 Appends a formatted Unicode string to a Null-terminated Unicode string
716 This function appends a formatted Unicode string to the Null-terminated
717 Unicode string specified by String. String is optional and may be NULL.
718 Storage for the formatted Unicode string returned is allocated using
719 AllocatePool(). The pointer to the appended string is returned. The caller
720 is responsible for freeing the returned string.
722 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
723 If FormatString is NULL, then ASSERT().
724 If FormatString is not aligned on a 16-bit boundary, then ASSERT().
726 @param[in] String A Null-terminated Unicode string.
727 @param[in] FormatString A Null-terminated Unicode format string.
728 @param[in] Marker VA_LIST marker for the variable argument list.
730 @retval NULL There was not enough available memory.
731 @return Null-terminated Unicode string is that is the formatted
732 string appended to String.
737 IN CHAR16
*String
, OPTIONAL
738 IN CONST CHAR16
*FormatString
,
742 UINTN CharactersRequired
;
744 CHAR16
*BufferToReturn
;
747 VA_COPY (ExtraMarker
, Marker
);
748 CharactersRequired
= SPrintLength(FormatString
, ExtraMarker
);
749 VA_END (ExtraMarker
);
751 if (String
!= NULL
) {
752 SizeRequired
= StrSize(String
) + (CharactersRequired
* sizeof(CHAR16
));
754 SizeRequired
= sizeof(CHAR16
) + (CharactersRequired
* sizeof(CHAR16
));
757 BufferToReturn
= AllocateZeroPool(SizeRequired
);
759 if (BufferToReturn
== NULL
) {
763 if (String
!= NULL
) {
764 StrCpy(BufferToReturn
, String
);
767 UnicodeVSPrint(BufferToReturn
+ StrLen(BufferToReturn
), (CharactersRequired
+1) * sizeof(CHAR16
), FormatString
, Marker
);
769 ASSERT(StrSize(BufferToReturn
)==SizeRequired
);
771 return (BufferToReturn
);
775 Appends a formatted Unicode string to a Null-terminated Unicode string
777 This function appends a formatted Unicode string to the Null-terminated
778 Unicode string specified by String. String is optional and may be NULL.
779 Storage for the formatted Unicode string returned is allocated using
780 AllocatePool(). The pointer to the appended string is returned. The caller
781 is responsible for freeing the returned string.
783 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
784 If FormatString is NULL, then ASSERT().
785 If FormatString is not aligned on a 16-bit boundary, then ASSERT().
787 @param[in] String A Null-terminated Unicode string.
788 @param[in] FormatString A Null-terminated Unicode format string.
789 @param[in] ... The variable argument list whose contents are
790 accessed based on the format string specified by
793 @retval NULL There was not enough available memory.
794 @return Null-terminated Unicode string is that is the formatted
795 string appended to String.
800 IN CHAR16
*String
, OPTIONAL
801 IN CONST CHAR16
*FormatString
,
808 VA_START (Marker
, FormatString
);
809 NewString
= CatVSPrint(String
, FormatString
, Marker
);