Microsoft KB Archive/250301

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 20:46, 16 July 2020 by X010 (talk | contribs) (1 revision imported: importing part 2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Q250301



The information in this article applies to:


  • Microsoft Win32 Application Programming Interface (API), included with:
    • Microsoft Windows 95
    • Microsoft Windows 98
    • Microsoft Windows 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 kbOSWin95 kbOSWin98 win98se kbDSupport
Issue type : kbprb
Technology : kbAudDeveloper kbWin32sSearch kbWin32API


Last Reviewed: December 16, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.