CascLib API Reference

CascSetFilePointer(64)

Description


  DWORD WINAPI CascSetFilePointer(
      HANDLE hFile,                   // Handle to an open file
      LONG lFilePos,                  // Low 32-bits of the bytes to move
      LONG * PtrFilePosHigh,          // Optional pointer to high 32-bits of the file position
      DWORD dwMoveMethod              // Seek method
      );

  bool WINAPI CascSetFilePointer64(
      HANDLE hFile,                   // Handle to an open file
      LONGLONG DistanceToMove,        // Number of bytes to move
      PULONGLONG PtrNewPos,           // Pointer to a 64-bit variable that receives the new file pointer
      DWORD dwMoveMethod              // Seek method
      );

Functions CascSetFilePointer and CascSetFilePointer64 change the current read position within an open CASC file. The function CascSetFilePointer64 is available since CascLib version 1.60

Parameters

hFile [in]
Handle to an open CASC file.
lFilePos [in]
Low-order 32 bits of a signed value that specifies the number of bytes to move the file pointer.
  • If PtrFilePosHigh is not NULL, PtrFilePosHigh[0] and lFilePos form a single 64-bit signed value that specifies the distance to move.
  • If PtrFilePosHigh is NULL, lFilePos is a 32-bit signed value. A positive value for lFilePos moves the file pointer forward in the file, and a negative value moves the file pointer back.
PtrFilePosHigh [in, out]
A pointer to the high order 32-bits of the signed 64-bit distance to move. If you do not need the high order 32-bits, this pointer must be set to NULL. When not NULL, this parameter also receives the high order DWORD of the new value of the file pointer.
DistanceToMove [in]
The number of bytes to move the file pointer. A positive value moves the pointer forward in the file and a negative value moves the file pointer backward.
PtrNewPos [out]
A pointer to a variable to receive the new file pointer. If this parameter is NULL, the new file pointer is not returned.
dwMoveMethod [in]
The starting point for the file pointer move. This parameter can be one of the following values:
Open Flag Meaning
FILE_BEGIN
(0)
The starting point is zero or the beginning of the file.
FILE_CURRENT
(1)
The start point is the current value of the file pointer.
FILE_END
(2)
The starting point is the current end-of-file position.

Return Value - CascSetFilePointer

On success, the function returns lower 32-bits of the new file position. CASC_INVALID_POS and GetLastError() returns an error code.

Return Value - CascSetFilePointer64

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