mov bx, Handle ;handle of device
mov cx, MaxBytes ;maximum number of bytes to send
mov dx, seg Buffer
mov ds, dx
mov dx, offset Buffer ;ds:dx points to buffer with data to send
mov ax, 4403h ;Send Control Data to Character Device
int 21h
jc error_handler ;carry set means error
mov ActualBytes, ax ;number of bytes sent
Send Control Data to Character Device (Function 4403h) writes control information of any length and format to a character-device driver. The format of the information is device-specific and does not follow any standard.
Handle
Identifies the device to send information to.
MaxBytes
Specifies the number of bytes to write.
Buffer
Points to the buffer that contains the data to write to the device.
If the function is successful, the carry flag is clear and the AX register contains the number of bytes sent. 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 |
Character-device drivers are not required to support this function or Receive Control Data from Character Device (Function 4402h). A program should use Get Device Data (Function 4400h) and examine bit 14 in the device-status value to ensure that the device driver can process control data.
Function 4400h Get Device Data
Function 4402h Receive Control Data from Character Device
Function 4404h Receive Control Data from Block Device
Function 4405h Send Control Data to Block Device