Platform SDK: Win32 API

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

Returns the media type for the specified block device.

mov     bx, Drive               ;See below
mov     ch, DeviceCat           ;See below
mov     cl, 68h                 ;Sense media type
mov     dx, seg Media           ;See below
mov     ds, dx
mov     dx, offset Media        ;ds:dx points to buffer for media type
mov     ax, 440Dh               ;IOCTL for block device
int     21h

jc      error_handler           ;carry set means error

Parameters

Drive
Specifies the drive for which parameters are requested (0 = default drive, 1 = A, 2 = 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.

Media
Points to a 2-byte buffer that receives information about the media type for the given drive. The buffer has the following form.
Offset Description
00h Receives a value specifying whether the media type is the default value. This byte is set to 01h for the default media type and to 00h for any other media type.
01h Receives a value specifying the media type. This byte is set to 02h for 720K disks, 07h for 1.44-MB disks, and 09h for 2.88-MB disks.

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.

Value Name
0001h ERROR_INVALID_FUNCTION
0005h ERROR_ACCESS_DENIED

Remarks

Sense Media Type may also return a device-dependent error value as specified by the device driver.

Sense Media Type returns 0005h (ERROR_ACCESS_DENIED) if the media type for the specified drive cannot be determined or if the given drive is not ready. Programs can use Get Extended Error (Function 59h) to retrieve additional information about the error.