/* Write by using the Disk IO protocol on the parent device. Lba addresses must be converted to byte offsets. */
EFI_STATUS EFIAPI PartitionWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
/* Write by using the Disk IO protocol on the parent device. Lba addresses must be converted to byte offsets. */
EFI_STATUS EFIAPI PartitionWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
{
  PARTITION_PRIVATE_DATA  *Private;
  UINT64                  Offset;
  Private = PARTITION_DEVICE_FROM_BLOCK_IO_THIS (This);
  if (BufferSize % Private->BlockSize != 0) {
    return ProbeMediaStatus (Private->DiskIo, MediaId, EFI_BAD_BUFFER_SIZE);
  }
  Offset = MultU64x32 (Lba, Private->BlockSize) + Private->Start;
  if (Offset + BufferSize > Private->End) {
    return ProbeMediaStatus (Private->DiskIo, MediaId, EFI_INVALID_PARAMETER);
  }
  return Private->DiskIo->WriteDisk (Private->DiskIo, MediaId, Offset, BufferSize, Buffer);
}