IFileSystemImage::CreateFileItem method

Create a file item with the specified name.

Syntax

HRESULT CreateFileItem(
  BSTR         name,
  IFsiFileItem **newItem
);

Parameters

name

String that contains the name of the file item to create.

newItem

An IFsiFileItem interface of the new file item. When done, call the IFsiFileItem::Release method to release the interface.

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 Description
E_POINTER
Pointer is not valid.

Value: 0x80004003

IMAPI_E_INVALID_PARAM
The provided name is not valid.

Value: 0xC0AAB101

E_OUTOFMEMORY
Failed to allocate the required memory.

Value: 0x8007000E

Remarks

After setting properties on the IFsiFileItem interface, call the IFsiDirectoryItem::Add method on the parent directory item to add it to the file system image.

Requirements

   
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

See Also

IFileSystemImage

IFsiFileItem