DISK_IOCTL_READ

Block device drivers respond to this I/O control code in order to service FAT file system requests to read data from the block device.

Parameters

hDevice
Handle to the block device.
dwIoControlCode
DISK_IOCTL_READ.
lpInBuffer
Address of a SG_REQ structure..
nInBufferSize
Size of a SG_REQ structure.
lpOutBuffer
Not used.
nOutBufferSize
Not used.
lpBytesReturned
Address of a DWORD to receive total bytes returned.
lpOverlapped
Not used.

Return Values

When this function returns, the FAT file system expects the sr_status member of the SG_REQ structure to be set to either ERROR_SUCCESS if the read succeeded, or a standard Win32 error code otherwise. Certain errors are automatically retried, such as ERROR_BAD_UNIT if the device has been removed and ERROR_NOT_READY if the driver is in the process of shutting down or starting up. Block device drivers should return ERROR_GEN_FAILURE for any unknown or unexpected errors.

Remarks

The FAT file system fills in the SG_REQ structure passed to the block device driver as follows:

sr_start
Starting block number.
sr_num_sec
Number of blocks to read.
sr_num_sg
Number of scatter/gather buffers (normally 1).
sr_callback
NULL.
sr_sglist[0].sb_buf
Address of the buffer to read blocks into. Note that this buffer is unaligned.
sr_sglist[0].sb_len
Size of the sr_sglist[0].sb_buf buffer in bytes.

If sr_num_sg is greater than 1, then the block device driver should fill in additional entries in the sr_sglist array.