views:

30

answers:

1

Hi, I am trying to use GetDiskFreeSpaceEx in wince5.0 emulator. This is the following code I have written.

ULARGE_INTEGER notused, totalBytes, freeBytes;


GetDiskFreeSpaceEx(_T("\\Windows"),&notused,&totalBytes,&freeBytes);
printf(" Error in disk %d ", GetLastError());

printf(" values = notused %d,totalBytes %d,freeBytes %d",notused,totalBytes,freeBytes);

*Output *

14540 PID:3db620e TID:3e5c83e Error in disk 0

14540 PID:3db620e TID:3e5c83e values = notused 25987296,totalBytes 0,freeBytes 26234880

The total bytes that I get is zero. Am I missing something or in emulator is that OK?

+1  A: 

Well, I am just reading the documentation here and it says:

lpTotalNumberOfBytes - Pointer to a variable to receive the total number of bytes on the disk that are available to the user associated with the calling thread

Have you tried another directory or user?

My guess is that this is specific to the Windows folder, but I am not too familiar wit hthe emulator.


I just tried the call on the \Windows directory in a RAM based image and received a number larger than 0.

My other guess would be that it is related to the store that the Windows folder resides in and the privileges you have for it.

Shaihi