/* Append the Request element to the Config Request. */
VOID AppendConfigRequest(IN OUT CHAR16 **ConfigRequest, IN OUT UINTN *SpareStrLen, IN CHAR16 *RequestElement)
/* Append the Request element to the Config Request. */
VOID AppendConfigRequest(IN OUT CHAR16 **ConfigRequest, IN OUT UINTN *SpareStrLen, IN CHAR16 *RequestElement)
{
  CHAR16  *NewStr;
  UINTN   StringSize;
  UINTN   StrLength;
  UINTN   MaxLen;
  StrLength  = StrLen (RequestElement);
  StringSize = (*ConfigRequest != NULL) ? StrSize (*ConfigRequest) : sizeof (CHAR16);
  MaxLen     = StringSize / sizeof (CHAR16) + *SpareStrLen;
  if (StrLength > *SpareStrLen) {
    MaxLen = StringSize / sizeof (CHAR16) + CONFIG_REQUEST_STRING_INCREMENTAL;
    NewStr = AllocateZeroPool (MaxLen * sizeof (CHAR16));
    ASSERT (NewStr != NULL);
    if (*ConfigRequest != NULL) {
      CopyMem (NewStr, *ConfigRequest, StringSize);
      FreePool (*ConfigRequest);
    }
    *ConfigRequest = NewStr;
    *SpareStrLen   = CONFIG_REQUEST_STRING_INCREMENTAL;
  }
  StrCatS (*ConfigRequest, MaxLen, RequestElement);
  *SpareStrLen -= StrLength;
}