IWMDMStorageControl::Rename (deprecated)
![]() |
This is preliminary documentation and subject to change.
This topic documents a feature of the Windows Media Device Manager SDK. We recommend that you migrate your application to use the Windows Portable Devices API. For more information, see the Windows Portable Devices SDK.
The Rename method renames the current storage.
Syntax
HRESULT Rename(
UINT fuMode,
LPWSTR pwszNewName,
IWMDMProgress* pProgress
);
Parameters
fuMode
[in] Processing mode used for the Rename operation. Specify exactly one of the following two modes. If both modes are specified, block mode is used.
| Mode | Description |
| WMDM_MODE_BLOCK | The operation is performed using block mode processing. The call will not return until the operation is finished. |
| WMDM_MODE_THREAD | The operation is performed using thread mode processing. The call will return immediately, and the operation is performed in a background thread. |
pwszNewName
[in] Pointer to a wide-character null-terminated string specifying the new name.
pProgress
[in] Optional pointer to an IWMDMProgress interface that has been implemented by the application to track the progress of the action.
Return Values
The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:
- Standard COM error codes
- Windows error codes converted to HRESULT values
- Windows Media Device Manager error codes
For an extenstive list of possible error codes, see Error Codes.
Possible values include, but are not limited to, those in the following table.
| Return code | Description |
| S_OK | The method succeeded. |
| WMDM_E_NOTSUPPORTED | Renaming is not supported for this storage medium. |
| WMDM_E_INTERFACEDEAD | The file or folder was previously deleted. |
| E_BUSY | The media device is already busy with another operation. |
| E_INVALIDARG | One or more parameters is invalid or NULL. |
| E_FAIL | An unspecified error occurred. |
| WMDM_E_NOTCERTIFIED | The caller is not certified |
Remarks
To ensure the file operation is finished, call IWMDMDevice::GetStatus and check for WMDM_STATUS_READY.
If an application uses WMDM_MODE_THREAD and passes a non-null pProgress parameter, the application must ensure that the object to which pProgress belongs is not destroyed until the read operation completes, because Windows Media Device Manager will send progress notifications to this object. This object can be destroyed only after it receives an End notification. Failure to do this will result in access violations.
Requirements
Header: Defined in mswmdm.h.
Library: mssachlp.lib
See Also
.gif)