Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 1.24 KB

File metadata and controls

36 lines (21 loc) · 1.24 KB

SetSize method

Project: Stream Extension Classes

Unit: PJIStreams

Classes: TPJIStreamWrapper, TPJHandleIStreamWrapper, TPJFileIStream

Applies to: ~>3.0

function SetSize(libNewSize: Largeint): HResult; virtual; stdcall;

Description

Changes the size of the wrapped stream.

Parameters:

  • libNewSize -- New stream size.

Returns:

  • S_OK on success.
  • E_FAIL if we can't set the size or the requested size is too large.
  • E_UNEXPECTED if there is an exception.
  • [~>3.0.0] STG_E_INVALIDFUNCTION if the value of libNewSize is greater than MaxInt or is less than zero. See Remarks.

Remarks

If the requested size of the wrapped stream is too large the stream size may be set to a smaller value than requested and E_FAIL will be returned.

[~>3.0.0] Although libNewSize accepts 64 bit values the implementation of SetSize is limited to positive 32 bit integer values. Passing a value greater than MaxInt or less than zero in the libNewSize parameter causes the method to return STG_E_INVALIDFUNCTION.

[~>3.1] libNewSize works as expected for values > MaxInt.