Close Device (Device-Driver Function 0Eh)

OPENCLOSEREQUEST STRUC

ocrLength db ? ;length of record, in bytes

ocrUnit db ? ;unit number (block device only)

ocrFunction db 0Eh ;function number

ocrStatus dw ? ;status

ocrReserved db 8 dup(?) ;reserved

OPENCLOSEREQUEST ENDS

Close Device (Device-Driver Function 0Eh) informs the driver that a file device or character device is being closed.

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

Fields

ocrLength

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

ocrUnit

Specifies the device on which the file is being closed. This field is used for block-device drivers only.

ocrFunction

Specifies the Close Device function: 0Eh.

ocrStatus

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.

ocrReserved

Reserved; do not use.

Comments

MS-DOS calls this function only if bit 11 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.”

MS-DOS calls this function whenever an application closes a file or device. This function can be used in conjunction with Open Device (Device-Driver Function 0Dh) to manage internal buffers and device initialization.

See Also

Device-Driver Function 0Dh Open Device
Interrupt 21h Function 3Eh Close File with Handle