Lock/Unlock Drive


Entry:
    AH = 45h
    AL
        = 0 Lock volume in drive
        = 1 UnLock volume in drive
        = 02 Return lock/unlock status
        = 03h-FFh - reserved
    DL = Drive number
Exit:
    carry clear
        AH = 0
    carry set
        AH = error code.

This function logically locks/unlocks removable media in a specifed drive.

This function must be supported for all removable drives numbered 80h and above. If a fixed disk supports the Removeable Drive Control API subset, then this function is always returned with success, (AH)=0h.

There must be support for up to 255 locks per drive. A drive may not be physically unlocked until all locks to that drive have been matched with a corresponding unlock. Excess unlock calls must be returned with carry set and AH = B0h, Drive not locked.

If the number of locks supported value would be exceeded on a lock request, then the request is rejected with carry set and AH = B4h, Lock count exceeded.

Locking a drive without media present is a valid operation.

On return from a lock or unlock request, (AL) contains the lock state of the drive as maintained by the BIOS. This is mainly provided for unlock requests for when the lock count remains greater than 0 after the request has been satisfied. In this case, the drive remains locked.

Any physical locking and unlocking of the drive is implementation dependent, but system software will operate on the assumption that a locked drive cannot be removed without an unlock request.