[edk2] [PATCH 7/7] MdePkg/BasePrintLib: Add deprecated flag for APIs [A|U]ValueToString

Hao Wu posted 7 patches 7 years, 8 months ago
[edk2] [PATCH 7/7] MdePkg/BasePrintLib: Add deprecated flag for APIs [A|U]ValueToString
Posted by Hao Wu 7 years, 8 months ago
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 MdePkg/Include/Library/PrintLib.h      | 12 ++++++++++++
 MdePkg/Library/BasePrintLib/PrintLib.c | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/MdePkg/Include/Library/PrintLib.h b/MdePkg/Include/Library/PrintLib.h
index 8c11dab..9fe3609 100644
--- a/MdePkg/Include/Library/PrintLib.h
+++ b/MdePkg/Include/Library/PrintLib.h
@@ -491,7 +491,11 @@ UnicodeSPrintAsciiFormat (
   ...
   );
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Converts a decimal value to a Null-terminated Unicode string.
   
   Converts the decimal number specified by Value to a Null-terminated Unicode 
@@ -541,6 +545,8 @@ UnicodeValueToString (
   IN UINTN       Width
   );
 
+#endif
+
 /**
   Converts a decimal value to a Null-terminated Unicode string.
 
@@ -882,7 +888,11 @@ AsciiSPrintUnicodeFormat (
   ...
   );
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Converts a decimal value to a Null-terminated ASCII string.
   
   Converts the decimal number specified by Value to a Null-terminated ASCII string 
@@ -931,6 +941,8 @@ AsciiValueToString (
   IN  UINTN      Width
   );
 
+#endif
+
 /**
   Converts a decimal value to a Null-terminated Ascii string.
 
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c
index 221b52e..7453e95 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -349,7 +349,11 @@ UnicodeSPrintAsciiFormat (
   return NumberOfPrinted;
 }
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Converts a decimal value to a Null-terminated Unicode string.
   
   Converts the decimal number specified by Value to a Null-terminated Unicode 
@@ -403,6 +407,8 @@ UnicodeValueToString (
   return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2);
 }
 
+#endif
+
 /**
   Converts a decimal value to a Null-terminated Unicode string.
 
@@ -781,7 +787,11 @@ AsciiSPrintUnicodeFormat (
 }
 
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Converts a decimal value to a Null-terminated ASCII string.
   
   Converts the decimal number specified by Value to a Null-terminated ASCII string 
@@ -833,6 +843,8 @@ AsciiValueToString (
   return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);
 }
 
+#endif
+
 /**
   Converts a decimal value to a Null-terminated Ascii string.
 
-- 
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel