IFsiFileItem2::AddStream method (imapi2fs.h)
Associates a named stream with a specific file in the file system image.
Syntax
HRESULT AddStream(
[in] BSTR name,
[in] IStream *streamData
);
Parameters
[in] name
A string represents the name of the named stream. This should not include the path and should only contain valid characters as per file system naming conventions.
[in] streamData
An IStream interface of the named stream used to write to the resultant file system image.
Return value
S_OK is returned on success, but other success codes may be returned as a result of implementation. The following error codes are commonly returned on operation failure, but do not represent the only possible error values:
Return code/value | Description |
---|---|
|
Feature is not supported for the current file system revision, and as a result, will be created without this feature. |
|
Pointer is not valid. |
|
The value specified for parameter '%1!ls!' is invalid. |
|
ls!' is not part of the file system. It must be added to complete this operation. |
|
The referenced IFileSystemImage object is in read only mode. |
|
Internal file system error has occurred. |
|
'%1!ls!' name already exists. |
|
Cannot read data from stream supplied for file '%1!ls!'. |
|
Adding '%1!ls!' would result in a result image having a size larger than the current configured limit. |
|
The data stream supplied for the file '%1!ls!' is inconsistent; expected %2!I64d! bytes, found %3!I64d! |
|
Failed to allocate required memory. |
Remarks
The file to which the named stream will be added must already exist within the file system image. If this method is called with a name that already exists for a named stream, it will return an error and will not replace the existing named stream.
If this method is invoked for a file system object that does not contain UDF in the list of file systems enabled for creation in the resultant image or if the UDF revision is below 2.00, this method returns success code IMAPI_S_IMAGE_FEATURE_NOT_SUPPORTED. This success code indicates that the named stream has been added but will not appear in the resultant file system image unless UDF revision 2.00 or higher is enabled in the file system object.
Currently, IMAPI_E_READONLY is returned when this method is called on an imported file system image, regardless of the read only status of the image.
This method is supported in Windows Server 2003 with Service Pack 1 (SP1), Windows XP with Service Pack 2 (SP2), and Windows Vista via the Windows Feature Pack for Storage. All features provided by this update package are supported natively in Windows 7 and Windows Server 2008 R2.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista, Windows XP with SP2 [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | imapi2fs.h |