Export (0) Print
Expand All

IVdsAdvancedDisk::Clean method

[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

bForce [in]

If TRUE, cleans a disk containing data volumes or ESP partitions.

bForceOEM [in]

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 typeDescription
0x12An EISA partition.
0x84A hibernation partition for laptops.
0xA0A diagnostic partition for some HP laptops.
0xDEA partition defined by Dell.
0xFEAn IBM IML partition.

 

bFullClean [in]

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.

ppAsync [out]

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/valueDescription
S_OK

The data was removed successfully and the disk was uninitialized.

VDS_E_NO_MEDIA
0x80042412L

There is no media in the removable device.

VDS_E_MISSING_DISK
0x80042454L

The disk is missing.

VDS_E_OPERATION_DENIED
0x8004240AL

The operation failed under one of the following conditions:

  • The disk contains an OEM partition and bForceOEM is false.
  • The disk contains a volume or ESP partition and bForce is FALSE.
  • The disk contains one of the system volumes regardless of whether bForce is TRUE or FALSE. A system volume can be any of the following items:
    • A volume containing the operating system loader.
    • A boot volume, which contains the system32 directory.
    • A volume containing the pagefile or hibernation file, or a volume used as a crash dump.
    • An ESP partition (the partition from which the system boots).
VDS_S_DISK_PARTIALLY_CLEANED
0x0004241AL

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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Vds.h

Library

Uuid.lib

See also

IVdsAdvancedDisk
IVdsAsync
Disk Object

 

 

Community Additions

ADD
Show:
© 2014 Microsoft