IOCTL Read (Device-Driver Function 03h)

IOCTLRWREQUEST STRUC

irwrLength db ? ;length of record, in bytes

irwrUnit db ? ;unit number

irwrFunction db 03h ;function number

irwrStatus dw ? ;status

irwrReserved db 8 dup(?) ;reserved

irwrData db ? ;not used

irwrBuffer dd ? ;INPUT: buffer address

irwrBytes dw ? ;INPUT: number of bytes requested

;OUTPUT: number of bytes read

IOCTLRWREQUEST ENDS

IOCTL Read (Device-Driver Function 03h) transfers data from a device driver into the specified buffer.

This function can be used for both block- and character-device drivers.

Fields

irwrLength

Specifies the length, in bytes, of the IOCTLRWREQUEST structure.

irwrUnit

Specifies the device driver from which data is to be read. This field is used for block-device drivers only.

irwrFunction

Specifies the IOCTL Read function: 03h.

irwrStatus

Specifies the status of the completed function. If the function is successful, the driver must set the done bit (bit 8). Otherwise, the driver must set both the error and done bits (bits 15 and 8) and copy an error value to the low-order byte.

irwrReserved

Reserved; do not use.

irwrData

Not used.

irwrBuffer

Contains the 32-bit address (segment:offset) of the buffer that receives data read from the device.

irwrBytes

Contains the number of bytes to read and receives the number of bytes read. The following table describes input and output:

Input/output Description

Input Specifies the number of bytes to read. This number must not exceed the size, in bytes, of the specified buffer.
Output Specifies the number of bytes read. This number cannot exceed the requested number of bytes.

Comments

MS-DOS calls this function only if bit 14 is set in the dhAttributes field of the DEVICEHEADER structure. For a full description of the DEVICEHEADER structure, see Section 9.9, “Structures.”

The format of the returned data is device-specific and does not follow any standard.

See Also

Device-Driver Function 0Ch IOCTL Write
Interrupt 21h Function 4402h Receive Control Data from Character Device
Interrupt 21h Function 4404h Receive Control Data from Block Device