Compartilhar via


IStorage::RenameElement

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method renames the specified substorage or stream object in this storage object.

Syntax

HRESULT RenameElement( 
  const WCHAR* pwcsOldName, 
  const WCHAR* pwcsNewName 
);

Parameters

  • pwcsOldName
    [in] Pointer to a wide character string that contains the name of the substorage or stream to be changed.
  • pwcsNewName
    [in] Pointer to a wide character string that contains the new name for the specified substorage or stream.

Return Value

The following table shows the return values for this method.

Value Description

S_OK

The element was successfully renamed.

E_PENDING

Asynchronous Storage only: Part or all of the element's data is currently unavailable.

For more information see the IFillLockBytes interface and Asynchronous Storage.

STG_E_ACCESSDENIED

The caller does not have sufficient permissions for renaming the element.

STG_E_FILENOTFOUND

The element with the specified old name does not exist.

STG_E_FILEALREADYEXISTS

The element specified by the new name already exists.

STG_E_INSUFFICIENTMEMORY

The element was not renamed due to a lack of memory.

STG_E_INVALIDNAME

Invalid value for one of the names.

STG_E_INVALIDPOINTER

The pointer specified for the element was invalid.

STG_E_INVALIDPARAMETER

One of the parameters was invalid.

STG_E_REVERTED

The storage object has been invalidated by a revert operation above it in the transaction tree.

STG_E_TOOMANYOPENFILES

The element was not renamed because there are too many open files.

Remarks

IStorage::RenameElement renames the specified substorage or stream in this storage object. An element in a storage object cannot be renamed while it is open. The rename operation is subject to committing the changes if the storage is open in transacted mode.

The IStorage::RenameElement method is not guaranteed to work in low memory with storage objects open in transacted mode. It may work in direct mode.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later