reactos/lib/sdk/crt/direct/getdfree.c
Cameron Gutman 29fa274d6d - Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers)
 - If someone wants to delete aicom-network-fixes, they are welcome to
 - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea

svn path=/branches/aicom-network-branch/; revision=44353
2009-12-02 03:23:19 +00:00

23 lines
635 B
C

#include <precomp.h>
#include <ctype.h>
#include <direct.h>
/*
* @implemented
*/
unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t* _diskspace)
{
char RootPathName[10];
RootPathName[0] = toupper(_drive +'@');
RootPathName[1] = ':';
RootPathName[2] = '\\';
RootPathName[3] = 0;
if (_diskspace == NULL)
return 0;
if (!GetDiskFreeSpaceA(RootPathName,(LPDWORD)&_diskspace->sectors_per_cluster,(LPDWORD)&_diskspace->bytes_per_sector,
(LPDWORD )&_diskspace->avail_clusters,(LPDWORD )&_diskspace->total_clusters))
return 0;
return _diskspace->avail_clusters;
}