Share via


IWMDMStorageGlobals::Initialize

banner art

The Initialize method formats the storage medium.

Syntax

HRESULT Initialize(
  UINT  fuMode,
  IWMDMProgress*  pProgress
);

Parameters

fuMode

[in]  Mode used to initialize the medium. Specify exactly one of the following two modes. If both modes are specified, block mode is used.

Mode Description
WMDM_MODE_BLOCK The operation will be performed using block mode processing. The call will not return until the operation is finished.
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.

pProgress

[in]  Pointer to an IWMDMProgress interface implemented by an application to track the progress of the formatting operation.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider 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 a complete 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 The media device does not support initializing.
E_BUSY The media device is performing an operation.
E_INVALIDARG The mode specified in the fuMode parameter is not valid.
E_FAIL An unspecified error occurred.
WMDM_E_NOTCERTIFIED The caller is not certified.

Remarks

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 End notification. Failure to do this will result in access violations.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also