Efi_disk_io.readdisk(), See the, Readdisk() – Intel Extensible Firmware Interface User Manual

Page 399: Func

Advertising
background image

Protocols

— Bootable Image Support

Version 1.10

12/01/02

11-39

EFI_DISK_IO.ReadDisk()

Summary

Reads a specified number of bytes from a device.

Prototype

EFI_STATUS

(EFIAPI *EFI_DISK_READ) (

IN

EFI_DISK_IO

*This,

IN

UINT32

MediaId,

IN

UINT64

Offset,

IN

UINTN

BufferSize,

OUT

VOID

*Buffer

);

Parameters

This

Indicates a pointer to the calling context. Type

EFI_DISK_IO

is

defined in the

DISK_IO

protocol description.

MediaId

ID of the medium to be read.

Offset

The starting byte offset on the logical block I/O device to read from.

BufferSize

The size in bytes of

Buffer

. The number of bytes to read from

the device.

Buffer

A pointer to the destination buffer for the data. The caller is responsible
for either having implicit or explicit ownership of the buffer.

Description

The

ReadDisk()

function reads the number of bytes specified by

BufferSize

from the

device. All the bytes are read, 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 read correctly from the device.

EFI_DEVICE_ERROR

The device reported an error while performing the read operation.

EFI_NO_MEDIA

There is no medium in the device.

EFI_MEDIA_CHANGED

The

MediaId

is not for the current medium.

EFI_INVALID_PARAMETER

The read request contains device addresses that are not valid for the
device.

Advertising