Efi_disk_io.writedisk(), E the, Writedisk() – Intel Extensible Firmware Interface User Manual
Page 400: Func, Efi_disk_io.writedisk() summary, Prototype, Parameters, Description, Status codes returned

Extensible Firmware Interface Specification
11-40
12/01/02
Version 1.10
EFI_DISK_IO.WriteDisk()
Summary
Writes a specified number of bytes to a device.
Prototype
EFI_STATUS
(EFIAPI *EFI_DISK_WRITE) (
IN
EFI_DISK_IO
*This,
IN
UINT32
MediaId,
IN
UINT64
Offset,
IN
UNITN
BufferSize,
IN
VOID
*Buffer
);
Parameters
This
Indicates a pointer to the calling context. Type
EFI_DISK_IO
is
defined in the
protocol description.
MediaId
ID of the medium to be written.
Offset
The starting byte offset on the logical block I/O device to write.
BufferSize
The size in bytes of
Buffer
. The number of bytes to write to
the device.
Buffer
A pointer to the buffer containing the data to be written.
Description
The
WriteDisk()
function writes the number of bytes specified by
BufferSize
to the device.
All bytes are written, or an error is returned. If there is no medium in the device, the function
returns
EFI_NO_MEDIA
. If the
MediaId
is not the ID of the medium currently in the device, the
function returns
EFI_MEDIA_CHANGED
.
Status Codes Returned
EFI_SUCCESS
The data was written correctly to the device.
EFI_WRITE_PROTECTED
The device cannot be written to.
EFI_NO_MEDIA
There is no medium in the device.
EFI_MEDIA_CHANGED
The
MediaId
is not for the current medium.
EFI_DEVICE_ERROR
The device reported an error while performing the write operation.
EFI_INVALID_PARAMETER
The write request contains device addresses that are not valid for
the device.