Share via


CeStreamSetSize (EDB) (Windows Embedded CE 6.0)

1/6/2010

This function sets the size of data in a stream.

This function does not work with CEDB databases. For more information about CEDB, see CEDB Reference.

Syntax

BOOL CeStreamSetSize(
  HANDLE hStream,
  DWORD cbSize
);

Parameters

  • hStream
    [in] Handle to the stream object. The handle is obtained with the CeOpenStream (EDB) function.
  • cbSize
    [in] New size of the stream.

Return Value

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table shows possible values.

Return Value Description

ERROR_ACCESS_DENIED

The stream was not opened with GENERIC_WRITE.

ERROR_INVALID_HANDLE

The hStream parameter is set to NULL or equal to INVALID_HANDLE_VALUE.

ERROR_NO_MORE_ITEMS

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 before doing anything else in the parent database.

Remarks

To set the size of a stream, you must have specified the GENERIC_WRITE flag when opening the stream with CeOpenStream. The size is based on the entire stream and is not relative to the current seek position.

The stream is increased or truncated as required.

To save changes to a stream with this function, call the CeStreamSaveChanges (EDB) function.

Requirements

Header windbase.h
Library coredll.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

EDB Functions
CeOpenStream (EDB)
CeStreamSaveChanges (EDB)