F
Florian
Hi,
I'm using the GetDiskFreeSpaceEx() API call and I'm getting really strange
results on one machine, a Windows XP (fully patched) machine. The code looks
like this:
ULARGE_INTEGER uiNotUsed, uiTotalNumberBytes, uiTotalNumberFreeBytes;
if (GetDiskFreeSpaceEx(cDrive, &uiNotUsed, &uiTotalNumberBytes,
&uiTotalNumberFreeBytes))
{
__int64 iFree64 = uiTotalNumberFreeBytes.QuadPart / (1024 * 1024);
__int64 iTotal64 = uiTotalNumberBytes.QuadPart / (1024 * 1024);
int iFree = iFree64;
int iTotal = iTotal64;
}
So I'm basically trying to store the number of megabytes in an integer
variable. This works on all Win2k (4) and Windows Server 2003 (2) machines
and works on two XP machines. But there is one laptop (that has no other
problems) where I will always get these values for both the total and free
space:
1407374883553280 (which is 0x5000000000000)
Can anybody explain to me what the **** is going on here? The laptop has one
harddisk (60Gb) with two logical drives (35.6Gb/2.33Gb free & 18.6Gb/6.42Gb
free).
I'm at a point where I can't use the app on this computer - and I'm worried
that I'm going to find more like that ... I couldn't find any problems in
technet,kb etc. so far. If I'm doing something wrong then I'd love to know
what I am doing wrong .... Even a printf("%i64d",
uiTotalNumberFreeBytes.QuadPart) shows the odd values ...
Thanks!
I'm using the GetDiskFreeSpaceEx() API call and I'm getting really strange
results on one machine, a Windows XP (fully patched) machine. The code looks
like this:
ULARGE_INTEGER uiNotUsed, uiTotalNumberBytes, uiTotalNumberFreeBytes;
if (GetDiskFreeSpaceEx(cDrive, &uiNotUsed, &uiTotalNumberBytes,
&uiTotalNumberFreeBytes))
{
__int64 iFree64 = uiTotalNumberFreeBytes.QuadPart / (1024 * 1024);
__int64 iTotal64 = uiTotalNumberBytes.QuadPart / (1024 * 1024);
int iFree = iFree64;
int iTotal = iTotal64;
}
So I'm basically trying to store the number of megabytes in an integer
variable. This works on all Win2k (4) and Windows Server 2003 (2) machines
and works on two XP machines. But there is one laptop (that has no other
problems) where I will always get these values for both the total and free
space:
1407374883553280 (which is 0x5000000000000)
Can anybody explain to me what the **** is going on here? The laptop has one
harddisk (60Gb) with two logical drives (35.6Gb/2.33Gb free & 18.6Gb/6.42Gb
free).
I'm at a point where I can't use the app on this computer - and I'm worried
that I'm going to find more like that ... I couldn't find any problems in
technet,kb etc. so far. If I'm doing something wrong then I'd love to know
what I am doing wrong .... Even a printf("%i64d",
uiTotalNumberFreeBytes.QuadPart) shows the odd values ...
Thanks!