GetFileSize() Does Not Support Huge Files on Windows 95 and Windows 98

ID: Q250301


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), included with:
    • Microsoft Windows versions 95, 98, 98 Second Edition


SYMPTOMS

When it is called on a Windows 95-based or Windows 98-based computer, the Win32 GetFileSize function does not support files larger than 4,294,967,295 bytes (4 gigabytes - 1 byte). The value of *lpFileSizeHigh (if lpFileSizeHigh is not null) is always returned as 0 (zero), regardless of the actual file size. As a result, GetFileSize returns an incorrect size of less than 4 gigabytes (GB) for files that are 4 GB or larger.


WORKAROUND

To correctly determine the size of a file that may be 4 GB or larger, use the GetFileInformationByHandle function.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Windows 95 and Microsoft Windows 98 (all versions).


MORE INFORMATION

There are other Win32 functions that support huge files (4,294,967,295 bytes or larger), for which Windows 95 and Windows 98 do not provide huge-file support. These functions include:

  • LockFile
  • ReadFile
  • ReadFileEx
  • SetFilePointer
  • UnLockFile
  • WriteFile
  • WriteFileEx
The file-size limitations of these functions on Windows 95 and Windows 98 are documented in the current version of the Microsoft Platform SDK.

The following functions may pass 64-bit values but have limitations under Windows 95 and Windows 98 or may not be supported under Windows 95 or Windows 98. These functions are documented in the current version of the Microsoft Platform SDK:
  • FileIOCompletionRoutine
  • GetDiskFreeSpace

The following file I/O functions are not supported on Windows 95 or Windows 98:
  • GetFileAttributesEx (supported on Windows 98 only)
  • GetFileSizeEx
  • GetQueuedCompletionStatus
  • LockFileEx
  • PostQueuedCompletionStatus
  • ReadDirectoryChangesW
  • ReadFileScatter
  • SetFilePointerEx
  • UnlockFileEx
  • WriteFileGather

Additional query words:

Keywords : win95 win98 kbAPI kbFileIO kbKernBase kbSDKWin32 kbWinOS95 kbWinOS98 win98se kbDSupport
Version : winnt:
Platform : winnt
Issue type : kbprb


Last Reviewed: January 27, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.