mov bx, DriveNum ; drive number 0=default, 1=A, 2=B ...
mov ch, 8 ; device category must be 8
mov cl, 48h ; LOCK/UNLOCK minor number
mov ax, 440D ; generic IOCTL function number
mov dx, seg ParamBlock
mov ds, dx
mov dx, offset ParamBlock
int 21h
jnc success
mov [ErrorValue], ax
Locks or unlocks the drive.
01h | Function not supported |
B0h | Volume not locked in drive |
B2h | Volume not removable |
B4h | Lock count exceeded |
0 | Lock volume in drive |
1 | UnLock volume in drive |
02 | Return lock/unlock status |
The values 03h through 0FFh are reserved.
The second byte field is filled on return from the call as the lock status of the drive.