Cc: Jiewen Yao <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
---
 MdePkg/Include/Library/BaseLib.h | 11 +++++++++++
 MdePkg/Library/BaseLib/String.c  | 11 +++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 79f421a97111..7e085b93a669 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -1020,7 +1020,11 @@ StrHexToUint64 (
   IN      CONST CHAR16             *String
   );
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Convert a Null-terminated Unicode string to a Null-terminated
   ASCII string and returns the ASCII string.
 
@@ -1060,6 +1064,8 @@ UnicodeStrToAsciiStr (
   OUT     CHAR8                     *Destination
   );
 
+#endif
+
 /**
   Convert a Null-terminated Unicode string to a Null-terminated
   ASCII string.
@@ -1611,8 +1617,11 @@ AsciiStrHexToUint64 (
   IN      CONST CHAR8                *String
   );
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
 
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Convert one Null-terminated ASCII string to a Null-terminated
   Unicode string and returns the Unicode string.
 
@@ -1646,6 +1655,8 @@ AsciiStrToUnicodeStr (
   OUT     CHAR16                    *Destination
   );
 
+#endif
+
 /**
   Convert one Null-terminated ASCII string to a Null-terminated
   Unicode string.
diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index 92992a5d27e0..07c0562f3bfc 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -1000,7 +1000,11 @@ InternalAsciiIsHexaDecimalDigitCharacter (
     (Char >= 'a' && Char <= 'f'));
 }
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Convert a Null-terminated Unicode string to a Null-terminated
   ASCII string and returns the ASCII string.
 
@@ -1078,8 +1082,6 @@ UnicodeStrToAsciiStr (
   return ReturnValue;
 }
 
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
 /**
   [ATTENTION] This function will be deprecated for security reason.
 
@@ -1986,8 +1988,11 @@ AsciiStrHexToUint64 (
   return Result;
 }
 
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
 
 /**
+  [ATTENTION] This function is deprecated for security reason.
+
   Convert one Null-terminated ASCII string to a Null-terminated
   Unicode string and returns the Unicode string.
 
@@ -2054,6 +2059,8 @@ AsciiStrToUnicodeStr (
   return ReturnValue;
 }
 
+#endif
+
 /**
   Converts an 8-bit value to an 8-bit BCD value.
 
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to