Windows Media Format SDK banner art
PreviousNext

IWMDMStorageControl::Read

The Read method reads content from a storage medium on a portable device and copies it to a file on the computer.

Syntax

HRESULT Read(
  UINT  fuMode,
  LPWSTR  pwszFilename,
  IWMDMProgress*  pProgress,
  IWMDMOperation*  pOperation
);

Parameters

  fuMode

[in]  Processing mode used for the Read 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, and exactly one of the last three (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_CONTENT_FILE The caller requests that Windows Media Device Manager read the file from the portable device into a file on the hard disk. The caller should indicate, in the pwszFileName parameter, the full path and name of the file.
WMDM_CONTENT_FOLDER The caller requests that Windows Media Device Manager read the specified folder, the contents, of the folder and the contents of any subfolders from the portable device onto the hard disk. The caller should indicate the full path of the target directory on the hard disk in the pwszFileName parameter.
WMDM_CONTENT_OPERATIONINTERFACE The content being read is an operation interface. The data for the content should be read from the application-implemented IWMDMOperation interface.

  pwszFilename

[in]  Pointer to a file name on the computer to which the content from the portable device will be copied. This parameter must be NULL if WMDM_CONTENT_OPERATIONINTERFACE is specified in fuMode.

  pProgress

[in]  Specifies an IWMDMProgress interface that has been implemented by the application to track the progress of ongoing operations (optional; can be NULL).

  pOperation

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

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.
E_BUSY The media device is already busy with another operation.
E_INVALIDARG Either the fuMode or the pOperation parameter is invalid or NULL.
E_NOTCERTIFIED Permission to read has been denied.
E_FAIL An unspecified error occurred.

Remarks

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

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.