Platform SDK: Win32 API

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

Sets the device parameters for the specified block device.

mov  bx, Drive           ;See below
mov  ch, DeviceCat       ;See below
mov  cl, 40h             ;Set device parameters
mov  dx, seg DriveDP     ;See below
mov  ds, dx
mov  dx, offset DriveDP  ;ds:dx points to a device parameters structure
mov  ax, 440Dh           ;IOCTL for block device
int  21h

jc  error_handler       ;carry set means error

Parameters

Drive
Specifies the drive that parameters are being set for (0 = default drive, 1 = A, 2 = B, and so on).
DeviceCat
Specifies the expected format of the device parameters information structure.
Value Expected device parameters structure
08h DEVICEPARAMS (FAT16 or FAT12 drive. Will fail on FAT32 drives.)
48h EA_DEVICEPARAMETERS (FAT32, FAT16 or FAT12 drives). 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.

DriveDP
Pointer to the applicable device parameters structure that contains the parameters for the specified block device. The format of the expected device parameters is indicated in the above DeviceCat parameter.

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
0002h ERROR_FILE_NOT_FOUND
0005h ERROR_ACCESS_DENIED

Remarks

Set Device Parameters returns 0002h (ERROR_FILE_NOT_FOUND) if the specified drive number is invalid.

If the number of sectors specified in the applicable device parameters structure is not zero, a TRACKLAYOUT structure specifying the size of each sector must follow the device parameters structure.

In the case of a FAT16 or FAT12 drive, the device parameters structure is a DEVICEPARAMS structure. For FAT32 drives, the device parameters structure is an EA_DEVICEPARAMETERS structure.