Getting incorrect data form GetDiskFreeSpace function 
Author Message
 Getting incorrect data form GetDiskFreeSpace function

I have a VB application that makes a call to a system service to get the
amount of free space on a hard disk.  It's worked for years, and the call is
to the function:

Declare Function GetDiskFreeSpace& Lib "kernel32" Alias "GetDiskFreeSpaceA"
_
    (ByVal lpRootPathName As String, _
    lpSectorsPerCluster As Long, _
    lpBytesPerSector As Long, _
    lpNumberOfFreeClusters As Long, _
    lpTotalNumberOfClusters As Long)

Now, suddenly, I'm having a problem with large disks.  If the disk (or disk
partition) is greater than 2+GB, then the information that comes back tells
me that the drive only holds 2,147,155,968 bytes -- even if it's really
quite larger.  Why does this function "break" for larger disks?  Is there
something else I should use to get this information for larger disks?  I'm
looking for exactly the information above -- cluster size, free clusters,
total clusters, etc.
--
Frank D. Nicodem, Jr.



Sun, 23 Feb 2003 02:08:05 GMT  
 Getting incorrect data form GetDiskFreeSpace function

Frank,

Quote:
>Is there something else I should use to get this information for larger disks?

In Win95 OSR2 and later, there's a function GetDiskFreeSpaceEx that
fixes the problem.

http://www.mvps.org/vbnet/code/shell/getdiskfreespaceex.htm

Matt

============================================

  CodeHound - Free VB Search Engine
  http://www.codehound.com



Sun, 23 Feb 2003 02:48:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Crystal 7 getting incorrect data from database

2. MID function returning incorrect data

3. Getting around GetDiskFreeSpace 2GB Limitations

4. How do I use the GetDiskFreeSpace-function?

5. GetDiskFreeSpace Function limitations?

6. Getting Access forms to display when calling functions from VB

7. Error: 80070001 Incorrect Function

8. Incorrect Case in DLL Function

9. DVD drive says "Incorrect Function:...

10. DAte problems when getting data from a Word Form

11. Getting access data into a combobox on a word form

12. getting data from forms???

 

 
Powered by phpBB® Forum Software