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