CascLib API Reference

CascGetFileSize(64)

Description


  DWORD WINAPI CascGetFileSize(
      HANDLE hFile,                   // Handle to an open file
      PDWORD PtrFileSizeHigh          // Optional pointer to high 32-bits of the file size
      );

  bool WINAPI CascGetFileSize64(
      HANDLE hFile,                   // Handle to an open file
      PULONGLONG PtrFileSize          // Pointer to a 64-bit variable that receives the file size
      );

Functions CascGetFileSize and CascGetFileSize64 retrieve size of a file in the storage. The function CascGetFileSize64 is available since CascLib version 1.60

Parameters

hStorage [in]
Handle to an open CASC storage.
PtrFileSizeHigh [out]
Pointer to a DWORD variable that receives upper 32-bits of the file size. If this parameter is NULL, the eventual upper 32-bits of the file size are lost.
PtrFileSize [out]
Pointer to an ULONGLONG variable that receives 64-bit file size. If this parameter is NULL, the function fails and GetLastError() returns ERROR_INVALID_PARAMETER.

Return Value - CascGetFileSize

On success, the function returns lower 32-bits of the file size.
On failure, the function returns CASC_INVALID_SIZE and GetLastError() returns an error code.

Return Value - CascGetFileSize64

On success, the function returns true.
On failure, the function false and GetLastError() returns an error code.