/* Concatenates a formatted unicode string to allocated pool. The caller must free the resulting buffer. */
CHAR16* EFIAPI UefiDevicePathLibCatPrint(IN OUT POOL_PRINT *Str, IN CHAR16 *Fmt,...)
/* Concatenates a formatted unicode string to allocated pool. The caller must free the resulting buffer. */
CHAR16* EFIAPI UefiDevicePathLibCatPrint(IN OUT POOL_PRINT *Str, IN CHAR16 *Fmt,...)
{
  UINTN    Count;
  VA_LIST  Args;
  VA_START (Args, Fmt);
  Count = SPrintLength (Fmt, Args);
  VA_END (Args);
  if ((Str->Count + (Count + 1)) * sizeof (CHAR16) > Str->Capacity) {
    Str->Capacity = (Str->Count + (Count + 1) * 2) * sizeof (CHAR16);
    Str->Str      = ReallocatePool (
                      Str->Count * sizeof (CHAR16),
                      Str->Capacity,
                      Str->Str
                      );
    ASSERT (Str->Str != NULL);
  }
  VA_START (Args, Fmt);
  UnicodeVSPrint (&Str->Str[Str->Count], Str->Capacity - Str->Count * sizeof (CHAR16), Fmt, Args);
  Str->Count += Count;
  VA_END (Args);
  return Str->Str;
}