A version of this page is also available for
This function changes the current seek position of an open stream.
BOOL CeStreamSeek( HANDLE hStream, DWORD cbMove, DWORD dwOrigin, LPDWORD lpcbNewOffset );
[in] Handle to the stream object. The handle is obtained with the CeOpenStream (EDB) function.
[in] Number of bytes to move the current seek position relative to the origin specified by the dwOrigin parameter.
[in] Specifies the origin from which to seek. Valid values for this parameter are defined by the STREAM_SEEK type, and can be one of the following:
The new seek position is an offset relative to the current seek position. In this case, cbMove is the signed displacement from the current seek position. You must cast cbMove ** to a LONG value.
The new seek position is an offset relative to the end of the stream. In this case, cbMove is the new seek position relative to the end of the stream.
The new seek position is an offset relative to the beginning of the stream. In this case, cbMove is the new seek position relative to the beginning of the stream.
[out] On successful return, contains the new seek position of the stream as a byte offset from the beginning of the stream. The value can be set to NULL.
TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values.
The hStream parameter is set to NULL or equal to INVALID_HANDLE_VALUE.
The dwOrigin parameter is not a valid STREAM_SEEK type.
The parent record of the stream object has been deleted. This can happen only if the stream object was opened for read access. When a stream is opened for write access, the parent record is locked for write access, which prevents the row from being deleted.
The database from which the stream object was opened had its seek position changed. To prevent this, open a stream, perform the operations, and then close the stream object before doing anything else in the parent database.
For performance reasons, changing the seek position does not cause an attempt to read data.
It is possible for a call to this function to succeed, but then subsequent functions that use the seek position to access the data to fail. For example, if the stream was 100 bytes in length, a stream seek to 200 would succeed, but a later operation would fail.
This function can be used to obtain the size of a stream. To do so, use STREAM_SEEK_END, with cbMove set to zero. On return, lpcbNewOffset contains the size of the stream.
|Windows Embedded CE||Windows CE 5.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|