Windows Media Format SDK banner art
PreviousNext

IWMDMStorageControl::Insert

The Insert method inserts content onto a storage medium.

Syntax

HRESULT Insert(
  UINT  fuMode,
  LPWSTR  pwszFile,
  IWMDMOperation*  pOperation,
  IWMDMProgress* pProgress,
  IWMDMStorage**  ppNewObject
);

Parameters

  fuMode

[in]  Processing mode used for the Insert operation. The following table lists the processing modes that can be specified in the fuMode parameter. You must specify exactly one of the first two modes, exactly one of the STORAGECONTROL modes, and exactly one of the CONTENT modes.

Mode Description
WMDM_MODE_BLOCK The operation will be performed using block mode processing. The call will not return until the operation is completed.
WMDM_MODE_THREAD The operation will be performed using thread mode processing. The call will return immediately, and the operation will be performed in a background thread.
WMDM_MODE_QUERY A test will be performed to determine whether the insert operation could succeed, but the insert will not be performed.
WMDM_STORAGECONTROL_INSERTBEFORE The object will be inserted before the target object.
WMDM_STORAGECONTROL_INSERTAFTER The object will be inserted after the target object.
WMDM_FILE_CREATE_OVERWRITE The object will replace the target object.
WMDM_CONTENT_FILE The content being inserted is a file.
WMDM_CONTENT_FOLDER The content being inserted is a folder.
WMDM_CONTENT_OPERATIONINTERFACE The content being inserted is an operation interface. The data for the content should be written to the application-implemented IWMDMOperation interface.

  pwszFile

[in]  Pointer to a (Unicode)wide character NULL-terminated string indicating where to find the content for the insert operation. This parameter must be NULL if WMDM_CONTENT_OPERATIONINTERFACE is specified in fuMode.

  pOperation

[in]  Pointer to an IWMDMOperation interface, an optional set of methods used to enhance the transfer of content to a media device. This parameter must be NULL if WMDM_CONTENT_FILE or WMDM_CONTENT_FOLDER is specified in fuMode.

  pProgress

[in]  Pointer to an IWMDMProgress interface to be used by Windows Media Device Manager to report progress back to the application. This parameter can be NULL.

  ppNewObject

[out]  Pointer to an IWMDMStorage interface that will contain the new content. This parameter can be NULL.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Description
WMDM_E_INTERFACEDEAD The file or folder was previously deleted.
WMDM_E_NORIGHTS The caller does not have the rights required to perform the requested operation.
E_BUSY The media device is already busy with another operation.
E_INVALIDARG Some of the input parameters are invalid or NULL.
E_FAIL An unspecified error occurred.

Remarks

If both WMDM_MODE_BLOCK and WMDM_MODE_THREAD are specified in fuMode, block mode is used.

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.