IOCTL Write (Device-Driver Function 0Ch)

IOCTLRWREQUEST STRUC

irwrLength db ? ;length of record, in bytes

irwrUnit db ? ;unit number

irwrFunction db 0Ch ;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 written

IOCTLRWREQUEST ENDS

IOCTL Write (Device-Driver Function 0Ch) transfers data from a buffer to a device driver.

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 to which data is to be written. This field is used for block-device drivers only.

irwrFunction

Specifies the IOCTL Write function: 0Ch.

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 containing data to write to the device.

irwrBytes

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

Input/Output Description

Input Specifies the number of bytes to write. This number must not exceed the amount of data in the specified buffer.
Output Specifies the number of bytes written. 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 driver's DEVICEHEADER structure. For a full description of the DEVICEHEADER structure, see Section 9.9, “Structures.”

See Also

Device-Driver Function 03h IOCTL Read
Interrupt 21h Function 4403h Send Control Data to Character Device
Interrupt 21h Function 4405h Send Control Data to Block Device