Platform SDK: Win32 API

Int 21h Function 7302h Get_ExtDPB (FAT32)

Returns a copy of the extended DPB for any valid drive.

Buffer   dw  ?
DriveDPB DPB <>
BufferSize equ sizeof DPB + sizeof WORD
...
mov  dx, seg Buffer
mov  es, dx
mov  di, offset Buffer  ;See below

mov  dl, DriveNum       ;See below
mov  cx, BufferSize     ;See below
mov  ax, 7302h          ;Get_ExtDPB
int  21h

jc  error_handler       ;carry set means error

Parameters

Buffer
The address of the buffer at ES:DI that will receive the WORD (the size value), followed by the copy of the extended DPB.
DriveNum
The 1-based drive number (0=default; 1=A, 2=B, and so on).
BufferSize
The size of the buffer, in bytes.

The size value returned by this function represents the size of DPB only. It does not include the two bytes of the size member itself.

This call will not work when the VDEF file system is mounted on the drive (for example during formatting).

Return Values

Clears the carry flag, and returns a copy of the DPB to ES:DI. The copy is a WORD equal to the size (in bytes) of the extended DPB, followed by the extended DPB itself (see EA_DEVICEPARAMETERS).

Remarks

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