+ Convert a Null-terminated Unicode hexadecimal string to a value of type\r
+ UINTN.\r
+\r
+ This function outputs a value of type UINTN by interpreting the contents of\r
+ the Unicode string specified by String as a hexadecimal number. The format of\r
+ the input Unicode string String is:\r
+\r
+ [spaces][zeros][x][hexadecimal digits].\r
+\r
+ The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
+ The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.\r
+ If "x" appears in the input string, it must be prefixed with at least one 0.\r
+ The function will ignore the pad space, which includes spaces or tab\r
+ characters, before [zeros], [x] or [hexadecimal digit]. The running zero\r
+ before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts\r
+ after [x] or the first valid hexadecimal digit. Then, the function stops at\r
+ 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
+ If the number represented by String exceeds the range defined by UINTN, then\r
+ MAX_UINTN is stored at the location pointed to by Data.\r
+\r
+ If EndPointer is not NULL, a pointer to the character that stopped the scan\r
+ is stored at the location pointed to by EndPointer. If String has no valid\r
+ hexadecimal digits right after the optional pad spaces, the value of String\r
+ is stored at the location pointed to by EndPointer.\r
+\r
+ @param String Pointer to a Null-terminated Unicode string.\r
+ @param EndPointer Pointer to character that stops scan.\r
+ @param Data Pointer to the converted value.\r
+\r
+ @retval RETURN_SUCCESS Value is translated from String.\r
+ @retval RETURN_INVALID_PARAMETER If String is NULL.\r
+ If Data is NULL.\r
+ If PcdMaximumUnicodeStringLength is not\r
+ zero, and String contains more than\r
+ PcdMaximumUnicodeStringLength Unicode\r
+ characters, not including the\r
+ Null-terminator.\r
+ @retval RETURN_UNSUPPORTED If the number represented by String exceeds\r
+ the range defined by UINTN.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+StrHexToUintnS (\r
+ IN CONST CHAR16 *String,\r
+ OUT CHAR16 **EndPointer, OPTIONAL\r
+ OUT UINTN *Data\r
+ );\r
+\r
+/**\r
+ Convert a Null-terminated Unicode hexadecimal string to a value of type\r
+ UINT64.\r
+\r
+ This function outputs a value of type UINT64 by interpreting the contents of\r
+ the Unicode string specified by String as a hexadecimal number. The format of\r
+ the input Unicode string String is:\r
+\r
+ [spaces][zeros][x][hexadecimal digits].\r
+\r
+ The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
+ The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.\r
+ If "x" appears in the input string, it must be prefixed with at least one 0.\r
+ The function will ignore the pad space, which includes spaces or tab\r
+ characters, before [zeros], [x] or [hexadecimal digit]. The running zero\r
+ before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts\r
+ after [x] or the first valid hexadecimal digit. Then, the function stops at\r
+ 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
+ If the number represented by String exceeds the range defined by UINT64, then\r
+ MAX_UINT64 is stored at the location pointed to by Data.\r
+\r
+ If EndPointer is not NULL, a pointer to the character that stopped the scan\r
+ is stored at the location pointed to by EndPointer. If String has no valid\r
+ hexadecimal digits right after the optional pad spaces, the value of String\r
+ is stored at the location pointed to by EndPointer.\r
+\r
+ @param String Pointer to a Null-terminated Unicode string.\r
+ @param EndPointer Pointer to character that stops scan.\r
+ @param Data Pointer to the converted value.\r
+\r
+ @retval RETURN_SUCCESS Value is translated from String.\r
+ @retval RETURN_INVALID_PARAMETER If String is NULL.\r
+ If Data is NULL.\r
+ If PcdMaximumUnicodeStringLength is not\r
+ zero, and String contains more than\r
+ PcdMaximumUnicodeStringLength Unicode\r
+ characters, not including the\r
+ Null-terminator.\r
+ @retval RETURN_UNSUPPORTED If the number represented by String exceeds\r
+ the range defined by UINT64.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+StrHexToUint64S (\r
+ IN CONST CHAR16 *String,\r
+ OUT CHAR16 **EndPointer, OPTIONAL\r
+ OUT UINT64 *Data\r
+ );\r
+\r
+/**\r
+ Returns the length of a Null-terminated Ascii string.\r
+\r
+ This function is similar as strlen_s defined in C11.\r
+\r
+ @param String A pointer to a Null-terminated Ascii string.\r
+ @param MaxSize The maximum number of Destination Ascii\r
+ char, including terminating null char.\r
+\r
+ @retval 0 If String is NULL.\r
+ @retval MaxSize If there is no null character in the first MaxSize characters of String.\r
+ @return The number of characters that percede the terminating null character.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiStrnLenS (\r
+ IN CONST CHAR8 *String,\r
+ IN UINTN MaxSize\r
+ );\r
+\r
+/**\r
+ Returns the size of a Null-terminated Ascii string in bytes, including the\r
+ Null terminator.\r
+\r
+ This function returns the size of the Null-terminated Ascii string specified\r
+ by String in bytes, including the Null terminator.\r
+\r
+ @param String A pointer to a Null-terminated Ascii string.\r
+ @param MaxSize The maximum number of Destination Ascii\r
+ char, including the Null terminator.\r
+\r
+ @retval 0 If String is NULL.\r
+ @retval (sizeof (CHAR8) * (MaxSize + 1))\r
+ If there is no Null terminator in the first MaxSize characters of\r
+ String.\r
+ @return The size of the Null-terminated Ascii string in bytes, including the\r
+ Null terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiStrnSizeS (\r
+ IN CONST CHAR8 *String,\r
+ IN UINTN MaxSize\r
+ );\r
+\r
+/**\r
+ Copies the string pointed to by Source (including the terminating null char)\r
+ to the array pointed to by Destination.\r
+\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
+ @param DestMax The maximum number of Destination Ascii\r
+ char, including terminating null char.\r
+ @param Source A pointer to a Null-terminated Ascii string.\r
+\r
+ @retval RETURN_SUCCESS String is copied.\r
+ @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).\r
+ @retval RETURN_INVALID_PARAMETER If Destination is NULL.\r
+ If Source is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and DestMax is greater than \r
+ PcdMaximumAsciiStringLength.\r
+ If DestMax is 0.\r
+ @retval RETURN_ACCESS_DENIED If Source and Destination overlap.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrCpyS (\r
+ OUT CHAR8 *Destination,\r
+ IN UINTN DestMax,\r
+ IN CONST CHAR8 *Source\r
+ );\r
+\r
+/**\r
+ Copies not more than Length successive char from the string pointed to by\r
+ Source to the array pointed to by Destination. If no null char is copied from\r
+ Source, then Destination[Length] is always set to null.\r
+\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
+ @param DestMax The maximum number of Destination Ascii\r
+ char, including terminating null char.\r
+ @param Source A pointer to a Null-terminated Ascii string.\r
+ @param Length The maximum number of Ascii characters to copy.\r
+\r
+ @retval RETURN_SUCCESS String is copied.\r
+ @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than \r
+ MIN(StrLen(Source), Length).\r
+ @retval RETURN_INVALID_PARAMETER If Destination is NULL.\r
+ If Source is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and DestMax is greater than \r
+ PcdMaximumAsciiStringLength.\r
+ If DestMax is 0.\r
+ @retval RETURN_ACCESS_DENIED If Source and Destination overlap.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrnCpyS (\r
+ OUT CHAR8 *Destination,\r
+ IN UINTN DestMax,\r
+ IN CONST CHAR8 *Source,\r
+ IN UINTN Length\r
+ );\r
+\r
+/**\r
+ Appends a copy of the string pointed to by Source (including the terminating\r
+ null char) to the end of the string pointed to by Destination.\r
+\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
+ @param DestMax The maximum number of Destination Ascii\r
+ char, including terminating null char.\r
+ @param Source A pointer to a Null-terminated Ascii string.\r
+\r
+ @retval RETURN_SUCCESS String is appended.\r
+ @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than \r
+ StrLen(Destination).\r
+ @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT\r
+ greater than StrLen(Source).\r
+ @retval RETURN_INVALID_PARAMETER If Destination is NULL.\r
+ If Source is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and DestMax is greater than \r
+ PcdMaximumAsciiStringLength.\r
+ If DestMax is 0.\r
+ @retval RETURN_ACCESS_DENIED If Source and Destination overlap.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrCatS (\r
+ IN OUT CHAR8 *Destination,\r
+ IN UINTN DestMax,\r
+ IN CONST CHAR8 *Source\r
+ );\r
+\r
+/**\r
+ Appends not more than Length successive char from the string pointed to by\r
+ Source to the end of the string pointed to by Destination. If no null char is\r
+ copied from Source, then Destination[StrLen(Destination) + Length] is always\r
+ set to null.\r
+\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
+ @param DestMax The maximum number of Destination Ascii\r
+ char, including terminating null char.\r
+ @param Source A pointer to a Null-terminated Ascii string.\r
+ @param Length The maximum number of Ascii characters to copy.\r
+\r
+ @retval RETURN_SUCCESS String is appended.\r
+ @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than\r
+ StrLen(Destination).\r
+ @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT\r
+ greater than MIN(StrLen(Source), Length).\r
+ @retval RETURN_INVALID_PARAMETER If Destination is NULL.\r
+ If Source is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and DestMax is greater than \r
+ PcdMaximumAsciiStringLength.\r
+ If DestMax is 0.\r
+ @retval RETURN_ACCESS_DENIED If Source and Destination overlap.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrnCatS (\r
+ IN OUT CHAR8 *Destination,\r
+ IN UINTN DestMax,\r
+ IN CONST CHAR8 *Source,\r
+ IN UINTN Length\r
+ );\r
+\r
+/**\r
+ Convert a Null-terminated Ascii decimal string to a value of type UINTN.\r
+\r
+ This function outputs a value of type UINTN by interpreting the contents of\r
+ the Ascii string specified by String as a decimal number. The format of the\r
+ input Ascii string String is:\r
+\r
+ [spaces] [decimal digits].\r
+\r
+ The valid decimal digit character is in the range [0-9]. The function will\r
+ ignore the pad space, which includes spaces or tab characters, before\r
+ [decimal digits]. The running zero in the beginning of [decimal digits] will\r
+ 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
+ MAX_UINTN is stored at the location pointed to by Data.\r
+\r
+ If EndPointer is not NULL, a pointer to the character that stopped the scan\r
+ is stored at the location pointed to by EndPointer. If String has no valid\r
+ decimal digits right after the optional pad spaces, the value of String is\r
+ stored at the location pointed to by EndPointer.\r
+\r
+ @param String Pointer to a Null-terminated Ascii string.\r
+ @param EndPointer Pointer to character that stops scan.\r
+ @param Data Pointer to the converted value.\r
+\r
+ @retval RETURN_SUCCESS Value is translated from String.\r
+ @retval RETURN_INVALID_PARAMETER If String is NULL.\r
+ If Data is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and String contains more than\r
+ PcdMaximumAsciiStringLength Ascii\r
+ characters, not including the\r
+ Null-terminator.\r
+ @retval RETURN_UNSUPPORTED If the number represented by String exceeds\r
+ the range defined by UINTN.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrDecimalToUintnS (\r
+ IN CONST CHAR8 *String,\r
+ OUT CHAR8 **EndPointer, OPTIONAL\r
+ OUT UINTN *Data\r
+ );\r
+\r
+/**\r
+ Convert a Null-terminated Ascii decimal string to a value of type UINT64.\r
+\r
+ This function outputs a value of type UINT64 by interpreting the contents of\r
+ the Ascii string specified by String as a decimal number. The format of the\r
+ input Ascii string String is:\r
+\r
+ [spaces] [decimal digits].\r
+\r
+ The valid decimal digit character is in the range [0-9]. The function will\r
+ ignore the pad space, which includes spaces or tab characters, before\r
+ [decimal digits]. The running zero in the beginning of [decimal digits] will\r
+ 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
+ MAX_UINT64 is stored at the location pointed to by Data.\r
+\r
+ If EndPointer is not NULL, a pointer to the character that stopped the scan\r
+ is stored at the location pointed to by EndPointer. If String has no valid\r
+ decimal digits right after the optional pad spaces, the value of String is\r
+ stored at the location pointed to by EndPointer.\r
+\r
+ @param String Pointer to a Null-terminated Ascii string.\r
+ @param EndPointer Pointer to character that stops scan.\r
+ @param Data Pointer to the converted value.\r
+\r
+ @retval RETURN_SUCCESS Value is translated from String.\r
+ @retval RETURN_INVALID_PARAMETER If String is NULL.\r
+ If Data is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and String contains more than\r
+ PcdMaximumAsciiStringLength Ascii\r
+ characters, not including the\r
+ Null-terminator.\r
+ @retval RETURN_UNSUPPORTED If the number represented by String exceeds\r
+ the range defined by UINT64.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrDecimalToUint64S (\r
+ IN CONST CHAR8 *String,\r
+ OUT CHAR8 **EndPointer, OPTIONAL\r
+ OUT UINT64 *Data\r
+ );\r
+\r
+/**\r
+ Convert a Null-terminated Ascii hexadecimal string to a value of type UINTN.\r
+\r
+ This function outputs a value of type UINTN by interpreting the contents of\r
+ the Ascii string specified by String as a hexadecimal number. The format of\r
+ the input Ascii string String is:\r
+\r
+ [spaces][zeros][x][hexadecimal digits].\r
+\r
+ The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
+ The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If\r
+ "x" appears in the input string, it must be prefixed with at least one 0. The\r
+ function will ignore the pad space, which includes spaces or tab characters,\r
+ before [zeros], [x] or [hexadecimal digits]. The running zero before [x] or\r
+ [hexadecimal digits] will be ignored. Then, the decoding starts after [x] or\r
+ the first valid hexadecimal digit. Then, the function stops at the first\r
+ 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
+ MAX_UINTN is stored at the location pointed to by Data.\r
+\r
+ If EndPointer is not NULL, a pointer to the character that stopped the scan\r
+ is stored at the location pointed to by EndPointer. If String has no valid\r
+ hexadecimal digits right after the optional pad spaces, the value of String\r
+ is stored at the location pointed to by EndPointer.\r
+\r
+ @param String Pointer to a Null-terminated Ascii string.\r
+ @param EndPointer Pointer to character that stops scan.\r
+ @param Data Pointer to the converted value.\r
+\r
+ @retval RETURN_SUCCESS Value is translated from String.\r
+ @retval RETURN_INVALID_PARAMETER If String is NULL.\r
+ If Data is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and String contains more than\r
+ PcdMaximumAsciiStringLength Ascii\r
+ characters, not including the\r
+ Null-terminator.\r
+ @retval RETURN_UNSUPPORTED If the number represented by String exceeds\r
+ the range defined by UINTN.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrHexToUintnS (\r
+ IN CONST CHAR8 *String,\r
+ OUT CHAR8 **EndPointer, OPTIONAL\r
+ OUT UINTN *Data\r
+ );\r
+\r
+/**\r
+ Convert a Null-terminated Ascii hexadecimal string to a value of type UINT64.\r
+\r
+ This function outputs a value of type UINT64 by interpreting the contents of\r
+ the Ascii string specified by String as a hexadecimal number. The format of\r
+ the input Ascii string String is:\r
+\r
+ [spaces][zeros][x][hexadecimal digits].\r
+\r
+ The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
+ The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If\r
+ "x" appears in the input string, it must be prefixed with at least one 0. The\r
+ function will ignore the pad space, which includes spaces or tab characters,\r
+ before [zeros], [x] or [hexadecimal digits]. The running zero before [x] or\r
+ [hexadecimal digits] will be ignored. Then, the decoding starts after [x] or\r
+ the first valid hexadecimal digit. Then, the function stops at the first\r
+ 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
+ MAX_UINT64 is stored at the location pointed to by Data.\r
+\r
+ If EndPointer is not NULL, a pointer to the character that stopped the scan\r
+ is stored at the location pointed to by EndPointer. If String has no valid\r
+ hexadecimal digits right after the optional pad spaces, the value of String\r
+ is stored at the location pointed to by EndPointer.\r
+\r
+ @param String Pointer to a Null-terminated Ascii string.\r
+ @param EndPointer Pointer to character that stops scan.\r
+ @param Data Pointer to the converted value.\r
+\r
+ @retval RETURN_SUCCESS Value is translated from String.\r
+ @retval RETURN_INVALID_PARAMETER If String is NULL.\r
+ If Data is NULL.\r
+ If PcdMaximumAsciiStringLength is not zero,\r
+ and String contains more than\r
+ PcdMaximumAsciiStringLength Ascii\r
+ characters, not including the\r
+ Null-terminator.\r
+ @retval RETURN_UNSUPPORTED If the number represented by String exceeds\r
+ the range defined by UINT64.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AsciiStrHexToUint64S (\r
+ IN CONST CHAR8 *String,\r
+ OUT CHAR8 **EndPointer, OPTIONAL\r
+ OUT UINT64 *Data\r
+ );\r
+\r
+\r
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
+\r
+/**\r
+ [ATTENTION] This function is deprecated for security reason.\r
+\r