Changeset 77662 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/PrintDxe/Print.c
- Timestamp:
- Mar 12, 2019 12:40:12 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129295
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776 /vendor/edk2/current 103735-103757,103769-103776,129194-129237
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/PrintDxe/Print.c
r48674 r77662 1 1 /** @file 2 This driver produces Print2 protocol layered on top of the PrintLib from the MdePkg.2 This driver produces Print2 protocols layered on top of the PrintLib from the MdePkg. 3 3 4 Copyright (c) 2009 , Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 21 21 #include <Library/UefiDriverEntryPoint.h> 22 22 23 /** 24 Implementaion of the UnicodeValueToString service in EFI_PRINT2_PROTOCOL. 25 26 If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then ASSERT(). 27 28 @param Buffer The pointer to the output buffer for the produced 29 Null-terminated Unicode string. 30 @param Flags The bitmask of flags that specify left justification, zero 31 pad, and commas. 32 @param Value The 64-bit signed value to convert to a string. 33 @param Width The maximum number of Unicode characters to place in Buffer, 34 not including the Null-terminator. 35 36 @return If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, return 0. 37 Otherwise, return the number of Unicode characters in Buffer not 38 including the Null-terminator. 39 40 **/ 41 UINTN 42 EFIAPI 43 PrintDxeUnicodeValueToString ( 44 IN OUT CHAR16 *Buffer, 45 IN UINTN Flags, 46 IN INT64 Value, 47 IN UINTN Width 48 ) 49 { 50 #ifdef DISABLE_NEW_DEPRECATED_INTERFACES 51 // 52 // If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then the 53 // PrintLib API UnicodeValueToString is already deprecated. 54 // In this case, ASSERT will be triggered and zero will be returned for the 55 // implementation of the UnicodeValueToString service in EFI_PRINT2_PROTOCOL 56 // to indicate that the service is no longer supported. 57 // 58 DEBUG ((DEBUG_ERROR, "PrintDxe: The UnicodeValueToString service in EFI_PRINT2_PROTOCOL is no longer supported for security reason.\n")); 59 DEBUG ((DEBUG_ERROR, "PrintDxe: Please consider using the UnicodeValueToStringS service in EFI_PRINT2S_PROTOCOL.\n")); 60 ASSERT (FALSE); 61 return 0; 62 #else 63 return UnicodeValueToString (Buffer, Flags, Value, Width); 64 #endif 65 } 66 67 /** 68 Implementaion of the AsciiValueToString service in EFI_PRINT2_PROTOCOL. 69 70 If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then ASSERT(). 71 72 @param Buffer A pointer to the output buffer for the produced 73 Null-terminated ASCII string. 74 @param Flags The bitmask of flags that specify left justification, zero 75 pad, and commas. 76 @param Value The 64-bit signed value to convert to a string. 77 @param Width The maximum number of ASCII characters to place in Buffer, 78 not including the Null-terminator. 79 80 @return If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, return 0. 81 Otherwise, return the number of ASCII characters in Buffer not 82 including the Null-terminator. 83 84 **/ 85 UINTN 86 EFIAPI 87 PrintDxeAsciiValueToString ( 88 OUT CHAR8 *Buffer, 89 IN UINTN Flags, 90 IN INT64 Value, 91 IN UINTN Width 92 ) 93 { 94 #ifdef DISABLE_NEW_DEPRECATED_INTERFACES 95 // 96 // If the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined, then the 97 // PrintLib API AsciiValueToString is already deprecated. 98 // In this case, ASSERT will be triggered and zero will be returned for the 99 // implementation of the AsciiValueToString service in EFI_PRINT2_PROTOCOL 100 // to indicate that the service is no longer supported. 101 // 102 DEBUG ((DEBUG_ERROR, "PrintDxe: The AsciiValueToString service in EFI_PRINT2_PROTOCOL is no longer supported for security reason.\n")); 103 DEBUG ((DEBUG_ERROR, "PrintDxe: Please consider using the AsciiValueToStringS service in EFI_PRINT2S_PROTOCOL.\n")); 104 ASSERT (FALSE); 105 return 0; 106 #else 107 return AsciiValueToString (Buffer, Flags, Value, Width); 108 #endif 109 } 110 23 111 EFI_HANDLE mPrintThunkHandle = NULL; 24 112 … … 28 116 UnicodeBSPrintAsciiFormat, 29 117 UnicodeSPrintAsciiFormat, 30 UnicodeValueToString,118 PrintDxeUnicodeValueToString, 31 119 AsciiBSPrint, 32 120 AsciiSPrint, 33 121 AsciiBSPrintUnicodeFormat, 34 122 AsciiSPrintUnicodeFormat, 35 AsciiValueToString 123 PrintDxeAsciiValueToString 124 }; 125 126 CONST EFI_PRINT2S_PROTOCOL mPrint2SProtocol = { 127 UnicodeBSPrint, 128 UnicodeSPrint, 129 UnicodeBSPrintAsciiFormat, 130 UnicodeSPrintAsciiFormat, 131 UnicodeValueToStringS, 132 AsciiBSPrint, 133 AsciiSPrint, 134 AsciiBSPrintUnicodeFormat, 135 AsciiSPrintUnicodeFormat, 136 AsciiValueToStringS 36 137 }; 37 138 … … 60 161 &mPrintThunkHandle, 61 162 &gEfiPrint2ProtocolGuid, &mPrint2Protocol, 163 &gEfiPrint2SProtocolGuid, &mPrint2SProtocol, 62 164 NULL 63 165 );
Note:
See TracChangeset
for help on using the changeset viewer.