[fpc-pascal]cluster size info for win9x/go32

Kuba Ober winnie at hoth.amu.edu.pl
Thu Sep 28 23:07:35 CEST 2000


Guys, please look at http://msdn.microsoft.com/library/default.asp first.

For GO32 you need to refer to underlying OS anyway, and this is always DOS, 
so call basic int21h functions.
But, it GO32 works in a DOS box under win95osr2 or later, or if it is a 
pure win32 app call fat32 api functions, for example

Int 21h Function 440Dh Minor Code 60h (FAT32)
Returns the device parameters for the specified block device.
mov  bx, Drive           ;See below
mov  ch, DeviceCat       ;See below
mov  cl, 60h             ;Get 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

It returns EA_DEVICEPARAMETERS structure, which contains FAT32 version of 
BPB structure, which contains A_BF_BPB_BytesPerSector DW ?        ;and
A_BF_BPB_SectorsPerCluster DB ?
Multiplying those two gives bytes-per-cluster info. Please look 
at 
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/winbase/fat32_7jxs.htm
for details.

Cheerz,
Kuba
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20000928/ac9c5e06/attachment.html>


More information about the fpc-pascal mailing list