StormLib API Reference

SFileSetFilePointer

Description

DWORD WINAPI SFileSetFilePointer(
  HANDLE hFile,                     // File handle
  LONG lFilePos,                    // Low 32 bits of the file position
  LONG * plFilePosHigh,             // Pointer to high 32 bits of the file position
  DWORD dwMoveMethod                // The starting point for the file pointer move
);

Function SFileSetFilePointer sets current position in an open file.

Parameters

hFile
[in] Handle to an open file. The file handle must have been created by SFileOpenFileEx.
lFilePos
[in] Low 32 bits of new position in the file.
plFilePosHigh
[in, out] Pointer to a high 32 bits of new position in the file.
dwMethod
[in] The starting point for the file pointer move. This parameter can be one of the following values:
Value Meaning
FILE_BEGIN
(0)
The starting point is 0 (zero) or the beginning of the file.
FILE_CURRENT
(1)
The starting point is the current file pointer.
FILE_END
(2)
The starting point is the current end of file.

Return Value

When the function succeeds, it returns lower 32-bit of the file size. On an error, it returns SFILE_INVALID_SIZE and GetLastError returns an error code.

Remarks

Current implementation of MPQ archives doesn't support files of size greater than 4 GB. Thus, if hFile is a handle to a file open from a MPQ and plFilePosHigh is not NULL, it must point to 0, or the function fails.

Availability in Storm.dll

Available in Storm.dll Yes
Ordinal number in Storm.dll 1.00 82 (0x052)
Ordinal number in Storm.dll 1.09 271 (0x10F)