BackupSeek Function

The BackupSeek function seeks forward in a data stream initially accessed by using the BackupRead or BackupWrite function.

Syntax

C++
BOOL BackupSeek(
  __in   HANDLE hFile,
  __in   DWORD dwLowBytesToSeek,
  __in   DWORD dwHighBytesToSeek,
  __out  LPDWORD lpdwLowByteSeeked,
  __out  LPDWORD lpdwHighByteSeeked,
  __in   LPVOID *lpContext
);

Parameters

hFile [in]

Handle to the file or directory. This handle is created by using the CreateFile function.

The handle must be synchronous (nonoverlapped). This means that the FILE_FLAG_OVERLAPPED flag must not be set when CreateFile is called. This function does not validate that the handle it receives is synchronous, so it does not return an error code for a synchronous handle, but calling it with an asynchronous (overlapped) handle can result in subtle errors that are very difficult to debug.

dwLowBytesToSeek [in]

Low-order part of the number of bytes to seek.

dwHighBytesToSeek [in]

High-order part of the number of bytes to seek.

lpdwLowByteSeeked [out]

Pointer to a variable that receives the low-order bits of the number of bytes the function actually seeks.

lpdwHighByteSeeked [out]

Pointer to a variable that receives the high-order bits of the number of bytes the function actually seeks.

lpContext [in]

Pointer to an internal data structure used by the function. This structure must be the same structure that was initialized by the BackupRead function. An application must not touch the contents of this structure.

Return Value

If the function could seek the requested amount, the function returns a nonzero value.

If the function could not seek the requested amount, the function returns zero. To get extended error information, call GetLastError.

Remarks

Applications use the BackupSeek function to skip portions of a data stream that cause errors. This function does not seek across stream headers. For example, this function cannot be used to skip the stream name. If an application attempts to seek past the end of a substream, the function fails, the lpdwLowByteSeeked and lpdwHighByteSeeked parameters indicate the actual number of bytes the function seeks, and the file position is placed at the start of the next stream header.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

BackupRead
BackupWrite
CreateFile

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags :


Community Content

Roland Illig
Limitation
The BackupSeek function cannot be used to skip a header or parts of it, especially the stream name. You have to use BackupRead for that.

Tags :

Page view tracker