GetDiskFreeSpaceEx returns disk free space without consideringuser-quota

S

somi

Hi

I am confused with what GetDiskFreeSpaceEx returns.
GetDiskFreeSpaceEx returns below three parameters:
lpFreeBytesAvailable: the total number of free bytes on a disk that
are available to the
user who is associated with the calling thread. If per-user quotas are
being used, this
value may be less than the total number of free bytes on a disk.
lpTotalNumberOfBytes: the total number of bytes on a disk that are
available to the user who
is associated with the calling thread. If per-user quotas are being
used, this value may be
less than the total number of bytes on a disk.
lpTotalNumberOfFreeBytes: the total number of free bytes on a disk.

In our application the parameters lpFreeBytesAvailable and
lpTotalNumberOfBytes are not
returning the values considering the user-quota that is defined on the
volume.

1) Drive D has 25 Gb total space and 19 GB free space.
2) Enabled quota in the D:\ Drive Properties/Quota tab and checked
"Deny disk space to user
exceeding quota limit" checkbox. Verified that the disk quota system
is active.
3) Set quota limit for a user (domain user) as 2 GB through "Quota
entries".
4) Ran the application in the context that user. The
parameters(lpFreeBytesAvailable = 19 GB
and lpTotalNumberOfBytes = 25 GB) returns sizes without considering
user quota.

But they do consider the hard quota set through FSRM (File Server
Resource Manager) on
Windows 2003 server R2 and Windows 2008 server OS, but does not
consider the quota set per-user.

So the statement “total number of free bytes on a disk that are
available to the user who is
associated with the calling thread” seems inacccurate. May be I am not
understanding
it correctly. Please comment on this.

~Somesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top