/* If the file was opened with ASCII mode the data will be processed through AsciiSPrint before writing. */
EFI_STATUS EFIAPI FileInterfaceFileWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
/* If the file was opened with ASCII mode the data will be processed through AsciiSPrint before writing. */
EFI_STATUS EFIAPI FileInterfaceFileWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
{
  CHAR8       *AsciiBuffer;
  UINTN       Size;
  EFI_STATUS  Status;
  if (((EFI_FILE_PROTOCOL_FILE *)This)->Unicode) {
    return (((EFI_FILE_PROTOCOL_FILE *)This)->Orig->Write (((EFI_FILE_PROTOCOL_FILE *)This)->Orig, BufferSize, Buffer));
  } else {
    AsciiBuffer = AllocateZeroPool (*BufferSize);
    AsciiSPrint (AsciiBuffer, *BufferSize, "%S", Buffer);
    Size   = AsciiStrSize (AsciiBuffer) - 1;
    Status = (((EFI_FILE_PROTOCOL_FILE *)This)->Orig->Write (((EFI_FILE_PROTOCOL_FILE *)This)->Orig, &Size, AsciiBuffer));
    FreePool (AsciiBuffer);
    return (Status);
  }
}