BUG: Drive Object Properties Are Incorrect on Large Drives (>2GB) (225032)
The information in this article applies to:
- Microsoft Visual Basic for Applications 5.0
- Microsoft Visual Basic for Applications 6.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q225032 SYMPTOMS
The FreeSpace, TotalSize, or AvailableSpace properties of the File System object's Drive object return incorrect results.
CAUSE
This problem occurs when:
- The expected return value exceeds 2147483647 bytes (or two Gigabytes), and:
- The code is running with Windows 95 or Windows 98.
The reason that this problem occurs is that 2147483647 is the maximum value that can be stored in a 32-bit integer, a Visual Basic Long. The File System object does not take the possibility of larger values into account.
RESOLUTION
To work around this problem, use the Windows API function GetDiskFreeSpaceEx to return the total size, available space, and free space of a drive. For additional information about using the GetDiskFreeSpaceEx function, please see the following article in the Microsoft Knowledge Base: 225144 HOWTO: Use GetDiskFreeSpaceEx to Retrieve Drive Information
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/28/2004 |
---|
Keywords: | kbbug kbpending KB225032 |
---|
|