LZSeek function (lzexpand.h)

Moves a file pointer the specified number of bytes from a starting position.

Syntax

LONG LZSeek(
  [in] INT  hFile,
  [in] LONG lOffset,
  [in] INT  iOrigin
);

Parameters

[in] hFile

A handle to the file.

[in] lOffset

The number of bytes by which to move the file pointer.

[in] iOrigin

The starting position of the pointer. This parameter must be one of the following values.

Value Meaning
0
Moves the file pointer lOffset bytes from the beginning of the file.
1
Moves the file pointer lOffset bytes from the current position.
2
Moves the file pointer lOffset bytes from the end of the file.

Return value

If the function succeeds, the return value specifies the offset from the beginning of the file to the new pointer position.

If the function fails, the return value is an LZERROR_* code. These codes have values less than zero. Note that LZSeek calls neither SetLastError nor SetLastErrorEx; thus, its failure does not affect a thread's last-error code.

The following is the list of error codes that LZSeek can return upon failure.

Return code Description
LZERROR_BADINHANDLE
The handle identifying the source file is not valid. The file cannot be read.
LZERROR_BADVALUE
One of the parameters is outside the range of acceptable values.
LZERROR_GLOBLOCK
The LZ file handle cannot be locked down.
 

There is no extended error information for this function; do not call GetLastError.

Remarks

The handle identified by the hFile parameter must be retrieved by calling either the LZInit or LZOpenFile function.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol Yes
SMB 3.0 Transparent Failover (TFO) Yes
SMB 3.0 with Scale-out File Shares (SO) Yes
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes
 

CsvFs will do redirected IO for compressed files.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header lzexpand.h (include Windows.h)
Library Lz32.lib
DLL Lz32.dll

See also

File Compression and Decompression

File Management Functions

LZInit

LZOpenFile