2 #include <msvcrt/ctype.h>
3 #include <msvcrt/direct.h>
9 unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t* _diskspace)
11 char RootPathName[10];
13 RootPathName[0] = toupper(_drive +'@');
14 RootPathName[1] = ':';
15 RootPathName[2] = '\\';
17 if (_diskspace == NULL)
19 if (!GetDiskFreeSpaceA(RootPathName,(LPDWORD)&_diskspace->sectors_per_cluster,(LPDWORD)&_diskspace->bytes_per_sector,
20 (LPDWORD )&_diskspace->avail_clusters,(LPDWORD )&_diskspace->total_clusters))
22 return _diskspace->avail_clusters;