General information
Category:
Windows API functions
Title:
GetDiskFreeSpaceEx return negative value on overflow condit
This code works on small drives with a parameter type of integer.
On large drives it return -1.0697E+9 with a parameter type of integer and
0.000E+0 with a parameter type of double.
Does anyone know how to set this up correctly to return the correct byte count for all drive sizes.
PUBLIC lpPathName, lpBytesToCall, lpTotalDiskBytes, lpFreeBytes
lpPathName = "A:\"
lpBytesToCall = 9
lpTotalDiskBytes = 9
lpFreeBytes = 9
DECLARE INTEGER GetDiskFreeSpaceEx IN WIN32API AS FREESPACE STRING @lpPathName,;
integer @lpBytesToCall, integer @lpTotalDiskBytes, integer @lpFreeBytes
RetVal = FREESPACE( @lpPathName, @lpBytesToCall, @lpTotalDiskBytes, @lpFreeBytes)
? "Path Free/Call Total/Bytes Free/Bytes"
? lpPathName
?? space(6)
?? lpBytesToCall
?? space(6)
?? lpTotalDiskBytes
?? space(6)
?? lpFreeBytes
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only