Platform SDK: Win32 API

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

Formats and verifies a track on the specified device.

mov     bx, Drive                 ;See below
mov     ch, DeviceCat             ;See below
mov     cl, 42h                   ;Format track on logical drive
mov     dx, seg FormatBlock       ;See below
mov     ds, dx
mov     dx, offset FormatBlock    ;ds:dx points to FVBLOCK structure
mov     ax, 440Dh                 ;IOCTL for block device
int     21h

jc      error_handler             ;carry set means error

Parameters

Drive
Specifies the drive on which the track is to be formatted and verified (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. (Will fail on FAT32 drives.)
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.

FormatBlock
Pointer to an FVBLOCK structure that specifies the head and cylinder to format. The FVBLOCK structure has the following form:
FVBLOCK STRUC
    fvSpecFunc    db  0   ;special functions
    fvHead        dw  ?   ;head to format/verify
    fvCylinder    dw  ?   ;cylinder to format/verify
    fvTracks      dw  ?   ;tracks to format/verify
FVBLOCK ENDS

The fvSpecFunc member can be 0, 1, or 2. The fvTracks member is ignored.

Return Values

If the fvSpecFunc member in the FVBLOCK structure is 1, clears the carry flag and sets the fvSpecFunc member to one of the following values.

Value Meaning
0 ROM support for given format combination
1 No ROM support
2 Illegal format combination
3 No media present

If the fvSpecFunc member is 0 and 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
0002h ERROR_FILE_NOT_FOUND
0005h ERROR_ACCESS_DENIED

Format Track on Logical Drive returns 0002h (ERROR_FILE_NOT_FOUND) if the specified drive number is invalid.