Platform SDK: Files and I/O

GetFileSizeEx

The GetFileSizeEx function retrieves the size of a specified file.

BOOL GetFileSizeEx(
  HANDLE hFile,              // handle to file
  PLARGE_INTEGER lpFileSize  // file size
);

Parameters

hFile
[in] Handle to the file whose size is to be returned. The handle must have been created with either GENERIC_READ or GENERIC_WRITE access to the file.
lpFileSize
[out] Pointer to a LARGE_INTEGER structure that receives the file size.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

File I/O Overview, File I/O Functions, LARGE_INTEGER