The Format method formats a file system on the current volume.

 HRESULT Format(
   [in] VDS_FILE_SYSTEM_TYPE type,
   [in, string] WCHAR* pwszLabel,
   [in] DWORD dwUnitAllocationSize,
   [in] long bForce,
   [in] long bQuickFormat,
   [in] long bEnableCompression,
   [out] IVdsAsync** ppAsync
 );

type: A file system type that is enumerated by VDS_FILE_SYSTEM_TYPE. Clients that format by using file systems that are not enumerated by VDS_FILE_SYSTEM_TYPE can use the IVdsVolumeMF2::FormatEx method.

pwszLabel: A null-terminated Unicode label to assign to the new file system. The maximum label size is file system-dependent.

dwUnitAllocationSize: The size, in bytes, of the allocation unit for the file system. The value MUST be a power of 2. The allocation unit range is file system-dependent.

bForce: A Boolean that determines whether the format is forced, even if the volume is in use.

bQuickFormat: A Boolean that determines whether a file system is quick format. A quick format does not verify each sector on the volume.

bEnableCompression: A Boolean that determines whether a file system is created with compression enabled.<127>

ppAsync: A pointer to an IVdsAsync interface that, if the operation is successfully completed, receives the IVdsAsync interface to monitor and control this operation. Callers MUST release the interface when they are done with it.

Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success, or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.

When the server receives this message, it MUST validate the following parameter:

The server MUST perform the following:

The server MUST perform the following. Errors generated in this sequence of steps are returned in the pHrResult parameter to the IVdsAsync::Wait or IVdsAsyncQueryStatus methods.

The server MUST update the percentage completed value periodically during the following sequence, and send progress notifications to all clients. How often the percentage completed is updated, and at what point in the sequence, is implementation specific. To send progress notifications to the clients:

The server MUST then perform the following in sequence. Errors generated in this sequence of steps are returned in the pHrResult parameter to the IVdsAsync::Wait or IVdsAsyncQueryStatus methods.