mov bl, Drive ;0 = default, 1 = A, 2 = B, etc.
mov cx, MaxBytes ;maximum number of bytes to receive
mov dx, seg Buffer
mov ds, dx
mov dx, offset Buffer ;ds:dx points to buffer to receive data
mov ax, 4404h ;Receive Control Data from Block Device
int 21h
jc error_handler ;carry set means error
mov ActualBytes, ax ;number of bytes received
Receive Control Data from Block Device (Function 4404h) reads control information of any length and format from a block-device driver. The format of the information is device-specific and does not follow any standard.
Drive
Specifies the drive for which information is requested (0 = default drive, 1 = drive A, 2 = drive B, etc.).
MaxBytes
Specifies the maximum number of bytes to read.
Buffer
Points to the buffer to receive the data read from the device. The buffer must be at least as large as MaxBytes.
If the function is successful, the carry flag is clear, the buffer is filled in with the requested information, and the AX register contains the number of bytes received. Otherwise, the carry flag is set and the AX register contains an error value, which may be one of the following:
Value | Name |
0001h | ERROR_INVALID_FUNCTION |
0005h | ERROR_ACCESS_DENIED |
0006h | ERROR_INVALID_HANDLE |
000Dh | ERROR_INVALID_DATA |
Function 4402h Receive Control Data from Character Device
Function 4403h Send Control Data to Character Device
Function 4405h Send Control Data to Block Device