Interrupt 21h Function 440Dh Minor Code 70h

Retrieves the current lock level and permissions on the specified drive.

mov ax, 440Dh        ; generic IOCTL
mov bl, DriveNum     ; see below
mov ch, 08h          ; device category (must be 08h)
mov cl, 70h          ; Get Current Lock State
int 21h

jc error

Parameters

DriveNum
Drive to retrieve lock information about. This parameter can be 0 for the default drive, 1 for A, 2 for B, and so on.

Return Value

Clears the carry flag and sets the AX and CX registers to these values if successful:

AX Current lock level. It may be either 0, 1, 2 or 3. If the volume is not locked, AX contains – 1
CX Lock permissions. The bits have the following form:

Bit Meaning
0 0 = Write operations are failed.
0 1 = Write operations are allowed, unless they are blocked by the lock level.
1 0 = New file mapping are allowed, unless they are blocked by the lock level.
1 1 = New file mapping are failed.
2 1 = The volume is locked for formatting.

Remarks

The lock level and the permissions determine the kind of access processes other than the lock owner have to the volume while it is locked. The following operations are allowed by processes other than lock owner at each lock level:

Level Operations
0 Read operations, write operations, and new file mappings are failed.
1 Read operations are allowed. Write operations and new file mappings are either allowed or failed based on permissions.
2 Read operations are allowed. Write operations and new file mappings are either failed or blocked based on permissions.
3 Read operations are blocked. Write operations and new file mappings are either failed or blocked based on permissions.