IMDSPStorageGlobals::Initialize
The Initialize method formats the storage medium. This method is optional. However, this method should be implemented if the device supports this functionality. If this method is not implemented, IMDSPStorageGlobals::GetCapabilities must return WMDM_STORAGECAP_NOT_INITIALIZABLE in addition to any other flags. For more information, see Mandatory and Optional Interfaces.
Syntax
HRESULT Initialize(UINTfuMode,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 is performed using block mode processing. The call is not returned until the operation is finished. |
WMDM_MODE_THREAD | The operation is performed using thread mode processing. The call returns immediately and the operation is performed in a background thread. |
pProgress
[in] Pointer to an IWMDMProgress interface implemented by an application to track the progress of the formatting operation. This parameter can be NULL.
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 | The device is not capable of formatting the storage medium. |
E_BUSY | The media device is performing an operation. |
E_INVALIDARG | An invalid mode has been specified in the fuMode parameter. |
E_FAIL | An unspecified error occurred. |
Remarks
If WMDM_MODE_BLOCK is specified, Initialize does not return until formatting is finished. If the WMDM_MODE_THREAD is specified, the call returns immediately and the caller can use the IMDSPStorageGlobals::GetStatus method to track the initializing operation.
Requirements
Header: Defined in mswmdm.h.
Library: mssachlp.lib
See Also