Export (0) Print
Expand All

IVdsAdvancedDisk::CreatePartition method

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

Creates a partition on a basic disk.

The IVdsCreatePartitionEx::CreatePartitionEx method supersedes this method.

Syntax


HRESULT CreatePartition(
  [in]   ULONGLONG ullOffset,
  [in]   ULONGLONG ullSize,
  [in]   CREATE_PARTITION_PARAMETERS *para,
  [out]  IVdsAsync **ppAsync
);

Parameters

ullOffset [in]

The partition offset.

ullSize [in]

The size, in bytes, of the new partition.

para [in]

The pointer to parameters defined by the CREATE_PARTITION_PARAMETERS structure.

ppAsync [out]

The address of an 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 partition was created successfully.

VDS_E_NO_MEDIA
0x80042412L

There is no media in a removable drive.

VDS_E_INVALID_OPERATION
0x80042415L

The media does not support this operation. For example, the caller cannot create a partition on a CD-ROM.

VDS_E_NOT_SUPPORTED
0x80042400L

Creating a second partition on removable media is not supported. Alternatively, this error indicates the disk is a dynamic disk.

VDS_E_PARTITION_LIMIT_REACHED
0x80042407L

The maximum number of partitions (four primary, or three primary and one extended) already exists when the caller tries to create an additional primary partition or extended partition.

VDS_S_UPDATE_BOOTFILE_FAILED
0x00042434L

The partition was created successfully, but VDS failed to update the boot options in the Boot Configuration Data (BCD) store.

Windows Server 2003:  Boot options are stored in the boot.ini file on an x86 or x64 system or NVRAM on an Itanium system.

 

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

IVdsCreatePartitionEx::CreatePartitionEx
IVdsAdvancedDisk
CREATE_PARTITION_PARAMETERS
IVdsAsync
Disk Object

 

 

Community Additions

ADD
Show:
© 2014 Microsoft