Platform SDK: Win32 API

Int 21h Function 7303h Get_ExtFreeSpace (FAT32)

Returns the total disk space and the free disk space.

mov  dx, seg Buffer
mov  es, dx
mov  di, offset Buffer    ;See below
mov  es:[di].ExtGetDskFreSpcStruc.ExtFree_Level, ExpectLevel
mov  cx, BufferSize       ;See below

mov  dx, seg DriveName    ;See below
mov  ds, dx
mov  dx, offset DriveName ;See below

mov  ax, 7303h            ;Get_ExtFreeSpace
int  21h

jc  error_handler         ;carry set means error

Parameters

Buffer
The address of the buffer at ES:DI that will receive the disk space information.
BufferSize
The size (in bytes) of the buffer.
DriveName
The address of a null terminated string at DS:DX. In real mode, this must be in standard form ("C:\"). In Windows, either the standard name or a universal naming convention form ("\\Server\Share") is acceptable.

Return Values

Clears the carry flag and returns the total disk space and the free disk space of the specified drive, in the form of an ExtGetDskFreSpcStruc structure, to a buffer at ES:DI. It is recommended to initialize the buffer to the level value the application expects to receive.

Remarks

When calling this function with DeviceIoControl, the dwloControlCode parameter must be set to VWIN32_DIOC_DOS_IOCTL (defined as 6 in VWIN32.H). For more information, see Using VWIN32 to Carry Out MS-DOS Functions.