IStream::Clone
This method creates a new stream object with its own seek pointer that references the same bytes as the original stream.
HRESULT Clone(
IStream **ppstm
);
Parameters
- ppstm
[out] When successful, pointer to the location of an IStream pointer to the new stream object. If an error occurs, this parameter is NULL.
Return Values
One of the values described in the following table is returned.
| Value | Description |
|---|---|
| S_OK | The stream was successfully cloned. |
| E_PENDING | Asynchronous Storage only: Part or all of the streams data is currently unavailable. |
| STG_E_INSUFFICIENT_MEMORY | The stream was not cloned due to a lack of memory. |
| STG_E_INVALIDPOINTER | The ppStm pointer is not valid. |
| STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree. |
Remarks
This method creates a new stream object for accessing the same bytes but using a separate seek pointer. The new stream object sees the same data as the source stream object. Changes written to one object are immediately visible in the other. Range locking is shared between the stream objects.
The initial setting of the seek pointer in the cloned stream instance is the same as the current setting of the seek pointer in the original stream at the time of the clone operation.
Requirements
| Runs on | Versions | Defined in | Include | Link to |
|---|---|---|---|---|
| Windows CE OS | 2.0 and later | Objidl.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.