IVdsAdvancedDisk::Clean method (vds.h)
[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]
Removes partition information and uninitializes basic or dynamic disks.
Windows Server 2003: The Clean method is not supported for removable devices.
Syntax
HRESULT Clean(
[in] BOOL bForce,
[in] BOOL bForceOEM,
[in] BOOL bFullClean,
[out] IVdsAsync **ppAsync
);
Parameters
[in] bForce
If TRUE, cleans a disk containing data volumes or ESP partitions.
[in] bForceOEM
If TRUE, cleans a MBR-based disk containing the known OEM partitions in the following table or cleans a GPT-based disk containing any OEM partition. An OEM partition has the GPT_ATTRIBUTE_PLATFORM_REQUIRED flag set on a GPT-based disk.
Partition type | Description |
---|---|
0x12 | An EISA partition. |
0x84 | A hibernation partition for laptops. |
0xA0 | A diagnostic partition for some HP laptops. |
0xDE | A partition defined by Dell. |
0xFE | An IBM IML partition. |
[in] bFullClean
If TRUE, cleans the entire disk by replacing the data on each sector with zeros; otherwise, this method cleans only the first and the last megabytes on the disk.
[out] ppAsync
The address of a pointer to the IVdsAsync interface pointer, which VDS initializes on return. Callers must release the interface. Use this pointer to cancel, wait for, or query the status of the operation.
Return value
This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, and VDS-specific return values. It can also return converted system error codes using the HRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlying VDS provider that is being used. Possible return values include the following.
Return code/value | Description |
---|---|
|
The data was removed successfully and the disk was uninitialized. |
|
There is no media in the removable device. |
|
The disk is missing. |
|
The operation failed under one of the following conditions:
|
|
The partition table is cleaned, but not all sectors are cleaned during a full clean. Alternatively, some sectors of the first megabyte and the last megabyte are cleaned; however, unless the clean is a full clean, the remaining sectors are not cleaned. |
Remarks
Before calling this method, the caller should dismount any mounted volumes on the disk by calling IVdsVolumeMF::Dismount for each volume.
Use the bForce parameter, the bForceOEM parameter, or both with this method unless you first delete all data volumes, known OEM partitions, and ESP partitions on the disk. This requirement excludes metadata partitions such as the MSR, the LDM metadata partition, and unknown OEM partitions.
Windows Server 2003: The Clean method is not supported for removable devices.
Implementers must return a pointer to the IVdsAsync interface for this method, regardless of whether the call initiates an asynchronous operation.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | vds.h |
Library | Uuid.lib |