Int 21h Function 440Dh Minor Code 70h (FAT32)
Retrieves the current lock level and permissions on the specified drive.
mov ax, 440Dh ; generic IOCTL
mov bl, DriveNum ; see below
mov ch, DeviceCat ; see below
mov cl, 70h ; Get Current Lock State
int 21h
jc error_handler
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.
- DeviceCat
- Specifies a FAT16, FAT12 or FAT32 drive.
Value |
Description |
08h |
FAT32, FAT16, or FAT12 drive. |
48h |
FAT32, FAT16, or FAT12 drive. This value is supported on Windows 95 OEM Service Release 2 and later. |
Note: Because this call may be implemented in the device driver, the 48h form of this call may fail on FAT16 or FAT12 media. Therefore, applications making the 48h form of this call must fall back on the 08h form if the 48h call fails.
Return Values
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. |