Platform SDK: Win32 API

Int 21h Function 440Dh Minor Code 4Ah (FAT32)

Locks the logical volume.

mov ax, 440Dh        ; generic IOCTL
mov bh, LockLevel    ; see below
mov bl, DriveNum     ; see below
mov ch, DeviceCat    ; see below
mov cl, 4Ah          ; Lock Logical Volume
mov dx, Permissions  ; see below
int 21h
 
jc error_handler

Parameters

LockLevel
Level of the lock. This parameter must be either 0, 1, 2, or 3.
DriveNum
Drive to lock. 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.

Permissions
Operations that the system permits while the volume is locked. This parameter is specified only when a level 1 lock is obtained or when a level 0 lock is obtained for the second time for formatting the volume. For other lock levels, this parameter is zero. When a level 1 lock is obtained, bits 0 and 1 of this parameter specify whether the system permits write operations, new file mappings, or both by other processes during a level 1 lock as well as during level 2 and 3 locks. If this parameter specifies that write operations, new file mappings, or both are failed, these operations are failed during level 1, 2, and 3 locks. This parameter has the following form:
Bit Meaning
0 0 = Write operations are failed (specified when a level 1 lock is obtained).
0 1 = Write operations are allowed (specified when a level 1 lock is obtained).
1 0 = New file mapping are allowed (specified when a level 1 lock is obtained).
1 1 = New file mapping are failed (specified when a level 1 lock is obtained).
2 1 = The volume is locked for formatting (specified when a level 0 lock is obtained for the second time).

Return Values

Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

Remarks

The volume must be locked before the application performs direct disk write operations by using Interrupt 26h or the IOCTL control functions. Lock Physical Volume (Interrupt 21h Function 440Dh Minor Code 4Bh) is used instead of this function before a call to an Interrupt 13h function. You must use Unlock Logical Volume (Interrupt 21h Function 440Dh Minor Code 6Ah) to release the lock.