Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

IVdsAdvancedDisk::Clean method (vds.h)

  • 2023-02-09
Feedback

In this article

[Beginning with Windows 8 and Windows Server 2012, theVirtual Disk Service COM interface is superseded by theWindows Storage Management API.]

Removes partition informationand uninitializes basic or dynamic disks.

Windows Server 2003:  TheClean 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

IfTRUE, cleans a disk containing data volumes or ESP partitions.

[in] bForceOEM

IfTRUE, cleans a MBR-based disk containing the known OEM partitions in the following table or cleans aGPT-based disk containing any OEM partition. An OEM partition has the GPT_ATTRIBUTE_PLATFORM_REQUIRED flag seton 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.

[in] bFullClean

IfTRUE, cleans the entire disk by replacing the data on each sector with zeros; otherwise, this method cleansonly the first and the last megabytes on the disk.

[out] ppAsync

The address of a pointer to theIVdsAsync interfacepointer, which VDS initializes on return. Callers must release the interface. Use this pointer to cancel, waitfor, or query the status of the operation.

Return value

This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, andVDS-specific return values. It can also return convertedsystem error codes using theHRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlyingVDS 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 andbForceOEM is false.
  • The disk contains a volume or ESP partition andbForce isFALSE.
  • The disk contains one of the system volumes regardless of whetherbForce isTRUE orFALSE. 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 callingIVdsVolumeMF::Dismount for each volume.

Use thebForce parameter, thebForceOEM parameter, or bothwith 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:  TheClean method is not supported for removable devices.

Implementers must return a pointer to theIVdsAsync interface forthis method, regardless of whether the call initiates an asynchronous operation.

Requirements

RequirementValue
Minimum supported clientWindows Vista [desktop apps only]
Minimum supported serverWindows Server 2003 [desktop apps only]
Target PlatformWindows
Headervds.h
LibraryUuid.lib

See also

Disk Object

IVdsAdvancedDisk

IVdsAsync


Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo