]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/BaseLib.h
MdePkg: Fix SafeString performing assertions on runtime checks
[mirror_edk2.git] / MdePkg / Include / Library / BaseLib.h
index b0bbe8cef83430015499cfd7c216228b30fd2a42..8e7b87cbda4e500ecbf56d1c5d59a69899a2c792 100644 (file)
@@ -216,7 +216,6 @@ StrnSizeS (
 \r
   If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
   If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -252,7 +251,6 @@ StrCpyS (
 \r
   If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -290,7 +288,6 @@ StrnCpyS (
 \r
   If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
   If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -330,7 +327,6 @@ StrCatS (
 \r
   If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
   If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -377,12 +373,7 @@ StrnCatS (
   be ignored. Then, the function stops at the first character that is a not a\r
   valid decimal character or a Null-terminator, whichever one comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
 \r
   If String has no valid decimal digits in the above format, then 0 is stored\r
   at the location pointed to by Data.\r
@@ -433,12 +424,7 @@ StrDecimalToUintnS (
   be ignored. Then, the function stops at the first character that is a not a\r
   valid decimal character or a Null-terminator, whichever one comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
 \r
   If String has no valid decimal digits in the above format, then 0 is stored\r
   at the location pointed to by Data.\r
@@ -494,12 +480,7 @@ StrDecimalToUint64S (
   the first character that is a not a valid hexadecimal character or NULL,\r
   whichever one comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
 \r
   If String has no valid hexadecimal digits in the above format, then 0 is\r
   stored at the location pointed to by Data.\r
@@ -555,12 +536,7 @@ StrHexToUintnS (
   the first character that is a not a valid hexadecimal character or NULL,\r
   whichever one comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
 \r
   If String has no valid hexadecimal digits in the above format, then 0 is\r
   stored at the location pointed to by Data.\r
@@ -649,8 +625,6 @@ AsciiStrnSizeS (
 \r
   This function is similar as strcpy_s defined in C11.\r
 \r
-  If an error would be returned, then the function will also ASSERT().\r
-\r
   If an error is returned, then the Destination is unmodified.\r
 \r
   @param  Destination              A pointer to a Null-terminated Ascii string.\r
@@ -683,8 +657,6 @@ AsciiStrCpyS (
 \r
   This function is similar as strncpy_s defined in C11.\r
 \r
-  If an error would be returned, then the function will also ASSERT().\r
-\r
   If an error is returned, then the Destination is unmodified.\r
 \r
   @param  Destination              A pointer to a Null-terminated Ascii string.\r
@@ -719,8 +691,6 @@ AsciiStrnCpyS (
 \r
   This function is similar as strcat_s defined in C11.\r
 \r
-  If an error would be returned, then the function will also ASSERT().\r
-\r
   If an error is returned, then the Destination is unmodified.\r
 \r
   @param  Destination              A pointer to a Null-terminated Ascii string.\r
@@ -757,8 +727,6 @@ AsciiStrCatS (
 \r
   This function is similar as strncat_s defined in C11.\r
 \r
-  If an error would be returned, then the function will also ASSERT().\r
-\r
   If an error is returned, then the Destination is unmodified.\r
 \r
   @param  Destination              A pointer to a Null-terminated Ascii string.\r
@@ -804,12 +772,6 @@ AsciiStrnCatS (
   be ignored. Then, the function stops at the first character that is a not a\r
   valid decimal character or a Null-terminator, whichever one comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than\r
-  PcdMaximumAsciiStringLength Ascii characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
   If String has no valid decimal digits in the above format, then 0 is stored\r
   at the location pointed to by Data.\r
   If the number represented by String exceeds the range defined by UINTN, then\r
@@ -859,12 +821,6 @@ AsciiStrDecimalToUintnS (
   be ignored. Then, the function stops at the first character that is a not a\r
   valid decimal character or a Null-terminator, whichever one comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than\r
-  PcdMaximumAsciiStringLength Ascii characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
   If String has no valid decimal digits in the above format, then 0 is stored\r
   at the location pointed to by Data.\r
   If the number represented by String exceeds the range defined by UINT64, then\r
@@ -918,12 +874,6 @@ AsciiStrDecimalToUint64S (
   character that is a not a valid hexadecimal character or Null-terminator,\r
   whichever on comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than\r
-  PcdMaximumAsciiStringLength Ascii characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
   If String has no valid hexadecimal digits in the above format, then 0 is\r
   stored at the location pointed to by Data.\r
   If the number represented by String exceeds the range defined by UINTN, then\r
@@ -977,12 +927,6 @@ AsciiStrHexToUintnS (
   character that is a not a valid hexadecimal character or Null-terminator,\r
   whichever on comes first.\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Data is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than\r
-  PcdMaximumAsciiStringLength Ascii characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
   If String has no valid hexadecimal digits in the above format, then 0 is\r
   stored at the location pointed to by Data.\r
   If the number represented by String exceeds the range defined by UINT64, then\r
@@ -1533,16 +1477,8 @@ StrHexToUint64 (
   "::" can be used to compress one or more groups of X when X contains only 0.\r
   The "::" can only appear once in the String.\r
 \r
-  If String is NULL, then ASSERT().\r
-\r
-  If Address is NULL, then ASSERT().\r
-\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
 \r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
   If EndPointer is not NULL and Address is translated from String, a pointer\r
   to the character that stopped the scan is stored at the location pointed to\r
   by EndPointer.\r
@@ -1594,16 +1530,8 @@ StrToIpv6Address (
   When /P is in the String, the function stops at the first character that is not\r
   a valid decimal digit character after P is converted.\r
 \r
-  If String is NULL, then ASSERT().\r
-\r
-  If Address is NULL, then ASSERT().\r
-\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
 \r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
   If EndPointer is not NULL and Address is translated from String, a pointer\r
   to the character that stopped the scan is stored at the location pointed to\r
   by EndPointer.\r
@@ -1667,8 +1595,6 @@ StrToIpv4Address (
                   oo          Data4[48:55]\r
                   pp          Data4[56:63]\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Guid is NULL, then ASSERT().\r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
 \r
   @param  String                   Pointer to a Null-terminated Unicode string.\r
@@ -1703,17 +1629,6 @@ StrToGuid (
 \r
   If String is not aligned in a 16-bit boundary, then ASSERT().\r
 \r
-  If String is NULL, then ASSERT().\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-\r
-  If Length is not multiple of 2, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero and Length is greater than\r
-  PcdMaximumUnicodeStringLength, then ASSERT().\r
-\r
-  If MaxBufferSize is less than (Length / 2), then ASSERT().\r
-\r
   @param  String                   Pointer to a Null-terminated Unicode string.\r
   @param  Length                   The number of Unicode characters to decode.\r
   @param  Buffer                   Pointer to the converted bytes array.\r
@@ -1804,7 +1719,6 @@ UnicodeStrToAsciiStr (
   the upper 8 bits, then ASSERT().\r
 \r
   If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -1851,7 +1765,6 @@ UnicodeStrToAsciiStrS (
   If any Unicode characters in Source contain non-zero value in the upper 8\r
   bits, then ASSERT().\r
   If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -2415,10 +2328,6 @@ AsciiStrHexToUint64 (
   "::" can be used to compress one or more groups of X when X contains only 0.\r
   The "::" can only appear once in the String.\r
 \r
-  If String is NULL, then ASSERT().\r
-\r
-  If Address is NULL, then ASSERT().\r
-\r
   If EndPointer is not NULL and Address is translated from String, a pointer\r
   to the character that stopped the scan is stored at the location pointed to\r
   by EndPointer.\r
@@ -2470,10 +2379,6 @@ AsciiStrToIpv6Address (
   When /P is in the String, the function stops at the first character that is not\r
   a valid decimal digit character after P is converted.\r
 \r
-  If String is NULL, then ASSERT().\r
-\r
-  If Address is NULL, then ASSERT().\r
-\r
   If EndPointer is not NULL and Address is translated from String, a pointer\r
   to the character that stopped the scan is stored at the location pointed to\r
   by EndPointer.\r
@@ -2535,9 +2440,6 @@ AsciiStrToIpv4Address (
                   oo          Data4[48:55]\r
                   pp          Data4[56:63]\r
 \r
-  If String is NULL, then ASSERT().\r
-  If Guid is NULL, then ASSERT().\r
-\r
   @param  String                   Pointer to a Null-terminated ASCII string.\r
   @param  Guid                     Pointer to the converted GUID.\r
 \r
@@ -2568,17 +2470,6 @@ AsciiStrToGuid (
   decoding stops after Length of characters and outputs Buffer containing\r
   (Length / 2) bytes.\r
 \r
-  If String is NULL, then ASSERT().\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-\r
-  If Length is not multiple of 2, then ASSERT().\r
-\r
-  If PcdMaximumAsciiStringLength is not zero and Length is greater than\r
-  PcdMaximumAsciiStringLength, then ASSERT().\r
-\r
-  If MaxBufferSize is less than (Length / 2), then ASSERT().\r
-\r
   @param  String                   Pointer to a Null-terminated ASCII string.\r
   @param  Length                   The number of ASCII characters to decode.\r
   @param  Buffer                   Pointer to the converted bytes array.\r
@@ -2659,7 +2550,6 @@ AsciiStrToUnicodeStr (
   equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.\r
 \r
   If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then the Destination is unmodified.\r
 \r
@@ -2705,7 +2595,6 @@ AsciiStrToUnicodeStrS (
   ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes.\r
 \r
   If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If an error would be returned, then the function will also ASSERT().\r
 \r
   If an error is returned, then Destination and DestinationLength are\r
   unmodified.\r