Platform SDK: Win32 API

Int 21h Function 440Dh Minor Code 49h (FAT32)

Ejects the specified media.

mov ax, 440Dh      ; Generic IOCTL
mov bx, DriveNum   ; See below
mov ch, DeviceCat  ; See below
mov cl,            ; Eject Removable Media
int 21h

jc  error_handler  ; Carry set means error

Parameters

DriveNum
Drive to eject (0 = default drive, 1 = A, 2 = B, and so on).
DeviceCat
Specifies a FAT16, FAT12 or FAT32 drive.
Value Description
08h 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

If the function is successful, clears the carry flag. Otherwise, sets the carry flag and sets the AX register to one of the following error values.

01h The function is not supported.
B1h The volume is locked in the drive.
B2h The volume is not removable.
B5h The valid eject request has failed.

Remarks

If a given physical drive has more than one logical volume, all volumes must be unlocked by using Int 21h Function 440Dh Minor Code 48h before the drive will eject.