/* Initialise the string table and allocate memory for the string elements. */
EFI_STATUS EFIAPI StringTableInitialize(IN STRING_TABLE *CONST StrTable, IN UINTN MaxStringElements)
/* Initialise the string table and allocate memory for the string elements. */
EFI_STATUS EFIAPI StringTableInitialize(IN STRING_TABLE *CONST StrTable, IN UINTN MaxStringElements)
{
  STRING_ELEMENT  *Elements;
  if ((StrTable == NULL) || (MaxStringElements > MAX_UINT8)) {
    return EFI_INVALID_PARAMETER;
  }
  ZeroMem (StrTable, sizeof (STRING_TABLE));
  Elements = (STRING_ELEMENT *)AllocateZeroPool (
                                 sizeof (STRING_ELEMENT) * MaxStringElements
                                 );
  if (Elements == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  StrTable->Elements          = Elements;
  StrTable->MaxStringElements = (UINT8)MaxStringElements;
  return EFI_SUCCESS;
}