mov bl, Drive ;0 = default, 1 = A, 2 = B, etc.
mov ch, 8 ;IOCTL category to check. Must be 8
mov cl, Function ;IOCTL function to check
mov ax, 4411h ;Query IOCTL Device 4411h
int 21h
jnc supported ;carry clear means IOCTL supported
Query IOCTL Device (Function 4411h) determines whether the specified IOCTL function is supported for the given drive.
Drive
Specifies the drive (0 = default, 1 = A, 2 = B, etc.).
Function
Specifies a Function 4401 minor code. It can be one of the following:
| Value | Meaning |
| 40h | Set Device Parameters |
| 41h | Write Track on Logical Drive |
| 42h | Format Track on Logical Drive |
| 46h | Set Media ID |
| 60h | Get Device Parameters |
| 61h | Read Track on Logical Drive |
| 62h | Verify Track on Logical Drive |
| 66h | Get Media ID |
| 68h | Sense Media Type |
If IOCTL is supported, the carry flag is clear. Otherwise, the carry flag is set and AX contains an error value, which may be one of the following:
| Value | Name |
| 0001h | ERROR_INVALID_FUNCTION |
| 0005h | ERROR_ACCESS_DENIED |
| 000Fh | ERROR_INVALID_DRIVE |
Query IOCTL Device returns 0001h (ERROR_INVALID_FUNCTION) if the device driver has no support for IOCTL functions. The function returns 0005h (ERROR_ACCESS_DENIED) if the device driver supports IOCTL functions but does not support the specified IOCTL.
Function 4410h Query IOCTL Handle