Previous | Next |
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 is performed using block mode processing. The call is not returned until the operation is completed. |
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.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Return code | Description |
E_BUSY | The media device is performing an operation. |
E_INVALIDARG | An invalid mode has been specified in the fuMode parameter. |
WMDM_E_NOTSUPPORTED | The device is not capable of formatting the storage medium. |
E_FAIL | An unspecified error occurred. |
Remarks
If WMDM_MODE_BLOCK is specified, Initialize does not return until formatting is complete. 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.
The pProgress argument can be NULL.
See Also
Previous | Next |