mov bx, DriveNum ; drive number, 0=default, 1=A, 2=B, ... mov ch, 8 ; device category must be 8 mov cl, 49h ; EJECT minor number mov ax, 440Dh ; generic IOCTL fuction number int 21h jnc success mov [ErrorValue], ax
This is a simple call through with no additional parameters. If the call is successful (CY flag is clear) then on return the specified drive will be ejected. If more than one drive letter is pointed to a single physical drive number, then the drive will remain locked as long as any of the relevant drive letters are locked.
01h | Function not supported |
B1h | Volume locked in drive |
B2h | Volume not removable |
B5h | Valid eject request failed |
DriveNum (BX)
Specifies the drive for the operation. Can be 0 for default drive, 1 for A, 2 for B and so on.