ReactOS
0.4.16-dev-109-gf4cb10f
getdfree.c
Go to the documentation of this file.
1
#include <precomp.h>
2
#include <ctype.h>
3
#include <
direct.h
>
4
5
6
/*
7
* @implemented
8
*/
9
unsigned
int
_getdiskfree
(
unsigned
int
_drive,
struct
_diskfree_t
* _diskspace)
10
{
11
char
RootPathName[10];
12
13
RootPathName[0] =
toupper
(_drive +
'@'
);
14
RootPathName[1] =
':'
;
15
RootPathName[2] =
'\\'
;
16
RootPathName[3] = 0;
17
if
(_diskspace ==
NULL
)
18
return
0;
19
if
(!
GetDiskFreeSpaceA
(RootPathName,(
LPDWORD
)&_diskspace->
sectors_per_cluster
,(
LPDWORD
)&_diskspace->
bytes_per_sector
,
20
(
LPDWORD
)&_diskspace->
avail_clusters
,(
LPDWORD
)&_diskspace->
total_clusters
))
21
return
0;
22
return
_diskspace->
avail_clusters
;
23
}
toupper
int toupper(int c)
Definition:
utclib.c:881
direct.h
NULL
#define NULL
Definition:
types.h:112
GetDiskFreeSpaceA
BOOL WINAPI GetDiskFreeSpaceA(IN LPCSTR lpRootPathName, OUT LPDWORD lpSectorsPerCluster, OUT LPDWORD lpBytesPerSector, OUT LPDWORD lpNumberOfFreeClusters, OUT LPDWORD lpTotalNumberOfClusters)
Definition:
disk.c:142
_getdiskfree
unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace)
Definition:
getdfree.c:9
_diskfree_t
Definition:
direct.h:20
_diskfree_t::bytes_per_sector
unsigned bytes_per_sector
Definition:
direct.h:24
_diskfree_t::sectors_per_cluster
unsigned sectors_per_cluster
Definition:
direct.h:23
_diskfree_t::total_clusters
unsigned total_clusters
Definition:
direct.h:21
_diskfree_t::avail_clusters
unsigned avail_clusters
Definition:
direct.h:22
LPDWORD
uint32_t * LPDWORD
Definition:
typedefs.h:59
sdk
lib
crt
direct
getdfree.c
Generated on Wed Oct 9 2024 06:19:17 for ReactOS by
1.9.6