2 This driver produces Print2 protocols layered on top of the PrintLib from the MdePkg.
4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Protocol/Print2.h>
12 #include <Library/PrintLib.h>
13 #include <Library/UefiBootServicesTableLib.h>
14 #include <Library/DebugLib.h>
15 #include <Library/UefiDriverEntryPoint.h>
18 Implementaion of the UnicodeValueToString service in EFI_PRINT2_PROTOCOL.
21 @param Buffer The pointer to the output buffer for the produced
22 Null-terminated Unicode string.
23 @param Flags The bitmask of flags that specify left justification, zero
25 @param Value The 64-bit signed value to convert to a string.
26 @param Width The maximum number of Unicode characters to place in Buffer,
27 not including the Null-terminator.
35 PrintDxeUnicodeValueToString (
36 IN OUT CHAR16
*Buffer
,
42 DEBUG ((DEBUG_ERROR
, "PrintDxe: The UnicodeValueToString service in EFI_PRINT2_PROTOCOL is no longer supported for security reason.\n"));
43 DEBUG ((DEBUG_ERROR
, "PrintDxe: Please consider using the UnicodeValueToStringS service in EFI_PRINT2S_PROTOCOL.\n"));
50 Implementaion of the AsciiValueToString service in EFI_PRINT2_PROTOCOL.
52 @param Buffer A pointer to the output buffer for the produced
53 Null-terminated ASCII string.
54 @param Flags The bitmask of flags that specify left justification, zero
56 @param Value The 64-bit signed value to convert to a string.
57 @param Width The maximum number of ASCII characters to place in Buffer,
58 not including the Null-terminator.
65 PrintDxeAsciiValueToString (
73 DEBUG ((DEBUG_ERROR
, "PrintDxe: The AsciiValueToString service in EFI_PRINT2_PROTOCOL is no longer supported for security reason.\n"));
74 DEBUG ((DEBUG_ERROR
, "PrintDxe: Please consider using the AsciiValueToStringS service in EFI_PRINT2S_PROTOCOL.\n"));
80 EFI_HANDLE mPrintThunkHandle
= NULL
;
82 CONST EFI_PRINT2_PROTOCOL mPrint2Protocol
= {
85 UnicodeBSPrintAsciiFormat
,
86 UnicodeSPrintAsciiFormat
,
87 PrintDxeUnicodeValueToString
,
90 AsciiBSPrintUnicodeFormat
,
91 AsciiSPrintUnicodeFormat
,
92 PrintDxeAsciiValueToString
95 CONST EFI_PRINT2S_PROTOCOL mPrint2SProtocol
= {
98 UnicodeBSPrintAsciiFormat
,
99 UnicodeSPrintAsciiFormat
,
100 UnicodeValueToStringS
,
103 AsciiBSPrintUnicodeFormat
,
104 AsciiSPrintUnicodeFormat
,
109 The user Entry Point for Print module.
111 This is the entry point for Print DXE Driver. It installs the Print2 Protocol.
113 @param[in] ImageHandle The firmware allocated handle for the EFI image.
114 @param[in] SystemTable A pointer to the EFI System Table.
116 @retval EFI_SUCCESS The entry point is executed successfully.
117 @retval Others Some error occurs when executing this entry point.
123 IN EFI_HANDLE ImageHandle
,
124 IN EFI_SYSTEM_TABLE
*SystemTable
129 Status
= gBS
->InstallMultipleProtocolInterfaces (
131 &gEfiPrint2ProtocolGuid
, &mPrint2Protocol
,
132 &gEfiPrint2SProtocolGuid
, &mPrint2SProtocol
,
135 ASSERT_EFI_ERROR (Status
);