/* Converts the Unicode string to ASCII string to a new allocated buffer. */
CHAR8* UnicodeStrDupToAsciiStr(CONST CHAR16 *String)
/* Converts the Unicode string to ASCII string to a new allocated buffer. */
CHAR8* UnicodeStrDupToAsciiStr(CONST CHAR16 *String)
{
  CHAR8       *AsciiStr;
  UINTN       BufLen;
  EFI_STATUS  Status;
  BufLen   = StrLen (String) + 1;
  AsciiStr = AllocatePool (BufLen);
  if (AsciiStr == NULL) {
    return NULL;
  }
  Status = UnicodeStrToAsciiStrS (String, AsciiStr, BufLen);
  if (EFI_ERROR (Status)) {
    return NULL;
  }
  return AsciiStr;
}