REQUESTHEADER

REQUESTHEADER STRUC

rhLength db ? ;length of record, in bytes

rhUnit db ? ;unit number (block device only)

rhFunction db ? ;function number

rhStatus dw ? ;status

rhReserved db 8 dup(?) ;reserved

REQUESTHEADER ENDS

The REQUESTHEADER structure contains information about a device-driver function.

Fields

rhLength

Specifies the length of the record, in bytes.

rhUnit

Identifies the device-driver function the request is for. For example, if the driver defines three functions, this field will contain 0, 1, or 2.

rhFunction

Specifies the action to be performed by the device driver. This field can be one of the following:

Value Function

00h Init
01h Media Check
02h Build BPB
03h IOCTL Read
04h Read
05h Nondestructive Read
06h Input Status
07h Input Flush
08h Write
09h Write with Verify
0Ah Output Status
0Bh Output Flush
0Ch IOCTL Write
0Dh Open Device
0Eh Close Device
0Fh Removable Media
10h Output Until Busy
13h Generic IOCTL
17h Get Logical Device
18h Set Logical Device
19h IOCTL Query

rhStatus

Specifies the status of the request when the device-driver interrupt routine returns control to MS-DOS. This field must be zero before MS-DOS calls the interrupt routine, which must set one or more bits in the field before returning to MS-DOS. The bits in this field have the following meanings:

Bit Meaning

0–7 Specify an error value, but only if bit 15 is set. If an error occurs, the interrupt routine must set bit 15 and copy an error value to these bits. The error value can be one of the following:

Error Meaning

00h Write-protect violation
01h Unknown unit
02h Drive not ready
03h Unknown command
04h CRC error
05h Incorrect length for drive-request structure
06h Seek error
07h Unknown media
08h Sector not found
09h Printer out of paper
0Ah Write fault
0Bh Read fault
0Ch General failure
0Dh Reserved
0Eh Reserved
0Fh Invalid disk change

8 Specifies whether the operation has completed. If this bit is set, the operation is done.
9 Specifies whether the device is busy. If this bit is set, the device is busy. This bit is set only by Input Status, Output Status, and Removable Media (Device-Driver Functions 06h, 0Ah, and 0Fh).
15 Specifies whether an error occurred. If this bit is 1, bits 0 through 7 of the rhStatus field contain an error value.

rhReserved

Reserved; do not use.

All other bits are reserved and must be zero.