Mail Archives: djgpp-workers/2001/11/24/13:10:18
> From: "Dennis Louie" <dennis-louie AT att DOT net>
> Date: Sat, 24 Nov 2001 09:51:25 -0800
>
> > Can you try to modify statfs.c so that it tries to call the functions
> > 7303h or 7302h, and see if any of them works for you?
>
> Are the calling and return register values the same as for Function 36h?
No, they are very different. I attach below the documentation of
these two functions.
> thought there might be new functions, but my DOS documentation is for V2!
You should be able to find the latest docs in Ralf Brown's monumental
Interrupt List (the docs below is from there).
> > What kind of partion type is that? Is it NTFS or something else?
>
> It's FAT32.
Then there's hope that one of the functions below will work, if XP
supports it.
--------D-217302-----------------------------
INT 21 - Windows95 - FAT32 - "Get_ExtDPB" - GET EXTENDED DPB
AX = 7302h
DL = drive number (00h=default, 01h=A:, etc.)
ES:DI -> buffer for returned data (see #01786)
CX = length of buffer (003Fh for Windows95)
SI = signature (undocumented, must be F1A6h to get device driver
address and next-DBP pointer) (see #01787)
Return: CF clear if successful
ES:DI buffer filled
CF set on error
AX = error code
0018h bad buffer length
SeeAlso: AX=7303h,AX=7304h,AH=1Fh,AH=32h
Format of Get_ExtDPB data buffer:
Offset Size Description (Table 01786)
00h WORD (call) length of following data (003Dh)
02h 61 BYTEs (ret) drive parameter block (DPB) (see #01787)
Format of Extended Drive Parameter Block:
Offset Size Description (Table 01787)
00h 24 BYTEs standard DOS 4+ DPB
18h BYTE "dpb_flags" (undocumented)
FFh force media check
19h DWORD pointer to next DPB (see note)
1Dh WORD cluster at which to start search for free space when writing,
usually the last cluster allocated
1Fh WORD number of free clusters on drive, FFFFh = unknown
21h WORD high word of free cluster count
23h WORD active FAT/mirroring
bit 7: do not mirror active FAT to inactive FATs
bits 6-4: reserved (0)
bits 3-0: the 0-based FAT number of the active FAT
(only meaningful if mirroring disabled)
25h WORD sector number of file system information sector, or
FFFFh for none (see also #01788)
27h WORD sector number of backup boot sector, or FFFFh for none
29h DWORD first sector number of the first cluster
2Dh DWORD maximum cluster number
31h DWORD number of sectors occupied by FAT
35h DWORD cluster number of start of root directory
39h DWORD cluster number at which to start searching for free space
Notes: except for offset 18h, all of the first 33 bytes are identical to
the standard DOS 4-6 DPB
unless the proper value is given in SI on entry to "Get_ExtDBP", the
next-DPB pointer and device driver address are set to 0000h:0000h
SeeAlso: #01786,#01395 at AH=32h,#01664
Format of File System Information structure:
Offset Size Description (Table 01788)
00h DWORD signature 61417272h
04h DWORD number of free clusters (FFFFFFFFh if unknown)
08h DWORD most recently allocated cluster
0Ch 12 BYTEs reserved
SeeAlso: #01787
--------D-217303-----------------------------
INT 21 - Windows95 - FAT32 - GET EXTENDED FREE SPACE ON DRIVE
AX = 7303h
DS:DX -> ASCIZ string for drive ("C:\" or "\\SERVER\Share")
ES:DI -> buffer for extended free space structure (see #01789)
CX = length of buffer for extended free space
Return: CF clear if successful
ES:DI buffer filled
CF set on error
AX = error code
Notes: on DOS versions which do not support the FAT32 calls, this function
returns CF clear/AL=00h (which is the DOS v1+ method for reporting
unimplemented functions)
under DOS 7.x (i.e. "MSDOS Mode" under Windows95), the ASCIZ string
pointed at by DS:DX *must* include the drive letter, or this function
will return CF set/AX=0015h (invalid drive). In a DOS box, omitting
the drive letter (DS:DX -> "\") results in the free space for the
current default drive, as expected
BUG: this function returns a maximum of 2GB free space even on an FAT32
partition larger than 2GB under some versions of Win95 and Win98,
apparently by limiting the number of reported free clusters to no
more than 64K -- but only in a DOS window if a TSR has hooked INT 21h
SeeAlso: AX=7302h,AX=7304h,AX=7305h,AH=36h
Format of extended free space structure:
Offset Size Description (Table 01789)
00h WORD (ret) size of returned structure
02h WORD (call) structure version (0000h)
(ret) actual structure version (0000h)
04h DWORD number of sectors per cluster (with adjustment for compression)
08h DWORD number of bytes per sector
0Ch DWORD number of available clusters
10h DWORD total number of clusters on the drive
14h DWORD number of physical sectors available on the drive, without
adjustment for compression
18h DWORD total number of physical sectors on the drive, without
adjustment for compression
1Ch DWORD number of available allocation units, without adjustment
for compression
20h DWORD total allocation units, without adjustment for compression
24h 8 BYTEs reserved
- Raw text -