Platform SDK: Win32 API |
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
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.
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 |
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.