You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Guillermina --
Microsoft replaced this function to GetDiskFreeSpaceEx, begining from Win95 OSR2 and NT4.
From Win32.Hlp (4 years ago):
"The GetDiskFreeSpace function returns incorrect values for volumes that are larger than 2 gigabytes. The function caps the values stored into *lpNumberOfFreeClusters and *lpTotalNumberOfClusters so as to never report volume sizes that are greater than 2 gigabytes.
Even on volumes that are smaller than 2 gigabytes, the values stored into *lpSectorsPerCluster, *lpNumberOfFreeClusters
, and *lpTotalNumberOfClusters values may be incorrect. That is because the operating system manipulates the values so that computations with them yield the correct volume size."
Beware... if you explicitly link to the GetDiskFreeSpaceEx() function in your code, your application will not run on Windows 95 (pre OSR2) - it will fail with a "Missing DLL Export" error.
If this is a problem, then the solution is to use runtime-dynamic-linking instead of loadtime linking. This involves removing the LIB clause from the declaration, using LoadLibrary() to bring an instance of the appropriate DLL into your address space, then a call to GetProcAddress() to get a pointer to the function (a return of zero means that this API is not available), then use CALL DWORD to execute the API. Finally, Freelibrary() is used to clean up the mess.
If you wish to implement this technique, then search the BBS for "GetDiskFreeSpaceEx" and you should (hopefully) find some example code.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment