/* Convert input ascii string to unicode string. It's caller's responsibility to free returned buffer using FreePool(). */
EFI_STRING StrToUnicodeStr(IN CHAR8 *AsciiString)
/* Convert input ascii string to unicode string. It's caller's responsibility to free returned buffer using FreePool(). */
EFI_STRING StrToUnicodeStr(IN CHAR8 *AsciiString)
{
  UINTN       StringLen;
  EFI_STRING  Buffer;
  EFI_STATUS  Status;
  if (AsciiString == NULL) {
    return NULL;
  }
  StringLen = AsciiStrLen (AsciiString) + 1;
  Buffer    = AllocatePool (StringLen * sizeof (CHAR16));
  if (Buffer == NULL) {
    return NULL;
  }
  Status = AsciiStrToUnicodeStrS (AsciiString, Buffer, StringLen);
  if (EFI_ERROR (Status)) {
    FreePool (Buffer);
    return NULL;
  }
  return Buffer;
}