IWMDMStorageControl::Move method (mswmdm.h)

The Move method moves the current storage to a new location on the device.

Syntax

HRESULT Move(
  [in] UINT          fuMode,
  [in] IWMDMStorage  *pTargetObject,
  [in] IWMDMProgress *pProgress
);

Parameters

[in] fuMode

Processing mode by which to invoke the Move operation and the type of move to make. 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.
 

The following table lists flags that indicate where the object is moved to. One value from this table is combined with one value from the preceding Mode table using a bitwise OR.

Flag Description
WMDM_STORAGECONTROL_INSERTBEFORE The object is inserted before the target object.
WMDM_STORAGECONTROL_INSERTINTO The object is inserted into the target object.
WMDM_STORAGECONTROL_INSERTAFTER The object is inserted after the target object.

[in] pTargetObject

Pointer to the object before or after which you want to put the current object.

[in] pProgress

Optional pointer to an IWMDMProgress interface that has been implemented by the application to track the progress of an ongoing operation.

Return value

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 extensive list of possible error codes, see Error Codes.

Remarks

A file or directory can be moved only within the same root storage.

If the WMDM_MODE_THREAD flag is specified, you should obtain completion status by calling either IWMDMProgress2::End2 or IWMDMProgress3::End3. These methods will ensure that the operation is complete and will also return an HRESULT with success or failure information.

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 move 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

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

IWMDMDevice::GetStatus

IWMDMProgress Interface

IWMDMStorage Interface

IWMDMStorageControl Interface